var gj=Object.defineProperty;var q1=e=>{throw TypeError(e)};var vj=(e,t,r)=>t in e?gj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var nd=(e,t,r)=>vj(e,typeof t!="symbol"?t+"":t,r),Ip=(e,t,r)=>t.has(e)||q1("Cannot "+r);var se=(e,t,r)=>(Ip(e,t,"read from private field"),r?r.call(e):t.get(e)),Ge=(e,t,r)=>t.has(e)?q1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ie=(e,t,r,n)=>(Ip(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pt=(e,t,r)=>(Ip(e,t,"access private method"),r);var ad=(e,t,r,n)=>({set _(a){Ie(e,t,a,r)},get _(){return se(e,t,n)}});function xj(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(n,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(a){if(a.ep)return;a.ep=!0;const s=r(a);fetch(a.href,s)}})();var Bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var FE={exports:{}},N0={},DE={exports:{}},ft={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Rf=Symbol.for("react.element"),yj=Symbol.for("react.portal"),wj=Symbol.for("react.fragment"),bj=Symbol.for("react.strict_mode"),_j=Symbol.for("react.profiler"),Ej=Symbol.for("react.provider"),Sj=Symbol.for("react.context"),Tj=Symbol.for("react.forward_ref"),kj=Symbol.for("react.suspense"),Nj=Symbol.for("react.memo"),Aj=Symbol.for("react.lazy"),W1=Symbol.iterator;function Cj(e){return e===null||typeof e!="object"?null:(e=W1&&e[W1]||e["@@iterator"],typeof e=="function"?e:null)}var ME={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LE=Object.assign,BE={};function mc(e,t,r){this.props=e,this.context=t,this.refs=BE,this.updater=r||ME}mc.prototype.isReactComponent={};mc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};mc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function UE(){}UE.prototype=mc.prototype;function gx(e,t,r){this.props=e,this.context=t,this.refs=BE,this.updater=r||ME}var vx=gx.prototype=new UE;vx.constructor=gx;LE(vx,mc.prototype);vx.isPureReactComponent=!0;var V1=Array.isArray,$E=Object.prototype.hasOwnProperty,xx={current:null},zE={key:!0,ref:!0,__self:!0,__source:!0};function HE(e,t,r){var n,a={},s=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)$E.call(t,n)&&!zE.hasOwnProperty(n)&&(a[n]=t[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(n in o=e.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:Rf,type:e,key:s,ref:i,props:a,_owner:xx.current}}function Pj(e,t){return{$$typeof:Rf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yx(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rf}function Oj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var G1=/\/+/g;function Fp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Oj(""+e.key):t.toString(36)}function Yd(e,t,r,n,a){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Rf:case yj:i=!0}}if(i)return i=e,a=a(i),e=n===""?"."+Fp(i,0):n,V1(a)?(r="",e!=null&&(r=e.replace(G1,"$&/")+"/"),Yd(a,t,r,"",function(u){return u})):a!=null&&(yx(a)&&(a=Pj(a,r+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(G1,"$&/")+"/")+e)),t.push(a)),1;if(i=0,n=n===""?".":n+":",V1(e))for(var o=0;o<e.length;o++){s=e[o];var l=n+Fp(s,o);i+=Yd(s,t,r,l,a)}else if(l=Cj(e),typeof l=="function")for(e=l.call(e),o=0;!(s=e.next()).done;)s=s.value,l=n+Fp(s,o++),i+=Yd(s,t,r,l,a);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function sd(e,t,r){if(e==null)return e;var n=[],a=0;return Yd(e,n,"","",function(s){return t.call(r,s,a++)}),n}function jj(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var vn={current:null},Xd={transition:null},Rj={ReactCurrentDispatcher:vn,ReactCurrentBatchConfig:Xd,ReactCurrentOwner:xx};function qE(){throw Error("act(...) is not supported in production builds of React.")}ft.Children={map:sd,forEach:function(e,t,r){sd(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return sd(e,function(){t++}),t},toArray:function(e){return sd(e,function(t){return t})||[]},only:function(e){if(!yx(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ft.Component=mc;ft.Fragment=wj;ft.Profiler=_j;ft.PureComponent=gx;ft.StrictMode=bj;ft.Suspense=kj;ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rj;ft.act=qE;ft.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=LE({},e.props),a=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=xx.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)$E.call(t,l)&&!zE.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&o!==void 0?o[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:Rf,type:e.type,key:a,ref:s,props:n,_owner:i}};ft.createContext=function(e){return e={$$typeof:Sj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ej,_context:e},e.Consumer=e};ft.createElement=HE;ft.createFactory=function(e){var t=HE.bind(null,e);return t.type=e,t};ft.createRef=function(){return{current:null}};ft.forwardRef=function(e){return{$$typeof:Tj,render:e}};ft.isValidElement=yx;ft.lazy=function(e){return{$$typeof:Aj,_payload:{_status:-1,_result:e},_init:jj}};ft.memo=function(e,t){return{$$typeof:Nj,type:e,compare:t===void 0?null:t}};ft.startTransition=function(e){var t=Xd.transition;Xd.transition={};try{e()}finally{Xd.transition=t}};ft.unstable_act=qE;ft.useCallback=function(e,t){return vn.current.useCallback(e,t)};ft.useContext=function(e){return vn.current.useContext(e)};ft.useDebugValue=function(){};ft.useDeferredValue=function(e){return vn.current.useDeferredValue(e)};ft.useEffect=function(e,t){return vn.current.useEffect(e,t)};ft.useId=function(){return vn.current.useId()};ft.useImperativeHandle=function(e,t,r){return vn.current.useImperativeHandle(e,t,r)};ft.useInsertionEffect=function(e,t){return vn.current.useInsertionEffect(e,t)};ft.useLayoutEffect=function(e,t){return vn.current.useLayoutEffect(e,t)};ft.useMemo=function(e,t){return vn.current.useMemo(e,t)};ft.useReducer=function(e,t,r){return vn.current.useReducer(e,t,r)};ft.useRef=function(e){return vn.current.useRef(e)};ft.useState=function(e){return vn.current.useState(e)};ft.useSyncExternalStore=function(e,t,r){return vn.current.useSyncExternalStore(e,t,r)};ft.useTransition=function(){return vn.current.useTransition()};ft.version="18.3.1";DE.exports=ft;var S=DE.exports;const Ce=mx(S),A0=xj({__proto__:null,default:Ce},[S]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ij=S,Fj=Symbol.for("react.element"),Dj=Symbol.for("react.fragment"),Mj=Object.prototype.hasOwnProperty,Lj=Ij.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bj={key:!0,ref:!0,__self:!0,__source:!0};function WE(e,t,r){var n,a={},s=null,i=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)Mj.call(t,n)&&!Bj.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:Fj,type:e,key:s,ref:i,props:a,_owner:Lj.current}}N0.Fragment=Dj;N0.jsx=WE;N0.jsxs=WE;FE.exports=N0;var c=FE.exports,VE={exports:{}},Wn={},GE={exports:{}},KE={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(Q,R){var z=Q.length;Q.push(R);e:for(;0<z;){var D=z-1>>>1,O=Q[D];if(0<a(O,R))Q[D]=R,Q[z]=O,z=D;else break e}}function r(Q){return Q.length===0?null:Q[0]}function n(Q){if(Q.length===0)return null;var R=Q[0],z=Q.pop();if(z!==R){Q[0]=z;e:for(var D=0,O=Q.length,j=O>>>1;D<j;){var B=2*(D+1)-1,L=Q[B],F=B+1,H=Q[F];if(0>a(L,z))F<O&&0>a(H,L)?(Q[D]=H,Q[F]=z,D=F):(Q[D]=L,Q[B]=z,D=B);else if(F<O&&0>a(H,z))Q[D]=H,Q[F]=z,D=F;else break e}}return R}function a(Q,R){var z=Q.sortIndex-R.sortIndex;return z!==0?z:Q.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var l=[],u=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(Q){for(var R=r(u);R!==null;){if(R.callback===null)n(u);else if(R.startTime<=Q)n(u),R.sortIndex=R.expirationTime,t(l,R);else break;R=r(u)}}function b(Q){if(m=!1,w(Q),!v)if(r(l)!==null)v=!0,W(_);else{var R=r(u);R!==null&&G(b,R.startTime-Q)}}function _(Q,R){v=!1,m&&(m=!1,x(C),C=-1),p=!0;var z=h;try{for(w(R),d=r(l);d!==null&&(!(d.expirationTime>R)||Q&&!k());){var D=d.callback;if(typeof D=="function"){d.callback=null,h=d.priorityLevel;var O=D(d.expirationTime<=R);R=e.unstable_now(),typeof O=="function"?d.callback=O:d===r(l)&&n(l),w(R)}else n(l);d=r(l)}if(d!==null)var j=!0;else{var B=r(u);B!==null&&G(b,B.startTime-R),j=!1}return j}finally{d=null,h=z,p=!1}}var T=!1,E=null,C=-1,P=5,N=-1;function k(){return!(e.unstable_now()-N<P)}function A(){if(E!==null){var Q=e.unstable_now();N=Q;var R=!0;try{R=E(!0,Q)}finally{R?I():(T=!1,E=null)}}else T=!1}var I;if(typeof y=="function")I=function(){y(A)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,U=M.port2;M.port1.onmessage=A,I=function(){U.postMessage(null)}}else I=function(){g(A,0)};function W(Q){E=Q,T||(T=!0,I())}function G(Q,R){C=g(function(){Q(e.unstable_now())},R)}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(Q){Q.callback=null},e.unstable_continueExecution=function(){v||p||(v=!0,W(_))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(Q){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var z=h;h=R;try{return Q()}finally{h=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,R){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var z=h;h=Q;try{return R()}finally{h=z}},e.unstable_scheduleCallback=function(Q,R,z){var D=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?D+z:D):z=D,Q){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,Q={id:f++,callback:R,priorityLevel:Q,startTime:z,expirationTime:O,sortIndex:-1},z>D?(Q.sortIndex=z,t(u,Q),r(l)===null&&Q===r(u)&&(m?(x(C),C=-1):m=!0,G(b,z-D))):(Q.sortIndex=O,t(l,Q),v||p||(v=!0,W(_))),Q},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(Q){var R=h;return function(){var z=h;h=R;try{return Q.apply(this,arguments)}finally{h=z}}}})(KE);GE.exports=KE;var Uj=GE.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $j=S,Hn=Uj;function ke(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var YE=new Set,Uu={};function Lo(e,t){ac(e,t),ac(e+"Capture",t)}function ac(e,t){for(Uu[e]=t,e=0;e<t.length;e++)YE.add(t[e])}var ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ig=Object.prototype.hasOwnProperty,zj=/^[: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]*$/,K1={},Y1={};function Hj(e){return ig.call(Y1,e)?!0:ig.call(K1,e)?!1:zj.test(e)?Y1[e]=!0:(K1[e]=!0,!1)}function qj(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Wj(e,t,r,n){if(t===null||typeof t>"u"||qj(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function xn(e,t,r,n,a,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Br={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Br[e]=new xn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Br[t]=new xn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Br[e]=new xn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Br[e]=new xn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Br[e]=new xn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Br[e]=new xn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Br[e]=new xn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Br[e]=new xn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Br[e]=new xn(e,5,!1,e.toLowerCase(),null,!1,!1)});var wx=/[\-:]([a-z])/g;function bx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wx,bx);Br[t]=new xn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wx,bx);Br[t]=new xn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wx,bx);Br[t]=new xn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Br[e]=new xn(e,1,!1,e.toLowerCase(),null,!1,!1)});Br.xlinkHref=new xn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Br[e]=new xn(e,1,!1,e.toLowerCase(),null,!0,!0)});function _x(e,t,r,n){var a=Br.hasOwnProperty(t)?Br[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Wj(t,r,a,n)&&(r=null),n||a===null?Hj(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Rs=$j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,id=Symbol.for("react.element"),hl=Symbol.for("react.portal"),pl=Symbol.for("react.fragment"),Ex=Symbol.for("react.strict_mode"),og=Symbol.for("react.profiler"),XE=Symbol.for("react.provider"),JE=Symbol.for("react.context"),Sx=Symbol.for("react.forward_ref"),lg=Symbol.for("react.suspense"),cg=Symbol.for("react.suspense_list"),Tx=Symbol.for("react.memo"),Xs=Symbol.for("react.lazy"),QE=Symbol.for("react.offscreen"),X1=Symbol.iterator;function Dc(e){return e===null||typeof e!="object"?null:(e=X1&&e[X1]||e["@@iterator"],typeof e=="function"?e:null)}var Kt=Object.assign,Dp;function tu(e){if(Dp===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Dp=t&&t[1]||""}return`
`+Dp+e}var Mp=!1;function Lp(e,t){if(!e||Mp)return"";Mp=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
`),s=n.stack.split(`
`),i=a.length-1,o=s.length-1;1<=i&&0<=o&&a[i]!==s[o];)o--;for(;1<=i&&0<=o;i--,o--)if(a[i]!==s[o]){if(i!==1||o!==1)do if(i--,o--,0>o||a[i]!==s[o]){var l=`
`+a[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=o);break}}}finally{Mp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?tu(e):""}function Vj(e){switch(e.tag){case 5:return tu(e.type);case 16:return tu("Lazy");case 13:return tu("Suspense");case 19:return tu("SuspenseList");case 0:case 2:case 15:return e=Lp(e.type,!1),e;case 11:return e=Lp(e.type.render,!1),e;case 1:return e=Lp(e.type,!0),e;default:return""}}function ug(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pl:return"Fragment";case hl:return"Portal";case og:return"Profiler";case Ex:return"StrictMode";case lg:return"Suspense";case cg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case JE:return(e.displayName||"Context")+".Consumer";case XE:return(e._context.displayName||"Context")+".Provider";case Sx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Tx:return t=e.displayName||null,t!==null?t:ug(e.type)||"Memo";case Xs:t=e._payload,e=e._init;try{return ug(e(t))}catch{}}return null}function Gj(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ug(t);case 8:return t===Ex?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ZE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Kj(e){var t=ZE(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(i){n=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function od(e){e._valueTracker||(e._valueTracker=Kj(e))}function eS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=ZE(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Sh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fg(e,t){var r=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function J1(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Pi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function tS(e,t){t=t.checked,t!=null&&_x(e,"checked",t,!1)}function dg(e,t){tS(e,t);var r=Pi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hg(e,t.type,r):t.hasOwnProperty("defaultValue")&&hg(e,t.type,Pi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q1(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function hg(e,t,r){(t!=="number"||Sh(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ru=Array.isArray;function Ol(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Pi(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function pg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ke(91));return Kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Z1(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ke(92));if(ru(r)){if(1<r.length)throw Error(ke(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Pi(r)}}function rS(e,t){var r=Pi(t.value),n=Pi(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function ew(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ld,aS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ld=ld||document.createElement("div"),ld.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ld.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $u(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var vu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yj=["Webkit","ms","Moz","O"];Object.keys(vu).forEach(function(e){Yj.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vu[t]=vu[e]})});function sS(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||vu.hasOwnProperty(e)&&vu[e]?(""+t).trim():t+"px"}function iS(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=sS(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var Xj=Kt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gg(e,t){if(t){if(Xj[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ke(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ke(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ke(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ke(62))}}function vg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xg=null;function kx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yg=null,jl=null,Rl=null;function tw(e){if(e=Df(e)){if(typeof yg!="function")throw Error(ke(280));var t=e.stateNode;t&&(t=R0(t),yg(e.stateNode,e.type,t))}}function oS(e){jl?Rl?Rl.push(e):Rl=[e]:jl=e}function lS(){if(jl){var e=jl,t=Rl;if(Rl=jl=null,tw(e),t)for(e=0;e<t.length;e++)tw(t[e])}}function cS(e,t){return e(t)}function uS(){}var Bp=!1;function fS(e,t,r){if(Bp)return e(t,r);Bp=!0;try{return cS(e,t,r)}finally{Bp=!1,(jl!==null||Rl!==null)&&(uS(),lS())}}function zu(e,t){var r=e.stateNode;if(r===null)return null;var n=R0(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ke(231,t,typeof r));return r}var wg=!1;if(ks)try{var Mc={};Object.defineProperty(Mc,"passive",{get:function(){wg=!0}}),window.addEventListener("test",Mc,Mc),window.removeEventListener("test",Mc,Mc)}catch{wg=!1}function Jj(e,t,r,n,a,s,i,o,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(f){this.onError(f)}}var xu=!1,Th=null,kh=!1,bg=null,Qj={onError:function(e){xu=!0,Th=e}};function Zj(e,t,r,n,a,s,i,o,l){xu=!1,Th=null,Jj.apply(Qj,arguments)}function eR(e,t,r,n,a,s,i,o,l){if(Zj.apply(this,arguments),xu){if(xu){var u=Th;xu=!1,Th=null}else throw Error(ke(198));kh||(kh=!0,bg=u)}}function Bo(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function dS(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rw(e){if(Bo(e)!==e)throw Error(ke(188))}function tR(e){var t=e.alternate;if(!t){if(t=Bo(e),t===null)throw Error(ke(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var s=a.alternate;if(s===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===r)return rw(a),e;if(s===n)return rw(a),t;s=s.sibling}throw Error(ke(188))}if(r.return!==n.return)r=a,n=s;else{for(var i=!1,o=a.child;o;){if(o===r){i=!0,r=a,n=s;break}if(o===n){i=!0,n=a,r=s;break}o=o.sibling}if(!i){for(o=s.child;o;){if(o===r){i=!0,r=s,n=a;break}if(o===n){i=!0,n=s,r=a;break}o=o.sibling}if(!i)throw Error(ke(189))}}if(r.alternate!==n)throw Error(ke(190))}if(r.tag!==3)throw Error(ke(188));return r.stateNode.current===r?e:t}function hS(e){return e=tR(e),e!==null?pS(e):null}function pS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=pS(e);if(t!==null)return t;e=e.sibling}return null}var mS=Hn.unstable_scheduleCallback,nw=Hn.unstable_cancelCallback,rR=Hn.unstable_shouldYield,nR=Hn.unstable_requestPaint,tr=Hn.unstable_now,aR=Hn.unstable_getCurrentPriorityLevel,Nx=Hn.unstable_ImmediatePriority,gS=Hn.unstable_UserBlockingPriority,Nh=Hn.unstable_NormalPriority,sR=Hn.unstable_LowPriority,vS=Hn.unstable_IdlePriority,C0=null,Za=null;function iR(e){if(Za&&typeof Za.onCommitFiberRoot=="function")try{Za.onCommitFiberRoot(C0,e,void 0,(e.current.flags&128)===128)}catch{}}var Ca=Math.clz32?Math.clz32:cR,oR=Math.log,lR=Math.LN2;function cR(e){return e>>>=0,e===0?32:31-(oR(e)/lR|0)|0}var cd=64,ud=4194304;function nu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ah(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,s=e.pingedLanes,i=r&268435455;if(i!==0){var o=i&~a;o!==0?n=nu(o):(s&=i,s!==0&&(n=nu(s)))}else i=r&~a,i!==0?n=nu(i):s!==0&&(n=nu(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,s=t&-t,a>=s||a===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Ca(t),a=1<<r,n|=e[r],t&=~a;return n}function uR(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fR(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-Ca(s),o=1<<i,l=a[i];l===-1?(!(o&r)||o&n)&&(a[i]=uR(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}function _g(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xS(){var e=cd;return cd<<=1,!(cd&4194240)&&(cd=64),e}function Up(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function If(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ca(t),e[t]=r}function dR(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-Ca(r),s=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~s}}function Ax(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Ca(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var Pt=0;function yS(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var wS,Cx,bS,_S,ES,Eg=!1,fd=[],xi=null,yi=null,wi=null,Hu=new Map,qu=new Map,ei=[],hR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function aw(e,t){switch(e){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":yi=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Hu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qu.delete(t.pointerId)}}function Lc(e,t,r,n,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[a]},t!==null&&(t=Df(t),t!==null&&Cx(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function pR(e,t,r,n,a){switch(t){case"focusin":return xi=Lc(xi,e,t,r,n,a),!0;case"dragenter":return yi=Lc(yi,e,t,r,n,a),!0;case"mouseover":return wi=Lc(wi,e,t,r,n,a),!0;case"pointerover":var s=a.pointerId;return Hu.set(s,Lc(Hu.get(s)||null,e,t,r,n,a)),!0;case"gotpointercapture":return s=a.pointerId,qu.set(s,Lc(qu.get(s)||null,e,t,r,n,a)),!0}return!1}function SS(e){var t=no(e.target);if(t!==null){var r=Bo(t);if(r!==null){if(t=r.tag,t===13){if(t=dS(r),t!==null){e.blockedOn=t,ES(e.priority,function(){bS(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Jd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Sg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);xg=n,r.target.dispatchEvent(n),xg=null}else return t=Df(r),t!==null&&Cx(t),e.blockedOn=r,!1;t.shift()}return!0}function sw(e,t,r){Jd(e)&&r.delete(t)}function mR(){Eg=!1,xi!==null&&Jd(xi)&&(xi=null),yi!==null&&Jd(yi)&&(yi=null),wi!==null&&Jd(wi)&&(wi=null),Hu.forEach(sw),qu.forEach(sw)}function Bc(e,t){e.blockedOn===t&&(e.blockedOn=null,Eg||(Eg=!0,Hn.unstable_scheduleCallback(Hn.unstable_NormalPriority,mR)))}function Wu(e){function t(a){return Bc(a,e)}if(0<fd.length){Bc(fd[0],e);for(var r=1;r<fd.length;r++){var n=fd[r];n.blockedOn===e&&(n.blockedOn=null)}}for(xi!==null&&Bc(xi,e),yi!==null&&Bc(yi,e),wi!==null&&Bc(wi,e),Hu.forEach(t),qu.forEach(t),r=0;r<ei.length;r++)n=ei[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ei.length&&(r=ei[0],r.blockedOn===null);)SS(r),r.blockedOn===null&&ei.shift()}var Il=Rs.ReactCurrentBatchConfig,Ch=!0;function gR(e,t,r,n){var a=Pt,s=Il.transition;Il.transition=null;try{Pt=1,Px(e,t,r,n)}finally{Pt=a,Il.transition=s}}function vR(e,t,r,n){var a=Pt,s=Il.transition;Il.transition=null;try{Pt=4,Px(e,t,r,n)}finally{Pt=a,Il.transition=s}}function Px(e,t,r,n){if(Ch){var a=Sg(e,t,r,n);if(a===null)Xp(e,t,n,Ph,r),aw(e,n);else if(pR(a,e,t,r,n))n.stopPropagation();else if(aw(e,n),t&4&&-1<hR.indexOf(e)){for(;a!==null;){var s=Df(a);if(s!==null&&wS(s),s=Sg(e,t,r,n),s===null&&Xp(e,t,n,Ph,r),s===a)break;a=s}a!==null&&n.stopPropagation()}else Xp(e,t,n,null,r)}}var Ph=null;function Sg(e,t,r,n){if(Ph=null,e=kx(n),e=no(e),e!==null)if(t=Bo(e),t===null)e=null;else if(r=t.tag,r===13){if(e=dS(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ph=e,null}function TS(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(aR()){case Nx:return 1;case gS:return 4;case Nh:case sR:return 16;case vS:return 536870912;default:return 16}default:return 16}}var hi=null,Ox=null,Qd=null;function kS(){if(Qd)return Qd;var e,t=Ox,r=t.length,n,a="value"in hi?hi.value:hi.textContent,s=a.length;for(e=0;e<r&&t[e]===a[e];e++);var i=r-e;for(n=1;n<=i&&t[r-n]===a[s-n];n++);return Qd=a.slice(e,1<n?1-n:void 0)}function Zd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dd(){return!0}function iw(){return!1}function Vn(e){function t(r,n,a,s,i){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?dd:iw,this.isPropagationStopped=iw,this}return Kt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=dd)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=dd)},persist:function(){},isPersistent:dd}),t}var gc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jx=Vn(gc),Ff=Kt({},gc,{view:0,detail:0}),xR=Vn(Ff),$p,zp,Uc,P0=Kt({},Ff,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rx,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Uc&&(Uc&&e.type==="mousemove"?($p=e.screenX-Uc.screenX,zp=e.screenY-Uc.screenY):zp=$p=0,Uc=e),$p)},movementY:function(e){return"movementY"in e?e.movementY:zp}}),ow=Vn(P0),yR=Kt({},P0,{dataTransfer:0}),wR=Vn(yR),bR=Kt({},Ff,{relatedTarget:0}),Hp=Vn(bR),_R=Kt({},gc,{animationName:0,elapsedTime:0,pseudoElement:0}),ER=Vn(_R),SR=Kt({},gc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),TR=Vn(SR),kR=Kt({},gc,{data:0}),lw=Vn(kR),NR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AR={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"},CR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PR(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=CR[e])?!!t[e]:!1}function Rx(){return PR}var OR=Kt({},Ff,{key:function(e){if(e.key){var t=NR[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?AR[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rx,charCode:function(e){return e.type==="keypress"?Zd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jR=Vn(OR),RR=Kt({},P0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cw=Vn(RR),IR=Kt({},Ff,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rx}),FR=Vn(IR),DR=Kt({},gc,{propertyName:0,elapsedTime:0,pseudoElement:0}),MR=Vn(DR),LR=Kt({},P0,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),BR=Vn(LR),UR=[9,13,27,32],Ix=ks&&"CompositionEvent"in window,yu=null;ks&&"documentMode"in document&&(yu=document.documentMode);var $R=ks&&"TextEvent"in window&&!yu,NS=ks&&(!Ix||yu&&8<yu&&11>=yu),uw=" ",fw=!1;function AS(e,t){switch(e){case"keyup":return UR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function CS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ml=!1;function zR(e,t){switch(e){case"compositionend":return CS(t);case"keypress":return t.which!==32?null:(fw=!0,uw);case"textInput":return e=t.data,e===uw&&fw?null:e;default:return null}}function HR(e,t){if(ml)return e==="compositionend"||!Ix&&AS(e,t)?(e=kS(),Qd=Ox=hi=null,ml=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return NS&&t.locale!=="ko"?null:t.data;default:return null}}var qR={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 dw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qR[e.type]:t==="textarea"}function PS(e,t,r,n){oS(n),t=Oh(t,"onChange"),0<t.length&&(r=new jx("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var wu=null,Vu=null;function WR(e){$S(e,0)}function O0(e){var t=xl(e);if(eS(t))return e}function VR(e,t){if(e==="change")return t}var OS=!1;if(ks){var qp;if(ks){var Wp="oninput"in document;if(!Wp){var hw=document.createElement("div");hw.setAttribute("oninput","return;"),Wp=typeof hw.oninput=="function"}qp=Wp}else qp=!1;OS=qp&&(!document.documentMode||9<document.documentMode)}function pw(){wu&&(wu.detachEvent("onpropertychange",jS),Vu=wu=null)}function jS(e){if(e.propertyName==="value"&&O0(Vu)){var t=[];PS(t,Vu,e,kx(e)),fS(WR,t)}}function GR(e,t,r){e==="focusin"?(pw(),wu=t,Vu=r,wu.attachEvent("onpropertychange",jS)):e==="focusout"&&pw()}function KR(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return O0(Vu)}function YR(e,t){if(e==="click")return O0(t)}function XR(e,t){if(e==="input"||e==="change")return O0(t)}function JR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ra=typeof Object.is=="function"?Object.is:JR;function Gu(e,t){if(Ra(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!ig.call(t,a)||!Ra(e[a],t[a]))return!1}return!0}function mw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gw(e,t){var r=mw(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=mw(r)}}function RS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function IS(){for(var e=window,t=Sh();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Sh(e.document)}return t}function Fx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function QR(e){var t=IS(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&RS(r.ownerDocument.documentElement,r)){if(n!==null&&Fx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,s=Math.min(n.start,a);n=n.end===void 0?s:Math.min(n.end,a),!e.extend&&s>n&&(a=n,n=s,s=a),a=gw(r,s);var i=gw(r,n);a&&i&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ZR=ks&&"documentMode"in document&&11>=document.documentMode,gl=null,Tg=null,bu=null,kg=!1;function vw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kg||gl==null||gl!==Sh(n)||(n=gl,"selectionStart"in n&&Fx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),bu&&Gu(bu,n)||(bu=n,n=Oh(Tg,"onSelect"),0<n.length&&(t=new jx("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=gl)))}function hd(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var vl={animationend:hd("Animation","AnimationEnd"),animationiteration:hd("Animation","AnimationIteration"),animationstart:hd("Animation","AnimationStart"),transitionend:hd("Transition","TransitionEnd")},Vp={},FS={};ks&&(FS=document.createElement("div").style,"AnimationEvent"in window||(delete vl.animationend.animation,delete vl.animationiteration.animation,delete vl.animationstart.animation),"TransitionEvent"in window||delete vl.transitionend.transition);function j0(e){if(Vp[e])return Vp[e];if(!vl[e])return e;var t=vl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in FS)return Vp[e]=t[r];return e}var DS=j0("animationend"),MS=j0("animationiteration"),LS=j0("animationstart"),BS=j0("transitionend"),US=new Map,xw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Li(e,t){US.set(e,t),Lo(t,[e])}for(var Gp=0;Gp<xw.length;Gp++){var Kp=xw[Gp],e3=Kp.toLowerCase(),t3=Kp[0].toUpperCase()+Kp.slice(1);Li(e3,"on"+t3)}Li(DS,"onAnimationEnd");Li(MS,"onAnimationIteration");Li(LS,"onAnimationStart");Li("dblclick","onDoubleClick");Li("focusin","onFocus");Li("focusout","onBlur");Li(BS,"onTransitionEnd");ac("onMouseEnter",["mouseout","mouseover"]);ac("onMouseLeave",["mouseout","mouseover"]);ac("onPointerEnter",["pointerout","pointerover"]);ac("onPointerLeave",["pointerout","pointerover"]);Lo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Lo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Lo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Lo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Lo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Lo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var au="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(" "),r3=new Set("cancel close invalid load scroll toggle".split(" ").concat(au));function yw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,eR(n,t,void 0,e),e.currentTarget=null}function $S(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var i=n.length-1;0<=i;i--){var o=n[i],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==s&&a.isPropagationStopped())break e;yw(a,o,u),s=l}else for(i=0;i<n.length;i++){if(o=n[i],l=o.instance,u=o.currentTarget,o=o.listener,l!==s&&a.isPropagationStopped())break e;yw(a,o,u),s=l}}}if(kh)throw e=bg,kh=!1,bg=null,e}function Lt(e,t){var r=t[Og];r===void 0&&(r=t[Og]=new Set);var n=e+"__bubble";r.has(n)||(zS(t,e,2,!1),r.add(n))}function Yp(e,t,r){var n=0;t&&(n|=4),zS(r,e,n,t)}var pd="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[pd]){e[pd]=!0,YE.forEach(function(r){r!=="selectionchange"&&(r3.has(r)||Yp(r,!1,e),Yp(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pd]||(t[pd]=!0,Yp("selectionchange",!1,t))}}function zS(e,t,r,n){switch(TS(t)){case 1:var a=gR;break;case 4:a=vR;break;default:a=Px}r=a.bind(null,t,r,e),a=void 0,!wg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function Xp(e,t,r,n,a){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var o=n.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===a||l.nodeType===8&&l.parentNode===a))return;i=i.return}for(;o!==null;){if(i=no(o),i===null)return;if(l=i.tag,l===5||l===6){n=s=i;continue e}o=o.parentNode}}n=n.return}fS(function(){var u=s,f=kx(r),d=[];e:{var h=US.get(e);if(h!==void 0){var p=jx,v=e;switch(e){case"keypress":if(Zd(r)===0)break e;case"keydown":case"keyup":p=jR;break;case"focusin":v="focus",p=Hp;break;case"focusout":v="blur",p=Hp;break;case"beforeblur":case"afterblur":p=Hp;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=ow;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=wR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=FR;break;case DS:case MS:case LS:p=ER;break;case BS:p=MR;break;case"scroll":p=xR;break;case"wheel":p=BR;break;case"copy":case"cut":case"paste":p=TR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=cw}var m=(t&4)!==0,g=!m&&e==="scroll",x=m?h!==null?h+"Capture":null:h;m=[];for(var y=u,w;y!==null;){w=y;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,x!==null&&(b=zu(y,x),b!=null&&m.push(Yu(y,b,w)))),g)break;y=y.return}0<m.length&&(h=new p(h,v,null,r,f),d.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==xg&&(v=r.relatedTarget||r.fromElement)&&(no(v)||v[Ns]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(v=r.relatedTarget||r.toElement,p=u,v=v?no(v):null,v!==null&&(g=Bo(v),v!==g||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=u),p!==v)){if(m=ow,b="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=cw,b="onPointerLeave",x="onPointerEnter",y="pointer"),g=p==null?h:xl(p),w=v==null?h:xl(v),h=new m(b,y+"leave",p,r,f),h.target=g,h.relatedTarget=w,b=null,no(f)===u&&(m=new m(x,y+"enter",v,r,f),m.target=w,m.relatedTarget=g,b=m),g=b,p&&v)t:{for(m=p,x=v,y=0,w=m;w;w=Yo(w))y++;for(w=0,b=x;b;b=Yo(b))w++;for(;0<y-w;)m=Yo(m),y--;for(;0<w-y;)x=Yo(x),w--;for(;y--;){if(m===x||x!==null&&m===x.alternate)break t;m=Yo(m),x=Yo(x)}m=null}else m=null;p!==null&&ww(d,h,p,m,!1),v!==null&&g!==null&&ww(d,g,v,m,!0)}}e:{if(h=u?xl(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=VR;else if(dw(h))if(OS)_=XR;else{_=KR;var T=GR}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=YR);if(_&&(_=_(e,u))){PS(d,_,r,f);break e}T&&T(e,h,u),e==="focusout"&&(T=h._wrapperState)&&T.controlled&&h.type==="number"&&hg(h,"number",h.value)}switch(T=u?xl(u):window,e){case"focusin":(dw(T)||T.contentEditable==="true")&&(gl=T,Tg=u,bu=null);break;case"focusout":bu=Tg=gl=null;break;case"mousedown":kg=!0;break;case"contextmenu":case"mouseup":case"dragend":kg=!1,vw(d,r,f);break;case"selectionchange":if(ZR)break;case"keydown":case"keyup":vw(d,r,f)}var E;if(Ix)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else ml?AS(e,r)&&(C="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(C="onCompositionStart");C&&(NS&&r.locale!=="ko"&&(ml||C!=="onCompositionStart"?C==="onCompositionEnd"&&ml&&(E=kS()):(hi=f,Ox="value"in hi?hi.value:hi.textContent,ml=!0)),T=Oh(u,C),0<T.length&&(C=new lw(C,e,null,r,f),d.push({event:C,listeners:T}),E?C.data=E:(E=CS(r),E!==null&&(C.data=E)))),(E=$R?zR(e,r):HR(e,r))&&(u=Oh(u,"onBeforeInput"),0<u.length&&(f=new lw("onBeforeInput","beforeinput",null,r,f),d.push({event:f,listeners:u}),f.data=E))}$S(d,t)})}function Yu(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Oh(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,s=a.stateNode;a.tag===5&&s!==null&&(a=s,s=zu(e,r),s!=null&&n.unshift(Yu(e,s,a)),s=zu(e,t),s!=null&&n.push(Yu(e,s,a))),e=e.return}return n}function Yo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ww(e,t,r,n,a){for(var s=t._reactName,i=[];r!==null&&r!==n;){var o=r,l=o.alternate,u=o.stateNode;if(l!==null&&l===n)break;o.tag===5&&u!==null&&(o=u,a?(l=zu(r,s),l!=null&&i.unshift(Yu(r,l,o))):a||(l=zu(r,s),l!=null&&i.push(Yu(r,l,o)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var n3=/\r\n?/g,a3=/\u0000|\uFFFD/g;function bw(e){return(typeof e=="string"?e:""+e).replace(n3,`
`).replace(a3,"")}function md(e,t,r){if(t=bw(t),bw(e)!==t&&r)throw Error(ke(425))}function jh(){}var Ng=null,Ag=null;function Cg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pg=typeof setTimeout=="function"?setTimeout:void 0,s3=typeof clearTimeout=="function"?clearTimeout:void 0,_w=typeof Promise=="function"?Promise:void 0,i3=typeof queueMicrotask=="function"?queueMicrotask:typeof _w<"u"?function(e){return _w.resolve(null).then(e).catch(o3)}:Pg;function o3(e){setTimeout(function(){throw e})}function Jp(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),Wu(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);Wu(t)}function bi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ew(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var vc=Math.random().toString(36).slice(2),Xa="__reactFiber$"+vc,Xu="__reactProps$"+vc,Ns="__reactContainer$"+vc,Og="__reactEvents$"+vc,l3="__reactListeners$"+vc,c3="__reactHandles$"+vc;function no(e){var t=e[Xa];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ns]||r[Xa]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ew(e);e!==null;){if(r=e[Xa])return r;e=Ew(e)}return t}e=r,r=e.parentNode}return null}function Df(e){return e=e[Xa]||e[Ns],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ke(33))}function R0(e){return e[Xu]||null}var jg=[],yl=-1;function Bi(e){return{current:e}}function Ut(e){0>yl||(e.current=jg[yl],jg[yl]=null,yl--)}function Ft(e,t){yl++,jg[yl]=e.current,e.current=t}var Oi={},Xr=Bi(Oi),An=Bi(!1),To=Oi;function sc(e,t){var r=e.type.contextTypes;if(!r)return Oi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},s;for(s in r)a[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Cn(e){return e=e.childContextTypes,e!=null}function Rh(){Ut(An),Ut(Xr)}function Sw(e,t,r){if(Xr.current!==Oi)throw Error(ke(168));Ft(Xr,t),Ft(An,r)}function HS(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(ke(108,Gj(e)||"Unknown",a));return Kt({},r,n)}function Ih(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,To=Xr.current,Ft(Xr,e),Ft(An,An.current),!0}function Tw(e,t,r){var n=e.stateNode;if(!n)throw Error(ke(169));r?(e=HS(e,t,To),n.__reactInternalMemoizedMergedChildContext=e,Ut(An),Ut(Xr),Ft(Xr,e)):Ut(An),Ft(An,r)}var ps=null,I0=!1,Qp=!1;function qS(e){ps===null?ps=[e]:ps.push(e)}function u3(e){I0=!0,qS(e)}function Ui(){if(!Qp&&ps!==null){Qp=!0;var e=0,t=Pt;try{var r=ps;for(Pt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ps=null,I0=!1}catch(a){throw ps!==null&&(ps=ps.slice(e+1)),mS(Nx,Ui),a}finally{Pt=t,Qp=!1}}return null}var wl=[],bl=0,Fh=null,Dh=0,ea=[],ta=0,ko=null,xs=1,ys="";function Xi(e,t){wl[bl++]=Dh,wl[bl++]=Fh,Fh=e,Dh=t}function WS(e,t,r){ea[ta++]=xs,ea[ta++]=ys,ea[ta++]=ko,ko=e;var n=xs;e=ys;var a=32-Ca(n)-1;n&=~(1<<a),r+=1;var s=32-Ca(t)+a;if(30<s){var i=a-a%5;s=(n&(1<<i)-1).toString(32),n>>=i,a-=i,xs=1<<32-Ca(t)+a|r<<a|n,ys=s+e}else xs=1<<s|r<<a|n,ys=e}function Dx(e){e.return!==null&&(Xi(e,1),WS(e,1,0))}function Mx(e){for(;e===Fh;)Fh=wl[--bl],wl[bl]=null,Dh=wl[--bl],wl[bl]=null;for(;e===ko;)ko=ea[--ta],ea[ta]=null,ys=ea[--ta],ea[ta]=null,xs=ea[--ta],ea[ta]=null}var $n=null,Un=null,zt=!1,Ta=null;function VS(e,t){var r=na(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function kw(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,$n=e,Un=bi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,$n=e,Un=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ko!==null?{id:xs,overflow:ys}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=na(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,$n=e,Un=null,!0):!1;default:return!1}}function Rg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ig(e){if(zt){var t=Un;if(t){var r=t;if(!kw(e,t)){if(Rg(e))throw Error(ke(418));t=bi(r.nextSibling);var n=$n;t&&kw(e,t)?VS(n,r):(e.flags=e.flags&-4097|2,zt=!1,$n=e)}}else{if(Rg(e))throw Error(ke(418));e.flags=e.flags&-4097|2,zt=!1,$n=e}}}function Nw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$n=e}function gd(e){if(e!==$n)return!1;if(!zt)return Nw(e),zt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Cg(e.type,e.memoizedProps)),t&&(t=Un)){if(Rg(e))throw GS(),Error(ke(418));for(;t;)VS(e,t),t=bi(t.nextSibling)}if(Nw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ke(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Un=bi(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Un=null}}else Un=$n?bi(e.stateNode.nextSibling):null;return!0}function GS(){for(var e=Un;e;)e=bi(e.nextSibling)}function ic(){Un=$n=null,zt=!1}function Lx(e){Ta===null?Ta=[e]:Ta.push(e)}var f3=Rs.ReactCurrentBatchConfig;function $c(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ke(309));var n=r.stateNode}if(!n)throw Error(ke(147,e));var a=n,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var o=a.refs;i===null?delete o[s]:o[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(ke(284));if(!r._owner)throw Error(ke(290,e))}return e}function vd(e,t){throw e=Object.prototype.toString.call(t),Error(ke(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Aw(e){var t=e._init;return t(e._payload)}function KS(e){function t(x,y){if(e){var w=x.deletions;w===null?(x.deletions=[y],x.flags|=16):w.push(y)}}function r(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function n(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function a(x,y){return x=Ti(x,y),x.index=0,x.sibling=null,x}function s(x,y,w){return x.index=w,e?(w=x.alternate,w!==null?(w=w.index,w<y?(x.flags|=2,y):w):(x.flags|=2,y)):(x.flags|=1048576,y)}function i(x){return e&&x.alternate===null&&(x.flags|=2),x}function o(x,y,w,b){return y===null||y.tag!==6?(y=sm(w,x.mode,b),y.return=x,y):(y=a(y,w),y.return=x,y)}function l(x,y,w,b){var _=w.type;return _===pl?f(x,y,w.props.children,b,w.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Xs&&Aw(_)===y.type)?(b=a(y,w.props),b.ref=$c(x,y,w),b.return=x,b):(b=ih(w.type,w.key,w.props,null,x.mode,b),b.ref=$c(x,y,w),b.return=x,b)}function u(x,y,w,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=im(w,x.mode,b),y.return=x,y):(y=a(y,w.children||[]),y.return=x,y)}function f(x,y,w,b,_){return y===null||y.tag!==7?(y=wo(w,x.mode,b,_),y.return=x,y):(y=a(y,w),y.return=x,y)}function d(x,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return y=sm(""+y,x.mode,w),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case id:return w=ih(y.type,y.key,y.props,null,x.mode,w),w.ref=$c(x,null,y),w.return=x,w;case hl:return y=im(y,x.mode,w),y.return=x,y;case Xs:var b=y._init;return d(x,b(y._payload),w)}if(ru(y)||Dc(y))return y=wo(y,x.mode,w,null),y.return=x,y;vd(x,y)}return null}function h(x,y,w,b){var _=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:o(x,y,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case id:return w.key===_?l(x,y,w,b):null;case hl:return w.key===_?u(x,y,w,b):null;case Xs:return _=w._init,h(x,y,_(w._payload),b)}if(ru(w)||Dc(w))return _!==null?null:f(x,y,w,b,null);vd(x,w)}return null}function p(x,y,w,b,_){if(typeof b=="string"&&b!==""||typeof b=="number")return x=x.get(w)||null,o(y,x,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case id:return x=x.get(b.key===null?w:b.key)||null,l(y,x,b,_);case hl:return x=x.get(b.key===null?w:b.key)||null,u(y,x,b,_);case Xs:var T=b._init;return p(x,y,w,T(b._payload),_)}if(ru(b)||Dc(b))return x=x.get(w)||null,f(y,x,b,_,null);vd(y,b)}return null}function v(x,y,w,b){for(var _=null,T=null,E=y,C=y=0,P=null;E!==null&&C<w.length;C++){E.index>C?(P=E,E=null):P=E.sibling;var N=h(x,E,w[C],b);if(N===null){E===null&&(E=P);break}e&&E&&N.alternate===null&&t(x,E),y=s(N,y,C),T===null?_=N:T.sibling=N,T=N,E=P}if(C===w.length)return r(x,E),zt&&Xi(x,C),_;if(E===null){for(;C<w.length;C++)E=d(x,w[C],b),E!==null&&(y=s(E,y,C),T===null?_=E:T.sibling=E,T=E);return zt&&Xi(x,C),_}for(E=n(x,E);C<w.length;C++)P=p(E,x,C,w[C],b),P!==null&&(e&&P.alternate!==null&&E.delete(P.key===null?C:P.key),y=s(P,y,C),T===null?_=P:T.sibling=P,T=P);return e&&E.forEach(function(k){return t(x,k)}),zt&&Xi(x,C),_}function m(x,y,w,b){var _=Dc(w);if(typeof _!="function")throw Error(ke(150));if(w=_.call(w),w==null)throw Error(ke(151));for(var T=_=null,E=y,C=y=0,P=null,N=w.next();E!==null&&!N.done;C++,N=w.next()){E.index>C?(P=E,E=null):P=E.sibling;var k=h(x,E,N.value,b);if(k===null){E===null&&(E=P);break}e&&E&&k.alternate===null&&t(x,E),y=s(k,y,C),T===null?_=k:T.sibling=k,T=k,E=P}if(N.done)return r(x,E),zt&&Xi(x,C),_;if(E===null){for(;!N.done;C++,N=w.next())N=d(x,N.value,b),N!==null&&(y=s(N,y,C),T===null?_=N:T.sibling=N,T=N);return zt&&Xi(x,C),_}for(E=n(x,E);!N.done;C++,N=w.next())N=p(E,x,C,N.value,b),N!==null&&(e&&N.alternate!==null&&E.delete(N.key===null?C:N.key),y=s(N,y,C),T===null?_=N:T.sibling=N,T=N);return e&&E.forEach(function(A){return t(x,A)}),zt&&Xi(x,C),_}function g(x,y,w,b){if(typeof w=="object"&&w!==null&&w.type===pl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case id:e:{for(var _=w.key,T=y;T!==null;){if(T.key===_){if(_=w.type,_===pl){if(T.tag===7){r(x,T.sibling),y=a(T,w.props.children),y.return=x,x=y;break e}}else if(T.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Xs&&Aw(_)===T.type){r(x,T.sibling),y=a(T,w.props),y.ref=$c(x,T,w),y.return=x,x=y;break e}r(x,T);break}else t(x,T);T=T.sibling}w.type===pl?(y=wo(w.props.children,x.mode,b,w.key),y.return=x,x=y):(b=ih(w.type,w.key,w.props,null,x.mode,b),b.ref=$c(x,y,w),b.return=x,x=b)}return i(x);case hl:e:{for(T=w.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){r(x,y.sibling),y=a(y,w.children||[]),y.return=x,x=y;break e}else{r(x,y);break}else t(x,y);y=y.sibling}y=im(w,x.mode,b),y.return=x,x=y}return i(x);case Xs:return T=w._init,g(x,y,T(w._payload),b)}if(ru(w))return v(x,y,w,b);if(Dc(w))return m(x,y,w,b);vd(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(r(x,y.sibling),y=a(y,w),y.return=x,x=y):(r(x,y),y=sm(w,x.mode,b),y.return=x,x=y),i(x)):r(x,y)}return g}var oc=KS(!0),YS=KS(!1),Mh=Bi(null),Lh=null,_l=null,Bx=null;function Ux(){Bx=_l=Lh=null}function $x(e){var t=Mh.current;Ut(Mh),e._currentValue=t}function Fg(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Fl(e,t){Lh=e,Bx=_l=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Tn=!0),e.firstContext=null)}function ia(e){var t=e._currentValue;if(Bx!==e)if(e={context:e,memoizedValue:t,next:null},_l===null){if(Lh===null)throw Error(ke(308));_l=e,Lh.dependencies={lanes:0,firstContext:e}}else _l=_l.next=e;return t}var ao=null;function zx(e){ao===null?ao=[e]:ao.push(e)}function XS(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,zx(t)):(r.next=a.next,a.next=r),t.interleaved=r,As(e,n)}function As(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Js=!1;function Hx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function JS(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function _s(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _i(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Et&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,As(e,r)}return a=n.interleaved,a===null?(t.next=t,zx(n)):(t.next=a.next,a.next=t),n.interleaved=t,As(e,r)}function eh(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ax(e,r)}}function Cw(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?a=s=i:s=s.next=i,r=r.next}while(r!==null);s===null?a=s=t:s=s.next=t}else a=s=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Bh(e,t,r,n){var a=e.updateQueue;Js=!1;var s=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,u=l.next;l.next=null,i===null?s=u:i.next=u,i=l;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==i&&(o===null?f.firstBaseUpdate=u:o.next=u,f.lastBaseUpdate=l))}if(s!==null){var d=a.baseState;i=0,f=u=l=null,o=s;do{var h=o.lane,p=o.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=e,m=o;switch(h=t,p=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){d=v.call(p,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,d,h):v,h==null)break e;d=Kt({},d,h);break e;case 2:Js=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(u=f=p,l=d):f=f.next=p,i|=h;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;h=o,o=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(f===null&&(l=d),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do i|=a.lane,a=a.next;while(a!==t)}else s===null&&(a.shared.lanes=0);Ao|=i,e.lanes=i,e.memoizedState=d}}function Pw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(ke(191,a));a.call(n)}}}var Mf={},es=Bi(Mf),Ju=Bi(Mf),Qu=Bi(Mf);function so(e){if(e===Mf)throw Error(ke(174));return e}function qx(e,t){switch(Ft(Qu,t),Ft(Ju,e),Ft(es,Mf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mg(t,e)}Ut(es),Ft(es,t)}function lc(){Ut(es),Ut(Ju),Ut(Qu)}function QS(e){so(Qu.current);var t=so(es.current),r=mg(t,e.type);t!==r&&(Ft(Ju,e),Ft(es,r))}function Wx(e){Ju.current===e&&(Ut(es),Ut(Ju))}var Vt=Bi(0);function Uh(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zp=[];function Vx(){for(var e=0;e<Zp.length;e++)Zp[e]._workInProgressVersionPrimary=null;Zp.length=0}var th=Rs.ReactCurrentDispatcher,em=Rs.ReactCurrentBatchConfig,No=0,Gt=null,hr=null,br=null,$h=!1,_u=!1,Zu=0,d3=0;function $r(){throw Error(ke(321))}function Gx(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ra(e[r],t[r]))return!1;return!0}function Kx(e,t,r,n,a,s){if(No=s,Gt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,th.current=e===null||e.memoizedState===null?g3:v3,e=r(n,a),_u){s=0;do{if(_u=!1,Zu=0,25<=s)throw Error(ke(301));s+=1,br=hr=null,t.updateQueue=null,th.current=x3,e=r(n,a)}while(_u)}if(th.current=zh,t=hr!==null&&hr.next!==null,No=0,br=hr=Gt=null,$h=!1,t)throw Error(ke(300));return e}function Yx(){var e=Zu!==0;return Zu=0,e}function Wa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return br===null?Gt.memoizedState=br=e:br=br.next=e,br}function oa(){if(hr===null){var e=Gt.alternate;e=e!==null?e.memoizedState:null}else e=hr.next;var t=br===null?Gt.memoizedState:br.next;if(t!==null)br=t,hr=e;else{if(e===null)throw Error(ke(310));hr=e,e={memoizedState:hr.memoizedState,baseState:hr.baseState,baseQueue:hr.baseQueue,queue:hr.queue,next:null},br===null?Gt.memoizedState=br=e:br=br.next=e}return br}function ef(e,t){return typeof t=="function"?t(e):t}function tm(e){var t=oa(),r=t.queue;if(r===null)throw Error(ke(311));r.lastRenderedReducer=e;var n=hr,a=n.baseQueue,s=r.pending;if(s!==null){if(a!==null){var i=a.next;a.next=s.next,s.next=i}n.baseQueue=a=s,r.pending=null}if(a!==null){s=a.next,n=n.baseState;var o=i=null,l=null,u=s;do{var f=u.lane;if((No&f)===f)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=d,i=n):l=l.next=d,Gt.lanes|=f,Ao|=f}u=u.next}while(u!==null&&u!==s);l===null?i=n:l.next=o,Ra(n,t.memoizedState)||(Tn=!0),t.memoizedState=n,t.baseState=i,t.baseQueue=l,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do s=a.lane,Gt.lanes|=s,Ao|=s,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function rm(e){var t=oa(),r=t.queue;if(r===null)throw Error(ke(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,s=t.memoizedState;if(a!==null){r.pending=null;var i=a=a.next;do s=e(s,i.action),i=i.next;while(i!==a);Ra(s,t.memoizedState)||(Tn=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function ZS(){}function eT(e,t){var r=Gt,n=oa(),a=t(),s=!Ra(n.memoizedState,a);if(s&&(n.memoizedState=a,Tn=!0),n=n.queue,Xx(nT.bind(null,r,n,e),[e]),n.getSnapshot!==t||s||br!==null&&br.memoizedState.tag&1){if(r.flags|=2048,tf(9,rT.bind(null,r,n,a,t),void 0,null),_r===null)throw Error(ke(349));No&30||tT(r,t,a)}return a}function tT(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Gt.updateQueue,t===null?(t={lastEffect:null,stores:null},Gt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function rT(e,t,r,n){t.value=r,t.getSnapshot=n,aT(t)&&sT(e)}function nT(e,t,r){return r(function(){aT(t)&&sT(e)})}function aT(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ra(e,r)}catch{return!0}}function sT(e){var t=As(e,1);t!==null&&Pa(t,e,1,-1)}function Ow(e){var t=Wa();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ef,lastRenderedState:e},t.queue=e,e=e.dispatch=m3.bind(null,Gt,e),[t.memoizedState,e]}function tf(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Gt.updateQueue,t===null?(t={lastEffect:null,stores:null},Gt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function iT(){return oa().memoizedState}function rh(e,t,r,n){var a=Wa();Gt.flags|=e,a.memoizedState=tf(1|t,r,void 0,n===void 0?null:n)}function F0(e,t,r,n){var a=oa();n=n===void 0?null:n;var s=void 0;if(hr!==null){var i=hr.memoizedState;if(s=i.destroy,n!==null&&Gx(n,i.deps)){a.memoizedState=tf(t,r,s,n);return}}Gt.flags|=e,a.memoizedState=tf(1|t,r,s,n)}function jw(e,t){return rh(8390656,8,e,t)}function Xx(e,t){return F0(2048,8,e,t)}function oT(e,t){return F0(4,2,e,t)}function lT(e,t){return F0(4,4,e,t)}function cT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uT(e,t,r){return r=r!=null?r.concat([e]):null,F0(4,4,cT.bind(null,t,e),r)}function Jx(){}function fT(e,t){var r=oa();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Gx(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function dT(e,t){var r=oa();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Gx(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function hT(e,t,r){return No&21?(Ra(r,t)||(r=xS(),Gt.lanes|=r,Ao|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Tn=!0),e.memoizedState=r)}function h3(e,t){var r=Pt;Pt=r!==0&&4>r?r:4,e(!0);var n=em.transition;em.transition={};try{e(!1),t()}finally{Pt=r,em.transition=n}}function pT(){return oa().memoizedState}function p3(e,t,r){var n=Si(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},mT(e))gT(t,r);else if(r=XS(e,t,r,n),r!==null){var a=fn();Pa(r,e,n,a),vT(r,t,n)}}function m3(e,t,r){var n=Si(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(mT(e))gT(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,o=s(i,r);if(a.hasEagerState=!0,a.eagerState=o,Ra(o,i)){var l=t.interleaved;l===null?(a.next=a,zx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=XS(e,t,a,n),r!==null&&(a=fn(),Pa(r,e,n,a),vT(r,t,n))}}function mT(e){var t=e.alternate;return e===Gt||t!==null&&t===Gt}function gT(e,t){_u=$h=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function vT(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ax(e,r)}}var zh={readContext:ia,useCallback:$r,useContext:$r,useEffect:$r,useImperativeHandle:$r,useInsertionEffect:$r,useLayoutEffect:$r,useMemo:$r,useReducer:$r,useRef:$r,useState:$r,useDebugValue:$r,useDeferredValue:$r,useTransition:$r,useMutableSource:$r,useSyncExternalStore:$r,useId:$r,unstable_isNewReconciler:!1},g3={readContext:ia,useCallback:function(e,t){return Wa().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:jw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,rh(4194308,4,cT.bind(null,t,e),r)},useLayoutEffect:function(e,t){return rh(4194308,4,e,t)},useInsertionEffect:function(e,t){return rh(4,2,e,t)},useMemo:function(e,t){var r=Wa();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Wa();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=p3.bind(null,Gt,e),[n.memoizedState,e]},useRef:function(e){var t=Wa();return e={current:e},t.memoizedState=e},useState:Ow,useDebugValue:Jx,useDeferredValue:function(e){return Wa().memoizedState=e},useTransition:function(){var e=Ow(!1),t=e[0];return e=h3.bind(null,e[1]),Wa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Gt,a=Wa();if(zt){if(r===void 0)throw Error(ke(407));r=r()}else{if(r=t(),_r===null)throw Error(ke(349));No&30||tT(n,t,r)}a.memoizedState=r;var s={value:r,getSnapshot:t};return a.queue=s,jw(nT.bind(null,n,s,e),[e]),n.flags|=2048,tf(9,rT.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=Wa(),t=_r.identifierPrefix;if(zt){var r=ys,n=xs;r=(n&~(1<<32-Ca(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Zu++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=d3++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},v3={readContext:ia,useCallback:fT,useContext:ia,useEffect:Xx,useImperativeHandle:uT,useInsertionEffect:oT,useLayoutEffect:lT,useMemo:dT,useReducer:tm,useRef:iT,useState:function(){return tm(ef)},useDebugValue:Jx,useDeferredValue:function(e){var t=oa();return hT(t,hr.memoizedState,e)},useTransition:function(){var e=tm(ef)[0],t=oa().memoizedState;return[e,t]},useMutableSource:ZS,useSyncExternalStore:eT,useId:pT,unstable_isNewReconciler:!1},x3={readContext:ia,useCallback:fT,useContext:ia,useEffect:Xx,useImperativeHandle:uT,useInsertionEffect:oT,useLayoutEffect:lT,useMemo:dT,useReducer:rm,useRef:iT,useState:function(){return rm(ef)},useDebugValue:Jx,useDeferredValue:function(e){var t=oa();return hr===null?t.memoizedState=e:hT(t,hr.memoizedState,e)},useTransition:function(){var e=rm(ef)[0],t=oa().memoizedState;return[e,t]},useMutableSource:ZS,useSyncExternalStore:eT,useId:pT,unstable_isNewReconciler:!1};function ya(e,t){if(e&&e.defaultProps){t=Kt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Dg(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Kt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var D0={isMounted:function(e){return(e=e._reactInternals)?Bo(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=fn(),a=Si(e),s=_s(n,a);s.payload=t,r!=null&&(s.callback=r),t=_i(e,s,a),t!==null&&(Pa(t,e,a,n),eh(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=fn(),a=Si(e),s=_s(n,a);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=_i(e,s,a),t!==null&&(Pa(t,e,a,n),eh(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=fn(),n=Si(e),a=_s(r,n);a.tag=2,t!=null&&(a.callback=t),t=_i(e,a,n),t!==null&&(Pa(t,e,n,r),eh(t,e,n))}};function Rw(e,t,r,n,a,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,i):t.prototype&&t.prototype.isPureReactComponent?!Gu(r,n)||!Gu(a,s):!0}function xT(e,t,r){var n=!1,a=Oi,s=t.contextType;return typeof s=="object"&&s!==null?s=ia(s):(a=Cn(t)?To:Xr.current,n=t.contextTypes,s=(n=n!=null)?sc(e,a):Oi),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=D0,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=s),t}function Iw(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&D0.enqueueReplaceState(t,t.state,null)}function Mg(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Hx(e);var s=t.contextType;typeof s=="object"&&s!==null?a.context=ia(s):(s=Cn(t)?To:Xr.current,a.context=sc(e,s)),a.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Dg(e,t,s,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&D0.enqueueReplaceState(a,a.state,null),Bh(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function cc(e,t){try{var r="",n=t;do r+=Vj(n),n=n.return;while(n);var a=r}catch(s){a=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:a,digest:null}}function nm(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Lg(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var y3=typeof WeakMap=="function"?WeakMap:Map;function yT(e,t,r){r=_s(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){qh||(qh=!0,Kg=n),Lg(e,t)},r}function wT(e,t,r){r=_s(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Lg(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){Lg(e,t),typeof n!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function Fw(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new y3;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=R3.bind(null,e,t,r),t.then(e,e))}function Dw(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mw(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=_s(-1,1),t.tag=2,_i(r,t,1))),r.lanes|=1),e)}var w3=Rs.ReactCurrentOwner,Tn=!1;function rn(e,t,r,n){t.child=e===null?YS(t,null,r,n):oc(t,e.child,r,n)}function Lw(e,t,r,n,a){r=r.render;var s=t.ref;return Fl(t,a),n=Kx(e,t,r,n,s,a),r=Yx(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Cs(e,t,a)):(zt&&r&&Dx(t),t.flags|=1,rn(e,t,n,a),t.child)}function Bw(e,t,r,n,a){if(e===null){var s=r.type;return typeof s=="function"&&!sy(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,bT(e,t,s,n,a)):(e=ih(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&a)){var i=s.memoizedProps;if(r=r.compare,r=r!==null?r:Gu,r(i,n)&&e.ref===t.ref)return Cs(e,t,a)}return t.flags|=1,e=Ti(s,n),e.ref=t.ref,e.return=t,t.child=e}function bT(e,t,r,n,a){if(e!==null){var s=e.memoizedProps;if(Gu(s,n)&&e.ref===t.ref)if(Tn=!1,t.pendingProps=n=s,(e.lanes&a)!==0)e.flags&131072&&(Tn=!0);else return t.lanes=e.lanes,Cs(e,t,a)}return Bg(e,t,r,n,a)}function _T(e,t,r){var n=t.pendingProps,a=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft(Sl,Rn),Rn|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ft(Sl,Rn),Rn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,Ft(Sl,Rn),Rn|=n}else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,Ft(Sl,Rn),Rn|=n;return rn(e,t,a,r),t.child}function ET(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Bg(e,t,r,n,a){var s=Cn(r)?To:Xr.current;return s=sc(t,s),Fl(t,a),r=Kx(e,t,r,n,s,a),n=Yx(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Cs(e,t,a)):(zt&&n&&Dx(t),t.flags|=1,rn(e,t,r,a),t.child)}function Uw(e,t,r,n,a){if(Cn(r)){var s=!0;Ih(t)}else s=!1;if(Fl(t,a),t.stateNode===null)nh(e,t),xT(t,r,n),Mg(t,r,n,a),n=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var l=i.context,u=r.contextType;typeof u=="object"&&u!==null?u=ia(u):(u=Cn(r)?To:Xr.current,u=sc(t,u));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==n||l!==u)&&Iw(t,i,n,u),Js=!1;var h=t.memoizedState;i.state=h,Bh(t,n,i,a),l=t.memoizedState,o!==n||h!==l||An.current||Js?(typeof f=="function"&&(Dg(t,r,f,n),l=t.memoizedState),(o=Js||Rw(t,r,o,n,h,l,u))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),i.props=n,i.state=l,i.context=u,n=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,JS(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:ya(t.type,o),i.props=u,d=t.pendingProps,h=i.context,l=r.contextType,typeof l=="object"&&l!==null?l=ia(l):(l=Cn(r)?To:Xr.current,l=sc(t,l));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==d||h!==l)&&Iw(t,i,n,l),Js=!1,h=t.memoizedState,i.state=h,Bh(t,n,i,a);var v=t.memoizedState;o!==d||h!==v||An.current||Js?(typeof p=="function"&&(Dg(t,r,p,n),v=t.memoizedState),(u=Js||Rw(t,r,u,n,h,v,l)||!1)?(f||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,v,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,v,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),i.props=n,i.state=v,i.context=l,n=u):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Ug(e,t,r,n,s,a)}function Ug(e,t,r,n,a,s){ET(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return a&&Tw(t,r,!1),Cs(e,t,s);n=t.stateNode,w3.current=t;var o=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=oc(t,e.child,null,s),t.child=oc(t,null,o,s)):rn(e,t,o,s),t.memoizedState=n.state,a&&Tw(t,r,!0),t.child}function ST(e){var t=e.stateNode;t.pendingContext?Sw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Sw(e,t.context,!1),qx(e,t.containerInfo)}function $w(e,t,r,n,a){return ic(),Lx(a),t.flags|=256,rn(e,t,r,n),t.child}var $g={dehydrated:null,treeContext:null,retryLane:0};function zg(e){return{baseLanes:e,cachePool:null,transitions:null}}function TT(e,t,r){var n=t.pendingProps,a=Vt.current,s=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Ft(Vt,a&1),e===null)return Ig(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,s?(n=t.mode,s=t.child,i={mode:"hidden",children:i},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=B0(i,n,0,null),e=wo(e,n,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=zg(r),t.memoizedState=$g,e):Qx(t,i));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return b3(e,t,i,n,o,a,r);if(s){s=n.fallback,i=t.mode,a=e.child,o=a.sibling;var l={mode:"hidden",children:n.children};return!(i&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Ti(a,l),n.subtreeFlags=a.subtreeFlags&14680064),o!==null?s=Ti(o,s):(s=wo(s,i,r,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,n=s,s=t.child,i=e.child.memoizedState,i=i===null?zg(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~r,t.memoizedState=$g,n}return s=e.child,e=s.sibling,n=Ti(s,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Qx(e,t){return t=B0({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xd(e,t,r,n){return n!==null&&Lx(n),oc(t,e.child,null,r),e=Qx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function b3(e,t,r,n,a,s,i){if(r)return t.flags&256?(t.flags&=-257,n=nm(Error(ke(422))),xd(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=n.fallback,a=t.mode,n=B0({mode:"visible",children:n.children},a,0,null),s=wo(s,a,i,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,t.mode&1&&oc(t,e.child,null,i),t.child.memoizedState=zg(i),t.memoizedState=$g,s);if(!(t.mode&1))return xd(e,t,i,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var o=n.dgst;return n=o,s=Error(ke(419)),n=nm(s,n,void 0),xd(e,t,i,n)}if(o=(i&e.childLanes)!==0,Tn||o){if(n=_r,n!==null){switch(i&-i){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|i)?0:a,a!==0&&a!==s.retryLane&&(s.retryLane=a,As(e,a),Pa(n,e,a,-1))}return ay(),n=nm(Error(ke(421))),xd(e,t,i,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=I3.bind(null,e),a._reactRetry=t,null):(e=s.treeContext,Un=bi(a.nextSibling),$n=t,zt=!0,Ta=null,e!==null&&(ea[ta++]=xs,ea[ta++]=ys,ea[ta++]=ko,xs=e.id,ys=e.overflow,ko=t),t=Qx(t,n.children),t.flags|=4096,t)}function zw(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Fg(e.return,t,r)}function am(e,t,r,n,a){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=a)}function kT(e,t,r){var n=t.pendingProps,a=n.revealOrder,s=n.tail;if(rn(e,t,n.children,r),n=Vt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zw(e,r,t);else if(e.tag===19)zw(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ft(Vt,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&Uh(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),am(t,!1,a,r,s);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Uh(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}am(t,!0,r,null,s);break;case"together":am(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Cs(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ao|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ke(153));if(t.child!==null){for(e=t.child,r=Ti(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ti(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function _3(e,t,r){switch(t.tag){case 3:ST(t),ic();break;case 5:QS(t);break;case 1:Cn(t.type)&&Ih(t);break;case 4:qx(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;Ft(Mh,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ft(Vt,Vt.current&1),t.flags|=128,null):r&t.child.childLanes?TT(e,t,r):(Ft(Vt,Vt.current&1),e=Cs(e,t,r),e!==null?e.sibling:null);Ft(Vt,Vt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return kT(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ft(Vt,Vt.current),n)break;return null;case 22:case 23:return t.lanes=0,_T(e,t,r)}return Cs(e,t,r)}var NT,Hg,AT,CT;NT=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Hg=function(){};AT=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,so(es.current);var s=null;switch(r){case"input":a=fg(e,a),n=fg(e,n),s=[];break;case"select":a=Kt({},a,{value:void 0}),n=Kt({},n,{value:void 0}),s=[];break;case"textarea":a=pg(e,a),n=pg(e,n),s=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=jh)}gg(r,n);var i;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var o=a[u];for(i in o)o.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Uu.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in n){var l=n[u];if(o=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(i in o)!o.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in l)l.hasOwnProperty(i)&&o[i]!==l[i]&&(r||(r={}),r[i]=l[i])}else r||(s||(s=[]),s.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Uu.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Lt("scroll",e),s||o===l||(s=[])):(s=s||[]).push(u,l))}r&&(s=s||[]).push("style",r);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};CT=function(e,t,r,n){r!==n&&(t.flags|=4)};function zc(e,t){if(!zt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function zr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function E3(e,t,r){var n=t.pendingProps;switch(Mx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zr(t),null;case 1:return Cn(t.type)&&Rh(),zr(t),null;case 3:return n=t.stateNode,lc(),Ut(An),Ut(Xr),Vx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(gd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ta!==null&&(Jg(Ta),Ta=null))),Hg(e,t),zr(t),null;case 5:Wx(t);var a=so(Qu.current);if(r=t.type,e!==null&&t.stateNode!=null)AT(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ke(166));return zr(t),null}if(e=so(es.current),gd(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Xa]=t,n[Xu]=s,e=(t.mode&1)!==0,r){case"dialog":Lt("cancel",n),Lt("close",n);break;case"iframe":case"object":case"embed":Lt("load",n);break;case"video":case"audio":for(a=0;a<au.length;a++)Lt(au[a],n);break;case"source":Lt("error",n);break;case"img":case"image":case"link":Lt("error",n),Lt("load",n);break;case"details":Lt("toggle",n);break;case"input":J1(n,s),Lt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},Lt("invalid",n);break;case"textarea":Z1(n,s),Lt("invalid",n)}gg(r,s),a=null;for(var i in s)if(s.hasOwnProperty(i)){var o=s[i];i==="children"?typeof o=="string"?n.textContent!==o&&(s.suppressHydrationWarning!==!0&&md(n.textContent,o,e),a=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&md(n.textContent,o,e),a=["children",""+o]):Uu.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&Lt("scroll",n)}switch(r){case"input":od(n),Q1(n,s,!0);break;case"textarea":od(n),ew(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=jh)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{i=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nS(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Xa]=t,e[Xu]=n,NT(e,t,!1,!1),t.stateNode=e;e:{switch(i=vg(r,n),r){case"dialog":Lt("cancel",e),Lt("close",e),a=n;break;case"iframe":case"object":case"embed":Lt("load",e),a=n;break;case"video":case"audio":for(a=0;a<au.length;a++)Lt(au[a],e);a=n;break;case"source":Lt("error",e),a=n;break;case"img":case"image":case"link":Lt("error",e),Lt("load",e),a=n;break;case"details":Lt("toggle",e),a=n;break;case"input":J1(e,n),a=fg(e,n),Lt("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=Kt({},n,{value:void 0}),Lt("invalid",e);break;case"textarea":Z1(e,n),a=pg(e,n),Lt("invalid",e);break;default:a=n}gg(r,a),o=a;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?iS(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&aS(e,l)):s==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&$u(e,l):typeof l=="number"&&$u(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Uu.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Lt("scroll",e):l!=null&&_x(e,s,l,i))}switch(r){case"input":od(e),Q1(e,n,!1);break;case"textarea":od(e),ew(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Pi(n.value));break;case"select":e.multiple=!!n.multiple,s=n.value,s!=null?Ol(e,!!n.multiple,s,!1):n.defaultValue!=null&&Ol(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=jh)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return zr(t),null;case 6:if(e&&t.stateNode!=null)CT(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ke(166));if(r=so(Qu.current),so(es.current),gd(t)){if(n=t.stateNode,r=t.memoizedProps,n[Xa]=t,(s=n.nodeValue!==r)&&(e=$n,e!==null))switch(e.tag){case 3:md(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&md(n.nodeValue,r,(e.mode&1)!==0)}s&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Xa]=t,t.stateNode=n}return zr(t),null;case 13:if(Ut(Vt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(zt&&Un!==null&&t.mode&1&&!(t.flags&128))GS(),ic(),t.flags|=98560,s=!1;else if(s=gd(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(ke(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ke(317));s[Xa]=t}else ic(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zr(t),s=!1}else Ta!==null&&(Jg(Ta),Ta=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Vt.current&1?pr===0&&(pr=3):ay())),t.updateQueue!==null&&(t.flags|=4),zr(t),null);case 4:return lc(),Hg(e,t),e===null&&Ku(t.stateNode.containerInfo),zr(t),null;case 10:return $x(t.type._context),zr(t),null;case 17:return Cn(t.type)&&Rh(),zr(t),null;case 19:if(Ut(Vt),s=t.memoizedState,s===null)return zr(t),null;if(n=(t.flags&128)!==0,i=s.rendering,i===null)if(n)zc(s,!1);else{if(pr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Uh(e),i!==null){for(t.flags|=128,zc(s,!1),n=i.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)s=r,e=n,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ft(Vt,Vt.current&1|2),t.child}e=e.sibling}s.tail!==null&&tr()>uc&&(t.flags|=128,n=!0,zc(s,!1),t.lanes=4194304)}else{if(!n)if(e=Uh(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),zc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!zt)return zr(t),null}else 2*tr()-s.renderingStartTime>uc&&r!==1073741824&&(t.flags|=128,n=!0,zc(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(r=s.last,r!==null?r.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=tr(),t.sibling=null,r=Vt.current,Ft(Vt,n?r&1|2:r&1),t):(zr(t),null);case 22:case 23:return ny(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Rn&1073741824&&(zr(t),t.subtreeFlags&6&&(t.flags|=8192)):zr(t),null;case 24:return null;case 25:return null}throw Error(ke(156,t.tag))}function S3(e,t){switch(Mx(t),t.tag){case 1:return Cn(t.type)&&Rh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lc(),Ut(An),Ut(Xr),Vx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wx(t),null;case 13:if(Ut(Vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ke(340));ic()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ut(Vt),null;case 4:return lc(),null;case 10:return $x(t.type._context),null;case 22:case 23:return ny(),null;case 24:return null;default:return null}}var yd=!1,Wr=!1,T3=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function El(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Jt(e,t,n)}else r.current=null}function qg(e,t,r){try{r()}catch(n){Jt(e,t,n)}}var Hw=!1;function k3(e,t){if(Ng=Ch,e=IS(),Fx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var i=0,o=-1,l=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||a!==0&&d.nodeType!==3||(o=i+a),d!==s||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===a&&(o=i),h===s&&++f===n&&(l=i),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ag={focusedElem:e,selectionRange:r},Ch=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){t=Fe;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,g=v.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:ya(t.type,m),g);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(b){Jt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}return v=Hw,Hw=!1,v}function Eu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var s=a.destroy;a.destroy=void 0,s!==void 0&&qg(t,r,s)}a=a.next}while(a!==n)}}function M0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Wg(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function PT(e){var t=e.alternate;t!==null&&(e.alternate=null,PT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xa],delete t[Xu],delete t[Og],delete t[l3],delete t[c3])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function OT(e){return e.tag===5||e.tag===3||e.tag===4}function qw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||OT(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vg(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jh));else if(n!==4&&(e=e.child,e!==null))for(Vg(e,t,r),e=e.sibling;e!==null;)Vg(e,t,r),e=e.sibling}function Gg(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Gg(e,t,r),e=e.sibling;e!==null;)Gg(e,t,r),e=e.sibling}var Or=null,Ea=!1;function $s(e,t,r){for(r=r.child;r!==null;)jT(e,t,r),r=r.sibling}function jT(e,t,r){if(Za&&typeof Za.onCommitFiberUnmount=="function")try{Za.onCommitFiberUnmount(C0,r)}catch{}switch(r.tag){case 5:Wr||El(r,t);case 6:var n=Or,a=Ea;Or=null,$s(e,t,r),Or=n,Ea=a,Or!==null&&(Ea?(e=Or,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Or.removeChild(r.stateNode));break;case 18:Or!==null&&(Ea?(e=Or,r=r.stateNode,e.nodeType===8?Jp(e.parentNode,r):e.nodeType===1&&Jp(e,r),Wu(e)):Jp(Or,r.stateNode));break;case 4:n=Or,a=Ea,Or=r.stateNode.containerInfo,Ea=!0,$s(e,t,r),Or=n,Ea=a;break;case 0:case 11:case 14:case 15:if(!Wr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var s=a,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&qg(r,t,i),a=a.next}while(a!==n)}$s(e,t,r);break;case 1:if(!Wr&&(El(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Jt(r,t,o)}$s(e,t,r);break;case 21:$s(e,t,r);break;case 22:r.mode&1?(Wr=(n=Wr)||r.memoizedState!==null,$s(e,t,r),Wr=n):$s(e,t,r);break;default:$s(e,t,r)}}function Ww(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new T3),t.forEach(function(n){var a=F3.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function fa(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var s=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:Or=o.stateNode,Ea=!1;break e;case 3:Or=o.stateNode.containerInfo,Ea=!0;break e;case 4:Or=o.stateNode.containerInfo,Ea=!0;break e}o=o.return}if(Or===null)throw Error(ke(160));jT(s,i,a),Or=null,Ea=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(u){Jt(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)RT(t,e),t=t.sibling}function RT(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fa(t,e),Ua(e),n&4){try{Eu(3,e,e.return),M0(3,e)}catch(m){Jt(e,e.return,m)}try{Eu(5,e,e.return)}catch(m){Jt(e,e.return,m)}}break;case 1:fa(t,e),Ua(e),n&512&&r!==null&&El(r,r.return);break;case 5:if(fa(t,e),Ua(e),n&512&&r!==null&&El(r,r.return),e.flags&32){var a=e.stateNode;try{$u(a,"")}catch(m){Jt(e,e.return,m)}}if(n&4&&(a=e.stateNode,a!=null)){var s=e.memoizedProps,i=r!==null?r.memoizedProps:s,o=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&tS(a,s),vg(o,i);var u=vg(o,s);for(i=0;i<l.length;i+=2){var f=l[i],d=l[i+1];f==="style"?iS(a,d):f==="dangerouslySetInnerHTML"?aS(a,d):f==="children"?$u(a,d):_x(a,f,d,u)}switch(o){case"input":dg(a,s);break;case"textarea":rS(a,s);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ol(a,!!s.multiple,p,!1):h!==!!s.multiple&&(s.defaultValue!=null?Ol(a,!!s.multiple,s.defaultValue,!0):Ol(a,!!s.multiple,s.multiple?[]:"",!1))}a[Xu]=s}catch(m){Jt(e,e.return,m)}}break;case 6:if(fa(t,e),Ua(e),n&4){if(e.stateNode===null)throw Error(ke(162));a=e.stateNode,s=e.memoizedProps;try{a.nodeValue=s}catch(m){Jt(e,e.return,m)}}break;case 3:if(fa(t,e),Ua(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Wu(t.containerInfo)}catch(m){Jt(e,e.return,m)}break;case 4:fa(t,e),Ua(e);break;case 13:fa(t,e),Ua(e),a=e.child,a.flags&8192&&(s=a.memoizedState!==null,a.stateNode.isHidden=s,!s||a.alternate!==null&&a.alternate.memoizedState!==null||(ty=tr())),n&4&&Ww(e);break;case 22:if(f=r!==null&&r.memoizedState!==null,e.mode&1?(Wr=(u=Wr)||f,fa(t,e),Wr=u):fa(t,e),Ua(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(Fe=e,f=e.child;f!==null;){for(d=Fe=f;Fe!==null;){switch(h=Fe,p=h.child,h.tag){case 0:case 11:case 14:case 15:Eu(4,h,h.return);break;case 1:El(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){Jt(n,r,m)}}break;case 5:El(h,h.return);break;case 22:if(h.memoizedState!==null){Gw(d);continue}}p!==null?(p.return=h,Fe=p):Gw(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{a=d.stateNode,u?(s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=d.stateNode,l=d.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=sS("display",i))}catch(m){Jt(e,e.return,m)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){Jt(e,e.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:fa(t,e),Ua(e),n&4&&Ww(e);break;case 21:break;default:fa(t,e),Ua(e)}}function Ua(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(OT(r)){var n=r;break e}r=r.return}throw Error(ke(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&($u(a,""),n.flags&=-33);var s=qw(e);Gg(e,s,a);break;case 3:case 4:var i=n.stateNode.containerInfo,o=qw(e);Vg(e,o,i);break;default:throw Error(ke(161))}}catch(l){Jt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function N3(e,t,r){Fe=e,IT(e)}function IT(e,t,r){for(var n=(e.mode&1)!==0;Fe!==null;){var a=Fe,s=a.child;if(a.tag===22&&n){var i=a.memoizedState!==null||yd;if(!i){var o=a.alternate,l=o!==null&&o.memoizedState!==null||Wr;o=yd;var u=Wr;if(yd=i,(Wr=l)&&!u)for(Fe=a;Fe!==null;)i=Fe,l=i.child,i.tag===22&&i.memoizedState!==null?Kw(a):l!==null?(l.return=i,Fe=l):Kw(a);for(;s!==null;)Fe=s,IT(s),s=s.sibling;Fe=a,yd=o,Wr=u}Vw(e)}else a.subtreeFlags&8772&&s!==null?(s.return=a,Fe=s):Vw(e)}}function Vw(e){for(;Fe!==null;){var t=Fe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Wr||M0(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Wr)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:ya(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Pw(t,s,n);break;case 3:var i=t.updateQueue;if(i!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Pw(t,i,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Wu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ke(163))}Wr||t.flags&512&&Wg(t)}catch(h){Jt(t,t.return,h)}}if(t===e){Fe=null;break}if(r=t.sibling,r!==null){r.return=t.return,Fe=r;break}Fe=t.return}}function Gw(e){for(;Fe!==null;){var t=Fe;if(t===e){Fe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Fe=r;break}Fe=t.return}}function Kw(e){for(;Fe!==null;){var t=Fe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{M0(4,t)}catch(l){Jt(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(l){Jt(t,a,l)}}var s=t.return;try{Wg(t)}catch(l){Jt(t,s,l)}break;case 5:var i=t.return;try{Wg(t)}catch(l){Jt(t,i,l)}}}catch(l){Jt(t,t.return,l)}if(t===e){Fe=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Fe=o;break}Fe=t.return}}var A3=Math.ceil,Hh=Rs.ReactCurrentDispatcher,Zx=Rs.ReactCurrentOwner,aa=Rs.ReactCurrentBatchConfig,Et=0,_r=null,lr=null,Dr=0,Rn=0,Sl=Bi(0),pr=0,rf=null,Ao=0,L0=0,ey=0,Su=null,Sn=null,ty=0,uc=1/0,ds=null,qh=!1,Kg=null,Ei=null,wd=!1,pi=null,Wh=0,Tu=0,Yg=null,ah=-1,sh=0;function fn(){return Et&6?tr():ah!==-1?ah:ah=tr()}function Si(e){return e.mode&1?Et&2&&Dr!==0?Dr&-Dr:f3.transition!==null?(sh===0&&(sh=xS()),sh):(e=Pt,e!==0||(e=window.event,e=e===void 0?16:TS(e.type)),e):1}function Pa(e,t,r,n){if(50<Tu)throw Tu=0,Yg=null,Error(ke(185));If(e,r,n),(!(Et&2)||e!==_r)&&(e===_r&&(!(Et&2)&&(L0|=r),pr===4&&ti(e,Dr)),Pn(e,n),r===1&&Et===0&&!(t.mode&1)&&(uc=tr()+500,I0&&Ui()))}function Pn(e,t){var r=e.callbackNode;fR(e,t);var n=Ah(e,e===_r?Dr:0);if(n===0)r!==null&&nw(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&nw(r),t===1)e.tag===0?u3(Yw.bind(null,e)):qS(Yw.bind(null,e)),i3(function(){!(Et&6)&&Ui()}),r=null;else{switch(yS(n)){case 1:r=Nx;break;case 4:r=gS;break;case 16:r=Nh;break;case 536870912:r=vS;break;default:r=Nh}r=zT(r,FT.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function FT(e,t){if(ah=-1,sh=0,Et&6)throw Error(ke(327));var r=e.callbackNode;if(Dl()&&e.callbackNode!==r)return null;var n=Ah(e,e===_r?Dr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Vh(e,n);else{t=n;var a=Et;Et|=2;var s=MT();(_r!==e||Dr!==t)&&(ds=null,uc=tr()+500,yo(e,t));do try{O3();break}catch(o){DT(e,o)}while(!0);Ux(),Hh.current=s,Et=a,lr!==null?t=0:(_r=null,Dr=0,t=pr)}if(t!==0){if(t===2&&(a=_g(e),a!==0&&(n=a,t=Xg(e,a))),t===1)throw r=rf,yo(e,0),ti(e,n),Pn(e,tr()),r;if(t===6)ti(e,n);else{if(a=e.current.alternate,!(n&30)&&!C3(a)&&(t=Vh(e,n),t===2&&(s=_g(e),s!==0&&(n=s,t=Xg(e,s))),t===1))throw r=rf,yo(e,0),ti(e,n),Pn(e,tr()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(ke(345));case 2:Ji(e,Sn,ds);break;case 3:if(ti(e,n),(n&130023424)===n&&(t=ty+500-tr(),10<t)){if(Ah(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){fn(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Pg(Ji.bind(null,e,Sn,ds),t);break}Ji(e,Sn,ds);break;case 4:if(ti(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var i=31-Ca(n);s=1<<i,i=t[i],i>a&&(a=i),n&=~s}if(n=a,n=tr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*A3(n/1960))-n,10<n){e.timeoutHandle=Pg(Ji.bind(null,e,Sn,ds),n);break}Ji(e,Sn,ds);break;case 5:Ji(e,Sn,ds);break;default:throw Error(ke(329))}}}return Pn(e,tr()),e.callbackNode===r?FT.bind(null,e):null}function Xg(e,t){var r=Su;return e.current.memoizedState.isDehydrated&&(yo(e,t).flags|=256),e=Vh(e,t),e!==2&&(t=Sn,Sn=r,t!==null&&Jg(t)),e}function Jg(e){Sn===null?Sn=e:Sn.push.apply(Sn,e)}function C3(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],s=a.getSnapshot;a=a.value;try{if(!Ra(s(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ti(e,t){for(t&=~ey,t&=~L0,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ca(t),n=1<<r;e[r]=-1,t&=~n}}function Yw(e){if(Et&6)throw Error(ke(327));Dl();var t=Ah(e,0);if(!(t&1))return Pn(e,tr()),null;var r=Vh(e,t);if(e.tag!==0&&r===2){var n=_g(e);n!==0&&(t=n,r=Xg(e,n))}if(r===1)throw r=rf,yo(e,0),ti(e,t),Pn(e,tr()),r;if(r===6)throw Error(ke(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ji(e,Sn,ds),Pn(e,tr()),null}function ry(e,t){var r=Et;Et|=1;try{return e(t)}finally{Et=r,Et===0&&(uc=tr()+500,I0&&Ui())}}function Co(e){pi!==null&&pi.tag===0&&!(Et&6)&&Dl();var t=Et;Et|=1;var r=aa.transition,n=Pt;try{if(aa.transition=null,Pt=1,e)return e()}finally{Pt=n,aa.transition=r,Et=t,!(Et&6)&&Ui()}}function ny(){Rn=Sl.current,Ut(Sl)}function yo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,s3(r)),lr!==null)for(r=lr.return;r!==null;){var n=r;switch(Mx(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Rh();break;case 3:lc(),Ut(An),Ut(Xr),Vx();break;case 5:Wx(n);break;case 4:lc();break;case 13:Ut(Vt);break;case 19:Ut(Vt);break;case 10:$x(n.type._context);break;case 22:case 23:ny()}r=r.return}if(_r=e,lr=e=Ti(e.current,null),Dr=Rn=t,pr=0,rf=null,ey=L0=Ao=0,Sn=Su=null,ao!==null){for(t=0;t<ao.length;t++)if(r=ao[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,s=r.pending;if(s!==null){var i=s.next;s.next=a,n.next=i}r.pending=n}ao=null}return e}function DT(e,t){do{var r=lr;try{if(Ux(),th.current=zh,$h){for(var n=Gt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}$h=!1}if(No=0,br=hr=Gt=null,_u=!1,Zu=0,Zx.current=null,r===null||r.return===null){pr=1,rf=t,lr=null;break}e:{var s=e,i=r.return,o=r,l=t;if(t=Dr,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,f=o,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=Dw(i);if(p!==null){p.flags&=-257,Mw(p,i,o,s,t),p.mode&1&&Fw(s,u,t),t=p,l=u;var v=t.updateQueue;if(v===null){var m=new Set;m.add(l),t.updateQueue=m}else v.add(l);break e}else{if(!(t&1)){Fw(s,u,t),ay();break e}l=Error(ke(426))}}else if(zt&&o.mode&1){var g=Dw(i);if(g!==null){!(g.flags&65536)&&(g.flags|=256),Mw(g,i,o,s,t),Lx(cc(l,o));break e}}s=l=cc(l,o),pr!==4&&(pr=2),Su===null?Su=[s]:Su.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var x=yT(s,l,t);Cw(s,x);break e;case 1:o=l;var y=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ei===null||!Ei.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=wT(s,o,t);Cw(s,b);break e}}s=s.return}while(s!==null)}BT(r)}catch(_){t=_,lr===r&&r!==null&&(lr=r=r.return);continue}break}while(!0)}function MT(){var e=Hh.current;return Hh.current=zh,e===null?zh:e}function ay(){(pr===0||pr===3||pr===2)&&(pr=4),_r===null||!(Ao&268435455)&&!(L0&268435455)||ti(_r,Dr)}function Vh(e,t){var r=Et;Et|=2;var n=MT();(_r!==e||Dr!==t)&&(ds=null,yo(e,t));do try{P3();break}catch(a){DT(e,a)}while(!0);if(Ux(),Et=r,Hh.current=n,lr!==null)throw Error(ke(261));return _r=null,Dr=0,pr}function P3(){for(;lr!==null;)LT(lr)}function O3(){for(;lr!==null&&!rR();)LT(lr)}function LT(e){var t=$T(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?BT(e):lr=t,Zx.current=null}function BT(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=S3(r,t),r!==null){r.flags&=32767,lr=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pr=6,lr=null;return}}else if(r=E3(r,t,Rn),r!==null){lr=r;return}if(t=t.sibling,t!==null){lr=t;return}lr=t=e}while(t!==null);pr===0&&(pr=5)}function Ji(e,t,r){var n=Pt,a=aa.transition;try{aa.transition=null,Pt=1,j3(e,t,r,n)}finally{aa.transition=a,Pt=n}return null}function j3(e,t,r,n){do Dl();while(pi!==null);if(Et&6)throw Error(ke(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ke(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(dR(e,s),e===_r&&(lr=_r=null,Dr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||wd||(wd=!0,zT(Nh,function(){return Dl(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=aa.transition,aa.transition=null;var i=Pt;Pt=1;var o=Et;Et|=4,Zx.current=null,k3(e,r),RT(r,e),QR(Ag),Ch=!!Ng,Ag=Ng=null,e.current=r,N3(r),nR(),Et=o,Pt=i,aa.transition=s}else e.current=r;if(wd&&(wd=!1,pi=e,Wh=a),s=e.pendingLanes,s===0&&(Ei=null),iR(r.stateNode),Pn(e,tr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(qh)throw qh=!1,e=Kg,Kg=null,e;return Wh&1&&e.tag!==0&&Dl(),s=e.pendingLanes,s&1?e===Yg?Tu++:(Tu=0,Yg=e):Tu=0,Ui(),null}function Dl(){if(pi!==null){var e=yS(Wh),t=aa.transition,r=Pt;try{if(aa.transition=null,Pt=16>e?16:e,pi===null)var n=!1;else{if(e=pi,pi=null,Wh=0,Et&6)throw Error(ke(331));var a=Et;for(Et|=4,Fe=e.current;Fe!==null;){var s=Fe,i=s.child;if(Fe.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(Fe=u;Fe!==null;){var f=Fe;switch(f.tag){case 0:case 11:case 15:Eu(8,f,s)}var d=f.child;if(d!==null)d.return=f,Fe=d;else for(;Fe!==null;){f=Fe;var h=f.sibling,p=f.return;if(PT(f),f===u){Fe=null;break}if(h!==null){h.return=p,Fe=h;break}Fe=p}}}var v=s.alternate;if(v!==null){var m=v.child;if(m!==null){v.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(m!==null)}}Fe=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,Fe=i;else e:for(;Fe!==null;){if(s=Fe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Eu(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,Fe=x;break e}Fe=s.return}}var y=e.current;for(Fe=y;Fe!==null;){i=Fe;var w=i.child;if(i.subtreeFlags&2064&&w!==null)w.return=i,Fe=w;else e:for(i=y;Fe!==null;){if(o=Fe,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:M0(9,o)}}catch(_){Jt(o,o.return,_)}if(o===i){Fe=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,Fe=b;break e}Fe=o.return}}if(Et=a,Ui(),Za&&typeof Za.onPostCommitFiberRoot=="function")try{Za.onPostCommitFiberRoot(C0,e)}catch{}n=!0}return n}finally{Pt=r,aa.transition=t}}return!1}function Xw(e,t,r){t=cc(r,t),t=yT(e,t,1),e=_i(e,t,1),t=fn(),e!==null&&(If(e,1,t),Pn(e,t))}function Jt(e,t,r){if(e.tag===3)Xw(e,e,r);else for(;t!==null;){if(t.tag===3){Xw(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ei===null||!Ei.has(n))){e=cc(r,e),e=wT(t,e,1),t=_i(t,e,1),e=fn(),t!==null&&(If(t,1,e),Pn(t,e));break}}t=t.return}}function R3(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=fn(),e.pingedLanes|=e.suspendedLanes&r,_r===e&&(Dr&r)===r&&(pr===4||pr===3&&(Dr&130023424)===Dr&&500>tr()-ty?yo(e,0):ey|=r),Pn(e,t)}function UT(e,t){t===0&&(e.mode&1?(t=ud,ud<<=1,!(ud&130023424)&&(ud=4194304)):t=1);var r=fn();e=As(e,t),e!==null&&(If(e,t,r),Pn(e,r))}function I3(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),UT(e,r)}function F3(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ke(314))}n!==null&&n.delete(t),UT(e,r)}var $T;$T=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||An.current)Tn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Tn=!1,_3(e,t,r);Tn=!!(e.flags&131072)}else Tn=!1,zt&&t.flags&1048576&&WS(t,Dh,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;nh(e,t),e=t.pendingProps;var a=sc(t,Xr.current);Fl(t,r),a=Kx(null,t,n,e,a,r);var s=Yx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Cn(n)?(s=!0,Ih(t)):s=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Hx(t),a.updater=D0,t.stateNode=a,a._reactInternals=t,Mg(t,n,e,r),t=Ug(null,t,n,!0,s,r)):(t.tag=0,zt&&s&&Dx(t),rn(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(nh(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=M3(n),e=ya(n,e),a){case 0:t=Bg(null,t,n,e,r);break e;case 1:t=Uw(null,t,n,e,r);break e;case 11:t=Lw(null,t,n,e,r);break e;case 14:t=Bw(null,t,n,ya(n.type,e),r);break e}throw Error(ke(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ya(n,a),Bg(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ya(n,a),Uw(e,t,n,a,r);case 3:e:{if(ST(t),e===null)throw Error(ke(387));n=t.pendingProps,s=t.memoizedState,a=s.element,JS(e,t),Bh(t,n,null,r);var i=t.memoizedState;if(n=i.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){a=cc(Error(ke(423)),t),t=$w(e,t,n,r,a);break e}else if(n!==a){a=cc(Error(ke(424)),t),t=$w(e,t,n,r,a);break e}else for(Un=bi(t.stateNode.containerInfo.firstChild),$n=t,zt=!0,Ta=null,r=YS(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ic(),n===a){t=Cs(e,t,r);break e}rn(e,t,n,r)}t=t.child}return t;case 5:return QS(t),e===null&&Ig(t),n=t.type,a=t.pendingProps,s=e!==null?e.memoizedProps:null,i=a.children,Cg(n,a)?i=null:s!==null&&Cg(n,s)&&(t.flags|=32),ET(e,t),rn(e,t,i,r),t.child;case 6:return e===null&&Ig(t),null;case 13:return TT(e,t,r);case 4:return qx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=oc(t,null,n,r):rn(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ya(n,a),Lw(e,t,n,a,r);case 7:return rn(e,t,t.pendingProps,r),t.child;case 8:return rn(e,t,t.pendingProps.children,r),t.child;case 12:return rn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,s=t.memoizedProps,i=a.value,Ft(Mh,n._currentValue),n._currentValue=i,s!==null)if(Ra(s.value,i)){if(s.children===a.children&&!An.current){t=Cs(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){i=s.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=_s(-1,r&-r),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Fg(s.return,r,t),o.lanes|=r;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(ke(341));i.lanes|=r,o=i.alternate,o!==null&&(o.lanes|=r),Fg(i,r,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}rn(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,Fl(t,r),a=ia(a),n=n(a),t.flags|=1,rn(e,t,n,r),t.child;case 14:return n=t.type,a=ya(n,t.pendingProps),a=ya(n.type,a),Bw(e,t,n,a,r);case 15:return bT(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ya(n,a),nh(e,t),t.tag=1,Cn(n)?(e=!0,Ih(t)):e=!1,Fl(t,r),xT(t,n,a),Mg(t,n,a,r),Ug(null,t,n,!0,e,r);case 19:return kT(e,t,r);case 22:return _T(e,t,r)}throw Error(ke(156,t.tag))};function zT(e,t){return mS(e,t)}function D3(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function na(e,t,r,n){return new D3(e,t,r,n)}function sy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function M3(e){if(typeof e=="function")return sy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sx)return 11;if(e===Tx)return 14}return 2}function Ti(e,t){var r=e.alternate;return r===null?(r=na(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ih(e,t,r,n,a,s){var i=2;if(n=e,typeof e=="function")sy(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case pl:return wo(r.children,a,s,t);case Ex:i=8,a|=8;break;case og:return e=na(12,r,t,a|2),e.elementType=og,e.lanes=s,e;case lg:return e=na(13,r,t,a),e.elementType=lg,e.lanes=s,e;case cg:return e=na(19,r,t,a),e.elementType=cg,e.lanes=s,e;case QE:return B0(r,a,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case XE:i=10;break e;case JE:i=9;break e;case Sx:i=11;break e;case Tx:i=14;break e;case Xs:i=16,n=null;break e}throw Error(ke(130,e==null?e:typeof e,""))}return t=na(i,r,t,a),t.elementType=e,t.type=n,t.lanes=s,t}function wo(e,t,r,n){return e=na(7,e,n,t),e.lanes=r,e}function B0(e,t,r,n){return e=na(22,e,n,t),e.elementType=QE,e.lanes=r,e.stateNode={isHidden:!1},e}function sm(e,t,r){return e=na(6,e,null,t),e.lanes=r,e}function im(e,t,r){return t=na(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function L3(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Up(0),this.expirationTimes=Up(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Up(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function iy(e,t,r,n,a,s,i,o,l){return e=new L3(e,t,r,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=na(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hx(s),e}function B3(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function HT(e){if(!e)return Oi;e=e._reactInternals;e:{if(Bo(e)!==e||e.tag!==1)throw Error(ke(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Cn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ke(171))}if(e.tag===1){var r=e.type;if(Cn(r))return HS(e,r,t)}return t}function qT(e,t,r,n,a,s,i,o,l){return e=iy(r,n,!0,e,a,s,i,o,l),e.context=HT(null),r=e.current,n=fn(),a=Si(r),s=_s(n,a),s.callback=t??null,_i(r,s,a),e.current.lanes=a,If(e,a,n),Pn(e,n),e}function U0(e,t,r,n){var a=t.current,s=fn(),i=Si(a);return r=HT(r),t.context===null?t.context=r:t.pendingContext=r,t=_s(s,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=_i(a,t,i),e!==null&&(Pa(e,a,i,s),eh(e,a,i)),i}function Gh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Jw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function oy(e,t){Jw(e,t),(e=e.alternate)&&Jw(e,t)}function U3(){return null}var WT=typeof reportError=="function"?reportError:function(e){console.error(e)};function ly(e){this._internalRoot=e}$0.prototype.render=ly.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ke(409));U0(e,t,null,null)};$0.prototype.unmount=ly.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Co(function(){U0(null,e,null,null)}),t[Ns]=null}};function $0(e){this._internalRoot=e}$0.prototype.unstable_scheduleHydration=function(e){if(e){var t=_S();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ei.length&&t!==0&&t<ei[r].priority;r++);ei.splice(r,0,e),r===0&&SS(e)}};function cy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function z0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qw(){}function $3(e,t,r,n,a){if(a){if(typeof n=="function"){var s=n;n=function(){var u=Gh(i);s.call(u)}}var i=qT(t,n,e,0,null,!1,!1,"",Qw);return e._reactRootContainer=i,e[Ns]=i.current,Ku(e.nodeType===8?e.parentNode:e),Co(),i}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var o=n;n=function(){var u=Gh(l);o.call(u)}}var l=iy(e,0,!1,null,null,!1,!1,"",Qw);return e._reactRootContainer=l,e[Ns]=l.current,Ku(e.nodeType===8?e.parentNode:e),Co(function(){U0(t,l,r,n)}),l}function H0(e,t,r,n,a){var s=r._reactRootContainer;if(s){var i=s;if(typeof a=="function"){var o=a;a=function(){var l=Gh(i);o.call(l)}}U0(t,i,e,a)}else i=$3(r,t,e,a,n);return Gh(i)}wS=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=nu(t.pendingLanes);r!==0&&(Ax(t,r|1),Pn(t,tr()),!(Et&6)&&(uc=tr()+500,Ui()))}break;case 13:Co(function(){var n=As(e,1);if(n!==null){var a=fn();Pa(n,e,1,a)}}),oy(e,1)}};Cx=function(e){if(e.tag===13){var t=As(e,134217728);if(t!==null){var r=fn();Pa(t,e,134217728,r)}oy(e,134217728)}};bS=function(e){if(e.tag===13){var t=Si(e),r=As(e,t);if(r!==null){var n=fn();Pa(r,e,t,n)}oy(e,t)}};_S=function(){return Pt};ES=function(e,t){var r=Pt;try{return Pt=e,t()}finally{Pt=r}};yg=function(e,t,r){switch(t){case"input":if(dg(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=R0(n);if(!a)throw Error(ke(90));eS(n),dg(n,a)}}}break;case"textarea":rS(e,r);break;case"select":t=r.value,t!=null&&Ol(e,!!r.multiple,t,!1)}};cS=ry;uS=Co;var z3={usingClientEntryPoint:!1,Events:[Df,xl,R0,oS,lS,ry]},Hc={findFiberByHostInstance:no,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},H3={bundleType:Hc.bundleType,version:Hc.version,rendererPackageName:Hc.rendererPackageName,rendererConfig:Hc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Rs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hS(e),e===null?null:e.stateNode},findFiberByHostInstance:Hc.findFiberByHostInstance||U3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bd.isDisabled&&bd.supportsFiber)try{C0=bd.inject(H3),Za=bd}catch{}}Wn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z3;Wn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cy(t))throw Error(ke(200));return B3(e,t,null,r)};Wn.createRoot=function(e,t){if(!cy(e))throw Error(ke(299));var r=!1,n="",a=WT;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=iy(e,1,!1,null,null,r,!1,n,a),e[Ns]=t.current,Ku(e.nodeType===8?e.parentNode:e),new ly(t)};Wn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ke(188)):(e=Object.keys(e).join(","),Error(ke(268,e)));return e=hS(t),e=e===null?null:e.stateNode,e};Wn.flushSync=function(e){return Co(e)};Wn.hydrate=function(e,t,r){if(!z0(t))throw Error(ke(200));return H0(null,e,t,!0,r)};Wn.hydrateRoot=function(e,t,r){if(!cy(e))throw Error(ke(405));var n=r!=null&&r.hydratedSources||null,a=!1,s="",i=WT;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=qT(t,null,e,1,r??null,a,!1,s,i),e[Ns]=t.current,Ku(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new $0(t)};Wn.render=function(e,t,r){if(!z0(t))throw Error(ke(200));return H0(null,e,t,!1,r)};Wn.unmountComponentAtNode=function(e){if(!z0(e))throw Error(ke(40));return e._reactRootContainer?(Co(function(){H0(null,null,e,!1,function(){e._reactRootContainer=null,e[Ns]=null})}),!0):!1};Wn.unstable_batchedUpdates=ry;Wn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!z0(r))throw Error(ke(200));if(e==null||e._reactInternals===void 0)throw Error(ke(38));return H0(e,t,r,!1,n)};Wn.version="18.3.1-next-f1338f8080-20240426";function VT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VT)}catch(e){console.error(e)}}VT(),VE.exports=Wn;var $i=VE.exports;const GT=mx($i);var KT,Zw=$i;KT=Zw.createRoot,Zw.hydrateRoot;const q3=1,W3=1e6;let om=0;function V3(){return om=(om+1)%Number.MAX_SAFE_INTEGER,om.toString()}const lm=new Map,eb=e=>{if(lm.has(e))return;const t=setTimeout(()=>{lm.delete(e),ku({type:"REMOVE_TOAST",toastId:e})},W3);lm.set(e,t)},G3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,q3)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?eb(r):e.toasts.forEach(n=>{eb(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},oh=[];let lh={toasts:[]};function ku(e){lh=G3(lh,e),oh.forEach(t=>{t(lh)})}function K3({...e}){const t=V3(),r=a=>ku({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>ku({type:"DISMISS_TOAST",toastId:t});return ku({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function Is(){const[e,t]=S.useState(lh);return S.useEffect(()=>(oh.push(t),()=>{const r=oh.indexOf(t);r>-1&&oh.splice(r,1)}),[e]),{...e,toast:K3,dismiss:r=>ku({type:"DISMISS_TOAST",toastId:r})}}function Pe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function tb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fs(...e){return t=>{let r=!1;const n=e.map(a=>{const s=tb(a,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let a=0;a<n.length;a++){const s=n[a];typeof s=="function"?s():tb(e[a],null)}}}}function Tt(...e){return S.useCallback(Fs(...e),e)}function Y3(e,t){const r=S.createContext(t),n=s=>{const{children:i,...o}=s,l=S.useMemo(()=>o,Object.values(o));return c.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function a(s){const i=S.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,a]}function Da(e,t=[]){let r=[];function n(s,i){const o=S.createContext(i),l=r.length;r=[...r,i];const u=d=>{var x;const{scope:h,children:p,...v}=d,m=((x=h==null?void 0:h[e])==null?void 0:x[l])||o,g=S.useMemo(()=>v,Object.values(v));return c.jsx(m.Provider,{value:g,children:p})};u.displayName=s+"Provider";function f(d,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[l])||o,v=S.useContext(p);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const a=()=>{const s=r.map(i=>S.createContext(i));return function(o){const l=(o==null?void 0:o[e])||s;return S.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return a.scopeName=e,[n,X3(a,...t)]}function X3(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const i=n.reduce((o,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...o,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function rb(e){const t=J3(e),r=S.forwardRef((n,a)=>{const{children:s,...i}=n,o=S.Children.toArray(s),l=o.find(Z3);if(l){const u=l.props.children,f=o.map(d=>d===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...i,ref:a,children:S.isValidElement(u)?S.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function J3(e){const t=S.forwardRef((r,n)=>{const{children:a,...s}=r;if(S.isValidElement(a)){const i=tI(a),o=eI(s,a.props);return a.type!==S.Fragment&&(o.ref=n?Fs(n,i):i),S.cloneElement(a,o)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Q3=Symbol("radix.slottable");function Z3(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Q3}function eI(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function tI(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function q0(e){const t=e+"CollectionProvider",[r,n]=Da(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:x}=m,y=Ce.useRef(null),w=Ce.useRef(new Map).current;return c.jsx(a,{scope:g,itemMap:w,collectionRef:y,children:x})};i.displayName=t;const o=e+"CollectionSlot",l=rb(o),u=Ce.forwardRef((m,g)=>{const{scope:x,children:y}=m,w=s(o,x),b=Tt(g,w.collectionRef);return c.jsx(l,{ref:b,children:y})});u.displayName=o;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=rb(f),p=Ce.forwardRef((m,g)=>{const{scope:x,children:y,...w}=m,b=Ce.useRef(null),_=Tt(g,b),T=s(f,x);return Ce.useEffect(()=>(T.itemMap.set(b,{ref:b,...w}),()=>void T.itemMap.delete(b))),c.jsx(h,{[d]:"",ref:_,children:y})});p.displayName=f;function v(m){const g=s(e+"CollectionConsumer",m);return Ce.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((T,E)=>w.indexOf(T.ref.current)-w.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:p},v,n]}function rI(e){const t=nI(e),r=S.forwardRef((n,a)=>{const{children:s,...i}=n,o=S.Children.toArray(s),l=o.find(sI);if(l){const u=l.props.children,f=o.map(d=>d===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...i,ref:a,children:S.isValidElement(u)?S.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function nI(e){const t=S.forwardRef((r,n)=>{const{children:a,...s}=r;if(S.isValidElement(a)){const i=oI(a),o=iI(s,a.props);return a.type!==S.Fragment&&(o.ref=n?Fs(n,i):i),S.cloneElement(a,o)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aI=Symbol("radix.slottable");function sI(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aI}function iI(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function oI(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=lI.reduce((e,t)=>{const r=rI(`Primitive.${t}`),n=S.forwardRef((a,s)=>{const{asChild:i,...o}=a,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uy(e,t){e&&$i.flushSync(()=>e.dispatchEvent(t))}function On(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function cI(e,t=globalThis==null?void 0:globalThis.document){const r=On(e);S.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var uI="DismissableLayer",Qg="dismissableLayer.update",fI="dismissableLayer.pointerDownOutside",dI="dismissableLayer.focusOutside",nb,YT=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xc=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:i,onDismiss:o,...l}=e,u=S.useContext(YT),[f,d]=S.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),v=Tt(t,E=>d(E)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(g),y=f?m.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,b=y>=x,_=pI(E=>{const C=E.target,P=[...u.branches].some(N=>N.contains(C));!b||P||(a==null||a(E),i==null||i(E),E.defaultPrevented||o==null||o())},h),T=mI(E=>{const C=E.target;[...u.branches].some(N=>N.contains(C))||(s==null||s(E),i==null||i(E),E.defaultPrevented||o==null||o())},h);return cI(E=>{y===u.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},h),S.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(nb=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ab(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=nb)}},[f,h,r,u]),S.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ab())},[f,u]),S.useEffect(()=>{const E=()=>p({});return document.addEventListener(Qg,E),()=>document.removeEventListener(Qg,E)},[]),c.jsx(Ze.div,{...l,ref:v,style:{pointerEvents:w?b?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,_.onPointerDownCapture)})});xc.displayName=uI;var hI="DismissableLayerBranch",XT=S.forwardRef((e,t)=>{const r=S.useContext(YT),n=S.useRef(null),a=Tt(t,n);return S.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),c.jsx(Ze.div,{...e,ref:a})});XT.displayName=hI;function pI(e,t=globalThis==null?void 0:globalThis.document){const r=On(e),n=S.useRef(!1),a=S.useRef(()=>{});return S.useEffect(()=>{const s=o=>{if(o.target&&!n.current){let l=function(){JT(fI,r,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function mI(e,t=globalThis==null?void 0:globalThis.document){const r=On(e),n=S.useRef(!1);return S.useEffect(()=>{const a=s=>{s.target&&!n.current&&JT(dI,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ab(){const e=new CustomEvent(Qg);document.dispatchEvent(e)}function JT(e,t,r,{discrete:n}){const a=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?uy(a,s):a.dispatchEvent(s)}var gI=xc,vI=XT,Ur=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},xI="Portal",Lf=S.forwardRef((e,t)=>{var o;const{container:r,...n}=e,[a,s]=S.useState(!1);Ur(()=>s(!0),[]);const i=r||a&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?GT.createPortal(c.jsx(Ze.div,{...n,ref:t}),i):null});Lf.displayName=xI;function yI(e,t){return S.useReducer((r,n)=>t[r][n]??r,e)}var Ma=e=>{const{present:t,children:r}=e,n=wI(t),a=typeof r=="function"?r({present:n.isPresent}):S.Children.only(r),s=Tt(n.ref,bI(a));return typeof r=="function"||n.isPresent?S.cloneElement(a,{ref:s}):null};Ma.displayName="Presence";function wI(e){const[t,r]=S.useState(),n=S.useRef(null),a=S.useRef(e),s=S.useRef("none"),i=e?"mounted":"unmounted",[o,l]=yI(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=_d(n.current);s.current=o==="mounted"?u:"none"},[o]),Ur(()=>{const u=n.current,f=a.current;if(f!==e){const h=s.current,p=_d(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),Ur(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=p=>{const m=_d(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!a.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=p=>{p.target===t&&(s.current=_d(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:S.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function _d(e){return(e==null?void 0:e.animationName)||"none"}function bI(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _I=A0[" useInsertionEffect ".trim().toString()]||Ur;function ji({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,s,i]=EI({defaultProp:t,onChange:r}),o=e!==void 0,l=o?e:a;{const f=S.useRef(e!==void 0);S.useEffect(()=>{const d=f.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=o},[o,n])}const u=S.useCallback(f=>{var d;if(o){const h=SI(f)?f(e):f;h!==e&&((d=i.current)==null||d.call(i,h))}else s(f)},[o,e,s,i]);return[l,u]}function EI({defaultProp:e,onChange:t}){const[r,n]=S.useState(e),a=S.useRef(r),s=S.useRef(t);return _I(()=>{s.current=t},[t]),S.useEffect(()=>{var i;a.current!==r&&((i=s.current)==null||i.call(s,r),a.current=r)},[r,a]),[r,n,s]}function SI(e){return typeof e=="function"}var QT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),TI="VisuallyHidden",W0=S.forwardRef((e,t)=>c.jsx(Ze.span,{...e,ref:t,style:{...QT,...e.style}}));W0.displayName=TI;var kI=W0,fy="ToastProvider",[dy,NI,AI]=q0("Toast"),[ZT]=Da("Toast",[AI]),[CI,V0]=ZT(fy),ek=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:i}=e,[o,l]=S.useState(null),[u,f]=S.useState(0),d=S.useRef(!1),h=S.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${fy}\`. Expected non-empty \`string\`.`),c.jsx(dy.Provider,{scope:t,children:c.jsx(CI,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:s,toastCount:u,viewport:o,onViewportChange:l,onToastAdd:S.useCallback(()=>f(p=>p+1),[]),onToastRemove:S.useCallback(()=>f(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:i})})};ek.displayName=fy;var tk="ToastViewport",PI=["F8"],Zg="toast.viewportPause",ev="toast.viewportResume",rk=S.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=PI,label:a="Notifications ({hotkey})",...s}=e,i=V0(tk,r),o=NI(r),l=S.useRef(null),u=S.useRef(null),f=S.useRef(null),d=S.useRef(null),h=Tt(t,d,i.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;S.useEffect(()=>{const g=x=>{var w;n.length!==0&&n.every(b=>x[b]||x.code===b)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),S.useEffect(()=>{const g=l.current,x=d.current;if(v&&g&&x){const y=()=>{if(!i.isClosePausedRef.current){const T=new CustomEvent(Zg);x.dispatchEvent(T),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const T=new CustomEvent(ev);x.dispatchEvent(T),i.isClosePausedRef.current=!1}},b=T=>{!g.contains(T.relatedTarget)&&w()},_=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",y),g.addEventListener("focusout",b),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",_),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",b),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",_),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[v,i.isClosePausedRef]);const m=S.useCallback(({tabbingDirection:g})=>{const y=o().map(w=>{const b=w.ref.current,_=[b,...HI(b)];return g==="forwards"?_:_.reverse()});return(g==="forwards"?y.reverse():y).flat()},[o]);return S.useEffect(()=>{const g=d.current;if(g){const x=y=>{var _,T,E;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const C=document.activeElement,P=y.shiftKey;if(y.target===g&&P){(_=u.current)==null||_.focus();return}const A=m({tabbingDirection:P?"backwards":"forwards"}),I=A.findIndex(M=>M===C);cm(A.slice(I+1))?y.preventDefault():P?(T=u.current)==null||T.focus():(E=f.current)==null||E.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[o,m]),c.jsxs(vI,{ref:l,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&c.jsx(tv,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});cm(g)}}),c.jsx(dy.Slot,{scope:r,children:c.jsx(Ze.ol,{tabIndex:-1,...s,ref:h})}),v&&c.jsx(tv,{ref:f,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});cm(g)}})]})});rk.displayName=tk;var nk="ToastFocusProxy",tv=S.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,s=V0(nk,r);return c.jsx(W0,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const o=i.relatedTarget;!((u=s.viewport)!=null&&u.contains(o))&&n()}})});tv.displayName=nk;var Bf="Toast",OI="toast.swipeStart",jI="toast.swipeMove",RI="toast.swipeCancel",II="toast.swipeEnd",ak=S.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:s,...i}=e,[o,l]=ji({prop:n,defaultProp:a??!0,onChange:s,caller:Bf});return c.jsx(Ma,{present:r||o,children:c.jsx(MI,{open:o,...i,ref:t,onClose:()=>l(!1),onPause:On(e.onPause),onResume:On(e.onResume),onSwipeStart:Pe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});ak.displayName=Bf;var[FI,DI]=ZT(Bf,{onClose(){}}),MI=S.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:s,onClose:i,onEscapeKeyDown:o,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:p,...v}=e,m=V0(Bf,r),[g,x]=S.useState(null),y=Tt(t,M=>x(M)),w=S.useRef(null),b=S.useRef(null),_=a||m.duration,T=S.useRef(0),E=S.useRef(_),C=S.useRef(0),{onToastAdd:P,onToastRemove:N}=m,k=On(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=m.viewport)==null||U.focus()),i()}),A=S.useCallback(M=>{!M||M===1/0||(window.clearTimeout(C.current),T.current=new Date().getTime(),C.current=window.setTimeout(k,M))},[k]);S.useEffect(()=>{const M=m.viewport;if(M){const U=()=>{A(E.current),u==null||u()},W=()=>{const G=new Date().getTime()-T.current;E.current=E.current-G,window.clearTimeout(C.current),l==null||l()};return M.addEventListener(Zg,W),M.addEventListener(ev,U),()=>{M.removeEventListener(Zg,W),M.removeEventListener(ev,U)}}},[m.viewport,_,l,u,A]),S.useEffect(()=>{s&&!m.isClosePausedRef.current&&A(_)},[s,_,m.isClosePausedRef,A]),S.useEffect(()=>(P(),()=>N()),[P,N]);const I=S.useMemo(()=>g?fk(g):null,[g]);return m.viewport?c.jsxs(c.Fragment,{children:[I&&c.jsx(LI,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:I}),c.jsx(FI,{scope:r,onClose:k,children:$i.createPortal(c.jsx(dy.ItemSlot,{scope:r,children:c.jsx(gI,{asChild:!0,onEscapeKeyDown:Pe(o,()=>{m.isFocusedToastEscapeKeyDownRef.current||k(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(Ze.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,M=>{M.key==="Escape"&&(o==null||o(M.nativeEvent),M.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:Pe(e.onPointerDown,M=>{M.button===0&&(w.current={x:M.clientX,y:M.clientY})}),onPointerMove:Pe(e.onPointerMove,M=>{if(!w.current)return;const U=M.clientX-w.current.x,W=M.clientY-w.current.y,G=!!b.current,Q=["left","right"].includes(m.swipeDirection),R=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,z=Q?R(0,U):0,D=Q?0:R(0,W),O=M.pointerType==="touch"?10:2,j={x:z,y:D},B={originalEvent:M,delta:j};G?(b.current=j,Ed(jI,d,B,{discrete:!1})):sb(j,m.swipeDirection,O)?(b.current=j,Ed(OI,f,B,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(U)>O||Math.abs(W)>O)&&(w.current=null)}),onPointerUp:Pe(e.onPointerUp,M=>{const U=b.current,W=M.target;if(W.hasPointerCapture(M.pointerId)&&W.releasePointerCapture(M.pointerId),b.current=null,w.current=null,U){const G=M.currentTarget,Q={originalEvent:M,delta:U};sb(U,m.swipeDirection,m.swipeThreshold)?Ed(II,p,Q,{discrete:!0}):Ed(RI,h,Q,{discrete:!0}),G.addEventListener("click",R=>R.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),LI=e=>{const{__scopeToast:t,children:r,...n}=e,a=V0(Bf,t),[s,i]=S.useState(!1),[o,l]=S.useState(!1);return $I(()=>i(!0)),S.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:c.jsx(Lf,{asChild:!0,children:c.jsx(W0,{...n,children:s&&c.jsxs(c.Fragment,{children:[a.label," ",r]})})})},BI="ToastTitle",sk=S.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(Ze.div,{...n,ref:t})});sk.displayName=BI;var UI="ToastDescription",ik=S.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return c.jsx(Ze.div,{...n,ref:t})});ik.displayName=UI;var ok="ToastAction",lk=S.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?c.jsx(uk,{altText:r,asChild:!0,children:c.jsx(hy,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ok}\`. Expected non-empty \`string\`.`),null)});lk.displayName=ok;var ck="ToastClose",hy=S.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=DI(ck,r);return c.jsx(uk,{asChild:!0,children:c.jsx(Ze.button,{type:"button",...n,ref:t,onClick:Pe(e.onClick,a.onClose)})})});hy.displayName=ck;var uk=S.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return c.jsx(Ze.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function fk(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),zI(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...fk(n))}}),t}function Ed(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?uy(a,s):a.dispatchEvent(s)}var sb=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),s=n>a;return t==="left"||t==="right"?s&&n>r:!s&&a>r};function $I(e=()=>{}){const t=On(e);Ur(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function zI(e){return e.nodeType===e.ELEMENT_NODE}function HI(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function cm(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var qI=ek,dk=rk,hk=ak,pk=sk,mk=ik,gk=lk,vk=hy;function xk(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=xk(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function yk(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=xk(e))&&(n&&(n+=" "),n+=t);return n}const ib=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ob=yk,Uf=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ob(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(u=>{const f=r==null?void 0:r[u],d=s==null?void 0:s[u];if(f===null)return null;const h=ib(f)||ib(d);return a[u][h]}),o=r&&Object.entries(r).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(v=>{let[m,g]=v;return Array.isArray(g)?g.includes({...s,...o}[m]):{...s,...o}[m]===g})?[...u,d,h]:u},[]);return ob(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wk=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var VI={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"};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GI=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:i,...o},l)=>S.createElement("svg",{ref:l,...VI,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:wk("lucide",a),...o},[...i.map(([u,f])=>S.createElement(u,f)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qe=(e,t)=>{const r=S.forwardRef(({className:n,...a},s)=>S.createElement(GI,{ref:s,iconNode:t,className:wk(`lucide-${WI(e)}`,n),...a}));return r.displayName=`${e}`,r};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ki=qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $f=qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KI=qe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const py=qe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bk=qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const my=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _k=qe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gy=qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YI=qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XI=qe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JI=qe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const QI=qe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const G0=qe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ZI=qe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ml=qe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eF=qe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tF=qe("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lb=qe("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rF=qe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ek=qe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nF=qe("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sk=qe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aF=qe("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const um=qe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rv=qe("Leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sF=qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cb=qe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iF=qe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kh=qe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oF=qe("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ub=qe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lF=qe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yh=qe("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cF=qe("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uF=qe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ch=qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fF=qe("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dF=qe("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fm=qe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tk=qe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const K0=qe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uh=qe("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vy=qe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xo=qe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kk=qe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Nk=qe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dm=qe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hF=qe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pF=qe("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mF=qe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xh=qe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fb=qe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ak=qe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ri=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Y0=qe("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),xy="-",gF=e=>{const t=xF(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const o=i.split(xy);return o[0]===""&&o.length!==1&&o.shift(),Ck(o,t)||vF(i)},getConflictingClassGroupIds:(i,o)=>{const l=r[i]||[];return o&&n[i]?[...l,...n[i]]:l}}},Ck=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?Ck(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(xy);return(i=t.validators.find(({validator:o})=>o(s)))==null?void 0:i.classGroupId},db=/^\[(.+)\]$/,vF=e=>{if(db.test(e)){const t=db.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},xF=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return wF(Object.entries(e.classGroups),r).forEach(([s,i])=>{nv(i,n,s,t)}),n},nv=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:hb(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(yF(a)){nv(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,i])=>{nv(i,hb(t,s),r,n)})})},hb=(e,t)=>{let r=e;return t.split(xy).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},yF=e=>e.isThemeGetter,wF=(e,t)=>t?e.map(([r,n])=>{const a=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,o])=>[t+i,o])):s);return[r,a]}):e,bF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return a(s,i),i},set(s,i){r.has(s)?r.set(s,i):a(s,i)}}},Pk="!",_F=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],s=t.length,i=o=>{const l=[];let u=0,f=0,d;for(let g=0;g<o.length;g++){let x=o[g];if(u===0){if(x===a&&(n||o.slice(g,g+s)===t)){l.push(o.slice(f,g)),f=g+s;continue}if(x==="/"){d=g;continue}}x==="["?u++:x==="]"&&u--}const h=l.length===0?o:o.substring(f),p=h.startsWith(Pk),v=p?h.substring(1):h,m=d&&d>f?d-f:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:m}};return r?o=>r({className:o,parseClassName:i}):i},EF=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},SF=e=>({cache:bF(e.cacheSize),parseClassName:_F(e),...gF(e)}),TF=/\s+/,kF=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,s=[],i=e.trim().split(TF);let o="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=r(u);let v=!!p,m=n(v?h.substring(0,p):h);if(!m){if(!v){o=u+(o.length>0?" "+o:o);continue}if(m=n(h),!m){o=u+(o.length>0?" "+o:o);continue}v=!1}const g=EF(f).join(":"),x=d?g+Pk:g,y=x+m;if(s.includes(y))continue;s.push(y);const w=a(m,v);for(let b=0;b<w.length;++b){const _=w[b];s.push(x+_)}o=u+(o.length>0?" "+o:o)}return o};function NF(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ok(t))&&(n&&(n+=" "),n+=r);return n}const Ok=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ok(e[n]))&&(r&&(r+=" "),r+=t);return r};function AF(e,...t){let r,n,a,s=i;function i(l){const u=t.reduce((f,d)=>d(f),e());return r=SF(u),n=r.cache.get,a=r.cache.set,s=o,o(l)}function o(l){const u=n(l);if(u)return u;const f=kF(l,r);return a(l,f),f}return function(){return s(NF.apply(null,arguments))}}const Mt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},jk=/^\[(?:([a-z-]+):)?(.+)\]$/i,CF=/^\d+\/\d+$/,PF=new Set(["px","full","screen"]),OF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,IF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,us=e=>Ll(e)||PF.has(e)||CF.test(e),zs=e=>yc(e,"length",HF),Ll=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>yc(e,"number",Ll),qc=e=>!!e&&Number.isInteger(Number(e)),DF=e=>e.endsWith("%")&&Ll(e.slice(0,-1)),nt=e=>jk.test(e),Hs=e=>OF.test(e),MF=new Set(["length","size","percentage"]),LF=e=>yc(e,MF,Rk),BF=e=>yc(e,"position",Rk),UF=new Set(["image","url"]),$F=e=>yc(e,UF,WF),zF=e=>yc(e,"",qF),Wc=()=>!0,yc=(e,t,r)=>{const n=jk.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},HF=e=>jF.test(e)&&!RF.test(e),Rk=()=>!1,qF=e=>IF.test(e),WF=e=>FF.test(e),VF=()=>{const e=Mt("colors"),t=Mt("spacing"),r=Mt("blur"),n=Mt("brightness"),a=Mt("borderColor"),s=Mt("borderRadius"),i=Mt("borderSpacing"),o=Mt("borderWidth"),l=Mt("contrast"),u=Mt("grayscale"),f=Mt("hueRotate"),d=Mt("invert"),h=Mt("gap"),p=Mt("gradientColorStops"),v=Mt("gradientColorStopPositions"),m=Mt("inset"),g=Mt("margin"),x=Mt("opacity"),y=Mt("padding"),w=Mt("saturate"),b=Mt("scale"),_=Mt("sepia"),T=Mt("skew"),E=Mt("space"),C=Mt("translate"),P=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto",nt,t],A=()=>[nt,t],I=()=>["",us,zs],M=()=>["auto",Ll,nt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",nt],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[Ll,nt];return{cacheSize:500,separator:":",theme:{colors:[Wc],spacing:[us,zs],blur:["none","",Hs,nt],brightness:D(),borderColor:[e],borderRadius:["none","","full",Hs,nt],borderSpacing:A(),borderWidth:I(),contrast:D(),grayscale:R(),hueRotate:D(),invert:R(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[DF,zs],inset:k(),margin:k(),opacity:D(),padding:A(),saturate:D(),scale:D(),sepia:R(),skew:D(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",nt]}],container:["container"],columns:[{columns:[Hs]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),nt]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",qc,nt]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",nt]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",qc,nt]}],"grid-cols":[{"grid-cols":[Wc]}],"col-start-end":[{col:["auto",{span:["full",qc,nt]},nt]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Wc]}],"row-start-end":[{row:["auto",{span:[qc,nt]},nt]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",nt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",nt,t]}],"min-w":[{"min-w":[nt,t,"min","max","fit"]}],"max-w":[{"max-w":[nt,t,"none","full","min","max","fit","prose",{screen:[Hs]},Hs]}],h:[{h:[nt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[nt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[nt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[nt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hs,zs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[Wc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",nt]}],"line-clamp":[{"line-clamp":["none",Ll,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",us,nt]}],"list-image":[{"list-image":["none",nt]}],"list-style-type":[{list:["none","disc","decimal",nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",us,zs]}],"underline-offset":[{"underline-offset":["auto",us,nt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),BF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",LF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$F]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:W()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[us,nt]}],"outline-w":[{outline:[us,zs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[us,zs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hs,zF]}],"shadow-color":[{shadow:[Wc]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Hs,nt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",nt]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",nt]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[qc,nt]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",nt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[us,zs,hm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},GF=AF(VF);function je(...e){return GF(yk(e))}const KF=qI,Ik=S.forwardRef(({className:e,...t},r)=>c.jsx(dk,{ref:r,className:je("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ik.displayName=dk.displayName;const YF=Uf("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Fk=S.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(hk,{ref:n,className:je(YF({variant:t}),e),...r}));Fk.displayName=hk.displayName;const XF=S.forwardRef(({className:e,...t},r)=>c.jsx(gk,{ref:r,className:je("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));XF.displayName=gk.displayName;const Dk=S.forwardRef(({className:e,...t},r)=>c.jsx(vk,{ref:r,className:je("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(Ri,{className:"h-4 w-4"})}));Dk.displayName=vk.displayName;const Mk=S.forwardRef(({className:e,...t},r)=>c.jsx(pk,{ref:r,className:je("text-sm font-semibold",e),...t}));Mk.displayName=pk.displayName;const Lk=S.forwardRef(({className:e,...t},r)=>c.jsx(mk,{ref:r,className:je("text-sm opacity-90",e),...t}));Lk.displayName=mk.displayName;function JF(){const{toasts:e}=Is();return c.jsxs(KF,{children:[e.map(function({id:t,title:r,description:n,action:a,...s}){return c.jsxs(Fk,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[r&&c.jsx(Mk,{children:r}),n&&c.jsx(Lk,{children:n})]}),a,c.jsx(Dk,{})]},t)}),c.jsx(Ik,{})]})}var pb=["light","dark"],QF="(prefers-color-scheme: dark)",ZF=S.createContext(void 0),eD={setTheme:e=>{},themes:[]},tD=()=>{var e;return(e=S.useContext(ZF))!=null?e:eD};S.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:s,value:i,attrs:o,nonce:l})=>{let u=s==="system",f=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,d=a?pb.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(v,m=!1,g=!0)=>{let x=i?i[v]:v,y=m?v+"|| ''":`'${x}'`,w="";return a&&g&&!m&&pb.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),r==="class"?m||x?w+=`c.add(${y})`:w+="null":x&&(w+=`d[s](n,${y})`),w},p=e?`!function(){${f}${h(e)}}()`:n?`!function(){try{${f}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${QF}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${u?"":"else{"+h(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(s,!1,!1)};}${d}}catch(t){}}();`;return S.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var rD=e=>{switch(e){case"success":return sD;case"info":return oD;case"warning":return iD;case"error":return lD;default:return null}},nD=Array(12).fill(0),aD=({visible:e,className:t})=>Ce.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ce.createElement("div",{className:"sonner-spinner"},nD.map((r,n)=>Ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),sD=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),iD=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),oD=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lD=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),cD=Ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),uD=()=>{let[e,t]=Ce.useState(document.hidden);return Ce.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},av=1,fD=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:av++,s=this.toasts.find(o=>o.id===a),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),s?this.toasts=this.toasts.map(o=>o.id===a?(this.publish({...o,...e,id:a,title:r}),{...o,...e,id:a,dismissible:i,title:r}):o):this.addToast({title:r,...n,dismissible:i,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),a=r!==void 0,s,i=n.then(async l=>{if(s=["resolve",l],Ce.isValidElement(l))a=!1,this.create({id:r,type:"default",message:l});else if(hD(l)&&!l.ok){a=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:r,type:"error",message:u,description:f})}else if(t.success!==void 0){a=!1;let u=typeof t.success=="function"?await t.success(l):t.success,f=typeof t.description=="function"?await t.description(l):t.description;this.create({id:r,type:"success",message:u,description:f})}}).catch(async l=>{if(s=["reject",l],t.error!==void 0){a=!1;let u=typeof t.error=="function"?await t.error(l):t.error,f=typeof t.description=="function"?await t.description(l):t.description;this.create({id:r,type:"error",message:u,description:f})}}).finally(()=>{var l;a&&(this.dismiss(r),r=void 0),(l=t.finally)==null||l.call(t)}),o=()=>new Promise((l,u)=>i.then(()=>s[0]==="reject"?u(s[1]):l(s[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:o}:Object.assign(r,{unwrap:o})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||av++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},bn=new fD,dD=(e,t)=>{let r=(t==null?void 0:t.id)||av++;return bn.addToast({title:e,...t,id:r}),r},hD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",pD=dD,mD=()=>bn.toasts,gD=()=>bn.getActiveToasts();Object.assign(pD,{success:bn.success,info:bn.info,warning:bn.warning,error:bn.error,custom:bn.custom,message:bn.message,promise:bn.promise,dismiss:bn.dismiss,loading:bn.loading},{getHistory:mD,getToasts:gD});function vD(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}vD(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function Sd(e){return e.label!==void 0}var xD=3,yD="32px",wD="16px",mb=4e3,bD=356,_D=14,ED=20,SD=200;function da(...e){return e.filter(Boolean).join(" ")}function TD(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var kD=e=>{var t,r,n,a,s,i,o,l,u,f,d;let{invert:h,toast:p,unstyled:v,interacting:m,setHeights:g,visibleToasts:x,heights:y,index:w,toasts:b,expanded:_,removeToast:T,defaultRichColors:E,closeButton:C,style:P,cancelButtonStyle:N,actionButtonStyle:k,className:A="",descriptionClassName:I="",duration:M,position:U,gap:W,loadingIcon:G,expandByDefault:Q,classNames:R,icons:z,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:O}=e,[j,B]=Ce.useState(null),[L,F]=Ce.useState(null),[H,Z]=Ce.useState(!1),[X,ne]=Ce.useState(!1),[he,V]=Ce.useState(!1),[Te,Ee]=Ce.useState(!1),[xe,Se]=Ce.useState(!1),[pe,le]=Ce.useState(0),[ue,me]=Ce.useState(0),_e=Ce.useRef(p.duration||M||mb),ye=Ce.useRef(null),Me=Ce.useRef(null),Le=w===0,$e=w+1<=x,tt=p.type,dt=p.dismissible!==!1,Je=p.className||"",ur=p.descriptionClassName||"",Re=Ce.useMemo(()=>y.findIndex(Ve=>Ve.toastId===p.id)||0,[y,p.id]),ot=Ce.useMemo(()=>{var Ve;return(Ve=p.closeButton)!=null?Ve:C},[p.closeButton,C]),rr=Ce.useMemo(()=>p.duration||M||mb,[p.duration,M]),kt=Ce.useRef(0),ie=Ce.useRef(0),Ne=Ce.useRef(0),ze=Ce.useRef(null),[ht,nr]=U.split("-"),ut=Ce.useMemo(()=>y.reduce((Ve,We,it)=>it>=Re?Ve:Ve+We.height,0),[y,Re]),Ot=uD(),Sr=p.invert||h,Tr=tt==="loading";ie.current=Ce.useMemo(()=>Re*W+ut,[Re,ut]),Ce.useEffect(()=>{_e.current=rr},[rr]),Ce.useEffect(()=>{Z(!0)},[]),Ce.useEffect(()=>{let Ve=Me.current;if(Ve){let We=Ve.getBoundingClientRect().height;return me(We),g(it=>[{toastId:p.id,height:We,position:p.position},...it]),()=>g(it=>it.filter(bt=>bt.toastId!==p.id))}},[g,p.id]),Ce.useLayoutEffect(()=>{if(!H)return;let Ve=Me.current,We=Ve.style.height;Ve.style.height="auto";let it=Ve.getBoundingClientRect().height;Ve.style.height=We,me(it),g(bt=>bt.find(He=>He.toastId===p.id)?bt.map(He=>He.toastId===p.id?{...He,height:it}:He):[{toastId:p.id,height:it,position:p.position},...bt])},[H,p.title,p.description,g,p.id]);let At=Ce.useCallback(()=>{ne(!0),le(ie.current),g(Ve=>Ve.filter(We=>We.toastId!==p.id)),setTimeout(()=>{T(p)},SD)},[p,T,g,ie]);Ce.useEffect(()=>{if(p.promise&&tt==="loading"||p.duration===1/0||p.type==="loading")return;let Ve;return _||m||O&&Ot?(()=>{if(Ne.current<kt.current){let We=new Date().getTime()-kt.current;_e.current=_e.current-We}Ne.current=new Date().getTime()})():_e.current!==1/0&&(kt.current=new Date().getTime(),Ve=setTimeout(()=>{var We;(We=p.onAutoClose)==null||We.call(p,p),At()},_e.current)),()=>clearTimeout(Ve)},[_,m,p,tt,O,Ot,At]),Ce.useEffect(()=>{p.delete&&At()},[At,p.delete]);function kr(){var Ve,We,it;return z!=null&&z.loading?Ce.createElement("div",{className:da(R==null?void 0:R.loader,(Ve=p==null?void 0:p.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":tt==="loading"},z.loading):G?Ce.createElement("div",{className:da(R==null?void 0:R.loader,(We=p==null?void 0:p.classNames)==null?void 0:We.loader,"sonner-loader"),"data-visible":tt==="loading"},G):Ce.createElement(aD,{className:da(R==null?void 0:R.loader,(it=p==null?void 0:p.classNames)==null?void 0:it.loader),visible:tt==="loading"})}return Ce.createElement("li",{tabIndex:0,ref:Me,className:da(A,Je,R==null?void 0:R.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[tt],(r=p==null?void 0:p.classNames)==null?void 0:r[tt]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:E,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":H,"data-promise":!!p.promise,"data-swiped":xe,"data-removed":X,"data-visible":$e,"data-y-position":ht,"data-x-position":nr,"data-index":w,"data-front":Le,"data-swiping":he,"data-dismissible":dt,"data-type":tt,"data-invert":Sr,"data-swipe-out":Te,"data-swipe-direction":L,"data-expanded":!!(_||Q&&H),style:{"--index":w,"--toasts-before":w,"--z-index":b.length-w,"--offset":`${X?pe:ie.current}px`,"--initial-height":Q?"auto":`${ue}px`,...P,...p.style},onDragEnd:()=>{V(!1),B(null),ze.current=null},onPointerDown:Ve=>{Tr||!dt||(ye.current=new Date,le(ie.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(V(!0),ze.current={x:Ve.clientX,y:Ve.clientY}))},onPointerUp:()=>{var Ve,We,it,bt;if(Te||!dt)return;ze.current=null;let He=Number(((Ve=Me.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),st=Number(((We=Me.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ct=new Date().getTime()-((it=ye.current)==null?void 0:it.getTime()),xt=j==="x"?He:st,Nr=Math.abs(xt)/Ct;if(Math.abs(xt)>=ED||Nr>.11){le(ie.current),(bt=p.onDismiss)==null||bt.call(p,p),F(j==="x"?He>0?"right":"left":st>0?"down":"up"),At(),Ee(!0),Se(!1);return}V(!1),B(null)},onPointerMove:Ve=>{var We,it,bt,He;if(!ze.current||!dt||((We=window.getSelection())==null?void 0:We.toString().length)>0)return;let st=Ve.clientY-ze.current.y,Ct=Ve.clientX-ze.current.x,xt=(it=e.swipeDirections)!=null?it:TD(U);!j&&(Math.abs(Ct)>1||Math.abs(st)>1)&&B(Math.abs(Ct)>Math.abs(st)?"x":"y");let Nr={x:0,y:0};j==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&st<0||xt.includes("bottom")&&st>0)&&(Nr.y=st):j==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&Ct<0||xt.includes("right")&&Ct>0)&&(Nr.x=Ct),(Math.abs(Nr.x)>0||Math.abs(Nr.y)>0)&&Se(!0),(bt=Me.current)==null||bt.style.setProperty("--swipe-amount-x",`${Nr.x}px`),(He=Me.current)==null||He.style.setProperty("--swipe-amount-y",`${Nr.y}px`)}},ot&&!p.jsx?Ce.createElement("button",{"aria-label":D,"data-disabled":Tr,"data-close-button":!0,onClick:Tr||!dt?()=>{}:()=>{var Ve;At(),(Ve=p.onDismiss)==null||Ve.call(p,p)},className:da(R==null?void 0:R.closeButton,(a=p==null?void 0:p.classNames)==null?void 0:a.closeButton)},(s=z==null?void 0:z.close)!=null?s:cD):null,p.jsx||S.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Ce.createElement(Ce.Fragment,null,tt||p.icon||p.promise?Ce.createElement("div",{"data-icon":"",className:da(R==null?void 0:R.icon,(i=p==null?void 0:p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||kr():null,p.type!=="loading"?p.icon||(z==null?void 0:z[tt])||rD(tt):null):null,Ce.createElement("div",{"data-content":"",className:da(R==null?void 0:R.content,(o=p==null?void 0:p.classNames)==null?void 0:o.content)},Ce.createElement("div",{"data-title":"",className:da(R==null?void 0:R.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?Ce.createElement("div",{"data-description":"",className:da(I,ur,R==null?void 0:R.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),S.isValidElement(p.cancel)?p.cancel:p.cancel&&Sd(p.cancel)?Ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||N,onClick:Ve=>{var We,it;Sd(p.cancel)&&dt&&((it=(We=p.cancel).onClick)==null||it.call(We,Ve),At())},className:da(R==null?void 0:R.cancelButton,(f=p==null?void 0:p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,S.isValidElement(p.action)?p.action:p.action&&Sd(p.action)?Ce.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||k,onClick:Ve=>{var We,it;Sd(p.action)&&((it=(We=p.action).onClick)==null||it.call(We,Ve),!Ve.defaultPrevented&&At())},className:da(R==null?void 0:R.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function gb(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ND(e,t){let r={};return[e,t].forEach((n,a)=>{let s=a===1,i=s?"--mobile-offset":"--offset",o=s?wD:yD;function l(u){["top","right","bottom","left"].forEach(f=>{r[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${i}-${u}`]=o:r[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(o)}),r}var AD=S.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:s,closeButton:i,className:o,offset:l,mobileOffset:u,theme:f="light",richColors:d,duration:h,style:p,visibleToasts:v=xD,toastOptions:m,dir:g=gb(),gap:x=_D,loadingIcon:y,icons:w,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:_}=e,[T,E]=Ce.useState([]),C=Ce.useMemo(()=>Array.from(new Set([n].concat(T.filter(O=>O.position).map(O=>O.position)))),[T,n]),[P,N]=Ce.useState([]),[k,A]=Ce.useState(!1),[I,M]=Ce.useState(!1),[U,W]=Ce.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Ce.useRef(null),Q=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=Ce.useRef(null),z=Ce.useRef(!1),D=Ce.useCallback(O=>{E(j=>{var B;return(B=j.find(L=>L.id===O.id))!=null&&B.delete||bn.dismiss(O.id),j.filter(({id:L})=>L!==O.id)})},[]);return Ce.useEffect(()=>bn.subscribe(O=>{if(O.dismiss){E(j=>j.map(B=>B.id===O.id?{...B,delete:!0}:B));return}setTimeout(()=>{GT.flushSync(()=>{E(j=>{let B=j.findIndex(L=>L.id===O.id);return B!==-1?[...j.slice(0,B),{...j[B],...O},...j.slice(B+1)]:[O,...j]})})})}),[]),Ce.useEffect(()=>{if(f!=="system"){W(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:j})=>{W(j?"dark":"light")})}catch{O.addListener(({matches:B})=>{try{W(B?"dark":"light")}catch(L){console.error(L)}})}},[f]),Ce.useEffect(()=>{T.length<=1&&A(!1)},[T]),Ce.useEffect(()=>{let O=j=>{var B,L;a.every(F=>j[F]||j.code===F)&&(A(!0),(B=G.current)==null||B.focus()),j.code==="Escape"&&(document.activeElement===G.current||(L=G.current)!=null&&L.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),Ce.useEffect(()=>{if(G.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[G.current]),Ce.createElement("section",{ref:t,"aria-label":`${b} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((O,j)=>{var B;let[L,F]=O.split("-");return T.length?Ce.createElement("ol",{key:O,dir:g==="auto"?gb():g,tabIndex:-1,ref:G,className:o,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":L,"data-lifted":k&&T.length>1&&!s,"data-x-position":F,style:{"--front-toast-height":`${((B=P[0])==null?void 0:B.height)||0}px`,"--width":`${bD}px`,"--gap":`${x}px`,...p,...ND(l,u)},onBlur:H=>{z.current&&!H.currentTarget.contains(H.relatedTarget)&&(z.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||z.current||(z.current=!0,R.current=H.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{I||A(!1)},onDragEnd:()=>A(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||M(!0)},onPointerUp:()=>M(!1)},T.filter(H=>!H.position&&j===0||H.position===O).map((H,Z)=>{var X,ne;return Ce.createElement(kD,{key:H.id,icons:w,index:Z,toast:H,defaultRichColors:d,duration:(X=m==null?void 0:m.duration)!=null?X:h,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:v,closeButton:(ne=m==null?void 0:m.closeButton)!=null?ne:i,interacting:I,position:O,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:D,toasts:T.filter(he=>he.position==H.position),heights:P.filter(he=>he.position==H.position),setHeights:N,expandByDefault:s,gap:x,loadingIcon:y,expanded:k,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const CD=({...e})=>{const{theme:t="system"}=tD();return c.jsx(AD,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var PD=A0[" useId ".trim().toString()]||(()=>{}),OD=0;function Oa(e){const[t,r]=S.useState(PD());return Ur(()=>{r(n=>n??String(OD++))},[e]),t?`radix-${t}`:""}const jD=["top","right","bottom","left"],Ii=Math.min,In=Math.max,Jh=Math.round,Td=Math.floor,ts=e=>({x:e,y:e}),RD={left:"right",right:"left",bottom:"top",top:"bottom"},ID={start:"end",end:"start"};function sv(e,t,r){return In(e,Ii(t,r))}function Ps(e,t){return typeof e=="function"?e(t):e}function Os(e){return e.split("-")[0]}function wc(e){return e.split("-")[1]}function yy(e){return e==="x"?"y":"x"}function wy(e){return e==="y"?"height":"width"}const FD=new Set(["top","bottom"]);function Qa(e){return FD.has(Os(e))?"y":"x"}function by(e){return yy(Qa(e))}function DD(e,t,r){r===void 0&&(r=!1);const n=wc(e),a=by(e),s=wy(a);let i=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Qh(i)),[i,Qh(i)]}function MD(e){const t=Qh(e);return[iv(e),t,iv(t)]}function iv(e){return e.replace(/start|end/g,t=>ID[t])}const vb=["left","right"],xb=["right","left"],LD=["top","bottom"],BD=["bottom","top"];function UD(e,t,r){switch(e){case"top":case"bottom":return r?t?xb:vb:t?vb:xb;case"left":case"right":return t?LD:BD;default:return[]}}function $D(e,t,r,n){const a=wc(e);let s=UD(Os(e),r==="start",n);return a&&(s=s.map(i=>i+"-"+a),t&&(s=s.concat(s.map(iv)))),s}function Qh(e){return e.replace(/left|right|bottom|top/g,t=>RD[t])}function zD(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bk(e){return typeof e!="number"?zD(e):{top:e,right:e,bottom:e,left:e}}function Zh(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function yb(e,t,r){let{reference:n,floating:a}=e;const s=Qa(t),i=by(t),o=wy(i),l=Os(t),u=s==="y",f=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,h=n[o]/2-a[o]/2;let p;switch(l){case"top":p={x:f,y:n.y-a.height};break;case"bottom":p={x:f,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-a.width,y:d};break;default:p={x:n.x,y:n.y}}switch(wc(t)){case"start":p[i]-=h*(r&&u?-1:1);break;case"end":p[i]+=h*(r&&u?-1:1);break}return p}const HD=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:i}=r,o=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:f,y:d}=yb(u,n,l),h=n,p={},v=0;for(let m=0;m<o.length;m++){const{name:g,fn:x}=o[m],{x:y,y:w,data:b,reset:_}=await x({x:f,y:d,initialPlacement:n,placement:h,strategy:a,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});f=y??f,d=w??d,p={...p,[g]:{...p[g],...b}},_&&v<=50&&(v++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(u=_.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):_.rects),{x:f,y:d}=yb(u,h,l)),m=-1)}return{x:f,y:d,placement:h,strategy:a,middlewareData:p}};async function nf(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:s,rects:i,elements:o,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Ps(t,e),v=Bk(p),g=o[h?d==="floating"?"reference":"floating":d],x=Zh(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(g)))==null||r?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:f,strategy:l})),y=d==="floating"?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),b=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},_=Zh(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:y,offsetParent:w,strategy:l}):y);return{top:(x.top-_.top+v.top)/b.y,bottom:(_.bottom-x.bottom+v.bottom)/b.y,left:(x.left-_.left+v.left)/b.x,right:(_.right-x.right+v.right)/b.x}}const qD=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:i,elements:o,middlewareData:l}=t,{element:u,padding:f=0}=Ps(e,t)||{};if(u==null)return{};const d=Bk(f),h={x:r,y:n},p=by(a),v=wy(p),m=await i.getDimensions(u),g=p==="y",x=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=s.reference[v]+s.reference[p]-h[p]-s.floating[v],_=h[p]-s.reference[p],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=T?T[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(T)))&&(E=o.floating[w]||s.floating[v]);const C=b/2-_/2,P=E/2-m[v]/2-1,N=Ii(d[x],P),k=Ii(d[y],P),A=N,I=E-m[v]-k,M=E/2-m[v]/2+C,U=sv(A,M,I),W=!l.arrow&&wc(a)!=null&&M!==U&&s.reference[v]/2-(M<A?N:k)-m[v]/2<0,G=W?M<A?M-A:M-I:0;return{[p]:h[p]+G,data:{[p]:U,centerOffset:M-U-G,...W&&{alignmentOffset:G}},reset:W}}}),WD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:i,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...g}=Ps(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const x=Os(a),y=Qa(o),w=Os(o)===o,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(w||!m?[Qh(o)]:MD(o)),T=v!=="none";!h&&T&&_.push(...$D(o,m,v,b));const E=[o,..._],C=await nf(t,g),P=[];let N=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&P.push(C[x]),d){const M=DD(a,i,b);P.push(C[M[0]],C[M[1]])}if(N=[...N,{placement:a,overflows:P}],!P.every(M=>M<=0)){var k,A;const M=(((k=s.flip)==null?void 0:k.index)||0)+1,U=E[M];if(U&&(!(d==="alignment"?y!==Qa(U):!1)||N.every(Q=>Qa(Q.placement)===y?Q.overflows[0]>0:!0)))return{data:{index:M,overflows:N},reset:{placement:U}};let W=(A=N.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:A.placement;if(!W)switch(p){case"bestFit":{var I;const G=(I=N.filter(Q=>{if(T){const R=Qa(Q.placement);return R===y||R==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(R=>R>0).reduce((R,z)=>R+z,0)]).sort((Q,R)=>Q[1]-R[1])[0])==null?void 0:I[0];G&&(W=G);break}case"initialPlacement":W=o;break}if(a!==W)return{reset:{placement:W}}}return{}}}};function wb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bb(e){return jD.some(t=>e[t]>=0)}const VD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Ps(e,t);switch(n){case"referenceHidden":{const s=await nf(t,{...a,elementContext:"reference"}),i=wb(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bb(i)}}}case"escaped":{const s=await nf(t,{...a,altBoundary:!0}),i=wb(s,r.floating);return{data:{escapedOffsets:i,escaped:bb(i)}}}default:return{}}}}},Uk=new Set(["left","top"]);async function GD(e,t){const{placement:r,platform:n,elements:a}=e,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),i=Os(r),o=wc(r),l=Qa(r)==="y",u=Uk.has(i)?-1:1,f=s&&l?-1:1,d=Ps(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof v=="number"&&(p=o==="end"?v*-1:v),l?{x:p*f,y:h*u}:{x:h*u,y:p*f}}const KD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:i,middlewareData:o}=t,l=await GD(t,e);return i===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:s+l.y,data:{...l,placement:i}}}}},YD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:o={fn:g=>{let{x,y}=g;return{x,y}}},...l}=Ps(e,t),u={x:r,y:n},f=await nf(t,l),d=Qa(Os(a)),h=yy(d);let p=u[h],v=u[d];if(s){const g=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=p+f[g],w=p-f[x];p=sv(y,p,w)}if(i){const g=d==="y"?"top":"left",x=d==="y"?"bottom":"right",y=v+f[g],w=v-f[x];v=sv(y,v,w)}const m=o.fn({...t,[h]:p,[d]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[h]:s,[d]:i}}}}}},XD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:i}=t,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=Ps(e,t),f={x:r,y:n},d=Qa(a),h=yy(d);let p=f[h],v=f[d];const m=Ps(o,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=h==="y"?"height":"width",b=s.reference[h]-s.floating[w]+g.mainAxis,_=s.reference[h]+s.reference[w]-g.mainAxis;p<b?p=b:p>_&&(p=_)}if(u){var x,y;const w=h==="y"?"width":"height",b=Uk.has(Os(a)),_=s.reference[d]-s.floating[w]+(b&&((x=i.offset)==null?void 0:x[d])||0)+(b?0:g.crossAxis),T=s.reference[d]+s.reference[w]+(b?0:((y=i.offset)==null?void 0:y[d])||0)-(b?g.crossAxis:0);v<_?v=_:v>T&&(v=T)}return{[h]:p,[d]:v}}}},JD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:i,elements:o}=t,{apply:l=()=>{},...u}=Ps(e,t),f=await nf(t,u),d=Os(a),h=wc(a),p=Qa(a)==="y",{width:v,height:m}=s.floating;let g,x;d==="top"||d==="bottom"?(g=d,x=h===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(x=d,g=h==="end"?"top":"bottom");const y=m-f.top-f.bottom,w=v-f.left-f.right,b=Ii(m-f[g],y),_=Ii(v-f[x],w),T=!t.middlewareData.shift;let E=b,C=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(C=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=y),T&&!h){const N=In(f.left,0),k=In(f.right,0),A=In(f.top,0),I=In(f.bottom,0);p?C=v-2*(N!==0||k!==0?N+k:In(f.left,f.right)):E=m-2*(A!==0||I!==0?A+I:In(f.top,f.bottom))}await l({...t,availableWidth:C,availableHeight:E});const P=await i.getDimensions(o.floating);return v!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function X0(){return typeof window<"u"}function bc(e){return $k(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function as(e){var t;return(t=($k(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $k(e){return X0()?e instanceof Node||e instanceof zn(e).Node:!1}function Ia(e){return X0()?e instanceof Element||e instanceof zn(e).Element:!1}function rs(e){return X0()?e instanceof HTMLElement||e instanceof zn(e).HTMLElement:!1}function _b(e){return!X0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot}const QD=new Set(["inline","contents"]);function zf(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Fa(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!QD.has(a)}const ZD=new Set(["table","td","th"]);function e5(e){return ZD.has(bc(e))}const t5=[":popover-open",":modal"];function J0(e){return t5.some(t=>{try{return e.matches(t)}catch{return!1}})}const r5=["transform","translate","scale","rotate","perspective"],n5=["transform","translate","scale","rotate","perspective","filter"],a5=["paint","layout","strict","content"];function _y(e){const t=Ey(),r=Ia(e)?Fa(e):e;return r5.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||n5.some(n=>(r.willChange||"").includes(n))||a5.some(n=>(r.contain||"").includes(n))}function s5(e){let t=Fi(e);for(;rs(t)&&!fc(t);){if(_y(t))return t;if(J0(t))return null;t=Fi(t)}return null}function Ey(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const i5=new Set(["html","body","#document"]);function fc(e){return i5.has(bc(e))}function Fa(e){return zn(e).getComputedStyle(e)}function Q0(e){return Ia(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fi(e){if(bc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_b(e)&&e.host||as(e);return _b(t)?t.host:t}function zk(e){const t=Fi(e);return fc(t)?e.ownerDocument?e.ownerDocument.body:e.body:rs(t)&&zf(t)?t:zk(t)}function af(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=zk(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),i=zn(a);if(s){const o=ov(i);return t.concat(i,i.visualViewport||[],zf(a)?a:[],o&&r?af(o):[])}return t.concat(a,af(a,[],r))}function ov(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hk(e){const t=Fa(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=rs(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Jh(r)!==s||Jh(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Sy(e){return Ia(e)?e:e.contextElement}function Bl(e){const t=Sy(e);if(!rs(t))return ts(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Hk(t);let i=(s?Jh(r.width):r.width)/n,o=(s?Jh(r.height):r.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const o5=ts(0);function qk(e){const t=zn(e);return!Ey()||!t.visualViewport?o5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function l5(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==zn(e)?!1:t}function Po(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),s=Sy(e);let i=ts(1);t&&(n?Ia(n)&&(i=Bl(n)):i=Bl(e));const o=l5(s,r,n)?qk(s):ts(0);let l=(a.left+o.x)/i.x,u=(a.top+o.y)/i.y,f=a.width/i.x,d=a.height/i.y;if(s){const h=zn(s),p=n&&Ia(n)?zn(n):n;let v=h,m=ov(v);for(;m&&n&&p!==v;){const g=Bl(m),x=m.getBoundingClientRect(),y=Fa(m),w=x.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,b=x.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,d*=g.y,l+=w,u+=b,v=zn(m),m=ov(v)}}return Zh({width:f,height:d,x:l,y:u})}function Z0(e,t){const r=Q0(e).scrollLeft;return t?t.left+r:Po(as(e)).left+r}function Wk(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Z0(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function c5(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s=a==="fixed",i=as(n),o=t?J0(t.floating):!1;if(n===i||o&&s)return r;let l={scrollLeft:0,scrollTop:0},u=ts(1);const f=ts(0),d=rs(n);if((d||!d&&!s)&&((bc(n)!=="body"||zf(i))&&(l=Q0(n)),rs(n))){const p=Po(n);u=Bl(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}const h=i&&!d&&!s?Wk(i,l):ts(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:r.y*u.y-l.scrollTop*u.y+f.y+h.y}}function u5(e){return Array.from(e.getClientRects())}function f5(e){const t=as(e),r=Q0(e),n=e.ownerDocument.body,a=In(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=In(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Z0(e);const o=-r.scrollTop;return Fa(n).direction==="rtl"&&(i+=In(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}const Eb=25;function d5(e,t){const r=zn(e),n=as(e),a=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,o=0,l=0;if(a){s=a.width,i=a.height;const f=Ey();(!f||f&&t==="fixed")&&(o=a.offsetLeft,l=a.offsetTop)}const u=Z0(n);if(u<=0){const f=n.ownerDocument,d=f.body,h=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(n.clientWidth-d.clientWidth-p);v<=Eb&&(s-=v)}else u<=Eb&&(s+=u);return{width:s,height:i,x:o,y:l}}const h5=new Set(["absolute","fixed"]);function p5(e,t){const r=Po(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=rs(e)?Bl(e):ts(1),i=e.clientWidth*s.x,o=e.clientHeight*s.y,l=a*s.x,u=n*s.y;return{width:i,height:o,x:l,y:u}}function Sb(e,t,r){let n;if(t==="viewport")n=d5(e,r);else if(t==="document")n=f5(as(e));else if(Ia(t))n=p5(t,r);else{const a=qk(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Zh(n)}function Vk(e,t){const r=Fi(e);return r===t||!Ia(r)||fc(r)?!1:Fa(r).position==="fixed"||Vk(r,t)}function m5(e,t){const r=t.get(e);if(r)return r;let n=af(e,[],!1).filter(o=>Ia(o)&&bc(o)!=="body"),a=null;const s=Fa(e).position==="fixed";let i=s?Fi(e):e;for(;Ia(i)&&!fc(i);){const o=Fa(i),l=_y(i);!l&&o.position==="fixed"&&(a=null),(s?!l&&!a:!l&&o.position==="static"&&!!a&&h5.has(a.position)||zf(i)&&!l&&Vk(e,i))?n=n.filter(f=>f!==i):a=o,i=Fi(i)}return t.set(e,n),n}function g5(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const i=[...r==="clippingAncestors"?J0(t)?[]:m5(t,this._c):[].concat(r),n],o=i[0],l=i.reduce((u,f)=>{const d=Sb(t,f,a);return u.top=In(d.top,u.top),u.right=Ii(d.right,u.right),u.bottom=Ii(d.bottom,u.bottom),u.left=In(d.left,u.left),u},Sb(t,o,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function v5(e){const{width:t,height:r}=Hk(e);return{width:t,height:r}}function x5(e,t,r){const n=rs(t),a=as(t),s=r==="fixed",i=Po(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=ts(0);function u(){l.x=Z0(a)}if(n||!n&&!s)if((bc(t)!=="body"||zf(a))&&(o=Q0(t)),n){const p=Po(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else a&&u();s&&!n&&a&&u();const f=a&&!n&&!s?Wk(a,o):ts(0),d=i.left+o.scrollLeft-l.x-f.x,h=i.top+o.scrollTop-l.y-f.y;return{x:d,y:h,width:i.width,height:i.height}}function pm(e){return Fa(e).position==="static"}function Tb(e,t){if(!rs(e)||Fa(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return as(e)===r&&(r=r.ownerDocument.body),r}function Gk(e,t){const r=zn(e);if(J0(e))return r;if(!rs(e)){let a=Fi(e);for(;a&&!fc(a);){if(Ia(a)&&!pm(a))return a;a=Fi(a)}return r}let n=Tb(e,t);for(;n&&e5(n)&&pm(n);)n=Tb(n,t);return n&&fc(n)&&pm(n)&&!_y(n)?r:n||s5(e)||r}const y5=async function(e){const t=this.getOffsetParent||Gk,r=this.getDimensions,n=await r(e.floating);return{reference:x5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function w5(e){return Fa(e).direction==="rtl"}const b5={convertOffsetParentRelativeRectToViewportRelativeRect:c5,getDocumentElement:as,getClippingRect:g5,getOffsetParent:Gk,getElementRects:y5,getClientRects:u5,getDimensions:v5,getScale:Bl,isElement:Ia,isRTL:w5};function Kk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _5(e,t){let r=null,n;const a=as(e);function s(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function i(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:h,height:p}=u;if(o||t(),!h||!p)return;const v=Td(d),m=Td(a.clientWidth-(f+h)),g=Td(a.clientHeight-(d+p)),x=Td(f),w={rootMargin:-v+"px "+-m+"px "+-g+"px "+-x+"px",threshold:In(0,Ii(1,l))||1};let b=!0;function _(T){const E=T[0].intersectionRatio;if(E!==l){if(!b)return i();E?i(!1,E):n=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Kk(u,e.getBoundingClientRect())&&i(),b=!1}try{r=new IntersectionObserver(_,{...w,root:a.ownerDocument})}catch{r=new IntersectionObserver(_,w)}r.observe(e)}return i(!0),s}function E5(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Sy(e),f=a||s?[...u?af(u):[],...af(t)]:[];f.forEach(x=>{a&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const d=u&&o?_5(u,r):null;let h=-1,p=null;i&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),r()}),u&&!l&&p.observe(u),p.observe(t));let v,m=l?Po(e):null;l&&g();function g(){const x=Po(e);m&&!Kk(m,x)&&r(),m=x,v=requestAnimationFrame(g)}return r(),()=>{var x;f.forEach(y=>{a&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),d==null||d(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const S5=KD,T5=YD,k5=WD,N5=JD,A5=VD,kb=qD,C5=XD,P5=(e,t,r)=>{const n=new Map,a={platform:b5,...r},s={...a.platform,_c:n};return HD(e,t,{...a,platform:s})};var O5=typeof document<"u",j5=function(){},fh=O5?S.useLayoutEffect:j5;function e0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!e0(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&e.$$typeof)&&!e0(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Yk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Nb(e,t){const r=Yk(e);return Math.round(t*r)/r}function mm(e){const t=S.useRef(e);return fh(()=>{t.current=e}),t}function R5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:i}={},transform:o=!0,whileElementsMounted:l,open:u}=e,[f,d]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=S.useState(n);e0(h,n)||p(n);const[v,m]=S.useState(null),[g,x]=S.useState(null),y=S.useCallback(Q=>{Q!==T.current&&(T.current=Q,m(Q))},[]),w=S.useCallback(Q=>{Q!==E.current&&(E.current=Q,x(Q))},[]),b=s||v,_=i||g,T=S.useRef(null),E=S.useRef(null),C=S.useRef(f),P=l!=null,N=mm(l),k=mm(a),A=mm(u),I=S.useCallback(()=>{if(!T.current||!E.current)return;const Q={placement:t,strategy:r,middleware:h};k.current&&(Q.platform=k.current),P5(T.current,E.current,Q).then(R=>{const z={...R,isPositioned:A.current!==!1};M.current&&!e0(C.current,z)&&(C.current=z,$i.flushSync(()=>{d(z)}))})},[h,t,r,k,A]);fh(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(Q=>({...Q,isPositioned:!1})))},[u]);const M=S.useRef(!1);fh(()=>(M.current=!0,()=>{M.current=!1}),[]),fh(()=>{if(b&&(T.current=b),_&&(E.current=_),b&&_){if(N.current)return N.current(b,_,I);I()}},[b,_,I,N,P]);const U=S.useMemo(()=>({reference:T,floating:E,setReference:y,setFloating:w}),[y,w]),W=S.useMemo(()=>({reference:b,floating:_}),[b,_]),G=S.useMemo(()=>{const Q={position:r,left:0,top:0};if(!W.floating)return Q;const R=Nb(W.floating,f.x),z=Nb(W.floating,f.y);return o?{...Q,transform:"translate("+R+"px, "+z+"px)",...Yk(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:R,top:z}},[r,o,W.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:I,refs:U,elements:W,floatingStyles:G}),[f,I,U,W,G])}const I5=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?kb({element:n.current,padding:a}).fn(r):{}:n?kb({element:n,padding:a}).fn(r):{}}}},F5=(e,t)=>({...S5(e),options:[e,t]}),D5=(e,t)=>({...T5(e),options:[e,t]}),M5=(e,t)=>({...C5(e),options:[e,t]}),L5=(e,t)=>({...k5(e),options:[e,t]}),B5=(e,t)=>({...N5(e),options:[e,t]}),U5=(e,t)=>({...A5(e),options:[e,t]}),$5=(e,t)=>({...I5(e),options:[e,t]});var z5="Arrow",Xk=S.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...s}=e;return c.jsx(Ze.svg,{...s,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xk.displayName=z5;var H5=Xk;function q5(e){const[t,r]=S.useState(void 0);return Ur(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let i,o;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,o=u.blockSize}else i=e.offsetWidth,o=e.offsetHeight;r({width:i,height:o})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ty="Popper",[Jk,_c]=Da(Ty),[W5,Qk]=Jk(Ty),Zk=e=>{const{__scopePopper:t,children:r}=e,[n,a]=S.useState(null);return c.jsx(W5,{scope:t,anchor:n,onAnchorChange:a,children:r})};Zk.displayName=Ty;var eN="PopperAnchor",tN=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,s=Qk(eN,r),i=S.useRef(null),o=Tt(t,i),l=S.useRef(null);return S.useEffect(()=>{const u=l.current;l.current=(n==null?void 0:n.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),n?null:c.jsx(Ze.div,{...a,ref:o})});tN.displayName=eN;var ky="PopperContent",[V5,G5]=Jk(ky),rN=S.forwardRef((e,t)=>{var H,Z,X,ne,he,V;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,g=Qk(ky,r),[x,y]=S.useState(null),w=Tt(t,Te=>y(Te)),[b,_]=S.useState(null),T=q5(b),E=(T==null?void 0:T.width)??0,C=(T==null?void 0:T.height)??0,P=n+(s!=="center"?"-"+s:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(u)?u:[u],A=k.length>0,I={padding:N,boundary:k.filter(Y5),altBoundary:A},{refs:M,floatingStyles:U,placement:W,isPositioned:G,middlewareData:Q}=R5({strategy:"fixed",placement:P,whileElementsMounted:(...Te)=>E5(...Te,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[F5({mainAxis:a+C,alignmentAxis:i}),l&&D5({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?M5():void 0,...I}),l&&L5({...I}),B5({...I,apply:({elements:Te,rects:Ee,availableWidth:xe,availableHeight:Se})=>{const{width:pe,height:le}=Ee.reference,ue=Te.floating.style;ue.setProperty("--radix-popper-available-width",`${xe}px`),ue.setProperty("--radix-popper-available-height",`${Se}px`),ue.setProperty("--radix-popper-anchor-width",`${pe}px`),ue.setProperty("--radix-popper-anchor-height",`${le}px`)}}),b&&$5({element:b,padding:o}),X5({arrowWidth:E,arrowHeight:C}),h&&U5({strategy:"referenceHidden",...I})]}),[R,z]=sN(W),D=On(v);Ur(()=>{G&&(D==null||D())},[G,D]);const O=(H=Q.arrow)==null?void 0:H.x,j=(Z=Q.arrow)==null?void 0:Z.y,B=((X=Q.arrow)==null?void 0:X.centerOffset)!==0,[L,F]=S.useState();return Ur(()=>{x&&F(window.getComputedStyle(x).zIndex)},[x]),c.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:G?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:L,"--radix-popper-transform-origin":[(ne=Q.transformOrigin)==null?void 0:ne.x,(he=Q.transformOrigin)==null?void 0:he.y].join(" "),...((V=Q.hide)==null?void 0:V.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(V5,{scope:r,placedSide:R,onArrowChange:_,arrowX:O,arrowY:j,shouldHideArrow:B,children:c.jsx(Ze.div,{"data-side":R,"data-align":z,...m,ref:w,style:{...m.style,animation:G?void 0:"none"}})})})});rN.displayName=ky;var nN="PopperArrow",K5={top:"bottom",right:"left",bottom:"top",left:"right"},aN=S.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=G5(nN,n),i=K5[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(H5,{...a,ref:r,style:{...a.style,display:"block"}})})});aN.displayName=nN;function Y5(e){return e!==null}var X5=e=>({name:"transformOrigin",options:e,fn(t){var g,x,y;const{placement:r,rects:n,middlewareData:a}=t,i=((g=a.arrow)==null?void 0:g.centerOffset)!==0,o=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=sN(r),d={start:"0%",center:"50%",end:"100%"}[f],h=(((x=a.arrow)==null?void 0:x.x)??0)+o/2,p=(((y=a.arrow)==null?void 0:y.y)??0)+l/2;let v="",m="";return u==="bottom"?(v=i?d:`${h}px`,m=`${-l}px`):u==="top"?(v=i?d:`${h}px`,m=`${n.floating.height+l}px`):u==="right"?(v=`${-l}px`,m=i?d:`${p}px`):u==="left"&&(v=`${n.floating.width+l}px`,m=i?d:`${p}px`),{data:{x:v,y:m}}}});function sN(e){const[t,r="center"]=e.split("-");return[t,r]}var Ny=Zk,Ay=tN,Cy=rN,Py=aN,J5=Symbol("radix.slottable");function Q5(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=J5,t}var[ep]=Da("Tooltip",[_c]),tp=_c(),iN="TooltipProvider",Z5=700,lv="tooltip.open",[eM,Oy]=ep(iN),oN=e=>{const{__scopeTooltip:t,delayDuration:r=Z5,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=e,i=S.useRef(!0),o=S.useRef(!1),l=S.useRef(0);return S.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(eM,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:S.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:o,onPointerInTransitChange:S.useCallback(u=>{o.current=u},[]),disableHoverableContent:a,children:s})};oN.displayName=iN;var sf="Tooltip",[tM,rp]=ep(sf),lN=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:s,disableHoverableContent:i,delayDuration:o}=e,l=Oy(sf,e.__scopeTooltip),u=tp(t),[f,d]=S.useState(null),h=Oa(),p=S.useRef(0),v=i??l.disableHoverableContent,m=o??l.delayDuration,g=S.useRef(!1),[x,y]=ji({prop:n,defaultProp:a??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(lv))):l.onClose(),s==null||s(E)},caller:sf}),w=S.useMemo(()=>x?g.current?"delayed-open":"instant-open":"closed",[x]),b=S.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),_=S.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),T=S.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},m)},[m,y]);return S.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(Ny,{...u,children:c.jsx(tM,{scope:t,contentId:h,open:x,stateAttribute:w,trigger:f,onTriggerChange:d,onTriggerEnter:S.useCallback(()=>{l.isOpenDelayedRef.current?T():b()},[l.isOpenDelayedRef,T,b]),onTriggerLeave:S.useCallback(()=>{v?_():(window.clearTimeout(p.current),p.current=0)},[_,v]),onOpen:b,onClose:_,disableHoverableContent:v,children:r})})};lN.displayName=sf;var cv="TooltipTrigger",cN=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=rp(cv,r),s=Oy(cv,r),i=tp(r),o=S.useRef(null),l=Tt(t,o,a.onTriggerChange),u=S.useRef(!1),f=S.useRef(!1),d=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),c.jsx(Ay,{asChild:!0,...i,children:c.jsx(Ze.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:l,onPointerMove:Pe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Pe(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Pe(e.onBlur,a.onClose),onClick:Pe(e.onClick,a.onClose)})})});cN.displayName=cv;var rM="TooltipPortal",[sie,nM]=ep(rM,{forceMount:void 0}),dc="TooltipContent",uN=S.forwardRef((e,t)=>{const r=nM(dc,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=e,i=rp(dc,e.__scopeTooltip);return c.jsx(Ma,{present:n||i.open,children:i.disableHoverableContent?c.jsx(fN,{side:a,...s,ref:t}):c.jsx(aM,{side:a,...s,ref:t})})}),aM=S.forwardRef((e,t)=>{const r=rp(dc,e.__scopeTooltip),n=Oy(dc,e.__scopeTooltip),a=S.useRef(null),s=Tt(t,a),[i,o]=S.useState(null),{trigger:l,onClose:u}=r,f=a.current,{onPointerInTransitChange:d}=n,h=S.useCallback(()=>{o(null),d(!1)},[d]),p=S.useCallback((v,m)=>{const g=v.currentTarget,x={x:v.clientX,y:v.clientY},y=cM(x,g.getBoundingClientRect()),w=uM(x,y),b=fM(m.getBoundingClientRect()),_=hM([...w,...b]);o(_),d(!0)},[d]);return S.useEffect(()=>()=>h(),[h]),S.useEffect(()=>{if(l&&f){const v=g=>p(g,f),m=g=>p(g,l);return l.addEventListener("pointerleave",v),f.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",m)}}},[l,f,p,h]),S.useEffect(()=>{if(i){const v=m=>{const g=m.target,x={x:m.clientX,y:m.clientY},y=(l==null?void 0:l.contains(g))||(f==null?void 0:f.contains(g)),w=!dM(x,i);y?h():w&&(h(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,f,i,u,h]),c.jsx(fN,{...e,ref:s})}),[sM,iM]=ep(sf,{isInside:!1}),oM=Q5("TooltipContent"),fN=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:i,...o}=e,l=rp(dc,r),u=tp(r),{onClose:f}=l;return S.useEffect(()=>(document.addEventListener(lv,f),()=>document.removeEventListener(lv,f)),[f]),S.useEffect(()=>{if(l.trigger){const d=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),c.jsx(xc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:c.jsxs(Cy,{"data-state":l.stateAttribute,...u,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(oM,{children:n}),c.jsx(sM,{scope:r,isInside:!0,children:c.jsx(kI,{id:l.contentId,role:"tooltip",children:a||n})})]})})});uN.displayName=dc;var dN="TooltipArrow",lM=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=tp(r);return iM(dN,r).isInside?null:c.jsx(Py,{...a,...n,ref:t})});lM.displayName=dN;function cM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function uM(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function fM(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function dM(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const o=t[s],l=t[i],u=o.x,f=o.y,d=l.x,h=l.y;f>n!=h>n&&r<(d-u)*(n-f)/(h-f)+u&&(a=!a)}return a}function hM(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),pM(t)}function pM(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(a.y-i.y)>=(s.y-i.y)*(a.x-i.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(a.y-i.y)>=(s.y-i.y)*(a.x-i.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var mM=oN,gM=lN,vM=cN,hN=uN;const pN=mM,Vi=gM,Gi=vM,Vs=S.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(hN,{ref:n,sideOffset:t,className:je("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Vs.displayName=hN.displayName;var Hf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},xM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},si,px,TE,yM=(TE=class{constructor(){Ge(this,si,xM);Ge(this,px,!1)}setTimeoutProvider(e){Ie(this,si,e)}setTimeout(e,t){return se(this,si).setTimeout(e,t)}clearTimeout(e){se(this,si).clearTimeout(e)}setInterval(e,t){return se(this,si).setInterval(e,t)}clearInterval(e){se(this,si).clearInterval(e)}},si=new WeakMap,px=new WeakMap,TE),io=new yM;function wM(e){setTimeout(e,0)}var Oo=typeof window>"u"||"Deno"in globalThis;function En(){}function bM(e,t){return typeof e=="function"?e(t):e}function uv(e){return typeof e=="number"&&e>=0&&e!==1/0}function mN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ni(e,t){return typeof e=="function"?e(t):e}function Zn(e,t){return typeof e=="function"?e(t):e}function Ab(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:s,queryKey:i,stale:o}=e;if(i){if(n){if(t.queryHash!==jy(i,t.options))return!1}else if(!lf(t.queryKey,i))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||s&&!s(t))}function Cb(e,t){const{exact:r,status:n,predicate:a,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(of(t.options.mutationKey)!==of(s))return!1}else if(!lf(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function jy(e,t){return((t==null?void 0:t.queryKeyHashFn)||of)(e)}function of(e){return JSON.stringify(e,(t,r)=>dv(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function lf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>lf(e[r],t[r])):!1}var _M=Object.prototype.hasOwnProperty;function gN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Pb(e)&&Pb(t);if(!n&&!(dv(e)&&dv(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),o=i.length,l=n?new Array(o):{};let u=0;for(let f=0;f<o;f++){const d=n?f:i[f],h=e[d],p=t[d];if(h===p){l[d]=h,(n?f<s:_M.call(e,d))&&u++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){l[d]=p;continue}const v=gN(h,p,r+1);l[d]=v,v===h&&u++}return s===o&&u===s?e:l}function fv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Pb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function dv(e){if(!Ob(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Ob(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ob(e){return Object.prototype.toString.call(e)==="[object Object]"}function EM(e){return new Promise(t=>{io.setTimeout(t,e)})}function hv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?gN(e,t):t}function SM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function TM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ry=Symbol();function vN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ry?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xN(e,t){return typeof e=="function"?e(...t):!!e}function kM(e,t,r){let n=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),n||(n=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),e}var co,ii,Vl,kE,NM=(kE=class extends Hf{constructor(){super();Ge(this,co);Ge(this,ii);Ge(this,Vl);Ie(this,Vl,t=>{if(!Oo&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){se(this,ii)||this.setEventListener(se(this,Vl))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,ii))==null||t.call(this),Ie(this,ii,void 0))}setEventListener(t){var r;Ie(this,Vl,t),(r=se(this,ii))==null||r.call(this),Ie(this,ii,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){se(this,co)!==t&&(Ie(this,co,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof se(this,co)=="boolean"?se(this,co):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},co=new WeakMap,ii=new WeakMap,Vl=new WeakMap,kE),Iy=new NM;function pv(){let e,t;const r=new Promise((a,s)=>{e=a,t=s});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}var AM=wM;function CM(){let e=[],t=0,r=o=>{o()},n=o=>{o()},a=AM;const s=o=>{t?e.push(o):a(()=>{r(o)})},i=()=>{const o=e;e=[],o.length&&a(()=>{n(()=>{o.forEach(l=>{r(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||i()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{a=o}}}var Rr=CM(),Gl,oi,Kl,NE,PM=(NE=class extends Hf{constructor(){super();Ge(this,Gl,!0);Ge(this,oi);Ge(this,Kl);Ie(this,Kl,t=>{if(!Oo&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){se(this,oi)||this.setEventListener(se(this,Kl))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,oi))==null||t.call(this),Ie(this,oi,void 0))}setEventListener(t){var r;Ie(this,Kl,t),(r=se(this,oi))==null||r.call(this),Ie(this,oi,t(this.setOnline.bind(this)))}setOnline(t){se(this,Gl)!==t&&(Ie(this,Gl,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return se(this,Gl)}},Gl=new WeakMap,oi=new WeakMap,Kl=new WeakMap,NE),t0=new PM;function OM(e){return Math.min(1e3*2**e,3e4)}function yN(e){return(e??"online")==="online"?t0.isOnline():!0}var mv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wN(e){let t=!1,r=0,n;const a=pv(),s=()=>a.status!=="pending",i=m=>{var g;if(!s()){const x=new mv(m);h(x),(g=e.onCancel)==null||g.call(e,x)}},o=()=>{t=!0},l=()=>{t=!1},u=()=>Iy.isFocused()&&(e.networkMode==="always"||t0.isOnline())&&e.canRun(),f=()=>yN(e.networkMode)&&e.canRun(),d=m=>{s()||(n==null||n(),a.resolve(m))},h=m=>{s()||(n==null||n(),a.reject(m))},p=()=>new Promise(m=>{var g;n=x=>{(s()||u())&&m(x)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;n=void 0,s()||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(s())return;let m;const g=r===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(x){m=Promise.reject(x)}Promise.resolve(m).then(d).catch(x=>{var T;if(s())return;const y=e.retry??(Oo?0:3),w=e.retryDelay??OM,b=typeof w=="function"?w(r,x):w,_=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,x);if(t||!_){h(x);return}r++,(T=e.onFail)==null||T.call(e,r,x),EM(b).then(()=>u()?void 0:p()).then(()=>{t?h(x):v()})})};return{promise:a,status:()=>a.status,cancel:i,continue:()=>(n==null||n(),a),cancelRetry:o,continueRetry:l,canStart:f,start:()=>(f()?v():p().then(v),a)}}var uo,AE,bN=(AE=class{constructor(){Ge(this,uo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uv(this.gcTime)&&Ie(this,uo,io.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Oo?1/0:5*60*1e3))}clearGcTimeout(){se(this,uo)&&(io.clearTimeout(se(this,uo)),Ie(this,uo,void 0))}},uo=new WeakMap,AE),fo,Yl,Qn,ho,yr,Af,po,ba,fs,CE,jM=(CE=class extends bN{constructor(t){super();Ge(this,ba);Ge(this,fo);Ge(this,Yl);Ge(this,Qn);Ge(this,ho);Ge(this,yr);Ge(this,Af);Ge(this,po);Ie(this,po,!1),Ie(this,Af,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ie(this,ho,t.client),Ie(this,Qn,se(this,ho).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,fo,Rb(this.options)),this.state=t.state??se(this,fo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=se(this,yr))==null?void 0:t.promise}setOptions(t){if(this.options={...se(this,Af),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Rb(this.options);r.data!==void 0&&(this.setState(jb(r.data,r.dataUpdatedAt)),Ie(this,fo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&se(this,Qn).remove(this)}setData(t,r){const n=hv(this.state.data,t,this.options);return pt(this,ba,fs).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){pt(this,ba,fs).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=se(this,yr))==null?void 0:n.promise;return(a=se(this,yr))==null||a.cancel(t),r?r.then(En).catch(En):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,fo))}isActive(){return this.observers.some(t=>Zn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ry||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ni(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!mN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=se(this,yr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=se(this,yr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),se(this,Qn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(se(this,yr)&&(se(this,po)?se(this,yr).cancel({revert:!0}):se(this,yr).cancelRetry()),this.scheduleGc()),se(this,Qn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pt(this,ba,fs).call(this,{type:"invalidate"})}async fetch(t,r){var l,u,f,d,h,p,v,m,g,x,y,w;if(this.state.fetchStatus!=="idle"&&((l=se(this,yr))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(se(this,yr))return se(this,yr).continueRetry(),se(this,yr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(_=>_.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,a=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(Ie(this,po,!0),n.signal)})},s=()=>{const b=vN(this.options,r),T=(()=>{const E={client:se(this,ho),queryKey:this.queryKey,meta:this.meta};return a(E),E})();return Ie(this,po,!1),this.options.persister?this.options.persister(b,T,this):b(T)},o=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:se(this,ho),state:this.state,fetchFn:s};return a(b),b})();(u=this.options.behavior)==null||u.onFetch(o,this),Ie(this,Yl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=o.fetchOptions)==null?void 0:f.meta))&&pt(this,ba,fs).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta}),Ie(this,yr,wN({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:b=>{b instanceof mv&&b.revert&&this.setState({...se(this,Yl),fetchStatus:"idle"}),n.abort()},onFail:(b,_)=>{pt(this,ba,fs).call(this,{type:"failed",failureCount:b,error:_})},onPause:()=>{pt(this,ba,fs).call(this,{type:"pause"})},onContinue:()=>{pt(this,ba,fs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const b=await se(this,yr).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(p=(h=se(this,Qn).config).onSuccess)==null||p.call(h,b,this),(m=(v=se(this,Qn).config).onSettled)==null||m.call(v,b,this.state.error,this),b}catch(b){if(b instanceof mv){if(b.silent)return se(this,yr).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw pt(this,ba,fs).call(this,{type:"error",error:b}),(x=(g=se(this,Qn).config).onError)==null||x.call(g,b,this),(w=(y=se(this,Qn).config).onSettled)==null||w.call(y,this.state.data,b,this),b}finally{this.scheduleGc()}}},fo=new WeakMap,Yl=new WeakMap,Qn=new WeakMap,ho=new WeakMap,yr=new WeakMap,Af=new WeakMap,po=new WeakMap,ba=new WeakSet,fs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._N(n.data,this.options),fetchMeta:t.meta??null};case"success":const a={...n,...jb(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,Yl,t.manual?a:void 0),a;case"error":const s=t.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Rr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),se(this,Qn).notify({query:this,type:"updated",action:t})})},CE);function _N(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function jb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Rb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var wn,mt,Cf,en,mo,Xl,gs,li,Pf,Jl,Ql,go,vo,ci,Zl,Nt,su,gv,vv,xv,yv,wv,bv,_v,EN,PE,RM=(PE=class extends Hf{constructor(t,r){super();Ge(this,Nt);Ge(this,wn);Ge(this,mt);Ge(this,Cf);Ge(this,en);Ge(this,mo);Ge(this,Xl);Ge(this,gs);Ge(this,li);Ge(this,Pf);Ge(this,Jl);Ge(this,Ql);Ge(this,go);Ge(this,vo);Ge(this,ci);Ge(this,Zl,new Set);this.options=r,Ie(this,wn,t),Ie(this,li,null),Ie(this,gs,pv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,mt).addObserver(this),Ib(se(this,mt),this.options)?pt(this,Nt,su).call(this):this.updateResult(),pt(this,Nt,yv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ev(se(this,mt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ev(se(this,mt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pt(this,Nt,wv).call(this),pt(this,Nt,bv).call(this),se(this,mt).removeObserver(this)}setOptions(t){const r=this.options,n=se(this,mt);if(this.options=se(this,wn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Zn(this.options.enabled,se(this,mt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pt(this,Nt,_v).call(this),se(this,mt).setOptions(this.options),r._defaulted&&!fv(this.options,r)&&se(this,wn).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,mt),observer:this});const a=this.hasListeners();a&&Fb(se(this,mt),n,this.options,r)&&pt(this,Nt,su).call(this),this.updateResult(),a&&(se(this,mt)!==n||Zn(this.options.enabled,se(this,mt))!==Zn(r.enabled,se(this,mt))||Ni(this.options.staleTime,se(this,mt))!==Ni(r.staleTime,se(this,mt)))&&pt(this,Nt,gv).call(this);const s=pt(this,Nt,vv).call(this);a&&(se(this,mt)!==n||Zn(this.options.enabled,se(this,mt))!==Zn(r.enabled,se(this,mt))||s!==se(this,ci))&&pt(this,Nt,xv).call(this,s)}getOptimisticResult(t){const r=se(this,wn).getQueryCache().build(se(this,wn),t),n=this.createResult(r,t);return FM(this,n)&&(Ie(this,en,n),Ie(this,Xl,this.options),Ie(this,mo,se(this,mt).state)),n}getCurrentResult(){return se(this,en)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&se(this,gs).status==="pending"&&se(this,gs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(t){se(this,Zl).add(t)}getCurrentQuery(){return se(this,mt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=se(this,wn).defaultQueryOptions(t),n=se(this,wn).getQueryCache().build(se(this,wn),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return pt(this,Nt,su).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,en)))}createResult(t,r){var P;const n=se(this,mt),a=this.options,s=se(this,en),i=se(this,mo),o=se(this,Xl),u=t!==n?t.state:se(this,Cf),{state:f}=t;let d={...f},h=!1,p;if(r._optimisticResults){const N=this.hasListeners(),k=!N&&Ib(t,r),A=N&&Fb(t,n,r,a);(k||A)&&(d={...d,..._N(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:g}=d;p=d.data;let x=!1;if(r.placeholderData!==void 0&&p===void 0&&g==="pending"){let N;s!=null&&s.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(N=s.data,x=!0):N=typeof r.placeholderData=="function"?r.placeholderData((P=se(this,Ql))==null?void 0:P.state.data,se(this,Ql)):r.placeholderData,N!==void 0&&(g="success",p=hv(s==null?void 0:s.data,N,r),h=!0)}if(r.select&&p!==void 0&&!x)if(s&&p===(i==null?void 0:i.data)&&r.select===se(this,Pf))p=se(this,Jl);else try{Ie(this,Pf,r.select),p=r.select(p),p=hv(s==null?void 0:s.data,p,r),Ie(this,Jl,p),Ie(this,li,null)}catch(N){Ie(this,li,N)}se(this,li)&&(v=se(this,li),p=se(this,Jl),m=Date.now(),g="error");const y=d.fetchStatus==="fetching",w=g==="pending",b=g==="error",_=w&&y,T=p!==void 0,C={status:g,fetchStatus:d.fetchStatus,isPending:w,isSuccess:g==="success",isError:b,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:b&&!T,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:b&&T,isStale:Fy(t,r),refetch:this.refetch,promise:se(this,gs),isEnabled:Zn(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=C.data!==void 0,k=C.status==="error"&&!N,A=U=>{k?U.reject(C.error):N&&U.resolve(C.data)},I=()=>{const U=Ie(this,gs,C.promise=pv());A(U)},M=se(this,gs);switch(M.status){case"pending":t.queryHash===n.queryHash&&A(M);break;case"fulfilled":(k||C.data!==M.value)&&I();break;case"rejected":(!k||C.error!==M.reason)&&I();break}}return C}updateResult(){const t=se(this,en),r=this.createResult(se(this,mt),this.options);if(Ie(this,mo,se(this,mt).state),Ie(this,Xl,this.options),se(this,mo).data!==void 0&&Ie(this,Ql,se(this,mt)),fv(r,t))return;Ie(this,en,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!se(this,Zl).size)return!0;const i=new Set(s??se(this,Zl));return this.options.throwOnError&&i.add("error"),Object.keys(se(this,en)).some(o=>{const l=o;return se(this,en)[l]!==t[l]&&i.has(l)})};pt(this,Nt,EN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pt(this,Nt,yv).call(this)}},wn=new WeakMap,mt=new WeakMap,Cf=new WeakMap,en=new WeakMap,mo=new WeakMap,Xl=new WeakMap,gs=new WeakMap,li=new WeakMap,Pf=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,go=new WeakMap,vo=new WeakMap,ci=new WeakMap,Zl=new WeakMap,Nt=new WeakSet,su=function(t){pt(this,Nt,_v).call(this);let r=se(this,mt).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(En)),r},gv=function(){pt(this,Nt,wv).call(this);const t=Ni(this.options.staleTime,se(this,mt));if(Oo||se(this,en).isStale||!uv(t))return;const n=mN(se(this,en).dataUpdatedAt,t)+1;Ie(this,go,io.setTimeout(()=>{se(this,en).isStale||this.updateResult()},n))},vv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,mt)):this.options.refetchInterval)??!1},xv=function(t){pt(this,Nt,bv).call(this),Ie(this,ci,t),!(Oo||Zn(this.options.enabled,se(this,mt))===!1||!uv(se(this,ci))||se(this,ci)===0)&&Ie(this,vo,io.setInterval(()=>{(this.options.refetchIntervalInBackground||Iy.isFocused())&&pt(this,Nt,su).call(this)},se(this,ci)))},yv=function(){pt(this,Nt,gv).call(this),pt(this,Nt,xv).call(this,pt(this,Nt,vv).call(this))},wv=function(){se(this,go)&&(io.clearTimeout(se(this,go)),Ie(this,go,void 0))},bv=function(){se(this,vo)&&(io.clearInterval(se(this,vo)),Ie(this,vo,void 0))},_v=function(){const t=se(this,wn).getQueryCache().build(se(this,wn),this.options);if(t===se(this,mt))return;const r=se(this,mt);Ie(this,mt,t),Ie(this,Cf,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},EN=function(t){Rr.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(se(this,en))}),se(this,wn).getQueryCache().notify({query:se(this,mt),type:"observerResultsUpdated"})})},PE);function IM(e,t){return Zn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ib(e,t){return IM(e,t)||e.state.data!==void 0&&Ev(e,t,t.refetchOnMount)}function Ev(e,t,r){if(Zn(t.enabled,e)!==!1&&Ni(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Fy(e,t)}return!1}function Fb(e,t,r,n){return(e!==t||Zn(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Fy(e,r)}function Fy(e,t){return Zn(t.enabled,e)!==!1&&e.isStaleByTime(Ni(t.staleTime,e))}function FM(e,t){return!fv(e.getCurrentResult(),t)}function r0(e){return{onFetch:(t,r)=>{var f,d,h,p,v;const n=t.options,a=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const g=w=>{kM(w,()=>t.signal,()=>m=!0)},x=vN(t.options,t.fetchOptions),y=async(w,b,_)=>{if(m)return Promise.reject();if(b==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:b,direction:_?"backward":"forward",meta:t.options.meta};return g(k),k})(),C=await x(E),{maxPages:P}=t.options,N=_?TM:SM;return{pages:N(w.pages,C,P),pageParams:N(w.pageParams,b,P)}};if(a&&s.length){const w=a==="backward",b=w?SN:Sv,_={pages:s,pageParams:i},T=b(n,_);o=await y(_,T,w)}else{const w=e??s.length;do{const b=l===0?i[0]??n.initialPageParam:Sv(n,o);if(l>0&&b==null)break;o=await y(o,b),l++}while(l<w)}return o};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Sv(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function SN(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function DM(e,t){return t?Sv(e,t)!=null:!1}function MM(e,t){return!t||!e.getPreviousPageParam?!1:SN(e,t)!=null}var LM=class extends RM{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:r0()})}getOptimisticResult(e){return e.behavior=r0(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var v,m;const{state:r}=e,n=super.createResult(e,t),{isFetching:a,isRefetching:s,isError:i,isRefetchError:o}=n,l=(m=(v=r.fetchMeta)==null?void 0:v.fetchMore)==null?void 0:m.direction,u=i&&l==="forward",f=a&&l==="forward",d=i&&l==="backward",h=a&&l==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:DM(t,r.data),hasPreviousPage:MM(t,r.data),isFetchNextPageError:u,isFetchingNextPage:f,isFetchPreviousPageError:d,isFetchingPreviousPage:h,isRefetchError:o&&!u&&!d,isRefetching:s&&!f&&!h}}},Of,Ga,tn,xo,Ka,Gs,OE,BM=(OE=class extends bN{constructor(t){super();Ge(this,Ka);Ge(this,Of);Ge(this,Ga);Ge(this,tn);Ge(this,xo);Ie(this,Of,t.client),this.mutationId=t.mutationId,Ie(this,tn,t.mutationCache),Ie(this,Ga,[]),this.state=t.state||UM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Ga).includes(t)||(se(this,Ga).push(t),this.clearGcTimeout(),se(this,tn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ga,se(this,Ga).filter(r=>r!==t)),this.scheduleGc(),se(this,tn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Ga).length||(this.state.status==="pending"?this.scheduleGc():se(this,tn).remove(this))}continue(){var t;return((t=se(this,xo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,u,f,d,h,p,v,m,g,x,y,w,b,_,T,E,C,P;const r=()=>{pt(this,Ka,Gs).call(this,{type:"continue"})},n={client:se(this,Of),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,xo,wN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(N,k)=>{pt(this,Ka,Gs).call(this,{type:"failed",failureCount:N,error:k})},onPause:()=>{pt(this,Ka,Gs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>se(this,tn).canRun(this)}));const a=this.state.status==="pending",s=!se(this,xo).canStart();try{if(a)r();else{pt(this,Ka,Gs).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(i=se(this,tn).config).onMutate)==null?void 0:o.call(i,t,this,n));const k=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,n));k!==this.state.context&&pt(this,Ka,Gs).call(this,{type:"pending",context:k,variables:t,isPaused:s})}const N=await se(this,xo).start();return await((d=(f=se(this,tn).config).onSuccess)==null?void 0:d.call(f,N,t,this.state.context,this,n)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,N,t,this.state.context,n)),await((m=(v=se(this,tn).config).onSettled)==null?void 0:m.call(v,N,null,this.state.variables,this.state.context,this,n)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,N,null,t,this.state.context,n)),pt(this,Ka,Gs).call(this,{type:"success",data:N}),N}catch(N){try{await((w=(y=se(this,tn).config).onError)==null?void 0:w.call(y,N,t,this.state.context,this,n))}catch(k){Promise.reject(k)}try{await((_=(b=this.options).onError)==null?void 0:_.call(b,N,t,this.state.context,n))}catch(k){Promise.reject(k)}try{await((E=(T=se(this,tn).config).onSettled)==null?void 0:E.call(T,void 0,N,this.state.variables,this.state.context,this,n))}catch(k){Promise.reject(k)}try{await((P=(C=this.options).onSettled)==null?void 0:P.call(C,void 0,N,t,this.state.context,n))}catch(k){Promise.reject(k)}throw pt(this,Ka,Gs).call(this,{type:"error",error:N}),N}finally{se(this,tn).runNext(this)}}},Of=new WeakMap,Ga=new WeakMap,tn=new WeakMap,xo=new WeakMap,Ka=new WeakSet,Gs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Rr.batch(()=>{se(this,Ga).forEach(n=>{n.onMutationUpdate(t)}),se(this,tn).notify({mutation:this,type:"updated",action:t})})},OE);function UM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vs,_a,jf,jE,$M=(jE=class extends Hf{constructor(t={}){super();Ge(this,vs);Ge(this,_a);Ge(this,jf);this.config=t,Ie(this,vs,new Set),Ie(this,_a,new Map),Ie(this,jf,0)}build(t,r,n){const a=new BM({client:t,mutationCache:this,mutationId:++ad(this,jf)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){se(this,vs).add(t);const r=kd(t);if(typeof r=="string"){const n=se(this,_a).get(r);n?n.push(t):se(this,_a).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(se(this,vs).delete(t)){const r=kd(t);if(typeof r=="string"){const n=se(this,_a).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&se(this,_a).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=kd(t);if(typeof r=="string"){const n=se(this,_a).get(r),a=n==null?void 0:n.find(s=>s.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=kd(t);if(typeof r=="string"){const a=(n=se(this,_a).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Rr.batch(()=>{se(this,vs).forEach(t=>{this.notify({type:"removed",mutation:t})}),se(this,vs).clear(),se(this,_a).clear()})}getAll(){return Array.from(se(this,vs))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Cb(r,n))}findAll(t={}){return this.getAll().filter(r=>Cb(t,r))}notify(t){Rr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Rr.batch(()=>Promise.all(t.map(r=>r.continue().catch(En))))}},vs=new WeakMap,_a=new WeakMap,jf=new WeakMap,jE);function kd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ya,RE,zM=(RE=class extends Hf{constructor(t={}){super();Ge(this,Ya);this.config=t,Ie(this,Ya,new Map)}build(t,r,n){const a=r.queryKey,s=r.queryHash??jy(a,r);let i=this.get(s);return i||(i=new jM({client:t,queryKey:a,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(i)),i}add(t){se(this,Ya).has(t.queryHash)||(se(this,Ya).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=se(this,Ya).get(t.queryHash);r&&(t.destroy(),r===t&&se(this,Ya).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Rr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,Ya).get(t)}getAll(){return[...se(this,Ya).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ab(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Ab(t,n)):r}notify(t){Rr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Rr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Rr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ya=new WeakMap,RE),Yt,ui,fi,ec,tc,di,rc,nc,IE,HM=(IE=class{constructor(e={}){Ge(this,Yt);Ge(this,ui);Ge(this,fi);Ge(this,ec);Ge(this,tc);Ge(this,di);Ge(this,rc);Ge(this,nc);Ie(this,Yt,e.queryCache||new zM),Ie(this,ui,e.mutationCache||new $M),Ie(this,fi,e.defaultOptions||{}),Ie(this,ec,new Map),Ie(this,tc,new Map),Ie(this,di,0)}mount(){ad(this,di)._++,se(this,di)===1&&(Ie(this,rc,Iy.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Yt).onFocus())})),Ie(this,nc,t0.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Yt).onOnline())})))}unmount(){var e,t;ad(this,di)._--,se(this,di)===0&&((e=se(this,rc))==null||e.call(this),Ie(this,rc,void 0),(t=se(this,nc))==null||t.call(this),Ie(this,nc,void 0))}isFetching(e){return se(this,Yt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,ui).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=se(this,Yt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=se(this,Yt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ni(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return se(this,Yt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=se(this,Yt).get(n.queryHash),s=a==null?void 0:a.state.data,i=bM(t,s);if(i!==void 0)return se(this,Yt).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return Rr.batch(()=>se(this,Yt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=se(this,Yt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=se(this,Yt);Rr.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=se(this,Yt);return Rr.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Rr.batch(()=>se(this,Yt).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(En).catch(En)}invalidateQueries(e,t={}){return Rr.batch(()=>(se(this,Yt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Rr.batch(()=>se(this,Yt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,r);return r.throwOnError||(s=s.catch(En)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(En)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=se(this,Yt).build(this,t);return r.isStaleByTime(Ni(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(En).catch(En)}fetchInfiniteQuery(e){return e.behavior=r0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(En).catch(En)}ensureInfiniteQueryData(e){return e.behavior=r0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return t0.isOnline()?se(this,ui).resumePausedMutations():Promise.resolve()}getQueryCache(){return se(this,Yt)}getMutationCache(){return se(this,ui)}getDefaultOptions(){return se(this,fi)}setDefaultOptions(e){Ie(this,fi,e)}setQueryDefaults(e,t){se(this,ec).set(of(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,ec).values()],r={};return t.forEach(n=>{lf(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){se(this,tc).set(of(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,tc).values()],r={};return t.forEach(n=>{lf(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...se(this,fi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=jy(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ry&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...se(this,fi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Yt).clear(),se(this,ui).clear()}},Yt=new WeakMap,ui=new WeakMap,fi=new WeakMap,ec=new WeakMap,tc=new WeakMap,di=new WeakMap,rc=new WeakMap,nc=new WeakMap,IE),TN=S.createContext(void 0),kN=e=>{const t=S.useContext(TN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qM=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(TN.Provider,{value:e,children:t})),NN=S.createContext(!1),WM=()=>S.useContext(NN);NN.Provider;function VM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var GM=S.createContext(VM()),KM=()=>S.useContext(GM),YM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?xN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},XM=e=>{S.useEffect(()=>{e.clearReset()},[e])},JM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||xN(r,[e.error,n])),QM=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...a)=>r(n(...a)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ZM=(e,t)=>e.isLoading&&e.isFetching&&!t,eL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Db=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function tL(e,t,r){var h,p,v,m;const n=WM(),a=KM(),s=kN(),i=s.defaultQueryOptions(e);(p=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,i);const o=s.getQueryCache().get(i.queryHash);i._optimisticResults=n?"isRestoring":"optimistic",QM(i),YM(i,a,o),XM(a);const l=!s.getQueryCache().get(i.queryHash),[u]=S.useState(()=>new t(s,i)),f=u.getOptimisticResult(i),d=!n&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(g=>{const x=d?u.subscribe(Rr.batchCalls(g)):En;return u.updateResult(),x},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(i)},[i,u]),eL(i,f))throw Db(i,u,a);if(JM({result:f,errorResetBoundary:a,throwOnError:i.throwOnError,query:o,suspense:i.suspense}))throw f.error;if((m=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||m.call(v,i,f),i.experimental_prefetchInRender&&!Oo&&ZM(f,n)){const g=l?Db(i,u,a):o==null?void 0:o.promise;g==null||g.catch(En).finally(()=>{u.updateResult()})}return i.notifyOnChangeProps?f:u.trackResult(f)}function rL(e,t){return tL(e,LM)}/**
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function cf(){return cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cf.apply(this,arguments)}var mi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(mi||(mi={}));const Mb="popstate";function nL(e){e===void 0&&(e={});function t(n,a){let{pathname:s,search:i,hash:o}=n.location;return Tv("",{pathname:s,search:i,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:n0(a)}return sL(t,r,null,e)}function cr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aL(){return Math.random().toString(36).substr(2,8)}function Lb(e,t){return{usr:e.state,key:e.key,idx:t}}function Tv(e,t,r,n){return r===void 0&&(r=null),cf({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ec(t):t,{state:r,key:t&&t.key||n||aL()})}function n0(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ec(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function sL(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:s=!1}=n,i=a.history,o=mi.Pop,l=null,u=f();u==null&&(u=0,i.replaceState(cf({},i.state,{idx:u}),""));function f(){return(i.state||{idx:null}).idx}function d(){o=mi.Pop;let g=f(),x=g==null?null:g-u;u=g,l&&l({action:o,location:m.location,delta:x})}function h(g,x){o=mi.Push;let y=Tv(m.location,g,x);u=f()+1;let w=Lb(y,u),b=m.createHref(y);try{i.pushState(w,"",b)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(b)}s&&l&&l({action:o,location:m.location,delta:1})}function p(g,x){o=mi.Replace;let y=Tv(m.location,g,x);u=f();let w=Lb(y,u),b=m.createHref(y);i.replaceState(w,"",b),s&&l&&l({action:o,location:m.location,delta:0})}function v(g){let x=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof g=="string"?g:n0(g);return y=y.replace(/ $/,"%20"),cr(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let m={get action(){return o},get location(){return e(a,i)},listen(g){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Mb,d),l=g,()=>{a.removeEventListener(Mb,d),l=null}},createHref(g){return t(a,g)},createURL:v,encodeLocation(g){let x=v(g);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(g){return i.go(g)}};return m}var Bb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bb||(Bb={}));function iL(e,t,r){return r===void 0&&(r="/"),oL(e,t,r)}function oL(e,t,r,n){let a=typeof t=="string"?Ec(t):t,s=My(a.pathname||"/",r);if(s==null)return null;let i=AN(e);lL(i);let o=null;for(let l=0;o==null&&l<i.length;++l){let u=wL(s);o=vL(i[l],u)}return o}function AN(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(s,i,o)=>{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:i,route:s};l.relativePath.startsWith("/")&&(cr(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Ai([n,l.relativePath]),f=r.concat(l);s.children&&s.children.length>0&&(cr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),AN(s.children,t,f,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:mL(u,s.index),routesMeta:f})};return e.forEach((s,i)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))a(s,i);else for(let l of CN(s.path))a(s,i,l)}),t}function CN(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return a?[s,""]:[s];let i=CN(n.join("/")),o=[];return o.push(...i.map(l=>l===""?s:[s,l].join("/"))),a&&o.push(...i),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function lL(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:gL(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const cL=/^:[\w-]+$/,uL=3,fL=2,dL=1,hL=10,pL=-2,Ub=e=>e==="*";function mL(e,t){let r=e.split("/"),n=r.length;return r.some(Ub)&&(n+=pL),t&&(n+=fL),r.filter(a=>!Ub(a)).reduce((a,s)=>a+(cL.test(s)?uL:s===""?dL:hL),n)}function gL(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function vL(e,t,r){let{routesMeta:n}=e,a={},s="/",i=[];for(let o=0;o<n.length;++o){let l=n[o],u=o===n.length-1,f=s==="/"?t:t.slice(s.length)||"/",d=xL({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},f),h=l.route;if(!d)return null;Object.assign(a,d.params),i.push({params:a,pathname:Ai([s,d.pathname]),pathnameBase:TL(Ai([s,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(s=Ai([s,d.pathnameBase]))}return i}function xL(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=yL(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let s=a[0],i=s.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:n.reduce((u,f,d)=>{let{paramName:h,isOptional:p}=f;if(h==="*"){let m=o[d]||"";i=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const v=o[d];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:i,pattern:e}}function yL(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Dy(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function wL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dy(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function My(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const bL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_L=e=>bL.test(e);function EL(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ec(e):e,s;if(r)if(_L(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),Dy(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=$b(r.substring(1),"/"):s=$b(r,t)}else s=t;return{pathname:s,search:kL(n),hash:NL(a)}}function $b(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function gm(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function SL(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function PN(e,t){let r=SL(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ON(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Ec(e):(a=cf({},e),cr(!a.pathname||!a.pathname.includes("?"),gm("?","pathname","search",a)),cr(!a.pathname||!a.pathname.includes("#"),gm("#","pathname","hash",a)),cr(!a.search||!a.search.includes("#"),gm("#","search","hash",a)));let s=e===""||a.pathname==="",i=s?"/":a.pathname,o;if(i==null)o=r;else{let d=t.length-1;if(!n&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),d-=1;a.pathname=h.join("/")}o=d>=0?t[d]:"/"}let l=EL(a,o),u=i&&i!=="/"&&i.endsWith("/"),f=(s||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Ai=e=>e.join("/").replace(/\/\/+/g,"/"),TL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),kL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,NL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function AL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const jN=["post","put","patch","delete"];new Set(jN);const CL=["get",...jN];new Set(CL);/**
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function uf(){return uf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uf.apply(this,arguments)}const Ly=S.createContext(null),PL=S.createContext(null),Uo=S.createContext(null),np=S.createContext(null),zi=S.createContext({outlet:null,matches:[],isDataRoute:!1}),RN=S.createContext(null);function OL(e,t){let{relative:r}=t===void 0?{}:t;qf()||cr(!1);let{basename:n,navigator:a}=S.useContext(Uo),{hash:s,pathname:i,search:o}=DN(e,{relative:r}),l=i;return n!=="/"&&(l=i==="/"?n:Ai([n,i])),a.createHref({pathname:l,search:o,hash:s})}function qf(){return S.useContext(np)!=null}function Sc(){return qf()||cr(!1),S.useContext(np).location}function IN(e){S.useContext(Uo).static||S.useLayoutEffect(e)}function ap(){let{isDataRoute:e}=S.useContext(zi);return e?qL():jL()}function jL(){qf()||cr(!1);let e=S.useContext(Ly),{basename:t,future:r,navigator:n}=S.useContext(Uo),{matches:a}=S.useContext(zi),{pathname:s}=Sc(),i=JSON.stringify(PN(a,r.v7_relativeSplatPath)),o=S.useRef(!1);return IN(()=>{o.current=!0}),S.useCallback(function(u,f){if(f===void 0&&(f={}),!o.current)return;if(typeof u=="number"){n.go(u);return}let d=ON(u,JSON.parse(i),s,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ai([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,i,s,e])}function FN(){let{matches:e}=S.useContext(zi),t=e[e.length-1];return t?t.params:{}}function DN(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=S.useContext(Uo),{matches:a}=S.useContext(zi),{pathname:s}=Sc(),i=JSON.stringify(PN(a,n.v7_relativeSplatPath));return S.useMemo(()=>ON(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}function RL(e,t){return IL(e,t)}function IL(e,t,r,n){qf()||cr(!1);let{navigator:a}=S.useContext(Uo),{matches:s}=S.useContext(zi),i=s[s.length-1],o=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let u=Sc(),f;if(t){var d;let g=typeof t=="string"?Ec(t):t;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||cr(!1),f=g}else f=u;let h=f.pathname||"/",p=h;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let v=iL(e,{pathname:p}),m=BL(v&&v.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Ai([l,a.encodeLocation?a.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:Ai([l,a.encodeLocation?a.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,r,n);return t&&m?S.createElement(np.Provider,{value:{location:uf({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:mi.Pop}},m):m}function FL(){let e=HL(),t=AL(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),r?S.createElement("pre",{style:a},r):null,null)}const DL=S.createElement(FL,null);class ML extends S.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?S.createElement(zi.Provider,{value:this.props.routeContext},S.createElement(RN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function LL(e){let{routeContext:t,match:r,children:n}=e,a=S.useContext(Ly);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),S.createElement(zi.Provider,{value:t},n)}function BL(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,o=(a=r)==null?void 0:a.errors;if(o!=null){let f=i.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);f>=0||cr(!1),i=i.slice(0,Math.min(i.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f<i.length;f++){let d=i[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:h,errors:p}=r,v=d.route.loader&&h[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||v){l=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((f,d,h)=>{let p,v=!1,m=null,g=null;r&&(p=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||DL,l&&(u<0&&h===0?(WL("route-fallback"),v=!0,g=null):u===h&&(v=!0,g=d.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,h+1)),y=()=>{let w;return p?w=m:v?w=g:d.route.Component?w=S.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,S.createElement(LL,{match:d,routeContext:{outlet:f,matches:x,isDataRoute:r!=null},children:w})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?S.createElement(ML,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var MN=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(MN||{}),LN=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(LN||{});function UL(e){let t=S.useContext(Ly);return t||cr(!1),t}function $L(e){let t=S.useContext(PL);return t||cr(!1),t}function zL(e){let t=S.useContext(zi);return t||cr(!1),t}function BN(e){let t=zL(),r=t.matches[t.matches.length-1];return r.route.id||cr(!1),r.route.id}function HL(){var e;let t=S.useContext(RN),r=$L(),n=BN();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function qL(){let{router:e}=UL(MN.UseNavigateStable),t=BN(LN.UseNavigateStable),r=S.useRef(!1);return IN(()=>{r.current=!0}),S.useCallback(function(a,s){s===void 0&&(s={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,uf({fromRouteId:t},s)))},[e,t])}const zb={};function WL(e,t,r){zb[e]||(zb[e]=!0)}function VL(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Cr(e){cr(!1)}function GL(e){let{basename:t="/",children:r=null,location:n,navigationType:a=mi.Pop,navigator:s,static:i=!1,future:o}=e;qf()&&cr(!1);let l=t.replace(/^\/*/,"/"),u=S.useMemo(()=>({basename:l,navigator:s,static:i,future:uf({v7_relativeSplatPath:!1},o)}),[l,o,s,i]);typeof n=="string"&&(n=Ec(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:v="default"}=n,m=S.useMemo(()=>{let g=My(f,l);return g==null?null:{location:{pathname:g,search:d,hash:h,state:p,key:v},navigationType:a}},[l,f,d,h,p,v,a]);return m==null?null:S.createElement(Uo.Provider,{value:u},S.createElement(np.Provider,{children:r,value:m}))}function KL(e){let{children:t,location:r}=e;return RL(kv(t),r)}new Promise(()=>{});function kv(e,t){t===void 0&&(t=[]);let r=[];return S.Children.forEach(e,(n,a)=>{if(!S.isValidElement(n))return;let s=[...t,a];if(n.type===S.Fragment){r.push.apply(r,kv(n.props.children,s));return}n.type!==Cr&&cr(!1),!n.props.index||!n.props.children||cr(!1);let i={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=kv(n.props.children,s)),r.push(i)}),r}/**
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nv.apply(this,arguments)}function YL(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,s;for(s=0;s<n.length;s++)a=n[s],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function XL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function JL(e,t){return e.button===0&&(!t||t==="_self")&&!XL(e)}const QL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ZL="6";try{window.__reactRouterVersion=ZL}catch{}const e6="startTransition",Hb=A0[e6];function t6(e){let{basename:t,children:r,future:n,window:a}=e,s=S.useRef();s.current==null&&(s.current=nL({window:a,v5Compat:!0}));let i=s.current,[o,l]=S.useState({action:i.action,location:i.location}),{v7_startTransition:u}=n||{},f=S.useCallback(d=>{u&&Hb?Hb(()=>l(d)):l(d)},[l,u]);return S.useLayoutEffect(()=>i.listen(f),[i,f]),S.useEffect(()=>VL(n),[n]),S.createElement(GL,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:i,future:n})}const r6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",n6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=S.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:s,replace:i,state:o,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,h=YL(t,QL),{basename:p}=S.useContext(Uo),v,m=!1;if(typeof u=="string"&&n6.test(u)&&(v=u,r6))try{let w=new URL(window.location.href),b=u.startsWith("//")?new URL(w.protocol+u):new URL(u),_=My(b.pathname,p);b.origin===w.origin&&_!=null?u=_+b.search+b.hash:m=!0}catch{}let g=OL(u,{relative:a}),x=a6(u,{replace:i,state:o,target:l,preventScrollReset:f,relative:a,viewTransition:d});function y(w){n&&n(w),w.defaultPrevented||x(w)}return S.createElement("a",Nv({},h,{href:v||g,onClick:m||s?n:y,ref:r,target:l}))});var qb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qb||(qb={}));var Wb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wb||(Wb={}));function a6(e,t){let{target:r,replace:n,state:a,preventScrollReset:s,relative:i,viewTransition:o}=t===void 0?{}:t,l=ap(),u=Sc(),f=DN(e,{relative:i});return S.useCallback(d=>{if(JL(d,r)){d.preventDefault();let h=n!==void 0?n:n0(u)===n0(f);l(e,{replace:h,state:a,preventScrollReset:s,relative:i,viewTransition:o})}},[u,l,f,n,a,r,e,s,i,o])}function s6(){const{pathname:e}=Sc();return S.useEffect(()=>{window.scrollTo(0,0)},[e]),null}var i6=Symbol.for("react.lazy"),a0=A0[" use ".trim().toString()];function o6(e){return typeof e=="object"&&e!==null&&"then"in e}function UN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===i6&&"_payload"in e&&o6(e._payload)}function By(e){const t=c6(e),r=S.forwardRef((n,a)=>{let{children:s,...i}=n;UN(s)&&typeof a0=="function"&&(s=a0(s._payload));const o=S.Children.toArray(s),l=o.find(f6);if(l){const u=l.props.children,f=o.map(d=>d===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...i,ref:a,children:S.isValidElement(u)?S.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}var l6=By("Slot");function c6(e){const t=S.forwardRef((r,n)=>{let{children:a,...s}=r;if(UN(a)&&typeof a0=="function"&&(a=a0(a._payload)),S.isValidElement(a)){const i=h6(a),o=d6(s,a.props);return a.type!==S.Fragment&&(o.ref=n?Fs(n,i):i),S.cloneElement(a,o)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var u6=Symbol("radix.slottable");function f6(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u6}function d6(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function h6(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Uy=Uf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-md hover:shadow-lg transition-all duration-300 hover:scale-105",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-md hover:shadow-lg transition-all duration-300",outline:"border-2 border-input bg-background hover:bg-accent/10 hover:border-primary/30 hover:text-accent-foreground shadow-sm hover:shadow-md transition-all duration-300 hover:scale-105",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm hover:shadow-md transition-all duration-300",ghost:"hover:bg-accent/10 hover:text-accent-foreground transition-all duration-300",link:"text-primary underline-offset-4 hover:underline transition-all duration-300",gradient:"bg-gradient-to-r from-primary via-primary/90 to-accent text-white hover:from-primary/90 hover:via-primary hover:to-accent/90 shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),be=S.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},s)=>{const i=n?l6:"button";return c.jsx(i,{className:je(Uy({variant:t,size:r,className:e})),ref:s,...a})});be.displayName="Button";class $N extends S.Component{constructor(r){super(r);nd(this,"handleReset",()=>{this.setState({hasError:!1,error:null,errorInfo:null})});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r,errorInfo:null}}componentDidCatch(r,n){console.error("ErrorBoundary caught an error:",r,n),this.setState({error:r,errorInfo:n})}render(){if(this.state.hasError){if(this.props.fallback)return this.props.fallback;const r=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:c.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"w-20 h-20 rounded-full bg-destructive/10 flex items-center justify-center",children:c.jsx(hF,{className:"w-10 h-10 text-destructive"})})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h1",{className:"text-2xl font-display font-bold text-foreground",children:"Something went wrong"}),c.jsx("p",{className:"text-muted-foreground",children:"We're sorry, but something unexpected happened. Please try again."})]}),r&&this.state.error&&c.jsxs("div",{className:"text-left bg-muted p-4 rounded-lg text-sm",children:[c.jsxs("p",{className:"font-semibold text-destructive mb-2",children:[this.state.error.name,": ",this.state.error.message]}),this.state.errorInfo&&c.jsx("pre",{className:"text-xs overflow-auto max-h-40",children:this.state.errorInfo.componentStack})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[c.jsx(be,{onClick:this.handleReset,variant:"default",children:"Try Again"}),c.jsx(be,{asChild:!0,variant:"outline",children:c.jsxs(vt,{to:"/",children:[c.jsx(Sk,{className:"w-4 h-4 mr-2"}),"Go Home"]})})]})]})})}return this.props.children}}var p6=S.createContext(void 0);function sp(e){const t=S.useContext(p6);return e||t||"ltr"}var vm=0;function $y(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Vb()),document.body.insertAdjacentElement("beforeend",e[1]??Vb()),vm++,()=>{vm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vm--}},[])}function Vb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xm="focusScope.autoFocusOnMount",ym="focusScope.autoFocusOnUnmount",Gb={bubbles:!1,cancelable:!0},m6="FocusScope",ip=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...i}=e,[o,l]=S.useState(null),u=On(a),f=On(s),d=S.useRef(null),h=Tt(t,m=>l(m)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(n){let m=function(w){if(p.paused||!o)return;const b=w.target;o.contains(b)?d.current=b:Ks(d.current,{select:!0})},g=function(w){if(p.paused||!o)return;const b=w.relatedTarget;b!==null&&(o.contains(b)||Ks(d.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const _ of w)_.removedNodes.length>0&&Ks(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const y=new MutationObserver(x);return o&&y.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),y.disconnect()}}},[n,o,p.paused]),S.useEffect(()=>{if(o){Yb.add(p);const m=document.activeElement;if(!o.contains(m)){const x=new CustomEvent(xm,Gb);o.addEventListener(xm,u),o.dispatchEvent(x),x.defaultPrevented||(g6(b6(zN(o)),{select:!0}),document.activeElement===m&&Ks(o))}return()=>{o.removeEventListener(xm,u),setTimeout(()=>{const x=new CustomEvent(ym,Gb);o.addEventListener(ym,f),o.dispatchEvent(x),x.defaultPrevented||Ks(m??document.body,{select:!0}),o.removeEventListener(ym,f),Yb.remove(p)},0)}}},[o,u,f,p]);const v=S.useCallback(m=>{if(!r&&!n||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(g&&x){const y=m.currentTarget,[w,b]=v6(y);w&&b?!m.shiftKey&&x===b?(m.preventDefault(),r&&Ks(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),r&&Ks(b,{select:!0})):x===y&&m.preventDefault()}},[r,n,p.paused]);return c.jsx(Ze.div,{tabIndex:-1,...i,ref:h,onKeyDown:v})});ip.displayName=m6;function g6(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ks(n,{select:t}),document.activeElement!==r)return}function v6(e){const t=zN(e),r=Kb(t,e),n=Kb(t.reverse(),e);return[r,n]}function zN(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Kb(e,t){for(const r of e)if(!x6(r,{upTo:t}))return r}function x6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function y6(e){return e instanceof HTMLInputElement&&"select"in e}function Ks(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&y6(e)&&t&&e.select()}}var Yb=w6();function w6(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Xb(e,t),e.unshift(t)},remove(t){var r;e=Xb(e,t),(r=e[0])==null||r.resume()}}}function Xb(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function b6(e){return e.filter(t=>t.tagName!=="A")}var wm="rovingFocusGroup.onEntryFocus",_6={bubbles:!1,cancelable:!0},Wf="RovingFocusGroup",[Av,HN,E6]=q0(Wf),[S6,op]=Da(Wf,[E6]),[T6,k6]=S6(Wf),qN=S.forwardRef((e,t)=>c.jsx(Av.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Av.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(N6,{...e,ref:t})})}));qN.displayName=Wf;var N6=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,h=S.useRef(null),p=Tt(t,h),v=sp(s),[m,g]=ji({prop:i,defaultProp:o??null,onChange:l,caller:Wf}),[x,y]=S.useState(!1),w=On(u),b=HN(r),_=S.useRef(!1),[T,E]=S.useState(0);return S.useEffect(()=>{const C=h.current;if(C)return C.addEventListener(wm,w),()=>C.removeEventListener(wm,w)},[w]),c.jsx(T6,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:m,onItemFocus:S.useCallback(C=>g(C),[g]),onItemShiftTab:S.useCallback(()=>y(!0),[]),onFocusableItemAdd:S.useCallback(()=>E(C=>C+1),[]),onFocusableItemRemove:S.useCallback(()=>E(C=>C-1),[]),children:c.jsx(Ze.div,{tabIndex:x||T===0?-1:0,"data-orientation":n,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{_.current=!0}),onFocus:Pe(e.onFocus,C=>{const P=!_.current;if(C.target===C.currentTarget&&P&&!x){const N=new CustomEvent(wm,_6);if(C.currentTarget.dispatchEvent(N),!N.defaultPrevented){const k=b().filter(W=>W.focusable),A=k.find(W=>W.active),I=k.find(W=>W.id===m),U=[A,I,...k].filter(Boolean).map(W=>W.ref.current);GN(U,f)}}_.current=!1}),onBlur:Pe(e.onBlur,()=>y(!1))})})}),WN="RovingFocusGroupItem",VN=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:s,children:i,...o}=e,l=Oa(),u=s||l,f=k6(WN,r),d=f.currentTabStopId===u,h=HN(r),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:m}=f;return S.useEffect(()=>{if(n)return p(),()=>v()},[n,p,v]),c.jsx(Av.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:c.jsx(Ze.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:Pe(e.onMouseDown,g=>{n?f.onItemFocus(u):g.preventDefault()}),onFocus:Pe(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Pe(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const x=P6(g,f.orientation,f.dir);if(x!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let w=h().filter(b=>b.focusable).map(b=>b.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const b=w.indexOf(g.currentTarget);w=f.loop?O6(w,b+1):w.slice(b+1)}setTimeout(()=>GN(w))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});VN.displayName=WN;var A6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function C6(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function P6(e,t,r){const n=C6(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return A6[n]}function GN(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function O6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var KN=qN,YN=VN;function j6(e){const t=R6(e),r=S.forwardRef((n,a)=>{const{children:s,...i}=n,o=S.Children.toArray(s),l=o.find(F6);if(l){const u=l.props.children,f=o.map(d=>d===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...i,ref:a,children:S.isValidElement(u)?S.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function R6(e){const t=S.forwardRef((r,n)=>{const{children:a,...s}=r;if(S.isValidElement(a)){const i=M6(a),o=D6(s,a.props);return a.type!==S.Fragment&&(o.ref=n?Fs(n,i):i),S.cloneElement(a,o)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var I6=Symbol("radix.slottable");function F6(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===I6}function D6(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function M6(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var L6=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jo=new WeakMap,Nd=new WeakMap,Ad={},bm=0,XN=function(e){return e&&(e.host||XN(e.parentNode))},B6=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=XN(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},U6=function(e,t,r,n){var a=B6(t,Array.isArray(e)?e:[e]);Ad[r]||(Ad[r]=new WeakMap);var s=Ad[r],i=[],o=new Set,l=new Set(a),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};a.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(o.has(h))f(h);else try{var p=h.getAttribute(n),v=p!==null&&p!=="false",m=(Jo.get(h)||0)+1,g=(s.get(h)||0)+1;Jo.set(h,m),s.set(h,g),i.push(h),m===1&&v&&Nd.set(h,!0),g===1&&h.setAttribute(r,"true"),v||h.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return f(t),o.clear(),bm++,function(){i.forEach(function(d){var h=Jo.get(d)-1,p=s.get(d)-1;Jo.set(d,h),s.set(d,p),h||(Nd.has(d)||d.removeAttribute(n),Nd.delete(d)),p||d.removeAttribute(r)}),bm--,bm||(Jo=new WeakMap,Jo=new WeakMap,Nd=new WeakMap,Ad={})}},zy=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=L6(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),U6(n,a,r,"aria-hidden")):function(){return null}},Ja=function(){return Ja=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Ja.apply(this,arguments)};function Tc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function $6(e,t,r,n){function a(s){return s instanceof r?s:new r(function(i){i(s)})}return new(r||(r=Promise))(function(s,i){function o(f){try{u(n.next(f))}catch(d){i(d)}}function l(f){try{u(n.throw(f))}catch(d){i(d)}}function u(f){f.done?s(f.value):a(f.value).then(o,l)}u((n=n.apply(e,t||[])).next())})}function z6(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}var dh="right-scroll-bar-position",hh="width-before-scroll-bar",H6="with-scroll-bars-hidden",q6="--removed-body-scroll-bar-size";function _m(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function W6(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var V6=typeof window<"u"?S.useLayoutEffect:S.useEffect,Jb=new WeakMap;function G6(e,t){var r=W6(null,function(n){return e.forEach(function(a){return _m(a,n)})});return V6(function(){var n=Jb.get(r);if(n){var a=new Set(n),s=new Set(e),i=r.current;a.forEach(function(o){s.has(o)||_m(o,null)}),s.forEach(function(o){a.has(o)||_m(o,i)})}Jb.set(r,e)},[e]),r}function K6(e){return e}function Y6(e,t){t===void 0&&(t=K6);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(o){return o!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(o){return s(o)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var o=r;r=[],o.forEach(s),i=r}var l=function(){var f=i;i=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),r}}}};return a}function X6(e){e===void 0&&(e={});var t=Y6(null);return t.options=Ja({async:!0,ssr:!1},e),t}var JN=function(e){var t=e.sideCar,r=Tc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return S.createElement(n,Ja({},r))};JN.isSideCarExport=!0;function J6(e,t){return e.useMedium(t),JN}var QN=X6(),Em=function(){},lp=S.forwardRef(function(e,t){var r=S.useRef(null),n=S.useState({onScrollCapture:Em,onWheelCapture:Em,onTouchMoveCapture:Em}),a=n[0],s=n[1],i=e.forwardProps,o=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,v=e.noIsolation,m=e.inert,g=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,b=Tc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,T=G6([r,t]),E=Ja(Ja({},b),a);return S.createElement(S.Fragment,null,f&&S.createElement(_,{sideCar:QN,removeScrollBar:u,shards:d,noRelative:p,noIsolation:v,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:r,gapMode:w}),i?S.cloneElement(S.Children.only(o),Ja(Ja({},E),{ref:T})):S.createElement(y,Ja({},E,{className:l,ref:T}),o))});lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lp.classNames={fullWidth:hh,zeroRight:dh};var Q6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Z6(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Q6();return t&&e.setAttribute("nonce",t),e}function e8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function t8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var r8=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Z6())&&(e8(t,r),t8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},n8=function(){var e=r8();return function(t,r){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ZN=function(){var e=n8(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},a8={left:0,top:0,right:0,gap:0},Sm=function(e){return parseInt(e||"",10)||0},s8=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Sm(r),Sm(n),Sm(a)]},i8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return a8;var t=s8(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},o8=ZN(),Ul="data-scroll-locked",l8=function(e,t,r,n){var a=e.left,s=e.top,i=e.right,o=e.gap;return r===void 0&&(r="margin"),`
.`.concat(H6,` {
overflow: hidden `).concat(n,`;
padding-right: `).concat(o,"px ").concat(n,`;
}
body[`).concat(Ul,`] {
overflow: hidden `).concat(n,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
padding-left: `.concat(a,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(o,"px ").concat(n,`;
`),r==="padding"&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),`
}
.`).concat(dh,` {
right: `).concat(o,"px ").concat(n,`;
}
.`).concat(hh,` {
margin-right: `).concat(o,"px ").concat(n,`;
}
.`).concat(dh," .").concat(dh,` {
right: 0 `).concat(n,`;
}
.`).concat(hh," .").concat(hh,` {
margin-right: 0 `).concat(n,`;
}
body[`).concat(Ul,`] {
`).concat(q6,": ").concat(o,`px;
}
`)},Qb=function(){var e=parseInt(document.body.getAttribute(Ul)||"0",10);return isFinite(e)?e:0},c8=function(){S.useEffect(function(){return document.body.setAttribute(Ul,(Qb()+1).toString()),function(){var e=Qb()-1;e<=0?document.body.removeAttribute(Ul):document.body.setAttribute(Ul,e.toString())}},[])},u8=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;c8();var s=S.useMemo(function(){return i8(a)},[a]);return S.createElement(o8,{styles:l8(s,!t,a,r?"":"!important")})},Cv=!1;if(typeof window<"u")try{var Cd=Object.defineProperty({},"passive",{get:function(){return Cv=!0,!0}});window.addEventListener("test",Cd,Cd),window.removeEventListener("test",Cd,Cd)}catch{Cv=!1}var Qo=Cv?{passive:!1}:!1,f8=function(e){return e.tagName==="TEXTAREA"},eA=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!f8(e)&&r[t]==="visible")},d8=function(e){return eA(e,"overflowY")},h8=function(e){return eA(e,"overflowX")},Zb=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=tA(e,n);if(a){var s=rA(e,n),i=s[1],o=s[2];if(i>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},p8=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},m8=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},tA=function(e,t){return e==="v"?d8(t):h8(t)},rA=function(e,t){return e==="v"?p8(t):m8(t)},g8=function(e,t){return e==="h"&&t==="rtl"?-1:1},v8=function(e,t,r,n,a){var s=g8(e,window.getComputedStyle(t).direction),i=s*n,o=r.target,l=t.contains(o),u=!1,f=i>0,d=0,h=0;do{if(!o)break;var p=rA(e,o),v=p[0],m=p[1],g=p[2],x=m-g-s*v;(v||x)&&tA(e,o)&&(d+=x,h+=v);var y=o.parentNode;o=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(f&&Math.abs(d)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Pd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e_=function(e){return[e.deltaX,e.deltaY]},t_=function(e){return e&&"current"in e?e.current:e},x8=function(e,t){return e[0]===t[0]&&e[1]===t[1]},y8=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},w8=0,Zo=[];function b8(e){var t=S.useRef([]),r=S.useRef([0,0]),n=S.useRef(),a=S.useState(w8++)[0],s=S.useState(ZN)[0],i=S.useRef(e);S.useEffect(function(){i.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var m=z6([e.lockRef.current],(e.shards||[]).map(t_),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var o=S.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var x=Pd(m),y=r.current,w="deltaX"in m?m.deltaX:y[0]-x[0],b="deltaY"in m?m.deltaY:y[1]-x[1],_,T=m.target,E=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in m&&E==="h"&&T.type==="range")return!1;var C=window.getSelection(),P=C&&C.anchorNode,N=P?P===T||P.contains(T):!1;if(N)return!1;var k=Zb(E,T);if(!k)return!0;if(k?_=E:(_=E==="v"?"h":"v",k=Zb(E,T)),!k)return!1;if(!n.current&&"changedTouches"in m&&(w||b)&&(n.current=_),!_)return!0;var A=n.current||_;return v8(A,g,m,A==="h"?w:b)},[]),l=S.useCallback(function(m){var g=m;if(!(!Zo.length||Zo[Zo.length-1]!==s)){var x="deltaY"in g?e_(g):Pd(g),y=t.current.filter(function(_){return _.name===g.type&&(_.target===g.target||g.target===_.shadowParent)&&x8(_.delta,x)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(i.current.shards||[]).map(t_).filter(Boolean).filter(function(_){return _.contains(g.target)}),b=w.length>0?o(g,w[0]):!i.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),u=S.useCallback(function(m,g,x,y){var w={name:m,delta:g,target:x,should:y,shadowParent:_8(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),f=S.useCallback(function(m){r.current=Pd(m),n.current=void 0},[]),d=S.useCallback(function(m){u(m.type,e_(m),m.target,o(m,e.lockRef.current))},[]),h=S.useCallback(function(m){u(m.type,Pd(m),m.target,o(m,e.lockRef.current))},[]);S.useEffect(function(){return Zo.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Qo),document.addEventListener("touchmove",l,Qo),document.addEventListener("touchstart",f,Qo),function(){Zo=Zo.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Qo),document.removeEventListener("touchmove",l,Qo),document.removeEventListener("touchstart",f,Qo)}},[]);var p=e.removeScrollBar,v=e.inert;return S.createElement(S.Fragment,null,v?S.createElement(s,{styles:y8(a)}):null,p?S.createElement(u8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _8(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const E8=J6(QN,b8);var cp=S.forwardRef(function(e,t){return S.createElement(lp,Ja({},e,{ref:t,sideCar:E8}))});cp.classNames=lp.classNames;var Pv=["Enter"," "],S8=["ArrowDown","PageUp","Home"],nA=["ArrowUp","PageDown","End"],T8=[...S8,...nA],k8={ltr:[...Pv,"ArrowRight"],rtl:[...Pv,"ArrowLeft"]},N8={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vf="Menu",[ff,A8,C8]=q0(Vf),[$o,aA]=Da(Vf,[C8,_c,op]),up=_c(),sA=op(),[P8,zo]=$o(Vf),[O8,Gf]=$o(Vf),iA=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:s,modal:i=!0}=e,o=up(t),[l,u]=S.useState(null),f=S.useRef(!1),d=On(s),h=sp(a);return S.useEffect(()=>{const p=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),c.jsx(Ny,{...o,children:c.jsx(P8,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:c.jsx(O8,{scope:t,onClose:S.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:h,modal:i,children:n})})})};iA.displayName=Vf;var j8="MenuAnchor",Hy=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=up(r);return c.jsx(Ay,{...a,...n,ref:t})});Hy.displayName=j8;var qy="MenuPortal",[R8,oA]=$o(qy,{forceMount:void 0}),lA=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,s=zo(qy,t);return c.jsx(R8,{scope:t,forceMount:r,children:c.jsx(Ma,{present:r||s.open,children:c.jsx(Lf,{asChild:!0,container:a,children:n})})})};lA.displayName=qy;var sa="MenuContent",[I8,Wy]=$o(sa),cA=S.forwardRef((e,t)=>{const r=oA(sa,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=zo(sa,e.__scopeMenu),i=Gf(sa,e.__scopeMenu);return c.jsx(ff.Provider,{scope:e.__scopeMenu,children:c.jsx(Ma,{present:n||s.open,children:c.jsx(ff.Slot,{scope:e.__scopeMenu,children:i.modal?c.jsx(F8,{...a,ref:t}):c.jsx(D8,{...a,ref:t})})})})}),F8=S.forwardRef((e,t)=>{const r=zo(sa,e.__scopeMenu),n=S.useRef(null),a=Tt(t,n);return S.useEffect(()=>{const s=n.current;if(s)return zy(s)},[]),c.jsx(Vy,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),D8=S.forwardRef((e,t)=>{const r=zo(sa,e.__scopeMenu);return c.jsx(Vy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),M8=j6("MenuContent.ScrollLock"),Vy=S.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:v,...m}=e,g=zo(sa,r),x=Gf(sa,r),y=up(r),w=sA(r),b=A8(r),[_,T]=S.useState(null),E=S.useRef(null),C=Tt(t,E,g.onContentChange),P=S.useRef(0),N=S.useRef(""),k=S.useRef(0),A=S.useRef(null),I=S.useRef("right"),M=S.useRef(0),U=v?cp:S.Fragment,W=v?{as:M8,allowPinchZoom:!0}:void 0,G=R=>{var H,Z;const z=N.current+R,D=b().filter(X=>!X.disabled),O=document.activeElement,j=(H=D.find(X=>X.ref.current===O))==null?void 0:H.textValue,B=D.map(X=>X.textValue),L=Y8(B,z,j),F=(Z=D.find(X=>X.textValue===L))==null?void 0:Z.ref.current;(function X(ne){N.current=ne,window.clearTimeout(P.current),ne!==""&&(P.current=window.setTimeout(()=>X(""),1e3))})(z),F&&setTimeout(()=>F.focus())};S.useEffect(()=>()=>window.clearTimeout(P.current),[]),$y();const Q=S.useCallback(R=>{var D,O;return I.current===((D=A.current)==null?void 0:D.side)&&J8(R,(O=A.current)==null?void 0:O.area)},[]);return c.jsx(I8,{scope:r,searchRef:N,onItemEnter:S.useCallback(R=>{Q(R)&&R.preventDefault()},[Q]),onItemLeave:S.useCallback(R=>{var z;Q(R)||((z=E.current)==null||z.focus(),T(null))},[Q]),onTriggerLeave:S.useCallback(R=>{Q(R)&&R.preventDefault()},[Q]),pointerGraceTimerRef:k,onPointerGraceIntentChange:S.useCallback(R=>{A.current=R},[]),children:c.jsx(U,{...W,children:c.jsx(ip,{asChild:!0,trapped:a,onMountAutoFocus:Pe(s,R=>{var z;R.preventDefault(),(z=E.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:c.jsx(xc,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:c.jsx(KN,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:_,onCurrentTabStopIdChange:T,onEntryFocus:Pe(l,R=>{x.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Cy,{role:"menu","aria-orientation":"vertical","data-state":TA(g.open),"data-radix-menu-content":"",dir:x.dir,...y,...m,ref:C,style:{outline:"none",...m.style},onKeyDown:Pe(m.onKeyDown,R=>{const D=R.target.closest("[data-radix-menu-content]")===R.currentTarget,O=R.ctrlKey||R.altKey||R.metaKey,j=R.key.length===1;D&&(R.key==="Tab"&&R.preventDefault(),!O&&j&&G(R.key));const B=E.current;if(R.target!==B||!T8.includes(R.key))return;R.preventDefault();const F=b().filter(H=>!H.disabled).map(H=>H.ref.current);nA.includes(R.key)&&F.reverse(),G8(F)}),onBlur:Pe(e.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:Pe(e.onPointerMove,df(R=>{const z=R.target,D=M.current!==R.clientX;if(R.currentTarget.contains(z)&&D){const O=R.clientX>M.current?"right":"left";I.current=O,M.current=R.clientX}}))})})})})})})});cA.displayName=sa;var L8="MenuGroup",Gy=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ze.div,{role:"group",...n,ref:t})});Gy.displayName=L8;var B8="MenuLabel",uA=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ze.div,{...n,ref:t})});uA.displayName=B8;var s0="MenuItem",r_="menu.itemSelect",fp=S.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,s=S.useRef(null),i=Gf(s0,e.__scopeMenu),o=Wy(s0,e.__scopeMenu),l=Tt(t,s),u=S.useRef(!1),f=()=>{const d=s.current;if(!r&&d){const h=new CustomEvent(r_,{bubbles:!0,cancelable:!0});d.addEventListener(r_,p=>n==null?void 0:n(p),{once:!0}),uy(d,h),h.defaultPrevented?u.current=!1:i.onClose()}};return c.jsx(fA,{...a,ref:l,disabled:r,onClick:Pe(e.onClick,f),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),u.current=!0},onPointerUp:Pe(e.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:Pe(e.onKeyDown,d=>{const h=o.searchRef.current!=="";r||h&&d.key===" "||Pv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});fp.displayName=s0;var fA=S.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...s}=e,i=Wy(s0,r),o=sA(r),l=S.useRef(null),u=Tt(t,l),[f,d]=S.useState(!1),[h,p]=S.useState("");return S.useEffect(()=>{const v=l.current;v&&p((v.textContent??"").trim())},[s.children]),c.jsx(ff.ItemSlot,{scope:r,disabled:n,textValue:a??h,children:c.jsx(YN,{asChild:!0,...o,focusable:!n,children:c.jsx(Ze.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:u,onPointerMove:Pe(e.onPointerMove,df(v=>{n?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,df(v=>i.onItemLeave(v))),onFocus:Pe(e.onFocus,()=>d(!0)),onBlur:Pe(e.onBlur,()=>d(!1))})})})}),U8="MenuCheckboxItem",dA=S.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return c.jsx(vA,{scope:e.__scopeMenu,checked:r,children:c.jsx(fp,{role:"menuitemcheckbox","aria-checked":i0(r)?"mixed":r,...a,ref:t,"data-state":Yy(r),onSelect:Pe(a.onSelect,()=>n==null?void 0:n(i0(r)?!0:!r),{checkForDefaultPrevented:!1})})})});dA.displayName=U8;var hA="MenuRadioGroup",[$8,z8]=$o(hA,{value:void 0,onValueChange:()=>{}}),pA=S.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,s=On(n);return c.jsx($8,{scope:e.__scopeMenu,value:r,onValueChange:s,children:c.jsx(Gy,{...a,ref:t})})});pA.displayName=hA;var mA="MenuRadioItem",gA=S.forwardRef((e,t)=>{const{value:r,...n}=e,a=z8(mA,e.__scopeMenu),s=r===a.value;return c.jsx(vA,{scope:e.__scopeMenu,checked:s,children:c.jsx(fp,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Yy(s),onSelect:Pe(n.onSelect,()=>{var i;return(i=a.onValueChange)==null?void 0:i.call(a,r)},{checkForDefaultPrevented:!1})})})});gA.displayName=mA;var Ky="MenuItemIndicator",[vA,H8]=$o(Ky,{checked:!1}),xA=S.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,s=H8(Ky,r);return c.jsx(Ma,{present:n||i0(s.checked)||s.checked===!0,children:c.jsx(Ze.span,{...a,ref:t,"data-state":Yy(s.checked)})})});xA.displayName=Ky;var q8="MenuSeparator",yA=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});yA.displayName=q8;var W8="MenuArrow",wA=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=up(r);return c.jsx(Py,{...a,...n,ref:t})});wA.displayName=W8;var V8="MenuSub",[iie,bA]=$o(V8),iu="MenuSubTrigger",_A=S.forwardRef((e,t)=>{const r=zo(iu,e.__scopeMenu),n=Gf(iu,e.__scopeMenu),a=bA(iu,e.__scopeMenu),s=Wy(iu,e.__scopeMenu),i=S.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=S.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return S.useEffect(()=>f,[f]),S.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),l(null)}},[o,l]),c.jsx(Hy,{asChild:!0,...u,children:c.jsx(fA,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":TA(r.open),...e,ref:Fs(t,a.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,df(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:Pe(e.onPointerLeave,df(d=>{var p,v;f();const h=(p=r.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(v=r.content)==null?void 0:v.dataset.side,g=m==="right",x=g?-5:5,y=h[g?"left":"right"],w=h[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:y,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:y,y:h.bottom}],side:m}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,d=>{var p;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||k8[n.dir].includes(d.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),d.preventDefault())})})})});_A.displayName=iu;var EA="MenuSubContent",SA=S.forwardRef((e,t)=>{const r=oA(sa,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=zo(sa,e.__scopeMenu),i=Gf(sa,e.__scopeMenu),o=bA(EA,e.__scopeMenu),l=S.useRef(null),u=Tt(t,l);return c.jsx(ff.Provider,{scope:e.__scopeMenu,children:c.jsx(Ma,{present:n||s.open,children:c.jsx(ff.Slot,{scope:e.__scopeMenu,children:c.jsx(Vy,{id:o.contentId,"aria-labelledby":o.triggerId,...a,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var d;i.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,f=>{f.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:Pe(e.onKeyDown,f=>{var p;const d=f.currentTarget.contains(f.target),h=N8[i.dir].includes(f.key);d&&h&&(s.onOpenChange(!1),(p=o.trigger)==null||p.focus(),f.preventDefault())})})})})})});SA.displayName=EA;function TA(e){return e?"open":"closed"}function i0(e){return e==="indeterminate"}function Yy(e){return i0(e)?"indeterminate":e?"checked":"unchecked"}function G8(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function K8(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Y8(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=K8(e,Math.max(s,0));a.length===1&&(i=i.filter(u=>u!==r));const l=i.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return l!==r?l:void 0}function X8(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const o=t[s],l=t[i],u=o.x,f=o.y,d=l.x,h=l.y;f>n!=h>n&&r<(d-u)*(n-f)/(h-f)+u&&(a=!a)}return a}function J8(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return X8(r,t)}function df(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q8=iA,Z8=Hy,eB=lA,tB=cA,rB=Gy,nB=uA,aB=fp,sB=dA,iB=pA,oB=gA,lB=xA,cB=yA,uB=wA,fB=_A,dB=SA,dp="DropdownMenu",[hB]=Da(dp,[aA]),yn=aA(),[pB,kA]=hB(dp),NA=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,l=yn(t),u=S.useRef(null),[f,d]=ji({prop:a,defaultProp:s??!1,onChange:i,caller:dp});return c.jsx(pB,{scope:t,triggerId:Oa(),triggerRef:u,contentId:Oa(),open:f,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(h=>!h),[d]),modal:o,children:c.jsx(Q8,{...l,open:f,onOpenChange:d,dir:n,modal:o,children:r})})};NA.displayName=dp;var AA="DropdownMenuTrigger",CA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,s=kA(AA,r),i=yn(r);return c.jsx(Z8,{asChild:!0,...i,children:c.jsx(Ze.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Fs(t,s.triggerRef),onPointerDown:Pe(e.onPointerDown,o=>{!n&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:Pe(e.onKeyDown,o=>{n||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});CA.displayName=AA;var mB="DropdownMenuPortal",PA=e=>{const{__scopeDropdownMenu:t,...r}=e,n=yn(t);return c.jsx(eB,{...n,...r})};PA.displayName=mB;var OA="DropdownMenuContent",jA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=kA(OA,r),s=yn(r),i=S.useRef(!1);return c.jsx(tB,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...n,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{var l;i.current||(l=a.triggerRef.current)==null||l.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!a.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jA.displayName=OA;var gB="DropdownMenuGroup",vB=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(rB,{...a,...n,ref:t})});vB.displayName=gB;var xB="DropdownMenuLabel",RA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(nB,{...a,...n,ref:t})});RA.displayName=xB;var yB="DropdownMenuItem",IA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(aB,{...a,...n,ref:t})});IA.displayName=yB;var wB="DropdownMenuCheckboxItem",FA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(sB,{...a,...n,ref:t})});FA.displayName=wB;var bB="DropdownMenuRadioGroup",_B=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(iB,{...a,...n,ref:t})});_B.displayName=bB;var EB="DropdownMenuRadioItem",DA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(oB,{...a,...n,ref:t})});DA.displayName=EB;var SB="DropdownMenuItemIndicator",MA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(lB,{...a,...n,ref:t})});MA.displayName=SB;var TB="DropdownMenuSeparator",LA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(cB,{...a,...n,ref:t})});LA.displayName=TB;var kB="DropdownMenuArrow",NB=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(uB,{...a,...n,ref:t})});NB.displayName=kB;var AB="DropdownMenuSubTrigger",BA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(fB,{...a,...n,ref:t})});BA.displayName=AB;var CB="DropdownMenuSubContent",UA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=yn(r);return c.jsx(dB,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});UA.displayName=CB;var PB=NA,OB=CA,jB=PA,$A=jA,zA=RA,HA=IA,qA=FA,WA=DA,VA=MA,GA=LA,KA=BA,YA=UA;const RB=PB,IB=OB,FB=S.forwardRef(({className:e,inset:t,children:r,...n},a)=>c.jsxs(KA,{ref:a,className:je("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...n,children:[r,c.jsx(gy,{className:"ml-auto h-4 w-4"})]}));FB.displayName=KA.displayName;const DB=S.forwardRef(({className:e,...t},r)=>c.jsx(YA,{ref:r,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));DB.displayName=YA.displayName;const XA=S.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(jB,{children:c.jsx($A,{ref:n,sideOffset:t,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));XA.displayName=$A.displayName;const JA=S.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(HA,{ref:n,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...r}));JA.displayName=HA.displayName;const MB=S.forwardRef(({className:e,children:t,checked:r,...n},a)=>c.jsxs(qA,{ref:a,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:r,...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(VA,{children:c.jsx(bk,{className:"h-4 w-4"})})}),t]}));MB.displayName=qA.displayName;const LB=S.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(WA,{ref:n,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(VA,{children:c.jsx(QI,{className:"h-2 w-2 fill-current"})})}),t]}));LB.displayName=WA.displayName;const BB=S.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(zA,{ref:n,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));BB.displayName=zA.displayName;const UB=S.forwardRef(({className:e,...t},r)=>c.jsx(GA,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));UB.displayName=GA.displayName;const n_=[{label:"Home",href:"/"},{label:"Products",href:"/products"},{label:"Posts",href:"/posts"}],a_=[{label:"Flower Planting Calendar",href:"/tools/flower-calendar"},{label:"Pot Size Calculator",href:"/tools/pot-calculator"},{label:"Bloom Time Calculator",href:"/tools/bloom-calculator"},{label:"Budget Planner (₹)",href:"/tools/budget-planner"}];function gr(){const[e,t]=S.useState(!1),[r,n]=S.useState(!1);S.useEffect(()=>{const s=()=>{n(window.scrollY>10)};return window.addEventListener("scroll",s),()=>window.removeEventListener("scroll",s)},[]);const a=S.useCallback(s=>{s.key==="Escape"&&t(!1)},[]);return c.jsxs(c.Fragment,{children:[c.jsx("a",{href:"#main-content",className:"skip-to-content",children:"Skip to main content"}),c.jsxs("header",{className:je("fixed top-0 left-0 right-0 z-50 transition-all duration-500 overflow-visible",r?"glass shadow-xl backdrop-blur-xl bg-white/80 border-b border-white/20":"bg-transparent"),onKeyDown:a,children:[c.jsx("div",{className:"section-container overflow-visible",children:c.jsxs("div",{className:"flex items-center justify-between h-12 xs:h-14 sm:h-16 md:h-18 lg:h-20 py-0.5 xs:py-1 overflow-visible",children:[c.jsxs(vt,{to:"/",className:"flex items-center gap-1.5 xs:gap-2 sm:gap-3 focus-ring",children:[c.jsx("div",{className:"flex-shrink-0 flex items-center justify-center h-10 xs:h-12 sm:h-14 md:h-16 lg:h-16 overflow-hidden",children:c.jsx("img",{src:"/images/Avtar.png",alt:"Perfect Gardener Logo",className:"h-full w-auto max-w-[72px] xs:max-w-[80px] sm:max-w-[96px] object-contain object-center transition-transform duration-300",onError:s=>{const i=s.target;i.style.display="none";const o=i.parentElement;if(o){const l=document.createElement("div");l.className="w-16 h-16 md:w-20 md:h-20 lg:w-24 lg:h-24 rounded-full bg-primary/10 flex items-center justify-center";const u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("class","w-10 h-10 md:w-12 md:h-12 lg:w-14 lg:h-14 text-primary"),u.setAttribute("fill","none"),u.setAttribute("stroke","currentColor"),u.setAttribute("viewBox","0 0 24 24");const f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("stroke-linecap","round"),f.setAttribute("stroke-linejoin","round"),f.setAttribute("stroke-width","2"),f.setAttribute("d","M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"),u.appendChild(f),l.appendChild(u),o.appendChild(l)}}})}),c.jsx("span",{className:"font-display font-bold text-base xs:text-lg sm:text-xl md:text-2xl lg:text-3xl xl:text-4xl text-foreground hidden xs:inline",children:"Perfect Gardener"})]}),c.jsxs("nav",{className:"hidden md:flex items-center gap-0.5 lg:gap-1",role:"navigation","aria-label":"Main navigation",children:[n_.map(s=>c.jsx(vt,{to:s.href,className:"px-2 lg:px-3 xl:px-4 py-1.5 lg:py-2 text-xs lg:text-sm xl:text-base font-semibold text-foreground/80 hover:text-foreground hover:bg-gradient-to-r hover:from-primary/10 hover:to-accent/10 rounded-lg transition-all duration-300 hover:scale-105 focus-ring",children:s.label},s.href)),c.jsxs(RB,{children:[c.jsx(IB,{asChild:!0,children:c.jsxs(be,{variant:"ghost",className:"px-4 py-2 text-sm md:text-base font-semibold text-foreground/80 hover:text-foreground hover:bg-secondary focus-ring",children:["Tools",c.jsx(my,{className:"ml-1 h-5 w-5"})]})}),c.jsx(XA,{align:"start",className:"w-56 bg-popover border border-border shadow-lg z-[100]",children:a_.map(s=>c.jsx(JA,{asChild:!0,children:c.jsx(vt,{to:s.href,className:"w-full cursor-pointer focus-ring",children:s.label})},s.href))})]}),c.jsx(vt,{to:"/#youtube",className:"px-4 py-2 text-sm md:text-base font-semibold text-foreground/80 hover:text-foreground hover:bg-gradient-to-r hover:from-primary/10 hover:to-accent/10 rounded-lg transition-all duration-300 hover:scale-105 focus-ring",children:"YouTube"})]}),c.jsx(be,{variant:"ghost",size:"icon",className:"md:hidden focus-ring relative z-50",onClick:()=>t(!e),"aria-expanded":e,"aria-controls":"mobile-menu","aria-label":e?"Close menu":"Open menu",children:c.jsxs("div",{className:"relative w-5 h-5",children:[c.jsx("span",{className:je("absolute left-0 top-0 h-0.5 w-full bg-foreground transition-all duration-300",e?"top-2 rotate-45":"top-0")}),c.jsx("span",{className:je("absolute left-0 top-2 h-0.5 w-full bg-foreground transition-all duration-300",e?"opacity-0":"opacity-100")}),c.jsx("span",{className:je("absolute left-0 top-4 h-0.5 w-full bg-foreground transition-all duration-300",e?"top-2 -rotate-45":"top-4")})]})})]})}),c.jsx("div",{id:"mobile-menu",className:je("md:hidden overflow-hidden transition-all duration-300 bg-background/95 backdrop-blur-md border-t border-border shadow-lg",e?"max-h-[500px] opacity-100 visible":"max-h-0 opacity-0 invisible"),role:"navigation","aria-label":"Mobile navigation",children:c.jsxs("nav",{className:"section-container py-4 space-y-1",children:[n_.map(s=>c.jsx(vt,{to:s.href,className:"block px-4 py-3 text-base font-semibold text-foreground hover:bg-secondary rounded-lg transition-colors focus-ring",onClick:()=>t(!1),children:s.label},s.href)),c.jsx("div",{className:"px-4 py-2 text-sm font-semibold text-muted-foreground",children:"Tools"}),a_.map(s=>c.jsx(vt,{to:s.href,className:"block px-6 py-2 text-foreground/80 hover:bg-secondary rounded-lg transition-colors focus-ring text-sm",onClick:()=>t(!1),children:s.label},s.href)),c.jsx(vt,{to:"/#youtube",className:"block px-4 py-3 text-base font-semibold text-foreground hover:bg-secondary rounded-lg transition-colors focus-ring",onClick:()=>t(!1),children:"YouTube"})]})})]})]})}const $B=[{label:"Home",href:"/"},{label:"Products",href:"/products"},{label:"Posts",href:"/posts"},{label:"Contact",href:"/contact"},{label:"About",href:"/about"},{label:"Privacy Policy",href:"/privacy"}],zB=[{label:"YouTube",href:"https://www.youtube.com/@perfect.gardener",icon:Y0},{label:"Instagram",href:"https://www.instagram.com/_perfect.gardener/",icon:aF},{label:"Facebook",href:"https://www.facebook.com/perfect.gardener",icon:tF},{label:"Twitter",href:"https://twitter.com/perfect_gardener",icon:pF}];function vr(){const e=new Date().getFullYear();return c.jsx("footer",{className:"bg-secondary/50 border-t border-border",children:c.jsxs("div",{className:"section-container py-12 md:py-16",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 md:gap-12",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs(vt,{to:"/",className:"flex items-center gap-3 group",children:[c.jsx("div",{className:"flex-shrink-0 flex items-center justify-center",style:{minHeight:"64px",padding:"4px 0",overflow:"visible"},children:c.jsx("img",{src:"/images/Avtar.png",alt:"Perfect Gardener Logo",className:"w-16 h-16 md:w-20 md:h-20 lg:w-24 lg:h-24 object-contain object-center group-hover:scale-110 transition-transform duration-300 drop-shadow-lg",style:{width:"auto",height:"auto",maxWidth:"80px",maxHeight:"80px",objectFit:"contain",objectPosition:"center",display:"block"},onError:t=>{const r=t.target;r.style.display="none";const n=r.parentElement;if(n){const a=document.createElement("div");a.className="w-16 h-16 md:w-20 md:h-20 lg:w-24 lg:h-24 rounded-full bg-primary/10 flex items-center justify-center";const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("class","w-10 h-10 md:w-12 md:h-12 lg:w-14 lg:h-14 text-primary"),s.setAttribute("fill","none"),s.setAttribute("stroke","currentColor"),s.setAttribute("viewBox","0 0 24 24");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("stroke-width","2"),i.setAttribute("d","M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"),s.appendChild(i),a.appendChild(s),n.appendChild(a)}}})}),c.jsx("span",{className:"font-display font-bold text-xl md:text-2xl lg:text-3xl text-foreground",children:"Perfect Gardener"})]}),c.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed max-w-xs",children:"Nature, flowers, plants, care — helping them grow better. Your trusted companion for all gardening needs."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-display font-semibold text-foreground mb-4",children:"Quick Links"}),c.jsx("ul",{className:"space-y-2",children:$B.map(t=>c.jsx("li",{children:c.jsx(vt,{to:t.href,className:"text-sm text-muted-foreground hover:text-primary transition-colors focus-ring rounded",children:t.label})},t.href))})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h4",{className:"font-display font-semibold text-foreground mb-4",children:"Contact"}),c.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[c.jsx("li",{children:"Email: progardener01@gmail.com"}),c.jsx("li",{children:"Location: Uttarakhand, India"})]}),c.jsx(be,{asChild:!0,className:"mt-4",children:c.jsxs("a",{href:"https://www.youtube.com/@perfect.gardener",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(Y0,{className:"w-4 h-4 mr-2"}),"Subscribe on YouTube"]})}),c.jsx("div",{className:"flex items-center gap-2 pt-4",children:zB.map(t=>c.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer","aria-label":t.label,className:"w-10 h-10 rounded-full bg-background border border-border flex items-center justify-center text-muted-foreground hover:text-primary hover:border-primary transition-colors focus-ring",children:c.jsx(t.icon,{className:"w-4 h-4"})},t.label))})]})]}),c.jsx("div",{className:"mt-12 pt-6 border-t border-border text-center",children:c.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",e," Perfect Gardener • All rights reserved."]})})]})})}function HB(){return c.jsxs("section",{className:"relative min-h-screen flex items-center pt-20 sm:pt-24 md:pt-12 lg:pt-16 overflow-hidden",onMouseMove:e=>{const t=document.querySelectorAll(".floating-card"),r=e.currentTarget.getBoundingClientRect(),n=(e.clientX-r.left)/r.width*100,a=(e.clientY-r.top)/r.height*100;t.forEach((s,i)=>{const o=s,l=(i+1)*.5,u=(n-50)*l*.01,f=(a-50)*l*.01;o.style.transform=`translate(${u}px, ${f}px)`})},children:[c.jsx("div",{className:"absolute inset-0 -z-10",style:{background:`
radial-gradient(ellipse 80% 50% at 50% 0%, hsl(147 55% 40% / 0.15) 0%, transparent 50%),
radial-gradient(ellipse 60% 40% at 100% 50%, hsl(199 85% 70% / 0.12) 0%, transparent 50%),
radial-gradient(ellipse 50% 30% at 0% 100%, hsl(120 40% 85% / 0.1) 0%, transparent 50%),
linear-gradient(180deg, hsl(140 25% 98%) 0%, hsl(140 20% 99%) 100%)
`}}),c.jsx("div",{className:"absolute top-20 right-20 w-[500px] h-[500px] rounded-full blur-3xl opacity-40 hidden lg:block animate-parallax-glow",style:{background:"radial-gradient(circle, hsl(147 55% 40% / 0.3) 0%, transparent 70%)"}}),c.jsx("div",{className:"absolute bottom-20 left-20 w-[400px] h-[400px] rounded-full blur-3xl opacity-30 hidden lg:block animate-parallax-glow",style:{background:"radial-gradient(circle, hsl(199 85% 70% / 0.25) 0%, transparent 70%)",animationDelay:"1s"}}),c.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] rounded-full blur-3xl opacity-20 hidden lg:block animate-parallax-glow",style:{background:"radial-gradient(circle, hsl(120 40% 85% / 0.2) 0%, transparent 70%)",animationDelay:"2s"}}),c.jsx("div",{className:"absolute top-1/4 left-1/4 w-32 h-32 rounded-full bg-primary/10 blur-2xl animate-float-slow hidden lg:block"}),c.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-40 h-40 rounded-full bg-accent/10 blur-2xl animate-float-fast hidden lg:block"}),c.jsx("div",{className:"absolute top-24 right-8 w-40 h-40 rounded-full bg-primary/10 blur-3xl md:hidden"}),c.jsx("div",{className:"absolute bottom-24 left-6 w-44 h-44 rounded-full bg-accent/10 blur-3xl md:hidden"}),c.jsx("div",{className:"absolute top-1/2 right-0 -translate-y-1/2 translate-x-1/4 w-[700px] h-[700px] rounded-full border-2 border-dashed border-primary/15 animate-slow-spin hidden lg:block"}),c.jsx("div",{className:"absolute top-1/2 right-0 -translate-y-1/2 translate-x-1/4 w-[550px] h-[550px] rounded-full border border-primary/10 animate-slow-spin hidden lg:block",style:{animationDirection:"reverse",animationDuration:"25s"}}),c.jsx("div",{className:"absolute top-1/2 right-0 -translate-y-1/2 translate-x-1/4 w-[400px] h-[400px] rounded-full border border-primary/5 animate-slow-spin hidden lg:block",style:{animationDuration:"30s"}}),c.jsx("div",{className:"section-container relative z-10",children:c.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-12 lg:gap-16 items-center",children:[c.jsxs("div",{className:"space-y-6 sm:space-y-8 text-center lg:text-left",children:[c.jsxs("div",{className:"inline-flex items-center gap-1.5 xs:gap-2 px-3 xs:px-4 sm:px-5 py-1.5 xs:py-2 sm:py-2.5 rounded-full bg-gradient-to-r from-primary/10 via-accent/10 to-primary/10 backdrop-blur-sm border border-primary/20 text-primary text-xs xs:text-sm font-semibold animate-fade-in-up shadow-lg",children:[c.jsx(vy,{className:"w-3 h-3 xs:w-4 xs:h-4"}),c.jsx("span",{children:"Your Green Companion"})]}),c.jsxs("h1",{className:"font-display text-2xl xs:text-3xl sm:text-4xl md:text-5xl lg:text-6xl xl:text-7xl font-extrabold leading-[1.1] animate-fade-in-up animation-delay-100",children:[c.jsx("span",{className:"text-foreground",children:"Perfect"})," ",c.jsx("span",{className:"gradient-text",children:"Gardener"})]}),c.jsx("p",{className:"text-sm xs:text-base sm:text-lg md:text-xl lg:text-2xl text-muted-foreground max-w-xl mx-auto lg:mx-0 leading-relaxed animate-fade-in-up animation-delay-200",children:"Perfect Gardener helps home gardeners grow healthier plants with expert gardening tips, organic seeds, trusted tools, and step-by-step plant care guides."}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 xs:gap-3 sm:gap-4 justify-center lg:justify-start animate-fade-in-up animation-delay-300",children:[c.jsx(be,{asChild:!0,size:"lg",className:"btn-gradient group relative overflow-hidden px-4 xs:px-5 sm:px-6 md:px-8 py-3 xs:py-4 sm:py-5 md:py-6 text-xs xs:text-sm sm:text-base md:text-lg font-semibold w-full sm:w-auto",children:c.jsxs(vt,{to:"/products",className:"relative z-10 flex items-center justify-center",children:["Browse Products",c.jsx($f,{className:"w-3 h-3 xs:w-4 xs:h-4 sm:w-5 sm:h-5 ml-1.5 xs:ml-2 transition-transform group-hover:translate-x-1"})]})}),c.jsx(be,{asChild:!0,variant:"outline",size:"lg",className:"px-4 xs:px-5 sm:px-6 md:px-8 py-3 xs:py-4 sm:py-5 md:py-6 text-xs xs:text-sm sm:text-base md:text-lg font-semibold border-2 hover:bg-primary/5 hover:border-primary/30 transition-all duration-300 shadow-md hover:shadow-lg w-full sm:w-auto",children:c.jsx(vt,{to:"/posts",children:"Read Posts"})})]}),c.jsxs("div",{className:"flex items-center justify-center lg:justify-start gap-3 xs:gap-4 sm:gap-6 md:gap-8 pt-4 xs:pt-5 sm:pt-6 md:pt-8 animate-fade-in-up animation-delay-400",children:[c.jsxs("div",{className:"text-center group",children:[c.jsx("p",{className:"font-display text-xl xs:text-2xl sm:text-3xl md:text-4xl font-bold gradient-text mb-0.5 xs:mb-1 group-hover:scale-110 transition-transform duration-300",children:"50+"}),c.jsx("p",{className:"text-[10px] xs:text-xs sm:text-sm text-muted-foreground font-medium",children:"Products curated"})]}),c.jsx("div",{className:"w-px h-8 xs:h-10 sm:h-12 md:h-16 bg-gradient-to-b from-transparent via-border to-transparent"}),c.jsxs("div",{className:"text-center group",children:[c.jsx("p",{className:"font-display text-xl xs:text-2xl sm:text-3xl md:text-4xl font-bold gradient-text mb-0.5 xs:mb-1 group-hover:scale-110 transition-transform duration-300",children:"10K+"}),c.jsx("p",{className:"text-[10px] xs:text-xs sm:text-sm text-muted-foreground font-medium",children:"Happy Gardeners"})]})]})]}),c.jsx("div",{className:"relative hidden md:flex items-center justify-center",children:c.jsxs("div",{className:"relative w-full max-w-[700px] aspect-square flex items-center justify-center",children:[[{size:200,speed:20,direction:1,delay:0,mobileSize:120},{size:280,speed:25,direction:-1,delay:.5,mobileSize:160},{size:360,speed:30,direction:1,delay:1,mobileSize:200},{size:440,speed:35,direction:-1,delay:1.5,mobileSize:240}].map((e,t)=>c.jsx("svg",{className:"absolute",width:"100%",height:"100%",viewBox:`0 0 ${e.size} ${e.size}`,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",animation:`rotate-ring-${e.direction===1?"forward":"backward"} ${e.speed}s linear infinite`,animationDelay:`${e.delay}s`,maxWidth:`${e.size}px`,maxHeight:`${e.size}px`},children:c.jsx("circle",{cx:e.size/2,cy:e.size/2,r:(e.size-4)/2,fill:"none",stroke:"hsl(147 55% 40% / 0.25)",strokeWidth:"2",strokeDasharray:"4 6",className:"transition-opacity duration-300"})},t)),c.jsxs("div",{className:"relative z-20 w-[180px] h-[180px] flex items-end justify-center",children:[c.jsx("div",{className:"absolute bottom-0 w-full h-12 rounded-full bg-gradient-to-b from-amber-700/40 to-amber-800/50 shadow-lg"}),c.jsx("div",{className:"relative w-full h-full flex items-end justify-center pb-2",children:c.jsx("img",{src:"/images/tree.gif",alt:"Healthy Growing Plant",className:"w-full h-full object-contain animate-float",style:{filter:"brightness(1.1) saturate(1.2)",animation:"float 4s ease-in-out infinite"},onError:e=>{const t=e.target;t.style.display="none";const r=t.parentElement;if(r){const n=document.createElement("div");n.className="text-8xl animate-float",n.textContent="🌱",r.appendChild(n)}}})}),c.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-primary/10 via-transparent to-primary/10 blur-xl pointer-events-none"})]}),[{label:"Organic Seeds",angle:0,distance:220},{label:"Fresh Plants",angle:90,distance:220},{label:"Garden Tools",angle:180,distance:220},{label:"Expert Tips",angle:270,distance:220}].map((e,t)=>{const r=e.angle*Math.PI/180,n=Math.cos(r)*e.distance,a=Math.sin(r)*e.distance;return c.jsx("div",{className:"absolute z-30",style:{left:`calc(50% + ${n}px)`,top:`calc(50% + ${a}px)`,transform:"translate(-50%, -50%)"},children:c.jsxs("div",{className:"relative bg-white/95 backdrop-blur-sm rounded-2xl px-6 py-4 shadow-lg border border-primary/20 hover:shadow-xl hover:scale-110 hover:-translate-y-1 transition-all duration-300 group cursor-default",style:{animation:`float ${3+t*.4}s ease-in-out infinite`,animationDelay:`${t*.2}s`},children:[c.jsx("span",{className:"text-sm font-bold text-foreground group-hover:text-primary transition-colors",children:e.label}),c.jsx("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-br from-primary/10 to-accent/10 opacity-0 group-hover:opacity-100 transition-opacity duration-300 -z-10 blur-sm"}),c.jsx("div",{className:"absolute inset-0 rounded-2xl border-2 border-primary/0 group-hover:border-primary/30 transition-all duration-300 pointer-events-none"})]})},e.label)})]})}),c.jsx("div",{className:"md:hidden flex justify-center py-8",children:c.jsxs("div",{className:"relative w-[280px] h-[280px] flex items-center justify-center",children:[[{size:120,speed:20,direction:1,delay:0},{size:160,speed:25,direction:-1,delay:.5},{size:200,speed:30,direction:1,delay:1},{size:240,speed:35,direction:-1,delay:1.5}].map((e,t)=>c.jsx("svg",{className:"absolute",width:e.size,height:e.size,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",animation:`rotate-ring-${e.direction===1?"forward":"backward"} ${e.speed}s linear infinite`,animationDelay:`${e.delay}s`},children:c.jsx("circle",{cx:e.size/2,cy:e.size/2,r:(e.size-4)/2,fill:"none",stroke:"hsl(147 55% 40% / 0.2)",strokeWidth:"1.5",strokeDasharray:"3 5",className:"transition-opacity duration-300"})},t)),c.jsxs("div",{className:"relative z-20 w-[100px] h-[100px] flex items-end justify-center",children:[c.jsx("div",{className:"absolute bottom-0 w-full h-8 rounded-full bg-gradient-to-b from-amber-700/40 to-amber-800/50 shadow-lg"}),c.jsx("div",{className:"relative w-full h-full flex items-end justify-center pb-1",children:c.jsx("img",{src:"/images/tree.gif",alt:"Growing Tree",className:"relative w-full h-full object-contain animate-float",style:{animation:"float 4s ease-in-out infinite"},onError:e=>{const t=e.target;t.style.display="none";const r=t.parentElement;if(r){const n=document.createElement("div");n.className="text-6xl animate-float",n.textContent="🌱",r.appendChild(n)}}})}),c.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-primary/10 via-transparent to-primary/10 blur-xl pointer-events-none"})]}),[{label:"Organic Seeds",x:0,y:-130},{label:"Fresh Plants",x:120,y:-10},{label:"Garden Tools",x:0,y:120},{label:"Expert Tips",x:-120,y:-10}].map(e=>c.jsx("div",{className:"absolute z-30",style:{left:`calc(50% + ${e.x}px)`,top:`calc(50% + ${e.y}px)`,transform:"translate(-50%, -50%)"},children:c.jsx("div",{className:"bg-white/90 backdrop-blur-sm border border-primary/15 shadow-md rounded-full px-3 py-1 text-[11px] font-semibold text-foreground",children:e.label})},e.label))]})})]})})]})}function qB(e){const t=WB(e),r=S.forwardRef((n,a)=>{const{children:s,...i}=n,o=S.Children.toArray(s),l=o.find(GB);if(l){const u=l.props.children,f=o.map(d=>d===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...i,ref:a,children:S.isValidElement(u)?S.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function WB(e){const t=S.forwardRef((r,n)=>{const{children:a,...s}=r;if(S.isValidElement(a)){const i=YB(a),o=KB(s,a.props);return a.type!==S.Fragment&&(o.ref=n?Fs(n,i):i),S.cloneElement(a,o)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VB=Symbol("radix.slottable");function GB(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VB}function KB(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function YB(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hp="Dialog",[QA,ZA]=Da(hp),[XB,La]=QA(hp),eC=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,o=S.useRef(null),l=S.useRef(null),[u,f]=ji({prop:n,defaultProp:a??!1,onChange:s,caller:hp});return c.jsx(XB,{scope:t,triggerRef:o,contentRef:l,contentId:Oa(),titleId:Oa(),descriptionId:Oa(),open:u,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(d=>!d),[f]),modal:i,children:r})};eC.displayName=hp;var tC="DialogTrigger",rC=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=La(tC,r),s=Tt(t,a.triggerRef);return c.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Qy(a.open),...n,ref:s,onClick:Pe(e.onClick,a.onOpenToggle)})});rC.displayName=tC;var Xy="DialogPortal",[JB,nC]=QA(Xy,{forceMount:void 0}),aC=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,s=La(Xy,t);return c.jsx(JB,{scope:t,forceMount:r,children:S.Children.map(n,i=>c.jsx(Ma,{present:r||s.open,children:c.jsx(Lf,{asChild:!0,container:a,children:i})}))})};aC.displayName=Xy;var o0="DialogOverlay",sC=S.forwardRef((e,t)=>{const r=nC(o0,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=La(o0,e.__scopeDialog);return s.modal?c.jsx(Ma,{present:n||s.open,children:c.jsx(ZB,{...a,ref:t})}):null});sC.displayName=o0;var QB=qB("DialogOverlay.RemoveScroll"),ZB=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=La(o0,r);return c.jsx(cp,{as:QB,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(Ze.div,{"data-state":Qy(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),jo="DialogContent",iC=S.forwardRef((e,t)=>{const r=nC(jo,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,s=La(jo,e.__scopeDialog);return c.jsx(Ma,{present:n||s.open,children:s.modal?c.jsx(e9,{...a,ref:t}):c.jsx(t9,{...a,ref:t})})});iC.displayName=jo;var e9=S.forwardRef((e,t)=>{const r=La(jo,e.__scopeDialog),n=S.useRef(null),a=Tt(t,r.contentRef,n);return S.useEffect(()=>{const s=n.current;if(s)return zy(s)},[]),c.jsx(oC,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&s.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault())})}),t9=S.forwardRef((e,t)=>{const r=La(jo,e.__scopeDialog),n=S.useRef(!1),a=S.useRef(!1);return c.jsx(oC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(n.current||(o=r.triggerRef.current)==null||o.focus(),s.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),oC=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:s,...i}=e,o=La(jo,r),l=S.useRef(null),u=Tt(t,l);return $y(),c.jsxs(c.Fragment,{children:[c.jsx(ip,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:s,children:c.jsx(xc,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Qy(o.open),...i,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(n9,{titleId:o.titleId}),c.jsx(s9,{contentRef:l,descriptionId:o.descriptionId})]})]})}),Jy="DialogTitle",lC=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=La(Jy,r);return c.jsx(Ze.h2,{id:a.titleId,...n,ref:t})});lC.displayName=Jy;var cC="DialogDescription",uC=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=La(cC,r);return c.jsx(Ze.p,{id:a.descriptionId,...n,ref:t})});uC.displayName=cC;var fC="DialogClose",dC=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=La(fC,r);return c.jsx(Ze.button,{type:"button",...n,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});dC.displayName=fC;function Qy(e){return e?"open":"closed"}var hC="DialogTitleWarning",[r9,pC]=Y3(hC,{contentName:jo,titleName:Jy,docsSlug:"dialog"}),n9=({titleId:e})=>{const t=pC(hC),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},a9="DialogDescriptionWarning",s9=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pC(a9).contentName}}.`;return S.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},mC=eC,i9=rC,gC=aC,Zy=sC,e1=iC,t1=lC,r1=uC,n1=dC;const ou=mC,o9=gC,vC=S.forwardRef(({className:e,...t},r)=>c.jsx(Zy,{ref:r,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vC.displayName=Zy.displayName;const Tl=S.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(o9,{children:[c.jsx(vC,{}),c.jsxs(e1,{ref:n,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,c.jsxs(n1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(Ri,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Tl.displayName=e1.displayName;const kl=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kl.displayName="DialogHeader";const lu=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});lu.displayName="DialogFooter";const Nl=S.forwardRef(({className:e,...t},r)=>c.jsx(t1,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));Nl.displayName=t1.displayName;const cu=S.forwardRef(({className:e,...t},r)=>c.jsx(r1,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));cu.displayName=r1.displayName;const l9=Uf("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Es({className:e,variant:t,...r}){return c.jsx("div",{className:je(l9({variant:t}),e),...r})}var c9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],u9=c9.reduce((e,t)=>{const r=By(`Primitive.${t}`),n=S.forwardRef((a,s)=>{const{asChild:i,...o}=a,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),f9="Separator",s_="horizontal",d9=["horizontal","vertical"],xC=S.forwardRef((e,t)=>{const{decorative:r,orientation:n=s_,...a}=e,s=h9(n)?n:s_,o=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(u9.div,{"data-orientation":s,...o,...a,ref:t})});xC.displayName=f9;function h9(e){return d9.includes(e)}var yC=xC;const wC=S.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>c.jsx(yC,{ref:a,decorative:r,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));wC.displayName=yC.displayName;function Tm(e){if(!e)return"unknown";const t=e.toLowerCase();return t.includes("amazon.in")||t.includes("amazon.com")?"amazon":t.includes("meesho.com")?"meesho":t.includes("flipkart.com")?"flipkart":t.includes("myntra.com")?"myntra":t.includes("ajio.com")?"ajio":t.includes("nykaa.com")?"nykaa":t.includes("snapdeal.com")?"snapdeal":t.includes("paytmmall.com")?"paytm":t.includes("shopclues.com")?"shopclues":"other"}function ll(e){return!e||e==="unknown"||e==="other"?"Store":e.charAt(0).toUpperCase()+e.slice(1)}function p9(e){return!e||e==="unknown"||e==="other"?"View Product":`View on ${ll(e)}`}function m9(e){const t=parseInt(e,10)||e.charCodeAt(0),r=3.5+t%15/10,n=50+t*17%450;return{rating:Math.round(r*10)/10,reviews:n}}function g9({rating:e}){return c.jsx("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(t=>c.jsx(kk,{className:`w-4 h-4 ${t<=e?"fill-yellow-400 text-yellow-400":t-.5<=e?"fill-yellow-400/50 text-yellow-400":"text-muted-foreground"}`},t))})}function v9({product:e,open:t,onOpenChange:r}){const{rating:n,reviews:a}=m9((e==null?void 0:e.id)||""),s=e!=null&&e.images&&e.images.length>0?e.images:e!=null&&e.image?[e.image]:[],[i,o]=S.useState(0),[l,u]=S.useState(null),[f,d]=S.useState(null);if(S.useEffect(()=>{t&&o(0)},[t]),!e)return null;const h=50,p=w=>{d(null),u(w.targetTouches[0].clientX)},v=w=>{d(w.targetTouches[0].clientX)},m=()=>{if(!l||!f)return;const w=l-f,b=w>h,_=w<-h;b&&i<s.length-1&&o(i+1),_&&i>0&&o(i-1)},g=()=>{o(w=>w>0?w-1:s.length-1)},x=()=>{o(w=>w<s.length-1?w+1:0)},y=s[i]||e.image||"";return c.jsx(ou,{open:t,onOpenChange:r,children:c.jsxs(Tl,{className:"sm:max-w-4xl max-h-[90vh] overflow-y-auto",children:[c.jsx(kl,{className:"sr-only",children:c.jsx(Nl,{children:e.name})}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-muted group",onTouchStart:p,onTouchMove:v,onTouchEnd:m,children:[c.jsx("img",{src:y,alt:`${e.name} - Image ${i+1}`,className:"w-full h-full object-contain block transition-opacity duration-300",onError:w=>{w.target.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Crect fill='%23e5e7eb' width='400' height='400'/%3E%3Ctext fill='%239ca3af' font-family='system-ui' font-size='20' x='50%25' y='50%25' text-anchor='middle' dy='.3em'%3ENo Image%3C/text%3E%3C/svg%3E"}}),s.length>1&&c.jsxs(c.Fragment,{children:[c.jsx(be,{variant:"secondary",size:"icon",className:"absolute left-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity h-10 w-10 rounded-full shadow-lg",onClick:g,"aria-label":"Previous image",children:c.jsx(_k,{className:"w-5 h-5"})}),c.jsx(be,{variant:"secondary",size:"icon",className:"absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity h-10 w-10 rounded-full shadow-lg",onClick:x,"aria-label":"Next image",children:c.jsx(gy,{className:"w-5 h-5"})}),c.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-black/60 text-white text-sm px-3 py-1 rounded-full backdrop-blur-sm",children:[i+1," / ",s.length]})]})]}),s.length>1&&c.jsx("div",{className:"flex gap-2 overflow-x-auto pb-2 scrollbar-hide",children:s.map((w,b)=>c.jsx("button",{type:"button",onClick:()=>o(b),className:je("flex-shrink-0 w-20 h-20 rounded-lg overflow-hidden border-2 transition-all",i===b?"border-primary shadow-md scale-105":"border-border opacity-60 hover:opacity-100 hover:scale-105"),children:c.jsx("img",{src:w,alt:`Thumbnail ${b+1}`,className:"w-full h-full object-contain block",onError:_=>{_.target.style.display="none"}})},b))})]}),c.jsxs("div",{className:"flex flex-col",children:[e.category&&c.jsxs(Es,{variant:"secondary",className:"w-fit mb-3",children:[c.jsx(Nk,{className:"w-3 h-3 mr-1"}),e.category]}),c.jsx("h2",{className:"font-display font-bold text-lg md:text-xl text-foreground leading-tight mb-3",children:e.name}),c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(g9,{rating:n}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),c.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",a," reviews)"]})]}),c.jsx("p",{className:"text-2xl font-bold text-primary mb-4",children:e.price}),c.jsx(wC,{className:"my-3"}),e.description&&c.jsxs("div",{className:"mb-4",children:[c.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-2 flex items-center gap-2",children:[c.jsx(Yh,{className:"w-4 h-4"}),"About this product"]}),c.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.description})]}),c.jsxs("div",{className:"space-y-2 mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Availability"}),c.jsx("span",{className:"text-green-600 font-medium",children:"In Stock"})]}),c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Shipping"}),c.jsx("span",{className:"text-foreground",children:"Free Delivery"})]}),c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Returns"}),c.jsx("span",{className:"text-foreground",children:"Easy 7-Day Returns"})]})]}),c.jsx(be,{asChild:!0,className:"w-full mt-auto",size:"lg",children:c.jsxs("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",children:[p9(e.source),c.jsx(Ml,{className:"w-4 h-4 ml-2"})]})})]})]})]})})}function bC({product:e,className:t,index:r=0}){const[n,a]=S.useState(!1),s=e.images&&e.images.length>0?e.images[0]:e.image||"";return c.jsxs(c.Fragment,{children:[c.jsxs("article",{className:je("group glass-card rounded-2xl overflow-hidden animate-fade-in transition-all duration-300 hover:shadow-lg hover:border-primary/20 hover:-translate-y-1",t),style:{animationDelay:`${r*100}ms`},children:[c.jsxs("div",{className:"aspect-square overflow-hidden bg-muted relative",children:[s?c.jsx("img",{src:s,alt:e.name,loading:"lazy",className:"w-full h-full object-contain block transition-transform duration-300 group-hover:scale-105",onError:i=>{i.target.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Crect fill='%23e5e7eb' width='400' height='400'/%3E%3Ctext fill='%239ca3af' font-family='system-ui' font-size='20' x='50%25' y='50%25' text-anchor='middle' dy='.3em'%3ENo Image%3C/text%3E%3C/svg%3E"}}):c.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:c.jsx("span",{className:"text-4xl",children:"📦"})}),e.images&&e.images.length>1&&c.jsxs("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground text-xs px-2 py-1 rounded-full backdrop-blur-sm",children:[e.images.length," images"]}),c.jsxs("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end justify-center gap-2 pb-4",children:[c.jsxs(be,{variant:"secondary",size:"sm",onClick:i=>{i.preventDefault(),a(!0)},className:"gap-2 backdrop-blur-sm bg-white/90 hover:bg-white",children:[c.jsx(eF,{className:"w-4 h-4"}),"Quick View"]}),c.jsx(be,{variant:"secondary",size:"sm",asChild:!0,className:"gap-2 backdrop-blur-sm bg-white/90 hover:bg-white",children:c.jsx(vt,{to:`/product/${e.id}`,children:"View Details"})})]})]}),c.jsxs("div",{className:"p-3 sm:p-4 space-y-2",children:[c.jsx(vt,{to:`/product/${e.id}`,children:c.jsx("h3",{className:"font-display font-semibold text-foreground line-clamp-2 text-[13px] sm:text-sm leading-snug min-h-[2.25rem] sm:min-h-[2.5rem] cursor-pointer hover:text-primary transition-colors group-hover:underline decoration-primary/50",children:e.name})}),c.jsx("p",{className:"gradient-text font-bold text-lg sm:text-xl transition-transform group-hover:scale-110 inline-block",children:e.price}),c.jsx(be,{asChild:!0,variant:"gradient",className:"w-full mt-3 group/btn",size:"sm",children:c.jsxs("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:"focus-ring",children:[c.jsx(uh,{className:"w-3.5 h-3.5 mr-2"}),"Buy Now",c.jsx(Ml,{className:"w-3.5 h-3.5 ml-2 transition-transform group-hover/btn:translate-x-1"})]})})]})]}),c.jsx(v9,{product:{...e,images:e.images},open:n,onOpenChange:a})]})}function x9({className:e}){return c.jsxs("div",{className:je("bg-card rounded-xl border border-border overflow-hidden",e),children:[c.jsx("div",{className:"aspect-square bg-muted animate-pulse"}),c.jsxs("div",{className:"p-4 space-y-3",children:[c.jsx("div",{className:"h-5 bg-muted rounded animate-pulse w-3/4"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/2"}),c.jsx("div",{className:"h-6 bg-muted rounded animate-pulse w-1/4 mt-4"}),c.jsx("div",{className:"h-10 bg-muted rounded-lg animate-pulse w-full mt-4"})]})]})}function Ov({count:e=4}){return c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4 md:gap-6",children:Array.from({length:e}).map((t,r)=>c.jsx(x9,{className:`animation-delay-${(r+1)*100}`},r))})}const y9=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class a1 extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class w9 extends a1{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class i_ extends a1{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class o_ extends a1{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var jv;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(jv||(jv={}));class b9{constructor(t,{headers:r={},customFetch:n,region:a=jv.Any}={}){this.url=t,this.headers=r,this.region=a,this.fetch=y9(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return $6(this,arguments,void 0,function*(r,n={}){var a;let s,i;try{const{headers:o,method:l,body:u,signal:f,timeout:d}=n;let h={},{region:p}=n;p||(p=this.region);const v=new URL(`${this.url}/${r}`);p&&p!=="any"&&(h["x-region"]=p,v.searchParams.set("forceFunctionRegion",p));let m;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(h["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(h["Content-Type"]="application/json",m=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?m=JSON.stringify(u):m=u;let g=f;d&&(i=new AbortController,s=setTimeout(()=>i.abort(),d),f?(g=i.signal,f.addEventListener("abort",()=>i.abort())):g=i.signal);const x=yield this.fetch(v.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),o),body:m,signal:g}).catch(_=>{throw new w9(_)}),y=x.headers.get("x-relay-error");if(y&&y==="true")throw new i_(x);if(!x.ok)throw new o_(x);let w=((a=x.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),b;return w==="application/json"?b=yield x.json():w==="application/octet-stream"||w==="application/pdf"?b=yield x.blob():w==="text/event-stream"?b=x:w==="multipart/form-data"?b=yield x.formData():b=yield x.text(),{data:b,error:null,response:x}}catch(o){return{data:null,error:o,response:o instanceof o_||o instanceof i_?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var _9=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},E9=class{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let a=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{let i=null,o=null,l=null,u=s.status,f=s.statusText;if(s.ok){var d,h;if(r.method!=="HEAD"){var p;const x=await s.text();x===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((p=r.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?o=x:o=JSON.parse(x))}const m=(d=r.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),g=(h=s.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");m&&g&&g.length>1&&(l=parseInt(g[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(o)&&(o.length>1?(i={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,l=null,u=406,f="Not Acceptable"):o.length===1?o=o[0]:o=null)}else{var v;const m=await s.text();try{i=JSON.parse(m),Array.isArray(i)&&s.status===404&&(o=[],i=null,u=200,f="OK")}catch{s.status===404&&m===""?(u=204,f="No Content"):i={message:m}}if(i&&r.isMaybeSingle&&(!(i==null||(v=i.details)===null||v===void 0)&&v.includes("0 rows"))&&(i=null,u=200,f="OK"),i&&r.shouldThrowOnError)throw new _9(i)}return{error:i,data:o,count:l,status:u,statusText:f}});return this.shouldThrowOnError||(a=a.catch(s=>{var i;let o="";const l=s==null?void 0:s.cause;if(l){var u,f,d,h;const v=(u=l==null?void 0:l.message)!==null&&u!==void 0?u:"",m=(f=l==null?void 0:l.code)!==null&&f!==void 0?f:"";o=`${(d=s==null?void 0:s.name)!==null&&d!==void 0?d:"FetchError"}: ${s==null?void 0:s.message}`,o+=`
Caused by: ${(h=l==null?void 0:l.name)!==null&&h!==void 0?h:"Error"}: ${v}`,m&&(o+=` (${m})`),l!=null&&l.stack&&(o+=`
${l.stack}`)}else{var p;o=(p=s==null?void 0:s.stack)!==null&&p!==void 0?p:""}return{error:{message:`${(i=s==null?void 0:s.name)!==null&&i!==void 0?i:"FetchError"}: ${s==null?void 0:s.message}`,details:o,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),a.then(e,t)}returns(){return this}overrideTypes(){return this}},S9=class extends E9{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:a=n}={}){const s=a?`${a}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const a=typeof n>"u"?"offset":`${n}.offset`,s=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(a,`${e}`),this.url.searchParams.set(s,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:a=!1,format:s="text"}={}){var i;const o=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,a?"wal":null].filter(Boolean).join("|"),l=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${l}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const l_=new RegExp("[,()]");var cl=class extends S9{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&l_.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&l_.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let a="";n==="plain"?a="pl":n==="phrase"?a="ph":n==="websearch"&&(a="w");const s=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${a}fts${s}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},T9=class{constructor(e,{headers:t={},schema:r,fetch:n}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},a=r?"HEAD":"GET";let s=!1;const i=(e??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join(""),{url:o,headers:l}=this.cloneRequestState();return o.searchParams.set("select",i),n&&l.append("Prefer",`count=${n}`),new cl({method:a,url:o,headers:l,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const a="POST",{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){const o=e.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(o.length>0){const l=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",l.join(","))}}return new cl({method:a,url:s,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:a=!0}={}){var s;const i="POST",{url:o,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&o.searchParams.set("on_conflict",t),n&&l.append("Prefer",`count=${n}`),a||l.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){const f=[...new Set(u)].map(d=>`"${d}"`);o.searchParams.set("columns",f.join(","))}}return new cl({method:i,url:o,headers:l,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}update(e,{count:t}={}){var r;const n="PATCH",{url:a,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new cl({method:n,url:a,headers:s,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:a}=this.cloneRequestState();return e&&a.append("Prefer",`count=${e}`),new cl({method:r,url:n,headers:a,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},k9=class _C{constructor(t,{headers:r={},schema:n,fetch:a}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.fetch=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new T9(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new _C(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:n=!1,get:a=!1,count:s}={}){var i;let o;const l=new URL(`${this.url}/rpc/${t}`);let u;const f=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(f)),d=n&&Object.values(r).some(f);d?(o="POST",u=r):n||a?(o=n?"HEAD":"GET",Object.entries(r).filter(([p,v])=>v!==void 0).map(([p,v])=>[p,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([p,v])=>{l.searchParams.append(p,v)})):(o="POST",u=r);const h=new Headers(this.headers);return d?h.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&h.set("Prefer",`count=${s}`),new cl({method:o,url:l,headers:h,schema:this.schemaName,body:u,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}};class N9{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const a=n.node,s=parseInt(a.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const A9="2.90.1",C9=`realtime-js/${A9}`,EC="1.0.0",P9="2.0.0",c_=EC,Rv=1e4,O9=1e3,j9=100;var Qs;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Qs||(Qs={}));var fr;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(fr||(fr={}));var Sa;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Sa||(Sa={}));var Iv;(function(e){e.websocket="websocket"})(Iv||(Iv={}));var eo;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(eo||(eo={}));class R9{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const a=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(t){var r,n;const a=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},i=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(t,r,n){var a,s;const i=t.topic,o=(a=t.ref)!==null&&a!==void 0?a:"",l=(s=t.join_ref)!==null&&s!==void 0?s:"",u=t.payload.event,f=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(f).length===0?"":JSON.stringify(f);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+i.length+u.length+d.length,p=new ArrayBuffer(this.HEADER_LENGTH+h);let v=new DataView(p),m=0;v.setUint8(m++,this.KINDS.userBroadcastPush),v.setUint8(m++,l.length),v.setUint8(m++,o.length),v.setUint8(m++,i.length),v.setUint8(m++,u.length),v.setUint8(m++,d.length),v.setUint8(m++,r),Array.from(l,x=>v.setUint8(m++,x.charCodeAt(0))),Array.from(o,x=>v.setUint8(m++,x.charCodeAt(0))),Array.from(i,x=>v.setUint8(m++,x.charCodeAt(0))),Array.from(u,x=>v.setUint8(m++,x.charCodeAt(0))),Array.from(d,x=>v.setUint8(m++,x.charCodeAt(0)));var g=new Uint8Array(p.byteLength+n.byteLength);return g.set(new Uint8Array(p),0),g.set(new Uint8Array(n),p.byteLength),g.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[a,s,i,o,l]=n;return r({join_ref:a,ref:s,topic:i,event:o,payload:l})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),a=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,a)}}_decodeUserBroadcast(t,r,n){const a=r.getUint8(1),s=r.getUint8(2),i=r.getUint8(3),o=r.getUint8(4);let l=this.HEADER_LENGTH+4;const u=n.decode(t.slice(l,l+a));l=l+a;const f=n.decode(t.slice(l,l+s));l=l+s;const d=n.decode(t.slice(l,l+i));l=l+i;const h=t.slice(l,t.byteLength),p=o===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,v={type:this.BROADCAST_EVENT,event:f,payload:p};return i>0&&(v.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class SC{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Rt;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Rt||(Rt={}));const u_=(e,t,r={})=>{var n;const a=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((s,i)=>(s[i]=I9(i,e,t,a),s),{}):{}},I9=(e,t,r,n)=>{const a=t.find(o=>o.name===e),s=a==null?void 0:a.type,i=r[e];return s&&!n.includes(s)?TC(s,i):Fv(i)},TC=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return L9(t,r)}switch(e){case Rt.bool:return F9(t);case Rt.float4:case Rt.float8:case Rt.int2:case Rt.int4:case Rt.int8:case Rt.numeric:case Rt.oid:return D9(t);case Rt.json:case Rt.jsonb:return M9(t);case Rt.timestamp:return B9(t);case Rt.abstime:case Rt.date:case Rt.daterange:case Rt.int4range:case Rt.int8range:case Rt.money:case Rt.reltime:case Rt.text:case Rt.time:case Rt.timestamptz:case Rt.timetz:case Rt.tsrange:case Rt.tstzrange:return Fv(t);default:return Fv(t)}},Fv=e=>e,F9=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},D9=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},M9=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},L9=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let s;const i=e.slice(1,r);try{s=JSON.parse("["+i+"]")}catch{s=i?i.split(","):[]}return s.map(o=>TC(t,o))}return e},B9=e=>typeof e=="string"?e.replace(" ","T"):e,kC=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class km{constructor(t,r,n={},a=Rv){this.channel=t,this.event=r,this.payload=n,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var f_;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(f_||(f_={}));class Nu{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},a=>{const{onJoin:s,onLeave:i,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Nu.syncState(this.state,a,s,i),this.pendingDiffs.forEach(l=>{this.state=Nu.syncDiff(this.state,l,s,i)}),this.pendingDiffs=[],o()}),this.channel._on(n.diff,{},a=>{const{onJoin:s,onLeave:i,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Nu.syncDiff(this.state,a,s,i),o())}),this.onJoin((a,s,i)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:s,newPresences:i})}),this.onLeave((a,s,i)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:s,leftPresences:i})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,a){const s=this.cloneDeep(t),i=this.transformState(r),o={},l={};return this.map(s,(u,f)=>{i[u]||(l[u]=f)}),this.map(i,(u,f)=>{const d=s[u];if(d){const h=f.map(g=>g.presence_ref),p=d.map(g=>g.presence_ref),v=f.filter(g=>p.indexOf(g.presence_ref)<0),m=d.filter(g=>h.indexOf(g.presence_ref)<0);v.length>0&&(o[u]=v),m.length>0&&(l[u]=m)}else o[u]=f}),this.syncDiff(s,{joins:o,leaves:l},n,a)}static syncDiff(t,r,n,a){const{joins:s,leaves:i}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),a||(a=()=>{}),this.map(s,(o,l)=>{var u;const f=(u=t[o])!==null&&u!==void 0?u:[];if(t[o]=this.cloneDeep(l),f.length>0){const d=t[o].map(p=>p.presence_ref),h=f.filter(p=>d.indexOf(p.presence_ref)<0);t[o].unshift(...h)}n(o,f,l)}),this.map(i,(o,l)=>{let u=t[o];if(!u)return;const f=l.map(d=>d.presence_ref);u=u.filter(d=>f.indexOf(d.presence_ref)<0),t[o]=u,a(o,u,l),u.length===0&&delete t[o]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const a=t[n];return"metas"in a?r[n]=a.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):r[n]=a,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var d_;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(d_||(d_={}));var Au;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Au||(Au={}));var hs;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(hs||(hs={}));class Al{constructor(t,r={config:{}},n){var a,s;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=fr.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new km(this,Sa.join,this.params,this.timeout),this.rejoinTimer=new SC(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=fr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=fr.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=fr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=fr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=fr.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Sa.reply,{},(i,o)=>{this._trigger(this._replyEventName(o),i)}),this.presence=new Nu(this),this.broadcastEndpointURL=kC(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,a,s;if(this.socket.isConnected()||this.socket.connect(),this.state==fr.closed){const{config:{broadcast:i,presence:o,private:l}}=this.params,u=(a=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&a!==void 0?a:[],f=!!this.bindings[Au.PRESENCE]&&this.bindings[Au.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,d={},h={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:f}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(hs.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(hs.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:p})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(hs.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,g=(v=m==null?void 0:m.length)!==null&&v!==void 0?v:0,x=[];for(let y=0;y<g;y++){const w=m[y],{filter:{event:b,schema:_,table:T,filter:E}}=w,C=p&&p[y];if(C&&C.event===b&&Al.isFilterValueEqual(C.schema,_)&&Al.isFilterValueEqual(C.table,T)&&Al.isFilterValueEqual(C.filter,E))x.push(Object.assign(Object.assign({},w),{id:C.id}));else{this.unsubscribe(),this.state=fr.errored,t==null||t(hs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(hs.SUBSCRIBED);return}}).receive("error",p=>{this.state=fr.errored,t==null||t(hs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(hs.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===fr.joined&&t===Au.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var a;if(r==null)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,i,(a=n.timeout)!==null&&a!==void 0?a:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;try{const u=await o.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var n,a;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:i}=t,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((a=u.body)===null||a===void 0?void 0:a.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var i,o,l;const u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(o=(i=this.params)===null||i===void 0?void 0:i.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=fr.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Sa.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(a=>{n=new km(this,Sa.leave,{},t),n.receive("ok",()=>{r(),a("ok")}).receive("timeout",()=>{r(),a("timed out")}).receive("error",()=>{a("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=fr.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const a=new AbortController,s=setTimeout(()=>a.abort(),n),i=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:a.signal}));return clearTimeout(s),i}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new km(this,t,r,n);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>j9){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var a,s;const i=t.toLocaleLowerCase(),{close:o,error:l,leave:u,join:f}=Sa;if(n&&[o,l,u,f].indexOf(i)>=0&&n!==this._joinRef())return;let h=this._onMessage(i,r,n);if(r&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(i)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(p=>{var v,m,g;return((v=p.filter)===null||v===void 0?void 0:v.event)==="*"||((g=(m=p.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===i}).map(p=>p.callback(h,n)):(s=this.bindings[i])===null||s===void 0||s.filter(p=>{var v,m,g,x,y,w,b,_;if(["broadcast","presence","postgres_changes"].includes(i))if("id"in p){const T=p.id,E=(v=p.filter)===null||v===void 0?void 0:v.event;return T&&((m=r.ids)===null||m===void 0?void 0:m.includes(T))&&(E==="*"||(E==null?void 0:E.toLocaleLowerCase())===((g=r.data)===null||g===void 0?void 0:g.type.toLocaleLowerCase()))&&(!(!((x=p.filter)===null||x===void 0)&&x.table)||p.filter.table===((y=r.data)===null||y===void 0?void 0:y.table))}else{const T=(b=(w=p==null?void 0:p.filter)===null||w===void 0?void 0:w.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return T==="*"||T===((_=r==null?void 0:r.event)===null||_===void 0?void 0:_.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===i}).map(p=>{if(typeof h=="object"&&"ids"in h){const v=h.data,{schema:m,table:g,commit_timestamp:x,type:y,errors:w}=v;h=Object.assign(Object.assign({},{schema:m,table:g,commit_timestamp:x,eventType:y,new:{},old:{},errors:w}),this._getPayloadRecords(v))}p.callback(h,n)})}_isClosed(){return this.state===fr.closed}_isJoined(){return this.state===fr.joined}_isJoining(){return this.state===fr.joining}_isLeaving(){return this.state===fr.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const a=t.toLocaleLowerCase(),s={type:a,filter:r,callback:n};return this.bindings[a]?this.bindings[a].push(s):this.bindings[a]=[s],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(a=>{var s;return!(((s=a.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===n&&Al.isEqual(a.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Sa.close,{},t)}_onError(t){this._on(Sa.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=fr.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=u_(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=u_(t.columns,t.old_record)),r}}const Nm=()=>{},Od={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},U9=[1e3,2e3,5e3,1e4],$9=1e4,z9=`
addEventListener("message", (e) => {
if (e.data.event === "start") {
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
}
});`;class H9{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Rv,this.transport=null,this.heartbeatIntervalMs=Od.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Nm,this.ref=0,this.reconnectTimer=null,this.vsn=c_,this.logger=Nm,this.conn=null,this.sendBuffer=[],this.serializer=new R9,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=a=>a?(...s)=>a(...s):(...s)=>fetch(...s),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${Iv.websocket}`,this.httpEndpoint=kC(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=N9.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r}
To use Realtime in Node.js, you need to provide a WebSocket implementation:
Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:
npm install ws
import ws from "ws"
const client = new RealtimeClient(url, {
...options,
transport: ws
})`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Qs.connecting:return eo.Connecting;case Qs.open:return eo.Open;case Qs.closing:return eo.Closing;default:return eo.Closed}}isConnected(){return this.connectionState()===eo.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,a=this.getChannels().find(s=>s.topic===n);if(a)return a;{const s=new Al(`realtime:${t}`,r,this);return this.channels.push(s),s}}push(t){const{topic:r,event:n,payload:a,ref:s}=t,i=()=>{this.encode(t,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${r} ${n} (${s})`,a),this.isConnected()?i():this.sendBuffer.push(i)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(O9,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Od.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",u)}catch(f){this.log("error","error in heartbeat callback",f)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:n,event:a,payload:s,ref:i}=r,o=i?`(${i})`:"",l=s.status||"";this.log("receive",`${l} ${n} ${a} ${o}`.trim(),s),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(a,s,i)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===Qs.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Qs.open||this.conn.readyState===Qs.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Sa.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",a=new URLSearchParams(r);return`${t}${n}${a}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([z9],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(a){this.log("error","Error fetching access token from callback",a),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(a=>{const s={access_token:r,version:C9};r&&a.updateJoinPayload(s),a.joinedOnce&&a._isJoined()&&a._push(Sa.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(a){this.log("error",`error in ${t} callback`,a)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new SC(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Od.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,a,s,i,o,l,u,f,d,h,p;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:Rv,this.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:Od.HEARTBEAT_INTERVAL,this.worker=(s=t==null?void 0:t.worker)!==null&&s!==void 0?s:!1,this.accessToken=(i=t==null?void 0:t.accessToken)!==null&&i!==void 0?i:null,this.heartbeatCallback=(o=t==null?void 0:t.heartbeatCallback)!==null&&o!==void 0?o:Nm,this.vsn=(l=t==null?void 0:t.vsn)!==null&&l!==void 0?l:c_,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:v=>U9[v-1]||$9,this.vsn){case EC:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:(v,m)=>m(JSON.stringify(v)),this.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:(v,m)=>m(JSON.parse(v));break;case P9:this.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:this.serializer.encode.bind(this.serializer),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var hf=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function q9(e,t,r){const n=new URL(t,e);if(r)for(const[a,s]of Object.entries(r))s!==void 0&&n.searchParams.set(a,s);return n.toString()}async function W9(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function V9(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:a,body:s,headers:i}){const o=q9(e.baseUrl,n,a),l=await W9(e.auth),u=await t(o,{method:r,headers:{...s?{"Content-Type":"application/json"}:{},...l,...i},body:s?JSON.stringify(s):void 0}),f=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),h=d&&f?JSON.parse(f):f;if(!u.ok){const p=d?h:void 0,v=p==null?void 0:p.error;throw new hf((v==null?void 0:v.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:p})}return{status:u.status,headers:u.headers,data:h}}}}function jd(e){return e.join("")}var G9=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:jd(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${jd(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${jd(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${jd(e.namespace)}`}),!0}catch(t){if(t instanceof hf&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof hf&&r.status===409)return;throw r}}};function el(e){return e.join("")}var K9=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${el(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${el(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${el(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${el(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${el(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${el(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof hf&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof hf&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},Y9=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=V9({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new G9(this.client,t),this.tableOps=new K9(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},pp=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function Wt(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var X9=class extends pp{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Dv=class extends pp{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}};const s1=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),J9=()=>Response,Mv=e=>{if(Array.isArray(e))return e.map(r=>Mv(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const a=r.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[a]=Mv(n)}),t},Q9=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Z9=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function pf(e){"@babel/helpers - typeof";return pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pf(e)}function e7(e,t){if(pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t7(e){var t=e7(e,"string");return pf(t)=="symbol"?t:t+""}function r7(e,t,r){return(t=t7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h_(Object(r),!0).forEach(function(n){r7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const Am=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},n7=async(e,t,r)=>{e instanceof await J9()&&!(r!=null&&r.noResolveJson)?e.json().then(n=>{const a=e.status||500,s=(n==null?void 0:n.statusCode)||a+"";t(new X9(Am(n),a,s))}).catch(n=>{t(new Dv(Am(n),n))}):t(new Dv(Am(e),e))},a7=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?a:(Q9(n)?(a.headers=Ye({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(n)):a.body=n,t!=null&&t.duplex&&(a.duplex=t.duplex),Ye(Ye({},a),r))};async function Kf(e,t,r,n,a,s){return new Promise((i,o)=>{e(r,a7(t,n,a,s)).then(l=>{if(!l.ok)throw l;return n!=null&&n.noResolveJson?l:l.json()}).then(l=>i(l)).catch(l=>n7(l,o,n))})}async function mf(e,t,r,n){return Kf(e,"GET",t,r,n)}async function wa(e,t,r,n,a){return Kf(e,"POST",t,n,a,r)}async function Lv(e,t,r,n,a){return Kf(e,"PUT",t,n,a,r)}async function s7(e,t,r,n){return Kf(e,"HEAD",t,Ye(Ye({},r),{},{noResolveJson:!0}),n)}async function i1(e,t,r,n,a){return Kf(e,"DELETE",t,n,a,r)}var i7=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Wt(t))return{data:null,error:t};throw t}}};let NC;NC=Symbol.toStringTag;var o7=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[NC]="BlobDownloadBuilder",this.promise=null}asStream(){return new i7(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Wt(t))return{data:null,error:t};throw t}}};const l7={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},p_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var c7=class{constructor(e,t={},r,n){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=s1(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,n){var a=this;try{let s;const i=Ye(Ye({},p_),n);let o=Ye(Ye({},a.headers),e==="POST"&&{"x-upsert":String(i.upsert)});const l=i.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",i.cacheControl),l&&s.append("metadata",a.encodeMetadata(l)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.has("cacheControl")||s.append("cacheControl",i.cacheControl),l&&!s.has("metadata")&&s.append("metadata",a.encodeMetadata(l))):(s=r,o["cache-control"]=`max-age=${i.cacheControl}`,o["content-type"]=i.contentType,l&&(o["x-metadata"]=a.toBase64(a.encodeMetadata(l))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers&&(o=Ye(Ye({},o),n.headers));const u=a._removeEmptyFolders(t),f=a._getFinalPath(u),d=await(e=="PUT"?Lv:wa)(a.fetch,`${a.url}/object/${f}`,s,Ye({headers:o},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(s){if(a.shouldThrowOnError)throw s;if(Wt(s))return{data:null,error:s};throw s}}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var a=this;const s=a._removeEmptyFolders(e),i=a._getFinalPath(s),o=new URL(a.url+`/object/upload/sign/${i}`);o.searchParams.set("token",t);try{let l;const u=Ye({upsert:p_.upsert},n),f=Ye(Ye({},a.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,f["cache-control"]=`max-age=${u.cacheControl}`,f["content-type"]=u.contentType),{data:{path:s,fullPath:(await Lv(a.fetch,o.toString(),l,{headers:f})).Key},error:null}}catch(l){if(a.shouldThrowOnError)throw l;if(Wt(l))return{data:null,error:l};throw l}}async createSignedUploadUrl(e,t){var r=this;try{let n=r._getFinalPath(e);const a=Ye({},r.headers);t!=null&&t.upsert&&(a["x-upsert"]="true");const s=await wa(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:a}),i=new URL(r.url+s.url),o=i.searchParams.get("token");if(!o)throw new pp("No token returned by API");return{data:{signedUrl:i.toString(),path:e,token:o},error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Wt(n))return{data:null,error:n};throw n}}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;try{return{data:await wa(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}),error:null}}catch(a){if(n.shouldThrowOnError)throw a;if(Wt(a))return{data:null,error:a};throw a}}async copy(e,t,r){var n=this;try{return{data:{path:(await wa(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key},error:null}}catch(a){if(n.shouldThrowOnError)throw a;if(Wt(a))return{data:null,error:a};throw a}}async createSignedUrl(e,t,r){var n=this;try{let a=n._getFinalPath(e),s=await wa(n.fetch,`${n.url}/object/sign/${a}`,Ye({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:n.headers});const i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s={signedUrl:encodeURI(`${n.url}${s.signedURL}${i}`)},{data:s,error:null}}catch(a){if(n.shouldThrowOnError)throw a;if(Wt(a))return{data:null,error:a};throw a}}async createSignedUrls(e,t,r){var n=this;try{const a=await wa(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:a.map(i=>Ye(Ye({},i),{},{signedUrl:i.signedURL?encodeURI(`${n.url}${i.signedURL}${s}`):null})),error:null}}catch(a){if(n.shouldThrowOnError)throw a;if(Wt(a))return{data:null,error:a};throw a}}download(e,t){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=n?`?${n}`:"",s=this._getFinalPath(e),i=()=>mf(this.fetch,`${this.url}/${r}/${s}${a}`,{headers:this.headers,noResolveJson:!0});return new o7(i,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);try{return{data:Mv(await mf(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Wt(n))return{data:null,error:n};throw n}}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await s7(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Wt(n)&&n instanceof Dv){const a=n.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:n}}throw n}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],a=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";a!==""&&n.push(a);const s=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});i!==""&&n.push(i);let o=n.join("&");return o!==""&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${r}${o}`)}}}async remove(e){var t=this;try{return{data:await i1(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}async list(e,t,r){var n=this;try{const a=Ye(Ye(Ye({},l7),t),{},{prefix:e||""});return{data:await wa(n.fetch,`${n.url}/object/list/${n.bucketId}`,a,{headers:n.headers},r),error:null}}catch(a){if(n.shouldThrowOnError)throw a;if(Wt(a))return{data:null,error:a};throw a}}async listV2(e,t){var r=this;try{const n=Ye({},e);return{data:await wa(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Wt(n))return{data:null,error:n};throw n}}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const AC="2.90.1",CC={"X-Client-Info":`storage-js/${AC}`};var u7=class{constructor(e,t={},r,n){this.shouldThrowOnError=!1;const a=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Ye(Ye({},CC),t),this.fetch=s1(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{const r=t.listBucketOptionsToQueryString(e);return{data:await mf(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await mf(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}async createBucket(e,t={public:!1}){var r=this;try{return{data:await wa(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Wt(n))return{data:null,error:n};throw n}}async updateBucket(e,t){var r=this;try{return{data:await Lv(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Wt(n))return{data:null,error:n};throw n}}async emptyBucket(e){var t=this;try{return{data:await wa(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await i1(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},f7=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Ye(Ye({},CC),t),this.fetch=s1(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await wa(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}async listBuckets(e){var t=this;try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),a=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return{data:await mf(t.fetch,a,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await i1(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Wt(r))return{data:null,error:r};throw r}}from(e){var t=this;if(!Z9(e))throw new pp("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new Y9({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(a,s){const i=a[s];return typeof i!="function"?i:async(...o)=>{try{return{data:await i.apply(a,o),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}};const o1={"X-Client-Info":`storage-js/${AC}`,"Content-Type":"application/json"};var PC=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function Dn(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var Cm=class extends PC{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},d7=class extends PC{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};const l1=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),h7=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},m_=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),p7=async(e,t,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const n=e.status||500,a=e;if(typeof a.json=="function")a.json().then(s=>{const i=(s==null?void 0:s.statusCode)||(s==null?void 0:s.code)||n+"";t(new Cm(m_(s),n,i))}).catch(()=>{const s=n+"";t(new Cm(a.statusText||`HTTP ${n} error`,n,s))});else{const s=n+"";t(new Cm(a.statusText||`HTTP ${n} error`,n,s))}}else t(new d7(m_(e),e))},m7=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return n?(h7(n)?(a.headers=Ye({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(n)):a.body=n,Ye(Ye({},a),r)):a};async function g7(e,t,r,n,a,s){return new Promise((i,o)=>{e(r,m7(t,n,a,s)).then(l=>{if(!l.ok)throw l;if(n!=null&&n.noResolveJson)return l;const u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>i(l)).catch(l=>p7(l,o,n))})}async function Mn(e,t,r,n,a){return g7(e,"POST",t,n,a,r)}var v7=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Ye(Ye({},o1),t),this.fetch=l1(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await Mn(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Dn(n))return{data:null,error:n};throw n}}async listIndexes(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await Mn(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Dn(n))return{data:null,error:n};throw n}}},x7=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Ye(Ye({},o1),t),this.fetch=l1(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await Mn(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await Mn(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await Mn(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}},y7=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Ye(Ye({},o1),t),this.fetch=l1(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await Mn(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Dn(r))return{data:null,error:r};throw r}}},w7=class extends y7{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new b7(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},b7=class extends v7{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new _7(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},_7=class extends x7{constructor(e,t,r,n,a){super(e,t,a),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,Ye(Ye({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},E7=class extends u7{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new c7(this.url,this.headers,e,this.fetch)}get vectors(){return new w7(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new f7(this.url+"/iceberg",this.headers,this.fetch)}};const OC="2.90.1",ul=30*1e3,Bv=3,Pm=Bv*ul,S7="http://localhost:9999",T7="supabase.auth.token",k7={"X-Client-Info":`gotrue-js/${OC}`},Uv="X-Supabase-Api-Version",jC={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},N7=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,A7=10*60*1e3;class gf extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function Ue(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class C7 extends gf{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function P7(e){return Ue(e)&&e.name==="AuthApiError"}class to extends gf{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Ds extends gf{constructor(t,r,n,a){super(t,n,a),this.name=r,this.status=n}}class jn extends Ds{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function O7(e){return Ue(e)&&e.name==="AuthSessionMissingError"}class tl extends Ds{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Rd extends Ds{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Id extends Ds{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function j7(e){return Ue(e)&&e.name==="AuthImplicitGrantRedirectError"}class g_ extends Ds{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class R7 extends Ds{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class $v extends Ds{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Om(e){return Ue(e)&&e.name==="AuthRetryableFetchError"}class v_ extends Ds{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class zv extends Ds{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const l0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),x_=`
\r=`.split(""),I7=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<x_.length;t+=1)e[x_[t].charCodeAt(0)]=-2;for(let t=0;t<l0.length;t+=1)e[l0[t].charCodeAt(0)]=t;return e})();function y_(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(l0[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(l0[n]),t.queuedBits-=6}}function RC(e,t,r){const n=I7[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function w_(e){const t=[],r=i=>{t.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},s=i=>{M7(i,n,r)};for(let i=0;i<e.length;i+=1)RC(e.charCodeAt(i),a,s);return t.join("")}function F7(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function D7(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const a=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|a)+65536,r+=1}F7(n,t)}}function M7(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function $l(e){const t=[],r={queue:0,queuedBits:0},n=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)RC(e.charCodeAt(a),r,n);return new Uint8Array(t)}function L7(e){const t=[];return D7(e,r=>t.push(r)),new Uint8Array(t)}function oo(e){const t=[],r={queue:0,queuedBits:0},n=a=>{t.push(a)};return e.forEach(a=>y_(a,r,n)),y_(null,r,n),t.join("")}function B7(e){return Math.round(Date.now()/1e3)+e}function U7(){return Symbol("auth-callback")}const Pr=()=>typeof window<"u"&&typeof document<"u",Ki={tested:!1,writable:!1},IC=()=>{if(!Pr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ki.tested)return Ki.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ki.tested=!0,Ki.writable=!0}catch{Ki.tested=!0,Ki.writable=!1}return Ki.writable};function $7(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((a,s)=>{t[s]=a})}catch{}return r.searchParams.forEach((n,a)=>{t[a]=n}),t}const FC=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),z7=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",fl=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Yi=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Ar=async(e,t)=>{await e.removeItem(t)};class mp{constructor(){this.promise=new mp.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}mp.promiseConstructor=Promise;function jm(e){const t=e.split(".");if(t.length!==3)throw new zv("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!N7.test(t[n]))throw new zv("JWT not in base64url format");return{header:JSON.parse(w_(t[0])),payload:JSON.parse(w_(t[1])),signature:$l(t[2]),raw:{header:t[0],payload:t[1]}}}async function H7(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function q7(e,t){return new Promise((n,a)=>{(async()=>{for(let s=0;s<1/0;s++)try{const i=await e(s);if(!t(s,null,i)){n(i);return}}catch(i){if(!t(s,i)){a(i);return}}})()})}function W7(e){return("0"+e.toString(16)).substr(-2)}function V7(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let a="";for(let s=0;s<56;s++)a+=r.charAt(Math.floor(Math.random()*n));return a}return crypto.getRandomValues(t),Array.from(t,W7).join("")}async function G7(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),a=new Uint8Array(n);return Array.from(a).map(s=>String.fromCharCode(s)).join("")}async function K7(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await G7(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function rl(e,t,r=!1){const n=V7();let a=n;r&&(a+="/PASSWORD_RECOVERY"),await fl(e,`${t}-code-verifier`,a);const s=await K7(n);return[s,n===s?"plain":"s256"]}const Y7=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function X7(e){const t=e.headers.get(Uv);if(!t||!t.match(Y7))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function J7(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function Q7(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const Z7=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function nl(e){if(!Z7.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Rm(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function eU(e,t){return new Proxy(e,{get:(r,n,a)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const s=n.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,a)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,a)}})}function b_(e){return JSON.parse(JSON.stringify(e))}const Qi=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),tU=[502,503,504];async function __(e){var t;if(!z7(e))throw new $v(Qi(e),0);if(tU.includes(e.status))throw new $v(Qi(e),e.status);let r;try{r=await e.json()}catch(s){throw new to(Qi(s),s)}let n;const a=X7(e);if(a&&a.getTime()>=jC["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new v_(Qi(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new jn}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((s,i)=>s&&typeof i=="string",!0))throw new v_(Qi(r),e.status,r.weak_password.reasons);throw new C7(Qi(r),e.status||500,n)}const rU=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(n),Object.assign(Object.assign({},a),r))};async function Ke(e,t,r,n){var a;const s=Object.assign({},n==null?void 0:n.headers);s[Uv]||(s[Uv]=jC["2024-01-01"].name),n!=null&&n.jwt&&(s.Authorization=`Bearer ${n.jwt}`);const i=(a=n==null?void 0:n.query)!==null&&a!==void 0?a:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const o=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",l=await nU(e,t,r+o,{headers:s,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function nU(e,t,r,n,a,s){const i=rU(t,n,a,s);let o;try{o=await e(r,Object.assign({},i))}catch(l){throw console.error(l),new $v(Qi(l),0)}if(o.ok||await __(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(l){await __(l)}}function ma(e){var t;let r=null;iU(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=B7(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function E_(e){const t=ma(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ri(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function aU(e){return{data:e,error:null}}function sU(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:a,verification_type:s}=e,i=Tc(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:t,email_otp:r,hashed_token:n,redirect_to:a,verification_type:s},l=Object.assign({},i);return{data:{properties:o,user:l},error:null}}function S_(e){return e}function iU(e){return e.access_token&&e.refresh_token&&e.expires_in}const Im=["global","local","others"];class oU{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=FC(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=Im[0]){if(Im.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Im.join(", ")}`);try{return await Ke(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await Ke(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:ri})}catch(n){if(Ue(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Tc(t,["options"]),a=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(a.new_email=n==null?void 0:n.newEmail,delete a.newEmail),await Ke(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:sU,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Ue(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await Ke(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ri})}catch(r){if(Ue(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,a,s,i,o,l;try{const u={nextPage:null,lastPage:0,total:0},f=await Ke(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(s=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:""},xform:S_});if(f.error)throw f.error;const d=await f.json(),h=(i=f.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(l=(o=f.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{const m=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(v.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(Ue(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){nl(t);try{return await Ke(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ri})}catch(r){if(Ue(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){nl(t);try{return await Ke(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:ri})}catch(n){if(Ue(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){nl(t);try{return await Ke(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:ri})}catch(n){if(Ue(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){nl(t.userId);try{const{data:r,error:n}=await Ke(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:r,error:n}}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async _deleteFactor(t){nl(t.userId),nl(t.id);try{return{data:await Ke(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,a,s,i,o,l;try{const u={nextPage:null,lastPage:0,total:0},f=await Ke(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(s=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:""},xform:S_});if(f.error)throw f.error;const d=await f.json(),h=(i=f.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(l=(o=f.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{const m=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(v.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(Ue(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Ke(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await Ke(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await Ke(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await Ke(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await Ke(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ue(r))return{data:null,error:r};throw r}}}function T_(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const al={debug:!!(globalThis&&IC()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class DC extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class lU extends DC{}async function cU(e,t,r){al.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),al.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){al.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await r()}finally{al.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw al.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new lU(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(al.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function uU(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function MC(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function fU(e){return parseInt(e,16)}function dU(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function hU(e){var t;const{chainId:r,domain:n,expirationTime:a,issuedAt:s=new Date,nonce:i,notBefore:o,requestId:l,resources:u,scheme:f,uri:d,version:h}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=MC(e.address),v=f?`${f}://${n}`:n,m=e.statement?`${e.statement}
`:"",g=`${v} wants you to sign in with your Ethereum account:
${p}
${m}`;let x=`URI: ${d}
Version: ${h}
Chain ID: ${r}${i?`
Nonce: ${i}`:""}
Issued At: ${s.toISOString()}`;if(a&&(x+=`
Expiration Time: ${a.toISOString()}`),o&&(x+=`
Not Before: ${o.toISOString()}`),l&&(x+=`
Request ID: ${l}`),u){let y=`
Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);y+=`
- ${w}`}x+=y}return`${g}
${x}`}class or extends Error{constructor({message:t,code:r,cause:n,name:a}){var s;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(s=a??(n instanceof Error?n.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=r}}class c0 extends or{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function pU({error:e,options:t}){var r,n,a;const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new or({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=s.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new or({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=s.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new or({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=s.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new or({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new or({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new or({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new or({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new or({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const i=window.location.hostname;if(LC(i)){if(s.rp.id!==i)return new or({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new or({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new or({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new or({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new or({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function mU({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new or({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new or({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(LC(n)){if(r.rpId!==n)return new or({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new or({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new or({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new or({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class gU{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const vU=new gU;function xU(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,a=Tc(e,["challenge","user","excludeCredentials"]),s=$l(t).buffer,i=Object.assign(Object.assign({},r),{id:$l(r.id).buffer}),o=Object.assign(Object.assign({},a),{challenge:s,user:i});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:$l(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function yU(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=Tc(e,["challenge","allowCredentials"]),a=$l(t).buffer,s=Object.assign(Object.assign({},n),{challenge:a});if(r&&r.length>0){s.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const o=r[i];s.allowCredentials[i]=Object.assign(Object.assign({},o),{id:$l(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function wU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:oo(new Uint8Array(e.response.attestationObject)),clientDataJSON:oo(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function bU(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:oo(new Uint8Array(a.authenticatorData)),clientDataJSON:oo(new Uint8Array(a.clientDataJSON)),signature:oo(new Uint8Array(a.signature)),userHandle:a.userHandle?oo(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function LC(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function k_(){var e,t;return!!(Pr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function _U(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new c0("Browser returned unexpected credential type",t)}:{data:null,error:new c0("Empty credential response",t)}}catch(t){return{data:null,error:pU({error:t,options:e})}}}async function EU(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new c0("Browser returned unexpected credential type",t)}:{data:null,error:new c0("Empty credential response",t)}}catch(t){return{data:null,error:mU({error:t,options:e})}}}const SU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},TU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function u0(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),r=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),n={};for(const a of e)if(a)for(const s in a){const i=a[s];if(i!==void 0)if(Array.isArray(i))n[s]=i;else if(r(i))n[s]=i;else if(t(i)){const o=n[s];t(o)?n[s]=u0(o,i):n[s]=u0(i)}else n[s]=i}return n}function kU(e,t){return u0(SU,e,t||{})}function NU(e,t){return u0(TU,e,t||{})}class AU{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:a},s){try{const{data:i,error:o}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!i)return{data:null,error:o};const l=a??vU.createNewAbortSignal();if(i.webauthn.type==="create"){const{user:u}=i.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(i.webauthn.type){case"create":{const u=kU(i.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:f,error:d}=await _U({publicKey:u,signal:l});return f?{data:{factorId:t,challengeId:i.id,webauthn:{type:i.webauthn.type,credential_response:f}},error:null}:{data:null,error:d}}case"request":{const u=NU(i.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:f,error:d}=await EU(Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:u,signal:l}));return f?{data:{factorId:t,challengeId:i.id,webauthn:{type:i.webauthn.type,credential_response:f}},error:null}:{data:null,error:d}}}}catch(i){return Ue(i)?{data:null,error:i}:{data:null,error:new to("Unexpected error in challenge",i)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},s){if(!r)return{data:null,error:new gf("rpId is required for WebAuthn authentication")};try{if(!k_())return{data:null,error:new to("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:a},{request:s});if(!i)return{data:null,error:o};const{webauthn:l}=i;return this._verify({factorId:t,challengeId:i.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(i){return Ue(i)?{data:null,error:i}:{data:null,error:new to("Unexpected error in authenticate",i)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},s){if(!r)return{data:null,error:new gf("rpId is required for WebAuthn registration")};try{if(!k_())return{data:null,error:new to("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:t});if(!i)return await this.client.mfa.listFactors().then(f=>{var d;return(d=f.data)===null||d===void 0?void 0:d.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(f=>f?this.client.mfa.unenroll({factorId:f==null?void 0:f.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:a},{create:s});return l?this._verify({factorId:i.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(i){return Ue(i)?{data:null,error:i}:{data:null,error:new to("Unexpected error in register",i)}}}}uU();const CU={url:S7,storageKey:T7,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:k7,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function N_(e,t,r){return await r()}const sl={};class vf{get jwks(){var t,r;return(r=(t=sl[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){sl[this.storageKey]=Object.assign(Object.assign({},sl[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=sl[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){sl[this.storageKey]=Object.assign(Object.assign({},sl[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},CU),t);if(this.storageKey=s.storageKey,this.instanceID=(r=vf.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,vf.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&Pr()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new oU({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=FC(s.fetch),this.lock=s.lock||N_,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&Pr()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=cU:this.lock=N_,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new AU(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:IC()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=T_(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=T_(this.memoryStorage)),Pr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${OC}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(Pr()&&(r=$7(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Pr()&&this.detectSessionInUrl&&n!=="none"){const{data:a,error:s}=await this._getSessionFromURL(r,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),j7(s)){const l=(t=s.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:i,redirectType:o}=a;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Ue(r)?this._returnResult({error:r}):this._returnResult({error:new to("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,a;try{const s=await Ke(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:ma}),{data:i,error:o}=s;if(o||!i)return this._returnResult({data:{user:null,session:null},error:o});const l=i.session,u=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(Ue(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(t){var r,n,a;try{let s;if("email"in t){const{email:f,password:d,options:h}=t;let p=null,v=null;this.flowType==="pkce"&&([p,v]=await rl(this.storage,this.storageKey)),s=await Ke(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:f,password:d,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:v},xform:ma})}else if("phone"in t){const{phone:f,password:d,options:h}=t;s=await Ke(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:f,password:d,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(a=h==null?void 0:h.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:ma})}else throw new Rd("You must provide either an email or phone number and a password");const{data:i,error:o}=s;if(o||!i)return await Ar(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=i.session,u=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(t){try{let r;if("email"in t){const{email:s,password:i,options:o}=t;r=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:E_})}else if("phone"in t){const{phone:s,password:i,options:o}=t;r=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:E_})}else throw new Rd("You must provide either an email or phone number and a password");const{data:n,error:a}=r;if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!n||!n.session||!n.user){const s=new tl;return this._returnResult({data:{user:null,session:null},error:s})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:a})}catch(r){if(Ue(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,a,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,a,s,i,o,l,u,f,d,h;let p,v;if("message"in t)p=t.message,v=t.signature;else{const{chain:m,wallet:g,statement:x,options:y}=t;let w;if(Pr())if(typeof g=="object")w=g;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")w=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=g}const b=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),_=await w.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=MC(_[0]);let E=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!E){const P=await w.request({method:"eth_chainId"});E=fU(P)}const C={domain:b.host,address:T,statement:x,uri:b.href,version:"1",chainId:E,nonce:(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(i=(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(f=y==null?void 0:y.signInWithEthereum)===null||f===void 0?void 0:f.resources};p=hU(C),v=await w.request({method:"personal_sign",params:[dU(p),T]})}try{const{data:m,error:g}=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:v},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:ma});if(g)throw g;if(!m||!m.session||!m.user){const x=new tl;return this._returnResult({data:{user:null,session:null},error:x})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:g})}catch(m){if(Ue(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var r,n,a,s,i,o,l,u,f,d,h,p;let v,m;if("message"in t)v=t.message,m=t.signature;else{const{chain:g,wallet:x,statement:y,options:w}=t;let b;if(Pr())if(typeof x=="object")b=x;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))b=T.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=x}const _=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){const T=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),y?{statement:y}:null));let E;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")E=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)E=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)v=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),m=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${_.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(a=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((s=w==null?void 0:w.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((d=(f=w==null?void 0:w.signInWithSolana)===null||f===void 0?void 0:f.resources)===null||d===void 0)&&d.length?["Resources",...w.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(`
`);const T=await b.signMessage(new TextEncoder().encode(v),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=T}}try{const{data:g,error:x}=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:oo(m)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ma});if(x)throw x;if(!g||!g.session||!g.user){const y=new tl;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:x})}catch(g){if(Ue(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async _exchangeCodeForSession(t){const r=await Yi(this.storage,`${this.storageKey}-code-verifier`),[n,a]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new R7;const{data:s,error:i}=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:ma});if(await Ar(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!s||!s.session||!s.user){const o=new tl;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:a??null}),error:i})}catch(s){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(t){try{const{options:r,provider:n,token:a,access_token:s,nonce:i}=t,o=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:a,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:ma}),{data:l,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const f=new tl;return this._returnResult({data:{user:null,session:null},error:f})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(Ue(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,a,s,i;try{if("email"in t){const{email:o,options:l}=t;let u=null,f=null;this.flowType==="pkce"&&([u,f]=await rl(this.storage,this.storageKey));const{error:d}=await Ke(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:f},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:o,options:l}=t,{data:u,error:f}=await Ke(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(a=l==null?void 0:l.data)!==null&&a!==void 0?a:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(i=l==null?void 0:l.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:f})}throw new Rd("You must provide either an email or phone number.")}catch(o){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(t){var r,n;try{let a,s;"options"in t&&(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo,s=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:o}=await Ke(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:a,xform:ma});if(o)throw o;if(!i)throw new Error("An error occurred on token verification.");const l=i.session,u=i.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(a){if(Ue(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(t){var r,n,a,s,i;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await rl(this.storage,this.storageKey));const u=await Ke(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:aU});return!((s=u.data)===null||s===void 0)&&s.url&&Pr()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new jn;const{error:a}=await Ke(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(t){if(Ue(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:a,options:s}=t,{error:i}=await Ke(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:a,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}else if("phone"in t){const{phone:n,type:a,options:s}=t,{data:i,error:o}=await Ke(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:a,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:o})}throw new Rd("You must provide either an email or phone number and a type")}catch(r){if(Ue(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await Yi(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Pm:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const i=await Yi(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=Rm()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};t.user=eU(t.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:a,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await Ke(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ri}):await this._useSession(async r=>{var n,a,s;const{data:i,error:o}=r;if(o)throw o;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new jn}:await Ke(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(a=i.session)===null||a===void 0?void 0:a.access_token)!==null&&s!==void 0?s:void 0,xform:ri})})}catch(r){if(Ue(r))return O7(r)&&(await this._removeSession(),await Ar(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:a,error:s}=n;if(s)throw s;if(!a.session)throw new jn;const i=a.session;let o=null,l=null;this.flowType==="pkce"&&t.email!=null&&([o,l]=await rl(this.storage,this.storageKey));const{data:u,error:f}=await Ke(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:o,code_challenge_method:l}),jwt:i.access_token,xform:ri});if(f)throw f;return i.user=u.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new jn;const r=Date.now()/1e3;let n=r,a=!0,s=null;const{payload:i}=jm(t.access_token);if(i.exp&&(n=i.exp,a=n<=r),a){const{data:o,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:l}=await this._getUser(t.access_token);if(l)throw l;s={access_token:t.access_token,refresh_token:t.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(r){if(Ue(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:i,error:o}=r;if(o)throw o;t=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new jn;const{data:a,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(Ue(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Pr())throw new Id("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Id(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new g_("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Id("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new g_("No code detected.");const{data:y,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:a,access_token:s,refresh_token:i,expires_in:o,expires_at:l,token_type:u}=t;if(!s||!o||!i||!u)throw new Id("No session defined in URL");const f=Math.round(Date.now()/1e3),d=parseInt(o);let h=f+d;l&&(h=parseInt(l));const p=h-f;p*1e3<=ul&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const v=h-d;f-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,h,f):f-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,h,f);const{data:m,error:g}=await this._getUser(s);if(g)throw g;const x={provider_token:n,provider_refresh_token:a,access_token:s,expires_in:d,expires_at:h,refresh_token:i,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:x,redirectType:t.type},error:null})}catch(n){if(Ue(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await Yi(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:a,error:s}=r;if(s)return this._returnResult({error:s});const i=(n=a.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:o}=await this.admin.signOut(i,t);if(o&&!(P7(o)&&(o.status===404||o.status===401||o.status===403)))return this._returnResult({error:o})}return t!=="others"&&(await this._removeSession(),await Ar(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=U7(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,a;try{const{data:{session:s},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,r={}){let n=null,a=null;this.flowType==="pkce"&&([n,a]=await rl(this.storage,this.storageKey,!0));try{return await Ke(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:a,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(s){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:a}=await this._useSession(async s=>{var i,o,l,u,f;const{data:d,error:h}=s;if(h)throw h;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(i=t.options)===null||i===void 0?void 0:i.redirectTo,scopes:(o=t.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Ke(this.fetch,"GET",p,{headers:this.headers,jwt:(f=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&f!==void 0?f:void 0})});if(a)throw a;return Pr()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Ue(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:a,data:{session:s}}=r;if(a)throw a;const{options:i,provider:o,token:l,access_token:u,nonce:f}=t,d=await Ke(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=s==null?void 0:s.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:l,access_token:u,nonce:f,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:ma}),{data:h,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new tl}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:p}))}catch(a){if(await Ar(this.storage,`${this.storageKey}-code-verifier`),Ue(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,a;const{data:s,error:i}=r;if(i)throw i;return await Ke(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0})})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await q7(async a=>(a>0&&await H7(200*Math.pow(2,a-1)),this._debug(r,"refreshing attempt",a),await Ke(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:ma})),(a,s)=>{const i=200*Math.pow(2,a);return s&&Om(s)&&Date.now()+i-n<ul})}catch(n){if(this._debug(r,"error",n),Ue(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Pr()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const a=await Yi(this.storage,this.storageKey);if(a&&this.userStorage){let i=await Yi(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:a.user},await fl(this.userStorage,this.storageKey+"-user",i)),a.user=(t=i==null?void 0:i.user)!==null&&t!==void 0?t:Rm()}else if(a&&!a.user&&!a.user){const i=await Yi(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(a.user=i.user,await Ar(this.storage,this.storageKey+"-user"),await fl(this.storage,this.storageKey,a)):a.user=Rm()}if(this._debug(n,"session from storage",a),!this._isValidSession(a)){this._debug(n,"session is not valid"),a!==null&&await this._removeSession();return}const s=((r=a.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Pm;if(this._debug(n,`session has${s?"":" not"} expired with margin of ${Pm}s`),s){if(this.autoRefreshToken&&a.refresh_token){const{error:i}=await this._callRefreshToken(a.refresh_token);i&&(console.error(i),Om(i)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:o}=await this._getUser(a.access_token);!o&&(i!=null&&i.user)?(a.user=i.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(n,"error",a),console.error(a);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new jn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new mp;const{data:s,error:i}=await this._refreshAccessToken(t);if(i)throw i;if(!s.session)throw new jn;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(a,"error",s),Ue(s)){const i={data:null,error:s};return Om(s)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,r,n=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const s=[],i=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(t,r)}catch(l){s.push(l)}});if(await Promise.all(i),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Ar(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await fl(this.userStorage,this.storageKey+"-user",{user:r.user});const a=Object.assign({},r);delete a.user;const s=b_(a);await fl(this.storage,this.storageKey,s)}else{const a=b_(r);await fl(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Ar(this.storage,this.storageKey),await Ar(this.storage,this.storageKey+"-code-verifier"),await Ar(this.storage,this.storageKey+"-user"),this.userStorage&&await Ar(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Pr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ul);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((n.expires_at*1e3-t)/ul);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${ul}ms, refresh threshold is ${Bv} ticks`),a<=Bv&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof DC)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Pr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const a=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&a.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&a.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[s,i]=await rl(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(i)}`});a.push(o.toString())}if(n!=null&&n.queryParams){const s=new URLSearchParams(n.queryParams);a.push(s.toString())}return n!=null&&n.skipBrowserRedirect&&a.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:a,error:s}=r;return s?this._returnResult({data:null,error:s}):await Ke(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,a;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:u}=await Ke(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&l.type==="totp"&&(!((a=l==null?void 0:l.totp)===null||a===void 0)&&a.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:a,error:s}=r;if(s)return this._returnResult({data:null,error:s});const i=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?wU(t.webauthn.credential_response):bU(t.webauthn.credential_response)})}:{code:t.code}),{data:o,error:l}=await Ke(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:i,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:a,error:s}=r;if(s)return this._returnResult({data:null,error:s});const i=await Ke(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});if(i.error)return i;const{data:o}=i;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:xU(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:yU(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const a={all:[],phone:[],totp:[],webauthn:[]};for(const s of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])a.all.push(s),s.status==="verified"&&a[s.factor_type].push(s);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;const{data:{session:n},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:s}=jm(n.access_token);let i=null;s.aal&&(i=s.aal);let o=i;((r=(t=n.user.factors)===null||t===void 0?void 0:t.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(o="aal2");const u=s.amr||[];return{data:{currentLevel:i,nextLevel:o,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?await Ke(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new jn})})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:a},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new jn});const i=await Ke(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&Pr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:a},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new jn});const i=await Ke(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&Pr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await Ke(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new jn})})}catch(t){if(Ue(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?(await Ke(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new jn})})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(o=>o.kid===t);if(n)return n;const a=Date.now();if(n=this.jwks.keys.find(o=>o.kid===t),n&&this.jwks_cached_at+A7>a)return n;const{data:s,error:i}=await Ke(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=a,n=s.keys.find(o=>o.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:v}=await this.getSession();if(v||!p.session)return this._returnResult({data:null,error:v});n=p.session.access_token}const{header:a,payload:s,signature:i,raw:{header:o,payload:l}}=jm(n);r!=null&&r.allowExpired||J7(s.exp);const u=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:s,header:a,signature:i},error:null}}const f=Q7(a.alg),d=await crypto.subtle.importKey("jwk",u,f,!0,["verify"]);if(!await crypto.subtle.verify(f,d,i,L7(`${o}.${l}`)))throw new zv("Invalid JWT signature");return{data:{claims:s,header:a,signature:i},error:null}}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}}vf.nextInstanceID={};const PU=vf,OU="2.90.1";let uu="";typeof Deno<"u"?uu="deno":typeof document<"u"?uu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?uu="react-native":uu="node";const jU={"X-Client-Info":`supabase-js-${uu}/${OU}`},RU={headers:jU},IU={schema:"public"},FU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},DU={};function xf(e){"@babel/helpers - typeof";return xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xf(e)}function MU(e,t){if(xf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LU(e){var t=MU(e,"string");return xf(t)=="symbol"?t:t+""}function BU(e,t,r){return(t=LU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A_(Object(r),!0).forEach(function(n){BU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const UU=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),$U=()=>Headers,zU=(e,t,r)=>{const n=UU(r),a=$U();return async(s,i)=>{var o;const l=(o=await t())!==null&&o!==void 0?o:e;let u=new a(i==null?void 0:i.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(s,Xt(Xt({},i),{},{headers:u}))}};function HU(e){return e.endsWith("/")?e:e+"/"}function qU(e,t){var r,n;const{db:a,auth:s,realtime:i,global:o}=e,{db:l,auth:u,realtime:f,global:d}=t,h={db:Xt(Xt({},l),a),auth:Xt(Xt({},u),s),realtime:Xt(Xt({},f),i),storage:{},global:Xt(Xt(Xt({},d),o),{},{headers:Xt(Xt({},(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{}),(n=o==null?void 0:o.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function WU(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(HU(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var VU=class extends PU{constructor(e){super(e)}},GU=class{constructor(e,t,r){var n,a;this.supabaseUrl=e,this.supabaseKey=t;const s=WU(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const i=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:IU,realtime:DU,auth:Xt(Xt({},FU),{},{storageKey:i}),global:RU},l=qU(r??{},o);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=l.global.headers)!==null&&a!==void 0?a:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=zU(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Xt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&this.accessToken().then(f=>this.realtime.setAuth(f)).catch(f=>console.warn("Failed to set initial Realtime auth token:",f)),this.rest=new k9(new URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new E7(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new b9(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:a,storageKey:s,flowType:i,lock:o,debug:l,throwOnError:u},f,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new VU({url:this.authUrl.href,headers:Xt(Xt({},h),f),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:a,flowType:i,lock:o,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new H9(this.realtimeUrl.href,Xt(Xt({},e),{},{params:Xt(Xt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const KU=(e,t,r)=>new GU(e,t,r);function YU(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}YU()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const XU="https://tircumfjwyhbgcylnnjd.supabase.co",JU="sb_publishable_vQPwRCUSq6_I0gEibeGVMQ_-_34zV4W",ra=KU(XU,JU),QU="/.netlify/functions";async function Gr(e,t={}){const r=`${QU}${e}`;try{const n=await fetch(r,{...t,headers:{"Content-Type":"application/json",...t.headers}});if(!n.ok){let a=`API request failed: ${n.statusText}`,s=null;try{const o=await n.json();a=o.error||o.message||a,s=o}catch{a=`HTTP ${n.status}: ${n.statusText}`}const i=new Error(a);throw i.status=n.status,i.details=s,i}return n.json()}catch(n){if(n instanceof Error&&n.name==="TypeError"&&n.message.includes("fetch"))throw new Error("Network error: Unable to connect to server. Please check your connection and try again.");if(n instanceof Error&&"status"in n)throw n;const a=n instanceof Error?n.message:"An unexpected error occurred. Please try again.";throw new Error(a)}}const Fm={login:async(e,t)=>{if(e==="admin"&&t==="admin123")return{success:!0,user:{id:"admin-1",username:"admin",email:"admin@gardener.com"}};try{return await Gr("/users/login",{method:"POST",body:JSON.stringify({username:e,password:t})})}catch{throw new Error("Invalid username or password")}},create:async(e,t,r)=>Gr("/users",{method:"POST",body:JSON.stringify({username:e,password:t,email:r})}),resetPassword:async(e,t)=>Gr("/users/reset-password",{method:"POST",body:JSON.stringify({email:e,newPassword:t})})},fu={getAll:async(e=1,t=12)=>{console.log("🔍 Products API: Fetching products...");const r=(e-1)*t,{data:n,error:a}=await ra.from("products").select("*").order("created_at",{ascending:!1}).range(r,r+t-1);if(console.log("📦 Products API Response:",{products:n,error:a}),a)throw console.error("❌ Products API Error:",a),a;const{count:s}=await ra.from("products").select("*",{count:"exact",head:!0});return console.log("📊 Products Count:",s),{data:n||[],total:s||0,page:e,limit:t}},getAllSimple:async()=>{const{data:e,error:t}=await ra.from("products").select("*").order("created_at",{ascending:!1});if(t)throw t;return e||[]},create:async e=>{const t={...e,subCategory:e.subCategory||e.sub_category};return(await Gr("/products",{method:"POST",body:JSON.stringify(t)})).product},update:async(e,t)=>{const r={...t,subCategory:t.subCategory||t.sub_category};return(await Gr(`/products/${e}`,{method:"PUT",body:JSON.stringify(r)})).product},delete:async e=>{await Gr(`/products/${e}`,{method:"DELETE"})}},Zs={getAll:async(e=1,t=6)=>{console.log("🔍 Posts API: Fetching posts...");const r=(e-1)*t,{data:n,error:a}=await ra.from("posts").select("*").order("created_at",{ascending:!1}).range(r,r+t-1);if(console.log("📝 Posts API Response:",{posts:n,error:a}),a)throw console.error("❌ Posts API Error:",a),a;const{count:s}=await ra.from("posts").select("*",{count:"exact",head:!0});return console.log("📊 Posts Count:",s),{data:n||[],total:s||0,page:e,limit:t}},getAllSimple:async()=>{const{data:e,error:t}=await ra.from("posts").select("*").order("date",{ascending:!1});if(t)throw t;return e||[]},getBySlug:async e=>{const{data:t,error:r}=await ra.from("posts").select("*").eq("slug",e).single();if(r)throw r;return t},create:async e=>{const t={...e,readTime:e.readTime||e.read_time};return(await Gr("/posts",{method:"POST",body:JSON.stringify(t)})).post},update:async(e,t)=>{const r={...t,readTime:t.readTime||t.read_time};return(await Gr(`/posts/${e}`,{method:"PUT",body:JSON.stringify(r)})).post},delete:async e=>{await Gr(`/posts/${e}`,{method:"DELETE"})}},ms={getAll:async(e=1,t=10)=>{console.log("🔍 Plants API: Fetching plants...");const{data:r,error:n}=await ra.from("plants").select("*").order("created_at",{ascending:!1}).range((e-1)*t,e*t-1);if(console.log("🌿 Plants API Response:",{plants:r,error:n}),n)throw console.error("❌ Plants API Error:",n),n;const{count:a}=await ra.from("plants").select("*",{count:"exact",head:!0});return console.log("📊 Plants Count:",a),{data:r||[],total:a||0,page:e,limit:t}},searchByName:async(e,t=5)=>{const r=e.trim();if(!r)return[];const{data:n,error:a}=await ra.from("plants").select("*").ilike("name",r).limit(t);if(a)throw a;if(n&&n.length>0)return n;const{data:s,error:i}=await ra.from("plants").select("*").ilike("name",`%${r}%`).limit(t);if(i)throw i;return s||[]},getById:async e=>{const{data:t,error:r}=await ra.from("plants").select("*").eq("id",e).single();if(r)throw r;return t},create:async e=>{const t={name:e.name,region:e.region,growingMonths:e.growingMonths||e.growing_months,season:e.season,soilRequirements:e.soilRequirements||e.soil_requirements,bloomHarvestTime:e.bloomHarvestTime||e.bloom_harvest_time,sunlightNeeds:e.sunlightNeeds||e.sunlight_needs,careInstructions:e.careInstructions||e.care_instructions,image:e.image,plantType:e.plantType||e.plant_type,dataSource:e.dataSource};return(await Gr("/plants",{method:"POST",body:JSON.stringify(t)})).plant},update:async(e,t)=>{const r={name:t.name,region:t.region,growingMonths:t.growingMonths||t.growing_months,season:t.season,soilRequirements:t.soilRequirements||t.soil_requirements,bloomHarvestTime:t.bloomHarvestTime||t.bloom_harvest_time,sunlightNeeds:t.sunlightNeeds||t.sunlight_needs,careInstructions:t.careInstructions||t.care_instructions,image:t.image,plantType:t.plantType||t.plant_type,dataSource:t.dataSource};return(await Gr(`/plants/${e}`,{method:"PUT",body:JSON.stringify(r)})).plant},delete:async e=>{await Gr(`/plants/${e}`,{method:"DELETE"})}},ni={getHomeLatest:async(e=3)=>(await Gr(`/comments?scope=home&limit=${encodeURIComponent(String(e))}`)).comments||[],getPostComments:async e=>(await Gr(`/comments?scope=post&postSlug=${encodeURIComponent(e)}`)).comments||[],createHomeComment:async e=>(await Gr("/comments",{method:"POST",body:JSON.stringify({scope:"home",authorName:e.authorName,authorEmail:e.authorEmail,authorPhone:e.authorPhone,rating:e.rating,content:e.content})})).comment,createPostComment:async e=>(await Gr("/comments",{method:"POST",body:JSON.stringify({scope:"post",postSlug:e.postSlug,parentId:e.parentId,authorName:e.authorName,content:e.content})})).comment};let Kn=null,at=null;const ga={getAll:async()=>{try{console.log("🔍 Product Storage: Fetching products...");const e=await fu.getAll(1,1e3);console.log("📦 Product Storage Response:",e);const t=(e.data||[]).map(r=>({id:r.id,name:r.name,price:r.price,image:r.image||(r.images&&r.images.length>0?r.images[0]:void 0),images:r.images||(r.image?[r.image]:[]),link:r.link,category:r.category,description:r.description,source:r.source,subCategory:r.subCategory||r.sub_category}));return console.log("✅ Product Storage Normalized:",t),Kn=t,t}catch(e){return console.error("❌ Failed to fetch products:",e),Kn||[]}},getAllSync:()=>Kn||[],save:async e=>{console.warn("productStorage.save() is deprecated. Use add/update/delete methods instead.")},add:async e=>{try{const{id:t,...r}=e,n=await fu.create(r),a={id:n.id,name:n.name,price:n.price,image:n.image||(n.images&&n.images.length>0?n.images[0]:void 0),images:n.images||(n.image?[n.image]:[]),link:n.link,category:n.category,description:n.description,source:n.source,subCategory:n.subCategory||n.sub_category};return Kn&&Kn.push(a),a}catch(t){throw console.error("Failed to add product:",t),t}},update:async(e,t)=>{try{if(await fu.update(e,t),Kn){const r=Kn.findIndex(n=>n.id===e);r!==-1&&(Kn[r]={...Kn[r],...t})}}catch(r){throw console.error("Failed to update product:",r),r}},delete:async e=>{try{await fu.delete(e),Kn&&(Kn=Kn.filter(t=>t.id!==e))}catch(t){throw console.error("Failed to delete product:",t),t}}},Ys={getAll:async()=>{try{const t=((await Zs.getAll(1,1e3)).data||[]).map(r=>({id:r.id,title:r.title,slug:r.slug,excerpt:r.excerpt,content:r.content,date:r.date,readTime:r.read_time,category:r.category,author:r.author,image:r.image,featured:r.featured}));return at=t,t}catch(e){return console.error("Failed to fetch posts:",e),at||[]}},getAllSync:()=>at||[],save:async e=>{console.warn("postStorage.save() is deprecated. Use add/update/delete methods instead.")},add:async e=>{try{const{id:t,...r}=e,n=await Zs.create(r),a={id:n.id,title:n.title,slug:n.slug,excerpt:n.excerpt,content:n.content,date:n.date,readTime:n.read_time,category:n.category,author:n.author,image:n.image,featured:n.featured};return at&&at.push(a),a}catch(t){throw console.error("Failed to add post:",t),t}},update:async(e,t)=>{var r,n,a,s,i,o,l,u;try{const f=await Zs.update(e,t);if(at){const d=at.findIndex(h=>h.id===e);if(d!==-1){if(!f.content){const h=await Zs.getBySlug(f.slug);if(h)return at[d]={id:h.id,title:h.title,slug:h.slug,excerpt:h.excerpt,content:h.content,date:h.date,readTime:h.read_time,category:h.category,author:h.author,image:h.image,featured:h.featured},at[d]}at[d]={...at[d],...t}}}return{id:f.id,title:f.title||t.title||"",slug:f.slug||t.slug||"",excerpt:t.excerpt!==void 0?t.excerpt:((r=at==null?void 0:at.find(d=>d.id===e))==null?void 0:r.excerpt)||"",content:t.content!==void 0?t.content:((n=at==null?void 0:at.find(d=>d.id===e))==null?void 0:n.content)||"",date:t.date||((a=at==null?void 0:at.find(d=>d.id===e))==null?void 0:a.date),readTime:t.readTime||((s=at==null?void 0:at.find(d=>d.id===e))==null?void 0:s.readTime),category:t.category!==void 0?t.category:(i=at==null?void 0:at.find(d=>d.id===e))==null?void 0:i.category,author:t.author||((o=at==null?void 0:at.find(d=>d.id===e))==null?void 0:o.author),image:t.image!==void 0?t.image:(l=at==null?void 0:at.find(d=>d.id===e))==null?void 0:l.image,featured:t.featured!==void 0?t.featured:(u=at==null?void 0:at.find(d=>d.id===e))==null?void 0:u.featured}}catch(f){throw console.error("Failed to update post:",f),f}},delete:async e=>{try{await Zs.delete(e),at&&(at=at.filter(t=>t.id!==e))}catch(t){throw console.error("Failed to delete post:",t),t}},getBySlug:async e=>{try{return await Zs.getBySlug(e)}catch(t){return console.error("Failed to fetch post by slug:",t),at==null?void 0:at.find(r=>r.slug===e)}}};function ZU({limit:e=5,showViewAll:t=!0}){const[r,n]=S.useState([]),[a,s]=S.useState(!0);return S.useEffect(()=>{const i=async()=>{console.log("🔍 ProductsSection: Starting to load products...");try{const l=await ga.getAll();if(console.log("📦 ProductsSection: Received products:",l),l.length>0){const u=l.map(f=>({id:f.id,name:f.name,price:f.price,image:f.images&&f.images.length>0?f.images[0]:f.image||"",images:f.images&&f.images.length>0?f.images:f.image?[f.image]:[],link:f.link||""}));console.log("✅ ProductsSection: Converted products:",u),n(u.slice(0,e))}else console.log("⚠️ ProductsSection: No products found, setting empty array"),n([])}catch(l){console.error("❌ ProductsSection: Error loading products:",l),n([])}finally{s(!1)}};i();const o=setInterval(i,3e4);return()=>{clearInterval(o)}},[e]),c.jsxs("section",{id:"products",className:"py-8 md:py-12 relative overflow-hidden wavy-top wavy-bottom",children:[c.jsx("div",{className:"absolute inset-0 -z-10",style:{background:"radial-gradient(ellipse 60% 50% at 50% 50%, hsl(147 55% 40% / 0.05) 0%, transparent 70%)"}}),c.jsxs("div",{className:"section-container",children:[c.jsx("div",{className:"text-center mb-8",children:c.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"We recommend these gardening tools and supplies based on what works well for home gardeners. These are affiliate links, so we may earn a small commission if you buy through them."})}),c.jsxs("div",{className:"text-center mb-16",children:[c.jsx("h2",{className:"font-display text-4xl md:text-5xl lg:text-6xl font-extrabold mb-6",children:c.jsx("span",{className:"gradient-text",children:"Featured Products"})}),c.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Curated selection of premium gardening products to help your garden thrive."})]}),a?c.jsx(Ov,{count:e}):c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-3 sm:gap-4 md:gap-6",children:r.map((i,o)=>c.jsx(bC,{product:i,index:o},i.id))}),!a&&r.length===0&&c.jsx("div",{className:"text-center py-12 bg-muted/50 rounded-xl",children:c.jsx("p",{className:"text-muted-foreground",children:"No products found yet. Check back soon!"})}),t&&!a&&r.length>0&&c.jsx("div",{className:"text-center mt-16",children:c.jsx(be,{asChild:!0,variant:"gradient",size:"lg",className:"px-8 py-6 text-lg font-semibold",children:c.jsxs(vt,{to:"/products",className:"group",children:["View all products",c.jsx($f,{className:"w-5 h-5 ml-2 transition-transform group-hover:translate-x-1"})]})})})]})]})}var Hv=new Map,Fd=new WeakMap,C_=0,e$;function t$(e){return e?(Fd.has(e)||(C_+=1,Fd.set(e,C_.toString())),Fd.get(e)):"0"}function r$(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?t$(e.root):e[t]}`).toString()}function n$(e){const t=r$(e);let r=Hv.get(t);if(!r){const n=new Map;let a;const s=new IntersectionObserver(i=>{i.forEach(o=>{var l;const u=o.isIntersecting&&a.some(f=>o.intersectionRatio>=f);e.trackVisibility&&typeof o.isVisible>"u"&&(o.isVisible=u),(l=n.get(o.target))==null||l.forEach(f=>{f(u,o)})})},e);a=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:s,elements:n},Hv.set(t,r)}return r}function a$(e,t,r={},n=e$){if(typeof window.IntersectionObserver>"u"&&n!==void 0){const l=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:typeof r.threshold=="number"?r.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:a,observer:s,elements:i}=n$(r),o=i.get(e)||[];return i.has(e)||i.set(e,o),o.push(t),s.observe(e),function(){o.splice(o.indexOf(t),1),o.length===0&&(i.delete(e),s.unobserve(e)),i.size===0&&(s.disconnect(),Hv.delete(a))}}function s$({threshold:e,delay:t,trackVisibility:r,rootMargin:n,root:a,triggerOnce:s,skip:i,initialInView:o,fallbackInView:l,onChange:u}={}){var f;const[d,h]=S.useState(null),p=S.useRef(u),v=S.useRef(o),[m,g]=S.useState({inView:!!o,entry:void 0});p.current=u,S.useEffect(()=>{if(v.current===void 0&&(v.current=o),i||!d)return;let b;return b=a$(d,(_,T)=>{const E=v.current;v.current=_,!(E===void 0&&!_)&&(g({inView:_,entry:T}),p.current&&p.current(_,T),T.isIntersecting&&s&&b&&(b(),b=void 0))},{root:a,rootMargin:n,threshold:e,trackVisibility:r,delay:t},l),()=>{b&&b()}},[Array.isArray(e)?e.toString():e,d,a,n,s,i,r,l,t]);const x=(f=m.entry)==null?void 0:f.target,y=S.useRef(void 0);!d&&x&&!s&&!i&&y.current!==x&&(y.current=x,g({inView:!!o,entry:void 0}),v.current=o);const w=[h,m.inView,m.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}function c1({queryKey:e,fetchFunction:t,initialLimit:r=20,preloadLimit:n=10,enabled:a=!0}){var v;const{data:s,error:i,fetchNextPage:o,hasNextPage:l,isFetching:u,isFetchingNextPage:f,status:d}=rL({queryKey:e,queryFn:({pageParam:m=1})=>t(m,r),getNextPageParam:(m,g)=>g.reduce((y,w)=>y+w.data.length,0)<m.total?g.length+1:void 0,enabled:a,staleTime:3e5,cacheTime:6e5}),h=(s==null?void 0:s.pages.flatMap(m=>m.data))||[],p=((v=s==null?void 0:s.pages[0])==null?void 0:v.total)||0;return S.useEffect(()=>{l&&!f&&h.length>0&&p-h.length<=n&&o()},[l,f,h.length,p,n,o]),{items:h,total:p,error:i,isLoading:d==="pending",isFetching:u,isFetchingNextPage:f,hasNextPage:l,loadMore:o}}function BC(){const{ref:e,inView:t}=s$({threshold:.1,rootMargin:"100px"});return{ref:e,inView:t}}function i$({limit:e=3}){const{items:t,isLoading:r}=c1({queryKey:["posts"],fetchFunction:(a,s)=>Zs.getAll(a,s),initialLimit:e}),n=t.slice(0,e);return c.jsxs("section",{id:"posts",className:"py-8 md:py-16 relative overflow-hidden wavy-top wavy-bottom",children:[c.jsx("div",{className:"absolute inset-0 -z-10",style:{background:"radial-gradient(ellipse 50% 40% at 50% 50%, hsl(199 85% 70% / 0.08) 0%, transparent 70%)"}}),c.jsxs("div",{className:"section-container",children:[c.jsx("div",{className:"text-center mb-8",children:c.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"We write about real gardening experiences and practical advice that we've tested ourselves. These posts cover everything from beginner tips to advanced techniques."})}),c.jsxs("div",{className:"text-center mb-16",children:[c.jsx("h2",{className:"font-display text-3xl md:text-4xl lg:text-5xl font-extrabold mb-6",children:c.jsx("span",{className:"gradient-text",children:"Latest Posts"})}),c.jsx("p",{className:"text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Insights and tips from Perfect Gardener to help your garden flourish."})]}),r?c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 sm:gap-4 md:gap-6",children:Array.from({length:e}).map((a,s)=>c.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 space-y-4",children:[c.jsx("div",{className:"h-6 bg-muted rounded animate-pulse w-3/4"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-2/3"})]}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/3"})]},s))}):c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 sm:gap-4 md:gap-6",children:n.map((a,s)=>{const i=a.slug?`/blog/${a.slug}`:"/posts";return c.jsx(vt,{to:i,children:c.jsxs("article",{className:je("group glass-card rounded-2xl overflow-hidden animate-fade-in transition-all duration-500 hover:shadow-2xl hover:-translate-y-2 hover:scale-[1.02] cursor-pointer"),style:{animationDelay:`${s*100}ms`},children:[a.image&&a.image.startsWith("http")&&c.jsxs("div",{className:"relative w-full aspect-video overflow-hidden bg-muted",children:[c.jsx("img",{src:a.image,alt:a.title,className:"w-full h-full object-contain block group-hover:scale-110 transition-transform duration-500",onError:o=>{o.target.style.display="none"}}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),c.jsxs("div",{className:"p-8",children:[c.jsx("h3",{className:"font-display font-bold text-xl text-foreground mb-4 line-clamp-2 group-hover:gradient-text transition-all duration-300",children:a.title}),c.jsx("p",{className:"text-muted-foreground text-base mb-6 line-clamp-3 leading-relaxed",children:a.excerpt}),c.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(py,{className:"w-4 h-4"}),new Date(a.date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(G0,{className:"w-4 h-4"}),a.readTime]})]})]})]})},a.id)})}),c.jsxs("div",{className:"flex flex-wrap justify-center gap-4 mt-16",children:[c.jsx(be,{asChild:!0,variant:"gradient",size:"lg",className:"px-8 py-6 text-lg font-semibold",children:c.jsxs(vt,{to:"/posts",className:"group",children:["View all posts",c.jsx($f,{className:"w-5 h-5 ml-2 transition-transform group-hover:translate-x-1"})]})}),c.jsx(be,{asChild:!0,variant:"outline",size:"lg",className:"px-8 py-6 text-lg font-semibold",children:c.jsx(vt,{to:"/tools",children:"Explore Tools"})})]})]})]})}const jt=S.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:je("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));jt.displayName="Card";const nn=S.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:je("flex flex-col space-y-1.5 p-6",e),...t}));nn.displayName="CardHeader";const an=S.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:je("text-2xl font-semibold leading-none tracking-tight",e),...t}));an.displayName="CardTitle";const Va=S.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:je("text-sm text-muted-foreground",e),...t}));Va.displayName="CardDescription";const It=S.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:je("p-6 pt-0",e),...t}));It.displayName="CardContent";const o$=S.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:je("flex items-center p-6 pt-0",e),...t}));o$.displayName="CardFooter";const l$=[{title:"Flower Planting Calendar",href:"/tools/flower-calendar",image:"/images/Flower planting calculator.png",color:"border-blue-200"},{title:"Pot Size Calculator",href:"/tools/pot-calculator",image:"/images/pot size calculator.png",color:"border-green-200"},{title:"Bloom Time Calculator",href:"/tools/bloom-calculator",image:"/images/bloom time calender.png",color:"border-purple-200"},{title:"Budget Planner",href:"/tools/budget-planner",image:"/images/budget planner.png",color:"border-orange-200"}];function c$(){const e="v2";return c.jsxs("section",{id:"tools",className:"py-12 md:py-16 relative overflow-hidden z-10",children:[c.jsx("div",{className:"absolute inset-0 -z-10",style:{background:"radial-gradient(ellipse 50% 30% at 50% 50%, hsl(142 76% 36% / 0.08) 0%, transparent 70%)"}}),c.jsxs("div",{className:"w-full mx-auto px-2 xs:px-3 sm:px-4 md:px-6 lg:px-6 xl:px-8 2xl:px-10",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold text-foreground mb-4",children:"Gardening Tools & Calculators"}),c.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Practical tools to help you plan, calculate, and optimize your gardening activities for better results."})]}),c.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 sm:gap-3 md:gap-4 mb-8",children:l$.map(t=>c.jsx(jt,{className:je("group overflow-hidden border-2 hover:border-primary/50 transition-all duration-300 hover:-translate-y-1 hover:shadow-lg",t.color),children:c.jsxs(vt,{to:t.href,className:"block h-full",children:[c.jsx("div",{className:"w-full aspect-square overflow-hidden bg-muted p-2 flex items-center justify-center",children:c.jsx("img",{src:`${t.image}?${e}`,alt:t.title,className:"w-full h-full object-contain block",loading:"lazy"})}),c.jsx("div",{className:"px-2 py-2 text-center",children:c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title})})]})},t.title))}),c.jsx("div",{className:"text-center",children:c.jsx(be,{asChild:!0,variant:"outline",size:"lg",className:"group",children:c.jsxs(vt,{to:"/tools",className:"flex items-center",children:["Explore All Tools",c.jsx($f,{className:"w-5 h-5 ml-2 group-hover:translate-x-1 transition-transform"})]})})})]})]})}function u$(){return c.jsx("section",{id:"youtube",className:"py-12 md:py-16 bg-secondary/30",children:c.jsxs("div",{className:"section-container",children:[c.jsx("div",{className:"text-center mb-8"}),c.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[c.jsxs("div",{className:"space-y-6 text-center lg:text-left",children:[c.jsx("h2",{className:"font-display text-3xl md:text-4xl font-bold text-foreground",children:"Support Perfect Gardener on YouTube !"}),c.jsx("p",{className:"text-lg text-muted-foreground max-w-lg mx-auto lg:mx-0",children:"I love sharing my gardening journey through videos! From planting seeds to harvesting vegetables, you'll find practical tips, real garden tours, and honest reviews of what works (and what doesn't). Join me as we learn and grow together!"}),c.jsx(be,{asChild:!0,size:"lg",className:"group",children:c.jsxs("a",{href:"https://www.youtube.com/@perfect.gardener",target:"_blank",rel:"noopener noreferrer",children:[c.jsx(Y0,{className:"w-5 h-5 mr-2"}),"Subscribe on YouTube"]})})]}),c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"aspect-video rounded-xl overflow-hidden shadow-soft border border-border bg-card",children:c.jsx("iframe",{src:"https://www.youtube.com/embed/ds2Ozajh5zs",title:"Perfect Gardener - Featured Video",loading:"lazy",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,className:"w-full h-full"})}),c.jsx("div",{className:"absolute -z-10 -bottom-4 -right-4 w-full h-full rounded-xl bg-primary/10"})]})]})]})})}const Be=S.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:je("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Be.displayName="Input";const ws=S.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:je("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));ws.displayName="Textarea";var f$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],d$=f$.reduce((e,t)=>{const r=By(`Primitive.${t}`),n=S.forwardRef((a,s)=>{const{asChild:i,...o}=a,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),h$="Label",UC=S.forwardRef((e,t)=>c.jsx(d$.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));UC.displayName=h$;var $C=UC;const p$=Uf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oe=S.forwardRef(({className:e,...t},r)=>c.jsx($C,{ref:r,className:je(p$(),e),...t}));Oe.displayName=$C.displayName;function P_(e,[t,r]){return Math.min(r,Math.max(t,e))}function m$(e){const t=g$(e),r=S.forwardRef((n,a)=>{const{children:s,...i}=n,o=S.Children.toArray(s),l=o.find(x$);if(l){const u=l.props.children,f=o.map(d=>d===l?S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...i,ref:a,children:S.isValidElement(u)?S.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:a,children:s})});return r.displayName=`${e}.Slot`,r}function g$(e){const t=S.forwardRef((r,n)=>{const{children:a,...s}=r;if(S.isValidElement(a)){const i=w$(a),o=y$(s,a.props);return a.type!==S.Fragment&&(o.ref=n?Fs(n,i):i),S.cloneElement(a,o)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var v$=Symbol("radix.slottable");function x$(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===v$}function y$(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...o)=>{const l=s(...o);return a(...o),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...s}:n==="className"&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}function w$(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function b$(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _$=[" ","Enter","ArrowUp","ArrowDown"],E$=[" ","Enter"],Ro="Select",[gp,vp,S$]=q0(Ro),[kc]=Da(Ro,[S$,_c]),xp=_c(),[T$,Hi]=kc(Ro),[k$,N$]=kc(Ro),zC=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:s,value:i,defaultValue:o,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:h,required:p,form:v}=e,m=xp(t),[g,x]=S.useState(null),[y,w]=S.useState(null),[b,_]=S.useState(!1),T=sp(u),[E,C]=ji({prop:n,defaultProp:a??!1,onChange:s,caller:Ro}),[P,N]=ji({prop:i,defaultProp:o,onChange:l,caller:Ro}),k=S.useRef(null),A=g?v||!!g.closest("form"):!0,[I,M]=S.useState(new Set),U=Array.from(I).map(W=>W.props.value).join(";");return c.jsx(Ny,{...m,children:c.jsxs(T$,{required:p,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:b,onValueNodeHasChildrenChange:_,contentId:Oa(),value:P,onValueChange:N,open:E,onOpenChange:C,dir:T,triggerPointerDownPosRef:k,disabled:h,children:[c.jsx(gp.Provider,{scope:t,children:c.jsx(k$,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(W=>{M(G=>new Set(G).add(W))},[]),onNativeOptionRemove:S.useCallback(W=>{M(G=>{const Q=new Set(G);return Q.delete(W),Q})},[]),children:r})}),A?c.jsxs(d4,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:P,onChange:W=>N(W.target.value),disabled:h,form:v,children:[P===void 0?c.jsx("option",{value:""}):null,Array.from(I)]},U):null]})})};zC.displayName=Ro;var HC="SelectTrigger",qC=S.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,s=xp(r),i=Hi(HC,r),o=i.disabled||n,l=Tt(t,i.onTriggerChange),u=vp(r),f=S.useRef("touch"),[d,h,p]=p4(m=>{const g=u().filter(w=>!w.disabled),x=g.find(w=>w.value===i.value),y=m4(g,m,x);y!==void 0&&i.onValueChange(y.value)}),v=m=>{o||(i.onOpenChange(!0),p()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(Ay,{asChild:!0,...s,children:c.jsx(Ze.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":h4(i.value)?"":void 0,...a,ref:l,onClick:Pe(a.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&v(m)}),onPointerDown:Pe(a.onPointerDown,m=>{f.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:Pe(a.onKeyDown,m=>{const g=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(g&&m.key===" ")&&_$.includes(m.key)&&(v(),m.preventDefault())})})})});qC.displayName=HC;var WC="SelectValue",VC=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:s,placeholder:i="",...o}=e,l=Hi(WC,r),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,d=Tt(t,l.onValueNodeChange);return Ur(()=>{u(f)},[u,f]),c.jsx(Ze.span,{...o,ref:d,style:{pointerEvents:"none"},children:h4(l.value)?c.jsx(c.Fragment,{children:i}):s})});VC.displayName=WC;var A$="SelectIcon",GC=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return c.jsx(Ze.span,{"aria-hidden":!0,...a,ref:t,children:n||"▼"})});GC.displayName=A$;var C$="SelectPortal",KC=e=>c.jsx(Lf,{asChild:!0,...e});KC.displayName=C$;var Io="SelectContent",YC=S.forwardRef((e,t)=>{const r=Hi(Io,e.__scopeSelect),[n,a]=S.useState();if(Ur(()=>{a(new DocumentFragment)},[]),!r.open){const s=n;return s?$i.createPortal(c.jsx(XC,{scope:e.__scopeSelect,children:c.jsx(gp.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(JC,{...e,ref:t})});YC.displayName=Io;var va=10,[XC,qi]=kc(Io),P$="SelectContentImpl",O$=m$("SelectContent.RemoveScroll"),JC=S.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:s,onPointerDownOutside:i,side:o,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:m,avoidCollisions:g,...x}=e,y=Hi(Io,r),[w,b]=S.useState(null),[_,T]=S.useState(null),E=Tt(t,H=>b(H)),[C,P]=S.useState(null),[N,k]=S.useState(null),A=vp(r),[I,M]=S.useState(!1),U=S.useRef(!1);S.useEffect(()=>{if(w)return zy(w)},[w]),$y();const W=S.useCallback(H=>{const[Z,...X]=A().map(V=>V.ref.current),[ne]=X.slice(-1),he=document.activeElement;for(const V of H)if(V===he||(V==null||V.scrollIntoView({block:"nearest"}),V===Z&&_&&(_.scrollTop=0),V===ne&&_&&(_.scrollTop=_.scrollHeight),V==null||V.focus(),document.activeElement!==he))return},[A,_]),G=S.useCallback(()=>W([C,w]),[W,C,w]);S.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:Q,triggerPointerDownPosRef:R}=y;S.useEffect(()=>{if(w){let H={x:0,y:0};const Z=ne=>{var he,V;H={x:Math.abs(Math.round(ne.pageX)-(((he=R.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((V=R.current)==null?void 0:V.y)??0))}},X=ne=>{H.x<=10&&H.y<=10?ne.preventDefault():w.contains(ne.target)||Q(!1),document.removeEventListener("pointermove",Z),R.current=null};return R.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",X,{capture:!0})}}},[w,Q,R]),S.useEffect(()=>{const H=()=>Q(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[Q]);const[z,D]=p4(H=>{const Z=A().filter(he=>!he.disabled),X=Z.find(he=>he.ref.current===document.activeElement),ne=m4(Z,H,X);ne&&setTimeout(()=>ne.ref.current.focus())}),O=S.useCallback((H,Z,X)=>{const ne=!U.current&&!X;(y.value!==void 0&&y.value===Z||ne)&&(P(H),ne&&(U.current=!0))},[y.value]),j=S.useCallback(()=>w==null?void 0:w.focus(),[w]),B=S.useCallback((H,Z,X)=>{const ne=!U.current&&!X;(y.value!==void 0&&y.value===Z||ne)&&k(H)},[y.value]),L=n==="popper"?qv:QC,F=L===qv?{side:o,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:m,avoidCollisions:g}:{};return c.jsx(XC,{scope:r,content:w,viewport:_,onViewportChange:T,itemRefCallback:O,selectedItem:C,onItemLeave:j,itemTextRefCallback:B,focusSelectedItem:G,selectedItemText:N,position:n,isPositioned:I,searchRef:z,children:c.jsx(cp,{as:O$,allowPinchZoom:!0,children:c.jsx(ip,{asChild:!0,trapped:y.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:Pe(a,H=>{var Z;(Z=y.trigger)==null||Z.focus({preventScroll:!0}),H.preventDefault()}),children:c.jsx(xc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:c.jsx(L,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:H=>H.preventDefault(),...x,...F,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Pe(x.onKeyDown,H=>{const Z=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!Z&&H.key.length===1&&D(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let ne=A().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(H.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const he=H.target,V=ne.indexOf(he);ne=ne.slice(V+1)}setTimeout(()=>W(ne)),H.preventDefault()}})})})})})})});JC.displayName=P$;var j$="SelectItemAlignedPosition",QC=S.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,s=Hi(Io,r),i=qi(Io,r),[o,l]=S.useState(null),[u,f]=S.useState(null),d=Tt(t,E=>f(E)),h=vp(r),p=S.useRef(!1),v=S.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=i,w=S.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&m&&g&&x){const E=s.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),P=s.valueNode.getBoundingClientRect(),N=x.getBoundingClientRect();if(s.dir!=="rtl"){const he=N.left-C.left,V=P.left-he,Te=E.left-V,Ee=E.width+Te,xe=Math.max(Ee,C.width),Se=window.innerWidth-va,pe=P_(V,[va,Math.max(va,Se-xe)]);o.style.minWidth=Ee+"px",o.style.left=pe+"px"}else{const he=C.right-N.right,V=window.innerWidth-P.right-he,Te=window.innerWidth-E.right-V,Ee=E.width+Te,xe=Math.max(Ee,C.width),Se=window.innerWidth-va,pe=P_(V,[va,Math.max(va,Se-xe)]);o.style.minWidth=Ee+"px",o.style.right=pe+"px"}const k=h(),A=window.innerHeight-va*2,I=m.scrollHeight,M=window.getComputedStyle(u),U=parseInt(M.borderTopWidth,10),W=parseInt(M.paddingTop,10),G=parseInt(M.borderBottomWidth,10),Q=parseInt(M.paddingBottom,10),R=U+W+I+Q+G,z=Math.min(g.offsetHeight*5,R),D=window.getComputedStyle(m),O=parseInt(D.paddingTop,10),j=parseInt(D.paddingBottom,10),B=E.top+E.height/2-va,L=A-B,F=g.offsetHeight/2,H=g.offsetTop+F,Z=U+W+H,X=R-Z;if(Z<=B){const he=k.length>0&&g===k[k.length-1].ref.current;o.style.bottom="0px";const V=u.clientHeight-m.offsetTop-m.offsetHeight,Te=Math.max(L,F+(he?j:0)+V+G),Ee=Z+Te;o.style.height=Ee+"px"}else{const he=k.length>0&&g===k[0].ref.current;o.style.top="0px";const Te=Math.max(B,U+m.offsetTop+(he?O:0)+F)+X;o.style.height=Te+"px",m.scrollTop=Z-B+m.offsetTop}o.style.margin=`${va}px 0`,o.style.minHeight=z+"px",o.style.maxHeight=A+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,s.trigger,s.valueNode,o,u,m,g,x,s.dir,n]);Ur(()=>w(),[w]);const[b,_]=S.useState();Ur(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const T=S.useCallback(E=>{E&&v.current===!0&&(w(),y==null||y(),v.current=!1)},[w,y]);return c.jsx(I$,{scope:r,contentWrapper:o,shouldExpandOnScrollRef:p,onScrollButtonChange:T,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:c.jsx(Ze.div,{...a,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});QC.displayName=j$;var R$="SelectPopperPosition",qv=S.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=va,...s}=e,i=xp(r);return c.jsx(Cy,{...i,...s,ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qv.displayName=R$;var[I$,u1]=kc(Io,{}),Wv="SelectViewport",ZC=S.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,s=qi(Wv,r),i=u1(Wv,r),o=Tt(t,s.onViewportChange),l=S.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(gp.Slot,{scope:r,children:c.jsx(Ze.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Pe(a.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const p=Math.abs(l.current-f.scrollTop);if(p>0){const v=window.innerHeight-va*2,m=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),x=Math.max(m,g);if(x<v){const y=x+p,w=Math.min(v,y),b=y-w;d.style.height=w+"px",d.style.bottom==="0px"&&(f.scrollTop=b>0?b:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});ZC.displayName=Wv;var e4="SelectGroup",[F$,D$]=kc(e4),M$=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Oa();return c.jsx(F$,{scope:r,id:a,children:c.jsx(Ze.div,{role:"group","aria-labelledby":a,...n,ref:t})})});M$.displayName=e4;var t4="SelectLabel",r4=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=D$(t4,r);return c.jsx(Ze.div,{id:a.id,...n,ref:t})});r4.displayName=t4;var f0="SelectItem",[L$,n4]=kc(f0),a4=S.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:s,...i}=e,o=Hi(f0,r),l=qi(f0,r),u=o.value===n,[f,d]=S.useState(s??""),[h,p]=S.useState(!1),v=Tt(t,y=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,y,n,a)}),m=Oa(),g=S.useRef("touch"),x=()=>{a||(o.onValueChange(n),o.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(L$,{scope:r,value:n,disabled:a,textId:m,isSelected:u,onItemTextChange:S.useCallback(y=>{d(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:c.jsx(gp.ItemSlot,{scope:r,value:n,disabled:a,textValue:f,children:c.jsx(Ze.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:v,onFocus:Pe(i.onFocus,()=>p(!0)),onBlur:Pe(i.onBlur,()=>p(!1)),onClick:Pe(i.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:Pe(i.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:Pe(i.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:Pe(i.onPointerMove,y=>{var w;g.current=y.pointerType,a?(w=l.onItemLeave)==null||w.call(l):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(i.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:Pe(i.onKeyDown,y=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&y.key===" "||(E$.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});a4.displayName=f0;var du="SelectItemText",s4=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...s}=e,i=Hi(du,r),o=qi(du,r),l=n4(du,r),u=N$(du,r),[f,d]=S.useState(null),h=Tt(t,x=>d(x),l.onItemTextChange,x=>{var y;return(y=o.itemTextRefCallback)==null?void 0:y.call(o,x,l.value,l.disabled)}),p=f==null?void 0:f.textContent,v=S.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Ur(()=>(m(v),()=>g(v)),[m,g,v]),c.jsxs(c.Fragment,{children:[c.jsx(Ze.span,{id:l.textId,...s,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?$i.createPortal(s.children,i.valueNode):null]})});s4.displayName=du;var i4="SelectItemIndicator",o4=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return n4(i4,r).isSelected?c.jsx(Ze.span,{"aria-hidden":!0,...n,ref:t}):null});o4.displayName=i4;var Vv="SelectScrollUpButton",l4=S.forwardRef((e,t)=>{const r=qi(Vv,e.__scopeSelect),n=u1(Vv,e.__scopeSelect),[a,s]=S.useState(!1),i=Tt(t,n.onScrollButtonChange);return Ur(()=>{if(r.viewport&&r.isPositioned){let o=function(){const u=l.scrollTop>0;s(u)};const l=r.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[r.viewport,r.isPositioned]),a?c.jsx(u4,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=r;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});l4.displayName=Vv;var Gv="SelectScrollDownButton",c4=S.forwardRef((e,t)=>{const r=qi(Gv,e.__scopeSelect),n=u1(Gv,e.__scopeSelect),[a,s]=S.useState(!1),i=Tt(t,n.onScrollButtonChange);return Ur(()=>{if(r.viewport&&r.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=r.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[r.viewport,r.isPositioned]),a?c.jsx(u4,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=r;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});c4.displayName=Gv;var u4=S.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,s=qi("SelectScrollButton",r),i=S.useRef(null),o=vp(r),l=S.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return S.useEffect(()=>()=>l(),[l]),Ur(()=>{var f;const u=o().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),c.jsx(Ze.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Pe(a.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:Pe(a.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:Pe(a.onPointerLeave,()=>{l()})})}),B$="SelectSeparator",f4=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(Ze.div,{"aria-hidden":!0,...n,ref:t})});f4.displayName=B$;var Kv="SelectArrow",U$=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=xp(r),s=Hi(Kv,r),i=qi(Kv,r);return s.open&&i.position==="popper"?c.jsx(Py,{...a,...n,ref:t}):null});U$.displayName=Kv;var $$="SelectBubbleInput",d4=S.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const a=S.useRef(null),s=Tt(n,a),i=b$(t);return S.useEffect(()=>{const o=a.current;if(!o)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const d=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(d)}},[i,t]),c.jsx(Ze.select,{...r,style:{...QT,...r.style},ref:s,defaultValue:t})});d4.displayName=$$;function h4(e){return e===""||e===void 0}function p4(e){const t=On(e),r=S.useRef(""),n=S.useRef(0),a=S.useCallback(i=>{const o=r.current+i;t(o),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),s=S.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,s]}function m4(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=z$(e,Math.max(s,0));a.length===1&&(i=i.filter(u=>u!==r));const l=i.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return l!==r?l:void 0}function z$(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var H$=zC,g4=qC,q$=VC,W$=GC,V$=KC,v4=YC,G$=ZC,x4=r4,y4=a4,K$=s4,Y$=o4,w4=l4,b4=c4,_4=f4;const kn=H$,Nn=q$,ln=S.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(g4,{ref:n,className:je("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,c.jsx(W$,{asChild:!0,children:c.jsx(my,{className:"h-4 w-4 opacity-50"})})]}));ln.displayName=g4.displayName;const E4=S.forwardRef(({className:e,...t},r)=>c.jsx(w4,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(YI,{className:"h-4 w-4"})}));E4.displayName=w4.displayName;const S4=S.forwardRef(({className:e,...t},r)=>c.jsx(b4,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(my,{className:"h-4 w-4"})}));S4.displayName=b4.displayName;const cn=S.forwardRef(({className:e,children:t,position:r="popper",...n},a)=>c.jsx(V$,{children:c.jsxs(v4,{ref:a,className:je("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[c.jsx(E4,{}),c.jsx(G$,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(S4,{})]})}));cn.displayName=v4.displayName;const X$=S.forwardRef(({className:e,...t},r)=>c.jsx(x4,{ref:r,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));X$.displayName=x4.displayName;const Qe=S.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(y4,{ref:n,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Y$,{children:c.jsx(bk,{className:"h-4 w-4"})})}),c.jsx(K$,{children:t})]}));Qe.displayName=y4.displayName;const J$=S.forwardRef(({className:e,...t},r)=>c.jsx(_4,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));J$.displayName=_4.displayName;function Q$(){const[e,t]=S.useState([]),[r,n]=S.useState(!1),[a,s]=S.useState("5"),{toast:i}=Is();S.useEffect(()=>{let u=!0;return(async()=>{try{const d=await ni.getHomeLatest(3);if(!u)return;t(d.map(h=>({id:h.id,name:h.author_name,rating:h.rating||5,text:h.content,date:new Date(h.created_at).toISOString().split("T")[0]})))}catch(d){console.error("❌ Failed to load home comments:",d)}})(),()=>{u=!1}},[]);const o=async u=>{u.preventDefault(),n(!0);const f=new FormData(u.currentTarget);try{const d=f.get("name")||"",h=f.get("email")||"",p=f.get("phone")||"",v=f.get("comment")||"";await ni.createHomeComment({authorName:d,authorEmail:h||void 0,authorPhone:p||void 0,rating:Number(a)||5,content:v});const m=await ni.getHomeLatest(3);t(m.map(g=>({id:g.id,name:g.author_name,rating:g.rating||5,text:g.content,date:new Date(g.created_at).toISOString().split("T")[0]}))),u.target.reset(),s("5"),i({title:"Comment submitted!",description:"Thank you for your feedback."})}catch(d){console.error("❌ Failed to submit home comment:",d);const h=d instanceof Error?d.message:"Failed to submit comment.";i({title:"Error",description:h,variant:"destructive"})}finally{n(!1)}},l=u=>Array.from({length:5}).map((f,d)=>c.jsx(kk,{className:je("w-4 h-4",d<u?"text-yellow-500 fill-yellow-500":"text-muted")},d));return c.jsx("section",{className:"py-12 md:py-16 bg-green-50/30",children:c.jsx("div",{className:"section-container",children:c.jsxs("div",{className:"max-w-7xl mx-auto",children:[c.jsx("div",{className:"text-center mb-8",children:c.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Have a gardening question or want to share your own tips? This is where our community discusses plant care, solves problems, and helps each other grow better gardens."})}),c.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold text-foreground mb-8 text-center",children:"Community Questions & Answers"}),c.jsxs("form",{onSubmit:o,className:"space-y-4 mb-12 p-6 bg-card rounded-xl border border-border w-full",children:[c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"name",children:"Name"}),c.jsx(Be,{id:"name",name:"name",placeholder:"Your name",required:!0,className:"focus-ring"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"email",children:"Email"}),c.jsx(Be,{id:"email",name:"email",type:"email",placeholder:"you@example.com",className:"focus-ring"})]})]}),c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"phone",children:"Phone (optional)"}),c.jsx(Be,{id:"phone",name:"phone",type:"tel",placeholder:"Your phone number",className:"focus-ring"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"rating",children:"Rating"}),c.jsxs(kn,{value:a,onValueChange:s,children:[c.jsx(ln,{id:"rating",className:"focus-ring",children:c.jsx(Nn,{placeholder:"Select rating"})}),c.jsxs(cn,{className:"bg-popover border border-border z-[100]",children:[c.jsx(Qe,{value:"5",children:"★★★★★ (5 stars)"}),c.jsx(Qe,{value:"4",children:"★★★★☆ (4 stars)"}),c.jsx(Qe,{value:"3",children:"★★★☆☆ (3 stars)"}),c.jsx(Qe,{value:"2",children:"★★☆☆☆ (2 stars)"}),c.jsx(Qe,{value:"1",children:"★☆☆☆☆ (1 star)"})]})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"comment",children:"Comment"}),c.jsx(ws,{id:"comment",name:"comment",placeholder:"Share your feedback...",rows:4,required:!0,className:"focus-ring resize-none"})]}),c.jsx(be,{type:"submit",disabled:r,className:"w-full sm:w-auto",children:r?"Submitting...":c.jsxs(c.Fragment,{children:[c.jsx(K0,{className:"w-4 h-4 mr-2"}),"Submit Comment"]})})]}),c.jsx("div",{className:"space-y-4 w-full",children:e.map(u=>c.jsx("article",{className:"p-4 bg-card rounded-lg border border-border animate-fade-in",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:c.jsx(Ak,{className:"w-5 h-5 text-primary"})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[c.jsx("h4",{className:"font-semibold text-foreground",children:u.name}),c.jsx("time",{className:"text-xs text-muted-foreground",children:u.date})]}),c.jsx("div",{className:"flex items-center gap-0.5 my-1",children:l(u.rating)}),c.jsx("p",{className:"text-muted-foreground text-sm",children:u.text})]})]})},u.id))})]})})})}function hn(){const[e,t]=S.useState(!1);S.useEffect(()=>{const n=()=>{t(window.scrollY>400)};return window.addEventListener("scroll",n),()=>window.removeEventListener("scroll",n)},[]);const r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return c.jsx(be,{variant:"outline",size:"icon",onClick:r,className:je("fixed bottom-6 right-6 z-50 rounded-full shadow-lg transition-all duration-300 bg-card hover:bg-primary hover:text-primary-foreground",e?"opacity-100 translate-y-0":"opacity-0 translate-y-4 pointer-events-none"),"aria-label":"Back to top",children:c.jsx(KI,{className:"w-5 h-5"})})}const Z$=()=>c.jsxs("div",{className:"min-h-screen flex flex-col",children:[c.jsx(gr,{}),c.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"Organization",name:"Perfect Gardener",url:"https://perfectgardener.netlify.app",logo:"https://perfectgardener.netlify.app/assets/images/Avtar.png",description:"Perfect Gardener is a website where home gardeners learn how to grow better plants using simple, practical advice.",sameAs:["https://www.youtube.com/@perfect.gardener"]})}}),c.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"WebSite",name:"Perfect Gardener",url:"https://perfectgardener.netlify.app",description:"Practical gardening tips and plant care guides for home gardeners.",publisher:{"@type":"Organization",name:"Perfect Gardener"},potentialAction:{"@type":"SearchAction",target:"https://perfectgardener.netlify.app/search?q={search_term_string}","query-input":"required name=search_term_string"}})}}),c.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"VideoObject",name:"Perfect Gardener YouTube Channel",description:"Gardening videos showing plant care, garden tips, and practical gardening advice.",thumbnailUrl:"https://img.youtube.com/vi/ds2Ozajh5zs/maxresdefault.jpg",uploadDate:"2024-01-01",duration:"PT10M",embedUrl:"https://www.youtube.com/embed/ds2Ozajh5zs",interactionStatistic:{"@type":"InteractionCounter",interactionType:"https://schema.org/WatchAction",userInteractionCount:1e3}})}}),c.jsxs("main",{id:"main-content",className:"flex-1",children:[c.jsx(HB,{}),c.jsx(ZU,{limit:5}),c.jsx(i$,{limit:3}),c.jsx(c$,{}),c.jsx(u$,{}),c.jsx(Q$,{})]}),c.jsx(vr,{}),c.jsx(hn,{})]}),ez=()=>{const e=Sc();return S.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{id:"main-content",className:"flex-1 pt-20 pb-16",children:c.jsx("section",{className:"py-20 md:py-32",children:c.jsx("div",{className:"section-container",children:c.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[c.jsx("h1",{className:"text-8xl md:text-9xl font-display font-bold text-primary mb-4",children:"404"}),c.jsx("h2",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-6",children:"Oops! Page Not Found"}),c.jsx("p",{className:"text-lg md:text-xl text-muted-foreground mb-8 max-w-lg mx-auto",children:"Sorry, the page you're looking for doesn't exist or has been moved. Let's get you back on track!"}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[c.jsx(be,{asChild:!0,size:"lg",className:"text-lg px-8 py-6",children:c.jsxs(vt,{to:"/",className:"flex items-center gap-2",children:[c.jsx(Sk,{className:"w-5 h-5"}),"Back to Home"]})}),c.jsx(be,{asChild:!0,variant:"outline",size:"lg",className:"text-lg px-8 py-6",children:c.jsxs(vt,{to:"/contact",className:"flex items-center gap-2",children:[c.jsx(Kh,{className:"w-5 h-5"}),"Report This Page"]})})]})]})})})}),c.jsx(vr,{}),c.jsx(hn,{})]})};function Yf({title:e,description:t,keywords:r,image:n,url:a,type:s="website",author:i,publishedTime:o,modifiedTime:l,category:u}){const f="Perfect Gardener",d="https://perfectgardener.netlify.app",h=`${d}/assets/images/og-image.jpg`,p="Perfect Gardener - Practical gardening tips and plant care guides. Learn how to grow healthy plants at home with easy-to-follow advice from an experienced gardener.",v=e?`${e} — ${f}`:`${f} - Gardening Tips & Plant Care`,m=t||p,g=n||h,x=a||d,y=r||"gardening tips, plant care, home gardening, organic gardening, garden tools, vegetable gardening, flower planting, plant care guide, gardening for beginners, Indian gardening";return S.useEffect(()=>{document.title=v;const w=(_,T,E="name")=>{let C=document.querySelector(`meta[${E}="${_}"]`);C||(C=document.createElement("meta"),C.setAttribute(E,_),document.head.appendChild(C)),C.setAttribute("content",T)};w("description",m),w("keywords",y),w("author",i||"Perfect Gardener");let b=document.querySelector("link[rel='canonical']");if(b||(b=document.createElement("link"),b.setAttribute("rel","canonical"),document.head.appendChild(b)),b.setAttribute("href",x),w("og:title",v,"property"),w("og:description",m,"property"),w("og:type",s,"property"),w("og:url",x,"property"),w("og:image",g,"property"),w("og:site_name",f,"property"),w("twitter:card","summary_large_image"),w("twitter:title",v),w("twitter:description",m),w("twitter:image",g),w("twitter:creator","@perfect_gardener"),s==="article"&&(i&&w("article:author",i,"property"),o&&w("article:published_time",o,"property"),l&&w("article:modified_time",l,"property"),u&&w("article:section",u,"property")),s==="article"&&e&&t){let _=document.querySelector('script[type="application/ld+json"][data-seo="article"]');_||(_=document.createElement("script"),_.setAttribute("type","application/ld+json"),_.setAttribute("data-seo","article"),document.head.appendChild(_));const T={"@context":"https://schema.org","@type":"BlogPosting",headline:e,description:m,image:g,author:{"@type":"Person",name:i||"Shubham Jakhmola"},publisher:{"@type":"Organization",name:f,logo:{"@type":"ImageObject",url:`${d}/assets/images/Avtar.png`}},datePublished:o||new Date().toISOString(),dateModified:l||new Date().toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":x}};_.textContent=JSON.stringify(T)}return()=>{}},[v,m,y,g,x,s,i,o,l,u]),null}const tz=[{icon:"🌸",title:"Seasonal Flower Planting Calendar",description:"Find the perfect flowers to plant each month in your region of India and get detailed planting guidance.",href:"/tools/flower-calendar"},{icon:"⚱️🛠️",title:"Pot Size Calculator",description:"Calculate the ideal pot size for your plants and estimate soil requirements to avoid root issues.",href:"/tools/pot-calculator"},{icon:"🌺",title:"Flower Bloom Time Calculator",description:"Predict when your flowers will bloom based on your sowing time and flower type.",href:"/tools/bloom-calculator"},{icon:"💰",title:"Gardening Budget Planner",description:"Plan your gardening budget and estimate costs for soil, seeds, fertilizers, and more.",href:"/tools/budget-planner"}],rz=()=>c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(Yf,{title:"Free Gardening Tools & Calculators",description:"Free online gardening tools and calculators: flower bloom time calculator, pot size calculator, budget planner, and seasonal planting calendar. Plan and manage your garden with these helpful tools.",keywords:"gardening tools, garden calculators, plant calculator, gardening tools online, free gardening tools, garden planning tools, plant care calculator, gardening helper tools",url:"https://perfectgardener.netlify.app/tools"}),c.jsx(gr,{}),c.jsxs("main",{id:"main-content",className:"pt-20",children:[c.jsx("section",{className:"py-12 md:py-16 text-center bg-gradient-to-br from-primary/10 to-accent/5 border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsx("h1",{className:"text-3xl md:text-5xl font-display font-bold text-foreground mb-3",children:"Free Gardening Tools"}),c.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:"Whether you're a beginner or an experienced gardener, everything you need to plan, calculate, and optimize your home garden"})]})}),c.jsx("section",{className:"py-12 md:py-16",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:tz.map(e=>c.jsxs(vt,{to:e.href,className:"group bg-card border border-border rounded-xl p-6 text-center flex flex-col gap-3 transition-all duration-300 hover:shadow-elegant hover:-translate-y-1 hover:border-primary",children:[c.jsx("div",{className:"text-5xl",children:e.icon}),c.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-primary transition-colors",children:e.title}),c.jsx("p",{className:"text-sm text-muted-foreground flex-grow",children:e.description}),c.jsx("span",{className:"mt-auto inline-flex items-center justify-center gap-2 text-primary font-medium",children:"Open Tool →"})]},e.href))})})}),c.jsx("section",{className:"py-12 md:py-16 bg-muted/30",children:c.jsxs("div",{className:"container mx-auto px-4 text-center",children:[c.jsx("h2",{className:"text-2xl md:text-3xl font-display font-bold text-foreground mb-4",children:"Ready to Grow?"}),c.jsx("p",{className:"text-muted-foreground mb-6",children:"Start with any tool above to optimize your gardening experience."}),c.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[c.jsx(vt,{to:"/",className:"btn-ghost px-6 py-3 rounded-lg border border-border hover:bg-muted transition-colors",children:"Back to Home"}),c.jsx(vt,{to:"/products",className:"bg-primary text-primary-foreground px-6 py-3 rounded-lg font-medium hover:bg-primary/90 transition-colors",children:"Browse Products"})]})]})})]}),c.jsx(vr,{}),c.jsx(hn,{})]}),nz=Uf("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),yp=S.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:je(nz({variant:t}),e),...r}));yp.displayName="Alert";const az=S.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:je("mb-1 font-medium leading-none tracking-tight",e),...t}));az.displayName="AlertTitle";const wp=S.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:je("text-sm [&_p]:leading-relaxed",e),...t}));wp.displayName="AlertDescription";function sz(e,t){const r=e.length,n=t.length,a=Array(r+1).fill(null).map(()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)a[s][0]=s;for(let s=0;s<=n;s++)a[0][s]=s;for(let s=1;s<=r;s++)for(let i=1;i<=n;i++)e[s-1]===t[i-1]?a[s][i]=a[s-1][i-1]:a[s][i]=Math.min(a[s-1][i]+1,a[s][i-1]+1,a[s-1][i-1]+1);return a[r][n]}function iz(e,t){const r=Math.max(e.length,t.length);return r===0?1:1-sz(e.toLowerCase(),t.toLowerCase())/r}function ph(e,t,r=.6){if(!e||e.trim().length===0)return{match:null,similarity:0};const n=e.toLowerCase().trim(),a=t.find(l=>l.toLowerCase()===n);if(a)return{match:a,similarity:1};const s=t.find(l=>l.toLowerCase().includes(n)||n.includes(l.toLowerCase()));if(s)return{match:s,similarity:.8};let i=null,o=0;for(const l of t){const u=iz(n,l.toLowerCase());u>o&&u>=r&&(o=u,i=l)}return{match:i,similarity:o}}function T4(e,t,r,n=.5){if(!t||t.trim().length===0)return{filtered:e,suggestedTerm:null};const a=t.toLowerCase().trim(),s=e.map(d=>r(d)),i=Array.from(new Set(s)),{match:o,similarity:l}=ph(t,i,n);let u,f=null;return o&&l>=n&&l<1?(u=e.filter(d=>r(d).toLowerCase().includes(o.toLowerCase())),f=o):u=e.filter(d=>r(d).toLowerCase().includes(a)),{filtered:u,suggestedTerm:f}}const oz=()=>{const[e,t]=S.useState(""),[r,n]=S.useState("All"),[a,s]=S.useState(!1),{items:i,isLoading:o,isFetching:l,isFetchingNextPage:u,hasNextPage:f,loadMore:d}=c1({queryKey:["products"],fetchFunction:fu.getAll,initialLimit:20,preloadLimit:10,enabled:!0}),{ref:h,inView:p}=BC();S.useEffect(()=>{p&&f&&!u&&!l&&d()},[p,f,u,l,d]);const v=S.useMemo(()=>i||[],[i]),m=S.useMemo(()=>v.map(E=>({id:E.id,name:E.name,price:E.price,image:E.images&&E.images.length>0?E.images[0]:E.image||"",images:E.images&&E.images.length>0?E.images:E.image?[E.image]:[],link:E.link||"",category:E.category||"Uncategorized",description:E.description||"",source:E.source,subCategory:E.subCategory})),[v]),g=S.useMemo(()=>["All",...Array.from(new Set(v.map(C=>C.category).filter(C=>typeof C=="string"&&C.trim().length>0)))],[v]),x=S.useMemo(()=>{const E=m.filter(N=>r==="All"||N.category===r);if(!e.trim())return{filtered:E,suggestedTerm:null};const{filtered:C,suggestedTerm:P}=T4(E,e,N=>`${N.name} ${N.description||""}`,.5);return{filtered:C,suggestedTerm:P}},[m,e,r]),y=x.filtered,w=x.suggestedTerm,b=!!(w&&w.toLowerCase()!==e.toLowerCase()),_=()=>{t(""),n("All")},T=e||r!=="All";return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(gr,{}),c.jsxs("main",{id:"main-content",className:"pt-20",children:[c.jsx("section",{className:"py-8 md:py-12 bg-gradient-to-br from-primary/10 to-accent/5 border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"Gardening Products"}),c.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Curated selection of premium gardening products. Everything you need to grow a beautiful garden."})]})}),c.jsx("section",{className:"py-6 bg-muted/30 border-b border-border sticky top-16 z-40",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-start md:items-center",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(Tk,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),c.jsx(Be,{type:"text",placeholder:"Search products...",value:e,onChange:E=>t(E.target.value),className:"pl-10 bg-background"}),b&&w&&c.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 z-50",children:c.jsxs(yp,{className:"bg-primary/10 border-primary/20",children:[c.jsx(vy,{className:"w-4 h-4 text-primary"}),c.jsxs(wp,{className:"text-sm",children:["Did you mean ",c.jsx("strong",{children:w}),"?"," ",c.jsx(be,{variant:"link",className:"h-auto p-0 text-primary underline",onClick:()=>{t(w)},children:"Use this instead"})]})]})})]}),c.jsxs(be,{variant:"outline",className:"md:hidden",onClick:()=>s(!a),children:[c.jsx(Ek,{className:"w-4 h-4 mr-2"}),"Filters"]}),c.jsx("div",{className:"hidden md:flex flex-wrap gap-2",children:g.map(E=>c.jsx(be,{variant:r===E?"default":"outline",size:"sm",onClick:()=>n(E),children:E},E))}),T&&c.jsxs(be,{variant:"ghost",size:"sm",onClick:_,children:[c.jsx(Ri,{className:"w-4 h-4 mr-1"}),"Clear"]})]}),a&&c.jsx("div",{className:"md:hidden mt-4 flex flex-wrap gap-2",children:g.map(E=>c.jsx(be,{variant:r===E?"default":"outline",size:"sm",onClick:()=>{n(E),s(!1)},children:E},E))})]})}),c.jsx("section",{className:"py-4",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",y.length," product",y.length!==1?"s":"",u&&c.jsx("span",{children:" (loading more...)"})]}),T&&c.jsxs("div",{className:"flex items-center gap-2",children:[r!=="All"&&c.jsx(Es,{variant:"secondary",children:r}),e&&c.jsxs(Es,{variant:"secondary",children:['"',e,'"']})]})]})})}),c.jsx("section",{className:"py-6 pb-16",children:c.jsx("div",{className:"container mx-auto px-4",children:o?c.jsx(Ov,{count:20}):y.length>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 sm:gap-4 md:gap-6",children:y.map((E,C)=>c.jsx(bC,{product:E,index:C},E.id))}),f&&!u&&c.jsx("div",{ref:h,className:"flex justify-center py-8",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading more products..."})}),u&&c.jsx("div",{className:"flex justify-center py-8",children:c.jsx(Ov,{count:4})})]}):c.jsxs("div",{className:"text-center py-16 bg-muted/50 rounded-xl",children:[c.jsx("p",{className:"text-xl font-medium text-foreground mb-2",children:"No products found"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:"Try adjusting your search or filter criteria"}),c.jsx(be,{variant:"outline",onClick:_,children:"Clear all filters"})]})})})]}),c.jsx(vr,{}),c.jsx(hn,{})]})},lz=e=>new Date(e).toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),cz=()=>{const[e,t]=S.useState(!0),[r,n]=S.useState(""),[a,s]=S.useState("All"),[i,o]=S.useState(!1),[l,u]=S.useState([]),[f,d]=S.useState(null),[h,p]=S.useState(!1);S.useEffect(()=>{let b=!1;const _=async()=>{try{t(!0);const C=((await Zs.getAll(1,1e3)).data||[]).map(P=>({id:String(P.id),title:String(P.title||""),excerpt:String(P.excerpt||""),content:String(P.content||""),date:String(P.date||new Date().toISOString().split("T")[0]),readTime:String(P.readTime||P.read_time||"5 min read"),category:String(P.category||"Uncategorized"),author:String(P.author||"Perfect Gardener"),image:P.image||void 0,featured:!!P.featured,slug:P.slug||void 0}));b||u(C)}catch{b||u([])}finally{b||t(!1)}};_();const T=setInterval(_,3e5);return()=>{b=!0,clearInterval(T)}},[]);const v=S.useMemo(()=>["All",...Array.from(new Set(l.map(b=>b.category).filter(Boolean)))],[l]),m=S.useMemo(()=>{const b=l.filter(E=>a==="All"||E.category===a);if(!r.trim())return d(null),p(!1),b;const{filtered:_,suggestedTerm:T}=T4(b,r,E=>`${E.title} ${E.excerpt||""}`,.5);return d(T),p(!!(T&&T.toLowerCase()!==r.toLowerCase())),_},[l,r,a]),g=m.filter(b=>b.featured),x=m.filter(b=>!b.featured),y=r||a!=="All",w=()=>{n(""),s("All")};return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(gr,{}),c.jsxs("main",{id:"main-content",className:"pt-20",children:[c.jsx("section",{className:"py-8 md:py-12 bg-gradient-to-br from-primary/10 to-accent/5 border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"Gardening Blog"}),c.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Tips, guides, and insights to help you grow a beautiful garden."})]})}),c.jsx("section",{className:"py-6 bg-muted/30 border-b border-border sticky top-16 z-40",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-start md:items-center",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(Tk,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),c.jsx(Be,{type:"text",placeholder:"Search articles...",value:r,onChange:b=>n(b.target.value),className:"pl-10 bg-background"}),h&&f&&c.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 z-50",children:c.jsxs(yp,{className:"bg-primary/10 border-primary/20",children:[c.jsx(vy,{className:"w-4 h-4 text-primary"}),c.jsxs(wp,{className:"text-sm",children:["Did you mean ",c.jsx("strong",{children:f}),"?"," ",c.jsx(be,{variant:"link",className:"h-auto p-0 text-primary underline",onClick:()=>{n(f),p(!1)},children:"Use this instead"})]})]})})]}),c.jsxs(be,{variant:"outline",className:"md:hidden",onClick:()=>o(!i),children:[c.jsx(Ek,{className:"w-4 h-4 mr-2"}),"Categories"]}),c.jsx("div",{className:"hidden md:flex flex-wrap gap-2",children:v.map(b=>c.jsx(be,{variant:a===b?"default":"outline",size:"sm",onClick:()=>s(b),children:b},b))}),y&&c.jsxs(be,{variant:"ghost",size:"sm",onClick:w,children:[c.jsx(Ri,{className:"w-4 h-4 mr-1"}),"Clear"]})]}),i&&c.jsx("div",{className:"md:hidden mt-4 flex flex-wrap gap-2",children:v.map(b=>c.jsx(be,{variant:a===b?"default":"outline",size:"sm",onClick:()=>{s(b),o(!1)},children:b},b))})]})}),c.jsx("section",{className:"py-4",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",m.length," articles"]}),y&&c.jsxs("div",{className:"flex items-center gap-2",children:[a!=="All"&&c.jsx(Es,{variant:"secondary",children:a}),r&&c.jsxs(Es,{variant:"secondary",children:['"',r,'"']})]})]})})}),c.jsx("section",{className:"py-6 pb-16",children:c.jsx("div",{className:"container mx-auto px-4",children:e?c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4 md:gap-6",children:Array.from({length:6}).map((b,_)=>c.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 space-y-4",children:[c.jsx("div",{className:"h-6 bg-muted rounded animate-pulse w-3/4"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-2/3"})]}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/3"})]},_))}):m.length>0?c.jsxs("div",{className:"space-y-12",children:[g.length>0&&a==="All"&&!r&&c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-6 flex items-center gap-2",children:"⭐ Featured Articles"}),c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4 md:gap-6",children:g.map((b,_)=>c.jsx(O_,{post:b,index:_,featured:!0},b.id))})]}),c.jsxs("div",{children:[g.length>0&&a==="All"&&!r&&c.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-6",children:"All Articles"}),c.jsx("div",{className:"grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4 md:gap-6",children:(a==="All"&&!r?x:m).map((b,_)=>c.jsx(O_,{post:b,index:_},b.id))})]})]}):c.jsxs("div",{className:"text-center py-16 bg-muted/50 rounded-xl",children:[c.jsx("p",{className:"text-xl font-medium text-foreground mb-2",children:"No articles found"}),c.jsx("p",{className:"text-muted-foreground mb-4",children:"Try adjusting your search or filter criteria"}),c.jsx(be,{variant:"outline",onClick:w,children:"Clear all filters"})]})})}),c.jsx("section",{className:"py-12 bg-muted/30 border-t border-border",children:c.jsxs("div",{className:"container mx-auto px-4 text-center",children:[c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mb-3",children:"Ready to Start Gardening?"}),c.jsx("p",{className:"text-muted-foreground mb-6",children:"Check out our free gardening tools to plan your garden."}),c.jsx(be,{asChild:!0,size:"lg",children:c.jsxs(vt,{to:"/tools",className:"group",children:["Explore Tools",c.jsx($f,{className:"w-4 h-4 ml-2 transition-transform group-hover:translate-x-1"})]})})]})})]}),c.jsx(vr,{}),c.jsx(hn,{})]})},O_=({post:e,index:t,featured:r})=>{const n=e.slug?`/blog/${e.slug}`:"/posts";return c.jsx(vt,{to:n,children:c.jsxs("article",{className:je("group bg-card rounded-xl border overflow-hidden card-hover animate-fade-in flex flex-col cursor-pointer transition-all hover:shadow-lg",r?"border-primary/30":"border-border"),style:{animationDelay:`${t*100}ms`},children:[e.image&&c.jsxs("div",{className:"relative w-full aspect-video overflow-hidden bg-muted",children:[c.jsx("img",{src:e.image,alt:e.title,className:"w-full h-full object-contain block group-hover:scale-110 transition-transform duration-500",onError:a=>{a.target.style.display="none"}}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]}),c.jsxs("div",{className:"p-6 flex flex-col flex-grow",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx(Es,{variant:r?"default":"secondary",className:"text-xs",children:e.category}),r&&c.jsx("span",{className:"text-xs text-primary font-medium",children:"Featured"})]}),c.jsx("h3",{className:"font-display font-semibold text-lg text-foreground mb-3 line-clamp-2 group-hover:text-primary transition-colors",children:e.title}),c.jsx("p",{className:"text-muted-foreground text-sm mb-4 line-clamp-3 flex-grow",children:e.excerpt}),c.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground mt-auto pt-4 border-t border-border",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(py,{className:"w-3 h-3"}),lz(e.date)]}),c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(G0,{className:"w-3 h-3"}),e.readTime]})]})]})]})})};class Xf{constructor(t=0,r="Network Error"){this.status=t,this.text=r}}const uz=()=>{if(!(typeof localStorage>"u"))return{get:e=>Promise.resolve(localStorage.getItem(e)),set:(e,t)=>Promise.resolve(localStorage.setItem(e,t)),remove:e=>Promise.resolve(localStorage.removeItem(e))}},Ir={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:uz()},f1=e=>e?typeof e=="string"?{publicKey:e}:e.toString()==="[object Object]"?e:{}:{},fz=(e,t="https://api.emailjs.com")=>{if(!e)return;const r=f1(e);Ir.publicKey=r.publicKey,Ir.blockHeadless=r.blockHeadless,Ir.storageProvider=r.storageProvider,Ir.blockList=r.blockList,Ir.limitRate=r.limitRate,Ir.origin=r.origin||t},k4=async(e,t,r={})=>{const n=await fetch(Ir.origin+e,{method:"POST",headers:r,body:t}),a=await n.text(),s=new Xf(n.status,a);if(n.ok)return s;throw s},N4=(e,t,r)=>{if(!e||typeof e!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!t||typeof t!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!r||typeof r!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},dz=e=>{if(e&&e.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send/"},A4=e=>e.webdriver||!e.languages||e.languages.length===0,C4=()=>new Xf(451,"Unavailable For Headless Browser"),hz=(e,t)=>{if(!Array.isArray(e))throw"The BlockList list has to be an array";if(typeof t!="string")throw"The BlockList watchVariable has to be a string"},pz=e=>{var t;return!((t=e.list)!=null&&t.length)||!e.watchVariable},mz=(e,t)=>e instanceof FormData?e.get(t):e[t],P4=(e,t)=>{if(pz(e))return!1;hz(e.list,e.watchVariable);const r=mz(t,e.watchVariable);return typeof r!="string"?!1:e.list.includes(r)},O4=()=>new Xf(403,"Forbidden"),gz=(e,t)=>{if(typeof e!="number"||e<0)throw"The LimitRate throttle has to be a positive number";if(t&&typeof t!="string")throw"The LimitRate ID has to be a non-empty string"},vz=async(e,t,r)=>{const n=Number(await r.get(e)||0);return t-Date.now()+n},j4=async(e,t,r)=>{if(!t.throttle||!r)return!1;gz(t.throttle,t.id);const n=t.id||e;return await vz(n,t.throttle,r)>0?!0:(await r.set(n,Date.now().toString()),!1)},R4=()=>new Xf(429,"Too Many Requests"),xz=async(e,t,r,n)=>{const a=f1(n),s=a.publicKey||Ir.publicKey,i=a.blockHeadless||Ir.blockHeadless,o=a.storageProvider||Ir.storageProvider,l={...Ir.blockList,...a.blockList},u={...Ir.limitRate,...a.limitRate};return i&&A4(navigator)?Promise.reject(C4()):(N4(s,e,t),dz(r),r&&P4(l,r)?Promise.reject(O4()):await j4(location.pathname,u,o)?Promise.reject(R4()):k4("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:s,service_id:e,template_id:t,template_params:r}),{"Content-type":"application/json"}))},yz=e=>{if(!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of the form"},wz=e=>typeof e=="string"?document.querySelector(e):e,bz=async(e,t,r,n)=>{const a=f1(n),s=a.publicKey||Ir.publicKey,i=a.blockHeadless||Ir.blockHeadless,o=Ir.storageProvider||a.storageProvider,l={...Ir.blockList,...a.blockList},u={...Ir.limitRate,...a.limitRate};if(i&&A4(navigator))return Promise.reject(C4());const f=wz(r);N4(s,e,t),yz(f);const d=new FormData(f);return P4(l,d)?Promise.reject(O4()):await j4(location.pathname,u,o)?Promise.reject(R4()):(d.append("lib_version","4.4.1"),d.append("service_id",e),d.append("template_id",t),d.append("user_id",s),k4("/api/v1.0/email/send-form",d))},Cu={init:fz,send:xz,sendForm:bz,EmailJSResponseStatus:Xf},Dm={serviceId:"service_m7co0uu",templateId:"template_1x3zj8n",publicKey:"rWeo1dt9mNcXiXJfV"},_z=()=>{const{toast:e}=Is(),[t,r]=S.useState(!1),[n,a]=S.useState(null),[s,i]=S.useState({name:"",email:"",subject:"",message:"",math:"",website:""});S.useEffect(()=>{Cu.init(Dm.publicKey)},[]),S.useEffect(()=>{if(n){const h=setTimeout(()=>{a(null)},5e3);return()=>clearTimeout(h)}},[n]);const o=h=>{i(p=>({...p,[h.target.name]:h.target.value})),n&&a(null)},l=h=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(h),u=()=>s.website?(a({type:"error",message:"Spam detected. Please try again."}),!1):s.math!=="8"?(a({type:"error",message:"Please answer the math question correctly."}),!1):s.name.trim()?s.email.trim()?l(s.email)?s.subject.trim()?s.message.trim()?s.message.trim().length<10?(a({type:"error",message:"Please enter a more detailed message (at least 10 characters)."}),!1):!0:(a({type:"error",message:"Please enter your message."}),!1):(a({type:"error",message:"Please enter a subject."}),!1):(a({type:"error",message:"Please enter a valid email address."}),!1):(a({type:"error",message:"Please enter your email address."}),!1):(a({type:"error",message:"Please enter your name."}),!1),f=async h=>{if(h.preventDefault(),a(null),!!u()){r(!0);try{const p={from_name:s.name.trim(),from_email:s.email.trim(),subject:s.subject.trim()||"Contact Form - Perfect Gardener",message:s.message.trim()};await Cu.send(Dm.serviceId,Dm.templateId,p),a({type:"success",message:"Message sent successfully! I'll get back to you soon."}),e({title:"Message Sent! 🌱",description:"Thank you for reaching out. We'll get back to you within 24 hours."}),i({name:"",email:"",subject:"",message:"",math:"",website:""})}catch(p){console.error("EmailJS Error:",p);const v=p,m=v.text||v.message||"Please try again later or contact us directly.";a({type:"error",message:`Sorry, there was an error sending your message. ${m}`}),e({title:"Failed to send message",description:m,variant:"destructive"})}finally{r(!1)}}},d=[{icon:Kh,title:"Email",value:"progardener01@gmail.com",description:"We reply within 24 hours"},{icon:uF,title:"Phone",value:"+91 998859975"},{icon:oF,title:"Location",value:"Uttarakhand, India",description:"India"},{icon:G0,title:"Working Hours",value:"9:00 AM - 6:00 PM",description:"Monday to Saturday"}];return c.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[c.jsx(gr,{}),c.jsxs("main",{className:"flex-grow",children:[c.jsx("section",{className:"bg-gradient-to-br from-primary/10 via-accent/5 to-background py-16 md:py-24",children:c.jsxs("div",{className:"container mx-auto px-4 text-center",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 bg-primary/10 text-primary px-4 py-2 rounded-full mb-6",children:[c.jsx(rv,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm font-medium",children:"Get in Touch"})]}),c.jsx("h1",{className:"text-2xl xs:text-3xl sm:text-4xl md:text-5xl font-display font-bold text-foreground mb-3 xs:mb-4",children:"Contact Us"}),c.jsx("p",{className:"text-sm xs:text-base sm:text-lg text-muted-foreground max-w-2xl mx-auto px-2",children:"Got questions about gardening? Need some tips? Drop us a line and we'll get back to you!"})]})}),c.jsx("section",{className:"py-16",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[c.jsx("div",{className:"lg:col-span-2",children:c.jsxs(jt,{className:"border-border/50 shadow-lg",children:[c.jsxs(nn,{children:[c.jsx(an,{className:"text-2xl font-display",children:"Send us a Message"}),c.jsx(Va,{children:"Fill out the form below and we'll get back to you as soon as possible."})]}),c.jsx(It,{children:c.jsxs("form",{onSubmit:f,className:"space-y-6",id:"contact-form",children:[n&&c.jsxs(yp,{variant:n.type==="error"?"destructive":"default",className:n.type==="success"?"bg-green-50 border-green-200 dark:bg-green-950 dark:border-green-800":"",children:[n.type==="success"?c.jsx(JI,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):c.jsx(XI,{className:"h-4 w-4"}),c.jsx(wp,{className:n.type==="success"?"text-green-800 dark:text-green-200":"",children:n.message})]}),c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"name",children:"Your Name *"}),c.jsx(Be,{id:"name",name:"name",placeholder:"John Doe",value:s.name,onChange:o,required:!0,className:"bg-background",disabled:t})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"email",children:"Email Address *"}),c.jsx(Be,{id:"email",name:"email",type:"email",placeholder:"john@example.com",value:s.email,onChange:o,required:!0,className:"bg-background",disabled:t})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"subject",children:"Subject *"}),c.jsx(Be,{id:"subject",name:"subject",placeholder:"What's this about?",value:s.subject,onChange:o,required:!0,className:"bg-background",disabled:t})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"message",children:"Your Message *"}),c.jsx(ws,{id:"message",name:"message",placeholder:"Tell us how we can help you...",value:s.message,onChange:o,required:!0,rows:6,className:"bg-background resize-none",disabled:t})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"math",children:"Security Question: What is 5 + 3? *"}),c.jsx(Be,{id:"math",name:"math",type:"text",placeholder:"Enter your answer",value:s.math,onChange:o,required:!0,className:"bg-background",disabled:t})]}),c.jsxs("div",{className:"hidden",style:{display:"none"},children:[c.jsx(Oe,{htmlFor:"website",children:"Website (leave blank)"}),c.jsx(Be,{id:"website",name:"website",type:"text",value:s.website,onChange:o,tabIndex:-1,autoComplete:"off"})]}),c.jsx(be,{type:"submit",size:"lg",className:"w-full sm:w-auto",disabled:t,children:t?c.jsxs(c.Fragment,{children:[c.jsx(sF,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):c.jsxs(c.Fragment,{children:[c.jsx(K0,{className:"w-4 h-4 mr-2"}),"Send Message"]})})]})})]})}),c.jsxs("div",{className:"space-y-4",children:[d.map((h,p)=>c.jsx(jt,{className:"border-border/50 hover:shadow-md transition-shadow",children:c.jsxs(It,{className:"p-4 flex items-start gap-4",children:[c.jsx("div",{className:"p-3 rounded-full bg-primary/10 text-primary shrink-0",children:c.jsx(h.icon,{className:"w-5 h-5"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-foreground",children:h.title}),c.jsx("p",{className:"text-foreground/90",children:h.value}),c.jsx("p",{className:"text-sm text-muted-foreground",children:h.description})]})]})},p)),c.jsx(jt,{className:"border-primary/20 bg-primary/5",children:c.jsxs(It,{className:"p-4",children:[c.jsxs("h3",{className:"font-semibold text-foreground mb-2 flex items-center gap-2",children:[c.jsx(rv,{className:"w-4 h-4 text-primary"}),"Quick Gardening Tip"]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Water your plants early in the morning to reduce evaporation and give leaves time to dry before nightfall, preventing fungal diseases."})]})})]})]})})})]}),c.jsx(vr,{})]})},Ez=()=>{const[e,t]=S.useState(""),[r,n]=S.useState(""),[a,s]=S.useState(""),[i,o]=S.useState("moderate"),[l,u]=S.useState(null),f=()=>{const v=parseFloat(r);if(!e||!v||v<4){alert("Please select a plant type and enter a valid plant size (4-48 inches)");return}let m=v/2,g=v;i==="fast"?g=v*1.5:i==="slow"&&(m=Math.max(6,v/3)),m=Math.max(6,Math.round(m*10)/10),g=Math.round(g*10)/10;const x=(m+g)/2,y=Math.round((x/2)**2*Math.PI*x/6.1*10)/10,w=parseFloat((y*.6).toFixed(1));u({plantName:a||"Your plant",plantType:e,minPotSize:m,maxPotSize:g,avgPotSize:x,soilLiters:y,soilKg:w})},d=()=>{t(""),n(""),s(""),o("moderate"),u(null)},h=v=>{switch(v){case"flower":return"🌸 Flowering Plant";case"vegetable":return"🥕 Vegetable";case"herb":return"🌿 Herb";default:return"Plant"}},p=v=>{switch(v){case"flower":return"For Flowers: Use well-draining potting soil, add perlite";case"vegetable":return"For Vegetables: Mix soil with compost (1:1 ratio)";case"herb":return"For Herbs: Use light, well-draining potting mix with sand";default:return""}};return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(Yf,{title:"Pot Size Calculator for Plants",description:"Calculate the ideal pot size for your plants and estimate soil requirements. Free online tool to determine correct pot diameter, soil quantity in liters and kg for flowers, vegetables, and herbs.",keywords:"pot size calculator, plant pot calculator, pot size for plants, soil calculator, container size calculator, gardening pot calculator, how to choose pot size, plant container calculator",url:"https://perfectgardener.netlify.app/tools/pot-calculator"}),c.jsx(gr,{}),c.jsx("main",{id:"main-content",className:"pt-20",children:c.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-3xl",children:[c.jsx(vt,{to:"/tools",className:"inline-flex items-center text-primary hover:underline mb-6 font-medium",children:"← Back to Tools Hub"}),c.jsxs("div",{className:"text-center mb-8",children:[c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"⚱️🛠️ Pot Size Calculator for Plants"}),c.jsx("p",{className:"text-muted-foreground",children:"Calculate the ideal pot size, soil quantity, and drainage requirements for your plants."})]}),c.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 mb-8",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plantType",children:"Plant Type:"}),c.jsxs(kn,{value:e,onValueChange:t,children:[c.jsx(ln,{children:c.jsx(Nn,{placeholder:"-- Select Plant Type --"})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"flower",children:"Flowering Plant"}),c.jsx(Qe,{value:"vegetable",children:"Vegetable"}),c.jsx(Qe,{value:"herb",children:"Herb"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plantSize",children:"Expected Plant Size (in inches):"}),c.jsx(Be,{id:"plantSize",type:"number",placeholder:"e.g., 12 for 12 inches",min:4,max:48,value:r,onChange:v=>n(v.target.value)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plantName",children:"Plant Name (Optional):"}),c.jsx(Be,{id:"plantName",type:"text",placeholder:"e.g., Tomato, Rose, Basil",value:a,onChange:v=>s(v.target.value)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"growthRate",children:"Growth Rate:"}),c.jsxs(kn,{value:i,onValueChange:o,children:[c.jsx(ln,{children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"slow",children:"Slow Growing"}),c.jsx(Qe,{value:"moderate",children:"Moderate Growing"}),c.jsx(Qe,{value:"fast",children:"Fast Growing"})]})]})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[c.jsx(be,{onClick:f,className:"flex-1 sm:flex-none",children:"Calculate Pot Size"}),c.jsx(be,{onClick:d,variant:"secondary",className:"flex-1 sm:flex-none",children:"Reset"})]})]}),l&&c.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 animate-fade-in",children:[c.jsxs("h2",{className:"text-xl font-semibold text-primary mb-4",children:["📏 Pot Sizing Recommendation for ",l.plantName]}),c.jsx("div",{className:"flex items-center gap-2 mb-4",children:c.jsx("span",{className:"text-xl",children:h(l.plantType)})}),c.jsxs("div",{className:"space-y-3 mb-6",children:[c.jsxs("div",{className:"flex flex-col gap-1 p-3 bg-muted/50 rounded-lg border-l-4 border-primary",children:[c.jsx("span",{className:"font-semibold text-sm text-foreground",children:"📏 Pot Diameter Range"}),c.jsxs("span",{className:"text-muted-foreground",children:[Math.round(l.avgPotSize*.7*10)/10,'" - ',Math.round(l.avgPotSize*1.2*10)/10,'"']})]}),c.jsxs("div",{className:"flex flex-col gap-1 p-3 bg-muted/50 rounded-lg border-l-4 border-primary",children:[c.jsx("span",{className:"font-semibold text-sm text-foreground",children:"🎯 Recommended Diameter"}),c.jsxs("span",{className:"text-muted-foreground",children:["~",l.avgPotSize,'" diameter pot']})]}),c.jsxs("div",{className:"flex flex-col gap-1 p-3 bg-muted/50 rounded-lg border-l-4 border-primary",children:[c.jsx("span",{className:"font-semibold text-sm text-foreground",children:"🪴 Soil Quantity (Liters)"}),c.jsxs("span",{className:"text-muted-foreground",children:[l.soilLiters," L"]})]}),c.jsxs("div",{className:"flex flex-col gap-1 p-3 bg-muted/50 rounded-lg border-l-4 border-primary",children:[c.jsx("span",{className:"font-semibold text-sm text-foreground",children:"🪨 Soil Quantity (Kg)"}),c.jsxs("span",{className:"text-muted-foreground",children:["~",l.soilKg," kg"]})]})]}),c.jsxs("div",{className:"bg-primary/10 border-l-4 border-primary rounded-lg p-4",children:[c.jsx("h4",{className:"font-semibold text-primary mb-3",children:"💧 Drainage & Soil Tips"}),c.jsxs("ul",{className:"space-y-2 text-sm text-foreground",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Drainage Holes:"})," Ensure at least 2-3 drainage holes at bottom"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Soil Mix:"})," Use potting soil with 30-40% organic compost"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Soil Depth:"})," Leave 1-2 inches from soil surface to pot rim"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Base Layer:"})," Add 1-2 inches coarse sand/gravel for drainage"]}),l.plantType&&c.jsx("li",{children:c.jsx("strong",{children:p(l.plantType)})}),c.jsxs("li",{children:[c.jsx("strong",{children:"Watering:"})," Water until it drains from bottom, avoid waterlogging"]})]})]})]})]})}),c.jsx(vr,{}),c.jsx(hn,{})]})},Yv=["January","February","March","April","May","June","July","August","September","October","November","December"],j_=[{value:"Marigold",label:"Marigold (Genda)"},{value:"Rose",label:"Rose"},{value:"Zinnia",label:"Zinnia"},{value:"Sunflower",label:"Sunflower"},{value:"Dahlia",label:"Dahlia"},{value:"Cosmos",label:"Cosmos"},{value:"Petunia",label:"Petunia"},{value:"Chrysanthemum",label:"Chrysanthemum"},{value:"Jasmine",label:"Jasmine"},{value:"Bougainvillea",label:"Bougainvillea"},{value:"Gladiolus",label:"Gladiolus"},{value:"Tulip",label:"Tulip"},{value:"Pansy",label:"Pansy"},{value:"Dianthus",label:"Dianthus"},{value:"Snapdragon",label:"Snapdragon"},{value:"Other",label:"Other (Plant)"}];function R_(e,t){const r=Yv.indexOf(e);return Yv[(r+t)%12]}const Sz=()=>{const{toast:e}=Is(),[t,r]=S.useState(""),[n,a]=S.useState(""),[s,i]=S.useState(""),[o,l]=S.useState(null),[u,f]=S.useState(null),[d,h]=S.useState([]),[p,v]=S.useState([]),[m,g]=S.useState(!0),[x,y]=S.useState(!1);S.useEffect(()=>{(async()=>{try{const A=await(await fetch("/assets/Data/PlantsDatabase.json")).json();h(A.Plants||[]),g(!1)}catch(k){console.error("Failed to load local plants database (this is normal if file doesn't exist):",k),g(!1)}})()},[]),S.useEffect(()=>{(async()=>{var k;console.log("🔍 Bloom Calculator: Loading plants from database...");try{const A=await ms.getAll();console.log("🌿 Bloom Calculator: DB plants response:",A),v(A.data||[]),console.log("✅ Bloom Calculator: DB plants loaded:",((k=A.data)==null?void 0:k.length)||0)}catch(A){console.error("❌ Failed to load plants from database:",A)}})()},[]);const w=N=>{const k=N.toLowerCase().trim();if(!k)return{plant:null};let A=d.find(U=>U.name.toLowerCase()===k);if(A)return{plant:A};if(A=d.find(U=>U.name.toLowerCase().includes(k)||k.includes(U.name.toLowerCase())),A)return{plant:A};const I=d.map(U=>U.name),{match:M}=ph(N,I,.5);if(M){const U=d.find(W=>W.name===M);if(U)return{plant:U,suggestedName:M}}return{plant:null}},b=N=>{const k=N.toLowerCase().trim();if(!k||p.length===0)return{plant:null};let A=p.find(U=>U.name.toLowerCase()===k);if(A)return{plant:A};if(A=p.find(U=>U.name.toLowerCase().includes(k)||k.includes(U.name.toLowerCase())),A)return{plant:A};const I=p.map(U=>U.name),{match:M}=ph(N,I,.5);if(M){const U=p.find(W=>W.name===M);if(U)return{plant:U,suggestedName:M}}return{plant:null}},_=N=>({name:N.name,Region:N.region||"","Growing Months":N.growing_months||"",Season:N.season||"","Soil Requirements":N.soil_requirements||"","Bloom and Harvest Time":N.bloom_harvest_time||"","Sunlight Needs":N.sunlight_needs||"","Care Instructions":N.care_instructions||"",Image:N.image||""}),T=N=>{const k=(N["Bloom and Harvest Time"]||"").toLowerCase(),A=k.match(/(\d+)\s*(?:-|to)\s*(\d+)\s*(day|days|month|months)/i),I=k.match(/(\d+)\s*(day|days|month|months)/i);let M=60;if(A){const Q=Number(A[1]),R=Number(A[2]),z=A[3].toLowerCase(),D=Math.round((Q+R)/2);M=z.startsWith("month")?D*30:D}else if(I){const Q=Number(I[1]);M=I[2].toLowerCase().startsWith("month")?Q*30:Q}else{const Q=(N["Growing Months"]||"").split(",").map(R=>R.trim()).filter(Boolean);Q.length>0&&(M=Q.length*30)}const U=7,W=60,G=N["Care Instructions"].split(",").map(Q=>Q.trim()).filter(Q=>Q.length>0);return{daysToGermination:U,daysToMaturity:M,bloomDuration:W,care:G.length>0?G:[`Region: ${N.Region}`,`Season: ${N.Season}`,`Sunlight: ${N["Sunlight Needs"]}`,`Soil: ${N["Soil Requirements"]}`]}},E=()=>d.length===0&&p.length===0?j_:[...["Rose","Marigold","Sunflower","Tulip","Jasmine","Tomato","Chili","Brinjal","Okra","Cucumber","Mango","Banana","Papaya","Guava","Lemon"].map(A=>{const I=w(A);if(I.plant)return I.plant;const M=b(A);return M.plant?_(M.plant):null}).filter(A=>A!==null).map(A=>({value:A.name,label:A.name})).slice(0,10),...j_.filter(A=>A.value!=="Other"),{value:"Other",label:"Other (Type plant name)"}],C=async()=>{let N=t;const k=t==="Other";if(!N||!s){e({title:"Missing Information",description:"Please select both plant and sowing month",variant:"destructive"});return}if(N==="Other"){if(!n.trim()){e({title:"Missing Plant Name",description:"Please enter a plant, fruit, or vegetable name",variant:"destructive"});return}N=n.trim()}l(null),f(null);let A,I=N,M="",U,W;if(k){const O=Array.from(new Set([...d.map(L=>L.name),...p.map(L=>L.name),"Rose","Marigold","Sunflower","Tulip","Jasmine","Tomato","Chili","Brinjal","Okra","Cucumber","Mango","Banana","Papaya","Guava","Lemon"])).filter(Boolean),{match:j,similarity:B}=ph(N,O,.5);j&&B>=.6&&j.toLowerCase()!==N.toLowerCase()&&(W=N,N=j,I=j,f(j))}const G=w(N);if(G.plant&&(G.suggestedName&&G.suggestedName.toLowerCase()!==N.toLowerCase()&&(W=N,I=G.suggestedName,f(G.suggestedName)),A=T(G.plant),M="Local Database",G.plant.Image&&G.plant.Image.trim()&&(U=G.plant.Image.trim())),!A){const O=b(N);if(O.plant)O.suggestedName&&O.suggestedName.toLowerCase()!==N.toLowerCase()&&(W=N,I=O.suggestedName,f(O.suggestedName)),A=T(_(O.plant)),M="Live Database",O.plant.image&&O.plant.image.trim()&&(U=O.plant.image.trim());else try{const j=await ms.searchByName(N,5);if(j&&j.length>0){const B=j[0];A=T(_(B)),M="Live Database",B.image&&B.image.trim()&&(U=B.image.trim()),v(L=>L.some(F=>F.id===B.id)?L:[B,...L])}}catch(j){console.error("❌ Bloom Calculator: DB searchByName failed:",j)}}if(!A){y(!0);try{const O=await fetch("/.netlify/functions/ai-suggest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plantName:N})});if(O.ok){const j=await O.json(),B=((j==null?void 0:j.suggestion)||"").trim();if(B){const L=w(B);if(L.plant&&(A=T(L.plant),M="Local Database",I=B,f(B),L.plant.Image&&L.plant.Image.trim()&&(U=L.plant.Image.trim())),!A){const F=b(B);F.plant&&(A=T(_(F.plant)),M="Live Database",I=B,f(B),F.plant.image&&F.plant.image.trim()&&(U=F.plant.image.trim()))}if(!A)try{const F=await ms.searchByName(B,5);if(F&&F.length>0){const H=F[0];A=T(_(H)),M="Live Database",I=H.name,f(H.name),H.image&&H.image.trim()&&(U=H.image.trim()),v(Z=>Z.some(X=>X.id===H.id)?Z:[H,...Z])}}catch(F){console.error("❌ Bloom Calculator: DB searchByName failed:",F)}}}}catch(O){console.error("❌ AI suggestion failed:",O)}finally{y(!1)}}if(!A){e({title:"Plant Not Found",description:`No bloom data found for "${N}". Try a different name or choose from the list.`,variant:"destructive"});return}const Q=A.daysToGermination+A.daysToMaturity,R=Math.ceil(Q/30),z=R_(s,R),D=R_(z,Math.ceil(A.bloomDuration/30));l({flowerName:I,sowingMonth:s,bloomMonth:z,endMonth:D,totalDays:Q,data:A,image:U,dataSource:M,correctedFrom:W})},P=()=>{r(""),a(""),i(""),l(null),y(!1),f(null)};return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(Yf,{title:"Flower Bloom Time Calculator",description:"Calculate when your flowers will bloom based on planting time and flower type. Free online tool to predict bloom timeline for marigold, rose, sunflower, and more. Perfect for planning your garden.",keywords:"bloom time calculator, flower bloom calculator, when do flowers bloom, flower planting calendar, bloom timeline, flower growth calculator, gardening calculator, plant bloom time",url:"https://perfectgardener.netlify.app/tools/bloom-calculator"}),c.jsx(gr,{}),c.jsx("main",{id:"main-content",className:"pt-20",children:c.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-3xl",children:[c.jsx(vt,{to:"/tools",className:"inline-flex items-center text-primary hover:underline mb-6 font-medium",children:"← Back to Tools Hub"}),c.jsxs("div",{className:"text-center mb-8",children:[c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"🌺 Flower Bloom Time Calculator"}),c.jsx("p",{className:"text-muted-foreground",children:"Predict when your flowers will bloom based on variety and sowing time."})]}),c.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 mb-8",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"flowerName",children:"Select Plant (Flower/Vegetable/Fruit):"}),c.jsxs(kn,{value:t,onValueChange:N=>{r(N),l(null),N!=="Other"&&a("")},children:[c.jsx(ln,{children:c.jsx(Nn,{placeholder:"-- Select Plant --"})}),c.jsx(cn,{children:m?c.jsx(Qe,{value:"loading",disabled:!0,children:"Loading plants..."}):E().map(N=>c.jsx(Qe,{value:N.value,children:N.label},N.value))})]}),t==="Other"&&c.jsx(Be,{type:"text",placeholder:"Enter plant, vegetable, or fruit name (e.g., Tomato, Mango, Rose)",value:n,onChange:N=>{a(N.target.value),l(null)},className:"mt-2"}),u&&c.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:['Showing results for "',u,'"']})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"sowingMonth",children:"Sowing Month:"}),c.jsxs(kn,{value:s,onValueChange:N=>{i(N),l(null)},children:[c.jsx(ln,{children:c.jsx(Nn,{placeholder:"-- Select Month --"})}),c.jsx(cn,{children:Yv.map(N=>c.jsx(Qe,{value:N,children:N},N))})]})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[c.jsx(be,{onClick:C,disabled:x,className:"flex-1 sm:flex-none",children:x?"Loading AI Info...":"Calculate Bloom Time"}),c.jsx(be,{onClick:P,variant:"secondary",className:"flex-1 sm:flex-none",children:"Reset"})]})]}),o&&c.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 animate-fade-in",children:[c.jsxs("h2",{className:"text-xl font-semibold text-primary mb-4",children:["🌺 ",o.flowerName," Bloom Timeline"]}),o.dataSource&&c.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:["Source: ",o.dataSource]}),o.image&&c.jsx("div",{className:"w-full aspect-video overflow-hidden rounded-lg mb-6 bg-muted",children:c.jsx("img",{src:o.image,alt:o.flowerName,className:"w-full h-full object-contain block",onError:N=>{N.target.style.display="none"}})}),c.jsx("h3",{className:"font-semibold text-foreground mb-4",children:"📅 Bloom Timeline"}),c.jsxs("div",{className:"bg-primary/5 rounded-lg p-4 space-y-3 mb-6",children:[c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-background rounded-lg",children:[c.jsx("span",{className:"text-2xl",children:"🌱"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-primary block",children:"Sowing Month"}),c.jsx("span",{className:"text-muted-foreground text-sm",children:o.sowingMonth})]})]}),c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-background rounded-lg",children:[c.jsx("span",{className:"text-2xl",children:"🌿"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-primary block",children:"Germination"}),c.jsxs("span",{className:"text-muted-foreground text-sm",children:[o.data.daysToGermination," days"]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-background rounded-lg",children:[c.jsx("span",{className:"text-2xl",children:"🌸"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-primary block",children:"Bloom Start"}),c.jsxs("span",{className:"text-muted-foreground text-sm",children:[o.bloomMonth," (~",o.totalDays," days)"]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-background rounded-lg",children:[c.jsx("span",{className:"text-2xl",children:"💐"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-primary block",children:"Bloom Duration"}),c.jsxs("span",{className:"text-muted-foreground text-sm",children:[o.data.bloomDuration," days"]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-background rounded-lg",children:[c.jsx("span",{className:"text-2xl",children:"🍂"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-primary block",children:"Bloom End"}),c.jsxs("span",{className:"text-muted-foreground text-sm",children:["Around ",o.endMonth]})]})]})]}),c.jsxs("div",{className:"bg-primary/10 border-l-4 border-primary rounded-lg p-4",children:[c.jsx("h4",{className:"font-semibold text-primary mb-3",children:"🌿 Essential Care Tips"}),c.jsx("ul",{className:"space-y-2 text-sm text-foreground list-disc list-inside",children:o.data.care.map((N,k)=>c.jsx("li",{children:N},k))})]})]})]})}),c.jsx(vr,{}),c.jsx(hn,{})]})},il={pots:{basic:20,standard:35,premium:60},soil:{basic:50,standard:80,premium:150},seeds:{flower:30,vegetable:40,herb:50,mixed:35},saplings:{flower:50,vegetable:30,herb:40,mixed:40},fertilizer:{basic:150,standard:250,premium:400},tools:{basic:200,standard:400,premium:600}},Tz=()=>{const[e,t]=S.useState("10"),[r,n]=S.useState("flower"),[a,s]=S.useState("standard"),[i,o]=S.useState("standard"),[l,u]=S.useState(null),f=()=>{const h=parseInt(e);if(!h||h<1||h>100){alert("Please enter a valid number of pots (1-100)");return}const p=il.pots[i==="basic"?"basic":i==="premium"?"premium":"standard"],v=p*h,g=h*(i==="basic"?.5:i==="premium"?.7:.6),x=il.soil[i],y=g*x,b=il.seeds[r]*(h/5),T=il.saplings[r]*(h/3),E=il.fertilizer[i],C=il.tools[i],P=v+y+b+T+E+C;u({numPots:h,plantType:r,soilQuality:i,totalPotsCost:v,totalSoilCost:y,totalSoilKg:g,potCost:p,totalSeedCost:b,totalSaplingCost:T,fertilizer:E,toolsCost:C,subtotal:P})},d=()=>{t("10"),n("flower"),s("standard"),o("standard"),u(null)};return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(Yf,{title:"Gardening Budget Planner Calculator",description:"Plan your gardening budget and estimate costs for pots, soil, seeds, fertilizers, and tools. Free online calculator to help you budget for your home garden in Indian Rupees (₹).",keywords:"gardening budget calculator, garden cost calculator, plant budget planner, gardening expenses calculator, garden budget planning, home gardening cost, Indian gardening budget, ₹ gardening calculator",url:"https://perfectgardener.netlify.app/tools/budget-planner"}),c.jsx(gr,{}),c.jsx("main",{id:"main-content",className:"pt-20",children:c.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-3xl",children:[c.jsx(vt,{to:"/tools",className:"inline-flex items-center text-primary hover:underline mb-6 font-medium",children:"← Back to Tools Hub"}),c.jsxs("div",{className:"text-center mb-8",children:[c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"💰 Gardening Budget Planner (₹)"}),c.jsx("p",{className:"text-muted-foreground",children:"Estimate your gardening setup costs based on plant type, quantity, and desired budget."})]}),c.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 mb-8",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"numPots",children:"Number of Pots:"}),c.jsx(Be,{id:"numPots",type:"number",placeholder:"e.g., 10",min:1,max:100,value:e,onChange:h=>t(h.target.value)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plantType",children:"Plant Type:"}),c.jsxs(kn,{value:r,onValueChange:n,children:[c.jsx(ln,{children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"flower",children:"Flowering Plants"}),c.jsx(Qe,{value:"vegetable",children:"Vegetables"}),c.jsx(Qe,{value:"herb",children:"Herbs"}),c.jsx(Qe,{value:"mixed",children:"Mixed"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"budget",children:"Budget Range (Optional, ₹):"}),c.jsxs(kn,{value:a,onValueChange:s,children:[c.jsx(ln,{children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"budget",children:"Budget (₹500-2000)"}),c.jsx(Qe,{value:"standard",children:"Standard (₹2000-5000)"}),c.jsx(Qe,{value:"premium",children:"Premium (₹5000+)"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"soilQuality",children:"Soil Quality:"}),c.jsxs(kn,{value:i,onValueChange:o,children:[c.jsx(ln,{children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"basic",children:"Basic Mix"}),c.jsx(Qe,{value:"standard",children:"Standard Mix"}),c.jsx(Qe,{value:"premium",children:"Premium Organic"})]})]})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[c.jsx(be,{onClick:f,className:"flex-1 sm:flex-none",children:"Calculate Budget"}),c.jsx(be,{onClick:d,variant:"secondary",className:"flex-1 sm:flex-none",children:"Reset"})]})]}),l&&c.jsxs("div",{className:"bg-card border border-border rounded-xl p-6 animate-fade-in",children:[c.jsxs("h2",{className:"text-xl font-semibold text-primary mb-2",children:["💰 Budget Estimate for ",l.numPots," Pots (",l.plantType," garden)"]}),c.jsx("h3",{className:"font-semibold text-foreground mb-4",children:"📊 Your Gardening Budget Breakdown"}),c.jsxs("p",{className:"text-muted-foreground text-sm mb-6",children:[l.numPots," pots • ",l.plantType," plants • ",l.soilQuality," soil quality"]}),c.jsxs("div",{className:"space-y-2 mb-6",children:[c.jsxs("div",{className:"flex justify-between items-center p-3 bg-primary/5 rounded-lg",children:[c.jsxs("span",{className:"text-foreground font-medium",children:["🪴 Pots (",l.numPots," × ₹",l.potCost,")"]}),c.jsxs("span",{className:"text-primary font-semibold",children:["₹",l.totalPotsCost.toLocaleString()]})]}),c.jsxs("div",{className:"flex justify-between items-center p-3 bg-primary/5 rounded-lg",children:[c.jsxs("span",{className:"text-foreground font-medium",children:["🌍 Soil (",l.totalSoilKg.toFixed(1)," kg)"]}),c.jsxs("span",{className:"text-primary font-semibold",children:["₹",l.totalSoilCost.toLocaleString()]})]}),c.jsxs("div",{className:"flex justify-between items-center p-3 bg-primary/5 rounded-lg",children:[c.jsx("span",{className:"text-foreground font-medium",children:"🌱 Seeds & Saplings"}),c.jsxs("span",{className:"text-primary font-semibold",children:["₹",(l.totalSeedCost+l.totalSaplingCost).toLocaleString()]})]}),c.jsxs("div",{className:"flex justify-between items-center p-3 bg-primary/5 rounded-lg",children:[c.jsx("span",{className:"text-foreground font-medium",children:"🌿 Fertilizer (Initial)"}),c.jsxs("span",{className:"text-primary font-semibold",children:["₹",l.fertilizer.toLocaleString()]})]}),c.jsxs("div",{className:"flex justify-between items-center p-3 bg-primary/5 rounded-lg",children:[c.jsx("span",{className:"text-foreground font-medium",children:"🛠️ Tools & Accessories"}),c.jsxs("span",{className:"text-primary font-semibold",children:["₹",l.toolsCost.toLocaleString()]})]})]}),c.jsxs("div",{className:"flex justify-between items-center p-4 bg-gradient-to-r from-primary/15 to-primary/10 rounded-lg border-t-2 border-primary mb-6",children:[c.jsx("span",{className:"text-primary font-bold text-lg",children:"💰 Total Setup Cost:"}),c.jsxs("span",{className:"text-primary font-bold text-xl",children:["₹",l.subtotal.toLocaleString()]})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[c.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 text-center",children:[c.jsx("div",{className:"text-xs text-muted-foreground uppercase mb-2",children:"Pots"}),c.jsxs("div",{className:"text-2xl font-bold text-primary",children:[Math.round(l.totalPotsCost/l.subtotal*100),"%"]})]}),c.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 text-center",children:[c.jsx("div",{className:"text-xs text-muted-foreground uppercase mb-2",children:"Soil"}),c.jsxs("div",{className:"text-2xl font-bold text-primary",children:[Math.round(l.totalSoilCost/l.subtotal*100),"%"]})]}),c.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 text-center",children:[c.jsx("div",{className:"text-xs text-muted-foreground uppercase mb-2",children:"Plants"}),c.jsxs("div",{className:"text-2xl font-bold text-primary",children:[Math.round((l.totalSeedCost+l.totalSaplingCost)/l.subtotal*100),"%"]})]})]}),c.jsxs("div",{className:"bg-primary/10 border-l-4 border-primary rounded-lg p-4",children:[c.jsx("h4",{className:"font-semibold text-primary mb-3",children:"💡 Money-Saving Tips"}),c.jsxs("ul",{className:"space-y-2 text-sm text-foreground list-disc list-inside",children:[c.jsx("li",{children:"Buy pots in bulk - save 10-15%"}),c.jsx("li",{children:"Make your own compost"}),c.jsx("li",{children:"Use seeds vs saplings - save 40-50%"}),c.jsx("li",{children:"Reuse old containers"}),c.jsx("li",{children:"Share tools with neighbors"}),c.jsx("li",{children:"Buy seasonal seeds on sale"}),c.jsxs("li",{children:["Monthly budget: ₹",Math.round(l.subtotal/6),"-₹",Math.round(l.subtotal/4)]})]})]})]})]})}),c.jsx(vr,{}),c.jsx(hn,{})]})},I_=[{id:"north",name:"North India",climate:"Cold winters, hot summers",examples:"Delhi, Punjab, UP, Rajasthan"},{id:"south",name:"South India",climate:"Tropical, warm year-round",examples:"Tamil Nadu, Kerala, Karnataka, Andhra Pradesh"},{id:"east",name:"East India",climate:"Humid, moderate winters",examples:"West Bengal, Odisha, Bihar, Jharkhand"},{id:"west",name:"West India",climate:"Hot, dry summers, coastal humidity",examples:"Maharashtra, Gujarat, Goa"},{id:"central",name:"Central India",climate:"Hot summers, mild winters",examples:"Madhya Pradesh, Chhattisgarh"},{id:"northeast",name:"Northeast India",climate:"Heavy rainfall, mild temperatures",examples:"Assam, Meghalaya, Sikkim"},{id:"hills",name:"Himalayan Region",climate:"Cold, alpine conditions",examples:"Himachal, Uttarakhand, J&K"}],Mm=["January","February","March","April","May","June","July","August","September","October","November","December"],kz={January:{season:"Winter",seasonEmoji:"❄️",flowers:[{name:"Sweet Pea",emoji:"🌸",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-75 days",description:"Fragrant climbing flowers perfect for winter gardens"},{name:"Pansy",emoji:"🌺",sunlight:"Partial Shade",water:"Regular",difficulty:"Easy",bloomTime:"45-60 days",description:"Colorful, cold-tolerant flowers with distinctive patterns"},{name:"Larkspur",emoji:"💜",sunlight:"Full Sun",water:"Moderate",difficulty:"Moderate",bloomTime:"80-90 days",description:"Tall spikes of blue, pink, or white flowers"},{name:"Antirrhinum",emoji:"🌷",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"70-80 days",description:"Snapdragons with unique jaw-shaped blooms"},{name:"Calendula",emoji:"🌼",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"45-55 days",description:"Bright orange/yellow medicinal flowers"}],tips:["Protect seedlings from morning frost with covers","Water only when soil surface is dry","Add mulch around plants to retain warmth","Start seeds indoors for early spring blooms"],regionNotes:{north:"Peak winter - protect from frost, use row covers",south:"Best planting season - mild weather ideal for most flowers",east:"Cool and foggy - ensure good drainage",west:"Pleasant weather - ideal for winter annuals",central:"Cold nights - mulch heavily",northeast:"Mild and moist - watch for fungal issues",hills:"Very cold - focus on cold-hardy varieties only"}},February:{season:"Late Winter",seasonEmoji:"🌸",flowers:[{name:"Phlox",emoji:"💮",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"50-60 days",description:"Clusters of fragrant star-shaped flowers"},{name:"Verbena",emoji:"🌺",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"60-70 days",description:"Spreading habit with colorful flower clusters"},{name:"Petunia",emoji:"🌸",sunlight:"Full Sun",water:"Regular",difficulty:"Easy",bloomTime:"45-60 days",description:"Trumpet-shaped flowers in many colors"},{name:"Gazania",emoji:"🌻",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"50-60 days",description:"Daisy-like flowers that close at night"},{name:"Dianthus",emoji:"🌷",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"45-55 days",description:"Sweet-scented carnation family flowers"}],tips:["Begin fertilizing with liquid organic mix","Use cocopeat + compost mix for pots","Prepare beds for spring planting","Transplant winter seedlings to larger containers"],regionNotes:{north:"Winter ending - start preparing spring beds",south:"Continue winter planting, harvest early blooms",east:"Fog clearing - increase watering gradually",west:"Warming up - shift to heat-tolerant varieties",central:"Pleasant weather - best planting window",northeast:"Dry season starting - water regularly",hills:"Still cold - continue with cold-hardy plants"}},March:{season:"Spring",seasonEmoji:"🌷",flowers:[{name:"Marigold",emoji:"🌼",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"45-50 days",description:"Classic garden flower, pest-repelling properties"},{name:"Alyssum",emoji:"🤍",sunlight:"Partial Shade",water:"Moderate",difficulty:"Easy",bloomTime:"40-50 days",description:"Low-growing with honey-scented clusters"},{name:"Salvia",emoji:"🔴",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"60-70 days",description:"Spikes of red, blue, or purple flowers"},{name:"Gerbera",emoji:"🌸",sunlight:"Partial Shade",water:"Regular",difficulty:"Moderate",bloomTime:"90-120 days",description:"Large colorful daisy-like flowers"},{name:"Hollyhock",emoji:"🌺",sunlight:"Full Sun",water:"Moderate",difficulty:"Moderate",bloomTime:"120-150 days",description:"Tall spires of cup-shaped flowers"}],tips:["Pinch faded blooms to encourage more flowers","Apply neem oil spray to prevent aphids","Increase watering as temperatures rise","Start summer flower seeds indoors"],regionNotes:{north:"Spring arrives - perfect planting weather",south:"Getting warm - shift to heat-tolerant plants",east:"Warm and pleasant - ideal growing conditions",west:"Heating up - water in early morning only",central:"Good planting month - moderate temperatures",northeast:"Pre-monsoon - prepare for heavy rains",hills:"Spring blooms starting - enjoy the colors"}},April:{season:"Summer",seasonEmoji:"☀️",flowers:[{name:"Zinnia",emoji:"🌺",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Heat-loving with vibrant double blooms"},{name:"Sunflower",emoji:"🌻",sunlight:"Full Sun",water:"Regular",difficulty:"Easy",bloomTime:"70-80 days",description:"Cheerful giants that follow the sun"},{name:"Cosmos",emoji:"💮",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"50-60 days",description:"Delicate daisy-like flowers, drought-tolerant"},{name:"Portulaca",emoji:"🌸",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"40-50 days",description:"Succulent with vibrant rose-like flowers"},{name:"Amaranthus",emoji:"🔴",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"60-70 days",description:"Dramatic drooping flower tassels"}],tips:["Water early morning to prevent evaporation","Mulch heavily to retain soil moisture","Provide afternoon shade for delicate plants","Use terracotta pots for natural cooling"],regionNotes:{north:"Getting hot - water twice daily if needed",south:"Peak heat - only plant heat-tolerant varieties",east:"Hot and humid - watch for pest infestations",west:"Very hot - essential to mulch and shade",central:"Hot summer begins - reduce planting activity",northeast:"Pre-monsoon heat - prepare drainage systems",hills:"Pleasant spring - best planting season"}},May:{season:"Peak Summer",seasonEmoji:"🔥",flowers:[{name:"Vinca (Periwinkle)",emoji:"🌸",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"40-50 days",description:"Extremely heat and drought tolerant"},{name:"Tithonia",emoji:"🧡",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"70-80 days",description:"Mexican sunflower with orange blooms"},{name:"Celosia",emoji:"🔴",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Unique brain-like or feathery blooms"},{name:"Gaillardia",emoji:"🌼",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"60-75 days",description:"Blanket flower with fiery colors"},{name:"Cockscomb",emoji:"❤️",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Velvet-textured crested flowers"}],tips:["Use terracotta pots for natural cooling effect","Provide partial shade in afternoon","Water deeply but less frequently","Avoid fertilizing during peak heat"],regionNotes:{north:"Extreme heat - focus on hardy survivors only",south:"Hot and dry - minimal planting recommended",east:"Humid heat - fungal prevention important",west:"Scorching - only drought-tolerant plants",central:"Very hot - pause most planting activities",northeast:"Monsoon approaching - prepare for rains",hills:"Beautiful weather - continue spring planting"}},June:{season:"Pre-Monsoon",seasonEmoji:"🌧️",flowers:[{name:"Rain Lily",emoji:"🌸",sunlight:"Partial Shade",water:"Regular",difficulty:"Easy",bloomTime:"After first rain",description:"Magical blooms appear after monsoon showers"},{name:"Cleome",emoji:"💜",sunlight:"Full Sun",water:"Moderate",difficulty:"Moderate",bloomTime:"70-80 days",description:"Spider flower with unique bloom shape"},{name:"Nasturtium",emoji:"🧡",sunlight:"Partial Shade",water:"Moderate",difficulty:"Easy",bloomTime:"50-60 days",description:"Edible flowers with peppery taste"},{name:"Torenia",emoji:"💙",sunlight:"Partial Shade",water:"Regular",difficulty:"Easy",bloomTime:"45-55 days",description:"Wishbone flower loves humid conditions"},{name:"Crossandra",emoji:"🧡",sunlight:"Partial Shade",water:"Regular",difficulty:"Easy",bloomTime:"60-70 days",description:"Firecracker flower loves monsoon humidity"}],tips:["Ensure excellent drainage in all containers","Fertilize lightly before heavy monsoon rains","Plant monsoon-loving bulbs now","Prepare rain shelters for delicate flowers"],regionNotes:{north:"Monsoon approaching - prepare drainage",south:"Southwest monsoon starts - ideal for rain lovers",east:"Monsoon season begins - excellent for planting",west:"Heavy rains expected - ensure drainage",central:"Monsoon arriving - great planting opportunity",northeast:"Heavy rainfall - protect from waterlogging",hills:"Monsoon mists - humidity-loving plants thrive"}},July:{season:"Monsoon",seasonEmoji:"🌦️",flowers:[{name:"Balsam",emoji:"🌺",sunlight:"Partial Shade",water:"Self-sufficient",difficulty:"Easy",bloomTime:"45-55 days",description:"Touch-me-not that thrives in rain"},{name:"Gomphrena",emoji:"💜",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Globe amaranth with papery blooms"},{name:"Impatiens",emoji:"🌸",sunlight:"Full Shade",water:"Regular",difficulty:"Easy",bloomTime:"40-50 days",description:"Perfect for shady monsoon gardens"},{name:"Coleus",emoji:"🍃",sunlight:"Partial Shade",water:"Regular",difficulty:"Easy",bloomTime:"Foliage plant",description:"Colorful foliage in vibrant patterns"},{name:"Begonia",emoji:"🌺",sunlight:"Partial Shade",water:"Moderate",difficulty:"Moderate",bloomTime:"60-70 days",description:"Beautiful foliage and delicate blooms"}],tips:["Don't over-fertilize during monsoon","Stake tall varieties for wind protection","Check daily for waterlogging issues","Remove fallen leaves to prevent fungal growth"],regionNotes:{north:"Peak monsoon - excellent growing conditions",south:"Heavy rains - monitor drainage constantly",east:"Flooding risk - raised beds recommended",west:"Heavy coastal rains - protect from salt spray",central:"Good rainfall - plants thrive naturally",northeast:"Very heavy rains - shelter delicate plants",hills:"Landslide season - container gardening safer"}},August:{season:"Monsoon",seasonEmoji:"🌿",flowers:[{name:"Rain Lily",emoji:"🌸",sunlight:"Partial Shade",water:"Rain-sufficient",difficulty:"Easy",bloomTime:"Immediate after rain",description:"Peak blooming season for these beauties"},{name:"Amaranthus",emoji:"🔴",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Love lies bleeding with cascading flowers"},{name:"Butterfly Pea",emoji:"💙",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"90-120 days",description:"Blue flowers used for tea, climbing vine"},{name:"Canna",emoji:"🔴",sunlight:"Full Sun",water:"Heavy",difficulty:"Easy",bloomTime:"60-90 days",description:"Tropical blooms with large leaves"},{name:"Tuberose",emoji:"🤍",sunlight:"Full Sun",water:"Regular",difficulty:"Moderate",bloomTime:"90-120 days",description:"Intensely fragrant night-blooming flowers"}],tips:["Watch out for fungal infections","Spray neem solution weekly as prevention","Remove yellowing leaves promptly","Prepare for post-monsoon planting"],regionNotes:{north:"Monsoon continues - lush green everywhere",south:"Rains reducing - prepare autumn flowers",east:"Still rainy - maintain drainage vigilance",west:"Rains decreasing - start autumn prep",central:"Late monsoon - good growing period",northeast:"Continuous rain - protect from rot",hills:"Misty and cool - perfect for ferns and shade plants"}},September:{season:"Late Monsoon",seasonEmoji:"🍁",flowers:[{name:"Coreopsis",emoji:"🌼",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"55-65 days",description:"Tickseed with cheerful yellow blooms"},{name:"Torenia",emoji:"💜",sunlight:"Partial Shade",water:"Moderate",difficulty:"Easy",bloomTime:"45-55 days",description:"Wishbone flower for shaded areas"},{name:"Celosia",emoji:"🔴",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Crested and plume varieties available"},{name:"Ageratum",emoji:"💙",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"50-60 days",description:"Fluffy blue flower clusters"},{name:"Dahlia",emoji:"🌸",sunlight:"Full Sun",water:"Regular",difficulty:"Moderate",bloomTime:"60-90 days",description:"Start tubers now for autumn blooms"}],tips:["Begin pruning monsoon growth","Mix in cow dung compost for nutrients","Start winter flower seeds indoors","Reduce watering as monsoon recedes"],regionNotes:{north:"Monsoon ending - perfect autumn prep time",south:"Transitioning - start winter flowers",east:"Rains reducing - revitalize soil",west:"Post-monsoon - ideal planting window",central:"Pleasant weather returning - expand garden",northeast:"Rains slowing - good planting opportunity",hills:"Autumn colors starting - prepare for cold"}},October:{season:"Autumn",seasonEmoji:"🌻",flowers:[{name:"Calendula",emoji:"🧡",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"45-55 days",description:"Pot marigold with medicinal properties"},{name:"Dahlia",emoji:"🌺",sunlight:"Full Sun",water:"Regular",difficulty:"Moderate",bloomTime:"60-90 days",description:"Stunning variety of colors and forms"},{name:"Chrysanthemum",emoji:"🌼",sunlight:"Full Sun",water:"Moderate",difficulty:"Moderate",bloomTime:"60-75 days",description:"Classic autumn flower for festivals"},{name:"Marigold",emoji:"🌼",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"45-50 days",description:"Essential for Diwali celebrations"},{name:"Cosmos",emoji:"💮",sunlight:"Full Sun",water:"Low",difficulty:"Easy",bloomTime:"50-60 days",description:"Graceful flowers on slender stems"}],tips:["Use 14:14:14 NPK fertilizer for blooms","Morning sun is essential for flowering","Plant now for Diwali flowers","Protect from early morning dew"],regionNotes:{north:"Perfect autumn weather - plant everything",south:"Post-monsoon - excellent planting time",east:"Pleasant and dry - ideal conditions",west:"Comfortable weather - garden expansion time",central:"Festive season prep - focus on marigolds",northeast:"Dry season - regular watering needed",hills:"Cold approaching - plant cold-hardy varieties"}},November:{season:"Early Winter",seasonEmoji:"🍂",flowers:[{name:"Aster",emoji:"💜",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"60-70 days",description:"Star-shaped flowers in many colors"},{name:"Snapdragon",emoji:"🌷",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"65-75 days",description:"Dragon-faced blooms kids love"},{name:"Dianthus",emoji:"💮",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"45-55 days",description:"Sweet-scented pinks and reds"},{name:"Stock",emoji:"🌸",sunlight:"Full Sun",water:"Moderate",difficulty:"Moderate",bloomTime:"70-80 days",description:"Intensely fragrant evening blooms"},{name:"Poppy",emoji:"🌺",sunlight:"Full Sun",water:"Low",difficulty:"Moderate",bloomTime:"80-90 days",description:"Delicate papery petals"}],tips:["Group plants based on water needs","Add vermicompost for better blooms","Protect from cold winds with barriers","Reduce watering frequency"],regionNotes:{north:"Winter setting in - protect tender plants",south:"Mild and pleasant - peak gardening season",east:"Cool and comfortable - excellent for flowers",west:"Pleasant weather - enjoy outdoor gardening",central:"Cooling down - winter flower paradise",northeast:"Dry and cool - water regularly",hills:"Getting cold - mulch heavily for insulation"}},December:{season:"Winter",seasonEmoji:"❄️",flowers:[{name:"Pansy",emoji:"🌸",sunlight:"Full Sun",water:"Moderate",difficulty:"Easy",bloomTime:"45-60 days",description:"Happy faced flowers in endless colors"},{name:"Lobelia",emoji:"💙",sunlight:"Partial Shade",water:"Regular",difficulty:"Moderate",bloomTime:"55-65 days",description:"Trailing blue flowers for edges"},{name:"Cyclamen",emoji:"💮",sunlight:"Partial Shade",water:"Moderate",difficulty:"Advanced",bloomTime:"60-90 days",description:"Elegant swept-back petals"},{name:"Primula",emoji:"🌸",sunlight:"Partial Shade",water:"Regular",difficulty:"Moderate",bloomTime:"50-60 days",description:"Colorful primrose clusters"},{name:"Viola",emoji:"💜",sunlight:"Partial Shade",water:"Moderate",difficulty:"Easy",bloomTime:"45-55 days",description:"Delicate cousin of pansy"}],tips:["Light morning watering only","Protect from harsh fog with polythene covers","Ensure good air circulation","Prepare for January sowing"],regionNotes:{north:"Peak winter - frost protection essential",south:"Best season - cool and comfortable",east:"Foggy mornings - water carefully",west:"Pleasant and cool - enjoy the garden",central:"Cold nights - protect from frost",northeast:"Dry and cold - maintain moisture levels",hills:"Very cold - only hardy alpines survive outdoors"}}},Nz=e=>{switch(e){case"Easy":return"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400";case"Moderate":return"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400";case"Advanced":return"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400";default:return"bg-muted text-muted-foreground"}},Az=()=>{const e=Mm[new Date().getMonth()],[t,r]=S.useState(e),[n,a]=S.useState("north"),s=kz[t],i=I_.find(o=>o.id===n);return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx(gr,{}),c.jsxs("main",{id:"main-content",className:"pt-20",children:[c.jsx("section",{className:"py-8 md:py-12 bg-gradient-to-br from-primary/10 to-accent/5 border-b border-border",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs("nav",{className:"text-sm mb-4",children:[c.jsx("a",{href:"/tools",className:"text-muted-foreground hover:text-primary",children:"Tools"}),c.jsx("span",{className:"mx-2 text-muted-foreground",children:"/"}),c.jsx("span",{className:"text-foreground",children:"Flower Calendar"})]}),c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"🌸 Seasonal Flower Planting Calendar"}),c.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Find the perfect flowers to plant each month in your region of India. Get detailed planting guidance tailored to your local climate."})]})}),c.jsx("section",{className:"py-6 bg-muted/30 border-b border-border sticky top-16 z-40",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[c.jsxs("div",{className:"flex-1 min-w-[200px]",children:[c.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Select Month"}),c.jsxs(kn,{value:t,onValueChange:r,children:[c.jsx(ln,{className:"w-full bg-background",children:c.jsx(Nn,{placeholder:"Choose month"})}),c.jsx(cn,{children:Mm.map(o=>c.jsx(Qe,{value:o,children:o},o))})]})]}),c.jsxs("div",{className:"flex-1 min-w-[250px]",children:[c.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Select Region"}),c.jsxs(kn,{value:n,onValueChange:a,children:[c.jsx(ln,{className:"w-full bg-background",children:c.jsx(Nn,{placeholder:"Choose region"})}),c.jsx(cn,{children:I_.map(o=>c.jsx(Qe,{value:o.id,children:o.name},o.id))})]})]})]})})}),c.jsx("section",{className:"py-6",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[c.jsxs(jt,{className:"border-primary/20",children:[c.jsx(nn,{className:"pb-2",children:c.jsxs(an,{className:"text-lg flex items-center gap-2",children:[c.jsx("span",{className:"text-2xl",children:s.seasonEmoji}),t," - ",s.season]})}),c.jsx(It,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:s.regionNotes[n]})})]}),c.jsxs(jt,{className:"border-accent/20",children:[c.jsx(nn,{className:"pb-2",children:c.jsxs(an,{className:"text-lg flex items-center gap-2",children:["📍 ",i==null?void 0:i.name]})}),c.jsxs(It,{children:[c.jsxs("p",{className:"text-sm text-muted-foreground mb-1",children:[c.jsx("strong",{children:"Climate:"})," ",i==null?void 0:i.climate]}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.jsx("strong",{children:"Includes:"})," ",i==null?void 0:i.examples]})]})]})]})})}),c.jsx("section",{className:"py-6",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs("h2",{className:"text-2xl font-display font-bold text-foreground mb-4",children:["🌼 Flowers to Plant in ",t]}),c.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:s.flowers.map(o=>c.jsxs(jt,{className:"hover:shadow-elegant transition-shadow",children:[c.jsxs(nn,{className:"pb-2",children:[c.jsxs(an,{className:"text-lg flex items-center gap-2",children:[c.jsx("span",{className:"text-2xl",children:o.emoji}),o.name]}),c.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium w-fit ${Nz(o.difficulty)}`,children:o.difficulty})]}),c.jsxs(It,{className:"space-y-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:o.description}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{children:"☀️"}),c.jsx("span",{className:"text-muted-foreground",children:o.sunlight})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{children:"💧"}),c.jsx("span",{className:"text-muted-foreground",children:o.water})]}),c.jsxs("div",{className:"col-span-2 flex items-center gap-1",children:[c.jsx("span",{children:"⏱️"}),c.jsxs("span",{className:"text-muted-foreground",children:["Bloom: ",o.bloomTime]})]})]})]})]},o.name))})]})}),c.jsx("section",{className:"py-6 bg-muted/30",children:c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs("h2",{className:"text-2xl font-display font-bold text-foreground mb-4",children:["💡 ",t," Gardening Tips"]}),c.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:s.tips.map((o,l)=>c.jsxs("div",{className:"flex items-start gap-3 bg-background p-4 rounded-lg border border-border",children:[c.jsx("span",{className:"text-primary font-bold",children:"✓"}),c.jsx("p",{className:"text-foreground",children:o})]},l))})]})}),c.jsx("section",{className:"py-8",children:c.jsxs("div",{className:"container mx-auto px-4 text-center",children:[c.jsx("h2",{className:"text-xl font-display font-bold text-foreground mb-4",children:"Explore Other Months"}),c.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:Mm.map(o=>c.jsx("button",{onClick:()=>r(o),className:`px-3 py-1.5 rounded-full text-sm font-medium transition-colors ${t===o?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:o.slice(0,3)},o))})]})}),c.jsx("section",{className:"py-8 border-t border-border",children:c.jsx("div",{className:"container mx-auto px-4 text-center",children:c.jsx("a",{href:"/tools",className:"inline-flex items-center gap-2 text-primary hover:text-primary/80 font-medium",children:"← Back to All Tools"})})})]}),c.jsx(vr,{}),c.jsx(hn,{})]})};var bp="Tabs",[Cz]=Da(bp,[op]),I4=op(),[Pz,d1]=Cz(bp),F4=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:s,orientation:i="horizontal",dir:o,activationMode:l="automatic",...u}=e,f=sp(o),[d,h]=ji({prop:n,onChange:a,defaultProp:s??"",caller:bp});return c.jsx(Pz,{scope:r,baseId:Oa(),value:d,onValueChange:h,orientation:i,dir:f,activationMode:l,children:c.jsx(Ze.div,{dir:f,"data-orientation":i,...u,ref:t})})});F4.displayName=bp;var D4="TabsList",M4=S.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,s=d1(D4,r),i=I4(r);return c.jsx(KN,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:c.jsx(Ze.div,{role:"tablist","aria-orientation":s.orientation,...a,ref:t})})});M4.displayName=D4;var L4="TabsTrigger",B4=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...s}=e,i=d1(L4,r),o=I4(r),l=z4(i.baseId,n),u=H4(i.baseId,n),f=n===i.value;return c.jsx(YN,{asChild:!0,...o,focusable:!a,active:f,children:c.jsx(Ze.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l,...s,ref:t,onMouseDown:Pe(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:Pe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:Pe(e.onFocus,()=>{const d=i.activationMode!=="manual";!f&&!a&&d&&i.onValueChange(n)})})})});B4.displayName=L4;var U4="TabsContent",$4=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:a,children:s,...i}=e,o=d1(U4,r),l=z4(o.baseId,n),u=H4(o.baseId,n),f=n===o.value,d=S.useRef(f);return S.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),c.jsx(Ma,{present:a||f,children:({present:h})=>c.jsx(Ze.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&s})})});$4.displayName=U4;function z4(e,t){return`${e}-trigger-${t}`}function H4(e,t){return`${e}-content-${t}`}var Oz=F4,q4=M4,W4=B4,V4=$4;const G4=Oz,h1=S.forwardRef(({className:e,...t},r)=>c.jsx(q4,{ref:r,className:je("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));h1.displayName=q4.displayName;const bo=S.forwardRef(({className:e,...t},r)=>c.jsx(W4,{ref:r,className:je("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));bo.displayName=W4.displayName;const _o=S.forwardRef(({className:e,...t},r)=>c.jsx(V4,{ref:r,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_o.displayName=V4.displayName;var jz=Symbol("radix.slottable");function Rz(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=jz,t}var K4="AlertDialog",[Iz]=Da(K4,[ZA]),Ms=ZA(),Y4=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ms(t);return c.jsx(mC,{...n,...r,modal:!0})};Y4.displayName=K4;var Fz="AlertDialogTrigger",Dz=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ms(r);return c.jsx(i9,{...a,...n,ref:t})});Dz.displayName=Fz;var Mz="AlertDialogPortal",X4=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ms(t);return c.jsx(gC,{...n,...r})};X4.displayName=Mz;var Lz="AlertDialogOverlay",J4=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ms(r);return c.jsx(Zy,{...a,...n,ref:t})});J4.displayName=Lz;var zl="AlertDialogContent",[Bz,Uz]=Iz(zl),$z=Rz("AlertDialogContent"),Q4=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...a}=e,s=Ms(r),i=S.useRef(null),o=Tt(t,i),l=S.useRef(null);return c.jsx(r9,{contentName:zl,titleName:Z4,docsSlug:"alert-dialog",children:c.jsx(Bz,{scope:r,cancelRef:l,children:c.jsxs(e1,{role:"alertdialog",...s,...a,ref:o,onOpenAutoFocus:Pe(a.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx($z,{children:n}),c.jsx(Hz,{contentRef:i})]})})})});Q4.displayName=zl;var Z4="AlertDialogTitle",eP=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ms(r);return c.jsx(t1,{...a,...n,ref:t})});eP.displayName=Z4;var tP="AlertDialogDescription",rP=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ms(r);return c.jsx(r1,{...a,...n,ref:t})});rP.displayName=tP;var zz="AlertDialogAction",nP=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ms(r);return c.jsx(n1,{...a,...n,ref:t})});nP.displayName=zz;var aP="AlertDialogCancel",sP=S.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=Uz(aP,r),s=Ms(r),i=Tt(t,a);return c.jsx(n1,{...s,...n,ref:i})});sP.displayName=aP;var Hz=({contentRef:e})=>{const t=`\`${zl}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${zl}\` by passing a \`${tP}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${zl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},qz=Y4,Wz=X4,iP=J4,oP=Q4,lP=nP,cP=sP,uP=eP,fP=rP;const Lm=qz,Vz=Wz,dP=S.forwardRef(({className:e,...t},r)=>c.jsx(iP,{className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));dP.displayName=iP.displayName;const mh=S.forwardRef(({className:e,...t},r)=>c.jsxs(Vz,{children:[c.jsx(dP,{}),c.jsx(oP,{ref:r,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));mh.displayName=oP.displayName;const gh=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});gh.displayName="AlertDialogHeader";const vh=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vh.displayName="AlertDialogFooter";const xh=S.forwardRef(({className:e,...t},r)=>c.jsx(uP,{ref:r,className:je("text-lg font-semibold",e),...t}));xh.displayName=uP.displayName;const yh=S.forwardRef(({className:e,...t},r)=>c.jsx(fP,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));yh.displayName=fP.displayName;const wh=S.forwardRef(({className:e,...t},r)=>c.jsx(lP,{ref:r,className:je(Uy(),e),...t}));wh.displayName=lP.displayName;const bh=S.forwardRef(({className:e,...t},r)=>c.jsx(cP,{ref:r,className:je(Uy({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));bh.displayName=cP.displayName;/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var hP=1252,Gz=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],p1={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},m1=function(e){Gz.indexOf(e)!=-1&&(hP=p1[0]=e)};function Kz(){m1(1252)}var Na=function(e){m1(e)};function pP(){Na(1200),Kz()}function F_(e){for(var t=[],r=0,n=e.length;r<n;++r)t[r]=e.charCodeAt(r);return t}function Yz(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}function mP(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}var hu=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return t==255&&r==254?Yz(e.slice(2)):t==254&&r==255?mP(e.slice(2)):t==65279?e.slice(1):e},Dd=function(t){return String.fromCharCode(t)},D_=function(t){return String.fromCharCode(t)},yf,gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function M_(e){for(var t="",r=0,n=0,a=0,s=0,i=0,o=0,l=0,u=0;u<e.length;)r=e.charCodeAt(u++),s=r>>2,n=e.charCodeAt(u++),i=(r&3)<<4|n>>4,a=e.charCodeAt(u++),o=(n&15)<<2|a>>6,l=a&63,isNaN(n)?o=l=64:isNaN(a)&&(l=64),t+=gi.charAt(s)+gi.charAt(i)+gi.charAt(o)+gi.charAt(l);return t}function qn(e){var t="",r=0,n=0,a=0,s=0,i=0,o=0,l=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var u=0;u<e.length;)s=gi.indexOf(e.charAt(u++)),i=gi.indexOf(e.charAt(u++)),r=s<<2|i>>4,t+=String.fromCharCode(r),o=gi.indexOf(e.charAt(u++)),n=(i&15)<<4|o>>2,o!==64&&(t+=String.fromCharCode(n)),l=gi.indexOf(e.charAt(u++)),a=(o&3)<<6|l,l!==64&&(t+=String.fromCharCode(a));return t}var gt=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Ho=function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}}();function Di(e){return gt?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function L_(e){return gt?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var ka=function(t){return gt?Ho(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function qo(e){if(Array.isArray(e))return e.map(function(n){return String.fromCharCode(n)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function g1(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return g1(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var ai=gt?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Ho(t)}))}:function(e){if(typeof Uint8Array<"u"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var n=new Uint8Array(r),a=0;for(t=0,r=0;t<e.length;r+=a,++t)if(a=e[t].length,e[t]instanceof Uint8Array)n.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";n.set(new Uint8Array(e[t]),r)}return n}return[].concat.apply([],e.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function Xz(e){for(var t=[],r=0,n=e.length+250,a=Di(e.length+255),s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i<128)a[r++]=i;else if(i<2048)a[r++]=192|i>>6&31,a[r++]=128|i&63;else if(i>=55296&&i<57344){i=(i&1023)+64;var o=e.charCodeAt(++s)&1023;a[r++]=240|i>>8&7,a[r++]=128|i>>2&63,a[r++]=128|o>>6&15|(i&3)<<4,a[r++]=128|o&63}else a[r++]=224|i>>12&15,a[r++]=128|i>>6&63,a[r++]=128|i&63;r>n&&(t.push(a.slice(0,r)),r=0,a=Di(65535),n=65530)}return t.push(a.slice(0,r)),ai(t)}var dn=/\u0000/g,pu=/[\u0001-\u0006]/g;function Hl(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function Aa(e,t){var r=""+e;return r.length>=t?r:Qt("0",t-r.length)+r}function v1(e,t){var r=""+e;return r.length>=t?r:Qt(" ",t-r.length)+r}function d0(e,t){var r=""+e;return r.length>=t?r:r+Qt(" ",t-r.length)}function Jz(e,t){var r=""+Math.round(e);return r.length>=t?r:Qt("0",t-r.length)+r}function Qz(e,t){var r=""+e;return r.length>=t?r:Qt("0",t-r.length)+r}var B_=Math.pow(2,32);function ol(e,t){if(e>B_||e<-B_)return Jz(e,t);var r=Math.round(e);return Qz(r,t)}function h0(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 U_=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],Bm=[["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 Zz(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 rt={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"秒 "'},$_={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},eH={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 p0(e,t,r){for(var n=e<0?-1:1,a=e*n,s=0,i=1,o=0,l=1,u=0,f=0,d=Math.floor(a);u<t&&(d=Math.floor(a),o=d*i+s,f=d*u+l,!(a-d<5e-8));)a=1/(a-d),s=i,i=o,l=u,u=f;if(f>t&&(u>t?(f=l,o=s):(f=u,o=i)),!r)return[0,n*o,f];var h=Math.floor(n*o/f);return[h,n*o-h*f,f]}function lo(e,t,r){if(e>2958465||e<0)return null;var n=e|0,a=Math.floor(86400*(e-n)),s=0,i=[],o={D:n,T:a,u:86400*(e-n)-a,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),t&&t.date1904&&(n+=1462),o.u>.9999&&(o.u=0,++a==86400&&(o.T=a=0,++n,++o.D)),n===60)i=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)i=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),i=[l.getFullYear(),l.getMonth()+1,l.getDate()],s=l.getDay(),n<60&&(s=(s+6)%7),r&&(s=iH(l,i))}return o.y=i[0],o.m=i[1],o.d=i[2],o.S=a%60,a=Math.floor(a/60),o.M=a%60,a=Math.floor(a/60),o.H=a,o.q=s,o}var gP=new Date(1899,11,31,0,0,0),tH=gP.getTime(),rH=new Date(1900,2,1,0,0,0);function vP(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=rH&&(r+=24*60*60*1e3),(r-(tH+(e.getTimezoneOffset()-gP.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function x1(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function nH(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function aH(e){var t=e<0?12:11,r=x1(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function sH(e){var t=x1(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function wf(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=aH(e):t===10?r=e.toFixed(10).substr(0,12):r=sH(e),x1(nH(r.toUpperCase()))}function Fo(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):wf(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return la(14,vP(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function iH(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function oH(e,t,r,n){var a="",s=0,i=0,o=r.y,l,u=0;switch(e){case 98:o=r.y+543;case 121:switch(t.length){case 1:case 2:l=o%100,u=2;break;default:l=o%1e4,u=4;break}break;case 109:switch(t.length){case 1:case 2:l=r.m,u=t.length;break;case 3:return Bm[r.m-1][1];case 5:return Bm[r.m-1][0];default:return Bm[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:l=r.d,u=t.length;break;case 3:return U_[r.q][0];default:return U_[r.q][1]}break;case 104:switch(t.length){case 1:case 2:l=1+(r.H+11)%12,u=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:l=r.H,u=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:l=r.M,u=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")?Aa(r.S,t.length):(n>=2?i=n===3?1e3:100:i=n===1?10:1,s=Math.round(i*(r.S+r.u)),s>=60*i&&(s=0),t==="s"?s===0?"0":""+s/i:(a=Aa(s,2+n),t==="ss"?a.substr(0,2):"."+a.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":l=r.D*24+r.H;break;case"[m]":case"[mm]":l=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":l=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}u=t.length===3?1:2;break;case 101:l=o,u=1;break}var f=u>0?Aa(l,u):"";return f}function vi(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,n=e.substr(0,r);r!=e.length;r+=t)n+=(n.length>0?",":"")+e.substr(r,t);return n}var xP=/%/g;function lH(e,t,r){var n=t.replace(xP,""),a=t.length-n.length;return Ss(e,n,r*Math.pow(10,2*a))+Qt("%",a)}function cH(e,t,r){for(var n=t.length-1;t.charCodeAt(n-1)===44;)--n;return Ss(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function yP(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+yP(e,-t);var a=e.indexOf(".");a===-1&&(a=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%a;if(s<0&&(s+=a),r=(t/Math.pow(10,s)).toPrecision(n+1+(a+s)%a),r.indexOf("e")===-1){var i=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,a)+"."+r.substr(2+a),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,u,f){return l+u+f.substr(0,(a+s)%a)+"."+f.substr(s)+"E"})}else r=t.toExponential(n);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 wP=/# (\?+)( ?)\/( ?)(\d+)/;function uH(e,t,r){var n=parseInt(e[4],10),a=Math.round(t*n),s=Math.floor(a/n),i=a-s*n,o=n;return r+(s===0?"":""+s)+" "+(i===0?Qt(" ",e[1].length+1+e[4].length):v1(i,e[1].length)+e[2]+"/"+e[3]+Aa(o,e[4].length))}function fH(e,t,r){return r+(t===0?"":""+t)+Qt(" ",e[1].length+2+e[4].length)}var bP=/^#*0*\.([0#]+)/,_P=/\).*[0#]/,EP=/\(###\) ###\\?-####/;function sn(e){for(var t="",r,n=0;n!=e.length;++n)switch(r=e.charCodeAt(n)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function z_(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function H_(e,t){var r=e-Math.floor(e),n=Math.pow(10,t);return t<(""+Math.round(r*n)).length?0:Math.round(r*n)}function dH(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function hH(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function Xn(e,t,r){if(e.charCodeAt(0)===40&&!t.match(_P)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Xn("n",n,r):"("+Xn("n",n,-r)+")"}if(t.charCodeAt(t.length-1)===44)return cH(e,t,r);if(t.indexOf("%")!==-1)return lH(e,t,r);if(t.indexOf("E")!==-1)return yP(t,r);if(t.charCodeAt(0)===36)return"$"+Xn(e,t.substr(t.charAt(1)==" "?2:1),r);var a,s,i,o,l=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+ol(l,t.length);if(t.match(/^[#?]+$/))return a=ol(r,0),a==="0"&&(a=""),a.length>t.length?a:sn(t.substr(0,t.length-a.length))+a;if(s=t.match(wP))return uH(s,l,u);if(t.match(/^#+0+$/))return u+ol(l,t.length-t.indexOf("0"));if(s=t.match(bP))return a=z_(r,s[1].length).replace(/^([^\.]+)$/,"$1."+sn(s[1])).replace(/\.$/,"."+sn(s[1])).replace(/\.(\d*)$/,function(v,m){return"."+m+Qt("0",sn(s[1]).length-m.length)}),t.indexOf("0.")!==-1?a:a.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return u+z_(l,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return u+vi(ol(l,0));if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Xn(e,t,-r):vi(""+(Math.floor(r)+dH(r,s[1].length)))+"."+Aa(H_(r,s[1].length),s[1].length);if(s=t.match(/^#,#*,#0/))return Xn(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return a=Hl(Xn(e,t.replace(/[\\-]/g,""),r)),i=0,Hl(Hl(t.replace(/\\/g,"")).replace(/[0#]/g,function(v){return i<a.length?a.charAt(i++):v==="0"?"0":""}));if(t.match(EP))return a=Xn(e,"##########",r),"("+a.substr(0,3)+") "+a.substr(3,3)+"-"+a.substr(6);var f="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),o=p0(l,Math.pow(10,i)-1,!1),a=""+u,f=Ss("n",s[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),a+=f+s[2]+"/"+s[3],f=d0(o[2],i),f.length<s[4].length&&(f=sn(s[4].substr(s[4].length-f.length))+f),a+=f,a;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),o=p0(l,Math.pow(10,i)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?v1(o[1],i)+s[2]+"/"+s[3]+d0(o[2],i):Qt(" ",2*i+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return a=ol(r,0),t.length<=a.length?a:sn(t.substr(0,t.length-a.length))+a;if(s=t.match(/^([#0?]+)\.([#0]+)$/)){a=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=a.indexOf(".");var d=t.indexOf(".")-i,h=t.length-a.length-d;return sn(t.substr(0,d)+a+t.substr(t.length-h))}if(s=t.match(/^00,000\.([#0]*0)$/))return i=H_(r,s[1].length),r<0?"-"+Xn(e,t,-r):vi(hH(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?Aa(0,3-v.length):"")+v})+"."+Aa(i,s[1].length);switch(t){case"###,##0.00":return Xn(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var p=vi(ol(l,0));return p!=="0"?u+p:"";case"###,###.00":return Xn(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return Xn(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function pH(e,t,r){for(var n=t.length-1;t.charCodeAt(n-1)===44;)--n;return Ss(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}function mH(e,t,r){var n=t.replace(xP,""),a=t.length-n.length;return Ss(e,n,r*Math.pow(10,2*a))+Qt("%",a)}function SP(e,t){var r,n=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+SP(e,-t);var a=e.indexOf(".");a===-1&&(a=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%a;if(s<0&&(s+=a),r=(t/Math.pow(10,s)).toPrecision(n+1+(a+s)%a),!r.match(/[Ee]/)){var i=Math.floor(Math.log(t)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,u,f){return l+u+f.substr(0,(a+s)%a)+"."+f.substr(s)+"E"})}else r=t.toExponential(n);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 Ha(e,t,r){if(e.charCodeAt(0)===40&&!t.match(_P)){var n=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Ha("n",n,r):"("+Ha("n",n,-r)+")"}if(t.charCodeAt(t.length-1)===44)return pH(e,t,r);if(t.indexOf("%")!==-1)return mH(e,t,r);if(t.indexOf("E")!==-1)return SP(t,r);if(t.charCodeAt(0)===36)return"$"+Ha(e,t.substr(t.charAt(1)==" "?2:1),r);var a,s,i,o,l=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+Aa(l,t.length);if(t.match(/^[#?]+$/))return a=""+r,r===0&&(a=""),a.length>t.length?a:sn(t.substr(0,t.length-a.length))+a;if(s=t.match(wP))return fH(s,l,u);if(t.match(/^#+0+$/))return u+Aa(l,t.length-t.indexOf("0"));if(s=t.match(bP))return a=(""+r).replace(/^([^\.]+)$/,"$1."+sn(s[1])).replace(/\.$/,"."+sn(s[1])),a=a.replace(/\.(\d*)$/,function(v,m){return"."+m+Qt("0",sn(s[1]).length-m.length)}),t.indexOf("0.")!==-1?a:a.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return u+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return u+vi(""+l);if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Ha(e,t,-r):vi(""+r)+"."+Qt("0",s[1].length);if(s=t.match(/^#,#*,#0/))return Ha(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return a=Hl(Ha(e,t.replace(/[\\-]/g,""),r)),i=0,Hl(Hl(t.replace(/\\/g,"")).replace(/[0#]/g,function(v){return i<a.length?a.charAt(i++):v==="0"?"0":""}));if(t.match(EP))return a=Ha(e,"##########",r),"("+a.substr(0,3)+") "+a.substr(3,3)+"-"+a.substr(6);var f="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),o=p0(l,Math.pow(10,i)-1,!1),a=""+u,f=Ss("n",s[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),a+=f+s[2]+"/"+s[3],f=d0(o[2],i),f.length<s[4].length&&(f=sn(s[4].substr(s[4].length-f.length))+f),a+=f,a;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),o=p0(l,Math.pow(10,i)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?v1(o[1],i)+s[2]+"/"+s[3]+d0(o[2],i):Qt(" ",2*i+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return a=""+r,t.length<=a.length?a:sn(t.substr(0,t.length-a.length))+a;if(s=t.match(/^([#0]+)\.([#0]+)$/)){a=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=a.indexOf(".");var d=t.indexOf(".")-i,h=t.length-a.length-d;return sn(t.substr(0,d)+a+t.substr(t.length-h))}if(s=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Ha(e,t,-r):vi(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?Aa(0,3-v.length):"")+v})+"."+Aa(0,s[1].length);switch(t){case"###,###":case"##,###":case"#,###":var p=vi(""+l);return p!=="0"?u+p:"";default:if(t.match(/\.[0#?]*$/))return Ha(e,t.slice(0,t.lastIndexOf(".")),r)+sn(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function Ss(e,t,r){return(r|0)===r?Ha(e,t,r):Xn(e,t,r)}function gH(e){for(var t=[],r=!1,n=0,a=0;n<e.length;++n)switch(e.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:t[t.length]=e.substr(a,n-a),a=n+1}if(t[t.length]=e.substr(a),r===!0)throw new Error("Format |"+e+"| unterminated string ");return t}var TP=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function Nc(e){for(var t=0,r="",n="";t<e.length;)switch(r=e.charAt(t)){case"G":h0(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(n=r;e.charAt(t++)!=="]"&&t<e.length;)n+=e.charAt(t);if(n.match(TP))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 vH(e,t,r,n){for(var a=[],s="",i=0,o="",l="t",u,f,d,h="H";i<e.length;)switch(o=e.charAt(i)){case"G":if(!h0(e,i))throw new Error("unrecognized character "+o+" in "+e);a[a.length]={t:"G",v:"General"},i+=7;break;case'"':for(s="";(d=e.charCodeAt(++i))!==34&&i<e.length;)s+=String.fromCharCode(d);a[a.length]={t:"t",v:s},++i;break;case"\\":var p=e.charAt(++i),v=p==="("||p===")"?p:"t";a[a.length]={t:v,v:p},++i;break;case"_":a[a.length]={t:"t",v:" "},i+=2;break;case"@":a[a.length]={t:"T",v:t},++i;break;case"B":case"b":if(e.charAt(i+1)==="1"||e.charAt(i+1)==="2"){if(u==null&&(u=lo(t,r,e.charAt(i+1)==="2"),u==null))return"";a[a.length]={t:"X",v:e.substr(i,2)},l=o,i+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0||u==null&&(u=lo(t,r),u==null))return"";for(s=o;++i<e.length&&e.charAt(i).toLowerCase()===o;)s+=o;o==="m"&&l.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=h),a[a.length]={t:o,v:s},l=o;break;case"A":case"a":case"上":var m={t:o,v:o};if(u==null&&(u=lo(t,r)),e.substr(i,3).toUpperCase()==="A/P"?(u!=null&&(m.v=u.H>=12?"P":"A"),m.t="T",h="h",i+=3):e.substr(i,5).toUpperCase()==="AM/PM"?(u!=null&&(m.v=u.H>=12?"PM":"AM"),m.t="T",i+=5,h="h"):e.substr(i,5).toUpperCase()==="上午/下午"?(u!=null&&(m.v=u.H>=12?"下午":"上午"),m.t="T",i+=5,h="h"):(m.t="t",++i),u==null&&m.t==="T")return"";a[a.length]=m,l=o;break;case"[":for(s=o;e.charAt(i++)!=="]"&&i<e.length;)s+=e.charAt(i);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(TP)){if(u==null&&(u=lo(t,r),u==null))return"";a[a.length]={t:"Z",v:s.toLowerCase()},l=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",Nc(e)||(a[a.length]={t:"t",v:s}));break;case".":if(u!=null){for(s=o;++i<e.length&&(o=e.charAt(i))==="0";)s+=o;a[a.length]={t:"s",v:s};break}case"0":case"#":for(s=o;++i<e.length&&"0#?.,E+-%".indexOf(o=e.charAt(i))>-1;)s+=o;a[a.length]={t:"n",v:s};break;case"?":for(s=o;e.charAt(++i)===o;)s+=o;a[a.length]={t:o,v:s},l=o;break;case"*":++i,(e.charAt(i)==" "||e.charAt(i)=="*")&&++i;break;case"(":case")":a[a.length]={t:n===1?"t":o,v:o},++i;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=o;i<e.length&&"0123456789".indexOf(e.charAt(++i))>-1;)s+=e.charAt(i);a[a.length]={t:"D",v:s};break;case" ":a[a.length]={t:o,v:o},++i;break;case"$":a[a.length]={t:"t",v:"$"},++i;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+e);a[a.length]={t:"t",v:o},++i;break}var g=0,x=0,y;for(i=a.length-1,l="t";i>=0;--i)switch(a[i].t){case"h":case"H":a[i].t=h,l="h",g<1&&(g=1);break;case"s":(y=a[i].v.match(/\.0+$/))&&(x=Math.max(x,y[0].length-1)),g<3&&(g=3);case"d":case"y":case"M":case"e":l=a[i].t;break;case"m":l==="s"&&(a[i].t="M",g<2&&(g=2));break;case"X":break;case"Z":g<1&&a[i].v.match(/[Hh]/)&&(g=1),g<2&&a[i].v.match(/[Mm]/)&&(g=2),g<3&&a[i].v.match(/[Ss]/)&&(g=3)}switch(g){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var w="",b;for(i=0;i<a.length;++i)switch(a[i].t){case"t":case"T":case" ":case"D":break;case"X":a[i].v="",a[i].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":a[i].v=oH(a[i].t.charCodeAt(0),a[i].v,u,x),a[i].t="t";break;case"n":case"?":for(b=i+1;a[b]!=null&&((o=a[b].t)==="?"||o==="D"||(o===" "||o==="t")&&a[b+1]!=null&&(a[b+1].t==="?"||a[b+1].t==="t"&&a[b+1].v==="/")||a[i].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(a[b].v==="/"||a[b].v===" "&&a[b+1]!=null&&a[b+1].t=="?"));)a[i].v+=a[b].v,a[b]={v:"",t:";"},++b;w+=a[i].v,i=b-1;break;case"G":a[i].t="t",a[i].v=Fo(t,r);break}var _="",T,E;if(w.length>0){w.charCodeAt(0)==40?(T=t<0&&w.charCodeAt(0)===45?-t:t,E=Ss("n",w,T)):(T=t<0&&n>1?-t:t,E=Ss("n",w,T),T<0&&a[0]&&a[0].t=="t"&&(E=E.substr(1),a[0].v="-"+a[0].v)),b=E.length-1;var C=a.length;for(i=0;i<a.length;++i)if(a[i]!=null&&a[i].t!="t"&&a[i].v.indexOf(".")>-1){C=i;break}var P=a.length;if(C===a.length&&E.indexOf("E")===-1){for(i=a.length-1;i>=0;--i)a[i]==null||"n?".indexOf(a[i].t)===-1||(b>=a[i].v.length-1?(b-=a[i].v.length,a[i].v=E.substr(b+1,a[i].v.length)):b<0?a[i].v="":(a[i].v=E.substr(0,b+1),b=-1),a[i].t="t",P=i);b>=0&&P<a.length&&(a[P].v=E.substr(0,b+1)+a[P].v)}else if(C!==a.length&&E.indexOf("E")===-1){for(b=E.indexOf(".")-1,i=C;i>=0;--i)if(!(a[i]==null||"n?".indexOf(a[i].t)===-1)){for(f=a[i].v.indexOf(".")>-1&&i===C?a[i].v.indexOf(".")-1:a[i].v.length-1,_=a[i].v.substr(f+1);f>=0;--f)b>=0&&(a[i].v.charAt(f)==="0"||a[i].v.charAt(f)==="#")&&(_=E.charAt(b--)+_);a[i].v=_,a[i].t="t",P=i}for(b>=0&&P<a.length&&(a[P].v=E.substr(0,b+1)+a[P].v),b=E.indexOf(".")+1,i=C;i<a.length;++i)if(!(a[i]==null||"n?(".indexOf(a[i].t)===-1&&i!==C)){for(f=a[i].v.indexOf(".")>-1&&i===C?a[i].v.indexOf(".")+1:0,_=a[i].v.substr(0,f);f<a[i].v.length;++f)b<E.length&&(_+=E.charAt(b++));a[i].v=_,a[i].t="t",P=i}}}for(i=0;i<a.length;++i)a[i]!=null&&"n?".indexOf(a[i].t)>-1&&(T=n>1&&t<0&&i>0&&a[i-1].v==="-"?-t:t,a[i].v=Ss(a[i].t,a[i].v,T),a[i].t="t");var N="";for(i=0;i!==a.length;++i)a[i]!=null&&(N+=a[i].v);return N}var q_=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function W_(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 xH(e,t){var r=gH(e),n=r.length,a=r[n-1].indexOf("@");if(n<4&&a>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof t!="number")return[4,r.length===4||a>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=a>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=a>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=a>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=t>0?r[0]:t<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var i=r[0].match(q_),o=r[1].match(q_);return W_(t,i)?[n,r[0]]:W_(t,o)?[n,r[1]]:[n,r[i!=null&&o!=null?2:1]]}return[n,s]}function la(e,t,r){r==null&&(r={});var n="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?n=r.dateNF:n=e;break;case"number":e==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:rt)[e],n==null&&(n=r.table&&r.table[$_[e]]||rt[$_[e]]),n==null&&(n=eH[e]||"General");break}if(h0(n,0))return Fo(t,r);t instanceof Date&&(t=vP(t,r.date1904));var a=xH(n,t);if(h0(a[1]))return Fo(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return vH(a[1],t,r,a[0])}function Eo(e,t){if(typeof t!="number"){t=+t||-1;for(var r=0;r<392;++r){if(rt[r]==null){t<0&&(t=r);continue}if(rt[r]==e){t=r;break}}t<0&&(t=391)}return rt[t]=e,t}function kP(){rt=Zz()}var yH={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},NP=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function wH(e){var t=typeof e=="number"?rt[e]:e;return t=t.replace(NP,"(\\d+)"),new RegExp("^"+t+"$")}function bH(e,t,r){var n=-1,a=-1,s=-1,i=-1,o=-1,l=-1;(t.match(NP)||[]).forEach(function(d,h){var p=parseInt(r[h+1],10);switch(d.toLowerCase().charAt(0)){case"y":n=p;break;case"d":s=p;break;case"h":i=p;break;case"s":l=p;break;case"m":i>=0?o=p:a=p;break}}),l>=0&&o==-1&&a>=0&&(o=a,a=-1);var u=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(a>=1?a:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var f=("00"+(i>=0?i:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return i==-1&&o==-1&&l==-1?u:n==-1&&a==-1&&s==-1?f:u+"T"+f}var _H=function(){var e={};e.version="1.2.0";function t(){for(var E=0,C=new Array(256),P=0;P!=256;++P)E=P,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,C[P]=E;return typeof Int32Array<"u"?new Int32Array(C):C}var r=t();function n(E){var C=0,P=0,N=0,k=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(N=0;N!=256;++N)k[N]=E[N];for(N=0;N!=256;++N)for(P=E[N],C=256+N;C<4096;C+=256)P=k[C]=P>>>8^E[P&255];var A=[];for(N=1;N!=16;++N)A[N-1]=typeof Int32Array<"u"?k.subarray(N*256,N*256+256):k.slice(N*256,N*256+256);return A}var a=n(r),s=a[0],i=a[1],o=a[2],l=a[3],u=a[4],f=a[5],d=a[6],h=a[7],p=a[8],v=a[9],m=a[10],g=a[11],x=a[12],y=a[13],w=a[14];function b(E,C){for(var P=C^-1,N=0,k=E.length;N<k;)P=P>>>8^r[(P^E.charCodeAt(N++))&255];return~P}function _(E,C){for(var P=C^-1,N=E.length-15,k=0;k<N;)P=w[E[k++]^P&255]^y[E[k++]^P>>8&255]^x[E[k++]^P>>16&255]^g[E[k++]^P>>>24]^m[E[k++]]^v[E[k++]]^p[E[k++]]^h[E[k++]]^d[E[k++]]^f[E[k++]]^u[E[k++]]^l[E[k++]]^o[E[k++]]^i[E[k++]]^s[E[k++]]^r[E[k++]];for(N+=15;k<N;)P=P>>>8^r[(P^E[k++])&255];return~P}function T(E,C){for(var P=C^-1,N=0,k=E.length,A=0,I=0;N<k;)A=E.charCodeAt(N++),A<128?P=P>>>8^r[(P^A)&255]:A<2048?(P=P>>>8^r[(P^(192|A>>6&31))&255],P=P>>>8^r[(P^(128|A&63))&255]):A>=55296&&A<57344?(A=(A&1023)+64,I=E.charCodeAt(N++)&1023,P=P>>>8^r[(P^(240|A>>8&7))&255],P=P>>>8^r[(P^(128|A>>2&63))&255],P=P>>>8^r[(P^(128|I>>6&15|(A&3)<<4))&255],P=P>>>8^r[(P^(128|I&63))&255]):(P=P>>>8^r[(P^(224|A>>12&15))&255],P=P>>>8^r[(P^(128|A>>6&63))&255],P=P>>>8^r[(P^(128|A&63))&255]);return~P}return e.table=r,e.bstr=b,e.buf=_,e.str=T,e}(),yt=function(){var t={};t.version="1.2.1";function r(q,te){for(var K=q.split("/"),J=te.split("/"),ee=0,re=0,fe=Math.min(K.length,J.length);ee<fe;++ee){if(re=K[ee].length-J[ee].length)return re;if(K[ee]!=J[ee])return K[ee]<J[ee]?-1:1}return K.length-J.length}function n(q){if(q.charAt(q.length-1)=="/")return q.slice(0,-1).indexOf("/")===-1?q:n(q.slice(0,-1));var te=q.lastIndexOf("/");return te===-1?q:q.slice(0,te+1)}function a(q){if(q.charAt(q.length-1)=="/")return a(q.slice(0,-1));var te=q.lastIndexOf("/");return te===-1?q:q.slice(te+1)}function s(q,te){typeof te=="string"&&(te=new Date(te));var K=te.getHours();K=K<<6|te.getMinutes(),K=K<<5|te.getSeconds()>>>1,q.write_shift(2,K);var J=te.getFullYear()-1980;J=J<<4|te.getMonth()+1,J=J<<5|te.getDate(),q.write_shift(2,J)}function i(q){var te=q.read_shift(2)&65535,K=q.read_shift(2)&65535,J=new Date,ee=K&31;K>>>=5;var re=K&15;K>>>=4,J.setMilliseconds(0),J.setFullYear(K+1980),J.setMonth(re-1),J.setDate(ee);var fe=te&31;te>>>=5;var ve=te&63;return te>>>=6,J.setHours(te),J.setMinutes(ve),J.setSeconds(fe<<1),J}function o(q){jr(q,0);for(var te={},K=0;q.l<=q.length-4;){var J=q.read_shift(2),ee=q.read_shift(2),re=q.l+ee,fe={};switch(J){case 21589:K=q.read_shift(1),K&1&&(fe.mtime=q.read_shift(4)),ee>5&&(K&2&&(fe.atime=q.read_shift(4)),K&4&&(fe.ctime=q.read_shift(4))),fe.mtime&&(fe.mt=new Date(fe.mtime*1e3));break}q.l=re,te[J]=fe}return te}var l;function u(){return l||(l={})}function f(q,te){if(q[0]==80&&q[1]==75)return Ot(q,te);if((q[0]|32)==109&&(q[1]|32)==105)return He(q,te);if(q.length<512)throw new Error("CFB file size "+q.length+" < 512");var K=3,J=512,ee=0,re=0,fe=0,ve=0,ce=0,de=[],ae=q.slice(0,512);jr(ae,0);var Y=d(ae);switch(K=Y[0],K){case 3:J=512;break;case 4:J=4096;break;case 0:if(Y[1]==0)return Ot(q,te);default:throw new Error("Major Version: Expected 3 or 4 saw "+K)}J!==512&&(ae=q.slice(0,J),jr(ae,28));var oe=q.slice(0,J);h(ae,K);var ge=ae.read_shift(4,"i");if(K===3&&ge!==0)throw new Error("# Directory Sectors: Expected 0 saw "+ge);ae.l+=4,fe=ae.read_shift(4,"i"),ae.l+=4,ae.chk("00100000","Mini Stream Cutoff Size: "),ve=ae.read_shift(4,"i"),ee=ae.read_shift(4,"i"),ce=ae.read_shift(4,"i"),re=ae.read_shift(4,"i");for(var we=-1,Ae=0;Ae<109&&(we=ae.read_shift(4,"i"),!(we<0));++Ae)de[Ae]=we;var De=p(q,J);g(ce,re,De,J,de);var lt=y(De,fe,de,J);lt[fe].name="!Directory",ee>0&&ve!==I&&(lt[ve].name="!MiniFAT"),lt[de[0]].name="!FAT",lt.fat_addrs=de,lt.ssz=J;var _t={},Ht=[],ls=[],qt=[];w(fe,lt,De,Ht,ee,_t,ls,ve),v(ls,qt,Ht),Ht.shift();var Us={FileIndex:ls,FullPaths:qt};return te&&te.raw&&(Us.raw={header:oe,sectors:De}),Us}function d(q){if(q[q.l]==80&&q[q.l+1]==75)return[0,0];q.chk(M,"Header Signature: "),q.l+=16;var te=q.read_shift(2,"u");return[q.read_shift(2,"u"),te]}function h(q,te){var K=9;switch(q.l+=2,K=q.read_shift(2)){case 9:if(te!=3)throw new Error("Sector Shift: Expected 9 saw "+K);break;case 12:if(te!=4)throw new Error("Sector Shift: Expected 12 saw "+K);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+K)}q.chk("0600","Mini Sector Shift: "),q.chk("000000000000","Reserved: ")}function p(q,te){for(var K=Math.ceil(q.length/te)-1,J=[],ee=1;ee<K;++ee)J[ee-1]=q.slice(ee*te,(ee+1)*te);return J[K-1]=q.slice(K*te),J}function v(q,te,K){for(var J=0,ee=0,re=0,fe=0,ve=0,ce=K.length,de=[],ae=[];J<ce;++J)de[J]=ae[J]=J,te[J]=K[J];for(;ve<ae.length;++ve)J=ae[ve],ee=q[J].L,re=q[J].R,fe=q[J].C,de[J]===J&&(ee!==-1&&de[ee]!==ee&&(de[J]=de[ee]),re!==-1&&de[re]!==re&&(de[J]=de[re])),fe!==-1&&(de[fe]=J),ee!==-1&&J!=de[J]&&(de[ee]=de[J],ae.lastIndexOf(ee)<ve&&ae.push(ee)),re!==-1&&J!=de[J]&&(de[re]=de[J],ae.lastIndexOf(re)<ve&&ae.push(re));for(J=1;J<ce;++J)de[J]===J&&(re!==-1&&de[re]!==re?de[J]=de[re]:ee!==-1&&de[ee]!==ee&&(de[J]=de[ee]));for(J=1;J<ce;++J)if(q[J].type!==0){if(ve=J,ve!=de[ve])do ve=de[ve],te[J]=te[ve]+"/"+te[J];while(ve!==0&&de[ve]!==-1&&ve!=de[ve]);de[J]=-1}for(te[0]+="/",J=1;J<ce;++J)q[J].type!==2&&(te[J]+="/")}function m(q,te,K){for(var J=q.start,ee=q.size,re=[],fe=J;K&&ee>0&&fe>=0;)re.push(te.slice(fe*A,fe*A+A)),ee-=A,fe=ro(K,fe*4);return re.length===0?dr(0):ai(re).slice(0,q.size)}function g(q,te,K,J,ee){var re=I;if(q===I){if(te!==0)throw new Error("DIFAT chain shorter than expected")}else if(q!==-1){var fe=K[q],ve=(J>>>2)-1;if(!fe)return;for(var ce=0;ce<ve&&(re=ro(fe,ce*4))!==I;++ce)ee.push(re);g(ro(fe,J-4),te-1,K,J,ee)}}function x(q,te,K,J,ee){var re=[],fe=[];ee||(ee=[]);var ve=J-1,ce=0,de=0;for(ce=te;ce>=0;){ee[ce]=!0,re[re.length]=ce,fe.push(q[ce]);var ae=K[Math.floor(ce*4/J)];if(de=ce*4&ve,J<4+de)throw new Error("FAT boundary crossed: "+ce+" 4 "+J);if(!q[ae])break;ce=ro(q[ae],de)}return{nodes:re,data:t2([fe])}}function y(q,te,K,J){var ee=q.length,re=[],fe=[],ve=[],ce=[],de=J-1,ae=0,Y=0,oe=0,ge=0;for(ae=0;ae<ee;++ae)if(ve=[],oe=ae+te,oe>=ee&&(oe-=ee),!fe[oe]){ce=[];var we=[];for(Y=oe;Y>=0;){we[Y]=!0,fe[Y]=!0,ve[ve.length]=Y,ce.push(q[Y]);var Ae=K[Math.floor(Y*4/J)];if(ge=Y*4&de,J<4+ge)throw new Error("FAT boundary crossed: "+Y+" 4 "+J);if(!q[Ae]||(Y=ro(q[Ae],ge),we[Y]))break}re[oe]={nodes:ve,data:t2([ce])}}return re}function w(q,te,K,J,ee,re,fe,ve){for(var ce=0,de=J.length?2:0,ae=te[q].data,Y=0,oe=0,ge;Y<ae.length;Y+=128){var we=ae.slice(Y,Y+128);jr(we,64),oe=we.read_shift(2),ge=E1(we,0,oe-de),J.push(ge);var Ae={name:ge,type:we.read_shift(1),color:we.read_shift(1),L:we.read_shift(4,"i"),R:we.read_shift(4,"i"),C:we.read_shift(4,"i"),clsid:we.read_shift(16),state:we.read_shift(4,"i"),start:0,size:0},De=we.read_shift(2)+we.read_shift(2)+we.read_shift(2)+we.read_shift(2);De!==0&&(Ae.ct=b(we,we.l-8));var lt=we.read_shift(2)+we.read_shift(2)+we.read_shift(2)+we.read_shift(2);lt!==0&&(Ae.mt=b(we,we.l-8)),Ae.start=we.read_shift(4,"i"),Ae.size=we.read_shift(4,"i"),Ae.size<0&&Ae.start<0&&(Ae.size=Ae.type=0,Ae.start=I,Ae.name=""),Ae.type===5?(ce=Ae.start,ee>0&&ce!==I&&(te[ce].name="!StreamData")):Ae.size>=4096?(Ae.storage="fat",te[Ae.start]===void 0&&(te[Ae.start]=x(K,Ae.start,te.fat_addrs,te.ssz)),te[Ae.start].name=Ae.name,Ae.content=te[Ae.start].data.slice(0,Ae.size)):(Ae.storage="minifat",Ae.size<0?Ae.size=0:ce!==I&&Ae.start!==I&&te[ce]&&(Ae.content=m(Ae,te[ce].data,(te[ve]||{}).data))),Ae.content&&jr(Ae.content,0),re[ge]=Ae,fe.push(Ae)}}function b(q,te){return new Date((Fn(q,te+4)/1e7*Math.pow(2,32)+Fn(q,te)/1e7-11644473600)*1e3)}function _(q,te){return u(),f(l.readFileSync(q),te)}function T(q,te){var K=te&&te.type;switch(K||gt&&Buffer.isBuffer(q)&&(K="buffer"),K||"base64"){case"file":return _(q,te);case"base64":return f(ka(qn(q)),te);case"binary":return f(ka(q),te)}return f(q,te)}function E(q,te){var K=te||{},J=K.root||"Root Entry";if(q.FullPaths||(q.FullPaths=[]),q.FileIndex||(q.FileIndex=[]),q.FullPaths.length!==q.FileIndex.length)throw new Error("inconsistent CFB structure");q.FullPaths.length===0&&(q.FullPaths[0]=J+"/",q.FileIndex[0]={name:J,type:5}),K.CLSID&&(q.FileIndex[0].clsid=K.CLSID),C(q)}function C(q){var te="Sh33tJ5";if(!yt.find(q,"/"+te)){var K=dr(4);K[0]=55,K[1]=K[3]=50,K[2]=54,q.FileIndex.push({name:te,type:2,content:K,size:4,L:69,R:69,C:69}),q.FullPaths.push(q.FullPaths[0]+te),P(q)}}function P(q,te){E(q);for(var K=!1,J=!1,ee=q.FullPaths.length-1;ee>=0;--ee){var re=q.FileIndex[ee];switch(re.type){case 0:J?K=!0:(q.FileIndex.pop(),q.FullPaths.pop());break;case 1:case 2:case 5:J=!0,isNaN(re.R*re.L*re.C)&&(K=!0),re.R>-1&&re.L>-1&&re.R==re.L&&(K=!0);break;default:K=!0;break}}if(!(!K&&!te)){var fe=new Date(1987,1,19),ve=0,ce=Object.create?Object.create(null):{},de=[];for(ee=0;ee<q.FullPaths.length;++ee)ce[q.FullPaths[ee]]=!0,q.FileIndex[ee].type!==0&&de.push([q.FullPaths[ee],q.FileIndex[ee]]);for(ee=0;ee<de.length;++ee){var ae=n(de[ee][0]);J=ce[ae],J||(de.push([ae,{name:a(ae).replace("/",""),type:1,clsid:W,ct:fe,mt:fe,content:null}]),ce[ae]=!0)}for(de.sort(function(ge,we){return r(ge[0],we[0])}),q.FullPaths=[],q.FileIndex=[],ee=0;ee<de.length;++ee)q.FullPaths[ee]=de[ee][0],q.FileIndex[ee]=de[ee][1];for(ee=0;ee<de.length;++ee){var Y=q.FileIndex[ee],oe=q.FullPaths[ee];if(Y.name=a(oe).replace("/",""),Y.L=Y.R=Y.C=-(Y.color=1),Y.size=Y.content?Y.content.length:0,Y.start=0,Y.clsid=Y.clsid||W,ee===0)Y.C=de.length>1?1:-1,Y.size=0,Y.type=5;else if(oe.slice(-1)=="/"){for(ve=ee+1;ve<de.length&&n(q.FullPaths[ve])!=oe;++ve);for(Y.C=ve>=de.length?-1:ve,ve=ee+1;ve<de.length&&n(q.FullPaths[ve])!=n(oe);++ve);Y.R=ve>=de.length?-1:ve,Y.type=1}else n(q.FullPaths[ee+1]||"")==n(oe)&&(Y.R=ee+1),Y.type=2}}}function N(q,te){var K=te||{};if(K.fileType=="mad")return st(q,K);switch(P(q),K.fileType){case"zip":return Tr(q,K)}var J=function(ge){for(var we=0,Ae=0,De=0;De<ge.FileIndex.length;++De){var lt=ge.FileIndex[De];if(lt.content){var _t=lt.content.length;_t>0&&(_t<4096?we+=_t+63>>6:Ae+=_t+511>>9)}}for(var Ht=ge.FullPaths.length+3>>2,ls=we+7>>3,qt=we+127>>7,Us=ls+Ae+Ht+qt,Ba=Us+127>>7,Rp=Ba<=109?0:Math.ceil((Ba-109)/127);Us+Ba+Rp+127>>7>Ba;)Rp=++Ba<=109?0:Math.ceil((Ba-109)/127);var cs=[1,Rp,Ba,qt,Ht,Ae,we,0];return ge.FileIndex[0].size=we<<6,cs[7]=(ge.FileIndex[0].start=cs[0]+cs[1]+cs[2]+cs[3]+cs[4]+cs[5])+(cs[6]+7>>3),cs}(q),ee=dr(J[7]<<9),re=0,fe=0;{for(re=0;re<8;++re)ee.write_shift(1,U[re]);for(re=0;re<8;++re)ee.write_shift(2,0);for(ee.write_shift(2,62),ee.write_shift(2,3),ee.write_shift(2,65534),ee.write_shift(2,9),ee.write_shift(2,6),re=0;re<3;++re)ee.write_shift(2,0);for(ee.write_shift(4,0),ee.write_shift(4,J[2]),ee.write_shift(4,J[0]+J[1]+J[2]+J[3]-1),ee.write_shift(4,0),ee.write_shift(4,4096),ee.write_shift(4,J[3]?J[0]+J[1]+J[2]-1:I),ee.write_shift(4,J[3]),ee.write_shift(-4,J[1]?J[0]-1:I),ee.write_shift(4,J[1]),re=0;re<109;++re)ee.write_shift(-4,re<J[2]?J[1]+re:-1)}if(J[1])for(fe=0;fe<J[1];++fe){for(;re<236+fe*127;++re)ee.write_shift(-4,re<J[2]?J[1]+re:-1);ee.write_shift(-4,fe===J[1]-1?I:fe+1)}var ve=function(ge){for(fe+=ge;re<fe-1;++re)ee.write_shift(-4,re+1);ge&&(++re,ee.write_shift(-4,I))};for(fe=re=0,fe+=J[1];re<fe;++re)ee.write_shift(-4,G.DIFSECT);for(fe+=J[2];re<fe;++re)ee.write_shift(-4,G.FATSECT);ve(J[3]),ve(J[4]);for(var ce=0,de=0,ae=q.FileIndex[0];ce<q.FileIndex.length;++ce)ae=q.FileIndex[ce],ae.content&&(de=ae.content.length,!(de<4096)&&(ae.start=fe,ve(de+511>>9)));for(ve(J[6]+7>>3);ee.l&511;)ee.write_shift(-4,G.ENDOFCHAIN);for(fe=re=0,ce=0;ce<q.FileIndex.length;++ce)ae=q.FileIndex[ce],ae.content&&(de=ae.content.length,!(!de||de>=4096)&&(ae.start=fe,ve(de+63>>6)));for(;ee.l&511;)ee.write_shift(-4,G.ENDOFCHAIN);for(re=0;re<J[4]<<2;++re){var Y=q.FullPaths[re];if(!Y||Y.length===0){for(ce=0;ce<17;++ce)ee.write_shift(4,0);for(ce=0;ce<3;++ce)ee.write_shift(4,-1);for(ce=0;ce<12;++ce)ee.write_shift(4,0);continue}ae=q.FileIndex[re],re===0&&(ae.start=ae.size?ae.start-1:I);var oe=re===0&&K.root||ae.name;if(de=2*(oe.length+1),ee.write_shift(64,oe,"utf16le"),ee.write_shift(2,de),ee.write_shift(1,ae.type),ee.write_shift(1,ae.color),ee.write_shift(-4,ae.L),ee.write_shift(-4,ae.R),ee.write_shift(-4,ae.C),ae.clsid)ee.write_shift(16,ae.clsid,"hex");else for(ce=0;ce<4;++ce)ee.write_shift(4,0);ee.write_shift(4,ae.state||0),ee.write_shift(4,0),ee.write_shift(4,0),ee.write_shift(4,0),ee.write_shift(4,0),ee.write_shift(4,ae.start),ee.write_shift(4,ae.size),ee.write_shift(4,0)}for(re=1;re<q.FileIndex.length;++re)if(ae=q.FileIndex[re],ae.size>=4096)if(ee.l=ae.start+1<<9,gt&&Buffer.isBuffer(ae.content))ae.content.copy(ee,ee.l,0,ae.size),ee.l+=ae.size+511&-512;else{for(ce=0;ce<ae.size;++ce)ee.write_shift(1,ae.content[ce]);for(;ce&511;++ce)ee.write_shift(1,0)}for(re=1;re<q.FileIndex.length;++re)if(ae=q.FileIndex[re],ae.size>0&&ae.size<4096)if(gt&&Buffer.isBuffer(ae.content))ae.content.copy(ee,ee.l,0,ae.size),ee.l+=ae.size+63&-64;else{for(ce=0;ce<ae.size;++ce)ee.write_shift(1,ae.content[ce]);for(;ce&63;++ce)ee.write_shift(1,0)}if(gt)ee.l=ee.length;else for(;ee.l<ee.length;)ee.write_shift(1,0);return ee}function k(q,te){var K=q.FullPaths.map(function(ce){return ce.toUpperCase()}),J=K.map(function(ce){var de=ce.split("/");return de[de.length-(ce.slice(-1)=="/"?2:1)]}),ee=!1;te.charCodeAt(0)===47?(ee=!0,te=K[0].slice(0,-1)+te):ee=te.indexOf("/")!==-1;var re=te.toUpperCase(),fe=ee===!0?K.indexOf(re):J.indexOf(re);if(fe!==-1)return q.FileIndex[fe];var ve=!re.match(pu);for(re=re.replace(dn,""),ve&&(re=re.replace(pu,"!")),fe=0;fe<K.length;++fe)if((ve?K[fe].replace(pu,"!"):K[fe]).replace(dn,"")==re||(ve?J[fe].replace(pu,"!"):J[fe]).replace(dn,"")==re)return q.FileIndex[fe];return null}var A=64,I=-2,M="d0cf11e0a1b11ae1",U=[208,207,17,224,161,177,26,225],W="00000000000000000000000000000000",G={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:I,FREESECT:-1,HEADER_SIGNATURE:M,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:W,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Q(q,te,K){u();var J=N(q,K);l.writeFileSync(te,J)}function R(q){for(var te=new Array(q.length),K=0;K<q.length;++K)te[K]=String.fromCharCode(q[K]);return te.join("")}function z(q,te){var K=N(q,te);switch(te&&te.type||"buffer"){case"file":return u(),l.writeFileSync(te.filename,K),K;case"binary":return typeof K=="string"?K:R(K);case"base64":return M_(typeof K=="string"?K:R(K));case"buffer":if(gt)return Buffer.isBuffer(K)?K:Ho(K);case"array":return typeof K=="string"?ka(K):K}return K}var D;function O(q){try{var te=q.InflateRaw,K=new te;if(K._processChunk(new Uint8Array([3,0]),K._finishFlushFlag),K.bytesRead)D=q;else throw new Error("zlib does not expose bytesRead")}catch(J){console.error("cannot use native zlib: "+(J.message||J))}}function j(q,te){if(!D)return nr(q,te);var K=D.InflateRaw,J=new K,ee=J._processChunk(q.slice(q.l),J._finishFlushFlag);return q.l+=J.bytesRead,ee}function B(q){return D?D.deflateRawSync(q):Re(q)}var L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=[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],H=[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 Z(q){var te=(q<<1|q<<11)&139536|(q<<5|q<<15)&558144;return(te>>16|te>>8|te)&255}for(var X=typeof Uint8Array<"u",ne=X?new Uint8Array(256):[],he=0;he<256;++he)ne[he]=Z(he);function V(q,te){var K=ne[q&255];return te<=8?K>>>8-te:(K=K<<8|ne[q>>8&255],te<=16?K>>>16-te:(K=K<<8|ne[q>>16&255],K>>>24-te))}function Te(q,te){var K=te&7,J=te>>>3;return(q[J]|(K<=6?0:q[J+1]<<8))>>>K&3}function Ee(q,te){var K=te&7,J=te>>>3;return(q[J]|(K<=5?0:q[J+1]<<8))>>>K&7}function xe(q,te){var K=te&7,J=te>>>3;return(q[J]|(K<=4?0:q[J+1]<<8))>>>K&15}function Se(q,te){var K=te&7,J=te>>>3;return(q[J]|(K<=3?0:q[J+1]<<8))>>>K&31}function pe(q,te){var K=te&7,J=te>>>3;return(q[J]|(K<=1?0:q[J+1]<<8))>>>K&127}function le(q,te,K){var J=te&7,ee=te>>>3,re=(1<<K)-1,fe=q[ee]>>>J;return K<8-J||(fe|=q[ee+1]<<8-J,K<16-J)||(fe|=q[ee+2]<<16-J,K<24-J)||(fe|=q[ee+3]<<24-J),fe&re}function ue(q,te,K){var J=te&7,ee=te>>>3;return J<=5?q[ee]|=(K&7)<<J:(q[ee]|=K<<J&255,q[ee+1]=(K&7)>>8-J),te+3}function me(q,te,K){var J=te&7,ee=te>>>3;return K=(K&1)<<J,q[ee]|=K,te+1}function _e(q,te,K){var J=te&7,ee=te>>>3;return K<<=J,q[ee]|=K&255,K>>>=8,q[ee+1]=K,te+8}function ye(q,te,K){var J=te&7,ee=te>>>3;return K<<=J,q[ee]|=K&255,K>>>=8,q[ee+1]=K&255,q[ee+2]=K>>>8,te+16}function Me(q,te){var K=q.length,J=2*K>te?2*K:te+5,ee=0;if(K>=te)return q;if(gt){var re=L_(J);if(q.copy)q.copy(re);else for(;ee<q.length;++ee)re[ee]=q[ee];return re}else if(X){var fe=new Uint8Array(J);if(fe.set)fe.set(q);else for(;ee<K;++ee)fe[ee]=q[ee];return fe}return q.length=J,q}function Le(q){for(var te=new Array(q),K=0;K<q;++K)te[K]=0;return te}function $e(q,te,K){var J=1,ee=0,re=0,fe=0,ve=0,ce=q.length,de=X?new Uint16Array(32):Le(32);for(re=0;re<32;++re)de[re]=0;for(re=ce;re<K;++re)q[re]=0;ce=q.length;var ae=X?new Uint16Array(ce):Le(ce);for(re=0;re<ce;++re)de[ee=q[re]]++,J<ee&&(J=ee),ae[re]=0;for(de[0]=0,re=1;re<=J;++re)de[re+16]=ve=ve+de[re-1]<<1;for(re=0;re<ce;++re)ve=q[re],ve!=0&&(ae[re]=de[ve+16]++);var Y=0;for(re=0;re<ce;++re)if(Y=q[re],Y!=0)for(ve=V(ae[re],J)>>J-Y,fe=(1<<J+4-Y)-1;fe>=0;--fe)te[ve|fe<<Y]=Y&15|re<<4;return J}var tt=X?new Uint16Array(512):Le(512),dt=X?new Uint16Array(32):Le(32);if(!X){for(var Je=0;Je<512;++Je)tt[Je]=0;for(Je=0;Je<32;++Je)dt[Je]=0}(function(){for(var q=[],te=0;te<32;te++)q.push(5);$e(q,dt,32);var K=[];for(te=0;te<=143;te++)K.push(8);for(;te<=255;te++)K.push(9);for(;te<=279;te++)K.push(7);for(;te<=287;te++)K.push(8);$e(K,tt,288)})();var ur=function(){for(var te=X?new Uint8Array(32768):[],K=0,J=0;K<H.length-1;++K)for(;J<H[K+1];++J)te[J]=K;for(;J<32768;++J)te[J]=29;var ee=X?new Uint8Array(259):[];for(K=0,J=0;K<F.length-1;++K)for(;J<F[K+1];++J)ee[J]=K;function re(ve,ce){for(var de=0;de<ve.length;){var ae=Math.min(65535,ve.length-de),Y=de+ae==ve.length;for(ce.write_shift(1,+Y),ce.write_shift(2,ae),ce.write_shift(2,~ae&65535);ae-- >0;)ce[ce.l++]=ve[de++]}return ce.l}function fe(ve,ce){for(var de=0,ae=0,Y=X?new Uint16Array(32768):[];ae<ve.length;){var oe=Math.min(65535,ve.length-ae);if(oe<10){for(de=ue(ce,de,+(ae+oe==ve.length)),de&7&&(de+=8-(de&7)),ce.l=de/8|0,ce.write_shift(2,oe),ce.write_shift(2,~oe&65535);oe-- >0;)ce[ce.l++]=ve[ae++];de=ce.l*8;continue}de=ue(ce,de,+(ae+oe==ve.length)+2);for(var ge=0;oe-- >0;){var we=ve[ae];ge=(ge<<5^we)&32767;var Ae=-1,De=0;if((Ae=Y[ge])&&(Ae|=ae&-32768,Ae>ae&&(Ae-=32768),Ae<ae))for(;ve[Ae+De]==ve[ae+De]&&De<250;)++De;if(De>2){we=ee[De],we<=22?de=_e(ce,de,ne[we+1]>>1)-1:(_e(ce,de,3),de+=5,_e(ce,de,ne[we-23]>>5),de+=3);var lt=we<8?0:we-4>>2;lt>0&&(ye(ce,de,De-F[we]),de+=lt),we=te[ae-Ae],de=_e(ce,de,ne[we]>>3),de-=3;var _t=we<4?0:we-2>>1;_t>0&&(ye(ce,de,ae-Ae-H[we]),de+=_t);for(var Ht=0;Ht<De;++Ht)Y[ge]=ae&32767,ge=(ge<<5^ve[ae])&32767,++ae;oe-=De-1}else we<=143?we=we+48:de=me(ce,de,1),de=_e(ce,de,ne[we]),Y[ge]=ae&32767,++ae}de=_e(ce,de,0)-1}return ce.l=(de+7)/8|0,ce.l}return function(ce,de){return ce.length<8?re(ce,de):fe(ce,de)}}();function Re(q){var te=dr(50+Math.floor(q.length*1.1)),K=ur(q,te);return te.slice(0,K)}var ot=X?new Uint16Array(32768):Le(32768),rr=X?new Uint16Array(32768):Le(32768),kt=X?new Uint16Array(128):Le(128),ie=1,Ne=1;function ze(q,te){var K=Se(q,te)+257;te+=5;var J=Se(q,te)+1;te+=5;var ee=xe(q,te)+4;te+=4;for(var re=0,fe=X?new Uint8Array(19):Le(19),ve=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ce=1,de=X?new Uint8Array(8):Le(8),ae=X?new Uint8Array(8):Le(8),Y=fe.length,oe=0;oe<ee;++oe)fe[L[oe]]=re=Ee(q,te),ce<re&&(ce=re),de[re]++,te+=3;var ge=0;for(de[0]=0,oe=1;oe<=ce;++oe)ae[oe]=ge=ge+de[oe-1]<<1;for(oe=0;oe<Y;++oe)(ge=fe[oe])!=0&&(ve[oe]=ae[ge]++);var we=0;for(oe=0;oe<Y;++oe)if(we=fe[oe],we!=0){ge=ne[ve[oe]]>>8-we;for(var Ae=(1<<7-we)-1;Ae>=0;--Ae)kt[ge|Ae<<we]=we&7|oe<<3}var De=[];for(ce=1;De.length<K+J;)switch(ge=kt[pe(q,te)],te+=ge&7,ge>>>=3){case 16:for(re=3+Te(q,te),te+=2,ge=De[De.length-1];re-- >0;)De.push(ge);break;case 17:for(re=3+Ee(q,te),te+=3;re-- >0;)De.push(0);break;case 18:for(re=11+pe(q,te),te+=7;re-- >0;)De.push(0);break;default:De.push(ge),ce<ge&&(ce=ge);break}var lt=De.slice(0,K),_t=De.slice(K);for(oe=K;oe<286;++oe)lt[oe]=0;for(oe=J;oe<30;++oe)_t[oe]=0;return ie=$e(lt,ot,286),Ne=$e(_t,rr,30),te}function ht(q,te){if(q[0]==3&&!(q[1]&3))return[Di(te),2];for(var K=0,J=0,ee=L_(te||1<<18),re=0,fe=ee.length>>>0,ve=0,ce=0;!(J&1);){if(J=Ee(q,K),K+=3,J>>>1)J>>1==1?(ve=9,ce=5):(K=ze(q,K),ve=ie,ce=Ne);else{K&7&&(K+=8-(K&7));var de=q[K>>>3]|q[(K>>>3)+1]<<8;if(K+=32,de>0)for(!te&&fe<re+de&&(ee=Me(ee,re+de),fe=ee.length);de-- >0;)ee[re++]=q[K>>>3],K+=8;continue}for(;;){!te&&fe<re+32767&&(ee=Me(ee,re+32767),fe=ee.length);var ae=le(q,K,ve),Y=J>>>1==1?tt[ae]:ot[ae];if(K+=Y&15,Y>>>=4,!(Y>>>8&255))ee[re++]=Y;else{if(Y==256)break;Y-=257;var oe=Y<8?0:Y-4>>2;oe>5&&(oe=0);var ge=re+F[Y];oe>0&&(ge+=le(q,K,oe),K+=oe),ae=le(q,K,ce),Y=J>>>1==1?dt[ae]:rr[ae],K+=Y&15,Y>>>=4;var we=Y<4?0:Y-2>>1,Ae=H[Y];for(we>0&&(Ae+=le(q,K,we),K+=we),!te&&fe<ge&&(ee=Me(ee,ge+100),fe=ee.length);re<ge;)ee[re]=ee[re-Ae],++re}}}return te?[ee,K+7>>>3]:[ee.slice(0,re),K+7>>>3]}function nr(q,te){var K=q.slice(q.l||0),J=ht(K,te);return q.l+=J[1],J[0]}function ut(q,te){if(q)typeof console<"u"&&console.error(te);else throw new Error(te)}function Ot(q,te){var K=q;jr(K,0);var J=[],ee=[],re={FileIndex:J,FullPaths:ee};E(re,{root:te.root});for(var fe=K.length-4;(K[fe]!=80||K[fe+1]!=75||K[fe+2]!=5||K[fe+3]!=6)&&fe>=0;)--fe;K.l=fe+4,K.l+=4;var ve=K.read_shift(2);K.l+=6;var ce=K.read_shift(4);for(K.l=ce,fe=0;fe<ve;++fe){K.l+=20;var de=K.read_shift(4),ae=K.read_shift(4),Y=K.read_shift(2),oe=K.read_shift(2),ge=K.read_shift(2);K.l+=8;var we=K.read_shift(4),Ae=o(K.slice(K.l+Y,K.l+Y+oe));K.l+=Y+oe+ge;var De=K.l;K.l=we+4,Sr(K,de,ae,re,Ae),K.l=De}return re}function Sr(q,te,K,J,ee){q.l+=2;var re=q.read_shift(2),fe=q.read_shift(2),ve=i(q);if(re&8257)throw new Error("Unsupported ZIP encryption");for(var ce=q.read_shift(4),de=q.read_shift(4),ae=q.read_shift(4),Y=q.read_shift(2),oe=q.read_shift(2),ge="",we=0;we<Y;++we)ge+=String.fromCharCode(q[q.l++]);if(oe){var Ae=o(q.slice(q.l,q.l+oe));(Ae[21589]||{}).mt&&(ve=Ae[21589].mt),((ee||{})[21589]||{}).mt&&(ve=ee[21589].mt)}q.l+=oe;var De=q.slice(q.l,q.l+de);switch(fe){case 8:De=j(q,ae);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+fe)}var lt=!1;re&8&&(ce=q.read_shift(4),ce==134695760&&(ce=q.read_shift(4),lt=!0),de=q.read_shift(4),ae=q.read_shift(4)),de!=te&&ut(lt,"Bad compressed size: "+te+" != "+de),ae!=K&&ut(lt,"Bad uncompressed size: "+K+" != "+ae),xt(J,ge,De,{unsafe:!0,mt:ve})}function Tr(q,te){var K=te||{},J=[],ee=[],re=dr(1),fe=K.compression?8:0,ve=0,ce=0,de=0,ae=0,Y=0,oe=q.FullPaths[0],ge=oe,we=q.FileIndex[0],Ae=[],De=0;for(ce=1;ce<q.FullPaths.length;++ce)if(ge=q.FullPaths[ce].slice(oe.length),we=q.FileIndex[ce],!(!we.size||!we.content||ge=="Sh33tJ5")){var lt=ae,_t=dr(ge.length);for(de=0;de<ge.length;++de)_t.write_shift(1,ge.charCodeAt(de)&127);_t=_t.slice(0,_t.l),Ae[Y]=_H.buf(we.content,0);var Ht=we.content;fe==8&&(Ht=B(Ht)),re=dr(30),re.write_shift(4,67324752),re.write_shift(2,20),re.write_shift(2,ve),re.write_shift(2,fe),we.mt?s(re,we.mt):re.write_shift(4,0),re.write_shift(-4,Ae[Y]),re.write_shift(4,Ht.length),re.write_shift(4,we.content.length),re.write_shift(2,_t.length),re.write_shift(2,0),ae+=re.length,J.push(re),ae+=_t.length,J.push(_t),ae+=Ht.length,J.push(Ht),re=dr(46),re.write_shift(4,33639248),re.write_shift(2,0),re.write_shift(2,20),re.write_shift(2,ve),re.write_shift(2,fe),re.write_shift(4,0),re.write_shift(-4,Ae[Y]),re.write_shift(4,Ht.length),re.write_shift(4,we.content.length),re.write_shift(2,_t.length),re.write_shift(2,0),re.write_shift(2,0),re.write_shift(2,0),re.write_shift(2,0),re.write_shift(4,0),re.write_shift(4,lt),De+=re.l,ee.push(re),De+=_t.length,ee.push(_t),++Y}return re=dr(22),re.write_shift(4,101010256),re.write_shift(2,0),re.write_shift(2,0),re.write_shift(2,Y),re.write_shift(2,Y),re.write_shift(4,De),re.write_shift(4,ae),re.write_shift(2,0),ai([ai(J),ai(ee),re])}var At={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 kr(q,te){if(q.ctype)return q.ctype;var K=q.name||"",J=K.match(/\.([^\.]+)$/);return J&&At[J[1]]||te&&(J=(K=te).match(/[\.\\]([^\.\\])+$/),J&&At[J[1]])?At[J[1]]:"application/octet-stream"}function Ve(q){for(var te=M_(q),K=[],J=0;J<te.length;J+=76)K.push(te.slice(J,J+76));return K.join(`\r
`)+`\r
`}function We(q){var te=q.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(de){var ae=de.charCodeAt(0).toString(16).toUpperCase();return"="+(ae.length==1?"0"+ae:ae)});te=te.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),te.charAt(0)==`
`&&(te="=0D"+te.slice(1)),te=te.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var K=[],J=te.split(`\r
`),ee=0;ee<J.length;++ee){var re=J[ee];if(re.length==0){K.push("");continue}for(var fe=0;fe<re.length;){var ve=76,ce=re.slice(fe,fe+ve);ce.charAt(ve-1)=="="?ve--:ce.charAt(ve-2)=="="?ve-=2:ce.charAt(ve-3)=="="&&(ve-=3),ce=re.slice(fe,fe+ve),fe+=ve,fe<re.length&&(ce+="="),K.push(ce)}}return K.join(`\r
`)}function it(q){for(var te=[],K=0;K<q.length;++K){for(var J=q[K];K<=q.length&&J.charAt(J.length-1)=="=";)J=J.slice(0,J.length-1)+q[++K];te.push(J)}for(var ee=0;ee<te.length;++ee)te[ee]=te[ee].replace(/[=][0-9A-Fa-f]{2}/g,function(re){return String.fromCharCode(parseInt(re.slice(1),16))});return ka(te.join(`\r
`))}function bt(q,te,K){for(var J="",ee="",re="",fe,ve=0;ve<10;++ve){var ce=te[ve];if(!ce||ce.match(/^\s*$/))break;var de=ce.match(/^(.*?):\s*([^\s].*)$/);if(de)switch(de[1].toLowerCase()){case"content-location":J=de[2].trim();break;case"content-type":re=de[2].trim();break;case"content-transfer-encoding":ee=de[2].trim();break}}switch(++ve,ee.toLowerCase()){case"base64":fe=ka(qn(te.slice(ve).join("")));break;case"quoted-printable":fe=it(te.slice(ve));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+ee)}var ae=xt(q,J.slice(K.length),fe,{unsafe:!0});re&&(ae.ctype=re)}function He(q,te){if(R(q.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var K=te&&te.root||"",J=(gt&&Buffer.isBuffer(q)?q.toString("binary"):R(q)).split(`\r
`),ee=0,re="";for(ee=0;ee<J.length;++ee)if(re=J[ee],!!/^Content-Location:/i.test(re)&&(re=re.slice(re.indexOf("file")),K||(K=re.slice(0,re.lastIndexOf("/")+1)),re.slice(0,K.length)!=K))for(;K.length>0&&(K=K.slice(0,K.length-1),K=K.slice(0,K.lastIndexOf("/")+1),re.slice(0,K.length)!=K););var fe=(J[1]||"").match(/boundary="(.*?)"/);if(!fe)throw new Error("MAD cannot find boundary");var ve="--"+(fe[1]||""),ce=[],de=[],ae={FileIndex:ce,FullPaths:de};E(ae);var Y,oe=0;for(ee=0;ee<J.length;++ee){var ge=J[ee];ge!==ve&&ge!==ve+"--"||(oe++&&bt(ae,J.slice(Y,ee),K),Y=ee)}return ae}function st(q,te){var K=te||{},J=K.boundary||"SheetJS";J="------="+J;for(var ee=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+J.slice(2)+'"',"","",""],re=q.FullPaths[0],fe=re,ve=q.FileIndex[0],ce=1;ce<q.FullPaths.length;++ce)if(fe=q.FullPaths[ce].slice(re.length),ve=q.FileIndex[ce],!(!ve.size||!ve.content||fe=="Sh33tJ5")){fe=fe.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(De){return"_x"+De.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(De){return"_u"+De.charCodeAt(0).toString(16)+"_"});for(var de=ve.content,ae=gt&&Buffer.isBuffer(de)?de.toString("binary"):R(de),Y=0,oe=Math.min(1024,ae.length),ge=0,we=0;we<=oe;++we)(ge=ae.charCodeAt(we))>=32&&ge<128&&++Y;var Ae=Y>=oe*4/5;ee.push(J),ee.push("Content-Location: "+(K.root||"file:///C:/SheetJS/")+fe),ee.push("Content-Transfer-Encoding: "+(Ae?"quoted-printable":"base64")),ee.push("Content-Type: "+kr(ve,fe)),ee.push(""),ee.push(Ae?We(ae):Ve(ae))}return ee.push(J+`--\r
`),ee.join(`\r
`)}function Ct(q){var te={};return E(te,q),te}function xt(q,te,K,J){var ee=J&&J.unsafe;ee||E(q);var re=!ee&&yt.find(q,te);if(!re){var fe=q.FullPaths[0];te.slice(0,fe.length)==fe?fe=te:(fe.slice(-1)!="/"&&(fe+="/"),fe=(fe+te).replace("//","/")),re={name:a(te),type:2},q.FileIndex.push(re),q.FullPaths.push(fe),ee||yt.utils.cfb_gc(q)}return re.content=K,re.size=K?K.length:0,J&&(J.CLSID&&(re.clsid=J.CLSID),J.mt&&(re.mt=J.mt),J.ct&&(re.ct=J.ct)),re}function Nr(q,te){E(q);var K=yt.find(q,te);if(K){for(var J=0;J<q.FileIndex.length;++J)if(q.FileIndex[J]==K)return q.FileIndex.splice(J,1),q.FullPaths.splice(J,1),!0}return!1}function Gn(q,te,K){E(q);var J=yt.find(q,te);if(J){for(var ee=0;ee<q.FileIndex.length;++ee)if(q.FileIndex[ee]==J)return q.FileIndex[ee].name=a(K),q.FullPaths[ee]=K,!0}return!1}function os(q){P(q,!0)}return t.find=k,t.read=T,t.parse=f,t.write=z,t.writeFile=Q,t.utils={cfb_new:Ct,cfb_add:xt,cfb_del:Nr,cfb_mov:Gn,cfb_gc:os,ReadShift:Pu,CheckField:YP,prep_blob:jr,bconcat:ai,use_zlib:O,_deflateRaw:Re,_inflateRaw:nr,consts:G},t}();function EH(e){if(typeof Deno<"u")return Deno.readFileSync(e);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var t=File(e);t.open("r"),t.encoding="binary";var r=t.read();return t.close(),r}catch(n){if(!n.message||!n.message.match(/onstruct/))throw n}throw new Error("Cannot access file "+e)}function ns(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;++n)Object.prototype.hasOwnProperty.call(e,t[n])&&r.push(t[n]);return r}function y1(e){for(var t=[],r=ns(e),n=0;n!==r.length;++n)t[e[r[n]]]=r[n];return t}var m0=new Date(1899,11,30,0,0,0);function pn(e,t){var r=e.getTime(),n=m0.getTime()+(e.getTimezoneOffset()-m0.getTimezoneOffset())*6e4;return(r-n)/(24*60*60*1e3)}var AP=new Date,SH=m0.getTime()+(AP.getTimezoneOffset()-m0.getTimezoneOffset())*6e4,V_=AP.getTimezoneOffset();function _p(e){var t=new Date;return t.setTime(e*24*60*60*1e3+SH),t.getTimezoneOffset()!==V_&&t.setTime(t.getTime()+(t.getTimezoneOffset()-V_)*6e4),t}function TH(e){var t=0,r=0,n=!1,a=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!a)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var s=1;s!=a.length;++s)if(a[s]){switch(r=1,s>3&&(n=!0),a[s].slice(a[s].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+a[s].slice(a[s].length-1));case"D":r*=24;case"H":r*=60;case"M":if(n)r*=60;else throw new Error("Unsupported ISO Duration Field: M")}t+=r*parseInt(a[s],10)}return t}var G_=new Date("2017-02-19T19:06:09.000Z"),CP=isNaN(G_.getFullYear())?new Date("2/19/17"):G_,kH=CP.getFullYear()==2017;function Er(e,t){var r=new Date(e);if(kH)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(CP.getFullYear()==1917&&!isNaN(r.getFullYear())){var n=r.getFullYear();return e.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var a=e.match(/\d+/g)||["2017","2","19","0","0","0"],s=new Date(+a[0],+a[1]-1,+a[2],+a[3]||0,+a[4]||0,+a[5]||0);return e.indexOf("Z")>-1&&(s=new Date(s.getTime()-s.getTimezoneOffset()*60*1e3)),s}function Do(e,t){if(gt&&Buffer.isBuffer(e)){if(t){if(e[0]==255&&e[1]==254)return gu(e.slice(2).toString("utf16le"));if(e[1]==254&&e[2]==255)return gu(mP(e.slice(2).toString("binary")))}return e.toString("binary")}if(typeof TextDecoder<"u")try{if(t){if(e[0]==255&&e[1]==254)return gu(new TextDecoder("utf-16le").decode(e.slice(2)));if(e[0]==254&&e[1]==255)return gu(new TextDecoder("utf-16be").decode(e.slice(2)))}var r={"€":"","‚":"",ƒ:"","„":"","…":"
","†":"","‡":"","ˆ":"","‰":"",Š:"","‹":"",Œ:"",Ž:"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"",š:"","›":"",œ:"",ž:"",Ÿ:""};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(s){return r[s]||s})}catch{}for(var n=[],a=0;a!=e.length;++a)n.push(String.fromCharCode(e[a]));return n.join("")}function Mr(e){if(typeof JSON<"u"&&!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]=Mr(e[r]));return t}function Qt(e,t){for(var r="";r.length<t;)r+=e;return r}function ja(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,n=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(t=Number(n))||(n=n.replace(/[(](.*)[)]/,function(a,s){return r=-r,s}),!isNaN(t=Number(n)))?t/r:t}var NH=["january","february","march","april","may","june","july","august","september","october","november","december"];function hc(e){var t=new Date(e),r=new Date(NaN),n=t.getYear(),a=t.getMonth(),s=t.getDate();if(isNaN(s))return r;var i=e.toLowerCase();if(i.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(i=i.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),i.length>3&&NH.indexOf(i)==-1)return r}else if(i.match(/[a-z]/))return r;return n<0||n>8099?r:(a>0||s>1)&&n!=101?t:e.match(/[^-0-9:,\/\\]/)?r:t}var AH=function(){var e="abacaba".split(/(:?b)/i).length==5;return function(r,n,a){if(e||typeof n=="string")return r.split(n);for(var s=r.split(n),i=[s[0]],o=1;o<s.length;++o)i.push(a),i.push(s[o]);return i}}();function PP(e){return e?e.content&&e.type?Do(e.content,!0):e.data?hu(e.data):e.asNodeBuffer&>?hu(e.asNodeBuffer().toString("binary")):e.asBinary?hu(e.asBinary()):e._data&&e._data.getContent?hu(Do(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function OP(e){if(!e)return null;if(e.data)return F_(e.data);if(e.asNodeBuffer&>)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return typeof t=="string"?F_(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}function CH(e){return e&&e.name.slice(-4)===".bin"?OP(e):PP(e)}function Jn(e,t){for(var r=e.FullPaths||ns(e.files),n=t.toLowerCase().replace(/[\/]/g,"\\"),a=n.replace(/\\/g,"/"),s=0;s<r.length;++s){var i=r[s].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==i||a==i)return e.files?e.files[r[s]]:e.FileIndex[s]}return null}function w1(e,t){var r=Jn(e,t);if(r==null)throw new Error("Cannot find file "+t+" in zip");return r}function sr(e,t,r){if(!r)return CH(w1(e,t));if(!t)return null;try{return sr(e,t)}catch{return null}}function Ln(e,t,r){if(!r)return PP(w1(e,t));if(!t)return null;try{return Ln(e,t)}catch{return null}}function PH(e,t,r){return OP(w1(e,t))}function K_(e){for(var t=e.FullPaths||ns(e.files),r=[],n=0;n<t.length;++n)t[n].slice(-1)!="/"&&r.push(t[n].replace(/^Root Entry[\/]/,""));return r.sort()}function OH(e,t,r){if(e.FullPaths){if(typeof r=="string"){var n;return gt?n=Ho(r):n=Xz(r),yt.utils.cfb_add(e,t,n)}yt.utils.cfb_add(e,t,r)}else e.file(t,r)}function jP(e,t){switch(t.type){case"base64":return yt.read(e,{type:"base64"});case"binary":return yt.read(e,{type:"binary"});case"buffer":case"array":return yt.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function mu(e,t){if(e.charAt(0)=="/")return e.slice(1);var r=t.split("/");t.slice(-1)!="/"&&r.pop();for(var n=e.split("/");n.length!==0;){var a=n.shift();a===".."?r.pop():a!=="."&&r.push(a)}return r.join("/")}var RP=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
`,jH=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,Y_=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,RH=/<[^>]*>/g,Qr=RP.match(Y_)?Y_:RH,IH=/<\w*:/,FH=/<(\/?)\w+:/;function Xe(e,t,r){for(var n={},a=0,s=0;a!==e.length&&!((s=e.charCodeAt(a))===32||s===10||s===13);++a);if(t||(n[0]=e.slice(0,a)),a===e.length)return n;var i=e.match(jH),o=0,l="",u=0,f="",d="",h=1;if(i)for(u=0;u!=i.length;++u){for(d=i[u],s=0;s!=d.length&&d.charCodeAt(s)!==61;++s);for(f=d.slice(0,s).trim();d.charCodeAt(s+1)==32;)++s;for(h=(a=d.charCodeAt(s+1))==34||a==39?1:0,l=d.slice(s+1+h,d.length-h),o=0;o!=f.length&&f.charCodeAt(o)!==58;++o);if(o===f.length)f.indexOf("_")>0&&(f=f.slice(0,f.indexOf("_"))),n[f]=l,n[f.toLowerCase()]=l;else{var p=(o===5&&f.slice(0,5)==="xmlns"?"xmlns":"")+f.slice(o+1);if(n[p]&&f.slice(o-3,o)=="ext")continue;n[p]=l,n[p.toLowerCase()]=l}}return n}function ss(e){return e.replace(FH,"<$1")}var IP={""":'"',"'":"'",">":">","<":"<","&":"&"},DH=y1(IP),St=function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,t=/_x([\da-fA-F]{4})_/ig;return function r(n){var a=n+"",s=a.indexOf("<![CDATA[");if(s==-1)return a.replace(e,function(o,l){return IP[o]||String.fromCharCode(parseInt(l,o.indexOf("x")>-1?16:10))||o}).replace(t,function(o,l){return String.fromCharCode(parseInt(l,16))});var i=a.indexOf("]]>");return r(a.slice(0,s))+a.slice(s+9,i)+r(a.slice(i+3))}}(),MH=/[&<>'"]/g,LH=/[\u0000-\u001f]/g;function b1(e){var t=e+"";return t.replace(MH,function(r){return DH[r]}).replace(/\n/g,"<br/>").replace(LH,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}var X_=function(){var e=/&#(\d+);/g;function t(r,n){return String.fromCharCode(parseInt(n,10))}return function(n){return n.replace(e,t)}}();function $t(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function Um(e){for(var t="",r=0,n=0,a=0,s=0,i=0,o=0;r<e.length;){if(n=e.charCodeAt(r++),n<128){t+=String.fromCharCode(n);continue}if(a=e.charCodeAt(r++),n>191&&n<224){i=(n&31)<<6,i|=a&63,t+=String.fromCharCode(i);continue}if(s=e.charCodeAt(r++),n<240){t+=String.fromCharCode((n&15)<<12|(a&63)<<6|s&63);continue}i=e.charCodeAt(r++),o=((n&7)<<18|(a&63)<<12|(s&63)<<6|i&63)-65536,t+=String.fromCharCode(55296+(o>>>10&1023)),t+=String.fromCharCode(56320+(o&1023))}return t}function J_(e){var t=Di(2*e.length),r,n,a=1,s=0,i=0,o;for(n=0;n<e.length;n+=a)a=1,(o=e.charCodeAt(n))<128?r=o:o<224?(r=(o&31)*64+(e.charCodeAt(n+1)&63),a=2):o<240?(r=(o&15)*4096+(e.charCodeAt(n+1)&63)*64+(e.charCodeAt(n+2)&63),a=3):(a=4,r=(o&7)*262144+(e.charCodeAt(n+1)&63)*4096+(e.charCodeAt(n+2)&63)*64+(e.charCodeAt(n+3)&63),r-=65536,i=55296+(r>>>10&1023),r=56320+(r&1023)),i!==0&&(t[s++]=i&255,t[s++]=i>>>8,i=0),t[s++]=r%256,t[s++]=r>>>8;return t.slice(0,s).toString("ucs2")}function Q_(e){return Ho(e,"binary").toString("utf8")}var Md="foo bar bazâð£",Dt=gt&&(Q_(Md)==Um(Md)&&Q_||J_(Md)==Um(Md)&&J_)||Um,gu=gt?function(e){return Ho(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,n=0,a=0;r<e.length;)switch(n=e.charCodeAt(r++),!0){case n<128:t.push(String.fromCharCode(n));break;case n<2048:t.push(String.fromCharCode(192+(n>>6))),t.push(String.fromCharCode(128+(n&63)));break;case(n>=55296&&n<57344):n-=55296,a=e.charCodeAt(r++)-56320+(n<<10),t.push(String.fromCharCode(240+(a>>18&7))),t.push(String.fromCharCode(144+(a>>12&63))),t.push(String.fromCharCode(128+(a>>6&63))),t.push(String.fromCharCode(128+(a&63)));break;default:t.push(String.fromCharCode(224+(n>>12))),t.push(String.fromCharCode(128+(n>>6&63))),t.push(String.fromCharCode(128+(n&63)))}return t.join("")},bf=function(){var e={};return function(r,n){var a=r+"|"+(n||"");return e[a]?e[a]:e[a]=new RegExp("<(?:\\w+:)?"+r+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+r+">",n||"")}}(),FP=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 n=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,""),a=0;a<e.length;++a)n=n.replace(e[a][0],e[a][1]);return n}}(),BH=function(){var e={};return function(r){return e[r]!==void 0?e[r]:e[r]=new RegExp("<(?:vt:)?"+r+">([\\s\\S]*?)</(?:vt:)?"+r+">","g")}}(),UH=/<\/?(?:vt:)?variant>/g,$H=/<(?:vt:)([^>]*)>([\s\S]*)</;function Z_(e,t){var r=Xe(e),n=e.match(BH(r.baseType))||[],a=[];if(n.length!=r.size){if(t.WTF)throw new Error("unexpected vector length "+n.length+" != "+r.size);return a}return n.forEach(function(s){var i=s.replace(UH,"").match($H);i&&a.push({v:Dt(i[2]),t:i[1]})}),a}var zH=/(^\s|\s$|\n)/;function HH(e){return ns(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function qH(e,t,r){return"<"+e+(r!=null?HH(r):"")+(t!=null?(t.match(zH)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function _1(e){if(gt&&Buffer.isBuffer(e))return e.toString("utf8");if(typeof e=="string")return e;if(typeof Uint8Array<"u"&&e instanceof Uint8Array)return Dt(qo(g1(e)));throw new Error("Bad input format: expected Buffer or string")}var _f=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/mg,WH={CT:"http://schemas.openxmlformats.org/package/2006/content-types"},VH=["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"];function GH(e,t){for(var r=1-2*(e[t+7]>>>7),n=((e[t+7]&127)<<4)+(e[t+6]>>>4&15),a=e[t+6]&15,s=5;s>=0;--s)a=a*256+e[t+s];return n==2047?a==0?r*(1/0):NaN:(n==0?n=-1022:(n-=1023,a+=Math.pow(2,52)),r*Math.pow(2,n-52)*a)}function KH(e,t,r){var n=(t<0||1/t==-1/0?1:0)<<7,a=0,s=0,i=n?-t:t;isFinite(i)?i==0?a=s=0:(a=Math.floor(Math.log(i)/Math.LN2),s=i*Math.pow(2,52-a),a<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?a=-1022:(s-=Math.pow(2,52),a+=1023)):(a=2047,s=isNaN(t)?26985:0);for(var o=0;o<=5;++o,s/=256)e[r+o]=s&255;e[r+6]=(a&15)<<4|s&15,e[r+7]=a>>4|n}var e2=function(e){for(var t=[],r=10240,n=0;n<e[0].length;++n)if(e[0][n])for(var a=0,s=e[0][n].length;a<s;a+=r)t.push.apply(t,e[0][n].slice(a,a+r));return t},t2=gt?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(t){return Buffer.isBuffer(t)?t:Ho(t)})):e2(e)}:e2,r2=function(e,t,r){for(var n=[],a=t;a<r;a+=2)n.push(String.fromCharCode(bs(e,a)));return n.join("").replace(dn,"")},E1=gt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(dn,""):r2(e,t,r)}:r2,n2=function(e,t,r){for(var n=[],a=t;a<t+r;++a)n.push(("0"+e[a].toString(16)).slice(-2));return n.join("")},DP=gt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):n2(e,t,r)}:n2,a2=function(e,t,r){for(var n=[],a=t;a<r;a++)n.push(String.fromCharCode(dl(e,a)));return n.join("")},Jf=gt?function(t,r,n){return Buffer.isBuffer(t)?t.toString("utf8",r,n):a2(t,r,n)}:a2,MP=function(e,t){var r=Fn(e,t);return r>0?Jf(e,t+4,t+4+r-1):""},LP=MP,BP=function(e,t){var r=Fn(e,t);return r>0?Jf(e,t+4,t+4+r-1):""},UP=BP,$P=function(e,t){var r=2*Fn(e,t);return r>0?Jf(e,t+4,t+4+r-1):""},zP=$P,HP=function(t,r){var n=Fn(t,r);return n>0?E1(t,r+4,r+4+n):""},qP=HP,WP=function(e,t){var r=Fn(e,t);return r>0?Jf(e,t+4,t+4+r):""},VP=WP,GP=function(e,t){return GH(e,t)},g0=GP,KP=function(t){return Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array};gt&&(LP=function(t,r){if(!Buffer.isBuffer(t))return MP(t,r);var n=t.readUInt32LE(r);return n>0?t.toString("utf8",r+4,r+4+n-1):""},UP=function(t,r){if(!Buffer.isBuffer(t))return BP(t,r);var n=t.readUInt32LE(r);return n>0?t.toString("utf8",r+4,r+4+n-1):""},zP=function(t,r){if(!Buffer.isBuffer(t))return $P(t,r);var n=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+n-1)},qP=function(t,r){if(!Buffer.isBuffer(t))return HP(t,r);var n=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+n)},VP=function(t,r){if(!Buffer.isBuffer(t))return WP(t,r);var n=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+n)},g0=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):GP(t,r)},KP=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array});var dl=function(e,t){return e[t]},bs=function(e,t){return e[t+1]*256+e[t]},YH=function(e,t){var r=e[t+1]*256+e[t];return r<32768?r:(65535-r+1)*-1},Fn=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},ro=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},XH=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function Pu(e,t){var r="",n,a,s=[],i,o,l,u;switch(t){case"dbcs":if(u=this.l,gt&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*e).toString("utf16le");else for(l=0;l<e;++l)r+=String.fromCharCode(bs(this,u)),u+=2;e*=2;break;case"utf8":r=Jf(this,this.l,this.l+e);break;case"utf16le":e*=2,r=E1(this,this.l,this.l+e);break;case"wstr":return Pu.call(this,e,"dbcs");case"lpstr-ansi":r=LP(this,this.l),e=4+Fn(this,this.l);break;case"lpstr-cp":r=UP(this,this.l),e=4+Fn(this,this.l);break;case"lpwstr":r=zP(this,this.l),e=4+2*Fn(this,this.l);break;case"lpp4":e=4+Fn(this,this.l),r=qP(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+Fn(this,this.l),r=VP(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(i=dl(this,this.l+e++))!==0;)s.push(Dd(i));r=s.join("");break;case"_wstr":for(e=0,r="";(i=bs(this,this.l+e))!==0;)s.push(Dd(i)),e+=2;e+=2,r=s.join("");break;case"dbcs-cont":for(r="",u=this.l,l=0;l<e;++l){if(this.lens&&this.lens.indexOf(u)!==-1)return i=dl(this,u),this.l=u+1,o=Pu.call(this,e-l,i?"dbcs-cont":"sbcs-cont"),s.join("")+o;s.push(Dd(bs(this,u))),u+=2}r=s.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(r="",u=this.l,l=0;l!=e;++l){if(this.lens&&this.lens.indexOf(u)!==-1)return i=dl(this,u),this.l=u+1,o=Pu.call(this,e-l,i?"dbcs-cont":"sbcs-cont"),s.join("")+o;s.push(Dd(dl(this,u))),u+=1}r=s.join("");break;default:switch(e){case 1:return n=dl(this,this.l),this.l++,n;case 2:return n=(t==="i"?YH:bs)(this,this.l),this.l+=2,n;case 4:case-4:return t==="i"||!(this[this.l+3]&128)?(n=(e>0?ro:XH)(this,this.l),this.l+=4,n):(a=Fn(this,this.l),this.l+=4,a);case 8:case-8:if(t==="f")return e==8?a=g0(this,this.l):a=g0([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,a;e=8;case 16:r=DP(this,this.l,e);break}}return this.l+=e,r}var JH=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},QH=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},ZH=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function eq(e,t,r){var n=0,a=0;if(r==="dbcs"){for(a=0;a!=t.length;++a)ZH(this,t.charCodeAt(a),this.l+2*a);n=2*t.length}else if(r==="sbcs"){for(t=t.replace(/[^\x00-\x7F]/g,"_"),a=0;a!=t.length;++a)this[this.l+a]=t.charCodeAt(a)&255;n=t.length}else if(r==="hex"){for(;a<e;++a)this[this.l++]=parseInt(t.slice(2*a,2*a+2),16)||0;return this}else if(r==="utf16le"){var s=Math.min(this.l+e,this.length);for(a=0;a<Math.min(t.length,e);++a){var i=t.charCodeAt(a);this[this.l++]=i&255,this[this.l++]=i>>8}for(;this.l<s;)this[this.l++]=0;return this}else switch(e){case 1:n=1,this[this.l]=t&255;break;case 2:n=2,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255;break;case 3:n=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:n=4,JH(this,t,this.l);break;case 8:if(n=8,r==="f"){KH(this,t,this.l);break}case 16:break;case-4:n=4,QH(this,t,this.l);break}return this.l+=n,this}function YP(e,t){var r=DP(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function jr(e,t){e.l=t,e.read_shift=Pu,e.chk=YP,e.write_shift=eq}function Jr(e,t){e.l+=t}function dr(e){var t=Di(e);return jr(t,0),t}function Ls(e,t,r){if(e){var n,a,s;jr(e,e.l||0);for(var i=e.length,o=0,l=0;e.l<i;){o=e.read_shift(1),o&128&&(o=(o&127)+((e.read_shift(1)&127)<<7));var u=_0[o]||_0[65535];for(n=e.read_shift(1),s=n&127,a=1;a<4&&n&128;++a)s+=((n=e.read_shift(1))&127)<<7*a;l=e.l+s;var f=u.f&&u.f(e,s,r);if(e.l=l,t(f,u,o))return}}}function Xv(){var e=[],t=gt?256:2048,r=function(u){var f=dr(u);return jr(f,0),f},n=r(t),a=function(){n&&(n.length>n.l&&(n=n.slice(0,n.l),n.l=n.length),n.length>0&&e.push(n),n=null)},s=function(u){return n&&u<n.length-n.l?n:(a(),n=r(Math.max(u+1,t)))},i=function(){return a(),ai(e)},o=function(u){a(),n=u,n.l==null&&(n.l=n.length),s(t)};return{next:s,push:o,end:i,_bufs:e}}function Ou(e,t,r){var n=Mr(e);if(t.s?(n.cRel&&(n.c+=t.s.c),n.rRel&&(n.r+=t.s.r)):(n.cRel&&(n.c+=t.c),n.rRel&&(n.r+=t.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function s2(e,t,r){var n=Mr(e);return n.s=Ou(n.s,t.s,r),n.e=Ou(n.e,t.s,r),n}function ju(e,t){if(e.cRel&&e.c<0)for(e=Mr(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=Mr(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=et(e);return!e.cRel&&e.cRel!=null&&(r=nq(r)),!e.rRel&&e.rRel!=null&&(r=tq(r)),r}function $m(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?"":"$")+mr(e.s.c)+":"+(e.e.cRel?"":"$")+mr(e.e.c):e.s.c==0&&!e.s.cRel&&e.e.c==(t.biff>=12?16383:255)&&!e.e.cRel?(e.s.rRel?"":"$")+Lr(e.s.r)+":"+(e.e.rRel?"":"$")+Lr(e.e.r):ju(e.s,t.biff)+":"+ju(e.e,t.biff)}function S1(e){return parseInt(rq(e),10)-1}function Lr(e){return""+(e+1)}function tq(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function rq(e){return e.replace(/\$(\d+)$/,"$1")}function T1(e){for(var t=aq(e),r=0,n=0;n!==t.length;++n)r=26*r+t.charCodeAt(n)-64;return r-1}function mr(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 nq(e){return e.replace(/^([A-Z])/,"$$$1")}function aq(e){return e.replace(/^\$([A-Z])/,"$1")}function sq(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function un(e){for(var t=0,r=0,n=0;n<e.length;++n){var a=e.charCodeAt(n);a>=48&&a<=57?t=10*t+(a-48):a>=65&&a<=90&&(r=26*r+(a-64))}return{c:r-1,r:t-1}}function et(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 Ac(e){var t=e.indexOf(":");return t==-1?{s:un(e),e:un(e)}:{s:un(e.slice(0,t)),e:un(e.slice(t+1))}}function wt(e,t){return typeof t>"u"||typeof t=="number"?wt(e.s,e.e):(typeof e!="string"&&(e=et(e)),typeof t!="string"&&(t=et(t)),e==t?e:e+":"+t)}function Zt(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,a=0,s=e.length;for(r=0;n<s&&!((a=e.charCodeAt(n)-64)<1||a>26);++n)r=26*r+a;for(t.s.c=--r,r=0;n<s&&!((a=e.charCodeAt(n)-48)<0||a>9);++n)r=10*r+a;if(t.s.r=--r,n===s||a!=10)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++n,r=0;n!=s&&!((a=e.charCodeAt(n)-64)<1||a>26);++n)r=26*r+a;for(t.e.c=--r,r=0;n!=s&&!((a=e.charCodeAt(n)-48)<0||a>9);++n)r=10*r+a;return t.e.r=--r,t}function i2(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=la(e.z,r?pn(t):t)}catch{}try{return e.w=la((e.XF||{}).numFmtId||(r?14:0),r?pn(t):t)}catch{return""+t}}function js(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"?Go[e.v]||e.v:t==null?i2(e,e.v):i2(e,t))}function Wi(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",n={};return n[r]=e,{SheetNames:[r],Sheets:n}}function XP(e,t,r){var n=r||{},a=e?Array.isArray(e):n.dense,s=e||(a?[]:{}),i=0,o=0;if(s&&n.origin!=null){if(typeof n.origin=="number")i=n.origin;else{var l=typeof n.origin=="string"?un(n.origin):n.origin;i=l.r,o=l.c}s["!ref"]||(s["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var f=Zt(s["!ref"]);u.s.c=f.s.c,u.s.r=f.s.r,u.e.c=Math.max(u.e.c,f.e.c),u.e.r=Math.max(u.e.r,f.e.r),i==-1&&(u.e.r=i=f.e.r+1)}for(var d=0;d!=t.length;++d)if(t[d]){if(!Array.isArray(t[d]))throw new Error("aoa_to_sheet expects an array of arrays");for(var h=0;h!=t[d].length;++h)if(!(typeof t[d][h]>"u")){var p={v:t[d][h]},v=i+d,m=o+h;if(u.s.r>v&&(u.s.r=v),u.s.c>m&&(u.s.c=m),u.e.r<v&&(u.e.r=v),u.e.c<m&&(u.e.c=m),t[d][h]&&typeof t[d][h]=="object"&&!Array.isArray(t[d][h])&&!(t[d][h]instanceof Date))p=t[d][h];else if(Array.isArray(p.v)&&(p.f=t[d][h][1],p.v=p.v[0]),p.v===null)if(p.f)p.t="n";else if(n.nullError)p.t="e",p.v=0;else if(n.sheetStubs)p.t="z";else continue;else typeof p.v=="number"?p.t="n":typeof p.v=="boolean"?p.t="b":p.v instanceof Date?(p.z=n.dateNF||rt[14],n.cellDates?(p.t="d",p.w=la(p.z,pn(p.v))):(p.t="n",p.v=pn(p.v),p.w=la(p.z,p.v))):p.t="s";if(a)s[v]||(s[v]=[]),s[v][m]&&s[v][m].z&&(p.z=s[v][m].z),s[v][m]=p;else{var g=et({c:m,r:v});s[g]&&s[g].z&&(p.z=s[g].z),s[g]=p}}}return u.s.c<1e7&&(s["!ref"]=wt(u)),s}function Cc(e,t){return XP(null,e,t)}function iq(e){return e.read_shift(4,"i")}function Yr(e){var t=e.read_shift(4);return t===0?"":e.read_shift(t,"dbcs")}function oq(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function k1(e,t){var r=e.l,n=e.read_shift(1),a=Yr(e),s=[],i={t:a,h:a};if(n&1){for(var o=e.read_shift(4),l=0;l!=o;++l)s.push(oq(e));i.r=s}else i.r=[{ich:0,ifnt:0}];return e.l=r+t,i}var lq=k1;function ua(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 Wo(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}var cq=Yr;function N1(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}var uq=Yr,Jv=N1;function A1(e){var t=e.slice(e.l,e.l+4),r=t[0]&1,n=t[0]&2;e.l+=4;var a=n===0?g0([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):ro(t,0)>>2;return r?a/100:a}function JP(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}var Vo=JP;function Vr(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function fq(e){var t={},r=e.read_shift(1),n=r>>>1,a=e.read_shift(1),s=e.read_shift(2,"i"),i=e.read_shift(1),o=e.read_shift(1),l=e.read_shift(1);switch(e.l++,n){case 0:t.auto=1;break;case 1:t.index=a;var u=So[a];u&&(t.rgb=Sf(u));break;case 2:t.rgb=Sf([i,o,l]);break;case 3:t.theme=a;break}return s!=0&&(t.tint=s>0?s/32767:s/32768),t}function dq(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 QP(e,t){var r={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},n=e.read_shift(4);switch(n){case 0:return"";case 4294967295:case 4294967294:return r[e.read_shift(4)]||""}if(n>400)throw new Error("Unsupported Clipboard: "+n.toString(16));return e.l-=4,e.read_shift(0,t==1?"lpstr":"lpwstr")}function hq(e){return QP(e,1)}function pq(e){return QP(e,2)}var C1=2,_n=3,Ld=11,o2=12,v0=19,Bd=64,mq=65,gq=71,vq=4108,xq=4126,wr=80,ZP=81,yq=[wr,ZP],wq={1:{n:"CodePage",t:C1},2:{n:"Category",t:wr},3:{n:"PresentationFormat",t:wr},4:{n:"ByteCount",t:_n},5:{n:"LineCount",t:_n},6:{n:"ParagraphCount",t:_n},7:{n:"SlideCount",t:_n},8:{n:"NoteCount",t:_n},9:{n:"HiddenCount",t:_n},10:{n:"MultimediaClipCount",t:_n},11:{n:"ScaleCrop",t:Ld},12:{n:"HeadingPairs",t:vq},13:{n:"TitlesOfParts",t:xq},14:{n:"Manager",t:wr},15:{n:"Company",t:wr},16:{n:"LinksUpToDate",t:Ld},17:{n:"CharacterCount",t:_n},19:{n:"SharedDoc",t:Ld},22:{n:"HyperlinksChanged",t:Ld},23:{n:"AppVersion",t:_n,p:"version"},24:{n:"DigSig",t:mq},26:{n:"ContentType",t:wr},27:{n:"ContentStatus",t:wr},28:{n:"Language",t:wr},29:{n:"Version",t:wr},255:{},2147483648:{n:"Locale",t:v0},2147483651:{n:"Behavior",t:v0},1919054434:{}},bq={1:{n:"CodePage",t:C1},2:{n:"Title",t:wr},3:{n:"Subject",t:wr},4:{n:"Author",t:wr},5:{n:"Keywords",t:wr},6:{n:"Comments",t:wr},7:{n:"Template",t:wr},8:{n:"LastAuthor",t:wr},9:{n:"RevNumber",t:wr},10:{n:"EditTime",t:Bd},11:{n:"LastPrinted",t:Bd},12:{n:"CreatedDate",t:Bd},13:{n:"ModifiedDate",t:Bd},14:{n:"PageCount",t:_n},15:{n:"WordCount",t:_n},16:{n:"CharCount",t:_n},17:{n:"Thumbnail",t:gq},18:{n:"Application",t:wr},19:{n:"DocSecurity",t:_n},255:{},2147483648:{n:"Locale",t:v0},2147483651:{n:"Behavior",t:v0},1919054434:{}},l2={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},_q=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function Eq(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var Sq=Eq([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]),So=Mr(Sq),Go={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},eO={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},c2={"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"};function Tq(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function kq(e){var t=Tq();if(!e||!e.match)return t;var r={};if((e.match(Qr)||[]).forEach(function(n){var a=Xe(n);switch(a[0].replace(IH,"<")){case"<?xml":break;case"<Types":t.xmlns=a["xmlns"+(a[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[a.Extension]=a.ContentType;break;case"<Override":t[c2[a.ContentType]]!==void 0&&t[c2[a.ContentType]].push(a.PartName);break}}),t.xmlns!==WH.CT)throw new Error("Unknown Namespace: "+t.xmlns);return t.calcchain=t.calcchains.length>0?t.calcchains[0]:"",t.sst=t.strs.length>0?t.strs[0]:"",t.style=t.styles.length>0?t.styles[0]:"",t.defaults=r,delete t.calcchains,t}var Cl={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.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",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",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",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",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 Qv(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Ru(e,t){var r={"!id":{}};if(!e)return r;t.charAt(0)!=="/"&&(t="/"+t);var n={};return(e.match(Qr)||[]).forEach(function(a){var s=Xe(a);if(s[0]==="<Relationship"){var i={};i.Type=s.Type,i.Target=s.Target,i.Id=s.Id,s.TargetMode&&(i.TargetMode=s.TargetMode);var o=s.TargetMode==="External"?s.Target:mu(s.Target,t);r[o]=i,n[s.Id]=i}}),r["!id"]=n,r}var Nq="application/vnd.oasis.opendocument.spreadsheet";function Aq(e,t){for(var r=_1(e),n,a;n=_f.exec(r);)switch(n[3]){case"manifest":break;case"file-entry":if(a=Xe(n[0],!1),a.path=="/"&&a.type!==Nq)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(t&&t.WTF)throw n}}var Iu=[["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"]],Cq=function(){for(var e=new Array(Iu.length),t=0;t<Iu.length;++t){var r=Iu[t],n="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);e[t]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return e}();function tO(e){var t={};e=Dt(e);for(var r=0;r<Iu.length;++r){var n=Iu[r],a=e.match(Cq[r]);a!=null&&a.length>0&&(t[n[1]]=St(a[1])),n[2]==="date"&&t[n[1]]&&(t[n[1]]=Er(t[n[1]]))}return t}var Pq=[["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"]];function rO(e,t,r,n){var a=[];if(typeof e=="string")a=Z_(e,n);else for(var s=0;s<e.length;++s)a=a.concat(e[s].map(function(f){return{v:f}}));var i=typeof t=="string"?Z_(t,n).map(function(f){return f.v}):t,o=0,l=0;if(i.length>0)for(var u=0;u!==a.length;u+=2){switch(l=+a[u+1].v,a[u].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":r.Worksheets=l,r.SheetNames=i.slice(o,o+l);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne områder":r.NamedRanges=l,r.DefinedNames=i.slice(o,o+l);break;case"Charts":case"Diagramme":r.Chartsheets=l,r.ChartNames=i.slice(o,o+l);break}o+=l}}function Oq(e,t,r){var n={};return t||(t={}),e=Dt(e),Pq.forEach(function(a){var s=(e.match(bf(a[0]))||[])[1];switch(a[2]){case"string":s&&(t[a[1]]=St(s));break;case"bool":t[a[1]]=s==="true";break;case"raw":var i=e.match(new RegExp("<"+a[0]+"[^>]*>([\\s\\S]*?)</"+a[0]+">"));i&&i.length>0&&(n[a[1]]=i[1]);break}}),n.HeadingPairs&&n.TitlesOfParts&&rO(n.HeadingPairs,n.TitlesOfParts,t,r),t}var jq=/<[^>]+>[^<]*/g;function Rq(e,t){var r={},n="",a=e.match(jq);if(a)for(var s=0;s!=a.length;++s){var i=a[s],o=Xe(i);switch(o[0]){case"<?xml":break;case"<Properties":break;case"<property":n=St(o.name);break;case"</property>":n=null;break;default:if(i.indexOf("<vt:")===0){var l=i.split(">"),u=l[0].slice(4),f=l[1];switch(u){case"lpstr":case"bstr":case"lpwstr":r[n]=St(f);break;case"bool":r[n]=$t(f);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[n]=parseInt(f,10);break;case"r4":case"r8":case"decimal":r[n]=parseFloat(f);break;case"filetime":case"date":r[n]=Er(f);break;case"cy":case"error":r[n]=St(f);break;default:if(u.slice(-1)=="/")break;t.WTF&&typeof console<"u"&&console.warn("Unexpected",i,u,l)}}else if(i.slice(0,2)!=="</"){if(t.WTF)throw new Error(i)}}}return r}var Iq={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"},zm;function Fq(e,t,r){zm||(zm=y1(Iq)),t=zm[t]||t,e[t]=r}function P1(e){var t=e.read_shift(4),r=e.read_shift(4);return new Date((r/1e7*Math.pow(2,32)+t/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function nO(e,t,r){var n=e.l,a=e.read_shift(0,"lpstr-cp");if(r)for(;e.l-n&3;)++e.l;return a}function aO(e,t,r){var n=e.read_shift(0,"lpwstr");return n}function sO(e,t,r){return t===31?aO(e):nO(e,t,r)}function Zv(e,t,r){return sO(e,t,r===!1?0:4)}function Dq(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return sO(e,t,0)}function Mq(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n){var a=e.l;r[n]=e.read_shift(0,"lpwstr").replace(dn,""),e.l-a&2&&(e.l+=2)}return r}function Lq(e){for(var t=e.read_shift(4),r=[],n=0;n!=t;++n)r[n]=e.read_shift(0,"lpstr-cp").replace(dn,"");return r}function Bq(e){var t=e.l,r=x0(e,ZP);e[e.l]==0&&e[e.l+1]==0&&e.l-t&2&&(e.l+=2);var n=x0(e,_n);return[r,n]}function Uq(e){for(var t=e.read_shift(4),r=[],n=0;n<t/2;++n)r.push(Bq(e));return r}function u2(e,t){for(var r=e.read_shift(4),n={},a=0;a!=r;++a){var s=e.read_shift(4),i=e.read_shift(4);n[s]=e.read_shift(i,t===1200?"utf16le":"utf8").replace(dn,"").replace(pu,"!"),t===1200&&i%2&&(e.l+=2)}return e.l&3&&(e.l=e.l>>3<<2),n}function iO(e){var t=e.read_shift(4),r=e.slice(e.l,e.l+t);return e.l+=t,(t&3)>0&&(e.l+=4-(t&3)&3),r}function $q(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}function x0(e,t,r){var n=e.read_shift(2),a,s=r||{};if(e.l+=2,t!==o2&&n!==t&&yq.indexOf(t)===-1&&!((t&65534)==4126&&(n&65534)==4126))throw new Error("Expected type "+t+" saw "+n);switch(t===o2?n:t){case 2:return a=e.read_shift(2,"i"),s.raw||(e.l+=2),a;case 3:return a=e.read_shift(4,"i"),a;case 11:return e.read_shift(4)!==0;case 19:return a=e.read_shift(4),a;case 30:return nO(e,n,4).replace(dn,"");case 31:return aO(e);case 64:return P1(e);case 65:return iO(e);case 71:return $q(e);case 80:return Zv(e,n,!s.raw).replace(dn,"");case 81:return Dq(e,n).replace(dn,"");case 4108:return Uq(e);case 4126:case 4127:return n==4127?Mq(e):Lq(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+n)}}function f2(e,t){var r=e.l,n=e.read_shift(4),a=e.read_shift(4),s=[],i=0,o=0,l=-1,u={};for(i=0;i!=a;++i){var f=e.read_shift(4),d=e.read_shift(4);s[i]=[f,d+r]}s.sort(function(y,w){return y[1]-w[1]});var h={};for(i=0;i!=a;++i){if(e.l!==s[i][1]){var p=!0;if(i>0&&t)switch(t[s[i-1][0]].t){case 2:e.l+2===s[i][1]&&(e.l+=2,p=!1);break;case 80:e.l<=s[i][1]&&(e.l=s[i][1],p=!1);break;case 4108:e.l<=s[i][1]&&(e.l=s[i][1],p=!1);break}if((!t||i==0)&&e.l<=s[i][1]&&(p=!1,e.l=s[i][1]),p)throw new Error("Read Error: Expected address "+s[i][1]+" at "+e.l+" :"+i)}if(t){var v=t[s[i][0]];if(h[v.n]=x0(e,v.t,{raw:!0}),v.p==="version"&&(h[v.n]=String(h[v.n]>>16)+"."+("0000"+String(h[v.n]&65535)).slice(-4)),v.n=="CodePage")switch(h[v.n]){case 0:h[v.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:Na(o=h[v.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+h[v.n])}}else if(s[i][0]===1){if(o=h.CodePage=x0(e,C1),Na(o),l!==-1){var m=e.l;e.l=s[l][1],u=u2(e,o),e.l=m}}else if(s[i][0]===0){if(o===0){l=i,e.l=s[i+1][1];continue}u=u2(e,o)}else{var g=u[s[i][0]],x;switch(e[e.l]){case 65:e.l+=4,x=iO(e);break;case 30:e.l+=4,x=Zv(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 31:e.l+=4,x=Zv(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,x=e.read_shift(4,"i");break;case 19:e.l+=4,x=e.read_shift(4);break;case 5:e.l+=4,x=e.read_shift(8,"f");break;case 11:e.l+=4,x=er(e,4);break;case 64:e.l+=4,x=Er(P1(e));break;default:throw new Error("unparsed value: "+e[e.l])}h[g]=x}}return e.l=r+n,h}function d2(e,t,r){var n=e.content;if(!n)return{};jr(n,0);var a,s,i,o,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var u=n.read_shift(4),f=n.read_shift(16);if(f!==yt.utils.consts.HEADER_CLSID&&f!==r)throw new Error("Bad PropertySet CLSID "+f);if(a=n.read_shift(4),a!==1&&a!==2)throw new Error("Unrecognized #Sets: "+a);if(s=n.read_shift(16),o=n.read_shift(4),a===1&&o!==n.l)throw new Error("Length mismatch: "+o+" !== "+n.l);a===2&&(i=n.read_shift(16),l=n.read_shift(4));var d=f2(n,t),h={SystemIdentifier:u};for(var p in d)h[p]=d[p];if(h.FMTID=s,a===1)return h;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);var v;try{v=f2(n,null)}catch{}for(p in v)h[p]=v[p];return h.FMTID=[s,i],h}function qs(e,t){return e.read_shift(t),null}function zq(e,t,r){for(var n=[],a=e.l+t;e.l<a;)n.push(r(e,a-e.l));if(a!==e.l)throw new Error("Slurp error");return n}function er(e,t){return e.read_shift(t)===1}function ir(e){return e.read_shift(2,"u")}function oO(e,t){return zq(e,t,ir)}function Hq(e){var t=e.read_shift(1),r=e.read_shift(1);return r===1?t:t===1}function Qf(e,t,r){var n=e.read_shift(r&&r.biff>=12?2:1),a="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var s=e.read_shift(1);s&&(a="dbcs-cont")}else r.biff==12&&(a="wstr");r.biff>=2&&r.biff<=5&&(a="cpstr");var i=n?e.read_shift(n,a):"";return i}function qq(e){var t=e.read_shift(2),r=e.read_shift(1),n=r&4,a=r&8,s=1+(r&1),i=0,o,l={};a&&(i=e.read_shift(2)),n&&(o=e.read_shift(4));var u=s==2?"dbcs-cont":"sbcs-cont",f=t===0?"":e.read_shift(t,u);return a&&(e.l+=4*i),n&&(e.l+=o),l.t=f,a||(l.raw="<t>"+l.t+"</t>",l.r=l.t),l}function Mo(e,t,r){var n;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 a=e.read_shift(1);return a===0?n=e.read_shift(t,"sbcs-cont"):n=e.read_shift(t,"dbcs-cont"),n}function Zf(e,t,r){var n=e.read_shift(r&&r.biff==2?1:2);return n===0?(e.l++,""):Mo(e,n,r)}function Ko(e,t,r){if(r.biff>5)return Zf(e,t,r);var n=e.read_shift(1);return n===0?(e.l++,""):e.read_shift(n,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function Wq(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);return e.l+=2,[t,r]}function Vq(e){var t=e.read_shift(4),r=e.l,n=!1;t>24&&(e.l+=t-24,e.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(n=!0),e.l=r);var a=e.read_shift((n?t-24:t)>>1,"utf16le").replace(dn,"");return n&&(e.l+=24),a}function Gq(e){for(var t=e.read_shift(2),r="";t-- >0;)r+="../";var n=e.read_shift(0,"lpstr-ansi");if(e.l+=2,e.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var a=e.read_shift(4);if(a===0)return r+n.replace(/\\/g,"/");var s=e.read_shift(4);if(e.read_shift(2)!=3)throw new Error("Bad FileMoniker");var i=e.read_shift(s>>1,"utf16le").replace(dn,"");return r+i}function Kq(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return Vq(e);case"0303000000000000c000000000000046":return Gq(e);default:throw new Error("Unsupported Moniker "+r)}}function Ud(e){var t=e.read_shift(4),r=t>0?e.read_shift(t,"utf16le").replace(dn,""):"";return r}function Yq(e,t){var r=e.l+t,n=e.read_shift(4);if(n!==2)throw new Error("Unrecognized streamVersion: "+n);var a=e.read_shift(2);e.l+=2;var s,i,o,l,u="",f,d;a&16&&(s=Ud(e,r-e.l)),a&128&&(i=Ud(e,r-e.l)),(a&257)===257&&(o=Ud(e,r-e.l)),(a&257)===1&&(l=Kq(e,r-e.l)),a&8&&(u=Ud(e,r-e.l)),a&32&&(f=e.read_shift(16)),a&64&&(d=P1(e)),e.l=r;var h=i||o||l||"";h&&u&&(h+="#"+u),h||(h="#"+u),a&2&&h.charAt(0)=="/"&&h.charAt(1)!="/"&&(h="file://"+h);var p={Target:h};return f&&(p.guid=f),d&&(p.time=d),s&&(p.Tooltip=s),p}function lO(e){var t=e.read_shift(1),r=e.read_shift(1),n=e.read_shift(1),a=e.read_shift(1);return[t,r,n,a]}function cO(e,t){var r=lO(e);return r[3]=0,r}function is(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2);return{r:t,c:r,ixfe:n}}function Xq(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}function Jq(e,t,r){return t===0?"":Ko(e,t,r)}function Qq(e,t,r){var n=r.biff>8?4:2,a=e.read_shift(n),s=e.read_shift(n,"i"),i=e.read_shift(n,"i");return[a,s,i]}function uO(e){var t=e.read_shift(2),r=A1(e);return[t,r]}function Zq(e,t,r){e.l+=4,t-=4;var n=e.l+t,a=Qf(e,t,r),s=e.read_shift(2);if(n-=e.l,s!==n)throw new Error("Malformed AddinUdf: padding = "+n+" != "+s);return e.l+=s,a}function Ep(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2),a=e.read_shift(2);return{s:{c:n,r:t},e:{c:a,r}}}function fO(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(1),a=e.read_shift(1);return{s:{c:n,r:t},e:{c:a,r}}}var eW=fO;function dO(e){e.l+=4;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2);return e.l+=12,[r,t,n]}function tW(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t}function rW(e){var t={};return e.l+=4,e.cf=e.read_shift(2),t}function Hr(e){e.l+=2,e.l+=e.read_shift(2)}var nW={0:Hr,4:Hr,5:Hr,6:Hr,7:rW,8:Hr,9:Hr,10:Hr,11:Hr,12:Hr,13:tW,14:Hr,15:Hr,16:Hr,17:Hr,18:Hr,19:Hr,20:Hr,21:dO};function aW(e,t){for(var r=e.l+t,n=[];e.l<r;){var a=e.read_shift(2);e.l-=2;try{n.push(nW[a](e,r-e.l))}catch{return e.l=r,n}}return e.l!=r&&(e.l=r),n}function $d(e,t){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=e.read_shift(2),t-=2,t>=2&&(r.dt=e.read_shift(2),e.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(t>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return e.read_shift(t),r}function sW(e,t){return t===0||e.read_shift(2),1200}function iW(e,t,r){if(r.enc)return e.l+=t,"";var n=e.l,a=Ko(e,0,r);return e.read_shift(t+n-e.l),a}function oW(e,t,r){var n=r&&r.biff==8||t==2?e.read_shift(2):(e.l+=t,0);return{fDialog:n&16,fBelow:n&64,fRight:n&128}}function lW(e,t,r){var n=e.read_shift(4),a=e.read_shift(1)&3,s=e.read_shift(1);switch(s){case 0:s="Worksheet";break;case 1:s="Macrosheet";break;case 2:s="Chartsheet";break;case 6:s="VBAModule";break}var i=Qf(e,0,r);return i.length===0&&(i="Sheet1"),{pos:n,hs:a,dt:s,name:i}}function cW(e,t){for(var r=e.l+t,n=e.read_shift(4),a=e.read_shift(4),s=[],i=0;i!=a&&e.l<r;++i)s.push(qq(e));return s.Count=n,s.Unique=a,s}function uW(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}function fW(e){var t={};t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c;var r=e.read_shift(2);e.l+=4;var n=e.read_shift(1);return e.l+=3,n&7&&(t.level=n&7),n&32&&(t.hidden=!0),n&64&&(t.hpt=r/20),t}function dW(e){var t=Xq(e);if(t.type!=2211)throw new Error("Invalid Future Record "+t.type);var r=e.read_shift(4);return r!==0}function hW(e){return e.read_shift(2),e.read_shift(4)}function h2(e,t,r){var n=0;r&&r.biff==2||(n=e.read_shift(2));var a=e.read_shift(2);r&&r.biff==2&&(n=1-(a>>15),a&=32767);var s={Unsynced:n&1,DyZero:(n&2)>>1,ExAsc:(n&4)>>2,ExDsc:(n&8)>>3};return[s,a]}function pW(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2),o=e.read_shift(2),l=e.read_shift(2),u=e.read_shift(2);return{Pos:[t,r],Dim:[n,a],Flags:s,CurTab:i,FirstTab:o,Selected:l,TabRatio:u}}function mW(e,t,r){if(r&&r.biff>=2&&r.biff<5)return{};var n=e.read_shift(2);return{RTL:n&64}}function gW(){}function vW(e,t,r){var n={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10;break}return n.name=Qf(e,0,r),n}function xW(e){var t=is(e);return t.isst=e.read_shift(4),t}function yW(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var n=e.l+t,a=is(e);r.biff==2&&e.l++;var s=Zf(e,n-e.l,r);return a.val=s,a}function wW(e,t,r){var n=e.read_shift(2),a=Ko(e,0,r);return[n,a]}var bW=Ko;function p2(e,t,r){var n=e.l+t,a=r.biff==8||!r.biff?4:2,s=e.read_shift(a),i=e.read_shift(a),o=e.read_shift(2),l=e.read_shift(2);return e.l=n,{s:{r:s,c:o},e:{r:i,c:l}}}function _W(e){var t=e.read_shift(2),r=e.read_shift(2),n=uO(e);return{r:t,c:r,ixfe:n[0],rknum:n[1]}}function EW(e,t){for(var r=e.l+t-2,n=e.read_shift(2),a=e.read_shift(2),s=[];e.l<r;)s.push(uO(e));if(e.l!==r)throw new Error("MulRK read error");var i=e.read_shift(2);if(s.length!=i-a+1)throw new Error("MulRK length mismatch");return{r:n,c:a,C:i,rkrec:s}}function SW(e,t){for(var r=e.l+t-2,n=e.read_shift(2),a=e.read_shift(2),s=[];e.l<r;)s.push(e.read_shift(2));if(e.l!==r)throw new Error("MulBlank read error");var i=e.read_shift(2);if(s.length!=i-a+1)throw new Error("MulBlank length mismatch");return{r:n,c:a,C:i,ixfe:s}}function TW(e,t,r,n){var a={},s=e.read_shift(4),i=e.read_shift(4),o=e.read_shift(4),l=e.read_shift(2);return a.patternType=_q[o>>26],n.cellStyles&&(a.alc=s&7,a.fWrap=s>>3&1,a.alcV=s>>4&7,a.fJustLast=s>>7&1,a.trot=s>>8&255,a.cIndent=s>>16&15,a.fShrinkToFit=s>>20&1,a.iReadOrder=s>>22&2,a.fAtrNum=s>>26&1,a.fAtrFnt=s>>27&1,a.fAtrAlc=s>>28&1,a.fAtrBdr=s>>29&1,a.fAtrPat=s>>30&1,a.fAtrProt=s>>31&1,a.dgLeft=i&15,a.dgRight=i>>4&15,a.dgTop=i>>8&15,a.dgBottom=i>>12&15,a.icvLeft=i>>16&127,a.icvRight=i>>23&127,a.grbitDiag=i>>30&3,a.icvTop=o&127,a.icvBottom=o>>7&127,a.icvDiag=o>>14&127,a.dgDiag=o>>21&15,a.icvFore=l&127,a.icvBack=l>>7&127,a.fsxButton=l>>14&1),a}function kW(e,t,r){var n={};return n.ifnt=e.read_shift(2),n.numFmtId=e.read_shift(2),n.flags=e.read_shift(2),n.fStyle=n.flags>>2&1,t-=6,n.data=TW(e,t,n.fStyle,r),n}function NW(e){e.l+=4;var t=[e.read_shift(2),e.read_shift(2)];if(t[0]!==0&&t[0]--,t[1]!==0&&t[1]--,t[0]>7||t[1]>7)throw new Error("Bad Gutters: "+t.join("|"));return t}function m2(e,t,r){var n=is(e);(r.biff==2||t==9)&&++e.l;var a=Hq(e);return n.val=a,n.t=a===!0||a===!1?"b":"e",n}function AW(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var n=is(e),a=Vr(e);return n.val=a,n}var g2=Jq;function CW(e,t,r){var n=e.l+t,a=e.read_shift(2),s=e.read_shift(2);if(r.sbcch=s,s==1025||s==14849)return[s,a];if(s<1||s>255)throw new Error("Unexpected SupBook type: "+s);for(var i=Mo(e,s),o=[];n>e.l;)o.push(Zf(e));return[s,a,i,o]}function v2(e,t,r){var n=e.read_shift(2),a,s={fBuiltIn:n&1,fWantAdvise:n>>>1&1,fWantPict:n>>>2&1,fOle:n>>>3&1,fOleLink:n>>>4&1,cf:n>>>5&1023,fIcon:n>>>15&1};return r.sbcch===14849&&(a=Zq(e,t-2,r)),s.body=a||e.read_shift(t-2),typeof a=="string"&&(s.Name=a),s}var PW=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function x2(e,t,r){var n=e.l+t,a=e.read_shift(2),s=e.read_shift(1),i=e.read_shift(1),o=e.read_shift(r&&r.biff==2?1:2),l=0;(!r||r.biff>=5)&&(r.biff!=5&&(e.l+=2),l=e.read_shift(2),r.biff==5&&(e.l+=2),e.l+=4);var u=Mo(e,i,r);a&32&&(u=PW[u.charCodeAt(0)]);var f=n-e.l;r&&r.biff==2&&--f;var d=n==e.l||o===0||!(f>0)?[]:fY(e,f,r,o);return{chKey:s,Name:u,itab:l,rgce:d}}function hO(e,t,r){if(r.biff<8)return OW(e,t,r);for(var n=[],a=e.l+t,s=e.read_shift(r.biff>8?4:2);s--!==0;)n.push(Qq(e,r.biff>8?12:6,r));if(e.l!=a)throw new Error("Bad ExternSheet: "+e.l+" != "+a);return n}function OW(e,t,r){e[e.l+1]==3&&e[e.l]++;var n=Qf(e,t,r);return n.charCodeAt(0)==3?n.slice(1):n}function jW(e,t,r){if(r.biff<8){e.l+=t;return}var n=e.read_shift(2),a=e.read_shift(2),s=Mo(e,n,r),i=Mo(e,a,r);return[s,i]}function RW(e,t,r){var n=fO(e);e.l++;var a=e.read_shift(1);return t-=8,[dY(e,t,r),a,n]}function y2(e,t,r){var n=eW(e);switch(r.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[n,cY(e,t,r)]}function IW(e){var t=e.read_shift(4)!==0,r=e.read_shift(4)!==0,n=e.read_shift(4);return[t,r,n]}function FW(e,t,r){if(!(r.biff<8)){var n=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2),o=Ko(e,0,r);return r.biff<8&&e.read_shift(1),[{r:n,c:a},o,i,s]}}function DW(e,t,r){return FW(e,t,r)}function MW(e,t){for(var r=[],n=e.read_shift(2);n--;)r.push(Ep(e));return r}function LW(e,t,r){if(r&&r.biff<8)return UW(e,t,r);var n=dO(e),a=aW(e,t-22,n[1]);return{cmo:n,ft:a}}var BW={8:function(e,t){var r=e.l+t;e.l+=10;var n=e.read_shift(2);e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4;var a=e.read_shift(1);return e.l+=a,e.l=r,{fmt:n}}};function UW(e,t,r){e.l+=4;var n=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2);e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=6,t-=36;var i=[];return i.push((BW[n]||Jr)(e,t,r)),{cmo:[a,n,s],ft:i}}function $W(e,t,r){var n=e.l,a="";try{e.l+=4;var s=(r.lastobj||{cmo:[0,0]}).cmo[1],i;[0,5,7,11,12,14].indexOf(s)==-1?e.l+=6:i=Wq(e,6,r);var o=e.read_shift(2);e.read_shift(2),ir(e,2);var l=e.read_shift(2);e.l+=l;for(var u=1;u<e.lens.length-1;++u){if(e.l-n!=e.lens[u])throw new Error("TxO: bad continue record");var f=e[e.l],d=Mo(e,e.lens[u+1]-e.lens[u]-1);if(a+=d,a.length>=(f?o:2*o))break}if(a.length!==o&&a.length!==o*2)throw new Error("cchText: "+o+" != "+a.length);return e.l=n+t,{t:a}}catch{return e.l=n+t,{t:a}}}function zW(e,t){var r=Ep(e);e.l+=16;var n=Yq(e,t-24);return[r,n]}function HW(e,t){e.read_shift(2);var r=Ep(e),n=e.read_shift((t-10)/2,"dbcs-cont");return n=n.replace(dn,""),[r,n]}function qW(e){var t=[0,0],r;return r=e.read_shift(2),t[0]=l2[r]||r,r=e.read_shift(2),t[1]=l2[r]||r,t}function WW(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(cO(e));return r}function VW(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(cO(e));return r}function GW(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t}function pO(e,t,r){if(!r.cellStyles)return Jr(e,t);var n=r&&r.biff>=12?4:2,a=e.read_shift(n),s=e.read_shift(n),i=e.read_shift(n),o=e.read_shift(n),l=e.read_shift(2);n==2&&(e.l+=2);var u={s:a,e:s,w:i,ixfe:o,flags:l};return(r.biff>=5||!r.biff)&&(u.level=l>>8&7),u}function KW(e,t){var r={};return t<32||(e.l+=16,r.header=Vr(e),r.footer=Vr(e),e.l+=2),r}function YW(e,t,r){var n={area:!1};if(r.biff!=5)return e.l+=t,n;var a=e.read_shift(1);return e.l+=3,a&16&&(n.area=!0),n}var XW=is,JW=oO,QW=Zf;function ZW(e){var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),a={fmt:t,env:r,len:n,data:e.slice(e.l,e.l+n)};return e.l+=n,a}function eV(e,t,r){r.biffguess&&r.biff==5&&(r.biff=2);var n=is(e);++e.l;var a=Ko(e,t-7,r);return n.t="str",n.val=a,n}function tV(e){var t=is(e);++e.l;var r=Vr(e);return t.t="n",t.val=r,t}function rV(e){var t=is(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}function nV(e){var t=e.read_shift(1);return t===0?(e.l++,""):e.read_shift(t,"sbcs-cont")}function aV(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}function sV(e,t,r){var n=e.l+t,a=is(e),s=e.read_shift(2),i=Mo(e,s,r);return e.l=n,a.t="str",a.val=i,a}var iV=[2,3,48,49,131,139,140,245],w2=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=y1({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(o,l){var u=[],f=Di(1);switch(l.type){case"base64":f=ka(qn(o));break;case"binary":f=ka(o);break;case"buffer":case"array":f=o;break}jr(f,0);var d=f.read_shift(1),h=!!(d&136),p=!1,v=!1;switch(d){case 2:break;case 3:break;case 48:p=!0,h=!0;break;case 49:p=!0,h=!0;break;case 131:break;case 139:break;case 140:v=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+d.toString(16))}var m=0,g=521;d==2&&(m=f.read_shift(2)),f.l+=3,d!=2&&(m=f.read_shift(4)),m>1048576&&(m=1e6),d!=2&&(g=f.read_shift(2));var x=f.read_shift(2),y=l.codepage||1252;d!=2&&(f.l+=16,f.read_shift(1),f[f.l]!==0&&(y=e[f[f.l]]),f.l+=1,f.l+=2),v&&(f.l+=36);for(var w=[],b={},_=Math.min(f.length,d==2?521:g-10-(p?264:0)),T=v?32:11;f.l<_&&f[f.l]!=13;)switch(b={},b.name=yf.utils.decode(y,f.slice(f.l,f.l+T)).replace(/[\u0000\r\n].*$/g,""),f.l+=T,b.type=String.fromCharCode(f.read_shift(1)),d!=2&&!v&&(b.offset=f.read_shift(4)),b.len=f.read_shift(1),d==2&&(b.offset=f.read_shift(2)),b.dec=f.read_shift(1),b.name.length&&w.push(b),d!=2&&(f.l+=v?13:14),b.type){case"B":(!p||b.len!=8)&&l.WTF&&console.log("Skipping "+b.name+":"+b.type);break;case"G":case"P":l.WTF&&console.log("Skipping "+b.name+":"+b.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: "+b.type)}if(f[f.l]!==13&&(f.l=g-1),f.read_shift(1)!==13)throw new Error("DBF Terminator not found "+f.l+" "+f[f.l]);f.l=g;var E=0,C=0;for(u[0]=[],C=0;C!=w.length;++C)u[0][C]=w[C].name;for(;m-- >0;){if(f[f.l]===42){f.l+=x;continue}for(++f.l,u[++E]=[],C=0,C=0;C!=w.length;++C){var P=f.slice(f.l,f.l+w[C].len);f.l+=w[C].len,jr(P,0);var N=yf.utils.decode(y,P);switch(w[C].type){case"C":N.trim().length&&(u[E][C]=N.replace(/\s+$/,""));break;case"D":N.length===8?u[E][C]=new Date(+N.slice(0,4),+N.slice(4,6)-1,+N.slice(6,8)):u[E][C]=N;break;case"F":u[E][C]=parseFloat(N.trim());break;case"+":case"I":u[E][C]=v?P.read_shift(-4,"i")^2147483648:P.read_shift(4,"i");break;case"L":switch(N.trim().toUpperCase()){case"Y":case"T":u[E][C]=!0;break;case"N":case"F":u[E][C]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+N+"|")}break;case"M":if(!h)throw new Error("DBF Unexpected MEMO for type "+d.toString(16));u[E][C]="##MEMO##"+(v?parseInt(N.trim(),10):P.read_shift(4));break;case"N":N=N.replace(/\u0000/g,"").trim(),N&&N!="."&&(u[E][C]=+N||0);break;case"@":u[E][C]=new Date(P.read_shift(-8,"f")-621356832e5);break;case"T":u[E][C]=new Date((P.read_shift(4)-2440588)*864e5+P.read_shift(4));break;case"Y":u[E][C]=P.read_shift(4,"i")/1e4+P.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[E][C]=-P.read_shift(-8,"f");break;case"B":if(p&&w[C].len==8){u[E][C]=P.read_shift(8,"f");break}case"G":case"P":P.l+=w[C].len;break;case"0":if(w[C].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+w[C].type)}}}if(d!=2&&f.l<f.length&&f[f.l++]!=26)throw new Error("DBF EOF Marker missing "+(f.l-1)+" of "+f.length+" "+f[f.l-1].toString(16));return l&&l.sheetRows&&(u=u.slice(0,l.sheetRows)),l.DBF=w,u}function n(o,l){var u=l||{};u.dateNF||(u.dateNF="yyyymmdd");var f=Cc(r(o,u),u);return f["!cols"]=u.DBF.map(function(d){return{wch:d.len,DBF:d}}),delete u.DBF,f}function a(o,l){try{return Wi(n(o,l),l)}catch(u){if(l&&l.WTF)throw u}return{SheetNames:[],Sheets:{}}}var s={B:8,C:250,L:1,D:8,"?":0,"":0};function i(o,l){var u=l||{};if(+u.codepage>=0&&Na(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var f=Xv(),d=sx(o,{header:1,raw:!0,cellDates:!0}),h=d[0],p=d.slice(1),v=o["!cols"]||[],m=0,g=0,x=0,y=1;for(m=0;m<h.length;++m){if(((v[m]||{}).DBF||{}).name){h[m]=v[m].DBF.name,++x;continue}if(h[m]!=null){if(++x,typeof h[m]=="number"&&(h[m]=h[m].toString(10)),typeof h[m]!="string")throw new Error("DBF Invalid column name "+h[m]+" |"+typeof h[m]+"|");if(h.indexOf(h[m])!==m){for(g=0;g<1024;++g)if(h.indexOf(h[m]+"_"+g)==-1){h[m]+="_"+g;break}}}}var w=Zt(o["!ref"]),b=[],_=[],T=[];for(m=0;m<=w.e.c-w.s.c;++m){var E="",C="",P=0,N=[];for(g=0;g<p.length;++g)p[g][m]!=null&&N.push(p[g][m]);if(N.length==0||h[m]==null){b[m]="?";continue}for(g=0;g<N.length;++g){switch(typeof N[g]){case"number":C="B";break;case"string":C="C";break;case"boolean":C="L";break;case"object":C=N[g]instanceof Date?"D":"C";break;default:C="C"}P=Math.max(P,String(N[g]).length),E=E&&E!=C?"C":C}P>250&&(P=250),C=((v[m]||{}).DBF||{}).type,C=="C"&&v[m].DBF.len>P&&(P=v[m].DBF.len),E=="B"&&C=="N"&&(E="N",T[m]=v[m].DBF.dec,P=v[m].DBF.len),_[m]=E=="C"||C=="N"?P:s[E]||0,y+=_[m],b[m]=E}var k=f.next(32);for(k.write_shift(4,318902576),k.write_shift(4,p.length),k.write_shift(2,296+32*x),k.write_shift(2,y),m=0;m<4;++m)k.write_shift(4,0);for(k.write_shift(4,0|(+t[hP]||3)<<8),m=0,g=0;m<h.length;++m)if(h[m]!=null){var A=f.next(32),I=(h[m].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);A.write_shift(1,I,"sbcs"),A.write_shift(1,b[m]=="?"?"C":b[m],"sbcs"),A.write_shift(4,g),A.write_shift(1,_[m]||s[b[m]]||0),A.write_shift(1,T[m]||0),A.write_shift(1,2),A.write_shift(4,0),A.write_shift(1,0),A.write_shift(4,0),A.write_shift(4,0),g+=_[m]||s[b[m]]||0}var M=f.next(264);for(M.write_shift(4,13),m=0;m<65;++m)M.write_shift(4,0);for(m=0;m<p.length;++m){var U=f.next(y);for(U.write_shift(1,0),g=0;g<h.length;++g)if(h[g]!=null)switch(b[g]){case"L":U.write_shift(1,p[m][g]==null?63:p[m][g]?84:70);break;case"B":U.write_shift(8,p[m][g]||0,"f");break;case"N":var W="0";for(typeof p[m][g]=="number"&&(W=p[m][g].toFixed(T[g]||0)),x=0;x<_[g]-W.length;++x)U.write_shift(1,32);U.write_shift(1,W,"sbcs");break;case"D":p[m][g]?(U.write_shift(4,("0000"+p[m][g].getFullYear()).slice(-4),"sbcs"),U.write_shift(2,("00"+(p[m][g].getMonth()+1)).slice(-2),"sbcs"),U.write_shift(2,("00"+p[m][g].getDate()).slice(-2),"sbcs")):U.write_shift(8,"00000000","sbcs");break;case"C":var G=String(p[m][g]!=null?p[m][g]:"").slice(0,_[g]);for(U.write_shift(1,G,"sbcs"),x=0;x<_[g]-G.length;++x)U.write_shift(1,32);break}}return f.next(1).write_shift(1,26),f.end()}return{to_workbook:a,to_sheet:n,from_sheet:i}}(),oV=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("+ns(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(h,p){var v=e[p];return typeof v=="number"?D_(v):v},n=function(h,p,v){var m=p.charCodeAt(0)-32<<4|v.charCodeAt(0)-48;return m==59?h:D_(m)};e["|"]=254;function a(h,p){switch(p.type){case"base64":return s(qn(h),p);case"binary":return s(h,p);case"buffer":return s(gt&&Buffer.isBuffer(h)?h.toString("binary"):qo(h),p);case"array":return s(Do(h),p)}throw new Error("Unrecognized type "+p.type)}function s(h,p){var v=h.split(/[\n\r]+/),m=-1,g=-1,x=0,y=0,w=[],b=[],_=null,T={},E=[],C=[],P=[],N=0,k;for(+p.codepage>=0&&Na(+p.codepage);x!==v.length;++x){N=0;var A=v[x].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(t,r),I=A.replace(/;;/g,"\0").split(";").map(function(L){return L.replace(/\u0000/g,";")}),M=I[0],U;if(A.length>0)switch(M){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":I[1].charAt(0)=="P"&&b.push(A.slice(3).replace(/;;/g,";"));break;case"C":var W=!1,G=!1,Q=!1,R=!1,z=-1,D=-1;for(y=1;y<I.length;++y)switch(I[y].charAt(0)){case"A":break;case"X":g=parseInt(I[y].slice(1))-1,G=!0;break;case"Y":for(m=parseInt(I[y].slice(1))-1,G||(g=0),k=w.length;k<=m;++k)w[k]=[];break;case"K":U=I[y].slice(1),U.charAt(0)==='"'?U=U.slice(1,U.length-1):U==="TRUE"?U=!0:U==="FALSE"?U=!1:isNaN(ja(U))?isNaN(hc(U).getDate())||(U=Er(U)):(U=ja(U),_!==null&&Nc(_)&&(U=_p(U))),W=!0;break;case"E":R=!0;var O=ql(I[y].slice(1),{r:m,c:g});w[m][g]=[w[m][g],O];break;case"S":Q=!0,w[m][g]=[w[m][g],"S5S"];break;case"G":break;case"R":z=parseInt(I[y].slice(1))-1;break;case"C":D=parseInt(I[y].slice(1))-1;break;default:if(p&&p.WTF)throw new Error("SYLK bad record "+A)}if(W&&(w[m][g]&&w[m][g].length==2?w[m][g][0]=U:w[m][g]=U,_=null),Q){if(R)throw new Error("SYLK shared formula cannot have own formula");var j=z>-1&&w[z][D];if(!j||!j[1])throw new Error("SYLK shared formula cannot find base");w[m][g][1]=SO(j[1],{r:m-z,c:g-D})}break;case"F":var B=0;for(y=1;y<I.length;++y)switch(I[y].charAt(0)){case"X":g=parseInt(I[y].slice(1))-1,++B;break;case"Y":for(m=parseInt(I[y].slice(1))-1,k=w.length;k<=m;++k)w[k]=[];break;case"M":N=parseInt(I[y].slice(1))/20;break;case"F":break;case"G":break;case"P":_=b[parseInt(I[y].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(P=I[y].slice(1).split(" "),k=parseInt(P[0],10);k<=parseInt(P[1],10);++k)N=parseInt(P[2],10),C[k-1]=N===0?{hidden:!0}:{wch:N},pc(C[k-1]);break;case"C":g=parseInt(I[y].slice(1))-1,C[g]||(C[g]={});break;case"R":m=parseInt(I[y].slice(1))-1,E[m]||(E[m]={}),N>0?(E[m].hpt=N,E[m].hpx=Tf(N)):N===0&&(E[m].hidden=!0);break;default:if(p&&p.WTF)throw new Error("SYLK bad record "+A)}B<1&&(_=null);break;default:if(p&&p.WTF)throw new Error("SYLK bad record "+A)}}return E.length>0&&(T["!rows"]=E),C.length>0&&(T["!cols"]=C),p&&p.sheetRows&&(w=w.slice(0,p.sheetRows)),[w,T]}function i(h,p){var v=a(h,p),m=v[0],g=v[1],x=Cc(m,p);return ns(g).forEach(function(y){x[y]=g[y]}),x}function o(h,p){return Wi(i(h,p),p)}function l(h,p,v,m){var g="C;Y"+(v+1)+";X"+(m+1)+";K";switch(h.t){case"n":g+=h.v||0,h.f&&!h.F&&(g+=";E"+GG(h.f,{r:v,c:m}));break;case"b":g+=h.v?"TRUE":"FALSE";break;case"e":g+=h.w||h.v;break;case"d":g+='"'+(h.w||h.v)+'"';break;case"s":g+='"'+h.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return g}function u(h,p){p.forEach(function(v,m){var g="F;W"+(m+1)+" "+(m+1)+" ";v.hidden?g+="0":(typeof v.width=="number"&&!v.wpx&&(v.wpx=w0(v.width)),typeof v.wpx=="number"&&!v.wch&&(v.wch=b0(v.wpx)),typeof v.wch=="number"&&(g+=Math.round(v.wch))),g.charAt(g.length-1)!=" "&&h.push(g)})}function f(h,p){p.forEach(function(v,m){var g="F;";v.hidden?g+="M0;":v.hpt?g+="M"+20*v.hpt+";":v.hpx&&(g+="M"+20*bO(v.hpx)+";"),g.length>2&&h.push(g+"R"+(m+1))})}function d(h,p){var v=["ID;PWXL;N;E"],m=[],g=Zt(h["!ref"]),x,y=Array.isArray(h),w=`\r
`;v.push("P;PGeneral"),v.push("F;P0;DG0G8;M255"),h["!cols"]&&u(v,h["!cols"]),h["!rows"]&&f(v,h["!rows"]),v.push("B;Y"+(g.e.r-g.s.r+1)+";X"+(g.e.c-g.s.c+1)+";D"+[g.s.c,g.s.r,g.e.c,g.e.r].join(" "));for(var b=g.s.r;b<=g.e.r;++b)for(var _=g.s.c;_<=g.e.c;++_){var T=et({r:b,c:_});x=y?(h[b]||[])[_]:h[T],!(!x||x.v==null&&(!x.f||x.F))&&m.push(l(x,h,b,_))}return v.join(w)+w+m.join(w)+w+"E"+w}return{to_workbook:o,to_sheet:i,from_sheet:d}}(),lV=function(){function e(s,i){switch(i.type){case"base64":return t(qn(s),i);case"binary":return t(s,i);case"buffer":return t(gt&&Buffer.isBuffer(s)?s.toString("binary"):qo(s),i);case"array":return t(Do(s),i)}throw new Error("Unrecognized type "+i.type)}function t(s,i){for(var o=s.split(`
`),l=-1,u=-1,f=0,d=[];f!==o.length;++f){if(o[f].trim()==="BOT"){d[++l]=[],u=0;continue}if(!(l<0)){var h=o[f].trim().split(","),p=h[0],v=h[1];++f;for(var m=o[f]||"";(m.match(/["]/g)||[]).length&1&&f<o.length-1;)m+=`
`+o[++f];switch(m=m.trim(),+p){case-1:if(m==="BOT"){d[++l]=[],u=0;continue}else if(m!=="EOD")throw new Error("Unrecognized DIF special command "+m);break;case 0:m==="TRUE"?d[l][u]=!0:m==="FALSE"?d[l][u]=!1:isNaN(ja(v))?isNaN(hc(v).getDate())?d[l][u]=v:d[l][u]=Er(v):d[l][u]=ja(v),++u;break;case 1:m=m.slice(1,m.length-1),m=m.replace(/""/g,'"'),m&&m.match(/^=".*"$/)&&(m=m.slice(2,-1)),d[l][u++]=m!==""?m:null;break}if(m==="EOD")break}}return i&&i.sheetRows&&(d=d.slice(0,i.sheetRows)),d}function r(s,i){return Cc(e(s,i),i)}function n(s,i){return Wi(r(s,i),i)}var a=function(){var s=function(l,u,f,d,h){l.push(u),l.push(f+","+d),l.push('"'+h.replace(/"/g,'""')+'"')},i=function(l,u,f,d){l.push(u+","+f),l.push(u==1?'"'+d.replace(/"/g,'""')+'"':d)};return function(l){var u=[],f=Zt(l["!ref"]),d,h=Array.isArray(l);s(u,"TABLE",0,1,"sheetjs"),s(u,"VECTORS",0,f.e.r-f.s.r+1,""),s(u,"TUPLES",0,f.e.c-f.s.c+1,""),s(u,"DATA",0,0,"");for(var p=f.s.r;p<=f.e.r;++p){i(u,-1,0,"BOT");for(var v=f.s.c;v<=f.e.c;++v){var m=et({r:p,c:v});if(d=h?(l[p]||[])[v]:l[m],!d){i(u,1,0,"");continue}switch(d.t){case"n":var g=d.w;!g&&d.v!=null&&(g=d.v),g==null?d.f&&!d.F?i(u,1,0,"="+d.f):i(u,1,0,""):i(u,0,g,"V");break;case"b":i(u,0,d.v?1:0,d.v?"TRUE":"FALSE");break;case"s":i(u,1,0,isNaN(d.v)?d.v:'="'+d.v+'"');break;case"d":d.w||(d.w=la(d.z||rt[14],pn(Er(d.v)))),i(u,0,d.w,"V");break;default:i(u,1,0,"")}}}i(u,-1,0,"EOD");var x=`\r
`,y=u.join(x);return y}}();return{to_workbook:n,to_sheet:r,from_sheet:a}}(),cV=function(){function e(d){return d.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
`)}function t(d){return d.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(d,h){for(var p=d.split(`
`),v=-1,m=-1,g=0,x=[];g!==p.length;++g){var y=p[g].trim().split(":");if(y[0]==="cell"){var w=un(y[1]);if(x.length<=w.r)for(v=x.length;v<=w.r;++v)x[v]||(x[v]=[]);switch(v=w.r,m=w.c,y[2]){case"t":x[v][m]=e(y[3]);break;case"v":x[v][m]=+y[3];break;case"vtf":var b=y[y.length-1];case"vtc":switch(y[3]){case"nl":x[v][m]=!!+y[4];break;default:x[v][m]=+y[4];break}y[2]=="vtf"&&(x[v][m]=[x[v][m],b])}}}return h&&h.sheetRows&&(x=x.slice(0,h.sheetRows)),x}function n(d,h){return Cc(r(d,h),h)}function a(d,h){return Wi(n(d,h),h)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
`),i=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
`)+`
`,o=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
`),l="--SocialCalcSpreadsheetControlSave--";function u(d){if(!d||!d["!ref"])return"";for(var h=[],p=[],v,m="",g=Ac(d["!ref"]),x=Array.isArray(d),y=g.s.r;y<=g.e.r;++y)for(var w=g.s.c;w<=g.e.c;++w)if(m=et({r:y,c:w}),v=x?(d[y]||[])[w]:d[m],!(!v||v.v==null||v.t==="z")){switch(p=["cell",m,"t"],v.t){case"s":case"str":p.push(t(v.v));break;case"n":v.f?(p[2]="vtf",p[3]="n",p[4]=v.v,p[5]=t(v.f)):(p[2]="v",p[3]=v.v);break;case"b":p[2]="vt"+(v.f?"f":"c"),p[3]="nl",p[4]=v.v?"1":"0",p[5]=t(v.f||(v.v?"TRUE":"FALSE"));break;case"d":var b=pn(Er(v.v));p[2]="vtc",p[3]="nd",p[4]=""+b,p[5]=v.w||la(v.z||rt[14],b);break;case"e":continue}h.push(p.join(":"))}return h.push("sheet:c:"+(g.e.c-g.s.c+1)+":r:"+(g.e.r-g.s.r+1)+":tvf:1"),h.push("valueformat:1:text-wiki"),h.join(`
`)}function f(d){return[s,i,o,i,u(d),l].join(`
`)}return{to_workbook:a,to_sheet:n,from_sheet:f}}(),Ef=function(){function e(f,d,h,p,v){v.raw?d[h][p]=f:f===""||(f==="TRUE"?d[h][p]=!0:f==="FALSE"?d[h][p]=!1:isNaN(ja(f))?isNaN(hc(f).getDate())?d[h][p]=f:d[h][p]=Er(f):d[h][p]=ja(f))}function t(f,d){var h=d||{},p=[];if(!f||f.length===0)return p;for(var v=f.split(/[\r\n]/),m=v.length-1;m>=0&&v[m].length===0;)--m;for(var g=10,x=0,y=0;y<=m;++y)x=v[y].indexOf(" "),x==-1?x=v[y].length:x++,g=Math.max(g,x);for(y=0;y<=m;++y){p[y]=[];var w=0;for(e(v[y].slice(0,g).trim(),p,y,w,h),w=1;w<=(v[y].length-g)/10+1;++w)e(v[y].slice(g+(w-1)*10,g+w*10).trim(),p,y,w,h)}return h.sheetRows&&(p=p.slice(0,h.sheetRows)),p}var r={44:",",9:" ",59:";",124:"|"},n={44:3,9:2,59:1,124:0};function a(f){for(var d={},h=!1,p=0,v=0;p<f.length;++p)(v=f.charCodeAt(p))==34?h=!h:!h&&v in r&&(d[v]=(d[v]||0)+1);v=[];for(p in d)Object.prototype.hasOwnProperty.call(d,p)&&v.push([d[p],p]);if(!v.length){d=n;for(p in d)Object.prototype.hasOwnProperty.call(d,p)&&v.push([d[p],p])}return v.sort(function(m,g){return m[0]-g[0]||n[m[1]]-n[g[1]]}),r[v.pop()[1]]||44}function s(f,d){var h=d||{},p="",v=h.dense?[]:{},m={s:{c:0,r:0},e:{c:0,r:0}};f.slice(0,4)=="sep="?f.charCodeAt(5)==13&&f.charCodeAt(6)==10?(p=f.charAt(4),f=f.slice(7)):f.charCodeAt(5)==13||f.charCodeAt(5)==10?(p=f.charAt(4),f=f.slice(6)):p=a(f.slice(0,1024)):h&&h.FS?p=h.FS:p=a(f.slice(0,1024));var g=0,x=0,y=0,w=0,b=0,_=p.charCodeAt(0),T=!1,E=0,C=f.charCodeAt(0);f=f.replace(/\r\n/mg,`
`);var P=h.dateNF!=null?wH(h.dateNF):null;function N(){var k=f.slice(w,b),A={};if(k.charAt(0)=='"'&&k.charAt(k.length-1)=='"'&&(k=k.slice(1,-1).replace(/""/g,'"')),k.length===0)A.t="z";else if(h.raw)A.t="s",A.v=k;else if(k.trim().length===0)A.t="s",A.v=k;else if(k.charCodeAt(0)==61)k.charCodeAt(1)==34&&k.charCodeAt(k.length-1)==34?(A.t="s",A.v=k.slice(2,-1).replace(/""/g,'"')):YG(k)?(A.t="n",A.f=k.slice(1)):(A.t="s",A.v=k);else if(k=="TRUE")A.t="b",A.v=!0;else if(k=="FALSE")A.t="b",A.v=!1;else if(!isNaN(y=ja(k)))A.t="n",h.cellText!==!1&&(A.w=k),A.v=y;else if(!isNaN(hc(k).getDate())||P&&k.match(P)){A.z=h.dateNF||rt[14];var I=0;P&&k.match(P)&&(k=bH(k,h.dateNF,k.match(P)||[]),I=1),h.cellDates?(A.t="d",A.v=Er(k,I)):(A.t="n",A.v=pn(Er(k,I))),h.cellText!==!1&&(A.w=la(A.z,A.v instanceof Date?pn(A.v):A.v)),h.cellNF||delete A.z}else A.t="s",A.v=k;if(A.t=="z"||(h.dense?(v[g]||(v[g]=[]),v[g][x]=A):v[et({c:x,r:g})]=A),w=b+1,C=f.charCodeAt(w),m.e.c<x&&(m.e.c=x),m.e.r<g&&(m.e.r=g),E==_)++x;else if(x=0,++g,h.sheetRows&&h.sheetRows<=g)return!0}e:for(;b<f.length;++b)switch(E=f.charCodeAt(b)){case 34:C===34&&(T=!T);break;case _:case 10:case 13:if(!T&&N())break e;break}return b-w>0&&N(),v["!ref"]=wt(m),v}function i(f,d){return!(d&&d.PRN)||d.FS||f.slice(0,4)=="sep="||f.indexOf(" ")>=0||f.indexOf(",")>=0||f.indexOf(";")>=0?s(f,d):Cc(t(f,d),d)}function o(f,d){var h="",p=d.type=="string"?[0,0,0,0]:L1(f,d);switch(d.type){case"base64":h=qn(f);break;case"binary":h=f;break;case"buffer":d.codepage==65001?h=f.toString("utf8"):d.codepage&&typeof yf<"u"||(h=gt&&Buffer.isBuffer(f)?f.toString("binary"):qo(f));break;case"array":h=Do(f);break;case"string":h=f;break;default:throw new Error("Unrecognized type "+d.type)}return p[0]==239&&p[1]==187&&p[2]==191?h=Dt(h.slice(3)):d.type!="string"&&d.type!="buffer"&&d.codepage==65001?h=Dt(h):d.type=="binary"&&typeof yf<"u",h.slice(0,19)=="socialcalc:version:"?cV.to_sheet(d.type=="string"?h:Dt(h),d):i(h,d)}function l(f,d){return Wi(o(f,d),d)}function u(f){for(var d=[],h=Zt(f["!ref"]),p,v=Array.isArray(f),m=h.s.r;m<=h.e.r;++m){for(var g=[],x=h.s.c;x<=h.e.c;++x){var y=et({r:m,c:x});if(p=v?(f[m]||[])[x]:f[y],!p||p.v==null){g.push(" ");continue}for(var w=(p.w||(js(p),p.w)||"").slice(0,10);w.length<10;)w+=" ";g.push(w+(x===0?" ":""))}d.push(g.join(""))}return d.join(`
`)}return{to_workbook:l,to_sheet:o,from_sheet:u}}();function uV(e,t){var r=t||{},n=!!r.WTF;r.WTF=!0;try{var a=oV.to_workbook(e,r);return r.WTF=n,a}catch(s){if(r.WTF=n,!s.message.match(/SYLK bad record ID/)&&n)throw s;return Ef.to_workbook(e,t)}}var Fu=function(){function e(O,j,B){if(O){jr(O,O.l||0);for(var L=B.Enum||z;O.l<O.length;){var F=O.read_shift(2),H=L[F]||L[65535],Z=O.read_shift(2),X=O.l+Z,ne=H.f&&H.f(O,Z,B);if(O.l=X,j(ne,H,F))return}}}function t(O,j){switch(j.type){case"base64":return r(ka(qn(O)),j);case"binary":return r(ka(O),j);case"buffer":case"array":return r(O,j)}throw"Unsupported type "+j.type}function r(O,j){if(!O)return O;var B=j||{},L=B.dense?[]:{},F="Sheet1",H="",Z=0,X={},ne=[],he=[],V={s:{r:0,c:0},e:{r:0,c:0}},Te=B.sheetRows||0;if(O[2]==0&&(O[3]==8||O[3]==9)&&O.length>=16&&O[14]==5&&O[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(O[2]==2)B.Enum=z,e(O,function(pe,le,ue){switch(ue){case 0:B.vers=pe,pe>=4096&&(B.qpro=!0);break;case 6:V=pe;break;case 204:pe&&(H=pe);break;case 222:H=pe;break;case 15:case 51:B.qpro||(pe[1].v=pe[1].v.slice(1));case 13:case 14:case 16:ue==14&&(pe[2]&112)==112&&(pe[2]&15)>1&&(pe[2]&15)<15&&(pe[1].z=B.dateNF||rt[14],B.cellDates&&(pe[1].t="d",pe[1].v=_p(pe[1].v))),B.qpro&&pe[3]>Z&&(L["!ref"]=wt(V),X[F]=L,ne.push(F),L=B.dense?[]:{},V={s:{r:0,c:0},e:{r:0,c:0}},Z=pe[3],F=H||"Sheet"+(Z+1),H="");var me=B.dense?(L[pe[0].r]||[])[pe[0].c]:L[et(pe[0])];if(me){me.t=pe[1].t,me.v=pe[1].v,pe[1].z!=null&&(me.z=pe[1].z),pe[1].f!=null&&(me.f=pe[1].f);break}B.dense?(L[pe[0].r]||(L[pe[0].r]=[]),L[pe[0].r][pe[0].c]=pe[1]):L[et(pe[0])]=pe[1];break}},B);else if(O[2]==26||O[2]==14)B.Enum=D,O[2]==14&&(B.qpro=!0,O.l=0),e(O,function(pe,le,ue){switch(ue){case 204:F=pe;break;case 22:pe[1].v=pe[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(pe[3]>Z&&(L["!ref"]=wt(V),X[F]=L,ne.push(F),L=B.dense?[]:{},V={s:{r:0,c:0},e:{r:0,c:0}},Z=pe[3],F="Sheet"+(Z+1)),Te>0&&pe[0].r>=Te)break;B.dense?(L[pe[0].r]||(L[pe[0].r]=[]),L[pe[0].r][pe[0].c]=pe[1]):L[et(pe[0])]=pe[1],V.e.c<pe[0].c&&(V.e.c=pe[0].c),V.e.r<pe[0].r&&(V.e.r=pe[0].r);break;case 27:pe[14e3]&&(he[pe[14e3][0]]=pe[14e3][1]);break;case 1537:he[pe[0]]=pe[1],pe[0]==Z&&(F=pe[1]);break}},B);else throw new Error("Unrecognized LOTUS BOF "+O[2]);if(L["!ref"]=wt(V),X[H||F]=L,ne.push(H||F),!he.length)return{SheetNames:ne,Sheets:X};for(var Ee={},xe=[],Se=0;Se<he.length;++Se)X[ne[Se]]?(xe.push(he[Se]||ne[Se]),Ee[he[Se]]=X[he[Se]]||X[ne[Se]]):(xe.push(he[Se]),Ee[he[Se]]={"!ref":"A1"});return{SheetNames:xe,Sheets:Ee}}function n(O,j){var B=j||{};if(+B.codepage>=0&&Na(+B.codepage),B.type=="string")throw new Error("Cannot write WK1 to JS string");var L=Xv(),F=Zt(O["!ref"]),H=Array.isArray(O),Z=[];pa(L,0,s(1030)),pa(L,6,l(F));for(var X=Math.min(F.e.r,8191),ne=F.s.r;ne<=X;++ne)for(var he=Lr(ne),V=F.s.c;V<=F.e.c;++V){ne===F.s.r&&(Z[V]=mr(V));var Te=Z[V]+he,Ee=H?(O[ne]||[])[V]:O[Te];if(!(!Ee||Ee.t=="z"))if(Ee.t=="n")(Ee.v|0)==Ee.v&&Ee.v>=-32768&&Ee.v<=32767?pa(L,13,p(ne,V,Ee.v)):pa(L,14,m(ne,V,Ee.v));else{var xe=js(Ee);pa(L,15,d(ne,V,xe.slice(0,239)))}}return pa(L,1),L.end()}function a(O,j){var B=j||{};if(+B.codepage>=0&&Na(+B.codepage),B.type=="string")throw new Error("Cannot write WK3 to JS string");var L=Xv();pa(L,0,i(O));for(var F=0,H=0;F<O.SheetNames.length;++F)(O.Sheets[O.SheetNames[F]]||{})["!ref"]&&pa(L,27,R(O.SheetNames[F],H++));var Z=0;for(F=0;F<O.SheetNames.length;++F){var X=O.Sheets[O.SheetNames[F]];if(!(!X||!X["!ref"])){for(var ne=Zt(X["!ref"]),he=Array.isArray(X),V=[],Te=Math.min(ne.e.r,8191),Ee=ne.s.r;Ee<=Te;++Ee)for(var xe=Lr(Ee),Se=ne.s.c;Se<=ne.e.c;++Se){Ee===ne.s.r&&(V[Se]=mr(Se));var pe=V[Se]+xe,le=he?(X[Ee]||[])[Se]:X[pe];if(!(!le||le.t=="z"))if(le.t=="n")pa(L,23,N(Ee,Se,Z,le.v));else{var ue=js(le);pa(L,22,E(Ee,Se,Z,ue.slice(0,239)))}}++Z}}return pa(L,1),L.end()}function s(O){var j=dr(2);return j.write_shift(2,O),j}function i(O){var j=dr(26);j.write_shift(2,4096),j.write_shift(2,4),j.write_shift(4,0);for(var B=0,L=0,F=0,H=0;H<O.SheetNames.length;++H){var Z=O.SheetNames[H],X=O.Sheets[Z];if(!(!X||!X["!ref"])){++F;var ne=Ac(X["!ref"]);B<ne.e.r&&(B=ne.e.r),L<ne.e.c&&(L=ne.e.c)}}return B>8191&&(B=8191),j.write_shift(2,B),j.write_shift(1,F),j.write_shift(1,L),j.write_shift(2,0),j.write_shift(2,0),j.write_shift(1,1),j.write_shift(1,2),j.write_shift(4,0),j.write_shift(4,0),j}function o(O,j,B){var L={s:{c:0,r:0},e:{c:0,r:0}};return j==8&&B.qpro?(L.s.c=O.read_shift(1),O.l++,L.s.r=O.read_shift(2),L.e.c=O.read_shift(1),O.l++,L.e.r=O.read_shift(2),L):(L.s.c=O.read_shift(2),L.s.r=O.read_shift(2),j==12&&B.qpro&&(O.l+=2),L.e.c=O.read_shift(2),L.e.r=O.read_shift(2),j==12&&B.qpro&&(O.l+=2),L.s.c==65535&&(L.s.c=L.e.c=L.s.r=L.e.r=0),L)}function l(O){var j=dr(8);return j.write_shift(2,O.s.c),j.write_shift(2,O.s.r),j.write_shift(2,O.e.c),j.write_shift(2,O.e.r),j}function u(O,j,B){var L=[{c:0,r:0},{t:"n",v:0},0,0];return B.qpro&&B.vers!=20768?(L[0].c=O.read_shift(1),L[3]=O.read_shift(1),L[0].r=O.read_shift(2),O.l+=2):(L[2]=O.read_shift(1),L[0].c=O.read_shift(2),L[0].r=O.read_shift(2)),L}function f(O,j,B){var L=O.l+j,F=u(O,j,B);if(F[1].t="s",B.vers==20768){O.l++;var H=O.read_shift(1);return F[1].v=O.read_shift(H,"utf8"),F}return B.qpro&&O.l++,F[1].v=O.read_shift(L-O.l,"cstr"),F}function d(O,j,B){var L=dr(7+B.length);L.write_shift(1,255),L.write_shift(2,j),L.write_shift(2,O),L.write_shift(1,39);for(var F=0;F<L.length;++F){var H=B.charCodeAt(F);L.write_shift(1,H>=128?95:H)}return L.write_shift(1,0),L}function h(O,j,B){var L=u(O,j,B);return L[1].v=O.read_shift(2,"i"),L}function p(O,j,B){var L=dr(7);return L.write_shift(1,255),L.write_shift(2,j),L.write_shift(2,O),L.write_shift(2,B,"i"),L}function v(O,j,B){var L=u(O,j,B);return L[1].v=O.read_shift(8,"f"),L}function m(O,j,B){var L=dr(13);return L.write_shift(1,255),L.write_shift(2,j),L.write_shift(2,O),L.write_shift(8,B,"f"),L}function g(O,j,B){var L=O.l+j,F=u(O,j,B);if(F[1].v=O.read_shift(8,"f"),B.qpro)O.l=L;else{var H=O.read_shift(2);b(O.slice(O.l,O.l+H),F),O.l+=H}return F}function x(O,j,B){var L=j&32768;return j&=-32769,j=(L?O:0)+(j>=8192?j-16384:j),(L?"":"$")+(B?mr(j):Lr(j))}var y={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]},w=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function b(O,j){jr(O,0);for(var B=[],L=0,F="",H="",Z="",X="";O.l<O.length;){var ne=O[O.l++];switch(ne){case 0:B.push(O.read_shift(8,"f"));break;case 1:H=x(j[0].c,O.read_shift(2),!0),F=x(j[0].r,O.read_shift(2),!1),B.push(H+F);break;case 2:{var he=x(j[0].c,O.read_shift(2),!0),V=x(j[0].r,O.read_shift(2),!1);H=x(j[0].c,O.read_shift(2),!0),F=x(j[0].r,O.read_shift(2),!1),B.push(he+V+":"+H+F)}break;case 3:if(O.l<O.length){console.error("WK1 premature formula end");return}break;case 4:B.push("("+B.pop()+")");break;case 5:B.push(O.read_shift(2));break;case 6:{for(var Te="";ne=O[O.l++];)Te+=String.fromCharCode(ne);B.push('"'+Te.replace(/"/g,'""')+'"')}break;case 8:B.push("-"+B.pop());break;case 23:B.push("+"+B.pop());break;case 22:B.push("NOT("+B.pop()+")");break;case 20:case 21:X=B.pop(),Z=B.pop(),B.push(["AND","OR"][ne-20]+"("+Z+","+X+")");break;default:if(ne<32&&w[ne])X=B.pop(),Z=B.pop(),B.push(Z+w[ne]+X);else if(y[ne]){if(L=y[ne][1],L==69&&(L=O[O.l++]),L>B.length){console.error("WK1 bad formula parse 0x"+ne.toString(16)+":|"+B.join("|")+"|");return}var Ee=B.slice(-L);B.length-=L,B.push(y[ne][0]+"("+Ee.join(",")+")")}else return ne<=7?console.error("WK1 invalid opcode "+ne.toString(16)):ne<=24?console.error("WK1 unsupported op "+ne.toString(16)):ne<=30?console.error("WK1 invalid opcode "+ne.toString(16)):ne<=115?console.error("WK1 unsupported function opcode "+ne.toString(16)):console.error("WK1 unrecognized opcode "+ne.toString(16))}}B.length==1?j[1].f=""+B[0]:console.error("WK1 bad formula parse |"+B.join("|")+"|")}function _(O){var j=[{c:0,r:0},{t:"n",v:0},0];return j[0].r=O.read_shift(2),j[3]=O[O.l++],j[0].c=O[O.l++],j}function T(O,j){var B=_(O);return B[1].t="s",B[1].v=O.read_shift(j-4,"cstr"),B}function E(O,j,B,L){var F=dr(6+L.length);F.write_shift(2,O),F.write_shift(1,B),F.write_shift(1,j),F.write_shift(1,39);for(var H=0;H<L.length;++H){var Z=L.charCodeAt(H);F.write_shift(1,Z>=128?95:Z)}return F.write_shift(1,0),F}function C(O,j){var B=_(O);B[1].v=O.read_shift(2);var L=B[1].v>>1;if(B[1].v&1)switch(L&7){case 0:L=(L>>3)*5e3;break;case 1:L=(L>>3)*500;break;case 2:L=(L>>3)/20;break;case 3:L=(L>>3)/200;break;case 4:L=(L>>3)/2e3;break;case 5:L=(L>>3)/2e4;break;case 6:L=(L>>3)/16;break;case 7:L=(L>>3)/64;break}return B[1].v=L,B}function P(O,j){var B=_(O),L=O.read_shift(4),F=O.read_shift(4),H=O.read_shift(2);if(H==65535)return L===0&&F===3221225472?(B[1].t="e",B[1].v=15):L===0&&F===3489660928?(B[1].t="e",B[1].v=42):B[1].v=0,B;var Z=H&32768;return H=(H&32767)-16446,B[1].v=(1-Z*2)*(F*Math.pow(2,H+32)+L*Math.pow(2,H)),B}function N(O,j,B,L){var F=dr(14);if(F.write_shift(2,O),F.write_shift(1,B),F.write_shift(1,j),L==0)return F.write_shift(4,0),F.write_shift(4,0),F.write_shift(2,65535),F;var H=0,Z=0,X=0,ne=0;return L<0&&(H=1,L=-L),Z=Math.log2(L)|0,L/=Math.pow(2,Z-31),ne=L>>>0,ne&2147483648||(L/=2,++Z,ne=L>>>0),L-=ne,ne|=2147483648,ne>>>=0,L*=Math.pow(2,32),X=L>>>0,F.write_shift(4,X),F.write_shift(4,ne),Z+=16383+(H?32768:0),F.write_shift(2,Z),F}function k(O,j){var B=P(O);return O.l+=j-14,B}function A(O,j){var B=_(O),L=O.read_shift(4);return B[1].v=L>>6,B}function I(O,j){var B=_(O),L=O.read_shift(8,"f");return B[1].v=L,B}function M(O,j){var B=I(O);return O.l+=j-10,B}function U(O,j){return O[O.l+j-1]==0?O.read_shift(j,"cstr"):""}function W(O,j){var B=O[O.l++];B>j-1&&(B=j-1);for(var L="";L.length<B;)L+=String.fromCharCode(O[O.l++]);return L}function G(O,j,B){if(!(!B.qpro||j<21)){var L=O.read_shift(1);O.l+=17,O.l+=1,O.l+=2;var F=O.read_shift(j-21,"cstr");return[L,F]}}function Q(O,j){for(var B={},L=O.l+j;O.l<L;){var F=O.read_shift(2);if(F==14e3){for(B[F]=[0,""],B[F][0]=O.read_shift(2);O[O.l];)B[F][1]+=String.fromCharCode(O[O.l]),O.l++;O.l++}}return B}function R(O,j){var B=dr(5+O.length);B.write_shift(2,14e3),B.write_shift(2,j);for(var L=0;L<O.length;++L){var F=O.charCodeAt(L);B[B.l++]=F>127?95:F}return B[B.l++]=0,B}var z={0:{n:"BOF",f:ir},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:o},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:h},14:{n:"NUMBER",f:v},15:{n:"LABEL",f},16:{n:"FORMULA",f:g},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},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:U},222:{n:"SHEETNAMELP",f:W},65535:{n:""}},D={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:T},23:{n:"NUMBER17",f:P},24:{n:"NUMBER18",f:C},25:{n:"FORMULA19",f:k},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:Q},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:A},38:{n:"??"},39:{n:"NUMBER27",f:I},40:{n:"FORMULA28",f:M},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:U},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:G},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:n,book_to_wk3:a,to_workbook:t}}();function fV(e){var t={},r=e.match(Qr),n=0,a=!1;if(r)for(;n!=r.length;++n){var s=Xe(r[n]);switch(s[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!s.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":if(s.val=="1")break;t.cp=p1[parseInt(s.val,10)];break;case"<outline":if(!s.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=s.val;break;case"<sz":t.sz=s.val;break;case"<strike":if(!s.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!s.val)break;switch(s.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting";break}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if(s.val=="0")break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if(s.val=="0")break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":s.rgb&&(t.color=s.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":t.family=s.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":t.valign=s.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(s[0].charCodeAt(1)!==47&&!a)throw new Error("Unrecognized rich format "+s[0])}}return t}var dV=function(){var e=bf("t"),t=bf("rPr");function r(s){var i=s.match(e);if(!i)return{t:"s",v:""};var o={t:"s",v:St(i[1])},l=s.match(t);return l&&(o.s=fV(l[1])),o}var n=/<(?:\w+:)?r>/g,a=/<\/(?:\w+:)?r>/;return function(i){return i.replace(n,"").split(a).map(r).filter(function(o){return o.v})}}(),hV=function(){var t=/(\r\n|\n)/g;function r(a,s,i){var o=[];a.u&&o.push("text-decoration: underline;"),a.uval&&o.push("text-underline-style:"+a.uval+";"),a.sz&&o.push("font-size:"+a.sz+"pt;"),a.outline&&o.push("text-effect: outline;"),a.shadow&&o.push("text-shadow: auto;"),s.push('<span style="'+o.join("")+'">'),a.b&&(s.push("<b>"),i.push("</b>")),a.i&&(s.push("<i>"),i.push("</i>")),a.strike&&(s.push("<s>"),i.push("</s>"));var l=a.valign||"";return l=="superscript"||l=="super"?l="sup":l=="subscript"&&(l="sub"),l!=""&&(s.push("<"+l+">"),i.push("</"+l+">")),i.push("</span>"),a}function n(a){var s=[[],a.v,[]];return a.v?(a.s&&r(a.s,s[0],s[2]),s[0].join("")+s[1].replace(t,"<br/>")+s[2].join("")):""}return function(s){return s.map(n).join("")}}(),pV=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,mV=/<(?:\w+:)?r>/,gV=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function O1(e,t){var r=t?t.cellHTML:!0,n={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=St(Dt(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=Dt(e),r&&(n.h=b1(n.t))):e.match(mV)&&(n.r=Dt(e),n.t=St(Dt((e.replace(gV,"").match(pV)||[]).join("").replace(Qr,""))),r&&(n.h=hV(dV(n.r)))),n):{t:""}}var vV=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,xV=/<(?:\w+:)?(?:si|sstItem)>/g,yV=/<\/(?:\w+:)?(?:si|sstItem)>/;function wV(e,t){var r=[],n="";if(!e)return r;var a=e.match(vV);if(a){n=a[2].replace(xV,"").split(yV);for(var s=0;s!=n.length;++s){var i=O1(n[s].trim(),t);i!=null&&(r[r.length]=i)}a=Xe(a[1]),r.Count=a.count,r.Unique=a.uniqueCount}return r}function bV(e){return[e.read_shift(4),e.read_shift(4)]}function _V(e,t){var r=[],n=!1;return Ls(e,function(s,i,o){switch(o){case 159:r.Count=s[0],r.Unique=s[1];break;case 19:r.push(s);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(i.T,!n||t.WTF)throw new Error("Unexpected record 0x"+o.toString(16))}}),r}function mO(e){for(var t=[],r=e.split(""),n=0;n<r.length;++n)t[n]=r[n].charCodeAt(0);return t}function Ts(e,t){var r={};return r.Major=e.read_shift(2),r.Minor=e.read_shift(2),t>=4&&(e.l+=t-4),r}function EV(e){var t={};return t.id=e.read_shift(0,"lpp4"),t.R=Ts(e,4),t.U=Ts(e,4),t.W=Ts(e,4),t}function SV(e){for(var t=e.read_shift(4),r=e.l+t-4,n={},a=e.read_shift(4),s=[];a-- >0;)s.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(n.name=e.read_shift(0,"lpp4"),n.comps=s,e.l!=r)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+r);return n}function TV(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(SV(e));return t}function kV(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(e.read_shift(0,"lpp4"));return t}function NV(e){var t={};return e.read_shift(4),e.l+=4,t.id=e.read_shift(0,"lpp4"),t.name=e.read_shift(0,"lpp4"),t.R=Ts(e,4),t.U=Ts(e,4),t.W=Ts(e,4),t}function AV(e){var t=NV(e);if(t.ename=e.read_shift(0,"8lpp4"),t.blksz=e.read_shift(4),t.cmode=e.read_shift(4),e.read_shift(4)!=4)throw new Error("Bad !Primary record");return t}function gO(e,t){var r=e.l+t,n={};n.Flags=e.read_shift(4)&63,e.l+=4,n.AlgID=e.read_shift(4);var a=!1;switch(n.AlgID){case 26126:case 26127:case 26128:a=n.Flags==36;break;case 26625:a=n.Flags==4;break;case 0:a=n.Flags==16||n.Flags==4||n.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!a)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=e.read_shift(4),n.KeySize=e.read_shift(4),n.ProviderType=e.read_shift(4),e.l+=8,n.CSPName=e.read_shift(r-e.l>>1,"utf16le"),e.l=r,n}function vO(e,t){var r={},n=e.l+t;return e.l+=4,r.Salt=e.slice(e.l,e.l+16),e.l+=16,r.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),r.VerifierHash=e.slice(e.l,n),e.l=n,r}function CV(e){var t=Ts(e);switch(t.Minor){case 2:return[t.Minor,PV(e)];case 3:return[t.Minor,OV()];case 4:return[t.Minor,jV(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}function PV(e){var t=e.read_shift(4);if((t&63)!=36)throw new Error("EncryptionInfo mismatch");var r=e.read_shift(4),n=gO(e,r),a=vO(e,e.length-e.l);return{t:"Std",h:n,v:a}}function OV(){throw new Error("File is password-protected: ECMA-376 Extensible")}function jV(e){var t=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var r=e.read_shift(e.length-e.l,"utf8"),n={};return r.replace(Qr,function(s){var i=Xe(s);switch(ss(i[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":t.forEach(function(o){n[o]=i[o]});break;case"<dataIntegrity":n.encryptedHmacKey=i.encryptedHmacKey,n.encryptedHmacValue=i.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":n.uri=i.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":n.encs.push(i);break;default:throw i[0]}}),n}function RV(e,t){var r={},n=r.EncryptionVersionInfo=Ts(e,4);if(t-=4,n.Minor!=2)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);r.Flags=e.read_shift(4),t-=4;var a=e.read_shift(4);return t-=4,r.EncryptionHeader=gO(e,a),t-=a,r.EncryptionVerifier=vO(e,t),r}function IV(e){var t={},r=t.EncryptionVersionInfo=Ts(e,4);if(r.Major!=1||r.Minor!=1)throw"unrecognized version code "+r.Major+" : "+r.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}function FV(e){var t=0,r,n=mO(e),a=n.length+1,s,i,o,l,u;for(r=Di(a),r[0]=n.length,s=1;s!=a;++s)r[s]=n[s-1];for(s=a-1;s>=0;--s)i=r[s],o=t&16384?1:0,l=t<<1&32767,u=o|l,t=u^i;return t^52811}var xO=function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],t=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],n=function(i){return(i/2|i*128)&255},a=function(i,o){return n(i^o)},s=function(i){for(var o=t[i.length-1],l=104,u=i.length-1;u>=0;--u)for(var f=i[u],d=0;d!=7;++d)f&64&&(o^=r[l]),f*=2,--l;return o};return function(i){for(var o=mO(i),l=s(o),u=o.length,f=Di(16),d=0;d!=16;++d)f[d]=0;var h,p,v;for((u&1)===1&&(h=l>>8,f[u]=a(e[0],h),--u,h=l&255,p=o[o.length-1],f[u]=a(p,h));u>0;)--u,h=l>>8,f[u]=a(o[u],h),--u,h=l&255,f[u]=a(o[u],h);for(u=15,v=15-o.length;v>0;)h=l>>8,f[u]=a(e[v],h),--u,--v,h=l&255,f[u]=a(o[u],h),--u,--v;return f}}(),DV=function(e,t,r,n,a){a||(a=t),n||(n=xO(e));var s,i;for(s=0;s!=t.length;++s)i=t[s],i^=n[r],i=(i>>5|i<<3)&255,a[s]=i,++r;return[a,r,n]},MV=function(e){var t=0,r=xO(e);return function(n){var a=DV("",n,t,r);return t=a[1],a[0]}};function LV(e,t,r,n){var a={key:ir(e),verificationBytes:ir(e)};return r.password&&(a.verifier=FV(r.password)),n.valid=a.verificationBytes===a.verifier,n.valid&&(n.insitu=MV(r.password)),a}function BV(e,t,r){var n=r||{};return n.Info=e.read_shift(2),e.l-=2,n.Info===1?n.Data=IV(e):n.Data=RV(e,t),n}function UV(e,t,r){var n={Type:r.biff>=8?e.read_shift(2):0};return n.Type?BV(e,t-2,n):LV(e,r.biff>=8?t:t-2,r,n),n}var $V=function(){function e(a,s){switch(s.type){case"base64":return t(qn(a),s);case"binary":return t(a,s);case"buffer":return t(gt&&Buffer.isBuffer(a)?a.toString("binary"):qo(a),s);case"array":return t(Do(a),s)}throw new Error("Unrecognized type "+s.type)}function t(a,s){var i=s||{},o=i.dense?[]:{},l=a.match(/\\trowd.*?\\row\b/g);if(!l.length)throw new Error("RTF missing table");var u={s:{c:0,r:0},e:{c:0,r:l.length-1}};return l.forEach(function(f,d){Array.isArray(o)&&(o[d]=[]);for(var h=/\\\w+\b/g,p=0,v,m=-1;v=h.exec(f);){switch(v[0]){case"\\cell":var g=f.slice(p,h.lastIndex-v[0].length);if(g[0]==" "&&(g=g.slice(1)),++m,g.length){var x={v:g,t:"s"};Array.isArray(o)?o[d][m]=x:o[et({r:d,c:m})]=x}break}p=h.lastIndex}m>u.e.c&&(u.e.c=m)}),o["!ref"]=wt(u),o}function r(a,s){return Wi(e(a,s),s)}function n(a){for(var s=["{\\rtf1\\ansi"],i=Zt(a["!ref"]),o,l=Array.isArray(a),u=i.s.r;u<=i.e.r;++u){s.push("\\trowd\\trautofit1");for(var f=i.s.c;f<=i.e.c;++f)s.push("\\cellx"+(f+1));for(s.push("\\pard\\intbl"),f=i.s.c;f<=i.e.c;++f){var d=et({r:u,c:f});o=l?(a[u]||[])[f]:a[d],!(!o||o.v==null&&(!o.f||o.F))&&(s.push(" "+(o.w||(js(o),o.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}return{to_workbook:r,to_sheet:e,from_sheet:n}}();function zV(e){var t=e.slice(e[0]==="#"?1:0).slice(0,6);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function Sf(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)}function HV(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(t,r,n),s=Math.min(t,r,n),i=a-s;if(i===0)return[0,0,t];var o=0,l=0,u=a+s;switch(l=i/(u>1?2-u:u),a){case t:o=((r-n)/i+6)%6;break;case r:o=(n-t)/i+2;break;case n:o=(t-r)/i+4;break}return[o/6,l,u/2]}function qV(e){var t=e[0],r=e[1],n=e[2],a=r*2*(n<.5?n:1-n),s=n-a/2,i=[s,s,s],o=6*t,l;if(r!==0)switch(o|0){case 0:case 6:l=a*o,i[0]+=a,i[1]+=l;break;case 1:l=a*(2-o),i[0]+=l,i[1]+=a;break;case 2:l=a*(o-2),i[1]+=a,i[2]+=l;break;case 3:l=a*(4-o),i[1]+=l,i[2]+=a;break;case 4:l=a*(o-4),i[2]+=a,i[0]+=l;break;case 5:l=a*(6-o),i[2]+=l,i[0]+=a;break}for(var u=0;u!=3;++u)i[u]=Math.round(i[u]*255);return i}function y0(e,t){if(t===0)return e;var r=HV(zV(e));return t<0?r[2]=r[2]*(1+t):r[2]=1-(1-r[2])*(1-t),Sf(qV(r))}var yO=6,WV=15,VV=1,on=yO;function w0(e){return Math.floor((e+Math.round(128/on)/256)*on)}function b0(e){return Math.floor((e-5)/on*100+.5)/100}function ex(e){return Math.round((e*on+5)/on*256)/256}function Hm(e){return ex(b0(w0(e)))}function j1(e){var t=Math.abs(e-Hm(e)),r=on;if(t>.005)for(on=VV;on<WV;++on)Math.abs(e-Hm(e))<=t&&(t=Math.abs(e-Hm(e)),r=on);on=r}function pc(e){e.width?(e.wpx=w0(e.width),e.wch=b0(e.wpx),e.MDW=on):e.wpx?(e.wch=b0(e.wpx),e.width=ex(e.wch),e.MDW=on):typeof e.wch=="number"&&(e.width=ex(e.wch),e.wpx=w0(e.width),e.MDW=on),e.customWidth&&delete e.customWidth}var GV=96,wO=GV;function bO(e){return e*96/wO}function Tf(e){return e*wO/96}var KV={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function YV(e,t,r,n){t.Borders=[];var a={},s=!1;(e[0].match(Qr)||[]).forEach(function(i){var o=Xe(i);switch(ss(o[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":a={},o.diagonalUp&&(a.diagonalUp=$t(o.diagonalUp)),o.diagonalDown&&(a.diagonalDown=$t(o.diagonalDown)),t.Borders.push(a);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+o[0]+" in borders")}})}function XV(e,t,r,n){t.Fills=[];var a={},s=!1;(e[0].match(Qr)||[]).forEach(function(i){var o=Xe(i);switch(ss(o[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":a={},t.Fills.push(a);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":t.Fills.push(a),a={};break;case"<patternFill":case"<patternFill>":o.patternType&&(a.patternType=o.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":a.bgColor||(a.bgColor={}),o.indexed&&(a.bgColor.indexed=parseInt(o.indexed,10)),o.theme&&(a.bgColor.theme=parseInt(o.theme,10)),o.tint&&(a.bgColor.tint=parseFloat(o.tint)),o.rgb&&(a.bgColor.rgb=o.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":a.fgColor||(a.fgColor={}),o.theme&&(a.fgColor.theme=parseInt(o.theme,10)),o.tint&&(a.fgColor.tint=parseFloat(o.tint)),o.rgb!=null&&(a.fgColor.rgb=o.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+o[0]+" in fills")}})}function JV(e,t,r,n){t.Fonts=[];var a={},s=!1;(e[0].match(Qr)||[]).forEach(function(i){var o=Xe(i);switch(ss(o[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":t.Fonts.push(a),a={};break;case"<name":o.val&&(a.name=Dt(o.val));break;case"<name/>":case"</name>":break;case"<b":a.bold=o.val?$t(o.val):1;break;case"<b/>":a.bold=1;break;case"<i":a.italic=o.val?$t(o.val):1;break;case"<i/>":a.italic=1;break;case"<u":switch(o.val){case"none":a.underline=0;break;case"single":a.underline=1;break;case"double":a.underline=2;break;case"singleAccounting":a.underline=33;break;case"doubleAccounting":a.underline=34;break}break;case"<u/>":a.underline=1;break;case"<strike":a.strike=o.val?$t(o.val):1;break;case"<strike/>":a.strike=1;break;case"<outline":a.outline=o.val?$t(o.val):1;break;case"<outline/>":a.outline=1;break;case"<shadow":a.shadow=o.val?$t(o.val):1;break;case"<shadow/>":a.shadow=1;break;case"<condense":a.condense=o.val?$t(o.val):1;break;case"<condense/>":a.condense=1;break;case"<extend":a.extend=o.val?$t(o.val):1;break;case"<extend/>":a.extend=1;break;case"<sz":o.val&&(a.sz=+o.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":o.val&&(a.vertAlign=o.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":o.val&&(a.family=parseInt(o.val,10));break;case"<family/>":case"</family>":break;case"<scheme":o.val&&(a.scheme=o.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(o.val=="1")break;o.codepage=p1[parseInt(o.val,10)];break;case"<color":if(a.color||(a.color={}),o.auto&&(a.color.auto=$t(o.auto)),o.rgb)a.color.rgb=o.rgb.slice(-6);else if(o.indexed){a.color.index=parseInt(o.indexed,10);var l=So[a.color.index];a.color.index==81&&(l=So[1]),l||(l=So[1]),a.color.rgb=l[0].toString(16)+l[1].toString(16)+l[2].toString(16)}else o.theme&&(a.color.theme=parseInt(o.theme,10),o.tint&&(a.color.tint=parseFloat(o.tint)),o.theme&&r.themeElements&&r.themeElements.clrScheme&&(a.color.rgb=y0(r.themeElements.clrScheme[a.color.theme].rgb,a.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":s=!0;break;case"</AlternateContent>":s=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+o[0]+" in fonts")}})}function QV(e,t,r){t.NumberFmt=[];for(var n=ns(rt),a=0;a<n.length;++a)t.NumberFmt[n[a]]=rt[n[a]];var s=e[0].match(Qr);if(s)for(a=0;a<s.length;++a){var i=Xe(s[a]);switch(ss(i[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var o=St(Dt(i.formatCode)),l=parseInt(i.numFmtId,10);if(t.NumberFmt[l]=o,l>0){if(l>392){for(l=392;l>60&&t.NumberFmt[l]!=null;--l);t.NumberFmt[l]=o}Eo(o,l)}}break;case"</numFmt>":break;default:if(r.WTF)throw new Error("unrecognized "+i[0]+" in numFmts")}}}var zd=["numFmtId","fillId","fontId","borderId","xfId"],Hd=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function ZV(e,t,r){t.CellXf=[];var n,a=!1;(e[0].match(Qr)||[]).forEach(function(s){var i=Xe(s),o=0;switch(ss(i[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(n=i,delete n[0],o=0;o<zd.length;++o)n[zd[o]]&&(n[zd[o]]=parseInt(n[zd[o]],10));for(o=0;o<Hd.length;++o)n[Hd[o]]&&(n[Hd[o]]=$t(n[Hd[o]]));if(t.NumberFmt&&n.numFmtId>392){for(o=392;o>60;--o)if(t.NumberFmt[n.numFmtId]==t.NumberFmt[o]){n.numFmtId=o;break}}t.CellXf.push(n);break;case"</xf>":break;case"<alignment":case"<alignment/>":var l={};i.vertical&&(l.vertical=i.vertical),i.horizontal&&(l.horizontal=i.horizontal),i.textRotation!=null&&(l.textRotation=i.textRotation),i.indent&&(l.indent=i.indent),i.wrapText&&(l.wrapText=$t(i.wrapText)),n.alignment=l;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":a=!0;break;case"</AlternateContent>":a=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(r&&r.WTF&&!a)throw new Error("unrecognized "+i[0]+" in cellXfs")}})}var eG=function(){var t=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,r=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,n=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,a=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,s=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(o,l,u){var f={};if(!o)return f;o=o.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var d;return(d=o.match(t))&&QV(d,f,u),(d=o.match(a))&&JV(d,f,l,u),(d=o.match(n))&&XV(d,f,l,u),(d=o.match(s))&&YV(d,f,l,u),(d=o.match(r))&&ZV(d,f,u),f}}();function tG(e,t){var r=e.read_shift(2),n=Yr(e);return[r,n]}function rG(e,t,r){var n={};n.sz=e.read_shift(2)/20;var a=dq(e);a.fItalic&&(n.italic=1),a.fCondense&&(n.condense=1),a.fExtend&&(n.extend=1),a.fShadow&&(n.shadow=1),a.fOutline&&(n.outline=1),a.fStrikeout&&(n.strike=1);var s=e.read_shift(2);switch(s===700&&(n.bold=1),e.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript";break}var i=e.read_shift(1);i!=0&&(n.underline=i);var o=e.read_shift(1);o>0&&(n.family=o);var l=e.read_shift(1);switch(l>0&&(n.charset=l),e.l++,n.color=fq(e),e.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor";break}return n.name=Yr(e),n}var nG=Jr;function aG(e,t){var r=e.l+t,n=e.read_shift(2),a=e.read_shift(2);return e.l=r,{ixfe:n,numFmtId:a}}var sG=Jr;function iG(e,t,r){var n={};n.NumberFmt=[];for(var a in rt)n.NumberFmt[a]=rt[a];n.CellXf=[],n.Fonts=[];var s=[],i=!1;return Ls(e,function(l,u,f){switch(f){case 44:n.NumberFmt[l[0]]=l[1],Eo(l[1],l[0]);break;case 43:n.Fonts.push(l),l.color.theme!=null&&t&&t.themeElements&&t.themeElements.clrScheme&&(l.color.rgb=y0(t.themeElements.clrScheme[l.color.theme].rgb,l.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:s[s.length-1]==617&&n.CellXf.push(l);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:i=!0;break;case 36:i=!1;break;case 37:s.push(f),i=!0;break;case 38:s.pop(),i=!1;break;default:if(u.T>0)s.push(f);else if(u.T<0)s.pop();else if(!i||r.WTF&&s[s.length-1]!=37)throw new Error("Unexpected record 0x"+f.toString(16))}}),n}var oG=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function lG(e,t,r){t.themeElements.clrScheme=[];var n={};(e[0].match(Qr)||[]).forEach(function(a){var s=Xe(a);switch(s[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=s.val;break;case"<a:sysClr":n.rgb=s.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":s[0].charAt(1)==="/"?(t.themeElements.clrScheme[oG.indexOf(s[0])]=n,n={}):n.name=s[0].slice(3,s[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+s[0]+" in clrScheme")}})}function cG(){}function uG(){}var fG=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,dG=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,hG=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function pG(e,t,r){t.themeElements={};var n;[["clrScheme",fG,lG],["fontScheme",dG,cG],["fmtScheme",hG,uG]].forEach(function(a){if(!(n=e.match(a[1])))throw new Error(a[0]+" not found in themeElements");a[2](n,t,r)})}var mG=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function _O(e,t){(!e||e.length===0)&&(e=gG());var r,n={};if(!(r=e.match(mG)))throw new Error("themeElements not found in theme");return pG(r[0],n,t),n.raw=e,n}function gG(e,t){var r=[RP];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="MS 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="MS 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 vG(e,t,r){var n=e.l+t,a=e.read_shift(4);if(a!==124226){if(!r.cellStyles){e.l=n;return}var s=e.slice(e.l);e.l=n;var i;try{i=jP(s,{type:"array"})}catch{return}var o=Ln(i,"theme/theme/theme1.xml",!0);if(o)return _O(o,r)}}function xG(e){return e.read_shift(4)}function yG(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:e.l+=4;break;case 1:t.xclrValue=wG(e,4);break;case 2:t.xclrValue=lO(e);break;case 3:t.xclrValue=xG(e);break;case 4:e.l+=4;break}return e.l+=8,t}function wG(e,t){return Jr(e,t)}function bG(e,t){return Jr(e,t)}function _G(e){var t=e.read_shift(2),r=e.read_shift(2)-4,n=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=yG(e);break;case 6:n[1]=bG(e,r);break;case 14:case 15:n[1]=e.read_shift(r===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return n}function EG(e,t){var r=e.l+t;e.l+=2;var n=e.read_shift(2);e.l+=2;for(var a=e.read_shift(2),s=[];a-- >0;)s.push(_G(e,r-e.l));return{ixfe:n,ext:s}}function SG(e,t){t.forEach(function(r){switch(r[0]){}})}function TG(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:Yr(e)}}function kG(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function NG(e){return e.l+=4,e.read_shift(4)!=0}function AG(e,t,r){var n={Types:[],Cell:[],Value:[]},a=r||{},s=[],i=!1,o=2;return Ls(e,function(l,u,f){switch(f){case 335:n.Types.push({name:l.name});break;case 51:l.forEach(function(d){o==1?n.Cell.push({type:n.Types[d[0]-1].name,index:d[1]}):o==0&&n.Value.push({type:n.Types[d[0]-1].name,index:d[1]})});break;case 337:o=l?1:0;break;case 338:o=2;break;case 35:s.push(f),i=!0;break;case 36:s.pop(),i=!1;break;default:if(!u.T){if(!i||a.WTF&&s[s.length-1]!=35)throw new Error("Unexpected record 0x"+f.toString(16))}}}),n}function CG(e,t,r){var n={Types:[],Cell:[],Value:[]};if(!e)return n;var a=!1,s=2,i;return e.replace(Qr,function(o){var l=Xe(o);switch(ss(l[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":n.Types.push({name:l.name});break;case"</metadataType>":break;case"<futureMetadata":for(var u=0;u<n.Types.length;++u)n.Types[u].name==l.name&&(i=n.Types[u]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":s==1?n.Cell.push({type:n.Types[l.t-1].name,index:+l.v}):s==0&&n.Value.push({type:n.Types[l.t-1].name,index:+l.v});break;case"</rc>":break;case"<cellMetadata":s=1;break;case"</cellMetadata>":s=2;break;case"<valueMetadata":s=0;break;case"</valueMetadata>":s=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;case"<rvb":if(!i)break;i.offsets||(i.offsets=[]),i.offsets.push(+l.i);break;default:if(!a&&r.WTF)throw new Error("unrecognized "+l[0]+" in metadata")}return o}),n}function PG(e){var t=[];if(!e)return t;var r=1;return(e.match(Qr)||[]).forEach(function(n){var a=Xe(n);switch(a[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete a[0],a.i?r=a.i:a.i=r,t.push(a);break}}),t}function OG(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=et(r);var n=e.read_shift(1);return n&2&&(t.l="1"),n&8&&(t.a="1"),t}function jG(e,t,r){var n=[];return Ls(e,function(s,i,o){switch(o){case 63:n.push(s);break;default:if(!i.T)throw new Error("Unexpected record 0x"+o.toString(16))}}),n}function RG(e,t,r,n){if(!e)return e;var a=n||{},s=!1;Ls(e,function(o,l,u){switch(u){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:s=!0;break;case 36:s=!1;break;default:if(!l.T){if(!s||a.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}},a)}function IG(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}function b2(e,t,r,n){var a=Array.isArray(e),s;t.forEach(function(i){var o=un(i.ref);if(a?(e[o.r]||(e[o.r]=[]),s=e[o.r][o.c]):s=e[i.ref],!s){s={t:"z"},a?e[o.r][o.c]=s:e[i.ref]=s;var l=Zt(e["!ref"]||"BDWGO1000001:A1");l.s.r>o.r&&(l.s.r=o.r),l.e.r<o.r&&(l.e.r=o.r),l.s.c>o.c&&(l.s.c=o.c),l.e.c<o.c&&(l.e.c=o.c);var u=wt(l);u!==e["!ref"]&&(e["!ref"]=u)}s.c||(s.c=[]);var f={a:i.author,t:i.t,r:i.r,T:r};i.h&&(f.h=i.h);for(var d=s.c.length-1;d>=0;--d){if(!r&&s.c[d].T)return;r&&!s.c[d].T&&s.c.splice(d,1)}if(r&&n){for(d=0;d<n.length;++d)if(f.a==n[d].id){f.a=n[d].name||f.a;break}}s.c.push(f)})}function FG(e,t){if(e.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],n=[],a=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);a&&a[1]&&a[1].split(/<\/\w*:?author>/).forEach(function(i){if(!(i===""||i.trim()==="")){var o=i.match(/<(?:\w+:)?author[^>]*>(.*)/);o&&r.push(o[1])}});var s=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return s&&s[1]&&s[1].split(/<\/\w*:?comment>/).forEach(function(i){if(!(i===""||i.trim()==="")){var o=i.match(/<(?:\w+:)?comment[^>]*>/);if(o){var l=Xe(o[0]),u={author:l.authorId&&r[l.authorId]||"sheetjsghost",ref:l.ref,guid:l.guid},f=un(l.ref);if(!(t.sheetRows&&t.sheetRows<=f.r)){var d=i.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),h=!!d&&!!d[1]&&O1(d[1])||{r:"",t:"",h:""};u.r=h.r,h.r=="<t></t>"&&(h.t=h.h=""),u.t=(h.t||"").replace(/\r\n/g,`
`).replace(/\r/g,`
`),t.cellHTML&&(u.h=h.h),n.push(u)}}}}),n}function DG(e,t){var r=[],n=!1,a={},s=0;return e.replace(Qr,function(o,l){var u=Xe(o);switch(ss(u[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":a={author:u.personId,guid:u.id,ref:u.ref,T:1};break;case"</threadedComment>":a.t!=null&&r.push(a);break;case"<text>":case"<text":s=l+o.length;break;case"</text>":a.t=e.slice(s,l).replace(/\r\n/g,`
`).replace(/\r/g,`
`);break;case"<mentions":case"<mentions>":n=!0;break;case"</mentions>":n=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+u[0]+" in threaded comments")}return o}),r}function MG(e,t){var r=[],n=!1;return e.replace(Qr,function(s){var i=Xe(s);switch(ss(i[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":r.push({name:i.displayname,id:i.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&t.WTF)throw new Error("unrecognized "+i[0]+" in threaded comments")}return s}),r}function LG(e){var t={};t.iauthor=e.read_shift(4);var r=Vo(e);return t.rfx=r.s,t.ref=et(r.s),e.l+=16,t}var BG=Yr;function UG(e,t){var r=[],n=[],a={},s=!1;return Ls(e,function(o,l,u){switch(u){case 632:n.push(o);break;case 635:a=o;break;case 637:a.t=o.t,a.h=o.h,a.r=o.r;break;case 636:if(a.author=n[a.iauthor],delete a.iauthor,t.sheetRows&&a.rfx&&t.sheetRows<=a.rfx.r)break;a.t||(a.t=""),delete a.rfx,r.push(a);break;case 3072:break;case 35:s=!0;break;case 36:s=!1;break;case 37:break;case 38:break;default:if(!l.T){if(!s||t.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}),r}var $G="application/vnd.ms-office.vbaProject";function zG(e){var t=yt.utils.cfb_new({root:"R"});return e.FullPaths.forEach(function(r,n){if(!(r.slice(-1)==="/"||!r.match(/_VBA_PROJECT_CUR/))){var a=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");yt.utils.cfb_add(t,a,e.FileIndex[n].content)}}),yt.write(t)}function HG(){return{"!type":"dialog"}}function qG(){return{"!type":"dialog"}}function WG(){return{"!type":"macro"}}function VG(){return{"!type":"macro"}}var ql=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(n,a,s,i){var o=!1,l=!1;s.length==0?l=!0:s.charAt(0)=="["&&(l=!0,s=s.slice(1,-1)),i.length==0?o=!0:i.charAt(0)=="["&&(o=!0,i=i.slice(1,-1));var u=s.length>0?parseInt(s,10)|0:0,f=i.length>0?parseInt(i,10)|0:0;return o?f+=t.c:--f,l?u+=t.r:--u,a+(o?"":"$")+mr(f)+(l?"":"$")+Lr(u)}return function(a,s){return t=s,a.replace(e,r)}}(),EO=/(^|[^._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,GG=function(){return function(t,r){return t.replace(EO,function(n,a,s,i,o,l){var u=T1(i)-(s?0:r.c),f=S1(l)-(o?0:r.r),d=f==0?"":o?f+1:"["+f+"]",h=u==0?"":s?u+1:"["+u+"]";return a+"R"+d+"C"+h})}}();function SO(e,t){return e.replace(EO,function(r,n,a,s,i,o){return n+(a=="$"?a+s:mr(T1(s)+t.c))+(i=="$"?i+o:Lr(S1(o)+t.r))})}function KG(e,t,r){var n=Ac(t),a=n.s,s=un(r),i={r:s.r-a.r,c:s.c-a.c};return SO(e,i)}function YG(e){return e.length!=1}function _2(e){return e.replace(/_xlfn\./g,"")}function ar(e){e.l+=1}function Mi(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function TO(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return kO(e);r.biff==12&&(n=4)}var a=e.read_shift(n),s=e.read_shift(n),i=Mi(e),o=Mi(e);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:s,c:o[0],cRel:o[1],rRel:o[2]}}}function kO(e){var t=Mi(e),r=Mi(e),n=e.read_shift(1),a=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:a,cRel:r[1],rRel:r[2]}}}function XG(e,t,r){if(r.biff<8)return kO(e);var n=e.read_shift(r.biff==12?4:2),a=e.read_shift(r.biff==12?4:2),s=Mi(e),i=Mi(e);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:a,c:i[0],cRel:i[1],rRel:i[2]}}}function NO(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return JG(e);var n=e.read_shift(r&&r.biff==12?4:2),a=Mi(e);return{r:n,c:a[0],cRel:a[1],rRel:a[2]}}function JG(e){var t=Mi(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function QG(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 ZG(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return eK(e);var a=e.read_shift(n>=12?4:2),s=e.read_shift(2),i=(s&16384)>>14,o=(s&32768)>>15;if(s&=16383,o==1)for(;a>524287;)a-=1048576;if(i==1)for(;s>8191;)s=s-16384;return{r:a,c:s,cRel:i,rRel:o}}function eK(e){var t=e.read_shift(2),r=e.read_shift(1),n=(t&32768)>>15,a=(t&16384)>>14;return t&=16383,n==1&&t>=8192&&(t=t-16384),a==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:a,rRel:n}}function tK(e,t,r){var n=(e[e.l++]&96)>>5,a=TO(e,r.biff>=2&&r.biff<=5?6:8,r);return[n,a]}function rK(e,t,r){var n=(e[e.l++]&96)>>5,a=e.read_shift(2,"i"),s=8;if(r)switch(r.biff){case 5:e.l+=12,s=6;break;case 12:s=12;break}var i=TO(e,s,r);return[n,a,i]}function nK(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function aK(e,t,r){var n=(e[e.l++]&96)>>5,a=e.read_shift(2),s=8;if(r)switch(r.biff){case 5:e.l+=12,s=6;break;case 12:s=12;break}return e.l+=s,[n,a]}function sK(e,t,r){var n=(e[e.l++]&96)>>5,a=XG(e,t-1,r);return[n,a]}function iK(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[n]}function E2(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function oK(e,t,r){e.l+=2;for(var n=e.read_shift(r&&r.biff==2?1:2),a=[],s=0;s<=n;++s)a.push(e.read_shift(r&&r.biff==2?1:2));return a}function lK(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function cK(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function uK(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function fK(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[n]}function AO(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function dK(e){return e.read_shift(2),AO(e)}function hK(e){return e.read_shift(2),AO(e)}function pK(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var a=NO(e,0,r);return[n,a]}function mK(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var a=ZG(e,0,r);return[n,a]}function gK(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var a=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var s=NO(e,0,r);return[n,a,s]}function vK(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var a=e.read_shift(r&&r.biff<=3?1:2);return[xY[a],OO[a],n]}function xK(e,t,r){var n=e[e.l++],a=e.read_shift(1),s=r&&r.biff<=3?[n==88?-1:0,e.read_shift(1)]:yK(e);return[a,(s[0]===0?OO:vY)[s[1]]]}function yK(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function wK(e,t,r){e.l+=r&&r.biff==2?3:4}function bK(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var n=e.read_shift(2),a=e.read_shift(r&&r.biff==2?1:2);return[n,a]}function _K(e){return e.l++,Go[e.read_shift(1)]}function EK(e){return e.l++,e.read_shift(2)}function SK(e){return e.l++,e.read_shift(1)!==0}function TK(e){return e.l++,Vr(e)}function kK(e,t,r){return e.l++,Qf(e,t-1,r)}function NK(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]=er(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=Go[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=Vr(e);break;case 2:r[1]=Ko(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function AK(e,t,r){for(var n=e.read_shift(r.biff==12?4:2),a=[],s=0;s!=n;++s)a.push((r.biff==12?Vo:Ep)(e));return a}function CK(e,t,r){var n=0,a=0;r.biff==12?(n=e.read_shift(4),a=e.read_shift(4)):(a=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,--a==0&&(a=256));for(var s=0,i=[];s!=n&&(i[s]=[]);++s)for(var o=0;o!=a;++o)i[s][o]=NK(e,r.biff);return i}function PK(e,t,r){var n=e.read_shift(1)>>>5&3,a=!r||r.biff>=8?4:2,s=e.read_shift(a);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[n,0,s]}function OK(e,t,r){if(r.biff==5)return jK(e);var n=e.read_shift(1)>>>5&3,a=e.read_shift(2),s=e.read_shift(4);return[n,a,s]}function jK(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}function RK(e,t,r){var n=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var a=e.read_shift(r&&r.biff==2?1:2);return[n,a]}function IK(e,t,r){var n=e.read_shift(1)>>>5&3,a=e.read_shift(r&&r.biff==2?1:2);return[n,a]}function FK(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[n]}function DK(e,t,r){var n=(e[e.l++]&96)>>5,a=e.read_shift(2),s=4;if(r)switch(r.biff){case 5:s=15;break;case 12:s=6;break}return e.l+=s,[n,a]}var MK=Jr,LK=Jr,BK=Jr;function ed(e,t,r){return e.l+=2,[QG(e)]}function R1(e){return e.l+=6,[]}var UK=ed,$K=R1,zK=R1,HK=ed;function CO(e){return e.l+=2,[ir(e),e.read_shift(2)&1]}var qK=ed,WK=CO,VK=R1,GK=ed,KK=ed,YK=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function XK(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),a=e.read_shift(2),s=e.read_shift(2),i=YK[r>>2&31];return{ixti:t,coltype:r&3,rt:i,idx:n,c:a,C:s}}function JK(e){return e.l+=2,[e.read_shift(4)]}function QK(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function ZK(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function eY(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function tY(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function rY(e){return e.l+=4,[0,0]}var S2={1:{n:"PtgExp",f:bK},2:{n:"PtgTbl",f:BK},3:{n:"PtgAdd",f:ar},4:{n:"PtgSub",f:ar},5:{n:"PtgMul",f:ar},6:{n:"PtgDiv",f:ar},7:{n:"PtgPower",f:ar},8:{n:"PtgConcat",f:ar},9:{n:"PtgLt",f:ar},10:{n:"PtgLe",f:ar},11:{n:"PtgEq",f:ar},12:{n:"PtgGe",f:ar},13:{n:"PtgGt",f:ar},14:{n:"PtgNe",f:ar},15:{n:"PtgIsect",f:ar},16:{n:"PtgUnion",f:ar},17:{n:"PtgRange",f:ar},18:{n:"PtgUplus",f:ar},19:{n:"PtgUminus",f:ar},20:{n:"PtgPercent",f:ar},21:{n:"PtgParen",f:ar},22:{n:"PtgMissArg",f:ar},23:{n:"PtgStr",f:kK},26:{n:"PtgSheet",f:QK},27:{n:"PtgEndSheet",f:ZK},28:{n:"PtgErr",f:_K},29:{n:"PtgBool",f:SK},30:{n:"PtgInt",f:EK},31:{n:"PtgNum",f:TK},32:{n:"PtgArray",f:iK},33:{n:"PtgFunc",f:vK},34:{n:"PtgFuncVar",f:xK},35:{n:"PtgName",f:PK},36:{n:"PtgRef",f:pK},37:{n:"PtgArea",f:tK},38:{n:"PtgMemArea",f:RK},39:{n:"PtgMemErr",f:MK},40:{n:"PtgMemNoMem",f:LK},41:{n:"PtgMemFunc",f:IK},42:{n:"PtgRefErr",f:FK},43:{n:"PtgAreaErr",f:nK},44:{n:"PtgRefN",f:mK},45:{n:"PtgAreaN",f:sK},46:{n:"PtgMemAreaN",f:eY},47:{n:"PtgMemNoMemN",f:tY},57:{n:"PtgNameX",f:OK},58:{n:"PtgRef3d",f:gK},59:{n:"PtgArea3d",f:rK},60:{n:"PtgRefErr3d",f:DK},61:{n:"PtgAreaErr3d",f:aK},255:{}},nY={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},aY={1:{n:"PtgElfLel",f:CO},2:{n:"PtgElfRw",f:GK},3:{n:"PtgElfCol",f:UK},6:{n:"PtgElfRwV",f:KK},7:{n:"PtgElfColV",f:HK},10:{n:"PtgElfRadical",f:qK},11:{n:"PtgElfRadicalS",f:VK},13:{n:"PtgElfColS",f:$K},15:{n:"PtgElfColSV",f:zK},16:{n:"PtgElfRadicalLel",f:WK},25:{n:"PtgList",f:XK},29:{n:"PtgSxName",f:JK},255:{}},sY={0:{n:"PtgAttrNoop",f:rY},1:{n:"PtgAttrSemi",f:fK},2:{n:"PtgAttrIf",f:cK},4:{n:"PtgAttrChoose",f:oK},8:{n:"PtgAttrGoto",f:lK},16:{n:"PtgAttrSum",f:wK},32:{n:"PtgAttrBaxcel",f:E2},33:{n:"PtgAttrBaxcel",f:E2},64:{n:"PtgAttrSpace",f:dK},65:{n:"PtgAttrSpaceSemi",f:hK},128:{n:"PtgAttrIfError",f:uK},255:{}};function td(e,t,r,n){if(n.biff<8)return Jr(e,t);for(var a=e.l+t,s=[],i=0;i!==r.length;++i)switch(r[i][0]){case"PtgArray":r[i][1]=CK(e,0,n),s.push(r[i][1]);break;case"PtgMemArea":r[i][2]=AK(e,r[i][1],n),s.push(r[i][2]);break;case"PtgExp":n&&n.biff==12&&(r[i][1][1]=e.read_shift(4),s.push(r[i][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[i][0]}return t=a-e.l,t!==0&&s.push(Jr(e,t)),s}function rd(e,t,r){for(var n=e.l+t,a,s,i=[];n!=e.l;)t=n-e.l,s=e[e.l],a=S2[s]||S2[nY[s]],(s===24||s===25)&&(a=(s===24?aY:sY)[e[e.l+1]]),!a||!a.f?Jr(e,t):i.push([a.n,a.f(e,t,r)]);return i}function iY(e){for(var t=[],r=0;r<e.length;++r){for(var n=e[r],a=[],s=0;s<n.length;++s){var i=n[s];if(i)switch(i[0]){case 2:a.push('"'+i[1].replace(/"/g,'""')+'"');break;default:a.push(i[1])}else a.push("")}t.push(a.join(","))}return t.join(";")}var oY={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function lY(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 PO(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 n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var a="";if(r.biff>8)switch(e[n[0]][0]){case 357:return a=n[1]==-1?"#REF":e.SheetNames[n[1]],n[1]==n[2]?a:a+":"+e.SheetNames[n[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];case 355:default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return a=n[1]==-1?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?a:a+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return e[n[0]][0][3]?(a=n[1]==-1?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?a:a+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function T2(e,t,r){var n=PO(e,t,r);return n=="#REF"?n:lY(n,r)}function qr(e,t,r,n,a){var s=a&&a.biff||8,i={s:{c:0,r:0}},o=[],l,u,f,d=0,h=0,p,v="";if(!e[0]||!e[0][0])return"";for(var m=-1,g="",x=0,y=e[0].length;x<y;++x){var w=e[0][x];switch(w[0]){case"PtgUminus":o.push("-"+o.pop());break;case"PtgUplus":o.push("+"+o.pop());break;case"PtgPercent":o.push(o.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(l=o.pop(),u=o.pop(),m>=0){switch(e[0][m][1][0]){case 0:g=Qt(" ",e[0][m][1][1]);break;case 1:g=Qt("\r",e[0][m][1][1]);break;default:if(g="",a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}u=u+g,m=-1}o.push(u+oY[w[0]]+l);break;case"PtgIsect":l=o.pop(),u=o.pop(),o.push(u+" "+l);break;case"PtgUnion":l=o.pop(),u=o.pop(),o.push(u+","+l);break;case"PtgRange":l=o.pop(),u=o.pop(),o.push(u+":"+l);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":f=Ou(w[1][1],i,a),o.push(ju(f,s));break;case"PtgRefN":f=r?Ou(w[1][1],r,a):w[1][1],o.push(ju(f,s));break;case"PtgRef3d":d=w[1][1],f=Ou(w[1][2],i,a),v=T2(n,d,a),o.push(v+"!"+ju(f,s));break;case"PtgFunc":case"PtgFuncVar":var b=w[1][0],_=w[1][1];b||(b=0),b&=127;var T=b==0?[]:o.slice(-b);o.length-=b,_==="User"&&(_=T.shift()),o.push(_+"("+T.join(",")+")");break;case"PtgBool":o.push(w[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(w[1]);break;case"PtgNum":o.push(String(w[1]));break;case"PtgStr":o.push('"'+w[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(w[1]);break;case"PtgAreaN":p=s2(w[1][1],r?{s:r}:i,a),o.push($m(p,a));break;case"PtgArea":p=s2(w[1][1],i,a),o.push($m(p,a));break;case"PtgArea3d":d=w[1][1],p=w[1][2],v=T2(n,d,a),o.push(v+"!"+$m(p,a));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":h=w[1][2];var E=(n.names||[])[h-1]||(n[0]||[])[h],C=E?E.Name:"SH33TJSNAME"+String(h);C&&C.slice(0,6)=="_xlfn."&&!a.xlfn&&(C=C.slice(6)),o.push(C);break;case"PtgNameX":var P=w[1][1];h=w[1][2];var N;if(a.biff<=5)P<0&&(P=-P),n[P]&&(N=n[P][h]);else{var k="";if(((n[P]||[])[0]||[])[0]==14849||(((n[P]||[])[0]||[])[0]==1025?n[P][h]&&n[P][h].itab>0&&(k=n.SheetNames[n[P][h].itab-1]+"!"):k=n.SheetNames[h-1]+"!"),n[P]&&n[P][h])k+=n[P][h].Name;else if(n[0]&&n[0][h])k+=n[0][h].Name;else{var A=(PO(n,P,a)||"").split(";;");A[h-1]?k=A[h-1]:k+="SH33TJSERRX"}o.push(k);break}N||(N={Name:"SH33TJSERRY"}),o.push(N.Name);break;case"PtgParen":var I="(",M=")";if(m>=0){switch(g="",e[0][m][1][0]){case 2:I=Qt(" ",e[0][m][1][1])+I;break;case 3:I=Qt("\r",e[0][m][1][1])+I;break;case 4:M=Qt(" ",e[0][m][1][1])+M;break;case 5:M=Qt("\r",e[0][m][1][1])+M;break;default:if(a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][m][1][0])}m=-1}o.push(I+o.pop()+M);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":f={c:w[1][1],r:w[1][0]};var U={c:r.c,r:r.r};if(n.sharedf[et(f)]){var W=n.sharedf[et(f)];o.push(qr(W,i,U,n,a))}else{var G=!1;for(l=0;l!=n.arrayf.length;++l)if(u=n.arrayf[l],!(f.c<u[0].s.c||f.c>u[0].e.c)&&!(f.r<u[0].s.r||f.r>u[0].e.r)){o.push(qr(u[1],i,U,n,a)),G=!0;break}G||o.push(w[1])}break;case"PtgArray":o.push("{"+iY(w[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=x;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":o.push("");break;case"PtgAreaErr":o.push("#REF!");break;case"PtgAreaErr3d":o.push("#REF!");break;case"PtgList":o.push("Table"+w[1].idx+"[#"+w[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(w));default:throw new Error("Unrecognized Formula Token: "+String(w))}var Q=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(a.biff!=3&&m>=0&&Q.indexOf(e[0][x][0])==-1){w=e[0][m];var R=!0;switch(w[1][0]){case 4:R=!1;case 0:g=Qt(" ",w[1][1]);break;case 5:R=!1;case 1:g=Qt("\r",w[1][1]);break;default:if(g="",a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+w[1][0])}o.push((R?g:"")+o.pop()+(R?"":g)),m=-1}}if(o.length>1&&a.WTF)throw new Error("bad formula stack");return o[0]}function cY(e,t,r){var n=e.l+t,a=r.biff==2?1:2,s,i=e.read_shift(a);if(i==65535)return[[],Jr(e,t-2)];var o=rd(e,i,r);return t!==i+a&&(s=td(e,t-i-a,o,r)),e.l=n,[o,s]}function uY(e,t,r){var n=e.l+t,a=r.biff==2?1:2,s,i=e.read_shift(a);if(i==65535)return[[],Jr(e,t-2)];var o=rd(e,i,r);return t!==i+a&&(s=td(e,t-i-a,o,r)),e.l=n,[o,s]}function fY(e,t,r,n){var a=e.l+t,s=rd(e,n,r),i;return a!==e.l&&(i=td(e,a-e.l,s,r)),[s,i]}function dY(e,t,r){var n=e.l+t,a,s=e.read_shift(2),i=rd(e,s,r);return s==65535?[[],Jr(e,t-2)]:(t!==s+2&&(a=td(e,n-s-2,i,r)),[i,a])}function hY(e){var t;if(bs(e,e.l+6)!==65535)return[Vr(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=e[e.l+2]===1,e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}function qm(e,t,r){var n=e.l+t,a=is(e);r.biff==2&&++e.l;var s=hY(e),i=e.read_shift(1);r.biff!=2&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var o=uY(e,n-e.l,r);return{cell:a,val:s[0],formula:o,shared:i>>3&1,tt:s[1]}}function Sp(e,t,r){var n=e.read_shift(4),a=rd(e,n,r),s=e.read_shift(4),i=s>0?td(e,s,a,r):null;return[a,i]}var pY=Sp,Tp=Sp,mY=Sp,gY=Sp,vY={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"},OO={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"},xY={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 k2(e){return e.slice(0,3)=="of:"&&(e=e.slice(3)),e.charCodeAt(0)==61&&(e=e.slice(1),e.charCodeAt(0)==61&&(e=e.slice(1))),e=e.replace(/COM\.MICROSOFT\./g,""),e=e.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(t,r){return r.replace(/\./g,"")}),e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),e.replace(/[;~]/g,",").replace(/\|/g,";")}function Wm(e){var t=e.split(":"),r=t[0].split(".")[0];return[r,t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}var Du={},Wl={};function Mu(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];t=="xlml"&&(r=[1,1,1,1,.5,.5]),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 jO(e,t,r,n,a,s){try{n.cellNF&&(e.z=rt[t])}catch(o){if(n.WTF)throw o}if(!(e.t==="z"&&!n.cellStyles)){if(e.t==="d"&&typeof e.v=="string"&&(e.v=Er(e.v)),(!n||n.cellText!==!1)&&e.t!=="z")try{if(rt[t]==null&&Eo(yH[t]||"General",t),e.t==="e")e.w=e.w||Go[e.v];else if(t===0)if(e.t==="n")(e.v|0)===e.v?e.w=e.v.toString(10):e.w=wf(e.v);else if(e.t==="d"){var i=pn(e.v);(i|0)===i?e.w=i.toString(10):e.w=wf(i)}else{if(e.v===void 0)return"";e.w=Fo(e.v,Wl)}else e.t==="d"?e.w=la(t,pn(e.v),Wl):e.w=la(t,e.v,Wl)}catch(o){if(n.WTF)throw o}if(n.cellStyles&&r!=null)try{e.s=s.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=y0(a.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),n.WTF&&(e.s.fgColor.raw_rgb=a.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=y0(a.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),n.WTF&&(e.s.bgColor.raw_rgb=a.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(o){if(n.WTF&&s.Fills)throw o}}}function yY(e,t){var r=Zt(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=wt(r))}var wY=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,bY=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,_Y=/<(?:\w:)?hyperlink [^>]*>/mg,EY=/"(\w*:\w*)"/,SY=/<(?:\w:)?col\b[^>]*[\/]?>/g,TY=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,kY=/<(?:\w:)?pageMargins[^>]*\/>/g,RO=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,NY=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,AY=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function CY(e,t,r,n,a,s,i){if(!e)return e;n||(n={"!id":{}});var o=t.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},u="",f="",d=e.match(bY);d?(u=e.slice(0,d.index),f=e.slice(d.index+d[0].length)):u=f=e;var h=u.match(RO);h?I1(h[0],o,a,r):(h=u.match(NY))&&PY(h[0],h[1]||"",o,a,r);var p=(u.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(p>0){var v=u.slice(p,p+50).match(EY);v&&yY(o,v[1])}var m=u.match(AY);m&&m[1]&&DY(m[1],a);var g=[];if(t.cellStyles){var x=u.match(SY);x&&RY(g,x)}d&&MY(d[1],o,t,l,s,i);var y=f.match(TY);y&&(o["!autofilter"]=IY(y[0]));var w=[],b=f.match(wY);if(b)for(p=0;p!=b.length;++p)w[p]=Zt(b[p].slice(b[p].indexOf('"')+1));var _=f.match(_Y);_&&OY(o,_,n);var T=f.match(kY);if(T&&(o["!margins"]=jY(Xe(T[0]))),!o["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(o["!ref"]=wt(l)),t.sheetRows>0&&o["!ref"]){var E=Zt(o["!ref"]);t.sheetRows<=+E.e.r&&(E.e.r=t.sheetRows-1,E.e.r>l.e.r&&(E.e.r=l.e.r),E.e.r<E.s.r&&(E.s.r=E.e.r),E.e.c>l.e.c&&(E.e.c=l.e.c),E.e.c<E.s.c&&(E.s.c=E.e.c),o["!fullref"]=o["!ref"],o["!ref"]=wt(E))}return g.length>0&&(o["!cols"]=g),w.length>0&&(o["!merges"]=w),o}function I1(e,t,r,n){var a=Xe(e);r.Sheets[n]||(r.Sheets[n]={}),a.codeName&&(r.Sheets[n].CodeName=St(Dt(a.codeName)))}function PY(e,t,r,n,a){I1(e.slice(0,e.indexOf(">")),r,n,a)}function OY(e,t,r){for(var n=Array.isArray(e),a=0;a!=t.length;++a){var s=Xe(Dt(t[a]),!0);if(!s.ref)return;var i=((r||{})["!id"]||[])[s.id];i?(s.Target=i.Target,s.location&&(s.Target+="#"+St(s.location))):(s.Target="#"+St(s.location),i={Target:s.Target,TargetMode:"Internal"}),s.Rel=i,s.tooltip&&(s.Tooltip=s.tooltip,delete s.tooltip);for(var o=Zt(s.ref),l=o.s.r;l<=o.e.r;++l)for(var u=o.s.c;u<=o.e.c;++u){var f=et({c:u,r:l});n?(e[l]||(e[l]=[]),e[l][u]||(e[l][u]={t:"z",v:void 0}),e[l][u].l=s):(e[f]||(e[f]={t:"z",v:void 0}),e[f].l=s)}}}function jY(e){var t={};return["left","right","top","bottom","header","footer"].forEach(function(r){e[r]&&(t[r]=parseFloat(e[r]))}),t}function RY(e,t){for(var r=!1,n=0;n!=t.length;++n){var a=Xe(t[n],!0);a.hidden&&(a.hidden=$t(a.hidden));var s=parseInt(a.min,10)-1,i=parseInt(a.max,10)-1;for(a.outlineLevel&&(a.level=+a.outlineLevel||0),delete a.min,delete a.max,a.width=+a.width,!r&&a.width&&(r=!0,j1(a.width)),pc(a);s<=i;)e[s++]=Mr(a)}}function IY(e){var t={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return t}var FY=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function DY(e,t){t.Views||(t.Views=[{}]),(e.match(FY)||[]).forEach(function(r,n){var a=Xe(r);t.Views[n]||(t.Views[n]={}),+a.zoomScale&&(t.Views[n].zoom=+a.zoomScale),$t(a.rightToLeft)&&(t.Views[n].RTL=!0)})}var MY=function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,n=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,a=/ref=["']([^"']*)["']/,s=bf("v"),i=bf("f");return function(l,u,f,d,h,p){for(var v=0,m="",g=[],x=[],y=0,w=0,b=0,_="",T,E,C=0,P=0,N,k,A=0,I=0,M=Array.isArray(p.CellXf),U,W=[],G=[],Q=Array.isArray(u),R=[],z={},D=!1,O=!!f.sheetStubs,j=l.split(t),B=0,L=j.length;B!=L;++B){m=j[B].trim();var F=m.length;if(F!==0){var H=0;e:for(v=0;v<F;++v)switch(m[v]){case">":if(m[v-1]!="/"){++v;break e}if(f&&f.cellStyles){if(E=Xe(m.slice(H,v),!0),C=E.r!=null?parseInt(E.r,10):C+1,P=-1,f.sheetRows&&f.sheetRows<C)continue;z={},D=!1,E.ht&&(D=!0,z.hpt=parseFloat(E.ht),z.hpx=Tf(z.hpt)),E.hidden=="1"&&(D=!0,z.hidden=!0),E.outlineLevel!=null&&(D=!0,z.level=+E.outlineLevel),D&&(R[C-1]=z)}break;case"<":H=v;break}if(H>=v)break;if(E=Xe(m.slice(H,v),!0),C=E.r!=null?parseInt(E.r,10):C+1,P=-1,!(f.sheetRows&&f.sheetRows<C)){d.s.r>C-1&&(d.s.r=C-1),d.e.r<C-1&&(d.e.r=C-1),f&&f.cellStyles&&(z={},D=!1,E.ht&&(D=!0,z.hpt=parseFloat(E.ht),z.hpx=Tf(z.hpt)),E.hidden=="1"&&(D=!0,z.hidden=!0),E.outlineLevel!=null&&(D=!0,z.level=+E.outlineLevel),D&&(R[C-1]=z)),g=m.slice(v).split(e);for(var Z=0;Z!=g.length&&g[Z].trim().charAt(0)=="<";++Z);for(g=g.slice(Z),v=0;v!=g.length;++v)if(m=g[v].trim(),m.length!==0){if(x=m.match(r),y=v,w=0,b=0,m="<c "+(m.slice(0,1)=="<"?">":"")+m,x!=null&&x.length===2){for(y=0,_=x[1],w=0;w!=_.length&&!((b=_.charCodeAt(w)-64)<1||b>26);++w)y=26*y+b;--y,P=y}else++P;for(w=0;w!=m.length&&m.charCodeAt(w)!==62;++w);if(++w,E=Xe(m.slice(0,w),!0),E.r||(E.r=et({r:C-1,c:P})),_=m.slice(w),T={t:""},(x=_.match(s))!=null&&x[1]!==""&&(T.v=St(x[1])),f.cellFormula){if((x=_.match(i))!=null&&x[1]!==""){if(T.f=St(Dt(x[1])).replace(/\r\n/g,`
`),f.xlfn||(T.f=_2(T.f)),x[0].indexOf('t="array"')>-1)T.F=(_.match(a)||[])[1],T.F.indexOf(":")>-1&&W.push([Zt(T.F),T.F]);else if(x[0].indexOf('t="shared"')>-1){k=Xe(x[0]);var X=St(Dt(x[1]));f.xlfn||(X=_2(X)),G[parseInt(k.si,10)]=[k,X,E.r]}}else(x=_.match(/<f[^>]*\/>/))&&(k=Xe(x[0]),G[k.si]&&(T.f=KG(G[k.si][1],G[k.si][2],E.r)));var ne=un(E.r);for(w=0;w<W.length;++w)ne.r>=W[w][0].s.r&&ne.r<=W[w][0].e.r&&ne.c>=W[w][0].s.c&&ne.c<=W[w][0].e.c&&(T.F=W[w][1])}if(E.t==null&&T.v===void 0)if(T.f||T.F)T.v=0,T.t="n";else if(O)T.t="z";else continue;else T.t=E.t||"n";switch(d.s.c>P&&(d.s.c=P),d.e.c<P&&(d.e.c=P),T.t){case"n":if(T.v==""||T.v==null){if(!O)continue;T.t="z"}else T.v=parseFloat(T.v);break;case"s":if(typeof T.v>"u"){if(!O)continue;T.t="z"}else N=Du[parseInt(T.v,10)],T.v=N.t,T.r=N.r,f.cellHTML&&(T.h=N.h);break;case"str":T.t="s",T.v=T.v!=null?Dt(T.v):"",f.cellHTML&&(T.h=b1(T.v));break;case"inlineStr":x=_.match(n),T.t="s",x!=null&&(N=O1(x[1]))?(T.v=N.t,f.cellHTML&&(T.h=N.h)):T.v="";break;case"b":T.v=$t(T.v);break;case"d":f.cellDates?T.v=Er(T.v,1):(T.v=pn(Er(T.v,1)),T.t="n");break;case"e":(!f||f.cellText!==!1)&&(T.w=T.v),T.v=eO[T.v];break}if(A=I=0,U=null,M&&E.s!==void 0&&(U=p.CellXf[E.s],U!=null&&(U.numFmtId!=null&&(A=U.numFmtId),f.cellStyles&&U.fillId!=null&&(I=U.fillId))),jO(T,A,I,f,h,p),f.cellDates&&M&&T.t=="n"&&Nc(rt[A])&&(T.t="d",T.v=_p(T.v)),E.cm&&f.xlmeta){var he=(f.xlmeta.Cell||[])[+E.cm-1];he&&he.type=="XLDAPR"&&(T.D=!0)}if(Q){var V=un(E.r);u[V.r]||(u[V.r]=[]),u[V.r][V.c]=T}else u[E.r]=T}}}}R.length>0&&(u["!rows"]=R)}}();function LY(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var a=e.read_shift(2);e.l+=1;var s=e.read_shift(1);return e.l=n,s&7&&(r.level=s&7),s&16&&(r.hidden=!0),s&32&&(r.hpt=a/20),r}var BY=Vo;function UY(){}function $Y(e,t){var r={},n=e[e.l];return++e.l,r.above=!(n&64),r.left=!(n&128),e.l+=18,r.name=cq(e),r}function zY(e){var t=ua(e);return[t]}function HY(e){var t=Wo(e);return[t]}function qY(e){var t=ua(e),r=e.read_shift(1);return[t,r,"b"]}function WY(e){var t=Wo(e),r=e.read_shift(1);return[t,r,"b"]}function VY(e){var t=ua(e),r=e.read_shift(1);return[t,r,"e"]}function GY(e){var t=Wo(e),r=e.read_shift(1);return[t,r,"e"]}function KY(e){var t=ua(e),r=e.read_shift(4);return[t,r,"s"]}function YY(e){var t=Wo(e),r=e.read_shift(4);return[t,r,"s"]}function XY(e){var t=ua(e),r=Vr(e);return[t,r,"n"]}function IO(e){var t=Wo(e),r=Vr(e);return[t,r,"n"]}function JY(e){var t=ua(e),r=A1(e);return[t,r,"n"]}function QY(e){var t=Wo(e),r=A1(e);return[t,r,"n"]}function ZY(e){var t=ua(e),r=k1(e);return[t,r,"is"]}function eX(e){var t=ua(e),r=Yr(e);return[t,r,"str"]}function tX(e){var t=Wo(e),r=Yr(e);return[t,r,"str"]}function rX(e,t,r){var n=e.l+t,a=ua(e);a.r=r["!row"];var s=e.read_shift(1),i=[a,s,"b"];if(r.cellFormula){e.l+=2;var o=Tp(e,n-e.l,r);i[3]=qr(o,null,a,r.supbooks,r)}else e.l=n;return i}function nX(e,t,r){var n=e.l+t,a=ua(e);a.r=r["!row"];var s=e.read_shift(1),i=[a,s,"e"];if(r.cellFormula){e.l+=2;var o=Tp(e,n-e.l,r);i[3]=qr(o,null,a,r.supbooks,r)}else e.l=n;return i}function aX(e,t,r){var n=e.l+t,a=ua(e);a.r=r["!row"];var s=Vr(e),i=[a,s,"n"];if(r.cellFormula){e.l+=2;var o=Tp(e,n-e.l,r);i[3]=qr(o,null,a,r.supbooks,r)}else e.l=n;return i}function sX(e,t,r){var n=e.l+t,a=ua(e);a.r=r["!row"];var s=Yr(e),i=[a,s,"str"];if(r.cellFormula){e.l+=2;var o=Tp(e,n-e.l,r);i[3]=qr(o,null,a,r.supbooks,r)}else e.l=n;return i}var iX=Vo;function oX(e,t){var r=e.l+t,n=Vo(e),a=N1(e),s=Yr(e),i=Yr(e),o=Yr(e);e.l=r;var l={rfx:n,relId:a,loc:s,display:o};return i&&(l.Tooltip=i),l}function lX(){}function cX(e,t,r){var n=e.l+t,a=JP(e),s=e.read_shift(1),i=[a];if(i[2]=s,r.cellFormula){var o=pY(e,n-e.l,r);i[1]=o}else e.l=n;return i}function uX(e,t,r){var n=e.l+t,a=Vo(e),s=[a];if(r.cellFormula){var i=gY(e,n-e.l,r);s[1]=i,e.l=n}else e.l=n;return s}var fX=["left","right","top","bottom","header","footer"];function dX(e){var t={};return fX.forEach(function(r){t[r]=Vr(e)}),t}function hX(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function pX(){}function mX(){}function gX(e,t,r,n,a,s,i){if(!e)return e;var o=t||{};n||(n={"!id":{}});var l=o.dense?[]:{},u,f={s:{r:2e6,c:2e6},e:{r:0,c:0}},d=!1,h=!1,p,v,m,g,x,y,w,b,_,T=[];o.biff=12,o["!row"]=0;var E=0,C=!1,P=[],N={},k=o.supbooks||a.supbooks||[[]];if(k.sharedf=N,k.arrayf=P,k.SheetNames=a.SheetNames||a.Sheets.map(function(Q){return Q.name}),!o.supbooks&&(o.supbooks=k,a.Names))for(var A=0;A<a.Names.length;++A)k[0][A+1]=a.Names[A];var I=[],M=[],U=!1;_0[16]={n:"BrtShortReal",f:IO};var W;if(Ls(e,function(R,z,D){if(!h)switch(D){case 148:u=R;break;case 0:p=R,o.sheetRows&&o.sheetRows<=p.r&&(h=!0),b=Lr(g=p.r),o["!row"]=p.r,(R.hidden||R.hpt||R.level!=null)&&(R.hpt&&(R.hpx=Tf(R.hpt)),M[R.r]=R);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(v={t:R[2]},R[2]){case"n":v.v=R[1];break;case"s":w=Du[R[1]],v.v=w.t,v.r=w.r;break;case"b":v.v=!!R[1];break;case"e":v.v=R[1],o.cellText!==!1&&(v.w=Go[v.v]);break;case"str":v.t="s",v.v=R[1];break;case"is":v.t="s",v.v=R[1].t;break}if((m=i.CellXf[R[0].iStyleRef])&&jO(v,m.numFmtId,null,o,s,i),x=R[0].c==-1?x+1:R[0].c,o.dense?(l[g]||(l[g]=[]),l[g][x]=v):l[mr(x)+b]=v,o.cellFormula){for(C=!1,E=0;E<P.length;++E){var O=P[E];p.r>=O[0].s.r&&p.r<=O[0].e.r&&x>=O[0].s.c&&x<=O[0].e.c&&(v.F=wt(O[0]),C=!0)}!C&&R.length>3&&(v.f=R[3])}if(f.s.r>p.r&&(f.s.r=p.r),f.s.c>x&&(f.s.c=x),f.e.r<p.r&&(f.e.r=p.r),f.e.c<x&&(f.e.c=x),o.cellDates&&m&&v.t=="n"&&Nc(rt[m.numFmtId])){var j=lo(v.v);j&&(v.t="d",v.v=new Date(j.y,j.m-1,j.d,j.H,j.M,j.S,j.u))}W&&(W.type=="XLDAPR"&&(v.D=!0),W=void 0);break;case 1:case 12:if(!o.sheetStubs||d)break;v={t:"z",v:void 0},x=R[0].c==-1?x+1:R[0].c,o.dense?(l[g]||(l[g]=[]),l[g][x]=v):l[mr(x)+b]=v,f.s.r>p.r&&(f.s.r=p.r),f.s.c>x&&(f.s.c=x),f.e.r<p.r&&(f.e.r=p.r),f.e.c<x&&(f.e.c=x),W&&(W.type=="XLDAPR"&&(v.D=!0),W=void 0);break;case 176:T.push(R);break;case 49:W=((o.xlmeta||{}).Cell||[])[R-1];break;case 494:var B=n["!id"][R.relId];for(B?(R.Target=B.Target,R.loc&&(R.Target+="#"+R.loc),R.Rel=B):R.relId==""&&(R.Target="#"+R.loc),g=R.rfx.s.r;g<=R.rfx.e.r;++g)for(x=R.rfx.s.c;x<=R.rfx.e.c;++x)o.dense?(l[g]||(l[g]=[]),l[g][x]||(l[g][x]={t:"z",v:void 0}),l[g][x].l=R):(y=et({c:x,r:g}),l[y]||(l[y]={t:"z",v:void 0}),l[y].l=R);break;case 426:if(!o.cellFormula)break;P.push(R),_=o.dense?l[g][x]:l[mr(x)+b],_.f=qr(R[1],f,{r:p.r,c:x},k,o),_.F=wt(R[0]);break;case 427:if(!o.cellFormula)break;N[et(R[0].s)]=R[1],_=o.dense?l[g][x]:l[mr(x)+b],_.f=qr(R[1],f,{r:p.r,c:x},k,o);break;case 60:if(!o.cellStyles)break;for(;R.e>=R.s;)I[R.e--]={width:R.w/256,hidden:!!(R.flags&1),level:R.level},U||(U=!0,j1(R.w/256)),pc(I[R.e+1]);break;case 161:l["!autofilter"]={ref:wt(R)};break;case 476:l["!margins"]=R;break;case 147:a.Sheets[r]||(a.Sheets[r]={}),R.name&&(a.Sheets[r].CodeName=R.name),(R.above||R.left)&&(l["!outline"]={above:R.above,left:R.left});break;case 137:a.Views||(a.Views=[{}]),a.Views[0]||(a.Views[0]={}),R.RTL&&(a.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:d=!0;break;case 36:d=!1;break;case 37:d=!0;break;case 38:d=!1;break;default:if(!z.T){if(!d||o.WTF)throw new Error("Unexpected record 0x"+D.toString(16))}}},o),delete o.supbooks,delete o["!row"],!l["!ref"]&&(f.s.r<2e6||u&&(u.e.r>0||u.e.c>0||u.s.r>0||u.s.c>0))&&(l["!ref"]=wt(u||f)),o.sheetRows&&l["!ref"]){var G=Zt(l["!ref"]);o.sheetRows<=+G.e.r&&(G.e.r=o.sheetRows-1,G.e.r>f.e.r&&(G.e.r=f.e.r),G.e.r<G.s.r&&(G.s.r=G.e.r),G.e.c>f.e.c&&(G.e.c=f.e.c),G.e.c<G.s.c&&(G.s.c=G.e.c),l["!fullref"]=l["!ref"],l["!ref"]=wt(G))}return T.length>0&&(l["!merges"]=T),I.length>0&&(l["!cols"]=I),M.length>0&&(l["!rows"]=M),l}function vX(e){var t=[],r=e.match(/^<c:numCache>/),n;(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(s){var i=s.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);i&&(t[+i[1]]=r?+i[2]:i[2])});var a=St((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(e.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(s){n=s.replace(/<.*?>/g,"")}),[t,a,n]}function xX(e,t,r,n,a,s){var i=s||{"!type":"chart"};if(!e)return s;var o=0,l=0,u="A",f={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(d){var h=vX(d);f.s.r=f.s.c=0,f.e.c=o,u=mr(o),h[0].forEach(function(p,v){i[u+Lr(v)]={t:"n",v:p,z:h[1]},l=v}),f.e.r<l&&(f.e.r=l),++o}),o>0&&(i["!ref"]=wt(f)),i}function yX(e,t,r,n,a){if(!e)return e;n||(n={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},i,o=e.match(RO);return o&&I1(o[0],s,a,r),(i=e.match(/drawing r:id="(.*?)"/))&&(s["!rel"]=i[1]),n["!id"][s["!rel"]]&&(s["!drawel"]=n["!id"][s["!rel"]]),s}function wX(e,t){e.l+=10;var r=Yr(e);return{name:r}}function bX(e,t,r,n,a){if(!e)return e;n||(n={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},i=!1;return Ls(e,function(l,u,f){switch(f){case 550:s["!rel"]=l;break;case 651:a.Sheets[r]||(a.Sheets[r]={}),l.name&&(a.Sheets[r].CodeName=l.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:i=!0;break;case 36:i=!1;break;case 37:break;case 38:break;default:if(!(u.T>0)){if(!(u.T<0)){if(!i||t.WTF)throw new Error("Unexpected record 0x"+f.toString(16))}}}},t),n["!id"][s["!rel"]]&&(s["!drawel"]=n["!id"][s["!rel"]]),s}var FO=[["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"]],_X=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],EX=[],SX=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function N2(e,t){for(var r=0;r!=e.length;++r)for(var n=e[r],a=0;a!=t.length;++a){var s=t[a];if(n[s[0]]==null)n[s[0]]=s[1];else switch(s[2]){case"bool":typeof n[s[0]]=="string"&&(n[s[0]]=$t(n[s[0]]));break;case"int":typeof n[s[0]]=="string"&&(n[s[0]]=parseInt(n[s[0]],10));break}}}function A2(e,t){for(var r=0;r!=t.length;++r){var n=t[r];if(e[n[0]]==null)e[n[0]]=n[1];else switch(n[2]){case"bool":typeof e[n[0]]=="string"&&(e[n[0]]=$t(e[n[0]]));break;case"int":typeof e[n[0]]=="string"&&(e[n[0]]=parseInt(e[n[0]],10));break}}}function DO(e){A2(e.WBProps,FO),A2(e.CalcPr,SX),N2(e.WBView,_X),N2(e.Sheets,EX),Wl.date1904=$t(e.WBProps.date1904)}var TX="][*?/\\".split("");function kX(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return TX.forEach(function(n){if(e.indexOf(n)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}var NX=/<\w+:workbook/;function AX(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,a="xmlns",s={},i=0;if(e.replace(Qr,function(l,u){var f=Xe(l);switch(ss(f[0])){case"<?xml":break;case"<workbook":l.match(NX)&&(a="xmlns"+l.match(/<(\w+):/)[1]),r.xmlns=f[a];break;case"</workbook>":break;case"<fileVersion":delete f[0],r.AppVersion=f;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":FO.forEach(function(d){if(f[d[0]]!=null)switch(d[2]){case"bool":r.WBProps[d[0]]=$t(f[d[0]]);break;case"int":r.WBProps[d[0]]=parseInt(f[d[0]],10);break;default:r.WBProps[d[0]]=f[d[0]]}}),f.codeName&&(r.WBProps.CodeName=Dt(f.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete f[0],r.WBView.push(f);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(f.state){case"hidden":f.Hidden=1;break;case"veryHidden":f.Hidden=2;break;default:f.Hidden=0}delete f.state,f.name=St(Dt(f.name)),delete f[0],r.Sheets.push(f);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":n=!0;break;case"</definedNames>":n=!1;break;case"<definedName":s={},s.Name=Dt(f.name),f.comment&&(s.Comment=f.comment),f.localSheetId&&(s.Sheet=+f.localSheetId),$t(f.hidden||"0")&&(s.Hidden=!0),i=u+l.length;break;case"</definedName>":s.Ref=St(Dt(e.slice(i,u))),r.Names.push(s);break;case"<definedName/>":break;case"<calcPr":delete f[0],r.CalcPr=f;break;case"<calcPr/>":delete f[0],r.CalcPr=f;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</AlternateContent>":n=!1;break;case"<revisionPtr":break;default:if(!n&&t.WTF)throw new Error("unrecognized "+f[0]+" in workbook")}return l}),VH.indexOf(r.xmlns)===-1)throw new Error("Unknown Namespace: "+r.xmlns);return DO(r),r}function CX(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=Jv(e),r.name=Yr(e),r}function PX(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var a=t>8?Yr(e):"";return a.length>0&&(r.CodeName=a),r.autoCompressPictures=!!(n&65536),r.backupFile=!!(n&64),r.checkCompatibility=!!(n&4096),r.date1904=!!(n&1),r.filterPrivacy=!!(n&8),r.hidePivotFieldList=!!(n&1024),r.promptedSolutions=!!(n&16),r.publishItems=!!(n&2048),r.refreshAllConnections=!!(n&262144),r.saveExternalLinkValues=!!(n&128),r.showBorderUnselectedTables=!!(n&4),r.showInkAnnotation=!!(n&32),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(n&32768),r.updateLinks=["userSet","never","always"][n>>8&3],r}function OX(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function jX(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var a=e.read_shift(4),s=uq(e),i=mY(e,0,r),o=N1(e);e.l=n;var l={Name:s,Ptg:i};return a<268435455&&(l.Sheet=a),o&&(l.Comment=o),l}function RX(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],a=!1;t||(t={}),t.biff=12;var s=[],i=[[]];return i.SheetNames=[],i.XTI=[],_0[16]={n:"BrtFRTArchID$",f:OX},Ls(e,function(l,u,f){switch(f){case 156:i.SheetNames.push(l.name),r.Sheets.push(l);break;case 153:r.WBProps=l;break;case 39:l.Sheet!=null&&(t.SID=l.Sheet),l.Ref=qr(l.Ptg,null,null,i,t),delete t.SID,delete l.Ptg,s.push(l);break;case 1036:break;case 357:case 358:case 355:case 667:i[0].length?i.push([f,l]):i[0]=[f,l],i[i.length-1].XTI=[];break;case 362:i.length===0&&(i[0]=[],i[0].XTI=[]),i[i.length-1].XTI=i[i.length-1].XTI.concat(l),i.XTI=i.XTI.concat(l);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:n.push(f),a=!0;break;case 36:n.pop(),a=!1;break;case 37:n.push(f),a=!0;break;case 38:n.pop(),a=!1;break;case 16:break;default:if(!u.T){if(!a||t.WTF&&n[n.length-1]!=37&&n[n.length-1]!=35)throw new Error("Unexpected record 0x"+f.toString(16))}}},t),DO(r),r.Names=s,r.supbooks=i,r}function IX(e,t,r){return t.slice(-4)===".bin"?RX(e,r):AX(e,r)}function FX(e,t,r,n,a,s,i,o){return t.slice(-4)===".bin"?gX(e,n,r,a,s,i,o):CY(e,n,r,a,s,i,o)}function DX(e,t,r,n,a,s,i,o){return t.slice(-4)===".bin"?bX(e,n,r,a,s):yX(e,n,r,a,s)}function MX(e,t,r,n,a,s,i,o){return t.slice(-4)===".bin"?WG():VG()}function LX(e,t,r,n,a,s,i,o){return t.slice(-4)===".bin"?HG():qG()}function BX(e,t,r,n){return t.slice(-4)===".bin"?iG(e,r,n):eG(e,r,n)}function UX(e,t,r){return _O(e,r)}function $X(e,t,r){return t.slice(-4)===".bin"?_V(e,r):wV(e,r)}function zX(e,t,r){return t.slice(-4)===".bin"?UG(e,r):FG(e,r)}function HX(e,t,r){return t.slice(-4)===".bin"?jG(e):PG(e)}function qX(e,t,r,n){return r.slice(-4)===".bin"?RG(e,t,r,n):void 0}function WX(e,t,r){return t.slice(-4)===".bin"?AG(e,t,r):CG(e,t,r)}var MO=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,LO=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function ha(e,t){var r=e.split(/\s+/),n=[];if(n[0]=r[0],r.length===1)return n;var a=e.match(MO),s,i,o,l;if(a)for(l=0;l!=a.length;++l)s=a[l].match(LO),(i=s[1].indexOf(":"))===-1?n[s[1]]=s[2].slice(1,s[2].length-1):(s[1].slice(0,6)==="xmlns:"?o="xmlns"+s[1].slice(6):o=s[1].slice(i+1),n[o]=s[2].slice(1,s[2].length-1));return n}function VX(e){var t=e.split(/\s+/),r={};if(t.length===1)return r;var n=e.match(MO),a,s,i,o;if(n)for(o=0;o!=n.length;++o)a=n[o].match(LO),(s=a[1].indexOf(":"))===-1?r[a[1]]=a[2].slice(1,a[2].length-1):(a[1].slice(0,6)==="xmlns:"?i="xmlns"+a[1].slice(6):i=a[1].slice(s+1),r[i]=a[2].slice(1,a[2].length-1));return r}var Lu;function GX(e,t){var r=Lu[e]||St(e);return r==="General"?Fo(t):la(r,t)}function KX(e,t,r,n){var a=n;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":a=$t(n);break;case"i2":case"int":a=parseInt(n,10);break;case"r4":case"float":a=parseFloat(n);break;case"date":case"dateTime.tz":a=Er(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[St(t)]=a}function YX(e,t,r){if(e.t!=="z"){if(!r||r.cellText!==!1)try{e.t==="e"?e.w=e.w||Go[e.v]:t==="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=wf(e.v):e.w=Fo(e.v):e.w=GX(t||"General",e.v)}catch(s){if(r.WTF)throw s}try{var n=Lu[t]||t||"General";if(r.cellNF&&(e.z=n),r.cellDates&&e.t=="n"&&Nc(n)){var a=lo(e.v);a&&(e.t="d",e.v=new Date(a.y,a.m-1,a.d,a.H,a.M,a.S,a.u))}}catch(s){if(r.WTF)throw s}}}function XX(e,t,r){if(r.cellStyles&&t.Interior){var n=t.Interior;n.Pattern&&(n.patternType=KV[n.Pattern]||n.Pattern)}e[t.ID]=t}function JX(e,t,r,n,a,s,i,o,l,u){var f="General",d=n.StyleID,h={};u=u||{};var p=[],v=0;for(d===void 0&&o&&(d=o.StyleID),d===void 0&&i&&(d=i.StyleID);s[d]!==void 0&&(s[d].nf&&(f=s[d].nf),s[d].Interior&&p.push(s[d].Interior),!!s[d].Parent);)d=s[d].Parent;switch(r.Type){case"Boolean":n.t="b",n.v=$t(e);break;case"String":n.t="s",n.r=X_(St(e)),n.v=e.indexOf("<")>-1?St(t||e).replace(/<.*?>/g,""):n.r;break;case"DateTime":e.slice(-1)!="Z"&&(e+="Z"),n.v=(Er(e)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3),n.v!==n.v?n.v=St(e):n.v<60&&(n.v=n.v-1),(!f||f=="General")&&(f="yyyy-mm-dd");case"Number":n.v===void 0&&(n.v=+e),n.t||(n.t="n");break;case"Error":n.t="e",n.v=eO[e],u.cellText!==!1&&(n.w=e);break;default:e==""&&t==""?n.t="z":(n.t="s",n.v=X_(t||e));break}if(YX(n,f,u),u.cellFormula!==!1)if(n.Formula){var m=St(n.Formula);m.charCodeAt(0)==61&&(m=m.slice(1)),n.f=ql(m,a),delete n.Formula,n.ArrayRange=="RC"?n.F=ql("RC:RC",a):n.ArrayRange&&(n.F=ql(n.ArrayRange,a),l.push([Zt(n.F),n.F]))}else for(v=0;v<l.length;++v)a.r>=l[v][0].s.r&&a.r<=l[v][0].e.r&&a.c>=l[v][0].s.c&&a.c<=l[v][0].e.c&&(n.F=l[v][1]);u.cellStyles&&(p.forEach(function(g){!h.patternType&&g.patternType&&(h.patternType=g.patternType)}),n.s=h),n.StyleID!==void 0&&(n.ixfe=n.StyleID)}function QX(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,`
`).replace(/\r/g,`
`),e.v=e.w=e.ixfe=void 0}function Vm(e,t){var r=t||{};kP();var n=hu(_1(e));(r.type=="binary"||r.type=="array"||r.type=="base64")&&(n=Dt(n));var a=n.slice(0,1024).toLowerCase(),s=!1;if(a=a.replace(/".*?"/g,""),(a.indexOf(">")&1023)>Math.min(a.indexOf(",")&1023,a.indexOf(";")&1023)){var i=Mr(r);return i.type="string",Ef.to_workbook(n,i)}if(a.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(le){a.indexOf("<"+le)>=0&&(s=!0)}),s)return oJ(n,r);Lu={"General Number":"General","General Date":rt[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":rt[15],"Short Date":rt[14],"Long Time":rt[19],"Medium Time":rt[18],"Short Time":rt[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:rt[2],Standard:rt[4],Percent:rt[10],Scientific:rt[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var o,l=[],u,f={},d=[],h=r.dense?[]:{},p="",v={},m={},g=ha('<Data ss:Type="String">'),x=0,y=0,w=0,b={s:{r:2e6,c:2e6},e:{r:0,c:0}},_={},T={},E="",C=0,P=[],N={},k={},A=0,I=[],M=[],U={},W=[],G,Q=!1,R=[],z=[],D={},O=0,j=0,B={Sheets:[],WBProps:{date1904:!1}},L={};_f.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"");for(var F="";o=_f.exec(n);)switch(o[3]=(F=o[3]).toLowerCase()){case"data":if(F=="data"){if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&l.push([o[3],!0]);break}if(l[l.length-1][1])break;o[1]==="/"?JX(n.slice(x,o.index),E,g,l[l.length-1][0]=="comment"?U:v,{c:y,r:w},_,W[y],m,R,r):(E="",g=ha(o[0]),x=o.index+o[0].length);break;case"cell":if(o[1]==="/")if(M.length>0&&(v.c=M),(!r.sheetRows||r.sheetRows>w)&&v.v!==void 0&&(r.dense?(h[w]||(h[w]=[]),h[w][y]=v):h[mr(y)+Lr(w)]=v),v.HRef&&(v.l={Target:St(v.HRef)},v.HRefScreenTip&&(v.l.Tooltip=v.HRefScreenTip),delete v.HRef,delete v.HRefScreenTip),(v.MergeAcross||v.MergeDown)&&(O=y+(parseInt(v.MergeAcross,10)|0),j=w+(parseInt(v.MergeDown,10)|0),P.push({s:{c:y,r:w},e:{c:O,r:j}})),!r.sheetStubs)v.MergeAcross?y=O+1:++y;else if(v.MergeAcross||v.MergeDown){for(var H=y;H<=O;++H)for(var Z=w;Z<=j;++Z)(H>y||Z>w)&&(r.dense?(h[Z]||(h[Z]=[]),h[Z][H]={t:"z"}):h[mr(H)+Lr(Z)]={t:"z"});y=O+1}else++y;else v=VX(o[0]),v.Index&&(y=+v.Index-1),y<b.s.c&&(b.s.c=y),y>b.e.c&&(b.e.c=y),o[0].slice(-2)==="/>"&&++y,M=[];break;case"row":o[1]==="/"||o[0].slice(-2)==="/>"?(w<b.s.r&&(b.s.r=w),w>b.e.r&&(b.e.r=w),o[0].slice(-2)==="/>"&&(m=ha(o[0]),m.Index&&(w=+m.Index-1)),y=0,++w):(m=ha(o[0]),m.Index&&(w=+m.Index-1),D={},(m.AutoFitHeight=="0"||m.Height)&&(D.hpx=parseInt(m.Height,10),D.hpt=bO(D.hpx),z[w]=D),m.Hidden=="1"&&(D.hidden=!0,z[w]=D));break;case"worksheet":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"));d.push(p),b.s.r<=b.e.r&&b.s.c<=b.e.c&&(h["!ref"]=wt(b),r.sheetRows&&r.sheetRows<=b.e.r&&(h["!fullref"]=h["!ref"],b.e.r=r.sheetRows-1,h["!ref"]=wt(b))),P.length&&(h["!merges"]=P),W.length>0&&(h["!cols"]=W),z.length>0&&(h["!rows"]=z),f[p]=h}else b={s:{r:2e6,c:2e6},e:{r:0,c:0}},w=y=0,l.push([o[3],!1]),u=ha(o[0]),p=St(u.Name),h=r.dense?[]:{},P=[],R=[],z=[],L={name:p,Hidden:0},B.Sheets.push(L);break;case"table":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else{if(o[0].slice(-2)=="/>")break;l.push([o[3],!1]),W=[],Q=!1}break;case"style":o[1]==="/"?XX(_,T,r):T=ha(o[0]);break;case"numberformat":T.nf=St(ha(o[0]).Format||"General"),Lu[T.nf]&&(T.nf=Lu[T.nf]);for(var X=0;X!=392&&rt[X]!=T.nf;++X);if(X==392){for(X=57;X!=392;++X)if(rt[X]==null){Eo(T.nf,X);break}}break;case"column":if(l[l.length-1][0]!=="table")break;if(G=ha(o[0]),G.Hidden&&(G.hidden=!0,delete G.Hidden),G.Width&&(G.wpx=parseInt(G.Width,10)),!Q&&G.wpx>10){Q=!0,on=yO;for(var ne=0;ne<W.length;++ne)W[ne]&&pc(W[ne])}Q&&pc(G),W[G.Index-1||W.length]=G;for(var he=0;he<+G.Span;++he)W[W.length]=Mr(G);break;case"namedrange":if(o[1]==="/")break;B.Names||(B.Names=[]);var V=Xe(o[0]),Te={Name:V.Name,Ref:ql(V.RefersTo.slice(1),{r:0,c:0})};B.Sheets.length>0&&(Te.Sheet=B.Sheets.length-1),B.Names.push(Te);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(o[0].slice(-2)==="/>")break;o[1]==="/"?E+=n.slice(C,o.index):C=o.index+o[0].length;break;case"interior":if(!r.cellStyles)break;T.Interior=ha(o[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(o[0].slice(-2)==="/>")break;o[1]==="/"?Fq(N,F,n.slice(A,o.index)):A=o.index+o[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else l.push([o[3],!1]);break;case"comment":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"));QX(U),M.push(U)}else l.push([o[3],!1]),u=ha(o[0]),U={a:u.Author};break;case"autofilter":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/"){var Ee=ha(o[0]);h["!autofilter"]={ref:ql(Ee.Range).replace(/\$/g,"")},l.push([o[3],!0])}break;case"name":break;case"datavalidation":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&l.push([o[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(o[1]==="/"){if((u=l.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&l.push([o[3],!0]);break;case"null":break;default:if(l.length==0&&o[3]=="document"||l.length==0&&o[3]=="uof")return I2(n,r);var xe=!0;switch(l[l.length-1][0]){case"officedocumentsettings":switch(o[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:xe=!1}break;case"componentoptions":switch(o[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:xe=!1}break;case"excelworkbook":switch(o[3]){case"date1904":B.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:xe=!1}break;case"workbookoptions":switch(o[3]){case"owcversion":break;case"height":break;case"width":break;default:xe=!1}break;case"worksheetoptions":switch(o[3]){case"visible":if(o[0].slice(-2)!=="/>")if(o[1]==="/")switch(n.slice(A,o.index)){case"SheetHidden":L.Hidden=1;break;case"SheetVeryHidden":L.Hidden=2;break}else A=o.index+o[0].length;break;case"header":h["!margins"]||Mu(h["!margins"]={},"xlml"),isNaN(+Xe(o[0]).Margin)||(h["!margins"].header=+Xe(o[0]).Margin);break;case"footer":h["!margins"]||Mu(h["!margins"]={},"xlml"),isNaN(+Xe(o[0]).Margin)||(h["!margins"].footer=+Xe(o[0]).Margin);break;case"pagemargins":var Se=Xe(o[0]);h["!margins"]||Mu(h["!margins"]={},"xlml"),isNaN(+Se.Top)||(h["!margins"].top=+Se.Top),isNaN(+Se.Left)||(h["!margins"].left=+Se.Left),isNaN(+Se.Right)||(h["!margins"].right=+Se.Right),isNaN(+Se.Bottom)||(h["!margins"].bottom=+Se.Bottom);break;case"displayrighttoleft":B.Views||(B.Views=[]),B.Views[0]||(B.Views[0]={}),B.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":h["!outline"]||(h["!outline"]={}),h["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":h["!outline"]||(h["!outline"]={}),h["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:xe=!1}break;case"pivottable":case"pivotcache":switch(o[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:xe=!1}break;case"pagebreaks":switch(o[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:xe=!1}break;case"autofilter":switch(o[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:xe=!1}break;case"querytable":switch(o[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:xe=!1}break;case"datavalidation":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:xe=!1}break;case"sorting":case"conditionalformatting":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:xe=!1}break;case"mapinfo":case"schema":case"data":switch(o[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:xe=!1}break;case"smarttags":break;default:xe=!1;break}if(xe||o[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+o[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(o[0].slice(-2)==="/>")break;o[1]==="/"?KX(k,F,I,n.slice(A,o.index)):(I=o,A=o.index+o[0].length);break}if(r.WTF)throw"Unrecognized tag: "+o[3]+"|"+l.join("|")}var pe={};return!r.bookSheets&&!r.bookProps&&(pe.Sheets=f),pe.SheetNames=d,pe.Workbook=B,pe.SSF=Mr(rt),pe.Props=N,pe.Custprops=k,pe}function tx(e,t){switch(M1(t=t||{}),t.type||"base64"){case"base64":return Vm(qn(e),t);case"binary":case"buffer":case"file":return Vm(e,t);case"array":return Vm(qo(e),t)}}function ZX(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=hq(r),r.length-r.l<=4)return t;var n=r.read_shift(4);if(n==0||n>40||(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4)||(n=r.read_shift(4),n!==1907505652)||(t.UnicodeClipboardFormat=pq(r),n=r.read_shift(4),n==0||n>40))return t;r.l-=4,t.Reserved2=r.read_shift(0,"lpwstr")}var eJ=[60,1084,2066,2165,2175];function tJ(e,t,r,n,a){var s=n,i=[],o=r.slice(r.l,r.l+s);if(a&&a.enc&&a.enc.insitu&&o.length>0)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:a.enc.insitu(o)}i.push(o),r.l+=s;for(var l=bs(r,r.l),u=rx[l],f=0;u!=null&&eJ.indexOf(l)>-1;)s=bs(r,r.l+2),f=r.l+4,l==2066?f+=4:(l==2165||l==2175)&&(f+=12),o=r.slice(f,r.l+4+s),i.push(o),r.l+=4+s,u=rx[l=bs(r,r.l)];var d=ai(i);jr(d,0);var h=0;d.lens=[];for(var p=0;p<i.length;++p)d.lens.push(h),h+=i[p].length;if(d.length<n)throw"XLS Record 0x"+e.toString(16)+" Truncated: "+d.length+" < "+n;return t.f(d,d.length,a)}function $a(e,t,r){if(e.t!=="z"&&e.XF){var n=0;try{n=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=rt[n])}catch(s){if(t.WTF)throw s}if(!t||t.cellText!==!1)try{e.t==="e"?e.w=e.w||Go[e.v]:n===0||n=="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=wf(e.v):e.w=Fo(e.v):e.w=la(n,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(s){if(t.WTF)throw s}if(t.cellDates&&n&&e.t=="n"&&Nc(rt[n]||String(n))){var a=lo(e.v);a&&(e.t="d",e.v=new Date(a.y,a.m-1,a.d,a.H,a.M,a.S,a.u))}}}function qd(e,t,r){return{v:e,ixfe:t,t:r}}function rJ(e,t){var r={opts:{}},n={},a=t.dense?[]:{},s={},i={},o=null,l=[],u="",f={},d,h="",p,v,m,g,x={},y=[],w,b,_=[],T=[],E={Sheets:[],WBProps:{date1904:!1},Views:[{}]},C={},P=function(Re){return Re<8?So[Re]:Re<64&&T[Re-8]||So[Re]},N=function(Re,ot,rr){var kt=ot.XF.data;if(!(!kt||!kt.patternType||!rr||!rr.cellStyles)){ot.s={},ot.s.patternType=kt.patternType;var ie;(ie=Sf(P(kt.icvFore)))&&(ot.s.fgColor={rgb:ie}),(ie=Sf(P(kt.icvBack)))&&(ot.s.bgColor={rgb:ie})}},k=function(Re,ot,rr){if(!(D>1)&&!(rr.sheetRows&&Re.r>=rr.sheetRows)){if(rr.cellStyles&&ot.XF&&ot.XF.data&&N(Re,ot,rr),delete ot.ixfe,delete ot.XF,d=Re,h=et(Re),(!i||!i.s||!i.e)&&(i={s:{r:0,c:0},e:{r:0,c:0}}),Re.r<i.s.r&&(i.s.r=Re.r),Re.c<i.s.c&&(i.s.c=Re.c),Re.r+1>i.e.r&&(i.e.r=Re.r+1),Re.c+1>i.e.c&&(i.e.c=Re.c+1),rr.cellFormula&&ot.f){for(var kt=0;kt<y.length;++kt)if(!(y[kt][0].s.c>Re.c||y[kt][0].s.r>Re.r)&&!(y[kt][0].e.c<Re.c||y[kt][0].e.r<Re.r)){ot.F=wt(y[kt][0]),(y[kt][0].s.c!=Re.c||y[kt][0].s.r!=Re.r)&&delete ot.f,ot.f&&(ot.f=""+qr(y[kt][1],i,Re,R,A));break}}rr.dense?(a[Re.r]||(a[Re.r]=[]),a[Re.r][Re.c]=ot):a[h]=ot}},A={enc:!1,sbcch:0,snames:[],sharedf:x,arrayf:y,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf};t.password&&(A.password=t.password);var I,M=[],U=[],W=[],G=[],Q=!1,R=[];R.SheetNames=A.snames,R.sharedf=A.sharedf,R.arrayf=A.arrayf,R.names=[],R.XTI=[];var z=0,D=0,O=0,j=[],B=[],L;A.codepage=1200,Na(1200);for(var F=!1;e.l<e.length-1;){var H=e.l,Z=e.read_shift(2);if(Z===0&&z===10)break;var X=e.l===e.length?0:e.read_shift(2),ne=rx[Z];if(ne&&ne.f){if(t.bookSheets&&z===133&&Z!==133)break;if(z=Z,ne.r===2||ne.r==12){var he=e.read_shift(2);if(X-=2,!A.enc&&he!==Z&&((he&255)<<8|he>>8)!==Z)throw new Error("rt mismatch: "+he+"!="+Z);ne.r==12&&(e.l+=10,X-=10)}var V={};if(Z===10?V=ne.f(e,X,A):V=tJ(Z,ne,e,X,A),D==0&&[9,521,1033,2057].indexOf(z)===-1)continue;switch(Z){case 34:r.opts.Date1904=E.WBProps.date1904=V;break;case 134:r.opts.WriteProtect=!0;break;case 47:if(A.enc||(e.l=0),A.enc=V,!t.password)throw new Error("File is password-protected");if(V.valid==null)throw new Error("Encryption scheme unsupported");if(!V.valid)throw new Error("Password is incorrect");break;case 92:A.lastuser=V;break;case 66:var Te=Number(V);switch(Te){case 21010:Te=1200;break;case 32768:Te=1e4;break;case 32769:Te=1252;break}Na(A.codepage=Te),F=!0;break;case 317:A.rrtabid=V;break;case 25:A.winlocked=V;break;case 439:r.opts.RefreshAll=V;break;case 12:r.opts.CalcCount=V;break;case 16:r.opts.CalcDelta=V;break;case 17:r.opts.CalcIter=V;break;case 13:r.opts.CalcMode=V;break;case 14:r.opts.CalcPrecision=V;break;case 95:r.opts.CalcSaveRecalc=V;break;case 15:A.CalcRefMode=V;break;case 2211:r.opts.FullCalc=V;break;case 129:V.fDialog&&(a["!type"]="dialog"),V.fBelow||((a["!outline"]||(a["!outline"]={})).above=!0),V.fRight||((a["!outline"]||(a["!outline"]={})).left=!0);break;case 224:_.push(V);break;case 430:R.push([V]),R[R.length-1].XTI=[];break;case 35:case 547:R[R.length-1].push(V);break;case 24:case 536:L={Name:V.Name,Ref:qr(V.rgce,i,null,R,A)},V.itab>0&&(L.Sheet=V.itab-1),R.names.push(L),R[0]||(R[0]=[],R[0].XTI=[]),R[R.length-1].push(V),V.Name=="_xlnm._FilterDatabase"&&V.itab>0&&V.rgce&&V.rgce[0]&&V.rgce[0][0]&&V.rgce[0][0][0]=="PtgArea3d"&&(B[V.itab-1]={ref:wt(V.rgce[0][0][1][2])});break;case 22:A.ExternCount=V;break;case 23:R.length==0&&(R[0]=[],R[0].XTI=[]),R[R.length-1].XTI=R[R.length-1].XTI.concat(V),R.XTI=R.XTI.concat(V);break;case 2196:if(A.biff<8)break;L!=null&&(L.Comment=V[1]);break;case 18:a["!protect"]=V;break;case 19:V!==0&&A.WTF&&console.error("Password verifier: "+V);break;case 133:s[V.pos]=V,A.snames.push(V.name);break;case 10:{if(--D)break;if(i.e){if(i.e.r>0&&i.e.c>0){if(i.e.r--,i.e.c--,a["!ref"]=wt(i),t.sheetRows&&t.sheetRows<=i.e.r){var Ee=i.e.r;i.e.r=t.sheetRows-1,a["!fullref"]=a["!ref"],a["!ref"]=wt(i),i.e.r=Ee}i.e.r++,i.e.c++}M.length>0&&(a["!merges"]=M),U.length>0&&(a["!objects"]=U),W.length>0&&(a["!cols"]=W),G.length>0&&(a["!rows"]=G),E.Sheets.push(C)}u===""?f=a:n[u]=a,a=t.dense?[]:{}}break;case 9:case 521:case 1033:case 2057:{if(A.biff===8&&(A.biff={9:2,521:3,1033:4}[Z]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[V.BIFFVer]||8),A.biffguess=V.BIFFVer==0,V.BIFFVer==0&&V.dt==4096&&(A.biff=5,F=!0,Na(A.codepage=28591)),A.biff==8&&V.BIFFVer==0&&V.dt==16&&(A.biff=2),D++)break;if(a=t.dense?[]:{},A.biff<8&&!F&&(F=!0,Na(A.codepage=t.codepage||1252)),A.biff<5||V.BIFFVer==0&&V.dt==4096){u===""&&(u="Sheet1"),i={s:{r:0,c:0},e:{r:0,c:0}};var xe={pos:e.l-X,name:u};s[xe.pos]=xe,A.snames.push(u)}else u=(s[H]||{name:""}).name;V.dt==32&&(a["!type"]="chart"),V.dt==64&&(a["!type"]="macro"),M=[],U=[],A.arrayf=y=[],W=[],G=[],Q=!1,C={Hidden:(s[H]||{hs:0}).hs,name:u}}break;case 515:case 3:case 2:a["!type"]=="chart"&&(t.dense?(a[V.r]||[])[V.c]:a[et({c:V.c,r:V.r})])&&++V.c,w={ixfe:V.ixfe,XF:_[V.ixfe]||{},v:V.val,t:"n"},O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:V.c,r:V.r},w,t);break;case 5:case 517:w={ixfe:V.ixfe,XF:_[V.ixfe],v:V.val,t:V.t},O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:V.c,r:V.r},w,t);break;case 638:w={ixfe:V.ixfe,XF:_[V.ixfe],v:V.rknum,t:"n"},O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:V.c,r:V.r},w,t);break;case 189:for(var Se=V.c;Se<=V.C;++Se){var pe=V.rkrec[Se-V.c][0];w={ixfe:pe,XF:_[pe],v:V.rkrec[Se-V.c][1],t:"n"},O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:Se,r:V.r},w,t)}break;case 6:case 518:case 1030:{if(V.val=="String"){o=V;break}if(w=qd(V.val,V.cell.ixfe,V.tt),w.XF=_[w.ixfe],t.cellFormula){var le=V.formula;if(le&&le[0]&&le[0][0]&&le[0][0][0]=="PtgExp"){var ue=le[0][0][1][0],me=le[0][0][1][1],_e=et({r:ue,c:me});x[_e]?w.f=""+qr(V.formula,i,V.cell,R,A):w.F=((t.dense?(a[ue]||[])[me]:a[_e])||{}).F}else w.f=""+qr(V.formula,i,V.cell,R,A)}O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k(V.cell,w,t),o=V}break;case 7:case 519:if(o)o.val=V,w=qd(V,o.cell.ixfe,"s"),w.XF=_[w.ixfe],t.cellFormula&&(w.f=""+qr(o.formula,i,o.cell,R,A)),O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k(o.cell,w,t),o=null;else throw new Error("String record expects Formula");break;case 33:case 545:{y.push(V);var ye=et(V[0].s);if(p=t.dense?(a[V[0].s.r]||[])[V[0].s.c]:a[ye],t.cellFormula&&p){if(!o||!ye||!p)break;p.f=""+qr(V[1],i,V[0],R,A),p.F=wt(V[0])}}break;case 1212:{if(!t.cellFormula)break;if(h){if(!o)break;x[et(o.cell)]=V[0],p=t.dense?(a[o.cell.r]||[])[o.cell.c]:a[et(o.cell)],(p||{}).f=""+qr(V[0],i,d,R,A)}}break;case 253:w=qd(l[V.isst].t,V.ixfe,"s"),l[V.isst].h&&(w.h=l[V.isst].h),w.XF=_[w.ixfe],O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:V.c,r:V.r},w,t);break;case 513:t.sheetStubs&&(w={ixfe:V.ixfe,XF:_[V.ixfe],t:"z"},O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:V.c,r:V.r},w,t));break;case 190:if(t.sheetStubs)for(var Me=V.c;Me<=V.C;++Me){var Le=V.ixfe[Me-V.c];w={ixfe:Le,XF:_[Le],t:"z"},O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:Me,r:V.r},w,t)}break;case 214:case 516:case 4:w=qd(V.val,V.ixfe,"s"),w.XF=_[w.ixfe],O>0&&(w.z=j[w.ixfe>>8&63]),$a(w,t,r.opts.Date1904),k({c:V.c,r:V.r},w,t);break;case 0:case 512:D===1&&(i=V);break;case 252:l=V;break;case 1054:if(A.biff==4){j[O++]=V[1];for(var $e=0;$e<O+163&&rt[$e]!=V[1];++$e);$e>=163&&Eo(V[1],O+163)}else Eo(V[1],V[0]);break;case 30:{j[O++]=V;for(var tt=0;tt<O+163&&rt[tt]!=V;++tt);tt>=163&&Eo(V,O+163)}break;case 229:M=M.concat(V);break;case 93:U[V.cmo[0]]=A.lastobj=V;break;case 438:A.lastobj.TxO=V;break;case 127:A.lastobj.ImData=V;break;case 440:for(g=V[0].s.r;g<=V[0].e.r;++g)for(m=V[0].s.c;m<=V[0].e.c;++m)p=t.dense?(a[g]||[])[m]:a[et({c:m,r:g})],p&&(p.l=V[1]);break;case 2048:for(g=V[0].s.r;g<=V[0].e.r;++g)for(m=V[0].s.c;m<=V[0].e.c;++m)p=t.dense?(a[g]||[])[m]:a[et({c:m,r:g})],p&&p.l&&(p.l.Tooltip=V[1]);break;case 28:{if(A.biff<=5&&A.biff>=2)break;p=t.dense?(a[V[0].r]||[])[V[0].c]:a[et(V[0])];var dt=U[V[2]];p||(t.dense?(a[V[0].r]||(a[V[0].r]=[]),p=a[V[0].r][V[0].c]={t:"z"}):p=a[et(V[0])]={t:"z"},i.e.r=Math.max(i.e.r,V[0].r),i.s.r=Math.min(i.s.r,V[0].r),i.e.c=Math.max(i.e.c,V[0].c),i.s.c=Math.min(i.s.c,V[0].c)),p.c||(p.c=[]),v={a:V[1],t:dt.TxO.t},p.c.push(v)}break;case 2173:SG(_[V.ixfe],V.ext);break;case 125:{if(!A.cellStyles)break;for(;V.e>=V.s;)W[V.e--]={width:V.w/256,level:V.level||0,hidden:!!(V.flags&1)},Q||(Q=!0,j1(V.w/256)),pc(W[V.e+1])}break;case 520:{var Je={};V.level!=null&&(G[V.r]=Je,Je.level=V.level),V.hidden&&(G[V.r]=Je,Je.hidden=!0),V.hpt&&(G[V.r]=Je,Je.hpt=V.hpt,Je.hpx=Tf(V.hpt))}break;case 38:case 39:case 40:case 41:a["!margins"]||Mu(a["!margins"]={}),a["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[Z]]=V;break;case 161:a["!margins"]||Mu(a["!margins"]={}),a["!margins"].header=V.header,a["!margins"].footer=V.footer;break;case 574:V.RTL&&(E.Views[0].RTL=!0);break;case 146:T=V;break;case 2198:I=V;break;case 140:b=V;break;case 442:u?C.CodeName=V||C.name:E.WBProps.CodeName=V||"ThisWorkbook";break}}else ne||console.error("Missing Info for XLS Record 0x"+Z.toString(16)),e.l+=X}return r.SheetNames=ns(s).sort(function(ur,Re){return Number(ur)-Number(Re)}).map(function(ur){return s[ur].name}),t.bookSheets||(r.Sheets=n),!r.SheetNames.length&&f["!ref"]?(r.SheetNames.push("Sheet1"),r.Sheets&&(r.Sheets.Sheet1=f)):r.Preamble=f,r.Sheets&&B.forEach(function(ur,Re){r.Sheets[r.SheetNames[Re]]["!autofilter"]=ur}),r.Strings=l,r.SSF=Mr(rt),A.enc&&(r.Encryption=A.enc),I&&(r.Themes=I),r.Metadata={},b!==void 0&&(r.Metadata.Country=b),R.names.length>0&&(E.Names=R.names),r.Workbook=E,r}var C2={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function nJ(e,t,r){var n=yt.find(e,"/!DocumentSummaryInformation");if(n&&n.size>0)try{var a=d2(n,wq,C2.DSI);for(var s in a)t[s]=a[s]}catch(u){if(r.WTF)throw u}var i=yt.find(e,"/!SummaryInformation");if(i&&i.size>0)try{var o=d2(i,bq,C2.SI);for(var l in o)t[l]==null&&(t[l]=o[l])}catch(u){if(r.WTF)throw u}t.HeadingPairs&&t.TitlesOfParts&&(rO(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function BO(e,t){t||(t={}),M1(t),pP(),t.codepage&&m1(t.codepage);var r,n;if(e.FullPaths){if(yt.find(e,"/encryption"))throw new Error("File is password-protected");r=yt.find(e,"!CompObj"),n=yt.find(e,"/Workbook")||yt.find(e,"/Book")}else{switch(t.type){case"base64":e=ka(qn(e));break;case"binary":e=ka(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e));break}jr(e,0),n={content:e}}var a,s;if(r&&ZX(r),t.bookProps&&!t.bookSheets)a={};else{var i=gt?"buffer":"array";if(n&&n.content)a=rJ(n.content,t);else if((s=yt.find(e,"PerfectOffice_MAIN"))&&s.content)a=Fu.to_workbook(s.content,(t.type=i,t));else if((s=yt.find(e,"NativeContent_MAIN"))&&s.content)a=Fu.to_workbook(s.content,(t.type=i,t));else throw(s=yt.find(e,"MN0"))&&s.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");t.bookVBA&&e.FullPaths&&yt.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(a.vbaraw=zG(e))}var o={};return e.FullPaths&&nJ(e,o,t),a.Props=a.Custprops=o,t.bookFiles&&(a.cfb=e),a}var _0={0:{f:LY},1:{f:zY},2:{f:JY},3:{f:VY},4:{f:qY},5:{f:XY},6:{f:eX},7:{f:KY},8:{f:sX},9:{f:aX},10:{f:rX},11:{f:nX},12:{f:HY},13:{f:QY},14:{f:GY},15:{f:WY},16:{f:IO},17:{f:tX},18:{f:YY},19:{f:k1},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:jX},40:{},42:{},43:{f:rG},44:{f:tG},45:{f:nG},46:{f:sG},47:{f:aG},48:{},49:{f:iq},50:{},51:{f:kG},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:pO},62:{f:ZY},63:{f:OG},64:{f:pX},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Jr,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:hX},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:$Y},148:{f:BY,p:16},151:{f:lX},152:{},153:{f:PX},154:{},155:{},156:{f:CX},157:{},158:{},159:{T:1,f:bV},160:{T:-1},161:{T:1,f:Vo},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:iX},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:TG},336:{T:-1},337:{f:NG,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:Jv},357:{},358:{},359:{},360:{T:1},361:{},362:{f:hO},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:cX},427:{f:uX},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:dX},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:UY},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:oX},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:Jv},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:BG},633:{T:1},634:{T:-1},635:{T:1,f:LG},636:{T:-1},637:{f:lq},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:wX},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:mX},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:""}},rx={6:{f:qm},10:{f:qs},12:{f:ir},13:{f:ir},14:{f:er},15:{f:er},16:{f:Vr},17:{f:er},18:{f:er},19:{f:ir},20:{f:g2},21:{f:g2},23:{f:hO},24:{f:x2},25:{f:er},26:{},27:{},28:{f:DW},29:{},34:{f:er},35:{f:v2},38:{f:Vr},39:{f:Vr},40:{f:Vr},41:{f:Vr},42:{f:er},43:{f:er},47:{f:UV},49:{f:vW},51:{f:ir},60:{},61:{f:pW},64:{f:er},65:{f:gW},66:{f:ir},77:{},80:{},81:{},82:{},85:{f:ir},89:{},90:{},91:{},92:{f:iW},93:{f:LW},94:{},95:{f:er},96:{},97:{},99:{f:er},125:{f:pO},128:{f:NW},129:{f:oW},130:{f:ir},131:{f:er},132:{f:er},133:{f:lW},134:{},140:{f:qW},141:{f:ir},144:{},146:{f:VW},151:{},152:{},153:{},154:{},155:{},156:{f:ir},157:{},158:{},160:{f:JW},161:{f:KW},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:EW},190:{f:SW},193:{f:qs},197:{},198:{},199:{},200:{},201:{},202:{f:er},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:ir},220:{},221:{f:er},222:{},224:{f:kW},225:{f:sW},226:{f:qs},227:{},229:{f:MW},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:cW},253:{f:xW},255:{f:uW},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:oO},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:er},353:{f:qs},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:CW},431:{f:er},432:{},433:{},434:{},437:{},438:{f:$W},439:{f:er},440:{f:zW},441:{},442:{f:Zf},443:{},444:{f:ir},445:{},446:{},448:{f:qs},449:{f:hW,r:2},450:{f:qs},512:{f:p2},513:{f:XW},515:{f:AW},516:{f:yW},517:{f:m2},519:{f:QW},520:{f:fW},523:{},545:{f:y2},549:{f:h2},566:{},574:{f:mW},638:{f:_W},659:{},1048:{},1054:{f:wW},1084:{},1212:{f:RW},2048:{f:HW},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:$d},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:qs},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:GW,r:12},2173:{f:EG,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:er,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:jW,r:12},2197:{},2198:{f:vG,r:12},2199:{},2200:{},2201:{},2202:{f:IW,r:12},2203:{f:qs},2204:{},2205:{},2206:{},2207:{},2211:{f:dW},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:ir},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:YW},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:WW},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:p2},1:{},2:{f:rV},3:{f:tV},4:{f:eV},5:{f:m2},7:{f:nV},8:{},9:{f:$d},11:{},22:{f:ir},30:{f:bW},31:{},32:{},33:{f:y2},36:{},37:{f:h2},50:{f:aV},62:{},52:{},67:{},68:{f:ir},69:{},86:{},126:{},127:{f:ZW},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:sV},223:{},234:{},354:{},421:{},518:{f:qm},521:{f:$d},536:{f:x2},547:{f:v2},561:{},579:{},1030:{f:qm},1033:{f:$d},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function pa(e,t,r,n){var a=t;if(!isNaN(a)){var s=(r||[]).length||0,i=e.next(4);i.write_shift(2,a),i.write_shift(2,s),s>0&&KP(r)&&e.push(r)}}function P2(e,t){var r=t||{},n=r.dense?[]:{};e=e.replace(/<!--.*?-->/g,"");var a=e.match(/<table/i);if(!a)throw new Error("Invalid HTML: could not find <table>");var s=e.match(/<\/table/i),i=a.index,o=s&&s.index||e.length,l=AH(e.slice(i,o),/(:?<tr[^>]*>)/i,"<tr>"),u=-1,f=0,d=0,h=0,p={s:{r:1e7,c:1e7},e:{r:0,c:0}},v=[];for(i=0;i<l.length;++i){var m=l[i].trim(),g=m.slice(0,3).toLowerCase();if(g=="<tr"){if(++u,r.sheetRows&&r.sheetRows<=u){--u;break}f=0;continue}if(!(g!="<td"&&g!="<th")){var x=m.split(/<\/t[dh]>/i);for(o=0;o<x.length;++o){var y=x[o].trim();if(y.match(/<t[dh]/i)){for(var w=y,b=0;w.charAt(0)=="<"&&(b=w.indexOf(">"))>-1;)w=w.slice(b+1);for(var _=0;_<v.length;++_){var T=v[_];T.s.c==f&&T.s.r<u&&u<=T.e.r&&(f=T.e.c+1,_=-1)}var E=Xe(y.slice(0,y.indexOf(">")));h=E.colspan?+E.colspan:1,((d=+E.rowspan)>1||h>1)&&v.push({s:{r:u,c:f},e:{r:u+(d||1)-1,c:f+h-1}});var C=E.t||E["data-t"]||"";if(!w.length){f+=h;continue}if(w=FP(w),p.s.r>u&&(p.s.r=u),p.e.r<u&&(p.e.r=u),p.s.c>f&&(p.s.c=f),p.e.c<f&&(p.e.c=f),!w.length){f+=h;continue}var P={t:"s",v:w};r.raw||!w.trim().length||C=="s"||(w==="TRUE"?P={t:"b",v:!0}:w==="FALSE"?P={t:"b",v:!1}:isNaN(ja(w))?isNaN(hc(w).getDate())||(P={t:"d",v:Er(w)},r.cellDates||(P={t:"n",v:pn(P.v)}),P.z=r.dateNF||rt[14]):P={t:"n",v:ja(w)}),r.dense?(n[u]||(n[u]=[]),n[u][f]=P):n[et({r:u,c:f})]=P,f+=h}}}}return n["!ref"]=wt(p),v.length&&(n["!merges"]=v),n}function aJ(e,t,r,n){for(var a=e["!merges"]||[],s=[],i=t.s.c;i<=t.e.c;++i){for(var o=0,l=0,u=0;u<a.length;++u)if(!(a[u].s.r>r||a[u].s.c>i)&&!(a[u].e.r<r||a[u].e.c<i)){if(a[u].s.r<r||a[u].s.c<i){o=-1;break}o=a[u].e.r-a[u].s.r+1,l=a[u].e.c-a[u].s.c+1;break}if(!(o<0)){var f=et({r,c:i}),d=n.dense?(e[r]||[])[i]:e[f],h=d&&d.v!=null&&(d.h||b1(d.w||(js(d),d.w)||""))||"",p={};o>1&&(p.rowspan=o),l>1&&(p.colspan=l),n.editable?h='<span contenteditable="true">'+h+"</span>":d&&(p["data-t"]=d&&d.t||"z",d.v!=null&&(p["data-v"]=d.v),d.z!=null&&(p["data-z"]=d.z),d.l&&(d.l.Target||"#").charAt(0)!="#"&&(h='<a href="'+d.l.Target+'">'+h+"</a>")),p.id=(n.id||"sjs")+"-"+f,s.push(qH("td",h,p))}}var v="<tr>";return v+s.join("")+"</tr>"}var sJ='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',iJ="</body></html>";function oJ(e,t){var r=e.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||r.length==0)throw new Error("Invalid HTML: could not find <table>");if(r.length==1)return Wi(P2(r[0],t),t);var n=B1();return r.forEach(function(a,s){U1(n,P2(a,t),"Sheet"+(s+1))}),n}function lJ(e,t,r){var n=[];return n.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function cJ(e,t){var r=t||{},n=r.header!=null?r.header:sJ,a=r.footer!=null?r.footer:iJ,s=[n],i=Ac(e["!ref"]);r.dense=Array.isArray(e),s.push(lJ(e,i,r));for(var o=i.s.r;o<=i.e.r;++o)s.push(aJ(e,i,o,r));return s.push("</table>"+a),s.join("")}function UO(e,t,r){var n=r||{},a=0,s=0;if(n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var i=typeof n.origin=="string"?un(n.origin):n.origin;a=i.r,s=i.c}var o=t.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,o.length),u={s:{r:0,c:0},e:{r:a,c:s}};if(e["!ref"]){var f=Ac(e["!ref"]);u.s.r=Math.min(u.s.r,f.s.r),u.s.c=Math.min(u.s.c,f.s.c),u.e.r=Math.max(u.e.r,f.e.r),u.e.c=Math.max(u.e.c,f.e.c),a==-1&&(u.e.r=a=f.e.r+1)}var d=[],h=0,p=e["!rows"]||(e["!rows"]=[]),v=0,m=0,g=0,x=0,y=0,w=0;for(e["!cols"]||(e["!cols"]=[]);v<o.length&&m<l;++v){var b=o[v];if(O2(b)){if(n.display)continue;p[m]={hidden:!0}}var _=b.children;for(g=x=0;g<_.length;++g){var T=_[g];if(!(n.display&&O2(T))){var E=T.hasAttribute("data-v")?T.getAttribute("data-v"):T.hasAttribute("v")?T.getAttribute("v"):FP(T.innerHTML),C=T.getAttribute("data-z")||T.getAttribute("z");for(h=0;h<d.length;++h){var P=d[h];P.s.c==x+s&&P.s.r<m+a&&m+a<=P.e.r&&(x=P.e.c+1-s,h=-1)}w=+T.getAttribute("colspan")||1,((y=+T.getAttribute("rowspan")||1)>1||w>1)&&d.push({s:{r:m+a,c:x+s},e:{r:m+a+(y||1)-1,c:x+s+(w||1)-1}});var N={t:"s",v:E},k=T.getAttribute("data-t")||T.getAttribute("t")||"";E!=null&&(E.length==0?N.t=k||"z":n.raw||E.trim().length==0||k=="s"||(E==="TRUE"?N={t:"b",v:!0}:E==="FALSE"?N={t:"b",v:!1}:isNaN(ja(E))?isNaN(hc(E).getDate())||(N={t:"d",v:Er(E)},n.cellDates||(N={t:"n",v:pn(N.v)}),N.z=n.dateNF||rt[14]):N={t:"n",v:ja(E)})),N.z===void 0&&C!=null&&(N.z=C);var A="",I=T.getElementsByTagName("A");if(I&&I.length)for(var M=0;M<I.length&&!(I[M].hasAttribute("href")&&(A=I[M].getAttribute("href"),A.charAt(0)!="#"));++M);A&&A.charAt(0)!="#"&&(N.l={Target:A}),n.dense?(e[m+a]||(e[m+a]=[]),e[m+a][x+s]=N):e[et({c:x+s,r:m+a})]=N,u.e.c<x+s&&(u.e.c=x+s),x+=w}}++m}return d.length&&(e["!merges"]=(e["!merges"]||[]).concat(d)),u.e.r=Math.max(u.e.r,m-1+a),e["!ref"]=wt(u),m>=l&&(e["!fullref"]=wt((u.e.r=o.length-v+m-1+a,u))),e}function $O(e,t){var r=t||{},n=r.dense?[]:{};return UO(n,e,t)}function uJ(e,t){return Wi($O(e,t),t)}function O2(e){var t="",r=fJ(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function fJ(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function dJ(e){var t=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(n,a){return Array(parseInt(a,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,`
`),r=St(t.replace(/<[^>]*>/g,""));return[r]}var j2={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function zO(e,t){var r=t||{},n=_1(e),a=[],s,i,o={name:""},l="",u=0,f,d,h={},p=[],v=r.dense?[]:{},m,g,x={value:""},y="",w=0,b=[],_=-1,T=-1,E={s:{r:1e6,c:1e7},e:{r:0,c:0}},C=0,P={},N=[],k={},A=0,I=0,M=[],U=1,W=1,G=[],Q={Names:[]},R={},z=["",""],D=[],O={},j="",B=0,L=!1,F=!1,H=0;for(_f.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");m=_f.exec(n);)switch(m[3]=m[3].replace(/_.*$/,"")){case"table":case"工作表":m[1]==="/"?(E.e.c>=E.s.c&&E.e.r>=E.s.r?v["!ref"]=wt(E):v["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=E.e.r&&(v["!fullref"]=v["!ref"],E.e.r=r.sheetRows-1,v["!ref"]=wt(E)),N.length&&(v["!merges"]=N),M.length&&(v["!rows"]=M),f.name=f.名称||f.name,typeof JSON<"u"&&JSON.stringify(f),p.push(f.name),h[f.name]=v,F=!1):m[0].charAt(m[0].length-2)!=="/"&&(f=Xe(m[0],!1),_=T=-1,E.s.r=E.s.c=1e7,E.e.r=E.e.c=0,v=r.dense?[]:{},N=[],M=[],F=!0);break;case"table-row-group":m[1]==="/"?--C:++C;break;case"table-row":case"行":if(m[1]==="/"){_+=U,U=1;break}if(d=Xe(m[0],!1),d.行号?_=d.行号-1:_==-1&&(_=0),U=+d["number-rows-repeated"]||1,U<10)for(H=0;H<U;++H)C>0&&(M[_+H]={level:C});T=-1;break;case"covered-table-cell":m[1]!=="/"&&++T,r.sheetStubs&&(r.dense?(v[_]||(v[_]=[]),v[_][T]={t:"z"}):v[et({r:_,c:T})]={t:"z"}),y="",b=[];break;case"table-cell":case"数据":if(m[0].charAt(m[0].length-2)==="/")++T,x=Xe(m[0],!1),W=parseInt(x["number-columns-repeated"]||"1",10),g={t:"z",v:null},x.formula&&r.cellFormula!=!1&&(g.f=k2(St(x.formula))),(x.数据类型||x["value-type"])=="string"&&(g.t="s",g.v=St(x["string-value"]||""),r.dense?(v[_]||(v[_]=[]),v[_][T]=g):v[et({r:_,c:T})]=g),T+=W-1;else if(m[1]!=="/"){++T,y="",w=0,b=[],W=1;var Z=U?_+U-1:_;if(T>E.e.c&&(E.e.c=T),T<E.s.c&&(E.s.c=T),_<E.s.r&&(E.s.r=_),Z>E.e.r&&(E.e.r=Z),x=Xe(m[0],!1),D=[],O={},g={t:x.数据类型||x["value-type"],v:null},r.cellFormula)if(x.formula&&(x.formula=St(x.formula)),x["number-matrix-columns-spanned"]&&x["number-matrix-rows-spanned"]&&(A=parseInt(x["number-matrix-rows-spanned"],10)||0,I=parseInt(x["number-matrix-columns-spanned"],10)||0,k={s:{r:_,c:T},e:{r:_+A-1,c:T+I-1}},g.F=wt(k),G.push([k,g.F])),x.formula)g.f=k2(x.formula);else for(H=0;H<G.length;++H)_>=G[H][0].s.r&&_<=G[H][0].e.r&&T>=G[H][0].s.c&&T<=G[H][0].e.c&&(g.F=G[H][1]);switch((x["number-columns-spanned"]||x["number-rows-spanned"])&&(A=parseInt(x["number-rows-spanned"],10)||0,I=parseInt(x["number-columns-spanned"],10)||0,k={s:{r:_,c:T},e:{r:_+A-1,c:T+I-1}},N.push(k)),x["number-columns-repeated"]&&(W=parseInt(x["number-columns-repeated"],10)),g.t){case"boolean":g.t="b",g.v=$t(x["boolean-value"]);break;case"float":g.t="n",g.v=parseFloat(x.value);break;case"percentage":g.t="n",g.v=parseFloat(x.value);break;case"currency":g.t="n",g.v=parseFloat(x.value);break;case"date":g.t="d",g.v=Er(x["date-value"]),r.cellDates||(g.t="n",g.v=pn(g.v)),g.z="m/d/yy";break;case"time":g.t="n",g.v=TH(x["time-value"])/86400,r.cellDates&&(g.t="d",g.v=_p(g.v)),g.z="HH:MM:SS";break;case"number":g.t="n",g.v=parseFloat(x.数据数值);break;default:if(g.t==="string"||g.t==="text"||!g.t)g.t="s",x["string-value"]!=null&&(y=St(x["string-value"]),b=[]);else throw new Error("Unsupported value type "+g.t)}}else{if(L=!1,g.t==="s"&&(g.v=y||"",b.length&&(g.R=b),L=w==0),R.Target&&(g.l=R),D.length>0&&(g.c=D,D=[]),y&&r.cellText!==!1&&(g.w=y),L&&(g.t="z",delete g.v),(!L||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=_))for(var X=0;X<U;++X){if(W=parseInt(x["number-columns-repeated"]||"1",10),r.dense)for(v[_+X]||(v[_+X]=[]),v[_+X][T]=X==0?g:Mr(g);--W>0;)v[_+X][T+W]=Mr(g);else for(v[et({r:_+X,c:T})]=g;--W>0;)v[et({r:_+X,c:T+W})]=Mr(g);E.e.c<=T&&(E.e.c=T)}W=parseInt(x["number-columns-repeated"]||"1",10),T+=W-1,W=0,g={},y="",b=[]}R={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(m[1]==="/"){if((s=a.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&a.push([m[3],!0]);break;case"annotation":if(m[1]==="/"){if((s=a.pop())[0]!==m[3])throw"Bad state: "+s;O.t=y,b.length&&(O.R=b),O.a=j,D.push(O)}else m[0].charAt(m[0].length-2)!=="/"&&a.push([m[3],!1]);j="",B=0,y="",w=0,b=[];break;case"creator":m[1]==="/"?j=n.slice(B,m.index):B=m.index+m[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(m[1]==="/"){if((s=a.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&a.push([m[3],!1]);y="",w=0,b=[];break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if(m[1]==="/"){if(P[o.name]=l,(s=a.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&(l="",o=Xe(m[0],!1),a.push([m[3],!0]));break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(a[a.length-1][0]){case"time-style":case"date-style":i=Xe(m[0],!1),l+=j2[m[3]][i.style==="long"?1:0];break}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(a[a.length-1][0]){case"time-style":case"date-style":i=Xe(m[0],!1),l+=j2[m[3]][i.style==="long"?1:0];break}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(m[0].slice(-2)==="/>")break;if(m[1]==="/")switch(a[a.length-1][0]){case"number-style":case"date-style":case"time-style":l+=n.slice(u,m.index);break}else u=m.index+m[0].length;break;case"named-range":i=Xe(m[0],!1),z=Wm(i["cell-range-address"]);var ne={Name:i.name,Ref:z[0]+"!"+z[1]};F&&(ne.Sheet=p.length),Q.Names.push(ne);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"文本串":if(["master-styles"].indexOf(a[a.length-1][0])>-1)break;if(m[1]==="/"&&(!x||!x["string-value"])){var he=dJ(n.slice(w,m.index));y=(y.length>0?y+`
`:"")+he[0]}else Xe(m[0],!1),w=m.index+m[0].length;break;case"s":break;case"database-range":if(m[1]==="/")break;try{z=Wm(Xe(m[0])["target-range-address"]),h[z[0]]["!autofilter"]={ref:z[1]}}catch{}break;case"date":break;case"object":break;case"title":case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(m[1]!=="/"){if(R=Xe(m[0],!1),!R.href)break;R.Target=St(R.href),delete R.href,R.Target.charAt(0)=="#"&&R.Target.indexOf(".")>-1?(z=Wm(R.Target.slice(1)),R.Target="#"+z[0]+"!"+z[1]):R.Target.match(/^\.\.[\\\/]/)&&(R.Target=R.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(m[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(r.WTF)throw new Error(m)}}var V={Sheets:h,SheetNames:p,Workbook:Q};return r.bookSheets&&delete V.Sheets,V}function R2(e,t){t=t||{},Jn(e,"META-INF/manifest.xml")&&Aq(sr(e,"META-INF/manifest.xml"),t);var r=Ln(e,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var n=zO(Dt(r),t);return Jn(e,"meta.xml")&&(n.Props=tO(sr(e,"meta.xml"))),n}function I2(e,t){return zO(e,t)}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function F1(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function nx(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Dt(qo(e))}function ax(e){var t=e.reduce(function(a,s){return a+s.length},0),r=new Uint8Array(t),n=0;return e.forEach(function(a){r.set(a,n),n+=a.length}),r}function F2(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>>24}function hJ(e,t){for(var r=(e[t+15]&127)<<7|e[t+14]>>1,n=e[t+14]&1,a=t+13;a>=t;--a)n=n*256+e[a];return(e[t+15]&128?-n:n)*Math.pow(10,r-6176)}function kf(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function xr(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 Kr(e){for(var t=[],r=[0];r[0]<e.length;){var n=r[0],a=kf(e,r),s=a&7;a=Math.floor(a/8);var i=0,o;if(a==0)break;switch(s){case 0:{for(var l=r[0];e[r[0]++]>=128;);o=e.slice(l,r[0])}break;case 5:i=4,o=e.slice(r[0],r[0]+i),r[0]+=i;break;case 1:i=8,o=e.slice(r[0],r[0]+i),r[0]+=i;break;case 2:i=kf(e,r),o=e.slice(r[0],r[0]+i),r[0]+=i;break;case 3:case 4:default:throw new Error("PB Type ".concat(s," for Field ").concat(a," at offset ").concat(n))}var u={data:o,type:s};t[a]==null?t[a]=[u]:t[a].push(u)}return t}function D1(e,t){return(e==null?void 0:e.map(function(r){return t(r.data)}))||[]}function pJ(e){for(var t,r=[],n=[0];n[0]<e.length;){var a=kf(e,n),s=Kr(e.slice(n[0],n[0]+a));n[0]+=a;var i={id:xr(s[1][0].data),messages:[]};s[2].forEach(function(o){var l=Kr(o.data),u=xr(l[3][0].data);i.messages.push({meta:l,data:e.slice(n[0],n[0]+u)}),n[0]+=u}),(t=s[3])!=null&&t[0]&&(i.merge=xr(s[3][0].data)>>>0>0),r.push(i)}return r}function mJ(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=kf(t,r),a=[];r[0]<t.length;){var s=t[r[0]]&3;if(s==0){var i=t[r[0]++]>>2;if(i<60)++i;else{var o=i-59;i=t[r[0]],o>1&&(i|=t[r[0]+1]<<8),o>2&&(i|=t[r[0]+2]<<16),o>3&&(i|=t[r[0]+3]<<24),i>>>=0,i++,r[0]+=o}a.push(t.slice(r[0],r[0]+i)),r[0]+=i;continue}else{var l=0,u=0;if(s==1?(u=(t[r[0]]>>2&7)+4,l=(t[r[0]++]&224)<<3,l|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,s==2?(l=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(l=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),a=[ax(a)],l==0)throw new Error("Invalid offset 0");if(l>a[0].length)throw new Error("Invalid offset beyond length");if(u>=l)for(a.push(a[0].slice(-l)),u-=l;u>=a[a.length-1].length;)a.push(a[a.length-1]),u-=a[a.length-1].length;a.push(a[0].slice(-l,-l+u))}}var f=ax(a);if(f.length!=n)throw new Error("Unexpected length: ".concat(f.length," != ").concat(n));return f}function gJ(e){for(var t=[],r=0;r<e.length;){var n=e[r++],a=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(mJ(n,e.slice(r,r+a))),r+=a}if(r!==e.length)throw new Error("data is not a valid framed stream!");return ax(t)}function vJ(e,t,r,n){var a=F1(e),s=a.getUint32(4,!0),i=(n>1?12:8)+F2(s&(n>1?3470:398))*4,o=-1,l=-1,u=NaN,f=new Date(2001,0,1);s&512&&(o=a.getUint32(i,!0),i+=4),i+=F2(s&(n>1?12288:4096))*4,s&16&&(l=a.getUint32(i,!0),i+=4),s&32&&(u=a.getFloat64(i,!0),i+=8),s&64&&(f.setTime(f.getTime()+a.getFloat64(i,!0)*1e3),i+=8);var d;switch(e[2]){case 0:break;case 2:d={t:"n",v:u};break;case 3:d={t:"s",v:t[l]};break;case 5:d={t:"d",v:f};break;case 6:d={t:"b",v:u>0};break;case 7:d={t:"n",v:u/86400};break;case 8:d={t:"e",v:0};break;case 9:if(o>-1)d={t:"s",v:r[o]};else if(l>-1)d={t:"s",v:t[l]};else if(!isNaN(u))d={t:"n",v:u};else throw new Error("Unsupported cell type ".concat(e.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(e.slice(0,4)))}return d}function xJ(e,t,r){var n=F1(e),a=n.getUint32(8,!0),s=12,i=-1,o=-1,l=NaN,u=NaN,f=new Date(2001,0,1);a&1&&(l=hJ(e,s),s+=16),a&2&&(u=n.getFloat64(s,!0),s+=8),a&4&&(f.setTime(f.getTime()+n.getFloat64(s,!0)*1e3),s+=8),a&8&&(o=n.getUint32(s,!0),s+=4),a&16&&(i=n.getUint32(s,!0),s+=4);var d;switch(e[1]){case 0:break;case 2:d={t:"n",v:l};break;case 3:d={t:"s",v:t[o]};break;case 5:d={t:"d",v:f};break;case 6:d={t:"b",v:u>0};break;case 7:d={t:"n",v:u/86400};break;case 8:d={t:"e",v:0};break;case 9:if(i>-1)d={t:"s",v:r[i]};else throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(a&31," : ").concat(e.slice(0,4)));break;case 10:d={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(a&31," : ").concat(e.slice(0,4)))}return d}function yJ(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:return vJ(e,t,r,e[0]);case 5:return xJ(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function Ci(e){var t=Kr(e);return kf(t[1][0].data)}function D2(e,t){var r=Kr(t.data),n=xr(r[1][0].data),a=r[3],s=[];return(a||[]).forEach(function(i){var o=Kr(i.data),l=xr(o[1][0].data)>>>0;switch(n){case 1:s[l]=nx(o[3][0].data);break;case 8:{var u=e[Ci(o[9][0].data)][0],f=Kr(u.data),d=e[Ci(f[1][0].data)][0],h=xr(d.meta[1][0].data);if(h!=2001)throw new Error("2000 unexpected reference to ".concat(h));var p=Kr(d.data);s[l]=p[3].map(function(v){return nx(v.data)}).join("")}break}}),s}function wJ(e,t){var r,n,a,s,i,o,l,u,f,d,h,p,v,m,g=Kr(e),x=xr(g[1][0].data)>>>0,y=xr(g[2][0].data)>>>0,w=((n=(r=g[8])==null?void 0:r[0])==null?void 0:n.data)&&xr(g[8][0].data)>0||!1,b,_;if((s=(a=g[7])==null?void 0:a[0])!=null&&s.data&&t!=0)b=(o=(i=g[7])==null?void 0:i[0])==null?void 0:o.data,_=(u=(l=g[6])==null?void 0:l[0])==null?void 0:u.data;else if((d=(f=g[4])==null?void 0:f[0])!=null&&d.data&&t!=1)b=(p=(h=g[4])==null?void 0:h[0])==null?void 0:p.data,_=(m=(v=g[3])==null?void 0:v[0])==null?void 0:m.data;else throw"NUMBERS Tile missing ".concat(t," cell storage");for(var T=w?4:1,E=F1(b),C=[],P=0;P<b.length/2;++P){var N=E.getUint16(P*2,!0);N<65535&&C.push([P,N])}if(C.length!=y)throw"Expected ".concat(y," cells, found ").concat(C.length);var k=[];for(P=0;P<C.length-1;++P)k[C[P][0]]=_.subarray(C[P][1]*T,C[P+1][1]*T);return C.length>=1&&(k[C[C.length-1][0]]=_.subarray(C[C.length-1][1]*T)),{R:x,cells:k}}function bJ(e,t){var r,n=Kr(t.data),a=(r=n==null?void 0:n[7])!=null&&r[0]?xr(n[7][0].data)>>>0>0?1:0:-1,s=D1(n[5],function(i){return wJ(i,a)});return{nrows:xr(n[4][0].data)>>>0,data:s.reduce(function(i,o){return i[o.R]||(i[o.R]=[]),o.cells.forEach(function(l,u){if(i[o.R][u])throw new Error("Duplicate cell r=".concat(o.R," c=").concat(u));i[o.R][u]=l}),i},[])}}function _J(e,t,r){var n,a=Kr(t.data),s={s:{r:0,c:0},e:{r:0,c:0}};if(s.e.r=(xr(a[6][0].data)>>>0)-1,s.e.r<0)throw new Error("Invalid row varint ".concat(a[6][0].data));if(s.e.c=(xr(a[7][0].data)>>>0)-1,s.e.c<0)throw new Error("Invalid col varint ".concat(a[7][0].data));r["!ref"]=wt(s);var i=Kr(a[4][0].data),o=D2(e,e[Ci(i[4][0].data)][0]),l=(n=i[17])!=null&&n[0]?D2(e,e[Ci(i[17][0].data)][0]):[],u=Kr(i[3][0].data),f=0;u[1].forEach(function(d){var h=Kr(d.data),p=e[Ci(h[2][0].data)][0],v=xr(p.meta[1][0].data);if(v!=6002)throw new Error("6001 unexpected reference to ".concat(v));var m=bJ(e,p);m.data.forEach(function(g,x){g.forEach(function(y,w){var b=et({r:f+x,c:w}),_=yJ(y,o,l);_&&(r[b]=_)})}),f+=m.nrows})}function EJ(e,t){var r=Kr(t.data),n={"!ref":"A1"},a=e[Ci(r[2][0].data)],s=xr(a[0].meta[1][0].data);if(s!=6001)throw new Error("6000 unexpected reference to ".concat(s));return _J(e,a[0],n),n}function SJ(e,t){var r,n=Kr(t.data),a={name:(r=n[1])!=null&&r[0]?nx(n[1][0].data):"",sheets:[]},s=D1(n[2],Ci);return s.forEach(function(i){e[i].forEach(function(o){var l=xr(o.meta[1][0].data);l==6e3&&a.sheets.push(EJ(e,o))})}),a}function TJ(e,t){var r=B1(),n=Kr(t.data),a=D1(n[1],Ci);if(a.forEach(function(s){e[s].forEach(function(i){var o=xr(i.meta[1][0].data);if(o==2){var l=SJ(e,i);l.sheets.forEach(function(u,f){U1(r,u,f==0?l.name:l.name+"_"+f,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function Gm(e){var t,r,n,a,s={},i=[];if(e.FullPaths.forEach(function(l){if(l.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),e.FileIndex.forEach(function(l){if(l.name.match(/\.iwa$/)){var u;try{u=gJ(l.content)}catch(d){return console.log("?? "+l.content.length+" "+(d.message||d))}var f;try{f=pJ(u)}catch(d){return console.log("## "+(d.message||d))}f.forEach(function(d){s[d.id]=d.messages,i.push(d.id)})}}),!i.length)throw new Error("File has no messages");var o=((a=(n=(r=(t=s==null?void 0:s[1])==null?void 0:t[0])==null?void 0:r.meta)==null?void 0:n[1])==null?void 0:a[0].data)&&xr(s[1][0].meta[1][0].data)==1&&s[1][0];if(o||i.forEach(function(l){s[l].forEach(function(u){var f=xr(u.meta[1][0].data)>>>0;if(f==1)if(!o)o=u;else throw new Error("Document has multiple roots")})}),!o)throw new Error("Cannot find Document root");return TJ(s,o)}function kJ(e){return function(r){for(var n=0;n!=e.length;++n){var a=e[n];r[a[0]]===void 0&&(r[a[0]]=a[1]),a[2]==="n"&&(r[a[0]]=Number(r[a[0]]))}}}function M1(e){kJ([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function NJ(e){return Cl.WS.indexOf(e)>-1?"sheet":e==Cl.CS?"chart":e==Cl.DS?"dialog":e==Cl.MS?"macro":e&&e.length?e:"sheet"}function AJ(e,t){if(!e)return 0;try{e=t.map(function(n){return n.id||(n.id=n.strRelID),[n.name,e["!id"][n.id].Target,NJ(e["!id"][n.id].Type)]})}catch{return null}return!e||e.length===0?null:e}function CJ(e,t,r,n,a,s,i,o,l,u,f,d){try{s[n]=Ru(Ln(e,r,!0),t);var h=sr(e,t),p;switch(o){case"sheet":p=FX(h,t,a,l,s[n],u,f,d);break;case"chart":if(p=DX(h,t,a,l,s[n],u,f,d),!p||!p["!drawel"])break;var v=mu(p["!drawel"].Target,t),m=Qv(v),g=IG(Ln(e,v,!0),Ru(Ln(e,m,!0),v)),x=mu(g,v),y=Qv(x);p=xX(Ln(e,x,!0),x,l,Ru(Ln(e,y,!0),x),u,p);break;case"macro":p=MX(h,t,a,l,s[n],u,f,d);break;case"dialog":p=LX(h,t,a,l,s[n],u,f,d);break;default:throw new Error("Unrecognized sheet type "+o)}i[n]=p;var w=[];s&&s[n]&&ns(s[n]).forEach(function(b){var _="";if(s[n][b].Type==Cl.CMNT){_=mu(s[n][b].Target,t);var T=zX(sr(e,_,!0),_,l);if(!T||!T.length)return;b2(p,T,!1)}s[n][b].Type==Cl.TCMNT&&(_=mu(s[n][b].Target,t),w=w.concat(DG(sr(e,_,!0),l)))}),w&&w.length&&b2(p,w,!0,l.people||[])}catch(b){if(l.WTF)throw b}}function Yn(e){return e.charAt(0)=="/"?e.slice(1):e}function PJ(e,t){if(kP(),t=t||{},M1(t),Jn(e,"META-INF/manifest.xml")||Jn(e,"objectdata.xml"))return R2(e,t);if(Jn(e,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof Gm<"u"){if(e.FileIndex)return Gm(e);var r=yt.utils.cfb_new();return K_(e).forEach(function(M){OH(r,M,PH(e,M))}),Gm(r)}throw new Error("Unsupported NUMBERS file")}if(!Jn(e,"[Content_Types].xml"))throw Jn(e,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):Jn(e,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var n=K_(e),a=kq(Ln(e,"[Content_Types].xml")),s=!1,i,o;if(a.workbooks.length===0&&(o="xl/workbook.xml",sr(e,o,!0)&&a.workbooks.push(o)),a.workbooks.length===0){if(o="xl/workbook.bin",!sr(e,o,!0))throw new Error("Could not find workbook");a.workbooks.push(o),s=!0}a.workbooks[0].slice(-3)=="bin"&&(s=!0);var l={},u={};if(!t.bookSheets&&!t.bookProps){if(Du=[],a.sst)try{Du=$X(sr(e,Yn(a.sst)),a.sst,t)}catch(M){if(t.WTF)throw M}t.cellStyles&&a.themes.length&&(l=UX(Ln(e,a.themes[0].replace(/^\//,""),!0)||"",a.themes[0],t)),a.style&&(u=BX(sr(e,Yn(a.style)),a.style,l,t))}a.links.map(function(M){try{var U=Ru(Ln(e,Qv(Yn(M))),M);return qX(sr(e,Yn(M)),U,M,t)}catch{}});var f=IX(sr(e,Yn(a.workbooks[0])),a.workbooks[0],t),d={},h="";a.coreprops.length&&(h=sr(e,Yn(a.coreprops[0]),!0),h&&(d=tO(h)),a.extprops.length!==0&&(h=sr(e,Yn(a.extprops[0]),!0),h&&Oq(h,d,t)));var p={};(!t.bookSheets||t.bookProps)&&a.custprops.length!==0&&(h=Ln(e,Yn(a.custprops[0]),!0),h&&(p=Rq(h,t)));var v={};if((t.bookSheets||t.bookProps)&&(f.Sheets?i=f.Sheets.map(function(U){return U.name}):d.Worksheets&&d.SheetNames.length>0&&(i=d.SheetNames),t.bookProps&&(v.Props=d,v.Custprops=p),t.bookSheets&&typeof i<"u"&&(v.SheetNames=i),t.bookSheets?v.SheetNames:t.bookProps))return v;i={};var m={};t.bookDeps&&a.calcchain&&(m=HX(sr(e,Yn(a.calcchain)),a.calcchain));var g=0,x={},y,w;{var b=f.Sheets;d.Worksheets=b.length,d.SheetNames=[];for(var _=0;_!=b.length;++_)d.SheetNames[_]=b[_].name}var T=s?"bin":"xml",E=a.workbooks[0].lastIndexOf("/"),C=(a.workbooks[0].slice(0,E+1)+"_rels/"+a.workbooks[0].slice(E+1)+".rels").replace(/^\//,"");Jn(e,C)||(C="xl/_rels/workbook."+T+".rels");var P=Ru(Ln(e,C,!0),C.replace(/_rels.*/,"s5s"));(a.metadata||[]).length>=1&&(t.xlmeta=WX(sr(e,Yn(a.metadata[0])),a.metadata[0],t)),(a.people||[]).length>=1&&(t.people=MG(sr(e,Yn(a.people[0])),t)),P&&(P=AJ(P,f.Sheets));var N=sr(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(g=0;g!=d.Worksheets;++g){var k="sheet";if(P&&P[g]?(y="xl/"+P[g][1].replace(/[\/]?xl\//,""),Jn(e,y)||(y=P[g][1]),Jn(e,y)||(y=C.replace(/_rels\/.*$/,"")+P[g][1]),k=P[g][2]):(y="xl/worksheets/sheet"+(g+1-N)+"."+T,y=y.replace(/sheet0\./,"sheet.")),w=y.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&t.sheets!=null)switch(typeof t.sheets){case"number":if(g!=t.sheets)continue e;break;case"string":if(d.SheetNames[g].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var A=!1,I=0;I!=t.sheets.length;++I)typeof t.sheets[I]=="number"&&t.sheets[I]==g&&(A=1),typeof t.sheets[I]=="string"&&t.sheets[I].toLowerCase()==d.SheetNames[g].toLowerCase()&&(A=1);if(!A)continue e}}CJ(e,y,w,d.SheetNames[g],g,x,i,k,t,f,l,u)}return v={Directory:a,Workbook:f,Props:d,Custprops:p,Deps:m,Sheets:i,SheetNames:d.SheetNames,Strings:Du,Styles:u,Themes:l,SSF:Mr(rt)},t&&t.bookFiles&&(e.files?(v.keys=n,v.files=e.files):(v.keys=[],v.files={},e.FullPaths.forEach(function(M,U){M=M.replace(/^Root Entry[\/]/,""),v.keys.push(M),v.files[M]=e.FileIndex[U]}))),t&&t.bookVBA&&(a.vba.length>0?v.vbaraw=sr(e,Yn(a.vba[0]),!0):a.defaults&&a.defaults.bin===$G&&(v.vbaraw=sr(e,"xl/vbaProject.bin",!0))),v}function OJ(e,t){var r=t||{},n="Workbook",a=yt.find(e,n);try{if(n="/!DataSpaces/Version",a=yt.find(e,n),!a||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(EV(a.content),n="/!DataSpaces/DataSpaceMap",a=yt.find(e,n),!a||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);var s=TV(a.content);if(s.length!==1||s[0].comps.length!==1||s[0].comps[0].t!==0||s[0].name!=="StrongEncryptionDataSpace"||s[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",a=yt.find(e,n),!a||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);var i=kV(a.content);if(i.length!=1||i[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",a=yt.find(e,n),!a||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);AV(a.content)}catch{}if(n="/EncryptionInfo",a=yt.find(e,n),!a||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=CV(a.content);if(n="/EncryptedPackage",a=yt.find(e,n),!a||!a.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(o[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(o[1],a.content,r.password||"",r);if(o[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(o[1],a.content,r.password||"",r);throw new Error("File is password-protected")}function L1(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=qn(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 jJ(e,t){return yt.find(e,"EncryptedPackage")?OJ(e,t):BO(e,t)}function RJ(e,t){var r,n=e,a=t||{};return a.type||(a.type=gt&&Buffer.isBuffer(e)?"buffer":"base64"),r=jP(n,a),PJ(r,a)}function HO(e,t){var r=0;e:for(;r<e.length;)switch(e.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return tx(e.slice(r),t);default:break e}return Ef.to_workbook(e,t)}function IJ(e,t){var r="",n=L1(e,t);switch(t.type){case"base64":r=qn(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=Do(e);break;default:throw new Error("Unrecognized type "+t.type)}return n[0]==239&&n[1]==187&&n[2]==191&&(r=Dt(r)),t.type="binary",HO(r,t)}function FJ(e,t){var r=e;return t.type=="base64"&&(r=qn(r)),r=yf.utils.decode(1200,r.slice(2),"str"),t.type="binary",HO(r,t)}function DJ(e){return e.match(/[^\x00-\x7F]/)?gu(e):e}function Km(e,t,r,n){return n?(r.type="string",Ef.to_workbook(e,r)):Ef.to_workbook(t,r)}function Bu(e,t){pP();var r=t||{};if(typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer)return Bu(new Uint8Array(e),(r=Mr(r),r.type="array",r));typeof Uint8Array<"u"&&e instanceof Uint8Array&&!r.type&&(r.type=typeof Deno<"u"?"buffer":"array");var n=e,a=[0,0,0,0],s=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),Wl={},r.dateNF&&(Wl.dateNF=r.dateNF),r.type||(r.type=gt&&Buffer.isBuffer(e)?"buffer":"base64"),r.type=="file"&&(r.type=gt?"buffer":"binary",n=EH(e),typeof Uint8Array<"u"&&!gt&&(r.type="array")),r.type=="string"&&(s=!0,r.type="binary",r.codepage=65001,n=DJ(e)),r.type=="array"&&typeof Uint8Array<"u"&&e instanceof Uint8Array&&typeof ArrayBuffer<"u"){var i=new ArrayBuffer(3),o=new Uint8Array(i);if(o.foo="bar",!o.foo)return r=Mr(r),r.type="array",Bu(g1(n),r)}switch((a=L1(n,r))[0]){case 208:if(a[1]===207&&a[2]===17&&a[3]===224&&a[4]===161&&a[5]===177&&a[6]===26&&a[7]===225)return jJ(yt.read(n,r),r);break;case 9:if(a[1]<=8)return BO(n,r);break;case 60:return tx(n,r);case 73:if(a[1]===73&&a[2]===42&&a[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(a[1]===68)return uV(n,r);break;case 84:if(a[1]===65&&a[2]===66&&a[3]===76)return lV.to_workbook(n,r);break;case 80:return a[1]===75&&a[2]<9&&a[3]<9?RJ(n,r):Km(e,n,r,s);case 239:return a[3]===60?tx(n,r):Km(e,n,r,s);case 255:if(a[1]===254)return FJ(n,r);if(a[1]===0&&a[2]===2&&a[3]===0)return Fu.to_workbook(n,r);break;case 0:if(a[1]===0&&(a[2]>=2&&a[3]===0||a[2]===0&&(a[3]===8||a[3]===9)))return Fu.to_workbook(n,r);break;case 3:case 131:case 139:case 140:return w2.to_workbook(n,r);case 123:if(a[1]===92&&a[2]===114&&a[3]===116)return $V.to_workbook(n,r);break;case 10:case 13:case 32:return IJ(n,r);case 137:if(a[1]===80&&a[2]===78&&a[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return iV.indexOf(a[0])>-1&&a[2]<=12&&a[3]<=31?w2.to_workbook(n,r):Km(e,n,r,s)}function MJ(e,t,r,n,a,s,i,o){var l=Lr(r),u=o.defval,f=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),d=!0,h=a===1?[]:{};if(a!==1)if(Object.defineProperty)try{Object.defineProperty(h,"__rowNum__",{value:r,enumerable:!1})}catch{h.__rowNum__=r}else h.__rowNum__=r;if(!i||e[r])for(var p=t.s.c;p<=t.e.c;++p){var v=i?e[r][p]:e[n[p]+l];if(v===void 0||v.t===void 0){if(u===void 0)continue;s[p]!=null&&(h[s[p]]=u);continue}var m=v.v;switch(v.t){case"z":if(m==null)break;continue;case"e":m=m==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+v.t)}if(s[p]!=null){if(m==null)if(v.t=="e"&&m===null)h[s[p]]=null;else if(u!==void 0)h[s[p]]=u;else if(f&&m===null)h[s[p]]=null;else continue;else h[s[p]]=f&&(v.t!=="n"||v.t==="n"&&o.rawNumbers!==!1)?m:js(v,m,o);m!=null&&(d=!1)}}return{row:h,isempty:d}}function sx(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},n=0,a=1,s=[],i=0,o="",l={s:{r:0,c:0},e:{r:0,c:0}},u=t||{},f=u.range!=null?u.range:e["!ref"];switch(u.header===1?n=1:u.header==="A"?n=2:Array.isArray(u.header)?n=3:u.header==null&&(n=0),typeof f){case"string":l=Zt(f);break;case"number":l=Zt(e["!ref"]),l.s.r=f;break;default:l=f}n>0&&(a=0);var d=Lr(l.s.r),h=[],p=[],v=0,m=0,g=Array.isArray(e),x=l.s.r,y=0,w={};g&&!e[x]&&(e[x]=[]);var b=u.skipHidden&&e["!cols"]||[],_=u.skipHidden&&e["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(b[y]||{}).hidden)switch(h[y]=mr(y),r=g?e[x][y]:e[h[y]+d],n){case 1:s[y]=y-l.s.c;break;case 2:s[y]=h[y];break;case 3:s[y]=u.header[y-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),o=i=js(r,null,u),m=w[i]||0,!m)w[i]=1;else{do o=i+"_"+m++;while(w[o]);w[i]=m,w[o]=1}s[y]=o}for(x=l.s.r+a;x<=l.e.r;++x)if(!(_[x]||{}).hidden){var T=MJ(e,l,x,h,n,s,g,u);(T.isempty===!1||(n===1?u.blankrows!==!1:u.blankrows))&&(p[v++]=T.row)}return p.length=v,p}var M2=/"/g;function LJ(e,t,r,n,a,s,i,o){for(var l=!0,u=[],f="",d=Lr(r),h=t.s.c;h<=t.e.c;++h)if(n[h]){var p=o.dense?(e[r]||[])[h]:e[n[h]+d];if(p==null)f="";else if(p.v!=null){l=!1,f=""+(o.rawNumbers&&p.t=="n"?p.v:js(p,null,o));for(var v=0,m=0;v!==f.length;++v)if((m=f.charCodeAt(v))===a||m===s||m===34||o.forceQuotes){f='"'+f.replace(M2,'""')+'"';break}f=="ID"&&(f='"ID"')}else p.f!=null&&!p.F?(l=!1,f="="+p.f,f.indexOf(",")>=0&&(f='"'+f.replace(M2,'""')+'"')):f="";u.push(f)}return o.blankrows===!1&&l?null:u.join(i)}function qO(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var a=Zt(e["!ref"]),s=n.FS!==void 0?n.FS:",",i=s.charCodeAt(0),o=n.RS!==void 0?n.RS:`
`,l=o.charCodeAt(0),u=new RegExp((s=="|"?"\\|":s)+"+$"),f="",d=[];n.dense=Array.isArray(e);for(var h=n.skipHidden&&e["!cols"]||[],p=n.skipHidden&&e["!rows"]||[],v=a.s.c;v<=a.e.c;++v)(h[v]||{}).hidden||(d[v]=mr(v));for(var m=0,g=a.s.r;g<=a.e.r;++g)(p[g]||{}).hidden||(f=LJ(e,a,g,d,i,l,s,n),f!=null&&(n.strip&&(f=f.replace(u,"")),(f||n.blankrows!==!1)&&r.push((m++?o:"")+f)));return delete n.dense,r.join("")}function BJ(e,t){t||(t={}),t.FS=" ",t.RS=`
`;var r=qO(e,t);return r}function UJ(e){var t="",r,n="";if(e==null||e["!ref"]==null)return[];var a=Zt(e["!ref"]),s="",i=[],o,l=[],u=Array.isArray(e);for(o=a.s.c;o<=a.e.c;++o)i[o]=mr(o);for(var f=a.s.r;f<=a.e.r;++f)for(s=Lr(f),o=a.s.c;o<=a.e.c;++o)if(t=i[o]+s,r=u?(e[f]||[])[o]:e[t],n="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;n=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=t+"="+n}return l}function WO(e,t,r){var n=r||{},a=+!n.skipHeader,s=e||{},i=0,o=0;if(s&&n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var l=typeof n.origin=="string"?un(n.origin):n.origin;i=l.r,o=l.c}var u,f={s:{c:0,r:0},e:{c:o,r:i+t.length-1+a}};if(s["!ref"]){var d=Zt(s["!ref"]);f.e.c=Math.max(f.e.c,d.e.c),f.e.r=Math.max(f.e.r,d.e.r),i==-1&&(i=d.e.r+1,f.e.r=i+t.length-1+a)}else i==-1&&(i=0,f.e.r=t.length-1+a);var h=n.header||[],p=0;t.forEach(function(m,g){ns(m).forEach(function(x){(p=h.indexOf(x))==-1&&(h[p=h.length]=x);var y=m[x],w="z",b="",_=et({c:o+p,r:i+g+a});u=Nf(s,_),y&&typeof y=="object"&&!(y instanceof Date)?s[_]=y:(typeof y=="number"?w="n":typeof y=="boolean"?w="b":typeof y=="string"?w="s":y instanceof Date?(w="d",n.cellDates||(w="n",y=pn(y)),b=n.dateNF||rt[14]):y===null&&n.nullError&&(w="e",y=0),u?(u.t=w,u.v=y,delete u.w,delete u.R,b&&(u.z=b)):s[_]=u={t:w,v:y},b&&(u.z=b))})}),f.e.c=Math.max(f.e.c,o+h.length-1);var v=Lr(i);if(a)for(p=0;p<h.length;++p)s[mr(p+o)+v]={t:"s",v:h[p]};return s["!ref"]=wt(f),s}function $J(e,t){return WO(null,e,t)}function Nf(e,t,r){if(typeof t=="string"){if(Array.isArray(e)){var n=un(t);return e[n.r]||(e[n.r]=[]),e[n.r][n.c]||(e[n.r][n.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return typeof t!="number"?Nf(e,et(t)):Nf(e,et({r:t,c:r||0}))}function zJ(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 B1(){return{SheetNames:[],Sheets:{}}}function U1(e,t,r,n){var a=1;if(!r)for(;a<=65535&&e.SheetNames.indexOf(r="Sheet"+a)!=-1;++a,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var s=r.match(/(^.*?)(\d+)$/);a=s&&+s[2]||0;var i=s&&s[1]||r;for(++a;a<=65535&&e.SheetNames.indexOf(r=i+a)!=-1;++a);}if(kX(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 HJ(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=zJ(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function qJ(e,t){return e.z=t,e}function VO(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function WJ(e,t,r){return VO(e,"#"+t,r)}function VJ(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function GJ(e,t,r,n){for(var a=typeof t!="string"?t:Zt(t),s=typeof t=="string"?t:wt(t),i=a.s.r;i<=a.e.r;++i)for(var o=a.s.c;o<=a.e.c;++o){var l=Nf(e,i,o);l.t="n",l.F=s,delete l.v,i==a.s.r&&o==a.s.c&&(l.f=r,n&&(l.D=!0))}return e}var Ym={encode_col:mr,encode_row:Lr,encode_cell:et,encode_range:wt,decode_col:T1,decode_row:S1,split_cell:sq,decode_cell:un,decode_range:Ac,format_cell:js,sheet_add_aoa:XP,sheet_add_json:WO,sheet_add_dom:UO,aoa_to_sheet:Cc,json_to_sheet:$J,table_to_sheet:$O,table_to_book:uJ,sheet_to_csv:qO,sheet_to_txt:BJ,sheet_to_json:sx,sheet_to_html:cJ,sheet_to_formulae:UJ,sheet_to_row_object_array:sx,sheet_get_cell:Nf,book_new:B1,book_append_sheet:U1,book_set_sheet_visibility:HJ,cell_set_number_format:qJ,cell_set_hyperlink:VO,cell_set_internal_link:WJ,cell_add_comment:VJ,sheet_set_array_formula:GJ,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function KJ(){this.__data__=[],this.size=0}var YJ=KJ;function XJ(e,t){return e===t||e!==e&&t!==t}var GO=XJ,JJ=GO;function QJ(e,t){for(var r=e.length;r--;)if(JJ(e[r][0],t))return r;return-1}var kp=QJ,ZJ=kp,eQ=Array.prototype,tQ=eQ.splice;function rQ(e){var t=this.__data__,r=ZJ(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():tQ.call(t,r,1),--this.size,!0}var nQ=rQ,aQ=kp;function sQ(e){var t=this.__data__,r=aQ(t,e);return r<0?void 0:t[r][1]}var iQ=sQ,oQ=kp;function lQ(e){return oQ(this.__data__,e)>-1}var cQ=lQ,uQ=kp;function fQ(e,t){var r=this.__data__,n=uQ(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var dQ=fQ,hQ=YJ,pQ=nQ,mQ=iQ,gQ=cQ,vQ=dQ;function Pc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Pc.prototype.clear=hQ;Pc.prototype.delete=pQ;Pc.prototype.get=mQ;Pc.prototype.has=gQ;Pc.prototype.set=vQ;var Np=Pc,xQ=Np;function yQ(){this.__data__=new xQ,this.size=0}var wQ=yQ;function bQ(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _Q=bQ;function EQ(e){return this.__data__.get(e)}var SQ=EQ;function TQ(e){return this.__data__.has(e)}var kQ=TQ,NQ=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn,KO=NQ,AQ=KO,CQ=typeof self=="object"&&self&&self.Object===Object&&self,PQ=AQ||CQ||Function("return this")(),Bs=PQ,OQ=Bs,jQ=OQ.Symbol,$1=jQ,L2=$1,YO=Object.prototype,RQ=YO.hasOwnProperty,IQ=YO.toString,Vc=L2?L2.toStringTag:void 0;function FQ(e){var t=RQ.call(e,Vc),r=e[Vc];try{e[Vc]=void 0;var n=!0}catch{}var a=IQ.call(e);return n&&(t?e[Vc]=r:delete e[Vc]),a}var DQ=FQ,MQ=Object.prototype,LQ=MQ.toString;function BQ(e){return LQ.call(e)}var UQ=BQ,B2=$1,$Q=DQ,zQ=UQ,HQ="[object Null]",qQ="[object Undefined]",U2=B2?B2.toStringTag:void 0;function WQ(e){return e==null?e===void 0?qQ:HQ:U2&&U2 in Object(e)?$Q(e):zQ(e)}var Ap=WQ;function VQ(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var XO=VQ,GQ=Ap,KQ=XO,YQ="[object AsyncFunction]",XQ="[object Function]",JQ="[object GeneratorFunction]",QQ="[object Proxy]";function ZQ(e){if(!KQ(e))return!1;var t=GQ(e);return t==XQ||t==JQ||t==YQ||t==QQ}var JO=ZQ,eZ=Bs,tZ=eZ["__core-js_shared__"],rZ=tZ,Xm=rZ,$2=function(){var e=/[^.]+$/.exec(Xm&&Xm.keys&&Xm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nZ(e){return!!$2&&$2 in e}var aZ=nZ,sZ=Function.prototype,iZ=sZ.toString;function oZ(e){if(e!=null){try{return iZ.call(e)}catch{}try{return e+""}catch{}}return""}var QO=oZ,lZ=JO,cZ=aZ,uZ=XO,fZ=QO,dZ=/[\\^$.*+?()[\]{}|]/g,hZ=/^\[object .+?Constructor\]$/,pZ=Function.prototype,mZ=Object.prototype,gZ=pZ.toString,vZ=mZ.hasOwnProperty,xZ=RegExp("^"+gZ.call(vZ).replace(dZ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yZ(e){if(!uZ(e)||cZ(e))return!1;var t=lZ(e)?xZ:hZ;return t.test(fZ(e))}var wZ=yZ;function bZ(e,t){return e==null?void 0:e[t]}var _Z=bZ,EZ=wZ,SZ=_Z;function TZ(e,t){var r=SZ(e,t);return EZ(r)?r:void 0}var Oc=TZ,kZ=Oc,NZ=Bs,AZ=kZ(NZ,"Map"),z1=AZ,CZ=Oc,PZ=CZ(Object,"create"),Cp=PZ,z2=Cp;function OZ(){this.__data__=z2?z2(null):{},this.size=0}var jZ=OZ;function RZ(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var IZ=RZ,FZ=Cp,DZ="__lodash_hash_undefined__",MZ=Object.prototype,LZ=MZ.hasOwnProperty;function BZ(e){var t=this.__data__;if(FZ){var r=t[e];return r===DZ?void 0:r}return LZ.call(t,e)?t[e]:void 0}var UZ=BZ,$Z=Cp,zZ=Object.prototype,HZ=zZ.hasOwnProperty;function qZ(e){var t=this.__data__;return $Z?t[e]!==void 0:HZ.call(t,e)}var WZ=qZ,VZ=Cp,GZ="__lodash_hash_undefined__";function KZ(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=VZ&&t===void 0?GZ:t,this}var YZ=KZ,XZ=jZ,JZ=IZ,QZ=UZ,ZZ=WZ,eee=YZ;function jc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}jc.prototype.clear=XZ;jc.prototype.delete=JZ;jc.prototype.get=QZ;jc.prototype.has=ZZ;jc.prototype.set=eee;var tee=jc,H2=tee,ree=Np,nee=z1;function aee(){this.size=0,this.__data__={hash:new H2,map:new(nee||ree),string:new H2}}var see=aee;function iee(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var oee=iee,lee=oee;function cee(e,t){var r=e.__data__;return lee(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Pp=cee,uee=Pp;function fee(e){var t=uee(this,e).delete(e);return this.size-=t?1:0,t}var dee=fee,hee=Pp;function pee(e){return hee(this,e).get(e)}var mee=pee,gee=Pp;function vee(e){return gee(this,e).has(e)}var xee=vee,yee=Pp;function wee(e,t){var r=yee(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var bee=wee,_ee=see,Eee=dee,See=mee,Tee=xee,kee=bee;function Rc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Rc.prototype.clear=_ee;Rc.prototype.delete=Eee;Rc.prototype.get=See;Rc.prototype.has=Tee;Rc.prototype.set=kee;var ZO=Rc,Nee=Np,Aee=z1,Cee=ZO,Pee=200;function Oee(e,t){var r=this.__data__;if(r instanceof Nee){var n=r.__data__;if(!Aee||n.length<Pee-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Cee(n)}return r.set(e,t),this.size=r.size,this}var jee=Oee,Ree=Np,Iee=wQ,Fee=_Q,Dee=SQ,Mee=kQ,Lee=jee;function Ic(e){var t=this.__data__=new Ree(e);this.size=t.size}Ic.prototype.clear=Iee;Ic.prototype.delete=Fee;Ic.prototype.get=Dee;Ic.prototype.has=Mee;Ic.prototype.set=Lee;var Bee=Ic,Uee="__lodash_hash_undefined__";function $ee(e){return this.__data__.set(e,Uee),this}var zee=$ee;function Hee(e){return this.__data__.has(e)}var qee=Hee,Wee=ZO,Vee=zee,Gee=qee;function E0(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Wee;++t<r;)this.add(e[t])}E0.prototype.add=E0.prototype.push=Vee;E0.prototype.has=Gee;var Kee=E0;function Yee(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Xee=Yee;function Jee(e,t){return e.has(t)}var Qee=Jee,Zee=Kee,ete=Xee,tte=Qee,rte=1,nte=2;function ate(e,t,r,n,a,s){var i=r&rte,o=e.length,l=t.length;if(o!=l&&!(i&&l>o))return!1;var u=s.get(e),f=s.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&nte?new Zee:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var v=e[d],m=t[d];if(n)var g=i?n(m,v,d,t,e,s):n(v,m,d,e,t,s);if(g!==void 0){if(g)continue;h=!1;break}if(p){if(!ete(t,function(x,y){if(!tte(p,y)&&(v===x||a(v,x,r,n,s)))return p.push(y)})){h=!1;break}}else if(!(v===m||a(v,m,r,n,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var ej=ate,ste=Bs,ite=ste.Uint8Array,ote=ite;function lte(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var cte=lte;function ute(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var fte=ute,q2=$1,W2=ote,dte=GO,hte=ej,pte=cte,mte=fte,gte=1,vte=2,xte="[object Boolean]",yte="[object Date]",wte="[object Error]",bte="[object Map]",_te="[object Number]",Ete="[object RegExp]",Ste="[object Set]",Tte="[object String]",kte="[object Symbol]",Nte="[object ArrayBuffer]",Ate="[object DataView]",V2=q2?q2.prototype:void 0,Jm=V2?V2.valueOf:void 0;function Cte(e,t,r,n,a,s,i){switch(r){case Ate:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nte:return!(e.byteLength!=t.byteLength||!s(new W2(e),new W2(t)));case xte:case yte:case _te:return dte(+e,+t);case wte:return e.name==t.name&&e.message==t.message;case Ete:case Tte:return e==t+"";case bte:var o=pte;case Ste:var l=n>e;if(o||(o=mte),e.size!=t.size&&!l)return!1;var u=i.get(e);if(u)return u==t;n|=vte,i.set(e,t);var f=hte(o(e),o(t),n,a,s,i);return i.delete(e),f;case kte:if(Jm)return Jm.call(e)==Jm.call(t)}return!1}var Pte=Cte;function Ote(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var jte=Ote,Rte=Array.isArray,H1=Rte,Ite=jte,Fte=H1;function Dte(e,t,r){var n=t(e);return Fte(e)?n:Ite(n,r(e))}var Mte=Dte;function Lte(e,t){for(var r=-1,n=e==null?0:e.length,a=0,s=[];++r<n;){var i=e[r];t(i,r,e)&&(s[a++]=i)}return s}var Bte=Lte;function Ute(){return[]}var $te=Ute,zte=Bte,Hte=$te,qte=Object.prototype,Wte=qte.propertyIsEnumerable,G2=Object.getOwnPropertySymbols,Vte=G2?function(e){return e==null?[]:(e=Object(e),zte(G2(e),function(t){return Wte.call(e,t)}))}:Hte,Gte=Vte;function Kte(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Yte=Kte;function Xte(e){return e!=null&&typeof e=="object"}var Op=Xte,Jte=Ap,Qte=Op,Zte="[object Arguments]";function ere(e){return Qte(e)&&Jte(e)==Zte}var tre=ere,K2=tre,rre=Op,tj=Object.prototype,nre=tj.hasOwnProperty,are=tj.propertyIsEnumerable,sre=K2(function(){return arguments}())?K2:function(e){return rre(e)&&nre.call(e,"callee")&&!are.call(e,"callee")},ire=sre,S0={exports:{}};function ore(){return!1}var lre=ore;S0.exports;(function(e,t){var r=Bs,n=lre,a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===a,o=i?r.Buffer:void 0,l=o?o.isBuffer:void 0,u=l||n;e.exports=u})(S0,S0.exports);var rj=S0.exports,cre=9007199254740991,ure=/^(?:0|[1-9]\d*)$/;function fre(e,t){var r=typeof e;return t=t??cre,!!t&&(r=="number"||r!="symbol"&&ure.test(e))&&e>-1&&e%1==0&&e<t}var dre=fre,hre=9007199254740991;function pre(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hre}var nj=pre,mre=Ap,gre=nj,vre=Op,xre="[object Arguments]",yre="[object Array]",wre="[object Boolean]",bre="[object Date]",_re="[object Error]",Ere="[object Function]",Sre="[object Map]",Tre="[object Number]",kre="[object Object]",Nre="[object RegExp]",Are="[object Set]",Cre="[object String]",Pre="[object WeakMap]",Ore="[object ArrayBuffer]",jre="[object DataView]",Rre="[object Float32Array]",Ire="[object Float64Array]",Fre="[object Int8Array]",Dre="[object Int16Array]",Mre="[object Int32Array]",Lre="[object Uint8Array]",Bre="[object Uint8ClampedArray]",Ure="[object Uint16Array]",$re="[object Uint32Array]",Bt={};Bt[Rre]=Bt[Ire]=Bt[Fre]=Bt[Dre]=Bt[Mre]=Bt[Lre]=Bt[Bre]=Bt[Ure]=Bt[$re]=!0;Bt[xre]=Bt[yre]=Bt[Ore]=Bt[wre]=Bt[jre]=Bt[bre]=Bt[_re]=Bt[Ere]=Bt[Sre]=Bt[Tre]=Bt[kre]=Bt[Nre]=Bt[Are]=Bt[Cre]=Bt[Pre]=!1;function zre(e){return vre(e)&&gre(e.length)&&!!Bt[mre(e)]}var Hre=zre;function qre(e){return function(t){return e(t)}}var Wre=qre,T0={exports:{}};T0.exports;(function(e,t){var r=KO,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,i=s&&r.process,o=function(){try{var l=a&&a.require&&a.require("util").types;return l||i&&i.binding&&i.binding("util")}catch{}}();e.exports=o})(T0,T0.exports);var Vre=T0.exports,Gre=Hre,Kre=Wre,Y2=Vre,X2=Y2&&Y2.isTypedArray,Yre=X2?Kre(X2):Gre,aj=Yre,Xre=Yte,Jre=ire,Qre=H1,Zre=rj,ene=dre,tne=aj,rne=Object.prototype,nne=rne.hasOwnProperty;function ane(e,t){var r=Qre(e),n=!r&&Jre(e),a=!r&&!n&&Zre(e),s=!r&&!n&&!a&&tne(e),i=r||n||a||s,o=i?Xre(e.length,String):[],l=o.length;for(var u in e)(t||nne.call(e,u))&&!(i&&(u=="length"||a&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ene(u,l)))&&o.push(u);return o}var sne=ane,ine=Object.prototype;function one(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ine;return e===r}var lne=one;function cne(e,t){return function(r){return e(t(r))}}var une=cne,fne=une,dne=fne(Object.keys,Object),hne=dne,pne=lne,mne=hne,gne=Object.prototype,vne=gne.hasOwnProperty;function xne(e){if(!pne(e))return mne(e);var t=[];for(var r in Object(e))vne.call(e,r)&&r!="constructor"&&t.push(r);return t}var yne=xne,wne=JO,bne=nj;function _ne(e){return e!=null&&bne(e.length)&&!wne(e)}var Ene=_ne,Sne=sne,Tne=yne,kne=Ene;function Nne(e){return kne(e)?Sne(e):Tne(e)}var Ane=Nne,Cne=Mte,Pne=Gte,One=Ane;function jne(e){return Cne(e,One,Pne)}var Rne=jne,J2=Rne,Ine=1,Fne=Object.prototype,Dne=Fne.hasOwnProperty;function Mne(e,t,r,n,a,s){var i=r&Ine,o=J2(e),l=o.length,u=J2(t),f=u.length;if(l!=f&&!i)return!1;for(var d=l;d--;){var h=o[d];if(!(i?h in t:Dne.call(t,h)))return!1}var p=s.get(e),v=s.get(t);if(p&&v)return p==t&&v==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=i;++d<l;){h=o[d];var x=e[h],y=t[h];if(n)var w=i?n(y,x,h,t,e,s):n(x,y,h,e,t,s);if(!(w===void 0?x===y||a(x,y,r,n,s):w)){m=!1;break}g||(g=h=="constructor")}if(m&&!g){var b=e.constructor,_=t.constructor;b!=_&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var Lne=Mne,Bne=Oc,Une=Bs,$ne=Bne(Une,"DataView"),zne=$ne,Hne=Oc,qne=Bs,Wne=Hne(qne,"Promise"),Vne=Wne,Gne=Oc,Kne=Bs,Yne=Gne(Kne,"Set"),Xne=Yne,Jne=Oc,Qne=Bs,Zne=Jne(Qne,"WeakMap"),eae=Zne,ix=zne,ox=z1,lx=Vne,cx=Xne,ux=eae,sj=Ap,Fc=QO,Q2="[object Map]",tae="[object Object]",Z2="[object Promise]",eE="[object Set]",tE="[object WeakMap]",rE="[object DataView]",rae=Fc(ix),nae=Fc(ox),aae=Fc(lx),sae=Fc(cx),iae=Fc(ux),Zi=sj;(ix&&Zi(new ix(new ArrayBuffer(1)))!=rE||ox&&Zi(new ox)!=Q2||lx&&Zi(lx.resolve())!=Z2||cx&&Zi(new cx)!=eE||ux&&Zi(new ux)!=tE)&&(Zi=function(e){var t=sj(e),r=t==tae?e.constructor:void 0,n=r?Fc(r):"";if(n)switch(n){case rae:return rE;case nae:return Q2;case aae:return Z2;case sae:return eE;case iae:return tE}return t});var oae=Zi,Qm=Bee,lae=ej,cae=Pte,uae=Lne,nE=oae,aE=H1,sE=rj,fae=aj,dae=1,iE="[object Arguments]",oE="[object Array]",Wd="[object Object]",hae=Object.prototype,lE=hae.hasOwnProperty;function pae(e,t,r,n,a,s){var i=aE(e),o=aE(t),l=i?oE:nE(e),u=o?oE:nE(t);l=l==iE?Wd:l,u=u==iE?Wd:u;var f=l==Wd,d=u==Wd,h=l==u;if(h&&sE(e)){if(!sE(t))return!1;i=!0,f=!1}if(h&&!f)return s||(s=new Qm),i||fae(e)?lae(e,t,r,n,a,s):cae(e,t,l,r,n,a,s);if(!(r&dae)){var p=f&&lE.call(e,"__wrapped__"),v=d&&lE.call(t,"__wrapped__");if(p||v){var m=p?e.value():e,g=v?t.value():t;return s||(s=new Qm),a(m,g,r,n,s)}}return h?(s||(s=new Qm),uae(e,t,r,n,a,s)):!1}var mae=pae,gae=mae,cE=Op;function ij(e,t,r,n,a){return e===t?!0:e==null||t==null||!cE(e)&&!cE(t)?e!==e&&t!==t:gae(e,t,r,n,ij,a)}var vae=ij,xae=vae;function yae(e,t){return xae(e,t)}var wae=yae,oj={exports:{}};/*!
* Quill Editor v1.3.7
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/(function(e,t){(function(n,a){e.exports=a()})(typeof self<"u"?self:Bn,function(){return function(r){var n={};function a(s){if(n[s])return n[s].exports;var i=n[s]={i:s,l:!1,exports:{}};return r[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=r,a.c=n,a.d=function(s,i,o){a.o(s,i)||Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:o})},a.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(i,"a",i),i},a.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},a.p="",a(a.s=109)}([function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(17),i=a(18),o=a(19),l=a(45),u=a(46),f=a(47),d=a(48),h=a(49),p=a(12),v=a(32),m=a(33),g=a(31),x=a(1),y={Scope:x.Scope,create:x.create,find:x.find,query:x.query,register:x.register,Container:s.default,Format:i.default,Leaf:o.default,Embed:d.default,Scroll:l.default,Block:f.default,Inline:u.default,Text:h.default,Attributor:{Attribute:p.default,Class:v.default,Style:m.default,Store:g.default}};n.default=y},function(r,n,a){var s=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,y){x.__proto__=y}||function(x,y){for(var w in y)y.hasOwnProperty(w)&&(x[w]=y[w])};return function(x,y){g(x,y);function w(){this.constructor=x}x.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=function(g){s(x,g);function x(y){var w=this;return y="[Parchment] "+y,w=g.call(this,y)||this,w.message=y,w.name=w.constructor.name,w}return x}(Error);n.ParchmentError=i;var o={},l={},u={},f={};n.DATA_KEY="__blot";var d;(function(g){g[g.TYPE=3]="TYPE",g[g.LEVEL=12]="LEVEL",g[g.ATTRIBUTE=13]="ATTRIBUTE",g[g.BLOT=14]="BLOT",g[g.INLINE=7]="INLINE",g[g.BLOCK=11]="BLOCK",g[g.BLOCK_BLOT=10]="BLOCK_BLOT",g[g.INLINE_BLOT=6]="INLINE_BLOT",g[g.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",g[g.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",g[g.ANY=15]="ANY"})(d=n.Scope||(n.Scope={}));function h(g,x){var y=v(g);if(y==null)throw new i("Unable to create "+g+" blot");var w=y,b=g instanceof Node||g.nodeType===Node.TEXT_NODE?g:w.create(x);return new w(b,x)}n.create=h;function p(g,x){return x===void 0&&(x=!1),g==null?null:g[n.DATA_KEY]!=null?g[n.DATA_KEY].blot:x?p(g.parentNode,x):null}n.find=p;function v(g,x){x===void 0&&(x=d.ANY);var y;if(typeof g=="string")y=f[g]||o[g];else if(g instanceof Text||g.nodeType===Node.TEXT_NODE)y=f.text;else if(typeof g=="number")g&d.LEVEL&d.BLOCK?y=f.block:g&d.LEVEL&d.INLINE&&(y=f.inline);else if(g instanceof HTMLElement){var w=(g.getAttribute("class")||"").split(/\s+/);for(var b in w)if(y=l[w[b]],y)break;y=y||u[g.tagName]}return y==null?null:x&d.LEVEL&y.scope&&x&d.TYPE&y.scope?y:null}n.query=v;function m(){for(var g=[],x=0;x<arguments.length;x++)g[x]=arguments[x];if(g.length>1)return g.map(function(b){return m(b)});var y=g[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new i("Invalid definition");if(y.blotName==="abstract")throw new i("Cannot register abstract class");if(f[y.blotName||y.attrName]=y,typeof y.keyName=="string")o[y.keyName]=y;else if(y.className!=null&&(l[y.className]=y),y.tagName!=null){Array.isArray(y.tagName)?y.tagName=y.tagName.map(function(b){return b.toUpperCase()}):y.tagName=y.tagName.toUpperCase();var w=Array.isArray(y.tagName)?y.tagName:[y.tagName];w.forEach(function(b){(u[b]==null||y.className==null)&&(u[b]=y)})}return y}n.register=m},function(r,n,a){var s=a(51),i=a(11),o=a(3),l=a(20),u="\0",f=function(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]};f.prototype.insert=function(d,h){var p={};return d.length===0?this:(p.insert=d,h!=null&&typeof h=="object"&&Object.keys(h).length>0&&(p.attributes=h),this.push(p))},f.prototype.delete=function(d){return d<=0?this:this.push({delete:d})},f.prototype.retain=function(d,h){if(d<=0)return this;var p={retain:d};return h!=null&&typeof h=="object"&&Object.keys(h).length>0&&(p.attributes=h),this.push(p)},f.prototype.push=function(d){var h=this.ops.length,p=this.ops[h-1];if(d=o(!0,{},d),typeof p=="object"){if(typeof d.delete=="number"&&typeof p.delete=="number")return this.ops[h-1]={delete:p.delete+d.delete},this;if(typeof p.delete=="number"&&d.insert!=null&&(h-=1,p=this.ops[h-1],typeof p!="object"))return this.ops.unshift(d),this;if(i(d.attributes,p.attributes)){if(typeof d.insert=="string"&&typeof p.insert=="string")return this.ops[h-1]={insert:p.insert+d.insert},typeof d.attributes=="object"&&(this.ops[h-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof p.retain=="number")return this.ops[h-1]={retain:p.retain+d.retain},typeof d.attributes=="object"&&(this.ops[h-1].attributes=d.attributes),this}}return h===this.ops.length?this.ops.push(d):this.ops.splice(h,0,d),this},f.prototype.chop=function(){var d=this.ops[this.ops.length-1];return d&&d.retain&&!d.attributes&&this.ops.pop(),this},f.prototype.filter=function(d){return this.ops.filter(d)},f.prototype.forEach=function(d){this.ops.forEach(d)},f.prototype.map=function(d){return this.ops.map(d)},f.prototype.partition=function(d){var h=[],p=[];return this.forEach(function(v){var m=d(v)?h:p;m.push(v)}),[h,p]},f.prototype.reduce=function(d,h){return this.ops.reduce(d,h)},f.prototype.changeLength=function(){return this.reduce(function(d,h){return h.insert?d+l.length(h):h.delete?d-h.delete:d},0)},f.prototype.length=function(){return this.reduce(function(d,h){return d+l.length(h)},0)},f.prototype.slice=function(d,h){d=d||0,typeof h!="number"&&(h=1/0);for(var p=[],v=l.iterator(this.ops),m=0;m<h&&v.hasNext();){var g;m<d?g=v.next(d-m):(g=v.next(h-m),p.push(g)),m+=l.length(g)}return new f(p)},f.prototype.compose=function(d){var h=l.iterator(this.ops),p=l.iterator(d.ops),v=[],m=p.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var g=m.retain;h.peekType()==="insert"&&h.peekLength()<=g;)g-=h.peekLength(),v.push(h.next());m.retain-g>0&&p.next(m.retain-g)}for(var x=new f(v);h.hasNext()||p.hasNext();)if(p.peekType()==="insert")x.push(p.next());else if(h.peekType()==="delete")x.push(h.next());else{var y=Math.min(h.peekLength(),p.peekLength()),w=h.next(y),b=p.next(y);if(typeof b.retain=="number"){var _={};typeof w.retain=="number"?_.retain=y:_.insert=w.insert;var T=l.attributes.compose(w.attributes,b.attributes,typeof w.retain=="number");if(T&&(_.attributes=T),x.push(_),!p.hasNext()&&i(x.ops[x.ops.length-1],_)){var E=new f(h.rest());return x.concat(E).chop()}}else typeof b.delete=="number"&&typeof w.retain=="number"&&x.push(b)}return x.chop()},f.prototype.concat=function(d){var h=new f(this.ops.slice());return d.ops.length>0&&(h.push(d.ops[0]),h.ops=h.ops.concat(d.ops.slice(1))),h},f.prototype.diff=function(d,h){if(this.ops===d.ops)return new f;var p=[this,d].map(function(y){return y.map(function(w){if(w.insert!=null)return typeof w.insert=="string"?w.insert:u;var b=y===d?"on":"with";throw new Error("diff() called "+b+" non-document")}).join("")}),v=new f,m=s(p[0],p[1],h),g=l.iterator(this.ops),x=l.iterator(d.ops);return m.forEach(function(y){for(var w=y[1].length;w>0;){var b=0;switch(y[0]){case s.INSERT:b=Math.min(x.peekLength(),w),v.push(x.next(b));break;case s.DELETE:b=Math.min(w,g.peekLength()),g.next(b),v.delete(b);break;case s.EQUAL:b=Math.min(g.peekLength(),x.peekLength(),w);var _=g.next(b),T=x.next(b);i(_.insert,T.insert)?v.retain(b,l.attributes.diff(_.attributes,T.attributes)):v.push(T).delete(b);break}w-=b}}),v.chop()},f.prototype.eachLine=function(d,h){h=h||`
`;for(var p=l.iterator(this.ops),v=new f,m=0;p.hasNext();){if(p.peekType()!=="insert")return;var g=p.peek(),x=l.length(g)-p.peekLength(),y=typeof g.insert=="string"?g.insert.indexOf(h,x)-x:-1;if(y<0)v.push(p.next());else if(y>0)v.push(p.next(y));else{if(d(v,p.next(1).attributes||{},m)===!1)return;m+=1,v=new f}}v.length()>0&&d(v,{},m)},f.prototype.transform=function(d,h){if(h=!!h,typeof d=="number")return this.transformPosition(d,h);for(var p=l.iterator(this.ops),v=l.iterator(d.ops),m=new f;p.hasNext()||v.hasNext();)if(p.peekType()==="insert"&&(h||v.peekType()!=="insert"))m.retain(l.length(p.next()));else if(v.peekType()==="insert")m.push(v.next());else{var g=Math.min(p.peekLength(),v.peekLength()),x=p.next(g),y=v.next(g);if(x.delete)continue;y.delete?m.push(y):m.retain(g,l.attributes.transform(x.attributes,y.attributes,h))}return m.chop()},f.prototype.transformPosition=function(d,h){h=!!h;for(var p=l.iterator(this.ops),v=0;p.hasNext()&&v<=d;){var m=p.peekLength(),g=p.peekType();if(p.next(),g==="delete"){d-=Math.min(m,d-v);continue}else g==="insert"&&(v<d||!h)&&(d+=m);v+=m}return d},r.exports=f},function(r,n){var a=Object.prototype.hasOwnProperty,s=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=function(p){return typeof Array.isArray=="function"?Array.isArray(p):s.call(p)==="[object Array]"},u=function(p){if(!p||s.call(p)!=="[object Object]")return!1;var v=a.call(p,"constructor"),m=p.constructor&&p.constructor.prototype&&a.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!v&&!m)return!1;var g;for(g in p);return typeof g>"u"||a.call(p,g)},f=function(p,v){i&&v.name==="__proto__"?i(p,v.name,{enumerable:!0,configurable:!0,value:v.newValue,writable:!0}):p[v.name]=v.newValue},d=function(p,v){if(v==="__proto__")if(a.call(p,v)){if(o)return o(p,v).value}else return;return p[v]};r.exports=function h(){var p,v,m,g,x,y,w=arguments[0],b=1,_=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},b=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});b<_;++b)if(p=arguments[b],p!=null)for(v in p)m=d(w,v),g=d(p,v),w!==g&&(T&&g&&(u(g)||(x=l(g)))?(x?(x=!1,y=m&&l(m)?m:[]):y=m&&u(m)?m:{},f(w,{name:v,newValue:h(T,y,g)})):typeof g<"u"&&f(w,{name:v,newValue:g}));return w}},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var s=function(){function k(A,I){for(var M=0;M<I.length;M++){var U=I[M];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,I,M){return I&&k(A.prototype,I),M&&k(A,M),A}}(),i=function k(A,I,M){A===null&&(A=Function.prototype);var U=Object.getOwnPropertyDescriptor(A,I);if(U===void 0){var W=Object.getPrototypeOf(A);return W===null?void 0:k(W,I,M)}else{if("value"in U)return U.value;var G=U.get;return G===void 0?void 0:G.call(M)}},o=a(3),l=w(o),u=a(2),f=w(u),d=a(0),h=w(d),p=a(16),v=w(p),m=a(6),g=w(m),x=a(7),y=w(x);function w(k){return k&&k.__esModule?k:{default:k}}function b(k,A){if(!(k instanceof A))throw new TypeError("Cannot call a class as a function")}function _(k,A){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:k}function T(k,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);k.prototype=Object.create(A&&A.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(k,A):k.__proto__=A)}var E=1,C=function(k){T(A,k);function A(){return b(this,A),_(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return s(A,[{key:"attach",value:function(){i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"attach",this).call(this),this.attributes=new h.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new f.default().insert(this.value(),(0,l.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(M,U){var W=h.default.query(M,h.default.Scope.BLOCK_ATTRIBUTE);W!=null&&this.attributes.attribute(W,U)}},{key:"formatAt",value:function(M,U,W,G){this.format(W,G)}},{key:"insertAt",value:function(M,U,W){if(typeof U=="string"&&U.endsWith(`
`)){var G=h.default.create(P.blotName);this.parent.insertBefore(G,M===0?this:this.next),G.insertAt(0,U.slice(0,-1))}else i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,M,U,W)}}]),A}(h.default.Embed);C.scope=h.default.Scope.BLOCK_BLOT;var P=function(k){T(A,k);function A(I){b(this,A);var M=_(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,I));return M.cache={},M}return s(A,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(h.default.Leaf).reduce(function(M,U){return U.length()===0?M:M.insert(U.value(),N(U))},new f.default).insert(`
`,N(this))),this.cache.delta}},{key:"deleteAt",value:function(M,U){i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,M,U),this.cache={}}},{key:"formatAt",value:function(M,U,W,G){U<=0||(h.default.query(W,h.default.Scope.BLOCK)?M+U===this.length()&&this.format(W,G):i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,M,Math.min(U,this.length()-M-1),W,G),this.cache={})}},{key:"insertAt",value:function(M,U,W){if(W!=null)return i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,M,U,W);if(U.length!==0){var G=U.split(`
`),Q=G.shift();Q.length>0&&(M<this.length()-1||this.children.tail==null?i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,Math.min(M,this.length()-1),Q):this.children.tail.insertAt(this.children.tail.length(),Q),this.cache={});var R=this;G.reduce(function(z,D){return R=R.split(z,!0),R.insertAt(0,D),D.length},M+Q.length)}}},{key:"insertBefore",value:function(M,U){var W=this.children.head;i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,M,U),W instanceof v.default&&W.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"length",this).call(this)+E),this.cache.length}},{key:"moveChildren",value:function(M,U){i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"moveChildren",this).call(this,M,U),this.cache={}}},{key:"optimize",value:function(M){i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,M),this.cache={}}},{key:"path",value:function(M){return i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,M,!0)}},{key:"removeChild",value:function(M){i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"removeChild",this).call(this,M),this.cache={}}},{key:"split",value:function(M){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(U&&(M===0||M>=this.length()-E)){var W=this.clone();return M===0?(this.parent.insertBefore(W,this),this):(this.parent.insertBefore(W,this.next),W)}else{var G=i(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"split",this).call(this,M,U);return this.cache={},G}}}]),A}(h.default.Block);P.blotName="block",P.tagName="P",P.defaultChild="break",P.allowedChildren=[g.default,h.default.Embed,y.default];function N(k){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k==null||(typeof k.formats=="function"&&(A=(0,l.default)(A,k.formats())),k.parent==null||k.parent.blotName=="scroll"||k.parent.statics.scope!==k.statics.scope)?A:N(k.parent,A)}n.bubbleFormats=N,n.BlockEmbed=C,n.default=P},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},i=function(){function R(z,D){var O=[],j=!0,B=!1,L=void 0;try{for(var F=z[Symbol.iterator](),H;!(j=(H=F.next()).done)&&(O.push(H.value),!(D&&O.length===D));j=!0);}catch(Z){B=!0,L=Z}finally{try{!j&&F.return&&F.return()}finally{if(B)throw L}}return O}return function(z,D){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return R(z,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function R(z,D){for(var O=0;O<D.length;O++){var j=D[O];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(z,j.key,j)}}return function(z,D,O){return D&&R(z.prototype,D),O&&R(z,O),z}}();a(50);var l=a(2),u=N(l),f=a(14),d=N(f),h=a(8),p=N(h),v=a(9),m=N(v),g=a(0),x=N(g),y=a(15),w=N(y),b=a(3),_=N(b),T=a(10),E=N(T),C=a(34),P=N(C);function N(R){return R&&R.__esModule?R:{default:R}}function k(R,z,D){return z in R?Object.defineProperty(R,z,{value:D,enumerable:!0,configurable:!0,writable:!0}):R[z]=D,R}function A(R,z){if(!(R instanceof z))throw new TypeError("Cannot call a class as a function")}var I=(0,E.default)("quill"),M=function(){o(R,null,[{key:"debug",value:function(D){D===!0&&(D="log"),E.default.level(D)}},{key:"find",value:function(D){return D.__quill||x.default.find(D)}},{key:"import",value:function(D){return this.imports[D]==null&&I.error("Cannot import "+D+". Are you sure it was registered?"),this.imports[D]}},{key:"register",value:function(D,O){var j=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof D!="string"){var L=D.attrName||D.blotName;typeof L=="string"?this.register("formats/"+L,D,O):Object.keys(D).forEach(function(F){j.register(F,D[F],O)})}else this.imports[D]!=null&&!B&&I.warn("Overwriting "+D+" with",O),this.imports[D]=O,(D.startsWith("blots/")||D.startsWith("formats/"))&&O.blotName!=="abstract"?x.default.register(O):D.startsWith("modules")&&typeof O.register=="function"&&O.register()}}]);function R(z){var D=this,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(A(this,R),this.options=U(z,O),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",z);this.options.debug&&R.debug(this.options.debug);var j=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=x.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new d.default(this.scroll),this.selection=new w.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(L){L===p.default.events.TEXT_CHANGE&&D.root.classList.toggle("ql-blank",D.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(L,F){var H=D.selection.lastRange,Z=H&&H.length===0?H.index:void 0;W.call(D,function(){return D.editor.update(null,F,Z)},L)});var B=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+j+"<p><br></p></div>");this.setContents(B),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(R,[{key:"addContainer",value:function(D){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof D=="string"){var j=D;D=document.createElement("div"),D.classList.add(j)}return this.container.insertBefore(D,O),D}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(D,O,j){var B=this,L=G(D,O,j),F=i(L,4);return D=F[0],O=F[1],j=F[3],W.call(this,function(){return B.editor.deleteText(D,O)},j,D,-1*O)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(D),this.container.classList.toggle("ql-disabled",!D)}},{key:"focus",value:function(){var D=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=D,this.scrollIntoView()}},{key:"format",value:function(D,O){var j=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return W.call(this,function(){var L=j.getSelection(!0),F=new u.default;if(L==null)return F;if(x.default.query(D,x.default.Scope.BLOCK))F=j.editor.formatLine(L.index,L.length,k({},D,O));else{if(L.length===0)return j.selection.format(D,O),F;F=j.editor.formatText(L.index,L.length,k({},D,O))}return j.setSelection(L,p.default.sources.SILENT),F},B)}},{key:"formatLine",value:function(D,O,j,B,L){var F=this,H=void 0,Z=G(D,O,j,B,L),X=i(Z,4);return D=X[0],O=X[1],H=X[2],L=X[3],W.call(this,function(){return F.editor.formatLine(D,O,H)},L,D,0)}},{key:"formatText",value:function(D,O,j,B,L){var F=this,H=void 0,Z=G(D,O,j,B,L),X=i(Z,4);return D=X[0],O=X[1],H=X[2],L=X[3],W.call(this,function(){return F.editor.formatText(D,O,H)},L,D,0)}},{key:"getBounds",value:function(D){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=void 0;typeof D=="number"?j=this.selection.getBounds(D,O):j=this.selection.getBounds(D.index,D.length);var B=this.container.getBoundingClientRect();return{bottom:j.bottom-B.top,height:j.height,left:j.left-B.left,right:j.right-B.left,top:j.top-B.top,width:j.width}}},{key:"getContents",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,j=G(D,O),B=i(j,2);return D=B[0],O=B[1],this.editor.getContents(D,O)}},{key:"getFormat",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof D=="number"?this.editor.getFormat(D,O):this.editor.getFormat(D.index,D.length)}},{key:"getIndex",value:function(D){return D.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(D){return this.scroll.leaf(D)}},{key:"getLine",value:function(D){return this.scroll.line(D)}},{key:"getLines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof D!="number"?this.scroll.lines(D.index,D.length):this.scroll.lines(D,O)}},{key:"getModule",value:function(D){return this.theme.modules[D]}},{key:"getSelection",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return D&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,j=G(D,O),B=i(j,2);return D=B[0],O=B[1],this.editor.getText(D,O)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(D,O,j){var B=this,L=arguments.length>3&&arguments[3]!==void 0?arguments[3]:R.sources.API;return W.call(this,function(){return B.editor.insertEmbed(D,O,j)},L,D)}},{key:"insertText",value:function(D,O,j,B,L){var F=this,H=void 0,Z=G(D,0,j,B,L),X=i(Z,4);return D=X[0],H=X[2],L=X[3],W.call(this,function(){return F.editor.insertText(D,O,H)},L,D,O.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(D,O,j){this.clipboard.dangerouslyPasteHTML(D,O,j)}},{key:"removeFormat",value:function(D,O,j){var B=this,L=G(D,O,j),F=i(L,4);return D=F[0],O=F[1],j=F[3],W.call(this,function(){return B.editor.removeFormat(D,O)},j,D)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(D){var O=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return W.call(this,function(){D=new u.default(D);var B=O.getLength(),L=O.editor.deleteText(0,B),F=O.editor.applyDelta(D),H=F.ops[F.ops.length-1];H!=null&&typeof H.insert=="string"&&H.insert[H.insert.length-1]===`
`&&(O.editor.deleteText(O.getLength()-1,1),F.delete(1));var Z=L.compose(F);return Z},j)}},{key:"setSelection",value:function(D,O,j){if(D==null)this.selection.setRange(null,O||R.sources.API);else{var B=G(D,O,j),L=i(B,4);D=L[0],O=L[1],j=L[3],this.selection.setRange(new y.Range(D,O),j),j!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(D){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,j=new u.default().insert(D);return this.setContents(j,O)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,O=this.scroll.update(D);return this.selection.update(D),O}},{key:"updateContents",value:function(D){var O=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return W.call(this,function(){return D=new u.default(D),O.editor.applyDelta(D,j)},j,!0)}}]),R}();M.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},M.events=p.default.events,M.sources=p.default.sources,M.version="1.3.7",M.imports={delta:u.default,parchment:x.default,"core/module":m.default,"core/theme":P.default};function U(R,z){if(z=(0,_.default)(!0,{container:R,modules:{clipboard:!0,keyboard:!0,history:!0}},z),!z.theme||z.theme===M.DEFAULTS.theme)z.theme=P.default;else if(z.theme=M.import("themes/"+z.theme),z.theme==null)throw new Error("Invalid theme "+z.theme+". Did you register it?");var D=(0,_.default)(!0,{},z.theme.DEFAULTS);[D,z].forEach(function(B){B.modules=B.modules||{},Object.keys(B.modules).forEach(function(L){B.modules[L]===!0&&(B.modules[L]={})})});var O=Object.keys(D.modules).concat(Object.keys(z.modules)),j=O.reduce(function(B,L){var F=M.import("modules/"+L);return F==null?I.error("Cannot load "+L+" module. Are you sure you registered it?"):B[L]=F.DEFAULTS||{},B},{});return z.modules!=null&&z.modules.toolbar&&z.modules.toolbar.constructor!==Object&&(z.modules.toolbar={container:z.modules.toolbar}),z=(0,_.default)(!0,{},M.DEFAULTS,{modules:j},D,z),["bounds","container","scrollingContainer"].forEach(function(B){typeof z[B]=="string"&&(z[B]=document.querySelector(z[B]))}),z.modules=Object.keys(z.modules).reduce(function(B,L){return z.modules[L]&&(B[L]=z.modules[L]),B},{}),z}function W(R,z,D,O){if(this.options.strict&&!this.isEnabled()&&z===p.default.sources.USER)return new u.default;var j=D==null?null:this.getSelection(),B=this.editor.delta,L=R();if(j!=null&&(D===!0&&(D=j.index),O==null?j=Q(j,L,z):O!==0&&(j=Q(j,D,O,z)),this.setSelection(j,p.default.sources.SILENT)),L.length()>0){var F,H=[p.default.events.TEXT_CHANGE,L,B,z];if((F=this.emitter).emit.apply(F,[p.default.events.EDITOR_CHANGE].concat(H)),z!==p.default.sources.SILENT){var Z;(Z=this.emitter).emit.apply(Z,H)}}return L}function G(R,z,D,O,j){var B={};return typeof R.index=="number"&&typeof R.length=="number"?typeof z!="number"?(j=O,O=D,D=z,z=R.length,R=R.index):(z=R.length,R=R.index):typeof z!="number"&&(j=O,O=D,D=z,z=0),(typeof D>"u"?"undefined":s(D))==="object"?(B=D,j=O):typeof D=="string"&&(O!=null?B[D]=O:j=D),j=j||p.default.sources.API,[R,z,B,j]}function Q(R,z,D,O){if(R==null)return null;var j=void 0,B=void 0;if(z instanceof u.default){var L=[R.index,R.index+R.length].map(function(X){return z.transformPosition(X,O!==p.default.sources.USER)}),F=i(L,2);j=F[0],B=F[1]}else{var H=[R.index,R.index+R.length].map(function(X){return X<z||X===z&&O===p.default.sources.USER?X:D>=0?X+D:Math.max(z,X+D)}),Z=i(H,2);j=Z[0],B=Z[1]}return new y.Range(j,B-j)}n.expandConfig=U,n.overload=G,n.default=M},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(x,y){for(var w=0;w<y.length;w++){var b=y[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,y,w){return y&&g(x.prototype,y),w&&g(x,w),x}}(),i=function g(x,y,w){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,y);if(b===void 0){var _=Object.getPrototypeOf(x);return _===null?void 0:g(_,y,w)}else{if("value"in b)return b.value;var T=b.get;return T===void 0?void 0:T.call(w)}},o=a(7),l=d(o),u=a(0),f=d(u);function d(g){return g&&g.__esModule?g:{default:g}}function h(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")}function p(g,x){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:g}function v(g,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);g.prototype=Object.create(x&&x.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(g,x):g.__proto__=x)}var m=function(g){v(x,g);function x(){return h(this,x),p(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"formatAt",value:function(w,b,_,T){if(x.compare(this.statics.blotName,_)<0&&f.default.query(_,f.default.Scope.BLOT)){var E=this.isolate(w,b);T&&E.wrap(_,T)}else i(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"formatAt",this).call(this,w,b,_,T)}},{key:"optimize",value:function(w){if(i(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,w),this.parent instanceof x&&x.compare(this.statics.blotName,this.parent.statics.blotName)>0){var b=this.parent.isolate(this.offset(),this.length());this.moveChildren(b),b.wrap(this)}}}],[{key:"compare",value:function(w,b){var _=x.order.indexOf(w),T=x.order.indexOf(b);return _>=0||T>=0?_-T:w===b?0:w<b?-1:1}}]),x}(f.default.Inline);m.allowedChildren=[m,f.default.Embed,l.default],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=m},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(0),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}function l(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function f(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var d=function(h){f(p,h);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(i.default.Text);n.default=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function y(w,b){for(var _=0;_<b.length;_++){var T=b[_];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(w,T.key,T)}}return function(w,b,_){return b&&y(w.prototype,b),_&&y(w,_),w}}(),i=function y(w,b,_){w===null&&(w=Function.prototype);var T=Object.getOwnPropertyDescriptor(w,b);if(T===void 0){var E=Object.getPrototypeOf(w);return E===null?void 0:y(E,b,_)}else{if("value"in T)return T.value;var C=T.get;return C===void 0?void 0:C.call(_)}},o=a(54),l=d(o),u=a(10),f=d(u);function d(y){return y&&y.__esModule?y:{default:y}}function h(y,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function v(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var m=(0,f.default)("quill:events"),g=["selectionchange","mousedown","mouseup","click"];g.forEach(function(y){document.addEventListener(y,function(){for(var w=arguments.length,b=Array(w),_=0;_<w;_++)b[_]=arguments[_];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(T){if(T.__quill&&T.__quill.emitter){var E;(E=T.__quill.emitter).handleDOM.apply(E,b)}})})});var x=function(y){v(w,y);function w(){h(this,w);var b=p(this,(w.__proto__||Object.getPrototypeOf(w)).call(this));return b.listeners={},b.on("error",m.error),b}return s(w,[{key:"emit",value:function(){m.log.apply(m,arguments),i(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(_){for(var T=arguments.length,E=Array(T>1?T-1:0),C=1;C<T;C++)E[C-1]=arguments[C];(this.listeners[_.type]||[]).forEach(function(P){var N=P.node,k=P.handler;(_.target===N||N.contains(_.target))&&k.apply(void 0,[_].concat(E))})}},{key:"listenDOM",value:function(_,T,E){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:T,handler:E})}}]),w}(l.default);x.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},x.sources={API:"api",SILENT:"silent",USER:"user"},n.default=x},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});function s(o,l){if(!(o instanceof l))throw new TypeError("Cannot call a class as a function")}var i=function o(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,o),this.quill=l,this.options=u};i.DEFAULTS={},n.default=i},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=["error","warn","log","info"],i="warn";function o(u){if(s.indexOf(u)<=s.indexOf(i)){for(var f,d=arguments.length,h=Array(d>1?d-1:0),p=1;p<d;p++)h[p-1]=arguments[p];(f=console)[u].apply(f,h)}}function l(u){return s.reduce(function(f,d){return f[d]=o.bind(console,d,u),f},{})}o.level=l.level=function(u){i=u},n.default=l},function(r,n,a){var s=Array.prototype.slice,i=a(52),o=a(53),l=r.exports=function(h,p,v){return v||(v={}),h===p?!0:h instanceof Date&&p instanceof Date?h.getTime()===p.getTime():!h||!p||typeof h!="object"&&typeof p!="object"?v.strict?h===p:h==p:d(h,p,v)};function u(h){return h==null}function f(h){return!(!h||typeof h!="object"||typeof h.length!="number"||typeof h.copy!="function"||typeof h.slice!="function"||h.length>0&&typeof h[0]!="number")}function d(h,p,v){var m,g;if(u(h)||u(p)||h.prototype!==p.prototype)return!1;if(o(h))return o(p)?(h=s.call(h),p=s.call(p),l(h,p,v)):!1;if(f(h)){if(!f(p)||h.length!==p.length)return!1;for(m=0;m<h.length;m++)if(h[m]!==p[m])return!1;return!0}try{var x=i(h),y=i(p)}catch{return!1}if(x.length!=y.length)return!1;for(x.sort(),y.sort(),m=x.length-1;m>=0;m--)if(x[m]!=y[m])return!1;for(m=x.length-1;m>=0;m--)if(g=x[m],!l(h[g],p[g],v))return!1;return typeof h==typeof p}},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(1),i=function(){function o(l,u,f){f===void 0&&(f={}),this.attrName=l,this.keyName=u;var d=s.Scope.TYPE&s.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&s.Scope.LEVEL|d:this.scope=s.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return o.keys=function(l){return[].map.call(l.attributes,function(u){return u.name})},o.prototype.add=function(l,u){return this.canAdd(l,u)?(l.setAttribute(this.keyName,u),!0):!1},o.prototype.canAdd=function(l,u){var f=s.query(l,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return f==null?!1:this.whitelist==null?!0:typeof u=="string"?this.whitelist.indexOf(u.replace(/["']/g,""))>-1:this.whitelist.indexOf(u)>-1},o.prototype.remove=function(l){l.removeAttribute(this.keyName)},o.prototype.value=function(l){var u=l.getAttribute(this.keyName);return this.canAdd(l,u)&&u?u:""},o}();n.default=i},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var s=function(){function C(P,N){var k=[],A=!0,I=!1,M=void 0;try{for(var U=P[Symbol.iterator](),W;!(A=(W=U.next()).done)&&(k.push(W.value),!(N&&k.length===N));A=!0);}catch(G){I=!0,M=G}finally{try{!A&&U.return&&U.return()}finally{if(I)throw M}}return k}return function(P,N){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return C(P,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function C(P,N){for(var k=0;k<N.length;k++){var A=N[k];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(P,A.key,A)}}return function(P,N,k){return N&&C(P.prototype,N),k&&C(P,k),P}}(),o=function C(P,N,k){P===null&&(P=Function.prototype);var A=Object.getOwnPropertyDescriptor(P,N);if(A===void 0){var I=Object.getPrototypeOf(P);return I===null?void 0:C(I,N,k)}else{if("value"in A)return A.value;var M=A.get;return M===void 0?void 0:M.call(k)}},l=a(2),u=y(l),f=a(0),d=y(f),h=a(4),p=y(h),v=a(6),m=y(v),g=a(7),x=y(g);function y(C){return C&&C.__esModule?C:{default:C}}function w(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function b(C,P){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:C}function _(C,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);C.prototype=Object.create(P&&P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(C,P):C.__proto__=P)}var T=function(C){_(P,C);function P(){return w(this,P),b(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return P}(m.default);T.blotName="code",T.tagName="CODE";var E=function(C){_(P,C);function P(){return w(this,P),b(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return i(P,[{key:"delta",value:function(){var k=this,A=this.domNode.textContent;return A.endsWith(`
`)&&(A=A.slice(0,-1)),A.split(`
`).reduce(function(I,M){return I.insert(M).insert(`
`,k.formats())},new u.default)}},{key:"format",value:function(k,A){if(!(k===this.statics.blotName&&A)){var I=this.descendant(x.default,this.length()-1),M=s(I,1),U=M[0];U!=null&&U.deleteAt(U.length()-1,1),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,k,A)}}},{key:"formatAt",value:function(k,A,I,M){if(A!==0&&!(d.default.query(I,d.default.Scope.BLOCK)==null||I===this.statics.blotName&&M===this.statics.formats(this.domNode))){var U=this.newlineIndex(k);if(!(U<0||U>=k+A)){var W=this.newlineIndex(k,!0)+1,G=U-W+1,Q=this.isolate(W,G),R=Q.next;Q.format(I,M),R instanceof P&&R.formatAt(0,k-W+A-G,I,M)}}}},{key:"insertAt",value:function(k,A,I){if(I==null){var M=this.descendant(x.default,k),U=s(M,2),W=U[0],G=U[1];W.insertAt(G,A)}}},{key:"length",value:function(){var k=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
`)?k:k+1}},{key:"newlineIndex",value:function(k){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(A)return this.domNode.textContent.slice(0,k).lastIndexOf(`
`);var I=this.domNode.textContent.slice(k).indexOf(`
`);return I>-1?k+I:-1}},{key:"optimize",value:function(k){this.domNode.textContent.endsWith(`
`)||this.appendChild(d.default.create("text",`
`)),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,k);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===A.statics.formats(A.domNode)&&(A.optimize(k),A.moveChildren(this),A.remove())}},{key:"replace",value:function(k){o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,k),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(A){var I=d.default.find(A);I==null?A.parentNode.removeChild(A):I instanceof d.default.Embed?I.remove():I.unwrap()})}}],[{key:"create",value:function(k){var A=o(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,k);return A.setAttribute("spellcheck",!1),A}},{key:"formats",value:function(){return!0}}]),P}(p.default);E.blotName="code-block",E.tagName="PRE",E.TAB=" ",n.Code=T,n.default=E},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},i=function(){function R(z,D){var O=[],j=!0,B=!1,L=void 0;try{for(var F=z[Symbol.iterator](),H;!(j=(H=F.next()).done)&&(O.push(H.value),!(D&&O.length===D));j=!0);}catch(Z){B=!0,L=Z}finally{try{!j&&F.return&&F.return()}finally{if(B)throw L}}return O}return function(z,D){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return R(z,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function R(z,D){for(var O=0;O<D.length;O++){var j=D[O];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(z,j.key,j)}}return function(z,D,O){return D&&R(z.prototype,D),O&&R(z,O),z}}(),l=a(2),u=A(l),f=a(20),d=A(f),h=a(0),p=A(h),v=a(13),m=A(v),g=a(24),x=A(g),y=a(4),w=A(y),b=a(16),_=A(b),T=a(21),E=A(T),C=a(11),P=A(C),N=a(3),k=A(N);function A(R){return R&&R.__esModule?R:{default:R}}function I(R,z,D){return z in R?Object.defineProperty(R,z,{value:D,enumerable:!0,configurable:!0,writable:!0}):R[z]=D,R}function M(R,z){if(!(R instanceof z))throw new TypeError("Cannot call a class as a function")}var U=/^[ -~]*$/,W=function(){function R(z){M(this,R),this.scroll=z,this.delta=this.getDelta()}return o(R,[{key:"applyDelta",value:function(D){var O=this,j=!1;this.scroll.update();var B=this.scroll.length();return this.scroll.batchStart(),D=Q(D),D.reduce(function(L,F){var H=F.retain||F.delete||F.insert.length||1,Z=F.attributes||{};if(F.insert!=null){if(typeof F.insert=="string"){var X=F.insert;X.endsWith(`
`)&&j&&(j=!1,X=X.slice(0,-1)),L>=B&&!X.endsWith(`
`)&&(j=!0),O.scroll.insertAt(L,X);var ne=O.scroll.line(L),he=i(ne,2),V=he[0],Te=he[1],Ee=(0,k.default)({},(0,y.bubbleFormats)(V));if(V instanceof w.default){var xe=V.descendant(p.default.Leaf,Te),Se=i(xe,1),pe=Se[0];Ee=(0,k.default)(Ee,(0,y.bubbleFormats)(pe))}Z=d.default.attributes.diff(Ee,Z)||{}}else if(s(F.insert)==="object"){var le=Object.keys(F.insert)[0];if(le==null)return L;O.scroll.insertAt(L,le,F.insert[le])}B+=H}return Object.keys(Z).forEach(function(ue){O.scroll.formatAt(L,H,ue,Z[ue])}),L+H},0),D.reduce(function(L,F){return typeof F.delete=="number"?(O.scroll.deleteAt(L,F.delete),L):L+(F.retain||F.insert.length||1)},0),this.scroll.batchEnd(),this.update(D)}},{key:"deleteText",value:function(D,O){return this.scroll.deleteAt(D,O),this.update(new u.default().retain(D).delete(O))}},{key:"formatLine",value:function(D,O){var j=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(B).forEach(function(L){if(!(j.scroll.whitelist!=null&&!j.scroll.whitelist[L])){var F=j.scroll.lines(D,Math.max(O,1)),H=O;F.forEach(function(Z){var X=Z.length();if(!(Z instanceof m.default))Z.format(L,B[L]);else{var ne=D-Z.offset(j.scroll),he=Z.newlineIndex(ne+H)-ne+1;Z.formatAt(ne,he,L,B[L])}H-=X})}}),this.scroll.optimize(),this.update(new u.default().retain(D).retain(O,(0,E.default)(B)))}},{key:"formatText",value:function(D,O){var j=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(B).forEach(function(L){j.scroll.formatAt(D,O,L,B[L])}),this.update(new u.default().retain(D).retain(O,(0,E.default)(B)))}},{key:"getContents",value:function(D,O){return this.delta.slice(D,D+O)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(D,O){return D.concat(O.delta())},new u.default)}},{key:"getFormat",value:function(D){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=[],B=[];O===0?this.scroll.path(D).forEach(function(F){var H=i(F,1),Z=H[0];Z instanceof w.default?j.push(Z):Z instanceof p.default.Leaf&&B.push(Z)}):(j=this.scroll.lines(D,O),B=this.scroll.descendants(p.default.Leaf,D,O));var L=[j,B].map(function(F){if(F.length===0)return{};for(var H=(0,y.bubbleFormats)(F.shift());Object.keys(H).length>0;){var Z=F.shift();if(Z==null)return H;H=G((0,y.bubbleFormats)(Z),H)}return H});return k.default.apply(k.default,L)}},{key:"getText",value:function(D,O){return this.getContents(D,O).filter(function(j){return typeof j.insert=="string"}).map(function(j){return j.insert}).join("")}},{key:"insertEmbed",value:function(D,O,j){return this.scroll.insertAt(D,O,j),this.update(new u.default().retain(D).insert(I({},O,j)))}},{key:"insertText",value:function(D,O){var j=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return O=O.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(D,O),Object.keys(B).forEach(function(L){j.scroll.formatAt(D,O.length,L,B[L])}),this.update(new u.default().retain(D).insert(O,(0,E.default)(B)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var D=this.scroll.children.head;return D.statics.blotName!==w.default.blotName||D.children.length>1?!1:D.children.head instanceof _.default}},{key:"removeFormat",value:function(D,O){var j=this.getText(D,O),B=this.scroll.line(D+O),L=i(B,2),F=L[0],H=L[1],Z=0,X=new u.default;F!=null&&(F instanceof m.default?Z=F.newlineIndex(H)-H+1:Z=F.length()-H,X=F.delta().slice(H,H+Z-1).insert(`
`));var ne=this.getContents(D,O+Z),he=ne.diff(new u.default().insert(j).concat(X)),V=new u.default().retain(D).concat(he);return this.applyDelta(V)}},{key:"update",value:function(D){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,B=this.delta;if(O.length===1&&O[0].type==="characterData"&&O[0].target.data.match(U)&&p.default.find(O[0].target)){var L=p.default.find(O[0].target),F=(0,y.bubbleFormats)(L),H=L.offset(this.scroll),Z=O[0].oldValue.replace(x.default.CONTENTS,""),X=new u.default().insert(Z),ne=new u.default().insert(L.value()),he=new u.default().retain(H).concat(X.diff(ne,j));D=he.reduce(function(V,Te){return Te.insert?V.insert(Te.insert,F):V.push(Te)},new u.default),this.delta=B.compose(D)}else this.delta=this.getDelta(),(!D||!(0,P.default)(B.compose(D),this.delta))&&(D=B.diff(this.delta,j));return D}}]),R}();function G(R,z){return Object.keys(z).reduce(function(D,O){return R[O]==null||(z[O]===R[O]?D[O]=z[O]:Array.isArray(z[O])?z[O].indexOf(R[O])<0&&(D[O]=z[O].concat([R[O]])):D[O]=[z[O],R[O]]),D},{})}function Q(R){return R.reduce(function(z,D){if(D.insert===1){var O=(0,E.default)(D.attributes);return delete O.image,z.insert({image:D.attributes.image},O)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,E.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var j=D.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return z.insert(j,D.attributes)}return z.push(D)},new u.default)}n.default=W},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var s=function(){function C(P,N){var k=[],A=!0,I=!1,M=void 0;try{for(var U=P[Symbol.iterator](),W;!(A=(W=U.next()).done)&&(k.push(W.value),!(N&&k.length===N));A=!0);}catch(G){I=!0,M=G}finally{try{!A&&U.return&&U.return()}finally{if(I)throw M}}return k}return function(P,N){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return C(P,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function C(P,N){for(var k=0;k<N.length;k++){var A=N[k];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(P,A.key,A)}}return function(P,N,k){return N&&C(P.prototype,N),k&&C(P,k),P}}(),o=a(0),l=x(o),u=a(21),f=x(u),d=a(11),h=x(d),p=a(8),v=x(p),m=a(10),g=x(m);function x(C){return C&&C.__esModule?C:{default:C}}function y(C){if(Array.isArray(C)){for(var P=0,N=Array(C.length);P<C.length;P++)N[P]=C[P];return N}else return Array.from(C)}function w(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}var b=(0,g.default)("quill:selection"),_=function C(P){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;w(this,C),this.index=P,this.length=N},T=function(){function C(P,N){var k=this;w(this,C),this.emitter=N,this.scroll=P,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=l.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){k.mouseDown||setTimeout(k.update.bind(k,v.default.sources.USER),1)}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(A,I){A===v.default.events.TEXT_CHANGE&&I.length()>0&&k.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){if(k.hasFocus()){var A=k.getNativeRange();A!=null&&A.start.node!==k.cursor.textNode&&k.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{k.setNativeRange(A.start.node,A.start.offset,A.end.node,A.end.offset)}catch{}})}}),this.emitter.on(v.default.events.SCROLL_OPTIMIZE,function(A,I){if(I.range){var M=I.range,U=M.startNode,W=M.startOffset,G=M.endNode,Q=M.endOffset;k.setNativeRange(U,W,G,Q)}}),this.update(v.default.sources.SILENT)}return i(C,[{key:"handleComposition",value:function(){var N=this;this.root.addEventListener("compositionstart",function(){N.composing=!0}),this.root.addEventListener("compositionend",function(){if(N.composing=!1,N.cursor.parent){var k=N.cursor.restore();if(!k)return;setTimeout(function(){N.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var N=this;this.emitter.listenDOM("mousedown",document.body,function(){N.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){N.mouseDown=!1,N.update(v.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(N,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[N])){this.scroll.update();var A=this.getNativeRange();if(!(A==null||!A.native.collapsed||l.default.query(N,l.default.Scope.BLOCK))){if(A.start.node!==this.cursor.textNode){var I=l.default.find(A.start.node,!1);if(I==null)return;if(I instanceof l.default.Leaf){var M=I.split(A.start.offset);I.parent.insertBefore(this.cursor,M)}else I.insertBefore(this.cursor,A.start.node);this.cursor.attach()}this.cursor.format(N,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=this.scroll.length();N=Math.min(N,A-1),k=Math.min(N+k,A-1)-N;var I=void 0,M=this.scroll.leaf(N),U=s(M,2),W=U[0],G=U[1];if(W==null)return null;var Q=W.position(G,!0),R=s(Q,2);I=R[0],G=R[1];var z=document.createRange();if(k>0){z.setStart(I,G);var D=this.scroll.leaf(N+k),O=s(D,2);if(W=O[0],G=O[1],W==null)return null;var j=W.position(G,!0),B=s(j,2);return I=B[0],G=B[1],z.setEnd(I,G),z.getBoundingClientRect()}else{var L="left",F=void 0;return I instanceof Text?(G<I.data.length?(z.setStart(I,G),z.setEnd(I,G+1)):(z.setStart(I,G-1),z.setEnd(I,G),L="right"),F=z.getBoundingClientRect()):(F=W.domNode.getBoundingClientRect(),G>0&&(L="right")),{bottom:F.top+F.height,height:F.height,left:F[L],right:F[L],top:F.top,width:0}}}},{key:"getNativeRange",value:function(){var N=document.getSelection();if(N==null||N.rangeCount<=0)return null;var k=N.getRangeAt(0);if(k==null)return null;var A=this.normalizeNative(k);return b.info("getNativeRange",A),A}},{key:"getRange",value:function(){var N=this.getNativeRange();if(N==null)return[null,null];var k=this.normalizedToRange(N);return[k,N]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(N){var k=this,A=[[N.start.node,N.start.offset]];N.native.collapsed||A.push([N.end.node,N.end.offset]);var I=A.map(function(W){var G=s(W,2),Q=G[0],R=G[1],z=l.default.find(Q,!0),D=z.offset(k.scroll);return R===0?D:z instanceof l.default.Container?D+z.length():D+z.index(Q,R)}),M=Math.min(Math.max.apply(Math,y(I)),this.scroll.length()-1),U=Math.min.apply(Math,[M].concat(y(I)));return new _(U,M-U)}},{key:"normalizeNative",value:function(N){if(!E(this.root,N.startContainer)||!N.collapsed&&!E(this.root,N.endContainer))return null;var k={start:{node:N.startContainer,offset:N.startOffset},end:{node:N.endContainer,offset:N.endOffset},native:N};return[k.start,k.end].forEach(function(A){for(var I=A.node,M=A.offset;!(I instanceof Text)&&I.childNodes.length>0;)if(I.childNodes.length>M)I=I.childNodes[M],M=0;else if(I.childNodes.length===M)I=I.lastChild,M=I instanceof Text?I.data.length:I.childNodes.length+1;else break;A.node=I,A.offset=M}),k}},{key:"rangeToNative",value:function(N){var k=this,A=N.collapsed?[N.index]:[N.index,N.index+N.length],I=[],M=this.scroll.length();return A.forEach(function(U,W){U=Math.min(M-1,U);var G=void 0,Q=k.scroll.leaf(U),R=s(Q,2),z=R[0],D=R[1],O=z.position(D,W!==0),j=s(O,2);G=j[0],D=j[1],I.push(G,D)}),I.length<2&&(I=I.concat(I)),I}},{key:"scrollIntoView",value:function(N){var k=this.lastRange;if(k!=null){var A=this.getBounds(k.index,k.length);if(A!=null){var I=this.scroll.length()-1,M=this.scroll.line(Math.min(k.index,I)),U=s(M,1),W=U[0],G=W;if(k.length>0){var Q=this.scroll.line(Math.min(k.index+k.length,I)),R=s(Q,1);G=R[0]}if(!(W==null||G==null)){var z=N.getBoundingClientRect();A.top<z.top?N.scrollTop-=z.top-A.top:A.bottom>z.bottom&&(N.scrollTop+=A.bottom-z.bottom)}}}}},{key:"setNativeRange",value:function(N,k){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:N,I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,M=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(b.info("setNativeRange",N,k,A,I),!(N!=null&&(this.root.parentNode==null||N.parentNode==null||A.parentNode==null))){var U=document.getSelection();if(U!=null)if(N!=null){this.hasFocus()||this.root.focus();var W=(this.getNativeRange()||{}).native;if(W==null||M||N!==W.startContainer||k!==W.startOffset||A!==W.endContainer||I!==W.endOffset){N.tagName=="BR"&&(k=[].indexOf.call(N.parentNode.childNodes,N),N=N.parentNode),A.tagName=="BR"&&(I=[].indexOf.call(A.parentNode.childNodes,A),A=A.parentNode);var G=document.createRange();G.setStart(N,k),G.setEnd(A,I),U.removeAllRanges(),U.addRange(G)}}else U.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(N){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;if(typeof k=="string"&&(A=k,k=!1),b.info("setRange",N),N!=null){var I=this.rangeToNative(N);this.setNativeRange.apply(this,y(I).concat([k]))}else this.setNativeRange(null);this.update(A)}},{key:"update",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v.default.sources.USER,k=this.lastRange,A=this.getRange(),I=s(A,2),M=I[0],U=I[1];if(this.lastRange=M,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,h.default)(k,this.lastRange)){var W;!this.composing&&U!=null&&U.native.collapsed&&U.start.node!==this.cursor.textNode&&this.cursor.restore();var G=[v.default.events.SELECTION_CHANGE,(0,f.default)(this.lastRange),(0,f.default)(k),N];if((W=this.emitter).emit.apply(W,[v.default.events.EDITOR_CHANGE].concat(G)),N!==v.default.sources.SILENT){var Q;(Q=this.emitter).emit.apply(Q,G)}}}}]),C}();function E(C,P){try{P.parentNode}catch{return!1}return P instanceof Text&&(P=P.parentNode),C.contains(P)}n.Range=_,n.default=T},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function v(m,g){for(var x=0;x<g.length;x++){var y=g[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,g,x){return g&&v(m.prototype,g),x&&v(m,x),m}}(),i=function v(m,g,x){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,g);if(y===void 0){var w=Object.getPrototypeOf(m);return w===null?void 0:v(w,g,x)}else{if("value"in y)return y.value;var b=y.get;return b===void 0?void 0:b.call(x)}},o=a(0),l=u(o);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function d(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function h(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){h(m,v);function m(){return f(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"insertInto",value:function(x,y){x.children.length===0?i(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertInto",this).call(this,x,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),m}(l.default.Embed);p.blotName="break",p.tagName="BR",n.default=p},function(r,n,a){var s=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){d(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(44),o=a(30),l=a(1),u=function(d){s(h,d);function h(p){var v=d.call(this,p)||this;return v.build(),v}return h.prototype.appendChild=function(p){this.insertBefore(p)},h.prototype.attach=function(){d.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},h.prototype.build=function(){var p=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(v){try{var m=f(v);p.insertBefore(m,p.children.head||void 0)}catch(g){if(g instanceof l.ParchmentError)return;throw g}})},h.prototype.deleteAt=function(p,v){if(p===0&&v===this.length())return this.remove();this.children.forEachAt(p,v,function(m,g,x){m.deleteAt(g,x)})},h.prototype.descendant=function(p,v){var m=this.children.find(v),g=m[0],x=m[1];return p.blotName==null&&p(g)||p.blotName!=null&&g instanceof p?[g,x]:g instanceof h?g.descendant(p,x):[null,-1]},h.prototype.descendants=function(p,v,m){v===void 0&&(v=0),m===void 0&&(m=Number.MAX_VALUE);var g=[],x=m;return this.children.forEachAt(v,m,function(y,w,b){(p.blotName==null&&p(y)||p.blotName!=null&&y instanceof p)&&g.push(y),y instanceof h&&(g=g.concat(y.descendants(p,w,x))),x-=b}),g},h.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),d.prototype.detach.call(this)},h.prototype.formatAt=function(p,v,m,g){this.children.forEachAt(p,v,function(x,y,w){x.formatAt(y,w,m,g)})},h.prototype.insertAt=function(p,v,m){var g=this.children.find(p),x=g[0],y=g[1];if(x)x.insertAt(y,v,m);else{var w=m==null?l.create("text",v):l.create(v,m);this.appendChild(w)}},h.prototype.insertBefore=function(p,v){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(m){return p instanceof m}))throw new l.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,v)},h.prototype.length=function(){return this.children.reduce(function(p,v){return p+v.length()},0)},h.prototype.moveChildren=function(p,v){this.children.forEach(function(m){p.insertBefore(m,v)})},h.prototype.optimize=function(p){if(d.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var v=l.create(this.statics.defaultChild);this.appendChild(v),v.optimize(p)}else this.remove()},h.prototype.path=function(p,v){v===void 0&&(v=!1);var m=this.children.find(p,v),g=m[0],x=m[1],y=[[this,p]];return g instanceof h?y.concat(g.path(x,v)):(g!=null&&y.push([g,x]),y)},h.prototype.removeChild=function(p){this.children.remove(p)},h.prototype.replace=function(p){p instanceof h&&p.moveChildren(this),d.prototype.replace.call(this,p)},h.prototype.split=function(p,v){if(v===void 0&&(v=!1),!v){if(p===0)return this;if(p===this.length())return this.next}var m=this.clone();return this.parent.insertBefore(m,this.next),this.children.forEachAt(p,this.length(),function(g,x,y){g=g.split(x,v),m.appendChild(g)}),m},h.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},h.prototype.update=function(p,v){var m=this,g=[],x=[];p.forEach(function(y){y.target===m.domNode&&y.type==="childList"&&(g.push.apply(g,y.addedNodes),x.push.apply(x,y.removedNodes))}),x.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var w=l.find(y);w!=null&&(w.domNode.parentNode==null||w.domNode.parentNode===m.domNode)&&w.detach()}}),g.filter(function(y){return y.parentNode==m.domNode}).sort(function(y,w){return y===w?0:y.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var w=null;y.nextSibling!=null&&(w=l.find(y.nextSibling));var b=f(y);(b.next!=w||b.next==null)&&(b.parent!=null&&b.parent.removeChild(m),m.insertBefore(b,w||void 0))})},h}(o.default);function f(d){var h=l.find(d);if(h==null)try{h=l.create(d)}catch{h=l.create(l.Scope.INLINE),[].slice.call(d.childNodes).forEach(function(v){h.domNode.appendChild(v)}),d.parentNode&&d.parentNode.replaceChild(h.domNode,d),h.attach()}return h}n.default=u},function(r,n,a){var s=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){d(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(12),o=a(31),l=a(17),u=a(1),f=function(d){s(h,d);function h(p){var v=d.call(this,p)||this;return v.attributes=new o.default(v.domNode),v}return h.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},h.prototype.format=function(p,v){var m=u.query(p);m instanceof i.default?this.attributes.attribute(m,v):v&&m!=null&&(p!==this.statics.blotName||this.formats()[p]!==v)&&this.replaceWith(p,v)},h.prototype.formats=function(){var p=this.attributes.values(),v=this.statics.formats(this.domNode);return v!=null&&(p[this.statics.blotName]=v),p},h.prototype.replaceWith=function(p,v){var m=d.prototype.replaceWith.call(this,p,v);return this.attributes.copy(m),m},h.prototype.update=function(p,v){var m=this;d.prototype.update.call(this,p,v),p.some(function(g){return g.target===m.domNode&&g.type==="attributes"})&&this.attributes.build()},h.prototype.wrap=function(p,v){var m=d.prototype.wrap.call(this,p,v);return m instanceof h&&m.statics.scope===this.statics.scope&&this.attributes.move(m),m},h}(l.default);n.default=f},function(r,n,a){var s=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var h in d)d.hasOwnProperty(h)&&(f[h]=d[h])};return function(f,d){u(f,d);function h(){this.constructor=f}f.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(30),o=a(1),l=function(u){s(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.value=function(d){return!0},f.prototype.index=function(d,h){return this.domNode===d||this.domNode.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(h,1):-1},f.prototype.position=function(d,h){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return d>0&&(p+=1),[this.parent.domNode,p]},f.prototype.value=function(){var d;return d={},d[this.statics.blotName]=this.statics.value(this.domNode)||!0,d},f.scope=o.Scope.INLINE_BLOT,f}(i.default);n.default=l},function(r,n,a){var s=a(11),i=a(3),o={attributes:{compose:function(u,f,d){typeof u!="object"&&(u={}),typeof f!="object"&&(f={});var h=i(!0,{},f);d||(h=Object.keys(h).reduce(function(v,m){return h[m]!=null&&(v[m]=h[m]),v},{}));for(var p in u)u[p]!==void 0&&f[p]===void 0&&(h[p]=u[p]);return Object.keys(h).length>0?h:void 0},diff:function(u,f){typeof u!="object"&&(u={}),typeof f!="object"&&(f={});var d=Object.keys(u).concat(Object.keys(f)).reduce(function(h,p){return s(u[p],f[p])||(h[p]=f[p]===void 0?null:f[p]),h},{});return Object.keys(d).length>0?d:void 0},transform:function(u,f,d){if(typeof u!="object")return f;if(typeof f=="object"){if(!d)return f;var h=Object.keys(f).reduce(function(p,v){return u[v]===void 0&&(p[v]=f[v]),p},{});return Object.keys(h).length>0?h:void 0}}},iterator:function(u){return new l(u)},length:function(u){return typeof u.delete=="number"?u.delete:typeof u.retain=="number"?u.retain:typeof u.insert=="string"?u.insert.length:1}};function l(u){this.ops=u,this.index=0,this.offset=0}l.prototype.hasNext=function(){return this.peekLength()<1/0},l.prototype.next=function(u){u||(u=1/0);var f=this.ops[this.index];if(f){var d=this.offset,h=o.length(f);if(u>=h-d?(u=h-d,this.index+=1,this.offset=0):this.offset+=u,typeof f.delete=="number")return{delete:u};var p={};return f.attributes&&(p.attributes=f.attributes),typeof f.retain=="number"?p.retain=u:typeof f.insert=="string"?p.insert=f.insert.substr(d,u):p.insert=f.insert,p}else return{retain:1/0}},l.prototype.peek=function(){return this.ops[this.index]},l.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},l.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},l.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var u=this.offset,f=this.index,d=this.next(),h=this.ops.slice(this.index);return this.offset=u,this.index=f,[d].concat(h)}else return[]},r.exports=o},function(r,n){var a=function(){function s(m,g){return g!=null&&m instanceof g}var i;try{i=Map}catch{i=function(){}}var o;try{o=Set}catch{o=function(){}}var l;try{l=Promise}catch{l=function(){}}function u(m,g,x,y,w){typeof g=="object"&&(x=g.depth,y=g.prototype,w=g.includeNonEnumerable,g=g.circular);var b=[],_=[],T=typeof Buffer<"u";typeof g>"u"&&(g=!0),typeof x>"u"&&(x=1/0);function E(C,P){if(C===null)return null;if(P===0)return C;var N,k;if(typeof C!="object")return C;if(s(C,i))N=new i;else if(s(C,o))N=new o;else if(s(C,l))N=new l(function(z,D){C.then(function(O){z(E(O,P-1))},function(O){D(E(O,P-1))})});else if(u.__isArray(C))N=[];else if(u.__isRegExp(C))N=new RegExp(C.source,v(C)),C.lastIndex&&(N.lastIndex=C.lastIndex);else if(u.__isDate(C))N=new Date(C.getTime());else{if(T&&Buffer.isBuffer(C))return Buffer.allocUnsafe?N=Buffer.allocUnsafe(C.length):N=new Buffer(C.length),C.copy(N),N;s(C,Error)?N=Object.create(C):typeof y>"u"?(k=Object.getPrototypeOf(C),N=Object.create(k)):(N=Object.create(y),k=y)}if(g){var A=b.indexOf(C);if(A!=-1)return _[A];b.push(C),_.push(N)}s(C,i)&&C.forEach(function(z,D){var O=E(D,P-1),j=E(z,P-1);N.set(O,j)}),s(C,o)&&C.forEach(function(z){var D=E(z,P-1);N.add(D)});for(var I in C){var M;k&&(M=Object.getOwnPropertyDescriptor(k,I)),!(M&&M.set==null)&&(N[I]=E(C[I],P-1))}if(Object.getOwnPropertySymbols)for(var U=Object.getOwnPropertySymbols(C),I=0;I<U.length;I++){var W=U[I],G=Object.getOwnPropertyDescriptor(C,W);G&&!G.enumerable&&!w||(N[W]=E(C[W],P-1),G.enumerable||Object.defineProperty(N,W,{enumerable:!1}))}if(w)for(var Q=Object.getOwnPropertyNames(C),I=0;I<Q.length;I++){var R=Q[I],G=Object.getOwnPropertyDescriptor(C,R);G&&G.enumerable||(N[R]=E(C[R],P-1),Object.defineProperty(N,R,{enumerable:!1}))}return N}return E(m,x)}u.clonePrototype=function(g){if(g===null)return null;var x=function(){};return x.prototype=g,new x};function f(m){return Object.prototype.toString.call(m)}u.__objToStr=f;function d(m){return typeof m=="object"&&f(m)==="[object Date]"}u.__isDate=d;function h(m){return typeof m=="object"&&f(m)==="[object Array]"}u.__isArray=h;function p(m){return typeof m=="object"&&f(m)==="[object RegExp]"}u.__isRegExp=p;function v(m){var g="";return m.global&&(g+="g"),m.ignoreCase&&(g+="i"),m.multiline&&(g+="m"),g}return u.__getRegExpFlags=v,u}();typeof r=="object"&&r.exports&&(r.exports=a)},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function N(k,A){var I=[],M=!0,U=!1,W=void 0;try{for(var G=k[Symbol.iterator](),Q;!(M=(Q=G.next()).done)&&(I.push(Q.value),!(A&&I.length===A));M=!0);}catch(R){U=!0,W=R}finally{try{!M&&G.return&&G.return()}finally{if(U)throw W}}return I}return function(k,A){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return N(k,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function N(k,A){for(var I=0;I<A.length;I++){var M=A[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(k,M.key,M)}}return function(k,A,I){return A&&N(k.prototype,A),I&&N(k,I),k}}(),o=function N(k,A,I){k===null&&(k=Function.prototype);var M=Object.getOwnPropertyDescriptor(k,A);if(M===void 0){var U=Object.getPrototypeOf(k);return U===null?void 0:N(U,A,I)}else{if("value"in M)return M.value;var W=M.get;return W===void 0?void 0:W.call(I)}},l=a(0),u=b(l),f=a(8),d=b(f),h=a(4),p=b(h),v=a(16),m=b(v),g=a(13),x=b(g),y=a(25),w=b(y);function b(N){return N&&N.__esModule?N:{default:N}}function _(N,k){if(!(N instanceof k))throw new TypeError("Cannot call a class as a function")}function T(N,k){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:N}function E(N,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);N.prototype=Object.create(k&&k.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(N,k):N.__proto__=k)}function C(N){return N instanceof p.default||N instanceof h.BlockEmbed}var P=function(N){E(k,N);function k(A,I){_(this,k);var M=T(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,A));return M.emitter=I.emitter,Array.isArray(I.whitelist)&&(M.whitelist=I.whitelist.reduce(function(U,W){return U[W]=!0,U},{})),M.domNode.addEventListener("DOMNodeInserted",function(){}),M.optimize(),M.enable(),M}return i(k,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(I,M){var U=this.line(I),W=s(U,2),G=W[0],Q=W[1],R=this.line(I+M),z=s(R,1),D=z[0];if(o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,I,M),D!=null&&G!==D&&Q>0){if(G instanceof h.BlockEmbed||D instanceof h.BlockEmbed){this.optimize();return}if(G instanceof x.default){var O=G.newlineIndex(G.length(),!0);if(O>-1&&(G=G.split(O+1),G===D)){this.optimize();return}}else if(D instanceof x.default){var j=D.newlineIndex(0);j>-1&&D.split(j+1)}var B=D.children.head instanceof m.default?null:D.children.head;G.moveChildren(D,B),G.remove()}this.optimize()}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",I)}},{key:"formatAt",value:function(I,M,U,W){this.whitelist!=null&&!this.whitelist[U]||(o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,I,M,U,W),this.optimize())}},{key:"insertAt",value:function(I,M,U){if(!(U!=null&&this.whitelist!=null&&!this.whitelist[M])){if(I>=this.length())if(U==null||u.default.query(M,u.default.Scope.BLOCK)==null){var W=u.default.create(this.statics.defaultChild);this.appendChild(W),U==null&&M.endsWith(`
`)&&(M=M.slice(0,-1)),W.insertAt(0,M,U)}else{var G=u.default.create(M,U);this.appendChild(G)}else o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,I,M,U);this.optimize()}}},{key:"insertBefore",value:function(I,M){if(I.statics.scope===u.default.Scope.INLINE_BLOT){var U=u.default.create(this.statics.defaultChild);U.appendChild(I),I=U}o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,I,M)}},{key:"leaf",value:function(I){return this.path(I).pop()||[null,-1]}},{key:"line",value:function(I){return I===this.length()?this.line(I-1):this.descendant(C,I)}},{key:"lines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,U=function W(G,Q,R){var z=[],D=R;return G.children.forEachAt(Q,R,function(O,j,B){C(O)?z.push(O):O instanceof u.default.Container&&(z=z.concat(W(O,j,D))),D-=B}),z};return U(this,I,M)}},{key:"optimize",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,I,M),I.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,I,M))}},{key:"path",value:function(I){return o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,I).slice(1)}},{key:"update",value:function(I){if(this.batch!==!0){var M=d.default.sources.USER;typeof I=="string"&&(M=I),Array.isArray(I)||(I=this.observer.takeRecords()),I.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,M,I),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"update",this).call(this,I.concat([])),I.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,M,I)}}}]),k}(u.default.Scroll);P.blotName="scroll",P.className="ql-editor",P.tagName="DIV",P.defaultChild="block",P.allowedChildren=[p.default,h.BlockEmbed,w.default],n.default=P},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},i=function(){function F(H,Z){var X=[],ne=!0,he=!1,V=void 0;try{for(var Te=H[Symbol.iterator](),Ee;!(ne=(Ee=Te.next()).done)&&(X.push(Ee.value),!(Z&&X.length===Z));ne=!0);}catch(xe){he=!0,V=xe}finally{try{!ne&&Te.return&&Te.return()}finally{if(he)throw V}}return X}return function(H,Z){if(Array.isArray(H))return H;if(Symbol.iterator in Object(H))return F(H,Z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function F(H,Z){for(var X=0;X<Z.length;X++){var ne=Z[X];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(H,ne.key,ne)}}return function(H,Z,X){return Z&&F(H.prototype,Z),X&&F(H,X),H}}(),l=a(21),u=N(l),f=a(11),d=N(f),h=a(3),p=N(h),v=a(2),m=N(v),g=a(20),x=N(g),y=a(0),w=N(y),b=a(5),_=N(b),T=a(10),E=N(T),C=a(9),P=N(C);function N(F){return F&&F.__esModule?F:{default:F}}function k(F,H,Z){return H in F?Object.defineProperty(F,H,{value:Z,enumerable:!0,configurable:!0,writable:!0}):F[H]=Z,F}function A(F,H){if(!(F instanceof H))throw new TypeError("Cannot call a class as a function")}function I(F,H){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return H&&(typeof H=="object"||typeof H=="function")?H:F}function M(F,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof H);F.prototype=Object.create(H&&H.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),H&&(Object.setPrototypeOf?Object.setPrototypeOf(F,H):F.__proto__=H)}var U=(0,E.default)("quill:keyboard"),W=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",G=function(F){M(H,F),o(H,null,[{key:"match",value:function(X,ne){return ne=L(ne),["altKey","ctrlKey","metaKey","shiftKey"].some(function(he){return!!ne[he]!==X[he]&&ne[he]!==null})?!1:ne.key===(X.which||X.keyCode)}}]);function H(Z,X){A(this,H);var ne=I(this,(H.__proto__||Object.getPrototypeOf(H)).call(this,Z,X));return ne.bindings={},Object.keys(ne.options.bindings).forEach(function(he){he==="list autofill"&&Z.scroll.whitelist!=null&&!Z.scroll.whitelist.list||ne.options.bindings[he]&&ne.addBinding(ne.options.bindings[he])}),ne.addBinding({key:H.keys.ENTER,shiftKey:null},O),ne.addBinding({key:H.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ne.addBinding({key:H.keys.BACKSPACE},{collapsed:!0},R),ne.addBinding({key:H.keys.DELETE},{collapsed:!0},z)):(ne.addBinding({key:H.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},R),ne.addBinding({key:H.keys.DELETE},{collapsed:!0,suffix:/^.?$/},z)),ne.addBinding({key:H.keys.BACKSPACE},{collapsed:!1},D),ne.addBinding({key:H.keys.DELETE},{collapsed:!1},D),ne.addBinding({key:H.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},R),ne.listen(),ne}return o(H,[{key:"addBinding",value:function(X){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},V=L(X);if(V==null||V.key==null)return U.warn("Attempted to add invalid keyboard binding",V);typeof ne=="function"&&(ne={handler:ne}),typeof he=="function"&&(he={handler:he}),V=(0,p.default)(V,ne,he),this.bindings[V.key]=this.bindings[V.key]||[],this.bindings[V.key].push(V)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(ne){if(!ne.defaultPrevented){var he=ne.which||ne.keyCode,V=(X.bindings[he]||[]).filter(function(Re){return H.match(ne,Re)});if(V.length!==0){var Te=X.quill.getSelection();if(!(Te==null||!X.quill.hasFocus())){var Ee=X.quill.getLine(Te.index),xe=i(Ee,2),Se=xe[0],pe=xe[1],le=X.quill.getLeaf(Te.index),ue=i(le,2),me=ue[0],_e=ue[1],ye=Te.length===0?[me,_e]:X.quill.getLeaf(Te.index+Te.length),Me=i(ye,2),Le=Me[0],$e=Me[1],tt=me instanceof w.default.Text?me.value().slice(0,_e):"",dt=Le instanceof w.default.Text?Le.value().slice($e):"",Je={collapsed:Te.length===0,empty:Te.length===0&&Se.length()<=1,format:X.quill.getFormat(Te),offset:pe,prefix:tt,suffix:dt},ur=V.some(function(Re){if(Re.collapsed!=null&&Re.collapsed!==Je.collapsed||Re.empty!=null&&Re.empty!==Je.empty||Re.offset!=null&&Re.offset!==Je.offset)return!1;if(Array.isArray(Re.format)){if(Re.format.every(function(ot){return Je.format[ot]==null}))return!1}else if(s(Re.format)==="object"&&!Object.keys(Re.format).every(function(ot){return Re.format[ot]===!0?Je.format[ot]!=null:Re.format[ot]===!1?Je.format[ot]==null:(0,d.default)(Re.format[ot],Je.format[ot])}))return!1;return Re.prefix!=null&&!Re.prefix.test(Je.prefix)||Re.suffix!=null&&!Re.suffix.test(Je.suffix)?!1:Re.handler.call(X,Te,Je)!==!0});ur&&ne.preventDefault()}}}})}}]),H}(P.default);G.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},G.DEFAULTS={bindings:{bold:B("bold"),italic:B("italic"),underline:B("underline"),indent:{key:G.keys.TAB,format:["blockquote","indent","list"],handler:function(H,Z){if(Z.collapsed&&Z.offset!==0)return!0;this.quill.format("indent","+1",_.default.sources.USER)}},outdent:{key:G.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(H,Z){if(Z.collapsed&&Z.offset!==0)return!0;this.quill.format("indent","-1",_.default.sources.USER)}},"outdent backspace":{key:G.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(H,Z){Z.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):Z.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":j(!0),"outdent code-block":j(!1),"remove tab":{key:G.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(H){this.quill.deleteText(H.index-1,1,_.default.sources.USER)}},tab:{key:G.keys.TAB,handler:function(H){this.quill.history.cutoff();var Z=new m.default().retain(H.index).delete(H.length).insert(" ");this.quill.updateContents(Z,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(H.index+1,_.default.sources.SILENT)}},"list empty enter":{key:G.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(H,Z){this.quill.format("list",!1,_.default.sources.USER),Z.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:G.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(H){var Z=this.quill.getLine(H.index),X=i(Z,2),ne=X[0],he=X[1],V=(0,p.default)({},ne.formats(),{list:"checked"}),Te=new m.default().retain(H.index).insert(`
`,V).retain(ne.length()-he-1).retain(1,{list:"unchecked"});this.quill.updateContents(Te,_.default.sources.USER),this.quill.setSelection(H.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:G.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(H,Z){var X=this.quill.getLine(H.index),ne=i(X,2),he=ne[0],V=ne[1],Te=new m.default().retain(H.index).insert(`
`,Z.format).retain(he.length()-V-1).retain(1,{header:null});this.quill.updateContents(Te,_.default.sources.USER),this.quill.setSelection(H.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(H,Z){var X=Z.prefix.length,ne=this.quill.getLine(H.index),he=i(ne,2),V=he[0],Te=he[1];if(Te>X)return!0;var Ee=void 0;switch(Z.prefix.trim()){case"[]":case"[ ]":Ee="unchecked";break;case"[x]":Ee="checked";break;case"-":case"*":Ee="bullet";break;default:Ee="ordered"}this.quill.insertText(H.index," ",_.default.sources.USER),this.quill.history.cutoff();var xe=new m.default().retain(H.index-Te).delete(X+1).retain(V.length()-2-Te).retain(1,{list:Ee});this.quill.updateContents(xe,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(H.index-X,_.default.sources.SILENT)}},"code exit":{key:G.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(H){var Z=this.quill.getLine(H.index),X=i(Z,2),ne=X[0],he=X[1],V=new m.default().retain(H.index+ne.length()-he-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(V,_.default.sources.USER)}},"embed left":Q(G.keys.LEFT,!1),"embed left shift":Q(G.keys.LEFT,!0),"embed right":Q(G.keys.RIGHT,!1),"embed right shift":Q(G.keys.RIGHT,!0)}};function Q(F,H){var Z,X=F===G.keys.LEFT?"prefix":"suffix";return Z={key:F,shiftKey:H,altKey:null},k(Z,X,/^$/),k(Z,"handler",function(he){var V=he.index;F===G.keys.RIGHT&&(V+=he.length+1);var Te=this.quill.getLeaf(V),Ee=i(Te,1),xe=Ee[0];return xe instanceof w.default.Embed?(F===G.keys.LEFT?H?this.quill.setSelection(he.index-1,he.length+1,_.default.sources.USER):this.quill.setSelection(he.index-1,_.default.sources.USER):H?this.quill.setSelection(he.index,he.length+1,_.default.sources.USER):this.quill.setSelection(he.index+he.length+1,_.default.sources.USER),!1):!0}),Z}function R(F,H){if(!(F.index===0||this.quill.getLength()<=1)){var Z=this.quill.getLine(F.index),X=i(Z,1),ne=X[0],he={};if(H.offset===0){var V=this.quill.getLine(F.index-1),Te=i(V,1),Ee=Te[0];if(Ee!=null&&Ee.length()>1){var xe=ne.formats(),Se=this.quill.getFormat(F.index-1,1);he=x.default.attributes.diff(xe,Se)||{}}}var pe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(H.prefix)?2:1;this.quill.deleteText(F.index-pe,pe,_.default.sources.USER),Object.keys(he).length>0&&this.quill.formatLine(F.index-pe,pe,he,_.default.sources.USER),this.quill.focus()}}function z(F,H){var Z=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(H.suffix)?2:1;if(!(F.index>=this.quill.getLength()-Z)){var X={},ne=0,he=this.quill.getLine(F.index),V=i(he,1),Te=V[0];if(H.offset>=Te.length()-1){var Ee=this.quill.getLine(F.index+1),xe=i(Ee,1),Se=xe[0];if(Se){var pe=Te.formats(),le=this.quill.getFormat(F.index,1);X=x.default.attributes.diff(pe,le)||{},ne=Se.length()}}this.quill.deleteText(F.index,Z,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(F.index+ne-1,Z,X,_.default.sources.USER)}}function D(F){var H=this.quill.getLines(F),Z={};if(H.length>1){var X=H[0].formats(),ne=H[H.length-1].formats();Z=x.default.attributes.diff(ne,X)||{}}this.quill.deleteText(F,_.default.sources.USER),Object.keys(Z).length>0&&this.quill.formatLine(F.index,1,Z,_.default.sources.USER),this.quill.setSelection(F.index,_.default.sources.SILENT),this.quill.focus()}function O(F,H){var Z=this;F.length>0&&this.quill.scroll.deleteAt(F.index,F.length);var X=Object.keys(H.format).reduce(function(ne,he){return w.default.query(he,w.default.Scope.BLOCK)&&!Array.isArray(H.format[he])&&(ne[he]=H.format[he]),ne},{});this.quill.insertText(F.index,`
`,X,_.default.sources.USER),this.quill.setSelection(F.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(H.format).forEach(function(ne){X[ne]==null&&(Array.isArray(H.format[ne])||ne!=="link"&&Z.quill.format(ne,H.format[ne],_.default.sources.USER))})}function j(F){return{key:G.keys.TAB,shiftKey:!F,format:{"code-block":!0},handler:function(Z){var X=w.default.query("code-block"),ne=Z.index,he=Z.length,V=this.quill.scroll.descendant(X,ne),Te=i(V,2),Ee=Te[0],xe=Te[1];if(Ee!=null){var Se=this.quill.getIndex(Ee),pe=Ee.newlineIndex(xe,!0)+1,le=Ee.newlineIndex(Se+xe+he),ue=Ee.domNode.textContent.slice(pe,le).split(`
`);xe=0,ue.forEach(function(me,_e){F?(Ee.insertAt(pe+xe,X.TAB),xe+=X.TAB.length,_e===0?ne+=X.TAB.length:he+=X.TAB.length):me.startsWith(X.TAB)&&(Ee.deleteAt(pe+xe,X.TAB.length),xe-=X.TAB.length,_e===0?ne-=X.TAB.length:he-=X.TAB.length),xe+=me.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(ne,he,_.default.sources.SILENT)}}}}function B(F){return{key:F[0].toUpperCase(),shortKey:!0,handler:function(Z,X){this.quill.format(F,!X.format[F],_.default.sources.USER)}}}function L(F){if(typeof F=="string"||typeof F=="number")return L({key:F});if((typeof F>"u"?"undefined":s(F))==="object"&&(F=(0,u.default)(F,!1)),typeof F.key=="string")if(G.keys[F.key.toUpperCase()]!=null)F.key=G.keys[F.key.toUpperCase()];else if(F.key.length===1)F.key=F.key.toUpperCase().charCodeAt(0);else return null;return F.shortKey&&(F[W]=F.shortKey,delete F.shortKey),F}n.default=G,n.SHORTKEY=W},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function x(y,w){var b=[],_=!0,T=!1,E=void 0;try{for(var C=y[Symbol.iterator](),P;!(_=(P=C.next()).done)&&(b.push(P.value),!(w&&b.length===w));_=!0);}catch(N){T=!0,E=N}finally{try{!_&&C.return&&C.return()}finally{if(T)throw E}}return b}return function(y,w){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return x(y,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function x(y,w,b){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,w);if(_===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:x(T,w,b)}else{if("value"in _)return _.value;var E=_.get;return E===void 0?void 0:E.call(b)}},o=function(){function x(y,w){for(var b=0;b<w.length;b++){var _=w[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,w,b){return w&&x(y.prototype,w),b&&x(y,b),y}}(),l=a(0),u=h(l),f=a(7),d=h(f);function h(x){return x&&x.__esModule?x:{default:x}}function p(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function v(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var g=function(x){m(y,x),o(y,null,[{key:"value",value:function(){}}]);function y(w,b){p(this,y);var _=v(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,w));return _.selection=b,_.textNode=document.createTextNode(y.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return o(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(b,_){if(this._length!==0)return i(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,b,_);for(var T=this,E=0;T!=null&&T.statics.scope!==u.default.Scope.BLOCK_BLOT;)E+=T.offset(T.parent),T=T.parent;T!=null&&(this._length=y.CONTENTS.length,T.optimize(),T.formatAt(E,y.CONTENTS.length,b,_),this._length=0)}},{key:"index",value:function(b,_){return b===this.textNode?0:i(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,b,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){i(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var b=this.textNode,_=this.selection.getNativeRange(),T=void 0,E=void 0,C=void 0;if(_!=null&&_.start.node===b&&_.end.node===b){var P=[b,_.start.offset,_.end.offset];T=P[0],E=P[1],C=P[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var N=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof d.default?(T=this.next.domNode,this.next.insertAt(0,N),this.textNode.data=y.CONTENTS):(this.textNode.data=N,this.parent.insertBefore(u.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),E!=null){var k=[E,C].map(function(I){return Math.max(0,Math.min(T.data.length,I-1))}),A=s(k,2);return E=A[0],C=A[1],{startNode:T,startOffset:E,endNode:T,endOffset:C}}}}},{key:"update",value:function(b,_){var T=this;if(b.some(function(C){return C.type==="characterData"&&C.target===T.textNode})){var E=this.restore();E&&(_.range=E)}}},{key:"value",value:function(){return""}}]),y}(u.default.Embed);g.blotName="cursor",g.className="ql-cursor",g.tagName="span",g.CONTENTS="\uFEFF",n.default=g},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(0),i=u(s),o=a(4),l=u(o);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function d(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function h(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){h(m,v);function m(){return f(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m}(i.default.Container);p.allowedChildren=[l.default,o.BlockEmbed,p],n.default=p},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var s=function(){function g(x,y){for(var w=0;w<y.length;w++){var b=y[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,y,w){return y&&g(x.prototype,y),w&&g(x,w),x}}(),i=function g(x,y,w){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,y);if(b===void 0){var _=Object.getPrototypeOf(x);return _===null?void 0:g(_,y,w)}else{if("value"in b)return b.value;var T=b.get;return T===void 0?void 0:T.call(w)}},o=a(0),l=u(o);function u(g){return g&&g.__esModule?g:{default:g}}function f(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")}function d(g,x){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:g}function h(g,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);g.prototype=Object.create(x&&x.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(g,x):g.__proto__=x)}var p=function(g){h(x,g);function x(){return f(this,x),d(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"value",value:function(w){var b=i(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,w);return b.startsWith("rgb(")?(b=b.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+b.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):b}}]),x}(l.default.Attributor.Style),v=new l.default.Attributor.Class("color","ql-color",{scope:l.default.Scope.INLINE}),m=new p("color","color",{scope:l.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=v,n.ColorStyle=m},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var s=function(){function m(g,x){for(var y=0;y<x.length;y++){var w=x[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(g,w.key,w)}}return function(g,x,y){return x&&m(g.prototype,x),y&&m(g,y),g}}(),i=function m(g,x,y){g===null&&(g=Function.prototype);var w=Object.getOwnPropertyDescriptor(g,x);if(w===void 0){var b=Object.getPrototypeOf(g);return b===null?void 0:m(b,x,y)}else{if("value"in w)return w.value;var _=w.get;return _===void 0?void 0:_.call(y)}},o=a(6),l=u(o);function u(m){return m&&m.__esModule?m:{default:m}}function f(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var p=function(m){h(g,m);function g(){return f(this,g),d(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"format",value:function(y,w){if(y!==this.statics.blotName||!w)return i(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,y,w);w=this.constructor.sanitize(w),this.domNode.setAttribute("href",w)}}],[{key:"create",value:function(y){var w=i(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,y);return y=this.sanitize(y),w.setAttribute("href",y),w.setAttribute("rel","noopener noreferrer"),w.setAttribute("target","_blank"),w}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return v(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),g}(l.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function v(m,g){var x=document.createElement("a");x.href=m;var y=x.href.slice(0,x.href.indexOf(":"));return g.indexOf(y)>-1}n.default=p,n.sanitize=v},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},i=function(){function g(x,y){for(var w=0;w<y.length;w++){var b=y[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,y,w){return y&&g(x.prototype,y),w&&g(x,w),x}}(),o=a(23),l=d(o),u=a(107),f=d(u);function d(g){return g&&g.__esModule?g:{default:g}}function h(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")}var p=0;function v(g,x){g.setAttribute(x,g.getAttribute(x)!=="true")}var m=function(){function g(x){var y=this;h(this,g),this.select=x,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){y.togglePicker()}),this.label.addEventListener("keydown",function(w){switch(w.keyCode){case l.default.keys.ENTER:y.togglePicker();break;case l.default.keys.ESCAPE:y.escape(),w.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return i(g,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),v(this.label,"aria-expanded"),v(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var w=this,b=document.createElement("span");return b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item"),y.hasAttribute("value")&&b.setAttribute("data-value",y.getAttribute("value")),y.textContent&&b.setAttribute("data-label",y.textContent),b.addEventListener("click",function(){w.selectItem(b,!0)}),b.addEventListener("keydown",function(_){switch(_.keyCode){case l.default.keys.ENTER:w.selectItem(b,!0),_.preventDefault();break;case l.default.keys.ESCAPE:w.escape(),_.preventDefault();break}}),b}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=f.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,w=document.createElement("span");w.classList.add("ql-picker-options"),w.setAttribute("aria-hidden","true"),w.tabIndex="-1",w.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",w.id),this.options=w,[].slice.call(this.select.options).forEach(function(b){var _=y.buildItem(b);w.appendChild(_),b.selected===!0&&y.selectItem(_)}),this.container.appendChild(w)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(w){y.container.setAttribute(w.name,w.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(y){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=this.container.querySelector(".ql-selected");if(y!==b&&(b!=null&&b.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.getAttribute("data-label")):this.label.removeAttribute("data-label"),w))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var w=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(w)}else this.selectItem(null);var b=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}}]),g}();n.default=m},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(0),i=U(s),o=a(5),l=U(o),u=a(4),f=U(u),d=a(16),h=U(d),p=a(25),v=U(p),m=a(24),g=U(m),x=a(35),y=U(x),w=a(6),b=U(w),_=a(22),T=U(_),E=a(7),C=U(E),P=a(55),N=U(P),k=a(42),A=U(k),I=a(23),M=U(I);function U(W){return W&&W.__esModule?W:{default:W}}l.default.register({"blots/block":f.default,"blots/block/embed":u.BlockEmbed,"blots/break":h.default,"blots/container":v.default,"blots/cursor":g.default,"blots/embed":y.default,"blots/inline":b.default,"blots/scroll":T.default,"blots/text":C.default,"modules/clipboard":N.default,"modules/history":A.default,"modules/keyboard":M.default}),i.default.register(f.default,h.default,g.default,b.default,T.default,C.default),n.default=l.default},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(1),i=function(){function o(l){this.domNode=l,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(l){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var u;return Array.isArray(this.tagName)?(typeof l=="string"&&(l=l.toUpperCase(),parseInt(l).toString()===l&&(l=parseInt(l))),typeof l=="number"?u=document.createElement(this.tagName[l-1]):this.tagName.indexOf(l)>-1?u=document.createElement(l):u=document.createElement(this.tagName[0])):u=document.createElement(this.tagName),this.className&&u.classList.add(this.className),u},o.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var l=this.domNode.cloneNode(!1);return s.create(l)},o.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},o.prototype.deleteAt=function(l,u){var f=this.isolate(l,u);f.remove()},o.prototype.formatAt=function(l,u,f,d){var h=this.isolate(l,u);if(s.query(f,s.Scope.BLOT)!=null&&d)h.wrap(f,d);else if(s.query(f,s.Scope.ATTRIBUTE)!=null){var p=s.create(this.statics.scope);h.wrap(p),p.format(f,d)}},o.prototype.insertAt=function(l,u,f){var d=f==null?s.create("text",u):s.create(u,f),h=this.split(l);this.parent.insertBefore(d,h)},o.prototype.insertInto=function(l,u){u===void 0&&(u=null),this.parent!=null&&this.parent.children.remove(this);var f=null;l.children.insertBefore(this,u),u!=null&&(f=u.domNode),(this.domNode.parentNode!=l.domNode||this.domNode.nextSibling!=f)&&l.domNode.insertBefore(this.domNode,f),this.parent=l,this.attach()},o.prototype.isolate=function(l,u){var f=this.split(l);return f.split(u),f},o.prototype.length=function(){return 1},o.prototype.offset=function(l){return l===void 0&&(l=this.parent),this.parent==null||this==l?0:this.parent.children.offset(this)+this.parent.offset(l)},o.prototype.optimize=function(l){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},o.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(l){l.parent!=null&&(l.parent.insertBefore(this,l.next),l.remove())},o.prototype.replaceWith=function(l,u){var f=typeof l=="string"?s.create(l,u):l;return f.replace(this),f},o.prototype.split=function(l,u){return l===0?this:this.next},o.prototype.update=function(l,u){},o.prototype.wrap=function(l,u){var f=typeof l=="string"?s.create(l,u):l;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},o.blotName="abstract",o}();n.default=i},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(12),i=a(32),o=a(33),l=a(1),u=function(){function f(d){this.attributes={},this.domNode=d,this.build()}return f.prototype.attribute=function(d,h){h?d.add(this.domNode,h)&&(d.value(this.domNode)!=null?this.attributes[d.attrName]=d:delete this.attributes[d.attrName]):(d.remove(this.domNode),delete this.attributes[d.attrName])},f.prototype.build=function(){var d=this;this.attributes={};var h=s.default.keys(this.domNode),p=i.default.keys(this.domNode),v=o.default.keys(this.domNode);h.concat(p).concat(v).forEach(function(m){var g=l.query(m,l.Scope.ATTRIBUTE);g instanceof s.default&&(d.attributes[g.attrName]=g)})},f.prototype.copy=function(d){var h=this;Object.keys(this.attributes).forEach(function(p){var v=h.attributes[p].value(h.domNode);d.format(p,v)})},f.prototype.move=function(d){var h=this;this.copy(d),Object.keys(this.attributes).forEach(function(p){h.attributes[p].remove(h.domNode)}),this.attributes={}},f.prototype.values=function(){var d=this;return Object.keys(this.attributes).reduce(function(h,p){return h[p]=d.attributes[p].value(d.domNode),h},{})},f}();n.default=u},function(r,n,a){var s=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var h in d)d.hasOwnProperty(h)&&(f[h]=d[h])};return function(f,d){u(f,d);function h(){this.constructor=f}f.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(12);function o(u,f){var d=u.getAttribute("class")||"";return d.split(/\s+/).filter(function(h){return h.indexOf(f+"-")===0})}var l=function(u){s(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.keys=function(d){return(d.getAttribute("class")||"").split(/\s+/).map(function(h){return h.split("-").slice(0,-1).join("-")})},f.prototype.add=function(d,h){return this.canAdd(d,h)?(this.remove(d),d.classList.add(this.keyName+"-"+h),!0):!1},f.prototype.remove=function(d){var h=o(d,this.keyName);h.forEach(function(p){d.classList.remove(p)}),d.classList.length===0&&d.removeAttribute("class")},f.prototype.value=function(d){var h=o(d,this.keyName)[0]||"",p=h.slice(this.keyName.length+1);return this.canAdd(d,p)?p:""},f}(i.default);n.default=l},function(r,n,a){var s=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var h in d)d.hasOwnProperty(h)&&(f[h]=d[h])};return function(f,d){u(f,d);function h(){this.constructor=f}f.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(12);function o(u){var f=u.split("-"),d=f.slice(1).map(function(h){return h[0].toUpperCase()+h.slice(1)}).join("");return f[0]+d}var l=function(u){s(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.keys=function(d){return(d.getAttribute("style")||"").split(";").map(function(h){var p=h.split(":");return p[0].trim()})},f.prototype.add=function(d,h){return this.canAdd(d,h)?(d.style[o(this.keyName)]=h,!0):!1},f.prototype.remove=function(d){d.style[o(this.keyName)]="",d.getAttribute("style")||d.removeAttribute("style")},f.prototype.value=function(d){var h=d.style[o(this.keyName)];return this.canAdd(d,h)?h:""},f}(i.default);n.default=l},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(u,f){for(var d=0;d<f.length;d++){var h=f[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,f,d){return f&&l(u.prototype,f),d&&l(u,d),u}}();function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,f){i(this,l),this.quill=u,this.options=f,this.modules={}}return s(l,[{key:"init",value:function(){var f=this;Object.keys(this.options.modules).forEach(function(d){f.modules[d]==null&&f.addModule(d)})}},{key:"addModule",value:function(f){var d=this.quill.constructor.import("modules/"+f);return this.modules[f]=new d(this.quill,this.options.modules[f]||{}),this.modules[f]}}]),l}();o.DEFAULTS={modules:{}},o.themes={default:o},n.default=o},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function x(y,w){for(var b=0;b<w.length;b++){var _=w[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,w,b){return w&&x(y.prototype,w),b&&x(y,b),y}}(),i=function x(y,w,b){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,w);if(_===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:x(T,w,b)}else{if("value"in _)return _.value;var E=_.get;return E===void 0?void 0:E.call(b)}},o=a(0),l=d(o),u=a(7),f=d(u);function d(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function p(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function v(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var m="\uFEFF",g=function(x){v(y,x);function y(w){h(this,y);var b=p(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,w));return b.contentNode=document.createElement("span"),b.contentNode.setAttribute("contenteditable",!1),[].slice.call(b.domNode.childNodes).forEach(function(_){b.contentNode.appendChild(_)}),b.leftGuard=document.createTextNode(m),b.rightGuard=document.createTextNode(m),b.domNode.appendChild(b.leftGuard),b.domNode.appendChild(b.contentNode),b.domNode.appendChild(b.rightGuard),b}return s(y,[{key:"index",value:function(b,_){return b===this.leftGuard?0:b===this.rightGuard?1:i(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,b,_)}},{key:"restore",value:function(b){var _=void 0,T=void 0,E=b.data.split(m).join("");if(b===this.leftGuard)if(this.prev instanceof f.default){var C=this.prev.length();this.prev.insertAt(C,E),_={startNode:this.prev.domNode,startOffset:C+E.length}}else T=document.createTextNode(E),this.parent.insertBefore(l.default.create(T),this),_={startNode:T,startOffset:E.length};else b===this.rightGuard&&(this.next instanceof f.default?(this.next.insertAt(0,E),_={startNode:this.next.domNode,startOffset:E.length}):(T=document.createTextNode(E),this.parent.insertBefore(l.default.create(T),this.next),_={startNode:T,startOffset:E.length}));return b.data=m,_}},{key:"update",value:function(b,_){var T=this;b.forEach(function(E){if(E.type==="characterData"&&(E.target===T.leftGuard||E.target===T.rightGuard)){var C=T.restore(E.target);C&&(_.range=C)}})}}]),y}(l.default.Embed);n.default=g},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var s=a(0),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}var l={scope:i.default.Scope.BLOCK,whitelist:["right","center","justify"]},u=new i.default.Attributor.Attribute("align","align",l),f=new i.default.Attributor.Class("align","ql-align",l),d=new i.default.Attributor.Style("align","text-align",l);n.AlignAttribute=u,n.AlignClass=f,n.AlignStyle=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var s=a(0),i=l(s),o=a(26);function l(d){return d&&d.__esModule?d:{default:d}}var u=new i.default.Attributor.Class("background","ql-bg",{scope:i.default.Scope.INLINE}),f=new o.ColorAttributor("background","background-color",{scope:i.default.Scope.INLINE});n.BackgroundClass=u,n.BackgroundStyle=f},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var s=a(0),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}var l={scope:i.default.Scope.BLOCK,whitelist:["rtl"]},u=new i.default.Attributor.Attribute("direction","dir",l),f=new i.default.Attributor.Class("direction","ql-direction",l),d=new i.default.Attributor.Style("direction","direction",l);n.DirectionAttribute=u,n.DirectionClass=f,n.DirectionStyle=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var s=function(){function x(y,w){for(var b=0;b<w.length;b++){var _=w[b];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,w,b){return w&&x(y.prototype,w),b&&x(y,b),y}}(),i=function x(y,w,b){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,w);if(_===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:x(T,w,b)}else{if("value"in _)return _.value;var E=_.get;return E===void 0?void 0:E.call(b)}},o=a(0),l=u(o);function u(x){return x&&x.__esModule?x:{default:x}}function f(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function h(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p={scope:l.default.Scope.INLINE,whitelist:["serif","monospace"]},v=new l.default.Attributor.Class("font","ql-font",p),m=function(x){h(y,x);function y(){return f(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"value",value:function(b){return i(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,b).replace(/["']/g,"")}}]),y}(l.default.Attributor.Style),g=new m("font","font-family",p);n.FontStyle=g,n.FontClass=v},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var s=a(0),i=o(s);function o(f){return f&&f.__esModule?f:{default:f}}var l=new i.default.Attributor.Class("size","ql-size",{scope:i.default.Scope.INLINE,whitelist:["small","large","huge"]}),u=new i.default.Attributor.Style("size","font-size",{scope:i.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=l,n.SizeStyle=u},function(r,n,a){r.exports={align:{"":a(76),center:a(77),right:a(78),justify:a(79)},background:a(80),blockquote:a(81),bold:a(82),clean:a(83),code:a(58),"code-block":a(58),color:a(84),direction:{"":a(85),rtl:a(86)},float:{center:a(87),full:a(88),left:a(89),right:a(90)},formula:a(91),header:{1:a(92),2:a(93)},italic:a(94),image:a(95),indent:{"+1":a(96),"-1":a(97)},link:a(98),list:{ordered:a(99),bullet:a(100),check:a(101)},script:{sub:a(102),super:a(103)},strike:a(104),underline:a(105),video:a(106)}},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var s=function(){function w(b,_){for(var T=0;T<_.length;T++){var E=_[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,_,T){return _&&w(b.prototype,_),T&&w(b,T),b}}(),i=a(0),o=h(i),l=a(5),u=h(l),f=a(9),d=h(f);function h(w){return w&&w.__esModule?w:{default:w}}function p(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function v(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function m(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var g=function(w){m(b,w);function b(_,T){p(this,b);var E=v(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,_,T));return E.lastRecorded=0,E.ignoreChange=!1,E.clear(),E.quill.on(u.default.events.EDITOR_CHANGE,function(C,P,N,k){C!==u.default.events.TEXT_CHANGE||E.ignoreChange||(!E.options.userOnly||k===u.default.sources.USER?E.record(P,N):E.transform(P))}),E.quill.keyboard.addBinding({key:"Z",shortKey:!0},E.undo.bind(E)),E.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},E.redo.bind(E)),/Win/i.test(navigator.platform)&&E.quill.keyboard.addBinding({key:"Y",shortKey:!0},E.redo.bind(E)),E}return s(b,[{key:"change",value:function(T,E){if(this.stack[T].length!==0){var C=this.stack[T].pop();this.stack[E].push(C),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(C[T],u.default.sources.USER),this.ignoreChange=!1;var P=y(C[T]);this.quill.setSelection(P)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(T,E){if(T.ops.length!==0){this.stack.redo=[];var C=this.quill.getContents().diff(E),P=Date.now();if(this.lastRecorded+this.options.delay>P&&this.stack.undo.length>0){var N=this.stack.undo.pop();C=C.compose(N.undo),T=N.redo.compose(T)}else this.lastRecorded=P;this.stack.undo.push({redo:T,undo:C}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(T){this.stack.undo.forEach(function(E){E.undo=T.transform(E.undo,!0),E.redo=T.transform(E.redo,!0)}),this.stack.redo.forEach(function(E){E.undo=T.transform(E.undo,!0),E.redo=T.transform(E.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),b}(d.default);g.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function x(w){var b=w.ops[w.ops.length-1];return b==null?!1:b.insert!=null?typeof b.insert=="string"&&b.insert.endsWith(`
`):b.attributes!=null?Object.keys(b.attributes).some(function(_){return o.default.query(_,o.default.Scope.BLOCK)!=null}):!1}function y(w){var b=w.reduce(function(T,E){return T+=E.delete||0,T},0),_=w.length()-b;return x(w)&&(_-=1),_}n.default=g,n.getLastChangeIndex=y},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var s=function(){function O(j,B){for(var L=0;L<B.length;L++){var F=B[L];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(j,F.key,F)}}return function(j,B,L){return B&&O(j.prototype,B),L&&O(j,L),j}}(),i=function O(j,B,L){j===null&&(j=Function.prototype);var F=Object.getOwnPropertyDescriptor(j,B);if(F===void 0){var H=Object.getPrototypeOf(j);return H===null?void 0:O(H,B,L)}else{if("value"in F)return F.value;var Z=F.get;return Z===void 0?void 0:Z.call(L)}},o=a(3),l=P(o),u=a(2),f=P(u),d=a(8),h=P(d),p=a(23),v=P(p),m=a(34),g=P(m),x=a(59),y=P(x),w=a(60),b=P(w),_=a(28),T=P(_),E=a(61),C=P(E);function P(O){return O&&O.__esModule?O:{default:O}}function N(O,j){if(!(O instanceof j))throw new TypeError("Cannot call a class as a function")}function k(O,j){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j&&(typeof j=="object"||typeof j=="function")?j:O}function A(O,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);O.prototype=Object.create(j&&j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(O,j):O.__proto__=j)}var I=[!1,"center","right","justify"],M=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],U=[!1,"serif","monospace"],W=["1","2","3",!1],G=["small",!1,"large","huge"],Q=function(O){A(j,O);function j(B,L){N(this,j);var F=k(this,(j.__proto__||Object.getPrototypeOf(j)).call(this,B,L)),H=function Z(X){if(!document.body.contains(B.root))return document.body.removeEventListener("click",Z);F.tooltip!=null&&!F.tooltip.root.contains(X.target)&&document.activeElement!==F.tooltip.textbox&&!F.quill.hasFocus()&&F.tooltip.hide(),F.pickers!=null&&F.pickers.forEach(function(ne){ne.container.contains(X.target)||ne.close()})};return B.emitter.listenDOM("click",document.body,H),F}return s(j,[{key:"addModule",value:function(L){var F=i(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"addModule",this).call(this,L);return L==="toolbar"&&this.extendToolbar(F),F}},{key:"buildButtons",value:function(L,F){L.forEach(function(H){var Z=H.getAttribute("class")||"";Z.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),F[X]!=null))if(X==="direction")H.innerHTML=F[X][""]+F[X].rtl;else if(typeof F[X]=="string")H.innerHTML=F[X];else{var ne=H.value||"";ne!=null&&F[X][ne]&&(H.innerHTML=F[X][ne])}})})}},{key:"buildPickers",value:function(L,F){var H=this;this.pickers=L.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&D(X,I),new b.default(X,F.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var ne=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&D(X,M,ne==="background"?"#ffffff":"#000000"),new y.default(X,F[ne])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?D(X,U):X.classList.contains("ql-header")?D(X,W):X.classList.contains("ql-size")&&D(X,G)),new T.default(X)});var Z=function(){H.pickers.forEach(function(ne){ne.update()})};this.quill.on(h.default.events.EDITOR_CHANGE,Z)}}]),j}(g.default);Q.DEFAULTS=(0,l.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var j=this,B=this.container.querySelector("input.ql-image[type=file]");B==null&&(B=document.createElement("input"),B.setAttribute("type","file"),B.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),B.classList.add("ql-image"),B.addEventListener("change",function(){if(B.files!=null&&B.files[0]!=null){var L=new FileReader;L.onload=function(F){var H=j.quill.getSelection(!0);j.quill.updateContents(new f.default().retain(H.index).delete(H.length).insert({image:F.target.result}),h.default.sources.USER),j.quill.setSelection(H.index+1,h.default.sources.SILENT),B.value=""},L.readAsDataURL(B.files[0])}}),this.container.appendChild(B)),B.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var R=function(O){A(j,O);function j(B,L){N(this,j);var F=k(this,(j.__proto__||Object.getPrototypeOf(j)).call(this,B,L));return F.textbox=F.root.querySelector('input[type="text"]'),F.listen(),F}return s(j,[{key:"listen",value:function(){var L=this;this.textbox.addEventListener("keydown",function(F){v.default.match(F,"enter")?(L.save(),F.preventDefault()):v.default.match(F,"escape")&&(L.cancel(),F.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),F!=null?this.textbox.value=F:L!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+L)||""),this.root.setAttribute("data-mode",L)}},{key:"restoreFocus",value:function(){var L=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=L}},{key:"save",value:function(){var L=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var F=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",L,h.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",L,h.default.sources.USER)),this.quill.root.scrollTop=F;break}case"video":L=z(L);case"formula":{if(!L)break;var H=this.quill.getSelection(!0);if(H!=null){var Z=H.index+H.length;this.quill.insertEmbed(Z,this.root.getAttribute("data-mode"),L,h.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Z+1," ",h.default.sources.USER),this.quill.setSelection(Z+2,h.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),j}(C.default);function z(O){var j=O.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||O.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return j?(j[1]||"https")+"://www.youtube.com/embed/"+j[2]+"?showinfo=0":(j=O.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(j[1]||"https")+"://player.vimeo.com/video/"+j[2]+"/":O}function D(O,j){var B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;j.forEach(function(L){var F=document.createElement("option");L===B?F.setAttribute("selected","selected"):F.setAttribute("value",L),O.appendChild(F)})}n.BaseTooltip=R,n.default=Q},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function i(){this.head=this.tail=null,this.length=0}return i.prototype.append=function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];this.insertBefore(o[0],null),o.length>1&&this.append.apply(this,o.slice(1))},i.prototype.contains=function(o){for(var l,u=this.iterator();l=u();)if(l===o)return!0;return!1},i.prototype.insertBefore=function(o,l){o&&(o.next=l,l!=null?(o.prev=l.prev,l.prev!=null&&(l.prev.next=o),l.prev=o,l===this.head&&(this.head=o)):this.tail!=null?(this.tail.next=o,o.prev=this.tail,this.tail=o):(o.prev=null,this.head=this.tail=o),this.length+=1)},i.prototype.offset=function(o){for(var l=0,u=this.head;u!=null;){if(u===o)return l;l+=u.length(),u=u.next}return-1},i.prototype.remove=function(o){this.contains(o)&&(o.prev!=null&&(o.prev.next=o.next),o.next!=null&&(o.next.prev=o.prev),o===this.head&&(this.head=o.next),o===this.tail&&(this.tail=o.prev),this.length-=1)},i.prototype.iterator=function(o){return o===void 0&&(o=this.head),function(){var l=o;return o!=null&&(o=o.next),l}},i.prototype.find=function(o,l){l===void 0&&(l=!1);for(var u,f=this.iterator();u=f();){var d=u.length();if(o<d||l&&o===d&&(u.next==null||u.next.length()!==0))return[u,o];o-=d}return[null,0]},i.prototype.forEach=function(o){for(var l,u=this.iterator();l=u();)o(l)},i.prototype.forEachAt=function(o,l,u){if(!(l<=0))for(var f=this.find(o),d=f[0],h=f[1],p,v=o-h,m=this.iterator(d);(p=m())&&v<o+l;){var g=p.length();o>v?u(p,o-v,Math.min(l,v+g-o)):u(p,0,Math.min(g,o+l-v)),v+=g}},i.prototype.map=function(o){return this.reduce(function(l,u){return l.push(o(u)),l},[])},i.prototype.reduce=function(o,l){for(var u,f=this.iterator();u=f();)l=o(l,u);return l},i}();n.default=s},function(r,n,a){var s=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){d(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(17),o=a(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=100,f=function(d){s(h,d);function h(p){var v=d.call(this,p)||this;return v.scroll=v,v.observer=new MutationObserver(function(m){v.update(m)}),v.observer.observe(v.domNode,l),v.attach(),v}return h.prototype.detach=function(){d.prototype.detach.call(this),this.observer.disconnect()},h.prototype.deleteAt=function(p,v){this.update(),p===0&&v===this.length()?this.children.forEach(function(m){m.remove()}):d.prototype.deleteAt.call(this,p,v)},h.prototype.formatAt=function(p,v,m,g){this.update(),d.prototype.formatAt.call(this,p,v,m,g)},h.prototype.insertAt=function(p,v,m){this.update(),d.prototype.insertAt.call(this,p,v,m)},h.prototype.optimize=function(p,v){var m=this;p===void 0&&(p=[]),v===void 0&&(v={}),d.prototype.optimize.call(this,v);for(var g=[].slice.call(this.observer.takeRecords());g.length>0;)p.push(g.pop());for(var x=function(_,T){T===void 0&&(T=!0),!(_==null||_===m)&&_.domNode.parentNode!=null&&(_.domNode[o.DATA_KEY].mutations==null&&(_.domNode[o.DATA_KEY].mutations=[]),T&&x(_.parent))},y=function(_){_.domNode[o.DATA_KEY]==null||_.domNode[o.DATA_KEY].mutations==null||(_ instanceof i.default&&_.children.forEach(y),_.optimize(v))},w=p,b=0;w.length>0;b+=1){if(b>=u)throw new Error("[Parchment] Maximum optimize iterations reached");for(w.forEach(function(_){var T=o.find(_.target,!0);T!=null&&(T.domNode===_.target&&(_.type==="childList"?(x(o.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(E){var C=o.find(E,!1);x(C,!1),C instanceof i.default&&C.children.forEach(function(P){x(P,!1)})})):_.type==="attributes"&&x(T.prev)),x(T))}),this.children.forEach(y),w=[].slice.call(this.observer.takeRecords()),g=w.slice();g.length>0;)p.push(g.pop())}},h.prototype.update=function(p,v){var m=this;v===void 0&&(v={}),p=p||this.observer.takeRecords(),p.map(function(g){var x=o.find(g.target,!0);return x==null?null:x.domNode[o.DATA_KEY].mutations==null?(x.domNode[o.DATA_KEY].mutations=[g],x):(x.domNode[o.DATA_KEY].mutations.push(g),null)}).forEach(function(g){g==null||g===m||g.domNode[o.DATA_KEY]==null||g.update(g.domNode[o.DATA_KEY].mutations||[],v)}),this.domNode[o.DATA_KEY].mutations!=null&&d.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,v),this.optimize(p,v)},h.blotName="scroll",h.defaultChild="block",h.scope=o.Scope.BLOCK_BLOT,h.tagName="DIV",h}(i.default);n.default=f},function(r,n,a){var s=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var p in h)h.hasOwnProperty(p)&&(d[p]=h[p])};return function(d,h){f(d,h);function p(){this.constructor=d}d.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(18),o=a(1);function l(f,d){if(Object.keys(f).length!==Object.keys(d).length)return!1;for(var h in f)if(f[h]!==d[h])return!1;return!0}var u=function(f){s(d,f);function d(){return f!==null&&f.apply(this,arguments)||this}return d.formats=function(h){if(h.tagName!==d.tagName)return f.formats.call(this,h)},d.prototype.format=function(h,p){var v=this;h===this.statics.blotName&&!p?(this.children.forEach(function(m){m instanceof i.default||(m=m.wrap(d.blotName,!0)),v.attributes.copy(m)}),this.unwrap()):f.prototype.format.call(this,h,p)},d.prototype.formatAt=function(h,p,v,m){if(this.formats()[v]!=null||o.query(v,o.Scope.ATTRIBUTE)){var g=this.isolate(h,p);g.format(v,m)}else f.prototype.formatAt.call(this,h,p,v,m)},d.prototype.optimize=function(h){f.prototype.optimize.call(this,h);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var v=this.next;v instanceof d&&v.prev===this&&l(p,v.formats())&&(v.moveChildren(this),v.remove())},d.blotName="inline",d.scope=o.Scope.INLINE_BLOT,d.tagName="SPAN",d}(i.default);n.default=u},function(r,n,a){var s=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var h in d)d.hasOwnProperty(h)&&(f[h]=d[h])};return function(f,d){u(f,d);function h(){this.constructor=f}f.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(18),o=a(1),l=function(u){s(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(d){var h=o.query(f.blotName).tagName;if(d.tagName!==h)return u.formats.call(this,d)},f.prototype.format=function(d,h){o.query(d,o.Scope.BLOCK)!=null&&(d===this.statics.blotName&&!h?this.replaceWith(f.blotName):u.prototype.format.call(this,d,h))},f.prototype.formatAt=function(d,h,p,v){o.query(p,o.Scope.BLOCK)!=null?this.format(p,v):u.prototype.formatAt.call(this,d,h,p,v)},f.prototype.insertAt=function(d,h,p){if(p==null||o.query(h,o.Scope.INLINE)!=null)u.prototype.insertAt.call(this,d,h,p);else{var v=this.split(d),m=o.create(h,p);v.parent.insertBefore(m,v)}},f.prototype.update=function(d,h){navigator.userAgent.match(/Trident/)?this.build():u.prototype.update.call(this,d,h)},f.blotName="block",f.scope=o.Scope.BLOCK_BLOT,f.tagName="P",f}(i.default);n.default=l},function(r,n,a){var s=this&&this.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var d in f)f.hasOwnProperty(d)&&(u[d]=f[d])};return function(u,f){l(u,f);function d(){this.constructor=u}u.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(19),o=function(l){s(u,l);function u(){return l!==null&&l.apply(this,arguments)||this}return u.formats=function(f){},u.prototype.format=function(f,d){l.prototype.formatAt.call(this,0,this.length(),f,d)},u.prototype.formatAt=function(f,d,h,p){f===0&&d===this.length()?this.format(h,p):l.prototype.formatAt.call(this,f,d,h,p)},u.prototype.formats=function(){return this.statics.formats(this.domNode)},u}(i.default);n.default=o},function(r,n,a){var s=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var h in d)d.hasOwnProperty(h)&&(f[h]=d[h])};return function(f,d){u(f,d);function h(){this.constructor=f}f.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}}();Object.defineProperty(n,"__esModule",{value:!0});var i=a(19),o=a(1),l=function(u){s(f,u);function f(d){var h=u.call(this,d)||this;return h.text=h.statics.value(h.domNode),h}return f.create=function(d){return document.createTextNode(d)},f.value=function(d){var h=d.data;return h.normalize&&(h=h.normalize()),h},f.prototype.deleteAt=function(d,h){this.domNode.data=this.text=this.text.slice(0,d)+this.text.slice(d+h)},f.prototype.index=function(d,h){return this.domNode===d?h:-1},f.prototype.insertAt=function(d,h,p){p==null?(this.text=this.text.slice(0,d)+h+this.text.slice(d),this.domNode.data=this.text):u.prototype.insertAt.call(this,d,h,p)},f.prototype.length=function(){return this.text.length},f.prototype.optimize=function(d){u.prototype.optimize.call(this,d),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof f&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},f.prototype.position=function(d,h){return[this.domNode,d]},f.prototype.split=function(d,h){if(h===void 0&&(h=!1),!h){if(d===0)return this;if(d===this.length())return this.next}var p=o.create(this.domNode.splitText(d));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},f.prototype.update=function(d,h){var p=this;d.some(function(v){return v.type==="characterData"&&v.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},f.prototype.value=function(){return this.text},f.blotName="text",f.scope=o.Scope.INLINE_BLOT,f}(i.default);n.default=l},function(r,n,a){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(o,l){return arguments.length>1&&!this.contains(o)==!l?l:i.call(this,o)}}String.prototype.startsWith||(String.prototype.startsWith=function(o,l){return l=l||0,this.substr(l,o.length)===o}),String.prototype.endsWith||(String.prototype.endsWith=function(o,l){var u=this.toString();(typeof l!="number"||!isFinite(l)||Math.floor(l)!==l||l>u.length)&&(l=u.length),l-=o.length;var f=u.indexOf(o,l);return f!==-1&&f===l}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(l){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof l!="function")throw new TypeError("predicate must be a function");for(var u=Object(this),f=u.length>>>0,d=arguments[1],h,p=0;p<f;p++)if(h=u[p],l.call(d,h,p,u))return h}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var a=-1,s=1,i=0;function o(b,_,T){if(b==_)return b?[[i,b]]:[];(T<0||b.length<T)&&(T=null);var E=d(b,_),C=b.substring(0,E);b=b.substring(E),_=_.substring(E),E=h(b,_);var P=b.substring(b.length-E);b=b.substring(0,b.length-E),_=_.substring(0,_.length-E);var N=l(b,_);return C&&N.unshift([i,C]),P&&N.push([i,P]),v(N),T!=null&&(N=x(N,T)),N=y(N),N}function l(b,_){var T;if(!b)return[[s,_]];if(!_)return[[a,b]];var E=b.length>_.length?b:_,C=b.length>_.length?_:b,P=E.indexOf(C);if(P!=-1)return T=[[s,E.substring(0,P)],[i,C],[s,E.substring(P+C.length)]],b.length>_.length&&(T[0][0]=T[2][0]=a),T;if(C.length==1)return[[a,b],[s,_]];var N=p(b,_);if(N){var k=N[0],A=N[1],I=N[2],M=N[3],U=N[4],W=o(k,I),G=o(A,M);return W.concat([[i,U]],G)}return u(b,_)}function u(b,_){for(var T=b.length,E=_.length,C=Math.ceil((T+E)/2),P=C,N=2*C,k=new Array(N),A=new Array(N),I=0;I<N;I++)k[I]=-1,A[I]=-1;k[P+1]=0,A[P+1]=0;for(var M=T-E,U=M%2!=0,W=0,G=0,Q=0,R=0,z=0;z<C;z++){for(var D=-z+W;D<=z-G;D+=2){var O=P+D,j;D==-z||D!=z&&k[O-1]<k[O+1]?j=k[O+1]:j=k[O-1]+1;for(var B=j-D;j<T&&B<E&&b.charAt(j)==_.charAt(B);)j++,B++;if(k[O]=j,j>T)G+=2;else if(B>E)W+=2;else if(U){var L=P+M-D;if(L>=0&&L<N&&A[L]!=-1){var F=T-A[L];if(j>=F)return f(b,_,j,B)}}}for(var H=-z+Q;H<=z-R;H+=2){var L=P+H,F;H==-z||H!=z&&A[L-1]<A[L+1]?F=A[L+1]:F=A[L-1]+1;for(var Z=F-H;F<T&&Z<E&&b.charAt(T-F-1)==_.charAt(E-Z-1);)F++,Z++;if(A[L]=F,F>T)R+=2;else if(Z>E)Q+=2;else if(!U){var O=P+M-H;if(O>=0&&O<N&&k[O]!=-1){var j=k[O],B=P+j-O;if(F=T-F,j>=F)return f(b,_,j,B)}}}}return[[a,b],[s,_]]}function f(b,_,T,E){var C=b.substring(0,T),P=_.substring(0,E),N=b.substring(T),k=_.substring(E),A=o(C,P),I=o(N,k);return A.concat(I)}function d(b,_){if(!b||!_||b.charAt(0)!=_.charAt(0))return 0;for(var T=0,E=Math.min(b.length,_.length),C=E,P=0;T<C;)b.substring(P,C)==_.substring(P,C)?(T=C,P=T):E=C,C=Math.floor((E-T)/2+T);return C}function h(b,_){if(!b||!_||b.charAt(b.length-1)!=_.charAt(_.length-1))return 0;for(var T=0,E=Math.min(b.length,_.length),C=E,P=0;T<C;)b.substring(b.length-C,b.length-P)==_.substring(_.length-C,_.length-P)?(T=C,P=T):E=C,C=Math.floor((E-T)/2+T);return C}function p(b,_){var T=b.length>_.length?b:_,E=b.length>_.length?_:b;if(T.length<4||E.length*2<T.length)return null;function C(G,Q,R){for(var z=G.substring(R,R+Math.floor(G.length/4)),D=-1,O="",j,B,L,F;(D=Q.indexOf(z,D+1))!=-1;){var H=d(G.substring(R),Q.substring(D)),Z=h(G.substring(0,R),Q.substring(0,D));O.length<Z+H&&(O=Q.substring(D-Z,D)+Q.substring(D,D+H),j=G.substring(0,R-Z),B=G.substring(R+H),L=Q.substring(0,D-Z),F=Q.substring(D+H))}return O.length*2>=G.length?[j,B,L,F,O]:null}var P=C(T,E,Math.ceil(T.length/4)),N=C(T,E,Math.ceil(T.length/2)),k;if(!P&&!N)return null;N?P?k=P[4].length>N[4].length?P:N:k=N:k=P;var A,I,M,U;b.length>_.length?(A=k[0],I=k[1],M=k[2],U=k[3]):(M=k[0],U=k[1],A=k[2],I=k[3]);var W=k[4];return[A,I,M,U,W]}function v(b){b.push([i,""]);for(var _=0,T=0,E=0,C="",P="",N;_<b.length;)switch(b[_][0]){case s:E++,P+=b[_][1],_++;break;case a:T++,C+=b[_][1],_++;break;case i:T+E>1?(T!==0&&E!==0&&(N=d(P,C),N!==0&&(_-T-E>0&&b[_-T-E-1][0]==i?b[_-T-E-1][1]+=P.substring(0,N):(b.splice(0,0,[i,P.substring(0,N)]),_++),P=P.substring(N),C=C.substring(N)),N=h(P,C),N!==0&&(b[_][1]=P.substring(P.length-N)+b[_][1],P=P.substring(0,P.length-N),C=C.substring(0,C.length-N))),T===0?b.splice(_-E,T+E,[s,P]):E===0?b.splice(_-T,T+E,[a,C]):b.splice(_-T-E,T+E,[a,C],[s,P]),_=_-T-E+(T?1:0)+(E?1:0)+1):_!==0&&b[_-1][0]==i?(b[_-1][1]+=b[_][1],b.splice(_,1)):_++,E=0,T=0,C="",P="";break}b[b.length-1][1]===""&&b.pop();var k=!1;for(_=1;_<b.length-1;)b[_-1][0]==i&&b[_+1][0]==i&&(b[_][1].substring(b[_][1].length-b[_-1][1].length)==b[_-1][1]?(b[_][1]=b[_-1][1]+b[_][1].substring(0,b[_][1].length-b[_-1][1].length),b[_+1][1]=b[_-1][1]+b[_+1][1],b.splice(_-1,1),k=!0):b[_][1].substring(0,b[_+1][1].length)==b[_+1][1]&&(b[_-1][1]+=b[_+1][1],b[_][1]=b[_][1].substring(b[_+1][1].length)+b[_+1][1],b.splice(_+1,1),k=!0)),_++;k&&v(b)}var m=o;m.INSERT=s,m.DELETE=a,m.EQUAL=i,r.exports=m;function g(b,_){if(_===0)return[i,b];for(var T=0,E=0;E<b.length;E++){var C=b[E];if(C[0]===a||C[0]===i){var P=T+C[1].length;if(_===P)return[E+1,b];if(_<P){b=b.slice();var N=_-T,k=[C[0],C[1].slice(0,N)],A=[C[0],C[1].slice(N)];return b.splice(E,1,k,A),[E+1,b]}else T=P}}throw new Error("cursor_pos is out of bounds!")}function x(b,_){var T=g(b,_),E=T[1],C=T[0],P=E[C],N=E[C+1];if(P==null)return b;if(P[0]!==i)return b;if(N!=null&&P[1]+N[1]===N[1]+P[1])return E.splice(C,2,N,P),w(E,C,2);if(N!=null&&N[1].indexOf(P[1])===0){E.splice(C,2,[N[0],P[1]],[0,P[1]]);var k=N[1].slice(P[1].length);return k.length>0&&E.splice(C+2,0,[N[0],k]),w(E,C,3)}else return b}function y(b){for(var _=!1,T=function(N){return N.charCodeAt(0)>=56320&&N.charCodeAt(0)<=57343},E=function(N){return N.charCodeAt(N.length-1)>=55296&&N.charCodeAt(N.length-1)<=56319},C=2;C<b.length;C+=1)b[C-2][0]===i&&E(b[C-2][1])&&b[C-1][0]===a&&T(b[C-1][1])&&b[C][0]===s&&T(b[C][1])&&(_=!0,b[C-1][1]=b[C-2][1].slice(-1)+b[C-1][1],b[C][1]=b[C-2][1].slice(-1)+b[C][1],b[C-2][1]=b[C-2][1].slice(0,-1));if(!_)return b;for(var P=[],C=0;C<b.length;C+=1)b[C][1].length>0&&P.push(b[C]);return P}function w(b,_,T){for(var E=_+T-1;E>=0&&E>=_-1;E--)if(E+1<b.length){var C=b[E],P=b[E+1];C[0]===P[1]&&b.splice(E,2,[C[0],C[1]+P[1]])}return b}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:a,n.shim=a;function a(s){var i=[];for(var o in s)i.push(o);return i}},function(r,n){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=a?s:i,n.supported=s;function s(o){return Object.prototype.toString.call(o)=="[object Arguments]"}n.unsupported=i;function i(o){return o&&typeof o=="object"&&typeof o.length=="number"&&Object.prototype.hasOwnProperty.call(o,"callee")&&!Object.prototype.propertyIsEnumerable.call(o,"callee")||!1}},function(r,n){var a=Object.prototype.hasOwnProperty,s="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(s=!1));function o(u,f,d){this.fn=u,this.context=f,this.once=d||!1}function l(){this._events=new i,this._eventsCount=0}l.prototype.eventNames=function(){var f=[],d,h;if(this._eventsCount===0)return f;for(h in d=this._events)a.call(d,h)&&f.push(s?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(d)):f},l.prototype.listeners=function(f,d){var h=s?s+f:f,p=this._events[h];if(d)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var v=0,m=p.length,g=new Array(m);v<m;v++)g[v]=p[v].fn;return g},l.prototype.emit=function(f,d,h,p,v,m){var g=s?s+f:f;if(!this._events[g])return!1;var x=this._events[g],y=arguments.length,w,b;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),y){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,h),!0;case 4:return x.fn.call(x.context,d,h,p),!0;case 5:return x.fn.call(x.context,d,h,p,v),!0;case 6:return x.fn.call(x.context,d,h,p,v,m),!0}for(b=1,w=new Array(y-1);b<y;b++)w[b-1]=arguments[b];x.fn.apply(x.context,w)}else{var _=x.length,T;for(b=0;b<_;b++)switch(x[b].once&&this.removeListener(f,x[b].fn,void 0,!0),y){case 1:x[b].fn.call(x[b].context);break;case 2:x[b].fn.call(x[b].context,d);break;case 3:x[b].fn.call(x[b].context,d,h);break;case 4:x[b].fn.call(x[b].context,d,h,p);break;default:if(!w)for(T=1,w=new Array(y-1);T<y;T++)w[T-1]=arguments[T];x[b].fn.apply(x[b].context,w)}}return!0},l.prototype.on=function(f,d,h){var p=new o(d,h||this),v=s?s+f:f;return this._events[v]?this._events[v].fn?this._events[v]=[this._events[v],p]:this._events[v].push(p):(this._events[v]=p,this._eventsCount++),this},l.prototype.once=function(f,d,h){var p=new o(d,h||this,!0),v=s?s+f:f;return this._events[v]?this._events[v].fn?this._events[v]=[this._events[v],p]:this._events[v].push(p):(this._events[v]=p,this._eventsCount++),this},l.prototype.removeListener=function(f,d,h,p){var v=s?s+f:f;if(!this._events[v])return this;if(!d)return--this._eventsCount===0?this._events=new i:delete this._events[v],this;var m=this._events[v];if(m.fn)m.fn===d&&(!p||m.once)&&(!h||m.context===h)&&(--this._eventsCount===0?this._events=new i:delete this._events[v]);else{for(var g=0,x=[],y=m.length;g<y;g++)(m[g].fn!==d||p&&!m[g].once||h&&m[g].context!==h)&&x.push(m[g]);x.length?this._events[v]=x.length===1?x[0]:x:--this._eventsCount===0?this._events=new i:delete this._events[v]}return this},l.prototype.removeAllListeners=function(f){var d;return f?(d=s?s+f:f,this._events[d]&&(--this._eventsCount===0?this._events=new i:delete this._events[d])):(this._events=new i,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prototype.setMaxListeners=function(){return this},l.prefixed=s,l.EventEmitter=l,typeof r<"u"&&(r.exports=l)},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},i=function(){function le(ue,me){var _e=[],ye=!0,Me=!1,Le=void 0;try{for(var $e=ue[Symbol.iterator](),tt;!(ye=(tt=$e.next()).done)&&(_e.push(tt.value),!(me&&_e.length===me));ye=!0);}catch(dt){Me=!0,Le=dt}finally{try{!ye&&$e.return&&$e.return()}finally{if(Me)throw Le}}return _e}return function(ue,me){if(Array.isArray(ue))return ue;if(Symbol.iterator in Object(ue))return le(ue,me);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function le(ue,me){for(var _e=0;_e<me.length;_e++){var ye=me[_e];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(ue,ye.key,ye)}}return function(ue,me,_e){return me&&le(ue.prototype,me),_e&&le(ue,_e),ue}}(),l=a(3),u=A(l),f=a(2),d=A(f),h=a(0),p=A(h),v=a(5),m=A(v),g=a(10),x=A(g),y=a(9),w=A(y),b=a(36),_=a(37),T=a(13),E=A(T),C=a(26),P=a(38),N=a(39),k=a(40);function A(le){return le&&le.__esModule?le:{default:le}}function I(le,ue,me){return ue in le?Object.defineProperty(le,ue,{value:me,enumerable:!0,configurable:!0,writable:!0}):le[ue]=me,le}function M(le,ue){if(!(le instanceof ue))throw new TypeError("Cannot call a class as a function")}function U(le,ue){if(!le)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ue&&(typeof ue=="object"||typeof ue=="function")?ue:le}function W(le,ue){if(typeof ue!="function"&&ue!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ue);le.prototype=Object.create(ue&&ue.prototype,{constructor:{value:le,enumerable:!1,writable:!0,configurable:!0}}),ue&&(Object.setPrototypeOf?Object.setPrototypeOf(le,ue):le.__proto__=ue)}var G=(0,x.default)("quill:clipboard"),Q="__ql-matcher",R=[[Node.TEXT_NODE,pe],[Node.TEXT_NODE,Ee],["br",he],[Node.ELEMENT_NODE,Ee],[Node.ELEMENT_NODE,ne],[Node.ELEMENT_NODE,xe],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,Se],["li",Te],["b",Z.bind(Z,"bold")],["i",Z.bind(Z,"italic")],["style",V]],z=[b.AlignAttribute,P.DirectionAttribute].reduce(function(le,ue){return le[ue.keyName]=ue,le},{}),D=[b.AlignStyle,_.BackgroundStyle,C.ColorStyle,P.DirectionStyle,N.FontStyle,k.SizeStyle].reduce(function(le,ue){return le[ue.keyName]=ue,le},{}),O=function(le){W(ue,le);function ue(me,_e){M(this,ue);var ye=U(this,(ue.__proto__||Object.getPrototypeOf(ue)).call(this,me,_e));return ye.quill.root.addEventListener("paste",ye.onPaste.bind(ye)),ye.container=ye.quill.addContainer("ql-clipboard"),ye.container.setAttribute("contenteditable",!0),ye.container.setAttribute("tabindex",-1),ye.matchers=[],R.concat(ye.options.matchers).forEach(function(Me){var Le=i(Me,2),$e=Le[0],tt=Le[1];!_e.matchVisual&&tt===xe||ye.addMatcher($e,tt)}),ye}return o(ue,[{key:"addMatcher",value:function(_e,ye){this.matchers.push([_e,ye])}},{key:"convert",value:function(_e){if(typeof _e=="string")return this.container.innerHTML=_e.replace(/\>\r?\n +\</g,"><"),this.convert();var ye=this.quill.getFormat(this.quill.selection.savedRange.index);if(ye[E.default.blotName]){var Me=this.container.innerText;return this.container.innerHTML="",new d.default().insert(Me,I({},E.default.blotName,ye[E.default.blotName]))}var Le=this.prepareMatching(),$e=i(Le,2),tt=$e[0],dt=$e[1],Je=H(this.container,tt,dt);return L(Je,`
`)&&Je.ops[Je.ops.length-1].attributes==null&&(Je=Je.compose(new d.default().retain(Je.length()-1).delete(1))),G.log("convert",this.container.innerHTML,Je),this.container.innerHTML="",Je}},{key:"dangerouslyPasteHTML",value:function(_e,ye){var Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;if(typeof _e=="string")this.quill.setContents(this.convert(_e),ye),this.quill.setSelection(0,m.default.sources.SILENT);else{var Le=this.convert(ye);this.quill.updateContents(new d.default().retain(_e).concat(Le),Me),this.quill.setSelection(_e+Le.length(),m.default.sources.SILENT)}}},{key:"onPaste",value:function(_e){var ye=this;if(!(_e.defaultPrevented||!this.quill.isEnabled())){var Me=this.quill.getSelection(),Le=new d.default().retain(Me.index),$e=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(m.default.sources.SILENT),setTimeout(function(){Le=Le.concat(ye.convert()).delete(Me.length),ye.quill.updateContents(Le,m.default.sources.USER),ye.quill.setSelection(Le.length()-Me.length,m.default.sources.SILENT),ye.quill.scrollingContainer.scrollTop=$e,ye.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var _e=this,ye=[],Me=[];return this.matchers.forEach(function(Le){var $e=i(Le,2),tt=$e[0],dt=$e[1];switch(tt){case Node.TEXT_NODE:Me.push(dt);break;case Node.ELEMENT_NODE:ye.push(dt);break;default:[].forEach.call(_e.container.querySelectorAll(tt),function(Je){Je[Q]=Je[Q]||[],Je[Q].push(dt)});break}}),[ye,Me]}}]),ue}(w.default);O.DEFAULTS={matchers:[],matchVisual:!0};function j(le,ue,me){return(typeof ue>"u"?"undefined":s(ue))==="object"?Object.keys(ue).reduce(function(_e,ye){return j(_e,ye,ue[ye])},le):le.reduce(function(_e,ye){return ye.attributes&&ye.attributes[ue]?_e.push(ye):_e.insert(ye.insert,(0,u.default)({},I({},ue,me),ye.attributes))},new d.default)}function B(le){if(le.nodeType!==Node.ELEMENT_NODE)return{};var ue="__ql-computed-style";return le[ue]||(le[ue]=window.getComputedStyle(le))}function L(le,ue){for(var me="",_e=le.ops.length-1;_e>=0&&me.length<ue.length;--_e){var ye=le.ops[_e];if(typeof ye.insert!="string")break;me=ye.insert+me}return me.slice(-1*ue.length)===ue}function F(le){if(le.childNodes.length===0)return!1;var ue=B(le);return["block","list-item"].indexOf(ue.display)>-1}function H(le,ue,me){return le.nodeType===le.TEXT_NODE?me.reduce(function(_e,ye){return ye(le,_e)},new d.default):le.nodeType===le.ELEMENT_NODE?[].reduce.call(le.childNodes||[],function(_e,ye){var Me=H(ye,ue,me);return ye.nodeType===le.ELEMENT_NODE&&(Me=ue.reduce(function(Le,$e){return $e(ye,Le)},Me),Me=(ye[Q]||[]).reduce(function(Le,$e){return $e(ye,Le)},Me)),_e.concat(Me)},new d.default):new d.default}function Z(le,ue,me){return j(me,le,!0)}function X(le,ue){var me=p.default.Attributor.Attribute.keys(le),_e=p.default.Attributor.Class.keys(le),ye=p.default.Attributor.Style.keys(le),Me={};return me.concat(_e).concat(ye).forEach(function(Le){var $e=p.default.query(Le,p.default.Scope.ATTRIBUTE);$e!=null&&(Me[$e.attrName]=$e.value(le),Me[$e.attrName])||($e=z[Le],$e!=null&&($e.attrName===Le||$e.keyName===Le)&&(Me[$e.attrName]=$e.value(le)||void 0),$e=D[Le],$e!=null&&($e.attrName===Le||$e.keyName===Le)&&($e=D[Le],Me[$e.attrName]=$e.value(le)||void 0))}),Object.keys(Me).length>0&&(ue=j(ue,Me)),ue}function ne(le,ue){var me=p.default.query(le);if(me==null)return ue;if(me.prototype instanceof p.default.Embed){var _e={},ye=me.value(le);ye!=null&&(_e[me.blotName]=ye,ue=new d.default().insert(_e,me.formats(le)))}else typeof me.formats=="function"&&(ue=j(ue,me.blotName,me.formats(le)));return ue}function he(le,ue){return L(ue,`
`)||ue.insert(`
`),ue}function V(){return new d.default}function Te(le,ue){var me=p.default.query(le);if(me==null||me.blotName!=="list-item"||!L(ue,`
`))return ue;for(var _e=-1,ye=le.parentNode;!ye.classList.contains("ql-clipboard");)(p.default.query(ye)||{}).blotName==="list"&&(_e+=1),ye=ye.parentNode;return _e<=0?ue:ue.compose(new d.default().retain(ue.length()-1).retain(1,{indent:_e}))}function Ee(le,ue){return L(ue,`
`)||(F(le)||ue.length()>0&&le.nextSibling&&F(le.nextSibling))&&ue.insert(`
`),ue}function xe(le,ue){if(F(le)&&le.nextElementSibling!=null&&!L(ue,`
`)){var me=le.offsetHeight+parseFloat(B(le).marginTop)+parseFloat(B(le).marginBottom);le.nextElementSibling.offsetTop>le.offsetTop+me*1.5&&ue.insert(`
`)}return ue}function Se(le,ue){var me={},_e=le.style||{};return _e.fontStyle&&B(le).fontStyle==="italic"&&(me.italic=!0),_e.fontWeight&&(B(le).fontWeight.startsWith("bold")||parseInt(B(le).fontWeight)>=700)&&(me.bold=!0),Object.keys(me).length>0&&(ue=j(ue,me)),parseFloat(_e.textIndent||0)>0&&(ue=new d.default().insert(" ").concat(ue)),ue}function pe(le,ue){var me=le.data;if(le.parentNode.tagName==="O:P")return ue.insert(me.trim());if(me.trim().length===0&&le.parentNode.classList.contains("ql-clipboard"))return ue;if(!B(le.parentNode).whiteSpace.startsWith("pre")){var _e=function(Me,Le){return Le=Le.replace(/[^\u00a0]/g,""),Le.length<1&&Me?" ":Le};me=me.replace(/\r\n/g," ").replace(/\n/g," "),me=me.replace(/\s\s+/g,_e.bind(_e,!0)),(le.previousSibling==null&&F(le.parentNode)||le.previousSibling!=null&&F(le.previousSibling))&&(me=me.replace(/^\s+/,_e.bind(_e,!1))),(le.nextSibling==null&&F(le.parentNode)||le.nextSibling!=null&&F(le.nextSibling))&&(me=me.replace(/\s+$/,_e.bind(_e,!1)))}return ue.insert(me)}n.default=O,n.matchAttributor=X,n.matchBlot=ne,n.matchNewline=Ee,n.matchSpacing=xe,n.matchText=pe},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function v(m,g){for(var x=0;x<g.length;x++){var y=g[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,g,x){return g&&v(m.prototype,g),x&&v(m,x),m}}(),i=function v(m,g,x){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,g);if(y===void 0){var w=Object.getPrototypeOf(m);return w===null?void 0:v(w,g,x)}else{if("value"in y)return y.value;var b=y.get;return b===void 0?void 0:b.call(x)}},o=a(6),l=u(o);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function d(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function h(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){h(m,v);function m(){return f(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,[{key:"optimize",value:function(x){i(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,x),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return i(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),m}(l.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var s=function(){function k(A,I){var M=[],U=!0,W=!1,G=void 0;try{for(var Q=A[Symbol.iterator](),R;!(U=(R=Q.next()).done)&&(M.push(R.value),!(I&&M.length===I));U=!0);}catch(z){W=!0,G=z}finally{try{!U&&Q.return&&Q.return()}finally{if(W)throw G}}return M}return function(A,I){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return k(A,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function k(A,I){for(var M=0;M<I.length;M++){var U=I[M];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,I,M){return I&&k(A.prototype,I),M&&k(A,M),A}}(),o=a(2),l=x(o),u=a(0),f=x(u),d=a(5),h=x(d),p=a(10),v=x(p),m=a(9),g=x(m);function x(k){return k&&k.__esModule?k:{default:k}}function y(k,A,I){return A in k?Object.defineProperty(k,A,{value:I,enumerable:!0,configurable:!0,writable:!0}):k[A]=I,k}function w(k,A){if(!(k instanceof A))throw new TypeError("Cannot call a class as a function")}function b(k,A){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:k}function _(k,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);k.prototype=Object.create(A&&A.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(k,A):k.__proto__=A)}var T=(0,v.default)("quill:toolbar"),E=function(k){_(A,k);function A(I,M){w(this,A);var U=b(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,I,M));if(Array.isArray(U.options.container)){var W=document.createElement("div");P(W,U.options.container),I.container.parentNode.insertBefore(W,I.container),U.container=W}else typeof U.options.container=="string"?U.container=document.querySelector(U.options.container):U.container=U.options.container;if(!(U.container instanceof HTMLElement)){var G;return G=T.error("Container required for toolbar",U.options),b(U,G)}return U.container.classList.add("ql-toolbar"),U.controls=[],U.handlers={},Object.keys(U.options.handlers).forEach(function(Q){U.addHandler(Q,U.options.handlers[Q])}),[].forEach.call(U.container.querySelectorAll("button, select"),function(Q){U.attach(Q)}),U.quill.on(h.default.events.EDITOR_CHANGE,function(Q,R){Q===h.default.events.SELECTION_CHANGE&&U.update(R)}),U.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){var Q=U.quill.selection.getRange(),R=s(Q,1),z=R[0];U.update(z)}),U}return i(A,[{key:"addHandler",value:function(M,U){this.handlers[M]=U}},{key:"attach",value:function(M){var U=this,W=[].find.call(M.classList,function(Q){return Q.indexOf("ql-")===0});if(W){if(W=W.slice(3),M.tagName==="BUTTON"&&M.setAttribute("type","button"),this.handlers[W]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[W]==null){T.warn("ignoring attaching to disabled format",W,M);return}if(f.default.query(W)==null){T.warn("ignoring attaching to nonexistent format",W,M);return}}var G=M.tagName==="SELECT"?"change":"click";M.addEventListener(G,function(Q){var R=void 0;if(M.tagName==="SELECT"){if(M.selectedIndex<0)return;var z=M.options[M.selectedIndex];z.hasAttribute("selected")?R=!1:R=z.value||!1}else M.classList.contains("ql-active")?R=!1:R=M.value||!M.hasAttribute("value"),Q.preventDefault();U.quill.focus();var D=U.quill.selection.getRange(),O=s(D,1),j=O[0];if(U.handlers[W]!=null)U.handlers[W].call(U,R);else if(f.default.query(W).prototype instanceof f.default.Embed){if(R=prompt("Enter "+W),!R)return;U.quill.updateContents(new l.default().retain(j.index).delete(j.length).insert(y({},W,R)),h.default.sources.USER)}else U.quill.format(W,R,h.default.sources.USER);U.update(j)}),this.controls.push([W,M])}}},{key:"update",value:function(M){var U=M==null?{}:this.quill.getFormat(M);this.controls.forEach(function(W){var G=s(W,2),Q=G[0],R=G[1];if(R.tagName==="SELECT"){var z=void 0;if(M==null)z=null;else if(U[Q]==null)z=R.querySelector("option[selected]");else if(!Array.isArray(U[Q])){var D=U[Q];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),z=R.querySelector('option[value="'+D+'"]')}z==null?(R.value="",R.selectedIndex=-1):z.selected=!0}else if(M==null)R.classList.remove("ql-active");else if(R.hasAttribute("value")){var O=U[Q]===R.getAttribute("value")||U[Q]!=null&&U[Q].toString()===R.getAttribute("value")||U[Q]==null&&!R.getAttribute("value");R.classList.toggle("ql-active",O)}else R.classList.toggle("ql-active",U[Q]!=null)})}}]),A}(g.default);E.DEFAULTS={};function C(k,A,I){var M=document.createElement("button");M.setAttribute("type","button"),M.classList.add("ql-"+A),I!=null&&(M.value=I),k.appendChild(M)}function P(k,A){Array.isArray(A[0])||(A=[A]),A.forEach(function(I){var M=document.createElement("span");M.classList.add("ql-formats"),I.forEach(function(U){if(typeof U=="string")C(M,U);else{var W=Object.keys(U)[0],G=U[W];Array.isArray(G)?N(M,W,G):C(M,W,G)}}),k.appendChild(M)})}function N(k,A,I){var M=document.createElement("select");M.classList.add("ql-"+A),I.forEach(function(U){var W=document.createElement("option");U!==!1?W.setAttribute("value",U):W.setAttribute("selected","selected"),M.appendChild(W)}),k.appendChild(M)}E.DEFAULTS={container:null,handlers:{clean:function(){var A=this,I=this.quill.getSelection();if(I!=null)if(I.length==0){var M=this.quill.getFormat();Object.keys(M).forEach(function(U){f.default.query(U,f.default.Scope.INLINE)!=null&&A.quill.format(U,!1)})}else this.quill.removeFormat(I,h.default.sources.USER)},direction:function(A){var I=this.quill.getFormat().align;A==="rtl"&&I==null?this.quill.format("align","right",h.default.sources.USER):!A&&I==="right"&&this.quill.format("align",!1,h.default.sources.USER),this.quill.format("direction",A,h.default.sources.USER)},indent:function(A){var I=this.quill.getSelection(),M=this.quill.getFormat(I),U=parseInt(M.indent||0);if(A==="+1"||A==="-1"){var W=A==="+1"?1:-1;M.direction==="rtl"&&(W*=-1),this.quill.format("indent",U+W,h.default.sources.USER)}},link:function(A){A===!0&&(A=prompt("Enter link URL:")),this.quill.format("link",A,h.default.sources.USER)},list:function(A){var I=this.quill.getSelection(),M=this.quill.getFormat(I);A==="check"?M.list==="checked"||M.list==="unchecked"?this.quill.format("list",!1,h.default.sources.USER):this.quill.format("list","unchecked",h.default.sources.USER):this.quill.format("list",A,h.default.sources.USER)}}},n.default=E,n.addControls=P},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function v(m,g){for(var x=0;x<g.length;x++){var y=g[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,g,x){return g&&v(m.prototype,g),x&&v(m,x),m}}(),i=function v(m,g,x){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,g);if(y===void 0){var w=Object.getPrototypeOf(m);return w===null?void 0:v(w,g,x)}else{if("value"in y)return y.value;var b=y.get;return b===void 0?void 0:b.call(x)}},o=a(28),l=u(o);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function d(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function h(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){h(m,v);function m(g,x){f(this,m);var y=d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,g));return y.label.innerHTML=x,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(w){w.classList.add("ql-primary")}),y}return s(m,[{key:"buildItem",value:function(x){var y=i(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"buildItem",this).call(this,x);return y.style.backgroundColor=x.getAttribute("value")||"",y}},{key:"selectItem",value:function(x,y){i(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,x,y);var w=this.label.querySelector(".ql-color-label"),b=x&&x.getAttribute("data-value")||"";w&&(w.tagName==="line"?w.style.stroke=b:w.style.fill=b)}}]),m}(l.default);n.default=p},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function v(m,g){for(var x=0;x<g.length;x++){var y=g[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,g,x){return g&&v(m.prototype,g),x&&v(m,x),m}}(),i=function v(m,g,x){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,g);if(y===void 0){var w=Object.getPrototypeOf(m);return w===null?void 0:v(w,g,x)}else{if("value"in y)return y.value;var b=y.get;return b===void 0?void 0:b.call(x)}},o=a(28),l=u(o);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function d(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function h(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){h(m,v);function m(g,x){f(this,m);var y=d(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,g));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(w){w.innerHTML=x[w.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return s(m,[{key:"selectItem",value:function(x,y){i(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,x,y),x=x||this.defaultItem,this.label.innerHTML=x.innerHTML}}]),m}(l.default);n.default=p},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function l(u,f){for(var d=0;d<f.length;d++){var h=f[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,f,d){return f&&l(u.prototype,f),d&&l(u,d),u}}();function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function(){function l(u,f){var d=this;i(this,l),this.quill=u,this.boundsContainer=f||document.body,this.root=u.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){d.root.style.marginTop=-1*d.quill.root.scrollTop+"px"}),this.hide()}return s(l,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(f){var d=f.left+f.width/2-this.root.offsetWidth/2,h=f.bottom+this.quill.root.scrollTop;this.root.style.left=d+"px",this.root.style.top=h+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),v=this.root.getBoundingClientRect(),m=0;if(v.right>p.right&&(m=p.right-v.right,this.root.style.left=d+m+"px"),v.left<p.left&&(m=p.left-v.left,this.root.style.left=d+m+"px"),v.bottom>p.bottom){var g=v.bottom-v.top,x=f.bottom-f.top+g;this.root.style.top=h-x+"px",this.root.classList.add("ql-flip")}return m}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),l}();n.default=o},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function N(k,A){var I=[],M=!0,U=!1,W=void 0;try{for(var G=k[Symbol.iterator](),Q;!(M=(Q=G.next()).done)&&(I.push(Q.value),!(A&&I.length===A));M=!0);}catch(R){U=!0,W=R}finally{try{!M&&G.return&&G.return()}finally{if(U)throw W}}return I}return function(k,A){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return N(k,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function N(k,A,I){k===null&&(k=Function.prototype);var M=Object.getOwnPropertyDescriptor(k,A);if(M===void 0){var U=Object.getPrototypeOf(k);return U===null?void 0:N(U,A,I)}else{if("value"in M)return M.value;var W=M.get;return W===void 0?void 0:W.call(I)}},o=function(){function N(k,A){for(var I=0;I<A.length;I++){var M=A[I];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(k,M.key,M)}}return function(k,A,I){return A&&N(k.prototype,A),I&&N(k,I),k}}(),l=a(3),u=w(l),f=a(8),d=w(f),h=a(43),p=w(h),v=a(27),m=w(v),g=a(15),x=a(41),y=w(x);function w(N){return N&&N.__esModule?N:{default:N}}function b(N,k){if(!(N instanceof k))throw new TypeError("Cannot call a class as a function")}function _(N,k){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:N}function T(N,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);N.prototype=Object.create(k&&k.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(N,k):N.__proto__=k)}var E=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],C=function(N){T(k,N);function k(A,I){b(this,k),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=E);var M=_(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,A,I));return M.quill.container.classList.add("ql-snow"),M}return o(k,[{key:"extendToolbar",value:function(I){I.container.classList.add("ql-snow"),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),y.default),this.tooltip=new P(this.quill,this.options.bounds),I.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(M,U){I.handlers.link.call(I,!U.format.link)})}}]),k}(p.default);C.DEFAULTS=(0,u.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(k){if(k){var A=this.quill.getSelection();if(A==null||A.length==0)return;var I=this.quill.getText(A);/^\S+@\S+\.\S+$/.test(I)&&I.indexOf("mailto:")!==0&&(I="mailto:"+I);var M=this.quill.theme.tooltip;M.edit("link",I)}else this.quill.format("link",!1)}}}}});var P=function(N){T(k,N);function k(A,I){b(this,k);var M=_(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,A,I));return M.preview=M.root.querySelector("a.ql-preview"),M}return o(k,[{key:"listen",value:function(){var I=this;i(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(M){I.root.classList.contains("ql-editing")?I.save():I.edit("link",I.preview.textContent),M.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(M){if(I.linkRange!=null){var U=I.linkRange;I.restoreFocus(),I.quill.formatText(U,"link",!1,d.default.sources.USER),delete I.linkRange}M.preventDefault(),I.hide()}),this.quill.on(d.default.events.SELECTION_CHANGE,function(M,U,W){if(M!=null){if(M.length===0&&W===d.default.sources.USER){var G=I.quill.scroll.descendant(m.default,M.index),Q=s(G,2),R=Q[0],z=Q[1];if(R!=null){I.linkRange=new g.Range(M.index-z,R.length());var D=m.default.formats(R.domNode);I.preview.textContent=D,I.preview.setAttribute("href",D),I.show(),I.position(I.quill.getBounds(I.linkRange));return}}else delete I.linkRange;I.hide()}})}},{key:"show",value:function(){i(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k}(h.BaseTooltip);P.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=C},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(29),i=ye(s),o=a(36),l=a(38),u=a(64),f=a(65),d=ye(f),h=a(66),p=ye(h),v=a(67),m=ye(v),g=a(37),x=a(26),y=a(39),w=a(40),b=a(56),_=ye(b),T=a(68),E=ye(T),C=a(27),P=ye(C),N=a(69),k=ye(N),A=a(70),I=ye(A),M=a(71),U=ye(M),W=a(72),G=ye(W),Q=a(73),R=ye(Q),z=a(13),D=ye(z),O=a(74),j=ye(O),B=a(75),L=ye(B),F=a(57),H=ye(F),Z=a(41),X=ye(Z),ne=a(28),he=ye(ne),V=a(59),Te=ye(V),Ee=a(60),xe=ye(Ee),Se=a(61),pe=ye(Se),le=a(108),ue=ye(le),me=a(62),_e=ye(me);function ye(Me){return Me&&Me.__esModule?Me:{default:Me}}i.default.register({"attributors/attribute/direction":l.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":g.BackgroundClass,"attributors/class/color":x.ColorClass,"attributors/class/direction":l.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":w.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":g.BackgroundStyle,"attributors/style/color":x.ColorStyle,"attributors/style/direction":l.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":w.SizeStyle},!0),i.default.register({"formats/align":o.AlignClass,"formats/direction":l.DirectionClass,"formats/indent":u.IndentClass,"formats/background":g.BackgroundStyle,"formats/color":x.ColorStyle,"formats/font":y.FontClass,"formats/size":w.SizeClass,"formats/blockquote":d.default,"formats/code-block":D.default,"formats/header":p.default,"formats/list":m.default,"formats/bold":_.default,"formats/code":z.Code,"formats/italic":E.default,"formats/link":P.default,"formats/script":k.default,"formats/strike":I.default,"formats/underline":U.default,"formats/image":G.default,"formats/video":R.default,"formats/list/item":v.ListItem,"modules/formula":j.default,"modules/syntax":L.default,"modules/toolbar":H.default,"themes/bubble":ue.default,"themes/snow":_e.default,"ui/icons":X.default,"ui/picker":he.default,"ui/icon-picker":xe.default,"ui/color-picker":Te.default,"ui/tooltip":pe.default},!0),n.default=i.default},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var s=function(){function m(g,x){for(var y=0;y<x.length;y++){var w=x[y];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(g,w.key,w)}}return function(g,x,y){return x&&m(g.prototype,x),y&&m(g,y),g}}(),i=function m(g,x,y){g===null&&(g=Function.prototype);var w=Object.getOwnPropertyDescriptor(g,x);if(w===void 0){var b=Object.getPrototypeOf(g);return b===null?void 0:m(b,x,y)}else{if("value"in w)return w.value;var _=w.get;return _===void 0?void 0:_.call(y)}},o=a(0),l=u(o);function u(m){return m&&m.__esModule?m:{default:m}}function f(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function h(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}var p=function(m){h(g,m);function g(){return f(this,g),d(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return s(g,[{key:"add",value:function(y,w){if(w==="+1"||w==="-1"){var b=this.value(y)||0;w=w==="+1"?b+1:b-1}return w===0?(this.remove(y),!0):i(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"add",this).call(this,y,w)}},{key:"canAdd",value:function(y,w){return i(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,y,w)||i(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"canAdd",this).call(this,y,parseInt(w))}},{key:"value",value:function(y){return parseInt(i(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,y))||void 0}}]),g}(l.default.Attributor.Class),v=new p("indent","ql-indent",{scope:l.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=v},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(4),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}function l(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function f(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var d=function(h){f(p,h);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(i.default);d.blotName="blockquote",d.tagName="blockquote",n.default=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function p(v,m){for(var g=0;g<m.length;g++){var x=m[g];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,x.key,x)}}return function(v,m,g){return m&&p(v.prototype,m),g&&p(v,g),v}}(),i=a(4),o=l(i);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,v){if(!(p instanceof v))throw new TypeError("Cannot call a class as a function")}function f(p,v){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:p}function d(p,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);p.prototype=Object.create(v&&v.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(p,v):p.__proto__=v)}var h=function(p){d(v,p);function v(){return u(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,null,[{key:"formats",value:function(g){return this.tagName.indexOf(g.tagName)+1}}]),v}(o.default);h.blotName="header",h.tagName=["H1","H2","H3","H4","H5","H6"],n.default=h},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var s=function(){function b(_,T){for(var E=0;E<T.length;E++){var C=T[E];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}return function(_,T,E){return T&&b(_.prototype,T),E&&b(_,E),_}}(),i=function b(_,T,E){_===null&&(_=Function.prototype);var C=Object.getOwnPropertyDescriptor(_,T);if(C===void 0){var P=Object.getPrototypeOf(_);return P===null?void 0:b(P,T,E)}else{if("value"in C)return C.value;var N=C.get;return N===void 0?void 0:N.call(E)}},o=a(0),l=p(o),u=a(4),f=p(u),d=a(25),h=p(d);function p(b){return b&&b.__esModule?b:{default:b}}function v(b,_,T){return _ in b?Object.defineProperty(b,_,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[_]=T,b}function m(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function g(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function x(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var y=function(b){x(_,b);function _(){return m(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return s(_,[{key:"format",value:function(E,C){E===w.blotName&&!C?this.replaceWith(l.default.create(this.statics.scope)):i(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,E,C)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():i(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(E,C){return this.parent.isolate(this.offset(this.parent),this.length()),E===this.parent.statics.blotName?(this.parent.replaceWith(E,C),this):(this.parent.unwrap(),i(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,E,C))}}],[{key:"formats",value:function(E){return E.tagName===this.tagName?void 0:i(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,E)}}]),_}(f.default);y.blotName="list-item",y.tagName="LI";var w=function(b){x(_,b),s(_,null,[{key:"create",value:function(E){var C=E==="ordered"?"OL":"UL",P=i(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,C);return(E==="checked"||E==="unchecked")&&P.setAttribute("data-checked",E==="checked"),P}},{key:"formats",value:function(E){if(E.tagName==="OL")return"ordered";if(E.tagName==="UL")return E.hasAttribute("data-checked")?E.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(T){m(this,_);var E=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,T)),C=function(N){if(N.target.parentNode===T){var k=E.statics.formats(T),A=l.default.find(N.target);k==="checked"?A.format("list","unchecked"):k==="unchecked"&&A.format("list","checked")}};return T.addEventListener("touchstart",C),T.addEventListener("mousedown",C),E}return s(_,[{key:"format",value:function(E,C){this.children.length>0&&this.children.tail.format(E,C)}},{key:"formats",value:function(){return v({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(E,C){if(E instanceof y)i(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,E,C);else{var P=C==null?this.length():C.offset(this),N=this.split(P);N.parent.insertBefore(E,N)}}},{key:"optimize",value:function(E){i(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,E);var C=this.next;C!=null&&C.prev===this&&C.statics.blotName===this.statics.blotName&&C.domNode.tagName===this.domNode.tagName&&C.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(C.moveChildren(this),C.remove())}},{key:"replace",value:function(E){if(E.statics.blotName!==this.statics.blotName){var C=l.default.create(this.statics.defaultChild);E.moveChildren(C),this.appendChild(C)}i(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,E)}}]),_}(h.default);w.blotName="list",w.scope=l.default.Scope.BLOCK_BLOT,w.tagName=["OL","UL"],w.defaultChild="list-item",w.allowedChildren=[y],n.ListItem=y,n.default=w},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(56),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}function l(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function f(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var d=function(h){f(p,h);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(i.default);d.blotName="italic",d.tagName=["EM","I"],n.default=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function v(m,g){for(var x=0;x<g.length;x++){var y=g[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(m,y.key,y)}}return function(m,g,x){return g&&v(m.prototype,g),x&&v(m,x),m}}(),i=function v(m,g,x){m===null&&(m=Function.prototype);var y=Object.getOwnPropertyDescriptor(m,g);if(y===void 0){var w=Object.getPrototypeOf(m);return w===null?void 0:v(w,g,x)}else{if("value"in y)return y.value;var b=y.get;return b===void 0?void 0:b.call(x)}},o=a(6),l=u(o);function u(v){return v&&v.__esModule?v:{default:v}}function f(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function d(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function h(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p=function(v){h(m,v);function m(){return f(this,m),d(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return s(m,null,[{key:"create",value:function(x){return x==="super"?document.createElement("sup"):x==="sub"?document.createElement("sub"):i(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,x)}},{key:"formats",value:function(x){if(x.tagName==="SUB")return"sub";if(x.tagName==="SUP")return"super"}}]),m}(l.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(6),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}function l(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function f(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var d=function(h){f(p,h);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(i.default);d.blotName="strike",d.tagName="S",n.default=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=a(6),i=o(s);function o(h){return h&&h.__esModule?h:{default:h}}function l(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function f(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var d=function(h){f(p,h);function p(){return l(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(i.default);d.blotName="underline",d.tagName="U",n.default=d},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(x,y){for(var w=0;w<y.length;w++){var b=y[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,y,w){return y&&g(x.prototype,y),w&&g(x,w),x}}(),i=function g(x,y,w){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,y);if(b===void 0){var _=Object.getPrototypeOf(x);return _===null?void 0:g(_,y,w)}else{if("value"in b)return b.value;var T=b.get;return T===void 0?void 0:T.call(w)}},o=a(0),l=f(o),u=a(27);function f(g){return g&&g.__esModule?g:{default:g}}function d(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")}function h(g,x){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:g}function p(g,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);g.prototype=Object.create(x&&x.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(g,x):g.__proto__=x)}var v=["alt","height","width"],m=function(g){p(x,g);function x(){return d(this,x),h(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(w,b){v.indexOf(w)>-1?b?this.domNode.setAttribute(w,b):this.domNode.removeAttribute(w):i(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,b)}}],[{key:"create",value:function(w){var b=i(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,w);return typeof w=="string"&&b.setAttribute("src",this.sanitize(w)),b}},{key:"formats",value:function(w){return v.reduce(function(b,_){return w.hasAttribute(_)&&(b[_]=w.getAttribute(_)),b},{})}},{key:"match",value:function(w){return/\.(jpe?g|gif|png)$/.test(w)||/^data:image\/.+;base64/.test(w)}},{key:"sanitize",value:function(w){return(0,u.sanitize)(w,["http","https","data"])?w:"//:0"}},{key:"value",value:function(w){return w.getAttribute("src")}}]),x}(l.default.Embed);m.blotName="image",m.tagName="IMG",n.default=m},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function g(x,y){for(var w=0;w<y.length;w++){var b=y[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,y,w){return y&&g(x.prototype,y),w&&g(x,w),x}}(),i=function g(x,y,w){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,y);if(b===void 0){var _=Object.getPrototypeOf(x);return _===null?void 0:g(_,y,w)}else{if("value"in b)return b.value;var T=b.get;return T===void 0?void 0:T.call(w)}},o=a(4),l=a(27),u=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function d(g,x){if(!(g instanceof x))throw new TypeError("Cannot call a class as a function")}function h(g,x){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:g}function p(g,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);g.prototype=Object.create(x&&x.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(g,x):g.__proto__=x)}var v=["height","width"],m=function(g){p(x,g);function x(){return d(this,x),h(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,[{key:"format",value:function(w,b){v.indexOf(w)>-1?b?this.domNode.setAttribute(w,b):this.domNode.removeAttribute(w):i(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,b)}}],[{key:"create",value:function(w){var b=i(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,w);return b.setAttribute("frameborder","0"),b.setAttribute("allowfullscreen",!0),b.setAttribute("src",this.sanitize(w)),b}},{key:"formats",value:function(w){return v.reduce(function(b,_){return w.hasAttribute(_)&&(b[_]=w.getAttribute(_)),b},{})}},{key:"sanitize",value:function(w){return u.default.sanitize(w)}},{key:"value",value:function(w){return w.getAttribute("src")}}]),x}(o.BlockEmbed);m.blotName="video",m.className="ql-video",m.tagName="IFRAME",n.default=m},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var s=function(){function w(b,_){for(var T=0;T<_.length;T++){var E=_[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,_,T){return _&&w(b.prototype,_),T&&w(b,T),b}}(),i=function w(b,_,T){b===null&&(b=Function.prototype);var E=Object.getOwnPropertyDescriptor(b,_);if(E===void 0){var C=Object.getPrototypeOf(b);return C===null?void 0:w(C,_,T)}else{if("value"in E)return E.value;var P=E.get;return P===void 0?void 0:P.call(T)}},o=a(35),l=p(o),u=a(5),f=p(u),d=a(9),h=p(d);function p(w){return w&&w.__esModule?w:{default:w}}function v(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function m(w,b){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:w}function g(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(w,b):w.__proto__=b)}var x=function(w){g(b,w);function b(){return v(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,null,[{key:"create",value:function(T){var E=i(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,T);return typeof T=="string"&&(window.katex.render(T,E,{throwOnError:!1,errorColor:"#f00"}),E.setAttribute("data-value",T)),E}},{key:"value",value:function(T){return T.getAttribute("data-value")}}]),b}(l.default);x.blotName="formula",x.className="ql-formula",x.tagName="SPAN";var y=function(w){g(b,w),s(b,null,[{key:"register",value:function(){f.default.register(x,!0)}}]);function b(){v(this,b);var _=m(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return b}(h.default);n.FormulaBlot=x,n.default=y},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var s=function(){function T(E,C){for(var P=0;P<C.length;P++){var N=C[P];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}return function(E,C,P){return C&&T(E.prototype,C),P&&T(E,P),E}}(),i=function T(E,C,P){E===null&&(E=Function.prototype);var N=Object.getOwnPropertyDescriptor(E,C);if(N===void 0){var k=Object.getPrototypeOf(E);return k===null?void 0:T(k,C,P)}else{if("value"in N)return N.value;var A=N.get;return A===void 0?void 0:A.call(P)}},o=a(0),l=m(o),u=a(5),f=m(u),d=a(9),h=m(d),p=a(13),v=m(p);function m(T){return T&&T.__esModule?T:{default:T}}function g(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}function x(T,E){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:T}function y(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);T.prototype=Object.create(E&&E.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(T,E):T.__proto__=E)}var w=function(T){y(E,T);function E(){return g(this,E),x(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return s(E,[{key:"replaceWith",value:function(P){this.domNode.textContent=this.domNode.textContent,this.attach(),i(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"replaceWith",this).call(this,P)}},{key:"highlight",value:function(P){var N=this.domNode.textContent;this.cachedText!==N&&((N.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=P(N),this.domNode.normalize(),this.attach()),this.cachedText=N)}}]),E}(v.default);w.className="ql-syntax";var b=new l.default.Attributor.Class("token","hljs",{scope:l.default.Scope.INLINE}),_=function(T){y(E,T),s(E,null,[{key:"register",value:function(){f.default.register(b,!0),f.default.register(w,!0)}}]);function E(C,P){g(this,E);var N=x(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,C,P));if(typeof N.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return N.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){N.highlight(),k=null},N.options.interval)}),N.highlight(),N}return s(E,[{key:"highlight",value:function(){var P=this;if(!this.quill.selection.composing){this.quill.update(f.default.sources.USER);var N=this.quill.getSelection();this.quill.scroll.descendants(w).forEach(function(k){k.highlight(P.options.highlight)}),this.quill.update(f.default.sources.SILENT),N!=null&&this.quill.setSelection(N,f.default.sources.SILENT)}}}]),E}(h.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(T){var E=window.hljs.highlightAuto(T);return E.value}}(),interval:1e3},n.CodeBlock=w,n.CodeToken=b,n.default=_},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var s=function E(C,P,N){C===null&&(C=Function.prototype);var k=Object.getOwnPropertyDescriptor(C,P);if(k===void 0){var A=Object.getPrototypeOf(C);return A===null?void 0:E(A,P,N)}else{if("value"in k)return k.value;var I=k.get;return I===void 0?void 0:I.call(N)}},i=function(){function E(C,P){for(var N=0;N<P.length;N++){var k=P[N];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(C,k.key,k)}}return function(C,P,N){return P&&E(C.prototype,P),N&&E(C,N),C}}(),o=a(3),l=g(o),u=a(8),f=g(u),d=a(43),h=g(d),p=a(15),v=a(41),m=g(v);function g(E){return E&&E.__esModule?E:{default:E}}function x(E,C){if(!(E instanceof C))throw new TypeError("Cannot call a class as a function")}function y(E,C){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:E}function w(E,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);E.prototype=Object.create(C&&C.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(E,C):E.__proto__=C)}var b=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(E){w(C,E);function C(P,N){x(this,C),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=b);var k=y(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,P,N));return k.quill.container.classList.add("ql-bubble"),k}return i(C,[{key:"extendToolbar",value:function(N){this.tooltip=new T(this.quill,this.options.bounds),this.tooltip.root.appendChild(N.container),this.buildButtons([].slice.call(N.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(N.container.querySelectorAll("select")),m.default)}}]),C}(h.default);_.DEFAULTS=(0,l.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){C?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var T=function(E){w(C,E);function C(P,N){x(this,C);var k=y(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,P,N));return k.quill.on(f.default.events.EDITOR_CHANGE,function(A,I,M,U){if(A===f.default.events.SELECTION_CHANGE)if(I!=null&&I.length>0&&U===f.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var W=k.quill.getLines(I.index,I.length);if(W.length===1)k.position(k.quill.getBounds(I));else{var G=W[W.length-1],Q=k.quill.getIndex(G),R=Math.min(G.length()-1,I.index+I.length-Q),z=k.quill.getBounds(new p.Range(Q,R));k.position(z)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return i(C,[{key:"listen",value:function(){var N=this;s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){N.root.classList.remove("ql-editing")}),this.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!N.root.classList.contains("ql-hidden")){var k=N.quill.getSelection();k!=null&&N.position(N.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(N){var k=s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"position",this).call(this,N),A=this.root.querySelector(".ql-tooltip-arrow");if(A.style.marginLeft="",k===0)return k;A.style.marginLeft=-1*k-A.offsetWidth/2+"px"}}]),C}(d.BaseTooltip);T.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=T,n.default=_},function(r,n,a){r.exports=a(63)}]).default})})(oj);var bae=oj.exports,_ae=Bn&&Bn.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),k0=Bn&&Bn.__assign||function(){return k0=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},k0.apply(this,arguments)},Eae=Bn&&Bn.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var s=arguments[t],i=0,o=s.length;i<o;i++,a++)n[a]=s[i];return n},jp=Bn&&Bn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},za=jp(S),Sae=jp($i),Gc=jp(wae),uE=jp(bae),Tae=function(e){_ae(t,e);function t(r){var n=e.call(this,r)||this;n.dirtyProps=["modules","formats","bounds","theme","children"],n.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],n.state={generation:0},n.selection=null,n.onEditorChange=function(s,i,o,l){var u,f,d,h;s==="text-change"?(f=(u=n).onEditorChangeText)===null||f===void 0||f.call(u,n.editor.root.innerHTML,i,l,n.unprivilegedEditor):s==="selection-change"&&((h=(d=n).onEditorChangeSelection)===null||h===void 0||h.call(d,i,l,n.unprivilegedEditor))};var a=n.isControlled()?r.value:r.defaultValue;return n.value=a??"",n}return t.prototype.validateProps=function(r){var n;if(za.default.Children.count(r.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(za.default.Children.count(r.children)){var a=za.default.Children.only(r.children);if(((n=a)===null||n===void 0?void 0:n.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&r.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},t.prototype.shouldComponentUpdate=function(r,n){var a=this,s;if(this.validateProps(r),!this.editor||this.state.generation!==n.generation)return!0;if("value"in r){var i=this.getEditorContents(),o=(s=r.value,s??"");this.isEqualValue(o,i)||this.setEditorContents(this.editor,o)}return r.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,r.readOnly),Eae(this.cleanProps,this.dirtyProps).some(function(l){return!Gc.default(r[l],a.props[l])})},t.prototype.shouldComponentRegenerate=function(r){var n=this;return this.dirtyProps.some(function(a){return!Gc.default(r[a],n.props[a])})},t.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},t.prototype.componentWillUnmount=function(){this.destroyEditor()},t.prototype.componentDidUpdate=function(r,n){var a=this;if(this.editor&&this.shouldComponentRegenerate(r)){var s=this.editor.getContents(),i=this.editor.getSelection();this.regenerationSnapshot={delta:s,selection:i},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==n.generation){var o=this.regenerationSnapshot,s=o.delta,l=o.selection;delete this.regenerationSnapshot,this.instantiateEditor();var u=this.editor;u.setContents(s),fE(function(){return a.setEditorSelection(u,l)})}},t.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},t.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},t.prototype.isControlled=function(){return"value"in this.props},t.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},t.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},t.prototype.createEditor=function(r,n){var a=new uE.default(r,n);return n.tabIndex!=null&&this.setEditorTabIndex(a,n.tabIndex),this.hookEditor(a),a},t.prototype.hookEditor=function(r){this.unprivilegedEditor=this.makeUnprivilegedEditor(r),r.on("editor-change",this.onEditorChange)},t.prototype.unhookEditor=function(r){r.off("editor-change",this.onEditorChange)},t.prototype.getEditorContents=function(){return this.value},t.prototype.getEditorSelection=function(){return this.selection},t.prototype.isDelta=function(r){return r&&r.ops},t.prototype.isEqualValue=function(r,n){return this.isDelta(r)&&this.isDelta(n)?Gc.default(r.ops,n.ops):Gc.default(r,n)},t.prototype.setEditorContents=function(r,n){var a=this;this.value=n;var s=this.getEditorSelection();typeof n=="string"?r.setContents(r.clipboard.convert(n)):r.setContents(n),fE(function(){return a.setEditorSelection(r,s)})},t.prototype.setEditorSelection=function(r,n){if(this.selection=n,n){var a=r.getLength();n.index=Math.max(0,Math.min(n.index,a-1)),n.length=Math.max(0,Math.min(n.length,a-1-n.index)),r.setSelection(n)}},t.prototype.setEditorTabIndex=function(r,n){var a,s;!((s=(a=r)===null||a===void 0?void 0:a.scroll)===null||s===void 0)&&s.domNode&&(r.scroll.domNode.tabIndex=n)},t.prototype.setEditorReadOnly=function(r,n){n?r.disable():r.enable()},t.prototype.makeUnprivilegedEditor=function(r){var n=r;return{getHTML:function(){return n.root.innerHTML},getLength:n.getLength.bind(n),getText:n.getText.bind(n),getContents:n.getContents.bind(n),getSelection:n.getSelection.bind(n),getBounds:n.getBounds.bind(n)}},t.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var r=Sae.default.findDOMNode(this.editingArea);if(!r)throw new Error("Cannot find element for editing area");if(r.nodeType===3)throw new Error("Editing area cannot be a text node");return r},t.prototype.renderEditingArea=function(){var r=this,n=this.props,a=n.children,s=n.preserveWhitespace,i=this.state.generation,o={key:i,ref:function(l){r.editingArea=l}};return za.default.Children.count(a)?za.default.cloneElement(za.default.Children.only(a),o):s?za.default.createElement("pre",k0({},o)):za.default.createElement("div",k0({},o))},t.prototype.render=function(){var r;return za.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(r=this.props.className,r??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},t.prototype.onEditorChangeText=function(r,n,a,s){var i,o;if(this.editor){var l=this.isDelta(this.value)?s.getContents():s.getHTML();l!==this.getEditorContents()&&(this.lastDeltaChangeSet=n,this.value=l,(o=(i=this.props).onChange)===null||o===void 0||o.call(i,r,n,a,s))}},t.prototype.onEditorChangeSelection=function(r,n,a){var s,i,o,l,u,f;if(this.editor){var d=this.getEditorSelection(),h=!d&&r,p=d&&!r;Gc.default(r,d)||(this.selection=r,(i=(s=this.props).onChangeSelection)===null||i===void 0||i.call(s,r,n,a),h?(l=(o=this.props).onFocus)===null||l===void 0||l.call(o,r,n,a):p&&((f=(u=this.props).onBlur)===null||f===void 0||f.call(u,d,n,a)))}},t.prototype.focus=function(){this.editor&&this.editor.focus()},t.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},t.displayName="React Quill",t.Quill=uE.default,t.defaultProps={theme:"snow",modules:{},readOnly:!1},t}(za.default.Component);function fE(e){Promise.resolve().then(e)}var Pl=Tae;const kae=mx(Pl),Nae=["sans","serif","mono","arial","times","georgia","courier"];let Aae=null;try{Aae=Pl.Quill.import("modules/table"),console.log("✅ Quill table module loaded successfully")}catch(e){console.log("⚠️ Quill table module not available, using custom handler:",e)}try{const e=Pl.Quill.import("formats/font");e.whitelist=Nae,Pl.Quill.register(e,!0);const t=Pl.Quill.import("blots/block/embed");class r extends t{static create(a){const s=super.create();s.className="pg-file-card",s.setAttribute("contenteditable","false");const i=((a==null?void 0:a.name)||"Download file").toString(),o=a!=null&&a.size?` • ${a.size}`:"";return s.innerHTML=`
<a href="${a.url}" target="_blank" rel="noopener noreferrer" class="pg-file-card__link">
<span class="pg-file-card__name">${i}</span>
<span class="pg-file-card__meta">${o}</span>
<span class="pg-file-card__cta">Download</span>
</a>
`.trim(),s}static value(a){var l,u;const s=a.querySelector("a"),i=((l=a.querySelector(".pg-file-card__name"))==null?void 0:l.textContent)||"",o=((u=a.querySelector(".pg-file-card__meta"))==null?void 0:u.textContent)||"";return{url:(s==null?void 0:s.getAttribute("href"))||"",name:i,size:o.replace(/^\s*•\s*/,"")}}}nd(r,"blotName","file-card"),nd(r,"tagName","div"),Pl.Quill.register(r,!0)}catch(e){console.warn("⚠️ Quill additional formats registration failed:",e)}function Cae({value:e,onChange:t,placeholder:r="Start writing...",className:n}){const a=S.useRef(null),[s,i]=S.useState({words:0,characters:0}),[o,l]=S.useState(!1),[u,f]=S.useState(!1),[d,h]=S.useState(!1),[p,v]=S.useState(!1),[m,g]=S.useState({url:"",alt:"",width:"",alignment:"left",layout:"block"}),[x,y]=S.useState(null),[w,b]=S.useState({url:"",type:"youtube"}),[_,T]=S.useState({code:"",language:"javascript"}),[E,C]=S.useState({url:"",name:"",size:""});S.useEffect(()=>{const j=e.replace(/<[^>]*>/g,""),B=j.trim()?j.trim().split(/\s+/).length:0,L=j.length;i({words:B,characters:L})},[e]);const P=S.useMemo(()=>function(){var L;const j=(L=a.current)==null?void 0:L.getEditor(),B=j==null?void 0:j.getSelection(!0);if(j&&B){const[F]=j.getLeaf(B.index),H=F==null?void 0:F.domNode;if(H&&H.tagName==="IMG"){const Z=H,X=(Z.getAttribute("style")||"").toLowerCase(),ne=Z.getAttribute("src")||"",he=Z.getAttribute("alt")||"",V=X.match(/max-width:\s*(\d+)px/),Te=(V==null?void 0:V[1])||"";let Ee="block";X.includes("float: left")&&(Ee="wrap-left"),X.includes("float: right")&&(Ee="wrap-right"),X.includes("display: inline")&&(Ee="inline");let xe="left";X.includes("margin-left: auto")&&X.includes("margin-right: auto")?xe="center":X.includes("margin-left: auto")&&X.includes("margin-right: 0")&&(xe="right"),y(B.index),g({url:ne,alt:he,width:Te,alignment:xe,layout:Ee}),l(!0);return}}y(null),g({url:"",alt:"",width:"",alignment:"left",layout:"block"}),l(!0)},[]),N=()=>{var Z;const j=(Z=a.current)==null?void 0:Z.getEditor();if(!j||!m.url)return;const B=j.getSelection(!0);if(!B)return;const L=[];if(m.width?(L.push(`max-width: ${m.width}px`),L.push("width: 100%")):L.push("max-width: 100%"),m.layout==="inline")L.push("display: inline; vertical-align: baseline; margin: 0 .25rem;");else if(m.layout==="wrap-left")L.push("float: left; margin: 0.75rem 1rem 0.75rem 0; display: block;");else if(m.layout==="wrap-right")L.push("float: right; margin: 0.75rem 0 0.75rem 1rem; display: block;");else{let X="";m.alignment==="center"?X="display: block; margin-left: auto; margin-right: auto;":m.alignment==="right"?X="display: block; margin-left: auto; margin-right: 0;":X="display: block; margin-left: 0; margin-right: auto;",L.push(X),L.push("margin-top: 1rem"),L.push("margin-bottom: 1rem")}L.push("height: auto");const F=L.join("; "),H=`<img src="${m.url}" alt="${m.alt||""}" style="${F}" />`;x!==null?(j.deleteText(x,1,"user"),j.clipboard.dangerouslyPasteHTML(x,H),j.setSelection(x+1)):(j.clipboard.dangerouslyPasteHTML(B.index,H),j.setSelection(B.index+1)),l(!1),y(null),g({url:"",alt:"",width:"",alignment:"left",layout:"block"})},k=S.useMemo(()=>function(){C({url:"",name:"",size:""}),v(!0)},[]),A=()=>{var L;const j=(L=a.current)==null?void 0:L.getEditor();if(!j||!E.url)return;const B=j.getSelection(!0);B&&(j.insertEmbed(B.index,"file-card",{url:E.url,name:E.name||"Download file",size:E.size},"user"),j.setSelection(B.index+1),v(!1),C({url:"",name:"",size:""}))},I=S.useMemo(()=>function(){b({url:"",type:"youtube"}),f(!0)},[]),M=()=>{var F;const j=(F=a.current)==null?void 0:F.getEditor();if(!j||!w.url)return;const B=j.getSelection(!0);if(!B)return;let L="";if(w.type==="youtube"){const H=new RegExp('(?:youtube\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/\\s]{11})'),Z=w.url.match(H);if(Z&&Z[1])L=`<div class="embed-container" style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin: 1rem 0;">
<iframe src="https://www.youtube.com/embed/${Z[1]}"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</div>`;else{alert("Invalid YouTube URL. Please enter a valid YouTube video URL.");return}}else L=`<div class="embed-container" style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin: 1rem 0;">
<iframe src="${w.url}"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
frameborder="0"
allowfullscreen></iframe>
</div>`;j.clipboard.dangerouslyPasteHTML(B.index,L),j.setSelection(B.index+1),f(!1),b({url:"",type:"youtube"})},U=S.useMemo(()=>function(){T({code:"",language:"javascript"}),h(!0)},[]),W=()=>{var F;const j=(F=a.current)==null?void 0:F.getEditor();if(!j||!_.code)return;const B=j.getSelection(!0);if(!B)return;const L=`<pre class="language-${_.language}"><code class="language-${_.language}">${_.code}</code></pre>`;j.clipboard.dangerouslyPasteHTML(B.index,L),j.setSelection(B.index+1),h(!1),T({code:"",language:"javascript"})},G=S.useMemo(()=>function(){var ne;const j=(ne=a.current)==null?void 0:ne.getEditor();if(!j)return;const B=prompt("Number of rows:","3"),L=prompt("Number of columns:","3");if(!B||!L)return;const F=parseInt(B,10),H=parseInt(L,10);if(isNaN(F)||isNaN(H)||F<1||H<1){alert("Please enter valid numbers for rows and columns.");return}const Z=j.getSelection(!0);if(!Z)return;let X='<table style="border-collapse: collapse; width: 100%; margin: 1rem 0;"><tbody>';for(let he=0;he<F;he++){X+="<tr>";for(let V=0;V<H;V++)X+='<td style="border: 1px solid #ddd; padding: 8px;"> </td>';X+="</tr>"}X+="</tbody></table>",j.clipboard.dangerouslyPasteHTML(Z.index,X),j.setSelection(Z.index+1)},[]),Q=S.useMemo(()=>function(){var F;const j=(F=a.current)==null?void 0:F.getEditor();if(!j)return;const B=j.getSelection(!0);if(!B)return;j.clipboard.dangerouslyPasteHTML(B.index,'<hr style="margin: 1.5rem 0; border: none; border-top: 2px solid #ddd;" />'),j.setSelection(B.index+1)},[]),R=()=>{var B;const j=(B=a.current)==null?void 0:B.getEditor();j&&j.history.undo()},z=()=>{var B;const j=(B=a.current)==null?void 0:B.getEditor();j&&j.history.redo()};S.useEffect(()=>{var L;const j=(L=a.current)==null?void 0:L.getEditor();if(!j)return;const B=F=>{if((F.ctrlKey||F.metaKey)&&F.key==="b"&&(F.preventDefault(),j.format("bold",!j.getFormat().bold)),(F.ctrlKey||F.metaKey)&&F.key==="i"&&(F.preventDefault(),j.format("italic",!j.getFormat().italic)),(F.ctrlKey||F.metaKey)&&F.key==="k"){F.preventDefault();const H=prompt("Enter URL:");H&&j.format("link",H)}};return document.addEventListener("keydown",B),()=>{document.removeEventListener("keydown",B)}},[]);const D=S.useMemo(()=>({toolbar:{container:[[{font:[]}],[{header:[1,2,3,4,!1]}],["bold","italic","underline","strike"],[{script:"sub"},{script:"super"}],[{align:[]}],[{list:"ordered"},{list:"bullet"}],["blockquote","code-block"],["link","image","video"],[{color:[]},{background:[]}],["clean"]],handlers:{image:P,video:I}},clipboard:{matchVisual:!1},history:{delay:1e3,maxStack:100,userOnly:!0}}),[P,I]),O=S.useMemo(()=>["font","header","bold","italic","underline","strike","script","align","list","bullet","blockquote","code-block","link","image","video","file-card","color","background","width","height"],[]);return c.jsx(pN,{children:c.jsxs("div",{className:je("rich-text-editor-wrapper",n),children:[c.jsx("style",{children:`
.rich-text-editor-wrapper .pg-editor-topbar {
position: sticky;
top: 80px;
z-index: 20;
}
.rich-text-editor-wrapper .ql-container {
font-size: 14px;
min-height: 300px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
background: hsl(var(--background));
color: hsl(var(--foreground));
}
.rich-text-editor-wrapper .ql-editor {
min-height: 300px;
font-family: inherit;
}
.rich-text-editor-wrapper .ql-toolbar {
position: sticky;
top: 124px;
z-index: 15;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
background: hsl(var(--muted));
border-color: hsl(var(--border));
}
/* Make the font dropdown readable (Quill needs label mappings) */
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label::before,
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item::before {
content: attr(data-value);
}
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="sans"]::before { content: "Sans"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="sans"]::before { content: "Sans"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before { content: "Serif"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before { content: "Serif"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="mono"]::before { content: "Mono"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="mono"]::before { content: "Mono"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="arial"]::before { content: "Arial"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="arial"]::before { content: "Arial"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="times"]::before { content: "Times"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="times"]::before { content: "Times"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="georgia"]::before { content: "Georgia"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="georgia"]::before { content: "Georgia"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-label[data-value="courier"]::before { content: "Courier"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker.ql-font .ql-picker-item[data-value="courier"]::before { content: "Courier"; }
.rich-text-editor-wrapper .ql-toolbar .ql-picker-options {
background: hsl(var(--popover));
border-color: hsl(var(--border));
}
.rich-text-editor-wrapper .ql-toolbar .ql-picker-item,
.rich-text-editor-wrapper .ql-toolbar .ql-picker-label {
color: hsl(var(--foreground));
}
.rich-text-editor-wrapper .ql-toolbar .ql-stroke {
stroke: hsl(var(--foreground));
}
.rich-text-editor-wrapper .ql-toolbar .ql-fill {
fill: hsl(var(--foreground));
}
.rich-text-editor-wrapper .ql-toolbar button:hover,
.rich-text-editor-wrapper .ql-toolbar button.ql-active {
color: hsl(var(--primary));
}
.rich-text-editor-wrapper .ql-toolbar .ql-picker-label {
color: hsl(var(--foreground));
}
.rich-text-editor-wrapper .ql-editor.ql-blank::before {
color: hsl(var(--muted-foreground));
font-style: normal;
}
.rich-text-editor-wrapper .ql-editor pre.ql-syntax {
background-color: hsl(var(--muted));
border-radius: 4px;
padding: 1rem;
margin: 1rem 0;
overflow-x: auto;
font-family: 'Courier New', monospace;
}
.rich-text-editor-wrapper .ql-editor table {
border-collapse: collapse;
width: 100%;
margin: 1rem 0;
}
.rich-text-editor-wrapper .ql-editor table td,
.rich-text-editor-wrapper .ql-editor table th {
border: 1px solid hsl(var(--border));
padding: 8px;
}
.rich-text-editor-wrapper .ql-editor img {
max-width: 100%;
height: auto;
margin: 1rem 0;
display: block;
}
.rich-text-editor-wrapper .ql-editor img[style*="margin-left: auto"][style*="margin-right: auto"] {
margin-left: auto !important;
margin-right: auto !important;
}
.rich-text-editor-wrapper .ql-editor img[style*="margin-right: 0"] {
margin-left: auto !important;
margin-right: 0 !important;
}
.rich-text-editor-wrapper .ql-font-sans { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; }
.rich-text-editor-wrapper .ql-font-serif { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }
.rich-text-editor-wrapper .ql-font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.rich-text-editor-wrapper .ql-font-arial { font-family: Arial, Helvetica, sans-serif; }
.rich-text-editor-wrapper .ql-font-times { font-family: "Times New Roman", Times, serif; }
.rich-text-editor-wrapper .ql-font-georgia { font-family: Georgia, serif; }
.rich-text-editor-wrapper .ql-font-courier { font-family: "Courier New", Courier, monospace; }
.rich-text-editor-wrapper .pg-file-card {
margin: 0.75rem 0;
padding: 0.75rem;
border: 1px solid hsl(var(--border));
border-radius: 10px;
background: hsl(var(--muted));
}
.rich-text-editor-wrapper .pg-file-card__link {
display: flex;
align-items: center;
gap: 0.75rem;
text-decoration: none;
color: hsl(var(--foreground));
}
.rich-text-editor-wrapper .pg-file-card__name {
font-weight: 600;
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rich-text-editor-wrapper .pg-file-card__meta {
color: hsl(var(--muted-foreground));
font-size: 12px;
white-space: nowrap;
}
.rich-text-editor-wrapper .pg-file-card__cta {
font-size: 12px;
padding: 0.25rem 0.5rem;
border-radius: 999px;
border: 1px solid hsl(var(--border));
background: hsl(var(--background));
white-space: nowrap;
}
/* Ensure headings work correctly */
.rich-text-editor-wrapper .ql-editor h1,
.rich-text-editor-wrapper .ql-editor h2,
.rich-text-editor-wrapper .ql-editor h3,
.rich-text-editor-wrapper .ql-editor h4 {
font-weight: bold;
margin-top: 1em;
margin-bottom: 0.5em;
line-height: 1.2;
}
.rich-text-editor-wrapper .ql-editor h1 { font-size: 2em; }
.rich-text-editor-wrapper .ql-editor h2 { font-size: 1.5em; }
.rich-text-editor-wrapper .ql-editor h3 { font-size: 1.17em; }
.rich-text-editor-wrapper .ql-editor h4 { font-size: 1em; }
`}),c.jsxs("div",{className:"pg-editor-topbar flex items-center justify-between border-b border-border bg-background/90 backdrop-blur-md p-2 rounded-t-lg shadow-sm",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:R,className:"h-8 w-8 p-0",children:c.jsx(mF,{className:"h-4 w-4"})})}),c.jsx(Vs,{children:"Undo (Ctrl+Z)"})]}),c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:z,className:"h-8 w-8 p-0",children:c.jsx(fF,{className:"h-4 w-4"})})}),c.jsx(Vs,{children:"Redo (Ctrl+Y)"})]}),c.jsx("div",{className:"h-6 w-px bg-border mx-1"}),c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:G,className:"h-8 px-2",children:"Table"})}),c.jsx(Vs,{children:"Insert Table"})]}),c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsxs(be,{type:"button",variant:"ghost",size:"sm",onClick:U,className:"h-8 px-2",children:[c.jsx(ZI,{className:"h-4 w-4 mr-1"}),"Code"]})}),c.jsx(Vs,{children:"Insert Code Block"})]}),c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:Q,className:"h-8 px-2",children:c.jsx(lF,{className:"h-4 w-4"})})}),c.jsx(Vs,{children:"Insert Horizontal Divider"})]}),c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsxs(be,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(!0),className:"h-8 px-2",children:[c.jsx(Y0,{className:"h-4 w-4 mr-1"}),"Embed"]})}),c.jsx(Vs,{children:"Insert YouTube/Embed"})]}),c.jsxs(Vi,{children:[c.jsx(Gi,{asChild:!0,children:c.jsxs(be,{type:"button",variant:"ghost",size:"sm",onClick:k,className:"h-8 px-2",children:[c.jsx(cF,{className:"h-4 w-4 mr-1"}),"File"]})}),c.jsx(Vs,{children:"Attach a file (PDF/ZIP/etc)"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.words," words • ",s.characters," characters"]})]}),c.jsx(kae,{ref:a,theme:"snow",value:e,onChange:t,modules:D,formats:O,placeholder:r,preserveWhitespace:!0,bounds:"self"}),c.jsx(ou,{open:o,onOpenChange:l,children:c.jsxs(Tl,{className:"max-h-[90vh] overflow-y-auto",children:[c.jsxs(kl,{children:[c.jsx(Nl,{children:"Insert Image"}),c.jsx(cu,{children:"Upload an image from your computer or enter an image URL. Alt text is required for accessibility."})]}),c.jsxs("div",{className:"space-y-4 max-h-[calc(90vh-200px)] overflow-y-auto pr-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"image-upload",children:"Upload Image from Computer"}),c.jsx(Be,{id:"image-upload",type:"file",accept:"image/*",onChange:j=>{var L;const B=(L=j.target.files)==null?void 0:L[0];if(B){if(B.size>5*1024*1024){alert("Image size must be less than 5MB");return}const F=new FileReader;F.onload=H=>{var X;const Z=(X=H.target)==null?void 0:X.result;g({...m,url:Z})},F.onerror=()=>{alert("Error reading image file")},F.readAsDataURL(B)}},className:"cursor-pointer"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Or enter URL below"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"image-url",children:"Image URL"}),c.jsx(Be,{id:"image-url",value:m.url,onChange:j=>g({...m,url:j.target.value}),placeholder:"https://example.com/image.jpg or upload from computer above"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"image-alt",children:"Alt Text *"}),c.jsx(Be,{id:"image-alt",value:m.alt,onChange:j=>g({...m,alt:j.target.value}),placeholder:"Description of the image",required:!0})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"image-width",children:"Max Width (px, optional)"}),c.jsx(Be,{id:"image-width",type:"number",value:m.width,onChange:j=>g({...m,width:j.target.value}),placeholder:"800",min:"100",max:"2000"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"image-alignment",children:"Alignment"}),c.jsxs(kn,{value:m.alignment,onValueChange:j=>g({...m,alignment:j}),children:[c.jsx(ln,{id:"image-alignment",children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"left",children:"Left"}),c.jsx(Qe,{value:"center",children:"Center"}),c.jsx(Qe,{value:"right",children:"Right"})]})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"image-layout",children:"Layout"}),c.jsxs(kn,{value:m.layout,onValueChange:j=>g({...m,layout:j}),children:[c.jsx(ln,{id:"image-layout",children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"block",children:"Block"}),c.jsx(Qe,{value:"inline",children:"In line with text"}),c.jsx(Qe,{value:"wrap-left",children:"Wrap text (float left)"}),c.jsx(Qe,{value:"wrap-right",children:"Wrap text (float right)"})]})]})]}),m.url&&c.jsxs("div",{className:"mt-4",children:[c.jsx(Oe,{children:"Preview:"}),c.jsx("img",{src:m.url,alt:m.alt||"Preview",className:"mt-2 max-w-full h-auto rounded border",onError:j=>{j.target.style.display="none"}})]})]}),c.jsxs(lu,{children:[c.jsx(be,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),c.jsx(be,{onClick:N,disabled:!m.url||!m.alt,children:"Insert Image"})]})]})}),c.jsx(ou,{open:p,onOpenChange:v,children:c.jsxs(Tl,{className:"max-h-[90vh] overflow-y-auto",children:[c.jsxs(kl,{children:[c.jsx(Nl,{children:"Attach File"}),c.jsx(cu,{children:"Upload a file (PDF/ZIP/etc) or paste a URL. Uploaded files are embedded as a downloadable card."})]}),c.jsxs("div",{className:"space-y-4 max-h-[calc(90vh-200px)] overflow-y-auto pr-2",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"file-upload",children:"Upload File from Computer"}),c.jsx(Be,{id:"file-upload",type:"file",onChange:j=>{var F;const B=(F=j.target.files)==null?void 0:F[0];if(!B)return;if(B.size>1*1024*1024){alert("File too large to embed. Please upload it to storage and paste its URL, or select a smaller file (<= 1MB).");return}const L=new FileReader;L.onload=H=>{var X;const Z=(X=H.target)==null?void 0:X.result;C({url:Z,name:B.name,size:`${Math.ceil(B.size/1024)} KB`})},L.onerror=()=>{alert("Error reading file")},L.readAsDataURL(B)},className:"cursor-pointer"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Or enter URL below"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"file-url",children:"File URL *"}),c.jsx(Be,{id:"file-url",value:E.url,onChange:j=>C({...E,url:j.target.value}),placeholder:"https://example.com/file.pdf"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"file-name",children:"Display name"}),c.jsx(Be,{id:"file-name",value:E.name,onChange:j=>C({...E,name:j.target.value}),placeholder:"e.g. Planting Guide (PDF)"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"file-size",children:"Size (optional)"}),c.jsx(Be,{id:"file-size",value:E.size,onChange:j=>C({...E,size:j.target.value}),placeholder:"e.g. 320 KB"})]})]})]}),c.jsxs(lu,{children:[c.jsx(be,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),c.jsx(be,{onClick:A,disabled:!E.url,children:"Insert File Card"})]})]})}),c.jsx(ou,{open:u,onOpenChange:f,children:c.jsxs(Tl,{children:[c.jsxs(kl,{children:[c.jsx(Nl,{children:"Insert Embed"}),c.jsx(cu,{children:"Insert YouTube video or iframe embed. URLs will be sanitized for security."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"embed-type",children:"Embed Type"}),c.jsxs(kn,{value:w.type,onValueChange:j=>b({...w,type:j}),children:[c.jsx(ln,{children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"youtube",children:"YouTube"}),c.jsx(Qe,{value:"iframe",children:"Generic Iframe"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"embed-url",children:"URL *"}),c.jsx(Be,{id:"embed-url",value:w.url,onChange:j=>b({...w,url:j.target.value}),placeholder:w.type==="youtube"?"https://www.youtube.com/watch?v=...":"https://example.com/embed"})]})]}),c.jsxs(lu,{children:[c.jsx(be,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),c.jsx(be,{onClick:M,disabled:!w.url,children:"Insert Embed"})]})]})}),c.jsx(ou,{open:d,onOpenChange:h,children:c.jsxs(Tl,{className:"max-w-2xl",children:[c.jsxs(kl,{children:[c.jsx(Nl,{children:"Insert Code Block"}),c.jsx(cu,{children:"Enter your code and select the programming language for syntax highlighting."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"code-language",children:"Language"}),c.jsxs(kn,{value:_.language,onValueChange:j=>T({..._,language:j}),children:[c.jsx(ln,{children:c.jsx(Nn,{})}),c.jsxs(cn,{children:[c.jsx(Qe,{value:"javascript",children:"JavaScript"}),c.jsx(Qe,{value:"typescript",children:"TypeScript"}),c.jsx(Qe,{value:"html",children:"HTML"}),c.jsx(Qe,{value:"css",children:"CSS"}),c.jsx(Qe,{value:"bash",children:"Bash"}),c.jsx(Qe,{value:"json",children:"JSON"}),c.jsx(Qe,{value:"python",children:"Python"}),c.jsx(Qe,{value:"java",children:"Java"}),c.jsx(Qe,{value:"sql",children:"SQL"}),c.jsx(Qe,{value:"plaintext",children:"Plain Text"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"code-content",children:"Code *"}),c.jsx("textarea",{id:"code-content",value:_.code,onChange:j=>T({..._,code:j.target.value}),className:"w-full min-h-[200px] p-2 border rounded font-mono text-sm",placeholder:"Enter your code here..."})]})]}),c.jsxs(lu,{children:[c.jsx(be,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),c.jsx(be,{onClick:W,disabled:!_.code.trim(),children:"Insert Code"})]})]})})]})})}function dE({value:e,onChange:t,label:r="Image",placeholder:n="https://example.com/image.jpg",maxSizeMB:a=5}){const{toast:s}=Is(),i=S.useRef(null),[o,l]=S.useState(!1),u=async h=>{var m;const p=(m=h.target.files)==null?void 0:m[0];if(!p)return;if(!p.type.startsWith("image/")){s({title:"Invalid File Type",description:"Please select an image file (JPG, PNG, GIF, etc.)",variant:"destructive"});return}const v=a*1024*1024;if(p.size>v){s({title:"File Too Large",description:`Image must be smaller than ${a}MB. Current size: ${(p.size/1024/1024).toFixed(2)}MB`,variant:"destructive"});return}l(!0);try{const g=new FileReader;g.onloadend=()=>{const x=g.result;t(x),l(!1),s({title:"Image Uploaded",description:"Image has been converted and added successfully."})},g.onerror=()=>{l(!1),s({title:"Upload Failed",description:"Failed to read the image file. Please try again.",variant:"destructive"})},g.readAsDataURL(p)}catch{l(!1),s({title:"Upload Error",description:"An error occurred while uploading the image.",variant:"destructive"})}i.current&&(i.current.value="")},f=()=>{t(""),i.current&&(i.current.value="")},d=e&&e.startsWith("data:image");return c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{children:r}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Be,{type:"url",value:e&&!d?e:"",onChange:h=>t(h.target.value),placeholder:n,className:"flex-1"}),c.jsxs(be,{type:"button",variant:"outline",onClick:()=>{var h;return(h=i.current)==null?void 0:h.click()},disabled:o,className:"flex items-center gap-2",children:[c.jsx(Xh,{className:"w-4 h-4"}),o?"Uploading...":"Upload"]}),e&&c.jsx(be,{type:"button",variant:"ghost",size:"icon",onClick:f,className:"flex-shrink-0",children:c.jsx(Ri,{className:"w-4 h-4"})})]}),c.jsx("input",{ref:i,type:"file",accept:"image/*",onChange:u,className:"hidden"}),e&&c.jsx("div",{className:"relative mt-2",children:c.jsxs("div",{className:"relative w-full h-48 rounded-lg overflow-hidden border border-border bg-muted",children:[c.jsx("img",{src:e,alt:"Preview",className:"w-full h-full object-contain",onError:h=>{h.target.style.display="none"}}),d&&c.jsx("div",{className:"absolute top-2 right-2 bg-primary/90 text-primary-foreground text-xs px-2 py-1 rounded",children:"Local Image"})]})}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Enter an image URL or upload from your computer (max ",a,"MB). Supported formats: JPG, PNG, GIF, WebP"]})]})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:lj,setPrototypeOf:hE,isFrozen:Pae,getPrototypeOf:Oae,getOwnPropertyDescriptor:jae}=Object;let{freeze:mn,seal:ca,create:fx}=Object,{apply:dx,construct:hx}=typeof Reflect<"u"&&Reflect;mn||(mn=function(t){return t});ca||(ca=function(t){return t});dx||(dx=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),s=2;s<n;s++)a[s-2]=arguments[s];return t.apply(r,a)});hx||(hx=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return new t(...n)});const Vd=gn(Array.prototype.forEach),Rae=gn(Array.prototype.lastIndexOf),pE=gn(Array.prototype.pop),Kc=gn(Array.prototype.push),Iae=gn(Array.prototype.splice),_h=gn(String.prototype.toLowerCase),Zm=gn(String.prototype.toString),eg=gn(String.prototype.match),Yc=gn(String.prototype.replace),Fae=gn(String.prototype.indexOf),Dae=gn(String.prototype.trim),xa=gn(Object.prototype.hasOwnProperty),Zr=gn(RegExp.prototype.test),Xc=Mae(TypeError);function gn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return dx(e,t,n)}}function Mae(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return hx(e,r)}}function ct(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_h;hE&&hE(e,null);let n=t.length;for(;n--;){let a=t[n];if(typeof a=="string"){const s=r(a);s!==a&&(Pae(t)||(t[n]=s),a=s)}e[a]=!0}return e}function Lae(e){for(let t=0;t<e.length;t++)xa(e,t)||(e[t]=null);return e}function qa(e){const t=fx(null);for(const[r,n]of lj(e))xa(e,r)&&(Array.isArray(n)?t[r]=Lae(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=qa(n):t[r]=n);return t}function Jc(e,t){for(;e!==null;){const n=jae(e,t);if(n){if(n.get)return gn(n.get);if(typeof n.value=="function")return gn(n.value)}e=Oae(e)}function r(){return null}return r}const mE=mn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),tg=mn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rg=mn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Bae=mn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ng=mn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Uae=mn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),gE=mn(["#text"]),vE=mn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ag=mn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),xE=mn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Gd=mn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$ae=ca(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zae=ca(/<%[\w\W]*|[\w\W]*%>/gm),Hae=ca(/\$\{[\w\W]*/gm),qae=ca(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wae=ca(/^aria-[\-\w]+$/),cj=ca(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vae=ca(/^(?:\w+script|data):/i),Gae=ca(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),uj=ca(/^html$/i),Kae=ca(/^[a-z][.\w]*(-[.\w]+)+$/i);var yE=Object.freeze({__proto__:null,ARIA_ATTR:Wae,ATTR_WHITESPACE:Gae,CUSTOM_ELEMENT:Kae,DATA_ATTR:qae,DOCTYPE_NAME:uj,ERB_EXPR:zae,IS_ALLOWED_URI:cj,IS_SCRIPT_OR_DATA:Vae,MUSTACHE_EXPR:$ae,TMPLIT_EXPR:Hae});const Qc={element:1,text:3,progressingInstruction:7,comment:8,document:9},Yae=function(){return typeof window>"u"?null:window},Xae=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(n=r.getAttribute(a));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},wE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function fj(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yae();const t=ae=>fj(ae);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Qc.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,a=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:i,Node:o,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=e,v=l.prototype,m=Jc(v,"cloneNode"),g=Jc(v,"remove"),x=Jc(v,"nextSibling"),y=Jc(v,"childNodes"),w=Jc(v,"parentNode");if(typeof i=="function"){const ae=r.createElement("template");ae.content&&ae.content.ownerDocument&&(r=ae.content.ownerDocument)}let b,_="";const{implementation:T,createNodeIterator:E,createDocumentFragment:C,getElementsByTagName:P}=r,{importNode:N}=n;let k=wE();t.isSupported=typeof lj=="function"&&typeof w=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:I,TMPLIT_EXPR:M,DATA_ATTR:U,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:R}=yE;let{IS_ALLOWED_URI:z}=yE,D=null;const O=ct({},[...mE,...tg,...rg,...ng,...gE]);let j=null;const B=ct({},[...vE,...ag,...xE,...Gd]);let L=Object.seal(fx(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,H=null;const Z=Object.seal(fx(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let X=!0,ne=!0,he=!1,V=!0,Te=!1,Ee=!0,xe=!1,Se=!1,pe=!1,le=!1,ue=!1,me=!1,_e=!0,ye=!1;const Me="user-content-";let Le=!0,$e=!1,tt={},dt=null;const Je=ct({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ur=null;const Re=ct({},["audio","video","img","source","image","track"]);let ot=null;const rr=ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml";let ze=Ne,ht=!1,nr=null;const ut=ct({},[kt,ie,Ne],Zm);let Ot=ct({},["mi","mo","mn","ms","mtext"]),Sr=ct({},["annotation-xml"]);const Tr=ct({},["title","style","font","a","script"]);let At=null;const kr=["application/xhtml+xml","text/html"],Ve="text/html";let We=null,it=null;const bt=r.createElement("form"),He=function(Y){return Y instanceof RegExp||Y instanceof Function},st=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(it&&it===Y)){if((!Y||typeof Y!="object")&&(Y={}),Y=qa(Y),At=kr.indexOf(Y.PARSER_MEDIA_TYPE)===-1?Ve:Y.PARSER_MEDIA_TYPE,We=At==="application/xhtml+xml"?Zm:_h,D=xa(Y,"ALLOWED_TAGS")?ct({},Y.ALLOWED_TAGS,We):O,j=xa(Y,"ALLOWED_ATTR")?ct({},Y.ALLOWED_ATTR,We):B,nr=xa(Y,"ALLOWED_NAMESPACES")?ct({},Y.ALLOWED_NAMESPACES,Zm):ut,ot=xa(Y,"ADD_URI_SAFE_ATTR")?ct(qa(rr),Y.ADD_URI_SAFE_ATTR,We):rr,ur=xa(Y,"ADD_DATA_URI_TAGS")?ct(qa(Re),Y.ADD_DATA_URI_TAGS,We):Re,dt=xa(Y,"FORBID_CONTENTS")?ct({},Y.FORBID_CONTENTS,We):Je,F=xa(Y,"FORBID_TAGS")?ct({},Y.FORBID_TAGS,We):qa({}),H=xa(Y,"FORBID_ATTR")?ct({},Y.FORBID_ATTR,We):qa({}),tt=xa(Y,"USE_PROFILES")?Y.USE_PROFILES:!1,X=Y.ALLOW_ARIA_ATTR!==!1,ne=Y.ALLOW_DATA_ATTR!==!1,he=Y.ALLOW_UNKNOWN_PROTOCOLS||!1,V=Y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=Y.SAFE_FOR_TEMPLATES||!1,Ee=Y.SAFE_FOR_XML!==!1,xe=Y.WHOLE_DOCUMENT||!1,le=Y.RETURN_DOM||!1,ue=Y.RETURN_DOM_FRAGMENT||!1,me=Y.RETURN_TRUSTED_TYPE||!1,pe=Y.FORCE_BODY||!1,_e=Y.SANITIZE_DOM!==!1,ye=Y.SANITIZE_NAMED_PROPS||!1,Le=Y.KEEP_CONTENT!==!1,$e=Y.IN_PLACE||!1,z=Y.ALLOWED_URI_REGEXP||cj,ze=Y.NAMESPACE||Ne,Ot=Y.MATHML_TEXT_INTEGRATION_POINTS||Ot,Sr=Y.HTML_INTEGRATION_POINTS||Sr,L=Y.CUSTOM_ELEMENT_HANDLING||{},Y.CUSTOM_ELEMENT_HANDLING&&He(Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&He(Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&typeof Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(ne=!1),ue&&(le=!0),tt&&(D=ct({},gE),j=[],tt.html===!0&&(ct(D,mE),ct(j,vE)),tt.svg===!0&&(ct(D,tg),ct(j,ag),ct(j,Gd)),tt.svgFilters===!0&&(ct(D,rg),ct(j,ag),ct(j,Gd)),tt.mathMl===!0&&(ct(D,ng),ct(j,xE),ct(j,Gd))),Y.ADD_TAGS&&(typeof Y.ADD_TAGS=="function"?Z.tagCheck=Y.ADD_TAGS:(D===O&&(D=qa(D)),ct(D,Y.ADD_TAGS,We))),Y.ADD_ATTR&&(typeof Y.ADD_ATTR=="function"?Z.attributeCheck=Y.ADD_ATTR:(j===B&&(j=qa(j)),ct(j,Y.ADD_ATTR,We))),Y.ADD_URI_SAFE_ATTR&&ct(ot,Y.ADD_URI_SAFE_ATTR,We),Y.FORBID_CONTENTS&&(dt===Je&&(dt=qa(dt)),ct(dt,Y.FORBID_CONTENTS,We)),Y.ADD_FORBID_CONTENTS&&(dt===Je&&(dt=qa(dt)),ct(dt,Y.ADD_FORBID_CONTENTS,We)),Le&&(D["#text"]=!0),xe&&ct(D,["html","head","body"]),D.table&&(ct(D,["tbody"]),delete F.tbody),Y.TRUSTED_TYPES_POLICY){if(typeof Y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Xc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Xc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=Y.TRUSTED_TYPES_POLICY,_=b.createHTML("")}else b===void 0&&(b=Xae(p,a)),b!==null&&typeof _=="string"&&(_=b.createHTML(""));mn&&mn(Y),it=Y}},Ct=ct({},[...tg,...rg,...Bae]),xt=ct({},[...ng,...Uae]),Nr=function(Y){let oe=w(Y);(!oe||!oe.tagName)&&(oe={namespaceURI:ze,tagName:"template"});const ge=_h(Y.tagName),we=_h(oe.tagName);return nr[Y.namespaceURI]?Y.namespaceURI===ie?oe.namespaceURI===Ne?ge==="svg":oe.namespaceURI===kt?ge==="svg"&&(we==="annotation-xml"||Ot[we]):!!Ct[ge]:Y.namespaceURI===kt?oe.namespaceURI===Ne?ge==="math":oe.namespaceURI===ie?ge==="math"&&Sr[we]:!!xt[ge]:Y.namespaceURI===Ne?oe.namespaceURI===ie&&!Sr[we]||oe.namespaceURI===kt&&!Ot[we]?!1:!xt[ge]&&(Tr[ge]||!Ct[ge]):!!(At==="application/xhtml+xml"&&nr[Y.namespaceURI]):!1},Gn=function(Y){Kc(t.removed,{element:Y});try{w(Y).removeChild(Y)}catch{g(Y)}},os=function(Y,oe){try{Kc(t.removed,{attribute:oe.getAttributeNode(Y),from:oe})}catch{Kc(t.removed,{attribute:null,from:oe})}if(oe.removeAttribute(Y),Y==="is")if(le||ue)try{Gn(oe)}catch{}else try{oe.setAttribute(Y,"")}catch{}},q=function(Y){let oe=null,ge=null;if(pe)Y="<remove></remove>"+Y;else{const De=eg(Y,/^[\r\n\t ]+/);ge=De&&De[0]}At==="application/xhtml+xml"&&ze===Ne&&(Y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Y+"</body></html>");const we=b?b.createHTML(Y):Y;if(ze===Ne)try{oe=new h().parseFromString(we,At)}catch{}if(!oe||!oe.documentElement){oe=T.createDocument(ze,"template",null);try{oe.documentElement.innerHTML=ht?_:we}catch{}}const Ae=oe.body||oe.documentElement;return Y&&ge&&Ae.insertBefore(r.createTextNode(ge),Ae.childNodes[0]||null),ze===Ne?P.call(oe,xe?"html":"body")[0]:xe?oe.documentElement:Ae},te=function(Y){return E.call(Y.ownerDocument||Y,Y,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},K=function(Y){return Y instanceof d&&(typeof Y.nodeName!="string"||typeof Y.textContent!="string"||typeof Y.removeChild!="function"||!(Y.attributes instanceof f)||typeof Y.removeAttribute!="function"||typeof Y.setAttribute!="function"||typeof Y.namespaceURI!="string"||typeof Y.insertBefore!="function"||typeof Y.hasChildNodes!="function")},J=function(Y){return typeof o=="function"&&Y instanceof o};function ee(ae,Y,oe){Vd(ae,ge=>{ge.call(t,Y,oe,it)})}const re=function(Y){let oe=null;if(ee(k.beforeSanitizeElements,Y,null),K(Y))return Gn(Y),!0;const ge=We(Y.nodeName);if(ee(k.uponSanitizeElement,Y,{tagName:ge,allowedTags:D}),Ee&&Y.hasChildNodes()&&!J(Y.firstElementChild)&&Zr(/<[/\w!]/g,Y.innerHTML)&&Zr(/<[/\w!]/g,Y.textContent)||Y.nodeType===Qc.progressingInstruction||Ee&&Y.nodeType===Qc.comment&&Zr(/<[/\w]/g,Y.data))return Gn(Y),!0;if(!(Z.tagCheck instanceof Function&&Z.tagCheck(ge))&&(!D[ge]||F[ge])){if(!F[ge]&&ve(ge)&&(L.tagNameCheck instanceof RegExp&&Zr(L.tagNameCheck,ge)||L.tagNameCheck instanceof Function&&L.tagNameCheck(ge)))return!1;if(Le&&!dt[ge]){const we=w(Y)||Y.parentNode,Ae=y(Y)||Y.childNodes;if(Ae&&we){const De=Ae.length;for(let lt=De-1;lt>=0;--lt){const _t=m(Ae[lt],!0);_t.__removalCount=(Y.__removalCount||0)+1,we.insertBefore(_t,x(Y))}}}return Gn(Y),!0}return Y instanceof l&&!Nr(Y)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Zr(/<\/no(script|embed|frames)/i,Y.innerHTML)?(Gn(Y),!0):(Te&&Y.nodeType===Qc.text&&(oe=Y.textContent,Vd([A,I,M],we=>{oe=Yc(oe,we," ")}),Y.textContent!==oe&&(Kc(t.removed,{element:Y.cloneNode()}),Y.textContent=oe)),ee(k.afterSanitizeElements,Y,null),!1)},fe=function(Y,oe,ge){if(_e&&(oe==="id"||oe==="name")&&(ge in r||ge in bt))return!1;if(!(ne&&!H[oe]&&Zr(U,oe))){if(!(X&&Zr(W,oe))){if(!(Z.attributeCheck instanceof Function&&Z.attributeCheck(oe,Y))){if(!j[oe]||H[oe]){if(!(ve(Y)&&(L.tagNameCheck instanceof RegExp&&Zr(L.tagNameCheck,Y)||L.tagNameCheck instanceof Function&&L.tagNameCheck(Y))&&(L.attributeNameCheck instanceof RegExp&&Zr(L.attributeNameCheck,oe)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(oe,Y))||oe==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Zr(L.tagNameCheck,ge)||L.tagNameCheck instanceof Function&&L.tagNameCheck(ge))))return!1}else if(!ot[oe]){if(!Zr(z,Yc(ge,Q,""))){if(!((oe==="src"||oe==="xlink:href"||oe==="href")&&Y!=="script"&&Fae(ge,"data:")===0&&ur[Y])){if(!(he&&!Zr(G,Yc(ge,Q,"")))){if(ge)return!1}}}}}}}return!0},ve=function(Y){return Y!=="annotation-xml"&&eg(Y,R)},ce=function(Y){ee(k.beforeSanitizeAttributes,Y,null);const{attributes:oe}=Y;if(!oe||K(Y))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let we=oe.length;for(;we--;){const Ae=oe[we],{name:De,namespaceURI:lt,value:_t}=Ae,Ht=We(De),ls=_t;let qt=De==="value"?ls:Dae(ls);if(ge.attrName=Ht,ge.attrValue=qt,ge.keepAttr=!0,ge.forceKeepAttr=void 0,ee(k.uponSanitizeAttribute,Y,ge),qt=ge.attrValue,ye&&(Ht==="id"||Ht==="name")&&(os(De,Y),qt=Me+qt),Ee&&Zr(/((--!?|])>)|<\/(style|title|textarea)/i,qt)){os(De,Y);continue}if(Ht==="attributename"&&eg(qt,"href")){os(De,Y);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){os(De,Y);continue}if(!V&&Zr(/\/>/i,qt)){os(De,Y);continue}Te&&Vd([A,I,M],Ba=>{qt=Yc(qt,Ba," ")});const Us=We(Y.nodeName);if(!fe(Us,Ht,qt)){os(De,Y);continue}if(b&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!lt)switch(p.getAttributeType(Us,Ht)){case"TrustedHTML":{qt=b.createHTML(qt);break}case"TrustedScriptURL":{qt=b.createScriptURL(qt);break}}if(qt!==ls)try{lt?Y.setAttributeNS(lt,De,qt):Y.setAttribute(De,qt),K(Y)?Gn(Y):pE(t.removed)}catch{os(De,Y)}}ee(k.afterSanitizeAttributes,Y,null)},de=function ae(Y){let oe=null;const ge=te(Y);for(ee(k.beforeSanitizeShadowDOM,Y,null);oe=ge.nextNode();)ee(k.uponSanitizeShadowNode,oe,null),re(oe),ce(oe),oe.content instanceof s&&ae(oe.content);ee(k.afterSanitizeShadowDOM,Y,null)};return t.sanitize=function(ae){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,ge=null,we=null,Ae=null;if(ht=!ae,ht&&(ae="<!-->"),typeof ae!="string"&&!J(ae))if(typeof ae.toString=="function"){if(ae=ae.toString(),typeof ae!="string")throw Xc("dirty is not a string, aborting")}else throw Xc("toString is not a function");if(!t.isSupported)return ae;if(Se||st(Y),t.removed=[],typeof ae=="string"&&($e=!1),$e){if(ae.nodeName){const _t=We(ae.nodeName);if(!D[_t]||F[_t])throw Xc("root node is forbidden and cannot be sanitized in-place")}}else if(ae instanceof o)oe=q("<!---->"),ge=oe.ownerDocument.importNode(ae,!0),ge.nodeType===Qc.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?oe=ge:oe.appendChild(ge);else{if(!le&&!Te&&!xe&&ae.indexOf("<")===-1)return b&&me?b.createHTML(ae):ae;if(oe=q(ae),!oe)return le?null:me?_:""}oe&&pe&&Gn(oe.firstChild);const De=te($e?ae:oe);for(;we=De.nextNode();)re(we),ce(we),we.content instanceof s&&de(we.content);if($e)return ae;if(le){if(ue)for(Ae=C.call(oe.ownerDocument);oe.firstChild;)Ae.appendChild(oe.firstChild);else Ae=oe;return(j.shadowroot||j.shadowrootmode)&&(Ae=N.call(n,Ae,!0)),Ae}let lt=xe?oe.outerHTML:oe.innerHTML;return xe&&D["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&Zr(uj,oe.ownerDocument.doctype.name)&&(lt="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
`+lt),Te&&Vd([A,I,M],_t=>{lt=Yc(lt,_t," ")}),b&&me?b.createHTML(lt):lt},t.setConfig=function(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(ae),Se=!0},t.clearConfig=function(){it=null,Se=!1},t.isValidAttribute=function(ae,Y,oe){it||st({});const ge=We(ae),we=We(Y);return fe(ge,we,oe)},t.addHook=function(ae,Y){typeof Y=="function"&&Kc(k[ae],Y)},t.removeHook=function(ae,Y){if(Y!==void 0){const oe=Rae(k[ae],Y);return oe===-1?void 0:Iae(k[ae],oe,1)[0]}return pE(k[ae])},t.removeHooks=function(ae){k[ae]=[]},t.removeAllHooks=function(){k=wE()},t}var dj=fj();function Jae(e){if(!e)return"";const t={ALLOWED_TAGS:["p","br","strong","em","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","code","pre","a","img","table","thead","tbody","tr","td","th","hr","div","span","iframe"],ALLOWED_ATTR:["href","src","alt","title","class","style","width","height","frameborder","allowfullscreen","allow","target","rel"],ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|data):|[^a-z]|[a-z+.\-\w]+(?:[^a-z+.\-:]|$))/i};return dj.sanitize(e,t)}function hj(e){return e?e.replace(/[<>]/g,"").replace(/javascript:/gi,"").replace(/on\w+=/gi,"").trim():""}function pj(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function mj(e){if(!e)return"";try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?t.toString():""}catch{return""}}function Qae(e){return e?e.startsWith("http://")||e.startsWith("https://")?pj(e):e.startsWith("data:image/")?/^data:image\/(jpeg|jpg|png|gif|webp|svg\+xml);base64,[A-Za-z0-9+/=]+$/.test(e):!1:!1}function bE(e){return hj(e).slice(0,200)}function Zae(e){return e?e.replace(/[^₹$€£¥0-9,.\s]/g,"").slice(0,50):""}function ese(e){return hj(e).slice(0,1e3)}function tse({images:e=[],onChange:t,label:r="Product Images",maxImages:n=10,maxSizeMB:a=5}){const{toast:s}=Is(),i=S.useRef(null),o=S.useRef(null),[l,u]=S.useState(!1),[f,d]=S.useState(""),h=async g=>{const x=Array.from(g.target.files||[]);if(x.length===0)return;if(e.length+x.length>n){s({title:"Too Many Images",description:`Maximum ${n} images allowed. You can add ${n-e.length} more.`,variant:"destructive"});return}u(!0);const y=[];try{for(const w of x){if(!w.type.startsWith("image/")){s({title:"Invalid File Type",description:`${w.name} is not an image file. Skipped.`,variant:"destructive"});continue}const b=a*1024*1024;if(w.size>b){s({title:"File Too Large",description:`${w.name} is too large (max ${a}MB). Skipped.`,variant:"destructive"});continue}const _=await new Promise((T,E)=>{const C=new FileReader;C.onloadend=()=>T(C.result),C.onerror=E,C.readAsDataURL(w)});y.push(_)}y.length>0&&(t([...e,...y]),s({title:"Images Uploaded",description:`Successfully uploaded ${y.length} image(s).`}))}catch(w){console.error("Upload error:",w),s({title:"Upload Error",description:"An error occurred while uploading images.",variant:"destructive"})}finally{u(!1),i.current&&(i.current.value="")}},p=()=>{if(!f.trim()){s({title:"Empty URL",description:"Please enter an image URL.",variant:"destructive"});return}if(e.length>=n){s({title:"Too Many Images",description:`Maximum ${n} images allowed.`,variant:"destructive"});return}const g=mj(f.trim());if(!Qae(g)){s({title:"Invalid Image URL",description:"Please enter a valid image URL or upload from your computer.",variant:"destructive"});return}t([...e,g]),d(""),s({title:"Image Added",description:"Image URL has been added successfully."})},v=g=>{const x=e.filter((y,w)=>w!==g);t(x)},m=(g,x)=>{const y=[...e],[w]=y.splice(g,1);y.splice(x,0,w),t(y)};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Oe,{children:[r," (",e.length,"/",n,")"]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[c.jsx(Be,{ref:o,type:"url",value:f,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),p())},placeholder:"Enter image URL or upload from computer",className:"flex-1"}),c.jsxs(be,{type:"button",variant:"outline",onClick:p,disabled:l||e.length>=n,className:"flex items-center gap-2",children:[c.jsx(ch,{className:"w-4 h-4"}),"Add URL"]}),c.jsxs(be,{type:"button",variant:"outline",onClick:()=>{var g;return(g=i.current)==null?void 0:g.click()},disabled:l||e.length>=n,className:"flex items-center gap-2",children:[c.jsx(Xh,{className:"w-4 h-4"}),l?"Uploading...":"Upload"]})]}),c.jsx("input",{ref:i,type:"file",accept:"image/*",multiple:!0,onChange:h,className:"hidden"}),e.length>0&&c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4",children:e.map((g,x)=>c.jsxs("div",{className:"relative group aspect-square rounded-lg overflow-hidden border border-border bg-muted",children:[c.jsx("img",{src:g,alt:`Product image ${x+1}`,className:"w-full h-full object-contain block",onError:y=>{y.target.style.display="none"}}),c.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-center justify-center gap-2",children:[c.jsx(be,{type:"button",variant:"secondary",size:"icon",onClick:()=>v(x),className:"h-8 w-8",children:c.jsx(Ri,{className:"w-4 h-4"})}),x>0&&c.jsx(be,{type:"button",variant:"secondary",size:"icon",onClick:()=>m(x,x-1),className:"h-8 w-8",title:"Move left",children:"←"}),x<e.length-1&&c.jsx(be,{type:"button",variant:"secondary",size:"icon",onClick:()=>m(x,x+1),className:"h-8 w-8",title:"Move right",children:"→"})]}),c.jsx("div",{className:"absolute top-2 left-2 bg-primary text-primary-foreground text-xs px-2 py-1 rounded",children:x+1}),x===0&&c.jsx("div",{className:"absolute top-2 right-2 bg-green-600 text-white text-xs px-2 py-1 rounded",children:"Primary"})]},x))}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Add up to ",n," images. The first image will be used as the primary/thumbnail image. Supported formats: JPG, PNG, GIF, WebP. Max size: ",a,"MB per image."]})]})}const rse=()=>{const e=ap(),{toast:t}=Is(),r=kN(),[n,a]=S.useState([]),[s,i]=S.useState([]),[o,l]=S.useState([]),[u,f]=S.useState(""),[d,h]=S.useState(""),[p,v]=S.useState(""),{items:m,total:g,isLoading:x,isFetchingNextPage:y,hasNextPage:w,loadMore:b}=c1({queryKey:["admin-plants"],fetchFunction:ms.getAll,initialLimit:10,preloadLimit:5,enabled:!0}),{ref:_,inView:T}=BC(),E=S.useMemo(()=>{const ie=u.trim().toLowerCase();return ie?n.filter(Ne=>`${Ne.name} ${Ne.category||""} ${Ne.description||""} ${Ne.price||""}`.toLowerCase().includes(ie)):n},[n,u]),C=S.useMemo(()=>{const ie=d.trim().toLowerCase();return ie?s.filter(Ne=>`${Ne.title} ${Ne.slug} ${Ne.excerpt||""} ${Ne.category||""} ${Ne.author||""}`.toLowerCase().includes(ie)):s},[s,d]),P=S.useMemo(()=>{const ie=p.trim().toLowerCase();return ie?m.filter(Ne=>`${Ne.name} ${Ne.plant_type||""} ${Ne.region||""} ${Ne.season||""}`.toLowerCase().includes(ie)):m},[m,p]);S.useEffect(()=>{T&&w&&!y&&b()},[T,w,y,b]),S.useEffect(()=>{sessionStorage.getItem("admin_authenticated")||e("/admin/login")},[e]);const N=()=>{sessionStorage.removeItem("admin_authenticated"),sessionStorage.removeItem("admin_user"),e("/admin/login"),t({title:"Logged Out",description:"You have been successfully logged out."})},[k,A]=S.useState({name:"",price:"",image:"",images:[],link:"",category:"",description:"",source:"",subCategory:""}),[I,M]=S.useState(null),[U,W]=S.useState({title:"",slug:"",excerpt:"",content:"",category:"",author:"Perfect Gardener",date:new Date().toISOString().split("T")[0],readTime:"5 min read",featured:!1}),[G,Q]=S.useState(null),[R,z]=S.useState({name:"",region:"",growingMonths:"",season:"",soilRequirements:"",bloomHarvestTime:"",sunlightNeeds:"",careInstructions:"",image:"",plantType:""}),[D,O]=S.useState(null),[j,B]=S.useState(null),[L,F]=S.useState(null),[H,Z]=S.useState(null),[X,ne]=S.useState(!1),[he,V]=S.useState(!1),[Te,Ee]=S.useState(!1),[xe,Se]=S.useState(!1),[pe,le]=S.useState(!1);S.useEffect(()=>{(async()=>{try{const Ne=await ga.getAll();a(Ne);const ze=await Ys.getAll();i(ze)}catch(Ne){console.error("Error loading data:",Ne),t({title:"Error Loading Data",description:"Failed to load products and posts. Please check the console for details.",variant:"destructive"})}})()},[t]);const ue=async ie=>{ie.preventDefault(),V(!0);try{let Ne=k.source,ze=k.subCategory;if(k.link&&!Ne){const ut=Tm(k.link);ut!=="unknown"&&ut!=="other"&&(Ne=ut,ze=ut)}const ht={...k,name:bE(k.name),price:Zae(k.price),description:ese(k.description||""),link:k.link?mj(k.link):"",category:k.category?bE(k.category):"",source:Ne||void 0,subCategory:ze||void 0};if(!ht.name.trim()){t({title:"Validation Error",description:"Product name is required.",variant:"destructive"});return}if(!ht.price.trim()){t({title:"Validation Error",description:"Product price is required.",variant:"destructive"});return}if(ht.link&&!pj(ht.link)){t({title:"Invalid URL",description:"Please provide a valid URL for the buy link.",variant:"destructive"});return}const nr={id:I||crypto.randomUUID(),...ht,images:ht.images&&ht.images.length>0?ht.images:ht.image?[ht.image]:[]};if(I){await ga.update(I,nr);const ut=await ga.getAll();a(ut),t({title:"Product Updated",description:"Product has been successfully updated."}),M(null)}else{await ga.add(nr);const ut=await ga.getAll();a(ut),t({title:"Product Added",description:"New product has been added successfully."})}A({name:"",price:"",image:"",images:[],link:"",category:"",description:"",source:"",subCategory:""})}catch(Ne){console.error("Error saving product:",Ne);const ze=Ne instanceof Error?Ne.message:"Unknown error occurred";t({title:"Error Saving Product",description:ze||"An error occurred while saving the product. Please try again.",variant:"destructive"})}finally{V(!1)}},me=ie=>{var ze;const Ne=ie.images&&ie.images.length>0?ie.images:ie.image?[ie.image]:[];A({name:ie.name,price:ie.price,image:ie.image||"",images:Ne,link:ie.link||"",category:ie.category||"",description:ie.description||"",source:ie.source||"",subCategory:ie.subCategory||""}),M(ie.id),(ze=document.getElementById("product-form"))==null||ze.scrollIntoView({behavior:"smooth"})},_e=async ie=>{try{await ga.delete(ie);const Ne=await ga.getAll();a(Ne),B(null),t({title:"Product Deleted",description:"Product has been removed successfully."})}catch(Ne){console.error("Error deleting product:",Ne),t({title:"Error",description:"Failed to delete product. Please try again.",variant:"destructive"})}},ye=()=>{M(null),A({name:"",price:"",image:"",images:[],link:"",category:"",description:"",source:"",subCategory:""})},Me=async ie=>{var Ne,ze,ht,nr;if(ie.preventDefault(),!((Ne=U.title)!=null&&Ne.trim())){t({title:"Validation Error",description:"Post title is required.",variant:"destructive"});return}if(!((ze=U.slug)!=null&&ze.trim())){t({title:"Validation Error",description:"Post slug is required.",variant:"destructive"});return}if(!((ht=U.content)!=null&&ht.trim())||U.content.trim()==="<p><br></p>"){t({title:"Validation Error",description:"Post content cannot be empty.",variant:"destructive"});return}if(!((nr=U.excerpt)!=null&&nr.trim())){t({title:"Validation Error",description:"Post excerpt is required.",variant:"destructive"});return}ne(!0);try{const ut=Jae(U.content),Ot={...U,content:ut};if(G){const Sr=await Ys.update(G,Ot),Tr=await Ys.getAll();i(Tr),t({title:"Post Updated",description:"Post has been successfully updated."}),Q(null)}else{const Sr={id:crypto.randomUUID(),...Ot,date:Ot.date||new Date().toISOString().split("T")[0],author:Ot.author||"Perfect Gardener"},Tr=await Ys.add(Sr),At=await Ys.getAll();i(At),t({title:"Post Created",description:`New post created! It will be available at /blog/${Tr.slug}`})}W({title:"",slug:"",excerpt:"",content:"",category:"",author:"Perfect Gardener",date:new Date().toISOString().split("T")[0],readTime:"5 min read",featured:!1})}catch{}},Le=ie=>{var Ne;W({title:ie.title,slug:ie.slug,excerpt:ie.excerpt,content:ie.content,category:ie.category||"",author:ie.author||"Perfect Gardener",date:ie.date||new Date().toISOString().split("T")[0],readTime:ie.readTime||"5 min read",featured:ie.featured||!1}),Q(ie.id),(Ne=document.getElementById("post-form"))==null||Ne.scrollIntoView({behavior:"smooth"})},$e=async ie=>{try{await Ys.delete(ie);const Ne=await Ys.getAll();i(Ne),F(null),t({title:"Post Deleted",description:"Post has been removed successfully."})}catch(Ne){console.error("Error deleting post:",Ne),t({title:"Error",description:"Failed to delete post. Please try again.",variant:"destructive"})}},tt=()=>{Q(null),W({title:"",slug:"",excerpt:"",content:"",category:"",author:"Perfect Gardener",date:new Date().toISOString().split("T")[0],readTime:"5 min read",featured:!1,image:""})},dt=ie=>ie.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),Je=async ie=>{ie.preventDefault(),Ee(!0);try{if(!R.name.trim()){t({title:"Validation Error",description:"Plant name is required.",variant:"destructive"});return}D?(await ms.update(D,R),await r.invalidateQueries({queryKey:["admin-plants"]}),t({title:"Plant Updated",description:"Plant has been successfully updated."}),O(null)):(await ms.create({...R,dataSource:"manual"}),await r.invalidateQueries({queryKey:["admin-plants"]}),t({title:"Plant Added",description:"New plant has been added successfully."})),z({name:"",region:"",growingMonths:"",season:"",soilRequirements:"",bloomHarvestTime:"",sunlightNeeds:"",careInstructions:"",image:"",plantType:""})}catch(Ne){console.error("Error saving plant:",Ne);const ze=Ne instanceof Error?Ne.message:"An error occurred while saving the plant. Please try again.",ht=Ne;ht.message&&(ht.message.includes("required")?ht.message:ht.message.includes("Network error")||ht.message.includes("duplicate")||ht.message.includes("already exists")||ht.message),t({title:"Error Saving Plant",description:ze,variant:"destructive"})}finally{Ee(!1)}},ur=ie=>{var Ne;z({name:ie.name||"",region:ie.region||"",growingMonths:ie.growing_months||"",season:ie.season||"",soilRequirements:ie.soil_requirements||"",bloomHarvestTime:ie.bloom_harvest_time||"",sunlightNeeds:ie.sunlight_needs||"",careInstructions:ie.care_instructions||"",image:ie.image||"",plantType:ie.plant_type||""}),O(ie.id),(Ne=document.getElementById("plant-form"))==null||Ne.scrollIntoView({behavior:"smooth"})},Re=async ie=>{try{await ms.delete(ie),await r.invalidateQueries({queryKey:["admin-plants"]}),Z(null),t({title:"Plant Deleted",description:"Plant has been removed successfully."})}catch(Ne){console.error("Error deleting plant:",Ne);const ze=Ne instanceof Error?Ne.message:"Unknown error occurred";t({title:"Error",description:ze||"An error occurred while deleting the plant. Please try again.",variant:"destructive"})}},ot=()=>{O(null),z({name:"",region:"",growingMonths:"",season:"",soilRequirements:"",bloomHarvestTime:"",sunlightNeeds:"",careInstructions:"",image:"",plantType:""})},rr=async ie=>{var ht,nr;const Ne=(ht=ie.target.files)==null?void 0:ht[0];if(!Ne)return;const ze=(nr=Ne.name.split(".").pop())==null?void 0:nr.toLowerCase();if(!ze||ze!=="csv"&&ze!=="xlsx"&&ze!=="xls"&&ze!=="json"){t({title:"Invalid File",description:"Please upload a CSV, XLSX, or JSON file.",variant:"destructive"});return}le(!0);try{let ut=[];if(ze==="json"){const bt=await Ne.text(),He=JSON.parse(bt);if(Array.isArray(He))ut=He;else if(He.Plants&&Array.isArray(He.Plants))ut=He.Plants;else throw new Error("Invalid JSON format")}else{const bt=await Ne.arrayBuffer(),He=Bu(bt,{type:"array"}),st=He.SheetNames[0],Ct=He.Sheets[st];ut=Ym.sheet_to_json(Ct)}if(ut.length===0){t({title:"Empty File",description:"The file contains no data.",variant:"destructive"});return}const Ot=bt=>{const He=bt.toLowerCase().trim().replace(/[\s_]/g,"");return{plantname:"name",name:"name",title:"name",region:"region",growingmonths:"growingMonths",growing_months:"growingMonths",season:"season",soilrequirements:"soilRequirements",soil_requirements:"soilRequirements",bloomharvesttime:"bloomHarvestTime",bloom_harvest_time:"bloomHarvestTime",sunlightneeds:"sunlightNeeds",sunlight_needs:"sunlightNeeds",careinstructions:"careInstructions",care_instructions:"careInstructions",image:"image",planttype:"plantType",plant_type:"plantType"}[He]||He};let Sr=0,Tr=0,At=0;const kr=[];for(const bt of ut){const He={};if(Object.keys(bt).forEach(st=>{const Ct=Ot(st);He[Ct]=bt[st]}),!He.name){Tr++;continue}try{const st={name:String(He.name||"").trim(),region:He.region?String(He.region).trim():void 0,growingMonths:He.growingMonths?String(He.growingMonths).trim():void 0,season:He.season?String(He.season).trim():void 0,soilRequirements:He.soilRequirements?String(He.soilRequirements).trim():void 0,bloomHarvestTime:He.bloomHarvestTime?String(He.bloomHarvestTime).trim():void 0,sunlightNeeds:He.sunlightNeeds?String(He.sunlightNeeds).trim():void 0,careInstructions:He.careInstructions?String(He.careInstructions).trim():void 0,image:He.image?String(He.image).trim():void 0,plantType:He.plantType?String(He.plantType).trim():void 0,dataSource:ze==="json"?"imported_json":ze==="csv"?"imported_csv":"imported_xlsx"};await ms.create(st),Sr++}catch(st){At++;const Ct=String(He.name||"").trim(),xt=st instanceof Error?st.message:"Unknown error";kr.push(`Row "${Ct}": ${xt}`)}}const Ve=await ms.getAll();l(Ve.data||[]);const We=ut.length,it=`Import completed: ${Sr} inserted, ${Tr} skipped, ${At} errors out of ${We} total records.`;At>0&&kr.length>0?(console.error("Import errors:",kr),t({title:"Import Completed with Errors",description:`${it} First errors: ${kr.slice(0,3).join("; ")}${kr.length>3?"...":""}`,variant:"destructive"})):t({title:"Import Successful",description:it}),ie.target.value=""}catch(ut){console.error("Plant import error:",ut);const Ot=ut instanceof Error?ut.message:"Unknown error occurred";t({title:"Import Failed",description:Ot||"An error occurred while importing the file. Please check the file format.",variant:"destructive"})}finally{le(!1)}},kt=async ie=>{var ht,nr;const Ne=(ht=ie.target.files)==null?void 0:ht[0];if(!Ne)return;const ze=(nr=Ne.name.split(".").pop())==null?void 0:nr.toLowerCase();if(!ze||ze!=="csv"&&ze!=="xlsx"&&ze!=="xls"){t({title:"Invalid File",description:"Please upload a CSV or XLSX file.",variant:"destructive"});return}Se(!0);try{const ut=await Ne.arrayBuffer();let Ot=[];if(ze==="csv"){const bt=Bu(ut,{type:"array"}),He=bt.SheetNames[0],st=bt.Sheets[He];Ot=Ym.sheet_to_json(st)}else{const bt=Bu(ut,{type:"array"}),He=bt.SheetNames[0],st=bt.Sheets[He];Ot=Ym.sheet_to_json(st)}if(Ot.length===0){t({title:"Empty File",description:"The file contains no data.",variant:"destructive"});return}let Sr=0,Tr=0,At=0;const kr=[];for(const bt of Ot){const He=Ct=>{const xt=Ct.toLowerCase().trim().replace(/[\s_]/g,"");return{productname:"name",name:"name",title:"name",product:"name",price:"price",cost:"price",amount:"price",image:"image",imageurl:"image",img:"image",photo:"image",link:"link",buylink:"link",url:"link",category:"category",cat:"category",type:"category",description:"description",desc:"description",details:"description"}[xt]||xt},st={};if(Object.keys(bt).forEach(Ct=>{const xt=He(Ct);st[xt]=bt[Ct]}),!st.name||!st.price){Tr++;continue}try{const Ct=String(st.link||"").trim(),xt=Tm(Ct),Nr={id:crypto.randomUUID(),name:String(st.name||"").trim(),price:String(st.price||"").trim(),image:String(st.image||"").trim(),link:Ct,category:String(st.category||"").trim(),description:String(st.description||"").trim(),source:xt!=="unknown"&&xt!=="other"?xt:void 0,subCategory:xt!=="unknown"&&xt!=="other"?xt:void 0};await ga.add(Nr),Sr++}catch(Ct){At++;const xt=String(st.name||"").trim(),Nr=Ct instanceof Error?Ct.message:"Unknown error";kr.push(`Row "${xt}": ${Nr}`)}}const Ve=await ga.getAll();a(Ve);const We=Ot.length,it=`Import completed: ${Sr} inserted, ${Tr} skipped, ${At} errors out of ${We} total records.`;At>0&&kr.length>0?(console.error("Import errors:",kr),t({title:"Import Completed with Errors",description:`${it} First errors: ${kr.slice(0,3).join("; ")}${kr.length>3?"...":""}`,variant:"destructive"})):t({title:"Import Successful",description:it}),ie.target.value=""}catch(ut){console.error("Import error:",ut);const Ot=ut instanceof Error?ut.message:"Unknown error occurred";t({title:"Import Failed",description:Ot||"An error occurred while importing the file. Please check the file format.",variant:"destructive"})}finally{Se(!1)}};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsxs("main",{id:"main-content",className:"flex-1 pt-20 pb-16",children:[c.jsx("section",{className:"py-8 md:py-12 bg-gradient-to-br from-primary/10 to-accent/5 border-b border-border",children:c.jsx("div",{className:"container mx-auto px-4",children:c.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl md:text-4xl font-display font-bold text-foreground mb-3",children:"Admin Dashboard"}),c.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Manage products, blog posts, and content from a powerful admin panel. All data is persisted in your browser's localStorage."})]}),c.jsxs(be,{variant:"outline",onClick:N,className:"flex items-center gap-2 shrink-0",children:[c.jsx(iF,{className:"w-4 h-4"}),"Logout"]})]})})}),c.jsx("section",{className:"py-8 w-full",children:c.jsx("div",{className:"container mx-auto px-4 w-full",children:c.jsxs(G4,{defaultValue:"products",className:"space-y-6 w-full",children:[c.jsxs(h1,{className:"grid w-full grid-cols-3",children:[c.jsxs(bo,{value:"products",className:"flex items-center gap-2",children:[c.jsx(Yh,{className:"w-4 h-4"}),"Products (",n.length,")"]}),c.jsxs(bo,{value:"posts",className:"flex items-center gap-2",children:[c.jsx(rF,{className:"w-4 h-4"}),"Posts (",s.length,")"]}),c.jsxs(bo,{value:"plants",className:"flex items-center gap-2",children:[c.jsx(rv,{className:"w-4 h-4"}),"Plants (",o.length,")"]})]}),c.jsxs(_o,{value:"products",className:"space-y-6",children:[c.jsxs(jt,{children:[c.jsxs(nn,{children:[c.jsxs(an,{className:"flex items-center gap-2",children:[c.jsx(lb,{className:"w-5 h-5"}),"Bulk Import Products"]}),c.jsx(Va,{children:"Import multiple products at once from a CSV or XLSX file. Expected columns: name, price, image, link, category, description."})]}),c.jsxs(It,{children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(Be,{type:"file",accept:".csv,.xlsx,.xls",onChange:kt,className:"flex-1",id:"file-import"}),c.jsxs(be,{type:"button",variant:"outline",onClick:()=>{var ie;return(ie=document.getElementById("file-import"))==null?void 0:ie.click()},className:"flex items-center gap-2",disabled:xe,children:[c.jsx(Xh,{className:"w-4 h-4"}),xe?"Importing...":"Choose File"]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"CSV/XLSX format: name (required), price (required), image, link, category, description"})]})]}),c.jsxs(jt,{id:"product-form",children:[c.jsxs(nn,{children:[c.jsx(an,{className:"flex items-center gap-2",children:I?c.jsxs(c.Fragment,{children:[c.jsx(Xo,{className:"w-4 h-4"}),"Edit Product"]}):c.jsxs(c.Fragment,{children:[c.jsx(ch,{className:"w-4 h-4"}),"Add Product"]})}),c.jsx(Va,{children:I?"Update the product information below.":"Fill in the details to add a new product."})]}),c.jsx(It,{children:c.jsxs("form",{onSubmit:ue,className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"name",children:"Product Name *"}),c.jsx(Be,{id:"name",name:"name",value:k.name,onChange:ie=>A({...k,name:ie.target.value}),required:!0,placeholder:"e.g. Premium Potting Mix 5kg"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"price",children:"Price *"}),c.jsx(Be,{id:"price",name:"price",value:k.price,onChange:ie=>A({...k,price:ie.target.value}),required:!0,placeholder:"₹399"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"category",children:"Category"}),c.jsx(Be,{id:"category",name:"category",value:k.category,onChange:ie=>A({...k,category:ie.target.value}),placeholder:"e.g. Seeds & Kits"})]}),c.jsx("div",{className:"space-y-2 md:col-span-2",children:c.jsx(tse,{images:k.images||(k.image?[k.image]:[]),onChange:ie=>{A({...k,images:ie,image:ie.length>0?ie[0]:""})},label:"Product Images",maxImages:10})}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"link",children:"Buy Link"}),c.jsx(Be,{id:"link",name:"link",type:"url",value:k.link,onChange:ie=>{const Ne=ie.target.value,ze=Tm(Ne);A({...k,link:Ne,source:ze!=="unknown"&&ze!=="other"?ze:k.source,subCategory:ze!=="unknown"&&ze!=="other"?ze:k.subCategory})},placeholder:"https://amazon.in/..."}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Source will be auto-detected from URL (amazon, meesho, flipkart, etc.)"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"source",children:"Source"}),c.jsx(Be,{id:"source",name:"source",value:k.source||"",onChange:ie=>A({...k,source:ie.target.value}),placeholder:"amazon, meesho, flipkart..."}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Auto-detected from URL, or enter manually"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"subCategory",children:"Sub Category (Source)"}),c.jsx(Be,{id:"subCategory",name:"subCategory",value:k.subCategory||"",onChange:ie=>A({...k,subCategory:ie.target.value}),placeholder:"amazon, meesho, flipkart..."}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Same as source, used for product comparison"})]}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"description",children:"Description"}),c.jsx(ws,{id:"description",name:"description",value:k.description,onChange:ie=>A({...k,description:ie.target.value}),rows:3,placeholder:"Brief product description..."})]})]}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[I&&c.jsxs(be,{type:"button",variant:"outline",onClick:ye,children:[c.jsx(Ri,{className:"w-4 h-4 mr-2"}),"Cancel"]}),c.jsxs(be,{type:"submit",disabled:he,children:[c.jsx(fm,{className:"w-4 h-4 mr-2"}),he?"Saving...":I?"Update Product":"Add Product"]})]})]})})]}),n.length>0&&c.jsxs(jt,{children:[c.jsxs(nn,{children:[c.jsxs(an,{children:["All Products (",E.length,")"]}),c.jsx(Va,{children:"Click on a product to edit or delete it."})]}),c.jsxs(It,{children:[c.jsx("div",{className:"mb-4",children:c.jsx(Be,{placeholder:"Search products (name, category, description, price)...",value:u,onChange:ie=>f(ie.target.value)})}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:E.map(ie=>c.jsx(jt,{className:"relative",children:c.jsxs(It,{className:"p-4",children:[ie.image&&c.jsx("div",{className:"w-full aspect-[4/3] overflow-hidden rounded-lg mb-3 bg-muted",children:c.jsx("img",{src:ie.image,alt:ie.name,className:"w-full h-full object-contain block",onError:Ne=>{Ne.target.style.display="none"}})}),c.jsx("h3",{className:"font-semibold text-foreground mb-2 line-clamp-2",children:ie.name}),c.jsx("p",{className:"text-primary font-medium mb-2",children:ie.price}),ie.category&&c.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:ie.category}),ie.description&&c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-3",children:ie.description}),c.jsxs("div",{className:"flex gap-2 mt-4",children:[c.jsxs(be,{size:"sm",variant:"outline",onClick:()=>me(ie),className:"flex-1",children:[c.jsx(Xo,{className:"w-3 h-3 mr-1"}),"Edit"]}),c.jsxs(be,{size:"sm",variant:"destructive",onClick:()=>B(ie.id),className:"flex-1",children:[c.jsx(dm,{className:"w-3 h-3 mr-1"}),"Delete"]})]})]})},ie.id))})]})]})]}),c.jsxs(_o,{value:"posts",className:"space-y-6",children:[c.jsxs(jt,{id:"post-form",children:[c.jsxs(nn,{children:[c.jsx(an,{className:"flex items-center gap-2",children:G?c.jsxs(c.Fragment,{children:[c.jsx(Xo,{className:"w-4 h-4"}),"Edit Post"]}):c.jsxs(c.Fragment,{children:[c.jsx(ch,{className:"w-4 h-4"}),"Create New Post"]})}),c.jsx(Va,{children:G?"Update the post content below.":"Create a new blog post. The slug will be used to generate the post URL (/blog/your-slug)."})]}),c.jsx(It,{children:c.jsxs("form",{onSubmit:Me,className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"post-title",children:"Post Title *"}),c.jsx(Be,{id:"post-title",name:"title",value:U.title,onChange:ie=>{const Ne=ie.target.value;W({...U,title:Ne,slug:U.slug||dt(Ne)})},required:!0,placeholder:"e.g. How to Grow Tomatoes on a Balcony"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"post-slug",children:"Slug (URL) *"}),c.jsx(Be,{id:"post-slug",name:"slug",value:U.slug,onChange:ie=>W({...U,slug:dt(ie.target.value)}),required:!0,placeholder:"tomato-growing-guide"}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["URL: ",c.jsxs("code",{children:["/blog/",U.slug||"your-slug"]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"post-category",children:"Category"}),c.jsx(Be,{id:"post-category",name:"category",value:U.category,onChange:ie=>W({...U,category:ie.target.value}),placeholder:"e.g. Beginner Guides"})]}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"post-excerpt",children:"Short Excerpt *"}),c.jsx(ws,{id:"post-excerpt",name:"excerpt",value:U.excerpt,onChange:ie=>W({...U,excerpt:ie.target.value}),required:!0,rows:2,placeholder:"Brief summary shown in blog listings..."})]}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(dE,{value:U.image||"",onChange:ie=>W({...U,image:ie}),label:"Post Thumbnail Image",placeholder:"https://example.com/post-thumbnail.jpg or upload from computer"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This image will be displayed on the main page and post listings."})]}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"post-content",children:"Post Content *"}),c.jsx(Cae,{value:U.content,onChange:ie=>W({...U,content:ie}),placeholder:"Write your post content here..."})]})]}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[G&&c.jsxs(be,{type:"button",variant:"outline",onClick:tt,children:[c.jsx(Ri,{className:"w-4 h-4 mr-2"}),"Cancel"]}),c.jsxs(be,{type:"submit",disabled:X,children:[c.jsx(fm,{className:"w-4 h-4 mr-2"}),X?"Saving...":G?"Update Post":"Create Post"]})]})]})})]}),s.length>0&&c.jsxs(jt,{children:[c.jsxs(nn,{children:[c.jsxs(an,{children:["All Posts (",C.length,")"]}),c.jsx(Va,{children:"Click on a post to edit or delete it. Posts are automatically available at /blog/[slug]."})]}),c.jsxs(It,{children:[c.jsx("div",{className:"mb-4",children:c.jsx(Be,{placeholder:"Search posts (title, slug, category, author)...",value:d,onChange:ie=>h(ie.target.value)})}),c.jsx("div",{className:"space-y-4",children:C.map(ie=>c.jsx(jt,{className:"relative",children:c.jsx(It,{className:"p-4",children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("h3",{className:"font-semibold text-foreground",children:ie.title}),ie.featured&&c.jsx("span",{className:"text-xs bg-primary text-primary-foreground px-2 py-1 rounded",children:"Featured"})]}),c.jsx("p",{className:"text-sm text-muted-foreground mb-2 line-clamp-2",children:ie.excerpt}),c.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Ml,{className:"w-3 h-3"}),"/blog/",ie.slug]}),ie.category&&c.jsxs("span",{children:["• ",ie.category]}),ie.date&&c.jsxs("span",{children:["• ",new Date(ie.date).toLocaleDateString()]})]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(be,{size:"sm",variant:"outline",onClick:()=>Le(ie),children:[c.jsx(Xo,{className:"w-3 h-3 mr-1"}),"Edit"]}),c.jsxs(be,{size:"sm",variant:"destructive",onClick:()=>F(ie.id),children:[c.jsx(dm,{className:"w-3 h-3 mr-1"}),"Delete"]})]})]})})},ie.id))})]})]})]}),c.jsxs(_o,{value:"plants",className:"space-y-6 w-full",children:[c.jsxs(jt,{children:[c.jsxs(nn,{children:[c.jsxs(an,{className:"flex items-center gap-2",children:[c.jsx(lb,{className:"w-5 h-5"}),"Import Plant Dataset"]}),c.jsx(Va,{children:"Import multiple plants from CSV, XLSX, or JSON file. Expected columns: name, region, growing_months, season, soil_requirements, bloom_harvest_time, sunlight_needs, care_instructions, image, plant_type."})]}),c.jsxs(It,{children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(Be,{type:"file",accept:".csv,.xlsx,.xls,.json",onChange:rr,className:"flex-1",id:"plant-file-import"}),c.jsxs(be,{type:"button",variant:"outline",onClick:()=>{var ie;return(ie=document.getElementById("plant-file-import"))==null?void 0:ie.click()},className:"flex items-center gap-2",disabled:pe,children:[c.jsx(Xh,{className:"w-4 h-4"}),pe?"Importing...":"Choose File"]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Supported formats: CSV, XLSX, XLS, JSON"})]})]}),c.jsxs(jt,{id:"plant-form",children:[c.jsxs(nn,{children:[c.jsx(an,{className:"flex items-center gap-2",children:D?c.jsxs(c.Fragment,{children:[c.jsx(Xo,{className:"w-4 h-4"}),"Edit Plant"]}):c.jsxs(c.Fragment,{children:[c.jsx(ch,{className:"w-4 h-4"}),"Add Plant"]})}),c.jsx(Va,{children:D?"Update the plant information below.":"Fill in the details to add a new plant to the database."})]}),c.jsx(It,{children:c.jsxs("form",{onSubmit:Je,className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"plant-name",children:"Plant Name *"}),c.jsx(Be,{id:"plant-name",name:"name",value:R.name,onChange:ie=>z({...R,name:ie.target.value}),required:!0,placeholder:"e.g. Marigold, Tomato, Rose"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plant-region",children:"Region"}),c.jsx(Be,{id:"plant-region",name:"region",value:R.region,onChange:ie=>z({...R,region:ie.target.value}),placeholder:"e.g. North India, South India"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plant-type",children:"Plant Type"}),c.jsx(Be,{id:"plant-type",name:"plantType",value:R.plantType,onChange:ie=>z({...R,plantType:ie.target.value}),placeholder:"e.g. flower, vegetable, herb, fruit"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plant-growing-months",children:"Growing Months"}),c.jsx(Be,{id:"plant-growing-months",name:"growingMonths",value:R.growingMonths,onChange:ie=>z({...R,growingMonths:ie.target.value}),placeholder:"e.g. January-March, June-September"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plant-season",children:"Season"}),c.jsx(Be,{id:"plant-season",name:"season",value:R.season,onChange:ie=>z({...R,season:ie.target.value}),placeholder:"e.g. Summer, Winter, Monsoon"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plant-bloom-harvest",children:"Bloom/Harvest Time"}),c.jsx(Be,{id:"plant-bloom-harvest",name:"bloomHarvestTime",value:R.bloomHarvestTime,onChange:ie=>z({...R,bloomHarvestTime:ie.target.value}),placeholder:"e.g. 60-90 days, March-April"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"plant-sunlight",children:"Sunlight Needs"}),c.jsx(Be,{id:"plant-sunlight",name:"sunlightNeeds",value:R.sunlightNeeds,onChange:ie=>z({...R,sunlightNeeds:ie.target.value}),placeholder:"e.g. Full sun, Partial shade"})]}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"plant-soil",children:"Soil Requirements"}),c.jsx(ws,{id:"plant-soil",name:"soilRequirements",value:R.soilRequirements,onChange:ie=>z({...R,soilRequirements:ie.target.value}),rows:2,placeholder:"e.g. Well-drained, loamy soil with pH 6.0-7.0"})]}),c.jsxs("div",{className:"space-y-2 md:col-span-2",children:[c.jsx(Oe,{htmlFor:"plant-care",children:"Care Instructions"}),c.jsx(ws,{id:"plant-care",name:"careInstructions",value:R.careInstructions,onChange:ie=>z({...R,careInstructions:ie.target.value}),rows:4,placeholder:"Detailed care instructions..."})]}),c.jsx("div",{className:"space-y-2 md:col-span-2",children:c.jsx(dE,{value:R.image||"",onChange:ie=>z({...R,image:ie}),label:"Plant Image URL",maxSizeMB:1})})]}),c.jsxs("div",{className:"flex gap-2",children:[D&&c.jsx(be,{type:"button",variant:"outline",onClick:ot,children:"Cancel"}),c.jsxs(be,{type:"submit",className:"flex-1",disabled:Te,children:[c.jsx(fm,{className:"w-4 h-4 mr-2"}),Te?"Saving...":D?"Update Plant":"Add Plant"]})]})]})})]}),m.length>0&&c.jsxs(jt,{children:[c.jsx(nn,{children:c.jsxs(an,{children:["All Plants (",P.length,g?` / ${g}`:"",")"]})}),c.jsxs(It,{children:[c.jsx("div",{className:"mb-4",children:c.jsx(Be,{placeholder:"Search plants (name, type, region, season)...",value:p,onChange:ie=>v(ie.target.value)})}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:P.map(ie=>c.jsx(jt,{children:c.jsxs(It,{className:"p-4",children:[ie.image&&c.jsx("div",{className:"w-full aspect-[4/3] overflow-hidden rounded-lg mb-3 bg-muted",children:c.jsx("img",{src:ie.image,alt:ie.name,className:"w-full h-full object-contain block",onError:Ne=>{Ne.target.style.display="none"}})}),c.jsx("h3",{className:"font-semibold text-foreground mb-2 line-clamp-2",children:ie.name}),ie.plant_type&&c.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Type: ",ie.plant_type]}),ie.region&&c.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Region: ",ie.region]}),ie.season&&c.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Season: ",ie.season]}),c.jsxs("div",{className:"flex gap-2 mt-4",children:[c.jsxs(be,{size:"sm",variant:"outline",onClick:()=>ur(ie),className:"flex-1",children:[c.jsx(Xo,{className:"w-3 h-3 mr-1"}),"Edit"]}),c.jsxs(be,{size:"sm",variant:"destructive",onClick:()=>Z(ie.id),className:"flex-1",children:[c.jsx(dm,{className:"w-3 h-3 mr-1"}),"Delete"]})]})]})},ie.id))}),c.jsxs("div",{className:"mt-6",children:[c.jsx("div",{ref:_}),(x||y)&&c.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Loading more plants..."}),!w&&g>0&&c.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"All plants loaded."})]})]})]})]})]})})})]}),c.jsx(vr,{}),c.jsx(hn,{}),c.jsx(Lm,{open:j!==null,onOpenChange:()=>B(null),children:c.jsxs(mh,{children:[c.jsxs(gh,{children:[c.jsx(xh,{children:"Delete Product?"}),c.jsx(yh,{children:"This action cannot be undone. This will permanently delete the product from your database."})]}),c.jsxs(vh,{children:[c.jsx(bh,{children:"Cancel"}),c.jsx(wh,{onClick:()=>j&&_e(j),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),c.jsx(Lm,{open:L!==null,onOpenChange:()=>F(null),children:c.jsxs(mh,{children:[c.jsxs(gh,{children:[c.jsx(xh,{children:"Delete Post?"}),c.jsx(yh,{children:"This action cannot be undone. This will permanently delete the post and it will no longer be accessible at its URL."})]}),c.jsxs(vh,{children:[c.jsx(bh,{children:"Cancel"}),c.jsx(wh,{onClick:()=>L&&$e(L),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),c.jsx(Lm,{open:H!==null,onOpenChange:()=>Z(null),children:c.jsxs(mh,{children:[c.jsxs(gh,{children:[c.jsx(xh,{children:"Delete Plant?"}),c.jsx(yh,{children:"This action cannot be undone. This will permanently delete the plant from your database."})]}),c.jsxs(vh,{children:[c.jsx(bh,{children:"Cancel"}),c.jsx(wh,{onClick:()=>H&&Re(H),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Ws={serviceId:"service_m7co0uu",templateId:"template_2mk7f36",publicKey:"rWeo1dt9mNcXiXJfV"},nse=()=>{const e=ap(),{toast:t}=Is(),[r,n]=S.useState("login"),[a,s]=S.useState(""),[i,o]=S.useState(""),[l,u]=S.useState(!1),[f,d]=S.useState(""),[h,p]=S.useState(""),[v,m]=S.useState(""),[g,x]=S.useState(""),[y,w]=S.useState(""),[b,_]=S.useState("form"),[T,E]=S.useState(!1),[C,P]=S.useState(!1),[N,k]=S.useState(""),[A,I]=S.useState(""),[M,U]=S.useState(""),[W,G]=S.useState(""),[Q,R]=S.useState("email"),[z,D]=S.useState(!1),[O,j]=S.useState(!1),[B,L]=S.useState(!1);S.useEffect(()=>{try{Cu.init(Ws.publicKey),console.log("EmailJS initialized successfully")}catch(xe){console.error("EmailJS initialization error:",xe)}},[]);const F=async xe=>{xe.preventDefault(),u(!0);try{const Se=await Fm.login(i,a);Se.success&&(sessionStorage.setItem("admin_authenticated","true"),sessionStorage.setItem("admin_user",JSON.stringify(Se.user)),t({title:"Login Successful",description:"Welcome to the admin dashboard!"}),e("/admin"))}catch(Se){const pe=Se instanceof Error?Se.message:"Invalid username or password";t({title:"Login Failed",description:pe,variant:"destructive"}),s("")}finally{u(!1)}},H=async(xe,Se,pe,le)=>{try{const ue=await fetch("/.netlify/functions/otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"generate",email:xe,type:Se,username:pe,password:le})});if(!ue.ok){const _e=await ue.json().catch(()=>({error:"Network error"}));throw new Error(_e.error||`HTTP ${ue.status}: Failed to generate OTP`)}const me=await ue.json();if(!me.success||!me.otp)throw new Error(me.error||"Failed to generate OTP");return console.log("OTP generated successfully for:",xe),me.otp}catch(ue){console.error("Generate OTP Error:",ue);const me=ue instanceof Error?ue.message:"Failed to generate OTP. Please try again.";throw new Error(me)}},Z="shubhamjakhmola008@gmail.com",X=async(xe,Se,pe)=>{var le;try{try{Cu.init(Ws.publicKey)}catch(Me){console.log("EmailJS init check:",Me)}const me=new Date(Date.now()+10*60*1e3).toLocaleString("en-US",{hour:"2-digit",minute:"2-digit",day:"numeric",month:"short",year:"numeric"}),_e={email:Z,passcode:Se,time:me};console.log("Sending OTP email with params:",{serviceId:Ws.serviceId,templateId:Ws.templateId,email:xe,otpLength:Se.length,expiryTime:me});const ye=await Cu.send(Ws.serviceId,Ws.templateId,_e);return console.log("EmailJS OTP sent successfully:",{status:ye.status,text:ye.text}),ye}catch(ue){const me=ue;console.error("EmailJS Error Details:",{status:me==null?void 0:me.status,text:me==null?void 0:me.text,message:me==null?void 0:me.message,error:ue,serviceId:Ws.serviceId,templateId:Ws.templateId});let _e="Failed to send OTP email. Please try again.";throw(me==null?void 0:me.status)===429?_e="Too many email requests. Please wait a moment and try again.":(me==null?void 0:me.status)===400?_e="Invalid email configuration. Please contact support.":(me==null?void 0:me.status)===401?_e="Email service authentication failed. Please check configuration.":(me==null?void 0:me.status)===403?_e="Email service access forbidden. Please check API keys.":(le=me==null?void 0:me.text)!=null&&le.includes("network")?_e="Network error. Please check your connection and try again.":me!=null&&me.message&&(_e=me.message),new Error(_e)}},ne=async xe=>{if(xe.preventDefault(),!f||!h||!v||!g){t({title:"Validation Error",description:"All fields are required.",variant:"destructive"});return}if(v!==g){t({title:"Password Mismatch",description:"Passwords do not match.",variant:"destructive"});return}if(v.length<6){t({title:"Weak Password",description:"Password must be at least 6 characters long.",variant:"destructive"});return}if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(h)){t({title:"Invalid Email",description:"Please enter a valid email address.",variant:"destructive"});return}E(!0);try{const pe=await H(h,"create",f,v);await X(h,pe,"create"),_("otp"),t({title:"OTP Sent Successfully",description:"OTP has been sent. Please contact the admin to receive the OTP."})}catch(pe){console.error("Create User OTP Error:",pe);const le=pe instanceof Error?pe.message:"Failed to send OTP";t({title:"Failed to Send OTP",description:le||"Failed to send OTP. Please check your email address and try again.",variant:"destructive"})}finally{E(!1)}},he=async xe=>{if(xe.preventDefault(),!y){t({title:"OTP Required",description:"Please enter the OTP sent to your email.",variant:"destructive"});return}P(!0);try{const Se=await fetch("/.netlify/functions/otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"verify",email:h,otp:y})}),pe=await Se.json();if(!Se.ok||!pe.success)throw new Error(pe.error||"Invalid or expired OTP");if(pe.type!=="create")throw new Error("OTP type mismatch");await Fm.create(f,v,h),t({title:"Account Created",description:"Your admin account has been created successfully! You can now login."}),d(""),p(""),m(""),x(""),w(""),_("form"),n("login")}catch(Se){const pe=Se instanceof Error?Se.message:"Failed to create account. Please try again.";t({title:"Error",description:pe,variant:"destructive"})}finally{P(!1)}},V=async xe=>{if(xe.preventDefault(),!N){t({title:"Email Required",description:"Please enter your email address.",variant:"destructive"});return}if(!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)){t({title:"Invalid Email",description:"Please enter a valid email address.",variant:"destructive"});return}D(!0);try{const pe=await H(N,"reset");await X(N,pe,"reset"),R("otp"),t({title:"OTP Sent Successfully",description:"OTP has been sent. Please contact the admin to receive the OTP."})}catch(pe){console.error("Forgot Password OTP Error:",pe);const le=pe instanceof Error?pe.message:"Failed to send OTP";t({title:"Failed to Send OTP",description:le||"Failed to send OTP. Please check your email address and try again.",variant:"destructive"})}finally{D(!1)}},Te=async xe=>{if(xe.preventDefault(),!A){t({title:"OTP Required",description:"Please enter the OTP sent to your email.",variant:"destructive"});return}j(!0);try{const Se=await fetch("/.netlify/functions/otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"verify",email:N,otp:A})}),pe=await Se.json();if(!Se.ok||!pe.success)throw new Error(pe.error||"Invalid or expired OTP");if(pe.type!=="reset")throw new Error("OTP type mismatch");R("reset"),t({title:"OTP Verified",description:"Please enter your new password."})}catch(Se){const pe=Se instanceof Error?Se.message:"Invalid or expired OTP. Please try again.";t({title:"Error",description:pe,variant:"destructive"})}finally{j(!1)}},Ee=async xe=>{if(xe.preventDefault(),!M||!W){t({title:"Password Required",description:"Please enter and confirm your new password.",variant:"destructive"});return}if(M!==W){t({title:"Password Mismatch",description:"Passwords do not match.",variant:"destructive"});return}if(M.length<6){t({title:"Weak Password",description:"Password must be at least 6 characters long.",variant:"destructive"});return}L(!0);try{await Fm.resetPassword(N,M),t({title:"Password Reset",description:"Your password has been reset successfully! You can now login."}),k(""),I(""),U(""),G(""),R("email"),n("login")}catch(Se){const pe=Se instanceof Error?Se.message:"Failed to reset password. Please try again.";t({title:"Error",description:pe,variant:"destructive"})}finally{L(!1)}};return c.jsxs("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:[c.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-accent/5 to-background -z-10"}),c.jsxs(jt,{className:"w-full max-w-md shadow-xl border-2",children:[c.jsxs(nn,{className:"space-y-4 text-center",children:[c.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx("div",{className:"w-full h-full aspect-square overflow-hidden",children:c.jsx("img",{src:"/images/Avtar.png",alt:"Perfect Gardener Logo",className:"w-full h-full object-contain block",onError:xe=>{xe.target.style.display="none"}})})}),c.jsx(an,{className:"text-2xl font-display",children:"Admin Portal"}),c.jsx(Va,{children:"Manage your admin account and access the dashboard"})]}),c.jsx(It,{children:c.jsxs(G4,{value:r,onValueChange:n,className:"w-full",children:[c.jsxs(h1,{className:"grid w-full grid-cols-3",children:[c.jsxs(bo,{value:"login",children:[c.jsx(cb,{className:"w-4 h-4 mr-1"}),"Login"]}),c.jsxs(bo,{value:"create",children:[c.jsx(fb,{className:"w-4 h-4 mr-1"}),"Create"]}),c.jsxs(bo,{value:"forgot",children:[c.jsx(um,{className:"w-4 h-4 mr-1"}),"Reset"]})]}),c.jsx(_o,{value:"login",className:"space-y-4 mt-4",children:c.jsxs("form",{onSubmit:F,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"username",children:"Username"}),c.jsx(Be,{id:"username",type:"text",value:i,onChange:xe=>o(xe.target.value),placeholder:"Enter username",required:!0,autoFocus:!0,className:"bg-background"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"password",children:"Password"}),c.jsx(Be,{id:"password",type:"password",value:a,onChange:xe=>s(xe.target.value),placeholder:"Enter password",required:!0,className:"bg-background"})]}),c.jsx(be,{type:"submit",className:"w-full",size:"lg",disabled:l,children:l?"Logging in...":c.jsxs(c.Fragment,{children:[c.jsx(cb,{className:"w-4 h-4 mr-2"}),"Login"]})})]})}),c.jsx(_o,{value:"create",className:"space-y-4 mt-4",children:b==="form"?c.jsxs("form",{onSubmit:ne,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"create-username",children:"Username"}),c.jsx(Be,{id:"create-username",type:"text",value:f,onChange:xe=>d(xe.target.value),placeholder:"Choose a username",required:!0,className:"bg-background"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"create-email",children:"Email"}),c.jsx(Be,{id:"create-email",type:"email",value:h,onChange:xe=>p(xe.target.value),placeholder:"your@email.com",required:!0,className:"bg-background"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"create-password",children:"Password"}),c.jsx(Be,{id:"create-password",type:"password",value:v,onChange:xe=>m(xe.target.value),placeholder:"Minimum 6 characters",required:!0,className:"bg-background"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"confirm-password",children:"Confirm Password"}),c.jsx(Be,{id:"confirm-password",type:"password",value:g,onChange:xe=>x(xe.target.value),placeholder:"Re-enter password",required:!0,className:"bg-background"})]}),c.jsx(be,{type:"submit",className:"w-full",size:"lg",disabled:T,children:T?"Sending OTP...":c.jsxs(c.Fragment,{children:[c.jsx(Kh,{className:"w-4 h-4 mr-2"}),"Send OTP"]})})]}):c.jsxs("form",{onSubmit:he,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"create-otp",children:"Enter OTP"}),c.jsx(Be,{id:"create-otp",type:"text",value:y,onChange:xe=>w(xe.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",required:!0,maxLength:6,className:"bg-background text-center text-2xl tracking-widest",autoFocus:!0}),c.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"OTP has been sent. Please contact the admin to receive the OTP."})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(be,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{_("form"),w("")},children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back"]}),c.jsx(be,{type:"submit",className:"flex-1",size:"lg",disabled:C,children:C?"Verifying...":c.jsxs(c.Fragment,{children:[c.jsx(fb,{className:"w-4 h-4 mr-2"}),"Create Account"]})})]})]})}),c.jsx(_o,{value:"forgot",className:"space-y-4 mt-4",children:Q==="email"?c.jsxs("form",{onSubmit:V,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"forgot-email",children:"Email Address"}),c.jsx(Be,{id:"forgot-email",type:"email",value:N,onChange:xe=>k(xe.target.value),placeholder:"your@email.com",required:!0,className:"bg-background",autoFocus:!0}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter the email associated with your admin account"})]}),c.jsx(be,{type:"submit",className:"w-full",size:"lg",disabled:z,children:z?"Sending OTP...":c.jsxs(c.Fragment,{children:[c.jsx(Kh,{className:"w-4 h-4 mr-2"}),"Send OTP"]})})]}):Q==="otp"?c.jsxs("form",{onSubmit:Te,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"forgot-otp",children:"Enter OTP"}),c.jsx(Be,{id:"forgot-otp",type:"text",value:A,onChange:xe=>I(xe.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",required:!0,maxLength:6,className:"bg-background text-center text-2xl tracking-widest",autoFocus:!0}),c.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"OTP has been sent. Please contact the admin to receive the OTP."})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(be,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{R("email"),I("")},children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back"]}),c.jsx(be,{type:"submit",className:"flex-1",size:"lg",disabled:O,children:O?"Verifying...":c.jsxs(c.Fragment,{children:[c.jsx(um,{className:"w-4 h-4 mr-2"}),"Verify OTP"]})})]})]}):c.jsxs("form",{onSubmit:Ee,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"new-password",children:"New Password"}),c.jsx(Be,{id:"new-password",type:"password",value:M,onChange:xe=>U(xe.target.value),placeholder:"Minimum 6 characters",required:!0,className:"bg-background",autoFocus:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Oe,{htmlFor:"confirm-new-password",children:"Confirm New Password"}),c.jsx(Be,{id:"confirm-new-password",type:"password",value:W,onChange:xe=>G(xe.target.value),placeholder:"Re-enter new password",required:!0,className:"bg-background"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(be,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{R("otp"),U(""),G("")},children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back"]}),c.jsx(be,{type:"submit",className:"flex-1",size:"lg",disabled:B,children:B?"Resetting...":c.jsxs(c.Fragment,{children:[c.jsx(um,{className:"w-4 h-4 mr-2"}),"Reset Password"]})})]})]})})]})})]})]})};function Fr(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ase(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Kd=43200,_E=1440;let sse={};function ise(){return sse}function EE(e){const t=Fr(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Eh(e,t){const r=Fr(e),n=Fr(t),a=r.getTime()-n.getTime();return a<0?-1:a>0?1:a}function ose(e){return ase(e,Date.now())}function lse(e,t){const r=Fr(e),n=Fr(t),a=r.getFullYear()-n.getFullYear(),s=r.getMonth()-n.getMonth();return a*12+s}function cse(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function use(e,t){return+Fr(e)-+Fr(t)}function fse(e){const t=Fr(e);return t.setHours(23,59,59,999),t}function dse(e){const t=Fr(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function hse(e){const t=Fr(e);return+fse(t)==+dse(t)}function pse(e,t){const r=Fr(e),n=Fr(t),a=Eh(r,n),s=Math.abs(lse(r,n));let i;if(s<1)i=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*s);let o=Eh(r,n)===-a;hse(Fr(e))&&s===1&&Eh(e,n)===1&&(o=!1),i=a*(s-Number(o))}return i===0?0:i}function mse(e,t,r){const n=use(e,t)/1e3;return cse(r==null?void 0:r.roundingMethod)(n)}const gse={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vse=(e,t,r)=>{let n;const a=gse[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function sg(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const xse={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},bse={date:sg({formats:xse,defaultWidth:"full"}),time:sg({formats:yse,defaultWidth:"full"}),dateTime:sg({formats:wse,defaultWidth:"full"})},_se={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ese=(e,t,r,n)=>_se[e];function Zc(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,o=r!=null&&r.width?String(r.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{const i=e.defaultWidth,o=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[o]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const Sse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Tse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},kse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Nse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ase={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Cse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Pse=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ose={ordinalNumber:Pse,era:Zc({values:Sse,defaultWidth:"wide"}),quarter:Zc({values:Tse,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zc({values:kse,defaultWidth:"wide"}),day:Zc({values:Nse,defaultWidth:"wide"}),dayPeriod:Zc({values:Ase,defaultWidth:"wide",formattingValues:Cse,defaultFormattingWidth:"wide"})};function eu(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?Rse(o,d=>d.test(i)):jse(o,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;const f=t.slice(i.length);return{value:u,rest:f}}}function jse(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Rse(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Ise(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=r.valueCallback?r.valueCallback(i):i;const o=t.slice(a.length);return{value:i,rest:o}}}const Fse=/^(\d+)(th|st|nd|rd)?/i,Dse=/\d+/i,Mse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lse={any:[/^b/i,/^(a|c)/i]},Bse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Use={any:[/1/i,/2/i,/3/i,/4/i]},$se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},zse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Vse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Gse={ordinalNumber:Ise({matchPattern:Fse,parsePattern:Dse,valueCallback:e=>parseInt(e,10)}),era:eu({matchPatterns:Mse,defaultMatchWidth:"wide",parsePatterns:Lse,defaultParseWidth:"any"}),quarter:eu({matchPatterns:Bse,defaultMatchWidth:"wide",parsePatterns:Use,defaultParseWidth:"any",valueCallback:e=>e+1}),month:eu({matchPatterns:$se,defaultMatchWidth:"wide",parsePatterns:zse,defaultParseWidth:"any"}),day:eu({matchPatterns:Hse,defaultMatchWidth:"wide",parsePatterns:qse,defaultParseWidth:"any"}),dayPeriod:eu({matchPatterns:Wse,defaultMatchWidth:"any",parsePatterns:Vse,defaultParseWidth:"any"})},Kse={code:"en-US",formatDistance:vse,formatLong:bse,formatRelative:Ese,localize:Ose,match:Gse,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yse(e,t,r){const n=ise(),a=(r==null?void 0:r.locale)??n.locale??Kse,s=2520,i=Eh(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:i});let l,u;i>0?(l=Fr(t),u=Fr(e)):(l=Fr(e),u=Fr(t));const f=mse(u,l),d=(EE(u)-EE(l))/1e3,h=Math.round((f-d)/60);let p;if(h<2)return r!=null&&r.includeSeconds?f<5?a.formatDistance("lessThanXSeconds",5,o):f<10?a.formatDistance("lessThanXSeconds",10,o):f<20?a.formatDistance("lessThanXSeconds",20,o):f<40?a.formatDistance("halfAMinute",0,o):f<60?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",1,o):h===0?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",h,o);if(h<45)return a.formatDistance("xMinutes",h,o);if(h<90)return a.formatDistance("aboutXHours",1,o);if(h<_E){const v=Math.round(h/60);return a.formatDistance("aboutXHours",v,o)}else{if(h<s)return a.formatDistance("xDays",1,o);if(h<Kd){const v=Math.round(h/_E);return a.formatDistance("xDays",v,o)}else if(h<Kd*2)return p=Math.round(h/Kd),a.formatDistance("aboutXMonths",p,o)}if(p=pse(u,l),p<12){const v=Math.round(h/Kd);return a.formatDistance("xMonths",v,o)}else{const v=p%12,m=Math.trunc(p/12);return v<3?a.formatDistance("aboutXYears",m,o):v<9?a.formatDistance("overXYears",m,o):a.formatDistance("almostXYears",m+1,o)}}function SE(e,t){return Yse(e,ose(e),t)}function Xse({postSlug:e}){const{toast:t}=Is(),[r,n]=S.useState([]),[a,s]=S.useState({author:"",content:""}),[i,o]=S.useState(null),[l,u]=S.useState("");S.useEffect(()=>{let v=!0;return(async()=>{try{const g=await ni.getPostComments(e);if(!v)return;n(g.map(x=>({id:x.id,author:x.author_name,content:x.content,date:x.created_at,parentId:x.parent_id||void 0})))}catch(g){console.error("❌ Failed to load post comments:",g)}})(),()=>{v=!1}},[e]);const f=async v=>{if(v.preventDefault(),!a.author.trim()||!a.content.trim()){t({title:"Error",description:"Please fill in all fields.",variant:"destructive"});return}try{await ni.createPostComment({postSlug:e,authorName:a.author,content:a.content}),s({author:"",content:""});const m=await ni.getPostComments(e);n(m.map(g=>({id:g.id,author:g.author_name,content:g.content,date:g.created_at,parentId:g.parent_id||void 0}))),t({title:"Comment Added",description:"Your comment has been posted!"})}catch(m){console.error("❌ Failed to submit post comment:",m);const g=m instanceof Error?m.message:"Failed to post comment.";t({title:"Error",description:g,variant:"destructive"})}},d=async v=>{if(!l.trim()){t({title:"Error",description:"Please enter a reply.",variant:"destructive"});return}try{await ni.createPostComment({postSlug:e,parentId:v,authorName:"Guest",content:l}),u(""),o(null);const m=await ni.getPostComments(e);n(m.map(g=>({id:g.id,author:g.author_name,content:g.content,date:g.created_at,parentId:g.parent_id||void 0}))),t({title:"Reply Added",description:"Your reply has been posted!"})}catch(m){console.error("❌ Failed to submit reply:",m);const g=m instanceof Error?m.message:"Failed to post reply.";t({title:"Error",description:g,variant:"destructive"})}},h=r.filter(v=>!v.parentId),p=r.reduce((v,m)=>(m.parentId&&(v[m.parentId]||(v[m.parentId]=[]),v[m.parentId].push(m)),v),{});return c.jsxs("div",{className:"space-y-6 max-w-5xl mx-auto",children:[c.jsx(jt,{children:c.jsxs(It,{className:"p-6",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(ub,{className:"w-5 h-5 text-primary"}),c.jsx("h3",{className:"text-xl font-display font-bold",children:"Leave a Comment"})]}),c.jsxs("form",{onSubmit:f,className:"space-y-4",children:[c.jsx(Be,{placeholder:"Your Name",value:a.author,onChange:v=>s({...a,author:v.target.value}),required:!0,className:"bg-background"}),c.jsx(ws,{placeholder:"Write your comment here...",value:a.content,onChange:v=>s({...a,content:v.target.value}),required:!0,rows:4,className:"bg-background resize-none"}),c.jsx("div",{className:"flex justify-center",children:c.jsxs(be,{type:"submit",className:"w-full sm:w-auto",children:[c.jsx(K0,{className:"w-4 h-4 mr-2"}),"Post Comment"]})})]})]})}),r.length>0&&c.jsx(jt,{children:c.jsxs(It,{className:"p-6",children:[c.jsxs("h3",{className:"text-xl font-display font-bold mb-4",children:["Comments (",r.length,")"]}),c.jsx("div",{className:"max-h-[500px] overflow-y-auto pr-2 space-y-4",children:h.map(v=>c.jsx(Jse,{comment:v,replies:p[v.id]||[],onReply:()=>o(v.id),isReplying:i===v.id,replyContent:l,onReplyChange:u,onReplySubmit:()=>d(v.id),onCancelReply:()=>{o(null),u("")}},v.id))})]})}),r.length===0&&c.jsx(jt,{children:c.jsxs(It,{className:"p-6 text-center text-muted-foreground",children:[c.jsx(ub,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),c.jsx("p",{children:"No comments yet. Be the first to comment!"})]})})]})}function Jse({comment:e,replies:t,onReply:r,isReplying:n,replyContent:a,onReplyChange:s,onReplySubmit:i,onCancelReply:o}){return c.jsx("div",{className:"border-b border-border pb-4 last:border-0",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:c.jsx("span",{className:"text-primary font-semibold text-sm",children:e.author.charAt(0).toUpperCase()})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:"font-semibold text-foreground",children:e.author}),c.jsx("span",{className:"text-xs text-muted-foreground",children:SE(new Date(e.date),{addSuffix:!0})})]}),c.jsx("p",{className:"text-foreground/90 mb-2 whitespace-pre-wrap break-words",children:e.content}),c.jsxs(be,{variant:"ghost",size:"sm",onClick:r,className:"h-8 text-xs",children:[c.jsx(dF,{className:"w-3 h-3 mr-1"}),"Reply"]}),n&&c.jsxs("div",{className:"mt-3 ml-4 space-y-2",children:[c.jsx(ws,{placeholder:"Write your reply...",value:a,onChange:l=>s(l.target.value),rows:2,className:"bg-background resize-none text-sm"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(be,{size:"sm",onClick:i,children:[c.jsx(K0,{className:"w-3 h-3 mr-1"}),"Post Reply"]}),c.jsx(be,{size:"sm",variant:"outline",onClick:o,children:"Cancel"})]})]}),t.length>0&&c.jsx("div",{className:"mt-3 ml-4 space-y-3 border-l-2 border-primary/20 pl-4",children:t.map(l=>c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/20 flex items-center justify-center flex-shrink-0",children:c.jsx("span",{className:"text-accent-foreground font-semibold text-xs",children:l.author.charAt(0).toUpperCase()})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:"font-medium text-sm text-foreground",children:l.author}),c.jsx("span",{className:"text-xs text-muted-foreground",children:SE(new Date(l.date),{addSuffix:!0})})]}),c.jsx("p",{className:"text-sm text-foreground/80 whitespace-pre-wrap break-words",children:l.content})]})]},l.id))})]})]})})}const Qse=()=>{const{slug:e}=FN(),[t,r]=S.useState(null),[n,a]=S.useState(!0);if(S.useEffect(()=>{(async()=>{if(e)try{const o=await Ys.getBySlug(e);r(o||null)}catch(o){console.error("Error loading post:",o),r(null)}finally{a(!1)}})()},[e]),n)return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{className:"flex-1 pt-20 pb-16",children:c.jsx("div",{className:"w-full px-4 py-16",children:c.jsxs("div",{className:"w-full",children:[c.jsx("div",{className:"h-8 bg-muted rounded w-1/3 mb-4 animate-pulse"}),c.jsx("div",{className:"h-4 bg-muted rounded w-1/2 mb-8 animate-pulse"}),c.jsx("div",{className:"space-y-4",children:Array.from({length:5}).map((i,o)=>c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"},o))})]})})}),c.jsx(vr,{})]});if(!t)return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{className:"flex-1 pt-20 pb-16",children:c.jsx("div",{className:"w-full px-4 py-16",children:c.jsxs("div",{className:"w-full text-center",children:[c.jsx("h1",{className:"text-4xl font-display font-bold text-foreground mb-4",children:"Post Not Found"}),c.jsx("p",{className:"text-muted-foreground mb-8",children:"The blog post you're looking for doesn't exist or has been removed."}),c.jsx(be,{asChild:!0,children:c.jsxs(vt,{to:"/posts",children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back to All Posts"]})})]})})}),c.jsx(vr,{}),c.jsx(hn,{})]});const s=i=>{const o=["gardening","plant care","home gardening"],l=i.category?[i.category.toLowerCase()]:[],u=i.title.toLowerCase().split(" ").filter(f=>f.length>3).slice(0,5);return[...o,...l,...u].join(", ")};return c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[t&&c.jsx(Yf,{title:t.title,description:t.excerpt||`Read about ${t.title} on Perfect Gardener. ${t.category?`Category: ${t.category}.`:""} Expert gardening tips and plant care advice.`,keywords:s(t),image:t.image||void 0,url:`https://perfectgardener.netlify.app/blog/${t.slug}`,type:"article",author:t.author||"Shubham Jakhmola",publishedTime:t.date?new Date(t.date).toISOString():void 0,category:t.category||void 0}),c.jsx(gr,{}),c.jsx("main",{className:"flex-1 pt-20 pb-16",children:c.jsx("article",{className:"w-full px-4 sm:px-6 lg:px-8 py-8",children:c.jsxs("div",{className:"w-full",children:[c.jsx(be,{variant:"ghost",asChild:!0,className:"mb-8",children:c.jsxs(vt,{to:"/posts",children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back to All Posts"]})}),c.jsxs("header",{className:"mb-8",children:[t.category&&c.jsx("span",{className:"inline-block px-3 py-1 bg-primary/10 text-primary text-sm font-medium rounded-full mb-4",children:t.category}),c.jsx("h1",{className:"text-4xl md:text-5xl font-display font-bold text-foreground mb-4",children:t.title}),c.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:t.excerpt}),c.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground",children:[t.author&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Ak,{className:"w-4 h-4"}),t.author]}),t.date&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(py,{className:"w-4 h-4"}),new Date(t.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]}),t.readTime&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(G0,{className:"w-4 h-4"}),t.readTime]})]})]}),c.jsx(jt,{className:"mb-8",children:c.jsxs(It,{className:"p-6 sm:p-8 lg:p-10",children:[c.jsx("style",{children:`
.blog-post-content.prose p {
margin-top: 0.75em;
margin-bottom: 0.75em;
line-height: 1.7;
}
.blog-post-content.prose p:first-child {
margin-top: 0;
}
.blog-post-content.prose p:last-child {
margin-bottom: 0;
}
.blog-post-content.prose h1,
.blog-post-content.prose h2,
.blog-post-content.prose h3,
.blog-post-content.prose h4 {
margin-top: 1.25em;
margin-bottom: 0.5em;
line-height: 1.3;
}
.blog-post-content.prose h1:first-child,
.blog-post-content.prose h2:first-child,
.blog-post-content.prose h3:first-child,
.blog-post-content.prose h4:first-child {
margin-top: 0;
}
.blog-post-content.prose ul,
.blog-post-content.prose ol {
margin-top: 0.75em;
margin-bottom: 0.75em;
}
.blog-post-content.prose li {
margin-top: 0.25em;
margin-bottom: 0.25em;
}
.blog-post-content.prose img {
margin-top: 1em;
margin-bottom: 1em;
}
`}),c.jsx("div",{className:`blog-post-content prose prose-lg dark:prose-invert max-w-none
prose-headings:font-display prose-headings:text-foreground
prose-p:text-foreground/90 prose-a:text-primary prose-a:no-underline hover:prose-a:underline
prose-strong:text-foreground prose-img:rounded-lg prose-img:shadow-lg
prose-blockquote:border-primary prose-blockquote:bg-muted/50 prose-blockquote:py-2 prose-blockquote:px-4
prose-code:bg-muted prose-code:px-1 prose-code:py-0.5 prose-code:rounded
prose-pre:bg-muted prose-pre:text-foreground`,dangerouslySetInnerHTML:{__html:dj.sanitize(t.content,{ALLOWED_TAGS:["p","br","strong","em","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","blockquote","code","pre","div","span","table","thead","tbody","tr","td","th","hr","iframe"],ALLOWED_ATTR:["href","src","alt","title","class","id","target","rel","style","width","height","frameborder","allowfullscreen","allow"],ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|data):|[^a-z]|[a-z+.\-\w]+(?:[^a-z+.\-:]|$))/i})}})]})}),c.jsx("div",{className:"mt-12",children:c.jsx(Xse,{postSlug:t.slug})}),c.jsx("div",{className:"flex justify-center mt-8",children:c.jsx(be,{asChild:!0,variant:"outline",children:c.jsxs(vt,{to:"/posts",children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"View All Posts"]})})})]})})}),c.jsx(vr,{}),c.jsx(hn,{})]})},Zse=()=>{const{id:e}=FN(),t=ap(),[r,n]=S.useState(null),[a,s]=S.useState(!0),[i,o]=S.useState(null),[l,u]=S.useState(0),[f,d]=S.useState(null),[h,p]=S.useState(null),[v,m]=S.useState([]);S.useEffect(()=>{(async()=>{try{if(!e){o("Product ID is required"),s(!1);return}const P=await ga.getAll(),N=P.find(k=>k.id===e);if(!N){o("Product not found"),s(!1);return}if(n(N),N.name){const k=P.filter(A=>A.id!==N.id&&A.name.toLowerCase().trim()===N.name.toLowerCase().trim()&&A.subCategory&&A.subCategory!==N.subCategory);m(k)}s(!1)}catch(P){console.error("Error loading product:",P),o("Failed to load product. Please try again."),s(!1)}})()},[e]);const g=r!=null&&r.images&&r.images.length>0?r.images:r!=null&&r.image?[r.image]:[],x=50,y=C=>{p(null),d(C.targetTouches[0].clientX)},w=C=>{p(C.targetTouches[0].clientX)},b=()=>{if(!f||!h||g.length<=1)return;const C=f-h,P=C>x,N=C<-x;P&&l<g.length-1&&u(l+1),N&&l>0&&u(l-1)},_=()=>{g.length<=1||u(C=>C>0?C-1:g.length-1)},T=()=>{g.length<=1||u(C=>C<g.length-1?C+1:0)},E=g[l]||"";return a?c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{className:"flex-1 pt-20 pb-16",children:c.jsx("div",{className:"container mx-auto px-4 py-16",children:c.jsxs("div",{className:"max-w-4xl mx-auto",children:[c.jsx("div",{className:"h-8 bg-muted rounded w-1/3 mb-4 animate-pulse"}),c.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[c.jsx("div",{className:"aspect-square bg-muted rounded-lg animate-pulse"}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"h-6 bg-muted rounded w-3/4 animate-pulse"}),c.jsx("div",{className:"h-4 bg-muted rounded w-1/2 animate-pulse"}),c.jsx("div",{className:"h-8 bg-muted rounded w-1/4 animate-pulse"})]})]})]})})}),c.jsx(vr,{})]}):i||!r?c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{className:"flex-1 pt-20 pb-16",children:c.jsx("div",{className:"container mx-auto px-4 py-16",children:c.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[c.jsx("h1",{className:"text-2xl font-display font-bold text-foreground mb-4",children:i||"Product Not Found"}),c.jsx("p",{className:"text-muted-foreground mb-6",children:i||"The product you're looking for doesn't exist or has been removed."}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[c.jsx(be,{asChild:!0,variant:"default",children:c.jsxs(vt,{to:"/products",children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back to Products"]})}),c.jsx(be,{asChild:!0,variant:"outline",children:c.jsx(vt,{to:"/",children:"Go Home"})})]})]})})}),c.jsx(vr,{})]}):c.jsx($N,{children:c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{className:"flex-1 pt-20 pb-16",children:c.jsxs("div",{className:"container mx-auto px-4 py-8",children:[c.jsxs(be,{variant:"ghost",onClick:()=>t(-1),className:"mb-6",children:[c.jsx(ki,{className:"w-4 h-4 mr-2"}),"Back"]}),c.jsx("div",{className:"max-w-6xl mx-auto",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative aspect-square rounded-xl overflow-hidden bg-muted group",onTouchStart:y,onTouchMove:w,onTouchEnd:b,children:[E?c.jsx("img",{src:E,alt:`${r.name} - Image ${l+1}`,className:"w-full h-full object-contain block transition-opacity duration-300",onError:C=>{C.target.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Crect fill='%23e5e7eb' width='400' height='400'/%3E%3Ctext fill='%239ca3af' font-family='system-ui' font-size='20' x='50%25' y='50%25' text-anchor='middle' dy='.3em'%3ENo Image%3C/text%3E%3C/svg%3E"}}):c.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:c.jsx(Yh,{className:"w-16 h-16"})}),g.length>1&&c.jsxs(c.Fragment,{children:[c.jsx(be,{variant:"secondary",size:"icon",className:"absolute left-4 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity h-12 w-12 rounded-full shadow-lg backdrop-blur-sm bg-white/90",onClick:_,"aria-label":"Previous image",children:c.jsx(_k,{className:"w-6 h-6"})}),c.jsx(be,{variant:"secondary",size:"icon",className:"absolute right-4 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity h-12 w-12 rounded-full shadow-lg backdrop-blur-sm bg-white/90",onClick:T,"aria-label":"Next image",children:c.jsx(gy,{className:"w-6 h-6"})}),c.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-black/70 text-white text-sm px-4 py-2 rounded-full backdrop-blur-sm",children:[l+1," / ",g.length]})]})]}),g.length>1&&c.jsx("div",{className:"flex gap-3 overflow-x-auto pb-2 scrollbar-hide",children:g.map((C,P)=>c.jsx("button",{type:"button",onClick:()=>u(P),className:je("flex-shrink-0 w-20 h-20 sm:w-24 sm:h-24 rounded-lg overflow-hidden border-2 transition-all",l===P?"border-primary shadow-lg scale-105":"border-border opacity-60 hover:opacity-100 hover:scale-105"),children:c.jsx("img",{src:C,alt:`Thumbnail ${P+1}`,className:"w-full h-full object-contain block",onError:N=>{N.target.style.display="none"}})},P))})]}),c.jsxs("div",{className:"space-y-6",children:[r.category&&c.jsxs(Es,{variant:"secondary",className:"w-fit",children:[c.jsx(Nk,{className:"w-3 h-3 mr-1"}),r.category]}),c.jsx("h1",{className:"font-display font-bold text-3xl md:text-4xl text-foreground leading-tight",children:r.name}),c.jsx("p",{className:"text-3xl md:text-4xl font-bold text-primary",children:r.price}),c.jsx("div",{className:"h-px bg-border"}),r.description&&c.jsxs("div",{children:[c.jsxs("h2",{className:"text-lg font-semibold text-foreground mb-3 flex items-center gap-2",children:[c.jsx(Yh,{className:"w-5 h-5"}),"About this product"]}),c.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})]}),c.jsxs("div",{className:"space-y-3 bg-muted/50 rounded-xl p-6",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Availability"}),c.jsx("span",{className:"text-green-600 font-medium",children:"In Stock"})]}),c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Shipping"}),c.jsx("span",{className:"text-foreground",children:"Free Delivery"})]}),c.jsxs("div",{className:"flex items-center justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Returns"}),c.jsx("span",{className:"text-foreground",children:"Easy 7-Day Returns"})]})]}),r.link&&c.jsx(be,{asChild:!0,className:"w-full",size:"lg",children:c.jsxs("a",{href:r.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center",children:[c.jsx(uh,{className:"w-5 h-5 mr-2"}),"Buy this product",c.jsx(Ml,{className:"w-5 h-5 ml-2"})]})}),r.source&&c.jsxs("p",{className:"text-sm text-muted-foreground text-center mt-2",children:["Available on ",ll(r.source)]})]})]})}),v.length>0&&c.jsx("div",{className:"mt-12",children:c.jsxs(jt,{children:[c.jsx(nn,{children:c.jsxs(an,{className:"flex items-center gap-2",children:[c.jsx(nF,{className:"w-5 h-5"}),"Compare Prices Across Platforms"]})}),c.jsx(It,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Same product available on different platforms:"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[c.jsx(jt,{className:je("border-2",r.source&&"border-primary"),children:c.jsxs(It,{className:"p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx(Es,{variant:r.source?"default":"secondary",children:r.source?ll(r.source):"Current"}),r.source&&c.jsx("span",{className:"text-xs text-muted-foreground",children:"Current"})]}),c.jsx("p",{className:"font-bold text-lg text-primary mb-2",children:r.price}),r.link&&c.jsx(be,{asChild:!0,size:"sm",className:"w-full",variant:r.source?"default":"outline",children:c.jsxs("a",{href:r.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center",children:[c.jsx(uh,{className:"w-4 h-4 mr-2"}),"Buy from ",r.source?ll(r.source):"here",c.jsx(Ml,{className:"w-4 h-4 ml-2"})]})})]})}),v.map(C=>c.jsx(jt,{className:"border",children:c.jsxs(It,{className:"p-4",children:[c.jsx("div",{className:"flex items-center justify-between mb-2",children:c.jsx(Es,{variant:"secondary",children:C.subCategory?ll(C.subCategory):"Other"})}),c.jsx("p",{className:"font-bold text-lg text-primary mb-2",children:C.price}),C.link&&c.jsx(be,{asChild:!0,size:"sm",className:"w-full",variant:"outline",children:c.jsxs("a",{href:C.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center",children:[c.jsx(uh,{className:"w-4 h-4 mr-2"}),"Buy from ",C.subCategory?ll(C.subCategory):"here",c.jsx(Ml,{className:"w-4 h-4 ml-2"})]})})]})},C.id))]})]})})]})})]})}),c.jsx(vr,{}),c.jsx(hn,{})]})})},eie=()=>c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{id:"main-content",className:"flex-1 pt-20 pb-16",children:c.jsx("section",{className:"py-12 md:py-16",children:c.jsx("div",{className:"section-container",children:c.jsxs("div",{className:"max-w-4xl mx-auto",children:[c.jsx("h1",{className:"text-2xl xs:text-3xl sm:text-4xl md:text-5xl font-display font-bold text-foreground mb-3 xs:mb-4",children:"About Perfect Gardener"}),c.jsx("p",{className:"text-base xs:text-lg sm:text-xl text-muted-foreground mb-6 xs:mb-8",children:"Nature, flowers, plants, care — helping them grow beautifully."}),c.jsxs("div",{className:"space-y-4 xs:space-y-5 sm:space-y-6 text-foreground text-sm xs:text-base sm:text-lg leading-relaxed",children:[c.jsxs("p",{children:["Hey there! I'm ",c.jsx("strong",{className:"font-semibold",children:"Shubham Jakhmola"}),", and I live in the beautiful mountains of Uttarakhand. Gardening's been my thing for as long as I can remember. There's something really calming about getting your hands dirty and watching things grow. That's why I started Perfect Gardener — to share what I've learned along the way."]}),c.jsx("p",{children:"I wanted to make gardening less intimidating for folks who are just starting out. Whether you've never planted a seed or you're looking to step up your plant game, I've got tips that actually work. I talk about everything from getting your soil ready to dealing with pesky bugs, and it's all stuff I've tried myself in my own garden."}),c.jsx("p",{children:"You'll also find videos on my YouTube channel where I walk through different plant care routines, share some DIY tricks, and show off what's growing in my space. Nothing fancy — just real, practical advice from someone who's been doing this for a while."}),c.jsx("p",{children:"Bottom line? I want to help you grow better plants and create a nice green spot at home. If I can do it up here in the hills, you can definitely do it wherever you are!"})]})]})})})}),c.jsx(vr,{}),c.jsx(hn,{})]}),tie=()=>c.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[c.jsx(gr,{}),c.jsx("main",{id:"main-content",className:"flex-1 pt-20 pb-16",children:c.jsx("section",{className:"py-12 md:py-16",children:c.jsx("div",{className:"section-container",children:c.jsxs("div",{className:"max-w-4xl mx-auto",children:[c.jsx("h1",{className:"text-4xl md:text-5xl font-display font-bold text-foreground mb-8",children:"Privacy Policy"}),c.jsxs("div",{className:"space-y-6 text-foreground text-lg leading-relaxed",children:[c.jsx("p",{children:c.jsx("strong",{children:"Welcome to Perfect Gardener."})}),c.jsx("p",{children:"Your privacy matters to us. This page explains what data we collect, how it's used, and how it's protected."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"1. Information We Collect"}),c.jsx("p",{children:"Perfect Gardener is a static website and does not collect personal information by default."}),c.jsx("p",{children:"We may collect limited information in the following cases:"}),c.jsx("h3",{className:"text-xl font-display font-semibold text-foreground mt-6 mb-3",children:"a) Analytics Data"}),c.jsx("p",{children:"We use Google Analytics to understand how visitors interact with our website. This may include:"}),c.jsxs("ul",{className:"list-disc list-inside space-y-2 ml-4 mb-4",children:[c.jsx("li",{children:"Pages visited"}),c.jsx("li",{children:"Time spent on pages"}),c.jsx("li",{children:"Device type and browser"}),c.jsx("li",{children:"Approximate location (city-level)"})]}),c.jsx("p",{children:"This data is anonymous and does not personally identify you."}),c.jsx("h3",{className:"text-xl font-display font-semibold text-foreground mt-6 mb-3",children:"b) Contact Information"}),c.jsx("p",{children:"If you contact us through the contact form or email:"}),c.jsxs("ul",{className:"list-disc list-inside space-y-2 ml-4 mb-4",children:[c.jsx("li",{children:"Your name and email address may be collected"}),c.jsx("li",{children:"This data is used only to reply to your message"}),c.jsx("li",{children:"We do not store, sell, or share this information for marketing purposes."})]}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"2. Cookies"}),c.jsx("p",{children:"Perfect Gardener may use cookies via Google Analytics to:"}),c.jsxs("ul",{className:"list-disc list-inside space-y-2 ml-4 mb-4",children:[c.jsx("li",{children:"Measure website traffic"}),c.jsx("li",{children:"Improve performance and content quality"})]}),c.jsx("p",{children:"You can disable cookies anytime through your browser settings."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"3. Affiliate Disclosure"}),c.jsxs("div",{className:"border border-border rounded-lg p-4 bg-muted/50 my-4",children:[c.jsx("strong",{children:"Affiliate Disclosure"}),c.jsxs("p",{className:"mt-2",children:["Some links on this website are affiliate links. This means we may earn a small commission if you make a purchase through these links, at no extra cost to you. These commissions help support and maintain ",c.jsx("strong",{children:"Perfect Gardener"}),"."]})]}),c.jsx("p",{children:"Affiliate links do not influence our content or recommendations."}),c.jsx("p",{children:"We only share products we genuinely believe may be useful."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"4. Third-Party Services"}),c.jsx("p",{children:"We may use trusted third-party services, including:"}),c.jsxs("ul",{className:"list-disc list-inside space-y-2 ml-4 mb-4",children:[c.jsx("li",{children:"Google Analytics (website analytics)"}),c.jsx("li",{children:"EmailJS (contact form handling)"})]}),c.jsx("p",{children:"These services operate under their own privacy policies."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"5. Data Security"}),c.jsx("p",{children:"We take reasonable steps to protect your data."}),c.jsx("p",{children:"Since Perfect Gardener is a static website, no sensitive user data is stored on our servers."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"6. External Links"}),c.jsx("p",{children:"This website may contain links to external websites (such as product pages or social platforms)."}),c.jsx("p",{children:"We are not responsible for the privacy practices of those external sites."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"7. Children's Information"}),c.jsx("p",{children:"Perfect Gardener does not knowingly collect personal information from children under the age of 13."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"8. Changes to This Privacy Policy"}),c.jsx("p",{children:"This Privacy Policy may be updated from time to time."}),c.jsx("p",{children:"Any changes will be posted on this page with an updated revision date."}),c.jsx("h2",{className:"text-2xl font-display font-bold text-foreground mt-8 mb-4",children:"9. Contact Us"}),c.jsx("p",{children:"If you have questions about this Privacy Policy, you can contact us at:"}),c.jsxs("ul",{className:"list-disc list-inside space-y-2 ml-4",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Email:"})," progardener01@gmail.com"]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Website:"})," https://perfectgardener.netlify.app"]})]})]})]})})})}),c.jsx(vr,{}),c.jsx(hn,{})]}),rie=new HM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}}),nie=()=>c.jsx($N,{children:c.jsx(qM,{client:rie,children:c.jsxs(pN,{children:[c.jsx(JF,{}),c.jsx(CD,{}),c.jsxs(t6,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:[c.jsx(s6,{}),c.jsxs(KL,{children:[c.jsx(Cr,{path:"/",element:c.jsx(Z$,{})}),c.jsx(Cr,{path:"/products",element:c.jsx(oz,{})}),c.jsx(Cr,{path:"/product/:id",element:c.jsx(Zse,{})}),c.jsx(Cr,{path:"/posts",element:c.jsx(cz,{})}),c.jsx(Cr,{path:"/blog/:slug",element:c.jsx(Qse,{})}),c.jsx(Cr,{path:"/contact",element:c.jsx(_z,{})}),c.jsx(Cr,{path:"/about",element:c.jsx(eie,{})}),c.jsx(Cr,{path:"/privacy",element:c.jsx(tie,{})}),c.jsx(Cr,{path:"/tools",element:c.jsx(rz,{})}),c.jsx(Cr,{path:"/tools/pot-calculator",element:c.jsx(Ez,{})}),c.jsx(Cr,{path:"/tools/bloom-calculator",element:c.jsx(Sz,{})}),c.jsx(Cr,{path:"/tools/budget-planner",element:c.jsx(Tz,{})}),c.jsx(Cr,{path:"/tools/flower-calendar",element:c.jsx(Az,{})}),c.jsx(Cr,{path:"/admin/login",element:c.jsx(nse,{})}),c.jsx(Cr,{path:"/admin",element:c.jsx(rse,{})}),c.jsx(Cr,{path:"*",element:c.jsx(ez,{})})]})]})]})})});KT(document.getElementById("root")).render(c.jsx(nie,{}));