yamchart 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/{advisor-57BOMUUF.js → advisor-JMWAAWJO.js} +10 -10
  2. package/dist/chunk-4W6IVOKO.js +362 -0
  3. package/dist/chunk-4W6IVOKO.js.map +1 -0
  4. package/dist/{chunk-JYQKDWLG.js → chunk-5N3FYFBV.js} +72 -1
  5. package/dist/chunk-5N3FYFBV.js.map +1 -0
  6. package/dist/{chunk-OTAUP5RC.js → chunk-7AVPKKYY.js} +5 -5
  7. package/dist/chunk-7AVPKKYY.js.map +1 -0
  8. package/dist/{chunk-X6LQGWUX.js → chunk-KP4CYPBL.js} +9 -2
  9. package/dist/chunk-KP4CYPBL.js.map +1 -0
  10. package/dist/{chunk-E2UZXDF6.js → chunk-N6PUISAQ.js} +4 -4
  11. package/dist/compare-ZN6RUOOQ.js +87 -0
  12. package/dist/compare-ZN6RUOOQ.js.map +1 -0
  13. package/dist/{connection-utils-FTSZU2VF.js → connection-utils-VEKXRCOM.js} +4 -4
  14. package/dist/describe-X55JPLES.js +29 -0
  15. package/dist/describe-X55JPLES.js.map +1 -0
  16. package/dist/{dev-MRZ76V74.js → dev-NZLS72PG.js} +9 -7
  17. package/dist/dev-NZLS72PG.js.map +1 -0
  18. package/dist/{dist-PVHFUYP2.js → dist-E2PVGIPT.js} +4 -2
  19. package/dist/{dist-WDTDQDTX.js → dist-GVNWQXFR.js} +2 -2
  20. package/dist/index.js +314 -32
  21. package/dist/index.js.map +1 -1
  22. package/dist/{lineage-XSITWW2O.js → lineage-T5NRHHZN.js} +32 -5
  23. package/dist/{lineage-XSITWW2O.js.map → lineage-T5NRHHZN.js.map} +1 -1
  24. package/dist/public/assets/{EventManagement-BlxJ2TFw.js → EventManagement-7MyQq5KD.js} +1 -1
  25. package/dist/public/assets/{LoginPage-BT8ikmPn.js → LoginPage-BypxvDY2.js} +1 -1
  26. package/dist/public/assets/{PublicViewer-B4uFxgbt.js → PublicViewer-CdDaYqTc.js} +1 -1
  27. package/dist/public/assets/{SetupWizard-njrOhCzw.js → SetupWizard-CEGLuSGr.js} +1 -1
  28. package/dist/public/assets/{ShareManagement-Bg16oJhW.js → ShareManagement-DcPZNRdx.js} +1 -1
  29. package/dist/public/assets/{UserManagement-tiCIT4UY.js → UserManagement-VZ9Qvds0.js} +1 -1
  30. package/dist/public/assets/{index-BZ25r23j.css → index-B_fusLA_.css} +1 -1
  31. package/dist/public/assets/index-Cxn1i3jV.js +187 -0
  32. package/dist/public/assets/{index.es-BuktD_R2.js → index.es-06ls9Fpg.js} +1 -1
  33. package/dist/public/assets/{jspdf.es.min-DFRl2hZQ.js → jspdf.es.min-DER4Hnpt.js} +3 -3
  34. package/dist/public/index.html +3 -3
  35. package/dist/{query-JRMMNXX6.js → query-3F5V5CZH.js} +4 -4
  36. package/dist/{sample-VGIY4U4J.js → sample-SWYXGWOM.js} +4 -4
  37. package/dist/search-ARIDL6DA.js +28 -0
  38. package/dist/search-ARIDL6DA.js.map +1 -0
  39. package/dist/source-resolver-UHKZVOOC.js +18 -0
  40. package/dist/source-resolver-UHKZVOOC.js.map +1 -0
  41. package/dist/{sync-warehouse-XHTBZH25.js → sync-warehouse-J4E2R2PW.js} +4 -4
  42. package/dist/tables-VAR2ZKUA.js +30 -0
  43. package/dist/tables-VAR2ZKUA.js.map +1 -0
  44. package/dist/templates/default/docs/yamchart-reference.md +23 -4
  45. package/dist/templates/default/yamchart.yaml +1 -1
  46. package/dist/templates/empty/yamchart.yaml +1 -1
  47. package/dist/{test-TXRZWNXK.js → test-SV5SLSLM.js} +4 -4
  48. package/package.json +1 -1
  49. package/dist/chunk-JYQKDWLG.js.map +0 -1
  50. package/dist/chunk-OTAUP5RC.js.map +0 -1
  51. package/dist/chunk-X6LQGWUX.js.map +0 -1
  52. package/dist/describe-TGIOBNJB.js +0 -44
  53. package/dist/describe-TGIOBNJB.js.map +0 -1
  54. package/dist/dev-MRZ76V74.js.map +0 -1
  55. package/dist/public/assets/index-B41yj3io.js +0 -187
  56. package/dist/search-QSYNG4SR.js +0 -39
  57. package/dist/search-QSYNG4SR.js.map +0 -1
  58. package/dist/tables-UOO342TA.js +0 -40
  59. package/dist/tables-UOO342TA.js.map +0 -1
  60. /package/dist/{advisor-57BOMUUF.js.map → advisor-JMWAAWJO.js.map} +0 -0
  61. /package/dist/{chunk-E2UZXDF6.js.map → chunk-N6PUISAQ.js.map} +0 -0
  62. /package/dist/{connection-utils-FTSZU2VF.js.map → connection-utils-VEKXRCOM.js.map} +0 -0
  63. /package/dist/{dist-PVHFUYP2.js.map → dist-E2PVGIPT.js.map} +0 -0
  64. /package/dist/{dist-WDTDQDTX.js.map → dist-GVNWQXFR.js.map} +0 -0
  65. /package/dist/{query-JRMMNXX6.js.map → query-3F5V5CZH.js.map} +0 -0
  66. /package/dist/{sample-VGIY4U4J.js.map → sample-SWYXGWOM.js.map} +0 -0
  67. /package/dist/{sync-warehouse-XHTBZH25.js.map → sync-warehouse-J4E2R2PW.js.map} +0 -0
  68. /package/dist/{test-TXRZWNXK.js.map → test-SV5SLSLM.js.map} +0 -0
@@ -0,0 +1,187 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-BypxvDY2.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-CEGLuSGr.js","assets/UserManagement-VZ9Qvds0.js","assets/ShareManagement-DcPZNRdx.js","assets/PublicViewer-CdDaYqTc.js","assets/EventManagement-7MyQq5KD.js"])))=>i.map(i=>d[i]);
2
+ var zw=Object.defineProperty;var Lg=e=>{throw TypeError(e)};var Ww=(e,t,n)=>t in e?zw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>Ww(e,typeof t!="symbol"?t+"":t,n),Nh=(e,t,n)=>t.has(e)||Lg("Cannot "+n);var W=(e,t,n)=>(Nh(e,t,"read from private field"),n?n.call(e):t.get(e)),Be=(e,t,n)=>t.has(e)?Lg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ae=(e,t,n,r)=>(Nh(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),st=(e,t,n)=>(Nh(e,t,"access private method"),n);var Ec=(e,t,n,r)=>({set _(o){Ae(e,t,o,n)},get _(){return W(e,t,r)}});import{r as fa,a as N,R as Me,E as Yw,g as xx}from"./echarts-DtOYsfLX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Dh={exports:{}},fl={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Rg;function $w(){if(Rg)return fl;Rg=1;var e=fa(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,h){var p,y={},b=null,v=null;h!==void 0&&(b=""+h),d.key!==void 0&&(b=""+d.key),d.ref!==void 0&&(v=d.ref);for(p in d)r.call(d,p)&&!i.hasOwnProperty(p)&&(y[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)y[p]===void 0&&(y[p]=d[p]);return{$$typeof:t,type:c,key:b,ref:v,props:y,_owner:o.current}}return fl.Fragment=n,fl.jsx=l,fl.jsxs=l,fl}var Pg;function qw(){return Pg||(Pg=1,Dh.exports=$w()),Dh.exports}var f=qw(),Tc={},Oh={exports:{}},Xn={},Ah={exports:{}},Ih={};/**
11
+ * @license React
12
+ * scheduler.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var jg;function Vw(){return jg||(jg=1,(function(e){function t(te,de){var M=te.length;te.push(de);e:for(;0<M;){var V=M-1>>>1,ae=te[V];if(0<o(ae,de))te[V]=de,te[M]=ae,M=V;else break e}}function n(te){return te.length===0?null:te[0]}function r(te){if(te.length===0)return null;var de=te[0],M=te.pop();if(M!==de){te[0]=M;e:for(var V=0,ae=te.length,j=ae>>>1;V<j;){var le=2*(V+1)-1,pe=te[le],ye=le+1,Ne=te[ye];if(0>o(pe,M))ye<ae&&0>o(Ne,pe)?(te[V]=Ne,te[ye]=M,V=ye):(te[V]=pe,te[le]=M,V=le);else if(ye<ae&&0>o(Ne,M))te[V]=Ne,te[ye]=M,V=ye;else break e}}return de}function o(te,de){var M=te.sortIndex-de.sortIndex;return M!==0?M:te.id-de.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],h=[],p=1,y=null,b=3,v=!1,D=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(te){for(var de=n(h);de!==null;){if(de.callback===null)r(h);else if(de.startTime<=te)r(h),de.sortIndex=de.expirationTime,t(d,de);else break;de=n(h)}}function I(te){if(S=!1,O(te),!D)if(n(d)!==null)D=!0,ie(L);else{var de=n(h);de!==null&&ge(I,de.startTime-te)}}function L(te,de){D=!1,S&&(S=!1,T(A),A=-1),v=!0;var M=b;try{for(O(de),y=n(d);y!==null&&(!(y.expirationTime>de)||te&&!B());){var V=y.callback;if(typeof V=="function"){y.callback=null,b=y.priorityLevel;var ae=V(y.expirationTime<=de);de=e.unstable_now(),typeof ae=="function"?y.callback=ae:y===n(d)&&r(d),O(de)}else r(d);y=n(d)}if(y!==null)var j=!0;else{var le=n(h);le!==null&&ge(I,le.startTime-de),j=!1}return j}finally{y=null,b=M,v=!1}}var _=!1,C=null,A=-1,P=5,H=-1;function B(){return!(e.unstable_now()-H<P)}function z(){if(C!==null){var te=e.unstable_now();H=te;var de=!0;try{de=C(!0,te)}finally{de?Q():(_=!1,C=null)}}else _=!1}var Q;if(typeof k=="function")Q=function(){k(z)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,X=q.port2;q.port1.onmessage=z,Q=function(){X.postMessage(null)}}else Q=function(){E(z,0)};function ie(te){C=te,_||(_=!0,Q())}function ge(te,de){A=E(function(){te(e.unstable_now())},de)}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(te){te.callback=null},e.unstable_continueExecution=function(){D||v||(D=!0,ie(L))},e.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<te?Math.floor(1e3/te):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(te){switch(b){case 1:case 2:case 3:var de=3;break;default:de=b}var M=b;b=de;try{return te()}finally{b=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(te,de){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var M=b;b=te;try{return de()}finally{b=M}},e.unstable_scheduleCallback=function(te,de,M){var V=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?V+M:V):M=V,te){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=M+ae,te={id:p++,callback:de,priorityLevel:te,startTime:M,expirationTime:ae,sortIndex:-1},M>V?(te.sortIndex=M,t(h,te),n(d)===null&&te===n(h)&&(S?(T(A),A=-1):S=!0,ge(I,M-V))):(te.sortIndex=ae,t(d,te),D||v||(D=!0,ie(L))),te},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(te){var de=b;return function(){var M=b;b=de;try{return te.apply(this,arguments)}finally{b=M}}}})(Ih)),Ih}var Fg;function Qw(){return Fg||(Fg=1,Ah.exports=Vw()),Ah.exports}/**
19
+ * @license React
20
+ * react-dom.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Bg;function Gw(){if(Bg)return Xn;Bg=1;var e=fa(),t=Qw();function n(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,u=1;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(s,a){l(s,a),l(s+"Capture",a)}function l(s,a){for(o[s]=a,s=0;s<a.length;s++)r.add(a[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},y={};function b(s){return d.call(y,s)?!0:d.call(p,s)?!1:h.test(s)?y[s]=!0:(p[s]=!0,!1)}function v(s,a,u,m){if(u!==null&&u.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return m?!1:u!==null?!u.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function D(s,a,u,m){if(a===null||typeof a>"u"||v(s,a,u,m))return!0;if(m)return!1;if(u!==null)switch(u.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function S(s,a,u,m,x,w,R){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=x,this.mustUseProperty=u,this.propertyName=s,this.type=a,this.sanitizeURL=w,this.removeEmptyString=R}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){E[s]=new S(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];E[a]=new S(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){E[s]=new S(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){E[s]=new S(s,2,!1,s,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(s){E[s]=new S(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){E[s]=new S(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){E[s]=new S(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){E[s]=new S(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){E[s]=new S(s,5,!1,s.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function k(s){return s[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(s){var a=s.replace(T,k);E[a]=new S(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(T,k);E[a]=new S(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(T,k);E[a]=new S(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){E[s]=new S(s,1,!1,s.toLowerCase(),null,!1,!1)}),E.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){E[s]=new S(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,a,u,m){var x=E.hasOwnProperty(a)?E[a]:null;(x!==null?x.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(D(a,u,x,m)&&(u=null),m||x===null?b(a)&&(u===null?s.removeAttribute(a):s.setAttribute(a,""+u)):x.mustUseProperty?s[x.propertyName]=u===null?x.type===3?!1:"":u:(a=x.attributeName,m=x.attributeNamespace,u===null?s.removeAttribute(a):(x=x.type,u=x===3||x===4&&u===!0?"":""+u,m?s.setAttributeNS(m,a,u):s.setAttribute(a,u))))}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),_=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),B=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),ge=Symbol.for("react.offscreen"),te=Symbol.iterator;function de(s){return s===null||typeof s!="object"?null:(s=te&&s[te]||s["@@iterator"],typeof s=="function"?s:null)}var M=Object.assign,V;function ae(s){if(V===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);V=a&&a[1]||""}return`
27
+ `+V+s}var j=!1;function le(s,a){if(!s||j)return"";j=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(fe){var m=fe}Reflect.construct(s,[],a)}else{try{a.call()}catch(fe){m=fe}s.call(a.prototype)}else{try{throw Error()}catch(fe){m=fe}s()}}catch(fe){if(fe&&m&&typeof fe.stack=="string"){for(var x=fe.stack.split(`
28
+ `),w=m.stack.split(`
29
+ `),R=x.length-1,Y=w.length-1;1<=R&&0<=Y&&x[R]!==w[Y];)Y--;for(;1<=R&&0<=Y;R--,Y--)if(x[R]!==w[Y]){if(R!==1||Y!==1)do if(R--,Y--,0>Y||x[R]!==w[Y]){var K=`
30
+ `+x[R].replace(" at new "," at ");return s.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",s.displayName)),K}while(1<=R&&0<=Y);break}}}finally{j=!1,Error.prepareStackTrace=u}return(s=s?s.displayName||s.name:"")?ae(s):""}function pe(s){switch(s.tag){case 5:return ae(s.type);case 16:return ae("Lazy");case 13:return ae("Suspense");case 19:return ae("SuspenseList");case 0:case 2:case 15:return s=le(s.type,!1),s;case 11:return s=le(s.type.render,!1),s;case 1:return s=le(s.type,!0),s;default:return""}}function ye(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case C:return"Fragment";case _:return"Portal";case P:return"Profiler";case A:return"StrictMode";case Q:return"Suspense";case q:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case B:return(s.displayName||"Context")+".Consumer";case H:return(s._context.displayName||"Context")+".Provider";case z:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case X:return a=s.displayName||null,a!==null?a:ye(s.type)||"Memo";case ie:a=s._payload,s=s._init;try{return ye(s(a))}catch{}}return null}function Ne(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(a);case 8:return a===A?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function G(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Z(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function ue(s){var a=Z(s)?"checked":"value",u=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),m=""+s[a];if(!s.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var x=u.get,w=u.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return x.call(this)},set:function(R){m=""+R,w.call(this,R)}}),Object.defineProperty(s,a,{enumerable:u.enumerable}),{getValue:function(){return m},setValue:function(R){m=""+R},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function me(s){s._valueTracker||(s._valueTracker=ue(s))}function Ce(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var u=a.getValue(),m="";return s&&(m=Z(s)?s.checked?"true":"false":s.value),s=m,s!==u?(a.setValue(s),!0):!1}function Re(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function tt(s,a){var u=a.checked;return M({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??s._wrapperState.initialChecked})}function Ge(s,a){var u=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;u=G(a.value!=null?a.value:u),s._wrapperState={initialChecked:m,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function nt(s,a){a=a.checked,a!=null&&O(s,"checked",a,!1)}function we(s,a){nt(s,a);var u=G(a.value),m=a.type;if(u!=null)m==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+u):s.value!==""+u&&(s.value=""+u);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?oe(s,a.type,u):a.hasOwnProperty("defaultValue")&&oe(s,a.type,G(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function je(s,a,u){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var m=a.type;if(!(m!=="submit"&&m!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,u||a===s.value||(s.value=a),s.defaultValue=a}u=s.name,u!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,u!==""&&(s.name=u)}function oe(s,a,u){(a!=="number"||Re(s.ownerDocument)!==s)&&(u==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+u&&(s.defaultValue=""+u))}var re=Array.isArray;function xe(s,a,u,m){if(s=s.options,a){a={};for(var x=0;x<u.length;x++)a["$"+u[x]]=!0;for(u=0;u<s.length;u++)x=a.hasOwnProperty("$"+s[u].value),s[u].selected!==x&&(s[u].selected=x),x&&m&&(s[u].defaultSelected=!0)}else{for(u=""+G(u),a=null,x=0;x<s.length;x++){if(s[x].value===u){s[x].selected=!0,m&&(s[x].defaultSelected=!0);return}a!==null||s[x].disabled||(a=s[x])}a!==null&&(a.selected=!0)}}function Oe(s,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return M({},a,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function qe(s,a){var u=a.value;if(u==null){if(u=a.children,a=a.defaultValue,u!=null){if(a!=null)throw Error(n(92));if(re(u)){if(1<u.length)throw Error(n(93));u=u[0]}a=u}a==null&&(a=""),u=a}s._wrapperState={initialValue:G(u)}}function pt(s,a){var u=G(a.value),m=G(a.defaultValue);u!=null&&(u=""+u,u!==s.value&&(s.value=u),a.defaultValue==null&&s.defaultValue!==u&&(s.defaultValue=u)),m!=null&&(s.defaultValue=""+m)}function yt(s){var a=s.textContent;a===s._wrapperState.initialValue&&a!==""&&a!==null&&(s.value=a)}function ce(s){switch(s){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 be(s,a){return s==null||s==="http://www.w3.org/1999/xhtml"?ce(a):s==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var Le,rt=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,u,m,x){MSApp.execUnsafeLocalFunction(function(){return s(a,u,m,x)})}:s})(function(s,a){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=a;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Le.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function ot(s,a){if(a){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=a;return}}s.textContent=a}var gt={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},Zt=["Webkit","ms","Moz","O"];Object.keys(gt).forEach(function(s){Zt.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),gt[a]=gt[s]})});function hn(s,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||gt.hasOwnProperty(s)&&gt[s]?(""+a).trim():a+"px"}function Dn(s,a){s=s.style;for(var u in a)if(a.hasOwnProperty(u)){var m=u.indexOf("--")===0,x=hn(u,a[u],m);u==="float"&&(u="cssFloat"),m?s.setProperty(u,x):s[u]=x}}var Yn=M({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 Wt(s,a){if(a){if(Yn[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(n(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(n(61))}if(a.style!=null&&typeof a.style!="object")throw Error(n(62))}}function It(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){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 yn=null;function Dr(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ke=null,ut=null,Ie=null;function Ue(s){if(s=Xi(s)){if(typeof Ke!="function")throw Error(n(280));var a=s.stateNode;a&&(a=Pu(a),Ke(s.stateNode,s.type,a))}}function ft(s){ut?Ie?Ie.push(s):Ie=[s]:ut=s}function ze(){if(ut){var s=ut,a=Ie;if(Ie=ut=null,Ue(s),a)for(s=0;s<a.length;s++)Ue(a[s])}}function Yt(s,a){return s(a)}function en(){}var tn=!1;function $t(s,a,u){if(tn)return s(a,u);tn=!0;try{return Yt(s,a,u)}finally{tn=!1,(ut!==null||Ie!==null)&&(en(),ze())}}function nn(s,a){var u=s.stateNode;if(u===null)return null;var m=Pu(u);if(m===null)return null;u=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(n(231,a,typeof u));return u}var On=!1;if(c)try{var $n={};Object.defineProperty($n,"passive",{get:function(){On=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{On=!1}function $r(s,a,u,m,x,w,R,Y,K){var fe=Array.prototype.slice.call(arguments,3);try{a.apply(u,fe)}catch(Te){this.onError(Te)}}var We=!1,lt=null,Xe=!1,mt=null,_t={onError:function(s){We=!0,lt=s}};function wt(s,a,u,m,x,w,R,Y,K){We=!1,lt=null,$r.apply(_t,arguments)}function Lt(s,a,u,m,x,w,R,Y,K){if(wt.apply(this,arguments),We){if(We){var fe=lt;We=!1,lt=null}else throw Error(n(198));Xe||(Xe=!0,mt=fe)}}function Rt(s){var a=s,u=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(u=a.return),s=a.return;while(s)}return a.tag===3?u:null}function Mt(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function gn(s){if(Rt(s)!==s)throw Error(n(188))}function xa(s){var a=s.alternate;if(!a){if(a=Rt(s),a===null)throw Error(n(188));return a!==s?null:s}for(var u=s,m=a;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(m=x.return,m!==null){u=m;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return gn(x),s;if(w===m)return gn(x),a;w=w.sibling}throw Error(n(188))}if(u.return!==m.return)u=x,m=w;else{for(var R=!1,Y=x.child;Y;){if(Y===u){R=!0,u=x,m=w;break}if(Y===m){R=!0,m=x,u=w;break}Y=Y.sibling}if(!R){for(Y=w.child;Y;){if(Y===u){R=!0,u=w,m=x;break}if(Y===m){R=!0,m=w,u=x;break}Y=Y.sibling}if(!R)throw Error(n(189))}}if(u.alternate!==m)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?s:a}function pr(s){return s=xa(s),s!==null?Ps(s):null}function Ps(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=Ps(s);if(a!==null)return a;s=s.sibling}return null}var No=t.unstable_scheduleCallback,Pt=t.unstable_cancelCallback,Ii=t.unstable_shouldYield,va=t.unstable_requestPaint,jt=t.unstable_now,pu=t.unstable_getCurrentPriorityLevel,Do=t.unstable_ImmediatePriority,up=t.unstable_UserBlockingPriority,yu=t.unstable_NormalPriority,nT=t.unstable_LowPriority,cp=t.unstable_IdlePriority,gu=null,qr=null;function rT(s){if(qr&&typeof qr.onCommitFiberRoot=="function")try{qr.onCommitFiberRoot(gu,s,void 0,(s.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:aT,sT=Math.log,oT=Math.LN2;function aT(s){return s>>>=0,s===0?32:31-(sT(s)/oT|0)|0}var bu=64,xu=4194304;function Mi(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function vu(s,a){var u=s.pendingLanes;if(u===0)return 0;var m=0,x=s.suspendedLanes,w=s.pingedLanes,R=u&268435455;if(R!==0){var Y=R&~x;Y!==0?m=Mi(Y):(w&=R,w!==0&&(m=Mi(w)))}else R=u&~x,R!==0?m=Mi(R):w!==0&&(m=Mi(w));if(m===0)return 0;if(a!==0&&a!==m&&(a&x)===0&&(x=m&-m,w=a&-a,x>=w||x===16&&(w&4194240)!==0))return a;if((m&4)!==0&&(m|=u&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=m;0<a;)u=31-Or(a),x=1<<u,m|=s[u],a&=~x;return m}function iT(s,a){switch(s){case 1:case 2:case 4:return a+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 a+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 lT(s,a){for(var u=s.suspendedLanes,m=s.pingedLanes,x=s.expirationTimes,w=s.pendingLanes;0<w;){var R=31-Or(w),Y=1<<R,K=x[R];K===-1?((Y&u)===0||(Y&m)!==0)&&(x[R]=iT(Y,a)):K<=a&&(s.expiredLanes|=Y),w&=~Y}}function Qd(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function dp(){var s=bu;return bu<<=1,(bu&4194240)===0&&(bu=64),s}function Gd(s){for(var a=[],u=0;31>u;u++)a.push(s);return a}function Li(s,a,u){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Or(a),s[a]=u}function uT(s,a){var u=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<u;){var x=31-Or(u),w=1<<x;a[x]=0,m[x]=-1,s[x]=-1,u&=~w}}function Kd(s,a){var u=s.entangledLanes|=a;for(s=s.entanglements;u;){var m=31-Or(u),x=1<<m;x&a|s[m]&a&&(s[m]|=a),u&=~x}}var Ot=0;function fp(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var hp,Xd,mp,pp,yp,Jd=!1,Eu=[],js=null,Fs=null,Bs=null,Ri=new Map,Pi=new Map,Hs=[],cT="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 gp(s,a){switch(s){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":Fs=null;break;case"mouseover":case"mouseout":Bs=null;break;case"pointerover":case"pointerout":Ri.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pi.delete(a.pointerId)}}function ji(s,a,u,m,x,w){return s===null||s.nativeEvent!==w?(s={blockedOn:a,domEventName:u,eventSystemFlags:m,nativeEvent:w,targetContainers:[x]},a!==null&&(a=Xi(a),a!==null&&Xd(a)),s):(s.eventSystemFlags|=m,a=s.targetContainers,x!==null&&a.indexOf(x)===-1&&a.push(x),s)}function dT(s,a,u,m,x){switch(a){case"focusin":return js=ji(js,s,a,u,m,x),!0;case"dragenter":return Fs=ji(Fs,s,a,u,m,x),!0;case"mouseover":return Bs=ji(Bs,s,a,u,m,x),!0;case"pointerover":var w=x.pointerId;return Ri.set(w,ji(Ri.get(w)||null,s,a,u,m,x)),!0;case"gotpointercapture":return w=x.pointerId,Pi.set(w,ji(Pi.get(w)||null,s,a,u,m,x)),!0}return!1}function bp(s){var a=Oo(s.target);if(a!==null){var u=Rt(a);if(u!==null){if(a=u.tag,a===13){if(a=Mt(u),a!==null){s.blockedOn=a,yp(s.priority,function(){mp(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Tu(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var u=ef(s.domEventName,s.eventSystemFlags,a[0],s.nativeEvent);if(u===null){u=s.nativeEvent;var m=new u.constructor(u.type,u);yn=m,u.target.dispatchEvent(m),yn=null}else return a=Xi(u),a!==null&&Xd(a),s.blockedOn=u,!1;a.shift()}return!0}function xp(s,a,u){Tu(s)&&u.delete(a)}function fT(){Jd=!1,js!==null&&Tu(js)&&(js=null),Fs!==null&&Tu(Fs)&&(Fs=null),Bs!==null&&Tu(Bs)&&(Bs=null),Ri.forEach(xp),Pi.forEach(xp)}function Fi(s,a){s.blockedOn===a&&(s.blockedOn=null,Jd||(Jd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,fT)))}function Bi(s){function a(x){return Fi(x,s)}if(0<Eu.length){Fi(Eu[0],s);for(var u=1;u<Eu.length;u++){var m=Eu[u];m.blockedOn===s&&(m.blockedOn=null)}}for(js!==null&&Fi(js,s),Fs!==null&&Fi(Fs,s),Bs!==null&&Fi(Bs,s),Ri.forEach(a),Pi.forEach(a),u=0;u<Hs.length;u++)m=Hs[u],m.blockedOn===s&&(m.blockedOn=null);for(;0<Hs.length&&(u=Hs[0],u.blockedOn===null);)bp(u),u.blockedOn===null&&Hs.shift()}var Ea=I.ReactCurrentBatchConfig,wu=!0;function hT(s,a,u,m){var x=Ot,w=Ea.transition;Ea.transition=null;try{Ot=1,Zd(s,a,u,m)}finally{Ot=x,Ea.transition=w}}function mT(s,a,u,m){var x=Ot,w=Ea.transition;Ea.transition=null;try{Ot=4,Zd(s,a,u,m)}finally{Ot=x,Ea.transition=w}}function Zd(s,a,u,m){if(wu){var x=ef(s,a,u,m);if(x===null)bf(s,a,m,Su,u),gp(s,m);else if(dT(x,s,a,u,m))m.stopPropagation();else if(gp(s,m),a&4&&-1<cT.indexOf(s)){for(;x!==null;){var w=Xi(x);if(w!==null&&hp(w),w=ef(s,a,u,m),w===null&&bf(s,a,m,Su,u),w===x)break;x=w}x!==null&&m.stopPropagation()}else bf(s,a,m,null,u)}}var Su=null;function ef(s,a,u,m){if(Su=null,s=Dr(m),s=Oo(s),s!==null)if(a=Rt(s),a===null)s=null;else if(u=a.tag,u===13){if(s=Mt(a),s!==null)return s;s=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null);return Su=s,null}function vp(s){switch(s){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(pu()){case Do:return 1;case up:return 4;case yu:case nT:return 16;case cp:return 536870912;default:return 16}default:return 16}}var Us=null,tf=null,ku=null;function Ep(){if(ku)return ku;var s,a=tf,u=a.length,m,x="value"in Us?Us.value:Us.textContent,w=x.length;for(s=0;s<u&&a[s]===x[s];s++);var R=u-s;for(m=1;m<=R&&a[u-m]===x[w-m];m++);return ku=x.slice(s,1<m?1-m:void 0)}function Cu(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function _u(){return!0}function Tp(){return!1}function or(s){function a(u,m,x,w,R){this._reactName=u,this._targetInst=x,this.type=m,this.nativeEvent=w,this.target=R,this.currentTarget=null;for(var Y in s)s.hasOwnProperty(Y)&&(u=s[Y],this[Y]=u?u(w):w[Y]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?_u:Tp,this.isPropagationStopped=Tp,this}return M(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=_u)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=_u)},persist:function(){},isPersistent:_u}),a}var Ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nf=or(Ta),Hi=M({},Ta,{view:0,detail:0}),pT=or(Hi),rf,sf,Ui,Nu=M({},Hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:af,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ui&&(Ui&&s.type==="mousemove"?(rf=s.screenX-Ui.screenX,sf=s.screenY-Ui.screenY):sf=rf=0,Ui=s),rf)},movementY:function(s){return"movementY"in s?s.movementY:sf}}),wp=or(Nu),yT=M({},Nu,{dataTransfer:0}),gT=or(yT),bT=M({},Hi,{relatedTarget:0}),of=or(bT),xT=M({},Ta,{animationName:0,elapsedTime:0,pseudoElement:0}),vT=or(xT),ET=M({},Ta,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),TT=or(ET),wT=M({},Ta,{data:0}),Sp=or(wT),ST={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kT={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"},CT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _T(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=CT[s])?!!a[s]:!1}function af(){return _T}var NT=M({},Hi,{key:function(s){if(s.key){var a=ST[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=Cu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?kT[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:af,charCode:function(s){return s.type==="keypress"?Cu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Cu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),DT=or(NT),OT=M({},Nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kp=or(OT),AT=M({},Hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:af}),IT=or(AT),MT=M({},Ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),LT=or(MT),RT=M({},Nu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),PT=or(RT),jT=[9,13,27,32],lf=c&&"CompositionEvent"in window,zi=null;c&&"documentMode"in document&&(zi=document.documentMode);var FT=c&&"TextEvent"in window&&!zi,Cp=c&&(!lf||zi&&8<zi&&11>=zi),_p=" ",Np=!1;function Dp(s,a){switch(s){case"keyup":return jT.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Op(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var wa=!1;function BT(s,a){switch(s){case"compositionend":return Op(a);case"keypress":return a.which!==32?null:(Np=!0,_p);case"textInput":return s=a.data,s===_p&&Np?null:s;default:return null}}function HT(s,a){if(wa)return s==="compositionend"||!lf&&Dp(s,a)?(s=Ep(),ku=tf=Us=null,wa=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Cp&&a.locale!=="ko"?null:a.data;default:return null}}var UT={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 Ap(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!UT[s.type]:a==="textarea"}function Ip(s,a,u,m){ft(m),a=Mu(a,"onChange"),0<a.length&&(u=new nf("onChange","change",null,u,m),s.push({event:u,listeners:a}))}var Wi=null,Yi=null;function zT(s){Kp(s,0)}function Du(s){var a=Na(s);if(Ce(a))return s}function WT(s,a){if(s==="change")return a}var Mp=!1;if(c){var uf;if(c){var cf="oninput"in document;if(!cf){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),cf=typeof Lp.oninput=="function"}uf=cf}else uf=!1;Mp=uf&&(!document.documentMode||9<document.documentMode)}function Rp(){Wi&&(Wi.detachEvent("onpropertychange",Pp),Yi=Wi=null)}function Pp(s){if(s.propertyName==="value"&&Du(Yi)){var a=[];Ip(a,Yi,s,Dr(s)),$t(zT,a)}}function YT(s,a,u){s==="focusin"?(Rp(),Wi=a,Yi=u,Wi.attachEvent("onpropertychange",Pp)):s==="focusout"&&Rp()}function $T(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Du(Yi)}function qT(s,a){if(s==="click")return Du(a)}function VT(s,a){if(s==="input"||s==="change")return Du(a)}function QT(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var Ar=typeof Object.is=="function"?Object.is:QT;function $i(s,a){if(Ar(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var u=Object.keys(s),m=Object.keys(a);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var x=u[m];if(!d.call(a,x)||!Ar(s[x],a[x]))return!1}return!0}function jp(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Fp(s,a){var u=jp(s);s=0;for(var m;u;){if(u.nodeType===3){if(m=s+u.textContent.length,s<=a&&m>=a)return{node:u,offset:a-s};s=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=jp(u)}}function Bp(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Bp(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function Hp(){for(var s=window,a=Re();a instanceof s.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)s=a.contentWindow;else break;a=Re(s.document)}return a}function df(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function GT(s){var a=Hp(),u=s.focusedElem,m=s.selectionRange;if(a!==u&&u&&u.ownerDocument&&Bp(u.ownerDocument.documentElement,u)){if(m!==null&&df(u)){if(a=m.start,s=m.end,s===void 0&&(s=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(s,u.value.length);else if(s=(a=u.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var x=u.textContent.length,w=Math.min(m.start,x);m=m.end===void 0?w:Math.min(m.end,x),!s.extend&&w>m&&(x=m,m=w,w=x),x=Fp(u,w);var R=Fp(u,m);x&&R&&(s.rangeCount!==1||s.anchorNode!==x.node||s.anchorOffset!==x.offset||s.focusNode!==R.node||s.focusOffset!==R.offset)&&(a=a.createRange(),a.setStart(x.node,x.offset),s.removeAllRanges(),w>m?(s.addRange(a),s.extend(R.node,R.offset)):(a.setEnd(R.node,R.offset),s.addRange(a)))}}for(a=[],s=u;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<a.length;u++)s=a[u],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var KT=c&&"documentMode"in document&&11>=document.documentMode,Sa=null,ff=null,qi=null,hf=!1;function Up(s,a,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;hf||Sa==null||Sa!==Re(m)||(m=Sa,"selectionStart"in m&&df(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),qi&&$i(qi,m)||(qi=m,m=Mu(ff,"onSelect"),0<m.length&&(a=new nf("onSelect","select",null,a,u),s.push({event:a,listeners:m}),a.target=Sa)))}function Ou(s,a){var u={};return u[s.toLowerCase()]=a.toLowerCase(),u["Webkit"+s]="webkit"+a,u["Moz"+s]="moz"+a,u}var ka={animationend:Ou("Animation","AnimationEnd"),animationiteration:Ou("Animation","AnimationIteration"),animationstart:Ou("Animation","AnimationStart"),transitionend:Ou("Transition","TransitionEnd")},mf={},zp={};c&&(zp=document.createElement("div").style,"AnimationEvent"in window||(delete ka.animationend.animation,delete ka.animationiteration.animation,delete ka.animationstart.animation),"TransitionEvent"in window||delete ka.transitionend.transition);function Au(s){if(mf[s])return mf[s];if(!ka[s])return s;var a=ka[s],u;for(u in a)if(a.hasOwnProperty(u)&&u in zp)return mf[s]=a[u];return s}var Wp=Au("animationend"),Yp=Au("animationiteration"),$p=Au("animationstart"),qp=Au("transitionend"),Vp=new Map,Qp="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 zs(s,a){Vp.set(s,a),i(a,[s])}for(var pf=0;pf<Qp.length;pf++){var yf=Qp[pf],XT=yf.toLowerCase(),JT=yf[0].toUpperCase()+yf.slice(1);zs(XT,"on"+JT)}zs(Wp,"onAnimationEnd"),zs(Yp,"onAnimationIteration"),zs($p,"onAnimationStart"),zs("dblclick","onDoubleClick"),zs("focusin","onFocus"),zs("focusout","onBlur"),zs(qp,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vi="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(" "),ZT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vi));function Gp(s,a,u){var m=s.type||"unknown-event";s.currentTarget=u,Lt(m,a,void 0,s),s.currentTarget=null}function Kp(s,a){a=(a&4)!==0;for(var u=0;u<s.length;u++){var m=s[u],x=m.event;m=m.listeners;e:{var w=void 0;if(a)for(var R=m.length-1;0<=R;R--){var Y=m[R],K=Y.instance,fe=Y.currentTarget;if(Y=Y.listener,K!==w&&x.isPropagationStopped())break e;Gp(x,Y,fe),w=K}else for(R=0;R<m.length;R++){if(Y=m[R],K=Y.instance,fe=Y.currentTarget,Y=Y.listener,K!==w&&x.isPropagationStopped())break e;Gp(x,Y,fe),w=K}}}if(Xe)throw s=mt,Xe=!1,mt=null,s}function Ut(s,a){var u=a[Sf];u===void 0&&(u=a[Sf]=new Set);var m=s+"__bubble";u.has(m)||(Xp(a,s,2,!1),u.add(m))}function gf(s,a,u){var m=0;a&&(m|=4),Xp(u,s,m,a)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function Qi(s){if(!s[Iu]){s[Iu]=!0,r.forEach(function(u){u!=="selectionchange"&&(ZT.has(u)||gf(u,!1,s),gf(u,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Iu]||(a[Iu]=!0,gf("selectionchange",!1,a))}}function Xp(s,a,u,m){switch(vp(a)){case 1:var x=hT;break;case 4:x=mT;break;default:x=Zd}u=x.bind(null,a,u,s),x=void 0,!On||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(x=!0),m?x!==void 0?s.addEventListener(a,u,{capture:!0,passive:x}):s.addEventListener(a,u,!0):x!==void 0?s.addEventListener(a,u,{passive:x}):s.addEventListener(a,u,!1)}function bf(s,a,u,m,x){var w=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var R=m.tag;if(R===3||R===4){var Y=m.stateNode.containerInfo;if(Y===x||Y.nodeType===8&&Y.parentNode===x)break;if(R===4)for(R=m.return;R!==null;){var K=R.tag;if((K===3||K===4)&&(K=R.stateNode.containerInfo,K===x||K.nodeType===8&&K.parentNode===x))return;R=R.return}for(;Y!==null;){if(R=Oo(Y),R===null)return;if(K=R.tag,K===5||K===6){m=w=R;continue e}Y=Y.parentNode}}m=m.return}$t(function(){var fe=w,Te=Dr(u),Se=[];e:{var ve=Vp.get(s);if(ve!==void 0){var Pe=nf,Ye=s;switch(s){case"keypress":if(Cu(u)===0)break e;case"keydown":case"keyup":Pe=DT;break;case"focusin":Ye="focus",Pe=of;break;case"focusout":Ye="blur",Pe=of;break;case"beforeblur":case"afterblur":Pe=of;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=wp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=gT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=IT;break;case Wp:case Yp:case $p:Pe=vT;break;case qp:Pe=LT;break;case"scroll":Pe=pT;break;case"wheel":Pe=PT;break;case"copy":case"cut":case"paste":Pe=TT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=kp}var $e=(a&4)!==0,ln=!$e&&s==="scroll",ee=$e?ve!==null?ve+"Capture":null:ve;$e=[];for(var J=fe,se;J!==null;){se=J;var De=se.stateNode;if(se.tag===5&&De!==null&&(se=De,ee!==null&&(De=nn(J,ee),De!=null&&$e.push(Gi(J,De,se)))),ln)break;J=J.return}0<$e.length&&(ve=new Pe(ve,Ye,null,u,Te),Se.push({event:ve,listeners:$e}))}}if((a&7)===0){e:{if(ve=s==="mouseover"||s==="pointerover",Pe=s==="mouseout"||s==="pointerout",ve&&u!==yn&&(Ye=u.relatedTarget||u.fromElement)&&(Oo(Ye)||Ye[hs]))break e;if((Pe||ve)&&(ve=Te.window===Te?Te:(ve=Te.ownerDocument)?ve.defaultView||ve.parentWindow:window,Pe?(Ye=u.relatedTarget||u.toElement,Pe=fe,Ye=Ye?Oo(Ye):null,Ye!==null&&(ln=Rt(Ye),Ye!==ln||Ye.tag!==5&&Ye.tag!==6)&&(Ye=null)):(Pe=null,Ye=fe),Pe!==Ye)){if($e=wp,De="onMouseLeave",ee="onMouseEnter",J="mouse",(s==="pointerout"||s==="pointerover")&&($e=kp,De="onPointerLeave",ee="onPointerEnter",J="pointer"),ln=Pe==null?ve:Na(Pe),se=Ye==null?ve:Na(Ye),ve=new $e(De,J+"leave",Pe,u,Te),ve.target=ln,ve.relatedTarget=se,De=null,Oo(Te)===fe&&($e=new $e(ee,J+"enter",Ye,u,Te),$e.target=se,$e.relatedTarget=ln,De=$e),ln=De,Pe&&Ye)t:{for($e=Pe,ee=Ye,J=0,se=$e;se;se=Ca(se))J++;for(se=0,De=ee;De;De=Ca(De))se++;for(;0<J-se;)$e=Ca($e),J--;for(;0<se-J;)ee=Ca(ee),se--;for(;J--;){if($e===ee||ee!==null&&$e===ee.alternate)break t;$e=Ca($e),ee=Ca(ee)}$e=null}else $e=null;Pe!==null&&Jp(Se,ve,Pe,$e,!1),Ye!==null&&ln!==null&&Jp(Se,ln,Ye,$e,!0)}}e:{if(ve=fe?Na(fe):window,Pe=ve.nodeName&&ve.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&ve.type==="file")var Ve=WT;else if(Ap(ve))if(Mp)Ve=VT;else{Ve=$T;var Ze=YT}else(Pe=ve.nodeName)&&Pe.toLowerCase()==="input"&&(ve.type==="checkbox"||ve.type==="radio")&&(Ve=qT);if(Ve&&(Ve=Ve(s,fe))){Ip(Se,Ve,u,Te);break e}Ze&&Ze(s,ve,fe),s==="focusout"&&(Ze=ve._wrapperState)&&Ze.controlled&&ve.type==="number"&&oe(ve,"number",ve.value)}switch(Ze=fe?Na(fe):window,s){case"focusin":(Ap(Ze)||Ze.contentEditable==="true")&&(Sa=Ze,ff=fe,qi=null);break;case"focusout":qi=ff=Sa=null;break;case"mousedown":hf=!0;break;case"contextmenu":case"mouseup":case"dragend":hf=!1,Up(Se,u,Te);break;case"selectionchange":if(KT)break;case"keydown":case"keyup":Up(Se,u,Te)}var et;if(lf)e:{switch(s){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else wa?Dp(s,u)&&(at="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(at="onCompositionStart");at&&(Cp&&u.locale!=="ko"&&(wa||at!=="onCompositionStart"?at==="onCompositionEnd"&&wa&&(et=Ep()):(Us=Te,tf="value"in Us?Us.value:Us.textContent,wa=!0)),Ze=Mu(fe,at),0<Ze.length&&(at=new Sp(at,s,null,u,Te),Se.push({event:at,listeners:Ze}),et?at.data=et:(et=Op(u),et!==null&&(at.data=et)))),(et=FT?BT(s,u):HT(s,u))&&(fe=Mu(fe,"onBeforeInput"),0<fe.length&&(Te=new Sp("onBeforeInput","beforeinput",null,u,Te),Se.push({event:Te,listeners:fe}),Te.data=et))}Kp(Se,a)})}function Gi(s,a,u){return{instance:s,listener:a,currentTarget:u}}function Mu(s,a){for(var u=a+"Capture",m=[];s!==null;){var x=s,w=x.stateNode;x.tag===5&&w!==null&&(x=w,w=nn(s,u),w!=null&&m.unshift(Gi(s,w,x)),w=nn(s,a),w!=null&&m.push(Gi(s,w,x))),s=s.return}return m}function Ca(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Jp(s,a,u,m,x){for(var w=a._reactName,R=[];u!==null&&u!==m;){var Y=u,K=Y.alternate,fe=Y.stateNode;if(K!==null&&K===m)break;Y.tag===5&&fe!==null&&(Y=fe,x?(K=nn(u,w),K!=null&&R.unshift(Gi(u,K,Y))):x||(K=nn(u,w),K!=null&&R.push(Gi(u,K,Y)))),u=u.return}R.length!==0&&s.push({event:a,listeners:R})}var ew=/\r\n?/g,tw=/\u0000|\uFFFD/g;function Zp(s){return(typeof s=="string"?s:""+s).replace(ew,`
31
+ `).replace(tw,"")}function Lu(s,a,u){if(a=Zp(a),Zp(s)!==a&&u)throw Error(n(425))}function Ru(){}var xf=null,vf=null;function Ef(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Tf=typeof setTimeout=="function"?setTimeout:void 0,nw=typeof clearTimeout=="function"?clearTimeout:void 0,ey=typeof Promise=="function"?Promise:void 0,rw=typeof queueMicrotask=="function"?queueMicrotask:typeof ey<"u"?function(s){return ey.resolve(null).then(s).catch(sw)}:Tf;function sw(s){setTimeout(function(){throw s})}function wf(s,a){var u=a,m=0;do{var x=u.nextSibling;if(s.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"){if(m===0){s.removeChild(x),Bi(a);return}m--}else u!=="$"&&u!=="$?"&&u!=="$!"||m++;u=x}while(u);Bi(a)}function Ws(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return s}function ty(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return s;a--}else u==="/$"&&a++}s=s.previousSibling}return null}var _a=Math.random().toString(36).slice(2),Vr="__reactFiber$"+_a,Ki="__reactProps$"+_a,hs="__reactContainer$"+_a,Sf="__reactEvents$"+_a,ow="__reactListeners$"+_a,aw="__reactHandles$"+_a;function Oo(s){var a=s[Vr];if(a)return a;for(var u=s.parentNode;u;){if(a=u[hs]||u[Vr]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(s=ty(s);s!==null;){if(u=s[Vr])return u;s=ty(s)}return a}s=u,u=s.parentNode}return null}function Xi(s){return s=s[Vr]||s[hs],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Na(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function Pu(s){return s[Ki]||null}var kf=[],Da=-1;function Ys(s){return{current:s}}function zt(s){0>Da||(s.current=kf[Da],kf[Da]=null,Da--)}function Ft(s,a){Da++,kf[Da]=s.current,s.current=a}var $s={},An=Ys($s),qn=Ys(!1),Ao=$s;function Oa(s,a){var u=s.type.contextTypes;if(!u)return $s;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var x={},w;for(w in u)x[w]=a[w];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=x),x}function Vn(s){return s=s.childContextTypes,s!=null}function ju(){zt(qn),zt(An)}function ny(s,a,u){if(An.current!==$s)throw Error(n(168));Ft(An,a),Ft(qn,u)}function ry(s,a,u){var m=s.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return u;m=m.getChildContext();for(var x in m)if(!(x in a))throw Error(n(108,Ne(s)||"Unknown",x));return M({},u,m)}function Fu(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||$s,Ao=An.current,Ft(An,s),Ft(qn,qn.current),!0}function sy(s,a,u){var m=s.stateNode;if(!m)throw Error(n(169));u?(s=ry(s,a,Ao),m.__reactInternalMemoizedMergedChildContext=s,zt(qn),zt(An),Ft(An,s)):zt(qn),Ft(qn,u)}var ms=null,Bu=!1,Cf=!1;function oy(s){ms===null?ms=[s]:ms.push(s)}function iw(s){Bu=!0,oy(s)}function qs(){if(!Cf&&ms!==null){Cf=!0;var s=0,a=Ot;try{var u=ms;for(Ot=1;s<u.length;s++){var m=u[s];do m=m(!0);while(m!==null)}ms=null,Bu=!1}catch(x){throw ms!==null&&(ms=ms.slice(s+1)),No(Do,qs),x}finally{Ot=a,Cf=!1}}return null}var Aa=[],Ia=0,Hu=null,Uu=0,yr=[],gr=0,Io=null,ps=1,ys="";function Mo(s,a){Aa[Ia++]=Uu,Aa[Ia++]=Hu,Hu=s,Uu=a}function ay(s,a,u){yr[gr++]=ps,yr[gr++]=ys,yr[gr++]=Io,Io=s;var m=ps;s=ys;var x=32-Or(m)-1;m&=~(1<<x),u+=1;var w=32-Or(a)+x;if(30<w){var R=x-x%5;w=(m&(1<<R)-1).toString(32),m>>=R,x-=R,ps=1<<32-Or(a)+x|u<<x|m,ys=w+s}else ps=1<<w|u<<x|m,ys=s}function _f(s){s.return!==null&&(Mo(s,1),ay(s,1,0))}function Nf(s){for(;s===Hu;)Hu=Aa[--Ia],Aa[Ia]=null,Uu=Aa[--Ia],Aa[Ia]=null;for(;s===Io;)Io=yr[--gr],yr[gr]=null,ys=yr[--gr],yr[gr]=null,ps=yr[--gr],yr[gr]=null}var ar=null,ir=null,qt=!1,Ir=null;function iy(s,a){var u=Er(5,null,null,0);u.elementType="DELETED",u.stateNode=a,u.return=s,a=s.deletions,a===null?(s.deletions=[u],s.flags|=16):a.push(u)}function ly(s,a){switch(s.tag){case 5:var u=s.type;return a=a.nodeType!==1||u.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(s.stateNode=a,ar=s,ir=Ws(a.firstChild),!0):!1;case 6:return a=s.pendingProps===""||a.nodeType!==3?null:a,a!==null?(s.stateNode=a,ar=s,ir=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(u=Io!==null?{id:ps,overflow:ys}:null,s.memoizedState={dehydrated:a,treeContext:u,retryLane:1073741824},u=Er(18,null,null,0),u.stateNode=a,u.return=s,s.child=u,ar=s,ir=null,!0):!1;default:return!1}}function Df(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Of(s){if(qt){var a=ir;if(a){var u=a;if(!ly(s,a)){if(Df(s))throw Error(n(418));a=Ws(u.nextSibling);var m=ar;a&&ly(s,a)?iy(m,u):(s.flags=s.flags&-4097|2,qt=!1,ar=s)}}else{if(Df(s))throw Error(n(418));s.flags=s.flags&-4097|2,qt=!1,ar=s}}}function uy(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;ar=s}function zu(s){if(s!==ar)return!1;if(!qt)return uy(s),qt=!0,!1;var a;if((a=s.tag!==3)&&!(a=s.tag!==5)&&(a=s.type,a=a!=="head"&&a!=="body"&&!Ef(s.type,s.memoizedProps)),a&&(a=ir)){if(Df(s))throw cy(),Error(n(418));for(;a;)iy(s,a),a=Ws(a.nextSibling)}if(uy(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"){if(a===0){ir=Ws(s.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++}s=s.nextSibling}ir=null}}else ir=ar?Ws(s.stateNode.nextSibling):null;return!0}function cy(){for(var s=ir;s;)s=Ws(s.nextSibling)}function Ma(){ir=ar=null,qt=!1}function Af(s){Ir===null?Ir=[s]:Ir.push(s)}var lw=I.ReactCurrentBatchConfig;function Ji(s,a,u){if(s=u.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var m=u.stateNode}if(!m)throw Error(n(147,s));var x=m,w=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===w?a.ref:(a=function(R){var Y=x.refs;R===null?delete Y[w]:Y[w]=R},a._stringRef=w,a)}if(typeof s!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,s))}return s}function Wu(s,a){throw s=Object.prototype.toString.call(a),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function dy(s){var a=s._init;return a(s._payload)}function fy(s){function a(ee,J){if(s){var se=ee.deletions;se===null?(ee.deletions=[J],ee.flags|=16):se.push(J)}}function u(ee,J){if(!s)return null;for(;J!==null;)a(ee,J),J=J.sibling;return null}function m(ee,J){for(ee=new Map;J!==null;)J.key!==null?ee.set(J.key,J):ee.set(J.index,J),J=J.sibling;return ee}function x(ee,J){return ee=eo(ee,J),ee.index=0,ee.sibling=null,ee}function w(ee,J,se){return ee.index=se,s?(se=ee.alternate,se!==null?(se=se.index,se<J?(ee.flags|=2,J):se):(ee.flags|=2,J)):(ee.flags|=1048576,J)}function R(ee){return s&&ee.alternate===null&&(ee.flags|=2),ee}function Y(ee,J,se,De){return J===null||J.tag!==6?(J=Th(se,ee.mode,De),J.return=ee,J):(J=x(J,se),J.return=ee,J)}function K(ee,J,se,De){var Ve=se.type;return Ve===C?Te(ee,J,se.props.children,De,se.key):J!==null&&(J.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===ie&&dy(Ve)===J.type)?(De=x(J,se.props),De.ref=Ji(ee,J,se),De.return=ee,De):(De=hc(se.type,se.key,se.props,null,ee.mode,De),De.ref=Ji(ee,J,se),De.return=ee,De)}function fe(ee,J,se,De){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=wh(se,ee.mode,De),J.return=ee,J):(J=x(J,se.children||[]),J.return=ee,J)}function Te(ee,J,se,De,Ve){return J===null||J.tag!==7?(J=Uo(se,ee.mode,De,Ve),J.return=ee,J):(J=x(J,se),J.return=ee,J)}function Se(ee,J,se){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Th(""+J,ee.mode,se),J.return=ee,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case L:return se=hc(J.type,J.key,J.props,null,ee.mode,se),se.ref=Ji(ee,null,J),se.return=ee,se;case _:return J=wh(J,ee.mode,se),J.return=ee,J;case ie:var De=J._init;return Se(ee,De(J._payload),se)}if(re(J)||de(J))return J=Uo(J,ee.mode,se,null),J.return=ee,J;Wu(ee,J)}return null}function ve(ee,J,se,De){var Ve=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Ve!==null?null:Y(ee,J,""+se,De);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case L:return se.key===Ve?K(ee,J,se,De):null;case _:return se.key===Ve?fe(ee,J,se,De):null;case ie:return Ve=se._init,ve(ee,J,Ve(se._payload),De)}if(re(se)||de(se))return Ve!==null?null:Te(ee,J,se,De,null);Wu(ee,se)}return null}function Pe(ee,J,se,De,Ve){if(typeof De=="string"&&De!==""||typeof De=="number")return ee=ee.get(se)||null,Y(J,ee,""+De,Ve);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case L:return ee=ee.get(De.key===null?se:De.key)||null,K(J,ee,De,Ve);case _:return ee=ee.get(De.key===null?se:De.key)||null,fe(J,ee,De,Ve);case ie:var Ze=De._init;return Pe(ee,J,se,Ze(De._payload),Ve)}if(re(De)||de(De))return ee=ee.get(se)||null,Te(J,ee,De,Ve,null);Wu(J,De)}return null}function Ye(ee,J,se,De){for(var Ve=null,Ze=null,et=J,at=J=0,Tn=null;et!==null&&at<se.length;at++){et.index>at?(Tn=et,et=null):Tn=et.sibling;var St=ve(ee,et,se[at],De);if(St===null){et===null&&(et=Tn);break}s&&et&&St.alternate===null&&a(ee,et),J=w(St,J,at),Ze===null?Ve=St:Ze.sibling=St,Ze=St,et=Tn}if(at===se.length)return u(ee,et),qt&&Mo(ee,at),Ve;if(et===null){for(;at<se.length;at++)et=Se(ee,se[at],De),et!==null&&(J=w(et,J,at),Ze===null?Ve=et:Ze.sibling=et,Ze=et);return qt&&Mo(ee,at),Ve}for(et=m(ee,et);at<se.length;at++)Tn=Pe(et,ee,at,se[at],De),Tn!==null&&(s&&Tn.alternate!==null&&et.delete(Tn.key===null?at:Tn.key),J=w(Tn,J,at),Ze===null?Ve=Tn:Ze.sibling=Tn,Ze=Tn);return s&&et.forEach(function(to){return a(ee,to)}),qt&&Mo(ee,at),Ve}function $e(ee,J,se,De){var Ve=de(se);if(typeof Ve!="function")throw Error(n(150));if(se=Ve.call(se),se==null)throw Error(n(151));for(var Ze=Ve=null,et=J,at=J=0,Tn=null,St=se.next();et!==null&&!St.done;at++,St=se.next()){et.index>at?(Tn=et,et=null):Tn=et.sibling;var to=ve(ee,et,St.value,De);if(to===null){et===null&&(et=Tn);break}s&&et&&to.alternate===null&&a(ee,et),J=w(to,J,at),Ze===null?Ve=to:Ze.sibling=to,Ze=to,et=Tn}if(St.done)return u(ee,et),qt&&Mo(ee,at),Ve;if(et===null){for(;!St.done;at++,St=se.next())St=Se(ee,St.value,De),St!==null&&(J=w(St,J,at),Ze===null?Ve=St:Ze.sibling=St,Ze=St);return qt&&Mo(ee,at),Ve}for(et=m(ee,et);!St.done;at++,St=se.next())St=Pe(et,ee,at,St.value,De),St!==null&&(s&&St.alternate!==null&&et.delete(St.key===null?at:St.key),J=w(St,J,at),Ze===null?Ve=St:Ze.sibling=St,Ze=St);return s&&et.forEach(function(Uw){return a(ee,Uw)}),qt&&Mo(ee,at),Ve}function ln(ee,J,se,De){if(typeof se=="object"&&se!==null&&se.type===C&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case L:e:{for(var Ve=se.key,Ze=J;Ze!==null;){if(Ze.key===Ve){if(Ve=se.type,Ve===C){if(Ze.tag===7){u(ee,Ze.sibling),J=x(Ze,se.props.children),J.return=ee,ee=J;break e}}else if(Ze.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===ie&&dy(Ve)===Ze.type){u(ee,Ze.sibling),J=x(Ze,se.props),J.ref=Ji(ee,Ze,se),J.return=ee,ee=J;break e}u(ee,Ze);break}else a(ee,Ze);Ze=Ze.sibling}se.type===C?(J=Uo(se.props.children,ee.mode,De,se.key),J.return=ee,ee=J):(De=hc(se.type,se.key,se.props,null,ee.mode,De),De.ref=Ji(ee,J,se),De.return=ee,ee=De)}return R(ee);case _:e:{for(Ze=se.key;J!==null;){if(J.key===Ze)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){u(ee,J.sibling),J=x(J,se.children||[]),J.return=ee,ee=J;break e}else{u(ee,J);break}else a(ee,J);J=J.sibling}J=wh(se,ee.mode,De),J.return=ee,ee=J}return R(ee);case ie:return Ze=se._init,ln(ee,J,Ze(se._payload),De)}if(re(se))return Ye(ee,J,se,De);if(de(se))return $e(ee,J,se,De);Wu(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,J!==null&&J.tag===6?(u(ee,J.sibling),J=x(J,se),J.return=ee,ee=J):(u(ee,J),J=Th(se,ee.mode,De),J.return=ee,ee=J),R(ee)):u(ee,J)}return ln}var La=fy(!0),hy=fy(!1),Yu=Ys(null),$u=null,Ra=null,If=null;function Mf(){If=Ra=$u=null}function Lf(s){var a=Yu.current;zt(Yu),s._currentValue=a}function Rf(s,a,u){for(;s!==null;){var m=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),s===u)break;s=s.return}}function Pa(s,a){$u=s,If=Ra=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&a)!==0&&(Qn=!0),s.firstContext=null)}function br(s){var a=s._currentValue;if(If!==s)if(s={context:s,memoizedValue:a,next:null},Ra===null){if($u===null)throw Error(n(308));Ra=s,$u.dependencies={lanes:0,firstContext:s}}else Ra=Ra.next=s;return a}var Lo=null;function Pf(s){Lo===null?Lo=[s]:Lo.push(s)}function my(s,a,u,m){var x=a.interleaved;return x===null?(u.next=u,Pf(a)):(u.next=x.next,x.next=u),a.interleaved=u,gs(s,m)}function gs(s,a){s.lanes|=a;var u=s.alternate;for(u!==null&&(u.lanes|=a),u=s,s=s.return;s!==null;)s.childLanes|=a,u=s.alternate,u!==null&&(u.childLanes|=a),u=s,s=s.return;return u.tag===3?u.stateNode:null}var Vs=!1;function jf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function py(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function bs(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function Qs(s,a,u){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(vt&2)!==0){var x=m.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),m.pending=a,gs(s,u)}return x=m.interleaved,x===null?(a.next=a,Pf(m)):(a.next=x.next,x.next=a),m.interleaved=a,gs(s,u)}function qu(s,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194240)!==0)){var m=a.lanes;m&=s.pendingLanes,u|=m,a.lanes=u,Kd(s,u)}}function yy(s,a){var u=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var R={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};w===null?x=w=R:w=w.next=R,u=u.next}while(u!==null);w===null?x=w=a:w=w.next=a}else x=w=a;u={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:m.shared,effects:m.effects},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=a:s.next=a,u.lastBaseUpdate=a}function Vu(s,a,u,m){var x=s.updateQueue;Vs=!1;var w=x.firstBaseUpdate,R=x.lastBaseUpdate,Y=x.shared.pending;if(Y!==null){x.shared.pending=null;var K=Y,fe=K.next;K.next=null,R===null?w=fe:R.next=fe,R=K;var Te=s.alternate;Te!==null&&(Te=Te.updateQueue,Y=Te.lastBaseUpdate,Y!==R&&(Y===null?Te.firstBaseUpdate=fe:Y.next=fe,Te.lastBaseUpdate=K))}if(w!==null){var Se=x.baseState;R=0,Te=fe=K=null,Y=w;do{var ve=Y.lane,Pe=Y.eventTime;if((m&ve)===ve){Te!==null&&(Te=Te.next={eventTime:Pe,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ye=s,$e=Y;switch(ve=a,Pe=u,$e.tag){case 1:if(Ye=$e.payload,typeof Ye=="function"){Se=Ye.call(Pe,Se,ve);break e}Se=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=$e.payload,ve=typeof Ye=="function"?Ye.call(Pe,Se,ve):Ye,ve==null)break e;Se=M({},Se,ve);break e;case 2:Vs=!0}}Y.callback!==null&&Y.lane!==0&&(s.flags|=64,ve=x.effects,ve===null?x.effects=[Y]:ve.push(Y))}else Pe={eventTime:Pe,lane:ve,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Te===null?(fe=Te=Pe,K=Se):Te=Te.next=Pe,R|=ve;if(Y=Y.next,Y===null){if(Y=x.shared.pending,Y===null)break;ve=Y,Y=ve.next,ve.next=null,x.lastBaseUpdate=ve,x.shared.pending=null}}while(!0);if(Te===null&&(K=Se),x.baseState=K,x.firstBaseUpdate=fe,x.lastBaseUpdate=Te,a=x.shared.interleaved,a!==null){x=a;do R|=x.lane,x=x.next;while(x!==a)}else w===null&&(x.shared.lanes=0);jo|=R,s.lanes=R,s.memoizedState=Se}}function gy(s,a,u){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var m=s[a],x=m.callback;if(x!==null){if(m.callback=null,m=u,typeof x!="function")throw Error(n(191,x));x.call(m)}}}var Zi={},Qr=Ys(Zi),el=Ys(Zi),tl=Ys(Zi);function Ro(s){if(s===Zi)throw Error(n(174));return s}function Ff(s,a){switch(Ft(tl,a),Ft(el,s),Ft(Qr,Zi),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:be(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=be(a,s)}zt(Qr),Ft(Qr,a)}function ja(){zt(Qr),zt(el),zt(tl)}function by(s){Ro(tl.current);var a=Ro(Qr.current),u=be(a,s.type);a!==u&&(Ft(el,s),Ft(Qr,u))}function Bf(s){el.current===s&&(zt(Qr),zt(el))}var Qt=Ys(0);function Qu(s){for(var a=s;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Hf=[];function Uf(){for(var s=0;s<Hf.length;s++)Hf[s]._workInProgressVersionPrimary=null;Hf.length=0}var Gu=I.ReactCurrentDispatcher,zf=I.ReactCurrentBatchConfig,Po=0,Gt=null,bn=null,vn=null,Ku=!1,nl=!1,rl=0,uw=0;function In(){throw Error(n(321))}function Wf(s,a){if(a===null)return!1;for(var u=0;u<a.length&&u<s.length;u++)if(!Ar(s[u],a[u]))return!1;return!0}function Yf(s,a,u,m,x,w){if(Po=w,Gt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Gu.current=s===null||s.memoizedState===null?hw:mw,s=u(m,x),nl){w=0;do{if(nl=!1,rl=0,25<=w)throw Error(n(301));w+=1,vn=bn=null,a.updateQueue=null,Gu.current=pw,s=u(m,x)}while(nl)}if(Gu.current=Zu,a=bn!==null&&bn.next!==null,Po=0,vn=bn=Gt=null,Ku=!1,a)throw Error(n(300));return s}function $f(){var s=rl!==0;return rl=0,s}function Gr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?Gt.memoizedState=vn=s:vn=vn.next=s,vn}function xr(){if(bn===null){var s=Gt.alternate;s=s!==null?s.memoizedState:null}else s=bn.next;var a=vn===null?Gt.memoizedState:vn.next;if(a!==null)vn=a,bn=s;else{if(s===null)throw Error(n(310));bn=s,s={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},vn===null?Gt.memoizedState=vn=s:vn=vn.next=s}return vn}function sl(s,a){return typeof a=="function"?a(s):a}function qf(s){var a=xr(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var m=bn,x=m.baseQueue,w=u.pending;if(w!==null){if(x!==null){var R=x.next;x.next=w.next,w.next=R}m.baseQueue=x=w,u.pending=null}if(x!==null){w=x.next,m=m.baseState;var Y=R=null,K=null,fe=w;do{var Te=fe.lane;if((Po&Te)===Te)K!==null&&(K=K.next={lane:0,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),m=fe.hasEagerState?fe.eagerState:s(m,fe.action);else{var Se={lane:Te,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null};K===null?(Y=K=Se,R=m):K=K.next=Se,Gt.lanes|=Te,jo|=Te}fe=fe.next}while(fe!==null&&fe!==w);K===null?R=m:K.next=Y,Ar(m,a.memoizedState)||(Qn=!0),a.memoizedState=m,a.baseState=R,a.baseQueue=K,u.lastRenderedState=m}if(s=u.interleaved,s!==null){x=s;do w=x.lane,Gt.lanes|=w,jo|=w,x=x.next;while(x!==s)}else x===null&&(u.lanes=0);return[a.memoizedState,u.dispatch]}function Vf(s){var a=xr(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=s;var m=u.dispatch,x=u.pending,w=a.memoizedState;if(x!==null){u.pending=null;var R=x=x.next;do w=s(w,R.action),R=R.next;while(R!==x);Ar(w,a.memoizedState)||(Qn=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),u.lastRenderedState=w}return[w,m]}function xy(){}function vy(s,a){var u=Gt,m=xr(),x=a(),w=!Ar(m.memoizedState,x);if(w&&(m.memoizedState=x,Qn=!0),m=m.queue,Qf(wy.bind(null,u,m,s),[s]),m.getSnapshot!==a||w||vn!==null&&vn.memoizedState.tag&1){if(u.flags|=2048,ol(9,Ty.bind(null,u,m,x,a),void 0,null),En===null)throw Error(n(349));(Po&30)!==0||Ey(u,a,x)}return x}function Ey(s,a,u){s.flags|=16384,s={getSnapshot:a,value:u},a=Gt.updateQueue,a===null?(a={lastEffect:null,stores:null},Gt.updateQueue=a,a.stores=[s]):(u=a.stores,u===null?a.stores=[s]:u.push(s))}function Ty(s,a,u,m){a.value=u,a.getSnapshot=m,Sy(a)&&ky(s)}function wy(s,a,u){return u(function(){Sy(a)&&ky(s)})}function Sy(s){var a=s.getSnapshot;s=s.value;try{var u=a();return!Ar(s,u)}catch{return!0}}function ky(s){var a=gs(s,1);a!==null&&Pr(a,s,1,-1)}function Cy(s){var a=Gr();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sl,lastRenderedState:s},a.queue=s,s=s.dispatch=fw.bind(null,Gt,s),[a.memoizedState,s]}function ol(s,a,u,m){return s={tag:s,create:a,destroy:u,deps:m,next:null},a=Gt.updateQueue,a===null?(a={lastEffect:null,stores:null},Gt.updateQueue=a,a.lastEffect=s.next=s):(u=a.lastEffect,u===null?a.lastEffect=s.next=s:(m=u.next,u.next=s,s.next=m,a.lastEffect=s)),s}function _y(){return xr().memoizedState}function Xu(s,a,u,m){var x=Gr();Gt.flags|=s,x.memoizedState=ol(1|a,u,void 0,m===void 0?null:m)}function Ju(s,a,u,m){var x=xr();m=m===void 0?null:m;var w=void 0;if(bn!==null){var R=bn.memoizedState;if(w=R.destroy,m!==null&&Wf(m,R.deps)){x.memoizedState=ol(a,u,w,m);return}}Gt.flags|=s,x.memoizedState=ol(1|a,u,w,m)}function Ny(s,a){return Xu(8390656,8,s,a)}function Qf(s,a){return Ju(2048,8,s,a)}function Dy(s,a){return Ju(4,2,s,a)}function Oy(s,a){return Ju(4,4,s,a)}function Ay(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function Iy(s,a,u){return u=u!=null?u.concat([s]):null,Ju(4,4,Ay.bind(null,a,s),u)}function Gf(){}function My(s,a){var u=xr();a=a===void 0?null:a;var m=u.memoizedState;return m!==null&&a!==null&&Wf(a,m[1])?m[0]:(u.memoizedState=[s,a],s)}function Ly(s,a){var u=xr();a=a===void 0?null:a;var m=u.memoizedState;return m!==null&&a!==null&&Wf(a,m[1])?m[0]:(s=s(),u.memoizedState=[s,a],s)}function Ry(s,a,u){return(Po&21)===0?(s.baseState&&(s.baseState=!1,Qn=!0),s.memoizedState=u):(Ar(u,a)||(u=dp(),Gt.lanes|=u,jo|=u,s.baseState=!0),a)}function cw(s,a){var u=Ot;Ot=u!==0&&4>u?u:4,s(!0);var m=zf.transition;zf.transition={};try{s(!1),a()}finally{Ot=u,zf.transition=m}}function Py(){return xr().memoizedState}function dw(s,a,u){var m=Js(s);if(u={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null},jy(s))Fy(a,u);else if(u=my(s,a,u,m),u!==null){var x=Un();Pr(u,s,m,x),By(u,a,m)}}function fw(s,a,u){var m=Js(s),x={lane:m,action:u,hasEagerState:!1,eagerState:null,next:null};if(jy(s))Fy(a,x);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var R=a.lastRenderedState,Y=w(R,u);if(x.hasEagerState=!0,x.eagerState=Y,Ar(Y,R)){var K=a.interleaved;K===null?(x.next=x,Pf(a)):(x.next=K.next,K.next=x),a.interleaved=x;return}}catch{}finally{}u=my(s,a,x,m),u!==null&&(x=Un(),Pr(u,s,m,x),By(u,a,m))}}function jy(s){var a=s.alternate;return s===Gt||a!==null&&a===Gt}function Fy(s,a){nl=Ku=!0;var u=s.pending;u===null?a.next=a:(a.next=u.next,u.next=a),s.pending=a}function By(s,a,u){if((u&4194240)!==0){var m=a.lanes;m&=s.pendingLanes,u|=m,a.lanes=u,Kd(s,u)}}var Zu={readContext:br,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useInsertionEffect:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useMutableSource:In,useSyncExternalStore:In,useId:In,unstable_isNewReconciler:!1},hw={readContext:br,useCallback:function(s,a){return Gr().memoizedState=[s,a===void 0?null:a],s},useContext:br,useEffect:Ny,useImperativeHandle:function(s,a,u){return u=u!=null?u.concat([s]):null,Xu(4194308,4,Ay.bind(null,a,s),u)},useLayoutEffect:function(s,a){return Xu(4194308,4,s,a)},useInsertionEffect:function(s,a){return Xu(4,2,s,a)},useMemo:function(s,a){var u=Gr();return a=a===void 0?null:a,s=s(),u.memoizedState=[s,a],s},useReducer:function(s,a,u){var m=Gr();return a=u!==void 0?u(a):a,m.memoizedState=m.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},m.queue=s,s=s.dispatch=dw.bind(null,Gt,s),[m.memoizedState,s]},useRef:function(s){var a=Gr();return s={current:s},a.memoizedState=s},useState:Cy,useDebugValue:Gf,useDeferredValue:function(s){return Gr().memoizedState=s},useTransition:function(){var s=Cy(!1),a=s[0];return s=cw.bind(null,s[1]),Gr().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,u){var m=Gt,x=Gr();if(qt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=a(),En===null)throw Error(n(349));(Po&30)!==0||Ey(m,a,u)}x.memoizedState=u;var w={value:u,getSnapshot:a};return x.queue=w,Ny(wy.bind(null,m,w,s),[s]),m.flags|=2048,ol(9,Ty.bind(null,m,w,u,a),void 0,null),u},useId:function(){var s=Gr(),a=En.identifierPrefix;if(qt){var u=ys,m=ps;u=(m&~(1<<32-Or(m)-1)).toString(32)+u,a=":"+a+"R"+u,u=rl++,0<u&&(a+="H"+u.toString(32)),a+=":"}else u=uw++,a=":"+a+"r"+u.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},mw={readContext:br,useCallback:My,useContext:br,useEffect:Qf,useImperativeHandle:Iy,useInsertionEffect:Dy,useLayoutEffect:Oy,useMemo:Ly,useReducer:qf,useRef:_y,useState:function(){return qf(sl)},useDebugValue:Gf,useDeferredValue:function(s){var a=xr();return Ry(a,bn.memoizedState,s)},useTransition:function(){var s=qf(sl)[0],a=xr().memoizedState;return[s,a]},useMutableSource:xy,useSyncExternalStore:vy,useId:Py,unstable_isNewReconciler:!1},pw={readContext:br,useCallback:My,useContext:br,useEffect:Qf,useImperativeHandle:Iy,useInsertionEffect:Dy,useLayoutEffect:Oy,useMemo:Ly,useReducer:Vf,useRef:_y,useState:function(){return Vf(sl)},useDebugValue:Gf,useDeferredValue:function(s){var a=xr();return bn===null?a.memoizedState=s:Ry(a,bn.memoizedState,s)},useTransition:function(){var s=Vf(sl)[0],a=xr().memoizedState;return[s,a]},useMutableSource:xy,useSyncExternalStore:vy,useId:Py,unstable_isNewReconciler:!1};function Mr(s,a){if(s&&s.defaultProps){a=M({},a),s=s.defaultProps;for(var u in s)a[u]===void 0&&(a[u]=s[u]);return a}return a}function Kf(s,a,u,m){a=s.memoizedState,u=u(m,a),u=u==null?a:M({},a,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var ec={isMounted:function(s){return(s=s._reactInternals)?Rt(s)===s:!1},enqueueSetState:function(s,a,u){s=s._reactInternals;var m=Un(),x=Js(s),w=bs(m,x);w.payload=a,u!=null&&(w.callback=u),a=Qs(s,w,x),a!==null&&(Pr(a,s,x,m),qu(a,s,x))},enqueueReplaceState:function(s,a,u){s=s._reactInternals;var m=Un(),x=Js(s),w=bs(m,x);w.tag=1,w.payload=a,u!=null&&(w.callback=u),a=Qs(s,w,x),a!==null&&(Pr(a,s,x,m),qu(a,s,x))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var u=Un(),m=Js(s),x=bs(u,m);x.tag=2,a!=null&&(x.callback=a),a=Qs(s,x,m),a!==null&&(Pr(a,s,m,u),qu(a,s,m))}};function Hy(s,a,u,m,x,w,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,w,R):a.prototype&&a.prototype.isPureReactComponent?!$i(u,m)||!$i(x,w):!0}function Uy(s,a,u){var m=!1,x=$s,w=a.contextType;return typeof w=="object"&&w!==null?w=br(w):(x=Vn(a)?Ao:An.current,m=a.contextTypes,w=(m=m!=null)?Oa(s,x):$s),a=new a(u,w),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=ec,s.stateNode=a,a._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=x,s.__reactInternalMemoizedMaskedChildContext=w),a}function zy(s,a,u,m){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,m),a.state!==s&&ec.enqueueReplaceState(a,a.state,null)}function Xf(s,a,u,m){var x=s.stateNode;x.props=u,x.state=s.memoizedState,x.refs={},jf(s);var w=a.contextType;typeof w=="object"&&w!==null?x.context=br(w):(w=Vn(a)?Ao:An.current,x.context=Oa(s,w)),x.state=s.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Kf(s,a,w,u),x.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(a=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),a!==x.state&&ec.enqueueReplaceState(x,x.state,null),Vu(s,u,x,m),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308)}function Fa(s,a){try{var u="",m=a;do u+=pe(m),m=m.return;while(m);var x=u}catch(w){x=`
32
+ Error generating stack: `+w.message+`
33
+ `+w.stack}return{value:s,source:a,stack:x,digest:null}}function Jf(s,a,u){return{value:s,source:null,stack:u??null,digest:a??null}}function Zf(s,a){try{console.error(a.value)}catch(u){setTimeout(function(){throw u})}}var yw=typeof WeakMap=="function"?WeakMap:Map;function Wy(s,a,u){u=bs(-1,u),u.tag=3,u.payload={element:null};var m=a.value;return u.callback=function(){ic||(ic=!0,mh=m),Zf(s,a)},u}function Yy(s,a,u){u=bs(-1,u),u.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=a.value;u.payload=function(){return m(x)},u.callback=function(){Zf(s,a)}}var w=s.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(u.callback=function(){Zf(s,a),typeof m!="function"&&(Ks===null?Ks=new Set([this]):Ks.add(this));var R=a.stack;this.componentDidCatch(a.value,{componentStack:R!==null?R:""})}),u}function $y(s,a,u){var m=s.pingCache;if(m===null){m=s.pingCache=new yw;var x=new Set;m.set(a,x)}else x=m.get(a),x===void 0&&(x=new Set,m.set(a,x));x.has(u)||(x.add(u),s=Ow.bind(null,s,a,u),a.then(s,s))}function qy(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function Vy(s,a,u,m,x){return(s.mode&1)===0?(s===a?s.flags|=65536:(s.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(a=bs(-1,1),a.tag=2,Qs(u,a,1))),u.lanes|=1),s):(s.flags|=65536,s.lanes=x,s)}var gw=I.ReactCurrentOwner,Qn=!1;function Hn(s,a,u,m){a.child=s===null?hy(a,null,u,m):La(a,s.child,u,m)}function Qy(s,a,u,m,x){u=u.render;var w=a.ref;return Pa(a,x),m=Yf(s,a,u,m,w,x),u=$f(),s!==null&&!Qn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~x,xs(s,a,x)):(qt&&u&&_f(a),a.flags|=1,Hn(s,a,m,x),a.child)}function Gy(s,a,u,m,x){if(s===null){var w=u.type;return typeof w=="function"&&!Eh(w)&&w.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(a.tag=15,a.type=w,Ky(s,a,w,m,x)):(s=hc(u.type,null,m,a,a.mode,x),s.ref=a.ref,s.return=a,a.child=s)}if(w=s.child,(s.lanes&x)===0){var R=w.memoizedProps;if(u=u.compare,u=u!==null?u:$i,u(R,m)&&s.ref===a.ref)return xs(s,a,x)}return a.flags|=1,s=eo(w,m),s.ref=a.ref,s.return=a,a.child=s}function Ky(s,a,u,m,x){if(s!==null){var w=s.memoizedProps;if($i(w,m)&&s.ref===a.ref)if(Qn=!1,a.pendingProps=m=w,(s.lanes&x)!==0)(s.flags&131072)!==0&&(Qn=!0);else return a.lanes=s.lanes,xs(s,a,x)}return eh(s,a,u,m,x)}function Xy(s,a,u){var m=a.pendingProps,x=m.children,w=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft(Ha,lr),lr|=u;else{if((u&1073741824)===0)return s=w!==null?w.baseLanes|u:u,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,Ft(Ha,lr),lr|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=w!==null?w.baseLanes:u,Ft(Ha,lr),lr|=m}else w!==null?(m=w.baseLanes|u,a.memoizedState=null):m=u,Ft(Ha,lr),lr|=m;return Hn(s,a,x,u),a.child}function Jy(s,a){var u=a.ref;(s===null&&u!==null||s!==null&&s.ref!==u)&&(a.flags|=512,a.flags|=2097152)}function eh(s,a,u,m,x){var w=Vn(u)?Ao:An.current;return w=Oa(a,w),Pa(a,x),u=Yf(s,a,u,m,w,x),m=$f(),s!==null&&!Qn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~x,xs(s,a,x)):(qt&&m&&_f(a),a.flags|=1,Hn(s,a,u,x),a.child)}function Zy(s,a,u,m,x){if(Vn(u)){var w=!0;Fu(a)}else w=!1;if(Pa(a,x),a.stateNode===null)nc(s,a),Uy(a,u,m),Xf(a,u,m,x),m=!0;else if(s===null){var R=a.stateNode,Y=a.memoizedProps;R.props=Y;var K=R.context,fe=u.contextType;typeof fe=="object"&&fe!==null?fe=br(fe):(fe=Vn(u)?Ao:An.current,fe=Oa(a,fe));var Te=u.getDerivedStateFromProps,Se=typeof Te=="function"||typeof R.getSnapshotBeforeUpdate=="function";Se||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(Y!==m||K!==fe)&&zy(a,R,m,fe),Vs=!1;var ve=a.memoizedState;R.state=ve,Vu(a,m,R,x),K=a.memoizedState,Y!==m||ve!==K||qn.current||Vs?(typeof Te=="function"&&(Kf(a,u,Te,m),K=a.memoizedState),(Y=Vs||Hy(a,u,Y,m,ve,K,fe))?(Se||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(a.flags|=4194308)):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=K),R.props=m,R.state=K,R.context=fe,m=Y):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{R=a.stateNode,py(s,a),Y=a.memoizedProps,fe=a.type===a.elementType?Y:Mr(a.type,Y),R.props=fe,Se=a.pendingProps,ve=R.context,K=u.contextType,typeof K=="object"&&K!==null?K=br(K):(K=Vn(u)?Ao:An.current,K=Oa(a,K));var Pe=u.getDerivedStateFromProps;(Te=typeof Pe=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(Y!==Se||ve!==K)&&zy(a,R,m,K),Vs=!1,ve=a.memoizedState,R.state=ve,Vu(a,m,R,x);var Ye=a.memoizedState;Y!==Se||ve!==Ye||qn.current||Vs?(typeof Pe=="function"&&(Kf(a,u,Pe,m),Ye=a.memoizedState),(fe=Vs||Hy(a,u,fe,m,ve,Ye,K)||!1)?(Te||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(m,Ye,K),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(m,Ye,K)),typeof R.componentDidUpdate=="function"&&(a.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof R.componentDidUpdate!="function"||Y===s.memoizedProps&&ve===s.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||Y===s.memoizedProps&&ve===s.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=Ye),R.props=m,R.state=Ye,R.context=K,m=fe):(typeof R.componentDidUpdate!="function"||Y===s.memoizedProps&&ve===s.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||Y===s.memoizedProps&&ve===s.memoizedState||(a.flags|=1024),m=!1)}return th(s,a,u,m,w,x)}function th(s,a,u,m,x,w){Jy(s,a);var R=(a.flags&128)!==0;if(!m&&!R)return x&&sy(a,u,!1),xs(s,a,w);m=a.stateNode,gw.current=a;var Y=R&&typeof u.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,s!==null&&R?(a.child=La(a,s.child,null,w),a.child=La(a,null,Y,w)):Hn(s,a,Y,w),a.memoizedState=m.state,x&&sy(a,u,!0),a.child}function eg(s){var a=s.stateNode;a.pendingContext?ny(s,a.pendingContext,a.pendingContext!==a.context):a.context&&ny(s,a.context,!1),Ff(s,a.containerInfo)}function tg(s,a,u,m,x){return Ma(),Af(x),a.flags|=256,Hn(s,a,u,m),a.child}var nh={dehydrated:null,treeContext:null,retryLane:0};function rh(s){return{baseLanes:s,cachePool:null,transitions:null}}function ng(s,a,u){var m=a.pendingProps,x=Qt.current,w=!1,R=(a.flags&128)!==0,Y;if((Y=R)||(Y=s!==null&&s.memoizedState===null?!1:(x&2)!==0),Y?(w=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(x|=1),Ft(Qt,x&1),s===null)return Of(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((a.mode&1)===0?a.lanes=1:s.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(R=m.children,s=m.fallback,w?(m=a.mode,w=a.child,R={mode:"hidden",children:R},(m&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=R):w=mc(R,m,0,null),s=Uo(s,m,u,null),w.return=a,s.return=a,w.sibling=s,a.child=w,a.child.memoizedState=rh(u),a.memoizedState=nh,s):sh(a,R));if(x=s.memoizedState,x!==null&&(Y=x.dehydrated,Y!==null))return bw(s,a,R,m,Y,x,u);if(w){w=m.fallback,R=a.mode,x=s.child,Y=x.sibling;var K={mode:"hidden",children:m.children};return(R&1)===0&&a.child!==x?(m=a.child,m.childLanes=0,m.pendingProps=K,a.deletions=null):(m=eo(x,K),m.subtreeFlags=x.subtreeFlags&14680064),Y!==null?w=eo(Y,w):(w=Uo(w,R,u,null),w.flags|=2),w.return=a,m.return=a,m.sibling=w,a.child=m,m=w,w=a.child,R=s.child.memoizedState,R=R===null?rh(u):{baseLanes:R.baseLanes|u,cachePool:null,transitions:R.transitions},w.memoizedState=R,w.childLanes=s.childLanes&~u,a.memoizedState=nh,m}return w=s.child,s=w.sibling,m=eo(w,{mode:"visible",children:m.children}),(a.mode&1)===0&&(m.lanes=u),m.return=a,m.sibling=null,s!==null&&(u=a.deletions,u===null?(a.deletions=[s],a.flags|=16):u.push(s)),a.child=m,a.memoizedState=null,m}function sh(s,a){return a=mc({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function tc(s,a,u,m){return m!==null&&Af(m),La(a,s.child,null,u),s=sh(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function bw(s,a,u,m,x,w,R){if(u)return a.flags&256?(a.flags&=-257,m=Jf(Error(n(422))),tc(s,a,R,m)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(w=m.fallback,x=a.mode,m=mc({mode:"visible",children:m.children},x,0,null),w=Uo(w,x,R,null),w.flags|=2,m.return=a,w.return=a,m.sibling=w,a.child=m,(a.mode&1)!==0&&La(a,s.child,null,R),a.child.memoizedState=rh(R),a.memoizedState=nh,w);if((a.mode&1)===0)return tc(s,a,R,null);if(x.data==="$!"){if(m=x.nextSibling&&x.nextSibling.dataset,m)var Y=m.dgst;return m=Y,w=Error(n(419)),m=Jf(w,m,void 0),tc(s,a,R,m)}if(Y=(R&s.childLanes)!==0,Qn||Y){if(m=En,m!==null){switch(R&-R){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(m.suspendedLanes|R))!==0?0:x,x!==0&&x!==w.retryLane&&(w.retryLane=x,gs(s,x),Pr(m,s,x,-1))}return vh(),m=Jf(Error(n(421))),tc(s,a,R,m)}return x.data==="$?"?(a.flags|=128,a.child=s.child,a=Aw.bind(null,s),x._reactRetry=a,null):(s=w.treeContext,ir=Ws(x.nextSibling),ar=a,qt=!0,Ir=null,s!==null&&(yr[gr++]=ps,yr[gr++]=ys,yr[gr++]=Io,ps=s.id,ys=s.overflow,Io=a),a=sh(a,m.children),a.flags|=4096,a)}function rg(s,a,u){s.lanes|=a;var m=s.alternate;m!==null&&(m.lanes|=a),Rf(s.return,a,u)}function oh(s,a,u,m,x){var w=s.memoizedState;w===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:x}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=m,w.tail=u,w.tailMode=x)}function sg(s,a,u){var m=a.pendingProps,x=m.revealOrder,w=m.tail;if(Hn(s,a,m.children,u),m=Qt.current,(m&2)!==0)m=m&1|2,a.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&rg(s,u,a);else if(s.tag===19)rg(s,u,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Ft(Qt,m),(a.mode&1)===0)a.memoizedState=null;else switch(x){case"forwards":for(u=a.child,x=null;u!==null;)s=u.alternate,s!==null&&Qu(s)===null&&(x=u),u=u.sibling;u=x,u===null?(x=a.child,a.child=null):(x=u.sibling,u.sibling=null),oh(a,!1,x,u,w);break;case"backwards":for(u=null,x=a.child,a.child=null;x!==null;){if(s=x.alternate,s!==null&&Qu(s)===null){a.child=x;break}s=x.sibling,x.sibling=u,u=x,x=s}oh(a,!0,u,null,w);break;case"together":oh(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function nc(s,a){(a.mode&1)===0&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function xs(s,a,u){if(s!==null&&(a.dependencies=s.dependencies),jo|=a.lanes,(u&a.childLanes)===0)return null;if(s!==null&&a.child!==s.child)throw Error(n(153));if(a.child!==null){for(s=a.child,u=eo(s,s.pendingProps),a.child=u,u.return=a;s.sibling!==null;)s=s.sibling,u=u.sibling=eo(s,s.pendingProps),u.return=a;u.sibling=null}return a.child}function xw(s,a,u){switch(a.tag){case 3:eg(a),Ma();break;case 5:by(a);break;case 1:Vn(a.type)&&Fu(a);break;case 4:Ff(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,x=a.memoizedProps.value;Ft(Yu,m._currentValue),m._currentValue=x;break;case 13:if(m=a.memoizedState,m!==null)return m.dehydrated!==null?(Ft(Qt,Qt.current&1),a.flags|=128,null):(u&a.child.childLanes)!==0?ng(s,a,u):(Ft(Qt,Qt.current&1),s=xs(s,a,u),s!==null?s.sibling:null);Ft(Qt,Qt.current&1);break;case 19:if(m=(u&a.childLanes)!==0,(s.flags&128)!==0){if(m)return sg(s,a,u);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),Ft(Qt,Qt.current),m)break;return null;case 22:case 23:return a.lanes=0,Xy(s,a,u)}return xs(s,a,u)}var og,ah,ag,ig;og=function(s,a){for(var u=a.child;u!==null;){if(u.tag===5||u.tag===6)s.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},ah=function(){},ag=function(s,a,u,m){var x=s.memoizedProps;if(x!==m){s=a.stateNode,Ro(Qr.current);var w=null;switch(u){case"input":x=tt(s,x),m=tt(s,m),w=[];break;case"select":x=M({},x,{value:void 0}),m=M({},m,{value:void 0}),w=[];break;case"textarea":x=Oe(s,x),m=Oe(s,m),w=[];break;default:typeof x.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=Ru)}Wt(u,m);var R;u=null;for(fe in x)if(!m.hasOwnProperty(fe)&&x.hasOwnProperty(fe)&&x[fe]!=null)if(fe==="style"){var Y=x[fe];for(R in Y)Y.hasOwnProperty(R)&&(u||(u={}),u[R]="")}else fe!=="dangerouslySetInnerHTML"&&fe!=="children"&&fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&fe!=="autoFocus"&&(o.hasOwnProperty(fe)?w||(w=[]):(w=w||[]).push(fe,null));for(fe in m){var K=m[fe];if(Y=x!=null?x[fe]:void 0,m.hasOwnProperty(fe)&&K!==Y&&(K!=null||Y!=null))if(fe==="style")if(Y){for(R in Y)!Y.hasOwnProperty(R)||K&&K.hasOwnProperty(R)||(u||(u={}),u[R]="");for(R in K)K.hasOwnProperty(R)&&Y[R]!==K[R]&&(u||(u={}),u[R]=K[R])}else u||(w||(w=[]),w.push(fe,u)),u=K;else fe==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,Y=Y?Y.__html:void 0,K!=null&&Y!==K&&(w=w||[]).push(fe,K)):fe==="children"?typeof K!="string"&&typeof K!="number"||(w=w||[]).push(fe,""+K):fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&(o.hasOwnProperty(fe)?(K!=null&&fe==="onScroll"&&Ut("scroll",s),w||Y===K||(w=[])):(w=w||[]).push(fe,K))}u&&(w=w||[]).push("style",u);var fe=w;(a.updateQueue=fe)&&(a.flags|=4)}},ig=function(s,a,u,m){u!==m&&(a.flags|=4)};function al(s,a){if(!qt)switch(s.tailMode){case"hidden":a=s.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Mn(s){var a=s.alternate!==null&&s.alternate.child===s.child,u=0,m=0;if(a)for(var x=s.child;x!==null;)u|=x.lanes|x.childLanes,m|=x.subtreeFlags&14680064,m|=x.flags&14680064,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)u|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=m,s.childLanes=u,a}function vw(s,a,u){var m=a.pendingProps;switch(Nf(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(a),null;case 1:return Vn(a.type)&&ju(),Mn(a),null;case 3:return m=a.stateNode,ja(),zt(qn),zt(An),Uf(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(zu(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Ir!==null&&(gh(Ir),Ir=null))),ah(s,a),Mn(a),null;case 5:Bf(a);var x=Ro(tl.current);if(u=a.type,s!==null&&a.stateNode!=null)ag(s,a,u,m,x),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(n(166));return Mn(a),null}if(s=Ro(Qr.current),zu(a)){m=a.stateNode,u=a.type;var w=a.memoizedProps;switch(m[Vr]=a,m[Ki]=w,s=(a.mode&1)!==0,u){case"dialog":Ut("cancel",m),Ut("close",m);break;case"iframe":case"object":case"embed":Ut("load",m);break;case"video":case"audio":for(x=0;x<Vi.length;x++)Ut(Vi[x],m);break;case"source":Ut("error",m);break;case"img":case"image":case"link":Ut("error",m),Ut("load",m);break;case"details":Ut("toggle",m);break;case"input":Ge(m,w),Ut("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!w.multiple},Ut("invalid",m);break;case"textarea":qe(m,w),Ut("invalid",m)}Wt(u,w),x=null;for(var R in w)if(w.hasOwnProperty(R)){var Y=w[R];R==="children"?typeof Y=="string"?m.textContent!==Y&&(w.suppressHydrationWarning!==!0&&Lu(m.textContent,Y,s),x=["children",Y]):typeof Y=="number"&&m.textContent!==""+Y&&(w.suppressHydrationWarning!==!0&&Lu(m.textContent,Y,s),x=["children",""+Y]):o.hasOwnProperty(R)&&Y!=null&&R==="onScroll"&&Ut("scroll",m)}switch(u){case"input":me(m),je(m,w,!0);break;case"textarea":me(m),yt(m);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(m.onclick=Ru)}m=x,a.updateQueue=m,m!==null&&(a.flags|=4)}else{R=x.nodeType===9?x:x.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=ce(u)),s==="http://www.w3.org/1999/xhtml"?u==="script"?(s=R.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=R.createElement(u,{is:m.is}):(s=R.createElement(u),u==="select"&&(R=s,m.multiple?R.multiple=!0:m.size&&(R.size=m.size))):s=R.createElementNS(s,u),s[Vr]=a,s[Ki]=m,og(s,a,!1,!1),a.stateNode=s;e:{switch(R=It(u,m),u){case"dialog":Ut("cancel",s),Ut("close",s),x=m;break;case"iframe":case"object":case"embed":Ut("load",s),x=m;break;case"video":case"audio":for(x=0;x<Vi.length;x++)Ut(Vi[x],s);x=m;break;case"source":Ut("error",s),x=m;break;case"img":case"image":case"link":Ut("error",s),Ut("load",s),x=m;break;case"details":Ut("toggle",s),x=m;break;case"input":Ge(s,m),x=tt(s,m),Ut("invalid",s);break;case"option":x=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},x=M({},m,{value:void 0}),Ut("invalid",s);break;case"textarea":qe(s,m),x=Oe(s,m),Ut("invalid",s);break;default:x=m}Wt(u,x),Y=x;for(w in Y)if(Y.hasOwnProperty(w)){var K=Y[w];w==="style"?Dn(s,K):w==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&rt(s,K)):w==="children"?typeof K=="string"?(u!=="textarea"||K!=="")&&ot(s,K):typeof K=="number"&&ot(s,""+K):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?K!=null&&w==="onScroll"&&Ut("scroll",s):K!=null&&O(s,w,K,R))}switch(u){case"input":me(s),je(s,m,!1);break;case"textarea":me(s),yt(s);break;case"option":m.value!=null&&s.setAttribute("value",""+G(m.value));break;case"select":s.multiple=!!m.multiple,w=m.value,w!=null?xe(s,!!m.multiple,w,!1):m.defaultValue!=null&&xe(s,!!m.multiple,m.defaultValue,!0);break;default:typeof x.onClick=="function"&&(s.onclick=Ru)}switch(u){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Mn(a),null;case 6:if(s&&a.stateNode!=null)ig(s,a,s.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(n(166));if(u=Ro(tl.current),Ro(Qr.current),zu(a)){if(m=a.stateNode,u=a.memoizedProps,m[Vr]=a,(w=m.nodeValue!==u)&&(s=ar,s!==null))switch(s.tag){case 3:Lu(m.nodeValue,u,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Lu(m.nodeValue,u,(s.mode&1)!==0)}w&&(a.flags|=4)}else m=(u.nodeType===9?u:u.ownerDocument).createTextNode(m),m[Vr]=a,a.stateNode=m}return Mn(a),null;case 13:if(zt(Qt),m=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(qt&&ir!==null&&(a.mode&1)!==0&&(a.flags&128)===0)cy(),Ma(),a.flags|=98560,w=!1;else if(w=zu(a),m!==null&&m.dehydrated!==null){if(s===null){if(!w)throw Error(n(318));if(w=a.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(n(317));w[Vr]=a}else Ma(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mn(a),w=!1}else Ir!==null&&(gh(Ir),Ir=null),w=!0;if(!w)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=u,a):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(a.child.flags|=8192,(a.mode&1)!==0&&(s===null||(Qt.current&1)!==0?xn===0&&(xn=3):vh())),a.updateQueue!==null&&(a.flags|=4),Mn(a),null);case 4:return ja(),ah(s,a),s===null&&Qi(a.stateNode.containerInfo),Mn(a),null;case 10:return Lf(a.type._context),Mn(a),null;case 17:return Vn(a.type)&&ju(),Mn(a),null;case 19:if(zt(Qt),w=a.memoizedState,w===null)return Mn(a),null;if(m=(a.flags&128)!==0,R=w.rendering,R===null)if(m)al(w,!1);else{if(xn!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(R=Qu(s),R!==null){for(a.flags|=128,al(w,!1),m=R.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=u,u=a.child;u!==null;)w=u,s=m,w.flags&=14680066,R=w.alternate,R===null?(w.childLanes=0,w.lanes=s,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=R.childLanes,w.lanes=R.lanes,w.child=R.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=R.memoizedProps,w.memoizedState=R.memoizedState,w.updateQueue=R.updateQueue,w.type=R.type,s=R.dependencies,w.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),u=u.sibling;return Ft(Qt,Qt.current&1|2),a.child}s=s.sibling}w.tail!==null&&jt()>Ua&&(a.flags|=128,m=!0,al(w,!1),a.lanes=4194304)}else{if(!m)if(s=Qu(R),s!==null){if(a.flags|=128,m=!0,u=s.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),al(w,!0),w.tail===null&&w.tailMode==="hidden"&&!R.alternate&&!qt)return Mn(a),null}else 2*jt()-w.renderingStartTime>Ua&&u!==1073741824&&(a.flags|=128,m=!0,al(w,!1),a.lanes=4194304);w.isBackwards?(R.sibling=a.child,a.child=R):(u=w.last,u!==null?u.sibling=R:a.child=R,w.last=R)}return w.tail!==null?(a=w.tail,w.rendering=a,w.tail=a.sibling,w.renderingStartTime=jt(),a.sibling=null,u=Qt.current,Ft(Qt,m?u&1|2:u&1),a):(Mn(a),null);case 22:case 23:return xh(),m=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(a.flags|=8192),m&&(a.mode&1)!==0?(lr&1073741824)!==0&&(Mn(a),a.subtreeFlags&6&&(a.flags|=8192)):Mn(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function Ew(s,a){switch(Nf(a),a.tag){case 1:return Vn(a.type)&&ju(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return ja(),zt(qn),zt(An),Uf(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 5:return Bf(a),null;case 13:if(zt(Qt),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(n(340));Ma()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return zt(Qt),null;case 4:return ja(),null;case 10:return Lf(a.type._context),null;case 22:case 23:return xh(),null;case 24:return null;default:return null}}var rc=!1,Ln=!1,Tw=typeof WeakSet=="function"?WeakSet:Set,He=null;function Ba(s,a){var u=s.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(m){rn(s,a,m)}else u.current=null}function ih(s,a,u){try{u()}catch(m){rn(s,a,m)}}var lg=!1;function ww(s,a){if(xf=wu,s=Hp(),df(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var x=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var R=0,Y=-1,K=-1,fe=0,Te=0,Se=s,ve=null;t:for(;;){for(var Pe;Se!==u||x!==0&&Se.nodeType!==3||(Y=R+x),Se!==w||m!==0&&Se.nodeType!==3||(K=R+m),Se.nodeType===3&&(R+=Se.nodeValue.length),(Pe=Se.firstChild)!==null;)ve=Se,Se=Pe;for(;;){if(Se===s)break t;if(ve===u&&++fe===x&&(Y=R),ve===w&&++Te===m&&(K=R),(Pe=Se.nextSibling)!==null)break;Se=ve,ve=Se.parentNode}Se=Pe}u=Y===-1||K===-1?null:{start:Y,end:K}}else u=null}u=u||{start:0,end:0}}else u=null;for(vf={focusedElem:s,selectionRange:u},wu=!1,He=a;He!==null;)if(a=He,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,He=s;else for(;He!==null;){a=He;try{var Ye=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Ye!==null){var $e=Ye.memoizedProps,ln=Ye.memoizedState,ee=a.stateNode,J=ee.getSnapshotBeforeUpdate(a.elementType===a.type?$e:Mr(a.type,$e),ln);ee.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var se=a.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(De){rn(a,a.return,De)}if(s=a.sibling,s!==null){s.return=a.return,He=s;break}He=a.return}return Ye=lg,lg=!1,Ye}function il(s,a,u){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var x=m=m.next;do{if((x.tag&s)===s){var w=x.destroy;x.destroy=void 0,w!==void 0&&ih(a,u,w)}x=x.next}while(x!==m)}}function sc(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&s)===s){var m=u.create;u.destroy=m()}u=u.next}while(u!==a)}}function lh(s){var a=s.ref;if(a!==null){var u=s.stateNode;switch(s.tag){case 5:s=u;break;default:s=u}typeof a=="function"?a(s):a.current=s}}function ug(s){var a=s.alternate;a!==null&&(s.alternate=null,ug(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[Vr],delete a[Ki],delete a[Sf],delete a[ow],delete a[aw])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function cg(s){return s.tag===5||s.tag===3||s.tag===4}function dg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||cg(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function uh(s,a,u){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(s,a):u.insertBefore(s,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(s,u)):(a=u,a.appendChild(s)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Ru));else if(m!==4&&(s=s.child,s!==null))for(uh(s,a,u),s=s.sibling;s!==null;)uh(s,a,u),s=s.sibling}function ch(s,a,u){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?u.insertBefore(s,a):u.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(ch(s,a,u),s=s.sibling;s!==null;)ch(s,a,u),s=s.sibling}var Cn=null,Lr=!1;function Gs(s,a,u){for(u=u.child;u!==null;)fg(s,a,u),u=u.sibling}function fg(s,a,u){if(qr&&typeof qr.onCommitFiberUnmount=="function")try{qr.onCommitFiberUnmount(gu,u)}catch{}switch(u.tag){case 5:Ln||Ba(u,a);case 6:var m=Cn,x=Lr;Cn=null,Gs(s,a,u),Cn=m,Lr=x,Cn!==null&&(Lr?(s=Cn,u=u.stateNode,s.nodeType===8?s.parentNode.removeChild(u):s.removeChild(u)):Cn.removeChild(u.stateNode));break;case 18:Cn!==null&&(Lr?(s=Cn,u=u.stateNode,s.nodeType===8?wf(s.parentNode,u):s.nodeType===1&&wf(s,u),Bi(s)):wf(Cn,u.stateNode));break;case 4:m=Cn,x=Lr,Cn=u.stateNode.containerInfo,Lr=!0,Gs(s,a,u),Cn=m,Lr=x;break;case 0:case 11:case 14:case 15:if(!Ln&&(m=u.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){x=m=m.next;do{var w=x,R=w.destroy;w=w.tag,R!==void 0&&((w&2)!==0||(w&4)!==0)&&ih(u,a,R),x=x.next}while(x!==m)}Gs(s,a,u);break;case 1:if(!Ln&&(Ba(u,a),m=u.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=u.memoizedProps,m.state=u.memoizedState,m.componentWillUnmount()}catch(Y){rn(u,a,Y)}Gs(s,a,u);break;case 21:Gs(s,a,u);break;case 22:u.mode&1?(Ln=(m=Ln)||u.memoizedState!==null,Gs(s,a,u),Ln=m):Gs(s,a,u);break;default:Gs(s,a,u)}}function hg(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var u=s.stateNode;u===null&&(u=s.stateNode=new Tw),a.forEach(function(m){var x=Iw.bind(null,s,m);u.has(m)||(u.add(m),m.then(x,x))})}}function Rr(s,a){var u=a.deletions;if(u!==null)for(var m=0;m<u.length;m++){var x=u[m];try{var w=s,R=a,Y=R;e:for(;Y!==null;){switch(Y.tag){case 5:Cn=Y.stateNode,Lr=!1;break e;case 3:Cn=Y.stateNode.containerInfo,Lr=!0;break e;case 4:Cn=Y.stateNode.containerInfo,Lr=!0;break e}Y=Y.return}if(Cn===null)throw Error(n(160));fg(w,R,x),Cn=null,Lr=!1;var K=x.alternate;K!==null&&(K.return=null),x.return=null}catch(fe){rn(x,a,fe)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)mg(a,s),a=a.sibling}function mg(s,a){var u=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Rr(a,s),Kr(s),m&4){try{il(3,s,s.return),sc(3,s)}catch($e){rn(s,s.return,$e)}try{il(5,s,s.return)}catch($e){rn(s,s.return,$e)}}break;case 1:Rr(a,s),Kr(s),m&512&&u!==null&&Ba(u,u.return);break;case 5:if(Rr(a,s),Kr(s),m&512&&u!==null&&Ba(u,u.return),s.flags&32){var x=s.stateNode;try{ot(x,"")}catch($e){rn(s,s.return,$e)}}if(m&4&&(x=s.stateNode,x!=null)){var w=s.memoizedProps,R=u!==null?u.memoizedProps:w,Y=s.type,K=s.updateQueue;if(s.updateQueue=null,K!==null)try{Y==="input"&&w.type==="radio"&&w.name!=null&&nt(x,w),It(Y,R);var fe=It(Y,w);for(R=0;R<K.length;R+=2){var Te=K[R],Se=K[R+1];Te==="style"?Dn(x,Se):Te==="dangerouslySetInnerHTML"?rt(x,Se):Te==="children"?ot(x,Se):O(x,Te,Se,fe)}switch(Y){case"input":we(x,w);break;case"textarea":pt(x,w);break;case"select":var ve=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!w.multiple;var Pe=w.value;Pe!=null?xe(x,!!w.multiple,Pe,!1):ve!==!!w.multiple&&(w.defaultValue!=null?xe(x,!!w.multiple,w.defaultValue,!0):xe(x,!!w.multiple,w.multiple?[]:"",!1))}x[Ki]=w}catch($e){rn(s,s.return,$e)}}break;case 6:if(Rr(a,s),Kr(s),m&4){if(s.stateNode===null)throw Error(n(162));x=s.stateNode,w=s.memoizedProps;try{x.nodeValue=w}catch($e){rn(s,s.return,$e)}}break;case 3:if(Rr(a,s),Kr(s),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Bi(a.containerInfo)}catch($e){rn(s,s.return,$e)}break;case 4:Rr(a,s),Kr(s);break;case 13:Rr(a,s),Kr(s),x=s.child,x.flags&8192&&(w=x.memoizedState!==null,x.stateNode.isHidden=w,!w||x.alternate!==null&&x.alternate.memoizedState!==null||(hh=jt())),m&4&&hg(s);break;case 22:if(Te=u!==null&&u.memoizedState!==null,s.mode&1?(Ln=(fe=Ln)||Te,Rr(a,s),Ln=fe):Rr(a,s),Kr(s),m&8192){if(fe=s.memoizedState!==null,(s.stateNode.isHidden=fe)&&!Te&&(s.mode&1)!==0)for(He=s,Te=s.child;Te!==null;){for(Se=He=Te;He!==null;){switch(ve=He,Pe=ve.child,ve.tag){case 0:case 11:case 14:case 15:il(4,ve,ve.return);break;case 1:Ba(ve,ve.return);var Ye=ve.stateNode;if(typeof Ye.componentWillUnmount=="function"){m=ve,u=ve.return;try{a=m,Ye.props=a.memoizedProps,Ye.state=a.memoizedState,Ye.componentWillUnmount()}catch($e){rn(m,u,$e)}}break;case 5:Ba(ve,ve.return);break;case 22:if(ve.memoizedState!==null){gg(Se);continue}}Pe!==null?(Pe.return=ve,He=Pe):gg(Se)}Te=Te.sibling}e:for(Te=null,Se=s;;){if(Se.tag===5){if(Te===null){Te=Se;try{x=Se.stateNode,fe?(w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(Y=Se.stateNode,K=Se.memoizedProps.style,R=K!=null&&K.hasOwnProperty("display")?K.display:null,Y.style.display=hn("display",R))}catch($e){rn(s,s.return,$e)}}}else if(Se.tag===6){if(Te===null)try{Se.stateNode.nodeValue=fe?"":Se.memoizedProps}catch($e){rn(s,s.return,$e)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===s)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===s)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===s)break e;Te===Se&&(Te=null),Se=Se.return}Te===Se&&(Te=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Rr(a,s),Kr(s),m&4&&hg(s);break;case 21:break;default:Rr(a,s),Kr(s)}}function Kr(s){var a=s.flags;if(a&2){try{e:{for(var u=s.return;u!==null;){if(cg(u)){var m=u;break e}u=u.return}throw Error(n(160))}switch(m.tag){case 5:var x=m.stateNode;m.flags&32&&(ot(x,""),m.flags&=-33);var w=dg(s);ch(s,w,x);break;case 3:case 4:var R=m.stateNode.containerInfo,Y=dg(s);uh(s,Y,R);break;default:throw Error(n(161))}}catch(K){rn(s,s.return,K)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function Sw(s,a,u){He=s,pg(s)}function pg(s,a,u){for(var m=(s.mode&1)!==0;He!==null;){var x=He,w=x.child;if(x.tag===22&&m){var R=x.memoizedState!==null||rc;if(!R){var Y=x.alternate,K=Y!==null&&Y.memoizedState!==null||Ln;Y=rc;var fe=Ln;if(rc=R,(Ln=K)&&!fe)for(He=x;He!==null;)R=He,K=R.child,R.tag===22&&R.memoizedState!==null?bg(x):K!==null?(K.return=R,He=K):bg(x);for(;w!==null;)He=w,pg(w),w=w.sibling;He=x,rc=Y,Ln=fe}yg(s)}else(x.subtreeFlags&8772)!==0&&w!==null?(w.return=x,He=w):yg(s)}}function yg(s){for(;He!==null;){var a=He;if((a.flags&8772)!==0){var u=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Ln||sc(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!Ln)if(u===null)m.componentDidMount();else{var x=a.elementType===a.type?u.memoizedProps:Mr(a.type,u.memoizedProps);m.componentDidUpdate(x,u.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var w=a.updateQueue;w!==null&&gy(a,w,m);break;case 3:var R=a.updateQueue;if(R!==null){if(u=null,a.child!==null)switch(a.child.tag){case 5:u=a.child.stateNode;break;case 1:u=a.child.stateNode}gy(a,R,u)}break;case 5:var Y=a.stateNode;if(u===null&&a.flags&4){u=Y;var K=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&u.focus();break;case"img":K.src&&(u.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var fe=a.alternate;if(fe!==null){var Te=fe.memoizedState;if(Te!==null){var Se=Te.dehydrated;Se!==null&&Bi(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ln||a.flags&512&&lh(a)}catch(ve){rn(a,a.return,ve)}}if(a===s){He=null;break}if(u=a.sibling,u!==null){u.return=a.return,He=u;break}He=a.return}}function gg(s){for(;He!==null;){var a=He;if(a===s){He=null;break}var u=a.sibling;if(u!==null){u.return=a.return,He=u;break}He=a.return}}function bg(s){for(;He!==null;){var a=He;try{switch(a.tag){case 0:case 11:case 15:var u=a.return;try{sc(4,a)}catch(K){rn(a,u,K)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var x=a.return;try{m.componentDidMount()}catch(K){rn(a,x,K)}}var w=a.return;try{lh(a)}catch(K){rn(a,w,K)}break;case 5:var R=a.return;try{lh(a)}catch(K){rn(a,R,K)}}}catch(K){rn(a,a.return,K)}if(a===s){He=null;break}var Y=a.sibling;if(Y!==null){Y.return=a.return,He=Y;break}He=a.return}}var kw=Math.ceil,oc=I.ReactCurrentDispatcher,dh=I.ReactCurrentOwner,vr=I.ReactCurrentBatchConfig,vt=0,En=null,mn=null,_n=0,lr=0,Ha=Ys(0),xn=0,ll=null,jo=0,ac=0,fh=0,ul=null,Gn=null,hh=0,Ua=1/0,vs=null,ic=!1,mh=null,Ks=null,lc=!1,Xs=null,uc=0,cl=0,ph=null,cc=-1,dc=0;function Un(){return(vt&6)!==0?jt():cc!==-1?cc:cc=jt()}function Js(s){return(s.mode&1)===0?1:(vt&2)!==0&&_n!==0?_n&-_n:lw.transition!==null?(dc===0&&(dc=dp()),dc):(s=Ot,s!==0||(s=window.event,s=s===void 0?16:vp(s.type)),s)}function Pr(s,a,u,m){if(50<cl)throw cl=0,ph=null,Error(n(185));Li(s,u,m),((vt&2)===0||s!==En)&&(s===En&&((vt&2)===0&&(ac|=u),xn===4&&Zs(s,_n)),Kn(s,m),u===1&&vt===0&&(a.mode&1)===0&&(Ua=jt()+500,Bu&&qs()))}function Kn(s,a){var u=s.callbackNode;lT(s,a);var m=vu(s,s===En?_n:0);if(m===0)u!==null&&Pt(u),s.callbackNode=null,s.callbackPriority=0;else if(a=m&-m,s.callbackPriority!==a){if(u!=null&&Pt(u),a===1)s.tag===0?iw(vg.bind(null,s)):oy(vg.bind(null,s)),rw(function(){(vt&6)===0&&qs()}),u=null;else{switch(fp(m)){case 1:u=Do;break;case 4:u=up;break;case 16:u=yu;break;case 536870912:u=cp;break;default:u=yu}u=Ng(u,xg.bind(null,s))}s.callbackPriority=a,s.callbackNode=u}}function xg(s,a){if(cc=-1,dc=0,(vt&6)!==0)throw Error(n(327));var u=s.callbackNode;if(za()&&s.callbackNode!==u)return null;var m=vu(s,s===En?_n:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||a)a=fc(s,m);else{a=m;var x=vt;vt|=2;var w=Tg();(En!==s||_n!==a)&&(vs=null,Ua=jt()+500,Bo(s,a));do try{Nw();break}catch(Y){Eg(s,Y)}while(!0);Mf(),oc.current=w,vt=x,mn!==null?a=0:(En=null,_n=0,a=xn)}if(a!==0){if(a===2&&(x=Qd(s),x!==0&&(m=x,a=yh(s,x))),a===1)throw u=ll,Bo(s,0),Zs(s,m),Kn(s,jt()),u;if(a===6)Zs(s,m);else{if(x=s.current.alternate,(m&30)===0&&!Cw(x)&&(a=fc(s,m),a===2&&(w=Qd(s),w!==0&&(m=w,a=yh(s,w))),a===1))throw u=ll,Bo(s,0),Zs(s,m),Kn(s,jt()),u;switch(s.finishedWork=x,s.finishedLanes=m,a){case 0:case 1:throw Error(n(345));case 2:Ho(s,Gn,vs);break;case 3:if(Zs(s,m),(m&130023424)===m&&(a=hh+500-jt(),10<a)){if(vu(s,0)!==0)break;if(x=s.suspendedLanes,(x&m)!==m){Un(),s.pingedLanes|=s.suspendedLanes&x;break}s.timeoutHandle=Tf(Ho.bind(null,s,Gn,vs),a);break}Ho(s,Gn,vs);break;case 4:if(Zs(s,m),(m&4194240)===m)break;for(a=s.eventTimes,x=-1;0<m;){var R=31-Or(m);w=1<<R,R=a[R],R>x&&(x=R),m&=~w}if(m=x,m=jt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*kw(m/1960))-m,10<m){s.timeoutHandle=Tf(Ho.bind(null,s,Gn,vs),m);break}Ho(s,Gn,vs);break;case 5:Ho(s,Gn,vs);break;default:throw Error(n(329))}}}return Kn(s,jt()),s.callbackNode===u?xg.bind(null,s):null}function yh(s,a){var u=ul;return s.current.memoizedState.isDehydrated&&(Bo(s,a).flags|=256),s=fc(s,a),s!==2&&(a=Gn,Gn=u,a!==null&&gh(a)),s}function gh(s){Gn===null?Gn=s:Gn.push.apply(Gn,s)}function Cw(s){for(var a=s;;){if(a.flags&16384){var u=a.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var m=0;m<u.length;m++){var x=u[m],w=x.getSnapshot;x=x.value;try{if(!Ar(w(),x))return!1}catch{return!1}}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Zs(s,a){for(a&=~fh,a&=~ac,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var u=31-Or(a),m=1<<u;s[u]=-1,a&=~m}}function vg(s){if((vt&6)!==0)throw Error(n(327));za();var a=vu(s,0);if((a&1)===0)return Kn(s,jt()),null;var u=fc(s,a);if(s.tag!==0&&u===2){var m=Qd(s);m!==0&&(a=m,u=yh(s,m))}if(u===1)throw u=ll,Bo(s,0),Zs(s,a),Kn(s,jt()),u;if(u===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,Ho(s,Gn,vs),Kn(s,jt()),null}function bh(s,a){var u=vt;vt|=1;try{return s(a)}finally{vt=u,vt===0&&(Ua=jt()+500,Bu&&qs())}}function Fo(s){Xs!==null&&Xs.tag===0&&(vt&6)===0&&za();var a=vt;vt|=1;var u=vr.transition,m=Ot;try{if(vr.transition=null,Ot=1,s)return s()}finally{Ot=m,vr.transition=u,vt=a,(vt&6)===0&&qs()}}function xh(){lr=Ha.current,zt(Ha)}function Bo(s,a){s.finishedWork=null,s.finishedLanes=0;var u=s.timeoutHandle;if(u!==-1&&(s.timeoutHandle=-1,nw(u)),mn!==null)for(u=mn.return;u!==null;){var m=u;switch(Nf(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&ju();break;case 3:ja(),zt(qn),zt(An),Uf();break;case 5:Bf(m);break;case 4:ja();break;case 13:zt(Qt);break;case 19:zt(Qt);break;case 10:Lf(m.type._context);break;case 22:case 23:xh()}u=u.return}if(En=s,mn=s=eo(s.current,null),_n=lr=a,xn=0,ll=null,fh=ac=jo=0,Gn=ul=null,Lo!==null){for(a=0;a<Lo.length;a++)if(u=Lo[a],m=u.interleaved,m!==null){u.interleaved=null;var x=m.next,w=u.pending;if(w!==null){var R=w.next;w.next=x,m.next=R}u.pending=m}Lo=null}return s}function Eg(s,a){do{var u=mn;try{if(Mf(),Gu.current=Zu,Ku){for(var m=Gt.memoizedState;m!==null;){var x=m.queue;x!==null&&(x.pending=null),m=m.next}Ku=!1}if(Po=0,vn=bn=Gt=null,nl=!1,rl=0,dh.current=null,u===null||u.return===null){xn=1,ll=a,mn=null;break}e:{var w=s,R=u.return,Y=u,K=a;if(a=_n,Y.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=K,Te=Y,Se=Te.tag;if((Te.mode&1)===0&&(Se===0||Se===11||Se===15)){var ve=Te.alternate;ve?(Te.updateQueue=ve.updateQueue,Te.memoizedState=ve.memoizedState,Te.lanes=ve.lanes):(Te.updateQueue=null,Te.memoizedState=null)}var Pe=qy(R);if(Pe!==null){Pe.flags&=-257,Vy(Pe,R,Y,w,a),Pe.mode&1&&$y(w,fe,a),a=Pe,K=fe;var Ye=a.updateQueue;if(Ye===null){var $e=new Set;$e.add(K),a.updateQueue=$e}else Ye.add(K);break e}else{if((a&1)===0){$y(w,fe,a),vh();break e}K=Error(n(426))}}else if(qt&&Y.mode&1){var ln=qy(R);if(ln!==null){(ln.flags&65536)===0&&(ln.flags|=256),Vy(ln,R,Y,w,a),Af(Fa(K,Y));break e}}w=K=Fa(K,Y),xn!==4&&(xn=2),ul===null?ul=[w]:ul.push(w),w=R;do{switch(w.tag){case 3:w.flags|=65536,a&=-a,w.lanes|=a;var ee=Wy(w,K,a);yy(w,ee);break e;case 1:Y=K;var J=w.type,se=w.stateNode;if((w.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Ks===null||!Ks.has(se)))){w.flags|=65536,a&=-a,w.lanes|=a;var De=Yy(w,Y,a);yy(w,De);break e}}w=w.return}while(w!==null)}Sg(u)}catch(Ve){a=Ve,mn===u&&u!==null&&(mn=u=u.return);continue}break}while(!0)}function Tg(){var s=oc.current;return oc.current=Zu,s===null?Zu:s}function vh(){(xn===0||xn===3||xn===2)&&(xn=4),En===null||(jo&268435455)===0&&(ac&268435455)===0||Zs(En,_n)}function fc(s,a){var u=vt;vt|=2;var m=Tg();(En!==s||_n!==a)&&(vs=null,Bo(s,a));do try{_w();break}catch(x){Eg(s,x)}while(!0);if(Mf(),vt=u,oc.current=m,mn!==null)throw Error(n(261));return En=null,_n=0,xn}function _w(){for(;mn!==null;)wg(mn)}function Nw(){for(;mn!==null&&!Ii();)wg(mn)}function wg(s){var a=_g(s.alternate,s,lr);s.memoizedProps=s.pendingProps,a===null?Sg(s):mn=a,dh.current=null}function Sg(s){var a=s;do{var u=a.alternate;if(s=a.return,(a.flags&32768)===0){if(u=vw(u,a,lr),u!==null){mn=u;return}}else{if(u=Ew(u,a),u!==null){u.flags&=32767,mn=u;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{xn=6,mn=null;return}}if(a=a.sibling,a!==null){mn=a;return}mn=a=s}while(a!==null);xn===0&&(xn=5)}function Ho(s,a,u){var m=Ot,x=vr.transition;try{vr.transition=null,Ot=1,Dw(s,a,u,m)}finally{vr.transition=x,Ot=m}return null}function Dw(s,a,u,m){do za();while(Xs!==null);if((vt&6)!==0)throw Error(n(327));u=s.finishedWork;var x=s.finishedLanes;if(u===null)return null;if(s.finishedWork=null,s.finishedLanes=0,u===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var w=u.lanes|u.childLanes;if(uT(s,w),s===En&&(mn=En=null,_n=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||lc||(lc=!0,Ng(yu,function(){return za(),null})),w=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||w){w=vr.transition,vr.transition=null;var R=Ot;Ot=1;var Y=vt;vt|=4,dh.current=null,ww(s,u),mg(u,s),GT(vf),wu=!!xf,vf=xf=null,s.current=u,Sw(u),va(),vt=Y,Ot=R,vr.transition=w}else s.current=u;if(lc&&(lc=!1,Xs=s,uc=x),w=s.pendingLanes,w===0&&(Ks=null),rT(u.stateNode),Kn(s,jt()),a!==null)for(m=s.onRecoverableError,u=0;u<a.length;u++)x=a[u],m(x.value,{componentStack:x.stack,digest:x.digest});if(ic)throw ic=!1,s=mh,mh=null,s;return(uc&1)!==0&&s.tag!==0&&za(),w=s.pendingLanes,(w&1)!==0?s===ph?cl++:(cl=0,ph=s):cl=0,qs(),null}function za(){if(Xs!==null){var s=fp(uc),a=vr.transition,u=Ot;try{if(vr.transition=null,Ot=16>s?16:s,Xs===null)var m=!1;else{if(s=Xs,Xs=null,uc=0,(vt&6)!==0)throw Error(n(331));var x=vt;for(vt|=4,He=s.current;He!==null;){var w=He,R=w.child;if((He.flags&16)!==0){var Y=w.deletions;if(Y!==null){for(var K=0;K<Y.length;K++){var fe=Y[K];for(He=fe;He!==null;){var Te=He;switch(Te.tag){case 0:case 11:case 15:il(8,Te,w)}var Se=Te.child;if(Se!==null)Se.return=Te,He=Se;else for(;He!==null;){Te=He;var ve=Te.sibling,Pe=Te.return;if(ug(Te),Te===fe){He=null;break}if(ve!==null){ve.return=Pe,He=ve;break}He=Pe}}}var Ye=w.alternate;if(Ye!==null){var $e=Ye.child;if($e!==null){Ye.child=null;do{var ln=$e.sibling;$e.sibling=null,$e=ln}while($e!==null)}}He=w}}if((w.subtreeFlags&2064)!==0&&R!==null)R.return=w,He=R;else e:for(;He!==null;){if(w=He,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:il(9,w,w.return)}var ee=w.sibling;if(ee!==null){ee.return=w.return,He=ee;break e}He=w.return}}var J=s.current;for(He=J;He!==null;){R=He;var se=R.child;if((R.subtreeFlags&2064)!==0&&se!==null)se.return=R,He=se;else e:for(R=J;He!==null;){if(Y=He,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:sc(9,Y)}}catch(Ve){rn(Y,Y.return,Ve)}if(Y===R){He=null;break e}var De=Y.sibling;if(De!==null){De.return=Y.return,He=De;break e}He=Y.return}}if(vt=x,qs(),qr&&typeof qr.onPostCommitFiberRoot=="function")try{qr.onPostCommitFiberRoot(gu,s)}catch{}m=!0}return m}finally{Ot=u,vr.transition=a}}return!1}function kg(s,a,u){a=Fa(u,a),a=Wy(s,a,1),s=Qs(s,a,1),a=Un(),s!==null&&(Li(s,1,a),Kn(s,a))}function rn(s,a,u){if(s.tag===3)kg(s,s,u);else for(;a!==null;){if(a.tag===3){kg(a,s,u);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ks===null||!Ks.has(m))){s=Fa(u,s),s=Yy(a,s,1),a=Qs(a,s,1),s=Un(),a!==null&&(Li(a,1,s),Kn(a,s));break}}a=a.return}}function Ow(s,a,u){var m=s.pingCache;m!==null&&m.delete(a),a=Un(),s.pingedLanes|=s.suspendedLanes&u,En===s&&(_n&u)===u&&(xn===4||xn===3&&(_n&130023424)===_n&&500>jt()-hh?Bo(s,0):fh|=u),Kn(s,a)}function Cg(s,a){a===0&&((s.mode&1)===0?a=1:(a=xu,xu<<=1,(xu&130023424)===0&&(xu=4194304)));var u=Un();s=gs(s,a),s!==null&&(Li(s,a,u),Kn(s,u))}function Aw(s){var a=s.memoizedState,u=0;a!==null&&(u=a.retryLane),Cg(s,u)}function Iw(s,a){var u=0;switch(s.tag){case 13:var m=s.stateNode,x=s.memoizedState;x!==null&&(u=x.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(a),Cg(s,u)}var _g;_g=function(s,a,u){if(s!==null)if(s.memoizedProps!==a.pendingProps||qn.current)Qn=!0;else{if((s.lanes&u)===0&&(a.flags&128)===0)return Qn=!1,xw(s,a,u);Qn=(s.flags&131072)!==0}else Qn=!1,qt&&(a.flags&1048576)!==0&&ay(a,Uu,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;nc(s,a),s=a.pendingProps;var x=Oa(a,An.current);Pa(a,u),x=Yf(null,a,m,s,x,u);var w=$f();return a.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Vn(m)?(w=!0,Fu(a)):w=!1,a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,jf(a),x.updater=ec,a.stateNode=x,x._reactInternals=a,Xf(a,m,s,u),a=th(null,a,m,!0,w,u)):(a.tag=0,qt&&w&&_f(a),Hn(null,a,x,u),a=a.child),a;case 16:m=a.elementType;e:{switch(nc(s,a),s=a.pendingProps,x=m._init,m=x(m._payload),a.type=m,x=a.tag=Lw(m),s=Mr(m,s),x){case 0:a=eh(null,a,m,s,u);break e;case 1:a=Zy(null,a,m,s,u);break e;case 11:a=Qy(null,a,m,s,u);break e;case 14:a=Gy(null,a,m,Mr(m.type,s),u);break e}throw Error(n(306,m,""))}return a;case 0:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),eh(s,a,m,x,u);case 1:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),Zy(s,a,m,x,u);case 3:e:{if(eg(a),s===null)throw Error(n(387));m=a.pendingProps,w=a.memoizedState,x=w.element,py(s,a),Vu(a,m,null,u);var R=a.memoizedState;if(m=R.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){x=Fa(Error(n(423)),a),a=tg(s,a,m,u,x);break e}else if(m!==x){x=Fa(Error(n(424)),a),a=tg(s,a,m,u,x);break e}else for(ir=Ws(a.stateNode.containerInfo.firstChild),ar=a,qt=!0,Ir=null,u=hy(a,null,m,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ma(),m===x){a=xs(s,a,u);break e}Hn(s,a,m,u)}a=a.child}return a;case 5:return by(a),s===null&&Of(a),m=a.type,x=a.pendingProps,w=s!==null?s.memoizedProps:null,R=x.children,Ef(m,x)?R=null:w!==null&&Ef(m,w)&&(a.flags|=32),Jy(s,a),Hn(s,a,R,u),a.child;case 6:return s===null&&Of(a),null;case 13:return ng(s,a,u);case 4:return Ff(a,a.stateNode.containerInfo),m=a.pendingProps,s===null?a.child=La(a,null,m,u):Hn(s,a,m,u),a.child;case 11:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),Qy(s,a,m,x,u);case 7:return Hn(s,a,a.pendingProps,u),a.child;case 8:return Hn(s,a,a.pendingProps.children,u),a.child;case 12:return Hn(s,a,a.pendingProps.children,u),a.child;case 10:e:{if(m=a.type._context,x=a.pendingProps,w=a.memoizedProps,R=x.value,Ft(Yu,m._currentValue),m._currentValue=R,w!==null)if(Ar(w.value,R)){if(w.children===x.children&&!qn.current){a=xs(s,a,u);break e}}else for(w=a.child,w!==null&&(w.return=a);w!==null;){var Y=w.dependencies;if(Y!==null){R=w.child;for(var K=Y.firstContext;K!==null;){if(K.context===m){if(w.tag===1){K=bs(-1,u&-u),K.tag=2;var fe=w.updateQueue;if(fe!==null){fe=fe.shared;var Te=fe.pending;Te===null?K.next=K:(K.next=Te.next,Te.next=K),fe.pending=K}}w.lanes|=u,K=w.alternate,K!==null&&(K.lanes|=u),Rf(w.return,u,a),Y.lanes|=u;break}K=K.next}}else if(w.tag===10)R=w.type===a.type?null:w.child;else if(w.tag===18){if(R=w.return,R===null)throw Error(n(341));R.lanes|=u,Y=R.alternate,Y!==null&&(Y.lanes|=u),Rf(R,u,a),R=w.sibling}else R=w.child;if(R!==null)R.return=w;else for(R=w;R!==null;){if(R===a){R=null;break}if(w=R.sibling,w!==null){w.return=R.return,R=w;break}R=R.return}w=R}Hn(s,a,x.children,u),a=a.child}return a;case 9:return x=a.type,m=a.pendingProps.children,Pa(a,u),x=br(x),m=m(x),a.flags|=1,Hn(s,a,m,u),a.child;case 14:return m=a.type,x=Mr(m,a.pendingProps),x=Mr(m.type,x),Gy(s,a,m,x,u);case 15:return Ky(s,a,a.type,a.pendingProps,u);case 17:return m=a.type,x=a.pendingProps,x=a.elementType===m?x:Mr(m,x),nc(s,a),a.tag=1,Vn(m)?(s=!0,Fu(a)):s=!1,Pa(a,u),Uy(a,m,x),Xf(a,m,x,u),th(null,a,m,!0,s,u);case 19:return sg(s,a,u);case 22:return Xy(s,a,u)}throw Error(n(156,a.tag))};function Ng(s,a){return No(s,a)}function Mw(s,a,u,m){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(s,a,u,m){return new Mw(s,a,u,m)}function Eh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Lw(s){if(typeof s=="function")return Eh(s)?1:0;if(s!=null){if(s=s.$$typeof,s===z)return 11;if(s===X)return 14}return 2}function eo(s,a){var u=s.alternate;return u===null?(u=Er(s.tag,a,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=a,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&14680064,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,a=s.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u}function hc(s,a,u,m,x,w){var R=2;if(m=s,typeof s=="function")Eh(s)&&(R=1);else if(typeof s=="string")R=5;else e:switch(s){case C:return Uo(u.children,x,w,a);case A:R=8,x|=8;break;case P:return s=Er(12,u,a,x|2),s.elementType=P,s.lanes=w,s;case Q:return s=Er(13,u,a,x),s.elementType=Q,s.lanes=w,s;case q:return s=Er(19,u,a,x),s.elementType=q,s.lanes=w,s;case ge:return mc(u,x,w,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case H:R=10;break e;case B:R=9;break e;case z:R=11;break e;case X:R=14;break e;case ie:R=16,m=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return a=Er(R,u,a,x),a.elementType=s,a.type=m,a.lanes=w,a}function Uo(s,a,u,m){return s=Er(7,s,m,a),s.lanes=u,s}function mc(s,a,u,m){return s=Er(22,s,m,a),s.elementType=ge,s.lanes=u,s.stateNode={isHidden:!1},s}function Th(s,a,u){return s=Er(6,s,null,a),s.lanes=u,s}function wh(s,a,u){return a=Er(4,s.children!==null?s.children:[],s.key,a),a.lanes=u,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function Rw(s,a,u,m,x){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gd(0),this.expirationTimes=Gd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gd(0),this.identifierPrefix=m,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Sh(s,a,u,m,x,w,R,Y,K){return s=new Rw(s,a,u,Y,K),a===1?(a=1,w===!0&&(a|=8)):a=0,w=Er(3,null,null,a),s.current=w,w.stateNode=s,w.memoizedState={element:m,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},jf(w),s}function Pw(s,a,u){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:m==null?null:""+m,children:s,containerInfo:a,implementation:u}}function Dg(s){if(!s)return $s;s=s._reactInternals;e:{if(Rt(s)!==s||s.tag!==1)throw Error(n(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(Vn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(s.tag===1){var u=s.type;if(Vn(u))return ry(s,u,a)}return a}function Og(s,a,u,m,x,w,R,Y,K){return s=Sh(u,m,!0,s,x,w,R,Y,K),s.context=Dg(null),u=s.current,m=Un(),x=Js(u),w=bs(m,x),w.callback=a??null,Qs(u,w,x),s.current.lanes=x,Li(s,x,m),Kn(s,m),s}function pc(s,a,u,m){var x=a.current,w=Un(),R=Js(x);return u=Dg(u),a.context===null?a.context=u:a.pendingContext=u,a=bs(w,R),a.payload={element:s},m=m===void 0?null:m,m!==null&&(a.callback=m),s=Qs(x,a,R),s!==null&&(Pr(s,x,R,w),qu(s,x,R)),R}function yc(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function Ag(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<a?u:a}}function kh(s,a){Ag(s,a),(s=s.alternate)&&Ag(s,a)}function jw(){return null}var Ig=typeof reportError=="function"?reportError:function(s){console.error(s)};function Ch(s){this._internalRoot=s}gc.prototype.render=Ch.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(n(409));pc(s,a,null,null)},gc.prototype.unmount=Ch.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;Fo(function(){pc(null,s,null,null)}),a[hs]=null}};function gc(s){this._internalRoot=s}gc.prototype.unstable_scheduleHydration=function(s){if(s){var a=pp();s={blockedOn:null,target:s,priority:a};for(var u=0;u<Hs.length&&a!==0&&a<Hs[u].priority;u++);Hs.splice(u,0,s),u===0&&bp(s)}};function _h(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function bc(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function Mg(){}function Fw(s,a,u,m,x){if(x){if(typeof m=="function"){var w=m;m=function(){var fe=yc(R);w.call(fe)}}var R=Og(a,m,s,0,null,!1,!1,"",Mg);return s._reactRootContainer=R,s[hs]=R.current,Qi(s.nodeType===8?s.parentNode:s),Fo(),R}for(;x=s.lastChild;)s.removeChild(x);if(typeof m=="function"){var Y=m;m=function(){var fe=yc(K);Y.call(fe)}}var K=Sh(s,0,!1,null,null,!1,!1,"",Mg);return s._reactRootContainer=K,s[hs]=K.current,Qi(s.nodeType===8?s.parentNode:s),Fo(function(){pc(a,K,u,m)}),K}function xc(s,a,u,m,x){var w=u._reactRootContainer;if(w){var R=w;if(typeof x=="function"){var Y=x;x=function(){var K=yc(R);Y.call(K)}}pc(a,R,s,x)}else R=Fw(u,a,s,x,m);return yc(R)}hp=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var u=Mi(a.pendingLanes);u!==0&&(Kd(a,u|1),Kn(a,jt()),(vt&6)===0&&(Ua=jt()+500,qs()))}break;case 13:Fo(function(){var m=gs(s,1);if(m!==null){var x=Un();Pr(m,s,1,x)}}),kh(s,1)}},Xd=function(s){if(s.tag===13){var a=gs(s,134217728);if(a!==null){var u=Un();Pr(a,s,134217728,u)}kh(s,134217728)}},mp=function(s){if(s.tag===13){var a=Js(s),u=gs(s,a);if(u!==null){var m=Un();Pr(u,s,a,m)}kh(s,a)}},pp=function(){return Ot},yp=function(s,a){var u=Ot;try{return Ot=s,a()}finally{Ot=u}},Ke=function(s,a,u){switch(a){case"input":if(we(s,u),a=u.name,u.type==="radio"&&a!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<u.length;a++){var m=u[a];if(m!==s&&m.form===s.form){var x=Pu(m);if(!x)throw Error(n(90));Ce(m),we(m,x)}}}break;case"textarea":pt(s,u);break;case"select":a=u.value,a!=null&&xe(s,!!u.multiple,a,!1)}},Yt=bh,en=Fo;var Bw={usingClientEntryPoint:!1,Events:[Xi,Na,Pu,ft,ze,bh]},dl={findFiberByHostInstance:Oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hw={bundleType:dl.bundleType,version:dl.version,rendererPackageName:dl.rendererPackageName,rendererConfig:dl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=pr(s),s===null?null:s.stateNode},findFiberByHostInstance:dl.findFiberByHostInstance||jw,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 vc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vc.isDisabled&&vc.supportsFiber)try{gu=vc.inject(Hw),qr=vc}catch{}}return Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bw,Xn.createPortal=function(s,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_h(a))throw Error(n(200));return Pw(s,a,null,u)},Xn.createRoot=function(s,a){if(!_h(s))throw Error(n(299));var u=!1,m="",x=Ig;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),a=Sh(s,1,!1,null,null,u,!1,m,x),s[hs]=a.current,Qi(s.nodeType===8?s.parentNode:s),new Ch(a)},Xn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=pr(a),s=s===null?null:s.stateNode,s},Xn.flushSync=function(s){return Fo(s)},Xn.hydrate=function(s,a,u){if(!bc(a))throw Error(n(200));return xc(null,s,a,!0,u)},Xn.hydrateRoot=function(s,a,u){if(!_h(s))throw Error(n(405));var m=u!=null&&u.hydratedSources||null,x=!1,w="",R=Ig;if(u!=null&&(u.unstable_strictMode===!0&&(x=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(R=u.onRecoverableError)),a=Og(a,null,s,1,u??null,x,!1,w,R),s[hs]=a.current,Qi(s),m)for(s=0;s<m.length;s++)u=m[s],x=u._getVersion,x=x(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,x]:a.mutableSourceEagerHydrationData.push(u,x);return new gc(a)},Xn.render=function(s,a,u){if(!bc(a))throw Error(n(200));return xc(null,s,a,!1,u)},Xn.unmountComponentAtNode=function(s){if(!bc(s))throw Error(n(40));return s._reactRootContainer?(Fo(function(){xc(null,null,s,!1,function(){s._reactRootContainer=null,s[hs]=null})}),!0):!1},Xn.unstable_batchedUpdates=bh,Xn.unstable_renderSubtreeIntoContainer=function(s,a,u,m){if(!bc(u))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return xc(s,a,u,!1,m)},Xn.version="18.3.1-next-f1338f8080-20240426",Xn}var Hg;function dd(){if(Hg)return Oh.exports;Hg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Oh.exports=Gw(),Oh.exports}var Ug;function Kw(){if(Ug)return Tc;Ug=1;var e=dd();return Tc.createRoot=e.createRoot,Tc.hydrateRoot=e.hydrateRoot,Tc}var Xw=Kw(),ha=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(){}},Jw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},uo,rm,ix,Zw=(ix=class{constructor(){Be(this,uo,Jw);Be(this,rm,!1)}setTimeoutProvider(e){Ae(this,uo,e)}setTimeout(e,t){return W(this,uo).setTimeout(e,t)}clearTimeout(e){W(this,uo).clearTimeout(e)}setInterval(e,t){return W(this,uo).setInterval(e,t)}clearInterval(e){W(this,uo).clearInterval(e)}},uo=new WeakMap,rm=new WeakMap,ix),$o=new Zw;function eS(e){setTimeout(e,0)}var aa=typeof window>"u"||"Deno"in globalThis;function Pn(){}function tS(e,t){return typeof e=="function"?e(t):e}function f0(e){return typeof e=="number"&&e>=0&&e!==1/0}function vx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function To(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function zg(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==sm(l,t.options))return!1}else if(!Yl(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||o&&o!==t.state.fetchStatus||i&&!i(t))}function Wg(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ia(t.options.mutationKey)!==ia(i))return!1}else if(!Yl(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function sm(e,t){return((t==null?void 0:t.queryKeyHashFn)||ia)(e)}function ia(e){return JSON.stringify(e,(t,n)=>h0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Yl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Yl(e[n],t[n])):!1}var nS=Object.prototype.hasOwnProperty;function om(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Yg(e)&&Yg(t);if(!r&&!(h0(e)&&h0(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,d=r?new Array(c):{};let h=0;for(let p=0;p<c;p++){const y=r?p:l[p],b=e[y],v=t[y];if(b===v){d[y]=b,(r?p<i:nS.call(e,y))&&h++;continue}if(b===null||v===null||typeof b!="object"||typeof v!="object"){d[y]=v;continue}const D=om(b,v,n+1);d[y]=D,D===b&&h++}return i===c&&h===i?e:d}function $l(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Yg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function h0(e){if(!$g(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$g(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $g(e){return Object.prototype.toString.call(e)==="[object Object]"}function rS(e){return new Promise(t=>{$o.setTimeout(t,e)})}function m0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?om(e,t):t}function sS(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oS(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var am=Symbol();function Ex(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===am?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function im(e,t){return typeof e=="function"?e(...t):!!e}function aS(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Go,co,Za,lx,iS=(lx=class extends ha{constructor(){super();Be(this,Go);Be(this,co);Be(this,Za);Ae(this,Za,t=>{if(!aa&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,co)||this.setEventListener(W(this,Za))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,co))==null||t.call(this),Ae(this,co,void 0))}setEventListener(t){var n;Ae(this,Za,t),(n=W(this,co))==null||n.call(this),Ae(this,co,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,Go)!==t&&(Ae(this,Go,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,Go)=="boolean"?W(this,Go):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Go=new WeakMap,co=new WeakMap,Za=new WeakMap,lx),lm=new iS;function p0(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var lS=eS;function uS(){let e=[],t=0,n=c=>{c()},r=c=>{c()},o=lS;const i=c=>{t?e.push(c):o(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&o(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||l()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{o=c}}}var Xt=uS(),ei,fo,ti,ux,cS=(ux=class extends ha{constructor(){super();Be(this,ei,!0);Be(this,fo);Be(this,ti);Ae(this,ti,t=>{if(!aa&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,fo)||this.setEventListener(W(this,ti))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,fo))==null||t.call(this),Ae(this,fo,void 0))}setEventListener(t){var n;Ae(this,ti,t),(n=W(this,fo))==null||n.call(this),Ae(this,fo,t(this.setOnline.bind(this)))}setOnline(t){W(this,ei)!==t&&(Ae(this,ei,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,ei)}},ei=new WeakMap,fo=new WeakMap,ti=new WeakMap,ux),qc=new cS;function dS(e){return Math.min(1e3*2**e,3e4)}function Tx(e){return(e??"online")==="online"?qc.isOnline():!0}var y0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wx(e){let t=!1,n=0,r;const o=p0(),i=()=>o.status!=="pending",l=S=>{var E;if(!i()){const T=new y0(S);b(T),(E=e.onCancel)==null||E.call(e,T)}},c=()=>{t=!0},d=()=>{t=!1},h=()=>lm.isFocused()&&(e.networkMode==="always"||qc.isOnline())&&e.canRun(),p=()=>Tx(e.networkMode)&&e.canRun(),y=S=>{i()||(r==null||r(),o.resolve(S))},b=S=>{i()||(r==null||r(),o.reject(S))},v=()=>new Promise(S=>{var E;r=T=>{(i()||h())&&S(T)},(E=e.onPause)==null||E.call(e)}).then(()=>{var S;r=void 0,i()||(S=e.onContinue)==null||S.call(e)}),D=()=>{if(i())return;let S;const E=n===0?e.initialPromise:void 0;try{S=E??e.fn()}catch(T){S=Promise.reject(T)}Promise.resolve(S).then(y).catch(T=>{var _;if(i())return;const k=e.retry??(aa?0:3),O=e.retryDelay??dS,I=typeof O=="function"?O(n,T):O,L=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,T);if(t||!L){b(T);return}n++,(_=e.onFail)==null||_.call(e,n,T),rS(I).then(()=>h()?void 0:v()).then(()=>{t?b(T):D()})})};return{promise:o,status:()=>o.status,cancel:l,continue:()=>(r==null||r(),o),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?D():v().then(D),o)}}var Ko,cx,Sx=(cx=class{constructor(){Be(this,Ko)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),f0(this.gcTime)&&Ae(this,Ko,$o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(aa?1/0:300*1e3))}clearGcTimeout(){W(this,Ko)&&($o.clearTimeout(W(this,Ko)),Ae(this,Ko,void 0))}},Ko=new WeakMap,cx),Xo,ni,wr,Jo,Sn,Kl,Zo,Br,Ts,dx,fS=(dx=class extends Sx{constructor(t){super();Be(this,Br);Be(this,Xo);Be(this,ni);Be(this,wr);Be(this,Jo);Be(this,Sn);Be(this,Kl);Be(this,Zo);Ae(this,Zo,!1),Ae(this,Kl,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ae(this,Jo,t.client),Ae(this,wr,W(this,Jo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ae(this,Xo,Vg(this.options)),this.state=t.state??W(this,Xo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,Sn))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Kl),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Vg(this.options);n.data!==void 0&&(this.setState(qg(n.data,n.dataUpdatedAt)),Ae(this,Xo,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,wr).remove(this)}setData(t,n){const r=m0(this.state.data,t,this.options);return st(this,Br,Ts).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){st(this,Br,Ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=W(this,Sn))==null?void 0:r.promise;return(o=W(this,Sn))==null||o.cancel(t),n?n.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Xo))}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===am||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>To(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:!vx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,Sn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,Sn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,wr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,Sn)&&(W(this,Zo)?W(this,Sn).cancel({revert:!0}):W(this,Sn).cancelRetry()),this.scheduleGc()),W(this,wr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||st(this,Br,Ts).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,p,y,b,v,D,S,E,T,k,O;if(this.state.fetchStatus!=="idle"&&((d=W(this,Sn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Sn))return W(this,Sn).continueRetry(),W(this,Sn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(L=>L.options.queryFn);I&&this.setOptions(I.options)}const r=new AbortController,o=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(Ae(this,Zo,!0),r.signal)})},i=()=>{const I=Ex(this.options,n),_=(()=>{const C={client:W(this,Jo),queryKey:this.queryKey,meta:this.meta};return o(C),C})();return Ae(this,Zo,!1),this.options.persister?this.options.persister(I,_,this):I(_)},c=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Jo),state:this.state,fetchFn:i};return o(I),I})();(h=this.options.behavior)==null||h.onFetch(c,this),Ae(this,ni,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&st(this,Br,Ts).call(this,{type:"fetch",meta:(y=c.fetchOptions)==null?void 0:y.meta}),Ae(this,Sn,wx({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:I=>{I instanceof y0&&I.revert&&this.setState({...W(this,ni),fetchStatus:"idle"}),r.abort()},onFail:(I,L)=>{st(this,Br,Ts).call(this,{type:"failed",failureCount:I,error:L})},onPause:()=>{st(this,Br,Ts).call(this,{type:"pause"})},onContinue:()=>{st(this,Br,Ts).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const I=await W(this,Sn).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(v=(b=W(this,wr).config).onSuccess)==null||v.call(b,I,this),(S=(D=W(this,wr).config).onSettled)==null||S.call(D,I,this.state.error,this),I}catch(I){if(I instanceof y0){if(I.silent)return W(this,Sn).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw st(this,Br,Ts).call(this,{type:"error",error:I}),(T=(E=W(this,wr).config).onError)==null||T.call(E,I,this),(O=(k=W(this,wr).config).onSettled)==null||O.call(k,this.state.data,I,this),I}finally{this.scheduleGc()}}},Xo=new WeakMap,ni=new WeakMap,wr=new WeakMap,Jo=new WeakMap,Sn=new WeakMap,Kl=new WeakMap,Zo=new WeakMap,Br=new WeakSet,Ts=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...kx(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...qg(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,ni,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Xt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,wr).notify({query:this,type:"updated",action:t})})},dx);function kx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qg(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vg(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var er,bt,Xl,zn,ea,ri,ks,ho,Jl,si,oi,ta,na,mo,ai,Nt,Al,g0,b0,x0,v0,E0,T0,w0,Cx,fx,um=(fx=class extends ha{constructor(t,n){super();Be(this,Nt);Be(this,er);Be(this,bt);Be(this,Xl);Be(this,zn);Be(this,ea);Be(this,ri);Be(this,ks);Be(this,ho);Be(this,Jl);Be(this,si);Be(this,oi);Be(this,ta);Be(this,na);Be(this,mo);Be(this,ai,new Set);this.options=n,Ae(this,er,t),Ae(this,ho,null),Ae(this,ks,p0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,bt).addObserver(this),Qg(W(this,bt),this.options)?st(this,Nt,Al).call(this):this.updateResult(),st(this,Nt,v0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S0(W(this,bt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S0(W(this,bt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,st(this,Nt,E0).call(this),st(this,Nt,T0).call(this),W(this,bt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,bt);if(this.options=W(this,er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,W(this,bt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");st(this,Nt,w0).call(this),W(this,bt).setOptions(this.options),n._defaulted&&!$l(this.options,n)&&W(this,er).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,bt),observer:this});const o=this.hasListeners();o&&Gg(W(this,bt),r,this.options,n)&&st(this,Nt,Al).call(this),this.updateResult(),o&&(W(this,bt)!==r||Cr(this.options.enabled,W(this,bt))!==Cr(n.enabled,W(this,bt))||To(this.options.staleTime,W(this,bt))!==To(n.staleTime,W(this,bt)))&&st(this,Nt,g0).call(this);const i=st(this,Nt,b0).call(this);o&&(W(this,bt)!==r||Cr(this.options.enabled,W(this,bt))!==Cr(n.enabled,W(this,bt))||i!==W(this,mo))&&st(this,Nt,x0).call(this,i)}getOptimisticResult(t){const n=W(this,er).getQueryCache().build(W(this,er),t),r=this.createResult(n,t);return mS(this,r)&&(Ae(this,zn,r),Ae(this,ri,this.options),Ae(this,ea,W(this,bt).state)),r}getCurrentResult(){return W(this,zn)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,ks).status==="pending"&&W(this,ks).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){W(this,ai).add(t)}getCurrentQuery(){return W(this,bt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,er).defaultQueryOptions(t),r=W(this,er).getQueryCache().build(W(this,er),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return st(this,Nt,Al).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,zn)))}createResult(t,n){var P;const r=W(this,bt),o=this.options,i=W(this,zn),l=W(this,ea),c=W(this,ri),h=t!==r?t.state:W(this,Xl),{state:p}=t;let y={...p},b=!1,v;if(n._optimisticResults){const H=this.hasListeners(),B=!H&&Qg(t,n),z=H&&Gg(t,r,n,o);(B||z)&&(y={...y,...kx(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:D,errorUpdatedAt:S,status:E}=y;v=y.data;let T=!1;if(n.placeholderData!==void 0&&v===void 0&&E==="pending"){let H;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(H=i.data,T=!0):H=typeof n.placeholderData=="function"?n.placeholderData((P=W(this,oi))==null?void 0:P.state.data,W(this,oi)):n.placeholderData,H!==void 0&&(E="success",v=m0(i==null?void 0:i.data,H,n),b=!0)}if(n.select&&v!==void 0&&!T)if(i&&v===(l==null?void 0:l.data)&&n.select===W(this,Jl))v=W(this,si);else try{Ae(this,Jl,n.select),v=n.select(v),v=m0(i==null?void 0:i.data,v,n),Ae(this,si,v),Ae(this,ho,null)}catch(H){Ae(this,ho,H)}W(this,ho)&&(D=W(this,ho),v=W(this,si),S=Date.now(),E="error");const k=y.fetchStatus==="fetching",O=E==="pending",I=E==="error",L=O&&k,_=v!==void 0,A={status:E,fetchStatus:y.fetchStatus,isPending:O,isSuccess:E==="success",isError:I,isInitialLoading:L,isLoading:L,data:v,dataUpdatedAt:y.dataUpdatedAt,error:D,errorUpdatedAt:S,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:k,isRefetching:k&&!O,isLoadingError:I&&!_,isPaused:y.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:I&&_,isStale:cm(t,n),refetch:this.refetch,promise:W(this,ks),isEnabled:Cr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const H=A.data!==void 0,B=A.status==="error"&&!H,z=X=>{B?X.reject(A.error):H&&X.resolve(A.data)},Q=()=>{const X=Ae(this,ks,A.promise=p0());z(X)},q=W(this,ks);switch(q.status){case"pending":t.queryHash===r.queryHash&&z(q);break;case"fulfilled":(B||A.data!==q.value)&&Q();break;case"rejected":(!B||A.error!==q.reason)&&Q();break}}return A}updateResult(){const t=W(this,zn),n=this.createResult(W(this,bt),this.options);if(Ae(this,ea,W(this,bt).state),Ae(this,ri,this.options),W(this,ea).data!==void 0&&Ae(this,oi,W(this,bt)),$l(n,t))return;Ae(this,zn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!W(this,ai).size)return!0;const l=new Set(i??W(this,ai));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,zn)).some(c=>{const d=c;return W(this,zn)[d]!==t[d]&&l.has(d)})};st(this,Nt,Cx).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&st(this,Nt,v0).call(this)}},er=new WeakMap,bt=new WeakMap,Xl=new WeakMap,zn=new WeakMap,ea=new WeakMap,ri=new WeakMap,ks=new WeakMap,ho=new WeakMap,Jl=new WeakMap,si=new WeakMap,oi=new WeakMap,ta=new WeakMap,na=new WeakMap,mo=new WeakMap,ai=new WeakMap,Nt=new WeakSet,Al=function(t){st(this,Nt,w0).call(this);let n=W(this,bt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pn)),n},g0=function(){st(this,Nt,E0).call(this);const t=To(this.options.staleTime,W(this,bt));if(aa||W(this,zn).isStale||!f0(t))return;const r=vx(W(this,zn).dataUpdatedAt,t)+1;Ae(this,ta,$o.setTimeout(()=>{W(this,zn).isStale||this.updateResult()},r))},b0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,bt)):this.options.refetchInterval)??!1},x0=function(t){st(this,Nt,T0).call(this),Ae(this,mo,t),!(aa||Cr(this.options.enabled,W(this,bt))===!1||!f0(W(this,mo))||W(this,mo)===0)&&Ae(this,na,$o.setInterval(()=>{(this.options.refetchIntervalInBackground||lm.isFocused())&&st(this,Nt,Al).call(this)},W(this,mo)))},v0=function(){st(this,Nt,g0).call(this),st(this,Nt,x0).call(this,st(this,Nt,b0).call(this))},E0=function(){W(this,ta)&&($o.clearTimeout(W(this,ta)),Ae(this,ta,void 0))},T0=function(){W(this,na)&&($o.clearInterval(W(this,na)),Ae(this,na,void 0))},w0=function(){const t=W(this,er).getQueryCache().build(W(this,er),this.options);if(t===W(this,bt))return;const n=W(this,bt);Ae(this,bt,t),Ae(this,Xl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cx=function(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,zn))}),W(this,er).getQueryCache().notify({query:W(this,bt),type:"observerResultsUpdated"})})},fx);function hS(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qg(e,t){return hS(e,t)||e.state.data!==void 0&&S0(e,t,t.refetchOnMount)}function S0(e,t,n){if(Cr(t.enabled,e)!==!1&&To(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&cm(e,t)}return!1}function Gg(e,t,n,r){return(e!==t||Cr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&cm(e,n)}function cm(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(To(t.staleTime,e))}function mS(e,t){return!$l(e.getCurrentResult(),t)}function Kg(e){return{onFetch:(t,n)=>{var p,y,b,v,D;const r=t.options,o=(b=(y=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:y.fetchMore)==null?void 0:b.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],l=((D=t.state.data)==null?void 0:D.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const h=async()=>{let S=!1;const E=O=>{aS(O,()=>t.signal,()=>S=!0)},T=Ex(t.options,t.fetchOptions),k=async(O,I,L)=>{if(S)return Promise.reject();if(I==null&&O.pages.length)return Promise.resolve(O);const C=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:I,direction:L?"backward":"forward",meta:t.options.meta};return E(B),B})(),A=await T(C),{maxPages:P}=t.options,H=L?oS:sS;return{pages:H(O.pages,A,P),pageParams:H(O.pageParams,I,P)}};if(o&&i.length){const O=o==="backward",I=O?pS:Xg,L={pages:i,pageParams:l},_=I(r,L);c=await k(L,_,O)}else{const O=e??i.length;do{const I=d===0?l[0]??r.initialPageParam:Xg(r,c);if(d>0&&I==null)break;c=await k(c,I),d++}while(d<O)}return c};t.options.persister?t.fetchFn=()=>{var S,E;return(E=(S=t.options).persister)==null?void 0:E.call(S,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function Xg(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pS(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Zl,es,Rn,ra,ts,ao,hx,yS=(hx=class extends Sx{constructor(t){super();Be(this,ts);Be(this,Zl);Be(this,es);Be(this,Rn);Be(this,ra);Ae(this,Zl,t.client),this.mutationId=t.mutationId,Ae(this,Rn,t.mutationCache),Ae(this,es,[]),this.state=t.state||_x(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,es).includes(t)||(W(this,es).push(t),this.clearGcTimeout(),W(this,Rn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ae(this,es,W(this,es).filter(n=>n!==t)),this.scheduleGc(),W(this,Rn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,es).length||(this.state.status==="pending"?this.scheduleGc():W(this,Rn).remove(this))}continue(){var t;return((t=W(this,ra))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,d,h,p,y,b,v,D,S,E,T,k,O,I,L,_,C;const n=()=>{st(this,ts,ao).call(this,{type:"continue"})},r={client:W(this,Zl),meta:this.options.meta,mutationKey:this.options.mutationKey};Ae(this,ra,wx({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,P)=>{st(this,ts,ao).call(this,{type:"failed",failureCount:A,error:P})},onPause:()=>{st(this,ts,ao).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Rn).canRun(this)}));const o=this.state.status==="pending",i=!W(this,ra).canStart();try{if(o)n();else{st(this,ts,ao).call(this,{type:"pending",variables:t,isPaused:i}),W(this,Rn).config.onMutate&&await W(this,Rn).config.onMutate(t,this,r);const P=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));P!==this.state.context&&st(this,ts,ao).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const A=await W(this,ra).start();return await((h=(d=W(this,Rn).config).onSuccess)==null?void 0:h.call(d,A,t,this.state.context,this,r)),await((y=(p=this.options).onSuccess)==null?void 0:y.call(p,A,t,this.state.context,r)),await((v=(b=W(this,Rn).config).onSettled)==null?void 0:v.call(b,A,null,this.state.variables,this.state.context,this,r)),await((S=(D=this.options).onSettled)==null?void 0:S.call(D,A,null,t,this.state.context,r)),st(this,ts,ao).call(this,{type:"success",data:A}),A}catch(A){try{await((T=(E=W(this,Rn).config).onError)==null?void 0:T.call(E,A,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((O=(k=this.options).onError)==null?void 0:O.call(k,A,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((L=(I=W(this,Rn).config).onSettled)==null?void 0:L.call(I,void 0,A,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((C=(_=this.options).onSettled)==null?void 0:C.call(_,void 0,A,t,this.state.context,r))}catch(P){Promise.reject(P)}throw st(this,ts,ao).call(this,{type:"error",error:A}),A}finally{W(this,Rn).runNext(this)}}},Zl=new WeakMap,es=new WeakMap,Rn=new WeakMap,ra=new WeakMap,ts=new WeakSet,ao=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Xt.batch(()=>{W(this,es).forEach(r=>{r.onMutationUpdate(t)}),W(this,Rn).notify({mutation:this,type:"updated",action:t})})},hx);function _x(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cs,Hr,eu,mx,gS=(mx=class extends ha{constructor(t={}){super();Be(this,Cs);Be(this,Hr);Be(this,eu);this.config=t,Ae(this,Cs,new Set),Ae(this,Hr,new Map),Ae(this,eu,0)}build(t,n,r){const o=new yS({client:t,mutationCache:this,mutationId:++Ec(this,eu)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){W(this,Cs).add(t);const n=wc(t);if(typeof n=="string"){const r=W(this,Hr).get(n);r?r.push(t):W(this,Hr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Cs).delete(t)){const n=wc(t);if(typeof n=="string"){const r=W(this,Hr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&W(this,Hr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=wc(t);if(typeof n=="string"){const r=W(this,Hr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=wc(t);if(typeof n=="string"){const o=(r=W(this,Hr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Xt.batch(()=>{W(this,Cs).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Cs).clear(),W(this,Hr).clear()})}getAll(){return Array.from(W(this,Cs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wg(n,r))}findAll(t={}){return this.getAll().filter(n=>Wg(t,n))}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Xt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pn))))}},Cs=new WeakMap,Hr=new WeakMap,eu=new WeakMap,mx);function wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _s,po,tr,Ns,Is,Uc,k0,px,bS=(px=class extends ha{constructor(n,r){super();Be(this,Is);Be(this,_s);Be(this,po);Be(this,tr);Be(this,Ns);Ae(this,_s,n),this.setOptions(r),this.bindMethods(),st(this,Is,Uc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=W(this,_s).defaultMutationOptions(n),$l(this.options,r)||W(this,_s).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,tr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ia(r.mutationKey)!==ia(this.options.mutationKey)?this.reset():((o=W(this,tr))==null?void 0:o.state.status)==="pending"&&W(this,tr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,tr))==null||n.removeObserver(this)}onMutationUpdate(n){st(this,Is,Uc).call(this),st(this,Is,k0).call(this,n)}getCurrentResult(){return W(this,po)}reset(){var n;(n=W(this,tr))==null||n.removeObserver(this),Ae(this,tr,void 0),st(this,Is,Uc).call(this),st(this,Is,k0).call(this)}mutate(n,r){var o;return Ae(this,Ns,r),(o=W(this,tr))==null||o.removeObserver(this),Ae(this,tr,W(this,_s).getMutationCache().build(W(this,_s),this.options)),W(this,tr).addObserver(this),W(this,tr).execute(n)}},_s=new WeakMap,po=new WeakMap,tr=new WeakMap,Ns=new WeakMap,Is=new WeakSet,Uc=function(){var r;const n=((r=W(this,tr))==null?void 0:r.state)??_x();Ae(this,po,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},k0=function(n){Xt.batch(()=>{var r,o,i,l,c,d,h,p;if(W(this,Ns)&&this.hasListeners()){const y=W(this,po).variables,b=W(this,po).context,v={client:W(this,_s),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(o=(r=W(this,Ns)).onSuccess)==null||o.call(r,n.data,y,b,v)}catch(D){Promise.reject(D)}try{(l=(i=W(this,Ns)).onSettled)==null||l.call(i,n.data,null,y,b,v)}catch(D){Promise.reject(D)}}else if((n==null?void 0:n.type)==="error"){try{(d=(c=W(this,Ns)).onError)==null||d.call(c,n.error,y,b,v)}catch(D){Promise.reject(D)}try{(p=(h=W(this,Ns)).onSettled)==null||p.call(h,void 0,n.error,y,b,v)}catch(D){Promise.reject(D)}}}this.listeners.forEach(y=>{y(W(this,po))})})},px);function Jg(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function xS(e,t,n){const r=e.slice(0);return r[t]=n,r}var ii,cr,li,ui,Sr,yo,tu,nu,ru,su,Nn,C0,_0,N0,D0,O0,yx,vS=(yx=class extends ha{constructor(t,n,r){super();Be(this,Nn);Be(this,ii);Be(this,cr);Be(this,li);Be(this,ui);Be(this,Sr);Be(this,yo);Be(this,tu);Be(this,nu);Be(this,ru);Be(this,su,[]);Ae(this,ii,t),Ae(this,ui,r),Ae(this,li,[]),Ae(this,Sr,[]),Ae(this,cr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,Sr).forEach(t=>{t.subscribe(n=>{st(this,Nn,D0).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,Sr).forEach(t=>{t.destroy()})}setQueries(t,n){Ae(this,li,t),Ae(this,ui,n),Xt.batch(()=>{const r=W(this,Sr),o=st(this,Nn,N0).call(this,W(this,li));o.forEach(y=>y.observer.setOptions(y.defaultedQueryOptions));const i=o.map(y=>y.observer),l=i.map(y=>y.getCurrentResult()),c=r.length!==i.length,d=i.some((y,b)=>y!==r[b]),h=c||d,p=h?!0:l.some((y,b)=>{const v=W(this,cr)[b];return!v||!$l(y,v)});!h&&!p||(h&&(Ae(this,su,o),Ae(this,Sr,i)),Ae(this,cr,l),this.hasListeners()&&(h&&(Jg(r,i).forEach(y=>{y.destroy()}),Jg(i,r).forEach(y=>{y.subscribe(b=>{st(this,Nn,D0).call(this,y,b)})})),st(this,Nn,O0).call(this)))})}getCurrentResult(){return W(this,cr)}getQueries(){return W(this,Sr).map(t=>t.getCurrentQuery())}getObservers(){return W(this,Sr)}getOptimisticResult(t,n){const r=st(this,Nn,N0).call(this,t),o=r.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),i=r.map(l=>l.defaultedQueryOptions.queryHash);return[o,l=>st(this,Nn,_0).call(this,l??o,n,i),()=>st(this,Nn,C0).call(this,o,r)]}},ii=new WeakMap,cr=new WeakMap,li=new WeakMap,ui=new WeakMap,Sr=new WeakMap,yo=new WeakMap,tu=new WeakMap,nu=new WeakMap,ru=new WeakMap,su=new WeakMap,Nn=new WeakSet,C0=function(t,n){return n.map((r,o)=>{const i=t[o];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,l=>{n.forEach(c=>{c.observer.trackProp(l)})})})},_0=function(t,n,r){if(n){const o=W(this,ru),i=r!==void 0&&o!==void 0&&(o.length!==r.length||r.some((l,c)=>l!==o[c]));return(!W(this,yo)||W(this,cr)!==W(this,nu)||i||n!==W(this,tu))&&(Ae(this,tu,n),Ae(this,nu,W(this,cr)),r!==void 0&&Ae(this,ru,r),Ae(this,yo,om(W(this,yo),n(t)))),W(this,yo)}return t},N0=function(t){const n=new Map;W(this,Sr).forEach(o=>{const i=o.options.queryHash;if(!i)return;const l=n.get(i);l?l.push(o):n.set(i,[o])});const r=[];return t.forEach(o=>{var d;const i=W(this,ii).defaultQueryOptions(o),c=((d=n.get(i.queryHash))==null?void 0:d.shift())??new um(W(this,ii),i);r.push({defaultedQueryOptions:i,observer:c})}),r},D0=function(t,n){const r=W(this,Sr).indexOf(t);r!==-1&&(Ae(this,cr,xS(W(this,cr),r,n)),st(this,Nn,O0).call(this))},O0=function(){var t;if(this.hasListeners()){const n=W(this,yo),r=st(this,Nn,C0).call(this,W(this,cr),W(this,su)),o=st(this,Nn,_0).call(this,r,(t=W(this,ui))==null?void 0:t.combine);n!==o&&Xt.batch(()=>{this.listeners.forEach(i=>{i(W(this,cr))})})}},yx),ns,gx,ES=(gx=class extends ha{constructor(t={}){super();Be(this,ns);this.config=t,Ae(this,ns,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??sm(o,n);let l=this.get(i);return l||(l=new fS({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){W(this,ns).has(t.queryHash)||(W(this,ns).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,ns).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,ns).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,ns).get(t)}getAll(){return[...W(this,ns).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>zg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>zg(t,r)):n}notify(t){Xt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ns=new WeakMap,gx),sn,go,bo,ci,di,xo,fi,hi,bx,TS=(bx=class{constructor(e={}){Be(this,sn);Be(this,go);Be(this,bo);Be(this,ci);Be(this,di);Be(this,xo);Be(this,fi);Be(this,hi);Ae(this,sn,e.queryCache||new ES),Ae(this,go,e.mutationCache||new gS),Ae(this,bo,e.defaultOptions||{}),Ae(this,ci,new Map),Ae(this,di,new Map),Ae(this,xo,0)}mount(){Ec(this,xo)._++,W(this,xo)===1&&(Ae(this,fi,lm.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,sn).onFocus())})),Ae(this,hi,qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,sn).onOnline())})))}unmount(){var e,t;Ec(this,xo)._--,W(this,xo)===0&&((e=W(this,fi))==null||e.call(this),Ae(this,fi,void 0),(t=W(this,hi))==null||t.call(this),Ae(this,hi,void 0))}isFetching(e){return W(this,sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,go).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,sn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(To(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,sn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=W(this,sn).get(r.queryHash),i=o==null?void 0:o.state.data,l=tS(t,i);if(l!==void 0)return W(this,sn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Xt.batch(()=>W(this,sn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,sn);Xt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,sn);return Xt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Xt.batch(()=>W(this,sn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Pn).catch(Pn)}invalidateQueries(e,t={}){return Xt.batch(()=>(W(this,sn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Xt.batch(()=>W(this,sn).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Pn)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Pn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,sn).build(this,t);return n.isStaleByTime(To(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pn).catch(Pn)}fetchInfiniteQuery(e){return e.behavior=Kg(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pn).catch(Pn)}ensureInfiniteQueryData(e){return e.behavior=Kg(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return qc.isOnline()?W(this,go).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,sn)}getMutationCache(){return W(this,go)}getDefaultOptions(){return W(this,bo)}setDefaultOptions(e){Ae(this,bo,e)}setQueryDefaults(e,t){W(this,ci).set(ia(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,ci).values()],n={};return t.forEach(r=>{Yl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,di).set(ia(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,di).values()],n={};return t.forEach(r=>{Yl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,bo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sm(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===am&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,bo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,sn).clear(),W(this,go).clear()}},sn=new WeakMap,go=new WeakMap,bo=new WeakMap,ci=new WeakMap,di=new WeakMap,xo=new WeakMap,fi=new WeakMap,hi=new WeakMap,bx),Nx=N.createContext(void 0),Wn=e=>{const t=N.useContext(Nx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wS=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Nx.Provider,{value:e,children:t})),Dx=N.createContext(!1),Ox=()=>N.useContext(Dx);Dx.Provider;function SS(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kS=N.createContext(SS()),Ax=()=>N.useContext(kS),Ix=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?im(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Mx=e=>{N.useEffect(()=>{e.clearReset()},[e])},Lx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||im(n,[e.error,r])),Rx=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Px=(e,t)=>e.isLoading&&e.isFetching&&!t,A0=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Vc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zg({queries:e,...t},n){const r=Wn(),o=Ox(),i=Ax(),l=N.useMemo(()=>e.map(S=>{const E=r.defaultQueryOptions(S);return E._optimisticResults=o?"isRestoring":"optimistic",E}),[e,r,o]);l.forEach(S=>{Rx(S);const E=r.getQueryCache().get(S.queryHash);Ix(S,i,E)}),Mx(i);const[c]=N.useState(()=>new vS(r,l,t)),[d,h,p]=c.getOptimisticResult(l,t.combine),y=!o&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?c.subscribe(Xt.batchCalls(S)):Pn,[c,y]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=d.some((S,E)=>A0(l[E],S))?d.flatMap((S,E)=>{const T=l[E];if(T){const k=new um(r,T);if(A0(T,S))return Vc(T,k,i);Px(S,o)&&Vc(T,k,i)}return[]}):[];if(v.length>0)throw Promise.all(v);const D=d.find((S,E)=>{const T=l[E];return T&&Lx({result:S,errorResetBoundary:i,throwOnError:T.throwOnError,query:r.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(D!=null&&D.error)throw D.error;return h(p())}function CS(e,t,n){var b,v,D,S;const r=Ox(),o=Ax(),i=Wn(),l=i.defaultQueryOptions(e);(v=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||v.call(b,l);const c=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",Rx(l),Ix(l,o,c),Mx(o);const d=!i.getQueryCache().get(l.queryHash),[h]=N.useState(()=>new t(i,l)),p=h.getOptimisticResult(l),y=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(E=>{const T=y?h.subscribe(Xt.batchCalls(E)):Pn;return h.updateResult(),T},[h,y]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(l)},[l,h]),A0(l,p))throw Vc(l,h,o);if(Lx({result:p,errorResetBoundary:o,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;if((S=(D=i.getDefaultOptions().queries)==null?void 0:D._experimental_afterQuery)==null||S.call(D,l,p),l.experimental_prefetchInRender&&!aa&&Px(p,r)){const E=d?Vc(l,h,o):c==null?void 0:c.promise;E==null||E.catch(Pn).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function hr(e,t){return CS(e,um)}function _S(e,t){const n=Wn(),r=n.getQueryCache();return N.useSyncExternalStore(N.useCallback(o=>r.subscribe(Xt.batchCalls(o)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Ka(e,t){const n=Wn(),[r]=N.useState(()=>new bS(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const o=N.useSyncExternalStore(N.useCallback(l=>r.subscribe(Xt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=N.useCallback((l,c)=>{r.mutate(l,c).catch(Pn)},[r]);if(o.error&&im(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function NS({children:e}){const[t]=N.useState(()=>new TS({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return f.jsx(wS,{client:t,children:e})}const DS="modulepreload",OS=function(e){return"/"+e},e1={},ls=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));o=l(n.map(h=>{if(h=OS(h),h in e1)return;e1[h]=!0;const p=h.endsWith(".css"),y=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":DS,p||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),p)return new Promise((v,D)=>{b.addEventListener("load",v),b.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},t1={md:768,lg:1024};function n1(e){return e>=t1.lg?"lg":e>=t1.md?"md":"sm"}function dm(){const[e,t]=N.useState(()=>typeof window<"u"?n1(window.innerWidth):"lg");return N.useEffect(()=>{function n(){t(n1(window.innerWidth))}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const fm="/api";class ou extends Error{constructor(t,n,r){super(n),this.status=t,this.errorType=r,this.name="ApiError"}}async function Et(e,t){const n={...t==null?void 0:t.headers};t!=null&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${fm}${e}`,{credentials:"include",...t,headers:n});if(!r.ok){const o=await r.json().catch(()=>({error:"Unknown error"}));throw new ou(r.status,o.error||`HTTP ${r.status}`,o.errorType)}return r.json()}async function Sc(e,t){const n=await fetch(`${fm}${e}`,{credentials:"omit",...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Unknown error"}));throw new ou(n.status,r.error||`HTTP ${n.status}`,r.errorType)}return n.json()}const xt={getHealth:()=>Et("/health"),reconnect:()=>Et("/connections/reconnect",{method:"POST",body:"{}"}),getConfig:()=>Et("/config"),getChart:e=>Et(`/charts/${encodeURIComponent(e)}`),queryChart:(e,t={},n={})=>Et(`/charts/${encodeURIComponent(e)}/query${n.includeConfig?"?includeConfig=true":""}`,{method:"POST",body:JSON.stringify(t)}),queryChartsBatch:(e,t={})=>Et("/charts/batch",{method:"POST",body:JSON.stringify({charts:e,includeConfig:t.includeConfig})}),queryChartDetail:(e,t={})=>Et(`/charts/${encodeURIComponent(e)}/detail`,{method:"POST",body:JSON.stringify(t)}),invalidateChart:e=>Et(`/charts/${encodeURIComponent(e)}/invalidate`,{method:"POST"}),getChartEvents:()=>Et("/chart-events"),createChartEvent:e=>Et("/chart-events",{method:"POST",body:JSON.stringify(e)}),deleteChartEvent:e=>Et(`/chart-events/${e}`,{method:"DELETE"}),updateChartEvent:(e,t)=>Et(`/chart-events/${e}`,{method:"PUT",body:JSON.stringify(t)}),getParameterOptions:(e,t)=>Et(`/charts/${encodeURIComponent(e)}/parameters/${encodeURIComponent(t)}/options`),getModelOptions:(e,t,n)=>Et(`/models/${encodeURIComponent(e)}/options?value_field=${encodeURIComponent(t)}&label_field=${encodeURIComponent(n)}`),getDashboards:()=>Et("/dashboards"),getDashboard:(e,t)=>{const n=t?`/dashboards/${encodeURIComponent(e)}?branch=${encodeURIComponent(t)}`:`/dashboards/${encodeURIComponent(e)}`;return Et(n)},saveDashboard:(e,t,n,r)=>Et(`/dashboards/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(r?{tab:r,tabLayout:t,message:n}:{layout:t,message:n})}),warmDashboardCache:(e,t={},n)=>Et(`/dashboards/${encodeURIComponent(e)}/warm-cache`,{method:"POST",body:JSON.stringify({params:t,...n?{tab:n}:{}})}),getBranches:()=>Et("/git/branches"),createBranch:(e,t)=>Et("/git/branches",{method:"POST",body:JSON.stringify({name:e,from:t})}),checkoutBranch:e=>Et("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),getAuthMe:async()=>{const e=await fetch(`${fm}/auth/me`,{credentials:"include",headers:{"Content-Type":"application/json"}});if(e.status===401)return{providers:(await e.json().catch(()=>({}))).providers};if(!e.ok)throw new ou(e.status,`HTTP ${e.status}`);return e.json()},authSetup:e=>Et("/auth/setup",{method:"POST",body:JSON.stringify(e)}),authLogin:e=>Et("/auth/login",{method:"POST",body:JSON.stringify(e)}),authLogout:()=>Et("/auth/logout",{method:"POST"}),authChangePassword:e=>Et("/auth/me/password",{method:"PUT",body:JSON.stringify(e)}),authListUsers:()=>Et("/auth/users"),authCreateUser:e=>Et("/auth/users",{method:"POST",body:JSON.stringify(e)}),authUpdateUser:(e,t)=>Et(`/auth/users/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),authDeleteUser:e=>Et(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"}),createShareLink:e=>Et("/shares",{method:"POST",body:JSON.stringify(e)}),listShareLinks:()=>Et("/shares"),revokeShareLink:e=>Et(`/shares/${encodeURIComponent(e)}`,{method:"DELETE"}),getPublicConfig:e=>Sc(`/public/config?share_token=${encodeURIComponent(e)}`),getPublicDashboard:(e,t)=>Sc(`/public/dashboards/${encodeURIComponent(e)}?share_token=${encodeURIComponent(t)}`),queryPublicChart:(e,t,n,r=!1)=>{const o=new URLSearchParams({share_token:n});return r&&o.set("includeConfig","true"),Sc(`/public/charts/${encodeURIComponent(e)}/query?${o}`,{method:"POST",body:JSON.stringify(t)})},queryPublicChartBatch:(e,t,n=!1)=>Sc(`/public/charts/batch?share_token=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({charts:e,includeConfig:n})}),generateText:e=>Et("/chat/generate-text",{method:"POST",body:JSON.stringify(e)})};function ma(){return hr({queryKey:["config"],queryFn:xt.getConfig,staleTime:1/0})}function AS(){return hr({queryKey:["health"],queryFn:xt.getHealth,refetchInterval:3e4})}function jx(e){return hr({queryKey:["chart",e],queryFn:()=>xt.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const r1=e=>{let t;const n=new Set,r=(h,p)=>{const y=typeof h=="function"?h(t):h;if(!Object.is(y,t)){const b=t;t=p??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(v=>v(t,b))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,o,c);return c},IS=(e=>e?r1(e):r1),MS=e=>e;function LS(e,t=MS){const n=Me.useSyncExternalStore(e.subscribe,Me.useCallback(()=>t(e.getState()),[e,t]),Me.useCallback(()=>t(e.getInitialState()),[e,t]));return Me.useDebugValue(n),n}const s1=e=>{const t=IS(e),n=r=>LS(t,r);return Object.assign(n,t),n},Fx=(e=>e?s1(e):s1),Je=Fx((e,t)=>({globalFilters:{},chartFilters:{},crossFilters:{},setGlobalFilter:(n,r)=>e(o=>{if(r==null){const{[n]:i,...l}=o.globalFilters;return{globalFilters:l}}return{globalFilters:{...o.globalFilters,[n]:r}}}),setChartFilter:(n,r,o)=>e(i=>{if(o==null){const l=i.chartFilters[n];if(!l)return i;const{[r]:c,...d}=l;return{chartFilters:{...i.chartFilters,[n]:d}}}return{chartFilters:{...i.chartFilters,[n]:{...i.chartFilters[n],[r]:o}}}}),setCrossFilter:(n,r,o,i)=>e(l=>{const c=l.crossFilters[n];if(c&&c.value===r){const{[n]:d,...h}=l.crossFilters;return{crossFilters:h}}return{crossFilters:{...l.crossFilters,[n]:{field:n,value:r,sourceChart:o,temporal:i}}}}),clearCrossFilter:n=>e(r=>{const{[n]:o,...i}=r.crossFilters;return{crossFilters:i}}),clearAllCrossFilters:()=>e({crossFilters:{}}),getEffectiveFilters:n=>{const{globalFilters:r,crossFilters:o,chartFilters:i}=t(),l={};for(const c of Object.values(o))c.sourceChart!==n&&(l[c.field]=[c.value],c.temporal&&c.value&&(l.start_date=c.value,l.end_date=c.value));return{...r,...l,...i[n]}},resetFilters:()=>e({globalFilters:{},chartFilters:{},crossFilters:{}}),resetChartFilters:n=>e(r=>{const{[n]:o,...i}=r.chartFilters;return{chartFilters:i}})})),Bx=6048e5,RS=864e5,hm=6e4,mm=36e5,PS=1e3,o1=Symbol.for("constructDateFrom");function Dt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&o1 in e?e[o1](t):e instanceof Date?new e.constructor(t):new Date(t)}function dt(e,t){return Dt(t||e,e)}function Ms(e,t,n){const r=dt(e,n==null?void 0:n.in);return isNaN(t)?Dt((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function vi(e,t,n){const r=dt(e,n==null?void 0:n.in);if(isNaN(t))return Dt((n==null?void 0:n.in)||e,NaN);if(!t)return r;const o=r.getDate(),i=Dt((n==null?void 0:n.in)||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const l=i.getDate();return o>=l?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}let jS={};function pa(){return jS}function zr(e,t){var c,d,h,p;const n=pa(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,o=dt(e,t==null?void 0:t.in),i=o.getDay(),l=(i<r?7:0)+i-r;return o.setDate(o.getDate()-l),o.setHours(0,0,0,0),o}function la(e,t){return zr(e,{...t,weekStartsOn:1})}function Hx(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getFullYear(),o=Dt(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const i=la(o),l=Dt(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const c=la(l);return n.getTime()>=i.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Qc(e){const t=dt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ei(e,...t){const n=Dt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ua(e,t){const n=dt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function pm(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t),i=ua(r),l=ua(o),c=+i-Qc(i),d=+l-Qc(l);return Math.round((c-d)/RS)}function FS(e,t){const n=Hx(e,t),r=Dt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),la(r)}function ym(e,t,n){return vi(e,t*3,n)}function fd(e,t,n){return Ms(e,t*7,n)}function hd(e,t,n){return vi(e,t*12,n)}function BS(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Dt.bind(null,o));const i=dt(o,r);(!n||n<i||isNaN(+i))&&(n=i)}),Dt(r,n||NaN)}function HS(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=Dt.bind(null,o));const i=dt(o,r);(!n||n>i||isNaN(+i))&&(n=i)}),Dt(r,n||NaN)}function US(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t);return+ua(r)==+ua(o)}function Ux(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zS(e){return!(!Ux(e)&&typeof e!="number"||isNaN(+dt(e)))}function zx(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t),i=r.getFullYear()-o.getFullYear(),l=r.getMonth()-o.getMonth();return i*12+l}function WS(e,t){const n=dt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function md(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Wx(e,t){const[n,r]=Ei(e,t.start,t.end);return{start:n,end:r}}function YS(e,t){const{start:n,end:r}=Wx(t==null?void 0:t.in,e);let o=+n>+r;const i=o?+n:+r,l=o?r:n;l.setHours(0,0,0,0),l.setDate(1);let c=1;const d=[];for(;+l<=i;)d.push(Dt(n,l)),l.setMonth(l.getMonth()+c);return o?d.reverse():d}function Gc(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function ql(e,t){const n=dt(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function pd(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function mi(e,t){const n=dt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function $S(e,t){const{start:n,end:r}=Wx(t==null?void 0:t.in,e);let o=+n>+r;const i=o?+n:+r,l=o?r:n;l.setHours(0,0,0,0),l.setMonth(0,1);let c=1;const d=[];for(;+l<=i;)d.push(Dt(n,l)),l.setFullYear(l.getFullYear()+c);return o?d.reverse():d}function yd(e,t){var c,d,h,p;const n=pa(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,o=dt(e,t==null?void 0:t.in),i=o.getDay(),l=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+l),o.setHours(23,59,59,999),o}function qS(e,t){return yd(e,{...t,weekStartsOn:1})}function gm(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getMonth(),o=r-r%3+3;return n.setMonth(o,0),n.setHours(23,59,59,999),n}const VS={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"}},QS=(e,t,n)=>{let r;const o=VS[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Mh(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const GS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},KS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},XS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},JS={date:Mh({formats:GS,defaultWidth:"full"}),time:Mh({formats:KS,defaultWidth:"full"}),dateTime:Mh({formats:XS,defaultWidth:"full"})},ZS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ek=(e,t,n,r)=>ZS[e];function hl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):l;o=e.formattingValues[c]||e.formattingValues[l]}else{const l=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[c]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const tk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rk={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"]},sk={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"]},ok={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"}},ak={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"}},ik=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},lk={ordinalNumber:ik,era:hl({values:tk,defaultWidth:"wide"}),quarter:hl({values:nk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hl({values:rk,defaultWidth:"wide"}),day:hl({values:sk,defaultWidth:"wide"}),dayPeriod:hl({values:ok,defaultWidth:"wide",formattingValues:ak,defaultFormattingWidth:"wide"})};function ml(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const l=i[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?ck(c,y=>y.test(l)):uk(c,y=>y.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const p=t.slice(l.length);return{value:h,rest:p}}}function uk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ck(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function dk(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(o.length);return{value:l,rest:c}}}const fk=/^(\d+)(th|st|nd|rd)?/i,hk=/\d+/i,mk={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},pk={any:[/^b/i,/^(a|c)/i]},yk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gk={any:[/1/i,/2/i,/3/i,/4/i]},bk={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},xk={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]},vk={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},Ek={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]},Tk={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},wk={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}},Sk={ordinalNumber:dk({matchPattern:fk,parsePattern:hk,valueCallback:e=>parseInt(e,10)}),era:ml({matchPatterns:mk,defaultMatchWidth:"wide",parsePatterns:pk,defaultParseWidth:"any"}),quarter:ml({matchPatterns:yk,defaultMatchWidth:"wide",parsePatterns:gk,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ml({matchPatterns:bk,defaultMatchWidth:"wide",parsePatterns:xk,defaultParseWidth:"any"}),day:ml({matchPatterns:vk,defaultMatchWidth:"wide",parsePatterns:Ek,defaultParseWidth:"any"}),dayPeriod:ml({matchPatterns:Tk,defaultMatchWidth:"any",parsePatterns:wk,defaultParseWidth:"any"})},Yo={code:"en-US",formatDistance:QS,formatLong:JS,formatRelative:ek,localize:lk,match:Sk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kk(e,t){const n=dt(e,t==null?void 0:t.in);return pm(n,mi(n))+1}function gd(e,t){const n=dt(e,t==null?void 0:t.in),r=+la(n)-+FS(n);return Math.round(r/Bx)+1}function bm(e,t){var p,y,b,v;const n=dt(e,t==null?void 0:t.in),r=n.getFullYear(),o=pa(),i=(t==null?void 0:t.firstWeekContainsDate)??((y=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??o.firstWeekContainsDate??((v=(b=o.locale)==null?void 0:b.options)==null?void 0:v.firstWeekContainsDate)??1,l=Dt((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const c=zr(l,t),d=Dt((t==null?void 0:t.in)||e,0);d.setFullYear(r,0,i),d.setHours(0,0,0,0);const h=zr(d,t);return+n>=+c?r+1:+n>=+h?r:r-1}function Ck(e,t){var c,d,h,p;const n=pa(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=bm(e,t),i=Dt((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),zr(i,t)}function bd(e,t){const n=dt(e,t==null?void 0:t.in),r=+zr(n,t)-+Ck(n,t);return Math.round(r/Bx)+1}function At(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const no={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return At(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):At(n+1,2)},d(e,t){return At(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return At(e.getHours()%12||12,t.length)},H(e,t){return At(e.getHours(),t.length)},m(e,t){return At(e.getMinutes(),t.length)},s(e,t){return At(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return At(o,t.length)}},Wa={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},a1={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return no.y(e,t)},Y:function(e,t,n,r){const o=bm(e,r),i=o>0?o:1-o;if(t==="YY"){const l=i%100;return At(l,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):At(i,t.length)},R:function(e,t){const n=Hx(e);return At(n,t.length)},u:function(e,t){const n=e.getFullYear();return At(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return At(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return At(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return no.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return At(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=bd(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):At(o,t.length)},I:function(e,t,n){const r=gd(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):At(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):no.d(e,t)},D:function(e,t,n){const r=kk(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):At(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return At(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return At(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return At(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Wa.noon:r===0?o=Wa.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Wa.evening:r>=12?o=Wa.afternoon:r>=4?o=Wa.morning:o=Wa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return no.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):no.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):At(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):no.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):no.s(e,t)},S:function(e,t){return no.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return l1(r);case"XXXX":case"XX":return zo(r);case"XXXXX":case"XXX":default:return zo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return l1(r);case"xxxx":case"xx":return zo(r);case"xxxxx":case"xxx":default:return zo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+i1(r,":");case"OOOO":default:return"GMT"+zo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+i1(r,":");case"zzzz":default:return"GMT"+zo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return At(r,t.length)},T:function(e,t,n){return At(+e,t.length)}};function i1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+At(i,2)}function l1(e,t){return e%60===0?(e>0?"-":"+")+At(Math.abs(e)/60,2):zo(e,t)}function zo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=At(Math.trunc(r/60),2),i=At(r%60,2);return n+o+t+i}const u1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Yx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},_k=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return u1(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",u1(r,t)).replace("{{time}}",Yx(o,t))},I0={p:Yx,P:_k},Nk=/^D+$/,Dk=/^Y+$/,Ok=["D","DD","YY","YYYY"];function $x(e){return Nk.test(e)}function qx(e){return Dk.test(e)}function M0(e,t,n){const r=Ak(e,t,n);if(console.warn(r),Ok.includes(e))throw new RangeError(r)}function Ak(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ik=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Lk=/^'([^]*?)'?$/,Rk=/''/g,Pk=/[a-zA-Z]/;function on(e,t,n){var p,y,b,v,D,S,E,T;const r=pa(),o=(n==null?void 0:n.locale)??r.locale??Yo,i=(n==null?void 0:n.firstWeekContainsDate)??((y=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((v=(b=r.locale)==null?void 0:b.options)==null?void 0:v.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((S=(D=n==null?void 0:n.locale)==null?void 0:D.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((T=(E=r.locale)==null?void 0:E.options)==null?void 0:T.weekStartsOn)??0,c=dt(e,n==null?void 0:n.in);if(!zS(c))throw new RangeError("Invalid time value");let d=t.match(Mk).map(k=>{const O=k[0];if(O==="p"||O==="P"){const I=I0[O];return I(k,o.formatLong)}return k}).join("").match(Ik).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const O=k[0];if(O==="'")return{isToken:!1,value:jk(k)};if(a1[O])return{isToken:!0,value:k};if(O.match(Pk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:k}});o.localize.preprocessor&&(d=o.localize.preprocessor(c,d));const h={firstWeekContainsDate:i,weekStartsOn:l,locale:o};return d.map(k=>{if(!k.isToken)return k.value;const O=k.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&qx(O)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&$x(O))&&M0(O,t,String(e));const I=a1[O[0]];return I(c,O,o.localize,h)}).join("")}function jk(e){const t=e.match(Lk);return t?t[1].replace(Rk,"'"):e}function Fk(e,t){const n=dt(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),i=Dt(n,0);return i.setFullYear(r,o+1,0),i.setHours(0,0,0,0),i.getDate()}function Bk(){return Object.assign({},pa())}function Hk(e,t){const n=dt(e,t==null?void 0:t.in).getDay();return n===0?7:n}function Uk(e,t){return dt(e,t==null?void 0:t.in).getMonth()}function zk(e,t){return dt(e,t==null?void 0:t.in).getFullYear()}function Wk(e,t){return+dt(e)>+dt(t)}function Yk(e,t){return+dt(e)<+dt(t)}function $k(e,t){const n=qk(t)?new t(0):Dt(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function qk(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const Vk=10;class Vx{constructor(){Fe(this,"subPriority",0)}validate(t,n){return!0}}class Qk extends Vx{constructor(t,n,r,o,i){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,i&&(this.subPriority=i)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class Gk extends Vx{constructor(n,r){super();Fe(this,"priority",Vk);Fe(this,"subPriority",-1);this.context=n||(o=>Dt(r,o))}set(n,r){return r.timestampIsSet?n:Dt(n,$k(n,this.context))}}let Ct=class{run(t,n,r,o){const i=this.parse(t,n,r,o);return i?{setter:new Qk(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}};class Kk extends Ct{constructor(){super(...arguments);Fe(this,"priority",140);Fe(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const dn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ss={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function fn(e,t){return e&&{value:t(e.value),rest:e.rest}}function Jt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function os(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,l=n[5]?parseInt(n[5],10):0;return{value:r*(o*mm+i*hm+l*PS),rest:t.slice(n[0].length)}}function Qx(e){return Jt(dn.anyDigitsSigned,e)}function an(e,t){switch(e){case 1:return Jt(dn.singleDigit,t);case 2:return Jt(dn.twoDigits,t);case 3:return Jt(dn.threeDigits,t);case 4:return Jt(dn.fourDigits,t);default:return Jt(new RegExp("^\\d{1,"+e+"}"),t)}}function Kc(e,t){switch(e){case 1:return Jt(dn.singleDigitSigned,t);case 2:return Jt(dn.twoDigitsSigned,t);case 3:return Jt(dn.threeDigitsSigned,t);case 4:return Jt(dn.fourDigitsSigned,t);default:return Jt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function xm(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Gx(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const i=r+50,l=Math.trunc(i/100)*100,c=e>=i%100;o=e+l-(c?100:0)}return n?o:1-o}function Kx(e){return e%400===0||e%4===0&&e%100!==0}class Xk extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const i=l=>({year:l,isTwoDigitYear:r==="yy"});switch(r){case"y":return fn(an(4,n),i);case"yo":return fn(o.ordinalNumber(n,{unit:"year"}),i);default:return fn(an(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const i=n.getFullYear();if(o.isTwoDigitYear){const c=Gx(o.year,i);return n.setFullYear(c,0,1),n.setHours(0,0,0,0),n}const l=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(l,0,1),n.setHours(0,0,0,0),n}}class Jk extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const i=l=>({year:l,isTwoDigitYear:r==="YY"});switch(r){case"Y":return fn(an(4,n),i);case"Yo":return fn(o.ordinalNumber(n,{unit:"year"}),i);default:return fn(an(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,i){const l=bm(n,i);if(o.isTwoDigitYear){const d=Gx(o.year,l);return n.setFullYear(d,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),zr(n,i)}const c=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(c,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),zr(n,i)}}class Zk extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return Kc(r==="R"?4:r.length,n)}set(n,r,o){const i=Dt(n,0);return i.setFullYear(o,0,4),i.setHours(0,0,0,0),la(i)}}class eC extends Ct{constructor(){super(...arguments);Fe(this,"priority",130);Fe(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return Kc(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class tC extends Ct{constructor(){super(...arguments);Fe(this,"priority",120);Fe(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return an(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class nC extends Ct{constructor(){super(...arguments);Fe(this,"priority",120);Fe(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return an(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class rC extends Ct{constructor(){super(...arguments);Fe(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Fe(this,"priority",110)}parse(n,r,o){const i=l=>l-1;switch(r){case"M":return fn(Jt(dn.month,n),i);case"MM":return fn(an(2,n),i);case"Mo":return fn(o.ordinalNumber(n,{unit:"month"}),i);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class sC extends Ct{constructor(){super(...arguments);Fe(this,"priority",110);Fe(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const i=l=>l-1;switch(r){case"L":return fn(Jt(dn.month,n),i);case"LL":return fn(an(2,n),i);case"Lo":return fn(o.ordinalNumber(n,{unit:"month"}),i);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function oC(e,t,n){const r=dt(e,n==null?void 0:n.in),o=bd(r,n)-t;return r.setDate(r.getDate()-o*7),dt(r,n==null?void 0:n.in)}class aC extends Ct{constructor(){super(...arguments);Fe(this,"priority",100);Fe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return Jt(dn.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,i){return zr(oC(n,o,i),i)}}function iC(e,t,n){const r=dt(e,n==null?void 0:n.in),o=gd(r,n)-t;return r.setDate(r.getDate()-o*7),r}class lC extends Ct{constructor(){super(...arguments);Fe(this,"priority",100);Fe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return Jt(dn.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return la(iC(n,o))}}const uC=[31,28,31,30,31,30,31,31,30,31,30,31],cC=[31,29,31,30,31,30,31,31,30,31,30,31];class dC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"subPriority",1);Fe(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return Jt(dn.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return an(r.length,n)}}validate(n,r){const o=n.getFullYear(),i=Kx(o),l=n.getMonth();return i?r>=1&&r<=cC[l]:r>=1&&r<=uC[l]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class fC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"subpriority",1);Fe(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return Jt(dn.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return an(r.length,n)}}validate(n,r){const o=n.getFullYear();return Kx(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function vm(e,t,n){var y,b,v,D;const r=pa(),o=(n==null?void 0:n.weekStartsOn)??((b=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((D=(v=r.locale)==null?void 0:v.options)==null?void 0:D.weekStartsOn)??0,i=dt(e,n==null?void 0:n.in),l=i.getDay(),d=(t%7+7)%7,h=7-o,p=t<0||t>6?t-(l+h)%7:(d+h)%7-(l+h)%7;return Ms(i,p,n)}class hC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=vm(n,o,i),n.setHours(0,0,0,0),n}}class mC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,i){const l=c=>{const d=Math.floor((c-1)/7)*7;return(c+i.weekStartsOn+6)%7+d};switch(r){case"e":case"ee":return fn(an(r.length,n),l);case"eo":return fn(o.ordinalNumber(n,{unit:"day"}),l);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=vm(n,o,i),n.setHours(0,0,0,0),n}}class pC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,i){const l=c=>{const d=Math.floor((c-1)/7)*7;return(c+i.weekStartsOn+6)%7+d};switch(r){case"c":case"cc":return fn(an(r.length,n),l);case"co":return fn(o.ordinalNumber(n,{unit:"day"}),l);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=vm(n,o,i),n.setHours(0,0,0,0),n}}function yC(e,t,n){const r=dt(e,n==null?void 0:n.in),o=Hk(r,n),i=t-o;return Ms(r,i,n)}class gC extends Ct{constructor(){super(...arguments);Fe(this,"priority",90);Fe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const i=l=>l===0?7:l;switch(r){case"i":case"ii":return an(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return fn(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i);case"iiiii":return fn(o.day(n,{width:"narrow",context:"formatting"}),i);case"iiiiii":return fn(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i);case"iiii":default:return fn(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=yC(n,o),n.setHours(0,0,0,0),n}}class bC extends Ct{constructor(){super(...arguments);Fe(this,"priority",80);Fe(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(xm(o),0,0,0),n}}class xC extends Ct{constructor(){super(...arguments);Fe(this,"priority",80);Fe(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(xm(o),0,0,0),n}}class vC extends Ct{constructor(){super(...arguments);Fe(this,"priority",80);Fe(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(xm(o),0,0,0),n}}class EC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return Jt(dn.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const i=n.getHours()>=12;return i&&o<12?n.setHours(o+12,0,0,0):!i&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class TC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return Jt(dn.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class wC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return Jt(dn.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class SC extends Ct{constructor(){super(...arguments);Fe(this,"priority",70);Fe(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return Jt(dn.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return an(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const i=o<=24?o%24:o;return n.setHours(i,0,0,0),n}}class kC extends Ct{constructor(){super(...arguments);Fe(this,"priority",60);Fe(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return Jt(dn.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class CC extends Ct{constructor(){super(...arguments);Fe(this,"priority",50);Fe(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return Jt(dn.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return an(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class _C extends Ct{constructor(){super(...arguments);Fe(this,"priority",30);Fe(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=i=>Math.trunc(i*Math.pow(10,-r.length+3));return fn(an(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class NC extends Ct{constructor(){super(...arguments);Fe(this,"priority",10);Fe(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return os(ss.basicOptionalMinutes,n);case"XX":return os(ss.basic,n);case"XXXX":return os(ss.basicOptionalSeconds,n);case"XXXXX":return os(ss.extendedOptionalSeconds,n);case"XXX":default:return os(ss.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Dt(n,n.getTime()-Qc(n)-o)}}class DC extends Ct{constructor(){super(...arguments);Fe(this,"priority",10);Fe(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return os(ss.basicOptionalMinutes,n);case"xx":return os(ss.basic,n);case"xxxx":return os(ss.basicOptionalSeconds,n);case"xxxxx":return os(ss.extendedOptionalSeconds,n);case"xxx":default:return os(ss.extended,n)}}set(n,r,o){return r.timestampIsSet?n:Dt(n,n.getTime()-Qc(n)-o)}}class OC extends Ct{constructor(){super(...arguments);Fe(this,"priority",40);Fe(this,"incompatibleTokens","*")}parse(n){return Qx(n)}set(n,r,o){return[Dt(n,o*1e3),{timestampIsSet:!0}]}}class AC extends Ct{constructor(){super(...arguments);Fe(this,"priority",20);Fe(this,"incompatibleTokens","*")}parse(n){return Qx(n)}set(n,r,o){return[Dt(n,o),{timestampIsSet:!0}]}}const IC={G:new Kk,y:new Xk,Y:new Jk,R:new Zk,u:new eC,Q:new tC,q:new nC,M:new rC,L:new sC,w:new aC,I:new lC,d:new dC,D:new fC,E:new hC,e:new mC,c:new pC,i:new gC,a:new bC,b:new xC,B:new vC,h:new EC,H:new TC,K:new wC,k:new SC,m:new kC,s:new CC,S:new _C,X:new NC,x:new DC,t:new OC,T:new AC},MC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,LC=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RC=/^'([^]*?)'?$/,PC=/''/g,jC=/\S/,FC=/[a-zA-Z]/;function ws(e,t,n,r){var E,T,k,O;const o=()=>Dt(n,NaN),i=Bk(),l=i.locale??Yo,c=i.firstWeekContainsDate??((T=(E=i.locale)==null?void 0:E.options)==null?void 0:T.firstWeekContainsDate)??1,d=i.weekStartsOn??((O=(k=i.locale)==null?void 0:k.options)==null?void 0:O.weekStartsOn)??0,h={firstWeekContainsDate:c,weekStartsOn:d,locale:l},p=[new Gk(r==null?void 0:r.in,n)],y=t.match(LC).map(I=>{const L=I[0];if(L in I0){const _=I0[L];return _(I,l.formatLong)}return I}).join("").match(MC),b=[];for(let I of y){qx(I)&&M0(I,t,e),$x(I)&&M0(I,t,e);const L=I[0],_=IC[L];if(_){const{incompatibleTokens:C}=_;if(Array.isArray(C)){const P=b.find(H=>C.includes(H.token)||H.token===L);if(P)throw new RangeError(`The format string mustn't contain \`${P.fullToken}\` and \`${I}\` at the same time`)}else if(_.incompatibleTokens==="*"&&b.length>0)throw new RangeError(`The format string mustn't contain \`${I}\` and any other token at the same time`);b.push({token:L,fullToken:I});const A=_.run(e,I,l.match,h);if(!A)return o();p.push(A.setter),e=A.rest}else{if(L.match(FC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+L+"`");if(I==="''"?I="'":L==="'"&&(I=BC(I)),e.indexOf(I)===0)e=e.slice(I.length);else return o()}}if(e.length>0&&jC.test(e))return o();const v=p.map(I=>I.priority).sort((I,L)=>L-I).filter((I,L,_)=>_.indexOf(I)===L).map(I=>p.filter(L=>L.priority===I).sort((L,_)=>_.subPriority-L.subPriority)).map(I=>I[0]);let D=dt(n,r==null?void 0:r.in);if(isNaN(+D))return o();const S={};for(const I of v){if(!I.validate(D,h))return o();const L=I.set(D,S,h);Array.isArray(L)?(D=L[0],Object.assign(S,L[1])):D=L}return D}function BC(e){return e.match(RC)[1].replace(PC,"'")}function HC(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function UC(e,t,n){const[r,o]=Ei(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function kr(e,t,n){return Ms(e,-t,n)}function c1(e,t){const n=()=>Dt(t==null?void 0:t.in,NaN),o=$C(e);let i;if(o.date){const h=qC(o.date,2);i=VC(h.restDateString,h.year)}if(!i||isNaN(+i))return n();const l=+i;let c=0,d;if(o.time&&(c=QC(o.time),isNaN(c)))return n();if(o.timezone){if(d=GC(o.timezone),isNaN(d))return n()}else{const h=new Date(l+c),p=dt(0,t==null?void 0:t.in);return p.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),p.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),p}return dt(l+c+d,t==null?void 0:t.in)}const kc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},zC=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,WC=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,YC=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $C(e){const t={},n=e.split(kc.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],kc.timeZoneDelimiter.test(t.date)&&(t.date=e.split(kc.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const o=kc.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function qC(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function VC(e,t){if(t===null)return new Date(NaN);const n=e.match(zC);if(!n)return new Date(NaN);const r=!!n[4],o=pl(n[1]),i=pl(n[2])-1,l=pl(n[3]),c=pl(n[4]),d=pl(n[5])-1;if(r)return e_(t,c,d)?KC(t,c,d):new Date(NaN);{const h=new Date(0);return!JC(t,i,l)||!ZC(t,o)?new Date(NaN):(h.setUTCFullYear(t,i,Math.max(o,l)),h)}}function pl(e){return e?parseInt(e):1}function QC(e){const t=e.match(WC);if(!t)return NaN;const n=Lh(t[1]),r=Lh(t[2]),o=Lh(t[3]);return t_(n,r,o)?n*mm+r*hm+o*1e3:NaN}function Lh(e){return e&&parseFloat(e.replace(",","."))||0}function GC(e){if(e==="Z")return 0;const t=e.match(YC);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return n_(r,o)?n*(r*mm+o*hm):NaN}function KC(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}const XC=[31,null,31,30,31,30,31,31,30,31,30,31];function Xx(e){return e%400===0||e%4===0&&e%100!==0}function JC(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(XC[t]||(Xx(e)?29:28))}function ZC(e,t){return t>=1&&t<=(Xx(e)?366:365)}function e_(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function t_(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function n_(e,t){return t>=0&&t<=59}function r_(e,t,n){const r=dt(e,n==null?void 0:n.in),o=r.getFullYear(),i=r.getDate(),l=Dt(e,0);l.setFullYear(o,t,15),l.setHours(0,0,0,0);const c=Fk(l);return r.setMonth(t,Math.min(i,c)),r}function s_(e,t,n){const r=dt(e,n==null?void 0:n.in);return isNaN(+r)?Dt(e,NaN):(r.setFullYear(t),r)}function Ll(e,t,n){return vi(e,-t,n)}function Jx(e,t,n){return ym(e,-t,n)}function Zx(e,t,n){return fd(e,-t,n)}function Em(e,t,n){return hd(e,-t,n)}const o_="yyyy-MM-dd";function Tt(e){return on(e,o_)}function a_(e){const t=new Date,n=Tt(t);switch(e){case"today":return{start_date:n,end_date:n};case"yesterday":{const r=Tt(kr(t,1));return{start_date:r,end_date:r}}case"last_7_days":{const r=Tt(kr(t,1));return{start_date:Tt(kr(t,7)),end_date:r}}case"last_30_days":{const r=Tt(kr(t,1));return{start_date:Tt(kr(t,30)),end_date:r}}case"last_90_days":{const r=Tt(kr(t,1));return{start_date:Tt(kr(t,90)),end_date:r}}case"last_12_months":{const r=Tt(kr(t,1));return{start_date:Tt(Ll(t,12)),end_date:r}}case"year_to_date":return{start_date:Tt(mi(t)),end_date:n};case"month_to_date":return{start_date:Tt(ql(t)),end_date:n};case"quarter_to_date":return{start_date:Tt(Gc(t)),end_date:n};case"previous_month":{const r=Ll(t,1);return{start_date:Tt(ql(r)),end_date:Tt(md(r))}}case"previous_quarter":{const r=Ll(t,3);return{start_date:Tt(Gc(r)),end_date:Tt(gm(r))}}case"previous_year":{const r=Em(t,1);return{start_date:Tt(mi(r)),end_date:Tt(pd(r))}}default:return null}}function i_(e){const n=ua(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start_date:Tt(n),end_date:Tt(n)};case"week":return{start_date:Tt(zr(n,{weekStartsOn:1})),end_date:Tt(yd(n,{weekStartsOn:1}))};case"month":return{start_date:Tt(ql(n)),end_date:Tt(md(n))};case"quarter":return{start_date:Tt(Gc(n)),end_date:Tt(gm(n))};case"year":return{start_date:Tt(mi(n)),end_date:Tt(pd(n))}}const r=e.value??1;if(e.direction==="previous"){const c=e.includeToday?n:kr(n,1),h={day:kr,week:Zx,month:Ll,quarter:Jx,year:Em}[e.unit]((e.includeToday,n),r);return{start_date:Tt(h<c?h:c),end_date:Tt(h<c?c:h)}}const o=e.includeToday?n:Ms(n,1),l={day:Ms,week:fd,month:vi,quarter:ym,year:hd}[e.unit](o,r);return{start_date:Tt(o<l?o:l),end_date:Tt(o<l?l:o)}}function pi(e){if(e.start_date&&e.end_date)return e;const t=e.date_range;if(t==null)return e;if(typeof t=="string"){const n=a_(t);return n?{...e,start_date:n.start_date,end_date:n.end_date}:e}if(typeof t=="object"){const n=t;if(n.type==="custom"&&typeof n.start=="string"&&typeof n.end=="string")return{...e,start_date:n.start,end_date:n.end};if(n.type==="relative"){const r=i_(n);return{...e,start_date:r.start_date,end_date:r.end_date}}}return e}function e2(e,t){const n=Je(d=>d.globalFilters),r=Je(d=>d.chartFilters),o=Je(d=>d.crossFilters),i=Je(d=>d.getEffectiveFilters),l=N.useMemo(()=>Object.fromEntries(Object.entries(i(e)).filter(([d,h])=>h!=null&&h!==""&&!(Array.isArray(h)&&h.length===0))),[n,r,o,e]),c=N.useMemo(()=>{const d=pi(l);return t?{...d,...t}:d},[l,t]);return hr({queryKey:["chartData",e,c],queryFn:()=>xt.queryChart(e,c),enabled:!!e})}function l_(e){const t=Je(c=>c.globalFilters),n=Je(c=>c.chartFilters),r=Je(c=>c.crossFilters),o=Je(c=>c.getEffectiveFilters),i=N.useMemo(()=>Object.fromEntries(Object.entries(o(e)).filter(([c,d])=>d!=null&&d!==""&&!(Array.isArray(d)&&d.length===0))),[t,n,r,e]),l=N.useMemo(()=>pi(i),[i]);return hr({queryKey:["chartWithData",e,l],queryFn:()=>xt.queryChart(e,l,{includeConfig:!0}),enabled:!!e})}function Tm(){const e=Wn();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function t2(){return hr({queryKey:["dashboards"],queryFn:()=>xt.getDashboards()})}function d1(e){const t=[];for(const n of e.rows)for(const r of n.widgets)r.type==="chart"&&r.ref&&t.push(r.ref);return t}function u_(e){return e.tabs?e.tabs[0]?d1(e.tabs[0].layout):[]:e.layout?d1(e.layout):[]}function c_(e,t){var i,l,c;const n=Wn(),r=Je(d=>d.globalFilters),o=hr({queryKey:["dashboard",e,t],queryFn:()=>xt.getDashboard(e,t),enabled:!!e});return N.useEffect(()=>{var d,h,p,y,b;if((d=o.data)!=null&&d.name&&((h=o.data)!=null&&h.layout||(p=o.data)!=null&&p.tabs)){const v=u_(o.data);(b=(y=o.data.tabs)==null?void 0:y[0])==null||b.name;const D=pi(Object.fromEntries(Object.entries(r).filter(([S,E])=>E!=null)));v.forEach(S=>{n.prefetchQuery({queryKey:["chartWithData",S,D],queryFn:()=>xt.queryChart(S,D,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(i=o.data)==null?void 0:i.layout,(l=o.data)==null?void 0:l.tabs,(c=o.data)==null?void 0:c.name,r,n]),o}function d_(e){const t=Wn();return Ka({mutationFn:({layout:n,message:r,tab:o})=>xt.saveDashboard(e,n,r,o),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function f_(){const e=Wn();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}const h_=[["config"],["dashboard"],["dashboards"],["chartData"],["chartWithData"],["chart"]];function m_(){const e=Wn(),t=N.useRef(1e3);N.useEffect(()=>{let n=null,r=null,o=!1;function i(){o||(n=new EventSource("/api/events"),n.addEventListener("config-change",()=>{t.current=1e3;for(const l of h_)e.invalidateQueries({queryKey:l})}),n.onopen=()=>{t.current=1e3},n.onerror=()=>{n==null||n.close(),n=null,o||(r=setTimeout(i,t.current),t.current=Math.min(t.current*2,3e4))})}return i(),()=>{o=!0,n==null||n.close(),r&&clearTimeout(r)}},[e])}const wm=N.createContext(null),Cc="yc-theme-mode";function p_(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y_({configMode:e,children:t}){const n=N.useCallback(()=>{const d=localStorage.getItem(Cc);return d==="light"||d==="dark"?d:e==="light"||e==="dark"?e:p_()},[e]),[r,o]=N.useState(n);N.useEffect(()=>{if(localStorage.getItem(Cc)||e&&e!=="auto")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),p=y=>o(y.matches?"dark":"light");return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[e]),N.useEffect(()=>{document.documentElement.setAttribute("data-theme",r)},[r]);const i=N.useCallback(()=>{o(d=>{const h=d==="light"?"dark":"light";return localStorage.setItem(Cc,h),h})},[]),l=N.useCallback(()=>{localStorage.removeItem(Cc),o(n())},[n]),c=N.useMemo(()=>({mode:r,toggleMode:i,clearOverride:l}),[r,i,l]);return f.jsx(wm.Provider,{value:c,children:t})}function n2(){const e=N.useContext(wm);if(!e)throw new Error("useThemeMode must be used within ThemeModeProvider");return e}function g_(){return N.useContext(wm)}const _c={textColor:"#6b7280",borderColor:"#e5e7eb",surfaceColor:"#ffffff",splitLineColor:"#e5e7eb"};function cs(){const e=g_(),t=(e==null?void 0:e.mode)??"light";return N.useMemo(()=>{const n=getComputedStyle(document.documentElement);return{textColor:n.getPropertyValue("--yc-color-text-secondary").trim()||_c.textColor,borderColor:n.getPropertyValue("--yc-color-border").trim()||_c.borderColor,surfaceColor:n.getPropertyValue("--yc-color-surface").trim()||_c.surfaceColor,splitLineColor:n.getPropertyValue("--yc-color-border").trim()||_c.splitLineColor}},[t])}function f1(e,t){var i;const n=t.trim();if(!n)return e;const r=n.toLowerCase(),o=[];for(const l of e){const c=l.title.toLowerCase(),d=((i=l.description)==null?void 0:i.toLowerCase())??"",h=c.startsWith(r),p=c.includes(r),y=d.includes(r);h?o.push({item:l,rank:0}):p?o.push({item:l,rank:1}):y&&o.push({item:l,rank:2})}return o.sort((l,c)=>l.rank!==c.rank?l.rank-c.rank:l.item.title.localeCompare(c.item.title)),o.map(l=>l.item)}function b_(e,t){const[n,r]=N.useState(""),[o,i]=N.useState(0),l=N.useMemo(()=>{const b=f1(e,n),v=f1(t,n);return{dashboards:b,charts:v,all:[...b,...v]}},[e,t,n]),c=N.useCallback(b=>{r(b),i(0)},[]),d=N.useCallback(()=>{i(b=>Math.min(b+1,Math.max(l.all.length-1,0)))},[l.all.length]),h=N.useCallback(()=>{i(b=>Math.max(b-1,0))},[]),p=N.useCallback(()=>{r(""),i(0)},[]),y=l.all.length>0?l.all[o]??null:null;return{query:n,activeIndex:o,results:l,setQuery:c,setActiveIndex:i,moveDown:d,moveUp:h,resetSearch:p,activeItem:y}}function x_(e,t){return e.filter(n=>!n.charts||n.charts.length===0?!0:t?n.charts.includes(t):!1)}function r2(e){const{data:t,...n}=hr({queryKey:["chartEvents"],queryFn:()=>xt.getChartEvents(),staleTime:3e4}),r=(t==null?void 0:t.events)??[];return{events:N.useMemo(()=>t!=null&&t.events?x_(t.events,e):[],[t==null?void 0:t.events,e]),allEvents:r,...n}}const s2=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),v_={compact:"13px",default:"14px",comfortable:"16px"},E_={modern:{colors:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827"},modeColors:{light:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#60a5fa",background:"#0f172a",surface:"#1e293b",sidebar:"#0f172a",text:"#f1f5f9",textSecondary:"#94a3b8",border:"#334155",surfaceHover:"#334155",textMuted:"#64748b",inputBg:"#1e293b",danger:"#f87171",success:"#34d399"}},fonts:{heading:"Inter",body:"Inter",mono:"JetBrains Mono",size:"default"},palette:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"],radius:"8px",shadow:"0 1px 3px rgba(0,0,0,0.1)",cardPadding:"20px",cardBorder:"none",sidebarShow:!0},executive:{colors:{primary:"#0ea5e9",background:"#f8fafc",surface:"#ffffff",sidebar:"#1e293b",text:"#0f172a"},modeColors:{light:{primary:"#0ea5e9",background:"#f8fafc",surface:"#ffffff",sidebar:"#1e293b",text:"#0f172a",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#38bdf8",background:"#0c1322",surface:"#1a2332",sidebar:"#0c1322",text:"#e2e8f0",textSecondary:"#94a3b8",border:"#2d3a4a",surfaceHover:"#2d3a4a",textMuted:"#64748b",inputBg:"#1a2332",danger:"#f87171",success:"#34d399"}},fonts:{heading:"system-ui",body:"system-ui",mono:"ui-monospace",size:"compact"},palette:["#1e3a5f","#0d9488","#d97706","#64748b","#9f1239","#4338ca","#0369a1","#b45309","#475569","#7c3aed"],radius:"2px",shadow:"none",cardPadding:"16px",cardBorder:"1px solid #e2e8f0",sidebarShow:!0},minimal:{colors:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",sidebar:"#f1f5f9",text:"#1e293b"},modeColors:{light:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",sidebar:"#f1f5f9",text:"#1e293b",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#818cf8",background:"#0f172a",surface:"#1e293b",sidebar:"#1e293b",text:"#f1f5f9",textSecondary:"#94a3b8",border:"#334155",surfaceHover:"#334155",textMuted:"#64748b",inputBg:"#1e293b",danger:"#f87171",success:"#34d399"}},fonts:{heading:"system-ui",body:"system-ui",mono:"JetBrains Mono",size:"comfortable"},palette:["#3b82f6","#2563eb","#1d4ed8","#1e40af","#10b981","#059669","#047857","#065f46","#6366f1","#4f46e5"],radius:"0px",shadow:"none",cardPadding:"12px",cardBorder:"none",sidebarShow:!1}};function T_(e){const t=parseInt(e.replace("#",""),16),n=(t>>16)/255,r=(t>>8&255)/255,o=(t&255)/255,i=l=>l<=.03928?l/12.92:((l+.055)/1.055)**2.4;return .2126*i(n)+.7152*i(r)+.0722*i(o)}function h1(e,t){const n=parseInt(e.replace("#",""),16),r=Math.min(255,Math.max(0,(n>>16)+Math.round(2.55*t))),o=Math.min(255,Math.max(0,(n>>8&255)+Math.round(2.55*t))),i=Math.min(255,Math.max(0,(n&255)+Math.round(2.55*t)));return`#${((1<<24)+(r<<16)+(o<<8)+i).toString(16).slice(1)}`}function Rh(e){return s2.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function w_(e,t="light"){var _,C,A,P,H,B,z,Q,q,X,ie,ge;const n=e.base??"modern",r=E_[n],o=r.modeColors[t],i=((_=e.colors)==null?void 0:_.primary)??o.primary,l=((C=e.colors)==null?void 0:C.background)??o.background,c=((A=e.colors)==null?void 0:A.surface)??o.surface,d=((P=e.colors)==null?void 0:P.sidebar)??o.sidebar,h=((H=e.colors)==null?void 0:H.text)??o.text,p=((B=e.fonts)==null?void 0:B.heading)??r.fonts.heading,y=((z=e.fonts)==null?void 0:z.body)??r.fonts.body,b=((Q=e.fonts)==null?void 0:Q.mono)??r.fonts.mono,v=v_[((q=e.fonts)==null?void 0:q.size)??r.fonts.size]??"14px",D=e.palette??r.palette,S=new Set;for(const te of[p,y,b])!s2.has(te)&&te!=="ui-monospace"&&S.add(te);const E=S.size>0?`https://fonts.googleapis.com/css2?${[...S].map(te=>`family=${encodeURIComponent(te)}:wght@400;500;600;700`).join("&")}&display=swap`:null,T=T_(d)<.2,k=T?"#f1f5f9":h,O=T?"#94a3b8":o.textSecondary,I=T?"rgba(255,255,255,0.1)":o.border,L={"--yc-color-primary":i,"--yc-color-primary-light":h1(i,t==="dark"?15:20),"--yc-color-primary-dark":h1(i,t==="dark"?-10:-15),"--yc-color-background":l,"--yc-color-surface":c,"--yc-color-sidebar":d,"--yc-color-text":h,"--yc-color-text-secondary":o.textSecondary,"--yc-color-border":o.border,"--yc-color-surface-hover":o.surfaceHover,"--yc-color-text-muted":o.textMuted,"--yc-color-input-bg":o.inputBg,"--yc-color-danger":o.danger,"--yc-color-success":o.success,"--yc-color-sidebar-text":k,"--yc-color-sidebar-text-secondary":O,"--yc-color-sidebar-border":I,"--yc-font-heading":Rh(p),"--yc-font-body":Rh(y),"--yc-font-mono":Rh(b),"--yc-font-size-base":v,"--yc-radius":r.radius,"--yc-shadow":r.shadow,"--yc-card-padding":r.cardPadding,"--yc-card-border":r.cardBorder,"--yc-grid-gap":"16px","--yc-topbar-height":"40px"};return{base:n,mode:t,cssVars:L,palette:D,sidebarShow:((X=e.sidebar)==null?void 0:X.show)??r.sidebarShow,sidebarLinks:(ie=e.sidebar)==null?void 0:ie.links,sidebarSections:(ge=e.sidebar)==null?void 0:ge.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:E}}const o2=N.createContext(null);function S_({children:e}){const{data:t}=ma(),{mode:n}=n2(),r=N.useMemo(()=>w_((t==null?void 0:t.theme)??{},n),[t==null?void 0:t.theme,n]);return N.useEffect(()=>{const o=document.documentElement;for(const[i,l]of Object.entries(r.cssVars))o.style.setProperty(i,l);return()=>{for(const i of Object.keys(r.cssVars))o.style.removeProperty(i)}},[r.cssVars]),N.useEffect(()=>{if(!r.googleFontsUrl)return;const o="yc-google-fonts";let i=document.getElementById(o);return i||(i=document.createElement("link"),i.id=o,i.rel="stylesheet",document.head.appendChild(i)),i.href=r.googleFontsUrl,()=>{i==null||i.remove()}},[r.googleFontsUrl]),N.useEffect(()=>{if(!r.customCss)return;const o="yc-custom-css";let i=document.getElementById(o);return i||(i=document.createElement("link"),i.id=o,i.rel="stylesheet",document.head.appendChild(i)),i.href="/api/theme/custom.css",()=>{i==null||i.remove()}},[r.customCss]),N.useEffect(()=>{const o=r.title||(t==null?void 0:t.name)||"Yamchart";document.title=o},[r.title,t==null?void 0:t.name]),N.useEffect(()=>{if(!r.favicon)return;const o="yc-favicon";let i=document.querySelector(`link#${o}`);i||(i=document.createElement("link"),i.id=o,i.rel="icon",document.head.appendChild(i)),i.href=`/api/assets/${r.favicon.replace(/^\.\/assets\//,"")}`},[r.favicon]),f.jsx(o2.Provider,{value:r,children:e})}function k_({children:e}){var r;const{data:t}=ma(),n=(r=t==null?void 0:t.theme)==null?void 0:r.mode;return f.jsx(y_,{configMode:n,children:f.jsx(S_,{children:e})})}function Sm(){const e=N.useContext(o2);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function a2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=a2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nr(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=a2(e))&&(r&&(r+=" "),r+=t);return r}function zc({type:e,className:t,style:n}){const r={className:t,style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o={strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5};switch(e){case"bar":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 20h18M5 20V10h3v10M10 20V4h3v16M15 20v-8h3v8"})});case"line":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 20h18M4 16l4-6 4 4 4-8 4 6"})});case"area":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18"}),f.jsx("path",{...o,d:"M4 16l4-6 4 4 4-8 4 6v8H4z",fill:"currentColor",opacity:.15}),f.jsx("path",{...o,d:"M4 16l4-6 4 4 4-8 4 6"})]});case"pie":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M12 2a10 10 0 110 20 10 10 0 010-20z"}),f.jsx("path",{...o,d:"M12 2v10l8.66 5"})]});case"donut":return f.jsxs("svg",{...r,children:[f.jsx("circle",{...o,cx:"12",cy:"12",r:"10"}),f.jsx("circle",{...o,cx:"12",cy:"12",r:"5"}),f.jsx("path",{...o,d:"M12 2v5M22 12h-5"})]});case"scatter":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18M3 20V4"}),f.jsx("circle",{cx:"7",cy:"15",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"15",cy:"7",r:"1.5",fill:"currentColor"}),f.jsx("circle",{cx:"18",cy:"9",r:"1.5",fill:"currentColor"})]});case"combo":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18"}),f.jsx("path",{...o,d:"M5 20v-6h3v6M10 20v-10h3v10"}),f.jsx("path",{...o,d:"M5 10l4-3 4 2 5-5"})]});case"heatmap":return f.jsxs("svg",{...r,children:[f.jsx("rect",{...o,x:"3",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.2}),f.jsx("rect",{...o,x:"10",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.6}),f.jsx("rect",{...o,x:"17",y:"3",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.4}),f.jsx("rect",{...o,x:"3",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.8}),f.jsx("rect",{...o,x:"10",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.3}),f.jsx("rect",{...o,x:"17",y:"10",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.9}),f.jsx("rect",{...o,x:"3",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.5}),f.jsx("rect",{...o,x:"10",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.7}),f.jsx("rect",{...o,x:"17",y:"17",width:"4",height:"4",rx:"1",fill:"currentColor",opacity:.1})]});case"funnel":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 4h18l-3 5H6L3 4zM6 9h12l-2 5H8L6 9zM8 14h8l-2 5h-4l-2-5z"})});case"waterfall":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M3 20h18"}),f.jsx("path",{...o,d:"M5 8h3v4H5zM9 6h3v2H9zM13 10h3v4h-3zM17 6h3v8h-3"}),f.jsx("path",{...o,d:"M8 10h1M12 8h1",strokeDasharray:"2 1"})]});case"gauge":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M4.93 17.07A10 10 0 0112 2a10 10 0 017.07 15.07"}),f.jsx("path",{...o,d:"M12 12l-3-6",strokeWidth:2}),f.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]});case"kpi":case"metric":return f.jsxs("svg",{...r,children:[f.jsx("path",{...o,d:"M4 6h16M4 6v12a2 2 0 002 2h12a2 2 0 002-2V6"}),f.jsx("path",{...o,d:"M9 11h6M12 11v5",strokeWidth:2})]});case"table":return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M3 5h18M3 10h18M3 15h18M3 20h18M8 5v15M15 5v15"})});default:return f.jsx("svg",{...r,children:f.jsx("path",{...o,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}}const m1="yamchart-sidebar-folders";function C_(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function p1(e){const t=new Map;for(const r of e){const o=r.folder??"";t.has(o)||t.set(o,[]),t.get(o).push(r)}const n=[];for(const[r,o]of t)o.sort((i,l)=>{const c=i.title||i.name,d=l.title||l.name;return c.localeCompare(d)}),n.push({folder:r,label:C_(r),items:o});return n.sort((r,o)=>!r.folder&&!o.folder?0:r.folder?o.folder?r.label.localeCompare(o.label):-1:1),n}function y1({expanded:e,className:t,style:n}){return f.jsx("svg",{className:nr("w-3.5 h-3.5 transition-transform",e&&"rotate-90",t),style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function g1({dashboards:e,charts:t,currentPath:n,onNavigate:r,collapsed:o=!1}){var L,_;const i=Sm(),l=n.split("?")[0],c=C=>l===C,d=((L=i.sidebarSections)==null?void 0:L.dashboards)!==!1,h=((_=i.sidebarSections)==null?void 0:_.charts)!==!1,p={backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",borderColor:"var(--yc-color-primary)"},y=N.useMemo(()=>p1(e),[e]),b=N.useMemo(()=>p1(t),[t]),v=N.useMemo(()=>{for(const C of e)if(c(`/dashboards/${C.name}`))return C.folder??"";return null},[e,l]),D=N.useMemo(()=>{for(const C of t)if(c(`/charts/${C.name}`))return C.folder??"";return null},[t,l]),[S,E]=N.useState(()=>{try{const C=localStorage.getItem(m1);return C?JSON.parse(C):{}}catch{return{}}});N.useEffect(()=>{try{localStorage.setItem(m1,JSON.stringify(S))}catch{}},[S]);const T=N.useCallback((C,A)=>{const P=`${C}:${A}`;return C==="dashboards"&&v===A||C==="charts"&&D===A?!0:S[P]??!1},[S,v,D]),k=N.useCallback((C,A)=>{const P=`${C}:${A}`,H=C==="dashboards"&&v===A||C==="charts"&&D===A;E(B=>{const z=B[P]??H;return{...B,[P]:!z}})},[v,D]),O=y.length>1||y.some(C=>C.folder!==""),I=b.length>1||b.some(C=>C.folder!=="");return f.jsx("aside",{className:nr("yc-sidebar border-r flex flex-col transition-all overflow-hidden",o?"w-16":"w-56"),style:{backgroundColor:"var(--yc-color-sidebar)",borderColor:"var(--yc-color-sidebar-border)"},children:o?f.jsxs("div",{className:"py-3 flex flex-col items-center gap-1 overflow-y-auto",children:[d&&e.map(C=>{const A=`/dashboards/${C.name}`,P=c(A);return f.jsx("button",{onClick:()=>r(A),className:"p-2 rounded transition-colors",title:C.title,style:P?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})},C.name)}),d&&h&&e.length>0&&t.length>0&&f.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),h&&t.map(C=>{const A=`/charts/${C.name}`,P=c(A);return f.jsx("button",{onClick:()=>r(A),className:"p-2 rounded transition-colors",title:C.title,style:P?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:f.jsx(zc,{type:C.type,className:"w-5 h-5"})},C.name)}),f.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),f.jsx("button",{onClick:()=>r("/events"),className:"p-2 rounded transition-colors",title:"Events",style:c("/events")?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})})})]}):f.jsxs(f.Fragment,{children:[d&&e.length>0&&f.jsxs("div",{className:"py-2",children:[f.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Dashboards"}),O?y.map(C=>{const A=T("dashboards",C.folder);return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>k("dashboards",C.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[f.jsx(y1,{expanded:A}),f.jsx("span",{className:"truncate",children:C.label}),f.jsx("span",{className:"ml-auto opacity-50",children:C.items.length})]}),A&&C.items.map(P=>{const H=`/dashboards/${P.name}`,B=c(H);return f.jsxs("button",{onClick:()=>r(H),className:nr("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",B&&"border-r-2"),style:B?p:{color:"var(--yc-color-sidebar-text)"},title:P.title,children:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:B?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),f.jsx("span",{className:"truncate",children:P.title})]},P.name)})]},C.folder)}):e.map(C=>{const A=`/dashboards/${C.name}`,P=c(A);return f.jsxs("button",{onClick:()=>r(A),className:nr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",P&&"border-r-2"),style:P?p:{color:"var(--yc-color-sidebar-text)"},title:C.title,children:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:P?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),f.jsx("span",{className:"truncate",children:C.title})]},C.name)})]}),d&&h&&e.length>0&&t.length>0&&f.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"}}),h&&t.length>0&&f.jsxs("div",{className:"py-2 flex-1 overflow-y-auto",children:[f.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Charts"}),I?b.map(C=>{const A=T("charts",C.folder);return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>k("charts",C.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[f.jsx(y1,{expanded:A}),f.jsx("span",{className:"truncate",children:C.label}),f.jsx("span",{className:"ml-auto opacity-50",children:C.items.length})]}),A&&C.items.map(P=>{const H=`/charts/${P.name}`,B=c(H);return f.jsxs("button",{onClick:()=>r(H),className:nr("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",B&&"border-r-2"),style:B?p:{color:"var(--yc-color-sidebar-text)"},title:P.title,children:[f.jsx(zc,{type:P.type,className:"w-5 h-5 flex-shrink-0",style:{color:B?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),f.jsx("span",{className:"truncate",children:P.title})]},P.name)})]},C.folder)}):t.map(C=>{const A=`/charts/${C.name}`,P=c(A);return f.jsxs("button",{onClick:()=>r(A),className:nr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",P&&"border-r-2"),style:P?p:{color:"var(--yc-color-sidebar-text)"},title:C.title,children:[f.jsx(zc,{type:C.type,className:"w-5 h-5 flex-shrink-0",style:{color:P?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),f.jsx("span",{className:"truncate",children:C.title})]},C.name)})]}),i.sidebarLinks&&i.sidebarLinks.length>0&&f.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:i.sidebarLinks.map(C=>f.jsxs("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors hover:bg-white/10",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),f.jsx("span",{className:"truncate",children:C.label})]},C.url))}),f.jsx("div",{className:"py-2 border-t mt-auto",style:{borderColor:"var(--yc-color-sidebar-border)"},children:f.jsxs("button",{onClick:()=>r("/events"),className:nr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",c("/events")&&"border-r-2"),style:c("/events")?p:{color:"var(--yc-color-sidebar-text)"},children:[f.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:c("/events")?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})}),f.jsx("span",{children:"Events"})]})})]})})}function __({connection:e}){return f.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 min-w-[200px] bg-gray-900 text-white text-xs rounded-lg shadow-lg p-3 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200",children:[f.jsx("div",{className:"absolute -top-1 right-4 w-2 h-2 bg-gray-900 rotate-45"}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Name"}),f.jsx("span",{className:"font-medium",children:e.name})]}),f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Type"}),f.jsx("span",{className:"font-medium capitalize",children:e.type})]}),(e.type==="duckdb"||e.type==="sqlite")&&e.path&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Path"}),f.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.path,children:e.path})]}),(e.type==="postgres"||e.type==="mysql")&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Host"}),f.jsxs("span",{className:"font-medium",children:[e.host,":",e.port]})]}),f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Database"}),f.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Schema"}),f.jsx("span",{className:"font-medium",children:e.schema})]})]}),e.type==="snowflake"&&f.jsxs(f.Fragment,{children:[e.account&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Account"}),f.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.account,children:e.account})]}),e.warehouse&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Warehouse"}),f.jsx("span",{className:"font-medium",children:e.warehouse})]}),e.database&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Database"}),f.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Schema"}),f.jsx("span",{className:"font-medium",children:e.schema})]}),e.role&&f.jsxs("div",{className:"flex justify-between gap-4",children:[f.jsx("span",{className:"text-gray-400",children:"Role"}),f.jsx("span",{className:"font-medium",children:e.role})]})]})]})]})}function N_({status:e,connection:t,connectionStatus:n,authType:r}){const o=Wn(),[i,l]=N.useState(!1),[c,d]=N.useState(null),h=n==="disconnected",p=n?n==="connected":e==="ok",y=h&&r==="externalbrowser",b=async()=>{l(!0),d(null);try{await xt.reconnect(),await o.invalidateQueries()}catch(v){d(v instanceof Error?v.message:"Reconnection failed")}finally{l(!1)}};return f.jsxs("div",{className:"relative group",children:[f.jsxs("div",{className:"flex items-center gap-2 cursor-default",children:[i?f.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:"var(--yc-color-warning, #f59e0b)"}}):f.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:p?"var(--yc-color-success)":"var(--yc-color-danger)"}}),f.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:i?"Reconnecting...":p?"Connected":"Disconnected"}),y&&!i&&f.jsx("button",{onClick:b,className:"text-xs px-2 py-0.5 rounded border hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:"Re-authenticate"})]}),c&&f.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 text-xs px-2 py-1 rounded shadow-lg",style:{backgroundColor:"var(--yc-color-danger)",color:"white"},children:c}),t&&f.jsx(__,{connection:t})]})}const So=Fx(e=>({auth:{status:"loading"},providers:[],checkAuth:async()=>{try{const t=await xt.getAuthMe(),n=t.providers??[];t.needsSetup?e({auth:{status:"needs_setup"},providers:n}):t.user?e({auth:{status:"authenticated",user:t.user},providers:n}):e({auth:{status:"unauthenticated"},providers:n})}catch(t){t instanceof ou?t.status===404?e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]})}},login:async(t,n)=>{const{user:r}=await xt.authLogin({email:t,password:n});e({auth:{status:"authenticated",user:r}})},setup:async(t,n,r)=>{const{user:o}=await xt.authSetup({email:t,name:n,password:r});e({auth:{status:"authenticated",user:o}})},logout:async()=>{await xt.authLogout(),e({auth:{status:"unauthenticated"}})}}));function D_({onClose:e}){const[t,n]=N.useState(""),[r,o]=N.useState(""),[i,l]=N.useState(""),[c,d]=N.useState(""),[h,p]=N.useState(!1),[y,b]=N.useState(!1),v=async D=>{if(D.preventDefault(),d(""),r!==i){d("New passwords do not match");return}if(r.length<8){d("Password must be at least 8 characters");return}b(!0);try{await xt.authChangePassword({current_password:t,new_password:r}),p(!0),setTimeout(e,1500)}catch(S){d(S instanceof ou?S.message:"An error occurred")}finally{b(!1)}};return f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:f.jsxs("div",{className:"rounded-lg shadow-lg p-6 w-full max-w-md",style:{backgroundColor:"var(--yc-color-surface)"},onClick:D=>D.stopPropagation(),children:[f.jsx("h2",{className:"text-lg font-semibold mb-4",style:{color:"var(--yc-color-text)"},children:"Change Password"}),h?f.jsx("div",{className:"text-sm rounded-md px-4 py-3",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--yc-color-success) 30%, transparent)",color:"var(--yc-color-success)"},children:"Password changed successfully."}):f.jsxs("form",{onSubmit:v,className:"space-y-4",children:[c&&f.jsx("div",{className:"text-sm rounded-md px-4 py-3",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--yc-color-danger) 30%, transparent)",color:"var(--yc-color-danger)"},children:c}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Current Password"}),f.jsx("input",{type:"password",value:t,onChange:D=>n(D.target.value),required:!0,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"New Password"}),f.jsx("input",{type:"password",value:r,onChange:D=>o(D.target.value),required:!0,minLength:8,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),f.jsxs("div",{children:[f.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Confirm New Password"}),f.jsx("input",{type:"password",value:i,onChange:D=>l(D.target.value),required:!0,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),f.jsxs("div",{className:"flex justify-end gap-3",children:[f.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-sm hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),f.jsx("button",{type:"submit",disabled:y,className:"px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:y?"Saving...":"Change Password"})]})]})]})})}function O_({onNavigateToUsers:e,onNavigateToShares:t}){const n=So(h=>h.auth),r=So(h=>h.logout),[o,i]=N.useState(!1),[l,c]=N.useState(!1),d=N.useRef(null);return N.useEffect(()=>{const h=p=>{d.current&&!d.current.contains(p.target)&&i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),n.status!=="authenticated"?null:f.jsxs("div",{className:"relative",ref:d,children:[f.jsxs("button",{onClick:()=>i(!o),className:"flex items-center gap-2 text-sm px-2 py-1 rounded-md hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("span",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.user.name.charAt(0).toUpperCase()}),f.jsx("span",{children:n.user.name})]}),o&&f.jsxs("div",{className:"absolute right-0 mt-1 w-48 rounded-md shadow-lg py-1 z-50",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"px-4 py-2 text-xs border-b",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:n.user.email}),n.user.role==="admin"&&f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>{i(!1),e()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"User Management"}),t&&f.jsx("button",{onClick:()=>{i(!1),t()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"Shared Links"})]}),f.jsx("button",{onClick:()=>{i(!1),c(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"Change Password"}),f.jsx("button",{onClick:()=>{i(!1),r()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-danger)"},children:"Sign Out"})]}),l&&f.jsx(D_,{onClose:()=>c(!1)})]})}function A_({onToggleSidebar:e,onOpenSearch:t,currentPath:n,onNavigateToUsers:r,onNavigateToShares:o}){var b;const i=Sm(),{mode:l,toggleMode:c}=n2(),{data:d}=AS(),h=So(v=>v.auth),p=n.replace(/\?.*$/,"").replace(/^\//,"").split("/").filter(Boolean).map(v=>decodeURIComponent(v).replace(/-/g," ").replace(/\b\w/g,D=>D.toUpperCase())),y=typeof i.logo=="string"?`/api/assets/${i.logo.replace(/^\.\/assets\//,"")}`:i.logo?`/api/assets/${(l==="dark"&&i.logo.dark?i.logo.dark:i.logo.light).replace(/^\.\/assets\//,"")}`:null;return f.jsxs("header",{className:"yc-topbar flex items-center justify-between px-4 border-b flex-shrink-0",style:{height:"var(--yc-topbar-height)",backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:e,className:"p-1.5 rounded hover:bg-black/5 transition-colors",title:"Toggle sidebar",children:f.jsx("svg",{className:"w-5 h-5",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),y&&f.jsx("img",{src:y,alt:"",className:"h-6 w-auto"}),f.jsx("nav",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:p.map((v,D)=>f.jsxs("span",{className:"flex items-center gap-1.5",children:[D>0&&f.jsx("span",{children:"/"}),f.jsx("span",{className:D===p.length-1?"font-medium":"",style:D===p.length-1?{color:"var(--yc-color-text)"}:void 0,children:v})]},D))})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("button",{onClick:t,className:"hidden sm:flex items-center gap-1.5 p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Search (⌘K)",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),f.jsx("kbd",{className:"px-1 py-0.5 rounded text-xs font-mono border",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)",fontSize:"0.6rem",lineHeight:1},children:typeof navigator<"u"&&((b=navigator.platform)!=null&&b.includes("Mac"))?"⌘K":"Ctrl+K"})]}),f.jsx(N_,{status:d==null?void 0:d.status,connection:d==null?void 0:d.connection,connectionStatus:d==null?void 0:d.connectionStatus,authType:d==null?void 0:d.authType}),f.jsx("button",{onClick:c,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:l==="dark"?"Switch to light mode":"Switch to dark mode",children:l==="dark"?f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["v",d==null?void 0:d.version]}),h.status==="authenticated"&&r&&f.jsx(O_,{onNavigateToUsers:r,onNavigateToShares:o})]})]})}function I_({className:e,style:t}){return f.jsx("svg",{className:e,style:t,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})}function b1(e,t){if(!t.trim())return e;const n=e.toLowerCase().indexOf(t.toLowerCase());if(n===-1)return e;const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return f.jsxs(f.Fragment,{children:[r,f.jsx("mark",{style:{color:"var(--yc-color-primary)",backgroundColor:"transparent",fontWeight:600},children:o}),i]})}function M_(e,t,n=80){if(e.length<=n)return e;if(!t.trim())return e.slice(0,n)+"...";const r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return e.slice(0,n)+"...";r+t.length;const o=Math.floor((n-t.length)/2);let i=Math.max(0,r-o),l=Math.min(e.length,i+n);l===e.length&&(i=Math.max(0,l-n));let c=e.slice(i,l);return i>0&&(c="..."+c),l<e.length&&(c=c+"..."),c}function x1({item:e,query:t,isActive:n,onClick:r,onMouseEnter:o}){const i=t.trim().toLowerCase(),l=i&&e.title.toLowerCase().includes(i),c=e.description&&(!i||!l);return f.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left transition-colors cursor-pointer",style:{backgroundColor:n?"var(--yc-color-surface-hover)":"transparent",color:"var(--yc-color-text)"},onClick:r,onMouseEnter:o,"data-active":n||void 0,children:[f.jsx("div",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},children:e.kind==="dashboard"?f.jsx(I_,{className:"w-5 h-5"}):f.jsx(zc,{type:e.type,className:"w-5 h-5"})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-sm truncate",children:b1(e.title,t)}),c&&f.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:"var(--yc-color-text-secondary)"},children:i?b1(M_(e.description,t),t):e.description})]})]})}function L_({isOpen:e,onClose:t,onNavigate:n,dashboards:r,charts:o}){const i=N.useRef(null),l=N.useMemo(()=>r.map(L=>({kind:"dashboard",name:L.name,title:L.title,description:L.description})),[r]),c=N.useMemo(()=>o.map(L=>({kind:"chart",name:L.name,title:L.title,description:L.description,type:L.type})),[o]),{query:d,activeIndex:h,results:p,setQuery:y,setActiveIndex:b,moveDown:v,moveUp:D,resetSearch:S,activeItem:E}=b_(l,c);if(N.useEffect(()=>{if(e){const L=setTimeout(()=>{var _;return(_=i.current)==null?void 0:_.focus()},50);return()=>clearTimeout(L)}else S()},[e,S]),N.useEffect(()=>{if(!e)return;const L=document.querySelector('[data-active="true"]');L&&L.scrollIntoView({block:"nearest"})},[e,h]),N.useEffect(()=>{if(!e)return;function L(_){switch(_.key){case"ArrowDown":_.preventDefault(),v();break;case"Tab":_.preventDefault(),_.shiftKey?D():v();break;case"ArrowUp":_.preventDefault(),D();break;case"Enter":if(_.preventDefault(),E){const C=E.kind==="dashboard"?`/dashboards/${E.name}`:`/charts/${E.name}`;n(C),t()}break;case"Escape":_.preventDefault(),t();break}}return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,E,v,D,n,t]),!e)return null;const T=d.trim().length>0,k=T&&p.all.length===0,O=p.dashboards.length;function I(L){const _=L.kind==="dashboard"?`/dashboards/${L.name}`:`/charts/${L.name}`;n(_),t()}return f.jsx("div",{className:"fixed inset-0 z-50 flex justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.5)"},onClick:L=>{L.target===L.currentTarget&&t()},children:f.jsxs("div",{className:"w-full max-w-lg rounded-xl shadow-2xl overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",marginTop:"15vh",height:"fit-content",maxHeight:"70vh"},children:[f.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b",style:{borderColor:"var(--yc-color-border)"},children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),f.jsx("input",{ref:i,type:"text",value:d,onChange:L=>y(L.target.value),placeholder:"Search dashboards and charts...",className:"flex-1 bg-transparent outline-none text-sm",style:{color:"var(--yc-color-text)"}}),T&&f.jsx("button",{onClick:()=>y(""),className:"p-0.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsx("div",{className:"overflow-y-auto py-2",style:{maxHeight:"20rem"},children:k?f.jsxs("div",{className:"px-3 py-8 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["No results for “",d,"”"]}):f.jsxs(f.Fragment,{children:[p.dashboards.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"px-3 py-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Dashboards"}),p.dashboards.map((L,_)=>f.jsx(x1,{item:L,query:d,isActive:_===h,onClick:()=>I(L),onMouseEnter:()=>b(_)},`dashboard-${L.name}`))]}),p.charts.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"px-3 py-1.5 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Charts"}),p.charts.map((L,_)=>f.jsx(x1,{item:L,query:d,isActive:O+_===h,onClick:()=>I(L),onMouseEnter:()=>b(O+_)},`chart-${L.name}`))]})]})})]})})}const v1="yamchart-sidebar-hidden";function R_({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:o}){const{data:i}=ma(),{data:l}=t2(),c=Sm(),d=dm(),h=(i==null?void 0:i.charts)||[],p=l||[],[y,b]=N.useState(()=>c.sidebarShow?localStorage.getItem(v1)==="true":!0),[v,D]=N.useState(!1),[S,E]=N.useState(!1);N.useEffect(()=>{const I=L=>{(L.metaKey||L.ctrlKey)&&L.key==="k"&&(L.preventDefault(),E(!0))};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[]);const T=!y&&d!=="sm",k=d==="md"&&!y,O=N.useCallback(()=>{if(d==="sm"){D(I=>!I);return}b(I=>{const L=!I;return localStorage.setItem(v1,String(L)),L})},[d]);return f.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[T&&f.jsx(g1,{dashboards:p,charts:h,currentPath:t,onNavigate:n,collapsed:k}),d==="sm"&&v&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 transition-opacity",onClick:()=>D(!1)}),f.jsx("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 shadow-xl",style:{backgroundColor:"var(--yc-color-sidebar)"},children:f.jsx(g1,{dashboards:p,charts:h,currentPath:t,onNavigate:I=>{n(I),D(!1)}})})]}),f.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[f.jsx(A_,{onToggleSidebar:O,onOpenSearch:()=>E(!0),currentPath:t,onNavigateToUsers:r,onNavigateToShares:o}),f.jsx("main",{className:"flex-1 overflow-auto",children:e})]}),f.jsx(L_,{isOpen:S,onClose:()=>E(!1),onNavigate:I=>{n(I),E(!1)},dashboards:p,charts:h})]})}function P_(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Ph={},Il={};function qo(e,t){try{const r=(Ph[e]||(Ph[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in Il?Il[r]:E1(r,r.split(":"))}catch{if(e in Il)return Il[e];const n=e==null?void 0:e.match(j_);return n?E1(e,n.slice(1)):NaN}}const j_=/([+-]\d\d):?(\d\d)?/;function E1(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return Il[e]=n*60+r>0?n*60+r+o:n*60-r-o}class is extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(qo(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),i2(this),L0(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new is(...n,t):new is(Date.now(),t)}withTimeZone(t){return new is(+this,t)}getTimezoneOffset(){const t=-qo(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),L0(this),+this}[Symbol.for("constructDateFrom")](t){return new is(+new Date(t),this.timeZone)}}const T1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!T1.test(e))return;const t=e.replace(T1,"$1UTC");is.prototype[t]&&(e.startsWith("get")?is.prototype[e]=function(){return this.internal[t]()}:(is.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),F_(this),+this},is.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),L0(this),+this}))});function L0(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-qo(e.timeZone,e)*60))}function F_(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),i2(e)}function i2(e){const t=qo(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),i=-new Date(+r).getTimezoneOffset(),l=o-i,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const d=o-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const h=new Date(+e);h.setUTCSeconds(0);const p=o>0?h.getSeconds():(h.getSeconds()-60)%60,y=Math.round(-(qo(e.timeZone,e)*60))%60;(y||p)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+y),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+y+p));const b=qo(e.timeZone,e),v=b>0?Math.floor(b):Math.ceil(b),S=-new Date(+e).getTimezoneOffset()-v,E=v!==n,T=S-d;if(E&&T){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+T);const k=qo(e.timeZone,e),O=k>0?Math.floor(k):Math.ceil(k),I=v-O;I&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+I))}}class jn extends is{static tz(t,...n){return n.length?new jn(...n,t):new jn(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${P_(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new jn(+this,t)}[Symbol.for("constructDateFrom")](t){return new jn(+new Date(t),this.timeZone)}}const w1=5,B_=4;function H_(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),i=t.addDays(o,w1*7-1);return t.getMonth(e)===t.getMonth(i)?w1:B_}function l2(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function U_(e,t){const n=l2(e,t),r=H_(e,t);return t.addDays(n,r*7-1)}const u2={...Yo,labels:{labelDayButton:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(l,c)=>on(l,c,{locale:Yo,...n});let i=o(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,i)=>on(o,i,{locale:Yo,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;r&&typeof r.format=="function"?o=r.format.bind(r):o=(l,c)=>on(l,c,{locale:Yo,...n});let i=o(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(o,i)=>on(o,i,{locale:Yo,...t}),r(e,"cccc")}}};class mr{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?jn.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,i)=>{var l;return(l=this.overrides)!=null&&l.newDate?this.overrides.newDate(r,o,i):this.options.timeZone?new jn(r,o,i,this.options.timeZone):new Date(r,o,i)},this.addDays=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(r,o):Ms(r,o)},this.addMonths=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(r,o):vi(r,o)},this.addWeeks=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(r,o):fd(r,o)},this.addYears=(r,o)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(r,o):hd(r,o)},this.differenceInCalendarDays=(r,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):pm(r,o)},this.differenceInCalendarMonths=(r,o)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):zx(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):YS(r)},this.eachYearOfInterval=r=>{var c;const o=(c=this.overrides)!=null&&c.eachYearOfInterval?this.overrides.eachYearOfInterval(r):$S(r),i=new Set(o.map(d=>this.getYear(d)));if(i.size===o.length)return o;const l=[];return i.forEach(d=>{l.push(new Date(d,0,1))}),l},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):U_(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):qS(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):md(r)},this.endOfWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,o):yd(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):pd(r)},this.format=(r,o,i)=>{var c;const l=(c=this.overrides)!=null&&c.format?this.overrides.format(r,o,this.options):on(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):gd(r)},this.getMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(r,this.options):Uk(r,this.options)},this.getYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(r,this.options):zk(r,this.options)},this.getWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):bd(r,this.options)},this.isAfter=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(r,o):Wk(r,o)},this.isBefore=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(r,o):Yk(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):Ux(r)},this.isSameDay=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(r,o):US(r,o)},this.isSameMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(r,o):HC(r,o)},this.isSameYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(r,o):UC(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):BS(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):HS(r)},this.setMonth=(r,o)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(r,o):r_(r,o)},this.setYear=(r,o)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(r,o):s_(r,o)},this.startOfBroadcastWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):l2(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):ua(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):la(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):ql(r)},this.startOfWeek=(r,o)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):zr(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):mi(r)},this.options={locale:u2,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&mr.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:o}=this.options,i=n==null?void 0:n.code;if(i&&mr.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:r,numberingSystem:o}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}mr.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const ds=new mr;class c2{constructor(t,n,r=ds){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class z_{constructor(t,n){this.date=t,this.weeks=n}}class W_{constructor(t,n){this.days=n,this.weekNumber=t}}function Y_(e){return Me.createElement("button",{...e})}function $_(e){return Me.createElement("span",{...e})}function q_(e){const{size:t=24,orientation:n="left",className:r}=e;return Me.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&Me.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&Me.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&Me.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&Me.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function V_(e){const{day:t,modifiers:n,...r}=e;return Me.createElement("td",{...r})}function Q_(e){const{day:t,modifiers:n,...r}=e,o=Me.useRef(null);return Me.useEffect(()=>{var i;n.focused&&((i=o.current)==null||i.focus())},[n.focused]),Me.createElement("button",{ref:o,...r})}var Qe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Qe||(Qe={}));var Kt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Kt||(Kt={}));var Ur;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Ur||(Ur={}));var dr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(dr||(dr={}));function G_(e){const{options:t,className:n,components:r,classNames:o,...i}=e,l=[o[Qe.Dropdown],n].join(" "),c=t==null?void 0:t.find(({value:d})=>d===i.value);return Me.createElement("span",{"data-disabled":i.disabled,className:o[Qe.DropdownRoot]},Me.createElement(r.Select,{className:l,...i},t==null?void 0:t.map(({value:d,label:h,disabled:p})=>Me.createElement(r.Option,{key:d,value:d,disabled:p},h))),Me.createElement("span",{className:o[Qe.CaptionLabel],"aria-hidden":!0},c==null?void 0:c.label,Me.createElement(r.Chevron,{orientation:"down",size:18,className:o[Qe.Chevron]})))}function K_(e){return Me.createElement("div",{...e})}function X_(e){return Me.createElement("div",{...e})}function J_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Me.createElement("div",{...r},e.children)}function Z_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return Me.createElement("div",{...r})}function eN(e){return Me.createElement("table",{...e})}function tN(e){return Me.createElement("div",{...e})}const d2=N.createContext(void 0);function au(){const e=N.useContext(d2);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function nN(e){const{components:t}=au();return Me.createElement(t.Dropdown,{...e})}function rN(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...i}=e,{components:l,classNames:c,labels:{labelPrevious:d,labelNext:h}}=au(),p=N.useCallback(b=>{o&&(n==null||n(b))},[o,n]),y=N.useCallback(b=>{r&&(t==null||t(b))},[r,t]);return Me.createElement("nav",{...i},Me.createElement(l.PreviousMonthButton,{type:"button",className:c[Qe.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:y},Me.createElement(l.Chevron,{disabled:r?void 0:!0,className:c[Qe.Chevron],orientation:"left"})),Me.createElement(l.NextMonthButton,{type:"button",className:c[Qe.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":h(o),onClick:p},Me.createElement(l.Chevron,{disabled:o?void 0:!0,orientation:"right",className:c[Qe.Chevron]})))}function sN(e){const{components:t}=au();return Me.createElement(t.Button,{...e})}function oN(e){return Me.createElement("option",{...e})}function aN(e){const{components:t}=au();return Me.createElement(t.Button,{...e})}function iN(e){const{rootRef:t,...n}=e;return Me.createElement("div",{...n,ref:t})}function lN(e){return Me.createElement("select",{...e})}function uN(e){const{week:t,...n}=e;return Me.createElement("tr",{...n})}function cN(e){return Me.createElement("th",{...e})}function dN(e){return Me.createElement("thead",{"aria-hidden":!0},Me.createElement("tr",{...e}))}function fN(e){const{week:t,...n}=e;return Me.createElement("th",{...n})}function hN(e){return Me.createElement("th",{...e})}function mN(e){return Me.createElement("tbody",{...e})}function pN(e){const{components:t}=au();return Me.createElement(t.Dropdown,{...e})}const yN=Object.freeze(Object.defineProperty({__proto__:null,Button:Y_,CaptionLabel:$_,Chevron:q_,Day:V_,DayButton:Q_,Dropdown:G_,DropdownNav:K_,Footer:X_,Month:J_,MonthCaption:Z_,MonthGrid:eN,Months:tN,MonthsDropdown:nN,Nav:rN,NextMonthButton:sN,Option:oN,PreviousMonthButton:aN,Root:iN,Select:lN,Week:uN,WeekNumber:fN,WeekNumberHeader:hN,Weekday:cN,Weekdays:dN,Weeks:mN,YearsDropdown:pN},Symbol.toStringTag,{value:"Module"}));function Os(e,t,n=!1,r=ds){let{from:o,to:i}=e;const{differenceInCalendarDays:l,isSameDay:c}=r;return o&&i?(l(i,o)<0&&([o,i]=[i,o]),l(t,o)>=(n?1:0)&&l(i,t)>=(n?1:0)):!n&&i?c(i,t):!n&&o?c(o,t):!1}function km(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function xd(e){return!!(e&&typeof e=="object"&&"from"in e)}function Cm(e){return!!(e&&typeof e=="object"&&"after"in e)}function _m(e){return!!(e&&typeof e=="object"&&"before"in e)}function f2(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function h2(e,t){return Array.isArray(e)&&e.every(t.isDate)}function As(e,t,n=ds){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:i,isAfter:l}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return o(e,c);if(h2(c,n))return c.some(d=>o(e,d));if(xd(c))return Os(c,e,!1,n);if(f2(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(km(c)){const d=i(c.before,e),h=i(c.after,e),p=d>0,y=h<0;return l(c.before,c.after)?y&&p:p||y}return Cm(c)?i(e,c.after)>0:_m(c)?i(c.before,e)>0:typeof c=="function"?c(e):!1})}function gN(e,t,n,r,o){const{disabled:i,hidden:l,modifiers:c,showOutsideDays:d,broadcastCalendar:h,today:p=o.today()}=t,{isSameDay:y,isSameMonth:b,startOfMonth:v,isBefore:D,endOfMonth:S,isAfter:E}=o,T=n&&v(n),k=r&&S(r),O={[Kt.focused]:[],[Kt.outside]:[],[Kt.disabled]:[],[Kt.hidden]:[],[Kt.today]:[]},I={};for(const L of e){const{date:_,displayMonth:C}=L,A=!!(C&&!b(_,C)),P=!!(T&&D(_,T)),H=!!(k&&E(_,k)),B=!!(i&&As(_,i,o)),z=!!(l&&As(_,l,o))||P||H||!h&&!d&&A||h&&d===!1&&A,Q=y(_,p);A&&O.outside.push(L),B&&O.disabled.push(L),z&&O.hidden.push(L),Q&&O.today.push(L),c&&Object.keys(c).forEach(q=>{const X=c==null?void 0:c[q];X&&As(_,X,o)&&(I[q]?I[q].push(L):I[q]=[L])})}return L=>{const _={[Kt.focused]:!1,[Kt.disabled]:!1,[Kt.hidden]:!1,[Kt.outside]:!1,[Kt.today]:!1},C={};for(const A in O){const P=O[A];_[A]=P.some(H=>H===L)}for(const A in I)C[A]=I[A].some(P=>P===L);return{..._,...C}}}function bN(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[i])=>(n[i]?o.push(n[i]):t[Kt[i]]?o.push(t[Kt[i]]):t[Ur[i]]&&o.push(t[Ur[i]]),o),[t[Qe.Day]])}function xN(e){return{...yN,...e}}function vN(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function EN(){const e={};for(const t in Qe)e[Qe[t]]=`rdp-${Qe[t]}`;for(const t in Kt)e[Kt[t]]=`rdp-${Kt[t]}`;for(const t in Ur)e[Ur[t]]=`rdp-${Ur[t]}`;for(const t in dr)e[dr[t]]=`rdp-${dr[t]}`;return e}function m2(e,t,n){return(n??new mr(t)).formatMonthYear(e)}const TN=m2;function wN(e,t,n){return(n??new mr(t)).format(e,"d")}function SN(e,t=ds){return t.format(e,"LLLL")}function kN(e,t,n){return(n??new mr(t)).format(e,"cccccc")}function CN(e,t=ds){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _N(){return""}function p2(e,t=ds){return t.format(e,"yyyy")}const NN=p2,DN=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:m2,formatDay:wN,formatMonthCaption:TN,formatMonthDropdown:SN,formatWeekNumber:CN,formatWeekNumberHeader:_N,formatWeekdayName:kN,formatYearCaption:NN,formatYearDropdown:p2},Symbol.toStringTag,{value:"Module"}));function ON(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...DN,...e}}function Nm(e,t,n,r){let o=(r??new mr(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const AN=Nm;function Dm(e,t,n){return(n??new mr(t)).formatMonthYear(e)}const IN=Dm;function y2(e,t,n,r){let o=(r??new mr(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function g2(e){return"Choose the Month"}function b2(){return""}const MN="Go to the Next Month";function x2(e,t){return MN}function v2(e){return"Go to the Previous Month"}function E2(e,t,n){return(n??new mr(t)).format(e,"cccc")}function T2(e,t){return`Week ${e}`}function w2(e){return"Week Number"}function S2(e){return"Choose the Year"}const LN=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:IN,labelDay:AN,labelDayButton:Nm,labelGrid:Dm,labelGridcell:y2,labelMonthDropdown:g2,labelNav:b2,labelNext:x2,labelPrevious:v2,labelWeekNumber:T2,labelWeekNumberHeader:w2,labelWeekday:E2,labelYearDropdown:S2},Symbol.toStringTag,{value:"Module"})),jr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function RN(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...LN,...e??{},labelDayButton:jr(Nm,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:jr(g2,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:jr(x2,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:jr(v2,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:jr(T2,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:jr(S2,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:jr(Dm,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:jr(y2,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:jr(b2,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:jr(w2,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:jr(E2,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function PN(e,t,n,r,o){const{startOfMonth:i,startOfYear:l,endOfYear:c,eachMonthOfInterval:d,getMonth:h}=o;return d({start:l(e),end:c(e)}).map(b=>{const v=r.formatMonthDropdown(b,o),D=h(b),S=t&&b<i(t)||n&&b>i(n)||!1;return{value:D,label:v,disabled:S}})}function jN(e,t={},n={}){let r={...t==null?void 0:t[Qe.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function FN(e,t,n,r){const o=r??e.today(),i=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),l=[];for(let c=0;c<7;c++){const d=e.addDays(i,c);l.push(d)}return l}function BN(e,t,n,r,o=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:c,getYear:d}=r,h=i(e),p=l(t),y=c({start:h,end:p});return o&&y.reverse(),y.map(b=>{const v=n.formatYearDropdown(b,r);return{value:d(b),label:v,disabled:!1}})}function HN(e,t={}){var c;const{weekStartsOn:n,locale:r}=t,o=n??((c=r==null?void 0:r.options)==null?void 0:c.weekStartsOn)??0,i=d=>{const h=typeof d=="number"||typeof d=="string"?new Date(d):d;return new jn(h.getFullYear(),h.getMonth(),h.getDate(),12,0,0,e)},l=d=>{const h=i(d);return new Date(h.getFullYear(),h.getMonth(),h.getDate(),0,0,0,0)};return{today:()=>i(jn.tz(e)),newDate:(d,h,p)=>new jn(d,h,p,12,0,0,e),startOfDay:d=>i(d),startOfWeek:(d,h)=>{const p=i(d),y=(h==null?void 0:h.weekStartsOn)??o,b=(p.getDay()-y+7)%7;return p.setDate(p.getDate()-b),p},startOfISOWeek:d=>{const h=i(d),p=(h.getDay()-1+7)%7;return h.setDate(h.getDate()-p),h},startOfMonth:d=>{const h=i(d);return h.setDate(1),h},startOfYear:d=>{const h=i(d);return h.setMonth(0,1),h},endOfWeek:(d,h)=>{const p=i(d),v=((((h==null?void 0:h.weekStartsOn)??o)+6)%7-p.getDay()+7)%7;return p.setDate(p.getDate()+v),p},endOfISOWeek:d=>{const h=i(d),p=(7-h.getDay())%7;return h.setDate(h.getDate()+p),h},endOfMonth:d=>{const h=i(d);return h.setMonth(h.getMonth()+1,0),h},endOfYear:d=>{const h=i(d);return h.setMonth(11,31),h},eachMonthOfInterval:d=>{const h=i(d.start),p=i(d.end),y=[],b=new jn(h.getFullYear(),h.getMonth(),1,12,0,0,e),v=p.getFullYear()*12+p.getMonth();for(;b.getFullYear()*12+b.getMonth()<=v;)y.push(new jn(b,e)),b.setMonth(b.getMonth()+1,1);return y},addDays:(d,h)=>{const p=i(d);return p.setDate(p.getDate()+h),p},addWeeks:(d,h)=>{const p=i(d);return p.setDate(p.getDate()+h*7),p},addMonths:(d,h)=>{const p=i(d);return p.setMonth(p.getMonth()+h),p},addYears:(d,h)=>{const p=i(d);return p.setFullYear(p.getFullYear()+h),p},eachYearOfInterval:d=>{const h=i(d.start),p=i(d.end),y=[],b=new jn(h.getFullYear(),0,1,12,0,0,e);for(;b.getFullYear()<=p.getFullYear();)y.push(new jn(b,e)),b.setFullYear(b.getFullYear()+1,0,1);return y},getWeek:(d,h)=>{var y;const p=l(d);return bd(p,{weekStartsOn:(h==null?void 0:h.weekStartsOn)??o,firstWeekContainsDate:(h==null?void 0:h.firstWeekContainsDate)??((y=r==null?void 0:r.options)==null?void 0:y.firstWeekContainsDate)??1})},getISOWeek:d=>{const h=l(d);return gd(h)},differenceInCalendarDays:(d,h)=>{const p=l(d),y=l(h);return pm(p,y)},differenceInCalendarMonths:(d,h)=>{const p=l(d),y=l(h);return zx(p,y)}}}const iu=e=>e instanceof HTMLElement?e:null,jh=e=>[...e.querySelectorAll("[data-animated-month]")??[]],UN=e=>iu(e.querySelector("[data-animated-month]")),Fh=e=>iu(e.querySelector("[data-animated-caption]")),Bh=e=>iu(e.querySelector("[data-animated-weeks]")),zN=e=>iu(e.querySelector("[data-animated-nav]")),WN=e=>iu(e.querySelector("[data-animated-weekdays]"));function YN(e,t,{classNames:n,months:r,focused:o,dateLib:i}){const l=N.useRef(null),c=N.useRef(r),d=N.useRef(!1);N.useLayoutEffect(()=>{const h=c.current;if(c.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const p=i.isSameMonth(r[0].date,h[0].date),y=i.isAfter(r[0].date,h[0].date),b=y?n[dr.caption_after_enter]:n[dr.caption_before_enter],v=y?n[dr.weeks_after_enter]:n[dr.weeks_before_enter],D=l.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(jh(S).forEach(O=>{if(!(O instanceof HTMLElement))return;const I=UN(O);I&&O.contains(I)&&O.removeChild(I);const L=Fh(O);L&&L.classList.remove(b);const _=Bh(O);_&&_.classList.remove(v)}),l.current=S):l.current=null,d.current||p||o)return;const E=D instanceof HTMLElement?jh(D):[],T=jh(e.current);if(T!=null&&T.every(k=>k instanceof HTMLElement)&&E&&E.every(k=>k instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const k=zN(e.current);k&&(k.style.zIndex="1"),T.forEach((O,I)=>{const L=E[I];if(!L)return;O.style.position="relative",O.style.overflow="hidden";const _=Fh(O);_&&_.classList.add(b);const C=Bh(O);C&&C.classList.add(v);const A=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),k&&(k.style.zIndex=""),_&&_.classList.remove(b),C&&C.classList.remove(v),O.style.position="",O.style.overflow="",O.contains(L)&&O.removeChild(L)};L.style.pointerEvents="none",L.style.position="absolute",L.style.overflow="hidden",L.setAttribute("aria-hidden","true");const P=WN(L);P&&(P.style.opacity="0");const H=Fh(L);H&&(H.classList.add(y?n[dr.caption_before_exit]:n[dr.caption_after_exit]),H.addEventListener("animationend",A));const B=Bh(L);B&&B.classList.add(y?n[dr.weeks_before_exit]:n[dr.weeks_after_exit]),O.insertBefore(L,O.firstChild)})}})}function $N(e,t,n,r){const o=e[0],i=e[e.length-1],{ISOWeek:l,fixedWeeks:c,broadcastCalendar:d}=n??{},{addDays:h,differenceInCalendarDays:p,differenceInCalendarMonths:y,endOfBroadcastWeek:b,endOfISOWeek:v,endOfMonth:D,endOfWeek:S,isAfter:E,startOfBroadcastWeek:T,startOfISOWeek:k,startOfWeek:O}=r,I=d?T(o,r):l?k(o):O(o),L=d?b(i):l?v(D(i)):S(D(i)),_=t&&(d?b(t):l?v(t):S(t)),C=_&&E(L,_)?_:L,A=p(C,I),P=y(i,o)+1,H=[];for(let Q=0;Q<=A;Q++){const q=h(I,Q);H.push(q)}const z=(d?35:42)*P;if(c&&H.length<z){const Q=z-H.length;for(let q=0;q<Q;q++){const X=h(H[H.length-1],1);H.push(X)}}return H}function qN(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((i,l)=>i.concat(l.days.slice()),t.slice());return n.concat(o.slice())},t.slice())}function VN(e,t,n,r){const{numberOfMonths:o=1}=n,i=[];for(let l=0;l<o;l++){const c=r.addMonths(e,l);if(t&&c>t)break;i.push(c)}return i}function S1(e,t,n,r){const{month:o,defaultMonth:i,today:l=r.today(),numberOfMonths:c=1}=e;let d=o||i||l;const{differenceInCalendarMonths:h,addMonths:p,startOfMonth:y}=r;if(n&&h(n,d)<c-1){const b=-1*(c-1);d=p(n,b)}return t&&h(d,t)<0&&(d=t),y(d)}function QN(e,t,n,r){const{addDays:o,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:c,endOfWeek:d,getISOWeek:h,getWeek:p,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:v}=r,D=e.reduce((S,E)=>{const T=n.broadcastCalendar?y(E,r):n.ISOWeek?b(E):v(E),k=n.broadcastCalendar?i(E):n.ISOWeek?l(c(E)):d(c(E)),O=t.filter(C=>C>=T&&C<=k),I=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<I){const C=t.filter(A=>{const P=I-O.length;return A>k&&A<=o(k,P)});O.push(...C)}const L=O.reduce((C,A)=>{const P=n.ISOWeek?h(A):p(A),H=C.find(z=>z.weekNumber===P),B=new c2(A,E,r);return H?H.days.push(B):C.push(new W_(P,[B])),C},[]),_=new z_(E,L);return S.push(_),S},[]);return n.reverseMonths?D.reverse():D}function GN(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:i,startOfMonth:l,endOfMonth:c,addYears:d,endOfYear:h,newDate:p,today:y}=t,{fromYear:b,toYear:v,fromMonth:D,toMonth:S}=e;!n&&D&&(n=D),!n&&b&&(n=t.newDate(b,0,1)),!r&&S&&(r=S),!r&&v&&(r=p(v,11,31));const E=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):b?n=p(b,0,1):!n&&E&&(n=o(d(e.today??y(),-100))),r?r=c(r):v?r=p(v,11,31):!r&&E&&(r=h(e.today??y())),[n&&i(n),r&&i(r)]}function KN(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=o?i:1,p=l(e);if(!t)return c(p,h);if(!(d(t,e)<i))return c(p,h)}function XN(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:i}=n,{startOfMonth:l,addMonths:c,differenceInCalendarMonths:d}=r,h=o?i??1:1,p=l(e);if(!t)return c(p,-h);if(!(d(p,t)<=0))return c(p,-h)}function JN(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function vd(e,t){const[n,r]=N.useState(e);return[t===void 0?n:t,r]}function ZN(e,t){var I;const[n,r]=GN(e,t),{startOfMonth:o,endOfMonth:i}=t,l=S1(e,n,r,t),[c,d]=vd(l,e.month?l:void 0);N.useEffect(()=>{const L=S1(e,n,r,t);d(L)},[e.timeZone]);const{months:h,weeks:p,days:y,previousMonth:b,nextMonth:v}=N.useMemo(()=>{const L=VN(c,r,{numberOfMonths:e.numberOfMonths},t),_=$N(L,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),C=QN(L,_,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),A=JN(C),P=qN(C),H=XN(c,n,e,t),B=KN(c,r,e,t);return{months:C,weeks:A,days:P,previousMonth:H,nextMonth:B}},[t,c.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(I=e.endMonth)==null?void 0:I.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:D,onMonthChange:S}=e,E=L=>p.some(_=>_.days.some(C=>C.isEqualTo(L))),T=L=>{if(D)return;let _=o(L);n&&_<o(n)&&(_=o(n)),r&&_>o(r)&&(_=o(r)),d(_),S==null||S(_)};return{months:h,weeks:p,days:y,navStart:n,navEnd:r,previousMonth:b,nextMonth:v,goToMonth:T,goToDay:L=>{E(L)||T(L.date)}}}var Jr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Jr||(Jr={}));function k1(e){return!e[Kt.disabled]&&!e[Kt.hidden]&&!e[Kt.outside]}function e3(e,t,n,r){let o,i=-1;for(const l of e){const c=t(l);k1(c)&&(c[Kt.focused]&&i<Jr.FocusedModifier?(o=l,i=Jr.FocusedModifier):r!=null&&r.isEqualTo(l)&&i<Jr.LastFocused?(o=l,i=Jr.LastFocused):n(l.date)&&i<Jr.Selected?(o=l,i=Jr.Selected):c[Kt.today]&&i<Jr.Today&&(o=l,i=Jr.Today))}return o||(o=e.find(l=>k1(t(l)))),o}function t3(e,t,n,r,o,i,l){const{ISOWeek:c,broadcastCalendar:d}=i,{addDays:h,addMonths:p,addWeeks:y,addYears:b,endOfBroadcastWeek:v,endOfISOWeek:D,endOfWeek:S,max:E,min:T,startOfBroadcastWeek:k,startOfISOWeek:O,startOfWeek:I}=l;let _={day:h,week:y,month:p,year:b,startOfWeek:C=>d?k(C,l):c?O(C):I(C),endOfWeek:C=>d?v(C):c?D(C):S(C)}[e](n,t==="after"?1:-1);return t==="before"&&r?_=E([r,_]):t==="after"&&o&&(_=T([o,_])),_}function k2(e,t,n,r,o,i,l,c=0){if(c>365)return;const d=t3(e,t,n.date,r,o,i,l),h=!!(i.disabled&&As(d,i.disabled,l)),p=!!(i.hidden&&As(d,i.hidden,l)),y=d,b=new c2(d,y,l);return!h&&!p?b:k2(e,t,b,r,o,i,l,c+1)}function n3(e,t,n,r,o){const{autoFocus:i}=e,[l,c]=N.useState(),d=e3(t.days,n,r||(()=>!1),l),[h,p]=N.useState(i?d:void 0);return{isFocusTarget:S=>!!(d!=null&&d.isEqualTo(S)),setFocused:p,focused:h,blur:()=>{c(h),p(void 0)},moveFocus:(S,E)=>{if(!h)return;const T=k2(S,E,h,t.navStart,t.navEnd,e,o);T&&(e.disableNavigation&&!t.days.some(O=>O.isEqualTo(T))||(t.goToDay(T),p(T)))}}}function r3(e,t){const{selected:n,required:r,onSelect:o}=e,[i,l]=vd(n,o?n:void 0),c=o?n:i,{isSameDay:d}=t,h=v=>(c==null?void 0:c.some(D=>d(D,v)))??!1,{min:p,max:y}=e;return{selected:c,select:(v,D,S)=>{let E=[...c??[]];if(h(v)){if((c==null?void 0:c.length)===p||r&&(c==null?void 0:c.length)===1)return;E=c==null?void 0:c.filter(T=>!d(T,v))}else(c==null?void 0:c.length)===y?E=[v]:E=[...E,v];return o||l(E),o==null||o(E,v,D,S),E},isSelected:h}}function s3(e,t,n=0,r=0,o=!1,i=ds){const{from:l,to:c}=t||{},{isSameDay:d,isAfter:h,isBefore:p}=i;let y;if(!l&&!c)y={from:e,to:n>0?void 0:e};else if(l&&!c)d(l,e)?n===0?y={from:l,to:e}:o?y={from:l,to:void 0}:y=void 0:p(e,l)?y={from:e,to:l}:y={from:l,to:e};else if(l&&c)if(d(l,e)&&d(c,e))o?y={from:l,to:c}:y=void 0;else if(d(l,e))y={from:l,to:n>0?void 0:e};else if(d(c,e))y={from:e,to:n>0?void 0:e};else if(p(e,l))y={from:e,to:c};else if(h(e,l))y={from:l,to:e};else if(h(e,c))y={from:l,to:e};else throw new Error("Invalid range");if(y!=null&&y.from&&(y!=null&&y.to)){const b=i.differenceInCalendarDays(y.to,y.from);r>0&&b>r?y={from:e,to:void 0}:n>1&&b<n&&(y={from:e,to:void 0})}return y}function o3(e,t,n=ds){const r=Array.isArray(t)?t:[t];let o=e.from;const i=n.differenceInCalendarDays(e.to,e.from),l=Math.min(i,6);for(let c=0;c<=l;c++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function C1(e,t,n=ds){return Os(e,t.from,!1,n)||Os(e,t.to,!1,n)||Os(t,e.from,!1,n)||Os(t,e.to,!1,n)}function a3(e,t,n=ds){const r=Array.isArray(t)?t:[t];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?Os(e,c,!1,n):h2(c,n)?c.some(d=>Os(e,d,!1,n)):xd(c)?c.from&&c.to?C1(e,{from:c.from,to:c.to},n):!1:f2(c)?o3(e,c.dayOfWeek,n):km(c)?n.isAfter(c.before,c.after)?C1(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):As(e.from,c,n)||As(e.to,c,n):Cm(c)||_m(c)?As(e.from,c,n)||As(e.to,c,n):!1))return!0;const l=r.filter(c=>typeof c=="function");if(l.length){let c=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let h=0;h<=d;h++){if(l.some(p=>p(c)))return!0;c=n.addDays(c,1)}}return!1}function i3(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:i,onSelect:l}=e,[c,d]=vd(o,l?o:void 0),h=l?o:c;return{selected:h,select:(b,v,D)=>{const{min:S,max:E}=e,T=b?s3(b,h,S,E,i,t):void 0;return r&&n&&(T!=null&&T.from)&&T.to&&a3({from:T.from,to:T.to},n,t)&&(T.from=b,T.to=void 0),l||d(T),l==null||l(T,b,v,D),T},isSelected:b=>h&&Os(h,b,!1,t)}}function l3(e,t){const{selected:n,required:r,onSelect:o}=e,[i,l]=vd(n,o?n:void 0),c=o?n:i,{isSameDay:d}=t;return{selected:c,select:(y,b,v)=>{let D=y;return!r&&c&&c&&d(y,c)&&(D=void 0),o||l(D),o==null||o(D,y,b,v),D},isSelected:y=>c?d(c,y):!1}}function u3(e,t){const n=l3(e,t),r=r3(e,t),o=i3(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function Tr(e,t){return e instanceof jn&&e.timeZone===t?e:new jn(e,t)}function Ya(e,t,n){return Tr(e,t)}function _1(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Ya(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Ya(r,t):r):xd(e)?{...e,from:e.from?Tr(e.from,t):e.from,to:e.to?Tr(e.to,t):e.to}:km(e)?{before:Ya(e.before,t),after:Ya(e.after,t)}:Cm(e)?{after:Ya(e.after,t)}:_m(e)?{before:Ya(e.before,t)}:e}function Hh(e,t,n){return e&&(Array.isArray(e)?e.map(r=>_1(r,t)):_1(e,t))}function Qa(e){var Dr;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=Tr(t.today,n)),t.month&&(t.month=Tr(t.month,n)),t.defaultMonth&&(t.defaultMonth=Tr(t.defaultMonth,n)),t.startMonth&&(t.startMonth=Tr(t.startMonth,n)),t.endMonth&&(t.endMonth=Tr(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=Tr(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(Dr=t.selected)==null?void 0:Dr.map(Ke=>Tr(Ke,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?Tr(t.selected.from,n):t.selected.from,to:t.selected.to?Tr(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Hh(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Hh(t.hidden,n)),t.modifiers)){const Ke={};Object.keys(t.modifiers).forEach(ut=>{var Ie;Ke[ut]=Hh((Ie=t.modifiers)==null?void 0:Ie[ut],n)}),t.modifiers=Ke}const{components:r,formatters:o,labels:i,dateLib:l,locale:c,classNames:d}=N.useMemo(()=>{const Ke={...u2,...t.locale},ut=t.broadcastCalendar?1:t.weekStartsOn,Ie=t.noonSafe&&t.timeZone?HN(t.timeZone,{weekStartsOn:ut,locale:Ke}):void 0,Ue=t.dateLib&&Ie?{...Ie,...t.dateLib}:t.dateLib??Ie,ft=new mr({locale:Ke,weekStartsOn:ut,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Ue);return{dateLib:ft,components:xN(t.components),formatters:ON(t.formatters),labels:RN(t.labels,ft.options),locale:Ke,classNames:{...EN(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:l.today()});const{captionLayout:h,mode:p,navLayout:y,numberOfMonths:b=1,onDayBlur:v,onDayClick:D,onDayFocus:S,onDayKeyDown:E,onDayMouseEnter:T,onDayMouseLeave:k,onNextClick:O,onPrevClick:I,showWeekNumber:L,styles:_}=t,{formatCaption:C,formatDay:A,formatMonthDropdown:P,formatWeekNumber:H,formatWeekNumberHeader:B,formatWeekdayName:z,formatYearDropdown:Q}=o,q=ZN(t,l),{days:X,months:ie,navStart:ge,navEnd:te,previousMonth:de,nextMonth:M,goToMonth:V}=q,ae=gN(X,t,ge,te,l),{isSelected:j,select:le,selected:pe}=u3(t,l)??{},{blur:ye,focused:Ne,isFocusTarget:G,moveFocus:Z,setFocused:ue}=n3(t,q,ae,j??(()=>!1),l),{labelDayButton:me,labelGridcell:Ce,labelGrid:Re,labelMonthDropdown:tt,labelNav:Ge,labelPrevious:nt,labelNext:we,labelWeekday:je,labelWeekNumber:oe,labelWeekNumberHeader:re,labelYearDropdown:xe}=i,Oe=N.useMemo(()=>FN(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),qe=p!==void 0||D!==void 0,pt=N.useCallback(()=>{de&&(V(de),I==null||I(de))},[de,V,I]),yt=N.useCallback(()=>{M&&(V(M),O==null||O(M))},[V,M,O]),ce=N.useCallback((Ke,ut)=>Ie=>{Ie.preventDefault(),Ie.stopPropagation(),ue(Ke),!ut.disabled&&(le==null||le(Ke.date,ut,Ie),D==null||D(Ke.date,ut,Ie))},[le,D,ue]),be=N.useCallback((Ke,ut)=>Ie=>{ue(Ke),S==null||S(Ke.date,ut,Ie)},[S,ue]),Le=N.useCallback((Ke,ut)=>Ie=>{ye(),v==null||v(Ke.date,ut,Ie)},[ye,v]),rt=N.useCallback((Ke,ut)=>Ie=>{const Ue={ArrowLeft:[Ie.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Ie.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Ie.shiftKey?"year":"week","after"],ArrowUp:[Ie.shiftKey?"year":"week","before"],PageUp:[Ie.shiftKey?"year":"month","before"],PageDown:[Ie.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Ue[Ie.key]){Ie.preventDefault(),Ie.stopPropagation();const[ft,ze]=Ue[Ie.key];Z(ft,ze)}E==null||E(Ke.date,ut,Ie)},[Z,E,t.dir]),ot=N.useCallback((Ke,ut)=>Ie=>{T==null||T(Ke.date,ut,Ie)},[T]),gt=N.useCallback((Ke,ut)=>Ie=>{k==null||k(Ke.date,ut,Ie)},[k]),Zt=N.useCallback(Ke=>ut=>{const Ie=Number(ut.target.value),Ue=l.setMonth(l.startOfMonth(Ke),Ie);V(Ue)},[l,V]),hn=N.useCallback(Ke=>ut=>{const Ie=Number(ut.target.value),Ue=l.setYear(l.startOfMonth(Ke),Ie);V(Ue)},[l,V]),{className:Dn,style:Yn}=N.useMemo(()=>({className:[d[Qe.Root],t.className].filter(Boolean).join(" "),style:{..._==null?void 0:_[Qe.Root],...t.style}}),[d,t.className,t.style,_]),Wt=vN(t),It=N.useRef(null);YN(It,!!t.animate,{classNames:d,months:ie,focused:Ne,dateLib:l});const yn={dayPickerProps:t,selected:pe,select:le,isSelected:j,months:ie,nextMonth:M,previousMonth:de,goToMonth:V,getModifiers:ae,components:r,classNames:d,styles:_,labels:i,formatters:o};return Me.createElement(d2.Provider,{value:yn},Me.createElement(r.Root,{rootRef:t.animate?It:void 0,className:Dn,style:Yn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Wt},Me.createElement(r.Months,{className:d[Qe.Months],style:_==null?void 0:_[Qe.Months]},!t.hideNavigation&&!y&&Me.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Qe.Nav],style:_==null?void 0:_[Qe.Nav],"aria-label":Ge(),onPreviousClick:pt,onNextClick:yt,previousMonth:de,nextMonth:M}),ie.map((Ke,ut)=>Me.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Qe.Month],style:_==null?void 0:_[Qe.Month],key:ut,displayIndex:ut,calendarMonth:Ke},y==="around"&&!t.hideNavigation&&ut===0&&Me.createElement(r.PreviousMonthButton,{type:"button",className:d[Qe.PreviousMonthButton],tabIndex:de?void 0:-1,"aria-disabled":de?void 0:!0,"aria-label":nt(de),onClick:pt,"data-animated-button":t.animate?"true":void 0},Me.createElement(r.Chevron,{disabled:de?void 0:!0,className:d[Qe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),Me.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Qe.MonthCaption],style:_==null?void 0:_[Qe.MonthCaption],calendarMonth:Ke,displayIndex:ut},h!=null&&h.startsWith("dropdown")?Me.createElement(r.DropdownNav,{className:d[Qe.Dropdowns],style:_==null?void 0:_[Qe.Dropdowns]},(()=>{const Ie=h==="dropdown"||h==="dropdown-months"?Me.createElement(r.MonthsDropdown,{key:"month",className:d[Qe.MonthsDropdown],"aria-label":tt(),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:Zt(Ke.date),options:PN(Ke.date,ge,te,o,l),style:_==null?void 0:_[Qe.Dropdown],value:l.getMonth(Ke.date)}):Me.createElement("span",{key:"month"},P(Ke.date,l)),Ue=h==="dropdown"||h==="dropdown-years"?Me.createElement(r.YearsDropdown,{key:"year",className:d[Qe.YearsDropdown],"aria-label":xe(l.options),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:hn(Ke.date),options:BN(ge,te,o,l,!!t.reverseYears),style:_==null?void 0:_[Qe.Dropdown],value:l.getYear(Ke.date)}):Me.createElement("span",{key:"year"},Q(Ke.date,l));return l.getMonthYearOrder()==="year-first"?[Ue,Ie]:[Ie,Ue]})(),Me.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},C(Ke.date,l.options,l))):Me.createElement(r.CaptionLabel,{className:d[Qe.CaptionLabel],role:"status","aria-live":"polite"},C(Ke.date,l.options,l))),y==="around"&&!t.hideNavigation&&ut===b-1&&Me.createElement(r.NextMonthButton,{type:"button",className:d[Qe.NextMonthButton],tabIndex:M?void 0:-1,"aria-disabled":M?void 0:!0,"aria-label":we(M),onClick:yt,"data-animated-button":t.animate?"true":void 0},Me.createElement(r.Chevron,{disabled:M?void 0:!0,className:d[Qe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ut===b-1&&y==="after"&&!t.hideNavigation&&Me.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Qe.Nav],style:_==null?void 0:_[Qe.Nav],"aria-label":Ge(),onPreviousClick:pt,onNextClick:yt,previousMonth:de,nextMonth:M}),Me.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":p==="multiple"||p==="range","aria-label":Re(Ke.date,l.options,l)||void 0,className:d[Qe.MonthGrid],style:_==null?void 0:_[Qe.MonthGrid]},!t.hideWeekdays&&Me.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Qe.Weekdays],style:_==null?void 0:_[Qe.Weekdays]},L&&Me.createElement(r.WeekNumberHeader,{"aria-label":re(l.options),className:d[Qe.WeekNumberHeader],style:_==null?void 0:_[Qe.WeekNumberHeader],scope:"col"},B()),Oe.map(Ie=>Me.createElement(r.Weekday,{"aria-label":je(Ie,l.options,l),className:d[Qe.Weekday],key:String(Ie),style:_==null?void 0:_[Qe.Weekday],scope:"col"},z(Ie,l.options,l)))),Me.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Qe.Weeks],style:_==null?void 0:_[Qe.Weeks]},Ke.weeks.map(Ie=>Me.createElement(r.Week,{className:d[Qe.Week],key:Ie.weekNumber,style:_==null?void 0:_[Qe.Week],week:Ie},L&&Me.createElement(r.WeekNumber,{week:Ie,style:_==null?void 0:_[Qe.WeekNumber],"aria-label":oe(Ie.weekNumber,{locale:c}),className:d[Qe.WeekNumber],scope:"row",role:"rowheader"},H(Ie.weekNumber,l)),Ie.days.map(Ue=>{const{date:ft}=Ue,ze=ae(Ue);if(ze[Kt.focused]=!ze.hidden&&!!(Ne!=null&&Ne.isEqualTo(Ue)),ze[Ur.selected]=(j==null?void 0:j(ft))||ze.selected,xd(pe)){const{from:$t,to:nn}=pe;ze[Ur.range_start]=!!($t&&nn&&l.isSameDay(ft,$t)),ze[Ur.range_end]=!!($t&&nn&&l.isSameDay(ft,nn)),ze[Ur.range_middle]=Os(pe,ft,!0,l)}const Yt=jN(ze,_,t.modifiersStyles),en=bN(ze,d,t.modifiersClassNames),tn=!qe&&!ze.hidden?Ce(ft,ze,l.options,l):void 0;return Me.createElement(r.Day,{key:`${Ue.isoDate}_${Ue.displayMonthId}`,day:Ue,modifiers:ze,className:en.join(" "),style:Yt,role:"gridcell","aria-selected":ze.selected||void 0,"aria-label":tn,"data-day":Ue.isoDate,"data-month":Ue.outside?Ue.dateMonthId:void 0,"data-selected":ze.selected||void 0,"data-disabled":ze.disabled||void 0,"data-hidden":ze.hidden||void 0,"data-outside":Ue.outside||void 0,"data-focused":ze.focused||void 0,"data-today":ze.today||void 0},!ze.hidden&&qe?Me.createElement(r.DayButton,{className:d[Qe.DayButton],style:_==null?void 0:_[Qe.DayButton],type:"button",day:Ue,modifiers:ze,disabled:!ze.focused&&ze.disabled||void 0,"aria-disabled":ze.focused&&ze.disabled||void 0,tabIndex:G(Ue)?0:-1,"aria-label":me(ft,ze,l.options,l),onClick:ce(Ue,ze),onBlur:Le(Ue,ze),onFocus:be(Ue,ze),onKeyDown:rt(Ue,ze),onMouseEnter:ot(Ue,ze),onMouseLeave:gt(Ue,ze)},A(ft,l.options,l)):!ze.hidden&&A(Ue.date,l.options,l))})))))))),t.footer&&Me.createElement(r.Footer,{className:d[Qe.Footer],style:_==null?void 0:_[Qe.Footer],role:"status","aria-live":"polite"},t.footer)))}function Ti({trigger:e,children:t,isOpen:n,onOpenChange:r,width:o=340}){const[i,l]=N.useState(!1),c=N.useRef(null),d=N.useRef(null),h=n!==void 0?n:i,p=N.useCallback(b=>{r?r(b):l(b)},[r]),y=N.useCallback(()=>p(!1),[p]);return N.useEffect(()=>{if(!h)return;function b(v){const D=v.target;c.current&&!c.current.contains(D)&&d.current&&!d.current.contains(D)&&y()}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[h,y]),N.useEffect(()=>{if(!h)return;function b(v){v.key==="Escape"&&y()}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[h,y]),f.jsxs("div",{className:"relative",style:{display:"inline-flex"},children:[f.jsx("div",{ref:d,onClick:()=>p(!h),children:e}),h&&f.jsx("div",{ref:c,className:"absolute top-full left-0 mt-1 rounded-lg shadow-lg border z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border, #e5e7eb)",width:o},children:t})]})}function wi(){const[e,t]=N.useState(!1);return{isOpen:e,open:()=>t(!0),close:()=>t(!1),toggle:()=>t(n=>!n),onOpenChange:t}}function Si({label:e,value:t,active:n,icon:r,onClick:o,onClear:i}){return f.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-pointer transition-colors hover:border-blue-300",style:{borderColor:n?"var(--yc-color-primary)":"var(--yc-color-border, #e5e7eb)",backgroundColor:n?"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)":"var(--yc-color-surface)"},children:[r&&f.jsx("span",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},children:r}),t?f.jsxs("span",{className:"font-medium",children:[f.jsxs("span",{style:{color:"var(--yc-color-text-secondary)"},children:[e,": "]}),f.jsx("span",{style:{color:n?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},children:t})]}):f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:e}),n&&i?f.jsx("span",{role:"button",tabIndex:0,"aria-label":`Reset ${e} filter`,onClick:l=>{l.stopPropagation(),i()},onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.stopPropagation(),i())},className:"flex-shrink-0 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:f.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})}):f.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}function ya({title:e,onBack:t}){return f.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[t&&f.jsx("button",{type:"button",onClick:t,className:"flex items-center justify-center w-6 h-6 rounded hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),f.jsx("span",{className:"text-sm font-medium",style:{color:"var(--yc-color-text, #111)"},children:e})]})}const C2=[{value:"today",label:"Today"},{value:"yesterday",label:"Yesterday"},{value:"last_7_days",label:"Previous 7 days"},{value:"last_30_days",label:"Previous 30 days"},{value:"last_90_days",label:"Previous 90 days"},{divider:!0},{value:"previous_month",label:"Previous month"},{value:"previous_quarter",label:"Previous quarter"},{value:"previous_year",label:"Previous year"},{divider:!0},{value:"month_to_date",label:"Month to date"},{value:"quarter_to_date",label:"Quarter to date"},{value:"year_to_date",label:"Year to date"},{value:"last_12_months",label:"Last 12 months"}],c3=`
34
+ .rdp-root {
35
+ --rdp-accent-color: var(--yc-color-primary, #2563eb);
36
+ --rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
37
+ --rdp-range_start-color: white;
38
+ --rdp-range_start-background: var(--yc-color-primary, #2563eb);
39
+ --rdp-range_end-color: white;
40
+ --rdp-range_end-background: var(--yc-color-primary, #2563eb);
41
+ --rdp-range_middle-background: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
42
+ --rdp-range_middle-color: var(--yc-color-primary, #1e40af);
43
+ --rdp-day_button-height: 36px;
44
+ --rdp-day_button-width: 36px;
45
+ color: var(--yc-color-text);
46
+ font-size: 14px;
47
+ }
48
+ .rdp-months { flex-wrap: nowrap; gap: 16px; }
49
+ .rdp-month_caption { font-size: 15px; font-weight: 600; }
50
+ .rdp-day { border-radius: 0; }
51
+ .rdp-selected .rdp-day_button { font-weight: 600; }
52
+ .rdp-range_start .rdp-day_button,
53
+ .rdp-range_end .rdp-day_button { font-weight: 600; }
54
+ .rdp-today .rdp-day_button {
55
+ font-weight: 700;
56
+ border: 2px solid var(--yc-color-primary, #2563eb);
57
+ }
58
+ .rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
59
+ `;function Xc(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function Om(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}const R0={last_7_days:{type:"relative",direction:"previous",value:7,unit:"day",includeToday:!1},last_30_days:{type:"relative",direction:"previous",value:30,unit:"day",includeToday:!1},last_90_days:{type:"relative",direction:"previous",value:90,unit:"day",includeToday:!1},last_12_months:{type:"relative",direction:"previous",value:12,unit:"month",includeToday:!1}};function d3(e){return!!(Om(e)||typeof e=="string"&&e in R0)}function f3(e){return Om(e)?e:typeof e=="string"&&e in R0?R0[e]:{type:"relative",direction:"previous",value:30,unit:"day",includeToday:!1}}function h3(e){const n=ua(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:WS(n)};case"week":return{start:zr(n,{weekStartsOn:1}),end:yd(n,{weekStartsOn:1})};case"month":return{start:ql(n),end:md(n)};case"quarter":return{start:Gc(n),end:gm(n)};case"year":return{start:mi(n),end:pd(n)}}const r=e.value??1,o=e.direction==="previous",l=(o?{day:kr,week:Zx,month:Ll,quarter:Jx,year:Em}:{day:Ms,week:fd,month:vi,quarter:ym,year:hd})[e.unit];if(o){const c=e.includeToday?n:kr(n,1),d=l((e.includeToday,n),r);return{start:d<c?d:c,end:d<c?c:d}}else{const c=e.includeToday?n:Ms(n,1),d=l(c,r);return{start:c<d?c:d,end:c<d?d:c}}}function m3(e){if(Xc(e))return`${e.start} to ${e.end}`;if(Om(e)){if(e.direction==="current")return`Current ${(e.unit.charAt(0).toUpperCase()+e.unit.slice(1)).toLowerCase()}`;const t=e.value??1,n=t===1?e.unit:`${e.unit}s`;return`${e.direction==="previous"?"Previous":"Next"} ${t} ${n}`}if(typeof e=="string"){const t=C2.find(r=>"value"in r&&r.value===e);return t&&"label"in t?t.label:{last_7_days:"Previous 7 days",last_30_days:"Previous 30 days",last_90_days:"Previous 90 days",last_12_months:"Last 12 months"}[e]||e.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}return String(e)}const p3=f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})});function _2({name:e,label:t="Date",chartName:n,defaultValue:r="last_30_days"}){var D;const o=wi(),i=Je(S=>S.globalFilters),l=Je(S=>S.chartFilters),c=Je(S=>S.setGlobalFilter),d=Je(S=>S.setChartFilter),h=n?((D=l[n])==null?void 0:D[e])??i[e]??r:i[e]??r;N.useEffect(()=>{var E;(n?((E=l[n])==null?void 0:E[e])??i[e]:i[e])===void 0&&r&&(n?d(n,e,r):c(e,r))},[n,e,r,i,l,c,d]);const p=S=>{const E=S;n?d(n,e,E):c(e,E),o.close()},y=typeof h=="string"?h!==r:!0,b=m3(h),v=()=>{n?d(n,e,r):c(e,r)};return f.jsx(Ti,{isOpen:o.isOpen,onOpenChange:o.onOpenChange,width:620,trigger:f.jsx(Si,{label:t,value:b,active:y,icon:p3,onClear:v}),children:f.jsx(y3,{currentValue:h,onApply:p,onClose:o.close})})}function y3({currentValue:e,onApply:t,onClose:n}){const[r,o]=N.useState(()=>d3(e)?"relative":Xc(e)?"fixed":"presets");return f.jsxs("div",{children:[r==="presets"&&f.jsx(g3,{currentValue:e,onSelectPreset:i=>{t(i),n()},onNavigate:o}),r==="fixed"&&f.jsx(b3,{currentValue:e,onApply:t,onBack:()=>o("presets")}),r==="relative"&&f.jsx(x3,{currentValue:e,onApply:t,onBack:()=>o("presets")})]})}function g3({currentValue:e,onSelectPreset:t,onNavigate:n}){return f.jsxs("div",{className:"py-1",children:[C2.map((r,o)=>{if("divider"in r)return f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}},`divider-${o}`);const i=typeof e=="string"&&e===r.value;return f.jsxs("button",{type:"button",onClick:()=>t(r.value),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:i?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},children:[f.jsx("span",{className:i?"font-medium":"",children:r.label}),i&&f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-primary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},r.value)}),f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}}),f.jsxs("button",{type:"button",onClick:()=>n("fixed"),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:"var(--yc-color-text, #111)"},children:[f.jsx("span",{children:"Fixed date range..."}),f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),f.jsxs("button",{type:"button",onClick:()=>n("relative"),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:"var(--yc-color-text, #111)"},children:[f.jsx("span",{children:"Relative date range..."}),f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}function b3({currentValue:e,onApply:t,onBack:n}){const[r,o]=N.useState("between"),[i,l]=N.useState(()=>{if(Xc(e)){const b=ws(e.start,"yyyy-MM-dd",new Date),v=ws(e.end,"yyyy-MM-dd",new Date);return{from:b,to:v}}}),[c,d]=N.useState(()=>{if(Xc(e)&&r!=="between")return ws(e.start,"yyyy-MM-dd",new Date)}),h=()=>{if(r==="between"&&(i!=null&&i.from)&&(i!=null&&i.to))t({type:"custom",start:on(i.from,"yyyy-MM-dd"),end:on(i.to,"yyyy-MM-dd")});else if(r==="on"&&c){const b=on(c,"yyyy-MM-dd");t({type:"custom",start:b,end:b})}else r==="before"&&c?t({type:"custom",start:"1970-01-01",end:on(c,"yyyy-MM-dd")}):r==="after"&&c&&t({type:"custom",start:on(c,"yyyy-MM-dd"),end:on(new Date(2099,11,31),"yyyy-MM-dd")})},p=r==="between"?!!(i!=null&&i.from&&(i!=null&&i.to)):!!c,y=[{key:"between",label:"Between"},{key:"before",label:"Before"},{key:"on",label:"On"},{key:"after",label:"After"}];return f.jsxs("div",{children:[f.jsx(ya,{title:"Fixed date range",onBack:n}),f.jsx("div",{className:"px-4 pt-3",children:f.jsx("div",{className:"flex gap-1 mb-3",children:y.map(b=>f.jsx("button",{type:"button",onClick:()=>o(b.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:r===b.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:b.label},b.key))})}),f.jsxs("div",{className:"px-4 flex justify-center",children:[f.jsx("style",{children:c3}),r==="between"?f.jsx(Qa,{mode:"range",selected:i,onSelect:l,numberOfMonths:2,defaultMonth:(i==null?void 0:i.from)||new Date}):f.jsx(Qa,{mode:"single",selected:c,onSelect:d,numberOfMonths:2,defaultMonth:c||new Date})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:h,disabled:!p,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}function x3({currentValue:e,onApply:t,onBack:n}){const r=f3(e),[o,i]=N.useState(r.direction),[l,c]=N.useState(r.value??30),[d,h]=N.useState(r.unit),[p,y]=N.useState(r.includeToday??!1),b=N.useMemo(()=>{const k=h3({direction:o,value:o==="current"?void 0:l,unit:d,includeToday:p}),O=k.start.getFullYear(),I=k.end.getFullYear();return O===I?`${on(k.start,"MMM d")} – ${on(k.end,"MMM d, yyyy")}`:`${on(k.start,"MMM d, yyyy")} – ${on(k.end,"MMM d, yyyy")}`},[o,l,d,p]),v=()=>{t({type:"relative",direction:o,value:o==="current"?void 0:l,unit:d,includeToday:p})},D=[{key:"previous",label:"Previous"},{key:"current",label:"Current"},{key:"next",label:"Next"}],S=[{value:"day",label:"days"},{value:"week",label:"weeks"},{value:"month",label:"months"},{value:"quarter",label:"quarters"},{value:"year",label:"years"}],E=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"},{value:"year",label:"Year"}];return f.jsxs("div",{children:[f.jsx(ya,{title:"Relative date range",onBack:n}),f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsx("div",{className:"flex gap-1",children:D.map(T=>f.jsx("button",{type:"button",onClick:()=>i(T.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:o===T.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:T.label},T.key))}),o==="current"?f.jsx("div",{className:"flex gap-2",children:E.map(T=>f.jsx("button",{type:"button",onClick:()=>h(T.value),className:"px-3 py-1.5 text-sm rounded border transition-colors",style:d===T.value?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",borderColor:"var(--yc-color-primary)",color:"var(--yc-color-primary)",fontWeight:500}:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:T.label},T.value))}):f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"number",min:1,value:l,onChange:T=>c(Math.max(1,parseInt(T.target.value)||1)),className:"w-20 px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"}}),f.jsx("select",{value:d,onChange:T=>h(T.target.value),className:"px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:S.map(T=>f.jsx("option",{value:T.value,children:T.label},T.value))})]}),o!=="current"&&f.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("input",{type:"checkbox",checked:p,onChange:T=>y(T.target.checked),className:"rounded border-gray-300"}),"Include today"]}),f.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),f.jsx("span",{children:b})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:v,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function Jc({name:e,label:t=e,options:n,chartName:r,defaultValue:o,source:i}){var P,H;const l=wi(),c=Je(B=>B.globalFilters),d=Je(B=>B.chartFilters),h=Je(B=>B.setGlobalFilter),p=Je(B=>B.setChartFilter),y=!!i,{data:b,isLoading:v}=hr({queryKey:y?r?["parameterOptions",r,e]:["modelOptions",i.model,i.value_field,i.label_field]:["noop"],queryFn:()=>r?xt.getParameterOptions(r,e):xt.getModelOptions(i.model,i.value_field,i.label_field),enabled:y,staleTime:300*1e3}),D=y?[{value:"",label:"All"},...(b==null?void 0:b.options)??[]]:[{value:"",label:"All"},...n??[]],S=r?((P=d[r])==null?void 0:P[e])??c[e]??o??"":c[e]??o??"",[E,T]=N.useState(S),[k,O]=N.useState("");N.useEffect(()=>{l.isOpen&&(T(S),O(""))},[l.isOpen,S]),N.useEffect(()=>{var z;(r?((z=d[r])==null?void 0:z[e])??c[e]:c[e])===void 0&&o&&(r?p(r,e,o):h(e,o))},[r,e,o,c,d,h,p]);const I=()=>{const B=E||null;r?p(r,e,B):h(e,B),l.close()},L=k?D.filter(B=>B.label.toLowerCase().includes(k.toLowerCase())):D,_=S?((H=D.find(B=>B.value===S))==null?void 0:H.label)||S:void 0,C=!!S&&S!==o,A=()=>{const B=o??null;r?p(r,e,B):h(e,B)};return y&&v?f.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm gap-1.5",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:f.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):f.jsxs(Ti,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,trigger:f.jsx(Si,{label:t,value:_||t,active:C,onClear:A}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-3",children:[D.length>6&&f.jsx("div",{className:"mb-2",children:f.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:B=>O(B.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0})}),f.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[L.map(B=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[f.jsx("input",{type:"radio",name:`select-${e}`,checked:E===B.value,onChange:()=>T(B.value),className:"text-blue-600"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:B.label})]},B.value)),L.length===0&&f.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:I,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function N2({name:e,label:t=e,options:n,chartName:r,defaultValue:o,source:i}){const l=wi(),c=Je(z=>z.globalFilters),d=Je(z=>z.chartFilters),h=Je(z=>z.setGlobalFilter),p=Je(z=>z.setChartFilter),y=!!i,{data:b,isLoading:v}=hr({queryKey:y?r?["parameterOptions",r,e]:["modelOptions",i.model,i.value_field,i.label_field]:["noop"],queryFn:()=>r?xt.getParameterOptions(r,e):xt.getModelOptions(i.model,i.value_field,i.label_field),enabled:y,staleTime:300*1e3}),D=y?(b==null?void 0:b.options)??[]:n??[],S=(()=>{var Q;const z=r?((Q=d[r])==null?void 0:Q[e])??c[e]??o??[]:c[e]??o??[];return Array.isArray(z)?z:[]})(),[E,T]=N.useState(S),[k,O]=N.useState("");N.useEffect(()=>{l.isOpen&&(T(S),O(""))},[l.isOpen]),N.useEffect(()=>{var Q;(r?((Q=d[r])==null?void 0:Q[e])??c[e]:c[e])===void 0&&o&&(r?p(r,e,o):h(e,o))},[r,e,o,c,d,h,p]);const I=z=>{T(Q=>Q.includes(z)?Q.filter(q=>q!==z):[...Q,z])},L=()=>{E.length===D.length?T([]):T(D.map(z=>z.value))},_=()=>{const z=E.length>0?E:null;r?p(r,e,z):h(e,z),l.close()},C=k?D.filter(z=>z.label.toLowerCase().includes(k.toLowerCase())):D,A=S.length===0?void 0:S.length<=2?S.map(z=>{var Q;return((Q=D.find(q=>q.value===z))==null?void 0:Q.label)||z}).join(", "):`${S.length} selected`,P=S.length>0,H=E.length===D.length&&D.length>0,B=()=>{const z=o??null;r?p(r,e,z):h(e,z)};return y&&v?f.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm gap-1.5",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:f.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):f.jsxs(Ti,{isOpen:l.isOpen,onOpenChange:l.onOpenChange,trigger:f.jsx(Si,{label:t,value:A||t,active:P,onClear:B}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-3",children:[D.length>6&&f.jsx("div",{className:"mb-2",children:f.jsx("input",{type:"text",placeholder:"Search...",value:k,onChange:z=>O(z.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0})}),f.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[!k&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm font-medium",children:[f.jsx("input",{type:"checkbox",checked:H,onChange:L,className:"text-blue-600 rounded"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:"Select all"})]}),f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}})]}),C.map(z=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[f.jsx("input",{type:"checkbox",checked:E.includes(z.value),onChange:()=>I(z.value),className:"text-blue-600 rounded"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:z.label})]},z.value)),C.length===0&&f.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:_,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}const P0=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"contains",label:"contains"},{value:"does_not_contain",label:"does not contain"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],D2=["is_empty","is_not_empty"];function O2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function v3(e){var t,n;if(O2(e))return D2.includes(e.operator)?(t=P0.find(o=>o.value===e.operator))==null?void 0:t.label:`${((n=P0.find(o=>o.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function A2({name:e,label:t=e,chartName:n,defaultValue:r}){var I;const o=wi(),i=Je(L=>L.globalFilters),l=Je(L=>L.chartFilters),c=Je(L=>L.setGlobalFilter),d=Je(L=>L.setChartFilter),h=n?((I=l[n])==null?void 0:I[e])??i[e]??r??null:i[e]??r??null,[p,y]=N.useState("contains"),[b,v]=N.useState("");N.useEffect(()=>{o.isOpen&&(O2(h)?(y(h.operator),v(h.value)):typeof h=="string"?(y("is"),v(h)):(y("contains"),v("")))},[o.isOpen]);const D=()=>{const L={operator:p,value:b};n?d(n,e,L):c(e,L),o.close()},S=!D2.includes(p),E=!S||b.trim().length>0,T=v3(h),k=!!T,O=()=>{const L=r??null;n?d(n,e,L):c(e,L)};return f.jsxs(Ti,{isOpen:o.isOpen,onOpenChange:o.onOpenChange,trigger:f.jsx(Si,{label:t,value:T||t,active:k,onClear:O}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-4 space-y-3",children:[f.jsx("select",{value:p,onChange:L=>y(L.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:P0.map(L=>f.jsx("option",{value:L.value,children:L.label},L.value))}),S&&f.jsx("input",{type:"text",value:b,onChange:L=>v(L.target.value),placeholder:"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:L=>{L.key==="Enter"&&E&&D()}})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:D,disabled:!E,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}const j0=[{value:"equal",label:"equal to"},{value:"not_equal",label:"not equal to"},{value:"greater",label:"greater than"},{value:"less",label:"less than"},{value:"greater_or_equal",label:"greater than or equal to"},{value:"less_or_equal",label:"less than or equal to"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],I2=["is_empty","is_not_empty"];function M2(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function E3(e){var t,n;if(M2(e)){if(I2.includes(e.operator))return(t=j0.find(o=>o.value===e.operator))==null?void 0:t.label;const r=((n=j0.find(o=>o.value===e.operator))==null?void 0:n.label)||e.operator;return e.operator==="between"&&e.value2!==void 0?`${e.value} – ${e.value2}`:`${r} ${e.value}`}if(typeof e=="number")return String(e)}function L2({name:e,label:t=e,chartName:n,defaultValue:r}){var A;const o=wi(),i=Je(P=>P.globalFilters),l=Je(P=>P.chartFilters),c=Je(P=>P.setGlobalFilter),d=Je(P=>P.setChartFilter),h=n?((A=l[n])==null?void 0:A[e])??i[e]??r??null:i[e]??r??null,[p,y]=N.useState("equal"),[b,v]=N.useState(""),[D,S]=N.useState("");N.useEffect(()=>{o.isOpen&&(M2(h)?(y(h.operator),v(String(h.value)),S(h.value2!==void 0?String(h.value2):"")):typeof h=="number"?(y("equal"),v(String(h)),S("")):(y("equal"),v(""),S("")))},[o.isOpen]);const E=()=>{const P={operator:p,value:parseFloat(b)||0,...p==="between"?{value2:parseFloat(D)||0}:{}};n?d(n,e,P):c(e,P),o.close()},T=!I2.includes(p),k=p==="between",O=!T||b!==""&&(!k||D!==""),I=E3(h),L=h===r||typeof h=="number"&&h===r||h==null,_=!!I&&!L,C=()=>{const P=r??null;n?d(n,e,P):c(e,P)};return f.jsxs(Ti,{isOpen:o.isOpen,onOpenChange:o.onOpenChange,trigger:f.jsx(Si,{label:t,value:I||t,active:_,onClear:C}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-4 space-y-3",children:[f.jsx("select",{value:p,onChange:P=>y(P.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:j0.map(P=>f.jsx("option",{value:P.value,children:P.label},P.value))}),T&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"number",value:b,onChange:P=>v(P.target.value),placeholder:k?"Min":"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:P=>{P.key==="Enter"&&O&&E()}}),k&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-sm self-center",style:{color:"var(--yc-color-text-muted)"},children:"and"}),f.jsx("input",{type:"number",value:D,onChange:P=>S(P.target.value),placeholder:"Max",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},onKeyDown:P=>{P.key==="Enter"&&O&&E()}})]})]})]}),f.jsxs("div",{className:"flex justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[f.jsx("button",{type:"button",onClick:()=>{n?d(n,e,null):c(e,null),o.close()},className:"px-3 py-1.5 text-sm rounded hover:bg-gray-100 dark:hover:bg-gray-700",style:{color:"var(--yc-color-text-secondary)"},children:"Clear"}),f.jsx("button",{type:"button",onClick:E,disabled:!O,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})]})]})}function R2({name:e,label:t=e,chartName:n}){var S;const r=wi(),o=Je(E=>E.globalFilters),i=Je(E=>E.chartFilters),l=Je(E=>E.setGlobalFilter),c=Je(E=>E.setChartFilter),d=n?((S=i[n])==null?void 0:S[e])??o[e]??null:o[e]??null,[h,p]=N.useState(typeof d=="boolean"?d:null);N.useEffect(()=>{r.isOpen&&p(typeof d=="boolean"?d:null)},[r.isOpen]);const y=()=>{n?c(n,e,h):l(e,h),r.close()},b=typeof d=="boolean"?d?"True":"False":void 0,v=typeof d=="boolean",D=()=>{n?c(n,e,null):l(e,null)};return f.jsxs(Ti,{isOpen:r.isOpen,onOpenChange:r.onOpenChange,width:240,trigger:f.jsx(Si,{label:t,value:b||t,active:v,onClear:D}),children:[f.jsx(ya,{title:t}),f.jsxs("div",{className:"p-4 space-y-1",children:[[{value:!0,label:"True"},{value:!1,label:"False"}].map(E=>f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[f.jsx("input",{type:"radio",name:`bool-${e}`,checked:h===E.value,onChange:()=>p(E.value),className:"text-blue-600"}),f.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:E.label})]},String(E.value))),f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-black/5 cursor-pointer text-sm",style:{color:"var(--yc-color-text-muted)"},children:[f.jsx("input",{type:"radio",name:`bool-${e}`,checked:h===null,onChange:()=>p(null),className:"text-blue-600"}),f.jsx("span",{children:"Any"})]})]}),f.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:f.jsx("button",{type:"button",onClick:y,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function ca(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function P2({parameters:e,chartName:t}){const n=Je(d=>d.globalFilters),r=Je(d=>d.chartFilters),o=Je(d=>d.resetFilters),i=Je(d=>d.resetChartFilters);if(e.length===0)return null;const l=e.some(d=>{var p;const h=t?((p=r[t])==null?void 0:p[d.name])??n[d.name]:n[d.name];return h==null?!1:JSON.stringify(h)!==JSON.stringify(d.default)}),c=()=>{t?i(t):o()};return f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(d=>{const h=d.label||ca(d.name),p=typeof d.default=="string"?d.default:void 0;switch(d.type){case"date_range":return f.jsx(_2,{name:d.name,label:h,chartName:t,defaultValue:p},d.name);case"select":{const y=(d.options||[]).map(b=>typeof b=="string"?{value:b,label:b}:b);return f.jsx(Jc,{name:d.name,label:h,options:y,chartName:t,defaultValue:p},d.name)}case"dynamic_select":return!t&&!d.source?f.jsxs("div",{className:"text-sm text-gray-500",children:[h,": dynamic_select requires chartName or source"]},d.name):f.jsx(Jc,{name:d.name,label:h,chartName:t,defaultValue:p,source:d.source},d.name);case"multi_select":{const y=(d.options||[]).map(b=>typeof b=="string"?{value:b,label:b}:b);return f.jsx(N2,{name:d.name,label:h,options:y,chartName:t,defaultValue:Array.isArray(d.default)?d.default:void 0,source:d.source},d.name)}case"text":return f.jsx(A2,{name:d.name,label:h,chartName:t,defaultValue:p},d.name);case"number":return f.jsx(L2,{name:d.name,label:h,chartName:t,defaultValue:typeof d.default=="number"?d.default:void 0},d.name);case"boolean":return f.jsx(R2,{name:d.name,label:h,chartName:t},d.name);default:return f.jsxs("div",{className:"text-sm text-gray-500",children:[h,": ",d.type," (not supported)"]},d.name)}}),l&&f.jsx("button",{type:"button",onClick:c,className:"text-sm px-2 py-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:"Clear all"})]})}function T3({resourceType:e,resourceName:t}){const n=So(S=>S.auth),[r,o]=N.useState(!1),[i,l]=N.useState(null),[c,d]=N.useState(null),[h,p]=N.useState(!1),y=N.useRef(null);if(n.status!=="authenticated")return null;const b=n.user.role==="admin"||n.user.role==="editor";N.useEffect(()=>{if(!r)return;const S=E=>{y.current&&!y.current.contains(E.target)&&o(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r]);const v=async()=>{const S=e==="dashboard"?`#/dashboards/${t}`:`#/charts/${t}`,E=`${window.location.origin}/${S}`;await navigator.clipboard.writeText(E),d("link"),setTimeout(()=>d(null),2e3)},D=async()=>{p(!0);try{const S=await xt.createShareLink({resourceType:e,resourceName:t}),E=e==="dashboard"?`#/public/dashboards/${t}?token=${S.token}`:`#/public/charts/${t}?token=${S.token}`,T=`${window.location.origin}/${E}`;l(T),await navigator.clipboard.writeText(T),d("public"),setTimeout(()=>d(null),2e3)}catch(S){console.error("Failed to create share link:",S)}finally{p(!1)}};return f.jsxs("div",{className:"relative",ref:y,children:[f.jsxs("button",{onClick:()=>o(!r),className:"text-sm flex items-center gap-1.5 px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Share",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),f.jsx("span",{children:"Share"})]}),r&&f.jsxs("div",{className:"absolute right-0 top-full mt-1 border rounded-lg shadow-lg py-1 w-64 z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("button",{onClick:v,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),c==="link"?f.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Copied!"}):f.jsx("span",{children:"Copy link (requires login)"})]}),b&&f.jsxs("button",{onClick:D,disabled:h,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),h?f.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"Creating..."}):c==="public"?f.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Public link copied!"}):f.jsx("span",{children:"Create public link"})]}),i&&f.jsxs("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--yc-color-border)"},children:[f.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Public URL:"}),f.jsx("div",{className:"text-xs break-all font-mono p-1.5 rounded",style:{color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-input-bg)"},children:i})]})]})]})}function w3({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:o,onExportCSV:i,onExportPNG:l,onShowSql:c,onShowEvents:d,eventCount:h}){const[p,y]=N.useState(!1);return f.jsxs("div",{className:"yc-chart-footer flex items-center justify-between px-4 py-2 border-t text-xs",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{onClick:()=>o("chart"),className:`p-1.5 rounded transition-colors ${r==="chart"?"bg-black/5":"hover:bg-black/5"}`,title:"Chart view",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}),f.jsx("button",{onClick:()=>o("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-black/5":"hover:bg-black/5"}`,title:"Table view",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),f.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&f.jsxs("span",{children:[e.toLocaleString()," rows"]}),t!=null&&f.jsxs("span",{children:[n&&f.jsx("span",{className:"text-green-600 mr-1",title:"Served from cache",children:"cached"}),t,"ms"]}),d&&f.jsxs("button",{onClick:d,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors flex items-center gap-1.5",style:{borderColor:"var(--yc-color-border)"},children:["Events",(h??0)>0&&f.jsx("span",{className:"text-[10px] leading-none px-1 py-0.5 rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:h})]}),c&&f.jsx("button",{onClick:c,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors font-mono",style:{borderColor:"var(--yc-color-border)"},children:"SQL"}),(i||l)&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>y(!p),className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Export"}),p&&f.jsxs("div",{className:"absolute right-0 bottom-full mb-1 w-32 rounded-md shadow-lg border py-1 z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[i&&f.jsx("button",{onClick:()=>{i(),y(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export CSV"}),l&&f.jsx("button",{onClick:()=>{l(),y(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export PNG"})]})]})]})]})}const S3=new Set(["SELECT","FROM","WHERE","AND","OR","NOT","IN","IS","NULL","AS","ON","JOIN","LEFT","RIGHT","INNER","OUTER","FULL","CROSS","GROUP","BY","ORDER","HAVING","LIMIT","OFFSET","UNION","ALL","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","VIEW","WITH","RECURSIVE","DISTINCT","CASE","WHEN","THEN","ELSE","END","BETWEEN","LIKE","ILIKE","EXISTS","ANY","SOME","ASC","DESC","NULLS","FIRST","LAST","TRUE","FALSE","OVER","PARTITION","ROWS","RANGE","PRECEDING","FOLLOWING","UNBOUNDED","CURRENT","ROW","FILTER","WITHIN","LATERAL","NATURAL","USING","EXCEPT","INTERSECT","FETCH","NEXT","ONLY","FOR","IF","REPLACE","CASCADE","RESTRICT","TEMPORARY","TEMP","MATERIALIZED","EXPLAIN","ANALYZE","WINDOW"]),k3=new Set(["COUNT","SUM","AVG","MIN","MAX","COALESCE","NULLIF","CAST","CONVERT","IFNULL","NVL","TRIM","LTRIM","RTRIM","UPPER","LOWER","LENGTH","SUBSTRING","SUBSTR","REPLACE","CONCAT","CONCAT_WS","DATE_TRUNC","DATE_PART","EXTRACT","NOW","CURRENT_DATE","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","TO_DATE","TO_CHAR","TO_NUMBER","TO_TIMESTAMP","ROUND","FLOOR","CEIL","CEILING","ABS","MOD","POWER","SQRT","LOG","LN","EXP","SIGN","ROW_NUMBER","RANK","DENSE_RANK","NTILE","LAG","LEAD","FIRST_VALUE","LAST_VALUE","NTH_VALUE","LISTAGG","STRING_AGG","ARRAY_AGG","JSON_AGG","BOOL_OR","BOOL_AND","GREATEST","LEAST","DECODE","IFF","ZEROIFNULL","TRY_CAST"]);function Fr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function C3(e){const t=[];let n=0;const r=o=>e.charAt(o);for(;n<e.length;){if(r(n)==="-"&&r(n+1)==="-"){const o=e.indexOf(`
60
+ `,n),i=o===-1?e.slice(n):e.slice(n,o);t.push(`<span class="sql-comment">${Fr(i)}</span>`),n+=i.length;continue}if(r(n)==="/"&&r(n+1)==="*"){const o=e.indexOf("*/",n+2),i=o===-1?e.slice(n):e.slice(n,o+2);t.push(`<span class="sql-comment">${Fr(i)}</span>`),n+=i.length;continue}if(r(n)==="'"){let o=n+1;for(;o<e.length;)if(r(o)==="'"&&r(o+1)==="'")o+=2;else if(r(o)==="'"){o++;break}else o++;t.push(`<span class="sql-string">${Fr(e.slice(n,o))}</span>`),n=o;continue}if(r(n)==='"'){const o=e.indexOf('"',n+1),i=o===-1?e.slice(n):e.slice(n,o+1);t.push(`<span class="sql-identifier">${Fr(i)}</span>`),n+=i.length;continue}if(/\d/.test(r(n))&&(n===0||/[\s,=(]/.test(r(n-1)))){let o=n;for(;o<e.length&&/[\d.]/.test(r(o));)o++;t.push(`<span class="sql-number">${Fr(e.slice(n,o))}</span>`),n=o;continue}if(/[a-zA-Z_]/.test(r(n))){let o=n;for(;o<e.length&&/[a-zA-Z0-9_]/.test(r(o));)o++;const i=e.slice(n,o),l=i.toUpperCase(),c=e.slice(o);/^\s*\(/.test(c)&&k3.has(l)?t.push(`<span class="sql-function">${Fr(i)}</span>`):S3.has(l)?t.push(`<span class="sql-keyword">${Fr(i)}</span>`):t.push(Fr(i)),n=o;continue}if(r(n)===":"&&r(n+1)===":"){let o=n+2;for(;o<e.length&&/[a-zA-Z0-9_]/.test(r(o));)o++;t.push(`<span class="sql-type">${Fr(e.slice(n,o))}</span>`),n=o;continue}if("=<>!+-*/%".includes(r(n))){t.push(`<span class="sql-operator">${Fr(r(n))}</span>`),n++;continue}t.push(Fr(r(n))),n++}return t.join("")}function _3(e){return C3(e).split(`
61
+ `).map(r=>`<div class="sql-line">${r||" "}</div>`).join("")}function N3({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:o,durationMs:i,rowCount:l,cached:c}){const[d,h]=N.useState(!1),p=N.useMemo(()=>n?_3(n):"",[n]);if(!e)return null;const y=async()=>{if(n)try{await navigator.clipboard.writeText(n),h(!0),setTimeout(()=>h(!1),2e3)}catch{}};return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),f.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[480px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[f.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Query Details"}),f.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Metadata"}),f.jsxs("div",{className:"text-sm space-y-1.5 p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[r&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Model"}),f.jsx("span",{className:"font-mono text-xs",style:{color:"var(--yc-color-text)"},children:r})]}),o&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Connection"}),f.jsx("span",{style:{color:"var(--yc-color-text)"},children:o})]}),l!=null&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Rows"}),f.jsx("span",{style:{color:"var(--yc-color-text)"},children:l.toLocaleString()})]}),i!=null&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Duration"}),f.jsxs("span",{style:{color:"var(--yc-color-text)"},children:[i,"ms",c&&f.jsx("span",{className:"ml-2 text-green-600 text-xs",children:"(cached)"})]})]})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Compiled SQL"}),f.jsx("button",{onClick:y,className:"text-xs px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-primary)"},children:d?"Copied!":"Copy"})]}),n?f.jsx("div",{className:"sql-viewer rounded overflow-x-auto",style:{fontFamily:"'Source Code Pro', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:"13px",lineHeight:"1.6",backgroundColor:"var(--yc-color-background)",color:"var(--yc-color-text)",border:"1px solid var(--yc-color-border)",counterReset:"line",padding:"12px 0"},dangerouslySetInnerHTML:{__html:p}}):f.jsx("p",{className:"text-sm italic",style:{color:"var(--yc-color-text-secondary)"},children:"No SQL available."})]})]})]})]})}const j2=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"];function yi(e,t,n){if(t)return t;const r=(n==null?void 0:n.palette)??j2;return r[e%r.length]}function D3(e,t,n,r){return n!=null&&n[e]?n[e]:yi(t,void 0,r)}const N1=[{name:"Red",hex:"#ef4444"},{name:"Orange",hex:"#f97316"},{name:"Green",hex:"#10b981"},{name:"Blue",hex:"#3b82f6"},{name:"Purple",hex:"#8b5cf6"}];function F0({value:e,onChange:t,themePalette:n,compact:r}){const[o,i]=N.useState(!1),[l,c]=N.useState(""),d=N.useRef(null);N.useEffect(()=>{if(!o)return;function b(v){d.current&&!d.current.contains(v.target)&&i(!1)}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[o]),N.useEffect(()=>{if(o&&e){const b=N1.some(v=>v.hex.toLowerCase()===e.toLowerCase())||h.some(v=>v.toLowerCase()===e.toLowerCase());c(b?"":e)}},[o]);const h=n??j2;function p(b){t(b),i(!1)}function y(){const b=l.trim();b&&/^#[0-9a-fA-F]{3,8}$/.test(b)&&(t(b),i(!1))}return f.jsxs("div",{className:"relative",ref:d,children:[r?f.jsx("button",{type:"button",onClick:()=>i(!o),className:"w-3 h-3 rounded-full flex-shrink-0 cursor-pointer hover:scale-125 transition-transform",style:{backgroundColor:e||"#6366f1"},title:e||"Set color"}):f.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-1.5 px-2 py-1 text-sm rounded border box-border -my-1",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:e?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)"},children:[f.jsx("span",{className:"w-4 h-4 rounded-full border flex-shrink-0",style:{backgroundColor:e||"transparent",borderColor:e?"var(--yc-color-border)":"var(--yc-color-text-muted)",borderStyle:e?"solid":"dashed"}}),f.jsx("span",{className:"truncate",children:e||"Color"})]}),o&&f.jsxs("div",{className:"absolute z-50 rounded-lg shadow-lg p-3 min-w-[200px]",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0,marginTop:4},children:[f.jsxs("div",{className:"mb-2",children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Standard"}),f.jsx("div",{className:"space-y-0.5",children:N1.map(b=>f.jsxs("button",{type:"button",onClick:()=>p(b.hex),className:"flex items-center gap-2 w-full px-1.5 py-1 rounded text-sm hover:opacity-80 transition-opacity",style:{backgroundColor:(e==null?void 0:e.toLowerCase())===b.hex.toLowerCase()?"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)":"transparent",color:"var(--yc-color-text)"},children:[f.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex-shrink-0",style:{backgroundColor:b.hex}}),b.name]},b.hex))})]}),f.jsxs("div",{className:"mb-2 pt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Theme"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map((b,v)=>f.jsx("button",{type:"button",onClick:()=>p(b),className:"w-5 h-5 rounded-full flex-shrink-0 transition-transform hover:scale-110",style:{backgroundColor:b,outline:(e==null?void 0:e.toLowerCase())===b.toLowerCase()?"2px solid var(--yc-color-primary)":"none",outlineOffset:2},title:b},`${b}-${v}`))})]}),f.jsxs("div",{className:"pt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider mb-1.5",style:{color:"var(--yc-color-text-muted)"},children:"Custom"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"w-5 h-5 rounded flex-shrink-0 border",style:{backgroundColor:/^#[0-9a-fA-F]{3,8}$/.test(l.trim())?l.trim():"transparent",borderColor:"var(--yc-color-border)"}}),f.jsx("input",{type:"text",value:l,onChange:b=>c(b.target.value),onKeyDown:b=>{b.key==="Enter"&&y()},placeholder:"#hex",className:"flex-1 min-w-0 px-1.5 py-1 text-xs rounded border",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),f.jsx("button",{type:"button",onClick:y,disabled:!l.trim()||!/^#[0-9a-fA-F]{3,8}$/.test(l.trim()),className:"text-xs px-1.5 py-1 rounded text-white disabled:opacity-40",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:"Apply"})]})]}),e&&f.jsx("div",{className:"pt-2 mt-1",style:{borderTop:"1px solid var(--yc-color-border)"},children:f.jsx("button",{type:"button",onClick:()=>{t(""),i(!1)},className:"text-xs hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:"Clear color"})})]})]})}function O3({open:e,title:t,message:n,confirmLabel:r="Delete",cancelLabel:o="Cancel",variant:i="danger",onConfirm:l,onCancel:c}){const d=N.useRef(null);return N.useEffect(()=>{var h;e&&((h=d.current)==null||h.focus())},[e]),N.useEffect(()=>{if(!e)return;function h(p){p.key==="Escape"&&c()}return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,c]),e?f.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:c}),f.jsxs("div",{className:"relative rounded-lg shadow-xl p-5 w-[360px] max-w-[90vw]",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--yc-color-text)"},children:t}),f.jsx("p",{className:"text-sm mb-5",style:{color:"var(--yc-color-text-secondary)"},children:n}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{onClick:c,className:"px-3 py-1.5 text-sm rounded border transition-colors hover:opacity-80",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-background)"},children:o}),f.jsx("button",{ref:d,onClick:l,className:"px-3 py-1.5 text-sm rounded text-white transition-colors hover:opacity-90",style:{backgroundColor:i==="danger"?"var(--yc-color-danger, #ef4444)":"var(--yc-color-primary, #3b82f6)"},children:r})]})]})]}):null}const Nc=`
62
+ .rdp-root {
63
+ --rdp-accent-color: var(--yc-color-primary, #2563eb);
64
+ --rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
65
+ --rdp-day_button-height: 32px;
66
+ --rdp-day_button-width: 32px;
67
+ color: var(--yc-color-text);
68
+ font-size: 13px;
69
+ }
70
+ .rdp-months { flex-wrap: nowrap; }
71
+ .rdp-month_caption { font-size: 14px; font-weight: 600; }
72
+ .rdp-selected .rdp-day_button { font-weight: 600; }
73
+ .rdp-today .rdp-day_button {
74
+ font-weight: 700;
75
+ border: 2px solid var(--yc-color-primary, #2563eb);
76
+ }
77
+ .rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
78
+ `;function A3({isOpen:e,onClose:t,events:n,allEvents:r,chartName:o,canEdit:i,eventsVisible:l,onToggleVisible:c,themePalette:d}){const h=Wn(),[p,y]=N.useState(!1),[b,v]=N.useState(""),[D,S]=N.useState(""),[E,T]=N.useState(""),[k,O]=N.useState(""),[I,L]=N.useState(!1),[_,C]=N.useState(""),[A,P]=N.useState(!1),[H,B]=N.useState(!1),z=N.useRef(null),Q=N.useRef(null),q=N.useRef(null),[X,ie]=N.useState(null),[ge,te]=N.useState(null),[de,M]=N.useState(""),V=N.useRef(null),[ae,j]=N.useState(null),[le,pe]=N.useState(null),ye=N.useRef(null),Ne=N.useRef(null),[G,Z]=N.useState(null);N.useEffect(()=>{var oe;p&&((oe=z.current)==null||oe.focus())},[p]),N.useEffect(()=>{var oe;ge&&((oe=V.current)==null||oe.focus())},[ge]),N.useEffect(()=>{if(!A)return;function oe(re){Q.current&&!Q.current.contains(re.target)&&P(!1)}return document.addEventListener("mousedown",oe),()=>document.removeEventListener("mousedown",oe)},[A]),N.useEffect(()=>{if(!H)return;function oe(re){q.current&&!q.current.contains(re.target)&&B(!1)}return document.addEventListener("mousedown",oe),()=>document.removeEventListener("mousedown",oe)},[H]),N.useEffect(()=>{if(ae===null)return;function oe(re){ye.current&&!ye.current.contains(re.target)&&j(null)}return document.addEventListener("mousedown",oe),()=>document.removeEventListener("mousedown",oe)},[ae]),N.useEffect(()=>{if(le===null)return;function oe(re){Ne.current&&!Ne.current.contains(re.target)&&pe(null)}return document.addEventListener("mousedown",oe),()=>document.removeEventListener("mousedown",oe)},[le]);const ue=Ka({mutationFn:oe=>xt.createChartEvent(oe),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),Re()}}),me=Ka({mutationFn:oe=>xt.deleteChartEvent(oe),onSuccess:()=>h.invalidateQueries({queryKey:["chartEvents"]})}),Ce=Ka({mutationFn:({index:oe,event:re})=>xt.updateChartEvent(oe,re),onSuccess:()=>{h.invalidateQueries({queryKey:["chartEvents"]}),ie(null),te(null)}});function Re(){y(!1),v(""),S(""),T(""),O(""),L(!1),C(""),P(!1),B(!1)}function tt(){!D.trim()||!b.trim()||ue.mutate({date:D.trim(),label:b.trim(),...k.trim()?{description:k.trim()}:{},...E.trim()?{color:E.trim()}:{},...I&&_.trim()?{endDate:_.trim()}:{},charts:[o]})}function Ge(oe){return r.findIndex(re=>re.date===oe.date&&re.label===oe.label&&(re.description??"")===(oe.description??"")&&(re.endDate??"")===(oe.endDate??""))}function nt(oe){Z(oe)}function we(){if(!G)return;const oe=Ge(G);oe!==-1&&(me.mutate(oe),Z(null))}function je(oe){if(X===null||!ge)return;const re=Ge(oe);if(re===-1)return;const xe=oe[ge]??"";if(de===xe){ie(null),te(null);return}Ce.mutate({index:re,event:{...oe,[ge]:de}})}return e?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),f.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[400px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Events"}),n.length>0&&f.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.length})]}),f.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[f.jsxs("div",{children:[f.jsx("div",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:"Show on chart"}),f.jsx("div",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:"Display event markers as dashed lines"})]}),f.jsx("button",{onClick:c,className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:l?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:f.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:l?22:2}})})]}),i&&!p&&f.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-sm rounded border border-dashed transition-colors hover:opacity-80",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-primary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add event"]}),p&&f.jsxs("div",{className:"p-3 rounded space-y-2",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"text-xs font-medium mb-2",style:{color:"var(--yc-color-text-secondary)"},children:"New event"}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>P(!A),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:D?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:D||(I?"Start date":"Select date")}),A&&f.jsxs("div",{ref:Q,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:D?ws(D,"yyyy-MM-dd",new Date):void 0,onSelect:oe=>{oe&&(S(on(oe,"yyyy-MM-dd")),P(!1))}})]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),f.jsx("button",{onClick:()=>{L(!I),I&&(C(""),B(!1))},className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:I?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:f.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:I?22:2}})})]}),I&&f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>B(!H),className:"w-full px-2 py-1.5 text-sm rounded border text-left",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:_?"var(--yc-color-text)":"var(--yc-color-text-muted)"},children:_||"End date"}),H&&f.jsxs("div",{ref:q,className:"absolute z-50 rounded-lg shadow-lg p-2 mt-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:_?ws(_,"yyyy-MM-dd",new Date):void 0,onSelect:oe=>{oe&&(C(on(oe,"yyyy-MM-dd")),B(!1))}})]})]}),f.jsx("input",{ref:z,type:"text",value:b,onChange:oe=>v(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&tt(),oe.key==="Escape"&&Re()},placeholder:"Event label",className:"w-full px-2 py-1.5 text-sm rounded border",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),f.jsxs("div",{children:[f.jsx("textarea",{value:k,onChange:oe=>O(oe.target.value),onKeyDown:oe=>{oe.key==="Escape"&&Re()},placeholder:"Description (optional)",rows:2,className:"w-full px-2 py-1.5 text-sm rounded border resize-y",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),f.jsxs("div",{className:"text-[10px] mt-0.5",style:{color:"var(--yc-color-text-muted)"},children:["Supports ",f.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--yc-color-primary)",textDecoration:"underline"},children:"Markdown"})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),f.jsx(F0,{value:E,onChange:T,themePalette:d})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[f.jsx("button",{onClick:Re,className:"px-2 py-1 text-xs rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),f.jsx("button",{onClick:tt,disabled:!D.trim()||!b.trim()||ue.isPending,className:"px-2 py-1 text-xs rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:ue.isPending?"Saving...":"Save"})]})]}),n.length===0?f.jsxs("div",{className:"text-center py-8",children:[f.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No events for this chart"}),f.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Events appear as dashed vertical lines on the chart"})]}):f.jsx("div",{className:"space-y-1",children:n.map((oe,re)=>f.jsxs("div",{className:"group flex items-start gap-3 p-3 rounded transition-colors hover:bg-black/[0.03]",style:{border:"1px solid transparent"},children:[i?f.jsx("div",{className:"flex-shrink-0 mt-0.5",children:f.jsx(F0,{value:oe.color??"",onChange:xe=>{const Oe=Ge(oe);Oe!==-1&&Ce.mutate({index:Oe,event:{...oe,...xe?{color:xe}:{color:void 0}}})},themePalette:d,compact:!0})}):f.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0 mt-0.5",style:{backgroundColor:oe.color||"#6366f1"}}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsxs("div",{className:"text-xs relative flex items-center gap-1",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:xe=>{i&&(xe.stopPropagation(),j(ae===re?null:re),pe(null))},children:oe.date}),ae===re&&f.jsxs("div",{ref:ye,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ws(oe.date,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ws(oe.date,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:xe=>{if(!xe)return;const Oe=on(xe,"yyyy-MM-dd");if(j(null),Oe===oe.date)return;const qe=Ge(oe);qe!==-1&&Ce.mutate({index:qe,event:{...oe,date:Oe}})}})]}),oe.endDate&&f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"→"}),f.jsx("span",{style:{cursor:i?"pointer":"default"},onClick:xe=>{i&&(xe.stopPropagation(),pe(le===re?null:re),j(null))},children:oe.endDate}),le===re&&f.jsxs("div",{ref:Ne,className:"absolute z-50 rounded-lg shadow-lg p-2",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",top:"100%",left:0},children:[f.jsx("style",{children:Nc}),f.jsx(Qa,{mode:"single",numberOfMonths:1,selected:(()=>{try{return ws(oe.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),defaultMonth:(()=>{try{return ws(oe.endDate,"yyyy-MM-dd",new Date)}catch{return}})(),onSelect:xe=>{if(!xe)return;const Oe=on(xe,"yyyy-MM-dd");if(pe(null),Oe===oe.endDate)return;const qe=Ge(oe);qe!==-1&&Ce.mutate({index:qe,event:{...oe,endDate:Oe}})}})]})]})]}),X===re&&ge==="label"?f.jsx("input",{ref:V,type:"text",value:de,onChange:xe=>M(xe.target.value),onBlur:()=>je(oe),onKeyDown:xe=>{xe.key==="Enter"&&je(oe),xe.key==="Escape"&&(ie(null),te(null))},className:"w-full py-0 text-sm font-medium border-0 border-b outline-none",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):f.jsx("div",{className:"text-sm font-medium truncate",style:{color:"var(--yc-color-text)",cursor:i?"pointer":"default"},onClick:()=>{i&&(ie(re),te("label"),M(oe.label))},children:oe.label}),X===re&&ge==="description"?f.jsx("input",{ref:V,type:"text",value:de,onChange:xe=>M(xe.target.value),onBlur:()=>je(oe),onKeyDown:xe=>{xe.key==="Enter"&&je(oe),xe.key==="Escape"&&(ie(null),te(null))},placeholder:"Add description",className:"w-full py-0 text-xs border-0 border-b outline-none mt-0.5",style:{backgroundColor:"transparent",borderColor:"var(--yc-color-primary, #3b82f6)",color:"var(--yc-color-text)",borderBottomWidth:1,borderBottomStyle:"solid"}}):f.jsx("div",{className:"text-xs truncate mt-0.5",style:{color:oe.description?"var(--yc-color-text-secondary)":"var(--yc-color-text-muted)",cursor:i?"pointer":"default"},onClick:()=>{i&&(ie(re),te("description"),M(oe.description??""))},children:oe.description||(i?"Add description":"")}),oe.charts&&oe.charts.length>0&&f.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:oe.charts.length===1&&oe.charts[0]===o?"This chart only":`${oe.charts.length} charts`})]}),i&&f.jsx("button",{onClick:()=>nt(oe),className:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-black/5 transition-all flex-shrink-0",style:{color:"var(--yc-color-danger, #ef4444)"},title:"Delete event",children:f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]},`${oe.date}-${oe.label}-${re}`))})]})]}),f.jsx(O3,{open:G!==null,title:"Delete event",message:`Delete "${G==null?void 0:G.label}"? This cannot be undone.`,onConfirm:we,onCancel:()=>Z(null)})]}):null}async function I3(e,t,n="png"){const{default:r}=await ls(async()=>{const{default:l}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:l}},[]),i=(await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1})).toDataURL(`image/${n}`,n==="jpeg"?.9:void 0);Zc(i,`${t}.${n}`)}async function M3(e,t,n){const[{default:r},{jsPDF:o}]=await Promise.all([ls(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),ls(()=>import("./jspdf.es.min-DER4Hnpt.js").then(I=>I.j),[])]),i=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),l=i.toDataURL("image/png"),c=i.width,d=i.height,p=c/d>1,y=new o({orientation:p?"landscape":"portrait",unit:"mm"}),b=y.internal.pageSize.getWidth(),v=y.internal.pageSize.getHeight();let D=0;n&&(D=8,y.setFontSize(16),y.text(n,b/2,D,{align:"center"}),D=14);const S=b,E=v-D;let T=S,k=d/c*T;k>E&&(k=E,T=c/d*k);const O=(b-T)/2;y.addImage(l,"PNG",O,D,T,k),y.save(`${t}.pdf`)}async function L3(e,t,n){const{jsPDF:r}=await ls(async()=>{const{jsPDF:E}=await import("./jspdf.es.min-DER4Hnpt.js").then(T=>T.j);return{jsPDF:E}},[]),o=new Image;o.src=e,await new Promise(E=>{o.onload=E});const l=o.width/o.height>1.2,c=new r({orientation:l?"landscape":"portrait",unit:"mm"}),d=c.internal.pageSize.getWidth(),h=c.internal.pageSize.getHeight();let p=15;n&&(c.setFontSize(14),c.text(n,d/2,10,{align:"center"}));const y=d-20,b=h-p-15;let v=y,D=o.height/o.width*v;D>b&&(D=b,v=o.width/o.height*D);const S=(d-v)/2;c.addImage(e,"PNG",S,p,v,D),c.save(`${t}.pdf`)}function Ed(e,t,n){if(e.length===0)return;const r=t.map(l=>l.name),o=e.map(l=>t.map(c=>{const d=l[c.name];if(d==null)return"";const h=String(d);return h.includes(",")||h.includes('"')||h.includes(`
79
+ `)?`"${h.replace(/"/g,'""')}"`:h})),i=[r.join(","),...o.map(l=>l.join(","))].join(`
80
+ `);F2(i,`${n}.csv`,"text/csv;charset=utf-8;")}function R3(e,t){const n=JSON.stringify(e,null,2);F2(n,`${t}.json`,"application/json;charset=utf-8;")}function Zc(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function F2(e,t,n){const r=new Blob([e],{type:n}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}const $a=50;function B2({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:o}){const[i,l]=N.useState(null),[c,d]=N.useState(0),h=N.useMemo(()=>n&&n.length>0?n.map(k=>({field:k.field,label:k.label??k.field,format:k.format})):t.map(k=>({field:k.name,label:k.name,format:void 0})),[n,t]),p=N.useMemo(()=>{if(!i)return e;const{field:k,direction:O}=i;return[...e].sort((I,L)=>{const _=I[k],C=L[k];if(_==null&&C==null)return 0;if(_==null)return 1;if(C==null)return-1;if(typeof _=="number"&&typeof C=="number")return O==="asc"?_-C:C-_;const A=String(_),P=String(C);return O==="asc"?A.localeCompare(P):P.localeCompare(A)})},[e,i]),y=Math.ceil(p.length/$a),b=p.slice(c*$a,(c+1)*$a),v=c*$a+1,D=Math.min((c+1)*$a,p.length),S=k=>{l(O=>!O||O.field!==k?{field:k,direction:"asc"}:O.direction==="asc"?{field:k,direction:"desc"}:null),d(0)},E=(k,O)=>k==null?"":O&&typeof k=="number"?O.includes("$")?`$${k.toLocaleString()}`:O.includes("%")?`${k.toFixed(1)}%`:k.toLocaleString():String(k),T=k=>!i||i.field!==k?"":i.direction==="asc"?" ↑":" ↓";return f.jsxs("div",{className:"border rounded-lg overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",p.length," rows filtered by ",r]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>Ed(e,t,`${o}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export CSV"}),f.jsx("button",{onClick:()=>R3(e,`${o}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export JSON"})]})]}),f.jsx("div",{className:"overflow-x-auto",children:f.jsxs("table",{className:"w-full text-sm yc-table",children:[f.jsx("thead",{children:f.jsxs("tr",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[f.jsx("th",{className:"px-3 py-2 text-right font-medium select-none w-10",style:{color:"var(--yc-color-text-muted)"},children:"#"}),h.map(k=>f.jsxs("th",{className:"px-4 py-2 text-left font-medium cursor-pointer hover:bg-black/5 select-none",style:{color:"var(--yc-color-text)"},onClick:()=>S(k.field),children:[k.label,T(k.field)]},k.field))]})}),f.jsx("tbody",{children:b.map((k,O)=>f.jsxs("tr",{style:{backgroundColor:O%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:[f.jsx("td",{className:"px-3 py-2 text-right yc-row-num w-10",style:{backgroundColor:O%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:c*$a+O+1}),h.map(I=>f.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text-secondary)"},children:E(k[I.field],I.format)},I.field))]},O))})]})}),y>1&&f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",v,"-",D," of ",p.length]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>d(k=>Math.max(0,k-1)),disabled:c===0,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Previous"}),f.jsx("button",{onClick:()=>d(k=>Math.min(y-1,k+1)),disabled:c>=y-1,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Next"})]})]})]})}class Am extends N.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error&&t.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error,()=>this.setState({error:null})):this.props.children}}const Wr=N.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:o},i){const l=N.useRef(null),c=N.useRef(null);return N.useImperativeHandle(i,()=>({getDataURL:d=>{var p;const h=(p=l.current)==null?void 0:p.getEchartsInstance();if(h)try{return h.getDataURL({type:d==="png"?"png":"svg",pixelRatio:2,backgroundColor:"#fff"})}catch{return h.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff"})}},getInstance:()=>{var d;return(d=l.current)==null?void 0:d.getEchartsInstance()}})),N.useEffect(()=>{const d=c.current;if(!d)return;let h;const p=new ResizeObserver(()=>{clearTimeout(h),h=setTimeout(()=>{var y,b;(b=(y=l.current)==null?void 0:y.getEchartsInstance())==null||b.resize()},150)});return p.observe(d),()=>{clearTimeout(h),p.disconnect()}},[]),f.jsx("div",{ref:c,style:{height:n,width:"100%"},children:f.jsx(Yw,{ref:l,option:t,notMerge:!0,style:{height:"100%",width:"100%"},showLoading:r,onEvents:o,opts:{renderer:"canvas"}})})});function P3(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function j3(e){return e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,n,r)=>{const i=!r.startsWith("#")?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${r}" style="color: #6366f1; text-decoration: underline;"${i}>${n}</a>`})}function Td(e,t,n){const r=e.filter(o=>{if(o.date===t)return!0;if(o.endDate&&n&&n.length>0){let i=n.indexOf(o.date),l=n.indexOf(o.endDate);const c=n.indexOf(t);if(i===-1&&(i=0),l===-1&&(l=n.length-1),c!==-1)return c>=i&&c<=l}return!1});return r.length===0?"":r.map(o=>{const i=o.color??"#6366f1",l=o.endDate?`${o.date} → ${o.endDate}`:"",c=o.description?P3(o.description,100):"",d=c?`<div style="font-size: 11px; color: #888; margin-top: 2px;">${j3(c)}</div>`:"",h=l?`<div style="font-size: 10px; color: #999; margin-top: 1px;">${l}</div>`:"";return`<div style="margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e5e7eb;"><span style="display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: ${i}; margin-right: 6px;"></span><span style="font-weight: 500;">${o.label}</span>${h}${d}</div>`}).join("")}function wd(e,t,n){let r=e.filter(o=>!o.endDate);if(n&&n.length>0&&(r=r.filter(o=>n.includes(o.date))),r.length!==0)return{silent:!0,symbol:"none",tooltip:{show:!1},data:r.map(o=>{const i=o.color??t;return{xAxis:o.date,label:{formatter:o.label,position:"insideEndTop",fontSize:11,color:i,backgroundColor:"rgba(99, 102, 241, 0.12)",padding:[2,6],borderRadius:3},lineStyle:{type:"dashed",color:i,width:1},emphasis:{disabled:!0}}})}}function Sd(e,t,n){const r=e.filter(l=>l.endDate);if(r.length===0)return[];const o=n==null?void 0:n[0],i=n==null?void 0:n[n.length-1];return r.flatMap(l=>{let c=l.date,d=l.endDate;if(n&&n.length>0&&o&&i){const p=n.indexOf(c),y=n.indexOf(d);p===-1&&(c=o),y===-1&&(d=i);const b=n.indexOf(c),v=n.indexOf(d);if(b>v)return[]}const h=l.color??t;return[[{xAxis:c,itemStyle:{color:h,opacity:.1},label:{show:!0,formatter:l.label,position:"insideTop",fontSize:11,color:h,padding:[2,6]}},{xAxis:d}]]})}const Im="#22c55e",H2="dashed";function F3(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e.toLocaleString()}function U2(e){return e.type==="fixed"}function B3(e){return e.type==="cumulative"}function H3(e){return e.type==="model"}function kd(e,t){const n=[];for(const r of e){const o=r.color??Im,i=r.style??H2;if(U2(r)){const l=F3(r.value);n.push({yAxis:r.value,label:{formatter:r.label?`${r.label}: ${l}`:l,position:"insideEndTop",fontSize:11,color:o,backgroundColor:"rgba(255,255,255,0.85)",padding:[2,6],borderRadius:2},lineStyle:{color:o,type:i,width:2}})}if(B3(r)){const l=r.from?t.indexOf(r.from):0,c=r.by?t.indexOf(r.by):t.length-1,d=Math.max(0,l===-1?0:l),h=c===-1?t.length-1:c;n.push([{coord:[d,0],label:{formatter:r.label??"",position:"insideEndTop",fontSize:11,color:o},lineStyle:{color:o,type:i,width:2}},{coord:[h,r.value]}])}}return n}function Cd(e,t){const n=[];for(const r of e){if(!r.zone)continue;const o=r.color??Im;if(U2(r)){const i=r.value*(1-r.zone.tolerance),l=r.value*(1+r.zone.tolerance);n.push([{yAxis:i,itemStyle:{color:o,opacity:.08}},{yAxis:l}])}}return n}function _d(e,t){const n=[];for(const r of e){if(!H3(r)||!t)continue;const o=r.color??Im,i=r.style??H2,l=t.rows.map(c=>{const d=c[r.source.value_field];return typeof d=="number"?d:parseFloat(String(d))||0});n.push({name:r.label??"Goal",data:l,color:o,lineStyle:{type:i,width:2,color:o},showSymbol:!1,z:5})}return n}const ed="#22c55e",td="#ef4444";function z2(e){return e.type==="fixed"}function W2(e){return e.type==="cumulative"}function U3(e,t){const n=t.find(z2);return n?e>=n.value?ed:td:null}function z3(e,t,n,r){const o=r.find(W2);if(!o||n===0)return null;const i=o.value/n*(t+1);return e>=i?ed:td}function W3(e,t){const n=t.find(z2);if(n)return e.map(o=>({value:o,itemStyle:{color:o>=n.value?ed:td}}));const r=t.find(W2);if(r){const o=e.length;return e.map((i,l)=>{const c=r.value/o*(l+1);return{value:i,itemStyle:{color:i>=c?ed:td}}})}return e}function Y2(e,t){if(e.length===0||t.length===0)return null;const n=e[e.length-1],r=U3(n,t);return r||z3(n,e.length-1,e.length,t)}function Y3(e){return"field"in e}function $3(e){return"columns"in e}function Uh(e){if(e.length===0)return e;const t=e[0].data.length;for(let n=0;n<t;n++){let r=0;for(const o of e)r+=o.data[n]??0;for(const o of e)o.data[n]=r===0?0:(o.data[n]??0)/r*100}return e}function Nd(e,t,n){var o,i;const r=t.stacking?"total":void 0;if(!t.series){const l=((o=t.y)==null?void 0:o.field)??"",c=e.map(h=>{const p=h[l];return typeof p=="number"?p:parseFloat(String(p))||0}),d=[{name:l,data:c,color:yi(0,void 0,n),stack:r}];return t.stacking==="percent"?Uh(d):d}if(Y3(t.series)){const l=t.series.field,c=t.series.colors,d=((i=t.y)==null?void 0:i.field)??"",h=[],p=new Map;e.forEach(b=>{const v=String(b[l]??"");p.has(v)||(h.push(v),p.set(v,[]));const D=b[d];p.get(v).push(typeof D=="number"?D:parseFloat(String(D))||0)});const y=h.map((b,v)=>({name:b,data:p.get(b),color:D3(b,v,c,n),stack:r}));return t.stacking==="percent"?Uh(y):y}if($3(t.series)){const l=t.series.columns.map((c,d)=>{const h=e.map(p=>{const y=p[c.field];return typeof y=="number"?y:parseFloat(String(y))||0});return{name:c.name??c.field,data:h,color:yi(d,c.color,n),opacity:c.opacity,style:c.style,gradient:c.gradient,stack:r,chartType:c.type,yAxisIndex:c.axis==="right"?1:c.axis==="left"?0:void 0}});return t.stacking==="percent"?Uh(l):l}return[]}function nd(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})T00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?$/);return c1(t?t[1]:e)}function q3(e){return e.replace(/'/g,"''").replace(/%Y/g,"yyyy").replace(/%y/g,"yy").replace(/%m/g,"MM").replace(/%b/g,"MMM").replace(/%B/g,"MMMM").replace(/%d/g,"dd").replace(/%H/g,"HH").replace(/%I/g,"hh").replace(/%M/g,"mm").replace(/%S/g,"ss").replace(/%p/g,"a").replace(/%P/g,"a")}function $2(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function V3(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(c=>c.getTime()).sort((c,d)=>c-d),n=t[0],r=t[t.length-1],o=(r-n)/(1e3*60*60*24);return o<2?"MMM dd, h:mm a":o<=90||(r-n)/(t.length-1)/(1e3*60*60*24)<28?"MMM dd":o<=730?"MMM yyyy":"yyyy"}function Q3(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(r=>r.getTime()).sort((r,o)=>r-o),n=(t[t.length-1]-t[0])/((t.length-1)*864e5);return n<1?"MMM dd, yyyy h:mm a":n<28?"MMM dd, yyyy":"MMM yyyy"}function Dd(e,t){const n=new Set,r=e.filter(l=>{const c=l[t.field];return n.has(c)?!1:(n.add(c),!0)});if(t.type!=="temporal")return r.map(l=>String(l[t.field]??""));const o=[];for(const l of r){const c=l[t.field];if(typeof c=="string")try{o.push(nd(c))}catch{}}const i=o.length>0?Q3(o):"MMM dd, yyyy";return r.map(l=>{const c=l[t.field];if(typeof c=="string")try{const d=nd(c);return t.format==="quarter"?$2(d):on(d,i)}catch{return String(c??"")}return String(c??"")})}function Od(e,t){const n=new Set,r=e.filter(o=>{const i=o[t.field];return n.has(i)?!1:(n.add(i),!0)});return Ls(r,t)}function Ls(e,t){let n;if(t.type==="temporal"&&!t.format){const r=[];for(const o of e){const i=o[t.field];if(typeof i=="string")try{r.push(nd(i))}catch{}}r.length>0&&(n=V3(r))}return e.map(r=>{const o=r[t.field];if(t.type==="temporal"&&typeof o=="string")try{const i=nd(o);if(t.format==="quarter")return $2(i);const l=t.format?q3(t.format):n??"MMM yyyy";return on(i,l)}catch{return String(o??"")}return String(o??"")})}function wo(e,t){if(t){if(t.includes("$"))return`$${e.toLocaleString()}`;if(t.includes("%"))return`${e.toFixed(1)}%`}return e.toLocaleString()}function G3(e){const t=e.replace("#","").match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Ad(e,t){if(!t)return null;if(typeof t=="object")return{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:t.from},{offset:1,color:t.to}]};const n=G3(e);return n?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.4)`},{offset:1,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.05)`}]}:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e},{offset:1,color:"rgba(0,0,0,0)"}]}}function Rs(e){return((e==null?void 0:e.base)??"modern")==="modern"?{smooth:!0,barBorderRadius:[4,4,0,0],pieBorderRadius:4}:{smooth:!1,barBorderRadius:[0,0,0,0],pieBorderRadius:0}}const q2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,events:h,goalData:p},y){var B,z,Q,q,X,ie,ge,te;const b=cs(),v=(o==null?void 0:o.series)&&"field"in o.series,D=v?Od(t,n):Ls(t,n),S=n.type==="temporal"?Dd(t,n):D,E=N.useMemo(()=>{if(v){const de=new Set;return t.filter(M=>{const V=M[n.field];return de.has(V)?!1:(de.add(V),!0)}).map(M=>M[n.field])}return t.map(de=>de[n.field])},[t,n.field,v]),T=N.useMemo(()=>{if(d)return{click:de=>{var pe,ye,Ne,G;const M=de;if(M.componentType!=="series")return;const V=M.dataIndex!=null?E[M.dataIndex]:void 0,ae=V!=null?String(V):M.name;if(ae==null||ae==="")return;const j=((ye=(pe=M.event)==null?void 0:pe.event)==null?void 0:ye.clientX)??0,le=((G=(Ne=M.event)==null?void 0:Ne.event)==null?void 0:G.clientY)??0;d(n.field,ae,{x:j,y:le},M.seriesName)}}},[d,n.field,E]);let k,O,I;if(o){const de=Nd(t,{type:o.type,y:r?{field:r.field,type:r.type}:void 0,series:o.series,stacking:o.stacking},i),M=Rs(i);k=de.map(V=>{const ae=Ad(V.color,V.gradient??o.gradient);return{type:"line",name:V.name,data:V.data,smooth:M.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:V.color,type:V.style==="dashed"?"dashed":V.style==="dotted"?"dotted":"solid"},itemStyle:{color:V.color},areaStyle:ae?{color:ae}:void 0,stack:V.stack,...V.opacity!==void 0?{opacity:V.opacity}:{}}}),de.length>1&&(O={show:((B=o.legend)==null?void 0:B.show)!==!1,...((z=o.legend)==null?void 0:z.position)==="top"?{top:0}:((Q=o.legend)==null?void 0:Q.position)==="left"?{left:0,orient:"vertical"}:((q=o.legend)==null?void 0:q.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:b.textColor,fontSize:12}}),(X=o.interactions)!=null&&X.zoom&&(I=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const de=(r==null?void 0:r.field)??"";k=[{type:"line",data:t.map(V=>{const ae=V[de];return typeof ae=="number"?ae:parseFloat(String(ae))||0}),smooth:Rs(i).smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:"#3B82F6"},itemStyle:{color:"#3B82F6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(59, 130, 246, 0.2)"},{offset:1,color:"rgba(59, 130, 246, 0)"}]}}}]}const L=(o==null?void 0:o.goals)??[];if(L.length>0&&Array.isArray(k)){const de=Y2(((ie=k[0])==null?void 0:ie.data)??[],L);de&&k[0]&&(k[0].lineStyle={...k[0].lineStyle,color:de},k[0].itemStyle={color:de});const M=kd(L,D),V=Cd(L);if(M.length>0&&k[0]){const j=k[0].markLine,le=(j==null?void 0:j.data)??[];k[0].markLine={...j,silent:!0,symbol:"none",data:[...le,...M]}}V.length>0&&k[0]&&(k[0].markArea={silent:!0,data:V});const ae=_d(L,p);for(const j of ae)k.push({type:"line",name:j.name,data:j.data,z:j.z,showSymbol:j.showSymbol,lineStyle:j.lineStyle,itemStyle:{color:j.color}})}const _=N.useMemo(()=>{if(!(h!=null&&h.length))return[];const M=h.flatMap(le=>le.endDate?[le.date,le.endDate]:[le.date]).map(le=>({[n.field]:le})),ae=Ls([...t,...M],n).slice(t.length);let j=0;return h.map(le=>{const pe={...le,date:ae[j++]??le.date};return le.endDate&&(pe.endDate=ae[j++]??le.endDate),pe})},[h,t,n]),C=Array.isArray(k)?k.map(de=>de.name).filter(Boolean):[],A=wd(_,b.textColor,D),P=Sd(_,b.textColor,D);if((A||P.length>0)&&Array.isArray(k)){const de={type:"line",data:((ge=k[0])==null?void 0:ge.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};A&&(de.markLine=A),P.length>0&&(de.markArea={silent:!0,data:P}),k.push(de)}const H={tooltip:{trigger:"axis",formatter:de=>{const M=de;if(!Array.isArray(M)||M.length===0)return"";let ae=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${S[M[0].dataIndex]??M[0].name}</div>`;for(const j of M)ae+=`<div>${j.marker} ${j.seriesName}: ${wo(j.value,r==null?void 0:r.format)}</div>`;return ae+=Td(_,M[0].name,D),ae+="</div>",ae}},legend:O?{...O,...C.length>0?{data:C}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:D,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:b.borderColor}},axisTick:{show:!1}},yAxis:{type:((te=o==null?void 0:o.y)==null?void 0:te.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,formatter:de=>wo(de,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:b.splitLineColor,type:"dashed"}}},series:k,...I?{dataZoom:I}:{},animation:!0,animationDuration:300};return f.jsx(Wr,{ref:y,option:H,height:l,loading:c,onEvents:T})}),V2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,horizontal:d=!1,onChartClick:h,activeCrossFilter:p,events:y,goalData:b},v){var ge,te,de,M,V,ae,j;const D=cs(),S=(o==null?void 0:o.series)&&"field"in o.series,E=S?Od(t,n):Ls(t,n),T=n.type==="temporal"?Dd(t,n):E,k=(p==null?void 0:p.field)===n.field,O=d||(o==null?void 0:o.orientation)==="horizontal",I=N.useMemo(()=>{if(S){const le=new Set;return t.filter(pe=>{const ye=pe[n.field];return le.has(ye)?!1:(le.add(ye),!0)}).map(pe=>pe[n.field])}return t.map(le=>le[n.field])},[t,n.field,S]),L=N.useMemo(()=>{if(h)return{click:le=>{var ue,me,Ce,Re;const pe=le;if(pe.componentType!=="series")return;const ye=pe.dataIndex!=null?I[pe.dataIndex]:void 0,Ne=ye!=null?String(ye):pe.name;if(Ne==null||Ne==="")return;const G=((me=(ue=pe.event)==null?void 0:ue.event)==null?void 0:me.clientX)??0,Z=((Re=(Ce=pe.event)==null?void 0:Ce.event)==null?void 0:Re.clientY)??0;h(n.field,Ne,{x:G,y:Z},pe.seriesName)}}},[h,n.field,I]),_=(o==null?void 0:o.stacking)==="percent",C=le=>_?`${le.toFixed(1)}%`:wo(le,r==null?void 0:r.format);let A,P=!1;if(o){const le=Nd(t,{type:o.type,y:r?{field:r.field,type:r.type}:void 0,series:o.series,stacking:o.stacking},i),pe=le.length>1,ye=!!o.stacking;P=pe;const Ne=Rs(i);A=le.map(G=>{const Z=Ad(G.color,G.gradient??o.gradient);return{type:"bar",name:G.name,data:k?G.data.map((ue,me)=>({value:ue,itemStyle:{opacity:String(I[me])===(p==null?void 0:p.value)?1:.3}})):G.data,barWidth:pe&&!ye?void 0:"60%",itemStyle:{color:Z??G.color,borderRadius:Ne.barBorderRadius},stack:G.stack,...G.opacity!==void 0?{opacity:G.opacity}:{}}})}else{const le=(r==null?void 0:r.field)??"",pe=t.map(Ne=>{const G=Ne[le];return typeof G=="number"?G:parseFloat(String(G))||0}),ye=Rs(i);A=[{type:"bar",data:k?pe.map((Ne,G)=>({value:Ne,itemStyle:{opacity:String(I[G])===(p==null?void 0:p.value)?1:.3}})):pe,barWidth:"60%",itemStyle:{color:"#3B82F6",borderRadius:ye.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const H=(o==null?void 0:o.goals)??[];if(H.length>0&&Array.isArray(A)&&!O){if(A[0]){const G=A[0].data.map(ue=>typeof ue=="number"?ue:ue.value),Z=W3(G,H);A[0].data=Z}const le=kd(H,E),pe=Cd(H);le.length>0&&A[0]&&(A[0].markLine={silent:!0,symbol:"none",data:le}),pe.length>0&&A[0]&&(A[0].markArea={silent:!0,data:pe});const ye=_d(H,b);for(const Ne of ye)A.push({type:"line",name:Ne.name,data:Ne.data,z:Ne.z,showSymbol:Ne.showSymbol,lineStyle:Ne.lineStyle,itemStyle:{color:Ne.color}})}const B=N.useMemo(()=>{if(!(y!=null&&y.length))return[];const pe=y.flatMap(Z=>Z.endDate?[Z.date,Z.endDate]:[Z.date]).map(Z=>({[n.field]:Z})),Ne=Ls([...t,...pe],n).slice(t.length);let G=0;return y.map(Z=>{const ue={...Z,date:Ne[G++]??Z.date};return Z.endDate&&(ue.endDate=Ne[G++]??Z.endDate),ue})},[y,t,n]),z=Array.isArray(A)?A.map(le=>le.name).filter(Boolean):[],Q=wd(B,D.textColor,E),q=Sd(B,D.textColor,E);if((Q||q.length>0)&&Array.isArray(A)){const le={type:"line",data:((ge=A[0])==null?void 0:ge.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};Q&&(le.markLine=Q),q.length>0&&(le.markArea={silent:!0,data:q}),A.push(le)}const ie={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:le=>{const pe=le;if(!Array.isArray(pe)||pe.length===0)return"";const ye=T[pe[0].dataIndex]??pe[0].name,Ne=Td(B,pe[0].name,E);if(pe.length===1){const Z=pe[0];return`
81
+ <div style="padding: 8px;">
82
+ <div style="font-weight: 600; margin-bottom: 4px;">${ye}</div>
83
+ <div>${Z.marker} ${(r==null?void 0:r.label)||(r==null?void 0:r.field)||Z.seriesName}: ${C(Z.value)}</div>
84
+ ${Ne}
85
+ </div>
86
+ `}const G=pe.map(Z=>`<div>${Z.marker} ${Z.seriesName}: ${C(Z.value)}</div>`).join("");return`
87
+ <div style="padding: 8px;">
88
+ <div style="font-weight: 600; margin-bottom: 4px;">${ye}</div>
89
+ ${G}
90
+ ${Ne}
91
+ </div>
92
+ `}},legend:P?{show:((te=o==null?void 0:o.legend)==null?void 0:te.show)!==!1,...((de=o==null?void 0:o.legend)==null?void 0:de.position)==="top"?{top:0}:((M=o==null?void 0:o.legend)==null?void 0:M.position)==="left"?{left:0,orient:"vertical"}:((V=o==null?void 0:o.legend)==null?void 0:V.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:D.textColor,fontSize:12},...z.length>0?{data:z}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:P?"15%":"10%",top:"10%",containLabel:!0},xAxis:O?{type:((ae=o==null?void 0:o.y)==null?void 0:ae.scale)==="log"?"log":"value",axisLabel:{color:D.textColor,fontSize:12,formatter:le=>C(le)},axisLine:{show:!1},splitLine:{lineStyle:{color:D.splitLineColor,type:"dashed"}}}:{type:"category",data:E,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:D.textColor,fontSize:12},axisLabel:{color:D.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:D.borderColor}},axisTick:{show:!1}},yAxis:O?{type:"category",data:E,axisLabel:{color:D.textColor,fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((j=o==null?void 0:o.y)==null?void 0:j.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:D.textColor,fontSize:12},..._?{max:100}:{},axisLabel:{color:D.textColor,fontSize:12,formatter:le=>C(le)},axisLine:{show:!1},splitLine:{lineStyle:{color:D.splitLineColor,type:"dashed"}}},series:A,animation:!0,animationDuration:300};return f.jsx(Wr,{ref:v,option:ie,height:l,loading:c,onEvents:L})}),Q2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,events:h,goalData:p},y){var z,Q,q,X,ie,ge,te,de;const b=cs(),v=(o==null?void 0:o.series)&&"field"in o.series,D=v?Od(t,n):Ls(t,n),S=n.type==="temporal"?Dd(t,n):D,E=(o==null?void 0:o.stacking)==="percent",T=N.useMemo(()=>{if(v){const M=new Set;return t.filter(V=>{const ae=V[n.field];return M.has(ae)?!1:(M.add(ae),!0)}).map(V=>V[n.field])}return t.map(M=>M[n.field])},[t,n.field,v]),k=N.useMemo(()=>{if(d)return{click:M=>{var ye,Ne,G,Z;const V=M;if(V.componentType!=="series")return;const ae=V.dataIndex!=null?T[V.dataIndex]:void 0,j=ae!=null?String(ae):V.name;if(j==null||j==="")return;const le=((Ne=(ye=V.event)==null?void 0:ye.event)==null?void 0:Ne.clientX)??0,pe=((Z=(G=V.event)==null?void 0:G.event)==null?void 0:Z.clientY)??0;d(n.field,j,{x:le,y:pe},V.seriesName)}}},[d,n.field,T]);let O,I,L;if(o){const M=Nd(t,{type:o.type,y:r?{field:r.field,type:r.type}:void 0,series:o.series,stacking:o.stacking},i),V=Rs(i);O=M.map(ae=>{const j=Ad(ae.color,ae.gradient??o.gradient??!0);return{type:"line",name:ae.name,data:ae.data,smooth:V.smooth,symbol:"none",lineStyle:{width:2,color:ae.color,type:ae.style==="dashed"?"dashed":ae.style==="dotted"?"dotted":"solid"},itemStyle:{color:ae.color},areaStyle:{color:j??ae.color},stack:ae.stack,...ae.opacity!==void 0?{opacity:ae.opacity}:{}}}),M.length>1&&(I={show:((z=o.legend)==null?void 0:z.show)!==!1,...((Q=o.legend)==null?void 0:Q.position)==="top"?{top:0}:((q=o.legend)==null?void 0:q.position)==="left"?{left:0,orient:"vertical"}:((X=o.legend)==null?void 0:X.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:b.textColor,fontSize:12}}),(ie=o.interactions)!=null&&ie.zoom&&(L=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const M=(r==null?void 0:r.field)??"";O=[{type:"line",data:t.map(ae=>{const j=ae[M];return typeof j=="number"?j:parseFloat(String(j))||0}),smooth:Rs(i).smooth,symbol:"none",lineStyle:{width:2,color:"#10B981"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(16, 185, 129, 0.4)"},{offset:1,color:"rgba(16, 185, 129, 0.05)"}]}}}]}const _=(o==null?void 0:o.goals)??[];if(_.length>0&&Array.isArray(O)){const M=Y2(((ge=O[0])==null?void 0:ge.data)??[],_);M&&O[0]&&(O[0].lineStyle={...O[0].lineStyle,color:M},O[0].itemStyle={color:M});const V=kd(_,D),ae=Cd(_);if(V.length>0&&O[0]){const le=O[0].markLine,pe=(le==null?void 0:le.data)??[];O[0].markLine={...le,silent:!0,symbol:"none",data:[...pe,...V]}}ae.length>0&&O[0]&&(O[0].markArea={silent:!0,data:ae});const j=_d(_,p);for(const le of j)O.push({type:"line",name:le.name,data:le.data,z:le.z,showSymbol:le.showSymbol,lineStyle:le.lineStyle,itemStyle:{color:le.color}})}const C=N.useMemo(()=>{if(!(h!=null&&h.length))return[];const V=h.flatMap(pe=>pe.endDate?[pe.date,pe.endDate]:[pe.date]).map(pe=>({[n.field]:pe})),j=Ls([...t,...V],n).slice(t.length);let le=0;return h.map(pe=>{const ye={...pe,date:j[le++]??pe.date};return pe.endDate&&(ye.endDate=j[le++]??pe.endDate),ye})},[h,t,n]),A=Array.isArray(O)?O.map(M=>M.name).filter(Boolean):[],P=wd(C,b.textColor,D),H=Sd(C,b.textColor,D);if((P||H.length>0)&&Array.isArray(O)){const M={type:"line",data:((te=O[0])==null?void 0:te.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};P&&(M.markLine=P),H.length>0&&(M.markArea={silent:!0,data:H}),O.push(M)}const B={tooltip:{trigger:"axis",formatter:M=>{const V=M;if(!Array.isArray(V)||V.length===0)return"";let j=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${S[V[0].dataIndex]??V[0].name}</div>`;for(const le of V){const pe=E?`${le.value.toFixed(1)}%`:wo(le.value,r==null?void 0:r.format);j+=`<div>${le.marker} ${le.seriesName}: ${pe}</div>`}return j+=Td(C,V[0].name,D),j+="</div>",j}},legend:I?{...I,...A.length>0?{data:A}:{}}:void 0,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:D,boundaryGap:!1,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:b.textColor,fontSize:12},axisLabel:{color:b.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:b.borderColor}},axisTick:{show:!1}},yAxis:{type:((de=o==null?void 0:o.y)==null?void 0:de.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:b.textColor,fontSize:12},...E?{max:100}:{},axisLabel:{color:b.textColor,fontSize:12,formatter:M=>E?`${M}%`:wo(M,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:b.splitLineColor,type:"dashed"}}},series:O,...L?{dataZoom:L}:{},animation:!0,animationDuration:300};return f.jsx(Wr,{ref:y,option:B,height:l,loading:c,onEvents:k})}),G2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,activeCrossFilter:h},p){var k,O,I,L;const y=cs(),b=(h==null?void 0:h.field)===n.field,v=N.useMemo(()=>t.map(_=>_[n.field]),[t,n.field]),D=N.useMemo(()=>{if(d)return{click:_=>{var z,Q,q,X;const C=_;if(C.componentType!=="series")return;const A=C.dataIndex!=null?v[C.dataIndex]:void 0,P=A!=null?String(A):C.name;if(P==null||P==="")return;const H=((Q=(z=C.event)==null?void 0:z.event)==null?void 0:Q.clientX)??0,B=((X=(q=C.event)==null?void 0:q.event)==null?void 0:X.clientY)??0;d(n.field,P,{x:H,y:B})}}},[d,n.field,v]),S=t.map((_,C)=>{const A=_[r.field],P=typeof A=="number"?A:parseFloat(String(A))||0;return{name:String(_[n.field]??""),value:P,itemStyle:{color:yi(C,void 0,i)}}}),E=_=>{if(r.format){if(r.format.includes("$"))return`$${_.toLocaleString()}`;if(r.format.includes("%"))return`${_.toFixed(1)}%`}return _.toLocaleString()},T={tooltip:{trigger:"item",formatter:_=>{const C=_;return`
93
+ <div style="padding: 8px;">
94
+ <div style="font-weight: 600; margin-bottom: 4px;">${C.name}</div>
95
+ <div>${C.marker} ${r.label||r.field}: ${E(C.value)}</div>
96
+ <div style="color: ${y.textColor}; font-size: 12px;">${C.percent.toFixed(1)}%</div>
97
+ </div>
98
+ `}},legend:{show:((k=o==null?void 0:o.legend)==null?void 0:k.show)!==!1,type:"scroll",...((O=o==null?void 0:o.legend)==null?void 0:O.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((I=o==null?void 0:o.legend)==null?void 0:I.position)==="bottom"?{bottom:0,orient:"horizontal",left:"center"}:((L=o==null?void 0:o.legend)==null?void 0:L.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"3%",top:"center"},textStyle:{color:y.textColor,fontSize:12,width:120,overflow:"truncate"},pageTextStyle:{color:y.textColor}},series:[{type:"pie",radius:["40%","60%"],center:["35%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Rs(i).pieBorderRadius,borderColor:y.surfaceColor,borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},labelLine:{show:!1},data:S.map(_=>({..._,itemStyle:{..._.itemStyle,...b&&(h==null?void 0:h.value)!==_.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return f.jsx(Wr,{ref:p,option:T,height:l,loading:c,onEvents:D})}),K2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:o,chartConfig:i,theme:l,height:c=400,loading:d=!1,onChartClick:h,activeCrossFilter:p},y){var L,_,C,A,P;const b=cs(),v=(p==null?void 0:p.field)===n.field,D=N.useMemo(()=>t.map(H=>H[n.field]),[t,n.field]),S=N.useMemo(()=>{if(h)return{click:H=>{var ie,ge,te,de;const B=H;if(B.componentType!=="series")return;const z=B.dataIndex!=null?D[B.dataIndex]:void 0,Q=z!=null?String(z):B.name;if(Q==null||Q==="")return;const q=((ge=(ie=B.event)==null?void 0:ie.event)==null?void 0:ge.clientX)??0,X=((de=(te=B.event)==null?void 0:te.event)==null?void 0:de.clientY)??0;h(n.field,Q,{x:q,y:X})}}},[h,n.field,D]),E=t.map((H,B)=>{const z=H[r.field],Q=typeof z=="number"?z:parseFloat(String(z))||0;return{name:String(H[n.field]??""),value:Q,itemStyle:{color:yi(B,void 0,l)}}});let T=null;if(o)if(o.field==="total"||!o.field)T=E.reduce((H,B)=>H+B.value,0);else{const H=(L=t[0])==null?void 0:L[o.field];T=typeof H=="number"?H:parseFloat(String(H))||null}const k=(H,B)=>{if(B){if(B.includes("$"))return`$${H.toLocaleString()}`;if(B.includes("%"))return`${H.toFixed(1)}%`}return H.toLocaleString()},O=T!==null?o!=null&&o.label?`{value|${k(T,(o==null?void 0:o.format)||r.format)}}
99
+ {label|${o.label}}`:`{value|${k(T,(o==null?void 0:o.format)||r.format)}}`:"",I={tooltip:{trigger:"item",formatter:H=>{const B=H;return`
100
+ <div style="padding: 8px;">
101
+ <div style="font-weight: 600; margin-bottom: 4px;">${B.name}</div>
102
+ <div>${B.marker} ${r.label||r.field}: ${k(B.value,r.format)}</div>
103
+ <div style="color: ${b.textColor}; font-size: 12px;">${B.percent.toFixed(1)}%</div>
104
+ </div>
105
+ `}},legend:{show:((_=i==null?void 0:i.legend)==null?void 0:_.show)!==!1,type:"scroll",...((C=i==null?void 0:i.legend)==null?void 0:C.position)==="top"?{top:0,orient:"horizontal",left:"center"}:((A=i==null?void 0:i.legend)==null?void 0:A.position)==="bottom"?{bottom:0,orient:"horizontal",left:"center"}:((P=i==null?void 0:i.legend)==null?void 0:P.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"3%",top:"center"},textStyle:{color:b.textColor,fontSize:12,width:120,overflow:"truncate"},pageTextStyle:{color:b.textColor}},series:[{type:"pie",radius:["40%","60%"],center:["35%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Rs(l).pieBorderRadius,borderColor:b.surfaceColor,borderWidth:2},label:{show:T!==null,position:"center",formatter:O,rich:{value:{fontSize:22,fontWeight:"bold",color:b.textColor,lineHeight:30},label:{fontSize:12,color:b.textColor,lineHeight:20}}},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"},scaleSize:5},labelLine:{show:!1},data:E.map(H=>({...H,itemStyle:{...H.itemStyle,...v&&(p==null?void 0:p.value)!==H.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return f.jsx(Wr,{ref:y,option:I,height:c,loading:d,onEvents:S})}),K3=5,X3=50;function zh(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function J3(e,t,n,r,o){return n===t?(r+o)/2:r+(e-t)/(n-t)*(o-r)}function Z3(e,t,n,r){const{size:o,group:i}=r,l=(o==null?void 0:o.min)??K3,c=(o==null?void 0:o.max)??X3,d=[];for(const v of e){const D=zh(v[t]),S=zh(v[n]);if(D===null||S===null)continue;let E=null;if(o&&(E=zh(v[o.field]),E===null))continue;const T=i?String(v[i.field]??"Other"):"data";d.push({x:D,y:S,sizeVal:E,groupVal:T})}let h=1/0,p=-1/0;if(o){for(const v of d)v.sizeVal!==null&&(h=Math.min(h,v.sizeVal),p=Math.max(p,v.sizeVal));isFinite(h)||(h=0,p=0)}const y=new Map;for(const v of d){const D=y.get(v.groupVal);D?D.push(v):y.set(v.groupVal,[v])}if(y.size===0)return{series:[{name:"data",data:[],symbolSizes:o?[]:void 0}]};const b=[];for(const[v,D]of y){const S=[],E=[];for(const T of D)o&&T.sizeVal!==null?(S.push([T.x,T.y,T.sizeVal]),E.push(J3(T.sizeVal,h,p,l,c))):S.push([T.x,T.y]);b.push({name:v,data:S,symbolSizes:o?E:void 0})}return{series:b}}function e4(e){const t=e.length;if(t<2)return null;let n=0,r=0,o=0,i=0;for(const[E,T]of e)n+=E,r+=T,o+=E*T,i+=E*E;const l=t*i-n*n;if(l===0)return null;const c=(t*o-n*r)/l,d=(r-c*n)/t,h=r/t;let p=0,y=0;for(const[E,T]of e){const k=c*E+d;p+=(T-k)**2,y+=(T-h)**2}const b=y===0?1:1-p/y,v=e.map(([E])=>E),D=Math.min(...v),S=Math.max(...v);return{slope:c,intercept:d,rSquared:b,line:[[D,c*D+d],[S,c*S+d]]}}const X2=N.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:o,theme:i,height:l=400,loading:c=!1,onChartClick:d,activeCrossFilter:h},p){const y=cs(),b=N.useMemo(()=>{var L,_,C;const D={size:o==null?void 0:o.size,group:o==null?void 0:o.group},{series:S}=Z3(t,n.field,r.field,D),E=(A,P)=>{if(P.format){if(P.format.includes("$"))return`$${A.toLocaleString()}`;if(P.format.includes("%"))return`${A.toFixed(1)}%`}return A.toLocaleString()},T=[],k=[];S.forEach((A,P)=>{const H=yi(P,S.length===1&&typeof(o==null?void 0:o.color)=="string"?o.color:void 0,i),B=A.symbolSizes;if(T.push({type:"scatter",name:A.name,data:A.data,symbolSize:B?(z,Q)=>B[Q.dataIndex]??10:10,itemStyle:{color:H},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.3)"}}}),o!=null&&o.regression&&A.data.length>=2){const z=A.data.map(q=>[q[0],q[1]]),Q=e4(z);if(Q){T.push({type:"line",name:`${A.name} trend`,data:Q.line,showSymbol:!1,lineStyle:{color:H,type:"dashed",opacity:.6,width:2},itemStyle:{color:H},tooltip:{show:!1},silent:!0});const q=[];if(o.regression.show_equation){const X=Q.intercept>=0?"+":"-";q.push(`y = ${Q.slope.toFixed(2)}x ${X} ${Math.abs(Q.intercept).toFixed(2)}`)}if(o.regression.show_r_squared&&q.push(`R² = ${Q.rSquared.toFixed(3)}`),q.length>0){const X=P*20;k.push({type:"text",left:"70%",top:`${12+X}%`,style:{text:q.join(" "),fill:H,fontSize:11,fontFamily:"monospace"}})}}}});const O=((L=o==null?void 0:o.size)==null?void 0:L.label)??((_=o==null?void 0:o.size)==null?void 0:_.field);return{tooltip:{trigger:"item",formatter:A=>{const P=A,H=P.value[0]??0,B=P.value[1]??0,z=P.value[2];let Q='<div style="padding: 8px;">';return S.length>1&&(Q+=`<div style="font-weight: 600; margin-bottom: 4px;">${P.seriesName}</div>`),Q+=`<div>${P.marker} ${n.label||n.field}: ${E(H,n)}</div>`,Q+=`<div>${P.marker} ${r.label||r.field}: ${E(B,r)}</div>`,O&&z!=null&&(Q+=`<div>${P.marker} ${O}: ${z.toLocaleString()}</div>`),Q+="</div>",Q}},legend:S.length>1?{show:((C=o==null?void 0:o.legend)==null?void 0:C.show)!==!1,top:0,data:S.map(A=>A.name)}:void 0,grid:{left:"3%",right:"4%",bottom:"3%",top:S.length>1?"15%":"10%",containLabel:!0},xAxis:{type:"value",name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:A=>E(A,n)},axisLine:{lineStyle:{color:y.borderColor}},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}},yAxis:{type:"value",name:r.label,nameLocation:"middle",nameGap:50,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:A=>E(A,r)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}},series:T,graphic:k.length>0?k:void 0,animation:!0,animationDuration:300}},[t,n,r,o,i,y]),v=N.useMemo(()=>{if(d)return{click:D=>{var O,I,L,_,C;const S=D;if(S.componentType!=="series")return;const E=(O=S.value)==null?void 0:O[0];if(E==null)return;const T=((L=(I=S.event)==null?void 0:I.event)==null?void 0:L.clientX)??0,k=((C=(_=S.event)==null?void 0:_.event)==null?void 0:C.clientY)??0;d(n.field,String(E),{x:T,y:k},S.seriesName)}}},[d,n.field]);return f.jsx(Wr,{ref:p,option:b,height:l,loading:c,onEvents:v})});function Wh(e,t){if(e.length===0)return 0;switch(t){case"sum":return e.reduce((n,r)=>n+r,0);case"avg":return e.reduce((n,r)=>n+r,0)/e.length;case"min":return e.reduce((n,r)=>n<r?n:r);case"max":return e.reduce((n,r)=>n>r?n:r);case"count":return e.length}}function t4(e,t){return t.map(n=>String(e[n]??"")).join("\0")}function n4(e,t){if(e.length===0)return{columnValues:[],groups:[],grandTotals:{}};const{rows:n,columns:r,values:o}=t,i=n[0],l=n.slice(1),c=[...new Set(e.map(y=>String(y[r]??"")))].sort((y,b)=>y.localeCompare(b,void 0,{numeric:!0})),d=new Map;for(const y of e){const b=String(y[i]??"");d.has(b)||d.set(b,[]),d.get(b).push(y)}const h=[];for(const[y,b]of d){const v=new Map;for(const E of b){const T=l.length>0?t4(E,l):"";v.has(T)||v.set(T,[]),v.get(T).push(E)}const D=[];for(const[,E]of v){const T={};for(const O of l)T[O]=String(E[0][O]??"");const k={};for(const O of o){const I=O.aggregate??"sum";for(const L of c){const _=`${O.field}:${L}`,A=E.filter(P=>String(P[r]??"")===L).map(P=>P[O.field]).filter(P=>typeof P=="number");k[_]=A.length>0?Wh(A,I):null}}D.push({labels:T,values:k})}l.length>0&&D.sort((E,T)=>{const k=E.labels[l[0]]??"",O=T.labels[l[0]]??"";return k.localeCompare(O)});const S={};for(const E of o){const T=E.aggregate??"sum";for(const k of c){const O=`${E.field}:${k}`,I=D.map(L=>L.values[O]).filter(L=>L!==null);I.length>0&&(S[O]=T==="avg"?I.reduce((L,_)=>L+_,0)/I.length:Wh(I,T))}}h.push({key:y,rows:D,subtotals:S})}const p={};for(const y of o){const b=y.aggregate??"sum";for(const v of c){const D=`${y.field}:${v}`,S=h.map(E=>E.subtotals[D]).filter(E=>E!==void 0);S.length>0&&(p[D]=b==="avg"?S.reduce((E,T)=>E+T,0)/S.length:Wh(S,b))}}return{columnValues:c,groups:h,grandTotals:p}}function r4(e,t,n,r="#4CAF50",o=.5){if(e===null||t===n)return"transparent";const i=(e-t)/(n-t);if(i<=0)return"transparent";const l=Math.round(i*o*100)/100,c=r.replace("#",""),d=parseInt(c.substring(0,2),16),h=parseInt(c.substring(2,4),16),p=parseInt(c.substring(4,6),16);return`rgba(${d}, ${h}, ${p}, ${l})`}const s4=50,o4=[25,50,100];function Rl(e,t){return e==null?"-":typeof e=="number"?t!=null&&t.includes("$")?`$${e.toLocaleString()}`:t!=null&&t.includes("%")?`${e.toFixed(1)}%`:e.toLocaleString():String(e)}function a4({data:e,pivotConfig:t,height:n}){var L,_;const[r,o]=N.useState(new Set),i=N.useMemo(()=>n4(e,t),[e,t]),l=t.rows,c=t.values,d=t.subtotals!==!1,h=t.grandTotals!==!1,p=((L=t.heatmap)==null?void 0:L.color)??"#4CAF50",y=((_=t.heatmap)==null?void 0:_.scope)??"column",b=N.useMemo(()=>new Set(c.filter(C=>C.heatmap).map(C=>C.field)),[c]),v=N.useMemo(()=>{if(b.size===0)return new Map;const C=new Map;if(y==="global"){let A=1/0,P=-1/0;for(const H of i.groups)for(const B of H.rows)for(const[z,Q]of Object.entries(B.values)){const q=z.split(":")[0];Q!==null&&b.has(q)&&(Q<A&&(A=Q),Q>P&&(P=Q))}if(A!==1/0){for(const H of c)if(b.has(H.field))for(const B of i.columnValues)C.set(`${H.field}:${B}`,{min:A,max:P})}}else for(const A of c)if(b.has(A.field))for(const P of i.columnValues){const H=`${A.field}:${P}`;let B=1/0,z=-1/0;for(const Q of i.groups)for(const q of Q.rows){const X=q.values[H];X!=null&&(X<B&&(B=X),X>z&&(z=X))}B!==1/0&&C.set(H,{min:B,max:z})}return C},[i,b,y,c]),D=N.useMemo(()=>{const C=new Map;for(const A of c)C.set(A.field,A.format);return C},[c]),S=C=>{o(A=>{const P=new Set(A);return P.has(C)?P.delete(C):P.add(C),P})},E=[];for(const C of i.columnValues)if(c.length===1)E.push({cellKey:`${c[0].field}:${C}`,label:C});else for(const A of c)E.push({cellKey:`${A.field}:${C}`,label:`${C} - ${ca(A.field)}`});const T=l.map(C=>ca(C)).join(" → "),k=l.length>1,O=k?2:1,I=(C,A)=>{const P=C.split(":")[0];if(!b.has(P))return"transparent";const H=v.get(C);return H?r4(A,H.min,H.max,p):"transparent"};return e.length===0?f.jsx("div",{className:"h-full overflow-auto",style:{maxHeight:n},children:f.jsx("div",{className:"text-center py-8",style:{color:"var(--yc-color-text-secondary)"},children:"No data"})}):f.jsx("div",{className:"h-full overflow-auto",style:{maxHeight:n},children:f.jsxs("table",{className:"min-w-full text-sm",style:{borderCollapse:"collapse"},children:[f.jsx("thead",{className:"sticky top-0 z-[2]",style:{background:"var(--yc-color-surface-hover)"},children:f.jsxs("tr",{children:[k?f.jsx("th",{colSpan:2,className:"px-4 py-3 text-left font-medium",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:T}):f.jsx("th",{className:"px-4 py-3 text-left font-medium",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:T}),E.map(C=>f.jsx("th",{className:"px-4 py-3 text-right font-medium",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:C.label},C.cellKey))]})}),f.jsx("tbody",{children:i.groups.map(C=>{const A=r.has(C.key),P=d&&C.rows.length>1;return f.jsxs(N.Fragment,{children:[f.jsxs("tr",{className:"cursor-pointer select-none",style:{background:"var(--yc-color-surface-hover)"},onClick:()=>S(C.key),children:[f.jsxs("td",{colSpan:O,className:"px-4 py-2 font-bold",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:[f.jsx("span",{className:"mr-1 inline-block w-4 text-center",style:{color:"var(--yc-color-text-muted)"},children:A?"▶":"▼"}),C.key]}),E.map(H=>f.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}},H.cellKey))]}),!A&&C.rows.map((H,B)=>f.jsxs("tr",{children:[k?f.jsxs(f.Fragment,{children:[f.jsx("td",{className:"px-4 py-2",style:{borderBottom:"1px solid var(--yc-color-border)"}}),f.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:Object.values(H.labels).join(", ")})]}):f.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"}}),E.map(z=>{const Q=H.values[z.cellKey]??null,q=z.cellKey.split(":")[0];return f.jsx("td",{className:"px-4 py-2 text-right",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)",backgroundColor:I(z.cellKey,Q)},children:Rl(Q,D.get(q))},z.cellKey)})]},B)),!A&&P&&f.jsxs("tr",{style:{background:"var(--yc-color-surface-hover)"},children:[f.jsxs("td",{colSpan:O,className:"px-4 py-2 font-medium italic",style:{color:"var(--yc-color-text-secondary)",borderBottom:"1px solid var(--yc-color-border)"},children:["Totals for ",C.key]}),E.map(H=>{const B=C.subtotals[H.cellKey]??null,z=H.cellKey.split(":")[0];return f.jsx("td",{className:"px-4 py-2 text-right font-medium",style:{color:"var(--yc-color-text)",borderBottom:"1px solid var(--yc-color-border)"},children:Rl(B,D.get(z))},H.cellKey)})]})]},C.key)})}),h&&f.jsx("tfoot",{className:"sticky bottom-0 z-[2]",style:{background:"var(--yc-color-surface-hover)"},children:f.jsxs("tr",{style:{borderTop:"2px solid var(--yc-color-border)"},children:[f.jsx("td",{colSpan:O,className:"px-4 py-3 font-bold",style:{color:"var(--yc-color-text)"},children:"Grand totals"}),E.map(C=>{const A=i.grandTotals[C.cellKey]??null,P=C.cellKey.split(":")[0];return f.jsx("td",{className:"px-4 py-3 text-right font-bold",style:{color:"var(--yc-color-text)"},children:Rl(A,D.get(P))},C.cellKey)})]})})]})})}function B0({data:e,columns:t,chartConfig:n,height:r=400,loading:o=!1,onRowClick:i}){var pe,ye,Ne;const[l,c]=N.useState(((pe=n==null?void 0:n.sort)==null?void 0:pe.field)??null),[d,h]=N.useState(((ye=n==null?void 0:n.sort)==null?void 0:ye.direction)??(n!=null&&n.sort?"asc":null)),[p,y]=N.useState([]),b=N.useRef([]),v=n==null?void 0:n.pagination,D=(v==null?void 0:v.enabled)!==!1&&v!=null,S=(v==null?void 0:v.mode)??"paginated",E=(v==null?void 0:v.page_size)??s4,[T,k]=N.useState(0),[O,I]=N.useState(E),[L,_]=N.useState(E),C=N.useRef(null),A=N.useMemo(()=>{let G;n!=null&&n.columns&&n.columns.length>0?G=n.columns.map(ue=>({field:ue.field,label:ue.label??ca(ue.field),format:ue.format,sticky:ue.sticky??!1,stickyIndex:-1,summary:ue.summary,overflow:ue.overflow,font:ue.font})):G=t.map(ue=>({field:ue.name,label:ca(ue.name),format:void 0,sticky:!1,stickyIndex:-1,summary:void 0}));let Z=0;return G.map(ue=>ue.sticky&&Z<3?{...ue,stickyIndex:Z++}:{...ue,sticky:!1,stickyIndex:-1})},[n==null?void 0:n.columns,t]),P=N.useMemo(()=>A.filter(G=>G.sticky).length,[A]),H=N.useCallback(G=>Z=>{b.current[G]=Z},[]);N.useLayoutEffect(()=>{if(P===0){y([]);return}const G=()=>{var Ce;const ue=[];let me=0;for(let Re=0;Re<P;Re++)ue.push(me),me+=((Ce=b.current[Re])==null?void 0:Ce.offsetWidth)??0;y(ue)};if(G(),typeof ResizeObserver>"u")return;const Z=new ResizeObserver(G);for(let ue=0;ue<P;ue++){const me=b.current[ue];me&&Z.observe(me)}return()=>Z.disconnect()},[P,A,o]);const B=G=>{l===G?d==="asc"?h("desc"):d==="desc"?(c(null),h(null)):h("asc"):(c(G),h("asc"))},z=N.useMemo(()=>!l||!d?e:[...e].sort((G,Z)=>{const ue=G[l],me=Z[l];if(ue==null)return 1;if(me==null)return-1;let Ce=0;return typeof ue=="number"&&typeof me=="number"?Ce=ue-me:Ce=String(ue).localeCompare(String(me)),d==="asc"?Ce:-Ce}),[e,l,d]);N.useEffect(()=>{k(0),_(O)},[e,l,d,O]);const Q=z.length,q=D?Math.ceil(Q/O):1,X=N.useMemo(()=>D?S==="infinite_scroll"?z.slice(0,L):z.slice(T*O,(T+1)*O):z,[z,D,S,T,O,L]);N.useEffect(()=>{if(!D||S!=="infinite_scroll")return;const G=C.current;if(!G||typeof IntersectionObserver>"u")return;const Z=new IntersectionObserver(ue=>{var me;(me=ue[0])!=null&&me.isIntersecting&&L<Q&&_(Ce=>Math.min(Ce+O,Q))},{rootMargin:"100px"});return Z.observe(G),()=>Z.disconnect()},[D,S,L,Q,O]);const ie=N.useMemo(()=>{const G=A.filter(ue=>ue.summary);if(G.length===0)return null;const Z={};for(const ue of G){const me=e.map(Ce=>Ce[ue.field]).filter(Ce=>typeof Ce=="number");if(ue.summary==="count"){Z[ue.field]=e.filter(Ce=>Ce[ue.field]!=null).length;continue}if(me.length===0){Z[ue.field]=null;continue}switch(ue.summary){case"sum":Z[ue.field]=me.reduce((Ce,Re)=>Ce+Re,0);break;case"avg":Z[ue.field]=me.reduce((Ce,Re)=>Ce+Re,0)/me.length;break;case"min":Z[ue.field]=Math.min(...me);break;case"max":Z[ue.field]=Math.max(...me);break}}return Z},[e,A]),ge=((Ne=n==null?void 0:n.summary)==null?void 0:Ne.label)??"Total",te=A.findIndex(G=>!G.summary);if(o)return f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse bg-gray-100 w-full h-full rounded"})});if(n!=null&&n.pivot){const G=typeof r=="number"?`${r}px`:r;return f.jsx(a4,{data:e,pivotConfig:n.pivot,height:G})}const de=typeof r=="number"?`${r}px`:r,M=(G,Z)=>G.sticky?{position:"sticky",left:`${p[G.stickyIndex]??0}px`,zIndex:Z?3:1}:{},V=G=>G.sticky&&G.stickyIndex===P-1?"shadow-[2px_0_4px_rgba(0,0,0,0.08)]":"",ae=D&&S==="paginated"?T*O:0,j=ae+1,le=Math.min(ae+X.length,Q);return f.jsxs("div",{className:"h-full flex flex-col",style:{maxHeight:de},children:[f.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[f.jsxs("table",{className:"min-w-full text-sm yc-table",children:[f.jsx("thead",{className:"sticky top-0 z-[2] bg-gray-50 border-b border-gray-200",children:f.jsxs("tr",{children:[f.jsx("th",{className:"px-3 py-3 text-right font-medium text-gray-400 select-none bg-gray-50 w-10",children:"#"}),A.map((G,Z)=>f.jsx("th",{ref:G.sticky?H(G.stickyIndex):void 0,className:`px-4 py-3 text-left font-medium text-gray-600 cursor-pointer hover:bg-gray-100 select-none bg-gray-50 ${V(G)}`,style:M(G,!0),onClick:()=>B(G.field),children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("span",{children:G.label}),f.jsx("span",{className:`w-4 text-center text-gray-400 ${l===G.field?"visible":"invisible"}`,children:l===G.field&&d==="asc"?"↑":"↓"})]})},G.field))]})}),f.jsx("tbody",{children:X.map((G,Z)=>f.jsxs("tr",{className:`border-b border-gray-100${i?" cursor-pointer hover:bg-black/5 dark:hover:bg-white/5":""}`,onClick:i?ue=>{const me=ue.target.closest("td[data-field]"),Ce=(me==null?void 0:me.getAttribute("data-field"))??void 0;i(G,{x:ue.clientX,y:ue.clientY},Ce)}:void 0,children:[f.jsx("td",{className:"px-3 py-3 text-right yc-row-num bg-white w-10",children:ae+Z+1}),A.map(ue=>{const me=Rl(G[ue.field],ue.format),Ce=G[ue.field],Re=Ce==null?void 0:String(Ce),tt=ue.overflow??"ellipsis",Ge=tt==="wrap"?{whiteSpace:"normal",wordBreak:"break-all"}:tt==="hidden"?{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"clip"}:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"};return f.jsx("td",{"data-field":ue.field,className:`px-4 py-3 text-gray-700 bg-white ${V(ue)}${ue.font==="mono"?" font-mono text-[0.8125rem]":""}`,style:{maxWidth:200,...Ge,...M(ue,!1)},title:tt!=="wrap"?Re:void 0,children:me},ue.field)})]},Z))}),ie&&f.jsx("tfoot",{className:"sticky bottom-0 z-[2]",children:f.jsxs("tr",{className:"border-t-2 border-gray-300 bg-gray-50 font-medium",children:[f.jsx("td",{className:"px-3 py-3 bg-gray-50 w-10"}),A.map((G,Z)=>{const ue=ie[G.field],me=te>=0&&Z===te;return f.jsx("td",{className:`px-4 py-3 text-gray-700 bg-gray-50 ${V(G)}`,style:M(G,!1),children:me?ge:ue!=null?Rl(ue,G.format):""},G.field)})]})})]}),z.length===0&&f.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"}),D&&S==="infinite_scroll"&&L<Q&&f.jsx("div",{ref:C,className:"flex justify-center py-4",children:f.jsx("span",{className:"text-sm text-gray-400",children:"Loading more..."})})]}),D&&S==="paginated"&&Q>0&&f.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t shrink-0",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},"data-testid":"pagination-controls",children:[f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",j,"-",le," of ",Q.toLocaleString()]}),f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsxs("select",{value:O,onChange:G=>{const Z=Number(G.target.value);I(Z),k(0)},className:"text-sm border rounded px-2 py-1",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},"aria-label":"Page size",children:[o4.map(G=>f.jsxs("option",{value:G,children:[G," / page"]},G)),f.jsx("option",{value:Q,children:"All"})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{onClick:()=>k(G=>Math.max(0,G-1)),disabled:T===0,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Previous"}),f.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[T+1," / ",q]}),f.jsx("button",{onClick:()=>k(G=>Math.min(q-1,G+1)),disabled:T>=q-1,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Next"})]})]})]}),D&&S==="infinite_scroll"&&Q>0&&f.jsxs("div",{className:"text-sm px-4 py-2 border-t shrink-0",style:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-input-bg)"},"data-testid":"infinite-scroll-status",children:["Showing ",Math.min(L,Q).toLocaleString()," of ",Q.toLocaleString()]})]})}function i4(e,t){return t!=null&&t.includes("$")?`$${e.toLocaleString()}`:t!=null&&t.includes("%")?`${e.toFixed(1)}%`:e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function l4({data:e,yAxis:t,loading:n=!1,title:r}){if(n)return f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse bg-gray-200 h-16 w-32 rounded"})});if(!e||e.length===0)return f.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"No data"});const o=e[0],i=o==null?void 0:o[t.field],l=typeof i=="number"?i:parseFloat(String(i))||0,c=i4(l,t.format),d=t.label||t.field;return f.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-4",children:[f.jsx("div",{className:"text-4xl font-bold text-gray-900 tabular-nums",children:c}),(r||d)&&f.jsx("div",{className:"text-sm text-gray-500 mt-2 text-center",children:r||d})]})}const J2=N.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:o,height:i=400,loading:l=!1,onChartClick:c,events:d,goalData:h},p){var Q,q,X,ie,ge,te,de;const y=cs(),b=(r==null?void 0:r.series)&&"field"in r.series,v=b?Od(t,n):Ls(t,n),D=n.type==="temporal"?Dd(t,n):v,S=N.useMemo(()=>{if(b){const M=new Set;return t.filter(V=>{const ae=V[n.field];return M.has(ae)?!1:(M.add(ae),!0)}).map(V=>V[n.field])}return t.map(M=>M[n.field])},[t,n.field,b]),E=N.useMemo(()=>{if(c)return{click:M=>{var ye,Ne,G,Z;const V=M;if(V.componentType!=="series")return;const ae=V.dataIndex!=null?S[V.dataIndex]:void 0,j=ae!=null?String(ae):V.name;if(j==null||j==="")return;const le=((Ne=(ye=V.event)==null?void 0:ye.event)==null?void 0:Ne.clientX)??0,pe=((Z=(G=V.event)==null?void 0:G.event)==null?void 0:Z.clientY)??0;c(n.field,j,{x:le,y:pe},V.seriesName)}}},[c,n.field,S]),T=Nd(t,{series:r.series},o),k=(Q=r.axes)==null?void 0:Q.left,O=(q=r.axes)==null?void 0:q.right,I=[];I.push({type:(k==null?void 0:k.scale)==="log"?"log":"value",name:k==null?void 0:k.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:M=>wo(M,k==null?void 0:k.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:y.splitLineColor,type:"dashed"}}}),O&&I.push({type:O.scale==="log"?"log":"value",name:O.label,nameLocation:"middle",nameGap:60,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,formatter:M=>wo(M,O.format)},axisLine:{show:!1},splitLine:{show:!1}});const L=Rs(o),_=T.map(M=>{const V=Ad(M.color,M.gradient??r.gradient),ae=M.chartType??"bar",j={name:M.name,data:M.data,yAxisIndex:M.yAxisIndex??0,itemStyle:{color:V??M.color},...M.opacity!==void 0?{opacity:M.opacity}:{}};return ae==="line"?{...j,type:"line",smooth:L.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:M.color,type:M.style==="dashed"?"dashed":M.style==="dotted"?"dotted":"solid"}}:ae==="area"?{...j,type:"line",smooth:L.smooth,symbol:"none",lineStyle:{width:2,color:M.color},areaStyle:{color:V??M.color}}:{...j,type:"bar",barWidth:"60%",itemStyle:{color:V??M.color,borderRadius:L.barBorderRadius}}}),C=(r==null?void 0:r.goals)??[];if(C.length>0&&Array.isArray(_)){const M=kd(C,v),V=Cd(C);M.length>0&&_[0]&&(_[0].markLine={silent:!0,symbol:"none",data:M}),V.length>0&&_[0]&&(_[0].markArea={silent:!0,data:V});const ae=_d(C,h);for(const j of ae)_.push({type:"line",name:j.name,data:j.data,yAxisIndex:0,z:j.z,showSymbol:j.showSymbol,lineStyle:j.lineStyle,itemStyle:{color:j.color}})}const A=N.useMemo(()=>{if(!(d!=null&&d.length))return[];const V=d.flatMap(pe=>pe.endDate?[pe.date,pe.endDate]:[pe.date]).map(pe=>({[n.field]:pe})),j=Ls([...t,...V],n).slice(t.length);let le=0;return d.map(pe=>{const ye={...pe,date:j[le++]??pe.date};return pe.endDate&&(ye.endDate=j[le++]??pe.endDate),ye})},[d,t,n]),P=Array.isArray(_)?_.map(M=>M.name).filter(Boolean):[],H=wd(A,y.textColor,v),B=Sd(A,y.textColor,v);if((H||B.length>0)&&Array.isArray(_)){const M={type:"line",data:((X=_[0])==null?void 0:X.data)??[],showSymbol:!1,lineStyle:{opacity:0,width:0},silent:!0,legendHoverLink:!1,tooltip:{show:!1}};H&&(M.markLine=H),B.length>0&&(M.markArea={silent:!0,data:B}),_.push(M)}const z={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:M=>{const V=M;if(!Array.isArray(V)||V.length===0)return"";let j=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${D[V[0].dataIndex]??V[0].name}</div>`;for(const le of V){const pe=T.find(Ne=>Ne.name===le.seriesName),ye=(pe==null?void 0:pe.yAxisIndex)===1?O:k;j+=`<div>${le.marker} ${le.seriesName}: ${wo(le.value,ye==null?void 0:ye.format)}</div>`}return j+=Td(A,V[0].name,v),j+="</div>",j}},legend:{show:((ie=r.legend)==null?void 0:ie.show)!==!1,...((ge=r.legend)==null?void 0:ge.position)==="top"?{top:0}:((te=r.legend)==null?void 0:te.position)==="left"?{left:0,orient:"vertical"}:((de=r.legend)==null?void 0:de.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:y.textColor,fontSize:12},...P.length>0?{data:P}:{}},grid:{left:"3%",right:O?"8%":"4%",bottom:"15%",top:"10%",containLabel:!0},xAxis:{type:"category",data:v,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:y.textColor,fontSize:12},axisLabel:{color:y.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:y.borderColor}},axisTick:{show:!1}},yAxis:I,series:_,animation:!0,animationDuration:300};return f.jsx(Wr,{ref:p,option:z,height:i,loading:l,onEvents:E})}),Z2=N.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:o=!1},i){const l=N.useMemo(()=>{var k,O;const c=n.x.field,d=n.y.field,h=n.value.field,p=[...new Set(t.map(I=>String(I[c]??"")))],y=[...new Set(t.map(I=>String(I[d]??"")))],b=[];let v=1/0,D=-1/0;for(const I of t){const L=String(I[c]??""),_=String(I[d]??""),C=Number(I[h]??0),A=p.indexOf(L),P=y.indexOf(_);A>=0&&P>=0&&(b.push([A,P,C]),C<v&&(v=C),C>D&&(D=C))}v===1/0&&(v=0),D===-1/0&&(D=0);const S=((k=n.color_range)==null?void 0:k.min)??"#EBF5FB",E=((O=n.color_range)==null?void 0:O.max)??"#1A5276",T=n.show_values??!0;return{tooltip:{position:"top",formatter:I=>{const L=I,_=p[L.value[0]]??"",C=y[L.value[1]]??"",A=L.value[2],P=n.value.label??h;return`${_}, ${C}<br/>${P}: <b>${A}</b>`}},grid:{left:"3%",right:"8%",bottom:"10%",top:"6%",containLabel:!0},xAxis:{type:"category",data:p,name:n.x.label,splitArea:{show:!0}},yAxis:{type:"category",data:y,name:n.y.label,splitArea:{show:!0}},visualMap:{min:v,max:D,calculable:!0,orient:"horizontal",left:"center",bottom:"0%",inRange:{color:[S,E]}},series:[{type:"heatmap",data:b,label:{show:T},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}},[t,n]);return f.jsx(Wr,{ref:i,option:l,height:r,loading:o})}),ev=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:o=400,loading:i=!1},l){const c=cs(),d=N.useMemo(()=>{var S;const h=n.stage.field,p=n.value.field,y=n.show_conversion??!0,b=t.map(E=>({name:String(E[h]??""),value:Number(E[p]??0)})),v={};for(let E=1;E<b.length;E++){const T=b[E-1],k=b[E];if(T&&k&&T.value>0){const O=(k.value/T.value*100).toFixed(1);v[k.name]=`${O}% of ${T.name}`}}const D=n.color??((S=r==null?void 0:r.palette)==null?void 0:S[0])??"#3B82F6";return{tooltip:{trigger:"item",formatter:E=>{const T=E;let k=`${T.name}: <b>${T.value.toLocaleString()}</b>`;return y&&v[T.name]&&(k+=`<br/><span style="color:${c.textColor}">${v[T.name]}</span>`),k}},series:[{type:"funnel",left:"10%",top:"10%",bottom:"10%",width:"80%",sort:"descending",gap:2,label:{show:!0,position:"inside",formatter:E=>{const T=E;return`${T.name}
106
+ ${T.value.toLocaleString()}`}},itemStyle:{borderColor:c.surfaceColor,borderWidth:1,color:E=>{const k=1-E.dataIndex*.15;return`${D}${Math.round(Math.max(k,.3)*255).toString(16).padStart(2,"0")}`}},data:b}]}},[t,n,r,c]);return f.jsx(Wr,{ref:l,option:d,height:o,loading:i})}),tv=N.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:o=!1},i){const l=cs(),c=N.useMemo(()=>{var O,I,L;const d=n.category.field,h=n.value.field,p=n.total_field,y=((O=n.colors)==null?void 0:O.increase)??"#22C55E",b=((I=n.colors)==null?void 0:I.decrease)??"#EF4444",v=((L=n.colors)==null?void 0:L.total)??"#3B82F6",D=[],S=[],E=[],T=[];let k=0;for(const _ of t){const C=String(_[d]??""),A=Number(_[h]??0),P=p?!!_[p]:!1;D.push(C),P?(S.push(Math.min(0,A)),E.push(Math.abs(A)),T.push(v),k=A):(A>=0?(S.push(k),E.push(A),T.push(y)):(S.push(k+A),E.push(Math.abs(A)),T.push(b)),k+=A)}return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:_=>{var z,Q;const C=_;if(!C[0])return"";const A=C[0].dataIndex,P=Number(((z=t[A])==null?void 0:z[h])??0),B=!(p?!!((Q=t[A])!=null&&Q[p]):!1)&&P>=0?"+":"";return`${C[0].name}<br/><b>${B}${P.toLocaleString()}</b>`}},grid:{left:"3%",right:"4%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:D,axisLabel:{color:l.textColor,rotate:D.length>6?30:0},axisLine:{lineStyle:{color:l.borderColor}}},yAxis:{type:"value",axisLabel:{color:l.textColor},splitLine:{lineStyle:{color:l.splitLineColor,type:"dashed"}}},series:[{type:"bar",stack:"waterfall",data:S,itemStyle:{color:"transparent",borderColor:"transparent"},emphasis:{itemStyle:{color:"transparent",borderColor:"transparent"}},tooltip:{show:!1}},{type:"bar",stack:"waterfall",data:E.map((_,C)=>({value:_,itemStyle:{color:T[C]}})),label:{show:!0,position:"top",formatter:_=>{var B,z;const C=_,A=Number(((B=t[C.dataIndex])==null?void 0:B[h])??0);return(p?!!((z=t[C.dataIndex])!=null&&z[p]):!1)?A.toLocaleString():`${A>=0?"+":""}${A.toLocaleString()}`}}}]}},[t,n,l]);return f.jsx(Wr,{ref:i,option:c,height:r,loading:o})}),nv=N.forwardRef(function({data:t,chartConfig:n,theme:r,height:o=400,loading:i=!1},l){const c=cs(),d=N.useMemo(()=>{var k;const h=n.value.field,p=n.min??0,y=n.max??100,b=n.format??"",v=t[0]?Number(t[0][h]??0):0,D=Math.min(Math.max(v,p),y);let S;if(n.thresholds&&n.thresholds.length>0){const O=y-p||1;S=n.thresholds.map(I=>[(I.value-p)/O,I.color])}else S=[[1,((k=r==null?void 0:r.palette)==null?void 0:k[0])??"#3B82F6"]];const T=[{type:"gauge",min:p,max:y,progress:{show:!0,width:18},axisLine:{lineStyle:{width:18,color:S}},axisTick:{show:!1},splitLine:{length:10,lineStyle:{width:2,color:c.textColor}},axisLabel:{distance:25,color:c.textColor,fontSize:12},pointer:{itemStyle:{color:"auto"}},anchor:{show:!0,showAbove:!0,size:20,itemStyle:{borderWidth:8}},title:{show:!1},detail:{valueAnimation:!0,fontSize:28,offsetCenter:[0,"70%"],formatter:`{value}${b}`},data:[{value:D}]}];if(n.goal){const O=Math.min(Math.max(n.goal.value,p),y);T.push({type:"gauge",min:p,max:y,pointer:{show:!0,length:"60%",width:4,itemStyle:{color:n.goal.color??"#22c55e"}},progress:{show:!1},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{show:!!n.goal.label,offsetCenter:[0,"90%"],fontSize:12,color:c.textColor},detail:{show:!1},data:[{value:O,name:n.goal.label??"Goal"}]})}return{series:T}},[t,n,r,c]);return f.jsx(Wr,{ref:l,option:d,height:o,loading:i})});function rv({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:o,isRefreshing:i=!1,hideImageExport:l=!1}){const[c,d]=N.useState(!1),h=N.useRef(null);return N.useEffect(()=>{const p=y=>{h.current&&!h.current.contains(y.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),f.jsxs("div",{className:"relative",ref:h,children:[f.jsx("button",{onClick:()=>d(!c),className:"p-1.5 hover:bg-black/5 rounded transition-colors",style:{color:"var(--yc-color-text-muted)"},title:"Chart actions",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})}),c&&f.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsxs("button",{onClick:()=>{e(),d(!1)},disabled:i,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2 disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:`w-4 h-4 ${i?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),f.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border)"}}),f.jsxs("button",{onClick:()=>{t(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export CSV"]}),!l&&f.jsxs(f.Fragment,{children:[f.jsxs("button",{onClick:()=>{n(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),f.jsxs("button",{onClick:()=>{r(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Export SVG"]}),o&&f.jsxs("button",{onClick:()=>{o(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]})]})}var lu=dd();function H0(e){const t=e.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2}):(\d{2})/);if(!t)return e;const[,n,r,o,i]=t;if(r==="00"&&o==="00"&&i==="00")return n;const l=parseInt(r,10),c=l>=12?"PM":"AM",d=l%12||12,h=i==="00"?`${d}:${o} ${c}`:`${d}:${o}:${i} ${c}`;return`${n} ${h}`}function sv({x:e,y:t,field:n,value:r,allFields:o,onFilter:i,onViewDetails:l,onGoToChart:c,onAddEvent:d,detailModel:h,targetChart:p,isTemporalChart:y,onClose:b}){const v=N.useRef(null);N.useEffect(()=>{const C=P=>{v.current&&!v.current.contains(P.target)&&b()},A=P=>{P.key==="Escape"&&b()};return document.addEventListener("mousedown",C),document.addEventListener("keydown",A),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",A)}},[b]);const D=o?Object.entries(o).map(([C,A])=>`${C} = ${H0(A)}`).join(", "):`${n} = ${H0(r)}`;let S=0;i&&S++,h&&S++,p&&S++,d&&y&&S++;const E=280,T=S*36+8,k=Math.min(e,window.innerWidth-E-8),O=Math.min(t,window.innerHeight-T-8),I=()=>{i==null||i(),b()},L=()=>{l==null||l(),b()},_=()=>{c==null||c(),b()};return lu.createPortal(f.jsxs("div",{ref:v,className:"fixed z-[9999] rounded-lg shadow-lg py-1 min-w-[200px]",style:{left:k,top:O,maxWidth:E,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[i&&f.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:I,children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})}),f.jsxs("span",{className:"truncate",children:["Filter: ",D]})]}),h&&f.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:L,children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M12 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"})}),f.jsx("span",{children:"View details"})]}),p&&f.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:_,children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})}),f.jsxs("span",{children:["Go to ",p]})]}),d&&y&&f.jsxs(f.Fragment,{children:[(i||h||p)&&f.jsx("div",{className:"my-1 border-t",style:{borderColor:"var(--yc-color-border)"}}),f.jsxs("button",{className:"w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-black/5 dark:hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-text)"},onClick:()=>{d(),b()},children:[f.jsx("svg",{className:"w-4 h-4 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),f.jsx("span",{children:"Add event"})]})]})]}),document.body)}function ov({date:e,onSave:t,onClose:n,saving:r=!1,themePalette:o}){const[i,l]=N.useState(""),[c,d]=N.useState(e),[h,p]=N.useState(""),[y,b]=N.useState(!1),[v,D]=N.useState(""),S=N.useRef(null);N.useEffect(()=>{var T;(T=S.current)==null||T.focus()},[]),N.useEffect(()=>{function T(k){k.key==="Escape"&&n()}return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[n]);function E(T){T.preventDefault(),i.trim()&&t({date:c,label:i.trim(),color:h,...y&&v?{endDate:v}:{}})}return lu.createPortal(f.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center",children:[f.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:n}),f.jsxs("form",{onSubmit:E,className:"relative rounded-lg shadow-xl p-5 w-80",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("h3",{className:"text-sm font-semibold mb-3",style:{color:"var(--yc-color-text)"},children:"Add event"}),f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:y?"Start date":"Date"}),f.jsx("input",{type:"text",value:c,onChange:T=>d(T.target.value),className:"w-full px-2 py-1.5 text-sm rounded border mb-3",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:"Multi-day"}),f.jsx("button",{type:"button",onClick:()=>{b(!y),y&&D("")},className:"relative w-10 h-5 rounded-full transition-colors flex-shrink-0",style:{backgroundColor:y?"var(--yc-color-primary, #3b82f6)":"var(--yc-color-border)"},children:f.jsx("span",{className:"absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform",style:{left:y?22:2}})})]}),y&&f.jsxs(f.Fragment,{children:[f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"End date"}),f.jsx("input",{type:"text",value:v,onChange:T=>D(T.target.value),placeholder:"YYYY-MM-DD",className:"w-full px-2 py-1.5 text-sm rounded border mb-3",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}})]}),f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Label"}),f.jsx("input",{ref:S,type:"text",value:i,onChange:T=>l(T.target.value),placeholder:"Event label",className:"w-full px-2 py-1.5 text-sm rounded border mb-3",style:{backgroundColor:"var(--yc-color-background)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text)"}}),f.jsx("label",{className:"block text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Color (optional)"}),f.jsx("div",{className:"mb-4",children:f.jsx(F0,{value:h,onChange:p,themePalette:o})}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-sm rounded",style:{color:"var(--yc-color-text-muted)"},children:"Cancel"}),f.jsx("button",{type:"submit",disabled:!i.trim()||r,className:"px-3 py-1.5 text-sm rounded text-white disabled:opacity-50",style:{backgroundColor:"var(--yc-color-primary, #3b82f6)"},children:r?"Saving...":"Save"})]})]})]}),document.body)}const u4={connection_error:{title:"Database connection failed",hint:"Check your connection configuration"},timeout:{title:"Query timed out",hint:"Try adding filters or optimizing your SQL"},not_found:{title:"Not found",hint:"Check that the chart and model exist"},validation_error:{title:"Configuration error",hint:"Check your chart YAML configuration"}};function rd({isLoading:e,error:t,data:n,hasActiveFilters:r,onRetry:o,children:i}){if(t){const l=t.errorType?u4[t.errorType]:void 0;return f.jsx("div",{className:"h-full flex items-center justify-center p-6",children:f.jsxs("div",{className:"text-center max-w-sm",children:[f.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full flex items-center justify-center",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-danger)"},children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),f.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:(l==null?void 0:l.title)??"Failed to load chart"}),f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:t.message}),(l==null?void 0:l.hint)&&f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:l.hint}),o&&f.jsx("button",{onClick:o,className:"mt-3 px-3 py-1.5 text-xs font-medium rounded transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)"},"aria-label":"Retry",children:"Retry"})]})})}return e&&!n?f.jsx("div",{className:"h-full animate-pulse rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}}):n&&n.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-6",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full flex items-center justify-center",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-text-muted)"},children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),f.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No data matches your filters"}),r&&f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Try adjusting your filters"})]})}):f.jsx(f.Fragment,{children:i})}const c4={day:{label:"Date",format:"%b %d, %Y"},week:{label:"Week Starting",format:"%b %d"},month:{label:"Month",format:"%b '%y"},quarter:{label:"Quarter",format:"quarter"},year:{label:"Year",format:"%Y"}};function Yh(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function d4(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function f4({chartName:e,drillParams:t}){var me,Ce,Re,tt,Ge,nt,we,je,oe;const n=N.useMemo(()=>{if(!t)return;const re=Object.fromEntries(Object.entries(t).filter(([xe])=>!xe.startsWith("_")));return Object.keys(re).length>0?re:void 0},[t]),{data:r,isLoading:o}=jx(e),{data:i,isLoading:l,error:c}=e2(e,n),{data:d}=ma(),h=Tm(),p=Je(re=>re.getEffectiveFilters),y=N.useRef(null),{events:b,allEvents:v}=r2(e),D=So(re=>re.auth),S=Wn(),[E,T]=N.useState(null),k=D.status==="disabled"||D.status==="authenticated"&&(D.user.role==="admin"||D.user.role==="editor"),O=((Ce=(me=r==null?void 0:r.chart)==null?void 0:me.x)==null?void 0:Ce.type)==="temporal",I=Ka({mutationFn:re=>xt.createChartEvent({date:re.date,label:re.label,...re.color?{color:re.color}:{},...re.endDate?{endDate:re.endDate}:{}}),onSuccess:()=>{S.invalidateQueries({queryKey:["chartEvents"]}),T(null)}}),[L,_]=N.useState("chart"),[C,A]=N.useState(!1),[P,H]=N.useState(!1),[B,z]=N.useState(()=>{const re=localStorage.getItem(`yamchart-events-visible-${e}`);return re===null?!0:re==="1"});function Q(){z(re=>{const xe=!re;return localStorage.setItem(`yamchart-events-visible-${e}`,xe?"1":"0"),xe})}const q=(()=>{try{const re=sessionStorage.getItem("yamchart-last-dashboard");if(re)return JSON.parse(re)}catch{}return null})(),X=t==null?void 0:t._from,ie=!!n&&Object.keys(n).length>0,ge=n?Object.entries(n).map(([re,xe])=>`${re}: ${xe}`).join(", "):"",de=p(e).granularity,M=de?c4[de]:void 0,[V,ae]=N.useState(null),j=N.useCallback((re,xe,Oe,qe)=>{var yt;let pt;if(qe&&((yt=r==null?void 0:r.chart)!=null&&yt.series)&&"field"in r.chart.series){const ce=r.chart.series.field;ce&&ce!==re&&(pt={[re]:xe,[ce]:qe})}ae({x:Oe.x,y:Oe.y,field:re,value:xe,allFields:pt})},[r]),le=N.useCallback(()=>{V&&T(V.value)},[V]),pe=N.useCallback(()=>{var qe,pt;if(!V||!((qe=r==null?void 0:r.drillDown)!=null&&qe.model))return;const re=r.drillDown,xe=re.fields?typeof re.fields=="string"?re.fields:re.fields[0]:re.field??((pt=r.chart.x)==null?void 0:pt.field)??V.field,Oe=new URLSearchParams;if(V.allFields)for(const[yt,ce]of Object.entries(V.allFields))Oe.set(yt,ce);else Oe.set(xe,V.value);Oe.set("_from",e),window.location.hash=`/charts/${e}/detail?${Oe.toString()}`,ae(null)},[V,r,e]),ye=N.useCallback(()=>{var qe,pt;if(!V||!((qe=r==null?void 0:r.drillDown)!=null&&qe.chart))return;const re=r.drillDown,xe=re.fields?typeof re.fields=="string"?re.fields:re.fields[0]:re.field??((pt=r.chart.x)==null?void 0:pt.field)??V.field,Oe=new URLSearchParams;if(V.allFields)for(const[yt,ce]of Object.entries(V.allFields))Oe.set(yt,ce);else Oe.set(xe,V.value);Oe.set("_from",e),window.location.hash=`/charts/${r.drillDown.chart}?${Oe.toString()}`,ae(null)},[V,r,e]),Ne=()=>{!i||!r||Ed(i.rows,i.columns,r.name||e)},G=()=>{var xe;const re=(xe=y.current)==null?void 0:xe.getDataURL("png");re&&r&&Zc(re,`${r.name||e}.png`)};if(o)return f.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Loading chart..."});if(!r)return f.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:["Chart not found: ",e]});const Z=M?{...r.chart.x,label:M.label,format:M.format}:r.chart.x,ue=()=>{var re,xe;if(!i)return f.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(L==="table"&&i)return f.jsx(B0,{data:i.rows,columns:i.columns,height:"100%",loading:l});switch(r.chart.type){case"line":return r.chart.x&&(r.chart.y||r.chart.series)?f.jsx(q2,{ref:y,data:i.rows,columns:i.columns,xAxis:Z,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:B?b:[]}):null;case"bar":return r.chart.x&&(r.chart.y||r.chart.series)?f.jsx(V2,{ref:y,data:i.rows,xAxis:Z,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:B?b:[]}):null;case"area":return r.chart.x&&(r.chart.y||r.chart.series)?f.jsx(Q2,{ref:y,data:i.rows,xAxis:Z,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:B?b:[]}):null;case"pie":return r.chart.x&&r.chart.y?f.jsx(G2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j}):null;case"donut":return r.chart.x&&r.chart.y?f.jsx(K2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,centerValue:r.chart.centerValue,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j}):null;case"scatter":return r.chart.x&&r.chart.y?f.jsx(X2,{ref:y,data:i.rows,xAxis:r.chart.x,yAxis:r.chart.y,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j}):null;case"combo":return r.chart.x?f.jsx(J2,{ref:y,data:i.rows,xAxis:Z,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l,onChartClick:j,events:B?b:[]}):null;case"heatmap":return f.jsx(Z2,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"funnel":return f.jsx(ev,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"waterfall":return f.jsx(tv,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"gauge":return f.jsx(nv,{ref:y,data:i.rows,chartConfig:r.chart,theme:d==null?void 0:d.theme,height:"100%",loading:l});case"table":return f.jsx(B0,{data:i.rows,columns:i.columns,chartConfig:r.chart,height:"100%",loading:l,onRowClick:r.drillDown?(Oe,qe,pt)=>{const yt=r.drillDown,ce=yt.fields?typeof yt.fields=="string"?[yt.fields]:yt.fields:yt.field?[yt.field]:[];if(ce.length===0)return;const be={};for(const Le of ce)Le in Oe?be[Le]=String(Oe[Le]??""):pt?be[Le]=pt:be[Le]="";ae({x:qe.x,y:qe.y,field:ce[0],value:be[ce[0]],allFields:ce.length>1?be:void 0})}:void 0});case"kpi":{const Oe=r.chart;if(!((re=Oe.value)!=null&&re.field)||!i.rows[0])return f.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"No data available"});const qe=i.rows[0],pt=qe[Oe.value.field],yt=Yh(pt,Oe.format);let ce=null,be="percent_change",Le,rt,ot;if(i.comparison)ce=i.comparison.change,be=i.comparison.changeType,Le=i.comparison.currentPeriodLabel,rt=i.comparison.previousPeriodLabel,ot=Yh(i.comparison.previousValue,Oe.format);else if((xe=Oe.comparison)!=null&&xe.enabled&&Oe.comparison.field){const gt=qe[Oe.comparison.field];be=Oe.comparison.type,gt&&gt!==0&&(ce=be==="percent_change"?(pt-gt)/gt*100:pt-gt,ot=Yh(gt,Oe.format))}return f.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[f.jsxs("div",{className:"text-6xl font-bold tabular-nums",style:{color:"var(--yc-color-text)"},children:[yt,Oe.unit&&f.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:Oe.unit})]}),Le&&f.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-secondary)"},children:Le}),ce!==null&&f.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[f.jsx("span",{className:"text-sm font-medium px-2 py-0.5 rounded",style:ce>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:d4(ce,be)}),ot&&f.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["vs ",ot]}),rt&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",rt,")"]})]})]})}default:return f.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',r.chart.type,'" not yet implemented']})}};return f.jsx(Am,{fallback:(re,xe)=>f.jsx("div",{className:"flex items-center justify-center h-full p-8",children:f.jsxs("div",{className:"text-center",children:[f.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:re.message}),f.jsx("button",{onClick:xe,className:"mt-2 text-xs hover:opacity-80",style:{color:"var(--yc-color-primary)"},children:"Retry"})]})}),resetKey:e,children:f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs("div",{className:"px-6 pt-4 pb-3 space-y-3",children:[!X&&q&&f.jsxs("div",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),f.jsx("a",{href:`#/dashboards/${q.name}`,className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:q.title})]}),X&&f.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("button",{onClick:()=>{window.location.hash=`/charts/${X}`},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:X}),f.jsx("span",{children:"/"}),f.jsx("span",{style:{color:"var(--yc-color-text)"},className:"font-medium",children:r.title}),ge&&f.jsxs("span",{children:["(",ge,")"]})]}),f.jsxs("div",{className:"flex items-start justify-between gap-4",children:[f.jsxs("div",{children:[f.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:r.title}),r.description&&f.jsx("p",{className:"text-sm mt-1",style:{color:"var(--yc-color-text-secondary)"},children:r.description})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx("button",{onClick:()=>h(e),className:"p-2 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),f.jsx(T3,{resourceType:"chart",resourceName:e})]})]}),r.parameters.length>0&&f.jsx(P2,{parameters:r.parameters,chartName:e}),ie&&f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx("span",{className:"text-xs font-medium",style:{color:"var(--yc-color-text-secondary)"},children:"Filtered:"}),Object.entries(n).map(([re,xe])=>f.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"},children:[re,": ",xe]},re))]})]}),f.jsx("div",{className:"flex-1 min-h-0 px-6",children:f.jsx("div",{className:"h-full rounded-lg overflow-hidden",style:{background:"var(--yc-color-surface)",border:"var(--yc-card-border)",boxShadow:"var(--yc-shadow)",borderRadius:"var(--yc-radius)"},children:f.jsx(rd,{isLoading:l,error:c,data:i==null?void 0:i.rows,onRetry:()=>h(e),children:ue()})})}),f.jsx("div",{className:"px-6 pb-2",children:f.jsx(w3,{rowCount:i==null?void 0:i.meta.rowCount,durationMs:i==null?void 0:i.meta.durationMs,cached:i==null?void 0:i.meta.cached,view:L,onToggleView:_,onExportCSV:Ne,onExportPNG:G,onShowSql:()=>A(!C),onShowEvents:O?()=>H(!P):void 0,eventCount:O?b.length:void 0})}),ie&&i&&f.jsx("div",{className:"px-6 pb-4",children:f.jsx(B2,{data:i.rows,columns:i.columns,drillDownColumns:(Re=r.drillDown)==null?void 0:Re.columns,filterDisplay:ge,chartName:e})}),V&&f.jsx(sv,{x:V.x,y:V.y,field:V.field,value:V.value,allFields:V.allFields,onViewDetails:(tt=r.drillDown)!=null&&tt.model?pe:void 0,onGoToChart:(Ge=r.drillDown)!=null&&Ge.chart?ye:void 0,onAddEvent:k?le:void 0,detailModel:(nt=r.drillDown)==null?void 0:nt.model,targetChart:(we=r.drillDown)==null?void 0:we.chart,isTemporalChart:O,onClose:()=>ae(null)}),E&&f.jsx(ov,{date:E,onSave:re=>I.mutate(re),onClose:()=>T(null),saving:I.isPending,themePalette:(je=d==null?void 0:d.theme)==null?void 0:je.palette}),f.jsx(N3,{isOpen:C,onClose:()=>A(!1),compiledSql:i==null?void 0:i.meta.compiledSql,modelName:e,durationMs:i==null?void 0:i.meta.durationMs,rowCount:i==null?void 0:i.meta.rowCount,cached:i==null?void 0:i.meta.cached}),f.jsx(A3,{isOpen:P,onClose:()=>H(!1),events:b,allEvents:v,chartName:e,canEdit:k,eventsVisible:B,onToggleVisible:Q,themePalette:(oe=d==null?void 0:d.theme)==null?void 0:oe.palette})]})})}function h4({chartName:e,params:t}){var d;const n=Object.fromEntries(Object.entries(t).filter(([h])=>!h.startsWith("_"))),{data:r}=hr({queryKey:["chart",e],queryFn:()=>xt.getChart(e)}),{data:o,isLoading:i,error:l}=hr({queryKey:["chartDetail",e,n],queryFn:()=>xt.queryChartDetail(e,n),enabled:!!e}),c=Object.entries(n).map(([h,p])=>`${h}: ${p}`).join(", ");return i?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading details..."})}):l||!o?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load details: ",(l==null?void 0:l.message)||"Unknown error"]})}):f.jsxs("div",{className:"p-6",children:[f.jsxs("div",{className:"flex items-center gap-2 text-sm mb-4",children:[f.jsx("button",{onClick:()=>{window.history.back()},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:"← Back"}),f.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"/"}),f.jsxs("span",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:[(r==null?void 0:r.title)??e," — Detail"]})]}),Object.keys(n).length>0&&f.jsx("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:Object.entries(n).map(([h,p])=>f.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 text-xs rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[h,": ",p]},h))}),f.jsx(B2,{data:o.rows,columns:o.columns,drillDownColumns:(d=r==null?void 0:r.drillDown)==null?void 0:d.columns,filterDisplay:c,chartName:e})]})}function m4(e=50){const t=[],n=[];return{push(r){t.push(r),t.length>e&&t.shift(),n.length=0},undo(){if(t.length===0)return null;const r=t.pop();return n.push(r),r},redo(){if(n.length===0)return null;const r=n.pop();return t.push(r),r},canUndo(){return t.length>0},canRedo(){return n.length>0},clear(){t.length=0,n.length=0}}}const av=N.createContext(null);function p4({children:e}){const[t,n]=N.useState(!1),[r,o]=N.useState(null),[i,l]=N.useState(null),[c,d]=N.useState(null),h=N.useRef(m4()),[p,y]=N.useState(!1),[b,v]=N.useState(!1),D=r!==null,S=N.useMemo(()=>r||i,[r,i]),E=N.useCallback(C=>{l(C)},[]),T=N.useCallback(C=>{if(C===null){o(null);return}const A=r||i;A&&h.current.push(A),o(C),y(h.current.canUndo()),v(h.current.canRedo())},[r,i]),k=N.useCallback(()=>{const C=h.current.undo();C&&(o(C),y(h.current.canUndo()),v(h.current.canRedo()))},[]),O=N.useCallback(()=>{const C=h.current.redo();C&&(o(C),y(h.current.canUndo()),v(h.current.canRedo()))},[]);N.useEffect(()=>{h.current.clear(),y(!1),v(!1),d(null)},[t]),N.useEffect(()=>{if(!t)return;const C=A=>{const P=A.metaKey||A.ctrlKey;P&&A.key==="z"&&!A.shiftKey&&(A.preventDefault(),k()),P&&A.key==="z"&&A.shiftKey&&(A.preventDefault(),O())};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,k,O]);const I=N.useCallback(C=>{var q;const A=r||i;if(!A)return;const H=C.type==="chart"&&((q=C.ref)==null?void 0:q.toLowerCase().includes("kpi"))?3:6,z={height:100,widgets:[{...C,cols:H}]},Q={...A,rows:[...A.rows,z]};T(Q)},[r,i,T]),L=N.useCallback((C,A)=>{const P=r||i;if(!P)return;const H=P.rows.map((z,Q)=>{if(Q!==C)return z;const q=z.widgets.filter((X,ie)=>ie!==A);return{...z,widgets:q}}).filter(z=>z.widgets.length>0),B={...P,rows:H};T(B)},[r,i,T]),_=N.useCallback((C,A,P)=>{const H=r||i;if(!H)return;const B=H.rows.map((Q,q)=>{if(q!==C)return Q;const X=Q.widgets.map((ie,ge)=>ge!==A?ie:{...ie,...P});return{...Q,widgets:X}}),z={...H,rows:B};T(z)},[r,i,T]);return f.jsx(av.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:T,hasChanges:D,originalLayout:i,setOriginalLayout:E,currentLayout:S,addWidget:I,removeWidget:L,updateWidget:_,pendingFilters:c,setPendingFilters:d,undo:k,redo:O,canUndo:p,canRedo:b},children:e})}function ki(){const e=N.useContext(av);if(!e)throw new Error("useEditMode must be used within EditModeProvider");return e}function Ci(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function gi(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function yl(e,t,n,r,o,i,l){const{margin:c,containerPadding:d,rowHeight:h}=e,p=Ci(e);let y,b,v,D;if(l?(y=Math.round(l.width),b=Math.round(l.height)):(y=gi(r,p,c[0]),b=gi(o,h,c[1])),i?(v=Math.round(i.top),D=Math.round(i.left)):l?(v=Math.round(l.top),D=Math.round(l.left)):(v=Math.round((h+c[1])*n+d[1]),D=Math.round((p+c[0])*t+d[0])),!i&&!l){if(Number.isFinite(r)){const E=Math.round((p+c[0])*(t+r)+d[0])-D-y;E!==c[0]&&(y+=E-c[0])}if(Number.isFinite(o)){const E=Math.round((h+c[1])*(n+o)+d[1])-v-b;E!==c[1]&&(b+=E-c[1])}}return{top:v,left:D,width:y,height:b}}function y4(e,t,n,r,o){const{margin:i,containerPadding:l,cols:c,rowHeight:d,maxRows:h}=e,p=Ci(e);let y=Math.round((n-l[0])/(p+i[0])),b=Math.round((t-l[1])/(d+i[1]));return y=sd(y,0,c-r),b=sd(b,0,h-o),{x:y,y:b}}function Dc(e,t,n){const{margin:r,containerPadding:o,rowHeight:i}=e,l=Ci(e),c=Math.round((n-o[0])/(l+r[0])),d=Math.round((t-o[1])/(i+r[1]));return{x:c,y:d}}function g4(e,t,n){const{margin:r,rowHeight:o}=e,i=Ci(e),l=Math.max(1,Math.round((t+r[0])/(i+r[0]))),c=Math.max(1,Math.round((n+r[1])/(o+r[1])));return{w:l,h:c}}function sd(e,t,n){return Math.max(Math.min(e,n),t)}function Mm(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function sa(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&Mm(r,t))return r}}function iv(e,t){return e.filter(n=>Mm(n,t))}function b4(e,t){return t==="horizontal"?lv(e):t==="vertical"||t==="wrap"?U0(e):[...e]}function U0(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function lv(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function Id(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const o=r.y+r.h;o>t&&(t=o)}}return t}function Wo(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function Md(e){return e.filter(t=>t.static===!0)}function da(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ko(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=da(r))}return t}function x4(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const o=e[r];o!==void 0&&(t.i===o.i?n[r]=t:n[r]=o)}return n}function v4(e,t,n){let r=Wo(e,t);return r?(r=n(da(r)),[x4(e,r),r]):[[...e],null]}function Lm(e,t){const n=Md(e);for(let r=0;r<e.length;r++){const o=e[r];if(o!==void 0)if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;sa(n,o);)o.y++}return e}function Vo(e,t,n,r,o,i,l,c,d){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===r&&t.x===n)return[...e];const h=t.x,p=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let y=b4(e,l);(l==="vertical"&&typeof r=="number"?p>=r:l==="horizontal"&&typeof n=="number"?h>=n:!1)&&(y=y.reverse());const v=iv(y,t),D=v.length>0;if(D&&d)return ko(e);if(D&&i)return t.x=h,t.y=p,t.moved=!1,e;let S=[...e];for(let E=0;E<v.length;E++){const T=v[E];T!==void 0&&(T.moved||(T.static?S=D1(S,T,t,o,l):S=D1(S,t,T,o,l)))}return S}function D1(e,t,n,r,o,i){const l=o==="horizontal",c=o==="vertical",d=t.static;if(r){r=!1;const y={x:l?Math.max(t.x-n.w,0):n.x,y:c?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},b=sa(e,y),v=b!==void 0&&b.y+b.h>t.y,D=b!==void 0&&t.x+t.w>b.x;if(!b)return Vo(e,n,l?y.x:void 0,c?y.y:void 0,r,d,o);if(v&&c)return Vo(e,n,void 0,n.y+1,r,d,o);if(v&&o===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(D&&l)return Vo(e,t,n.x,void 0,r,d,o)}const h=l?n.x+1:void 0,p=c?n.y+1:void 0;return h===void 0&&p===void 0?[...e]:Vo(e,n,h,p,r,d,o)}function vo(e,t,n){return Math.max(t,Math.min(n,e))}var E4={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:o}){return{x:vo(t,0,Math.max(0,r-e.w)),y:vo(n,0,Math.max(0,o-e.h))}},constrainSize(e,t,n,r,{cols:o,maxRows:i}){const l=r==="w"||r==="nw"||r==="sw"?e.x+e.w:o-e.x,c=r==="n"||r==="nw"||r==="ne"?e.y+e.h:i-e.y;return{w:vo(t,1,Math.max(1,l)),h:vo(n,1,Math.max(1,c))}}},T4={name:"minMaxSize",constrainSize(e,t,n){return{w:vo(t,e.minW??1,e.maxW??1/0),h:vo(n,e.minH??1,e.maxH??1/0)}}},w4={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:o,containerHeight:i,rowHeight:l,margin:c}){const d=i>0?Math.floor((i+c[1])/(l+c[1])):o;return{x:vo(t,0,Math.max(0,r-e.w)),y:vo(n,0,Math.max(0,d-e.h))}}},od=[E4,T4];function Oc(e,t,n,r,o){let i={x:n,y:r};for(const l of e)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,o));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,o));return i}function S4(e,t,n,r,o,i){let l={w:n,h:r};for(const c of e)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,o,i));if(t.constraints)for(const c of t.constraints)c.constrainSize&&(l=c.constrainSize(t,l.w,l.h,o,i));return l}function Rm({top:e,left:t,width:n,height:r}){const o=`translate(${t}px,${e}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${n}px`,height:`${r}px`,position:"absolute"}}function uv({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function O1(e){return e*100+"%"}function k4(e,t,n,r){return e+n>r?t:n}function cv(e,t,n){return e<0?t:n}function C4(e){return Math.max(0,e)}function ad(e){return Math.max(0,e)}var Pm=(e,t,n)=>{const{left:r,height:o,width:i}=t,l=e.top-(o-e.height);return{left:r,width:i,height:cv(l,e.height,o),top:ad(l)}},jm=(e,t,n)=>{const{top:r,left:o,height:i,width:l}=t;return{top:r,height:i,width:k4(e.left,e.width,l,n),left:C4(o)}},Fm=(e,t,n)=>{const{top:r,height:o,width:i}=t,l=e.left+e.width-i;return l<0?{height:o,width:e.left+e.width,top:ad(r),left:0}:{height:o,width:i,top:ad(r),left:l}},Bm=(e,t,n)=>{const{top:r,left:o,height:i,width:l}=t;return{width:l,left:o,height:cv(r,e.height,i),top:ad(r)}},_4=(e,t,n)=>Pm(e,jm(e,t,n)),N4=(e,t,n)=>Pm(e,Fm(e,t)),D4=(e,t,n)=>Bm(e,jm(e,t,n)),O4=(e,t,n)=>Bm(e,Fm(e,t)),A4={n:Pm,ne:_4,e:jm,se:D4,s:Bm,sw:O4,w:Fm,nw:N4};function I4(e,t,n,r){const o=A4[e];return o?o(t,{...t,...n},r):n}var Hm={type:"transform",scale:1,calcStyle(e){return Rm(e)}},dv={type:"absolute",scale:1,calcStyle(e){return uv(e)}};function fv(e){return{type:"transform",scale:e,calcStyle(t){return Rm(t)},calcDragPosition(t,n,r,o){return{left:(t-r)/e,top:(n-o)/e}}}}var M4=Hm,L4={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},R4={enabled:!0,bounded:!1,threshold:3},P4={enabled:!0,handles:["se"]},j4={enabled:!1,defaultItem:{w:1,h:1}};function Um(e,t,n,r,o){const i=r==="x"?"w":"h";t[r]+=1;const l=e.findIndex(d=>d.i===t.i),c=o??Md(e).length>0;for(let d=l+1;d<e.length;d++){const h=e[d];if(h!==void 0&&!h.static){if(!c&&h.y>t.y+t.h)break;Mm(t,h)&&Um(e,h,n+t[i],r,c)}}t[r]=n}function F4(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!sa(e,t);)t.y--;let o;for(;(o=sa(e,t))!==void 0;)Um(n,t,o.y+o.h,"y");return t.y=Math.max(t.y,0),t}function B4(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!sa(e,t);)t.x--;let o;for(;(o=sa(e,t))!==void 0;)if(Um(r,t,o.x+o.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!sa(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var hv={type:"vertical",allowOverlap:!1,compact(e,t){const n=Md(e);let r=Id(n);const o=U0(e),i=new Array(e.length);for(let l=0;l<o.length;l++){const c=o[l];if(c===void 0)continue;let d=da(c);d.static||(d=F4(n,d,o,r),r=Math.max(r,d.y+d.h),n.push(d));const h=e.indexOf(c);i[h]=d,d.moved=!1}return i}},mv={type:"horizontal",allowOverlap:!1,compact(e,t){const n=Md(e),r=lv(e),o=new Array(e.length);for(let i=0;i<r.length;i++){const l=r[i];if(l===void 0)continue;let c=da(l);c.static||(c=B4(n,c,t,r),n.push(c));const d=e.indexOf(l);o[d]=c,c.moved=!1}return o}},pv={type:null,allowOverlap:!1,compact(e,t){return ko(e)}},H4={...hv,allowOverlap:!0,compact(e,t){return ko(e)}},U4={...mv,allowOverlap:!0,compact(e,t){return ko(e)}},z4={...pv,allowOverlap:!0};function uu(e,t=!1,n=!1){let r;return t?e==="vertical"?r=H4:e==="horizontal"?r=U4:r=z4:e==="vertical"?r=hv:e==="horizontal"?r=mv:r=pv,n?{...r,preventCollision:n}:r}function yv(e){return Object.keys(e).sort((n,r)=>e[n]-e[r])}function A1(e,t){const n=yv(e);let r=n[0];if(r===void 0)throw new Error("No breakpoints defined");for(let o=1;o<n.length;o++){const i=n[o];if(i===void 0)continue;const l=e[i];t>l&&(r=i)}return r}function I1(e,t){const n=t[e];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function $h(e,t,n,r,o,i){const l=e[n];if(l)return ko(l);let c=e[r];const d=yv(t),h=d.slice(d.indexOf(n));for(let v=0;v<h.length;v++){const D=h[v];if(D===void 0)continue;const S=e[D];if(S){c=S;break}}const p=ko(c||[]),y=Lm(p,{cols:o});return(typeof i=="object"&&i!==null?i:uu(i)).compact(y,o)}function Ac(e,t){if(Array.isArray(e))return e;const n=e,r=n[t];if(r!==void 0)return r;const o=Object.keys(n);for(const i of o){const l=n[i];if(l!==void 0)return l}return[10,10]}var gl={exports:{}},qh={},Vh={exports:{}},Qh,M1;function W4(){if(M1)return Qh;M1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Qh=e,Qh}var Gh,L1;function Y4(){if(L1)return Gh;L1=1;var e=W4();function t(){}function n(){}return n.resetWarningCache=t,Gh=function(){function r(l,c,d,h,p,y){if(y!==e){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Gh}var R1;function Ld(){return R1||(R1=1,Vh.exports=Y4()()),Vh.exports}var Ic={exports:{}},P1;function $4(){if(P1)return Ic.exports;P1=1;function e(n){var r,o,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(r=0;r<l;r++)n[r]&&(o=e(n[r]))&&(i&&(i+=" "),i+=o)}else for(o in n)n[o]&&(i&&(i+=" "),i+=o);return i}function t(){for(var n,r,o=0,i="",l=arguments.length;o<l;o++)(n=arguments[o])&&(r=e(n))&&(i&&(i+=" "),i+=r);return i}return Ic.exports=t,Ic.exports.clsx=t,Ic.exports}var un={},ro={},j1;function Rd(){if(j1)return ro;j1=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.dontSetMe=o,ro.findInArray=e,ro.int=r,ro.isFunction=t,ro.isNum=n;function e(i,l){for(let c=0,d=i.length;c<d;c++)if(l.apply(l,[i[c],c,i]))return i[c]}function t(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function n(i){return typeof i=="number"&&!isNaN(i)}function r(i){return parseInt(i,10)}function o(i,l,c){if(i[l])return new Error(`Invalid prop ${l} passed to ${c} - do not set this, set it on the child.`)}return ro}var so={},F1;function q4(){if(F1)return so;F1=1,Object.defineProperty(so,"__esModule",{value:!0}),so.browserPrefixToKey=n,so.browserPrefixToStyle=r,so.default=void 0,so.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var c,d;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=(d=(c=window.document)==null?void 0:c.documentElement)==null?void 0:d.style;if(!l||i in l)return"";for(let h=0;h<e.length;h++)if(n(i,e[h])in l)return e[h];return""}function n(i,l){return l?`${l}${o(i)}`:i}function r(i,l){return l?`-${l.toLowerCase()}-${i}`:i}function o(i){let l="",c=!0;for(let d=0;d<i.length;d++)c?(l+=i[d].toUpperCase(),c=!1):i[d]==="-"?c=!0:l+=i[d];return l}return so.default=t(),so}var B1;function zm(){if(B1)return un;B1=1,Object.defineProperty(un,"__esModule",{value:!0}),un.addClassName=L,un.addEvent=l,un.addUserSelectStyles=k,un.createCSSTransform=v,un.createSVGTransform=D,un.getTouch=E,un.getTouchIdentifier=T,un.getTranslation=S,un.innerHeight=p,un.innerWidth=y,un.matchesSelector=o,un.matchesSelectorAndParentsTo=i,un.offsetXYFromParent=b,un.outerHeight=d,un.outerWidth=h,un.removeClassName=_,un.removeEvent=c,un.scheduleRemoveUserSelectStyles=O;var e=Rd(),t=n(q4());function n(C,A){if(typeof WeakMap=="function")var P=new WeakMap,H=new WeakMap;return(n=function(B,z){if(!z&&B&&B.__esModule)return B;var Q,q,X={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return X;if(Q=z?H:P){if(Q.has(B))return Q.get(B);Q.set(B,X)}for(const ie in B)ie!=="default"&&{}.hasOwnProperty.call(B,ie)&&((q=(Q=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,ie))&&(q.get||q.set)?Q(X,ie,q):X[ie]=B[ie]);return X})(C,A)}let r="";function o(C,A){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(C[P])})),(0,e.isFunction)(C[r])?C[r](A):!1}function i(C,A,P){let H=C;do{if(o(H,A))return!0;if(H===P)return!1;H=H.parentNode}while(H);return!1}function l(C,A,P,H){if(!C)return;const B={capture:!0,...H};C.addEventListener?C.addEventListener(A,P,B):C.attachEvent?C.attachEvent("on"+A,P):C["on"+A]=P}function c(C,A,P,H){if(!C)return;const B={capture:!0,...H};C.removeEventListener?C.removeEventListener(A,P,B):C.detachEvent?C.detachEvent("on"+A,P):C["on"+A]=null}function d(C){let A=C.clientHeight;const P=C.ownerDocument.defaultView.getComputedStyle(C);return A+=(0,e.int)(P.borderTopWidth),A+=(0,e.int)(P.borderBottomWidth),A}function h(C){let A=C.clientWidth;const P=C.ownerDocument.defaultView.getComputedStyle(C);return A+=(0,e.int)(P.borderLeftWidth),A+=(0,e.int)(P.borderRightWidth),A}function p(C){let A=C.clientHeight;const P=C.ownerDocument.defaultView.getComputedStyle(C);return A-=(0,e.int)(P.paddingTop),A-=(0,e.int)(P.paddingBottom),A}function y(C){let A=C.clientWidth;const P=C.ownerDocument.defaultView.getComputedStyle(C);return A-=(0,e.int)(P.paddingLeft),A-=(0,e.int)(P.paddingRight),A}function b(C,A,P){const B=A===A.ownerDocument.body?{left:0,top:0}:A.getBoundingClientRect(),z=(C.clientX+A.scrollLeft-B.left)/P,Q=(C.clientY+A.scrollTop-B.top)/P;return{x:z,y:Q}}function v(C,A){const P=S(C,A,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function D(C,A){return S(C,A,"")}function S(C,A,P){let{x:H,y:B}=C,z=`translate(${H}${P},${B}${P})`;if(A){const Q=`${typeof A.x=="string"?A.x:A.x+P}`,q=`${typeof A.y=="string"?A.y:A.y+P}`;z=`translate(${Q}, ${q})`+z}return z}function E(C,A){return C.targetTouches&&(0,e.findInArray)(C.targetTouches,P=>A===P.identifier)||C.changedTouches&&(0,e.findInArray)(C.changedTouches,P=>A===P.identifier)}function T(C){if(C.targetTouches&&C.targetTouches[0])return C.targetTouches[0].identifier;if(C.changedTouches&&C.changedTouches[0])return C.changedTouches[0].identifier}function k(C){if(!C)return;let A=C.getElementById("react-draggable-style-el");A||(A=C.createElement("style"),A.type="text/css",A.id="react-draggable-style-el",A.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
107
+ `,A.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
108
+ `,C.getElementsByTagName("head")[0].appendChild(A)),C.body&&L(C.body,"react-draggable-transparent-selection")}function O(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{I(C)}):I(C)}function I(C){if(C)try{if(C.body&&_(C.body,"react-draggable-transparent-selection"),C.selection)C.selection.empty();else{const A=(C.defaultView||window).getSelection();A&&A.type!=="Caret"&&A.removeAllRanges()}}catch{}}function L(C,A){C.classList?C.classList.add(A):C.className.match(new RegExp(`(?:^|\\s)${A}(?!\\S)`))||(C.className+=` ${A}`)}function _(C,A){C.classList?C.classList.remove(A):C.className=C.className.replace(new RegExp(`(?:^|\\s)${A}(?!\\S)`,"g"),"")}return un}var Xr={},H1;function gv(){if(H1)return Xr;H1=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.canDragX=o,Xr.canDragY=i,Xr.createCoreData=c,Xr.createDraggableData=d,Xr.getBoundPosition=n,Xr.getControlPosition=l,Xr.snapToGrid=r;var e=Rd(),t=zm();function n(y,b,v){if(!y.props.bounds)return[b,v];let{bounds:D}=y.props;D=typeof D=="string"?D:h(D);const S=p(y);if(typeof D=="string"){const{ownerDocument:E}=S,T=E.defaultView;let k;if(D==="parent"?k=S.parentNode:k=S.getRootNode().querySelector(D),!(k instanceof T.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const O=k,I=T.getComputedStyle(S),L=T.getComputedStyle(O);D={left:-S.offsetLeft+(0,e.int)(L.paddingLeft)+(0,e.int)(I.marginLeft),top:-S.offsetTop+(0,e.int)(L.paddingTop)+(0,e.int)(I.marginTop),right:(0,t.innerWidth)(O)-(0,t.outerWidth)(S)-S.offsetLeft+(0,e.int)(L.paddingRight)-(0,e.int)(I.marginRight),bottom:(0,t.innerHeight)(O)-(0,t.outerHeight)(S)-S.offsetTop+(0,e.int)(L.paddingBottom)-(0,e.int)(I.marginBottom)}}return(0,e.isNum)(D.right)&&(b=Math.min(b,D.right)),(0,e.isNum)(D.bottom)&&(v=Math.min(v,D.bottom)),(0,e.isNum)(D.left)&&(b=Math.max(b,D.left)),(0,e.isNum)(D.top)&&(v=Math.max(v,D.top)),[b,v]}function r(y,b,v){const D=Math.round(b/y[0])*y[0],S=Math.round(v/y[1])*y[1];return[D,S]}function o(y){return y.props.axis==="both"||y.props.axis==="x"}function i(y){return y.props.axis==="both"||y.props.axis==="y"}function l(y,b,v){const D=typeof b=="number"?(0,t.getTouch)(y,b):null;if(typeof b=="number"&&!D)return null;const S=p(v),E=v.props.offsetParent||S.offsetParent||S.ownerDocument.body;return(0,t.offsetXYFromParent)(D||y,E,v.props.scale)}function c(y,b,v){const D=!(0,e.isNum)(y.lastX),S=p(y);return D?{node:S,deltaX:0,deltaY:0,lastX:b,lastY:v,x:b,y:v}:{node:S,deltaX:b-y.lastX,deltaY:v-y.lastY,lastX:y.lastX,lastY:y.lastY,x:b,y:v}}function d(y,b){const v=y.props.scale;return{node:b.node,x:y.state.x+b.deltaX/v,y:y.state.y+b.deltaY/v,deltaX:b.deltaX/v,deltaY:b.deltaY/v,lastX:y.state.x,lastY:y.state.y}}function h(y){return{left:y.left,top:y.top,right:y.right,bottom:y.bottom}}function p(y){const b=y.findDOMNode();if(!b)throw new Error("<DraggableCore>: Unmounted during event!");return b}return Xr}var bl={},Mc={},U1;function bv(){if(U1)return Mc;U1=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.default=e;function e(){}return Mc}var z1;function V4(){if(z1)return bl;z1=1,Object.defineProperty(bl,"__esModule",{value:!0}),bl.default=void 0;var e=d(fa()),t=c(Ld()),n=c(dd()),r=zm(),o=gv(),i=Rd(),l=c(bv());function c(S){return S&&S.__esModule?S:{default:S}}function d(S,E){if(typeof WeakMap=="function")var T=new WeakMap,k=new WeakMap;return(d=function(O,I){if(!I&&O&&O.__esModule)return O;var L,_,C={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return C;if(L=I?k:T){if(L.has(O))return L.get(O);L.set(O,C)}for(const A in O)A!=="default"&&{}.hasOwnProperty.call(O,A)&&((_=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,A))&&(_.get||_.set)?L(C,A,_):C[A]=O[A]);return C})(S,E)}function h(S,E,T){return(E=p(E))in S?Object.defineProperty(S,E,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[E]=T,S}function p(S){var E=y(S,"string");return typeof E=="symbol"?E:E+""}function y(S,E){if(typeof S!="object"||!S)return S;var T=S[Symbol.toPrimitive];if(T!==void 0){var k=T.call(S,E);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(S)}const b={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let v=b.mouse,D=class extends e.Component{constructor(){super(...arguments),h(this,"dragging",!1),h(this,"lastX",NaN),h(this,"lastY",NaN),h(this,"touchIdentifier",null),h(this,"mounted",!1),h(this,"handleDragStart",E=>{if(this.props.onMouseDown(E),!this.props.allowAnyClick&&typeof E.button=="number"&&E.button!==0)return!1;const T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:k}=T;if(this.props.disabled||!(E.target instanceof k.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(E.target,this.props.handle,T)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(E.target,this.props.cancel,T))return;E.type==="touchstart"&&!this.props.allowMobileScroll&&E.preventDefault();const O=(0,r.getTouchIdentifier)(E);this.touchIdentifier=O;const I=(0,o.getControlPosition)(E,O,this);if(I==null)return;const{x:L,y:_}=I,C=(0,o.createCoreData)(this,L,_);(0,l.default)("DraggableCore: handleDragStart: %j",C),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(E,C)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(k),this.dragging=!0,this.lastX=L,this.lastY=_,(0,r.addEvent)(k,v.move,this.handleDrag),(0,r.addEvent)(k,v.stop,this.handleDragStop))}),h(this,"handleDrag",E=>{const T=(0,o.getControlPosition)(E,this.touchIdentifier,this);if(T==null)return;let{x:k,y:O}=T;if(Array.isArray(this.props.grid)){let _=k-this.lastX,C=O-this.lastY;if([_,C]=(0,o.snapToGrid)(this.props.grid,_,C),!_&&!C)return;k=this.lastX+_,O=this.lastY+C}const I=(0,o.createCoreData)(this,k,O);if((0,l.default)("DraggableCore: handleDrag: %j",I),this.props.onDrag(E,I)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const C=document.createEvent("MouseEvents");C.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(C)}return}this.lastX=k,this.lastY=O}),h(this,"handleDragStop",E=>{if(!this.dragging)return;const T=(0,o.getControlPosition)(E,this.touchIdentifier,this);if(T==null)return;let{x:k,y:O}=T;if(Array.isArray(this.props.grid)){let C=k-this.lastX||0,A=O-this.lastY||0;[C,A]=(0,o.snapToGrid)(this.props.grid,C,A),k=this.lastX+C,O=this.lastY+A}const I=(0,o.createCoreData)(this,k,O);if(this.props.onStop(E,I)===!1||this.mounted===!1)return!1;const _=this.findDOMNode();_&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",I),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,_&&((0,l.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(_.ownerDocument,v.move,this.handleDrag),(0,r.removeEvent)(_.ownerDocument,v.stop,this.handleDragStop))}),h(this,"onMouseDown",E=>(v=b.mouse,this.handleDragStart(E))),h(this,"onMouseUp",E=>(v=b.mouse,this.handleDragStop(E))),h(this,"onTouchStart",E=>(v=b.touch,this.handleDragStart(E))),h(this,"onTouchEnd",E=>(v=b.touch,this.handleDragStop(E)))}componentDidMount(){this.mounted=!0;const E=this.findDOMNode();E&&(0,r.addEvent)(E,b.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const E=this.findDOMNode();if(E){const{ownerDocument:T}=E;(0,r.removeEvent)(T,b.mouse.move,this.handleDrag),(0,r.removeEvent)(T,b.touch.move,this.handleDrag),(0,r.removeEvent)(T,b.mouse.stop,this.handleDragStop),(0,r.removeEvent)(T,b.touch.stop,this.handleDragStop),(0,r.removeEvent)(E,b.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(T)}}findDOMNode(){var E,T,k;return(E=this.props)!=null&&E.nodeRef?(k=(T=this.props)==null?void 0:T.nodeRef)==null?void 0:k.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return bl.default=D,h(D,"displayName","DraggableCore"),h(D,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(S,E){if(S[E]&&S[E].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),h(D,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),bl}var W1;function Q4(){return W1||(W1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=y(fa()),n=p(Ld()),r=p(dd()),o=$4(),i=zm(),l=gv(),c=Rd(),d=p(V4()),h=p(bv());function p(T){return T&&T.__esModule?T:{default:T}}function y(T,k){if(typeof WeakMap=="function")var O=new WeakMap,I=new WeakMap;return(y=function(L,_){if(!_&&L&&L.__esModule)return L;var C,A,P={__proto__:null,default:L};if(L===null||typeof L!="object"&&typeof L!="function")return P;if(C=_?I:O){if(C.has(L))return C.get(L);C.set(L,P)}for(const H in L)H!=="default"&&{}.hasOwnProperty.call(L,H)&&((A=(C=Object.defineProperty)&&Object.getOwnPropertyDescriptor(L,H))&&(A.get||A.set)?C(P,H,A):P[H]=L[H]);return P})(T,k)}function b(){return b=Object.assign?Object.assign.bind():function(T){for(var k=1;k<arguments.length;k++){var O=arguments[k];for(var I in O)({}).hasOwnProperty.call(O,I)&&(T[I]=O[I])}return T},b.apply(null,arguments)}function v(T,k,O){return(k=D(k))in T?Object.defineProperty(T,k,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[k]=O,T}function D(T){var k=S(T,"string");return typeof k=="symbol"?k:k+""}function S(T,k){if(typeof T!="object"||!T)return T;var O=T[Symbol.toPrimitive];if(O!==void 0){var I=O.call(T,k);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(T)}class E extends t.Component{static getDerivedStateFromProps(k,O){let{position:I}=k,{prevPropsPosition:L}=O;return I&&(!L||I.x!==L.x||I.y!==L.y)?((0,h.default)("Draggable: getDerivedStateFromProps %j",{position:I,prevPropsPosition:L}),{x:I.x,y:I.y,prevPropsPosition:{...I}}):null}constructor(k){super(k),v(this,"onDragStart",(O,I)=>{if((0,h.default)("Draggable: onDragStart: %j",I),this.props.onStart(O,(0,l.createDraggableData)(this,I))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(O,I)=>{if(!this.state.dragging)return!1;(0,h.default)("Draggable: onDrag: %j",I);const L=(0,l.createDraggableData)(this,I),_={x:L.x,y:L.y,slackX:0,slackY:0};if(this.props.bounds){const{x:A,y:P}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[H,B]=(0,l.getBoundPosition)(this,_.x,_.y);_.x=H,_.y=B,_.slackX=this.state.slackX+(A-_.x),_.slackY=this.state.slackY+(P-_.y),L.x=_.x,L.y=_.y,L.deltaX=_.x-this.state.x,L.deltaY=_.y-this.state.y}if(this.props.onDrag(O,L)===!1)return!1;this.setState(_)}),v(this,"onDragStop",(O,I)=>{if(!this.state.dragging||this.props.onStop(O,(0,l.createDraggableData)(this,I))===!1)return!1;(0,h.default)("Draggable: onDragStop: %j",I);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:A,y:P}=this.props.position;_.x=A,_.y=P}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:k.position?k.position.x:k.defaultPosition.x,y:k.position?k.position.y:k.defaultPosition.y,prevPropsPosition:{...k.position},slackX:0,slackY:0,isElementSVG:!1},k.position&&!(k.onDrag||k.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var k,O;return((O=(k=this.props)==null?void 0:k.nodeRef)==null?void 0:O.current)??r.default.findDOMNode(this)}render(){const{axis:k,bounds:O,children:I,defaultPosition:L,defaultClassName:_,defaultClassNameDragging:C,defaultClassNameDragged:A,position:P,positionOffset:H,scale:B,...z}=this.props;let Q={},q=null;const ie=!!!P||this.state.dragging,ge=P||L,te={x:(0,l.canDragX)(this)&&ie?this.state.x:ge.x,y:(0,l.canDragY)(this)&&ie?this.state.y:ge.y};this.state.isElementSVG?q=(0,i.createSVGTransform)(te,H):Q=(0,i.createCSSTransform)(te,H);const de=(0,o.clsx)(I.props.className||"",_,{[C]:this.state.dragging,[A]:this.state.dragged});return t.createElement(d.default,b({},z,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(I),{className:de,style:{...I.props.style,...Q},transform:q}))}}e.default=E,v(E,"displayName","Draggable"),v(E,"propTypes",{...d.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),v(E,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(qh)),qh}var Y1;function Wm(){if(Y1)return gl.exports;Y1=1;const{default:e,DraggableCore:t}=Q4();return gl.exports=e,gl.exports.default=e,gl.exports.DraggableCore=t,gl.exports}var G4=Wm(),xl={exports:{}},vl={},Lc={},$1;function K4(){if($1)return Lc;$1=1,Lc.__esModule=!0,Lc.cloneElement=c;var e=t(fa());function t(d){return d&&d.__esModule?d:{default:d}}function n(d,h){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(d);h&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(d,b).enumerable})),p.push.apply(p,y)}return p}function r(d){for(var h=1;h<arguments.length;h++){var p=arguments[h]!=null?arguments[h]:{};h%2?n(Object(p),!0).forEach(function(y){o(d,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):n(Object(p)).forEach(function(y){Object.defineProperty(d,y,Object.getOwnPropertyDescriptor(p,y))})}return d}function o(d,h,p){return(h=i(h))in d?Object.defineProperty(d,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[h]=p,d}function i(d){var h=l(d,"string");return typeof h=="symbol"?h:h+""}function l(d,h){if(typeof d!="object"||!d)return d;var p=d[Symbol.toPrimitive];if(p!==void 0){var y=p.call(d,h);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}function c(d,h){return h.style&&d.props.style&&(h.style=r(r({},d.props.style),h.style)),h.className&&d.props.className&&(h.className=`${d.props.className} ${h.className}`),e.default.cloneElement(d,h)}return Lc}var El={},q1;function xv(){if(q1)return El;q1=1,El.__esModule=!0,El.resizableProps=void 0;var e=t(Ld());Wm();function t(n){return n&&n.__esModule?n:{default:n}}return El.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const[i]=r;return i.axis==="both"||i.axis==="y"?e.default.number.isRequired(...r):e.default.number(...r)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const[i]=r;return i.axis==="both"||i.axis==="x"?e.default.number.isRequired(...r):e.default.number(...r)}},El}var V1;function vv(){if(V1)return vl;V1=1,vl.__esModule=!0,vl.default=void 0;var e=i(fa()),t=Wm(),n=K4(),r=xv();const o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(S,E){if(typeof WeakMap=="function")var T=new WeakMap,k=new WeakMap;return(i=function(O,I){if(!I&&O&&O.__esModule)return O;var L,_,C={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return C;if(L=I?k:T){if(L.has(O))return L.get(O);L.set(O,C)}for(const A in O)A!=="default"&&{}.hasOwnProperty.call(O,A)&&((_=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,A))&&(_.get||_.set)?L(C,A,_):C[A]=O[A]);return C})(S,E)}function l(){return l=Object.assign?Object.assign.bind():function(S){for(var E=1;E<arguments.length;E++){var T=arguments[E];for(var k in T)({}).hasOwnProperty.call(T,k)&&(S[k]=T[k])}return S},l.apply(null,arguments)}function c(S,E){if(S==null)return{};var T,k,O=d(S,E);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(S);for(k=0;k<I.length;k++)T=I[k],E.indexOf(T)===-1&&{}.propertyIsEnumerable.call(S,T)&&(O[T]=S[T])}return O}function d(S,E){if(S==null)return{};var T={};for(var k in S)if({}.hasOwnProperty.call(S,k)){if(E.indexOf(k)!==-1)continue;T[k]=S[k]}return T}function h(S,E){var T=Object.keys(S);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(S);E&&(k=k.filter(function(O){return Object.getOwnPropertyDescriptor(S,O).enumerable})),T.push.apply(T,k)}return T}function p(S){for(var E=1;E<arguments.length;E++){var T=arguments[E]!=null?arguments[E]:{};E%2?h(Object(T),!0).forEach(function(k){y(S,k,T[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(k){Object.defineProperty(S,k,Object.getOwnPropertyDescriptor(T,k))})}return S}function y(S,E,T){return(E=b(E))in S?Object.defineProperty(S,E,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[E]=T,S}function b(S){var E=v(S,"string");return typeof E=="symbol"?E:E+""}function v(S,E){if(typeof S!="object"||!S)return S;var T=S[Symbol.toPrimitive];if(T!==void 0){var k=T.call(S,E);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(S)}let D=class extends e.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(E,T){const{minConstraints:k,maxConstraints:O,lockAspectRatio:I}=this.props;if(!k&&!O&&!I)return[E,T];if(I){const P=this.props.width/this.props.height,H=E-this.props.width,B=T-this.props.height;Math.abs(H)>Math.abs(B*P)?T=E/P:E=T*P}const[L,_]=[E,T];let[C,A]=this.slack||[0,0];return E+=C,T+=A,k&&(E=Math.max(k[0],E),T=Math.max(k[1],T)),O&&(E=Math.min(O[0],E),T=Math.min(O[1],T)),this.slack=[C+(L-E),A+(_-T)],[E,T]}resizeHandler(E,T){return(k,O)=>{var ge;let{node:I,deltaX:L,deltaY:_}=O;E==="onResizeStart"&&this.resetData();const C=(this.props.axis==="both"||this.props.axis==="x")&&T!=="n"&&T!=="s",A=(this.props.axis==="both"||this.props.axis==="y")&&T!=="e"&&T!=="w";if(!C&&!A)return;const P=T[0],H=T[T.length-1],B=I.getBoundingClientRect();if(this.lastHandleRect!=null){if(H==="w"){const te=B.left-this.lastHandleRect.left;L+=te}if(P==="n"){const te=B.top-this.lastHandleRect.top;_+=te}}this.lastHandleRect=B,H==="w"&&(L=-L),P==="n"&&(_=-_);let z=this.props.width+(C?L/this.props.transformScale:0),Q=this.props.height+(A?_/this.props.transformScale:0);[z,Q]=this.runConstraints(z,Q),E==="onResizeStop"&&this.lastSize&&({width:z,height:Q}=this.lastSize);const q=z!==this.props.width||Q!==this.props.height;E!=="onResizeStop"&&(this.lastSize={width:z,height:Q});const X=typeof this.props[E]=="function"?this.props[E]:null;X&&!(E==="onResize"&&!q)&&((ge=k.persist)==null||ge.call(k),X(k,{node:I,size:{width:z,height:Q},handle:T})),E==="onResizeStop"&&this.resetData()}}renderResizeHandle(E,T){const{handle:k}=this.props;if(!k)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${E}`,ref:T});if(typeof k=="function")return k(E,T);const O=typeof k.type=="string",I=p({ref:T},O?{}:{handleAxis:E});return e.cloneElement(k,I)}render(){const E=this.props,{children:T,className:k,draggableOpts:O,width:I,height:L,handle:_,handleSize:C,lockAspectRatio:A,axis:P,minConstraints:H,maxConstraints:B,onResize:z,onResizeStop:Q,onResizeStart:q,resizeHandles:X,transformScale:ie}=E,ge=c(E,o);return(0,n.cloneElement)(T,p(p({},ge),{},{className:`${k?`${k} `:""}react-resizable`,children:[...e.Children.toArray(T.props.children),...X.map(te=>{const de=this.handleRefs[te]??(this.handleRefs[te]=e.createRef());return e.createElement(t.DraggableCore,l({},O,{nodeRef:de,key:`resizableHandle-${te}`,onStop:this.resizeHandler("onResizeStop",te),onStart:this.resizeHandler("onResizeStart",te),onDrag:this.resizeHandler("onResize",te)}),this.renderResizeHandle(te,de))})]}))}};return vl.default=D,D.propTypes=r.resizableProps,D.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},vl}var Tl={},Q1;function X4(){if(Q1)return Tl;Q1=1,Tl.__esModule=!0,Tl.default=void 0;var e=l(fa()),t=i(Ld()),n=i(vv()),r=xv();const o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(E){return E&&E.__esModule?E:{default:E}}function l(E,T){if(typeof WeakMap=="function")var k=new WeakMap,O=new WeakMap;return(l=function(I,L){if(!L&&I&&I.__esModule)return I;var _,C,A={__proto__:null,default:I};if(I===null||typeof I!="object"&&typeof I!="function")return A;if(_=L?O:k){if(_.has(I))return _.get(I);_.set(I,A)}for(const P in I)P!=="default"&&{}.hasOwnProperty.call(I,P)&&((C=(_=Object.defineProperty)&&Object.getOwnPropertyDescriptor(I,P))&&(C.get||C.set)?_(A,P,C):A[P]=I[P]);return A})(E,T)}function c(){return c=Object.assign?Object.assign.bind():function(E){for(var T=1;T<arguments.length;T++){var k=arguments[T];for(var O in k)({}).hasOwnProperty.call(k,O)&&(E[O]=k[O])}return E},c.apply(null,arguments)}function d(E,T){var k=Object.keys(E);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(E);T&&(O=O.filter(function(I){return Object.getOwnPropertyDescriptor(E,I).enumerable})),k.push.apply(k,O)}return k}function h(E){for(var T=1;T<arguments.length;T++){var k=arguments[T]!=null?arguments[T]:{};T%2?d(Object(k),!0).forEach(function(O){p(E,O,k[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(k)):d(Object(k)).forEach(function(O){Object.defineProperty(E,O,Object.getOwnPropertyDescriptor(k,O))})}return E}function p(E,T,k){return(T=y(T))in E?Object.defineProperty(E,T,{value:k,enumerable:!0,configurable:!0,writable:!0}):E[T]=k,E}function y(E){var T=b(E,"string");return typeof T=="symbol"?T:T+""}function b(E,T){if(typeof E!="object"||!E)return E;var k=E[Symbol.toPrimitive];if(k!==void 0){var O=k.call(E,T);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(E)}function v(E,T){if(E==null)return{};var k,O,I=D(E,T);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(E);for(O=0;O<L.length;O++)k=L[O],T.indexOf(k)===-1&&{}.propertyIsEnumerable.call(E,k)&&(I[k]=E[k])}return I}function D(E,T){if(E==null)return{};var k={};for(var O in E)if({}.hasOwnProperty.call(E,O)){if(T.indexOf(O)!==-1)continue;k[O]=E[O]}return k}let S=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(T,k)=>{var I;const{size:O}=k;this.props.onResize?((I=T.persist)==null||I.call(T),this.setState(O,()=>this.props.onResize&&this.props.onResize(T,k))):this.setState(O)}}static getDerivedStateFromProps(T,k){return k.propsWidth!==T.width||k.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null}render(){const T=this.props,{handle:k,handleSize:O,onResize:I,onResizeStart:L,onResizeStop:_,draggableOpts:C,minConstraints:A,maxConstraints:P,lockAspectRatio:H,axis:B,width:z,height:Q,resizeHandles:q,style:X,transformScale:ie}=T,ge=v(T,o);return e.createElement(n.default,{axis:B,draggableOpts:C,handle:k,handleSize:O,height:this.state.height,lockAspectRatio:H,maxConstraints:P,minConstraints:A,onResizeStart:L,onResize:this.onResize,onResizeStop:_,resizeHandles:q,transformScale:ie,width:this.state.width},e.createElement("div",c({},ge,{style:h(h({},X),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return Tl.default=S,S.propTypes=h(h({},r.resizableProps),{},{children:t.default.element}),Tl}var G1;function J4(){return G1||(G1=1,xl.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},xl.exports.Resizable=vv().default,xl.exports.ResizableBox=X4().default),xl.exports}var Z4=J4();function Ev(e){return function(n,r,o,i,l,c,d){return e(n,r,d)}}function Pd(e){return function(n,r,o,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,o,i);var l=i.get(n),c=i.get(r);if(l&&c)return l===r&&c===n;i.set(n,r),i.set(r,n);var d=e(n,r,o,i);return i.delete(n),i.delete(r),d}}function Tv(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function K1(e){return e.constructor===Object||e.constructor==null}function X1(e){return typeof e.then=="function"}function jd(e,t){return e===t||e!==e&&t!==t}var eD="[object Arguments]",tD="[object Boolean]",nD="[object Date]",rD="[object RegExp]",sD="[object Map]",oD="[object Number]",aD="[object Object]",iD="[object Set]",lD="[object String]",J1=Object.prototype.toString;function Fd(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,o=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,c=e.createIsNestedEqual,d=c(h);function h(p,y,b){if(p===y)return!0;if(!p||!y||typeof p!="object"||typeof y!="object")return p!==p&&y!==y;if(K1(p)&&K1(y))return o(p,y,d,b);var v=Array.isArray(p),D=Array.isArray(y);if(v||D)return v===D&&t(p,y,d,b);var S=J1.call(p);return S!==J1.call(y)?!1:S===nD?n(p,y,d,b):S===rD?i(p,y,d,b):S===sD?r(p,y,d,b):S===iD?l(p,y,d,b):S===aD||S===eD?X1(p)||X1(y)?!1:o(p,y,d,b):S===tD||S===oD||S===lD?jd(p.valueOf(),y.valueOf()):!1}return h}function wv(e,t,n,r){var o=e.length;if(t.length!==o)return!1;for(;o-- >0;)if(!n(e[o],t[o],o,o,e,t,r))return!1;return!0}var uD=Pd(wv);function Sv(e,t){return jd(e.valueOf(),t.valueOf())}function kv(e,t,n,r){var o=e.size===t.size;if(!o)return!1;if(!e.size)return!0;var i={},l=0;return e.forEach(function(c,d){if(o){var h=!1,p=0;t.forEach(function(y,b){!h&&!i[p]&&(h=n(d,b,l,p,e,t,r)&&n(c,y,d,b,e,t,r))&&(i[p]=!0),p++}),l++,o=h}}),o}var cD=Pd(kv),dD="_owner",fD=Object.prototype.hasOwnProperty;function Cv(e,t,n,r){var o=Object.keys(e),i=o.length;if(Object.keys(t).length!==i)return!1;for(var l;i-- >0;){if(l=o[i],l===dD){var c=!!e.$$typeof,d=!!t.$$typeof;if((c||d)&&c!==d)return!1}if(!fD.call(t,l)||!n(e[l],t[l],l,l,e,t,r))return!1}return!0}var hD=Pd(Cv);function _v(e,t){return e.source===t.source&&e.flags===t.flags}function Nv(e,t,n,r){var o=e.size===t.size;if(!o)return!1;if(!e.size)return!0;var i={};return e.forEach(function(l,c){if(o){var d=!1,h=0;t.forEach(function(p,y){!d&&!i[h]&&(d=n(l,p,c,y,e,t,r))&&(i[h]=!0),h++}),o=d}}),o}var mD=Pd(Nv),Dv=Object.freeze({areArraysEqual:wv,areDatesEqual:Sv,areMapsEqual:kv,areObjectsEqual:Cv,areRegExpsEqual:_v,areSetsEqual:Nv,createIsNestedEqual:Ev}),Ov=Object.freeze({areArraysEqual:uD,areDatesEqual:Sv,areMapsEqual:cD,areObjectsEqual:hD,areRegExpsEqual:_v,areSetsEqual:mD,createIsNestedEqual:Ev}),pD=Fd(Dv);function Ss(e,t){return pD(e,t,void 0)}Fd(Tv(Dv,{createIsNestedEqual:function(){return jd}}));Fd(Ov);Fd(Tv(Ov,{createIsNestedEqual:function(){return jd}}));function Z1(e){const{children:t,cols:n,containerWidth:r,margin:o,containerPadding:i,rowHeight:l,maxRows:c,isDraggable:d,isResizable:h,isBounded:p,static:y,useCSSTransforms:b=!0,usePercentages:v=!1,transformScale:D=1,positionStrategy:S,dragThreshold:E=0,droppingPosition:T,className:k="",style:O,handle:I="",cancel:L="",x:_,y:C,w:A,h:P,minW:H=1,maxW:B=1/0,minH:z=1,maxH:Q=1/0,i:q,resizeHandles:X,resizeHandle:ie,constraints:ge=od,layoutItem:te,layout:de=[],onDragStart:M,onDrag:V,onDragStop:ae,onResizeStart:j,onResize:le,onResizeStop:pe}=e,[ye,Ne]=N.useState(!1),[G,Z]=N.useState(!1),ue=N.useRef(null),me=N.useRef({left:0,top:0}),Ce=N.useRef({top:0,left:0,width:0,height:0}),Re=N.useRef(void 0),tt=N.useRef(de);tt.current=de;const Ge=N.useRef(null),nt=N.useRef(null),we=N.useRef(!1),je=N.useRef({x:0,y:0}),oe=N.useRef(!1),re=N.useMemo(()=>({cols:n,containerPadding:i,containerWidth:r,margin:o,maxRows:c,rowHeight:l}),[n,i,r,o,c,l]),xe=N.useMemo(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:l,margin:o,layout:[]}),[n,c,r,l,o]),Oe=N.useCallback(()=>({...xe,layout:tt.current}),[xe]),qe=N.useMemo(()=>te??{i:q,x:_,y:C,w:A,h:P,minW:H,maxW:B,minH:z,maxH:Q},[te,q,_,C,A,P,H,B,z,Q]),pt=N.useCallback(Ie=>{if(S!=null&&S.calcStyle)return S.calcStyle(Ie);if(b)return Rm(Ie);const Ue=uv(Ie);return v?{...Ue,left:O1(Ie.left/r),width:O1(Ie.width/r)}:Ue},[S,b,v,r]),yt=N.useCallback((Ie,{node:Ue})=>{if(!M)return;const{offsetParent:ft}=Ue;if(!ft)return;const ze=ft.getBoundingClientRect(),Yt=Ue.getBoundingClientRect(),en=Yt.left/D,tn=ze.left/D,$t=Yt.top/D,nn=ze.top/D;let On;if(S!=null&&S.calcDragPosition){const lt=Ie;On=S.calcDragPosition(lt.clientX,lt.clientY,lt.clientX-Yt.left,lt.clientY-Yt.top)}else On={left:en-tn+ft.scrollLeft,top:$t-nn+ft.scrollTop};if(me.current=On,E>0){const lt=Ie;je.current={x:lt.clientX,y:lt.clientY},we.current=!0,oe.current=!1,Ne(!0);return}Ne(!0);const $n=Dc(re,On.top,On.left),{x:$r,y:We}=Oc(ge,qe,$n.x,$n.y,Oe());M(q,$r,We,{e:Ie,node:Ue,newPosition:On})},[M,D,re,S,E,ge,qe,Oe,q]),ce=N.useCallback((Ie,{node:Ue,deltaX:ft,deltaY:ze})=>{if(!V||!ye)return;const Yt=Ie;if(we.current&&!oe.current){const $r=Yt.clientX-je.current.x,We=Yt.clientY-je.current.y;if(Math.hypot($r,We)<E)return;if(oe.current=!0,we.current=!1,M){const Xe=Dc(re,me.current.top,me.current.left),{x:mt,y:_t}=Oc(ge,qe,Xe.x,Xe.y,Oe());M(q,mt,_t,{e:Ie,node:Ue,newPosition:me.current})}}let en=me.current.top+ze,tn=me.current.left+ft;if(p){const{offsetParent:$r}=Ue;if($r){const We=$r.clientHeight-gi(P,l,o[1]);en=sd(en,0,We);const lt=Ci(re),Xe=r-gi(A,lt,o[0]);tn=sd(tn,0,Xe)}}const $t={top:en,left:tn};me.current=$t;const nn=Dc(re,en,tn),{x:On,y:$n}=Oc(ge,qe,nn.x,nn.y,Oe());V(q,On,$n,{e:Ie,node:Ue,newPosition:$t})},[V,M,ye,E,p,P,l,o,re,r,A,q,ge,qe,Oe]),be=N.useCallback((Ie,{node:Ue})=>{if(!ae||!ye)return;const ft=we.current;if(we.current=!1,oe.current=!1,je.current={x:0,y:0},ft){Ne(!1),me.current={left:0,top:0};return}const{left:ze,top:Yt}=me.current,en={top:Yt,left:ze};Ne(!1),me.current={left:0,top:0};const tn=Dc(re,Yt,ze),{x:$t,y:nn}=Oc(ge,qe,tn.x,tn.y,Oe());ae(q,$t,nn,{e:Ie,node:Ue,newPosition:en})},[ae,ye,re,ge,qe,Oe,q]);Ge.current=yt,nt.current=ce;const Le=N.useCallback((Ie,{node:Ue,size:ft,handle:ze},Yt,en)=>{const tn=en==="onResizeStart"?j:en==="onResize"?le:pe;if(!tn)return;let $t;Ue?$t=I4(ze,Yt,ft,r):$t={...ft,top:Yt.top,left:Yt.left},Ce.current=$t;const nn=g4(re,$t.width,$t.height),{w:On,h:$n}=S4(ge,qe,nn.w,nn.h,ze,Oe());tn(q,On,$n,{e:Ie.nativeEvent,node:Ue,size:$t,handle:ze})},[j,le,pe,r,re,q,ge,qe,Oe]),rt=N.useCallback((Ie,Ue)=>{Z(!0);const ft=yl(re,_,C,A,P),ze={...Ue,handle:Ue.handle};Le(Ie,ze,ft,"onResizeStart")},[Le,re,_,C,A,P]),ot=N.useCallback((Ie,Ue)=>{const ft=yl(re,_,C,A,P),ze={...Ue,handle:Ue.handle};Le(Ie,ze,ft,"onResize")},[Le,re,_,C,A,P]),gt=N.useCallback((Ie,Ue)=>{Z(!1),Ce.current={top:0,left:0,width:0,height:0};const ft=yl(re,_,C,A,P),ze={...Ue,handle:Ue.handle};Le(Ie,ze,ft,"onResizeStop")},[Le,re,_,C,A,P]);N.useEffect(()=>{var ze,Yt;if(!T)return;const Ie=ue.current;if(!Ie)return;const Ue=Re.current||{left:0,top:0},ft=ye&&(T.left!==Ue.left||T.top!==Ue.top);if(ye){if(ft){const en=T.left-me.current.left,tn=T.top-me.current.top,$t={node:Ie,deltaX:en,deltaY:tn,lastX:me.current.left,lastY:me.current.top,x:T.left,y:T.top};(Yt=nt.current)==null||Yt.call(nt,T.e,$t)}}else{const en={node:Ie,deltaX:T.left,deltaY:T.top,lastX:0,lastY:0,x:T.left,y:T.top};(ze=Ge.current)==null||ze.call(Ge,T.e,en)}Re.current=T},[T,ye,q]);const Zt=yl(re,_,C,A,P,ye?me.current:null,G?Ce.current:null),hn=Me.Children.only(t),Dn=yl(re,0,0,1,1),Yn=[Dn.width,Dn.height],Wt=[1/0,1/0],It=hn.props,yn=It.className,Dr=It.style;let Ke=Me.cloneElement(hn,{ref:ue,className:nr("react-grid-item",yn,k,{static:y,resizing:G,"react-draggable":d,"react-draggable-dragging":ye,dropping:!!T,cssTransforms:b}),style:{...O,...Dr,...pt(Zt)}});const ut=ie;return Ke=f.jsx(Z4.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:Zt.width,height:Zt.height,minConstraints:Yn,maxConstraints:Wt,onResizeStart:rt,onResize:ot,onResizeStop:gt,transformScale:D,resizeHandles:X,handle:ut,children:Ke}),Ke=f.jsx(G4.DraggableCore,{disabled:!d,onStart:yt,onDrag:ce,onStop:be,handle:I,cancel:".react-resizable-handle"+(L?","+L:""),scale:D,nodeRef:ue,children:Ke}),Ke}var Es=()=>{},eb="react-grid-layout",Av=!1;try{Av=/firefox/i.test(navigator.userAgent)}catch{}function yD(e,t){const n=Me.Children.toArray(e),r=Me.Children.toArray(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++){const i=n[o],l=r[o];if((i==null?void 0:i.key)!==(l==null?void 0:l.key))return!1}return!0}function tb(e,t,n,r){const o=[],i=new Set;Me.Children.forEach(t,c=>{if(!Me.isValidElement(c)||c.key===null)return;const d=String(c.key);i.add(d);const h=e.find(p=>p.i===d);if(h)o.push(da(h));else{const y=c.props["data-grid"];y?o.push({i:d,x:y.x??0,y:y.y??0,w:y.w??1,h:y.h??1,minW:y.minW,maxW:y.maxW,minH:y.minH,maxH:y.maxH,static:y.static,isDraggable:y.isDraggable,isResizable:y.isResizable,resizeHandles:y.resizeHandles,isBounded:y.isBounded}):o.push({i:d,x:0,y:Id(o),w:1,h:1})}});const l=Lm(o,{cols:n});return r.compact(l,n)}function Iv(e){const{children:t,width:n,gridConfig:r,dragConfig:o,resizeConfig:i,dropConfig:l,positionStrategy:c=M4,compactor:d,constraints:h=od,layout:p=[],droppingItem:y,autoSize:b=!0,className:v="",style:D={},innerRef:S,onLayoutChange:E=Es,onDragStart:T=Es,onDrag:k=Es,onDragStop:O=Es,onResizeStart:I=Es,onResize:L=Es,onResizeStop:_=Es,onDrop:C=Es,onDropDragOver:A=Es}=e,P=N.useMemo(()=>({...L4,...r}),[r]),H=N.useMemo(()=>({...R4,...o}),[o]),B=N.useMemo(()=>({...P4,...i}),[i]),z=N.useMemo(()=>({...j4,...l}),[l]),{cols:Q,rowHeight:q,maxRows:X,margin:ie,containerPadding:ge}=P,{enabled:te,bounded:de,handle:M,cancel:V,threshold:ae}=H,{enabled:j,handles:le,handleComponent:pe}=B,{enabled:ye,defaultItem:Ne,onDragOver:G}=z,Z=d??uu("vertical"),ue=Z.type,me=Z.allowOverlap,Ce=Z.preventCollision??!1,Re=N.useMemo(()=>y??{i:"__dropping-elem__",...Ne},[y,Ne]),tt=c.type==="transform",Ge=c.scale,nt=ge??ie,[we,je]=N.useState(!1),[oe,re]=N.useState(()=>tb(p,t,Q,Z)),[xe,Oe]=N.useState(null),[qe,pt]=N.useState(!1),[yt,ce]=N.useState(null),[be,Le]=N.useState(),rt=N.useRef(null),ot=N.useRef(null),gt=N.useRef(null),Zt=N.useRef(0),hn=N.useRef(oe),Dn=N.useRef(p),Yn=N.useRef(t),Wt=N.useRef(ue),It=N.useRef(oe);It.current=oe,N.useEffect(()=>{je(!0),Ss(oe,p)||E(oe)},[]),N.useEffect(()=>{if(xe||yt)return;const We=!Ss(p,Dn.current),lt=!yD(t,Yn.current),Xe=ue!==Wt.current;if(We||lt||Xe){const _t=tb(We?p:oe,t,Q,Z);Ss(_t,oe)||re(_t)}Dn.current=p,Yn.current=t,Wt.current=ue},[p,t,Q,ue,Z,xe,yt,oe]),N.useEffect(()=>{if(!xe&&!Ss(oe,hn.current)){hn.current=oe;const We=oe.filter(lt=>lt.i!==Re.i);E(We)}},[oe,xe,E,Re.i]);const yn=N.useMemo(()=>{if(!b)return;const We=Id(oe),lt=nt[1];return We*q+(We-1)*ie[1]+lt*2+"px"},[b,oe,q,ie,nt]),Dr=N.useCallback((We,lt,Xe,mt)=>{const _t=It.current,wt=Wo(_t,We);if(!wt)return;const Lt={w:wt.w,h:wt.h,x:wt.x,y:wt.y,i:We};rt.current=da(wt),gt.current=_t,Oe(Lt),T(_t,wt,wt,null,mt.e,mt.node)},[T]),Ke=N.useCallback((We,lt,Xe,mt)=>{const _t=It.current,wt=rt.current,Lt=Wo(_t,We);if(!Lt)return;const Rt={w:Lt.w,h:Lt.h,x:Lt.x,y:Lt.y,i:We},Mt=Vo(_t,Lt,lt,Xe,!0,Ce,ue,Q,me);k(Mt,wt,Lt,Rt,mt.e,mt.node),re(Z.compact(Mt,Q)),Oe(Rt)},[Ce,ue,Q,me,Z,k]),ut=N.useCallback((We,lt,Xe,mt)=>{if(!xe)return;const _t=It.current,wt=rt.current,Lt=Wo(_t,We);if(!Lt)return;const Rt=Vo(_t,Lt,lt,Xe,!0,Ce,ue,Q,me),Mt=Z.compact(Rt,Q);O(Mt,wt,Lt,null,mt.e,mt.node);const gn=gt.current;rt.current=null,gt.current=null,Oe(null),re(Mt),gn&&!Ss(gn,Mt)&&E(Mt)},[xe,Ce,ue,Q,me,Z,O,E]),Ie=N.useCallback((We,lt,Xe,mt)=>{const _t=It.current,wt=Wo(_t,We);wt&&(ot.current=da(wt),gt.current=_t,pt(!0),I(_t,wt,wt,null,mt.e,mt.node))},[I]),Ue=N.useCallback((We,lt,Xe,mt)=>{const _t=It.current,wt=ot.current,{handle:Lt}=mt;let Rt=!1,Mt,gn;const[xa,pr]=v4(_t,We,Pt=>(Mt=Pt.x,gn=Pt.y,["sw","w","nw","n","ne"].includes(Lt)&&(["sw","nw","w"].includes(Lt)&&(Mt=Pt.x+(Pt.w-lt),lt=Pt.x!==Mt&&Mt<0?Pt.w:lt,Mt=Mt<0?0:Mt),["ne","n","nw"].includes(Lt)&&(gn=Pt.y+(Pt.h-Xe),Xe=Pt.y!==gn&&gn<0?Pt.h:Xe,gn=gn<0?0:gn),Rt=!0),Ce&&!me&&iv(_t,{...Pt,w:lt,h:Xe,x:Mt??Pt.x,y:gn??Pt.y}).filter(va=>va.i!==Pt.i).length>0&&(gn=Pt.y,Xe=Pt.h,Mt=Pt.x,lt=Pt.w,Rt=!1),Pt.w=lt,Pt.h=Xe,Pt));if(!pr)return;let Ps=xa;Rt&&Mt!==void 0&&gn!==void 0&&(Ps=Vo(xa,pr,Mt,gn,!0,Ce,ue,Q,me));const No={w:pr.w,h:pr.h,x:pr.x,y:pr.y,i:We,static:!0};L(Ps,wt,pr,No,mt.e,mt.node),re(Z.compact(Ps,Q)),Oe(No)},[Ce,ue,Q,me,Z,L]),ft=N.useCallback((We,lt,Xe,mt)=>{const _t=It.current,wt=ot.current,Lt=Wo(_t,We),Rt=Z.compact(_t,Q);_(Rt,wt,Lt??null,null,mt.e,mt.node);const Mt=gt.current;ot.current=null,gt.current=null,Oe(null),pt(!1),re(Rt),Mt&&!Ss(Mt,Rt)&&E(Rt)},[Q,Z,_,E]),ze=N.useCallback(()=>{const We=It.current;if(!We.some(mt=>mt.i===Re.i)){ce(null),Oe(null),Le(void 0);return}const Xe=Z.compact(We.filter(mt=>mt.i!==Re.i),Q);re(Xe),ce(null),Oe(null),Le(void 0)},[Re.i,Q,Z]),Yt=N.useCallback(We=>{var pu;if(We.preventDefault(),We.stopPropagation(),Av&&!((pu=We.nativeEvent.target)!=null&&pu.classList.contains(eb)))return!1;const lt=G?G(We.nativeEvent):A(We);if(lt===!1)return yt&&ze(),!1;const{dragOffsetX:Xe=0,dragOffsetY:mt=0,..._t}=lt??{},wt={...Re,..._t},Lt=We.currentTarget.getBoundingClientRect(),Rt={cols:Q,margin:ie,maxRows:X,rowHeight:q,containerWidth:n,containerPadding:nt},Mt=Ci(Rt),gn=gi(wt.w,Mt,ie[0]),xa=gi(wt.h,q,ie[1]),pr=gn/2,Ps=xa/2,No=We.clientX-Lt.left+Xe-pr,Pt=We.clientY-Lt.top+mt-Ps,Ii=Math.max(0,No),va=Math.max(0,Pt),jt={left:Ii/Ge,top:va/Ge,e:We.nativeEvent};if(yt)be&&(be.left!==jt.left||be.top!==jt.top)&&Le(jt);else{const Do=y4(Rt,va,Ii,wt.w,wt.h);ce(f.jsx("div",{},wt.i)),Le(jt),re([...It.current,{...wt,x:Do.x,y:Do.y,static:!1,isDraggable:!0}])}},[yt,be,Re,G,A,ze,Ge,Q,ie,X,q,n,nt]),en=N.useCallback(We=>{We.preventDefault(),We.stopPropagation(),Zt.current--,Zt.current<0&&(Zt.current=0),Zt.current===0&&ze()},[ze]),tn=N.useCallback(We=>{We.preventDefault(),We.stopPropagation(),Zt.current++},[]),$t=N.useCallback(We=>{We.preventDefault(),We.stopPropagation();const lt=It.current,Xe=lt.find(mt=>mt.i===Re.i);Zt.current=0,ze(),C(lt,Xe,We.nativeEvent)},[Re.i,ze,C]),nn=N.useCallback((We,lt)=>{if(!We||!We.key)return null;const Xe=Wo(oe,String(We.key));if(!Xe)return null;const mt=typeof Xe.isDraggable=="boolean"?Xe.isDraggable:!Xe.static&&te,_t=typeof Xe.isResizable=="boolean"?Xe.isResizable:!Xe.static&&j,wt=Xe.resizeHandles||[...le],Lt=mt&&de&&Xe.isBounded!==!1,Rt=pe;return f.jsx(Z1,{containerWidth:n,cols:Q,margin:ie,containerPadding:nt,maxRows:X,rowHeight:q,cancel:V,handle:M,onDragStart:Dr,onDrag:Ke,onDragStop:ut,onResizeStart:Ie,onResize:Ue,onResizeStop:ft,isDraggable:mt,isResizable:_t,isBounded:Lt,useCSSTransforms:tt&&we,usePercentages:!we,transformScale:Ge,positionStrategy:c,dragThreshold:ae,w:Xe.w,h:Xe.h,x:Xe.x,y:Xe.y,i:Xe.i,minH:Xe.minH,minW:Xe.minW,maxH:Xe.maxH,maxW:Xe.maxW,static:Xe.static,droppingPosition:lt?be:void 0,resizeHandles:wt,resizeHandle:Rt,constraints:h,layoutItem:Xe,layout:oe,children:We},Xe.i)},[oe,n,Q,ie,nt,X,q,V,M,Dr,Ke,ut,Ie,Ue,ft,te,j,de,tt,we,Ge,c,ae,be,le,pe,h]),On=()=>xe?f.jsx(Z1,{w:xe.w,h:xe.h,x:xe.x,y:xe.y,i:xe.i,className:`react-grid-placeholder ${qe?"placeholder-resizing":""}`,containerWidth:n,cols:Q,margin:ie,containerPadding:nt,maxRows:X,rowHeight:q,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:tt,transformScale:Ge,constraints:h,layout:oe,children:f.jsx("div",{})}):null,$n=nr(eb,v),$r={height:yn,...D};return f.jsxs("div",{ref:S,className:$n,style:$r,onDrop:ye?$t:void 0,onDragLeave:ye?en:void 0,onDragEnter:ye?tn:void 0,onDragOver:ye?Yt:void 0,children:[Me.Children.map(t,We=>Me.isValidElement(We)?nn(We):null),ye&&yt&&nn(yt,!0),On()]})}var gD={lg:1200,md:996,sm:768,xs:480,xxs:0},bD={lg:12,md:10,sm:6,xs:4,xxs:2},Kh=()=>{};function xD(e,t,n,r){const o=[];Me.Children.forEach(t,l=>{if(!Me.isValidElement(l)||l.key===null)return;const c=String(l.key),d=e.find(h=>h.i===c);if(d)o.push({...d,i:c});else{const p=l.props["data-grid"];p?o.push({i:c,x:p.x??0,y:p.y??0,w:p.w??1,h:p.h??1,minW:p.minW,maxW:p.maxW,minH:p.minH,maxH:p.maxH,static:p.static,isDraggable:p.isDraggable,isResizable:p.isResizable,resizeHandles:p.resizeHandles,isBounded:p.isBounded}):o.push({i:c,x:0,y:Id(o),w:1,h:1})}});const i=Lm(o,{cols:n});return r.compact(i,n)}function vD(e){const{children:t,width:n,breakpoint:r,breakpoints:o=gD,cols:i=bD,layouts:l={},rowHeight:c=150,maxRows:d=1/0,margin:h=[10,10],containerPadding:p=null,compactor:y,onBreakpointChange:b=Kh,onLayoutChange:v=Kh,onWidthChange:D=Kh,...S}=e,E=y??uu("vertical"),T=E.type,k=E.allowOverlap,O=N.useMemo(()=>r??A1(o,n),[]),I=N.useMemo(()=>I1(O,i),[O,i]),L=N.useMemo(()=>$h(l,o,O,O,I,T),[]),[_,C]=N.useState(O),[A,P]=N.useState(I),[H,B]=N.useState(L),[z,Q]=N.useState(l),q=N.useRef(n),X=N.useRef(r),ie=N.useRef(o),ge=N.useRef(i),te=N.useRef(l),de=N.useRef(T),M=N.useRef(z);N.useEffect(()=>{M.current=z},[z]);const V=N.useMemo(()=>Ss(l,te.current)?null:$h(l,o,_,_,A,E),[l,o,_,A,E]),ae=V??H;N.useEffect(()=>{V!==null&&(B(V),Q(l),M.current=l,te.current=l)},[V,l]),N.useEffect(()=>{if(T!==de.current){const Ne=E.compact(ko(ae),A),G={...M.current,[_]:Ne};B(Ne),Q(G),M.current=G,v(Ne,G),de.current=T}},[T,E,ae,A,k,_,v]),N.useEffect(()=>{const Ne=n!==q.current,G=r!==X.current,Z=!Ss(o,ie.current),ue=!Ss(i,ge.current);if(Ne||G||Z||ue){const me=r??A1(o,n),Ce=I1(me,i),Re=_;if(Re!==me||Z||ue){const nt={...M.current};nt[Re]||(nt[Re]=ko(H));let we=$h(nt,o,me,Re,Ce,E);we=xD(we,t,Ce,E),nt[me]=we,C(me),P(Ce),B(we),Q(nt),M.current=nt,b(me,Ce),v(we,nt)}const tt=Ac(h,me),Ge=p?Ac(p,me):null;D(n,tt,Ce,Ge),q.current=n,X.current=r,ie.current=o,ge.current=i}},[n,r,o,i,_,A,H,t,E,T,k,h,p,b,v,D]);const j=N.useCallback(Ne=>{const Z={...M.current,[_]:Ne};B(Ne),Q(Z),M.current=Z,v(Ne,Z)},[_,v]),le=N.useMemo(()=>Ac(h,_),[h,_]),pe=N.useMemo(()=>p===null?null:Ac(p,_),[p,_]),ye=N.useMemo(()=>({cols:A,rowHeight:c,maxRows:d,margin:le,containerPadding:pe}),[A,c,d,le,pe]);return f.jsx(Iv,{...S,width:n,gridConfig:ye,compactor:E,onLayoutChange:j,layout:ae,children:t})}function Mv(e){const{children:t,width:n,cols:r=12,rowHeight:o=150,maxRows:i=1/0,margin:l=[10,10],containerPadding:c=null,layout:d,droppingItem:h,compactType:p,preventCollision:y=!1,allowOverlap:b=!1,verticalCompact:v,isDraggable:D=!0,isBounded:S=!1,draggableHandle:E,draggableCancel:T,isResizable:k=!0,resizeHandles:O=["se"],resizeHandle:I,isDroppable:L=!1,useCSSTransforms:_=!0,transformScale:C=1,autoSize:A,className:P,style:H,innerRef:B,onLayoutChange:z,onDragStart:Q,onDrag:q,onDragStop:X,onResizeStart:ie,onResize:ge,onResizeStop:te,onDrop:de,onDropDragOver:M}=e;let V=p===void 0?"vertical":p;v===!1&&(V=null);const ae={cols:r,rowHeight:o,maxRows:i,margin:l,containerPadding:c},j={enabled:D,bounded:S,handle:E,cancel:T,threshold:0},le={enabled:k,handles:O,handleComponent:I},pe={enabled:L};let ye;_?C!==1?ye=fv(C):ye=Hm:ye=dv;const Ne=uu(V,b,y),G=S?[...od,w4]:od;return f.jsx(Iv,{width:n,gridConfig:ae,dragConfig:j,resizeConfig:le,dropConfig:pe,positionStrategy:ye,compactor:Ne,constraints:G,layout:d,droppingItem:h,autoSize:A,className:P,style:H,innerRef:B,onLayoutChange:z,onDragStart:Q,onDrag:q,onDragStop:X,onResizeStart:ie,onResize:ge,onResizeStop:te,onDrop:de,onDropDragOver:M,children:t})}Mv.displayName="ReactGridLayout";var ED=Mv;function Lv(e){const{children:t,width:n,breakpoint:r,breakpoints:o,cols:i,layouts:l,onBreakpointChange:c,onLayoutChange:d,onWidthChange:h,rowHeight:p,maxRows:y,margin:b,containerPadding:v,droppingItem:D,compactType:S,preventCollision:E=!1,allowOverlap:T=!1,verticalCompact:k,isDraggable:O=!0,isBounded:I=!1,draggableHandle:L,draggableCancel:_,isResizable:C=!0,resizeHandles:A=["se"],resizeHandle:P,isDroppable:H=!1,useCSSTransforms:B=!0,transformScale:z=1,autoSize:Q,className:q,style:X,innerRef:ie,onDragStart:ge,onDrag:te,onDragStop:de,onResizeStart:M,onResize:V,onResizeStop:ae,onDrop:j,onDropDragOver:le}=e;let pe=S===void 0?"vertical":S;k===!1&&(pe=null);const ye={enabled:O,bounded:I,handle:L,cancel:_},Ne={enabled:C,handles:A,handleComponent:P},G={enabled:H};let Z;B?z!==1?Z=fv(z):Z=Hm:Z=dv;const ue=uu(pe,T,E);return f.jsx(vD,{width:n,breakpoint:r,breakpoints:o,cols:i,layouts:l,rowHeight:p,maxRows:y,margin:b,containerPadding:v,compactor:ue,dragConfig:ye,resizeConfig:Ne,dropConfig:G,positionStrategy:Z,droppingItem:D,autoSize:Q,className:q,style:X,innerRef:ie,onBreakpointChange:c,onLayoutChange:d,onWidthChange:h,onDragStart:ge,onDrag:te,onDragStop:de,onResizeStart:M,onResize:V,onResizeStop:ae,onDrop:j,onDropDragOver:le,children:t})}Lv.displayName="ResponsiveReactGridLayout";var TD=Lv;function wD(e){const t=e,n=[...e].sort((h,p)=>h.y-p.y||h.x-p.x),r=[];let o=0,i=0,l=0;for(const h of n){const p=Math.min(h.w,6);i+p>6&&(o+=l,i=0,l=0),r.push({...h,x:i,y:o,w:p}),i+=p,l=Math.max(l,h.h)}const c=[];let d=0;for(const h of n)c.push({...h,x:0,y:d,w:1}),d+=h.h;return{lg:t,md:r,sm:c}}function SD(e,t,n,r){const o=Object.values(n);if(o.length===0)return e;let i=e,l=!1;for(const c of o){if(c.sourceChart===r||!t.some(h=>h.name===c.field))continue;const d=i.filter(h=>String(h[c.field])===c.value);d.length!==i.length&&(l=!0),i=d}return l?i:e}function Rv(e,t,n,r){const o=Object.values(n).filter(i=>i.sourceChart!==r);return o.length===0?!1:o.every(i=>{const l=e.some(d=>d.name===i.field),c=t==null?void 0:t.some(d=>d.name===i.field);return!l&&!c})}function wl(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function kD(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function CD({chartRef:e}){var H,B,z,Q,q,X;const{data:t}=jx(e),{data:n,isLoading:r,error:o,isFetching:i}=e2(e),l=Tm(),c=Je(ie=>ie.crossFilters),d=N.useMemo(()=>n!=null&&n.columns?Rv(n.columns,t==null?void 0:t.parameters,c,e):!1,[n==null?void 0:n.columns,t==null?void 0:t.parameters,c,e]),h=()=>{l(e)},p=()=>{if(!n||!t)return;const ie=t.name||e;Ed(n.rows,n.columns,ie)};if(r)return f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse h-12 w-24 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})});if(o)return f.jsx(rd,{isLoading:!1,error:o,data:void 0,onRetry:h,children:f.jsx("div",{})});if(!((H=n==null?void 0:n.rows)!=null&&H[0]))return f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No data available"});const y=n.rows[0],b=t==null?void 0:t.chart;if(!((B=b==null?void 0:b.value)!=null&&B.field))return f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Invalid KPI config"});const v=y[b.value.field],D=wl(v,b.format);let S=null,E="percent_change",T,k,O;if(n.comparison)S=n.comparison.change,E=n.comparison.changeType,T=n.comparison.currentPeriodLabel,k=n.comparison.previousPeriodLabel,O=wl(n.comparison.previousValue,b.format);else if((z=b.comparison)!=null&&z.enabled&&b.comparison.field){const ie=y[b.comparison.field];E=b.comparison.type,ie&&ie!==0&&(E==="percent_change"?S=(v-ie)/ie*100:S=v-ie,O=wl(ie,b.format))}const I=b.goal,L=I&&I.value!==0?Math.max(0,Math.min(v/I.value*100,100)):null,_=I?v>=I.value?"var(--yc-color-success)":"var(--yc-color-danger)":void 0,C=t==null?void 0:t.drillDown,A=!!(C!=null&&C.chart||C!=null&&C.model),P=()=>{if(!C)return;const ie=new URLSearchParams({_from:e});C.chart?window.location.hash=`/charts/${C.chart}?${ie.toString()}`:C.model&&(window.location.hash=`/charts/${e}/detail?${ie.toString()}`)};return f.jsxs("div",{className:"h-full flex flex-col p-4 group relative",style:{containerType:"size"},children:[f.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity z-10",children:f.jsx(rv,{onRefresh:h,onExportCSV:p,onExportPNG:p,onExportSVG:p,isRefreshing:i,hideImageExport:!0})}),f.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[f.jsx("a",{href:`#/charts/${e}`,className:"text-sm hover:underline line-clamp-2",style:{color:"var(--yc-color-text-secondary)"},children:t==null?void 0:t.title}),A&&f.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[f.jsx("title",{children:"Click value to drill down"}),f.jsx("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"})]}),d&&f.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:"Not filtered"})]}),f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center min-h-0",children:[f.jsxs("div",{className:nr("font-bold leading-none text-center",A&&"cursor-pointer hover:opacity-75 transition-opacity"),style:{color:"var(--yc-color-text)",fontSize:"clamp(1.25rem, min(40cqh, 14cqw), 8rem)"},onClick:A?P:void 0,role:A?"button":void 0,tabIndex:A?0:void 0,onKeyDown:A?ie=>{(ie.key==="Enter"||ie.key===" ")&&P()}:void 0,children:[D,b.unit&&f.jsx("span",{className:"font-normal ml-1",style:{fontSize:"0.5em",color:"var(--yc-color-text-muted)"},children:b.unit})]}),T&&f.jsx("div",{className:"text-xs mt-1.5 truncate",style:{color:"var(--yc-color-text-muted)"},children:T}),S!==null&&f.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap justify-center relative group/comparison kpi-comparison",children:[f.jsx("span",{className:"text-sm font-medium px-2 py-0.5 rounded",style:S>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:kD(S,E)}),O&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:["vs ",O]}),!O&&((Q=b.comparison)==null?void 0:Q.label)&&f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:b.comparison.label}),(k||O||((q=b.comparison)==null?void 0:q.label))&&f.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1.5 hidden group-hover/comparison:block z-50 pointer-events-none",children:f.jsxs("div",{className:"kpi-tooltip text-xs rounded-md px-3 py-2 shadow-lg whitespace-nowrap",children:[k&&f.jsx("div",{className:"font-medium",children:k}),!k&&((X=b.comparison)==null?void 0:X.label)&&f.jsx("div",{className:"font-medium",children:b.comparison.label}),O&&f.jsxs("div",{style:{opacity:.75},className:"mt-0.5",children:["Previous: ",O]})]})})]}),I&&L!==null&&f.jsxs("div",{className:"mt-2 w-full max-w-[200px]",children:[I.show_progress&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:[f.jsxs("span",{children:[wl(v,b.format)," / ",wl(I.value,b.format)]}),f.jsxs("span",{children:[L.toFixed(0),"%"]})]}),f.jsx("div",{className:"w-full h-1.5 rounded-full",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:f.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${L}%`,backgroundColor:_}})})]}),I.label&&f.jsx("div",{className:"text-xs mt-1 text-center",style:{color:"var(--yc-color-text-muted)"},children:I.label})]})]})]})}function _D({chartRef:e}){var G,Z,ue,me,Ce,Re,tt,Ge,nt;const{data:t,isLoading:n,isFetching:r,error:o}=l_(e),{data:i}=ma(),l=t==null?void 0:t.config,c=t,d=Tm(),h=N.useRef(null),[p,y]=N.useState(!1),b=Je(we=>we.chartFilters),v=Je(we=>we.resetChartFilters),D=Je(we=>we.crossFilters),S=Je(we=>we.setCrossFilter),{events:E}=r2(e),T=So(we=>we.auth),k=Wn(),[O,I]=N.useState(null),L=T.status==="disabled"||T.status==="authenticated"&&(T.user.role==="admin"||T.user.role==="editor"),_=((Z=(G=l==null?void 0:l.chart)==null?void 0:G.x)==null?void 0:Z.type)==="temporal",C=Ka({mutationFn:we=>xt.createChartEvent({date:we.date,label:we.label,...we.color?{color:we.color}:{}}),onSuccess:()=>{k.invalidateQueries({queryKey:["chartEvents"]}),I(null)}}),A=b[e]&&Object.keys(b[e]).length>0,P=N.useMemo(()=>{for(const we of Object.values(D))if(we.sourceChart===e)return{field:we.field,value:we.value};return null},[D,e]),H=N.useMemo(()=>!(c!=null&&c.rows)||!(c!=null&&c.columns)?(c==null?void 0:c.rows)??[]:SD(c.rows,c.columns,D,e),[c==null?void 0:c.rows,c==null?void 0:c.columns,D,e]),B=N.useMemo(()=>c!=null&&c.columns?Rv(c.columns,l==null?void 0:l.parameters,D,e):!1,[c==null?void 0:c.columns,l==null?void 0:l.parameters,D,e]),[z,Q]=N.useState(null),q=N.useCallback((we,je,oe,re)=>{var Oe;let xe;if(re&&((Oe=l==null?void 0:l.chart)!=null&&Oe.series)&&"field"in l.chart.series){const qe=l.chart.series.field;qe&&qe!==we&&(xe={[we]:je,[qe]:re})}Q({x:oe.x,y:oe.y,field:we,value:je,allFields:xe})},[l]),X=N.useCallback(()=>{var we,je,oe,re;if(z)if(z.allFields)for(const[xe,Oe]of Object.entries(z.allFields)){const qe=((je=(we=l==null?void 0:l.chart)==null?void 0:we.x)==null?void 0:je.type)==="temporal"&&xe===l.chart.x.field;S(xe,Oe,e,qe||void 0)}else{const xe=((re=(oe=l==null?void 0:l.chart)==null?void 0:oe.x)==null?void 0:re.type)==="temporal"&&z.field===l.chart.x.field;S(z.field,z.value,e,xe||void 0)}},[z,S,e,l]),ie=N.useCallback(()=>{z&&I(z.value)},[z]),ge=N.useCallback(()=>{var re,xe,Oe;if(!z||!((re=l==null?void 0:l.drillDown)!=null&&re.model))return;const we=l.drillDown,je=we.fields?typeof we.fields=="string"?we.fields:we.fields[0]:we.field??((Oe=(xe=l.chart)==null?void 0:xe.x)==null?void 0:Oe.field)??z.field,oe=new URLSearchParams;if(z.allFields)for(const[qe,pt]of Object.entries(z.allFields))oe.set(qe,pt);else oe.set(je,z.value);oe.set("_from",e),window.location.hash=`/charts/${e}/detail?${oe.toString()}`,Q(null)},[z,l,e]),te=N.useCallback(()=>{var re,xe,Oe;if(!z||!((re=l==null?void 0:l.drillDown)!=null&&re.chart))return;const we=l.drillDown,je=we.fields?typeof we.fields=="string"?we.fields:we.fields[0]:we.field??((Oe=(xe=l.chart)==null?void 0:xe.x)==null?void 0:Oe.field)??z.field,oe=new URLSearchParams;if(z.allFields)for(const[qe,pt]of Object.entries(z.allFields))oe.set(qe,pt);else oe.set(je,z.value);oe.set("_from",e),window.location.hash=`/charts/${l.drillDown.chart}?${oe.toString()}`,Q(null)},[z,l,e]),de=()=>{d(e)},M=()=>{v(e),y(!1)},V=()=>{if(!c||!l)return;const we=l.name||e;Ed(H,c.columns,we)},ae=()=>{var je;const we=(je=h.current)==null?void 0:je.getDataURL("png");we&&l&&Zc(we,`${l.name||e}.png`)},j=()=>{var je;const we=(je=h.current)==null?void 0:je.getDataURL("svg");we&&l&&Zc(we,`${l.name||e}.svg`)},le=async()=>{var je;const we=(je=h.current)==null?void 0:je.getDataURL("png");we&&l&&await L3(we,l.name||e,l.title)};if(!l&&o)return f.jsx(rd,{isLoading:!1,error:o,data:void 0,onRetry:()=>d(e),children:f.jsx("div",{})});if(!l||!c)return n?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("div",{className:"animate-pulse w-full h-full rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})}):f.jsxs("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:["Chart not found: ",e]});if(((ue=l.chart)==null?void 0:ue.type)==="kpi")return f.jsx(CD,{chartRef:e});const pe=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(l.chart.type),ye=()=>{switch(l.chart.type){case"line":return!l.chart.x||!l.chart.y&&!l.chart.series?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(q2,{ref:h,data:H,columns:c.columns,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P,events:E,goalData:c.goalData});case"bar":return!l.chart.x||!l.chart.y&&!l.chart.series?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(V2,{ref:h,data:H,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P,events:E,goalData:c.goalData});case"area":return!l.chart.x||!l.chart.y&&!l.chart.series?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(Q2,{ref:h,data:H,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P,events:E,goalData:c.goalData});case"pie":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(G2,{ref:h,data:H,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P});case"donut":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(K2,{ref:h,data:H,xAxis:l.chart.x,yAxis:l.chart.y,centerValue:l.chart.centerValue,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P});case"scatter":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(X2,{ref:h,data:H,xAxis:l.chart.x,yAxis:l.chart.y,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P});case"table":return f.jsx(B0,{data:H,columns:c.columns,chartConfig:l.chart,height:"100%",loading:r,onRowClick:l!=null&&l.drillDown?(we,je,oe)=>{const re=l.drillDown,xe=re.fields?typeof re.fields=="string"?[re.fields]:re.fields:re.field?[re.field]:[];if(xe.length===0)return;const Oe={};for(const qe of xe)qe in we?Oe[qe]=String(we[qe]??""):oe?Oe[qe]=oe:Oe[qe]="";Q({x:je.x,y:je.y,field:xe[0],value:Oe[xe[0]],allFields:xe.length>1?Oe:void 0})}:void 0});case"metric":return l.chart.y?f.jsx(l4,{data:H,yAxis:l.chart.y,title:l.title,loading:r}):f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing value configuration"});case"combo":return l.chart.x?f.jsx(J2,{ref:h,data:H,xAxis:l.chart.x,chartConfig:l.chart,theme:i==null?void 0:i.theme,height:"100%",loading:r,onChartClick:q,activeCrossFilter:P,events:E,goalData:c.goalData}):f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"});case"heatmap":return!l.chart.x||!l.chart.y?f.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):f.jsx(Z2,{ref:h,data:H,chartConfig:l.chart,height:"100%",loading:r});case"funnel":return f.jsx(ev,{ref:h,data:H,chartConfig:l.chart,height:"100%",loading:r});case"waterfall":return f.jsx(tv,{ref:h,data:H,chartConfig:l.chart,height:"100%",loading:r});case"gauge":return f.jsx(nv,{ref:h,data:H,chartConfig:l.chart,height:"100%",loading:r});default:return f.jsxs("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',l.chart.type,'" not yet implemented']})}},Ne=l.parameters&&l.parameters.length>0;return f.jsx(Am,{fallback:(we,je)=>f.jsx("div",{className:"h-full flex items-center justify-center p-4",children:f.jsxs("div",{className:"text-center",children:[f.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),f.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:we.message}),f.jsx("button",{onClick:je,className:"mt-2 text-xs text-blue-600 hover:text-blue-700",children:"Retry"})]})}),resetKey:e,children:f.jsxs("div",{className:"h-full p-2 flex flex-col group",children:[f.jsxs("div",{className:"flex items-center justify-between mb-2 px-2 flex-shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("a",{href:`#/charts/${e}`,className:"text-sm font-medium hover:underline",style:{color:"var(--yc-color-text)"},children:l.title}),(((me=l==null?void 0:l.drillDown)==null?void 0:me.chart)||((Ce=l==null?void 0:l.drillDown)==null?void 0:Ce.model))&&f.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[f.jsx("title",{children:"Click chart to drill down"}),f.jsx("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"})]}),A&&f.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:"Filtered"}),B&&!A&&f.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:"Not filtered"})]}),f.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[Ne&&f.jsx("button",{onClick:()=>y(!p),className:`p-1.5 rounded hover:bg-black/5 ${p?"bg-black/5":""}`,title:p?"Hide filters":"Override filters",children:f.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-secondary)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})})}),f.jsx(rv,{onRefresh:de,onExportCSV:V,onExportPNG:pe?ae:V,onExportSVG:pe?j:V,onExportPDF:pe?le:void 0,isRefreshing:r})]})]}),p&&Ne&&f.jsx("div",{className:"mb-2 px-2 flex-shrink-0",children:f.jsxs("div",{className:"flex items-end gap-2 flex-wrap",children:[f.jsx(P2,{parameters:l.parameters,chartName:e}),A&&f.jsx("button",{onClick:M,className:"px-2 py-1.5 text-xs hover:bg-black/5 rounded",style:{color:"var(--yc-color-text-secondary)"},children:"Reset to dashboard"})]})}),f.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:f.jsx(rd,{isLoading:n,error:o,data:H,onRetry:()=>d(e),children:ye()})}),z&&f.jsx(sv,{x:z.x,y:z.y,field:z.field,value:z.value,allFields:z.allFields,onFilter:X,onViewDetails:(Re=l==null?void 0:l.drillDown)!=null&&Re.model?ge:void 0,onGoToChart:(tt=l==null?void 0:l.drillDown)!=null&&tt.chart?te:void 0,onAddEvent:L?ie:void 0,detailModel:(Ge=l==null?void 0:l.drillDown)==null?void 0:Ge.model,targetChart:(nt=l==null?void 0:l.drillDown)==null?void 0:nt.chart,isTemporalChart:_,onClose:()=>Q(null)}),O&&f.jsx(ov,{date:O,onSave:we=>C.mutate(we),onClose:()=>I(null),saving:C.isPending})]})})}function nb(e){const t=[],n=String(e||"");let r=n.indexOf(","),o=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const l=n.slice(o,r).trim();(l||!i)&&t.push(l),o=r+1,r=n.indexOf(",",o)}return t}function Pv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ND=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DD=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OD={};function rb(e,t){return(OD.jsx?DD:ND).test(e)}const AD=/[ \t\n\f\r]/g;function ID(e){return typeof e=="object"?e.type==="text"?sb(e.value):!1:sb(e)}function sb(e){return e.replace(AD,"")===""}class cu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}cu.prototype.normal={};cu.prototype.property={};cu.prototype.space=void 0;function jv(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new cu(n,r,t)}function Vl(e){return e.toLowerCase()}class sr{constructor(t,n){this.attribute=n,this.property=t}}sr.prototype.attribute="";sr.prototype.booleanish=!1;sr.prototype.boolean=!1;sr.prototype.commaOrSpaceSeparated=!1;sr.prototype.commaSeparated=!1;sr.prototype.defined=!1;sr.prototype.mustUseProperty=!1;sr.prototype.number=!1;sr.prototype.overloadedBoolean=!1;sr.prototype.property="";sr.prototype.spaceSeparated=!1;sr.prototype.space=void 0;let MD=0;const ct=ga(),pn=ga(),z0=ga(),_e=ga(),Bt=ga(),Xa=ga(),ur=ga();function ga(){return 2**++MD}const W0=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:pn,commaOrSpaceSeparated:ur,commaSeparated:Xa,number:_e,overloadedBoolean:z0,spaceSeparated:Bt},Symbol.toStringTag,{value:"Module"})),Xh=Object.keys(W0);class Ym extends sr{constructor(t,n,r,o){let i=-1;if(super(t,n),ob(this,"space",o),typeof r=="number")for(;++i<Xh.length;){const l=Xh[i];ob(this,Xh[i],(r&W0[l])===W0[l])}}}Ym.prototype.defined=!0;function ob(e,t,n){n&&(e[t]=n)}function _i(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Ym(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Vl(r)]=r,n[Vl(i.attribute)]=r}return new cu(t,n,e.space)}const Fv=_i({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:Bt,ariaCurrent:null,ariaDescribedBy:Bt,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:Bt,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:Bt,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bt,ariaLevel:_e,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:Bt,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:Bt,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:pn,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Bv(e,t){return t in e?e[t]:t}function Hv(e,t){return Bv(e,t.toLowerCase())}const LD=_i({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xa,acceptCharset:Bt,accessKey:Bt,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:Bt,autoFocus:ct,autoPlay:ct,blocking:Bt,capture:null,charSet:null,checked:ct,cite:null,className:Bt,cols:_e,colSpan:null,content:null,contentEditable:pn,controls:ct,controlsList:Bt,coords:_e|Xa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:z0,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:Bt,height:_e,hidden:z0,high:_e,href:null,hrefLang:null,htmlFor:Bt,httpEquiv:Bt,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:Bt,itemRef:Bt,itemScope:ct,itemType:Bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ct,optimum:_e,pattern:null,ping:Bt,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:Bt,required:ct,reversed:ct,rows:_e,rowSpan:_e,sandbox:Bt,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootClonable:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:pn,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bt,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:Hv}),RD=_i({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ur,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:Bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xa,g2:Xa,glyphName:Xa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_e,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ur,rev:ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ur,requiredFeatures:ur,requiredFonts:ur,requiredFormats:ur,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ur,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Bv}),Uv=_i({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),zv=_i({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hv}),Wv=_i({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),PD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},jD=/[A-Z]/g,ab=/-[a-z]/g,FD=/^data[-\w.:]+$/i;function Bd(e,t){const n=Vl(t);let r=t,o=sr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&FD.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ab,HD);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ab.test(i)){let l=i.replace(jD,BD);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=Ym}return new o(r,t)}function BD(e){return"-"+e.toLowerCase()}function HD(e){return e.charAt(1).toUpperCase()}const du=jv([Fv,LD,Uv,zv,Wv],"html"),Co=jv([Fv,RD,Uv,zv,Wv],"svg");function ib(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Yv(e){return e.join(" ").trim()}var qa={},Jh,lb;function UD(){if(lb)return Jh;lb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
109
+ `,h="/",p="*",y="",b="comment",v="declaration";function D(E,T){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];T=T||{};var k=1,O=1;function I(q){var X=q.match(t);X&&(k+=X.length);var ie=q.lastIndexOf(d);O=~ie?q.length-ie:O+q.length}function L(){var q={line:k,column:O};return function(X){return X.position=new _(q),P(),X}}function _(q){this.start=q,this.end={line:k,column:O},this.source=T.source}_.prototype.content=E;function C(q){var X=new Error(T.source+":"+k+":"+O+": "+q);if(X.reason=q,X.filename=T.source,X.line=k,X.column=O,X.source=E,!T.silent)throw X}function A(q){var X=q.exec(E);if(X){var ie=X[0];return I(ie),E=E.slice(ie.length),X}}function P(){A(n)}function H(q){var X;for(q=q||[];X=B();)X!==!1&&q.push(X);return q}function B(){var q=L();if(!(h!=E.charAt(0)||p!=E.charAt(1))){for(var X=2;y!=E.charAt(X)&&(p!=E.charAt(X)||h!=E.charAt(X+1));)++X;if(X+=2,y===E.charAt(X-1))return C("End of comment missing");var ie=E.slice(2,X-2);return O+=2,I(ie),E=E.slice(X),O+=2,q({type:b,comment:ie})}}function z(){var q=L(),X=A(r);if(X){if(B(),!A(o))return C("property missing ':'");var ie=A(i),ge=q({type:v,property:S(X[0].replace(e,y)),value:ie?S(ie[0].replace(e,y)):y});return A(l),ge}}function Q(){var q=[];H(q);for(var X;X=z();)X!==!1&&(q.push(X),H(q));return q}return P(),Q()}function S(E){return E?E.replace(c,y):y}return Jh=D,Jh}var ub;function zD(){if(ub)return qa;ub=1;var e=qa&&qa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qa,"__esModule",{value:!0}),qa.default=n;const t=e(UD());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const l=(0,t.default)(r),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:p}=d;c?o(h,p,d):p&&(i=i||{},i[h]=p)}),i}return qa}var Sl={},cb;function WD(){if(cb)return Sl;cb=1,Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(h){return!h||n.test(h)||e.test(h)},l=function(h,p){return p.toUpperCase()},c=function(h,p){return"".concat(p,"-")},d=function(h,p){return p===void 0&&(p={}),i(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(o,c):h=h.replace(r,c),h.replace(t,l))};return Sl.camelCase=d,Sl}var kl,db;function YD(){if(db)return kl;db=1;var e=kl&&kl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(zD()),n=WD();function r(o,i){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,i)]=d)}),l}return r.default=r,kl=r,kl}var $D=YD();const qD=xx($D),Hd=$v("end"),fs=$v("start");function $v(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function VD(e){const t=fs(e),n=Hd(e);if(t&&n)return{start:t,end:n}}function Pl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fb(e.position):"start"in e||"end"in e?fb(e):"line"in e||"column"in e?Y0(e):""}function Y0(e){return hb(e&&e.line)+":"+hb(e&&e.column)}function fb(e){return Y0(e&&e.start)+"-"+Y0(e&&e.end)}function hb(e){return e&&typeof e=="number"?e:1}class Fn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(l=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?i.ruleId=r:(i.source=r.slice(0,d),i.ruleId=r.slice(d+1))}if(!i.place&&i.ancestors&&i.ancestors){const d=i.ancestors[i.ancestors.length-1];d&&(i.place=d.position)}const c=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Pl(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Fn.prototype.file="";Fn.prototype.name="";Fn.prototype.reason="";Fn.prototype.message="";Fn.prototype.stack="";Fn.prototype.column=void 0;Fn.prototype.line=void 0;Fn.prototype.ancestors=void 0;Fn.prototype.cause=void 0;Fn.prototype.fatal=void 0;Fn.prototype.place=void 0;Fn.prototype.ruleId=void 0;Fn.prototype.source=void 0;const $m={}.hasOwnProperty,QD=new Map,GD=/[A-Z]/g,KD=new Set(["table","tbody","thead","tfoot","tr"]),XD=new Set(["td","th"]),qv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function JD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=aO(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=oO(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Co:du,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Vv(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Vv(e,t,n){if(t.type==="element")return ZD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return eO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nO(e,t,n);if(t.type==="mdxjsEsm")return tO(e,t);if(t.type==="root")return rO(e,t,n);if(t.type==="text")return sO(e,t)}function ZD(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Co,e.schema=o),e.ancestors.push(t);const i=Gv(e,t.tagName,!1),l=iO(e,t);let c=Vm(e,t);return KD.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!ID(d):!0})),Qv(e,l,i,t),qm(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function eO(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ql(e,t.position)}function tO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ql(e,t.position)}function nO(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Co,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Gv(e,t.name,!0),l=lO(e,t),c=Vm(e,t);return Qv(e,l,i,t),qm(l,c),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}function rO(e,t,n){const r={};return qm(r,Vm(e,t)),e.create(t,e.Fragment,r,n)}function sO(e,t){return t.value}function Qv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function oO(e,t,n){return r;function r(o,i,l,c){const h=Array.isArray(l.children)?n:t;return c?h(i,l,c):h(i,l)}}function aO(e,t){return n;function n(r,o,i,l){const c=Array.isArray(i.children),d=fs(r);return t(o,i,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function iO(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&$m.call(t.properties,o)){const i=uO(e,o,t.properties[o]);if(i){const[l,c]=i;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&XD.has(t.tagName)?r=c:n[l]=c}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lO(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Ql(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,i=e.evaluater.evaluateExpression(c.expression)}else Ql(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Vm(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:QD;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const d=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(d){const h=o.get(d)||0;l=d+"-"+h,o.set(d,h+1)}}const c=Vv(e,i,l);c!==void 0&&n.push(c)}return n}function uO(e,t,n){const r=Bd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Pv(n):Yv(n)),r.property==="style"){let o=typeof n=="object"?n:cO(e,String(n));return e.stylePropertyNameCase==="css"&&(o=dO(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?PD[r.property]||r.property:r.attribute,n]}}function cO(e,t){try{return qD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=qv+"#cannot-parse-style-attribute",o}}function Gv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,l;for(;++i<o.length;){const c=rb(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}r=l}else r=rb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return $m.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ql(e)}function Ql(e,t){const n=new Fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=qv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dO(e){const t={};let n;for(n in e)$m.call(e,n)&&(t[fO(n)]=e[n]);return t}function fO(e){let t=e.replace(GD,hO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function hO(e){return"-"+e.toLowerCase()}const Zh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mO={};function pO(e,t){const n=mO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Kv(e,r,o)}function Kv(e,t,n){if(yO(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mb(e.children,t,n)}return Array.isArray(e)?mb(e,t,n):""}function mb(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Kv(e[o],t,n);return r.join("")}function yO(e){return!!(e&&typeof e=="object")}const pb=document.createElement("i");function Qm(e){const t="&"+e+";";pb.innerHTML=t;const n=pb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function us(e,t,n,r){const o=e.length;let i=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)l=r.slice(i,i+1e4),l.unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function _r(e,t){return e.length>0?(us(e,e.length,0,t),e):t}const yb={}.hasOwnProperty;function gO(e){const t={};let n=-1;for(;++n<e.length;)bO(t,e[n]);return t}function bO(e,t){let n;for(n in t){const o=(yb.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let l;if(i)for(l in i){yb.call(o,l)||(o[l]=[]);const c=i[l];xO(o[l],Array.isArray(c)?c:c?[c]:[])}}}function xO(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);us(e,0,0,r)}function Xv(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ja(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const as=_o(/[A-Za-z]/),fr=_o(/[\dA-Za-z]/),vO=_o(/[#-'*+\--9=?A-Z^-~]/);function $0(e){return e!==null&&(e<32||e===127)}const q0=_o(/\d/),EO=_o(/[\dA-Fa-f]/),TO=_o(/[!-/:-@[-`{-~]/);function it(e){return e!==null&&e<-2}function rr(e){return e!==null&&(e<0||e===32)}function kt(e){return e===-2||e===-1||e===32}const wO=_o(new RegExp("\\p{P}|\\p{S}","u")),SO=_o(/\s/);function _o(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ni(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(i===37&&fr(e.charCodeAt(n+1))&&fr(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const c=e.charCodeAt(n+1);i<56320&&c>56319&&c<57344?(l=String.fromCharCode(i,c),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Ht(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(d){return kt(d)?(e.enter(n),c(d)):t(d)}function c(d){return kt(d)&&i++<o?(e.consume(d),c):(e.exit(n),t(d))}}const kO={tokenize:CO};function CO(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ht(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),i(c)}function i(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return it(c)?(e.consume(c),e.exit("chunkText"),i):(e.consume(c),l)}}const _O={tokenize:NO},gb={tokenize:DO};function NO(e){const t=this,n=[];let r=0,o,i,l;return c;function c(O){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,d,h)(O)}return h(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&k();const I=t.events.length;let L=I,_;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){_=t.events[L][1].end;break}T(r);let C=I;for(;C<t.events.length;)t.events[C][1].end={..._},C++;return us(t.events,L+1,0,t.events.slice(I)),t.events.length=C,h(O)}return c(O)}function h(O){if(r===n.length){if(!o)return b(O);if(o.currentConstruct&&o.currentConstruct.concrete)return D(O);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(gb,p,y)(O)}function p(O){return o&&k(),T(r),b(O)}function y(O){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,D(O)}function b(O){return t.containerState={},e.attempt(gb,v,D)(O)}function v(O){return r++,n.push([t.currentConstruct,t.containerState]),b(O)}function D(O){if(O===null){o&&k(),T(0),e.consume(O);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),S(O)}function S(O){if(O===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(O);return}return it(O)?(e.consume(O),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(O),S)}function E(O,I){const L=t.sliceStream(O);if(I&&L.push(null),O.previous=i,i&&(i.next=O),i=O,o.defineSkip(O.start),o.write(L),t.parser.lazy[O.start.line]){let _=o.events.length;for(;_--;)if(o.events[_][1].start.offset<l&&(!o.events[_][1].end||o.events[_][1].end.offset>l))return;const C=t.events.length;let A=C,P,H;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(P){H=t.events[A][1].end;break}P=!0}for(T(r),_=C;_<t.events.length;)t.events[_][1].end={...H},_++;us(t.events,A+1,0,t.events.slice(C)),t.events.length=_}}function T(O){let I=n.length;for(;I-- >O;){const L=n[I];t.containerState=L[1],L[0].exit.call(t,e)}n.length=O}function k(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function DO(e,t,n){return Ht(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bb(e){if(e===null||rr(e)||SO(e))return 1;if(wO(e))return 2}function Gm(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const V0={name:"attention",resolveAll:OO,tokenize:AO};function OO(e,t){let n=-1,r,o,i,l,c,d,h,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[r][1].end},b={...e[n][1].start};xb(y,-d),xb(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:y,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},i={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=_r(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=_r(h,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",i,t]]),h=_r(h,Gm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=_r(h,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=_r(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,us(e,r-1,n-r+3,h),n=r+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function AO(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=bb(r);let i;return l;function l(d){return i=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===i)return e.consume(d),c;const h=e.exit("attentionSequence"),p=bb(d),y=!p||p===2&&o||n.includes(d),b=!o||o===2&&p||n.includes(r);return h._open=!!(i===42?y:y&&(o||!b)),h._close=!!(i===42?b:b&&(p||!y)),t(d)}}function xb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const IO={name:"autolink",tokenize:MO};function MO(e,t,n){let r=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(v){return as(v)?(e.consume(v),l):v===64?n(v):h(v)}function l(v){return v===43||v===45||v===46||fr(v)?(r=1,c(v)):h(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||fr(v))&&r++<32?(e.consume(v),c):(r=0,h(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||$0(v)?n(v):(e.consume(v),d)}function h(v){return v===64?(e.consume(v),p):vO(v)?(e.consume(v),h):n(v)}function p(v){return fr(v)?y(v):n(v)}function y(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||fr(v))&&r++<63){const D=v===45?b:y;return e.consume(v),D}return n(v)}}const Ud={partial:!0,tokenize:LO};function LO(e,t,n){return r;function r(i){return kt(i)?Ht(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||it(i)?t(i):n(i)}}const Jv={continuation:{tokenize:PO},exit:jO,name:"blockQuote",tokenize:RO};function RO(e,t,n){const r=this;return o;function o(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),i}return n(l)}function i(l){return kt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function PO(e,t,n){const r=this;return o;function o(l){return kt(l)?Ht(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return e.attempt(Jv,t,n)(l)}}function jO(e){e.exit("blockQuote")}const Zv={name:"characterEscape",tokenize:FO};function FO(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return TO(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const eE={name:"characterReference",tokenize:BO};function BO(e,t,n){const r=this;let o=0,i,l;return c;function c(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),d}function d(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),i=31,l=fr,p(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,l=EO,p):(e.enter("characterReferenceValue"),i=7,l=q0,p(y))}function p(y){if(y===59&&o){const b=e.exit("characterReferenceValue");return l===fr&&!Qm(r.sliceSerialize(b))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(y)&&o++<i?(e.consume(y),p):n(y)}}const vb={partial:!0,tokenize:UO},Eb={concrete:!0,name:"codeFenced",tokenize:HO};function HO(e,t,n){const r=this,o={partial:!0,tokenize:L};let i=0,l=0,c;return d;function d(_){return h(_)}function h(_){const C=r.events[r.events.length-1];return i=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,c=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(_)}function p(_){return _===c?(l++,e.consume(_),p):l<3?n(_):(e.exit("codeFencedFenceSequence"),kt(_)?Ht(e,y,"whitespace")(_):y(_))}function y(_){return _===null||it(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(vb,S,I)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===null||it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(_)):kt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ht(e,v,"whitespace")(_)):_===96&&_===c?n(_):(e.consume(_),b)}function v(_){return _===null||it(_)?y(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),D(_))}function D(_){return _===null||it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(_)):_===96&&_===c?n(_):(e.consume(_),D)}function S(_){return e.attempt(o,I,E)(_)}function E(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),T}function T(_){return i>0&&kt(_)?Ht(e,k,"linePrefix",i+1)(_):k(_)}function k(_){return _===null||it(_)?e.check(vb,S,I)(_):(e.enter("codeFlowValue"),O(_))}function O(_){return _===null||it(_)?(e.exit("codeFlowValue"),k(_)):(e.consume(_),O)}function I(_){return e.exit("codeFenced"),t(_)}function L(_,C,A){let P=0;return H;function H(X){return _.enter("lineEnding"),_.consume(X),_.exit("lineEnding"),B}function B(X){return _.enter("codeFencedFence"),kt(X)?Ht(_,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):z(X)}function z(X){return X===c?(_.enter("codeFencedFenceSequence"),Q(X)):A(X)}function Q(X){return X===c?(P++,_.consume(X),Q):P>=l?(_.exit("codeFencedFenceSequence"),kt(X)?Ht(_,q,"whitespace")(X):q(X)):A(X)}function q(X){return X===null||it(X)?(_.exit("codeFencedFence"),C(X)):A(X)}}}function UO(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const e0={name:"codeIndented",tokenize:WO},zO={partial:!0,tokenize:YO};function WO(e,t,n){const r=this;return o;function o(h){return e.enter("codeIndented"),Ht(e,i,"linePrefix",5)(h)}function i(h){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):it(h)?e.attempt(zO,l,d)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||it(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function d(h){return e.exit("codeIndented"),t(h)}}function YO(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):Ht(e,i,"linePrefix",5)(l)}function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):it(l)?o(l):n(l)}}const $O={name:"codeText",previous:VO,resolve:qO,tokenize:QO};function qO(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function VO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function QO(e,t,n){let r=0,o,i;return l;function l(y){return e.enter("codeText"),e.enter("codeTextSequence"),c(y)}function c(y){return y===96?(e.consume(y),r++,c):(e.exit("codeTextSequence"),d(y))}function d(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),d):y===96?(i=e.enter("codeTextSequence"),o=0,p(y)):it(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||it(y)?(e.exit("codeTextData"),d(y)):(e.consume(y),h)}function p(y){return y===96?(e.consume(y),o++,p):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(i.type="codeTextData",h(y))}}class GO{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Cl(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Cl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Cl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Cl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Cl(this.left,n.reverse())}}}function Cl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tE(e){const t={};let n=-1,r,o,i,l,c,d,h;const p=new GO(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,i=0,i<d.length&&d[i][1].type==="lineEndingBlank"&&(i+=2),i<d.length&&d[i][1].type==="content"))for(;++i<d.length&&d[i][1].type!=="content";)d[i][1].type==="chunkText"&&(d[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,KO(p,n)),n=t[n],h=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(l=p.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(r),p.splice(o,n-o+1,c))}}return us(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function KO(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],h={};let p,y,b=-1,v=n,D=0,S=0;const E=[S];for(;v;){for(;e.get(++o)[1]!==v;);i.push(o),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),y&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),y=v,v=v.next}for(v=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(S=b+1,E.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):E.pop(),b=E.length;b--;){const T=c.slice(E[b],E[b+1]),k=i.pop();d.push([k,k+T.length-1]),e.splice(k,2,T)}for(d.reverse(),b=-1;++b<d.length;)h[D+d[b][0]]=D+d[b][1],D+=d[b][1]-d[b][0]-1;return h}const XO={resolve:ZO,tokenize:e6},JO={partial:!0,tokenize:t6};function ZO(e){return tE(e),e}function e6(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?i(c):it(c)?e.check(JO,l,i)(c):(e.consume(c),o)}function i(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function t6(e,t,n){const r=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ht(e,i,"linePrefix")}function i(l){if(l===null||it(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function nE(e,t,n,r,o,i,l,c,d){const h=d||Number.POSITIVE_INFINITY;let p=0;return y;function y(T){return T===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(T),e.exit(i),b):T===null||T===32||T===41||$0(T)?n(T):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(T))}function b(T){return T===62?(e.enter(i),e.consume(T),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===62?(e.exit("chunkString"),e.exit(c),b(T)):T===null||T===60||it(T)?n(T):(e.consume(T),T===92?D:v)}function D(T){return T===60||T===62||T===92?(e.consume(T),v):v(T)}function S(T){return!p&&(T===null||T===41||rr(T))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(T)):p<h&&T===40?(e.consume(T),p++,S):T===41?(e.consume(T),p--,S):T===null||T===32||T===40||$0(T)?n(T):(e.consume(T),T===92?E:S)}function E(T){return T===40||T===41||T===92?(e.consume(T),S):S(T)}}function rE(e,t,n,r,o,i){const l=this;let c=0,d;return h;function h(v){return e.enter(r),e.enter(o),e.consume(v),e.exit(o),e.enter(i),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(i),e.enter(o),e.consume(v),e.exit(o),e.exit(r),t):it(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===null||v===91||v===93||it(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!kt(v)),v===92?b:y)}function b(v){return v===91||v===92||v===93?(e.consume(v),c++,y):y(v)}}function sE(e,t,n,r,o,i){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(r),e.enter(o),e.consume(b),e.exit(o),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(o),e.consume(b),e.exit(o),e.exit(r),t):(e.enter(i),h(b))}function h(b){return b===l?(e.exit(i),d(l)):b===null?n(b):it(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Ht(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===l||b===null||it(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?y:p)}function y(b){return b===l||b===92?(e.consume(b),p):p(b)}}function jl(e,t){let n;return r;function r(o){return it(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):kt(o)?Ht(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const n6={name:"definition",tokenize:s6},r6={partial:!0,tokenize:o6};function s6(e,t,n){const r=this;let o;return i;function i(v){return e.enter("definition"),l(v)}function l(v){return rE.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return o=Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return rr(v)?jl(e,h)(v):h(v)}function h(v){return nE(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(r6,y,y)(v)}function y(v){return kt(v)?Ht(e,b,"whitespace")(v):b(v)}function b(v){return v===null||it(v)?(e.exit("definition"),r.parser.defined.push(o),t(v)):n(v)}}function o6(e,t,n){return r;function r(c){return rr(c)?jl(e,o)(c):n(c)}function o(c){return sE(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function i(c){return kt(c)?Ht(e,l,"whitespace")(c):l(c)}function l(c){return c===null||it(c)?t(c):n(c)}}const a6={name:"hardBreakEscape",tokenize:i6};function i6(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return it(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const l6={name:"headingAtx",resolve:u6,tokenize:c6};function u6(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},us(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function c6(e,t,n){let r=0;return o;function o(p){return e.enter("atxHeading"),i(p)}function i(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||rr(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||it(p)?(e.exit("atxHeading"),t(p)):kt(p)?Ht(e,c,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function h(p){return p===null||p===35||rr(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),h)}}const d6=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Tb=["pre","script","style","textarea"],f6={concrete:!0,name:"htmlFlow",resolveTo:p6,tokenize:y6},h6={partial:!0,tokenize:b6},m6={partial:!0,tokenize:g6};function p6(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function y6(e,t,n){const r=this;let o,i,l,c,d;return h;function h(j){return p(j)}function p(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),y}function y(j){return j===33?(e.consume(j),b):j===47?(e.consume(j),i=!0,S):j===63?(e.consume(j),o=3,r.interrupt?t:M):as(j)?(e.consume(j),l=String.fromCharCode(j),E):n(j)}function b(j){return j===45?(e.consume(j),o=2,v):j===91?(e.consume(j),o=5,c=0,D):as(j)?(e.consume(j),o=4,r.interrupt?t:M):n(j)}function v(j){return j===45?(e.consume(j),r.interrupt?t:M):n(j)}function D(j){const le="CDATA[";return j===le.charCodeAt(c++)?(e.consume(j),c===le.length?r.interrupt?t:z:D):n(j)}function S(j){return as(j)?(e.consume(j),l=String.fromCharCode(j),E):n(j)}function E(j){if(j===null||j===47||j===62||rr(j)){const le=j===47,pe=l.toLowerCase();return!le&&!i&&Tb.includes(pe)?(o=1,r.interrupt?t(j):z(j)):d6.includes(l.toLowerCase())?(o=6,le?(e.consume(j),T):r.interrupt?t(j):z(j)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?k(j):O(j))}return j===45||fr(j)?(e.consume(j),l+=String.fromCharCode(j),E):n(j)}function T(j){return j===62?(e.consume(j),r.interrupt?t:z):n(j)}function k(j){return kt(j)?(e.consume(j),k):H(j)}function O(j){return j===47?(e.consume(j),H):j===58||j===95||as(j)?(e.consume(j),I):kt(j)?(e.consume(j),O):H(j)}function I(j){return j===45||j===46||j===58||j===95||fr(j)?(e.consume(j),I):L(j)}function L(j){return j===61?(e.consume(j),_):kt(j)?(e.consume(j),L):O(j)}function _(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),d=j,C):kt(j)?(e.consume(j),_):A(j)}function C(j){return j===d?(e.consume(j),d=null,P):j===null||it(j)?n(j):(e.consume(j),C)}function A(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rr(j)?L(j):(e.consume(j),A)}function P(j){return j===47||j===62||kt(j)?O(j):n(j)}function H(j){return j===62?(e.consume(j),B):n(j)}function B(j){return j===null||it(j)?z(j):kt(j)?(e.consume(j),B):n(j)}function z(j){return j===45&&o===2?(e.consume(j),ie):j===60&&o===1?(e.consume(j),ge):j===62&&o===4?(e.consume(j),V):j===63&&o===3?(e.consume(j),M):j===93&&o===5?(e.consume(j),de):it(j)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(h6,ae,Q)(j)):j===null||it(j)?(e.exit("htmlFlowData"),Q(j)):(e.consume(j),z)}function Q(j){return e.check(m6,q,ae)(j)}function q(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),X}function X(j){return j===null||it(j)?Q(j):(e.enter("htmlFlowData"),z(j))}function ie(j){return j===45?(e.consume(j),M):z(j)}function ge(j){return j===47?(e.consume(j),l="",te):z(j)}function te(j){if(j===62){const le=l.toLowerCase();return Tb.includes(le)?(e.consume(j),V):z(j)}return as(j)&&l.length<8?(e.consume(j),l+=String.fromCharCode(j),te):z(j)}function de(j){return j===93?(e.consume(j),M):z(j)}function M(j){return j===62?(e.consume(j),V):j===45&&o===2?(e.consume(j),M):z(j)}function V(j){return j===null||it(j)?(e.exit("htmlFlowData"),ae(j)):(e.consume(j),V)}function ae(j){return e.exit("htmlFlow"),t(j)}}function g6(e,t,n){const r=this;return o;function o(l){return it(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function b6(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ud,t,n)}}const x6={name:"htmlText",tokenize:v6};function v6(e,t,n){const r=this;let o,i,l;return c;function c(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),L):M===63?(e.consume(M),O):as(M)?(e.consume(M),A):n(M)}function h(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),i=0,D):as(M)?(e.consume(M),k):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function y(M){return M===null?n(M):M===45?(e.consume(M),b):it(M)?(l=y,ge(M)):(e.consume(M),y)}function b(M){return M===45?(e.consume(M),v):y(M)}function v(M){return M===62?ie(M):M===45?b(M):y(M)}function D(M){const V="CDATA[";return M===V.charCodeAt(i++)?(e.consume(M),i===V.length?S:D):n(M)}function S(M){return M===null?n(M):M===93?(e.consume(M),E):it(M)?(l=S,ge(M)):(e.consume(M),S)}function E(M){return M===93?(e.consume(M),T):S(M)}function T(M){return M===62?ie(M):M===93?(e.consume(M),T):S(M)}function k(M){return M===null||M===62?ie(M):it(M)?(l=k,ge(M)):(e.consume(M),k)}function O(M){return M===null?n(M):M===63?(e.consume(M),I):it(M)?(l=O,ge(M)):(e.consume(M),O)}function I(M){return M===62?ie(M):O(M)}function L(M){return as(M)?(e.consume(M),_):n(M)}function _(M){return M===45||fr(M)?(e.consume(M),_):C(M)}function C(M){return it(M)?(l=C,ge(M)):kt(M)?(e.consume(M),C):ie(M)}function A(M){return M===45||fr(M)?(e.consume(M),A):M===47||M===62||rr(M)?P(M):n(M)}function P(M){return M===47?(e.consume(M),ie):M===58||M===95||as(M)?(e.consume(M),H):it(M)?(l=P,ge(M)):kt(M)?(e.consume(M),P):ie(M)}function H(M){return M===45||M===46||M===58||M===95||fr(M)?(e.consume(M),H):B(M)}function B(M){return M===61?(e.consume(M),z):it(M)?(l=B,ge(M)):kt(M)?(e.consume(M),B):P(M)}function z(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),o=M,Q):it(M)?(l=z,ge(M)):kt(M)?(e.consume(M),z):(e.consume(M),q)}function Q(M){return M===o?(e.consume(M),o=void 0,X):M===null?n(M):it(M)?(l=Q,ge(M)):(e.consume(M),Q)}function q(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||rr(M)?P(M):(e.consume(M),q)}function X(M){return M===47||M===62||rr(M)?P(M):n(M)}function ie(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function ge(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),te}function te(M){return kt(M)?Ht(e,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):de(M)}function de(M){return e.enter("htmlTextData"),l(M)}}const Km={name:"labelEnd",resolveAll:S6,resolveTo:k6,tokenize:C6},E6={tokenize:_6},T6={tokenize:N6},w6={tokenize:D6};function S6(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&us(e,0,e.length,n),e}function k6(e,t){let n=e.length,r=0,o,i,l,c;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",h,t]],c=_r(c,e.slice(i+1,i+r+3)),c=_r(c,[["enter",p,t]]),c=_r(c,Gm(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),c=_r(c,[["exit",p,t],e[l-2],e[l-1],["exit",h,t]]),c=_r(c,e.slice(l+1)),c=_r(c,[["exit",d,t]]),us(e,i,e.length,c),e}function C6(e,t,n){const r=this;let o=r.events.length,i,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return c;function c(b){return i?i._inactive?y(b):(l=r.parser.defined.includes(Ja(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(E6,p,l?p:y)(b):b===91?e.attempt(T6,p,l?h:y)(b):l?p(b):y(b)}function h(b){return e.attempt(w6,p,y)(b)}function p(b){return t(b)}function y(b){return i._balanced=!0,n(b)}}function _6(e,t,n){return r;function r(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),o}function o(y){return rr(y)?jl(e,i)(y):i(y)}function i(y){return y===41?p(y):nE(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function l(y){return rr(y)?jl(e,d)(y):p(y)}function c(y){return n(y)}function d(y){return y===34||y===39||y===40?sE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):p(y)}function h(y){return rr(y)?jl(e,p)(y):p(y)}function p(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function N6(e,t,n){const r=this;return o;function o(c){return rE.call(r,e,i,l,"reference","referenceMarker","referenceString")(c)}function i(c){return r.parser.defined.includes(Ja(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function D6(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const O6={name:"labelStartImage",resolveAll:Km.resolveAll,tokenize:A6};function A6(e,t,n){const r=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),i}function i(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const I6={name:"labelStartLink",resolveAll:Km.resolveAll,tokenize:M6};function M6(e,t,n){const r=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const t0={name:"lineEnding",tokenize:L6};function L6(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ht(e,t,"linePrefix")}}const Wc={name:"thematicBreak",tokenize:R6};function R6(e,t,n){let r=0,o;return i;function i(h){return e.enter("thematicBreak"),l(h)}function l(h){return o=h,c(h)}function c(h){return h===o?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||it(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===o?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),kt(h)?Ht(e,c,"whitespace")(h):c(h))}}const Zn={continuation:{tokenize:B6},exit:U6,name:"list",tokenize:F6},P6={partial:!0,tokenize:z6},j6={partial:!0,tokenize:H6};function F6(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(v){const D=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(D==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:q0(v)){if(r.containerState.type||(r.containerState.type=D,e.enter(D,{_container:!0})),D==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Wc,n,h)(v):h(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return q0(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):n(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Ud,r.interrupt?n:p,e.attempt(P6,b,y))}function p(v){return r.containerState.initialBlankLine=!0,i++,b(v)}function y(v){return kt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function B6(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ud,o,i);function o(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ht(e,t,"listItemIndent",r.containerState.size+1)(c)}function i(c){return r.containerState.furtherBlankLines||!kt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(j6,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ht(e,e.attempt(Zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function H6(e,t,n){const r=this;return Ht(e,o,"listItemIndent",r.containerState.size+1);function o(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(i):n(i)}}function U6(e){e.exit(this.containerState.type)}function z6(e,t,n){const r=this;return Ht(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const l=r.events[r.events.length-1];return!kt(i)&&l&&l[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const wb={name:"setextUnderline",resolveTo:W6,tokenize:Y6};function W6(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",l,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Y6(e,t,n){const r=this;let o;return i;function i(h){let p=r.events.length,y;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){y=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||y)?(e.enter("setextHeadingLine"),o=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===o?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),kt(h)?Ht(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||it(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const $6={tokenize:q6};function q6(e){const t=this,n=e.attempt(Ud,r,e.attempt(this.parser.constructs.flowInitial,o,Ht(e,e.attempt(this.parser.constructs.flow,o,e.attempt(XO,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const V6={resolveAll:aE()},Q6=oE("string"),G6=oE("text");function oE(e){return{resolveAll:aE(e==="text"?K6:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,l,c);return l;function l(p){return h(p)?i(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return h(p)?(n.exit("data"),i(p)):(n.consume(p),d)}function h(p){if(p===null)return!0;const y=o[p];let b=-1;if(y)for(;++b<y.length;){const v=y[b];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function aE(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function K6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,l=-1,c=0,d;for(;i--;){const h=o[i];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)d=!0,c++;else if(h!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const X6={42:Zn,43:Zn,45:Zn,48:Zn,49:Zn,50:Zn,51:Zn,52:Zn,53:Zn,54:Zn,55:Zn,56:Zn,57:Zn,62:Jv},J6={91:n6},Z6={[-2]:e0,[-1]:e0,32:e0},eA={35:l6,42:Wc,45:[wb,Wc],60:f6,61:wb,95:Wc,96:Eb,126:Eb},tA={38:eE,92:Zv},nA={[-5]:t0,[-4]:t0,[-3]:t0,33:O6,38:eE,42:V0,60:[IO,x6],91:I6,92:[a6,Zv],93:Km,95:V0,96:$O},rA={null:[V0,V6]},sA={null:[42,95]},oA={null:[]},aA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:sA,contentInitial:J6,disable:oA,document:X6,flow:eA,flowInitial:Z6,insideSpan:rA,string:tA,text:nA},Symbol.toStringTag,{value:"Module"}));function iA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let l=[],c=[];const d={attempt:C(L),check:C(_),consume:k,enter:O,exit:I,interrupt:C(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:D,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:y};let p=t.tokenize.call(h,d);return t.resolveAll&&i.push(t),h;function y(B){return l=_r(l,B),E(),l[l.length-1]!==null?[]:(A(t,0),h.events=Gm(i,h.events,h),h.events)}function b(B,z){return uA(v(B),z)}function v(B){return lA(l,B)}function D(){const{_bufferIndex:B,_index:z,line:Q,column:q,offset:X}=r;return{_bufferIndex:B,_index:z,line:Q,column:q,offset:X}}function S(B){o[B.line]=B.column,H()}function E(){let B;for(;r._index<l.length;){const z=l[r._index];if(typeof z=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<z.length;)T(z.charCodeAt(r._bufferIndex));else T(z)}}function T(B){p=p(B)}function k(B){it(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,H()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=B}function O(B,z){const Q=z||{};return Q.type=B,Q.start=D(),h.events.push(["enter",Q,h]),c.push(Q),Q}function I(B){const z=c.pop();return z.end=D(),h.events.push(["exit",z,h]),z}function L(B,z){A(B,z.from)}function _(B,z){z.restore()}function C(B,z){return Q;function Q(q,X,ie){let ge,te,de,M;return Array.isArray(q)?ae(q):"tokenize"in q?ae([q]):V(q);function V(ye){return Ne;function Ne(G){const Z=G!==null&&ye[G],ue=G!==null&&ye.null,me=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return ae(me)(G)}}function ae(ye){return ge=ye,te=0,ye.length===0?ie:j(ye[te])}function j(ye){return Ne;function Ne(G){return M=P(),de=ye,ye.partial||(h.currentConstruct=ye),ye.name&&h.parser.constructs.disable.null.includes(ye.name)?pe():ye.tokenize.call(z?Object.assign(Object.create(h),z):h,d,le,pe)(G)}}function le(ye){return B(de,M),X}function pe(ye){return M.restore(),++te<ge.length?j(ge[te]):ie}}}function A(B,z){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&us(h.events,z,h.events.length-z,B.resolve(h.events.slice(z),h)),B.resolveTo&&(h.events=B.resolveTo(h.events,h))}function P(){const B=D(),z=h.previous,Q=h.currentConstruct,q=h.events.length,X=Array.from(c);return{from:q,restore:ie};function ie(){r=B,h.previous=z,h.currentConstruct=Q,h.events.length=q,c=X,H()}}function H(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function lA(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,i)];else{if(l=e.slice(n,o),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}function uA(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
110
+ `;break}case-3:{l=`\r
111
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(i)}o=i===-2,r.push(l)}return r.join("")}function cA(e){const r={constructs:gO([aA,...(e||{}).extensions||[]]),content:o(kO),defined:[],document:o(_O),flow:o($6),lazy:{},string:o(Q6),text:o(G6)};return r;function o(i){return l;function l(c){return iA(r,i,c)}}}function dA(e){for(;!tE(e););return e}const Sb=/[\0\t\n\r]/g;function fA(){let e=1,t="",n=!0,r;return o;function o(i,l,c){const d=[];let h,p,y,b,v;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),y=0,t="",n&&(i.charCodeAt(0)===65279&&y++,n=void 0);y<i.length;){if(Sb.lastIndex=y,h=Sb.exec(i),b=h&&h.index!==void 0?h.index:i.length,v=i.charCodeAt(b),!h){t=i.slice(y);break}if(v===10&&y===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),y<b&&(d.push(i.slice(y,b)),e+=b-y),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}y=b+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const hA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mA(e){return e.replace(hA,pA)}function pA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Xv(n.slice(i?2:1),i?16:10)}return Qm(n)||e}const iE={}.hasOwnProperty;function yA(e,t,n){return typeof t!="string"&&(n=t,t=void 0),gA(n)(dA(cA(n).document().write(fA()(e,t,!0))))}function gA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(oe),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Ge),blockQuote:i(ue),characterEscape:P,characterReference:P,codeFenced:i(me),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(me,l),codeText:i(Ce,l),codeTextData:P,data:P,codeFlowValue:P,definition:i(Re),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(tt),hardBreakEscape:i(nt),hardBreakTrailing:i(nt),htmlFlow:i(we,l),htmlFlowData:P,htmlText:i(we,l),htmlTextData:P,image:i(je),label:l,link:i(oe),listItem:i(xe),listItemValue:b,listOrdered:i(re,y),listUnordered:i(re),paragraph:i(Oe),reference:j,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Ge),strong:i(qe),thematicBreak:i(yt)},exit:{atxHeading:d(),atxHeadingSequence:L,autolink:d(),autolinkEmail:Z,autolinkProtocol:G,blockQuote:d(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ye,characterReference:Ne,codeFenced:d(E),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:D,codeFlowValue:H,codeIndented:d(T),codeText:d(X),codeTextData:H,data:H,definition:d(),definitionDestinationString:I,definitionLabelString:k,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(z),hardBreakTrailing:d(z),htmlFlow:d(Q),htmlFlowData:H,htmlText:d(q),htmlTextData:H,image:d(ge),label:de,labelText:te,lineEnding:B,link:d(ie),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:le,resourceDestinationString:M,resourceTitleString:V,resource:ae,setextHeading:d(A),setextHeadingLineSequence:C,setextHeadingText:_,strong:d(),thematicBreak:d()}};lE(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let be={type:"root",children:[]};const Le={stack:[be],tokenStack:[],config:t,enter:c,exit:h,buffer:l,resume:p,data:n},rt=[];let ot=-1;for(;++ot<ce.length;)if(ce[ot][1].type==="listOrdered"||ce[ot][1].type==="listUnordered")if(ce[ot][0]==="enter")rt.push(ot);else{const gt=rt.pop();ot=o(ce,gt,ot)}for(ot=-1;++ot<ce.length;){const gt=t[ce[ot][0]];iE.call(gt,ce[ot][1].type)&&gt[ce[ot][1].type].call(Object.assign({sliceSerialize:ce[ot][2].sliceSerialize},Le),ce[ot][1])}if(Le.tokenStack.length>0){const gt=Le.tokenStack[Le.tokenStack.length-1];(gt[1]||kb).call(Le,void 0,gt[0])}for(be.position={start:oo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:oo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)be=t.transforms[ot](be)||be;return be}function o(ce,be,Le){let rt=be-1,ot=-1,gt=!1,Zt,hn,Dn,Yn;for(;++rt<=Le;){const Wt=ce[rt];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?ot++:ot--,Yn=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(Zt&&!Yn&&!ot&&!Dn&&(Dn=rt),Yn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yn=void 0}if(!ot&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||ot===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(Zt){let It=rt;for(hn=void 0;It--;){const yn=ce[It];if(yn[1].type==="lineEnding"||yn[1].type==="lineEndingBlank"){if(yn[0]==="exit")continue;hn&&(ce[hn][1].type="lineEndingBlank",gt=!0),yn[1].type="lineEnding",hn=It}else if(!(yn[1].type==="linePrefix"||yn[1].type==="blockQuotePrefix"||yn[1].type==="blockQuotePrefixWhitespace"||yn[1].type==="blockQuoteMarker"||yn[1].type==="listItemIndent"))break}Dn&&(!hn||Dn<hn)&&(Zt._spread=!0),Zt.end=Object.assign({},hn?ce[hn][1].start:Wt[1].end),ce.splice(hn||rt,0,["exit",Zt,Wt[2]]),rt++,Le++}if(Wt[1].type==="listItemPrefix"){const It={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};Zt=It,ce.splice(rt,0,["enter",It,Wt[2]]),rt++,Le++,Dn=void 0,Yn=!0}}}return ce[be][1]._spread=gt,Le}function i(ce,be){return Le;function Le(rt){c.call(this,ce(rt),rt),be&&be.call(this,rt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(ce,be,Le){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([be,Le||void 0]),ce.position={start:oo(be.start),end:void 0}}function d(ce){return be;function be(Le){ce&&ce.call(this,Le),h.call(this,Le)}}function h(ce,be){const Le=this.stack.pop(),rt=this.tokenStack.pop();if(rt)rt[0].type!==ce.type&&(be?be.call(this,ce,rt[0]):(rt[1]||kb).call(this,ce,rt[0]));else throw new Error("Cannot close `"+ce.type+"` ("+Pl({start:ce.start,end:ce.end})+"): it’s not open");Le.position.end=oo(ce.end)}function p(){return pO(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function b(ce){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.lang=ce}function D(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.meta=ce}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce.replace(/(\r?\n|\r)$/g,"")}function k(ce){const be=this.resume(),Le=this.stack[this.stack.length-1];Le.label=be,Le.identifier=Ja(this.sliceSerialize(ce)).toLowerCase()}function O(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.title=ce}function I(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.url=ce}function L(ce){const be=this.stack[this.stack.length-1];if(!be.depth){const Le=this.sliceSerialize(ce).length;be.depth=Le}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function C(ce){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ce){const Le=this.stack[this.stack.length-1].children;let rt=Le[Le.length-1];(!rt||rt.type!=="text")&&(rt=pt(),rt.position={start:oo(ce.start),end:void 0},Le.push(rt)),this.stack.push(rt)}function H(ce){const be=this.stack.pop();be.value+=this.sliceSerialize(ce),be.position.end=oo(ce.end)}function B(ce){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=be.children[be.children.length-1];Le.position.end=oo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(P.call(this,ce),H.call(this,ce))}function z(){this.data.atHardBreak=!0}function Q(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce}function q(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce}function X(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.value=ce}function ie(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=be,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function ge(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=be,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function te(ce){const be=this.sliceSerialize(ce),Le=this.stack[this.stack.length-2];Le.label=mA(be),Le.identifier=Ja(be).toLowerCase()}function de(){const ce=this.stack[this.stack.length-1],be=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const rt=ce.children;Le.children=rt}else Le.alt=be}function M(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.url=ce}function V(){const ce=this.resume(),be=this.stack[this.stack.length-1];be.title=ce}function ae(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function le(ce){const be=this.resume(),Le=this.stack[this.stack.length-1];Le.label=be,Le.identifier=Ja(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function pe(ce){this.data.characterReferenceType=ce.type}function ye(ce){const be=this.sliceSerialize(ce),Le=this.data.characterReferenceType;let rt;Le?(rt=Xv(be,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):rt=Qm(be);const ot=this.stack[this.stack.length-1];ot.value+=rt}function Ne(ce){const be=this.stack.pop();be.position.end=oo(ce.end)}function G(ce){H.call(this,ce);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ce)}function Z(ce){H.call(this,ce);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ce)}function ue(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tt(){return{type:"emphasis",children:[]}}function Ge(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function we(){return{type:"html",value:""}}function je(){return{type:"image",title:null,url:"",alt:null}}function oe(){return{type:"link",title:null,url:"",children:[]}}function re(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function xe(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Oe(){return{type:"paragraph",children:[]}}function qe(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function yt(){return{type:"thematicBreak"}}}function oo(e){return{line:e.line,column:e.column,offset:e.offset}}function lE(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?lE(e,r):bA(e,r)}}function bA(e,t){let n;for(n in t)if(iE.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function kb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Pl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Pl({start:t.start,end:t.end})+") is still open")}function xA(e){const t=this;t.parser=n;function n(r){return yA(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function vA(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function EA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
112
+ `}]}function TA(e,t){const n=t.value?t.value+`
113
+ `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function wA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Ni(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function CA(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _A(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function uE(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function NA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uE(e,t);const o={src:Ni(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function DA(e,t){const n={src:Ni(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function OA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function AA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return uE(e,t);const o={href:Ni(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function IA(e,t){const n={href:Ni(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function MA(e,t,n){const r=e.all(t),o=n?LA(n):cE(t),i={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let y;p&&p.type==="element"&&p.tagName==="p"?y=p:(y={type:"element",tagName:"p",properties:{},children:[]},r.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
114
+ `}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
115
+ `});const h={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,h),e.applyData(t,h)}function LA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=cE(n[r])}return t}function cE(e){const t=e.spread;return t??e.children.length>1}function RA(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const l=r[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function PA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function FA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BA(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=fs(t.children[1]),d=Hd(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),o.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function HA(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<c;){const y=t.children[d],b={},v=l?l[d]:void 0;v&&(b.align=v);let D={type:"element",tagName:i,properties:b,children:[]};y&&(D.children=e.all(y),e.patch(y,D),D=e.applyData(y,D)),h.push(D)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function UA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Cb=9,_b=32;function zA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Nb(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Nb(t.slice(o),o>0,!1)),i.join("")}function Nb(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Cb||i===_b;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Cb||i===_b;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function WA(e,t){const n={type:"text",value:zA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $A={blockquote:vA,break:EA,code:TA,delete:wA,emphasis:SA,footnoteReference:kA,heading:CA,html:_A,imageReference:NA,image:DA,inlineCode:OA,linkReference:AA,link:IA,listItem:MA,list:RA,paragraph:PA,root:jA,strong:FA,table:BA,tableCell:UA,tableRow:HA,text:WA,thematicBreak:YA,toml:Rc,yaml:Rc,definition:Rc,footnoteDefinition:Rc};function Rc(){}const dE=-1,zd=0,Fl=1,id=2,Xm=3,Jm=4,Zm=5,ep=6,fE=7,hE=8,Db=typeof self=="object"?self:globalThis,qA=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case zd:case dE:return n(l,o);case Fl:{const c=n([],o);for(const d of l)c.push(r(d));return c}case id:{const c=n({},o);for(const[d,h]of l)c[r(d)]=r(h);return c}case Xm:return n(new Date(l),o);case Jm:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case Zm:{const c=n(new Map,o);for(const[d,h]of l)c.set(r(d),r(h));return c}case ep:{const c=n(new Set,o);for(const d of l)c.add(r(d));return c}case fE:{const{name:c,message:d}=l;return n(new Db[c](d),o)}case hE:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new Db[i](l),o)};return r},Ob=e=>qA(new Map,e)(0),Va="",{toString:VA}={},{keys:QA}=Object,_l=e=>{const t=typeof e;if(t!=="object"||!e)return[zd,t];const n=VA.call(e).slice(8,-1);switch(n){case"Array":return[Fl,Va];case"Object":return[id,Va];case"Date":return[Xm,Va];case"RegExp":return[Jm,Va];case"Map":return[Zm,Va];case"Set":return[ep,Va];case"DataView":return[Fl,n]}return n.includes("Array")?[Fl,n]:n.includes("Error")?[fE,n]:[id,n]},Pc=([e,t])=>e===zd&&(t==="function"||t==="symbol"),GA=(e,t,n,r)=>{const o=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},i=l=>{if(n.has(l))return n.get(l);let[c,d]=_l(l);switch(c){case zd:{let p=l;switch(d){case"bigint":c=hE,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return o([dE],l)}return o([c,p],l)}case Fl:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),o([d,[...b]],l)}const p=[],y=o([c,p],l);for(const b of l)p.push(i(b));return y}case id:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return i(l.toJSON());const p=[],y=o([c,p],l);for(const b of QA(l))(e||!Pc(_l(l[b])))&&p.push([i(b),i(l[b])]);return y}case Xm:return o([c,l.toISOString()],l);case Jm:{const{source:p,flags:y}=l;return o([c,{source:p,flags:y}],l)}case Zm:{const p=[],y=o([c,p],l);for(const[b,v]of l)(e||!(Pc(_l(b))||Pc(_l(v))))&&p.push([i(b),i(v)]);return y}case ep:{const p=[],y=o([c,p],l);for(const b of l)(e||!Pc(_l(b)))&&p.push(i(b));return y}}const{message:h}=l;return o([c,{name:d,message:h}],l)};return i},Ab=(e,{json:t,lossy:n}={})=>{const r=[];return GA(!(t||n),!!t,new Map,r)(e),r},bi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ob(Ab(e,t)):structuredClone(e):(e,t)=>Ob(Ab(e,t));function KA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function XA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KA,r=e.options.footnoteBackLabel||XA,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const p=e.all(h),y=String(h.identifier).toUpperCase(),b=Ni(y.toLowerCase());let v=0;const D=[],S=e.footnoteCounts.get(y);for(;S!==void 0&&++v<=S;){D.length>0&&D.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,v);typeof k=="string"&&(k={type:"text",value:k}),D.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const E=p[p.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const k=E.children[E.children.length-1];k&&k.type==="text"?k.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...D)}else p.push(...D);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(p,!0)};e.patch(h,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bi(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
116
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
117
+ `}]}}const mE=(function(e){if(e==null)return n5;if(typeof e=="function")return Wd(e);if(typeof e=="object")return Array.isArray(e)?ZA(e):e5(e);if(typeof e=="string")return t5(e);throw new Error("Expected function, string, or object as test")});function ZA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=mE(e[n]);return Wd(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function e5(e){const t=e;return Wd(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function t5(e){return Wd(t);function t(n){return n&&n.type===e}}function Wd(e){return t;function t(n,r,o){return!!(r5(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function n5(){return!0}function r5(e){return e!==null&&typeof e=="object"&&"type"in e}const pE=[],s5=!0,Ib=!1,o5="skip";function a5(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=mE(o),l=r?-1:1;c(e,void 0,[])();function c(d,h,p){const y=d&&typeof d=="object"?d:{};if(typeof y.type=="string"){const v=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=pE,D,S,E;if((!t||i(d,h,p[p.length-1]||void 0))&&(v=i5(n(d,p)),v[0]===Ib))return v;if("children"in d&&d.children){const T=d;if(T.children&&v[0]!==o5)for(S=(r?T.children.length:-1)+l,E=p.concat(T);S>-1&&S<T.children.length;){const k=T.children[S];if(D=c(k,S,E)(),D[0]===Ib)return D;S=typeof D[1]=="number"?D[1]:S+l}}return v}}}function i5(e){return Array.isArray(e)?e:typeof e=="number"?[s5,e]:e==null?pE:[e]}function tp(e,t,n,r){let o,i,l;typeof t=="function"&&typeof n!="function"?(i=void 0,l=t,o=n):(i=t,l=n,o=r),a5(e,i,c,o);function c(d,h){const p=h[h.length-1],y=p?p.children.indexOf(d):void 0;return l(d,y,p)}}const Q0={}.hasOwnProperty,l5={};function u5(e,t){const n=t||l5,r=new Map,o=new Map,i=new Map,l={...$A,...n.handlers},c={all:h,applyData:d5,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:l,one:d,options:n,patch:c5,wrap:h5};return tp(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const y=p.type==="definition"?r:o,b=String(p.identifier).toUpperCase();y.has(b)||y.set(b,p)}}),c;function d(p,y){const b=p.type,v=c.handlers[b];if(Q0.call(c.handlers,b)&&v)return v(c,p,y);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in p){const{children:S,...E}=p,T=bi(E);return T.children=c.all(p),T}return bi(p)}return(c.options.unknownHandler||f5)(c,p,y)}function h(p){const y=[];if("children"in p){const b=p.children;let v=-1;for(;++v<b.length;){const D=c.one(b[v],p);if(D){if(v&&b[v-1].type==="break"&&(!Array.isArray(D)&&D.type==="text"&&(D.value=Mb(D.value)),!Array.isArray(D)&&D.type==="element")){const S=D.children[0];S&&S.type==="text"&&(S.value=Mb(S.value))}Array.isArray(D)?y.push(...D):y.push(D)}}}return y}}function c5(e,t){e.position&&(t.position=VD(e))}function d5(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&i&&Object.assign(n.properties,bi(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function f5(e,t){const n=t.data||{},r="value"in t&&!(Q0.call(n,"hProperties")||Q0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function h5(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
118
+ `});++r<e.length;)r&&n.push({type:"text",value:`
119
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
120
+ `}),n}function Mb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lb(e,t){const n=u5(e,t),r=n.one(e,void 0),o=JA(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
121
+ `},o),i}function m5(e,t){return e&&"run"in e?async function(n,r){const o=Lb(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Lb(n,{file:r,...e||t})}}function Rb(e){if(e)throw e}var n0,Pb;function p5(){if(Pb)return n0;Pb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},i=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!y)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},l=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},c=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(r)return r(h,p).value}else return;return h[p]};return n0=function d(){var h,p,y,b,v,D,S=arguments[0],E=1,T=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},E=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});E<T;++E)if(h=arguments[E],h!=null)for(p in h)y=c(S,p),b=c(h,p),S!==b&&(k&&b&&(i(b)||(v=o(b)))?(v?(v=!1,D=y&&o(y)?y:[]):D=y&&i(y)?y:{},l(S,{name:p,newValue:d(k,D,b)})):typeof b<"u"&&l(S,{name:p,newValue:b}));return S},n0}var y5=p5();const r0=xx(y5);function G0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function g5(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...h){const p=e[++i];let y=-1;if(d){l(d);return}for(;++y<o.length;)(h[y]===null||h[y]===void 0)&&(h[y]=o[y]);o=h,p?b5(p,c)(...h):l(null,...h)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function b5(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(h){const p=h;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(i,o):d instanceof Error?o(d):i(d))}function o(l,...c){n||(n=!0,t(l,...c))}function i(l){o(null,l)}}const Zr={basename:x5,dirname:v5,extname:E5,join:T5,sep:"/"};function x5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fu(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else l<0&&(i=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(r=o):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function v5(e){if(fu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function E5(e){fu(e);let t=e.length,n=-1,r=0,o=-1,i=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function T5(...e){let t=-1,n;for(;++t<e.length;)fu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":w5(n)}function w5(e){fu(e);const t=e.codePointAt(0)===47;let n=S5(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function S5(e,t){let n="",r=0,o=-1,i=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||i===1))if(o!==l-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),o=l,i=0;continue}}else if(n.length>0){n="",r=0,o=l,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,i=0}else c===46&&i>-1?i++:i=-1}return n}function fu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const k5={cwd:C5};function C5(){return"/"}function K0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _5(e){if(typeof e=="string")e=new URL(e);else if(!K0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return N5(e)}function N5(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const s0=["history","path","basename","stem","extname","dirname"];class yE{constructor(t){let n;t?K0(t)?n={path:t}:typeof t=="string"||D5(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":k5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<s0.length;){const i=s0[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)s0.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Zr.basename(this.path):void 0}set basename(t){a0(t,"basename"),o0(t,"basename"),this.path=Zr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Zr.dirname(this.path):void 0}set dirname(t){jb(this.basename,"dirname"),this.path=Zr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Zr.extname(this.path):void 0}set extname(t){if(o0(t,"extname"),jb(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Zr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){K0(t)&&(t=_5(t)),a0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Zr.basename(this.path,this.extname):void 0}set stem(t){a0(t,"stem"),o0(t,"stem"),this.path=Zr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Fn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function o0(e,t){if(e&&e.includes(Zr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Zr.sep+"`")}function a0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function D5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const O5=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),A5={}.hasOwnProperty;class np extends O5{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=g5()}copy(){const t=new np;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(r0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(u0("data",this.frozen),this.namespace[t]=n,this):A5.call(this.namespace,t)&&this.namespace[t]||void 0:t?(u0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=jc(t),r=this.parser||this.Parser;return i0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),i0("process",this.parser||this.Parser),l0("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,l){const c=jc(t),d=r.parse(c);r.run(d,c,function(p,y,b){if(p||!y||!b)return h(p);const v=y,D=r.stringify(v,b);L5(D)?b.value=D:b.result=D,h(p,b)});function h(p,y){p||!y?l(p):i?i(y):n(void 0,y)}}}processSync(t){let n=!1,r;return this.freeze(),i0("processSync",this.parser||this.Parser),l0("processSync",this.compiler||this.Compiler),this.process(t,o),Bb("processSync","process",n),r;function o(i,l){n=!0,Rb(i),r=l}}run(t,n,r){Fb(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(l,c){const d=jc(n);o.run(t,d,h);function h(p,y,b){const v=y||t;p?c(p):l?l(v):r(void 0,v,b)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Bb("runSync","run",r),o;function i(l,c){Rb(l),o=c,r=!0}}stringify(t,n){this.freeze();const r=jc(n),o=this.compiler||this.Compiler;return l0("stringify",o),Fb(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(u0("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...y]=h;d(p,y)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(o.settings=r0(!0,o.settings,h.settings))}function c(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const y=h[p];i(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,p){let y=-1,b=-1;for(;++y<r.length;)if(r[y][0]===h){b=y;break}if(b===-1)r.push([h,...p]);else if(p.length>0){let[v,...D]=p;const S=r[b][1];G0(S)&&G0(v)&&(v=r0(!0,S,v)),r[b]=[h,v,...D]}}}}const I5=new np().freeze();function i0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function l0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function u0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Fb(e){if(!G0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Bb(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jc(e){return M5(e)?e:new yE(e)}function M5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function L5(e){return typeof e=="string"||R5(e)}function R5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hb=[],Ub={allowDangerousHtml:!0},j5=/^(https?|ircs?|mailto|xmpp)$/i,F5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function B5(e){const t=H5(e),n=U5(e);return z5(t.runSync(t.parse(n),n),e)}function H5(e){const t=e.rehypePlugins||Hb,n=e.remarkPlugins||Hb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ub}:Ub;return I5().use(xA).use(n).use(m5,r).use(t)}function U5(e){const t=e.children||"",n=new yE;return typeof t=="string"&&(n.value=t),n}function z5(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||W5;for(const p of F5)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+P5+p.id,void 0);return tp(e,h),JD(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function h(p,y,b){if(p.type==="raw"&&b&&typeof y=="number")return l?b.children.splice(y,1):b.children[y]={type:"text",value:p.value},y;if(p.type==="element"){let v;for(v in Zh)if(Object.hasOwn(Zh,v)&&Object.hasOwn(p.properties,v)){const D=p.properties[v],S=Zh[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(D||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):i?i.includes(p.tagName):!1;if(!v&&r&&typeof y=="number"&&(v=!r(p,y,b)),v&&b&&typeof y=="number")return c&&p.children?b.children.splice(y,1,...p.children):b.children.splice(y,1),y}}}function W5(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||j5.test(e.slice(0,t))?e:""}const zb=/[#.]/g;function Y5(e,t){const n=e||"",r={};let o=0,i,l;for(;o<n.length;){zb.lastIndex=o;const c=zb.exec(n),d=n.slice(o,c?c.index:n.length);d&&(i?i==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,o+=d.length),c&&(i=c[0],o++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function gE(e,t,n){const r=n?Q5(n):void 0;function o(i,l,...c){let d;if(i==null){d={type:"root",children:[]};const h=l;c.unshift(h)}else{d=Y5(i,t);const h=d.tagName.toLowerCase(),p=r?r.get(h):void 0;if(d.tagName=p||h,$5(l))c.unshift(l);else for(const[y,b]of Object.entries(l))q5(e,d.properties,y,b)}for(const h of c)X0(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function $5(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const i=o;for(const l of i)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function q5(e,t,n,r){const o=Bd(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?o.spaceSeparated?i=ib(r):o.commaSeparated?i=nb(r):o.commaOrSpaceSeparated?i=ib(nb(r).join(" ")):i=Wb(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?V5(r):String(r);if(Array.isArray(i)){const l=[];for(const c of i)l.push(Wb(o,o.property,c));i=l}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function X0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)X0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?X0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Wb(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Vl(n)===Vl(t)))return!0}return n}function V5(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Q5(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const G5=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","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","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],K5=gE(du,"div"),X5=gE(Co,"g",G5);function J5(e){const t=String(e),n=[];return{toOffset:o,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=Yb(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>i)return{line:l+1,column:i-(l>0?n[l-1]:0)+1,offset:i};l++}}}function o(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const c=n[n.length-1],d=Yb(t,c),h=d===-1?t.length+1:d+1;if(c===h)break;n.push(h)}const l=(i.line>1?n[i.line-2]:0)+i.column-1;if(l<n[i.line-1])return l}}}function Yb(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
122
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Qo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},bE={}.hasOwnProperty,Z5=Object.prototype;function eI(e,t){const n=t||{};return rp({file:n.file||void 0,location:!1,schema:n.space==="svg"?Co:du,verbose:n.verbose||!1},e)}function rp(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Yc(e,r,n),n}case"#document":case"#document-fragment":{const r=t,o="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:xE(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const i=String(e.file),l=J5(i),c=l.toPoint(0),d=l.toPoint(i.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Yc(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Yc(e,r,n),n}default:return n=tI(e,t),n}}function xE(e,t){let n=-1;const r=[];for(;++n<t.length;){const o=rp(e,t[n]);r.push(o)}return r}function tI(e,t){const n=e.schema;e.schema=t.namespaceURI===Qo.svg?Co:du;let r=-1;const o={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;bE.call(Z5,d)||(o[d]=c.value)}const l=(e.schema.space==="svg"?X5:K5)(t.tagName,o,xE(e,t.childNodes));if(Yc(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,h=d&&d.startTag&&Ga(d.startTag),p=d&&d.endTag&&Ga(d.endTag),y=rp(e,c.content);h&&p&&e.file&&(y.position={start:h.end,end:p.start}),l.content=y}return e.schema=n,l}function Yc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=nI(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function nI(e,t,n){const r=Ga(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(r&&!n.endTag&&o&&o.position&&o.position.end&&(r.end=Object.assign({},o.position.end)),e.verbose){const i={};let l;if(n.attrs)for(l in n.attrs)bE.call(n.attrs,l)&&(i[Bd(e.schema,l).property]=Ga(n.attrs[l]));n.startTag;const c=Ga(n.startTag),d=n.endTag?Ga(n.endTag):void 0,h={opening:c};d&&(h.closing=d),h.properties=i,t.data={position:h}}}return r}function Ga(e){const t=$b({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=$b({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function $b(e){return e.line&&e.column?e:void 0}const qb={}.hasOwnProperty;function vE(e,t){const n=t||{};function r(o,...i){let l=r.invalid;const c=r.handlers;if(o&&qb.call(o,e)){const d=String(o[e]);l=qb.call(c,d)?c[d]:r.unknown}if(l)return l.call(this,o,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const rI={},sI={}.hasOwnProperty,EE=vE("type",{handlers:{root:aI,element:dI,text:uI,comment:cI,doctype:lI}});function oI(e,t){const r=(t||rI).space;return EE(e,r==="svg"?Co:du)}function aI(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=sp(e.children,n,t),Di(e,n),n}function iI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=sp(e.children,n,t),Di(e,n),n}function lI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Di(e,t),t}function uI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Di(e,t),t}function cI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Di(e,t),t}function dI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Co);const o=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&sI.call(e.properties,i)){const d=fI(r,i,e.properties[i]);d&&o.push(d)}}const l=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:Qo[l],childNodes:[],parentNode:null};return c.childNodes=sp(e.children,c,r),Di(e,c),e.tagName==="template"&&e.content&&(c.content=iI(e.content,r)),c}function fI(e,t,n){const r=Bd(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Pv(n):Yv(n));const o={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=o.name.indexOf(":");i<0?o.prefix="":(o.name=o.name.slice(i+1),o.prefix=r.attribute.slice(0,i)),o.namespace=Qo[r.space]}return o}function sp(e,t,n){let r=-1;const o=[];if(e)for(;++r<e.length;){const i=EE(e[r],n);i.parentNode=t,o.push(i)}return o}function Di(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const hI=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],mI=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Vt="�";var F;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(F||(F={}));const Jn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function TE(e){return e>=55296&&e<=57343}function pI(e){return e>=56320&&e<=57343}function yI(e,t){return(e-55296)*1024+9216+t}function wE(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function SE(e){return e>=64976&&e<=65007||mI.has(e)}var he;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(he||(he={}));const gI=65536;class bI{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=gI,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:o,offset:i}=this,l=o+n,c=i+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(pI(n))return this.pos++,this._addGap(),yI(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(he.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;const r=this.html.charCodeAt(n);return r===F.CARRIAGE_RETURN?F.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let t=this.html.charCodeAt(this.pos);return t===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):t===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,TE(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===F.LINE_FEED||t===F.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){wE(t)?this._err(he.controlCharacterInInputStream):SE(t)&&this._err(he.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ht;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(ht||(ht={}));function kE(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const xI=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),vI=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function EI(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=vI.get(e))!==null&&t!==void 0?t:e}var kn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(kn||(kn={}));const TI=32;var Eo;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Eo||(Eo={}));function J0(e){return e>=kn.ZERO&&e<=kn.NINE}function wI(e){return e>=kn.UPPER_A&&e<=kn.UPPER_F||e>=kn.LOWER_A&&e<=kn.LOWER_F}function SI(e){return e>=kn.UPPER_A&&e<=kn.UPPER_Z||e>=kn.LOWER_A&&e<=kn.LOWER_Z||J0(e)}function kI(e){return e===kn.EQUALS||SI(e)}var wn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(wn||(wn={}));var Ds;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ds||(Ds={}));class CI{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=wn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ds.Strict}startEntity(t){this.decodeMode=t,this.state=wn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case wn.EntityStart:return t.charCodeAt(n)===kn.NUM?(this.state=wn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=wn.NamedEntity,this.stateNamedEntity(t,n));case wn.NumericStart:return this.stateNumericStart(t,n);case wn.NumericDecimal:return this.stateNumericDecimal(t,n);case wn.NumericHex:return this.stateNumericHex(t,n);case wn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|TI)===kn.LOWER_X?(this.state=wn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=wn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,o){if(n!==r){const i=r-n;this.result=this.result*Math.pow(o,i)+Number.parseInt(t.substr(n,i),o),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(J0(o)||wI(o))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const o=t.charCodeAt(n);if(J0(o))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===kn.SEMI)this.consumed+=1;else if(this.decodeMode===Ds.Strict)return 0;return this.emitCodePoint(EI(this.result),this.consumed),this.errors&&(t!==kn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],i=(o&Eo.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=_I(r,o,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Ds.Attribute&&(i===0||kI(l))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],i=(o&Eo.VALUE_LENGTH)>>14,i!==0){if(l===kn.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ds.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,o=(r[n]&Eo.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Eo.VALUE_LENGTH:o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){var t;switch(this.state){case wn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ds.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wn.NumericDecimal:return this.emitNumericEntity(0,2);case wn.NumericHex:return this.emitNumericEntity(0,3);case wn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wn.EntityStart:return 0}}}function _I(e,t,n,r){const o=(t&Eo.BRANCH_LENGTH)>>7,i=t&Eo.JUMP_TABLE;if(o===0)return i!==0&&r===i?n:-1;if(i){const d=r-i;return d<0||d>=o?-1:e[n+d]-1}let l=n,c=l+o-1;for(;l<=c;){const d=l+c>>>1,h=e[d];if(h<r)l=d+1;else if(h>r)c=d-1;else return e[d+o]}return-1}var Ee;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Ee||(Ee={}));var oa;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(oa||(oa={}));var Nr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Nr||(Nr={}));var ne;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(ne||(ne={}));var g;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(g||(g={}));const NI=new Map([[ne.A,g.A],[ne.ADDRESS,g.ADDRESS],[ne.ANNOTATION_XML,g.ANNOTATION_XML],[ne.APPLET,g.APPLET],[ne.AREA,g.AREA],[ne.ARTICLE,g.ARTICLE],[ne.ASIDE,g.ASIDE],[ne.B,g.B],[ne.BASE,g.BASE],[ne.BASEFONT,g.BASEFONT],[ne.BGSOUND,g.BGSOUND],[ne.BIG,g.BIG],[ne.BLOCKQUOTE,g.BLOCKQUOTE],[ne.BODY,g.BODY],[ne.BR,g.BR],[ne.BUTTON,g.BUTTON],[ne.CAPTION,g.CAPTION],[ne.CENTER,g.CENTER],[ne.CODE,g.CODE],[ne.COL,g.COL],[ne.COLGROUP,g.COLGROUP],[ne.DD,g.DD],[ne.DESC,g.DESC],[ne.DETAILS,g.DETAILS],[ne.DIALOG,g.DIALOG],[ne.DIR,g.DIR],[ne.DIV,g.DIV],[ne.DL,g.DL],[ne.DT,g.DT],[ne.EM,g.EM],[ne.EMBED,g.EMBED],[ne.FIELDSET,g.FIELDSET],[ne.FIGCAPTION,g.FIGCAPTION],[ne.FIGURE,g.FIGURE],[ne.FONT,g.FONT],[ne.FOOTER,g.FOOTER],[ne.FOREIGN_OBJECT,g.FOREIGN_OBJECT],[ne.FORM,g.FORM],[ne.FRAME,g.FRAME],[ne.FRAMESET,g.FRAMESET],[ne.H1,g.H1],[ne.H2,g.H2],[ne.H3,g.H3],[ne.H4,g.H4],[ne.H5,g.H5],[ne.H6,g.H6],[ne.HEAD,g.HEAD],[ne.HEADER,g.HEADER],[ne.HGROUP,g.HGROUP],[ne.HR,g.HR],[ne.HTML,g.HTML],[ne.I,g.I],[ne.IMG,g.IMG],[ne.IMAGE,g.IMAGE],[ne.INPUT,g.INPUT],[ne.IFRAME,g.IFRAME],[ne.KEYGEN,g.KEYGEN],[ne.LABEL,g.LABEL],[ne.LI,g.LI],[ne.LINK,g.LINK],[ne.LISTING,g.LISTING],[ne.MAIN,g.MAIN],[ne.MALIGNMARK,g.MALIGNMARK],[ne.MARQUEE,g.MARQUEE],[ne.MATH,g.MATH],[ne.MENU,g.MENU],[ne.META,g.META],[ne.MGLYPH,g.MGLYPH],[ne.MI,g.MI],[ne.MO,g.MO],[ne.MN,g.MN],[ne.MS,g.MS],[ne.MTEXT,g.MTEXT],[ne.NAV,g.NAV],[ne.NOBR,g.NOBR],[ne.NOFRAMES,g.NOFRAMES],[ne.NOEMBED,g.NOEMBED],[ne.NOSCRIPT,g.NOSCRIPT],[ne.OBJECT,g.OBJECT],[ne.OL,g.OL],[ne.OPTGROUP,g.OPTGROUP],[ne.OPTION,g.OPTION],[ne.P,g.P],[ne.PARAM,g.PARAM],[ne.PLAINTEXT,g.PLAINTEXT],[ne.PRE,g.PRE],[ne.RB,g.RB],[ne.RP,g.RP],[ne.RT,g.RT],[ne.RTC,g.RTC],[ne.RUBY,g.RUBY],[ne.S,g.S],[ne.SCRIPT,g.SCRIPT],[ne.SEARCH,g.SEARCH],[ne.SECTION,g.SECTION],[ne.SELECT,g.SELECT],[ne.SOURCE,g.SOURCE],[ne.SMALL,g.SMALL],[ne.SPAN,g.SPAN],[ne.STRIKE,g.STRIKE],[ne.STRONG,g.STRONG],[ne.STYLE,g.STYLE],[ne.SUB,g.SUB],[ne.SUMMARY,g.SUMMARY],[ne.SUP,g.SUP],[ne.TABLE,g.TABLE],[ne.TBODY,g.TBODY],[ne.TEMPLATE,g.TEMPLATE],[ne.TEXTAREA,g.TEXTAREA],[ne.TFOOT,g.TFOOT],[ne.TD,g.TD],[ne.TH,g.TH],[ne.THEAD,g.THEAD],[ne.TITLE,g.TITLE],[ne.TR,g.TR],[ne.TRACK,g.TRACK],[ne.TT,g.TT],[ne.U,g.U],[ne.UL,g.UL],[ne.SVG,g.SVG],[ne.VAR,g.VAR],[ne.WBR,g.WBR],[ne.XMP,g.XMP]]);function Oi(e){var t;return(t=NI.get(e))!==null&&t!==void 0?t:g.UNKNOWN}const ke=g,DI={[Ee.HTML]:new Set([ke.ADDRESS,ke.APPLET,ke.AREA,ke.ARTICLE,ke.ASIDE,ke.BASE,ke.BASEFONT,ke.BGSOUND,ke.BLOCKQUOTE,ke.BODY,ke.BR,ke.BUTTON,ke.CAPTION,ke.CENTER,ke.COL,ke.COLGROUP,ke.DD,ke.DETAILS,ke.DIR,ke.DIV,ke.DL,ke.DT,ke.EMBED,ke.FIELDSET,ke.FIGCAPTION,ke.FIGURE,ke.FOOTER,ke.FORM,ke.FRAME,ke.FRAMESET,ke.H1,ke.H2,ke.H3,ke.H4,ke.H5,ke.H6,ke.HEAD,ke.HEADER,ke.HGROUP,ke.HR,ke.HTML,ke.IFRAME,ke.IMG,ke.INPUT,ke.LI,ke.LINK,ke.LISTING,ke.MAIN,ke.MARQUEE,ke.MENU,ke.META,ke.NAV,ke.NOEMBED,ke.NOFRAMES,ke.NOSCRIPT,ke.OBJECT,ke.OL,ke.P,ke.PARAM,ke.PLAINTEXT,ke.PRE,ke.SCRIPT,ke.SECTION,ke.SELECT,ke.SOURCE,ke.STYLE,ke.SUMMARY,ke.TABLE,ke.TBODY,ke.TD,ke.TEMPLATE,ke.TEXTAREA,ke.TFOOT,ke.TH,ke.THEAD,ke.TITLE,ke.TR,ke.TRACK,ke.UL,ke.WBR,ke.XMP]),[Ee.MATHML]:new Set([ke.MI,ke.MO,ke.MN,ke.MS,ke.MTEXT,ke.ANNOTATION_XML]),[Ee.SVG]:new Set([ke.TITLE,ke.FOREIGN_OBJECT,ke.DESC]),[Ee.XLINK]:new Set,[Ee.XML]:new Set,[Ee.XMLNS]:new Set},Z0=new Set([ke.H1,ke.H2,ke.H3,ke.H4,ke.H5,ke.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var U;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(U||(U={}));const cn={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function OI(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function Ml(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function AI(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function io(e){return AI(e)||Ml(e)}function Vb(e){return io(e)||OI(e)}function Fc(e){return e+32}function CE(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function Qb(e){return CE(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function II(e){return e===F.NULL?he.nullCharacterReference:e>1114111?he.characterReferenceOutsideUnicodeRange:TE(e)?he.surrogateCharacterReference:SE(e)?he.noncharacterCharacterReference:wE(e)||e===F.CARRIAGE_RETURN?he.controlCharacterReference:null}class MI{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new bI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CI(xI,(r,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(he.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(he.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const o=II(r);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var r,o;(o=(r=this.handler).onParseError)===null||o===void 0||o.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ht.START_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ht.END_TAG,tagName:"",tagID:g.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:ht.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:ht.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(kE(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const o=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(he.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Oi(t.tagName),t.type===ht.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(he.endTagWithAttributes),t.selfClosing&&this._err(he.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case ht.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ht.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ht.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:ht.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=CE(t)?ht.WHITESPACE_CHARACTER:t===F.NULL?ht.NULL_CHARACTER:ht.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(ht.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ds.Attribute:Ds.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case U.DATA:{this._stateData(t);break}case U.RCDATA:{this._stateRcdata(t);break}case U.RAWTEXT:{this._stateRawtext(t);break}case U.SCRIPT_DATA:{this._stateScriptData(t);break}case U.PLAINTEXT:{this._statePlaintext(t);break}case U.TAG_OPEN:{this._stateTagOpen(t);break}case U.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case U.TAG_NAME:{this._stateTagName(t);break}case U.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case U.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case U.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case U.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case U.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case U.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case U.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case U.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case U.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case U.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case U.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case U.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case U.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case U.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case U.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case U.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case U.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case U.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case U.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case U.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case U.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case U.BOGUS_COMMENT:{this._stateBogusComment(t);break}case U.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case U.COMMENT_START:{this._stateCommentStart(t);break}case U.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case U.COMMENT:{this._stateComment(t);break}case U.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case U.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case U.COMMENT_END:{this._stateCommentEnd(t);break}case U.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case U.DOCTYPE:{this._stateDoctype(t);break}case U.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case U.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case U.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case U.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case U.CDATA_SECTION:{this._stateCdataSection(t);break}case U.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case U.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case U.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case U.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=U.TAG_OPEN;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitCodePoint(t);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case F.AMPERSAND:{this._startCharacterReference();break}case F.LESS_THAN_SIGN:{this.state=U.RCDATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case F.LESS_THAN_SIGN:{this.state=U.RAWTEXT_LESS_THAN_SIGN;break}case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break}case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(io(t))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case F.EXCLAMATION_MARK:{this.state=U.MARKUP_DECLARATION_OPEN;break}case F.SOLIDUS:{this.state=U.END_TAG_OPEN;break}case F.QUESTION_MARK:{this._err(he.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t);break}case F.EOF:{this._err(he.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=U.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(io(t))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case F.GREATER_THAN_SIGN:{this._err(he.missingEndTagName),this.state=U.DATA;break}case F.EOF:{this._err(he.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(he.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=U.BEFORE_ATTRIBUTE_NAME;break}case F.SOLIDUS:{this.state=U.SELF_CLOSING_START_TAG;break}case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentTagToken();break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.tagName+=Vt;break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ml(t)?Fc(t):t)}}_stateRcdataLessThanSign(t){t===F.SOLIDUS?this.state=U.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=U.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){io(t)?(this.state=U.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=U.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=U.BEFORE_ATTRIBUTE_NAME,!1;case F.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=U.SELF_CLOSING_START_TAG,!1;case F.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=U.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===F.SOLIDUS?this.state=U.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){io(t)?(this.state=U.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case F.SOLIDUS:{this.state=U.SCRIPT_DATA_END_TAG_OPEN;break}case F.EXCLAMATION_MARK:{this.state=U.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=U.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){io(t)?(this.state=U.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===F.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===F.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=U.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case F.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case F.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case F.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case F.HYPHEN_MINUS:{this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case F.GREATER_THAN_SIGN:{this.state=U.SCRIPT_DATA,this._emitChars(">");break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Vt);break}case F.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===F.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:io(t)?(this._emitChars("<"),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){io(t)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Jn.SCRIPT,!1)&&Qb(this.preprocessor.peek(Jn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Jn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case F.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.NULL:{this._err(he.unexpectedNullCharacter),this._emitChars(Vt);break}case F.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case F.HYPHEN_MINUS:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case F.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case F.HYPHEN_MINUS:{this._emitChars("-");break}case F.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case F.GREATER_THAN_SIGN:{this.state=U.SCRIPT_DATA,this._emitChars(">");break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vt);break}case F.EOF:{this._err(he.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===F.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Jn.SCRIPT,!1)&&Qb(this.preprocessor.peek(Jn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Jn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:{this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case F.EQUALS_SIGN:{this._err(he.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=U.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:{this._leaveAttrName(),this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case F.EQUALS_SIGN:{this._leaveAttrName(),this.state=U.BEFORE_ATTRIBUTE_VALUE;break}case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:{this._err(he.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.name+=Vt;break}default:this.currentAttr.name+=String.fromCodePoint(Ml(t)?Fc(t):t)}}_stateAfterAttributeName(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:{this.state=U.SELF_CLOSING_START_TAG;break}case F.EQUALS_SIGN:{this.state=U.BEFORE_ATTRIBUTE_VALUE;break}case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{this.state=U.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this.state=U.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(he.missingAttributeValue),this.state=U.DATA,this.emitCurrentTagToken();break}default:this.state=U.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case F.QUOTATION_MARK:{this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case F.APOSTROPHE:{this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break}case F.AMPERSAND:{this._startCharacterReference();break}case F.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break}case F.NULL:{this._err(he.unexpectedNullCharacter),this.currentAttr.value+=Vt;break}case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:case F.EQUALS_SIGN:case F.GRAVE_ACCENT:{this._err(he.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break}case F.SOLIDUS:{this._leaveAttrValue(),this.state=U.SELF_CLOSING_START_TAG;break}case F.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._err(he.missingWhitespaceBetweenAttributes),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case F.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=U.DATA,this.emitCurrentTagToken();break}case F.EOF:{this._err(he.eofInTag),this._emitEOFToken();break}default:this._err(he.unexpectedSolidusInTag),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentComment(n);break}case F.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.data+=Vt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Jn.DASH_DASH,!0)?(this._createCommentToken(Jn.DASH_DASH.length+1),this.state=U.COMMENT_START):this._consumeSequenceIfMatch(Jn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Jn.DOCTYPE.length+1),this.state=U.DOCTYPE):this._consumeSequenceIfMatch(Jn.CDATA_START,!0)?this.inForeignNode?this.state=U.CDATA_SECTION:(this._err(he.cdataInHtmlContent),this._createCommentToken(Jn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=U.BOGUS_COMMENT):this._ensureHibernation()||(this._err(he.incorrectlyOpenedComment),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case F.HYPHEN_MINUS:{this.state=U.COMMENT_START_DASH;break}case F.GREATER_THAN_SIGN:{this._err(he.abruptClosingOfEmptyComment),this.state=U.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=U.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{this.state=U.COMMENT_END;break}case F.GREATER_THAN_SIGN:{this._err(he.abruptClosingOfEmptyComment),this.state=U.DATA,this.emitCurrentComment(n);break}case F.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=U.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{this.state=U.COMMENT_END_DASH;break}case F.LESS_THAN_SIGN:{n.data+="<",this.state=U.COMMENT_LESS_THAN_SIGN;break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.data+=Vt;break}case F.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case F.EXCLAMATION_MARK:{n.data+="!",this.state=U.COMMENT_LESS_THAN_SIGN_BANG;break}case F.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=U.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===F.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=U.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===F.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=U.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==F.GREATER_THAN_SIGN&&t!==F.EOF&&this._err(he.nestedComment),this.state=U.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{this.state=U.COMMENT_END;break}case F.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=U.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentComment(n);break}case F.EXCLAMATION_MARK:{this.state=U.COMMENT_END_BANG;break}case F.HYPHEN_MINUS:{n.data+="-";break}case F.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=U.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case F.HYPHEN_MINUS:{n.data+="--!",this.state=U.COMMENT_END_DASH;break}case F.GREATER_THAN_SIGN:{this._err(he.incorrectlyClosedComment),this.state=U.DATA,this.emitCurrentComment(n);break}case F.EOF:{this._err(he.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=U.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case F.EOF:{this._err(he.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingWhitespaceBeforeDoctypeName),this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ml(t))this._createDoctypeToken(String.fromCharCode(Fc(t))),this.state=U.DOCTYPE_NAME;else switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.NULL:{this._err(he.unexpectedNullCharacter),this._createDoctypeToken(Vt),this.state=U.DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this._err(he.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.EOF:{this._err(he.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=U.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=U.AFTER_DOCTYPE_NAME;break}case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.name+=Vt;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ml(t)?Fc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Jn.PUBLIC,!1)?this.state=U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Jn.SYSTEM,!1)?this.state=U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(he.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.QUOTATION_MARK:{this._err(he.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(he.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(he.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.publicId="",this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(he.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case F.QUOTATION_MARK:{this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.publicId+=Vt;break}case F.GREATER_THAN_SIGN:{this._err(he.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case F.APOSTROPHE:{this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.publicId+=Vt;break}case F.GREATER_THAN_SIGN:{this._err(he.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case F.GREATER_THAN_SIGN:{this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.QUOTATION_MARK:{this._err(he.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(he.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.QUOTATION_MARK:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:{this.state=U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.QUOTATION_MARK:{this._err(he.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{this._err(he.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(he.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case F.APOSTROPHE:{n.systemId="",this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case F.GREATER_THAN_SIGN:{this._err(he.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(n);break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case F.QUOTATION_MARK:{this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.systemId+=Vt;break}case F.GREATER_THAN_SIGN:{this._err(he.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case F.APOSTROPHE:{this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case F.NULL:{this._err(he.unexpectedNullCharacter),n.systemId+=Vt;break}case F.GREATER_THAN_SIGN:{this._err(he.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.EOF:{this._err(he.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(he.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case F.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=U.DATA;break}case F.NULL:{this._err(he.unexpectedNullCharacter);break}case F.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case F.RIGHT_SQUARE_BRACKET:{this.state=U.CDATA_SECTION_BRACKET;break}case F.EOF:{this._err(he.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===F.RIGHT_SQUARE_BRACKET?this.state=U.CDATA_SECTION_END:(this._emitChars("]"),this.state=U.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case F.GREATER_THAN_SIGN:{this.state=U.DATA;break}case F.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=U.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(F.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Vb(this.preprocessor.peek(1))?U.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Vb(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===F.SEMICOLON&&this._err(he.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const _E=new Set([g.DD,g.DT,g.LI,g.OPTGROUP,g.OPTION,g.P,g.RB,g.RP,g.RT,g.RTC]),Gb=new Set([..._E,g.CAPTION,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]),ld=new Set([g.APPLET,g.CAPTION,g.HTML,g.MARQUEE,g.OBJECT,g.TABLE,g.TD,g.TEMPLATE,g.TH]),LI=new Set([...ld,g.OL,g.UL]),RI=new Set([...ld,g.BUTTON]),Kb=new Set([g.ANNOTATION_XML,g.MI,g.MN,g.MO,g.MS,g.MTEXT]),Xb=new Set([g.DESC,g.FOREIGN_OBJECT,g.TITLE]),PI=new Set([g.TR,g.TEMPLATE,g.HTML]),jI=new Set([g.TBODY,g.TFOOT,g.THEAD,g.TEMPLATE,g.HTML]),FI=new Set([g.TABLE,g.TEMPLATE,g.HTML]),BI=new Set([g.TD,g.TH]);class HI{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=g.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===g.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ee.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,r),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Ee.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Z0,Ee.HTML)}popUntilTableCellPopped(){this.popUntilPopped(BI,Ee.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(FI,Ee.HTML)}clearBackToTableBodyContext(){this.clearBackTo(jI,Ee.HTML)}clearBackToTableRowContext(){this.clearBackTo(PI,Ee.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===g.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===g.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const o=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Ee.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case Ee.SVG:{if(Xb.has(o))return!1;break}case Ee.MATHML:{if(Kb.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,ld)}hasInListItemScope(t){return this.hasInDynamicScope(t,LI)}hasInButtonScope(t){return this.hasInDynamicScope(t,RI)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ee.HTML:{if(Z0.has(n))return!0;if(ld.has(n))return!1;break}case Ee.SVG:{if(Xb.has(n))return!1;break}case Ee.MATHML:{if(Kb.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML)switch(this.tagIDs[n]){case t:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ee.HTML)switch(this.tagIDs[t]){case g.TBODY:case g.THEAD:case g.TFOOT:return!0;case g.TABLE:case g.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ee.HTML)switch(this.tagIDs[n]){case t:return!0;case g.OPTION:case g.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&_E.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gb.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Gb.has(this.currentTagId);)this.pop()}}const c0=3;var rs;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(rs||(rs={}));const Jb={type:rs.Marker};class UI{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],o=n.length,i=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===rs.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===i&&this.treeAdapter.getNamespaceURI(h)===l){const p=this.treeAdapter.getAttrList(h);p.length===o&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<c0)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<c0)return;const o=new Map(n.map(l=>[l.name,l.value]));let i=0;for(let l=0;l<r.length;l++){const c=r[l];c.attrs.every(d=>o.get(d.name)===d.value)&&(i+=1,i>=c0&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(Jb)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:rs.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:rs.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Jb);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===rs.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===rs.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===rs.Element&&n.element===t)}}const lo={createDocument(){return{nodeName:"#document",mode:Nr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const o=e.childNodes.find(i=>i.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};lo.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(lo.isTextNode(n)){n.value+=t;return}}lo.appendChild(e,lo.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&lo.isTextNode(r)?r.value+=t:lo.insertBefore(e,lo.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},NE="html",zI="about:legacy-compat",WI="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",DE=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],YI=[...DE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],$I=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),OE=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],qI=[...OE,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Zb(e,t){return t.some(n=>e.startsWith(n))}function VI(e){return e.name===NE&&e.publicId===null&&(e.systemId===null||e.systemId===zI)}function QI(e){if(e.name!==NE)return Nr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===WI)return Nr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),$I.has(n))return Nr.QUIRKS;let r=t===null?YI:DE;if(Zb(n,r))return Nr.QUIRKS;if(r=t===null?OE:qI,Zb(n,r))return Nr.LIMITED_QUIRKS}return Nr.NO_QUIRKS}const ex={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},GI="definitionurl",KI="definitionURL",XI=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),JI=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ee.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ee.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ee.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ee.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ee.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ee.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ee.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ee.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ee.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ee.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ee.XMLNS}]]),ZI=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),eM=new Set([g.B,g.BIG,g.BLOCKQUOTE,g.BODY,g.BR,g.CENTER,g.CODE,g.DD,g.DIV,g.DL,g.DT,g.EM,g.EMBED,g.H1,g.H2,g.H3,g.H4,g.H5,g.H6,g.HEAD,g.HR,g.I,g.IMG,g.LI,g.LISTING,g.MENU,g.META,g.NOBR,g.OL,g.P,g.PRE,g.RUBY,g.S,g.SMALL,g.SPAN,g.STRONG,g.STRIKE,g.SUB,g.SUP,g.TABLE,g.TT,g.U,g.UL,g.VAR]);function tM(e){const t=e.tagID;return t===g.FONT&&e.attrs.some(({name:r})=>r===oa.COLOR||r===oa.SIZE||r===oa.FACE)||eM.has(t)}function AE(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===GI){e.attrs[t].name=KI;break}}function IE(e){for(let t=0;t<e.attrs.length;t++){const n=XI.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function op(e){for(let t=0;t<e.attrs.length;t++){const n=JI.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function nM(e){const t=ZI.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Oi(e.tagName))}function rM(e,t){return t===Ee.MATHML&&(e===g.MI||e===g.MO||e===g.MN||e===g.MS||e===g.MTEXT)}function sM(e,t,n){if(t===Ee.MATHML&&e===g.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===oa.ENCODING){const o=n[r].value.toLowerCase();return o===ex.TEXT_HTML||o===ex.APPLICATION_XML}}return t===Ee.SVG&&(e===g.FOREIGN_OBJECT||e===g.DESC||e===g.TITLE)}function oM(e,t,n,r){return(!r||r===Ee.HTML)&&sM(e,t,n)||(!r||r===Ee.MATHML)&&rM(e,t)}const aM="hidden",iM=8,lM=3;var $;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})($||($={}));const uM={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ME=new Set([g.TABLE,g.TBODY,g.TFOOT,g.THEAD,g.TR]),tx={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:lo,onParseError:null};class nx{constructor(t,n,r=null,o=null){this.fragmentContext=r,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...tx,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new MI(this.options,this),this.activeFormattingElements=new UI(this.treeAdapter),this.fragmentContextID=r?Oi(this.treeAdapter.getTagName(r)):g.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new HI(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...tx,...n};t??(t=r.treeAdapter.createElement(ne.TEMPLATE,Ee.HTML,[]));const o=r.treeAdapter.createElement("documentmock",Ee.HTML,[]),i=new this(r,o,t);return i.fragmentContextID===g.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var o;if(!this.onParseError)return;const i=(o=t.location)!==null&&o!==void 0?o:uM,l={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(l)}onItemPush(t,n,r){var o,i;(i=(o=this.treeAdapter).onItemPush)===null||i===void 0||i.call(o,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(r=this.treeAdapter).onItemPop)===null||o===void 0||o.call(r,t,this.openElements.current),n){let i,l;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,l=this.fragmentContextID):{current:i,currentTagId:l}=this.openElements,this._setContextModes(i,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ee.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ee.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=cn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ee.HTML))switch(this.fragmentContextID){case g.TITLE:case g.TEXTAREA:{this.tokenizer.state=cn.RCDATA;break}case g.STYLE:case g.XMP:case g.IFRAME:case g.NOEMBED:case g.NOFRAMES:case g.NOSCRIPT:{this.tokenizer.state=cn.RAWTEXT;break}case g.SCRIPT:{this.tokenizer.state=cn.SCRIPT_DATA;break}case g.PLAINTEXT:{this.tokenizer.state=cn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,o),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Ee.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ee.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,Ee.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,g.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const o=this.treeAdapter.getChildNodes(n),i=r?o.lastIndexOf(r):o.length,l=o[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:h,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:h,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,o=this.treeAdapter.getTagName(t),i=n.type===ht.END_TAG&&o===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===g.SVG&&this.treeAdapter.getTagName(n)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ee.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===g.MGLYPH||t.tagID===g.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Ee.HTML)}_processToken(t){switch(t.type){case ht.CHARACTER:{this.onCharacter(t);break}case ht.NULL_CHARACTER:{this.onNullCharacter(t);break}case ht.COMMENT:{this.onComment(t);break}case ht.DOCTYPE:{this.onDoctype(t);break}case ht.START_TAG:{this._processStartTag(t);break}case ht.END_TAG:{this.onEndTag(t);break}case ht.EOF:{this.onEof(t);break}case ht.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const o=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return oM(t,o,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===rs.Marker||this.openElements.contains(o.element)),r=n===-1?t-1:n-1;for(let o=r;o>=0;o--){const i=this.activeFormattingElements.entries[o];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(g.P),this.openElements.popUntilTagNamePopped(g.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case g.TR:{this.insertionMode=$.IN_ROW;return}case g.TBODY:case g.THEAD:case g.TFOOT:{this.insertionMode=$.IN_TABLE_BODY;return}case g.CAPTION:{this.insertionMode=$.IN_CAPTION;return}case g.COLGROUP:{this.insertionMode=$.IN_COLUMN_GROUP;return}case g.TABLE:{this.insertionMode=$.IN_TABLE;return}case g.BODY:{this.insertionMode=$.IN_BODY;return}case g.FRAMESET:{this.insertionMode=$.IN_FRAMESET;return}case g.SELECT:{this._resetInsertionModeForSelect(t);return}case g.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case g.HTML:{this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return}case g.TD:case g.TH:{if(t>0){this.insertionMode=$.IN_CELL;return}break}case g.HEAD:{if(t>0){this.insertionMode=$.IN_HEAD;return}break}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===g.TEMPLATE)break;if(r===g.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(t){return ME.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case g.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ee.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case g.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return DI[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){BL(this,t);return}switch(this.insertionMode){case $.INITIAL:{Nl(this,t);break}case $.BEFORE_HTML:{Bl(this,t);break}case $.BEFORE_HEAD:{Hl(this,t);break}case $.IN_HEAD:{Ul(this,t);break}case $.IN_HEAD_NO_SCRIPT:{zl(this,t);break}case $.AFTER_HEAD:{Wl(this,t);break}case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:{RE(this,t);break}case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:{d0(this,t);break}case $.IN_TABLE_TEXT:{UE(this,t);break}case $.IN_COLUMN_GROUP:{ud(this,t);break}case $.AFTER_BODY:{cd(this,t);break}case $.AFTER_AFTER_BODY:{$c(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FL(this,t);return}switch(this.insertionMode){case $.INITIAL:{Nl(this,t);break}case $.BEFORE_HTML:{Bl(this,t);break}case $.BEFORE_HEAD:{Hl(this,t);break}case $.IN_HEAD:{Ul(this,t);break}case $.IN_HEAD_NO_SCRIPT:{zl(this,t);break}case $.AFTER_HEAD:{Wl(this,t);break}case $.TEXT:{this._insertCharacters(t);break}case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:{d0(this,t);break}case $.IN_COLUMN_GROUP:{ud(this,t);break}case $.AFTER_BODY:{cd(this,t);break}case $.AFTER_AFTER_BODY:{$c(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){em(this,t);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:{em(this,t);break}case $.IN_TABLE_TEXT:{Dl(this,t);break}case $.AFTER_BODY:{yM(this,t);break}case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:{gM(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:{bM(this,t);break}case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:{this._err(t,he.misplacedDoctype);break}case $.IN_TABLE_TEXT:{Dl(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,he.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?HL(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case $.INITIAL:{Nl(this,t);break}case $.BEFORE_HTML:{xM(this,t);break}case $.BEFORE_HEAD:{EM(this,t);break}case $.IN_HEAD:{Yr(this,t);break}case $.IN_HEAD_NO_SCRIPT:{SM(this,t);break}case $.AFTER_HEAD:{CM(this,t);break}case $.IN_BODY:{Bn(this,t);break}case $.IN_TABLE:{xi(this,t);break}case $.IN_TABLE_TEXT:{Dl(this,t);break}case $.IN_CAPTION:{TL(this,t);break}case $.IN_COLUMN_GROUP:{lp(this,t);break}case $.IN_TABLE_BODY:{qd(this,t);break}case $.IN_ROW:{Vd(this,t);break}case $.IN_CELL:{kL(this,t);break}case $.IN_SELECT:{YE(this,t);break}case $.IN_SELECT_IN_TABLE:{_L(this,t);break}case $.IN_TEMPLATE:{DL(this,t);break}case $.AFTER_BODY:{AL(this,t);break}case $.IN_FRAMESET:{IL(this,t);break}case $.AFTER_FRAMESET:{LL(this,t);break}case $.AFTER_AFTER_BODY:{PL(this,t);break}case $.AFTER_AFTER_FRAMESET:{jL(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?UL(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case $.INITIAL:{Nl(this,t);break}case $.BEFORE_HTML:{vM(this,t);break}case $.BEFORE_HEAD:{TM(this,t);break}case $.IN_HEAD:{wM(this,t);break}case $.IN_HEAD_NO_SCRIPT:{kM(this,t);break}case $.AFTER_HEAD:{_M(this,t);break}case $.IN_BODY:{$d(this,t);break}case $.TEXT:{fL(this,t);break}case $.IN_TABLE:{Gl(this,t);break}case $.IN_TABLE_TEXT:{Dl(this,t);break}case $.IN_CAPTION:{wL(this,t);break}case $.IN_COLUMN_GROUP:{SL(this,t);break}case $.IN_TABLE_BODY:{tm(this,t);break}case $.IN_ROW:{WE(this,t);break}case $.IN_CELL:{CL(this,t);break}case $.IN_SELECT:{$E(this,t);break}case $.IN_SELECT_IN_TABLE:{NL(this,t);break}case $.IN_TEMPLATE:{OL(this,t);break}case $.AFTER_BODY:{VE(this,t);break}case $.IN_FRAMESET:{ML(this,t);break}case $.AFTER_FRAMESET:{RL(this,t);break}case $.AFTER_AFTER_BODY:{$c(this,t);break}}}onEof(t){switch(this.insertionMode){case $.INITIAL:{Nl(this,t);break}case $.BEFORE_HTML:{Bl(this,t);break}case $.BEFORE_HEAD:{Hl(this,t);break}case $.IN_HEAD:{Ul(this,t);break}case $.IN_HEAD_NO_SCRIPT:{zl(this,t);break}case $.AFTER_HEAD:{Wl(this,t);break}case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:{BE(this,t);break}case $.TEXT:{hL(this,t);break}case $.IN_TABLE_TEXT:{Dl(this,t);break}case $.IN_TEMPLATE:{qE(this,t);break}case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:{ip(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===F.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:{this._insertCharacters(t);break}case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:{LE(this,t);break}case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:{d0(this,t);break}case $.IN_TABLE_TEXT:{HE(this,t);break}}}}function cM(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):FE(e,t),n}function dM(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const o=e.openElements.items[r];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[r])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function fM(e,t,n){let r=t,o=e.openElements.getCommonAncestor(t);for(let i=0,l=o;l!==n;i++,l=o){o=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&i>=lM;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=hM(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function hM(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function mM(e,t,n){const r=e.treeAdapter.getTagName(t),o=Oi(r);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);o===g.TEMPLATE&&i===Ee.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function pM(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,i=e.treeAdapter.createElement(o.tagName,r,o.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,o.tagID)}function ap(e,t){for(let n=0;n<iM;n++){const r=cM(e,t);if(!r)break;const o=dM(e,r);if(!o)break;e.activeFormattingElements.bookmark=r;const i=fM(e,o,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),l&&mM(e,l,i),pM(e,o,r)}}function em(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function yM(e,t){e._appendCommentNode(t,e.openElements.items[0])}function gM(e,t){e._appendCommentNode(t,e.document)}function ip(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(r);if(o&&!o.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(i);l&&!l.endTag&&e._setEndLocation(i,t)}}}}function bM(e,t){e._setDocumentType(t);const n=t.forceQuirks?Nr.QUIRKS:QI(t);VI(t)||e._err(t,he.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function Nl(e,t){e._err(t,he.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Nr.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function xM(e,t){t.tagID===g.HTML?(e._insertElement(t,Ee.HTML),e.insertionMode=$.BEFORE_HEAD):Bl(e,t)}function vM(e,t){const n=t.tagID;(n===g.HTML||n===g.HEAD||n===g.BODY||n===g.BR)&&Bl(e,t)}function Bl(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function EM(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.HEAD:{e._insertElement(t,Ee.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break}default:Hl(e,t)}}function TM(e,t){const n=t.tagID;n===g.HEAD||n===g.BODY||n===g.HTML||n===g.BR?Hl(e,t):e._err(t,he.endTagWithoutMatchingOpenElement)}function Hl(e,t){e._insertFakeElement(ne.HEAD,g.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function Yr(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.TITLE:{e._switchToTextParsing(t,cn.RCDATA);break}case g.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,cn.RAWTEXT):(e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break}case g.NOFRAMES:case g.STYLE:{e._switchToTextParsing(t,cn.RAWTEXT);break}case g.SCRIPT:{e._switchToTextParsing(t,cn.SCRIPT_DATA);break}case g.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break}case g.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Ul(e,t)}}function wM(e,t){switch(t.tagID){case g.HEAD:{e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break}case g.BODY:case g.BR:case g.HTML:{Ul(e,t);break}case g.TEMPLATE:{ba(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function ba(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==g.TEMPLATE&&e._err(t,he.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,he.endTagWithoutMatchingOpenElement)}function Ul(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function SM(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.BASEFONT:case g.BGSOUND:case g.HEAD:case g.LINK:case g.META:case g.NOFRAMES:case g.STYLE:{Yr(e,t);break}case g.NOSCRIPT:{e._err(t,he.nestedNoscriptInHead);break}default:zl(e,t)}}function kM(e,t){switch(t.tagID){case g.NOSCRIPT:{e.openElements.pop(),e.insertionMode=$.IN_HEAD;break}case g.BR:{zl(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function zl(e,t){const n=t.type===ht.EOF?he.openElementsLeftAfterEof:he.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function CM(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.BODY:{e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break}case g.FRAMESET:{e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_FRAMESET;break}case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{e._err(t,he.abandonedHeadElementChild),e.openElements.push(e.headElement,g.HEAD),Yr(e,t),e.openElements.remove(e.headElement);break}case g.HEAD:{e._err(t,he.misplacedStartTagForHeadElement);break}default:Wl(e,t)}}function _M(e,t){switch(t.tagID){case g.BODY:case g.HTML:case g.BR:{Wl(e,t);break}case g.TEMPLATE:{ba(e,t);break}default:e._err(t,he.endTagWithoutMatchingOpenElement)}}function Wl(e,t){e._insertFakeElement(ne.BODY,g.BODY),e.insertionMode=$.IN_BODY,Yd(e,t)}function Yd(e,t){switch(t.type){case ht.CHARACTER:{RE(e,t);break}case ht.WHITESPACE_CHARACTER:{LE(e,t);break}case ht.COMMENT:{em(e,t);break}case ht.START_TAG:{Bn(e,t);break}case ht.END_TAG:{$d(e,t);break}case ht.EOF:{BE(e,t);break}}}function LE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function RE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function NM(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function DM(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function OM(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_FRAMESET)}function AM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function IM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Z0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ee.HTML)}function MM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function LM(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),n||(e.formElement=e.openElements.current))}function RM(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const o=e.openElements.tagIDs[r];if(n===g.LI&&o===g.LI||(n===g.DD||n===g.DT)&&(o===g.DD||o===g.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==g.ADDRESS&&o!==g.DIV&&o!==g.P&&e._isSpecialElement(e.openElements.items[r],o))break}e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML)}function PM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.tokenizer.state=cn.PLAINTEXT}function jM(e,t){e.openElements.hasInScope(g.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1}function FM(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);n&&(ap(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function HM(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(g.NOBR)&&(ap(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ee.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function zM(e,t){e.treeAdapter.getDocumentMode(e.document)!==Nr.QUIRKS&&e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function PE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jE(e){const t=kE(e,oa.TYPE);return t!=null&&t.toLowerCase()===aM}function WM(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ee.HTML),jE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function YM(e,t){e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0}function $M(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._appendElement(t,Ee.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function qM(e,t){t.tagName=ne.IMG,t.tagID=g.IMG,PE(e,t)}function VM(e,t){e._insertElement(t,Ee.HTML),e.skipNextNewLine=!0,e.tokenizer.state=cn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function QM(e,t){e.openElements.hasInButtonScope(g.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function GM(e,t){e.framesetOk=!1,e._switchToTextParsing(t,cn.RAWTEXT)}function rx(e,t){e._switchToTextParsing(t,cn.RAWTEXT)}function KM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function XM(e,t){e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function JM(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ee.HTML)}function ZM(e,t){e.openElements.hasInScope(g.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(g.RTC),e._insertElement(t,Ee.HTML)}function eL(e,t){e._reconstructActiveFormattingElements(),AE(t),op(t),t.selfClosing?e._appendElement(t,Ee.MATHML):e._insertElement(t,Ee.MATHML),t.ackSelfClosing=!0}function tL(e,t){e._reconstructActiveFormattingElements(),IE(t),op(t),t.selfClosing?e._appendElement(t,Ee.SVG):e._insertElement(t,Ee.SVG),t.ackSelfClosing=!0}function sx(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ee.HTML)}function Bn(e,t){switch(t.tagID){case g.I:case g.S:case g.B:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.SMALL:case g.STRIKE:case g.STRONG:{BM(e,t);break}case g.A:{FM(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{IM(e,t);break}case g.P:case g.DL:case g.OL:case g.UL:case g.DIV:case g.DIR:case g.NAV:case g.MAIN:case g.MENU:case g.ASIDE:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.DETAILS:case g.ADDRESS:case g.ARTICLE:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{AM(e,t);break}case g.LI:case g.DD:case g.DT:{RM(e,t);break}case g.BR:case g.IMG:case g.WBR:case g.AREA:case g.EMBED:case g.KEYGEN:{PE(e,t);break}case g.HR:{$M(e,t);break}case g.RB:case g.RTC:{JM(e,t);break}case g.RT:case g.RP:{ZM(e,t);break}case g.PRE:case g.LISTING:{MM(e,t);break}case g.XMP:{QM(e,t);break}case g.SVG:{tL(e,t);break}case g.HTML:{NM(e,t);break}case g.BASE:case g.LINK:case g.META:case g.STYLE:case g.TITLE:case g.SCRIPT:case g.BGSOUND:case g.BASEFONT:case g.TEMPLATE:{Yr(e,t);break}case g.BODY:{DM(e,t);break}case g.FORM:{LM(e,t);break}case g.NOBR:{HM(e,t);break}case g.MATH:{eL(e,t);break}case g.TABLE:{zM(e,t);break}case g.INPUT:{WM(e,t);break}case g.PARAM:case g.TRACK:case g.SOURCE:{YM(e,t);break}case g.IMAGE:{qM(e,t);break}case g.BUTTON:{jM(e,t);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{UM(e,t);break}case g.IFRAME:{GM(e,t);break}case g.SELECT:{KM(e,t);break}case g.OPTION:case g.OPTGROUP:{XM(e,t);break}case g.NOEMBED:case g.NOFRAMES:{rx(e,t);break}case g.FRAMESET:{OM(e,t);break}case g.TEXTAREA:{VM(e,t);break}case g.NOSCRIPT:{e.options.scriptingEnabled?rx(e,t):sx(e,t);break}case g.PLAINTEXT:{PM(e,t);break}case g.COL:case g.TH:case g.TD:case g.TR:case g.HEAD:case g.FRAME:case g.TBODY:case g.TFOOT:case g.THEAD:case g.CAPTION:case g.COLGROUP:break;default:sx(e,t)}}function nL(e,t){if(e.openElements.hasInScope(g.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function rL(e,t){e.openElements.hasInScope(g.BODY)&&(e.insertionMode=$.AFTER_BODY,VE(e,t))}function sL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function oL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(g.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(g.FORM):n&&e.openElements.remove(n))}function aL(e){e.openElements.hasInButtonScope(g.P)||e._insertFakeElement(ne.P,g.P),e._closePElement()}function iL(e){e.openElements.hasInListItemScope(g.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(g.LI),e.openElements.popUntilTagNamePopped(g.LI))}function lL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function uL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function cL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function dL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,g.BR),e.openElements.pop(),e.framesetOk=!1}function FE(e,t){const n=t.tagName,r=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const i=e.openElements.items[o],l=e.openElements.tagIDs[o];if(r===l&&(r!==g.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(i,l))break}}function $d(e,t){switch(t.tagID){case g.A:case g.B:case g.I:case g.S:case g.U:case g.EM:case g.TT:case g.BIG:case g.CODE:case g.FONT:case g.NOBR:case g.SMALL:case g.STRIKE:case g.STRONG:{ap(e,t);break}case g.P:{aL(e);break}case g.DL:case g.UL:case g.OL:case g.DIR:case g.DIV:case g.NAV:case g.PRE:case g.MAIN:case g.MENU:case g.ASIDE:case g.BUTTON:case g.CENTER:case g.FIGURE:case g.FOOTER:case g.HEADER:case g.HGROUP:case g.DIALOG:case g.ADDRESS:case g.ARTICLE:case g.DETAILS:case g.SEARCH:case g.SECTION:case g.SUMMARY:case g.LISTING:case g.FIELDSET:case g.BLOCKQUOTE:case g.FIGCAPTION:{sL(e,t);break}case g.LI:{iL(e);break}case g.DD:case g.DT:{lL(e,t);break}case g.H1:case g.H2:case g.H3:case g.H4:case g.H5:case g.H6:{uL(e);break}case g.BR:{dL(e);break}case g.BODY:{nL(e,t);break}case g.HTML:{rL(e,t);break}case g.FORM:{oL(e);break}case g.APPLET:case g.OBJECT:case g.MARQUEE:{cL(e,t);break}case g.TEMPLATE:{ba(e,t);break}default:FE(e,t)}}function BE(e,t){e.tmplInsertionModeStack.length>0?qE(e,t):ip(e,t)}function fL(e,t){var n;t.tagID===g.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function hL(e,t){e._err(t,he.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function d0(e,t){if(e.openElements.currentTagId!==void 0&&ME.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case ht.CHARACTER:{UE(e,t);break}case ht.WHITESPACE_CHARACTER:{HE(e,t);break}}else hu(e,t)}function mL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_CAPTION}function pL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function yL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,g.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,lp(e,t)}function gL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_TABLE_BODY}function bL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,g.TBODY),e.insertionMode=$.IN_TABLE_BODY,qd(e,t)}function xL(e,t){e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function vL(e,t){jE(t)?e._appendElement(t,Ee.HTML):hu(e,t),t.ackSelfClosing=!0}function EL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ee.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function xi(e,t){switch(t.tagID){case g.TD:case g.TH:case g.TR:{bL(e,t);break}case g.STYLE:case g.SCRIPT:case g.TEMPLATE:{Yr(e,t);break}case g.COL:{yL(e,t);break}case g.FORM:{EL(e,t);break}case g.TABLE:{xL(e,t);break}case g.TBODY:case g.TFOOT:case g.THEAD:{gL(e,t);break}case g.INPUT:{vL(e,t);break}case g.CAPTION:{mL(e,t);break}case g.COLGROUP:{pL(e,t);break}default:hu(e,t)}}function Gl(e,t){switch(t.tagID){case g.TABLE:{e.openElements.hasInTableScope(g.TABLE)&&(e.openElements.popUntilTagNamePopped(g.TABLE),e._resetInsertionMode());break}case g.TEMPLATE:{ba(e,t);break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:hu(e,t)}}function hu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Yd(e,t),e.fosterParentingEnabled=n}function HE(e,t){e.pendingCharacterTokens.push(t)}function UE(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Dl(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)hu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const zE=new Set([g.CAPTION,g.COL,g.COLGROUP,g.TBODY,g.TD,g.TFOOT,g.TH,g.THEAD,g.TR]);function TL(e,t){const n=t.tagID;zE.has(n)?e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,xi(e,t)):Bn(e,t)}function wL(e,t){const n=t.tagID;switch(n){case g.CAPTION:case g.TABLE:{e.openElements.hasInTableScope(g.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(g.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===g.TABLE&&Gl(e,t));break}case g.BODY:case g.COL:case g.COLGROUP:case g.HTML:case g.TBODY:case g.TD:case g.TFOOT:case g.TH:case g.THEAD:case g.TR:break;default:$d(e,t)}}function lp(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.COL:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.TEMPLATE:{Yr(e,t);break}default:ud(e,t)}}function SL(e,t){switch(t.tagID){case g.COLGROUP:{e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break}case g.TEMPLATE:{ba(e,t);break}case g.COL:break;default:ud(e,t)}}function ud(e,t){e.openElements.currentTagId===g.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function qd(e,t){switch(t.tagID){case g.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_ROW;break}case g.TH:case g.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,g.TR),e.insertionMode=$.IN_ROW,Vd(e,t);break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,xi(e,t));break}default:xi(e,t)}}function tm(e,t){const n=t.tagID;switch(t.tagID){case g.TBODY:case g.TFOOT:case g.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break}case g.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,Gl(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:case g.TR:break;default:Gl(e,t)}}function Vd(e,t){switch(t.tagID){case g.TH:case g.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ee.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break}case g.CAPTION:case g.COL:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,qd(e,t));break}default:xi(e,t)}}function WE(e,t){switch(t.tagID){case g.TR:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break}case g.TABLE:{e.openElements.hasInTableScope(g.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,tm(e,t));break}case g.TBODY:case g.TFOOT:case g.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(g.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,tm(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:case g.TD:case g.TH:break;default:Gl(e,t)}}function kL(e,t){const n=t.tagID;zE.has(n)?(e.openElements.hasInTableScope(g.TD)||e.openElements.hasInTableScope(g.TH))&&(e._closeTableCell(),Vd(e,t)):Bn(e,t)}function CL(e,t){const n=t.tagID;switch(n){case g.TD:case g.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break}case g.TABLE:case g.TBODY:case g.TFOOT:case g.THEAD:case g.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),WE(e,t));break}case g.BODY:case g.CAPTION:case g.COL:case g.COLGROUP:case g.HTML:break;default:$d(e,t)}}function YE(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case g.OPTGROUP:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ee.HTML);break}case g.HR:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.INPUT:case g.KEYGEN:case g.TEXTAREA:case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),t.tagID!==g.SELECT&&e._processStartTag(t));break}case g.SCRIPT:case g.TEMPLATE:{Yr(e,t);break}}}function $E(e,t){switch(t.tagID){case g.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===g.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===g.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===g.OPTGROUP&&e.openElements.pop();break}case g.OPTION:{e.openElements.currentTagId===g.OPTION&&e.openElements.pop();break}case g.SELECT:{e.openElements.hasInSelectScope(g.SELECT)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode());break}case g.TEMPLATE:{ba(e,t);break}}}function _L(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e._processStartTag(t)):YE(e,t)}function NL(e,t){const n=t.tagID;n===g.CAPTION||n===g.TABLE||n===g.TBODY||n===g.TFOOT||n===g.THEAD||n===g.TR||n===g.TD||n===g.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(g.SELECT),e._resetInsertionMode(),e.onEndTag(t)):$E(e,t)}function DL(e,t){switch(t.tagID){case g.BASE:case g.BASEFONT:case g.BGSOUND:case g.LINK:case g.META:case g.NOFRAMES:case g.SCRIPT:case g.STYLE:case g.TEMPLATE:case g.TITLE:{Yr(e,t);break}case g.CAPTION:case g.COLGROUP:case g.TBODY:case g.TFOOT:case g.THEAD:{e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,xi(e,t);break}case g.COL:{e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,lp(e,t);break}case g.TR:{e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,qd(e,t);break}case g.TD:case g.TH:{e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,Vd(e,t);break}default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,Bn(e,t)}}function OL(e,t){t.tagID===g.TEMPLATE&&ba(e,t)}function qE(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(g.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ip(e,t)}function AL(e,t){t.tagID===g.HTML?Bn(e,t):cd(e,t)}function VE(e,t){var n;if(t.tagID===g.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===g.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else cd(e,t)}function cd(e,t){e.insertionMode=$.IN_BODY,Yd(e,t)}function IL(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.FRAMESET:{e._insertElement(t,Ee.HTML);break}case g.FRAME:{e._appendElement(t,Ee.HTML),t.ackSelfClosing=!0;break}case g.NOFRAMES:{Yr(e,t);break}}}function ML(e,t){t.tagID===g.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==g.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function LL(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.NOFRAMES:{Yr(e,t);break}}}function RL(e,t){t.tagID===g.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function PL(e,t){t.tagID===g.HTML?Bn(e,t):$c(e,t)}function $c(e,t){e.insertionMode=$.IN_BODY,Yd(e,t)}function jL(e,t){switch(t.tagID){case g.HTML:{Bn(e,t);break}case g.NOFRAMES:{Yr(e,t);break}}}function FL(e,t){t.chars=Vt,e._insertCharacters(t)}function BL(e,t){e._insertCharacters(t),e.framesetOk=!1}function QE(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ee.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function HL(e,t){if(tM(t))QE(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Ee.MATHML?AE(t):r===Ee.SVG&&(nM(t),IE(t)),op(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function UL(e,t){if(t.tagID===g.P||t.tagID===g.BR){QE(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Ee.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(r);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const zL=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,WL=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ox={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function GE(e,t){const n=ZL(e),r=vE("type",{handlers:{root:YL,element:$L,text:qL,comment:XE,doctype:VL,raw:GL},unknown:KL}),o={parser:n?new nx(ox):nx.getFragmentParser(void 0,ox),handle(c){r(c,o)},stitches:!1,options:t||{}};r(e,o),Ai(o,fs());const i=n?o.parser.document:o.parser.getFragment(),l=eI(i,{file:o.options.file});return o.stitches&&tp(l,"comment",function(c,d,h){const p=c;if(p.value.stitch&&h&&d!==void 0){const y=h.children;return y[d]=p.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function KE(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function YL(e,t){KE(e.children,t)}function $L(e,t){XL(e,t),KE(e.children,t),JL(e,t)}function qL(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ht.CHARACTER,chars:e.value,location:mu(e)};Ai(t,fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function VL(e,t){const n={type:ht.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:mu(e)};Ai(t,fs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function QL(e,t){t.stitches=!0;const n=eR(e);if("children"in e&&"children"in n){const r=GE({type:"root",children:e.children},t.options);n.children=r.children}XE({type:"comment",value:{stitch:n}},t)}function XE(e,t){const n=e.value,r={type:ht.COMMENT,data:n,location:mu(e)};Ai(t,fs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function GL(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,JE(t,fs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(zL,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function KL(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))QL(n,t);else{let r="";throw WL.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ai(e,t){JE(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=cn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function JE(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function XL(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===cn.PLAINTEXT)return;Ai(t,fs(e));const r=t.parser.openElements.current;let o="namespaceURI"in r?r.namespaceURI:Qo.html;o===Qo.html&&n==="svg"&&(o=Qo.svg);const i=oI({...e,children:[]},{space:o===Qo.svg?"svg":"html"}),l={type:ht.START_TAG,tagName:n,tagID:Oi(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:mu(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function JL(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&hI.includes(n)||t.parser.tokenizer.state===cn.PLAINTEXT)return;Ai(t,Hd(e));const r={type:ht.END_TAG,tagName:n,tagID:Oi(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:mu(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===cn.RCDATA||t.parser.tokenizer.state===cn.RAWTEXT||t.parser.tokenizer.state===cn.SCRIPT_DATA)&&(t.parser.tokenizer.state=cn.DATA)}function ZL(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function mu(e){const t=fs(e)||{line:void 0,column:void 0,offset:void 0},n=Hd(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function eR(e){return"children"in e?bi({...e,children:[]}):bi(e)}function tR(e){return function(t,n){return GE(t,{...e,file:n})}}const ZE=[{command:"/ai",description:"Generate text at this line"},{command:"/ai!",description:"Replace all widget content"}];function nR({filter:e,selectedIndex:t,position:n,onSelect:r,onClose:o}){const i=N.useRef(null),l=N.useMemo(()=>{const c=e.toLowerCase();return ZE.filter(d=>d.command.toLowerCase().includes(c)||d.description.toLowerCase().includes(c))},[e]);return N.useEffect(()=>{function c(d){i.current&&!i.current.contains(d.target)&&o()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[o]),N.useEffect(()=>{var d;const c=(d=i.current)==null?void 0:d.querySelector('[data-selected="true"]');c&&typeof c.scrollIntoView=="function"&&c.scrollIntoView({block:"nearest"})},[t]),l.length===0?null:lu.createPortal(f.jsx("div",{ref:i,className:"fixed z-[9999] rounded-lg shadow-xl py-1 min-w-[240px]",style:{top:n.top,left:n.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:l.map((c,d)=>f.jsxs("button",{"data-selected":d===t,onMouseDown:h=>{h.preventDefault(),r(c.command)},className:"w-full text-left px-3 py-2 text-sm flex items-center gap-3",style:d===t?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("span",{className:"font-mono font-medium min-w-[3rem]",children:c.command}),f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:c.description})]},c.command))}),document.body)}function rR(e){const t=e.trim(),n=t.match(/^\/ai!\s+(.+)$/);if(n!=null&&n[1])return{mode:"replace",prompt:n[1].trim()};const r=t.match(/^\/ai\s+(.+)$/);return r!=null&&r[1]?{mode:"insert",prompt:r[1].trim()}:null}function Bc(e,t,n){const r=e.split(`
123
+ `),o=r.findIndex(i=>i.trim()===t.trim());return o===-1?e:(r[o]=n,r.join(`
124
+ `))}function sR({chartName:e,chartTitle:t,displayValue:n,field:r,change:o,previousValue:i,lockedPreset:l,lockedRange:c,format:d}){const[h,p]=N.useState(!1),[y,b]=N.useState({top:0,left:0,placement:"below"}),v=N.useRef(null),D=N.useRef(null);N.useEffect(()=>{if(!h||!D.current)return;const k=()=>{var Q,q;if(!D.current)return;const O=D.current.getBoundingClientRect(),I=((Q=v.current)==null?void 0:Q.offsetHeight)||180,_=window.innerHeight-O.bottom,C=O.top,A=8;let P="below",H;_<I+A&&C>_?(P="above",H=O.top+window.scrollY-I-A):H=O.bottom+window.scrollY+A;let B=O.left+window.scrollX;const z=((q=v.current)==null?void 0:q.offsetWidth)||220;B+z>window.innerWidth-A&&(B=window.innerWidth-z-A),B<A&&(B=A),b({top:H,left:B,placement:P})};k(),requestAnimationFrame(k)},[h]),N.useEffect(()=>{if(!h)return;function k(O){v.current&&!v.current.contains(O.target)&&D.current&&!D.current.contains(O.target)&&p(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[h]),N.useEffect(()=>{if(!h)return;function k(O){O.key==="Escape"&&p(!1)}return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[h]);const S=l?l.replace(/_/g," ").replace(/\b\w/g,k=>k.toUpperCase()):c?c.replace(".."," to "):null,E=o!==void 0?`${o>=0?"+":""}${o.toFixed(1)}%`:null,T=o!==void 0?o>=0?"var(--yc-color-success)":"var(--yc-color-danger)":void 0;return f.jsxs(f.Fragment,{children:[f.jsx("span",{ref:D,onClick:()=>p(!h),className:"font-semibold border-b border-dashed cursor-pointer px-0.5 rounded transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)",borderColor:"color-mix(in srgb, var(--yc-color-primary) 50%, transparent)"},children:n}),h&&lu.createPortal(f.jsxs("div",{ref:v,className:"fixed z-[9999] rounded-lg shadow-xl p-3 min-w-[220px] text-sm",style:{top:y.top,left:y.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[f.jsx("div",{className:"font-medium mb-2",style:{color:"var(--yc-color-text)"},children:t}),f.jsxs("div",{className:"flex items-baseline gap-2 mb-2",children:[f.jsx("span",{className:"text-2xl font-bold",style:{color:"var(--yc-color-text)"},children:n}),r&&r!=="value"&&r!=="formatted"&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",r,")"]})]}),E&&f.jsxs("div",{className:"text-sm mb-2",style:T?{color:T}:void 0,children:[E," vs previous period",i!==void 0&&f.jsxs("span",{className:"ml-1",style:{color:"var(--yc-color-text-secondary)"},children:["(",(d==null?void 0:d.type)==="currency"?"$":"",i.toLocaleString(),")"]})]}),f.jsx("div",{className:"border-t my-2",style:{borderColor:"var(--yc-color-border)"}}),f.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),S?f.jsx("span",{children:S}):f.jsx("span",{className:"italic",children:"Follows dashboard filter"})]}),f.jsxs("div",{className:"flex items-center gap-2 text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:[f.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),f.jsx("span",{children:e})]})]}),document.body)]})}function oR(e){const t=/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,n=new Map;let r;for(;(r=t.exec(e))!==null;){const o=r[1],i=r[2],l=r[3];if(!o)continue;let c;if(l){const h=l.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);h?c={startDate:h[1],endDate:h[2]}:c={preset:l}}const d=`${o}:${i||""}:${l||""}`;n.has(d)||n.set(d,{chartName:o,field:i,locked:c})}return Array.from(n.values())}function aR(e){return Array.from(new Set(e.map(t=>t.chartName)))}function iR(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function lR(e,t){if(e.locked){if(e.locked.preset)return pi({date_range:e.locked.preset});if(e.locked.startDate&&e.locked.endDate)return{date_range:{type:"custom",start:e.locked.startDate,end:e.locked.endDate},start_date:e.locked.startDate,end_date:e.locked.endDate}}return pi(t)}function nm(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function uR(e,t){const n=aR(e),r=N.useMemo(()=>{const p=new Map;return e.forEach(y=>{const b=lR(y,t),v=`${y.chartName}:${JSON.stringify(b)}`;p.has(v)||p.set(v,{chartName:y.chartName,params:b,refs:[]}),p.get(v).refs.push(y)}),Array.from(p.values())},[e,t]),o=Zg({queries:r.map(p=>({queryKey:["chartData",p.chartName,p.params],queryFn:()=>xt.queryChart(p.chartName,p.params),enabled:r.length>0}))}),i=Zg({queries:n.map(p=>({queryKey:["chart",p],queryFn:()=>xt.getChart(p),enabled:n.length>0}))}),l=N.useMemo(()=>{const p={};return n.forEach((y,b)=>{const v=i[b];v!=null&&v.data&&(p[y]=v.data)}),p},[n,i]),c=N.useMemo(()=>{const p={};return r.forEach((y,b)=>{var E,T,k;const v=o[b],D=(E=l[y.chartName])==null?void 0:E.chart;if(!((k=(T=v==null?void 0:v.data)==null?void 0:T.rows)!=null&&k[0])||!D)return;const S=v.data.rows[0];y.refs.forEach(O=>{var L,_;const I=nm(O);if(D.type==="kpi"&&((L=D.value)!=null&&L.field)){const C=D.value.field,A=S[C]??0,P={value:A,formatted:iR(A,D.format),fields:{}};if(Object.entries(S).forEach(([H,B])=>{typeof B=="number"&&(P.fields[H]=B)}),(_=D.comparison)!=null&&_.enabled&&D.comparison.field){const H=S[D.comparison.field];H&&H!==0&&(D.comparison.type==="percent_change"?P.change=(A-H)/H*100:P.change=A-H)}p[I]=P}})}),p},[r,o,l]),d=o.some(p=>p.isLoading)||i.some(p=>p.isLoading),h=N.useMemo(()=>{const p={};return n.forEach((y,b)=>{var D;const v=i[b];(D=v==null?void 0:v.data)!=null&&D.title&&(p[y]=v.data.title)}),p},[n,i]);return{values:c,isLoading:d,getRefKey:nm,chartTitles:h}}function cR(e,t,n){const r={};let o=0;return{content:e.replace(/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,(l,c,d,h)=>{let p,y,b;if(h){const k=h.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);k?(p={startDate:k[1],endDate:k[2]},b=h):(p={preset:h},y=h)}const D=nm({chartName:c,field:d,locked:p}),S=t[D];if(!S)return l;let E;if(d)if(d==="formatted"||d==="value")E=S.formatted;else if(d==="change"&&S.change!==void 0)E=`${S.change>=0?"+":""}${S.change.toFixed(1)}%`;else if(S.fields[d]!==void 0)E=S.fields[d].toLocaleString();else return l;else E=S.formatted;const T=`kpi-ref-${o++}`;return r[T]={chartName:c,chartTitle:n[c]||c,displayValue:E,field:d,change:S.change,previousValue:S.fields.previous_value,lockedPreset:y,lockedRange:b},`<kpi-ref data-ref-id="${T}">${E}</kpi-ref>`}),refData:r}}function dR({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:o,onClose:i}){const l=N.useRef(null),c=N.useMemo(()=>{const d=e.toLowerCase();return t.filter(h=>h.name.toLowerCase().includes(d)||h.title.toLowerCase().includes(d))},[e,t]);return N.useEffect(()=>{function d(h){l.current&&!l.current.contains(h.target)&&i()}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[i]),N.useEffect(()=>{var h;const d=(h=l.current)==null?void 0:h.querySelector('[data-selected="true"]');d==null||d.scrollIntoView({block:"nearest"})},[n]),c.length===0?null:lu.createPortal(f.jsx("div",{ref:l,className:"fixed z-[9999] rounded-lg shadow-xl py-1 max-h-48 overflow-y-auto min-w-[200px]",style:{top:r.top,left:r.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:c.map((d,h)=>f.jsxs("button",{"data-selected":h===n,onMouseDown:p=>{p.preventDefault(),o(d.name)},className:"w-full text-left px-3 py-1.5 text-sm flex flex-col",style:h===n?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:[f.jsx("span",{className:"font-medium truncate",children:d.title}),f.jsx("span",{className:"text-xs font-mono truncate",style:{color:"var(--yc-color-text-muted)"},children:`{{${d.name}}}`})]},d.name))}),document.body)}function fR({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:o,dashboardName:i}){const{isEditing:l}=ki(),[c,d]=N.useState(e),h=N.useRef(null),[p,y]=N.useState(null),[b,v]=N.useState({top:0,left:0}),D=N.useRef(null),[S,E]=N.useState(!1),[T,k]=N.useState(null),[O,I]=N.useState(null),[L,_]=N.useState({top:0,left:0}),C=Je(G=>G.globalFilters),{data:A}=hr({queryKey:["config"],queryFn:()=>xt.getConfig()}),P=N.useMemo(()=>(A==null?void 0:A.charts.filter(G=>G.type==="kpi"))||[],[A]),H=N.useMemo(()=>oR(e),[e]),{values:B,isLoading:z,chartTitles:Q}=uR(H,C),{content:q,refData:X}=N.useMemo(()=>z||Object.keys(B).length===0?{content:e,refData:{}}:cR(e,B,Q),[e,B,z,Q]),ie=N.useMemo(()=>({"kpi-ref":({children:G,...Z})=>{const ue=Z["data-ref-id"],me=ue?X[ue]:null;return me?f.jsx(sR,{chartName:me.chartName,chartTitle:me.chartTitle,displayValue:me.displayValue,field:me.field,change:me.change,previousValue:me.previousValue,lockedPreset:me.lockedPreset,lockedRange:me.lockedRange}):f.jsx("span",{children:G})}}),[X]);N.useEffect(()=>{n||d(e)},[e,n]),N.useEffect(()=>{n&&h.current&&h.current.focus()},[n]);const ge=()=>{t==null||t(c),y(null),o==null||o()},te=()=>{d(e),y(null),o==null||o()},de=()=>{const G=h.current,Z=D.current;if(!G||!Z)return;const ue=G.selectionStart,me=G.value.substring(0,ue);Z.textContent=me;const Ce=G.getBoundingClientRect(),Re=Z.offsetWidth,tt=parseFloat(getComputedStyle(G).lineHeight)||18,Ge=G.clientWidth-16,nt=me.split(`
125
+ `),we=nt[nt.length-1]||"";Z.textContent=we;const je=Math.min(Z.offsetWidth,Ge),re=(nt.length-1+Math.floor(Re/Ge))*tt;v({top:Ce.top+re+tt+4-G.scrollTop,left:Ce.left+je+8})},M=()=>{const G=h.current,Z=D.current;if(!G||!Z)return;const ue=G.selectionStart,me=G.value.substring(0,ue),Ce=G.getBoundingClientRect(),Re=parseFloat(getComputedStyle(G).lineHeight)||18,tt=G.clientWidth-16,Ge=me.split(`
126
+ `),nt=Ge[Ge.length-1]||"";Z.textContent=nt;const we=Math.min(Z.offsetWidth,tt);Z.textContent=me;const oe=(Ge.length-1+Math.floor(Z.offsetWidth/tt))*Re;_({top:Ce.top+oe+Re+4-G.scrollTop,left:Ce.left+we+8})},V=N.useMemo(()=>{if(!(p!=null&&p.active))return[];const G=p.filter.toLowerCase();return P.filter(Z=>Z.name.toLowerCase().includes(G)||Z.title.toLowerCase().includes(G))},[p,P]),ae=G=>{if(!p||!h.current)return;const Z=h.current,ue=c.substring(0,p.startPos),me=c.substring(Z.selectionStart),Ce=`{{${G}}}`,Re=ue+Ce+me;d(Re),y(null);const tt=ue.length+Ce.length;setTimeout(()=>{Z.selectionStart=Z.selectionEnd=tt,Z.focus()},0)},j=G=>{if(!h.current)return;const Z=h.current,ue=Z.selectionStart,me=c.lastIndexOf(`
127
+ `,ue-1)+1,Ce=c.indexOf(`
128
+ `,ue),Re=Ce===-1?c.length:Ce,tt=c.substring(0,me),Ge=c.substring(Re),nt=tt+G+" "+Ge;d(nt),I(null);const we=me+G.length+1;setTimeout(()=>{Z.selectionStart=Z.selectionEnd=we,Z.focus()},0)},le=async(G,Z,ue)=>{E(!0),k(null);const me=Z==="replace"?"⏳ Generating...":Bc(c,ue,"⏳ Generating...");d(me);const Ce=Bc(c,ue,"").replace(/\n\n\n+/g,`
129
+
130
+ `).trim();try{const Re=await xt.generateText({prompt:G,mode:Z,dashboard:i,existingContent:Z==="insert"?Ce:void 0,filters:C});d(Z==="replace"?Re.content:Bc(me,"⏳ Generating...",Re.content))}catch(Re){const tt=Re instanceof Error?Re.message:"Generation failed";k(tt),d(Z==="replace"?ue:Bc(me,"⏳ Generating...",ue))}finally{E(!1)}},pe=G=>{if(O!=null&&O.active){const je=O.filter.toLowerCase(),oe=ZE.filter(re=>re.command.toLowerCase().includes(je)||re.description.toLowerCase().includes(je));if(G.key==="ArrowDown"){G.preventDefault(),I(re=>re?{...re,selectedIndex:Math.min(re.selectedIndex+1,oe.length-1)}:null);return}if(G.key==="ArrowUp"){G.preventDefault(),I(re=>re?{...re,selectedIndex:Math.max(re.selectedIndex-1,0)}:null);return}if(G.key==="Enter"||G.key==="Tab"){G.preventDefault();const re=oe[O.selectedIndex];re&&j(re.command);return}if(G.key==="Escape"){G.preventDefault(),I(null);return}}if(p!=null&&p.active){if(G.key==="ArrowDown"){G.preventDefault(),y(je=>je?{...je,selectedIndex:Math.min(je.selectedIndex+1,V.length-1)}:null);return}if(G.key==="ArrowUp"){G.preventDefault(),y(je=>je?{...je,selectedIndex:Math.max(je.selectedIndex-1,0)}:null);return}if(G.key==="Enter"||G.key==="Tab"){G.preventDefault();const je=V[p.selectedIndex];je&&ae(je.name);return}if(G.key==="Escape"){G.preventDefault(),y(null);return}}if(G.key==="Escape"){G.preventDefault(),te();return}if(G.key!=="Enter")return;const Z=h.current;if(Z){const je=Z.selectionStart,oe=c.substring(0,je),re=oe.lastIndexOf(`
131
+ `)+1,xe=oe.substring(re),Oe=rR(xe);if(Oe&&i){G.preventDefault(),le(Oe.prompt,Oe.mode,xe);return}}const ue=G.currentTarget,{selectionStart:me,value:Ce}=ue,Re=Ce.substring(0,me),tt=Re.lastIndexOf(`
132
+ `)+1,Ge=Re.substring(tt),nt=Ge.match(/^(\s*)([-*])\s(.*)$/);if(nt){const je=nt[1]??"",oe=nt[2]??"-";if(!(nt[3]??"").trim()){G.preventDefault();const qe=Ce.substring(0,tt)+Ce.substring(me);d(qe),setTimeout(()=>{ue.selectionStart=ue.selectionEnd=tt},0);return}G.preventDefault();const xe=`
133
+ ${je}${oe} `,Oe=Ce.substring(0,me)+xe+Ce.substring(me);d(Oe),setTimeout(()=>{ue.selectionStart=ue.selectionEnd=me+xe.length},0);return}const we=Ge.match(/^(\s*)(\d+)\.\s(.*)$/);if(we){const je=we[1]??"",oe=we[2]??"1";if(!(we[3]??"").trim()){G.preventDefault();const pt=Ce.substring(0,tt)+Ce.substring(me);d(pt),setTimeout(()=>{ue.selectionStart=ue.selectionEnd=tt},0);return}G.preventDefault();const xe=parseInt(oe,10)+1,Oe=`
134
+ ${je}${xe}. `,qe=Ce.substring(0,me)+Oe+Ce.substring(me);d(qe),setTimeout(()=>{ue.selectionStart=ue.selectionEnd=me+Oe.length},0);return}},ye=G=>{T&&k(null);const Z=G.target.value,ue=G.target.selectionStart;d(Z);const me=Z.substring(0,ue),Ce=me.lastIndexOf("{");if(Ce>=0){const Ge=me.substring(Ce+1);if(!Ge.includes("}")&&!Ge.includes(`
135
+ `)){const nt=Ge.replace(/^\{/,"");y({active:!0,startPos:Ce,filter:nt,selectedIndex:0}),setTimeout(de,0);return}}y(null);const Re=me.lastIndexOf(`
136
+ `)+1,tt=me.substring(Re);if(tt.startsWith("/")&&!tt.includes(" ")){const Ge=tt.substring(1);I({active:!0,filter:Ge,selectedIndex:0}),setTimeout(M,0)}else O!=null&&O.active&&I(null)},Ne=G=>{const Z=G.relatedTarget;Z!=null&&Z.closest("[data-kpi-autocomplete]")||S||ge()};return n?f.jsxs("div",{className:"h-full relative",children:[f.jsx("textarea",{ref:h,value:c,onChange:ye,onKeyDown:pe,onBlur:Ne,disabled:S,className:"h-full w-full p-4 resize-none font-mono text-sm focus:outline-none bg-transparent",style:S?{opacity:.6}:void 0,placeholder:"Type markdown here... Use {{ to insert KPI references, / for AI commands"}),f.jsx("span",{ref:D,className:"invisible fixed top-0 left-0 font-mono text-sm whitespace-pre","aria-hidden":"true"}),(p==null?void 0:p.active)&&V.length>0&&f.jsx(dR,{filter:p.filter,kpiCharts:P,selectedIndex:p.selectedIndex,position:b,onSelect:ae,onClose:()=>y(null)}),(O==null?void 0:O.active)&&f.jsx(nR,{filter:O.filter,selectedIndex:O.selectedIndex,position:L,onSelect:j,onClose:()=>I(null)}),T&&f.jsx("div",{className:"absolute bottom-12 left-4 right-4 text-xs p-2 rounded",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)",color:"var(--yc-color-danger)"},children:T})]}):f.jsxs("div",{className:"h-full p-4 overflow-auto flex flex-col justify-center",style:{containerType:"size"},children:[f.jsx("div",{className:"prose max-w-none prose-headings:mt-2 prose-headings:mb-2 prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",style:{fontSize:"clamp(0.875rem, min(5cqh, 2.5cqw), 1.5rem)"},children:f.jsx(B5,{rehypePlugins:[tR],components:ie,children:q})}),l&&t&&!e&&f.jsx("div",{className:"text-sm italic",style:{color:"var(--yc-color-text-muted)"},children:"Double-click to edit"})]})}function hR({children:e,onRemove:t,widgetType:n,onDoubleClick:r,isContentEditing:o}){const{isEditing:i}=ki();return f.jsxs("div",{className:nr("h-full relative",i&&"ring-2 ring-blue-200",i&&!o&&"select-none"),style:{background:"var(--yc-color-surface)",borderRadius:"var(--yc-radius)",boxShadow:"var(--yc-shadow)",border:"var(--yc-card-border)"},children:[i&&f.jsxs(f.Fragment,{children:[!(n==="text"&&o)&&f.jsx("div",{className:"absolute inset-0 z-[5] cursor-grab active:cursor-grabbing",style:{pointerEvents:"all"},onMouseDown:l=>l.preventDefault(),onDoubleClick:l=>{r&&(l.stopPropagation(),r())}}),t&&f.jsx("div",{className:"absolute top-1 right-1 z-10",children:f.jsx("button",{onClick:l=>{l.stopPropagation(),t()},className:"w-5 h-5 bg-white/70 hover:bg-red-100 rounded flex items-center justify-center transition-colors",title:"Remove widget",children:f.jsx("svg",{className:"w-3 h-3 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]}),f.jsx("div",{className:"h-full",children:e})]})}const Ol=38,eT=12,mR={lg:1024,md:768,sm:0},pR={lg:12,md:6,sm:1};function yR(e){return e.type==="chart"&&e.ref?`chart-${e.ref}`:e.type==="text"?`text-${(e.content||"empty").slice(0,50).replace(/[^a-zA-Z0-9]/g,"_").replace(/_+/g,"_")}`:"widget-unknown"}function gR(e){const t=[...e].sort((r,o)=>r.y-o.y||r.x-o.x),n=[];return t.map(r=>{let o=0;for(const l of n)r.x<l.x+l.w&&r.x+r.w>l.x&&(o=Math.max(o,l.y+l.h));const i={...r,y:o};return n.push(i),i})}const bR=40;function xR(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<eT;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const tT=xR(bR),vR=tT.map(e=>f.jsx("div",{style:{boxSizing:"border-box",background:"rgba(59, 130, 246, 0.04)",borderRadius:4,border:"1px solid rgba(59, 130, 246, 0.06)"}},e.i));function ER({layout:e,onLayoutChange:t,dashboardName:n}){const{isEditing:r,setPendingLayout:o,setOriginalLayout:i,currentLayout:l,removeWidget:c,updateWidget:d}=ki(),h=dm(),p=N.useRef(""),y=N.useRef(""),b=N.useRef(null),[v,D]=N.useState(0),[S,E]=N.useState(null),T=N.useRef(0),k=N.useRef(!1);N.useEffect(()=>{const q=b.current;if(!q)return;const X=new ResizeObserver(ie=>{var te;const ge=(te=ie[0])==null?void 0:te.contentRect.width;ge&&ge>0&&D(Math.floor(ge))});return X.observe(q),()=>X.disconnect()},[]),N.useEffect(()=>{const q=JSON.stringify(e);q!==p.current&&(p.current=q,i(e))},[e,i]),N.useEffect(()=>{r||E(null)},[r]);const O=l||e,I=O.gap??16,{gridLayout:L,widgetMap:_,widgetList:C}=N.useMemo(()=>{const q=[],X=new Map,ie=[];let ge=0;const te=new Set;return O.rows.forEach((M,V)=>{let ae=0,j=0;M.widgets.forEach((le,pe)=>{let ye=yR(le);if(te.has(ye)){let ue=2;for(;te.has(`${ye}-${ue}`);)ue++;ye=`${ye}-${ue}`}te.add(ye);const Ne=le.height??M.height,G=Math.ceil(Ne/Ol),Z={i:ye,x:le.x??ae,y:le.y??ge,w:le.cols,h:G,minW:1,minH:1,static:!r||S===ye};q.push(Z),X.set(ye,{widget:le,rowIndex:V,widgetIndex:pe}),ie.push({id:ye,widget:le,rowIndex:V,widgetIndex:pe}),ae+=le.cols,j=Math.max(j,G)}),ge+=j}),{gridLayout:gR(q),widgetMap:X,widgetList:ie}},[O,r,S]);N.useEffect(()=>{r&&C.length>T.current&&setTimeout(()=>{var q;(q=b.current)==null||q.scrollIntoView({behavior:"smooth",block:"end"})},100),T.current=C.length},[C.length,r]);const A=N.useMemo(()=>wD(L),[L]),P=N.useCallback(q=>{const ie=[...q.filter(V=>_.has(V.i))].sort((V,ae)=>V.y-ae.y||V.x-ae.x),ge=ie.map(V=>`${V.i}:${V.x},${V.y},${V.w},${V.h}`).join("|");if(ge===y.current)return null;y.current=ge;const te=new Map;ie.forEach(V=>{const ae=_.get(V.i);if(!ae)return;let j=te.get(V.y);j||(j={items:[]},te.set(V.y,j));const le=V.h*Ol;j.items.push({item:V,widget:{...ae.widget,cols:V.w,height:le,x:V.x,y:V.y}})});const de=[],M=[...te.keys()].sort((V,ae)=>V-ae);for(const V of M){const ae=te.get(V),j=Math.max(...ae.items.map(le=>le.item.h));de.push({height:j*Ol,widgets:ae.items.map(le=>le.widget)})}return{gap:O.gap,rows:de}},[_,O.gap]),H=N.useCallback(q=>{if(!r||k.current)return;const X=P(q);X&&(o(X),t==null||t(X))},[r,P,o,t]),B=N.useCallback(q=>{if(k.current=!1,!r)return;const X=P(q);X&&(o(X),t==null||t(X))},[r,P,o,t]),z=N.useCallback((q,X)=>{c(q,X)},[c]),Q=N.useCallback((q,X,ie)=>{d(q,X,{content:ie})},[d]);return f.jsxs(f.Fragment,{children:[!r&&f.jsx("style",{children:".react-resizable-handle { display: none !important; }"}),r&&f.jsx("style",{children:`
137
+ .react-grid-placeholder {
138
+ background: rgba(59, 130, 246, 0.15) !important;
139
+ border: 2px dashed rgba(59, 130, 246, 0.4) !important;
140
+ border-radius: var(--yc-radius) !important;
141
+ opacity: 1 !important;
142
+ }
143
+ .yc-edit-grid .react-grid-item {
144
+ transition: all 200ms ease !important;
145
+ }
146
+ .yc-edit-grid .react-grid-item.react-draggable-dragging {
147
+ transition: none !important;
148
+ z-index: 100;
149
+ box-shadow: 0 8px 25px rgba(0,0,0,0.15);
150
+ }
151
+ .yc-edit-grid .react-resizable-handle {
152
+ background: none !important;
153
+ width: 24px !important;
154
+ height: 24px !important;
155
+ z-index: 10 !important;
156
+ }
157
+ .yc-edit-grid .react-resizable-handle::after {
158
+ content: '' !important;
159
+ position: absolute !important;
160
+ right: 4px !important;
161
+ bottom: 4px !important;
162
+ width: 10px !important;
163
+ height: 10px !important;
164
+ border-right: 2px solid rgba(59,130,246,0.4) !important;
165
+ border-bottom: 2px solid rgba(59,130,246,0.4) !important;
166
+ border-radius: 0 0 2px 0 !important;
167
+ }
168
+ .yc-edit-grid .react-resizable-handle:hover::after {
169
+ border-color: rgba(59,130,246,0.8) !important;
170
+ }
171
+ .yc-bg-grid {
172
+ position: absolute !important;
173
+ inset: 0 !important;
174
+ pointer-events: none !important;
175
+ z-index: 0 !important;
176
+ overflow: hidden !important;
177
+ }
178
+ .yc-bg-grid .react-grid-item {
179
+ transition: none !important;
180
+ }
181
+ .yc-edit-grid {
182
+ position: relative;
183
+ }
184
+ .yc-edit-grid > .react-grid-item {
185
+ z-index: 1;
186
+ }
187
+ `}),f.jsxs("div",{ref:b,style:{position:"relative"},children:[v>0&&r&&h==="lg"&&f.jsx(ED,{className:"yc-bg-grid",layout:tT,cols:eT,rowHeight:Ol,width:v,margin:[I,I],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:vR}),v>0&&f.jsx(TD,{className:r?"layout yc-edit-grid":"layout",layouts:A,breakpoints:mR,cols:pR,rowHeight:Ol,width:v,margin:[I,I],isDraggable:r&&h==="lg",isResizable:r&&h==="lg",onLayoutChange:(q,X)=>{X.lg&&H(X.lg)},onDragStart:()=>{k.current=!0},onResizeStart:()=>{k.current=!0},onDragStop:q=>B([...q]),onResizeStop:q=>B([...q]),compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:C.map(({id:q,widget:X,rowIndex:ie,widgetIndex:ge})=>f.jsx("div",{className:"h-full",children:f.jsxs(hR,{onRemove:()=>z(ie,ge),widgetType:X.type,isContentEditing:S===q,onDoubleClick:X.type==="text"?()=>E(q):void 0,children:[X.type==="chart"&&X.ref&&f.jsx(_D,{chartRef:X.ref}),X.type==="text"&&f.jsx(fR,{content:X.content||"",onUpdate:te=>Q(ie,ge,te),isContentEditing:S===q,onEditStart:()=>E(q),onEditEnd:()=>E(null),dashboardName:n})]})},q))})]})]})}function TR({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:o}=ma(),[i,l]=N.useState(""),c=N.useRef(null);if(N.useEffect(()=>{const y=v=>{v.key==="Escape"&&t()},b=v=>{c.current&&!c.current.contains(v.target)&&t()};return e&&(document.addEventListener("keydown",y),document.addEventListener("mousedown",b)),()=>{document.removeEventListener("keydown",y),document.removeEventListener("mousedown",b)}},[e,t]),!e)return null;const h=((o==null?void 0:o.charts)||[]).filter(y=>y.title.toLowerCase().includes(i.toLowerCase())||y.name.toLowerCase().includes(i.toLowerCase())),p=y=>{n({type:"chart",ref:y,cols:6}),t()};return f.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:f.jsxs("div",{ref:c,className:"rounded-lg shadow-xl w-full max-w-md mx-4",style:{backgroundColor:"var(--yc-color-surface)"},children:[f.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:"Add Chart"}),f.jsx("button",{onClick:t,className:"p-1 hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),f.jsx("input",{type:"text",placeholder:"Search charts...",value:i,onChange:y=>l(y.target.value),className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"},autoFocus:!0})]}),f.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.length===0?f.jsx("div",{className:"p-4 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No charts found"}):f.jsx("div",{className:"p-2",children:h.map(y=>{const b=r.includes(y.name);return f.jsxs("button",{onClick:()=>p(y.name),disabled:b,className:"w-full text-left px-3 py-3 rounded-md hover:bg-black/5 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-between group",children:[f.jsxs("div",{children:[f.jsx("div",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:y.title}),f.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:y.name}),y.description&&f.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:y.description})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-xs px-2 py-1 rounded",style:{color:"var(--yc-color-text-muted)",backgroundColor:"var(--yc-color-surface-hover)"},children:y.type}),b?f.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-success)"},children:"Added"}):f.jsx("svg",{className:"w-5 h-5 opacity-0 group-hover:opacity-100",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},y.name)})})})]})})}function wR(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:new Date(e).toLocaleDateString()}function SR({dashboardId:e,title:t,description:n,contentRef:r,activeTab:o}){const{isEditing:i,setIsEditing:l,pendingLayout:c,setPendingLayout:d,setOriginalLayout:h,hasChanges:p,addWidget:y,currentLayout:b,undo:v,redo:D,canUndo:S,canRedo:E}=ki(),T=dm(),k=d_(e),O=f_(),I=_S({queryKey:["chartData"]}),L=Wn(),_=(()=>{const M=L.getQueryCache();let V=0;for(const ae of M.getAll()){const j=ae.queryKey[0];(j==="chartData"||j==="chartWithData")&&ae.state.dataUpdatedAt>V&&(V=ae.state.dataUpdatedAt)}return V>0?V:null})(),[C,A]=N.useState(!1),[P,H]=N.useState(!1),[B,z]=N.useState(!1),[Q,q]=N.useState(!1),X=(b==null?void 0:b.rows.flatMap(M=>M.widgets.filter(V=>V.type==="chart"&&V.ref).map(V=>V.ref)))||[],ie=()=>{O()},ge=async M=>{if(r.current){q(!0),A(!1);try{M==="pdf"?await M3(r.current,`${e}-dashboard`,t):await I3(r.current,`${e}-dashboard`,M)}finally{q(!1)}}},te=async()=>{if(c)try{await k.mutateAsync({layout:c,tab:o}),h(c),d(null),l(!1)}catch(M){console.error("Failed to save:",M)}},de=()=>{d(null),l(!1)};return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:[f.jsxs("div",{className:"flex items-center justify-between p-4",children:[f.jsx("div",{children:f.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)"},children:t})}),f.jsx("div",{className:"flex items-center gap-2",children:i?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsxs("button",{onClick:()=>z(!B),className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-md hover:bg-blue-100",children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",f.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),B&&f.jsxs("div",{className:"absolute left-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("button",{onClick:()=>{z(!1),H(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Chart"]}),f.jsxs("button",{onClick:()=>{z(!1),y({type:"text",content:"",cols:6})},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),f.jsxs("div",{className:"flex items-center",children:[f.jsx("button",{onClick:v,disabled:!S,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Undo (Cmd+Z)",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),f.jsx("button",{onClick:D,disabled:!E,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Redo (Cmd+Shift+Z)",children:f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),f.jsx("div",{className:"w-px h-6 mx-2",style:{backgroundColor:"var(--yc-color-border)"}}),f.jsx("button",{onClick:de,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),f.jsx("button",{onClick:te,disabled:!p||k.isPending,className:nr("px-4 py-2 text-sm font-medium rounded-md",p?"bg-blue-600 text-white hover:bg-blue-700":"cursor-not-allowed"),style:p?void 0:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:k.isPending?"Saving...":"Save & Push"})]}):f.jsxs(f.Fragment,{children:[_&&I===0&&f.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(_).toLocaleString(),children:["Updated ",wR(_)]}),f.jsx("button",{onClick:ie,disabled:I>0,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh all charts",children:f.jsx("svg",{className:nr("w-5 h-5",I>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),f.jsxs("div",{className:"relative",children:[f.jsx("button",{onClick:()=>A(!C),disabled:Q,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:Q?f.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),C&&f.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[f.jsxs("button",{onClick:()=>ge("png"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),f.jsxs("button",{onClick:()=>ge("jpeg"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export JPEG"]}),f.jsxs("button",{onClick:()=>ge("pdf"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[f.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]}),T==="lg"?f.jsx("button",{onClick:()=>l(!0),className:"p-2 hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},title:"Edit layout",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}):f.jsx("button",{disabled:!0,className:"p-2 rounded-md",style:{opacity:.5,cursor:"not-allowed",color:"var(--yc-color-text-muted)"},title:"Editing requires a desktop browser",children:f.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})})]})})]}),n&&f.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n})]}),f.jsx(TR,{isOpen:P,onClose:()=>H(!1),onAdd:y,existingCharts:X})]})}function kR({filters:e,isEditing:t,onReorder:n,onRename:r,showCrossFilters:o}){const[i,l]=N.useState(null),[c,d]=N.useState(null),h=Je(I=>I.globalFilters),p=Je(I=>I.resetFilters),y=Je(I=>I.crossFilters),b=Je(I=>I.clearCrossFilter),v=Je(I=>I.clearAllCrossFilters),D=o?Object.values(y):[];if(e.length===0&&D.length===0)return null;const S=e.some(I=>{const L=h[I.name];if(L==null||L===""||Array.isArray(L)&&L.length===0)return!1;const _=I.default??(I.type==="date_range"?"last_30_days":void 0);return JSON.stringify(L)!==JSON.stringify(_)});function E(I,L){l(L),I.dataTransfer.effectAllowed="move"}function T(I,L){I.preventDefault(),I.dataTransfer.dropEffect="move",d(L)}function k(I,L){if(I.preventDefault(),i===null||i===L)return;const _=[...e],C=_.splice(i,1)[0];_.splice(L,0,C),n==null||n(_),l(null),d(null)}function O(){l(null),d(null)}return t?f.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map((I,L)=>{const _=I.label||ca(I.name),C=i===L?"opacity-50":"";return f.jsxs("div",{draggable:!0,onDragStart:A=>E(A,L),onDragOver:A=>T(A,L),onDrop:A=>k(A,L),onDragEnd:O,className:`flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-grab active:cursor-grabbing transition-colors ${C}`,style:c===L?{borderColor:"var(--yc-color-primary)",backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)"}:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)"},children:[f.jsx("svg",{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})}),f.jsx(CR,{value:_,onChange:A=>r==null?void 0:r(L,A)}),f.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]},I.name)})}):f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.map(I=>{const L=I.label||ca(I.name),_=typeof I.default=="string"?I.default:void 0;switch(I.type){case"date_range":return f.jsx(_2,{name:I.name,label:L,defaultValue:_},I.name);case"select":{const C=(I.options||[]).map(A=>typeof A=="string"?{value:A,label:A}:A);return f.jsx(Jc,{name:I.name,label:L,options:C,defaultValue:_},I.name)}case"dynamic_select":return I.source?f.jsx(Jc,{name:I.name,label:L,source:I.source,defaultValue:_},I.name):f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[L,": dynamic_select requires source"]},I.name);case"multi_select":{const C=(I.options||[]).map(A=>typeof A=="string"?{value:A,label:A}:A);return f.jsx(N2,{name:I.name,label:L,options:C,defaultValue:Array.isArray(I.default)?I.default:void 0,source:I.source},I.name)}case"text":return f.jsx(A2,{name:I.name,label:L,defaultValue:_},I.name);case"number":return f.jsx(L2,{name:I.name,label:L,defaultValue:typeof I.default=="number"?I.default:void 0},I.name);case"boolean":return f.jsx(R2,{name:I.name,label:L},I.name);default:return f.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[L,": ",I.type," (not supported)"]},I.name)}}),D.length>0&&e.length>0&&f.jsx("div",{className:"w-px h-6 mx-1",style:{backgroundColor:"var(--yc-color-border)"}}),D.map(I=>f.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-1.5 text-sm rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[I.field,": ",H0(I.value),f.jsx("button",{onClick:()=>b(I.field),className:"ml-0.5 hover:opacity-80","aria-label":`Clear ${I.field} filter`,children:f.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:f.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},`cf-${I.field}`)),(S||D.length>0)&&f.jsx("button",{type:"button",onClick:()=>{S&&p(),D.length>0&&v()},className:"text-sm px-2 py-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",style:{color:"var(--yc-color-text-muted)"},children:"Clear all"})]})}function CR({value:e,onChange:t}){const[n,r]=N.useState(!1),[o,i]=N.useState(e);if(!n)return f.jsx("span",{className:"text-sm font-medium cursor-text hover:text-blue-600 hover:underline",style:{color:"var(--yc-color-text)"},onClick:c=>{c.stopPropagation(),r(!0),i(e)},title:"Click to rename",children:e});function l(){o.trim()&&o!==e&&t(o.trim()),r(!1)}return f.jsx("input",{autoFocus:!0,value:o,onChange:c=>i(c.target.value),onBlur:l,onKeyDown:c=>{c.key==="Enter"&&l(),c.key==="Escape"&&r(!1)},className:"text-sm font-medium border border-blue-300 rounded px-1 py-0 outline-none w-32",style:{color:"var(--yc-color-text)",backgroundColor:"var(--yc-color-surface)"},onClick:c=>c.stopPropagation()})}function _R({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=ki();return f.jsx("div",{className:"flex border-b mb-4 mt-2",style:{borderColor:"var(--yc-color-border)"},children:e.map(o=>f.jsx("button",{onClick:()=>n(o.name),disabled:r&&o.name!==t,className:nr("px-4 py-2 text-sm font-medium border-b-2 transition-colors",o.name===t?"border-blue-500 text-blue-600":"border-transparent hover:border-gray-300",r&&o.name!==t&&"opacity-50 cursor-not-allowed hover:border-transparent"),style:o.name!==t?{color:"var(--yc-color-text-secondary)"}:void 0,children:o.label},o.name))})}function NR({dashboardId:e,title:t,description:n,contentRef:r,tabs:o,activeTab:i,onTabChange:l,filters:c}){const{isEditing:d,pendingFilters:h,setPendingFilters:p}=ki(),y=Je(v=>Object.keys(v.crossFilters).length>0);N.useEffect(()=>{d&&!h&&p([...c])},[d]);const b=d&&h?h:c;return f.jsxs(f.Fragment,{children:[f.jsx(SR,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:o?i:void 0}),o&&i&&l&&f.jsx(_R,{tabs:o,activeTab:i,onTabChange:l}),(b.length>0||!d&&y)&&f.jsx("div",{className:"yc-filter-bar sticky top-0 z-10 border-b px-6 py-3",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:f.jsx(kR,{filters:b,isEditing:d,onReorder:v=>p(v),onRename:(v,D)=>{const S=[...b];S[v]={...S[v],label:D},p(S)},showCrossFilters:!d})})]})}function DR({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:o,error:i}=c_(e,t),l=N.useRef(null),c=Wn(),d=Je(S=>S.globalFilters),[h,p]=N.useState(n||"");N.useEffect(()=>{r&&sessionStorage.setItem("yamchart-last-dashboard",JSON.stringify({name:r.name,title:r.title}))},[r==null?void 0:r.name,r==null?void 0:r.title]),N.useEffect(()=>{if(!(r!=null&&r.tabs))return;const S=r.tabs.map(T=>T.name);if(h&&S.includes(h))return;const E=n&&S.includes(n)?n:S[0];E&&p(E)},[r==null?void 0:r.tabs,n]);const y=Je(S=>S.clearAllCrossFilters),b=N.useCallback(S=>{var T;p(S),y();const E=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${E}?tab=${encodeURIComponent(S)}`),r!=null&&r.name){const k=pi(Object.fromEntries(Object.entries(d).filter(([I,L])=>L!=null)));xt.warmDashboardCache(r.name,k,S).catch(()=>{});const O=(T=r.tabs)==null?void 0:T.find(I=>I.name===S);if(O)for(const I of O.layout.rows)for(const L of I.widgets)L.type==="chart"&&L.ref&&c.prefetchQuery({queryKey:["chartWithData",L.ref,k],queryFn:()=>xt.queryChart(L.ref,k,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,d,c,y]),v=N.useMemo(()=>{if(r){if(r.tabs){const S=r.tabs.find(E=>E.name===h);return S==null?void 0:S.layout}return r.layout}},[r,h]),D=N.useMemo(()=>{if(!r)return[];const S=r.filters||[];if(r.tabs){const E=r.tabs.find(k=>k.name===h),T=(E==null?void 0:E.filters)||[];return[...S,...T]}return S},[r,h]);return o?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading dashboard..."})}):i||!r?f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load dashboard: ",(i==null?void 0:i.message)||"Unknown error"]})}):v?f.jsx(p4,{children:f.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[f.jsx(NR,{dashboardId:e,title:r.title,description:r.description,contentRef:l,tabs:r.tabs,activeTab:h,onTabChange:r.tabs?b:void 0,filters:D}),f.jsx("div",{ref:l,className:"p-6",children:f.jsx(ER,{layout:v,dashboardName:r.name})})]})}):f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"No layout available"})})}const OR=N.lazy(()=>ls(()=>import("./LoginPage-BypxvDY2.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),AR=N.lazy(()=>ls(()=>import("./SetupWizard-CEGLuSGr.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),IR=N.lazy(()=>ls(()=>import("./UserManagement-VZ9Qvds0.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),MR=N.lazy(()=>ls(()=>import("./ShareManagement-DcPZNRdx.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),LR=N.lazy(()=>ls(()=>import("./PublicViewer-CdDaYqTc.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),RR=N.lazy(()=>ls(()=>import("./EventManagement-7MyQq5KD.js"),__vite__mapDeps([6,1])).then(e=>({default:e.EventManagement}))),Hc=()=>f.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:f.jsx("div",{className:"text-gray-500",children:"Loading..."})});function ax(e){const t=e.replace(/^#?/,""),n=t.match(/^\/settings\/(.+)$/);if(n&&n[1])return{type:"settings",name:n[1],params:{}};if(t==="/events")return{type:"events",name:"",params:{}};const[r,o]=t.split("?"),i=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(i&&i[1]&&i[2]){const y={};if(o)for(const[b,v]of new URLSearchParams(o).entries())y[b]=v;return{type:i[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(i[2]),params:y}}const[l,c]=t.split("?"),d=l==null?void 0:l.match(/^\/(charts)\/(.+)\/detail$/);if(d&&d[2]){const y={};if(c)for(const[b,v]of new URLSearchParams(c).entries())y[b]=v;return{type:"chart_detail",name:decodeURIComponent(d[2]),params:y}}const h=l==null?void 0:l.match(/^\/(dashboards|charts)\/(.+)$/);if(!h||!h[1]||!h[2])return null;const p={};if(c)for(const[y,b]of new URLSearchParams(c).entries())p[y]=b;return{type:h[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(h[2]),params:p}}function PR(e,t){return f.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:f.jsxs("div",{className:"text-center max-w-md p-8",children:[f.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:f.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),f.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),f.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Reload page"})]})})}function jR(){m_();const e=So(v=>v.auth),t=So(v=>v.checkAuth);N.useEffect(()=>{t()},[t]);const{data:n,isLoading:r}=ma(),{data:o,isLoading:i}=t2(),l=Je(v=>v.clearAllCrossFilters),[c,d]=N.useState(()=>window.location.hash.replace(/^#/,"")||"");N.useEffect(()=>{const v=()=>{d(window.location.hash.replace(/^#/,"")||""),l()};return window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[l]);const h=N.useCallback(v=>{window.location.hash=v,d(v),l()},[l]);N.useEffect(()=>{r||i||c||(o&&o.length>0&&o[0]?h(`/dashboards/${o[0].name}`):n!=null&&n.charts&&n.charts.length>0&&n.charts[0]&&h(`/charts/${n.charts[0].name}`))},[r,i,o,n,c,h]);const p=ax(c);if(p&&(p.type==="public_chart"||p.type==="public_dashboard"))return f.jsx(N.Suspense,{fallback:f.jsx(Hc,{}),children:f.jsx(LR,{parsed:{type:p.type,name:p.name,params:p.params}})});if(e.status==="loading")return f.jsx(Hc,{});if(e.status==="needs_setup")return f.jsx(N.Suspense,{fallback:f.jsx(Hc,{}),children:f.jsx(AR,{})});if(e.status==="unauthenticated")return f.jsx(N.Suspense,{fallback:f.jsx(Hc,{}),children:f.jsx(OR,{})});if(r||i)return f.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:f.jsx("div",{className:"text-gray-500",children:"Loading..."})});const y=ax(c),b=()=>y?y.type==="settings"&&y.name==="users"?f.jsx(N.Suspense,{fallback:f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:f.jsx(IR,{})}):y.type==="settings"&&y.name==="shares"?f.jsx(N.Suspense,{fallback:f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:f.jsx(MR,{})}):y.type==="events"?f.jsx(N.Suspense,{fallback:f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:f.jsx(RR,{})}):y.type==="dashboard"?f.jsx(DR,{dashboardId:y.name,initialTab:y.params.tab}):y.type==="chart_detail"?f.jsx(h4,{chartName:y.name,params:y.params}):f.jsx(f4,{chartName:y.name,drillParams:y.params}):f.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a dashboard or chart from the sidebar"});return f.jsx(Am,{fallback:PR,children:f.jsx(k_,{children:f.jsx(R_,{currentPath:c,onNavigate:h,onNavigateToUsers:()=>h("/settings/users"),onNavigateToShares:()=>h("/settings/shares"),children:b()})})})}Xw.createRoot(document.getElementById("root")).render(f.jsx(N.StrictMode,{children:f.jsx(NS,{children:f.jsx(jR,{})})}));export{ou as A,V2 as B,rd as C,B2 as D,F0 as E,P2 as F,nv as G,Z2 as H,q2 as L,B5 as M,G2 as P,T3 as S,B0 as T,tv as W,ls as _,xt as a,jx as b,nr as c,e2 as d,ma as e,Tm as f,Je as g,sv as h,ev as i,f as j,J2 as k,X2 as l,K2 as m,Q2 as n,DR as o,Wn as p,hr as q,Ka as r,ws as s,O3 as t,So as u,Qa as v,on as w};