@perses-dev/stat-chart-plugin 0.14.0 → 0.15.0-beta.1
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.
- package/__mf/js/StatChart.cfc077f0.js +7 -0
- package/__mf/js/async/121.dd7133cb.js +2 -0
- package/__mf/js/async/192.6939be34.js +1 -0
- package/__mf/js/async/2.8caf67bd.js +1 -0
- package/__mf/js/async/235.c6d2c4f5.js +1 -0
- package/__mf/js/async/274.7345c704.js +2 -0
- package/__mf/js/async/345.242802c4.js +29 -0
- package/__mf/js/async/354.6ea77f69.js +4 -0
- package/__mf/js/async/354.6ea77f69.js.LICENSE.txt +9 -0
- package/__mf/js/async/356.b00937de.js +1 -0
- package/__mf/js/async/392.559f0a15.js +2 -0
- package/__mf/js/async/449.6d8fc8b3.js +43 -0
- package/__mf/js/async/{580.4076ee7b.js.LICENSE.txt → 449.6d8fc8b3.js.LICENSE.txt} +41 -1
- package/__mf/js/async/470.16a500aa.js +2 -0
- package/__mf/js/async/570.34dc9996.js +2 -0
- package/__mf/js/async/587.7eb542f2.js +1 -0
- package/__mf/js/async/616.6b72e257.js +1 -0
- package/__mf/js/async/663.2de74425.js +1 -0
- package/__mf/js/async/{866.cb6cbc7a.js → 866.d7ad9e7a.js} +5 -5
- package/__mf/js/async/941.1589eeae.js +2 -0
- package/__mf/js/async/968.ebdf1f2d.js +1 -0
- package/__mf/js/async/970.f5882828.js +2 -0
- package/__mf/js/async/__federation_expose_StatChart.7973125b.js +1 -0
- package/__mf/js/async/lib-router.73f6cef1.js +2 -0
- package/__mf/js/{main.fe3736c5.js → main.cd844a8c.js} +3 -3
- package/lib/StatChart.d.ts +3 -3
- package/lib/StatChart.d.ts.map +1 -1
- package/lib/StatChart.js +4 -4
- package/lib/StatChart.js.map +1 -1
- package/lib/StatChartBase.d.ts +4 -4
- package/lib/StatChartBase.d.ts.map +1 -1
- package/lib/StatChartBase.js +12 -12
- package/lib/StatChartBase.js.map +1 -1
- package/lib/StatChartOptionsEditorSettings.d.ts +2 -2
- package/lib/StatChartOptionsEditorSettings.d.ts.map +1 -1
- package/lib/StatChartOptionsEditorSettings.js +8 -8
- package/lib/StatChartOptionsEditorSettings.js.map +1 -1
- package/lib/StatChartPanel.d.ts +4 -4
- package/lib/StatChartPanel.d.ts.map +1 -1
- package/lib/StatChartPanel.js +14 -9
- package/lib/StatChartPanel.js.map +1 -1
- package/lib/StatChartValueMappingEditor.d.ts +3 -3
- package/lib/StatChartValueMappingEditor.d.ts.map +1 -1
- package/lib/StatChartValueMappingEditor.js +1 -1
- package/lib/StatChartValueMappingEditor.js.map +1 -1
- package/lib/bootstrap.js +2 -2
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/stat-chart-model.d.ts +3 -3
- package/lib/stat-chart-model.d.ts.map +1 -1
- package/lib/stat-chart-model.js.map +1 -1
- package/lib/utils/calculate-font-size.d.ts +1 -1
- package/lib/utils/calculate-font-size.d.ts.map +1 -1
- package/lib/utils/calculate-font-size.js +2 -2
- package/lib/utils/calculate-font-size.js.map +1 -1
- package/lib/utils/calculate-value.d.ts +3 -2
- package/lib/utils/calculate-value.d.ts.map +1 -1
- package/lib/utils/calculate-value.js +1 -1
- package/lib/utils/calculate-value.js.map +1 -1
- package/lib/utils/data-transform.d.ts +3 -3
- package/lib/utils/data-transform.d.ts.map +1 -1
- package/lib/utils/data-transform.js.map +1 -1
- package/lib/utils/format-stat-chart-value.d.ts +1 -1
- package/lib/utils/format-stat-chart-value.d.ts.map +1 -1
- package/lib/utils/format-stat-chart-value.js +1 -1
- package/lib/utils/format-stat-chart-value.js.map +1 -1
- package/lib/utils/get-color.d.ts +2 -2
- package/lib/utils/get-color.d.ts.map +1 -1
- package/lib/utils/get-color.js +1 -1
- package/lib/utils/get-color.js.map +1 -1
- package/mf-manifest.json +29 -73
- package/mf-stats.json +29 -81
- package/package.json +10 -10
- package/__mf/js/StatChart.19a287b0.js +0 -7
- package/__mf/js/async/121.a33651ce.js +0 -2
- package/__mf/js/async/177.4dddf131.js +0 -1
- package/__mf/js/async/187.d7e6b2db.js +0 -7
- package/__mf/js/async/187.d7e6b2db.js.LICENSE.txt +0 -39
- package/__mf/js/async/192.0b251884.js +0 -1
- package/__mf/js/async/2.e8bdc16f.js +0 -1
- package/__mf/js/async/235.f388b6fd.js +0 -1
- package/__mf/js/async/274.b762faf5.js +0 -2
- package/__mf/js/async/356.3f7b970d.js +0 -1
- package/__mf/js/async/392.70b1a3c5.js +0 -2
- package/__mf/js/async/450.bdfbd76f.js +0 -1
- package/__mf/js/async/465.7c60371f.js +0 -2
- package/__mf/js/async/470.cc046da0.js +0 -2
- package/__mf/js/async/546.f27d00a1.js +0 -24
- package/__mf/js/async/546.f27d00a1.js.LICENSE.txt +0 -19
- package/__mf/js/async/558.e8f8691f.js +0 -1
- package/__mf/js/async/570.264704d1.js +0 -2
- package/__mf/js/async/580.4076ee7b.js +0 -66
- package/__mf/js/async/587.7d22fb82.js +0 -1
- package/__mf/js/async/588.c00e3759.js +0 -1
- package/__mf/js/async/616.22b37336.js +0 -1
- package/__mf/js/async/71.1f2caf38.js +0 -1
- package/__mf/js/async/721.5c1c6916.js +0 -1
- package/__mf/js/async/873.13ff7de6.js +0 -1
- package/__mf/js/async/941.230549f5.js +0 -2
- package/__mf/js/async/968.bfd3594f.js +0 -1
- package/__mf/js/async/978.98475f4b.js +0 -1
- package/__mf/js/async/__federation_expose_StatChart.f4a2f598.js +0 -1
- package/__mf/js/async/lib-router.6c58ccc7.js +0 -2
- package/lib/cjs/StatChart.js +0 -43
- package/lib/cjs/StatChartBase.js +0 -263
- package/lib/cjs/StatChartOptionsEditorSettings.js +0 -171
- package/lib/cjs/StatChartPanel.js +0 -130
- package/lib/cjs/StatChartValueMappingEditor.js +0 -36
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -42
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/stat-chart-model.js +0 -74
- package/lib/cjs/utils/calculate-font-size.js +0 -55
- package/lib/cjs/utils/calculate-value.js +0 -30
- package/lib/cjs/utils/data-transform.js +0 -36
- package/lib/cjs/utils/format-stat-chart-value.js +0 -34
- package/lib/cjs/utils/get-color.js +0 -66
- /package/__mf/css/async/{187.85c2cbf6.css → 449.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{121.a33651ce.js.LICENSE.txt → 121.dd7133cb.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.b762faf5.js.LICENSE.txt → 274.7345c704.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.70b1a3c5.js.LICENSE.txt → 392.559f0a15.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.cc046da0.js.LICENSE.txt → 470.16a500aa.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{570.264704d1.js.LICENSE.txt → 570.34dc9996.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{866.cb6cbc7a.js.LICENSE.txt → 866.d7ad9e7a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.230549f5.js.LICENSE.txt → 941.1589eeae.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{465.7c60371f.js.LICENSE.txt → 970.f5882828.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.6c58ccc7.js.LICENSE.txt → lib-router.73f6cef1.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*! For license information please see 449.6d8fc8b3.js.LICENSE.txt */
|
|
2
|
+
(self.chunk_StatChart_0_15_0_beta_1=self.chunk_StatChart_0_15_0_beta_1||[]).push([["449"],{70158(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var i=n(96844);function o(e){if(void 0!==e)return"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,n){var s=t.map(function(t){var s=null==n?t:r(r({},t),{options:r(r({},o(n)),o(t.options))});return(0,i.bind)(e,s)});return function(){s.forEach(function(e){return e()})}}},96844(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}},96907(e,t,n){"use strict";t.bindAll=t.bind=void 0;var r=n(96844);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return r.bind}});var i=n(70158);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return i.bindAll}})},1416(e,t,n){e.exports=n(99138)(n(41433),"DataView")},42616(e,t,n){e.exports=n(99138)(n(41433),"Promise")},60157(e,t,n){e.exports=n(99138)(n(41433),"Set")},61527(e,t,n){var r=n(90369),i=n(79912),o=n(23767);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,e.exports=s},78499(e,t,n){e.exports=n(99138)(n(41433),"WeakMap")},61414(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},78740(e){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},57260(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},74403(e,t,n){var r=n(78740),i=n(6397);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},22122(e,t,n){var r=n(42032),i=n(22934);e.exports=function e(t,n,o,s,a){return t===n||(null!=t&&null!=n&&(i(t)||i(n))?r(t,n,o,s,e,a):t!=t&&n!=n)}},42032(e,t,n){var r=n(86469),i=n(44075),o=n(64622),s=n(62677),a=n(31201),l=n(6397),u=n(30492),c=n(47995),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,v){var y=l(e),x=l(t),b=y?d:a(e),w=x?d:a(t);b=b==h?f:b,w=w==h?f:w;var S=b==f,C=w==f,A=b==w;if(A&&u(e)){if(!u(t))return!1;y=!0,S=!1}if(A&&!S)return v||(v=new r),y||c(e)?i(e,t,n,g,m,v):o(e,t,b,n,g,m,v);if(!(1&n)){var M=S&&p.call(e,"__wrapped__"),k=C&&p.call(t,"__wrapped__");if(M||k){var T=M?e.value():e,I=k?t.value():t;return v||(v=new r),m(T,I,n,g,v)}}return!!A&&(v||(v=new r),s(e,t,n,g,m,v))}},81452(e,t,n){var r=n(67499),i=n(9566),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},68812(e,t,n){var r=n(62140),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},79151(e){e.exports=function(e,t){return e.has(t)}},44075(e,t,n){var r=n(61527),i=n(57260),o=n(79151);e.exports=function(e,t,n,s,a,l){var u=1&n,c=e.length,h=t.length;if(c!=h&&!(u&&h>c))return!1;var d=l.get(e),f=l.get(t);if(d&&f)return d==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<c;){var v=e[p],y=t[p];if(s)var x=u?s(y,v,p,t,e,l):s(v,y,p,e,t,l);if(void 0!==x){if(x)continue;g=!1;break}if(m){if(!i(t,function(e,t){if(!o(m,t)&&(v===e||a(v,e,n,s,l)))return m.push(t)})){g=!1;break}}else if(!(v===y||a(v,y,n,s,l))){g=!1;break}}return l.delete(e),l.delete(t),g}},64622(e,t,n){var r=n(32781),i=n(28944),o=n(39316),s=n(44075),a=n(90953),l=n(15851),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!h(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&r;if(f||(f=l),e.size!=t.size&&!p)break;var g=d.get(e);if(g)return g==t;r|=2,d.set(e,t);var m=s(f(e),f(t),r,u,h,d);return d.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},62677(e,t,n){var r=n(90966),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var h=c;h--;){var d=u[h];if(!(l?d in t:i.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=l;++h<c;){var v=e[d=u[h]],y=t[d];if(o)var x=l?o(y,v,d,t,e,a):o(v,y,d,e,t,a);if(!(void 0===x?v===y||s(v,y,n,o,a):x)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return a.delete(e),a.delete(t),g}},90966(e,t,n){var r=n(74403),i=n(88876),o=n(31178);e.exports=function(e){return r(e,o,i)}},88876(e,t,n){var r=n(61414),i=n(53629),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;e.exports=s?function(e){return null==e?[]:r(s(e=Object(e)),function(t){return o.call(e,t)})}:i},31201(e,t,n){var r=n(1416),i=n(91955),o=n(42616),s=n(60157),a=n(78499),l=n(87148),u=n(81485),c="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=u(r),m=u(i),v=u(o),y=u(s),x=u(a),b=l;(r&&b(new r(new ArrayBuffer(1)))!=p||i&&b(new i)!=c||o&&b(o.resolve())!=h||s&&b(new s)!=d||a&&b(new a)!=f)&&(b=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return p;case m:return c;case v:return h;case y:return d;case x:return f}return t}),e.exports=b},90953(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},9566(e,t,n){e.exports=n(51019)(Object.keys,Object)},79912(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},23767(e){e.exports=function(e){return this.__data__.has(e)}},15851(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},62140(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},46177(e,t,n){var r=n(58953),i=n(43664),o=n(95378),s=Math.max,a=Math.min;e.exports=function(e,t,n){var l,u,c,h,d,f,p=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,r=u;return l=u=void 0,p=t,h=e.apply(r,n)}function x(e){var n=e-f,r=e-p;return void 0===f||n>=t||n<0||m&&r>=c}function b(){var e,n,r,o=i();if(x(o))return w(o);d=setTimeout(b,(e=o-f,n=o-p,r=t-e,m?a(r,c-n):r))}function w(e){return(d=void 0,v&&l)?y(e):(l=u=void 0,h)}function S(){var e,n=i(),r=x(n);if(l=arguments,u=this,f=n,r){if(void 0===d)return p=e=f,d=setTimeout(b,t),g?y(e):h;if(m)return clearTimeout(d),d=setTimeout(b,t),y(f)}return void 0===d&&(d=setTimeout(b,t)),h}return t=o(t)||0,r(n)&&(g=!!n.leading,c=(m="maxWait"in n)?s(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==d&&clearTimeout(d),p=0,l=f=u=d=void 0},S.flush=function(){return void 0===d?h:w(i())},S}},18264(e,t,n){var r=n(22122);e.exports=function(e,t){return r(e,t)}},75414(e,t,n){var r=n(87148),i=n(22934);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},31178(e,t,n){var r=n(31163),i=n(81452),o=n(18330);e.exports=function(e){return o(e)?r(e):i(e)}},43664(e,t,n){var r=n(41433);e.exports=function(){return r.Date.now()}},53629(e){e.exports=function(){return[]}},95378(e,t,n){var r=n(68812),i=n(58953),o=n(75414),s=0/0,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?s:+e}},24300(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z","Calendar")},29618(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Circle")},98029(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},53064(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},26684(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Earth")},78536(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z","EyeOffOutline")},1355(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z","EyeOutline")},98599(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z","Magnify")},4491(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},29917(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12M8.8,14L10,12.8V4H14V12.8L15.2,14H8.8Z","PinOutline")},16979(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z","UnfoldLessHorizontal")},9323(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z","UnfoldMoreHorizontal")},12933(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((r=n(1448))&&r.__esModule?r:{default:r}).default)("M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z","ViewColumn")},40362(e,t,n){"use strict";var r=n(56441);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},62688(e,t,n){e.exports=n(40362)()},56441(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},77440(e,t,n){!function(e,t){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var i={error:null},o=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=i,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(i)},o.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},o.componentDidUpdate=function(e,t){var n,r,i,o,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(r=a)&&(r=[]),n.length!==r.length||n.some(function(e,t){return!Object.is(e,r[t])}))&&(null==(i=(o=this.props).onResetKeysChange)||i.call(o,e.resetKeys,a),this.reset())},o.render=function(){var e=this.state.error,t=this.props,r=t.fallbackRender,i=t.FallbackComponent,o=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof r)return r(s);if(i)return n.createElement(i,s);else throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=o,e.useErrorHandler=function(e){var t=n.useState(null),r=t[0],i=t[1];if(null!=e)throw e;if(null!=r)throw r;return i},e.withErrorBoundary=function(e,t){var r=function(r){return n.createElement(o,t,n.createElement(e,r))};return r.displayName="withErrorBoundary("+(e.displayName||e.name||"Unknown")+")",r},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(70451))},23420(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var o=0,s=r.length;o<s;o++)r[o].fn!==t&&r[o].fn._!==t&&i.push(r[o]);return i.length?n[e]=i:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t},42915(e){"use strict";var t;t=function(){function e(){return!0}function t(){return!1}function n(){}return function r(){var i=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],o={name:"any",test:e},s=[],a=[],l={types:i,conversions:a,ignore:s};function u(e){var t=N(l.types,function(t){return t.name===e});if(t)return t;if("any"===e)return o;var n=N(l.types,function(t){return t.name.toLowerCase()===e.toLowerCase()});throw TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function c(e){return e===o?999:l.types.indexOf(e)}function h(e){var t=N(l.types,function(t){return t.test(e)});if(t)return t.name;throw TypeError("Value has unknown type. Value: "+e)}function d(e){return e.map(function(e){var t=e.types.map(y);return(e.restParam?"...":"")+t.join("|")}).join(",")}function f(e){var t=P(e);return!!t&&t.restParam}function p(e){return e.types.some(function(e){return null!=e.conversion})}function g(t){if(!t||0===t.types.length)return e;if(1===t.types.length)return u(t.types[0].name).test;if(2===t.types.length){var n=u(t.types[0].name).test,r=u(t.types[1].name).test;return function(e){return n(e)||r(e)}}var i=t.types.map(function(e){return u(e.name).test});return function(e){for(var t=0;t<i.length;t++)if(i[t](e))return!0;return!1}}function m(e,t){return t<e.params.length?e.params[t]:f(e.params)?P(e.params):null}function v(e,t,n){var r=m(e,t);return(r?n?r.types.filter(x):r.types:[]).map(y)}function y(e){return e.name}function x(e){return null===e.conversion||void 0===e.conversion}function b(e,t){var n=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}(B(e,function(e){return v(e,t,!1)}));return -1!==n.indexOf("any")?["any"]:n}function w(e,t,n){var r,i,o,s=e||"unnamed",a=n;for(o=0;o<t.length;o++){var l=a.filter(function(e){var n=g(m(e,o));return(o<e.params.length||f(e.params))&&n(t[o])});if(0===l.length){if((i=b(a,o)).length>0){var u=h(t[o]);return(r=TypeError("Unexpected type of argument in function "+s+" (expected: "+i.join(" or ")+", actual: "+u+", index: "+o+")")).data={category:"wrongType",fn:s,index:o,actual:u,expected:i},r}}else a=l}var c=a.map(function(e){return f(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return(r=TypeError("Too few arguments in function "+s+" (expected: "+(i=b(a,o)).join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:s,index:t.length,expected:i},r;var d=Math.max.apply(null,c);return t.length>d?(r=TypeError("Too many arguments in function "+s+" (expected: "+d+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:s,index:t.length,expectedLength:d}:(r=TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+s+".")).data={category:"mismatch",actual:t.map(h)},r}function S(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function C(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function A(e,t){var n,r,i=Math.min(e.params.length,t.params.length);if(0!=(r=e.params.some(p)-t.params.some(p)))return r;for(n=0;n<i;n++)if(0!=(r=p(e.params[n])-p(t.params[n])))return r;for(n=0;n<i;n++)if(0!==(r=function(e,t){var n;return 0!=(n=e.restParam-t.restParam)||0!=(n=p(e)-p(t))||0!=(n=S(e)-S(t))?n:C(e)-C(t)}(e.params[n],t.params[n])))return r;return e.params.length-t.params.length}function M(e){var t,n,r,i,o=[],s=[];switch(e.types.forEach(function(e){e.conversion&&(o.push(u(e.conversion.from).test),s.push(e.conversion.convert))}),s.length){case 0:return function(e){return e};case 1:return t=o[0],r=s[0],function(e){return t(e)?r(e):e};case 2:return t=o[0],n=o[1],r=s[0],i=s[1],function(e){return t(e)?r(e):n(e)?i(e):e};default:return function(e){for(var t=0;t<s.length;t++)if(o[t](e))return s[t](e);return e}}}function k(e,t){return function e(n,r,i){if(!(r<n.length))return[i.map(function(e,t){return{types:e,restParam:t===n.length-1&&f(n)}})];var o,s=n[r],a=t?s.types.filter(x):s.types;if(s.restParam){var l=a.filter(x);o=l.length<a.length?[l,a]:[a]}else o=a.map(function(e){return[e]});return B(o,function(t){return e(n,r+1,i.concat([t]))})}(e,0,[])}function T(e,r){if(0===Object.keys(r).length)throw SyntaxError("No signatures provided");var i,o=[];Object.keys(r).map(function(e){var t,n,i;return t=r[e],n=l.conversions,i=[],(""!==e.trim()&&(i=e.split(",").map(O).map(function(e,t,r){var i,o,s,a,l,h,d,f,p=(i=n,o=l=((a=0===e.indexOf("..."))?e.length>3?e.slice(3):"any":e).split("|").map(O).filter(E).filter(D),s={},i.forEach(function(e){-1!==o.indexOf(e.from)||-1===o.indexOf(e.to)||s[e.from]||(s[e.from]=e)}),h=Object.keys(s).map(function(e){return s[e]}),d=l.map(function(e){var t=u(e);return{name:e,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),f=h.map(function(e){var t=u(e.from);return{name:e.from,typeIndex:c(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}}),{types:d.concat(f),restParam:a});if(p.restParam&&t!==r.length-1)throw SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return p})),i.some(R))?null:{params:i,fn:t}}).filter(_).forEach(function(e){var t=N(o,function(t){return function(e,t){for(var n=Math.max(e.params.length,t.params.length),r=0;r<n;r++)if(!function(e,t){for(var n,r=0;r<e.length;r++)if(n=e[r],-1!==t.indexOf(n))return!0;return!1}(v(e,r,!0),v(t,r,!0)))return!1;var i=e.params.length,o=t.params.length,s=f(e.params),a=f(t.params);return s?a?i===o:o>=i:a?i>=o:i===o}(t,e)});if(t)throw TypeError('Conflicting signatures "'+d(t.params)+'" and "'+d(e.params)+'".');o.push(e)});var s=B(o,function(e){return(e?k(e.params,!1):[]).map(function(t){return{params:t,fn:e.fn}})}).filter(_);s.sort(A);var a=s[0]&&s[0].params.length<=2&&!f(s[0].params),h=s[1]&&s[1].params.length<=2&&!f(s[1].params),m=s[2]&&s[2].params.length<=2&&!f(s[2].params),y=s[3]&&s[3].params.length<=2&&!f(s[3].params),x=s[4]&&s[4].params.length<=2&&!f(s[4].params),b=s[5]&&s[5].params.length<=2&&!f(s[5].params),w=s.map(function(e){return function(e){var t,n,r;if(f(e)){var i,o=(t=(i=e).slice(0,i.length-1).map(g)).length,s=g(P(e)),a=function(e){for(var t=o;t<e.length;t++)if(!s(e[t]))return!1;return!0};return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return a(e)&&e.length>=o+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=g(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=g(e[0]),r=g(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(g),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}(e.params)}),S=a?g(s[0].params[0]):t,C=h?g(s[1].params[0]):t,T=m?g(s[2].params[0]):t,I=y?g(s[3].params[0]):t,F=x?g(s[4].params[0]):t,j=b?g(s[5].params[0]):t,z=a?g(s[0].params[1]):t,V=h?g(s[1].params[1]):t,H=m?g(s[2].params[1]):t,$=y?g(s[3].params[1]):t,W=x?g(s[4].params[1]):t,G=b?g(s[5].params[1]):t,U=s.map(function(e){return function(e,t){var n=t;if(e.some(p)){var r=f(e),i=e.map(M);n=function(){for(var e=[],n=r?arguments.length-1:arguments.length,o=0;o<n;o++)e[o]=i[o](arguments[o]);return r&&(e[n]=arguments[n].map(i[n])),t.apply(this,e)}}var o=n;if(f(e)){var s=e.length-1;o=function(){return n.apply(this,L(arguments,0,s).concat([L(arguments,s)]))}}return o}(e.params,e.fn)}),q=a?U[0]:n,Y=h?U[1]:n,Z=m?U[2]:n,K=y?U[3]:n,X=x?U[4]:n,J=b?U[5]:n,Q=a?s[0].params.length:-1,ee=h?s[1].params.length:-1,et=m?s[2].params.length:-1,en=y?s[3].params.length:-1,er=x?s[4].params.length:-1,ei=b?s[5].params.length:-1,eo=6*!!(a&&h&&m&&y&&x&&b),es=s.length,ea=function(){for(var t=eo;t<es;t++)if(w[t](arguments))return U[t].apply(this,arguments);return l.onMismatch(e,arguments,s)},el=function e(t,n){return arguments.length===Q&&S(t)&&z(n)?q.apply(e,arguments):arguments.length===ee&&C(t)&&V(n)?Y.apply(e,arguments):arguments.length===et&&T(t)&&H(n)?Z.apply(e,arguments):arguments.length===en&&I(t)&&$(n)?K.apply(e,arguments):arguments.length===er&&F(t)&&W(n)?X.apply(e,arguments):arguments.length===ei&&j(t)&&G(n)?J.apply(e,arguments):ea.apply(e,arguments)};try{Object.defineProperty(el,"name",{value:e})}catch(e){}return i={},s.forEach(function(e){e.params.some(p)||k(e.params,!0).forEach(function(t){i[d(t)]=e.fn})}),el.signatures=i,el}function I(e,t,n){throw w(e,t,n)}function D(e){return -1===l.ignore.indexOf(e)}function O(e){return e.trim()}function E(e){return!!e}function _(e){return null!==e}function R(e){return 0===e.types.length}function P(e){return e[e.length-1]}function L(e,t,n){return Array.prototype.slice.call(e,t,n)}function N(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function B(e,t){return Array.prototype.concat.apply([],e.map(t))}function F(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(("object"==typeof r.signatures||"string"==typeof r.signature)&&""!==r.name){if(""===t)t=r.name;else if(t!==r.name){var i=Error("Function names do not match (expected: "+t+", actual: "+r.name+")");throw i.data={actual:r.name,expected:t},i}}}return t}function j(e){var t,n={};function r(e,r){if(n.hasOwnProperty(e)&&r!==n[e])throw(t=Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var i=0;i<e.length;i++){var o=e[i];if("object"==typeof o.signatures)for(var s in o.signatures)o.signatures.hasOwnProperty(s)&&(r(s,o.signatures[s]),n[s]=o.signatures[s]);else if("string"==typeof o.signature)r(o.signature,o),n[o.signature]=o;else throw(t=TypeError("Function is no typed-function (index: "+i+")")).data={index:i},t}return n}return(l=T("typed",{"string, Object":T,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return T(F(t),e)},"...Function":function(e){return T(F(e),j(e))},"string, ...Function":function(e,t){return T(e,j(t))}})).create=r,l.types=i,l.conversions=a,l.ignore=s,l.onMismatch=I,l.throwMismatchError=I,l.createError=w,l.convert=function(e,t){var n=h(e);if(t===n)return e;for(var r=0;r<l.conversions.length;r++){var i=l.conversions[r];if(i.from===n&&i.to===t)return i.convert(e)}throw Error("Cannot convert from "+n+" to "+t)},l.find=function(e,t){if(!e.signatures)throw TypeError("Function is no typed-function");if("string"==typeof t){n=t.split(",");for(var n,r=0;r<n.length;r++)n[r]=n[r].trim()}else if(Array.isArray(t))n=t;else throw TypeError("String array or a comma separated string expected");var i=n.join(","),o=e.signatures[i];if(o)return o;throw TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")},l.addType=function(e,t){if(!e||"string"!=typeof e.name||"function"!=typeof e.test)throw TypeError("Object with properties {name: string, test: function} expected");if(!1!==t){for(var n=0;n<l.types.length;n++)if("Object"===l.types[n].name)return void l.types.splice(n,0,e)}l.types.push(e)},l.addConversion=function(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}()},"function"==typeof define&&define.amd?define([],t):e.exports=t()},70480(e,t,n){"use strict";let r,i;n.r(t),n.d(t,{generateChartsTheme:()=>iI,DensitySelector:()=>p2,applyMergeIndexedColumnsTransform:()=>i_,interpolateSelectionIndividual:()=>ik,DragButton:()=>gJ,TimeRangeSelector:()=>V$,getFormatterStats:()=>na,OptionsEditorGrid:()=>pK,TOOLTIP_MAX_HEIGHT:()=>VZ,useMousePosition:()=>V6,TextOverlay:()=>LY,isValidLegendSize:()=>ne,isValidLegendMode:()=>t7,isDateUnit:()=>rT,parseVariables:()=>rY,UnitSelector:()=>HT,PERCENT_UNIT_CONFIG:()=>n9,RepeatGrid:()=>H6,PERCENT_GROUP_CONFIG:()=>n6,YAxisLabel:()=>HO,replaceVariablesForDisplay:()=>rX,TOOLTIP_MIN_WIDTH:()=>Vq,useId:()=>rH,getTitleAction:()=>t5,getYBuffer:()=>Hv,PINNED_CROSSHAIR_SERIES_NAME:()=>tX,getPixelXFromGrid:()=>Ho,getFormattedAxisLabel:()=>iv,clearHighlightedSeries:()=>rL,FALLBACK_CHART_WIDTH:()=>VQ,restoreChart:()=>rP,FormatControls:()=>HD,transformData:()=>iP,getTimeSeriesValues:()=>lb,DEFAULT_LEGEND:()=>nt,OptionsEditorControl:()=>pZ,formatDecimal:()=>rs,DiscardChangesConfirmationDialog:()=>pz,formatTime:()=>nv,SelectionProvider:()=>eN,TimeChartTooltip:()=>HC,legendModes:()=>t6,EMPTY_TOOLTIP_DATA:()=>V4,isThroughputUnit:()=>rM,applyJoinTransform:()=>iO,TextField:()=>pv,SeriesInfo:()=>He,getClosestTimestamp:()=>rj,DropIndicator:()=>p5,applyMergeColumnsTransform:()=>iE,isTemperatureUnit:()=>rI,limitDecimalPlaces:()=>nc,useSnackbar:()=>tY,dateFormatOptionsWithTimeZone:()=>ip,calculateBarYBounds:()=>Hu,DEFAULT_COLUMN_HEIGHT:()=>40,parseVariablesAndFormat:()=>rZ,getCommonTimeScale:()=>lw,isBytesUnit:()=>rw,ModeSelector:()=>Lj,OptionsEditorColumn:()=>pH,DECIMAL_UNIT_CONFIG:()=>ro,DEFAULT_PINNED_CROSSHAIR:()=>tJ,TEMPERATURE_GROUP_CONFIG:()=>rt,NoDataOverlay:()=>LZ,getResourceExtendedDisplayName:()=>lA,InterpolationFormat:()=>r$,ErrorBoundary:()=>Cl.ErrorBoundary,hasDataFieldPatterns:()=>r7,CURRENCY_UNIT_CONFIG:()=>n3,ToolbarIconButton:()=>HM,DEFAULT_TOOLTIP_CONFIG:()=>V8,TRANSFORM_TEXT:()=>rD,calculateBarBandwidth:()=>Ha,ItemActionsProvider:()=>eO,isWithinPercentageRange:()=>Hm,OPTIMIZED_MODE_SERIES_LIMIT:()=>1e3,legendPositions:()=>t4,TIME_GROUP_CONFIG:()=>nd,defaultCursorData:()=>V3,createTimezoneAwareAxisFormatter:()=>Co,RefreshIntervalPicker:()=>H4,legendSizes:()=>t8,BITS_GROUP_CONFIG:()=>nZ,TOOLTIP_LABELS_MAX_WIDTH:()=>VK,applyValueMapping:()=>iD,UNIT_GROUP_CONFIG:()=>rd,batchDispatchNearbySeriesActions:()=>rB,DEFAULT_COLUMN_WIDTH:()=>150,getGMTOffset:()=>im,getPointInGrid:()=>rN,InfoTooltip:()=>pU,AlignSelector:()=>V,JSONEditor:()=>LL,CURRENCY_GROUP_CONFIG:()=>n5,TooltipHeader:()=>HS,SeriesMarker:()=>VG,FontSizeSelector:()=>Cc,THROUGHPUT_UNIT_CONFIG:()=>ru,DEFAULT_COLUMN_MAX_WIDTH:()=>1e3,TOOLTIP_PADDING:()=>VJ,TimeZoneContext:()=>lM,TimeZoneProvider:()=>lk,useDeepMemo:()=>iw,TransformsEditor:()=>H3,combineSx:()=>rV,getFormatterFromCache:()=>ns,applyMergeSeriesTransform:()=>iR,Legend:()=>pO,Dialog:()=>pj,getFormattedMultipleYAxes:()=>rE,replaceVariables:()=>rK,DECIMAL_GROUP_CONFIG:()=>ri,getResourceDisplayName:()=>lC,SnackbarProvider:()=>tq,formatBytes:()=>n0,getUnitConfig:()=>rg,LoadingOverlay:()=>LK,formatWithTimeZone:()=>ig,legacyCheckforNearbySeries:()=>Hp,replaceVariable:()=>rU,UNIT_CONFIG:()=>rf,testChartsTheme:()=>H_,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>VX,interpolate:()=>rG,THROUGHPUT_GROUP_CONFIG:()=>ra,BYTES_UNIT_CONFIG:()=>nQ,useChartsTheme:()=>eI,calculateBarSegmentBounds:()=>Hl,checkCrosshairPinnedStatus:()=>rF,mockChartsContext:()=>HR,checkforNearbyTimeSeries:()=>Hf,TOOLTIP_DATE_FORMAT:()=>V5,hasDecimalPlaces:()=>nu,isCurrencyUnit:()=>rk,DEFAULT_COLUMN_MIN_WIDTH:()=>60,handleMoveUp:()=>gK,ContentWithLegend:()=>p_,OptionsEditorGroup:()=>pX,isUnitWithDecimalPlaces:()=>rC,SeriesLabelsStack:()=>VU,getDateAndTime:()=>iy,getTableCellLayout:()=>dV,ChartsThemeContext:()=>ek,TooltipContent:()=>Hy,isValidTraceId:()=>lS,formatCurrency:()=>n4,ValueMappingsEditor:()=>$e,BYTES_GROUP_CONFIG:()=>nJ,interpolateSelectionBatch:()=>iT,isLegendItemVisuallySelected:()=>lR,getFormattedAxis:()=>rO,getClosestTimestampInFullDataset:()=>rz,ChartsProvider:()=>eM,TimeZoneSelector:()=>VW,LinkEditorForm:()=>LB,SortSelector:()=>LJ,formatValue:()=>rp,persesColumnsToTanstackColumns:()=>dH,NEARBY_SERIES_DESCRIPTION:()=>V0,calculateVisualYForSeries:()=>Hs,hasIndexedPatterns:()=>r9,ColorPicker:()=>eS,useItemActions:()=>eR,getUnitGroup:()=>rm,formatThroughput:()=>rc,getTheme:()=>Hq,shouldShortenValues:()=>nl,MIN_STEP_INTERVAL_MS:()=>lx,buildRelativeTimeOption:()=>t1,useSelection:()=>ej,TEMPERATURE_UNIT_CONFIG:()=>rn,SortSelectorButtons:()=>LQ,formatBits:()=>nX,getTimeZoneOptions:()=>t2,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>Hh,isUnitWithShortValues:()=>rA,getTooltipStyles:()=>Hi,interpolateHeaders:()=>iA,ErrorAlert:()=>Ca,OptionsColorPicker:()=>lI,getUnitGroupConfig:()=>rv,TOOLTIP_BG_COLOR_FALLBACK:()=>V2,TOOLTIP_MAX_WIDTH:()=>VY,DragAndDropElement:()=>gY,extractFieldNames:()=>ie,isBitsUnit:()=>rS,SHOW_FEWER_SERIES_LIMIT:()=>Hd,TIME_UNIT_CONFIG:()=>nf,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>Hc,isPercentUnit:()=>rx,getLegendSize:()=>ni,getSubmitText:()=>t3,handleMoveDown:()=>gX,PIN_TOOLTIP_HELP_TEXT:()=>V9,Table:()=>pM,typography:()=>HG,formatPercent:()=>n7,assembleTransform:()=>Hr,formatTemperature:()=>rr,useTimeZone:()=>lT,createRegexFromString:()=>iC,hasBatchPatterns:()=>r8,PersesTimeToIntlTime:()=>np,parseFormat:()=>r3,FormActions:()=>Ch,getNearbySeriesData:()=>Hg,useMemoized:()=>ib,isValidLegendPosition:()=>t9,getLegendMode:()=>nr,EMPHASIZED_SERIES_DESCRIPTION:()=>V1,replaceDataFields:()=>r4,Drawer:()=>mh,getLegendPosition:()=>nn,BITS_UNIT_CONFIG:()=>nK,EChart:()=>Cr,isTimeUnit:()=>ry,useChartsContext:()=>eT,interpolateQueryParams:()=>iM,UNPIN_TOOLTIP_HELP_TEXT:()=>V7,DateTimeRangePicker:()=>VH,SettingsAutocomplete:()=>p0,ThresholdsEditor:()=>L6,isDecimalUnit:()=>rb,enableDataZoom:()=>rR,replaceDataFieldsBatch:()=>r6,useDragAndDropMonitor:()=>gq,useLocalStorage:()=>r_,isRegexPattern:()=>iS});var o,s,a,l,u,c,h,d,f,p,g,m,v,y,x,b=n(62540),w=n(70451),S=n.n(w),C=n(11750),A=n(81023),M=n(59238),k=n(41953),T=n(24726),I=n(77308),D=n(23434),O=n(26952),E=n(72052),_=n(29009),R=n(46733);function P(e){return(0,R.Ay)("MuiButtonGroup",e)}let L=(0,_.A)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]);var N=n(94580),B=n(30016);let F=(0,I.A)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${L.grouped}`]:t.grouped},{[`& .${L.grouped}`]:t[`grouped${(0,T.A)(n.orientation)}`]},{[`& .${L.grouped}`]:t[`grouped${(0,T.A)(n.variant)}`]},{[`& .${L.grouped}`]:t[`grouped${(0,T.A)(n.variant)}${(0,T.A)(n.orientation)}`]},{[`& .${L.grouped}`]:t[`grouped${(0,T.A)(n.variant)}${(0,T.A)(n.color)}`]},{[`& .${L.firstButton}`]:t.firstButton},{[`& .${L.lastButton}`]:t.lastButton},{[`& .${L.middleButton}`]:t.middleButton},t.root,t[n.variant],!0===n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,"vertical"===n.orientation&&t.vertical]}})((0,D.A)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(e.vars||e).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${L.lastButton},& .${L.middleButton}`]:{borderTopRightRadius:0,borderTopLeftRadius:0},[`& .${L.firstButton},& .${L.middleButton}`]:{borderBottomRightRadius:0,borderBottomLeftRadius:0}}},{props:{orientation:"horizontal"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${L.lastButton},& .${L.middleButton}`]:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}},{props:{variant:"text",orientation:"horizontal"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderRight:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${L.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"text",orientation:"vertical"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderBottom:e.vars?`1px solid rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:`1px solid ${"light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"}`,[`&.${L.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,O.A)()).flatMap(([t])=>[{props:{variant:"text",color:t},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.5)`:(0,M.X4)(e.palette[t].main,.5)}}}]),{props:{variant:"outlined",orientation:"horizontal"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}},[`& .${L.lastButton},& .${L.middleButton}`]:{marginLeft:-1}}},{props:{variant:"outlined",orientation:"vertical"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}},[`& .${L.lastButton},& .${L.middleButton}`]:{marginTop:-1}}},{props:{variant:"contained",orientation:"horizontal"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderRight:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${L.disabled}`]:{borderRight:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},{props:{variant:"contained",orientation:"vertical"},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderBottom:`1px solid ${(e.vars||e).palette.grey[400]}`,[`&.${L.disabled}`]:{borderBottom:`1px solid ${(e.vars||e).palette.action.disabled}`}}}},...Object.entries(e.palette).filter((0,O.A)(["dark"])).map(([t])=>({props:{variant:"contained",color:t},style:{[`& .${L.firstButton},& .${L.middleButton}`]:{borderColor:(e.vars||e).palette[t].dark}}}))],[`& .${L.grouped}`]:{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}}}))),j=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiButtonGroup"}),{children:r,className:i,color:o="primary",component:s="div",disabled:a=!1,disableElevation:l=!1,disableFocusRipple:u=!1,disableRipple:c=!1,fullWidth:h=!1,orientation:d="horizontal",size:f="medium",variant:p="outlined",...g}=n,m={...n,color:o,component:s,disabled:a,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:h,orientation:d,size:f,variant:p},v=(e=>{let{classes:t,color:n,disabled:r,disableElevation:i,fullWidth:o,orientation:s,variant:a}=e,l={root:["root",a,s,o&&"fullWidth",i&&"disableElevation",`color${(0,T.A)(n)}`],grouped:["grouped",`grouped${(0,T.A)(s)}`,`grouped${(0,T.A)(a)}`,`grouped${(0,T.A)(a)}${(0,T.A)(s)}`,`grouped${(0,T.A)(a)}${(0,T.A)(n)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,A.A)(l,P,t)})(m),y=w.useMemo(()=>({className:v.grouped,color:o,disabled:a,disableElevation:l,disableFocusRipple:u,disableRipple:c,fullWidth:h,size:f,variant:p}),[o,a,l,u,c,h,f,p,v.grouped]),x=(0,k.A)(r),S=x.length;return(0,b.jsx)(F,{as:s,role:"group",className:(0,C.A)(v.root,i),ref:t,ownerState:m,...g,children:(0,b.jsx)(N.A.Provider,{value:y,children:x.map((e,t)=>{let n,r;return(0,b.jsx)(B.A.Provider,{value:(n=0===t,r=t===S-1,n&&r?"":n?v.firstButton:r?v.lastButton:v.middleButton),children:e},t)})})})});var z=n(7013);function V({onChange:e,value:t="left",...n}){let r=t=>{e(t)};return(0,b.jsxs)(j,{"aria-label":"Alignement",...n,children:[(0,b.jsx)(z.A,{onClick:()=>r("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,b.jsx)(z.A,{onClick:()=>r("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,b.jsx)(z.A,{onClick:()=>r("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var H=n(315),$=n(47095),W=n(93648),G=n(29618),U=n(98029);function q(){return(q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Y(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function Z(e){var t=(0,w.useRef)(e),n=(0,w.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var K,X=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},J=function(e){return"touches"in e},Q=function(e){return e&&e.ownerDocument.defaultView||self},ee=function(e,t,n){var r=e.getBoundingClientRect(),i=J(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:X((i.pageX-(r.left+Q(e).pageXOffset))/r.width),top:X((i.pageY-(r.top+Q(e).pageYOffset))/r.height)}},et=function(e){J(e)||e.preventDefault()},en=S().memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=Y(e,["onMove","onKey","onEnd"]),o=(0,w.useRef)(null),s=Z(t),a=Z(n),l=Z(r),u=(0,w.useRef)(null),c=(0,w.useRef)(!1),h=(0,w.useMemo)(function(){var e=function(e){et(e),(J(e)?e.touches.length>0:e.buttons>0)&&o.current?s(ee(o.current,e,u.current)):(n(!1),l())},t=function(){n(!1),l()};function n(n){var r=c.current,i=Q(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(et(t),(!c.current||J(t))&&r)){if(J(t)){c.current=!0;var i=t.changedTouches||[];i.length&&(u.current=i[0].identifier)}r.focus(),s(ee(r,t,u.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&l()},n]},[a,s,l]),d=h[0],f=h[1],p=h[2],g=h[3];return(0,w.useEffect)(function(){return g},[g]),S().createElement("div",q({},i,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:f,onKeyUp:p,tabIndex:0,role:"slider"}))}),er=function(e){return e.filter(Boolean).join(" ")},ei=function(e){var t=e.color,n=e.left,r=e.top,i=er(["react-colorful__pointer",e.className]);return S().createElement("div",{className:i,style:{top:100*(void 0===r?.5:r)+"%",left:100*n+"%"}},S().createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},eo=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},es=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?eo(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?eo(parseInt(e.substring(6,8),16)/255,2):1}},ea=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:eo(e.h),s:eo(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:eo(i/2),a:eo(r,2)}},el=function(e){var t=ea(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},eu=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),s=r*(1-n),a=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:eo(255*[r,a,s,s,l,r][u]),g:eo(255*[l,r,r,a,s,s][u]),b:eo(255*[s,s,l,r,r,a][u]),a:eo(i,2)}},ec=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eh=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?ec(eo(255*i)):"";return"#"+ec(t)+ec(n)+ec(r)+o},ed=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),s=o-Math.min(t,n,r),a=s?o===t?(n-r)/s:o===n?2+(r-t)/s:4+(t-n)/s:0;return{h:eo(60*(a<0?a+6:a)),s:eo(o?s/o*100:0),v:eo(o/255*100),a:i}},ef=S().memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=er(["react-colorful__hue",e.className]);return S().createElement("div",{className:i},S().createElement(en,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:X(t+360*e.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":eo(t),"aria-valuemax":"360","aria-valuemin":"0"},S().createElement(ei,{className:"react-colorful__hue-pointer",left:t/360,color:el({h:t,s:100,v:100,a:1})})))}),ep=S().memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:el({h:t.h,s:100,v:100,a:1})};return S().createElement("div",{className:"react-colorful__saturation",style:i},S().createElement(en,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:X(t.s+100*e.left,0,100),v:X(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+eo(t.s)+"%, Brightness "+eo(t.v)+"%"},S().createElement(ei,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:el(t)})))}),eg=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},em="u">typeof window?w.useLayoutEffect:w.useEffect,ev=new Map,ey=function(e){em(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!ev.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',ev.set(t,r);var i=K||n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}},[])},ex=function(e){var t,n,r,i,o,s,a,l=e.className,u=e.colorModel,c=e.color,h=void 0===c?u.defaultColor:c,d=e.onChange,f=e.onChangeEnd,p=Y(e,["className","colorModel","color","onChange","onChangeEnd"]),g=(0,w.useRef)(null);ey(g);var m=(t=Z(d),n=Z(f),i=(r=(0,w.useState)(function(){return u.toHsva(h)}))[0],o=r[1],s=(0,w.useRef)({color:h,hsva:i}),a=(0,w.useRef)(!1),(0,w.useEffect)(function(){if(!u.equal(h,s.current.color)){var e=u.toHsva(h);s.current={hsva:e,color:h},o(e),a.current=!1}},[h,u]),(0,w.useEffect)(function(){var e;eg(i,s.current.hsva)||u.equal(e=u.fromHsva(i),s.current.color)||(s.current={hsva:i,color:e},t(e),a.current=!0)},[i,u,t]),[i,(0,w.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[]),(0,w.useCallback)(function(){a.current&&(a.current=!1,n(s.current.color))},[n])]),v=m[0],y=m[1],x=m[2],b=er(["react-colorful",l]);return S().createElement("div",q({},p,{ref:g,className:b}),S().createElement(ep,{hsva:v,onChange:y,onChangeEnd:x}),S().createElement(ef,{hue:v.h,onChange:y,onChangeEnd:x,className:"react-colorful__last-control"}))},eb={defaultColor:"000",toHsva:function(e){return ed(es(e))},fromHsva:function(e){return eh(eu({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||eg(es(e),es(t))}},ew=function(e){return S().createElement(ex,q({},e,{colorModel:eb}))};let eS=({color:e,onChange:t,onClear:n,palette:r})=>{let[i,o]=(0,w.useState)(e),s=e=>{o(e),t?.(e)};return(0,b.jsxs)(H.A,{spacing:1,children:[(0,b.jsx)(ew,{color:e,onChange:s,style:{width:"100%"}}),(0,b.jsx)(H.A,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:r&&r.map((e,t)=>(0,b.jsx)($.A,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>s(e),children:(0,b.jsx)(G,{})},t))}),(0,b.jsxs)(H.A,{direction:"row",gap:1,alignItems:"center",children:[(0,b.jsx)(W.A,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:i,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),eC(e.target.value)&&t?.(e.target.value)}}),n&&(0,b.jsx)($.A,{onClick:n,children:(0,b.jsx)(U,{})})]})]})},eC=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),r=n&&n[1]?n[1].length:0;return 3===r||6===r||!!t&&4===r||!!t&&8===r};var eA=n(91823);function eM(e){let{children:t,chartsTheme:n,enablePinning:r=!1,enableSyncGrouping:i=!0}=e,[o,s]=(0,w.useState)(null),a=(0,w.useMemo)(()=>({chartsTheme:n,enablePinning:r,lastTooltipPinnedCoords:o,enableSyncGrouping:i,setLastTooltipPinnedCoords:s}),[n,r,i,o,s]);return(0,b.jsx)(ek.Provider,{value:a,children:t})}let ek=(0,w.createContext)(void 0);function eT(){let e=(0,w.useContext)(ek);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function eI(){return eT().chartsTheme}let eD=(0,w.createContext)(void 0);function eO({children:e}){let[t,n]=(0,w.useState)(new Map),r=(0,w.useCallback)((e,t,r)=>{n(n=>{let i=new Map(n),o=i.get(e)||{loading:!1};if(void 0!==r){let n=new Map(o.itemStatuses||new Map),s=n.get(r)||{loading:!1};n.set(r,{...s,...t}),i.set(e,{...o,itemStatuses:n})}else i.set(e,{...o,...t});return i})},[]),i=(0,w.useCallback)(e=>{n(t=>{if(void 0===e)return new Map;if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=(0,w.useMemo)(()=>({actionStatuses:t,setActionStatus:r,clearActionStatus:i}),[t,r,i]);return(0,b.jsx)(eD.Provider,{value:o,children:e})}let eE=()=>{},e_={actionStatuses:new Map,setActionStatus:eE,clearActionStatus:eE,hasContext:!1};function eR(){let e=(0,w.useContext)(eD);return(0,w.useMemo)(()=>e?{...e,hasContext:!0}:e_,[e])}let eP=(0,w.createContext)(void 0),eL=(e,t)=>t;function eN({children:e}){let[t,n]=(0,w.useState)(new Map),r=(0,w.useRef)(eL),i=(0,w.useCallback)(e=>{r.current=e},[]),o=(0,w.useCallback)(e=>{let t=new Map;e.forEach(({item:e,id:n})=>t.set(n,e)),n(t)},[]),s=(0,w.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.has(t)?r.delete(t):r.set(t,e),r})},[]),a=(0,w.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=(0,w.useCallback)(()=>n(new Map),[]),u=(0,w.useCallback)((e,n)=>t.has(r.current(e,n)),[t]),c=(0,w.useMemo)(()=>({selectionMap:t,setSelection:o,toggleSelection:s,removeFromSelection:a,clearSelection:l,isSelected:u,registerGetId:i}),[t,o,s,a,l,u,i]);return(0,b.jsx)(eP.Provider,{value:c,children:e})}let eB=()=>{},eF={selectionMap:new Map,setSelection:eB,toggleSelection:eB,removeFromSelection:eB,clearSelection:eB,isSelected:()=>!1,hasContext:!1};function ej(e){let t=(0,w.useContext)(eP);return(0,w.useEffect)(()=>{t&&e?.getId&&t.registerGetId(e.getId)},[t,e?.getId]),(0,w.useMemo)(()=>{if(!t)return eF;let{registerGetId:e,...n}=t;return{...n,hasContext:!0}},[t])}var ez=n(20231),eV=n.n(ez);let eH=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(r&&(r+=" "),r+=t);return r},e$={data:""},eW=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,eG=/\/\*[^]*?\*\/| +/g,eU=/\n+/g,eq=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+s+";":r+="f"==o[1]?eq(s,o):o+"{"+eq(s,"k"==o[1]?"":t)+"}":"object"==typeof s?r+=eq(s,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=s&&(o="-"==o[1]?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=eq.p?eq.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},eY={},eZ=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+eZ(e[n]);return t}return e};function eK(e){let t,n,r=this||{},i=e.call?e(r.p):e;return((e,t,n,r,i)=>{var o;let s=eZ(e),a=eY[s]||(eY[s]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(s));if(!eY[a]){let t=s!==e?e:(e=>{let t,n,r=[{}];for(;t=eW.exec(e.replace(eG,""));)t[4]?r.shift():t[3]?(n=t[3].replace(eU," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(eU," ").trim();return r[0]})(e);eY[a]=eq(i?{["@keyframes "+a]:t}:t,n?"":"."+a)}let l=n&&eY.g;return n&&(eY.g=eY[a]),o=eY[a],l?t.data=t.data.replace(l,o):-1===t.data.indexOf(o)&&(t.data=r?o+t.data:t.data+o),a})(i.unshift?i.raw?(t=[].slice.call(arguments,1),n=r.p,i.reduce((e,r,i)=>{let o=t[i];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":eq(e,""):!1===e?"":e}return e+r+(null==o?"":o)},"")):i.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):i,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||e$})(r.target),r.g,r.o,r.k)}function eX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function eJ(e,t,n){return t&&eX(e.prototype,t),n&&eX(e,n),e}function eQ(){return(eQ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function e0(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function e1(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function e2(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}eK.bind({g:1}),eK.bind({k:1});var e5=function(){return""},e3=S().createContext({enqueueSnackbar:e5,closeSnackbar:e5}),e4="@media (max-width:599.95px)",e6="@media (min-width:600px)",e8=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e9=function(e){return""+e8(e.vertical)+e8(e.horizontal)},e7=function(e){return!!e||0===e},te="unmounted",tt="exited",tn="entering",tr="entered",ti="exiting",to=function(e){function t(t){var n,r=e.call(this,t)||this,i=t.appear;return r.appearStatus=null,t.in?i?(n=tt,r.appearStatus=tn):n=tr:n=t.unmountOnExit||t.mountOnEnter?te:tt,r.state={status:n},r.nextCallback=null,r}e0(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===te?{status:tt}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==tn&&n!==tr&&(t=tn):(n===tn||n===tr)&&(t=ti)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===tn?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===tt&&this.setState({status:te})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:tn},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(r.enter,function(){t.safeSetState({status:tr},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})):this.safeSetState({status:tr},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();t?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:ti},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:tt},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:tt},function(){e.props.onExited&&e.props.onExited(e.node)})},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;!this.node||n?setTimeout(this.nextCallback,0):(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e))},n.render=function(){var e=this.state.status;if(e===te)return null;var t=this.props;return(0,t.children)(e,e1(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},eJ(t,[{key:"node",get:function(){var e,t=null==(e=this.props.nodeRef)?void 0:e.current;if(!t)throw Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(S().Component);function ts(){}function ta(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function tl(e,t){return(0,w.useMemo)(function(){return null==e&&null==t?null:function(n){ta(e,n),ta(t,n)}},[e,t])}function tu(e){var t=e.timeout,n=e.style,r=void 0===n?{}:n,i=e.mode;return{duration:"object"==typeof t?t[i]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}to.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ts,onEntering:ts,onEntered:ts,onExit:ts,onExiting:ts,onExited:ts};var tc=function(e){e.scrollTop=e.scrollTop},th=function(e){return Math.round(e)+"ms"};function td(e,t){void 0===e&&(e=["all"]);var n=t||{},r=n.duration,i=void 0===r?300:r,o=n.easing,s=void 0===o?"cubic-bezier(0.4, 0, 0.2, 1)":o,a=n.delay,l=void 0===a?0:a;return(Array.isArray(e)?e:[e]).map(function(e){return e+" "+("string"==typeof i?i:th(i))+" "+s+" "+("string"==typeof l?l:th(l))}).join(",")}function tf(e){return(e&&e.ownerDocument||document).defaultView||window}function tp(e,t){if(t){var n=function(e,t){var n,r=t.getBoundingClientRect(),i=tf(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=i.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var s=0,a=0;if(n&&"none"!==n&&"string"==typeof n){var l=n.split("(")[1].split(")")[0].split(",");s=parseInt(l[4],10),a=parseInt(l[5],10)}switch(e){case"left":return"translateX("+(i.innerWidth+s-r.left)+"px)";case"right":return"translateX(-"+(r.left+r.width-s)+"px)";case"up":return"translateY("+(i.innerHeight+a-r.top)+"px)";default:return"translateY(-"+(r.top+r.height-a)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var tg=(0,w.forwardRef)(function(e,t){var n=e.children,r=e.direction,i=void 0===r?"down":r,o=e.in,s=e.style,a=e.timeout,l=void 0===a?0:a,u=e.onEnter,c=e.onEntered,h=e.onExit,d=e.onExited,f=e1(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),p=(0,w.useRef)(null),g=tl(n.ref,p),m=tl(g,t),v=(0,w.useCallback)(function(){p.current&&tp(i,p.current)},[i]);return(0,w.useEffect)(function(){if(!o&&"down"!==i&&"right"!==i){var e=function(e,t){var n;function r(){for(var r=this,i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];clearTimeout(n),n=setTimeout(function(){e.apply(r,o)},t)}return void 0===t&&(t=166),r.clear=function(){clearTimeout(n)},r}(function(){p.current&&tp(i,p.current)}),t=tf(p.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[i,o]),(0,w.useEffect)(function(){o||v()},[o,v]),(0,w.createElement)(to,Object.assign({appear:!0,nodeRef:p,onEnter:function(e,t){tp(i,e),tc(e),u&&u(e,t)},onEntered:c,onEntering:function(e){var t=(null==s?void 0:s.transitionTimingFunction)||"cubic-bezier(0.0, 0, 0.2, 1)",n=tu({timeout:l,mode:"enter",style:eQ({},s,{transitionTimingFunction:t})});e.style.webkitTransition=td("-webkit-transform",n),e.style.transition=td("transform",n),e.style.webkitTransform="none",e.style.transform="none"},onExit:function(e){var t=(null==s?void 0:s.transitionTimingFunction)||"cubic-bezier(0.4, 0, 0.6, 1)",n=tu({timeout:l,mode:"exit",style:eQ({},s,{transitionTimingFunction:t})});e.style.webkitTransition=td("-webkit-transform",n),e.style.transition=td("transform",n),tp(i,e),h&&h(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",d&&d(e)},in:o,timeout:l},f),function(e,t){return(0,w.cloneElement)(n,eQ({ref:m,style:eQ({visibility:"exited"!==e||o?void 0:"hidden"},s,{},n.props.style)},t))})});tg.displayName="Slide";var tm=function(e){return S().createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},tv={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:S().createElement(function(){return S().createElement(tm,null,S().createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"}))},null),warning:S().createElement(function(){return S().createElement(tm,null,S().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:S().createElement(function(){return S().createElement(tm,null,S().createElement("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"}))},null),info:S().createElement(function(){return S().createElement(tm,null,S().createElement("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"}))},null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:tg,transitionDuration:{enter:225,exit:195}},ty=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:tv.autoHideDuration},tx=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,["string","number"])?e:n(e,["object"])?eQ({},tv.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?eQ({},tv.transitionDuration,{},t):tv.transitionDuration};function tb(e){return Object.entries(e).reduce(function(e,t){var n,r=t[0],i=t[1];return eQ({},e,((n={})[r]=eK(i),n))},{})}var tw="notistack-CollapseWrapper",tS=tb({root:{height:0},entered:{height:"auto"}}),tC=(0,w.forwardRef)(function(e,t){var n=e.children,r=e.in,i=e.onExited,o=(0,w.useRef)(null),s=(0,w.useRef)(null),a=tl(t,s),l=function(){return o.current?o.current.clientHeight:0};return(0,w.createElement)(to,{in:r,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=l(),n=tu({timeout:175,mode:"enter"}),r=n.duration,i=n.easing;e.style.transitionDuration="string"==typeof r?r:r+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=i||""},onExit:function(e){e.style.height=l()+"px"},onExited:i,onExiting:function(e){tc(e);var t=tu({timeout:175,mode:"exit"}),n=t.duration,r=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=r||""},nodeRef:s,timeout:175},function(e,t){return(0,w.createElement)("div",Object.assign({ref:a,className:eH(tS.root,"entered"===e&&tS.entered),style:eQ({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:td("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!r&&{visibility:"hidden"})},t),(0,w.createElement)("div",{ref:o,className:tw,style:{display:"flex",width:"100%"}},n))})});tC.displayName="Collapse";var tA={right:"left",left:"right",bottom:"up",top:"down"},tM=function(e){void 0===e&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var r;return eQ({},t,((r={})[n]=e[n],r))},{})},tk=function(){};function tT(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=[].concat(i);t&&-1===s.indexOf(t)&&s.push(t),e.apply(this,s),n.apply(this,s)}},tk)}var tI="u">typeof window?w.useLayoutEffect:w.useEffect;function tD(e){var t=(0,w.useRef)(e);return tI(function(){t.current=e}),(0,w.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var tO=(0,w.forwardRef)(function(e,t){var n=e.children,r=e.className,i=e.autoHideDuration,o=e.disableWindowBlurListener,s=void 0!==o&&o,a=e.onClose,l=e.id,u=e.open,c=e.SnackbarProps,h=void 0===c?{}:c,d=(0,w.useRef)(),f=tD(function(){a&&a.apply(void 0,arguments)}),p=tD(function(e){a&&null!=e&&(d.current&&clearTimeout(d.current),d.current=setTimeout(function(){f(null,"timeout",l)},e))});(0,w.useEffect)(function(){return u&&p(i),function(){d.current&&clearTimeout(d.current)}},[u,i,p]);var g=function(){d.current&&clearTimeout(d.current)},m=(0,w.useCallback)(function(){null!=i&&p(.5*i)},[i,p]);return(0,w.useEffect)(function(){if(!s&&u)return window.addEventListener("focus",m),window.addEventListener("blur",g),function(){window.removeEventListener("focus",m),window.removeEventListener("blur",g)}},[s,m,u]),(0,w.createElement)("div",Object.assign({ref:t},h,{className:eH("notistack-Snackbar",r),onMouseEnter:function(e){h.onMouseEnter&&h.onMouseEnter(e),g()},onMouseLeave:function(e){h.onMouseLeave&&h.onMouseLeave(e),m()}}),n)});tO.displayName="Snackbar";var tE=tb({root:((oQ={display:"flex",flexWrap:"wrap",flexGrow:1})[e6]={flexGrow:"initial",minWidth:"288px"},oQ)}),t_=(0,w.forwardRef)(function(e,t){var n=e.className,r=e1(e,["className"]);return S().createElement("div",Object.assign({ref:t,className:eH(tE.root,n)},r))});t_.displayName="SnackbarContent";var tR=tb({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),tP="notistack-snackbar",tL=(0,w.forwardRef)(function(e,t){var n=e.id,r=e.message,i=e.action,o=e.iconVariant,s=e.variant,a=e.hideIconVariant,l=e.style,u=e.className,c=o[s],h=i;return"function"==typeof h&&(h=h(n)),S().createElement(t_,{ref:t,role:"alert","aria-describedby":tP,style:l,className:eH("notistack-MuiContent","notistack-MuiContent-"+s,tR.root,tR[s],u,!a&&c&&tR.lessPadding)},S().createElement("div",{id:tP,className:tR.message},a?null:c,r),h&&S().createElement("div",{className:tR.action},h))});tL.displayName="MaterialDesignContent";var tN=(0,w.memo)(tL),tB=tb({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),tF=function(e){var t,n=(0,w.useRef)(),r=(0,w.useState)(!0),i=r[0],o=r[1],s=tT([e.snack.onClose,e.onClose]),a=(0,w.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,w.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var l=e.snack,u=e.classes,c=e.Component,h=(0,w.useMemo)(function(){return tM(u)},[u]),d=l.open,f=l.SnackbarProps,p=l.TransitionComponent,g=l.TransitionProps,m=l.transitionDuration,v=l.disableWindowBlurListener,y=l.content,x=e1(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),b=eQ({direction:"center"!==(t=x.anchorOrigin).horizontal?tA[t.horizontal]:tA[t.vertical],timeout:m},g),C=y;"function"==typeof C&&(C=C(x.id,x.message));var A=["onEnter","onEntered","onExit","onExited"].reduce(function(t,n){var r;return eQ({},t,((r={})[n]=tT([e.snack[n],e[n]],x.id),r))},{});return S().createElement(tC,{in:i,onExited:A.onExited},S().createElement(tO,{open:d,id:x.id,disableWindowBlurListener:v,autoHideDuration:x.autoHideDuration,className:eH(tB.wrappedRoot,h.root,h["anchorOrigin"+e9(x.anchorOrigin)]),SnackbarProps:f,onClose:s},S().createElement(p,Object.assign({},b,{appear:!0,in:d,onExit:A.onExit,onExited:a,onEnter:A.onEnter,onEntered:tT([A.onEntered,function(){e.snack.requestClose&&s(null,"instructed",e.snack.id)}],x.id)}),C||S().createElement(void 0===c?tN:c,Object.assign({},x)))))},tj=20,tz=6,tV=2,tH="."+tw,t$=tb({root:((o0={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:td(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[tH]={padding:tz+"px 0px",transition:"padding 300ms ease 0ms"},o0.maxWidth="calc(100% - "+2*tj+"px)",o0[e4]={width:"100%",maxWidth:"calc(100% - 32px)"},o0),rootDense:((o1={})[tH]={padding:tV+"px 0px"},o1),top:{top:tj-tz+"px",flexDirection:"column"},bottom:{bottom:tj-tz+"px",flexDirection:"column-reverse"},left:((o2={left:tj+"px"})[e6]={alignItems:"flex-start"},o2[e4]={left:"16px"},o2),right:((o5={right:tj+"px"})[e6]={alignItems:"flex-end"},o5[e4]={right:"16px"},o5),center:((o3={left:"50%",transform:"translateX(-50%)"})[e6]={alignItems:"center"},o3)}),tW=(0,w.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,r=e.anchorOrigin,i=e.dense,o=e.children,s=eH("notistack-SnackbarContainer",t$[r.vertical],t$[r.horizontal],t$.root,n.containerRoot,n["containerAnchorOrigin"+e9(r)],i&&t$.rootDense);return S().createElement("div",{className:s},o)}),tG=function(e){return!("string"==typeof e||(0,w.isValidElement)(e))},tU=function(e){function t(t){var n;return(n=e.call(this,t)||this).enqueueSnackbar=function(e,t){if(void 0===t&&(t={}),null==e)throw Error("enqueueSnackbar called with invalid argument");var r,i=tG(e)?e:t,o=tG(e)?e.message:e,s=i.key,a=i.preventDuplicate,l=e1(i,["key","preventDuplicate"]),u=e7(s),c=u?s:new Date().getTime()+Math.random(),h=(r=n.props,function(e,t){return(void 0===t&&(t=!1),t)?eQ({},tv[e],{},r[e],{},l[e]):"autoHideDuration"===e?ty(l.autoHideDuration,r.autoHideDuration):"transitionDuration"===e?tx(l.transitionDuration,r.transitionDuration):l[e]||r[e]||tv[e]}),d=eQ({id:c},l,{message:o,open:!0,entered:!1,requestClose:!1,persist:h("persist"),action:h("action"),content:h("content"),variant:h("variant"),anchorOrigin:h("anchorOrigin"),disableWindowBlurListener:h("disableWindowBlurListener"),autoHideDuration:h("autoHideDuration"),hideIconVariant:h("hideIconVariant"),TransitionComponent:h("TransitionComponent"),transitionDuration:h("transitionDuration"),TransitionProps:h("TransitionProps",!0),iconVariant:h("iconVariant",!0),style:h("style",!0),SnackbarProps:h("SnackbarProps",!0),className:eH(n.props.className,l.className)});return d.persist&&(d.autoHideDuration=void 0),n.setState(function(e){if(void 0===a&&n.props.preventDuplicate||a){var t=function(e){return u?e.id===c:e.message===o},r=e.queue.findIndex(t)>-1,i=e.snacks.findIndex(t)>-1;if(r||i)return e}return n.handleDisplaySnack(eQ({},e,{queue:[].concat(e.queue,[d])}))}),c},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?eQ({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,r=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(r=!0);var i=e.snacks.map(function(e){return t||e.persist&&!r?eQ({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),eQ({},e,{open:!1})):eQ({},e,{requestClose:!0})});return eQ({},e,{snacks:i})},n.handleEnteredSnack=function(e,t,r){if(!e7(r))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===r?eQ({},e,{entered:!0}):eQ({},e)})}})},n.handleCloseSnack=function(e,t,r){n.props.onClose&&n.props.onClose(e,t,r);var i=void 0===r;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return i||e.id===r?e.entered?eQ({},e,{open:!1}):eQ({},e,{requestClose:!0}):eQ({},e)}),queue:n.filter(function(e){return e.id!==r})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});e7(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!e7(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var r=n.processQueue(eQ({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===r.queue.length?r:n.handleDismissOldest(r)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(e2(n)),closeSnackbar:n.closeSnackbar.bind(e2(n))}},n}return e0(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.domRoot,i=n.children,o=n.dense,s=void 0!==o&&o,a=n.Components,l=void 0===a?{}:a,u=n.classes,c=this.state.snacks.reduce(function(e,t){var n,r=e9(t.anchorOrigin),i=e[r]||[];return eQ({},e,((n={})[r]=[].concat(i,[t]),n))},{}),h=Object.keys(c).map(function(t){var n=c[t],r=n[0];return S().createElement(tW,{key:t,dense:s,anchorOrigin:r.anchorOrigin,classes:u},n.map(function(t){return S().createElement(tF,{key:t.id,snack:t,classes:u,Component:l[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:tT([e.handleExitedSnack,e.props.onExited],t.id),onEntered:tT([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return S().createElement(e3.Provider,{value:t},i,r?(0,ez.createPortal)(h,r):h)},eJ(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||tv.maxSnack}}]),t}(w.Component);function tq({children:e,...t}){return(0,b.jsx)(tU,{...t,Components:{error:(0,I.A)(tN)(()=>({"&.notistack-MuiContent-error":{whiteSpace:"pre-wrap"}}))},children:e})}function tY(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,w.useContext)(e3),n=tZ(e,"error"),r=tZ(e,"info"),i=tZ(e,"warning"),o=tZ(e,"success"),s=(0,w.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:r,warningSnackbar:i,successSnackbar:o,exceptionSnackbar:s}}function tZ(e,t){return(0,w.useCallback)((n,r)=>e(n,{...r,variant:t}),[e,t])}var tK=n(25632);let tX="Pinned Crosshair",tJ={name:tX,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};var tQ=n(97618),t0=n(94461);function t1(e){return{value:{pastDuration:e},display:`Last ${(0,t0.formatDuration)((0,tQ.pW)(e),{delimiter:", "})}`}}function t2(){return["local","UTC",...Intl.supportedValuesOf?.("timeZone")??[]].filter((e,t,n)=>n.indexOf(e)===t).map(e=>({value:e,display:"local"===e?"Local":e.replace(/_/g," ")}))}function t5(e,t){return"read"===e?"View":t&&"create"===e?"Add":t||"create"!==e?"update"===e?"Edit":"":"Create"}function t3(e,t){return t&&"create"===e?"Add":t&&"update"===e?"Apply":t?"":"Save"}let t4=["bottom","right"],t6=["list","table"],t8=["small","medium"];function t9(e){return t4.includes(e)}function t7(e){return t6.includes(e)}function ne(e){return t8.includes(e)}let nt={position:"bottom",mode:"list",size:"medium"};function nn(e){return void 0===e?nt.position:t9(e)?e:nt.position}function nr(e){return e&&t7(e)?e:nt.mode}function ni(e){return e&&ne(e)?e:nt.size}let no=new Map([["time",new Map],["decimal",new Map],["bits",new Map],["bytes",new Map],["currency",new Map],["percent",new Map],["temperature",new Map],["throughput",new Map]]);function ns(e,t,n,r="en-US"){let i=`${e.filter(e=>![void 0,null,"",NaN].includes(e)).join("|")}|${r}`,o=no.get(t);if(!o)throw Error("No formatter found for the input type");let s=o.get(i);if(s)return s.format;let a=Intl.NumberFormat(r,n);return o?.set(`${i}`,a),a.format}let na=()=>({countCacheItems:e=>"all"!==e?no.get(e)?.size??0:Array.from(no.values()).reduce((e,t)=>e+(t?.size??0),0),getKeys:e=>[...no.get(e)?.keys()||[]]});function nl(e){return!1!==e}function nu(e){return"number"==typeof e}function nc(e){return e&&(e<0?e=0:e>20&&(e=20)),e}let nh="Time",nd={label:"Time",decimalPlaces:!0},nf={nanoseconds:{group:nh,label:"Nanoseconds"},microseconds:{group:nh,label:"Microseconds"},milliseconds:{group:nh,label:"Milliseconds"},seconds:{group:nh,label:"Seconds"},minutes:{group:nh,label:"Minutes"},hours:{group:nh,label:"Hours"},days:{group:nh,label:"Days"},weeks:{group:nh,label:"Weeks"},months:{group:nh,label:"Months"},years:{group:nh,label:"Years"}};var np=((oX={}).nanoseconds="nanosecond",oX.microseconds="microsecond",oX.milliseconds="millisecond",oX.seconds="second",oX.minutes="minute",oX.hours="hour",oX.days="day",oX.weeks="week",oX.months="month",oX.years="year",oX);let ng={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001,microseconds:1e-6,nanoseconds:1e-9},nm=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"];function nv(e,{unit:t,decimalPlaces:n}){var r;if(0===e)return"0s";let i=function(e,t){let n=e*ng[t],r=nm[0]||"years",i=r,o=n/ng[r];for(i of nm)if((o=n/ng[i])>=1)break;return{value:o,unit:i}}(e,t??"seconds"),o={style:"unit",unit:np[i.unit],unitDisplay:"months"===(r=i.unit)||"years"===r?"long":"narrow"};return nu(n)?(o.minimumFractionDigits=nc(n),o.maximumFractionDigits=nc(n)):o.maximumSignificantDigits=3,ns([o.style,o.unit,o.unitDisplay,o.maximumSignificantDigits,n,t??"seconds"],"time",o,"en-US")(i.value)}var ny="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{};function nx(){if(o9)return o8;o9=1;let e=[{key:"ZiB",factor:11805916207174113e5},{key:"ZB",factor:1e21},{key:"YiB",factor:12089258196146292e8},{key:"YB",factor:1e24},{key:"TiB",factor:0x10000000000},{key:"TB",factor:1e12},{key:"PiB",factor:0x4000000000000},{key:"PB",factor:1e15},{key:"MiB",factor:1048576},{key:"MB",factor:1e6},{key:"KiB",factor:1024},{key:"KB",factor:1e3},{key:"GiB",factor:0x40000000},{key:"GB",factor:1e9},{key:"EiB",factor:0x1000000000000000},{key:"EB",factor:1e18},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}return o8={unformat:function(n,r){let i,o=nS(),s=o.currentDelimiters(),a=o.currentCurrency().symbol,l=o.currentOrdinal(),u=o.getZeroFormat(),c=o.currentAbbreviations();if("string"==typeof n)if(function(e,t){if(!(e.indexOf(":")&&":"!==t.thousands))return!1;let n=e.split(":");if(3!==n.length)return!1;let r=+n[0],i=+n[1],o=+n[2];return!isNaN(r)&&!isNaN(i)&&!isNaN(o)}(n,s)){let e,t,r;t=+(e=n.split(":"))[0],r=+e[1],i=+e[2]+60*r+3600*t}else i=function(n,r,i="",o,s,a){if(""!==n)return n===s?0:function n(r,i,o,s,a,l,u){if(!isNaN(+r))return+r;let c="",h=r.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(h!==r)return -1*n(h,i,o,s,a,l);for(let t=0;t<e.length;t++){let u=e[t];if((c=r.replace(RegExp(`([0-9 ])(${u.key})$`),"$1"))!==r)return n(c,i,o,s,a,l)*u.factor}if((c=r.replace("%",""))!==r)return n(c,i,o,s,a,l)/100;let d=parseFloat(r);if(isNaN(d))return;let f=s(d);if(f&&"."!==f&&(c=r.replace(RegExp(`${t(f)}$`),""))!==r)return n(c,i,o,s,a,l);let p={};Object.keys(l).forEach(e=>{p[l[e]]=e});let g=Object.keys(p).sort().reverse(),m=g.length;for(let e=0;e<m;e++){let t=g[e],u=p[t];if((c=r.replace(t,""))!==r){let e;switch(u){case"thousand":e=1e3;break;case"million":e=1e6;break;case"billion":e=1e9;break;case"trillion":e=1e12}return n(c,i,o,s,a,l)*e}}}(n.replace(i,"").replace(RegExp(`([0-9])${t(r.thousands)}([0-9])`,"g"),"$1$2").replace(r.decimal,"."),r,i,o,s,a)}(n,s,a,l,u,c);else{if("number"!=typeof n)return;i=n}if(void 0!==i)return i}}}function nb(){if(se)return o7;se=1;let e=nx(),t=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:(e,t)=>"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},r={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function i(t){return void 0!==e.unformat(t)}function o(e,t,r,i=!1){let s=Object.keys(e).map(i=>{if(!t[i])return console.error(`${r} Invalid key: ${i}`),!1;let s=e[i],a=t[i];if("string"==typeof a&&(a={type:a}),"format"===a.type){if(!o(s,n,`[Validate ${i}]`,!0))return!1}else if(typeof s!==a.type)return console.error(`${r} ${i} type mismatched: "${a.type}" expected, "${typeof s}" provided`),!1;if(a.restrictions&&a.restrictions.length){let t=a.restrictions.length;for(let n=0;n<t;n++){let{restriction:t,message:o}=a.restrictions[n];if(!t(s,e))return console.error(`${r} ${i} invalid value: ${o}`),!1}}return a.restriction&&!a.restriction(s,e)?(console.error(`${r} ${i} invalid value: ${a.message}`),!1):a.validValues&&-1===a.validValues.indexOf(s)?(console.error(`${r} ${i} invalid value: must be among ${JSON.stringify(a.validValues)}, "${s}" provided`),!1):(!a.children||!!o(s,a.children,`[Validate ${i}]`))&&!0});return i||s.push(...Object.keys(t).map(n=>{let i=t[n];if("string"==typeof i&&(i={type:i}),i.mandatory){let t=i.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[n])return console.error(`${r} Missing mandatory key "${n}"`),!1}return!0})),s.reduce((e,t)=>e&&t,!0)}function s(e){return o(e,n,"[Validate format]")}return o7={validate:function(e,t){let n=i(e),r=s(t);return n&&r},validateFormat:s,validateInput:i,validateLanguage:function(e){return o(e,r,"[Validate language]")}}}var nw=function(e,t={}){var n,r,i,o,s,a;let l,u,c,h,d;if("string"!=typeof e)return e;r=e=(l=(n=e).match(/^{([^}]*)}/))?(t.prefix=l[1],n.slice(l[0].length)):n,function(e,t){if(-1!==e.indexOf("$")){t.output="currency";return}if(-1!==e.indexOf("%")){t.output="percent";return}if(-1!==e.indexOf("bd")){t.output="byte",t.base="general";return}if(-1!==e.indexOf("b")){t.output="byte",t.base="binary";return}if(-1!==e.indexOf("d")){t.output="byte",t.base="decimal";return}if(-1!==e.indexOf(":")){t.output="time";return}-1!==e.indexOf("o")&&(t.output="ordinal")}(e=(u=r.match(/{([^}]*)}$/))?(t.postfix=u[1],r.slice(0,-u[0].length)):r,t),(c=e.match(/[1-9]+[0-9]*/))&&(t.totalLength=+c[0]),(h=e.split(".")[0].match(/0+/))&&(t.characteristic=h[0].length),-1!==(i=e).indexOf(".")&&(t.optionalCharacteristic=-1===i.split(".")[0].indexOf("0")),-1!==e.indexOf("a")&&(t.average=!0),-1!==(o=e).indexOf("K")?t.forceAverage="thousand":-1!==o.indexOf("M")?t.forceAverage="million":-1!==o.indexOf("B")?t.forceAverage="billion":-1!==o.indexOf("T")&&(t.forceAverage="trillion");let f=e.split(".")[1];if(f){let e=f.match(/0+/);e&&(t.mantissa=e[0].length)}return(s=e).match(/\[\.]/)?t.optionalMantissa=!0:s.match(/\./)&&(t.optionalMantissa=!1),(d=e.split(".")[1])&&(t.trimMantissa=-1!==d.indexOf("[")),-1!==e.indexOf(",")&&(t.thousandSeparated=!0),-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0)),(a=e).match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),a.match(/^\+?-/)&&(t.negative="sign"),e.match(/^\+/)&&(t.forceSign=!0),t};function nS(){let e;if(sn)return st;sn=1;let t=o6?o4:(o6=1,o4={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),n=nb(),r={},i={},o=null,s={};function a(){return i[e]}return r.languages=()=>Object.assign({},i),r.currentLanguage=()=>e,r.currentBytes=()=>a().bytes||{},r.currentCurrency=()=>a().currency,r.currentAbbreviations=()=>a().abbreviations,r.currentDelimiters=()=>a().delimiters,r.currentOrdinal=()=>a().ordinal,r.currentDefaults=()=>Object.assign({},a().defaults,s),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),a().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),a().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),a().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),a().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),a().timeFormat),r.setDefaults=e=>{e=nw(e),n.validateFormat(e)&&(s=e)},r.getZeroFormat=()=>o,r.setZeroFormat=e=>o="string"==typeof e?e:null,r.hasZeroFormat=()=>null!==o,r.languageData=e=>{if(e){if(i[e])return i[e];throw Error(`Unknown tag "${e}"`)}return a()},r.registerLanguage=(t,r=!1)=>{if(!n.validateLanguage(t))throw Error("Invalid language data");i[t.languageTag]=t,r&&(e=t.languageTag)},r.setLanguage=(n,r=t.languageTag)=>{if(!i[n]){let t=n.split("-")[0],o=Object.keys(i).find(e=>e.split("-")[0]===t);return i[o]?void(e=o):void(e=r)}e=n},r.registerLanguage(t),e=t.languageTag,st=r}var nC={exports:{}};(function(e){var t,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,i=Math.floor,o="[BigNumber Error] ",s=o+"Number primitive has more than 15 significant digits: ",a=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function l(e){var t=0|e;return e>0||e===t?t:t-1}function u(e){for(var t,n,r=1,i=e.length,o=e[0]+"";r<i;){for(n=14-(t=e[r++]+"").length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function c(e,t){var n,r,i=e.c,o=t.c,s=e.s,a=t.s,l=e.e,u=t.e;if(!s||!a)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=l==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return l>u^n?1:-1;for(s=0,a=(l=i.length)<(u=o.length)?l:u;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return l==u?0:l>u^n?1:-1}function h(e,t,n,r){if(e<t||e>n||e!==i(e))throw Error(o+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function d(e){var t=e.c.length-1;return l(e.e/14)==t&&e.c[t]%2!=0}function f(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function p(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(t=function e(t){var g,m,v,y,x,b,w,S,C,A=F.prototype={constructor:F,toString:null,valueOf:null},M=new F(1),k=20,T=4,I=-7,D=21,O=-1e7,E=1e7,_=!1,R=1,P=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function F(e,t){var r,o,a,l,u,c,d,f,p=this;if(!(p instanceof F))return new F(e,t);if(null==t){if(e&&!0===e._isBigNumber){p.s=e.s,!e.c||e.e>E?p.c=p.e=null:e.e<O?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice());return}if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,u=e;u>=10;u/=10,l++);l>E?p.c=p.e=null:(p.e=l,p.c=[e]);return}f=String(e)}else{if(!n.test(f=String(e)))return C(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(l=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(l<0&&(l=u),l+=+f.slice(u+1),f=f.substring(0,u)):l<0&&(l=f.length)}else{if(h(t,2,N.length,"Base"),10==t&&B)return H(p=new F(e),k+p.e+1,T);if(f=String(e),c="number"==typeof e){if(0*e!=0)return C(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,F.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(s+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=N.slice(0,t),l=u=0,d=f.length;u<d;u++)if(0>r.indexOf(o=f.charAt(u))){if("."==o){if(u>l){l=d;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,u=-1,l=0;continue}return C(p,String(e),c,t)}c=!1,(l=(f=S(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):l=f.length}for(u=0;48===f.charCodeAt(u);u++);for(d=f.length;48===f.charCodeAt(--d););if(f=f.slice(u,++d)){if(d-=u,c&&F.DEBUG&&d>15&&(e>0x1fffffffffffff||e!==i(e)))throw Error(s+p.s*e);if((l=l-u-1)>E)p.c=p.e=null;else if(l<O)p.c=[p.e=0];else{if(p.e=l,p.c=[],u=(l+1)%14,l<0&&(u+=14),u<d){for(u&&p.c.push(+f.slice(0,u)),d-=14;u<d;)p.c.push(+f.slice(u,u+=14));u=14-(f=f.slice(u)).length}else u-=d;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function j(e,t,n,r){var i,o,s,a,l;if(null==n?n=T:h(n,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)l=u(e.c),l=1==r||2==r&&(s<=I||s>=D)?f(l,s):p(l,s,"0");else if(o=(e=H(new F(e),t,n)).e,a=(l=u(e.c)).length,1==r||2==r&&(t<=o||o<=I)){for(;a<t;l+="0",a++);l=f(l,o)}else if(t-=s,l=p(l,o,"0"),o+1>a){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-a)>0)for(o+1==a&&(l+=".");t--;l+="0");return e.s<0&&i?"-"+l:l}function z(e,t){for(var n,r,i=1,o=new F(e[0]);i<e.length;i++)(r=new F(e[i])).s&&(n=c(o,r))!==t&&(0!==n||o.s!==t)||(o=r);return o}function V(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+14*n-1)>E?e.c=e.e=null:n<O?e.c=[e.e=0]:(e.e=n,e.c=t),e}function H(e,t,n,o){var s,l,u,c,h,d,f,p=e.c;if(p){e:{for(s=1,c=p[0];c>=10;c/=10,s++);if((l=t-s)<0)l+=14,u=t,f=i((h=p[d=0])/a[s-u-1]%10);else if((d=r((l+1)/14))>=p.length)if(o){for(;p.length<=d;p.push(0));h=f=0,s=1,l%=14,u=l-14+1}else break e;else{for(s=1,h=c=p[d];c>=10;c/=10,s++);l%=14,f=(u=l-14+s)<0?0:i(h/a[s-u-1]%10)}if(o=o||t<0||null!=p[d+1]||(u<0?h:h%a[s-u-1]),o=n<4?(f||o)&&(0==n||n==(e.s<0?3:2)):f>5||5==f&&(4==n||o||6==n&&(l>0?u>0?h/a[s-u]:0:p[d-1])%10&1||n==(e.s<0?8:7)),t<1||!p[0])return p.length=0,o?(t-=e.e+1,p[0]=a[(14-t%14)%14],e.e=-t||0):p[0]=e.e=0,e;if(0==l?(p.length=d,c=1,d--):(p.length=d+1,c=a[14-l],p[d]=u>0?i(h/a[s-u]%a[u])*c:0),o)for(;;)if(0==d){for(l=1,u=p[0];u>=10;u/=10,l++);for(u=p[0]+=c,c=1;u>=10;u/=10,c++);l!=c&&(e.e++,1e14==p[0]&&(p[0]=1));break}else{if(p[d]+=c,1e14!=p[d])break;p[d--]=0,c=1}for(l=p.length;0===p[--l];p.pop());}e.e>E?e.c=e.e=null:e.e<O&&(e.c=[e.e=0])}return e}function $(e){var t,n=e.e;return null===n?e.toString():(t=u(e.c),t=n<=I||n>=D?f(t,n):p(t,n,"0"),e.s<0?"-"+t:t)}return F.clone=e,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(h(n=e[t],0,1e9,t),k=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(h(n=e[t],0,8,t),T=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(h(n[0],-1e9,0,t),h(n[1],0,1e9,t),I=n[0],D=n[1]):(h(n,-1e9,1e9,t),I=-(D=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)h(n[0],-1e9,-1,t),h(n[1],1,1e9,t),O=n[0],E=n[1];else if(h(n,-1e9,1e9,t),n)O=-(E=n<0?-n:n);else throw Error(o+t+" cannot be zero: "+n);if(e.hasOwnProperty(t="CRYPTO"))if(!!(n=e[t])===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))_=n;else throw _=!n,Error(o+"crypto unavailable");else _=n;else throw Error(o+t+" not true or false: "+n);if(e.hasOwnProperty(t="MODULO_MODE")&&(h(n=e[t],0,9,t),R=n),e.hasOwnProperty(t="POW_PRECISION")&&(h(n=e[t],0,1e9,t),P=n),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(n=e[t]))L=n;else throw Error(o+t+" not an object: "+n);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);B="0123456789"==n.slice(0,10),N=n}}else throw Error(o+"Object expected: "+e);return{DECIMAL_PLACES:k,ROUNDING_MODE:T,EXPONENTIAL_AT:[I,D],RANGE:[O,E],CRYPTO:_,MODULO_MODE:R,POW_PRECISION:P,FORMAT:L,ALPHABET:N}},F.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!F.DEBUG)return!0;var t,n,r=e.c,s=e.e,a=e.s;e:if("[object Array]"==({}).toString.call(r)){if((1===a||-1===a)&&s>=-1e9&&s<=1e9&&s===i(s)){if(0===r[0]){if(0===s&&1===r.length)return!0;break e}if((t=(s+1)%14)<1&&(t+=14),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=1e14||n!==i(n))break e;if(0!==n)return!0}}}else if(null===r&&null===s&&(null===a||1===a||-1===a))return!0;throw Error(o+"Invalid BigNumber: "+e)},F.maximum=F.max=function(){return z(arguments,-1)},F.minimum=F.min=function(){return z(arguments,1)},g=0x20000000000000*Math.random()&2097151?function(){return i(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},F.random=function(e){var t,n,s,l,u,c=0,d=[],f=new F(M);if(null==e?e=k:h(e,0,1e9),l=r(e/14),_)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(l*=2));c<l;)(u=131072*t[c]+(t[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(d.push(u%1e14),c+=2);c=l/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(l*=7);c<l;)(u=(31&t[c])*0x1000000000000+0x10000000000*t[c+1]+0x100000000*t[c+2]+0x1000000*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(d.push(u%1e14),c+=7);c=l/7}else throw _=!1,Error(o+"crypto unavailable");if(!_)for(;c<l;)(u=g())<9e15&&(d[c++]=u%1e14);for(l=d[--c],e%=14,l&&e&&(u=a[14-e],d[c]=i(l/u)*u);0===d[c];d.pop(),c--);if(c<0)d=[s=0];else{for(s=-1;0===d[0];d.splice(0,1),s-=14);for(c=1,u=d[0];u>=10;u/=10,c++);c<14&&(s-=14-c)}return f.e=s,f.c=d,f},F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},S=function(){var e="0123456789";function t(e,t,n,r){for(var i,o,s=[0],a=0,l=e.length;a<l;){for(o=s.length;o--;s[o]*=t);for(s[0]+=r.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>n-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(n,r,i,o,s){var a,l,c,h,d,f,g,m,v=n.indexOf("."),y=k,x=T;for(v>=0&&(h=P,P=0,n=n.replace(".",""),f=(m=new F(r)).pow(n.length-v),P=h,m.c=t(p(u(f.c),f.e,"0"),10,i,e),m.e=m.c.length),c=h=(g=t(n,r,i,s?(a=N,e):(a=e,N))).length;0==g[--h];g.pop());if(!g[0])return a.charAt(0);if(v<0?--c:(f.c=g,f.e=c,f.s=o,g=(f=w(f,m,y,x,i)).c,d=f.r,c=f.e),v=g[l=c+y+1],h=i/2,d=d||l<0||null!=g[l+1],d=x<4?(null!=v||d)&&(0==x||x==(f.s<0?3:2)):v>h||v==h&&(4==x||d||6==x&&1&g[l-1]||x==(f.s<0?8:7)),l<1||!g[0])n=d?p(a.charAt(1),-y,a.charAt(0)):a.charAt(0);else{if(g.length=l,d)for(--i;++g[--l]>i;)g[l]=0,l||(++c,g=[1].concat(g));for(h=g.length;!g[--h];);for(v=0,n="";v<=h;n+=a.charAt(g[v++]));n=p(n,c,a.charAt(0))}return n}}(),w=function(){function e(e,t,n){var r,i,o,s,a=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)r=c*(o=e[l]%1e7)+(s=e[l]/1e7|0)*u,a=((i=u*o+r%1e7*1e7+a)/n|0)+(r/1e7|0)+c*s,e[l]=i%n;return a&&(e=[a].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,o,s,a,u){var c,h,d,f,p,g,m,v,y,x,b,w,S,C,A,M,k,T=r.s==o.s?1:-1,I=r.c,D=o.c;if(!I||!I[0]||!D||!D[0])return new F(!r.s||!o.s||(I?D&&I[0]==D[0]:!D)?NaN:I&&0==I[0]||!D?0*T:T/0);for(y=(v=new F(T)).c=[],T=s+(h=r.e-o.e)+1,u||(u=1e14,h=l(r.e/14)-l(o.e/14),T=T/14|0),d=0;D[d]==(I[d]||0);d++);if(D[d]>(I[d]||0)&&h--,T<0)y.push(1),f=!0;else{for(C=I.length,M=D.length,d=0,T+=2,(p=i(u/(D[0]+1)))>1&&(D=e(D,p,u),I=e(I,p,u),M=D.length,C=I.length),S=M,b=(x=I.slice(0,M)).length;b<M;x[b++]=0);k=[0].concat(k=D.slice()),A=D[0],D[1]>=u/2&&A++;do{if(p=0,(c=t(D,x,M,b))<0){if(w=x[0],M!=b&&(w=w*u+(x[1]||0)),(p=i(w/A))>1)for(p>=u&&(p=u-1),m=(g=e(D,p,u)).length,b=x.length;1==t(g,x,m,b);)p--,n(g,M<m?k:D,m,u),m=g.length,c=1;else 0==p&&(c=p=1),m=(g=D.slice()).length;if(m<b&&(g=[0].concat(g)),n(x,g,b,u),b=x.length,-1==c)for(;1>t(D,x,M,b);)p++,n(x,M<b?k:D,b,u),b=x.length}else 0===c&&(p++,x=[0]);y[d++]=p,x[0]?x[b++]=I[S]||0:(x=[I[S]],b=1)}while((S++<C||null!=x[0])&&T--);f=null!=x[0],y[0]||y.splice(0,1)}if(1e14==u){for(d=1,T=y[0];T>=10;T/=10,d++);H(v,s+(v.e=d+14*h-1)+1,a,f)}else v.e=h,v.r=+f;return v}}(),m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,y=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g,C=function(e,t,n,r){var i,s=n?t:t.replace(b,"");if(x.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(m,function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t}),r&&(i=r,s=s.replace(v,"$1").replace(y,"0.$1")),t!=s))return new F(s,i);if(F.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},A.absoluteValue=A.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},A.comparedTo=function(e,t){return c(this,new F(e,t))},A.decimalPlaces=A.dp=function(e,t){var n,r,i;if(null!=e)return h(e,0,1e9),null==t?t=T:h(t,0,8),H(new F(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((i=n.length-1)-l(this.e/14))*14,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},A.dividedBy=A.div=function(e,t){return w(this,new F(e,t),k,T)},A.dividedToIntegerBy=A.idiv=function(e,t){return w(this,new F(e,t),0,1)},A.exponentiatedBy=A.pow=function(e,t){var n,s,a,l,u,c,h,f,p,g=this;if((e=new F(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+$(e));if(null!=t&&(t=new F(t)),c=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return p=new F(Math.pow(+$(g),c?e.s*(2-d(e)):+$(e))),t?p.mod(t):p;if(h=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);(s=!h&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||c&&g.c[1]>=24e7:g.c[0]<8e13||c&&g.c[0]<=9999975e7)))return l=g.s<0&&d(e)?-0:0,g.e>-1&&(l=1/l),new F(h?1/l:l);P&&(l=r(P/14+2))}for(c?(n=new F(.5),h&&(e.s=1),f=d(e)):f=(a=Math.abs(+$(e)))%2,p=new F(M);;){if(f){if(!(p=p.times(g)).c)break;l?p.c.length>l&&(p.c.length=l):s&&(p=p.mod(t))}if(a){if(0===(a=i(a/2)))break;f=a%2}else if(H(e=e.times(n),e.e+1,1),e.e>14)f=d(e);else{if(0==(a=+$(e)))break;f=a%2}g=g.times(g),l?g.c&&g.c.length>l&&(g.c.length=l):s&&(g=g.mod(t))}return s?p:(h&&(p=M.div(p)),t?p.mod(t):l?H(p,P,T,u):p)},A.integerValue=function(e){var t=new F(this);return null==e?e=T:h(e,0,8),H(t,t.e+1,e)},A.isEqualTo=A.eq=function(e,t){return 0===c(this,new F(e,t))},A.isFinite=function(){return!!this.c},A.isGreaterThan=A.gt=function(e,t){return c(this,new F(e,t))>0},A.isGreaterThanOrEqualTo=A.gte=function(e,t){return 1===(t=c(this,new F(e,t)))||0===t},A.isInteger=function(){return!!this.c&&l(this.e/14)>this.c.length-2},A.isLessThan=A.lt=function(e,t){return 0>c(this,new F(e,t))},A.isLessThanOrEqualTo=A.lte=function(e,t){return -1===(t=c(this,new F(e,t)))||0===t},A.isNaN=function(){return!this.s},A.isNegative=function(){return this.s<0},A.isPositive=function(){return this.s>0},A.isZero=function(){return!!this.c&&0==this.c[0]},A.minus=function(e,t){var n,r,i,o,s=this.s;if(t=(e=new F(e,t)).s,!s||!t)return new F(NaN);if(s!=t)return e.s=-t,this.plus(e);var a=this.e/14,u=e.e/14,c=this.c,h=e.c;if(!a||!u){if(!c||!h)return c?(e.s=-t,e):new F(h?this:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new F(c[0]?this:3==T?-0:0)}if(a=l(a),u=l(u),c=c.slice(),s=a-u){for((o=s<0)?(s=-s,i=c):(u=a,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(o=(s=c.length)<(t=h.length))?s:t,s=t=0;t<r;t++)if(c[t]!=h[t]){o=c[t]<h[t];break}if(o&&(i=c,c=h,h=i,e.s=-e.s),(t=(r=h.length)-(n=c.length))>0)for(;t--;c[n++]=0);for(t=1e14-1;r>s;){if(c[--r]<h[r]){for(n=r;n&&!c[--n];c[n]=t);--c[n],c[r]+=1e14}c[r]-=h[r]}for(;0==c[0];c.splice(0,1),--u);return c[0]?V(e,c,u):(e.s=3==T?-1:1,e.c=[e.e=0],e)},A.modulo=A.mod=function(e,t){var n,r;return(e=new F(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==R?(r=e.s,e.s=1,n=w(this,e,0,3),e.s=r,n.s*=r):n=w(this,e,0,R),(e=this.minus(n.times(e))).c[0]||1!=R||(e.s=this.s),e):new F(this):new F(NaN)},A.multipliedBy=A.times=function(e,t){var n,r,i,o,s,a,u,c,h,d,f,p,g,m=this.c,v=(e=new F(e,t)).c;if(!m||!v||!m[0]||!v[0])return this.s&&e.s&&(!m||m[0]||v)&&(!v||v[0]||m)?(e.s*=this.s,m&&v?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(r=l(this.e/14)+l(e.e/14),e.s*=this.s,(u=m.length)<(d=v.length)&&(g=m,m=v,v=g,i=u,u=d,d=i),i=u+d,g=[];i--;g.push(0));for(i=d;--i>=0;){for(n=0,f=v[i]%1e7,p=v[i]/1e7|0,o=i+(s=u);o>i;)a=p*(c=m[--s]%1e7)+(h=m[s]/1e7|0)*f,n=((c=f*c+a%1e7*1e7+g[o]+n)/1e14|0)+(a/1e7|0)+p*h,g[o--]=c%1e14;g[o]=n}return n?++r:g.splice(0,1),V(e,g,r)},A.negated=function(){var e=new F(this);return e.s=-e.s||null,e},A.plus=function(e,t){var n,r=this.s;if(t=(e=new F(e,t)).s,!r||!t)return new F(NaN);if(r!=t)return e.s=-t,this.minus(e);var i=this.e/14,o=e.e/14,s=this.c,a=e.c;if(!i||!o){if(!s||!a)return new F(r/0);if(!s[0]||!a[0])return a[0]?e:new F(s[0]?this:0*r)}if(i=l(i),o=l(o),s=s.slice(),r=i-o){for(r>0?(o=i,n=a):(r=-r,n=s),n.reverse();r--;n.push(0));n.reverse()}for((r=s.length)-(t=a.length)<0&&(n=a,a=s,s=n,t=r),r=0;t;)r=(s[--t]=s[t]+a[t]+r)/1e14|0,s[t]=1e14===s[t]?0:s[t]%1e14;return r&&(s=[r].concat(s),++o),V(e,s,o)},A.precision=A.sd=function(e,t){var n,r,i;if(null!=e&&!!e!==e)return h(e,1,1e9),null==t?t=T:h(t,0,8),H(new F(this),e,t);if(!(n=this.c))return null;if(r=14*(i=n.length-1)+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},A.shiftedBy=function(e){return h(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},A.squareRoot=A.sqrt=function(){var e,t,n,r,i,o=this.c,s=this.s,a=this.e,c=k+4,h=new F("0.5");if(1!==s||!o||!o[0])return new F(!s||s<0&&(!o||o[0])?NaN:o?this:1/0);if(0==(s=Math.sqrt(+$(this)))||s==1/0?(((t=u(o)).length+a)%2==0&&(t+="0"),s=Math.sqrt(+t),a=l((a+1)/2)-(a<0||a%2),n=new F(t=s==1/0?"5e"+a:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+a)):n=new F(s+""),n.c[0]){for((s=(a=n.e)+c)<3&&(s=0);;)if(i=n,n=h.times(i.plus(w(this,i,c,1))),u(i.c).slice(0,s)===(t=u(n.c)).slice(0,s)){if(n.e<a&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+k+2,1),e=!n.times(n).eq(this));break}if(!r&&(H(i,i.e+k+2,0),i.times(i).eq(this))){n=i;break}c+=4,s+=4,r=1}}return H(n,n.e+k+1,T,e)},A.toExponential=function(e,t){return null!=e&&(h(e,0,1e9),e++),j(this,e,t,1)},A.toFixed=function(e,t){return null!=e&&(h(e,0,1e9),e=e+this.e+1),j(this,e,t)},A.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=L;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var i,s=r.split("."),a=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=s[0],h=s[1],d=this.s<0,f=d?c.slice(1):c,p=f.length;if(l&&(i=a,a=l,l=i,p-=i),a>0&&p>0){for(i=p%a||a,c=f.substr(0,i);i<p;i+=a)c+=u+f.substr(i,a);l>0&&(c+=u+f.slice(i)),d&&(c="-"+c)}r=h?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?h.replace(RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):c}return(n.prefix||"")+r+(n.suffix||"")},A.toFraction=function(e){var t,n,r,i,s,l,c,h,d,f,p,g,m=this.c;if(null!=e&&(!(c=new F(e)).isInteger()&&(c.c||1!==c.s)||c.lt(M)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+$(c));if(!m)return new F(this);for(t=new F(M),d=n=new F(M),r=h=new F(M),g=u(m),s=t.e=g.length-this.e-1,t.c[0]=a[(l=s%14)<0?14+l:l],e=!e||c.comparedTo(t)>0?s>0?t:d:c,l=E,E=1/0,c=new F(g),h.c[0]=0;f=w(c,t,0,1),1!=(i=n.plus(f.times(r))).comparedTo(e);)n=r,r=i,d=h.plus(f.times(i=d)),h=i,t=c.minus(f.times(i=t)),c=i;return i=w(e.minus(n),r,0,1),h=h.plus(i.times(d)),n=n.plus(i.times(r)),h.s=d.s=this.s,s*=2,p=1>w(d,r,s,T).minus(this).abs().comparedTo(w(h,n,s,T).minus(this).abs())?[d,r]:[h,n],E=l,p},A.toNumber=function(){return+$(this)},A.toPrecision=function(e,t){return null!=e&&h(e,1,1e9),j(this,e,t,2)},A.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=i<=I||i>=D?f(u(n.c),i):p(u(n.c),i,"0"):10===e&&B?t=p(u((n=H(new F(n),k+i+1,T)).c),n.e,"0"):(h(e,2,N.length,"Base"),t=S(p(u(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},A.valueOf=A.toJSON=function(){return $(this)},A._isBigNumber=!0,null!=t&&F.set(t),F}()).default=t.BigNumber=t,nC.exports?nC.exports=t:(e||(e="u">typeof self&&self?self:window),e.BigNumber=t)})(ny);var nA=nC.exports;let nM=nS(),nk=nb(),nT={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},nI={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:nD,decimalSuffixes:nO}=nM.currentBytes(),nE={scale:1024,suffixes:nO,marker:"bd"},n_={scale:1024,suffixes:nD,marker:"b"},nR={scale:1e3,suffixes:nO,marker:"d"};function nP(e,t,n){let r=t[0],i=Math.abs(e);if(i>=n){for(let o=1;o<t.length;++o){let s=Math.pow(n,o),a=Math.pow(n,o+1);if(i>=s&&i<a){r=t[o],e/=s;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function nL(e){let t="";for(let n=0;n<e;n++)t+="0";return t}function nN({instance:e,providedFormat:t,state:n=nM,decimalSeparator:r,defaults:i=n.currentDefaults()}){var o,s,a,l,u;let c,h,d,f,p,g,m,v=e._value;if(0===v&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(v))return v.toString();let y=Object.assign({},nI,i,t),x=y.totalLength,b=x?0:y.characteristic,w=y.optionalCharacteristic,S=y.forceAverage,C=y.lowPrecision,A=!!x||!!S||y.average,M=x?-1:A&&void 0===t.mantissa?0:y.mantissa,k=!x&&(void 0===t.optionalMantissa?-1===M:y.optionalMantissa),T=y.trimMantissa,I=y.thousandSeparated,D=y.spaceSeparated,O=y.negative,E=y.forceSign,_=y.exponential,R=y.roundingFunction,P="";if(A){let e=function({value:e,forceAverage:t,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(e),u=-1;if(t&&r[t]&&nT[t]?(a=r[t],e/=nT[t]):l>=nT.trillion||n&&1===s(l/nT.trillion)?(a=r.trillion,e/=nT.trillion):l<nT.trillion&&l>=nT.billion||n&&1===s(l/nT.billion)?(a=r.billion,e/=nT.billion):l<nT.billion&&l>=nT.million||n&&1===s(l/nT.million)?(a=r.million,e/=nT.million):(l<nT.million&&l>=nT.thousand||n&&1===s(l/nT.thousand))&&(a=r.thousand,e/=nT.thousand),a&&(a=(i?" ":"")+a),o){let t=e<0,n=e.toString().split(".")[0];u=Math.max(o-(t?n.length-1:n.length),0)}return{value:e,abbreviation:a,mantissaPrecision:u}}({value:v,forceAverage:S,lowPrecision:C,abbreviations:n.currentAbbreviations(),spaceSeparated:D,roundingFunction:R,totalLength:x});v=e.value,P+=e.abbreviation,x&&(M=e.mantissaPrecision)}if(_){let e=function({value:e,characteristicPrecision:t}){let[n,r]=e.toExponential().split("e"),i=+n;return t&&1<t&&(i*=Math.pow(10,t-1),r-=t-1,r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}({value:v,characteristicPrecision:b});v=e.value,P=e.abbreviation+P}let L=function(e,t,n,r,i,o){if(-1===r)return e;let s=function(e,t,n=Math.round){return -1!==e.toString().indexOf("e")?function(e,t){let n=e.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+nL(i-s.length);else{let e=".";e=0>+o?`-0${e}`:`0${e}`;let r=(nL(-i-1)+Math.abs(o)+s).substr(0,t);r.length<t&&(r+=nL(t-r.length)),n=e+r}return+i>0&&t>0&&(n+=`.${nL(t)}`),n}(e,t):new nA(n(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}(t,r,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(n||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}(v.toString(),v,k,M,T,R);return o=L=function(e,t,n,r){let i=e,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&n)return s?`${o.replace("0","")}.${s}`:o.replace("0","");let a=t<0&&0===o.indexOf("-");if(a&&(o=o.slice(1),i=i.slice(1)),o.length<r){let e=r-o.length;for(let t=0;t<e;t++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}(L,v,w,b),s=v,a=r,h=(c=n.currentDelimiters()).thousands,a=a||c.decimal,d=c.thousandsSize||3,p=(f=o.toString()).split(".")[0],g=f.split(".")[1],m=s<0&&0===p.indexOf("-"),I&&(m&&(p=p.slice(1)),(function(e,t){let n=[],r=0;for(let i=e;i>0;i--)r===t&&(n.unshift(i),r=0),r++;return n})(p.length,d).forEach((e,t)=>{p=p.slice(0,e+t)+h+p.slice(e+t)}),m&&(p=`-${p}`)),L=f=g?p+a+g:p,(A||_)&&(L+=P),(E||v<0)&&(l=L,L=0===(u=v)?l:0==+l?l.replace("-",""):u>0?`+${l}`:"sign"===O?l:`(${l.replace("-","")})`),L}function nB(e,t){if(!e)return t;let n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}function nF(e,t,n){let r=new nA(e._value),i=t;return n.isNumbro(t)&&(i=t._value),i=new nA(i),e._value=r.minus(i).toNumber(),e}let nj=nS(),nz=nb(),nV={loadLanguagesInNode:e=>{e.forEach(e=>{let t;try{t=function(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}t&&nq.registerLanguage(t)})}},nH=nx(),n$={format:(...e)=>(function(e,t={},n){if("string"==typeof t&&(t=nw(t)),!nk.validateFormat(t))return"ERROR: invalid format";let r=t.prefix||"",i=t.postfix||"",o=function(e,t,n){var r,i,o;switch(t.output){case"currency":let s,a,l,u,c,h,d,f,p,g;return r=t=nB(t,nM.currentCurrencyDefaultFormat()),s=nM.currentCurrency(),l=Object.assign({},nI,a=Object.assign({},r)),c="",h=!!l.totalLength||!!l.forceAverage||l.average,d=a.currencyPosition||s.position,f=a.currencySymbol||s.symbol,p=void 0!==l.spaceSeparatedCurrency?l.spaceSeparatedCurrency:l.spaceSeparated,void 0===a.lowPrecision&&(a.lowPrecision=!1),p&&(c=" "),"infix"===d&&(u=c+f+c),g=nN({instance:e,providedFormat:a,state:nM,decimalSeparator:u}),"prefix"===d&&(g=e._value<0&&"sign"===l.negative?`-${c}${f}${g.slice(1)}`:e._value>0&&l.forceSign?`+${c}${f}${g.slice(1)}`:f+c+g),d&&"postfix"!==d||(g=g+(c=!l.spaceSeparatedAbbreviation&&h?"":c)+f),g;case"percent":let m,v,y;return i=t=nB(t,nM.currentPercentageDefaultFormat()),m=i.prefixSymbol,v=nN({instance:n(100*e._value),providedFormat:i,state:nM}),y=Object.assign({},nI,i),m?`%${y.spaceSeparated?" ":""}${v}`:`${v}${y.spaceSeparated?" ":""}%`;case"byte":return function(e,t,n,r){let i=t.base||"binary",o=Object.assign({},nI,t),{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes(),l={general:{scale:1024,suffixes:a||nO,marker:"bd"},binary:{scale:1024,suffixes:s||nD,marker:"b"},decimal:{scale:1e3,suffixes:a||nO,marker:"d"}}[i],{value:u,suffix:c}=nP(e._value,l.suffixes,l.scale),h=nN({instance:r(u),providedFormat:t,state:n,defaults:n.currentByteDefaultFormat()});return`${h}${o.spaceSeparated?" ":""}${c}`}(e,t=nB(t,nM.currentByteDefaultFormat()),nM,n);case"time":let x,b,w;return t=nB(t,nM.currentTimeDefaultFormat()),x=Math.floor(e._value/60/60),b=Math.floor((e._value-60*x*60)/60),w=Math.round(e._value-60*x*60-60*b),`${x}:${b<10?"0":""}${b}:${w<10?"0":""}${w}`;case"ordinal":let S,C,A,M;return o=t=nB(t,nM.currentOrdinalDefaultFormat()),S=nM.currentOrdinal(),C=Object.assign({},nI,o),A=nN({instance:e,providedFormat:o,state:nM}),M=S(e._value),`${A}${C.spaceSeparated?" ":""}${M}`;default:return nN({instance:e,providedFormat:t,numbro:n})}}(e,t,n);return(o=r+o)+i})(...e,nq),getByteUnit:(...e)=>(function(e){return nP(e._value,nE.suffixes,nE.scale).suffix})(...e),getBinaryByteUnit:(...e)=>(function(e){return nP(e._value,n_.suffixes,n_.scale).suffix})(...e),getDecimalByteUnit:(...e)=>(function(e){return nP(e._value,nR.suffixes,nR.scale).suffix})(...e),formatOrDefault:nB},nW={add:(e,t)=>{let n,r;return n=new nA(e._value),r=t,nq.isNumbro(t)&&(r=t._value),r=new nA(r),e._value=n.plus(r).toNumber(),e},subtract:(e,t)=>nF(e,t,nq),multiply:(e,t)=>{let n,r;return n=new nA(e._value),r=t,nq.isNumbro(t)&&(r=t._value),r=new nA(r),e._value=n.times(r).toNumber(),e},divide:(e,t)=>{let n,r;return n=new nA(e._value),r=t,nq.isNumbro(t)&&(r=t._value),r=new nA(r),e._value=n.dividedBy(r).toNumber(),e},set:(e,t)=>{let n;return n=t,nq.isNumbro(t)&&(n=t._value),e._value=n,e},difference:(e,t)=>{let n;return nF(n=nq(e._value),t,nq),Math.abs(n._value)},BigNumber:nA};class nG{constructor(e){this._value=e}clone(){return nq(this._value)}format(e={}){return n$.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=nw(e)),(e=n$.formatOrDefault(e,nj.currentCurrencyDefaultFormat())).output="currency",n$.format(this,e)}formatTime(e={}){return e.output="time",n$.format(this,e)}binaryByteUnits(){return n$.getBinaryByteUnit(this)}decimalByteUnits(){return n$.getDecimalByteUnit(this)}byteUnits(){return n$.getByteUnit(this)}difference(e){return nW.difference(this,e)}add(e){return nW.add(this,e)}subtract(e){return nW.subtract(this,e)}multiply(e){return nW.multiply(this,e)}divide(e){return nW.divide(this,e)}set(e){return nW.set(this,nU(e))}value(){return this._value}valueOf(){return this._value}}function nU(e){let t=e;return nq.isNumbro(e)?t=e._value:"string"==typeof e?t=nq.unformat(e):isNaN(e)&&(t=NaN),t}function nq(e){return new nG(nU(e))}nq.version="2.5.0",nq.isNumbro=function(e){return e instanceof nG},nq.language=nj.currentLanguage,nq.registerLanguage=nj.registerLanguage,nq.setLanguage=nj.setLanguage,nq.languages=nj.languages,nq.languageData=nj.languageData,nq.zeroFormat=nj.setZeroFormat,nq.defaultFormat=nj.currentDefaults,nq.setDefaults=nj.setDefaults,nq.defaultCurrencyFormat=nj.currentCurrencyDefaultFormat,nq.validate=nz.validate,nq.loadLanguagesInNode=nV.loadLanguagesInNode,nq.unformat=nH.unformat,nq.BigNumber=nW.BigNumber;var nY=nq&&nq.__esModule&&Object.prototype.hasOwnProperty.call(nq,"default")?nq.default:nq;let nZ={label:"Bits",decimalPlaces:!0,shortValues:!0},nK={bits:{group:"Bits",label:"Bits (IEC)"},decbits:{group:"Bits",label:"Bits (SI)"}};function nX(e,{unit:t="bits",shortValues:n,decimalPlaces:r}){let i="decbits"===t;if(!nl(n)||Math.abs(e)<(i?1e3:1024)){let i={style:"decimal",useGrouping:!0};nu(r)?(i.minimumFractionDigits=nc(r),i.maximumFractionDigits=nc(r)):nl(n)&&(i.maximumSignificantDigits=3);let o=[i.style,i.useGrouping,i.maximumSignificantDigits,r,n,t];return`${ns(o,"bits",i,"en-US")(e)} bits`}return nY(e).format({output:"byte",base:i?"decimal":"binary",spaceSeparated:!0,mantissa:nu(r)?r:2,trimMantissa:!nu(r),optionalMantissa:!nu(r)}).replace(/KB/g,"Kb").replace(/MB/g,"Mb").replace(/GB/g,"Gb").replace(/TB/g,"Tb").replace(/PB/g,"Pb").replace(/EB/g,"Eb").replace(/KiB/g,"Kib").replace(/MiB/g,"Mib").replace(/GiB/g,"Gib").replace(/TiB/g,"Tib").replace(/PiB/g,"Pib").replace(/EiB/g,"Eib")}let nJ={label:"Bytes",decimalPlaces:!0,shortValues:!0},nQ={bytes:{group:"Bytes",label:"Bytes (IEC)"},decbytes:{group:"Bytes",label:"Bytes (SI)"}};function n0(e,{unit:t="bytes",shortValues:n,decimalPlaces:r}){let i="decbytes"===t;if(!nl(n)||Math.abs(e)<(i?1e3:1024)){let i={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return nu(r)?(i.minimumFractionDigits=nc(r),i.maximumFractionDigits=nc(r)):nl(n)&&(i.maximumSignificantDigits=3),ns([i.style,i.unit,i.unitDisplay,i.useGrouping,i.maximumSignificantDigits,r,n,t],"bytes",i,"en-US")(e)}return nY(e).format({output:"byte",base:i?"decimal":"binary",spaceSeparated:!0,mantissa:nu(r)?r:2,trimMantissa:!nu(r),optionalMantissa:!nu(r)})}var n1=n(40224);let n2="Currency",n5={label:"Currency",decimalPlaces:!0},n3={aud:{group:n2,label:"Australian Dollar (A$)"},cad:{group:n2,label:"Canadian Dollar (CA$)"},chf:{group:n2,label:"Swiss Franc (CHF)"},cny:{group:n2,label:"Renminbi (CN\xa5)"},eur:{group:n2,label:"Euro (€)"},gbp:{group:n2,label:"Pound (\xa3)"},hkd:{group:n2,label:"Hong Kong Dollar (HK$)"},inr:{group:n2,label:"Indian Rupee (₹)"},jpy:{group:n2,label:"Yen (\xa5)"},krw:{group:n2,label:"South Korean Won (₩)"},nok:{group:n2,label:"Norwegian Krone (NOK)"},nzd:{group:n2,label:"New Zealand Dollar (NZ$)"},sek:{group:n2,label:"Swedish Krona (SEK)"},sgd:{group:n2,label:"Singapore Dollar (S$)"},usd:{group:n2,label:"US Dollar ($)"}};function n4(e,{unit:t,decimalPlaces:n}){let r={style:"currency",currency:(0,n1.toUpper)(t),currencyDisplay:"symbol"};return nu(n)?(r.minimumFractionDigits=nc(n),r.maximumFractionDigits=nc(n)):r.maximumSignificantDigits=3,ns([r.style,r.currency,r.currencyDisplay,r.maximumSignificantDigits,n,t],"currency",r,"en-US")(e)}let n6={label:"percent",decimalPlaces:!0},n8="Percent",n9={percent:{group:n8,label:"Percent (0-100)"},"percent-decimal":{group:n8,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:n8,label:"%"}};function n7(e,{unit:t,decimalPlaces:n}){let r={style:"percent",useGrouping:!0};return nu(n)?(r.minimumFractionDigits=nc(n),r.maximumFractionDigits=nc(n)):r.maximumSignificantDigits=3,"percent"===t&&(e/=100),ns([r.style,r.useGrouping,r.maximumSignificantDigits,n,t],"percent",r,"en-US")(e)}let re="Temperature",rt={label:re,decimalPlaces:!0},rn={celsius:{group:re,label:"Celsius (\xb0C)"},fahrenheit:{group:re,label:"Fahrenheit (\xb0F)"}},rr=(e,{unit:t,decimalPlaces:n})=>{let r={unit:t,style:"unit"};nu(n)?(r.minimumFractionDigits=nc(n),r.maximumFractionDigits=nc(n)):r.maximumSignificantDigits=3;let i="celsius"===t?"en-GB":"en-US";return ns([r.style,r.unit,r.maximumSignificantDigits,n,i],"temperature",r,i)(e)},ri={label:"Decimal",decimalPlaces:!0,shortValues:!0},ro={decimal:{group:"Decimal",label:"Decimal"}};function rs(e,{shortValues:t,decimalPlaces:n}){let r={style:"decimal",useGrouping:!0};return nl(t)&&(r.notation="compact"),nu(n)?(r.minimumFractionDigits=nc(n),r.maximumFractionDigits=nc(n)):nl(t)&&(r.maximumSignificantDigits=3),ns([r.style,r.useGrouping,r.notation,r.maximumSignificantDigits,n],"decimal",r,"en-US")(e)}let ra={label:"Throughput",decimalPlaces:!0},rl="Throughput",ru={"bits/sec":{group:rl,label:"Bits/sec (IEC)"},"decbits/sec":{group:rl,label:"Bits/sec (SI)"},"bytes/sec":{group:rl,label:"Bytes/sec (IEC)"},"decbytes/sec":{group:rl,label:"Bytes/sec (SI)"},"counts/sec":{group:rl,label:"Counts/sec"},"events/sec":{group:rl,label:"Events/sec"},"messages/sec":{group:rl,label:"Messages/sec"},"ops/sec":{group:rl,label:"Ops/sec"},"packets/sec":{group:rl,label:"Packets/sec"},"reads/sec":{group:rl,label:"Reads/sec"},"requests/sec":{group:rl,label:"Requests/sec"},"records/sec":{group:rl,label:"Records/sec"},"rows/sec":{group:rl,label:"Rows/sec"},"writes/sec":{group:rl,label:"Writes/sec"}};function rc(e,{unit:t,shortValues:n,decimalPlaces:r}){if("bits/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return nX(e,{unit:"bits",shortValues:n,decimalPlaces:r})+"/"+t}if("decbits/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return nX(e,{unit:"decbits",shortValues:n,decimalPlaces:r})+"/"+t}if("decbytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return n0(e,{unit:"decbytes",shortValues:n,decimalPlaces:r})+"/"+t}if("bytes/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return n0(e,{unit:"bytes",shortValues:n,decimalPlaces:r})+"/"+t}let i={style:"decimal",useGrouping:!0};nl(n)&&(i.notation="compact"),nu(r)?(i.minimumFractionDigits=nc(r),i.maximumFractionDigits=nc(r)):nl(n)&&(i.maximumSignificantDigits=3);let o=[i.style,i.useGrouping,i.notation,i.maximumSignificantDigits,r,n,t];return`${ns(o,"throughput",i,"en-US")(e)} ${t}`}let rh="Date",rd={Time:nd,Percent:n6,Decimal:ri,Bytes:nJ,Bits:nZ,Throughput:ra,Currency:n5,Temperature:rt,Date:{label:"Date & Time"}},rf={...nf,...n9,...ro,...nQ,...nK,...ru,...n3,...rn,"datetime-iso":{group:rh,label:"DateTime (GMT)"},"datetime-us":{group:rh,label:"DateTime (US-East)"},"datetime-local":{group:rh,label:"DateTime (Browser Local)"},"date-iso":{group:rh,label:"Date (GMT)"},"date-us":{group:rh,label:"Date (US-East)"},"date-local":{group:rh,label:"Date (Browser Local)"},"time-local":{group:rh,label:"Time (Browser Local)"},"time-iso":{group:rh,label:"Time (GMT)"},"time-us":{group:rh,label:"Time (US-East)"},"relative-time":{group:rh,label:"Relative Time"},"unix-timestamp":{group:rh,label:"Unix Timestamp (s)"},"unix-timestamp-ms":{group:rh,label:"Unix Timestamp (ms)"}};function rp(e,t){if(!t)return e.toString();if(rw(t))return n0(e,t);if(rS(t))return nX(e,t);if(rb(t))return rs(e,t);if(rx(t))return n7(e,t);if(ry(t))return nv(e,t);if(rM(t))return rc(e,t);if(rk(t))return n4(e,t);if(rT(t))return function(e,t={}){let n=Intl.DateTimeFormat().resolvedOptions().timeZone,{unit:r="datetime-local",locale:i=(()=>{if("u">typeof navigator){if(navigator.language)return navigator.language;if(navigator.languages&&navigator.languages.length>0){let e=navigator.languages[0];if(e)return e}let e=navigator;if(e.userLanguage)return e.userLanguage;if(e.browserLanguage)return e.browserLanguage;if(e.systemLanguage)return e.systemLanguage}return Intl.DateTimeFormat().resolvedOptions().locale||"en-US"})(),timeZone:o=n,referenceTime:s=Date.now()}=t;if("unix-timestamp"===r)return(e>1e12?Math.floor(e/1e3):e).toString();if("unix-timestamp-ms"===r)return Math.floor(e<1e11?1e3*e:e).toString();let a=function(e){if(e<0)if(Math.abs(e)>1e10)return new Date(e);else return new Date(1e3*e);if(e>=25e10&&e<=26e10){let t=new Date(1e3*e);if(t.getUTCFullYear()>=9999)return t}return new Date(e<1e10?1e3*e:e)}(e);if("relative-time"===r){let e=new Date(s),t=a.getTime()-e.getTime();for(let{unit:e,ms:n}of[{unit:"year",ms:31536e6},{unit:"month",ms:2592e6},{unit:"week",ms:6048e5},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}]){let r=Math.round(t/n);if(Math.abs(r)>=1)return new Intl.RelativeTimeFormat(i,{numeric:"auto"}).format(r,e)}return new Intl.RelativeTimeFormat(i,{numeric:"auto"}).format(0,"second")}let l={timeZone:o};switch(r){case"datetime-iso":return a.toISOString();case"datetime-us":return l.timeZone="America/New_York",l.year="numeric",l.month="2-digit",l.day="2-digit",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!0,new Intl.DateTimeFormat("en-US",l).format(a);case"datetime-local":l.year="numeric",l.month="2-digit",l.day="2-digit",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!1;break;case"date-iso":return a.toISOString().split("T")[0];case"date-us":return l.timeZone="America/New_York",l.year="numeric",l.month="2-digit",l.day="2-digit",new Intl.DateTimeFormat("en-US",l).format(a);case"date-local":l.year="numeric",l.month="2-digit",l.day="2-digit";break;case"time-local":l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!1;break;case"time-iso":return a.toISOString().split("T")[1].replace("Z","");case"time-us":return l.timeZone="America/New_York",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!0,new Intl.DateTimeFormat("en-US",l).format(a);default:throw Error(`Unknown date unit: ${r}`)}return new Intl.DateTimeFormat(i,l).format(a)}(e,t);if(rI(t))return rr(e,t);throw Error(`Unknown unit options ${t}`)}function rg(e){return rf[e.unit??"decimal"]}function rm(e){return rg(e).group??"Decimal"}function rv(e){return rd[rg(e).group??"Decimal"]}function ry(e){return"Time"===rm(e)}function rx(e){return"Percent"===rm(e)}function rb(e){return"Decimal"===rm(e)}function rw(e){return"Bytes"===rm(e)}function rS(e){return"Bits"===rm(e)}function rC(e){return!!rv(e).decimalPlaces}function rA(e){return!!rv(e).shortValues}function rM(e){return"Throughput"===rm(e)}function rk(e){return"Currency"===rm(e)}function rT(e){return"Date"===rm(e)}function rI(e){return"Temperature"===rm(e)}let rD={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series",ExtractColumnFields:"Extract column fields"};function rO(e,t){return[tK({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>rp(e,t)}},e)]}function rE(e,t,n,r){let i=[],o=tK({type:"value",position:"left",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>rp(e,t),overflow:"truncate"}},e);i.push(o);let s=0;return n.forEach((t,n)=>{let o,a,l={type:"value",position:"right",offset:s,boundaryGap:[0,"10%"],axisLabel:{formatter:e=>rp(e,t)},splitLine:{show:!1},show:e?.show};i.push(l),r&&(s+=(o=rp(r[n]??1e3,t),((a=document.createElement("canvas").getContext("2d"))?(a.font="12px sans-serif",a.measureText(o).width):6*o.length)+10))}),i}function r_(e,t){let{value:n,setValueAndStore:r}=function(e,t,n){let[r,i]=(0,w.useState)(()=>{try{let n=e.getItem(t);if(null!==n)return JSON.parse(n)}catch{}return e.setItem(t,JSON.stringify(n)),n}),o=(0,w.useCallback)(n=>{i(n),e.setItem(t,JSON.stringify(n))},[i,e,t]);return{value:r,setValue:i,setValueAndStore:o}}(window.localStorage,e,t);return[n,r]}function rR(e){let t=e._model;void 0!==t&&void 0!==t.option.toolbox&&t.option.toolbox.length>0&&"normal"===t.option.toolbox[0].feature.dataZoom.iconStatus.zoom&&e.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})}function rP(e){e.dispatchAction({type:"restore"})}function rL(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function rN(e,t,n){if(void 0===n)return null;let r=[e,t];return n.containPixel("grid",r)?n.convertFromPixel("grid",r):null}function rB(e,t,n,r,i,o){let s=o.length>0?o[o.length-1]:i[i.length-1];void 0!==s&&e.dispatchAction({type:"select",seriesIndex:s.seriesIndex,dataIndex:s.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay"}),r.length>0&&e.dispatchAction({type:"downplay",seriesIndex:r}),n.length>0?e.dispatchAction({type:"highlight",seriesIndex:n,notBlur:!1,escapeConnect:!0}):(e.dispatchAction({type:"highlight",seriesIndex:t,notBlur:!0,escapeConnect:!0}),e.dispatchAction({type:"toggleSelect"}))}function rF(e){return e[e.length-1]?.name===tX}function rj(e,t){if(void 0===e||void 0===t)return null;let n=null,r=1/0;for(let[i]of e){let e=Math.abs(i-t);e<r&&(n=i,r=e)}return n}function rz(e,t){if(void 0===t)return null;let n=e.length,r=null;for(let i=0;i<n;i++){let o=n>0?e[i]:null;if(!o)break;r=rj(o.values,t)}return r}function rV(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}function rH(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,w.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var r$=((oJ={}).CSV="csv",oJ.DISTRIBUTED="distributed",oJ.DOUBLEQUOTE="doublequote",oJ.GLOB="glob",oJ.JSON="json",oJ.LUCENE="lucene",oJ.PERCENTENCODE="percentencode",oJ.PIPE="pipe",oJ.PROMETHEUS="prometheus",oJ.RAW="raw",oJ.REGEX="regex",oJ.SINGLEQUOTE="singlequote",oJ.SQLSTRING="sqlstring",oJ.TEXT="text",oJ.QUERYPARAM="queryparam",oJ.REGEX_LITERAL="regexliteral",oJ);function rW(e){if(!e)return;let t=e.toLowerCase();return Object.values(r$).find(e=>e===t)||void 0}function rG(e,t,n){switch(n){case"csv":case"raw":return e.join(",");case"distributed":{let[n,...r]=e;return`${[n,...r.map(e=>`${t}=${e}`)].join(",")}`}case"doublequote":return e.map(e=>`"${e}"`).join(",");case"glob":return`{${e.join(",")}}`;case"json":return JSON.stringify(e.map(e=>{try{return JSON.parse(e)}catch{return e}}));case"lucene":return`(${e.map(e=>`"${e}"`).join(" OR ")})`;case"percentencode":return encodeURIComponent(e.join(","));case"pipe":return e.join("|");case"regex":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));return`(${t.join("|")})`}case"regexliteral":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\\\$&"));return`(${t.join("|")})`}case"singlequote":return e.map(e=>`'${e}'`).join(",");case"sqlstring":return e.map(e=>`'${e.replace(/'/g,"''")}'`).join(",");case"text":return e.join(" + ");case"queryparam":return e.map(e=>`${t}=${encodeURIComponent(e)}`).join("&");default:return`(${e.join("|")})`}}function rU(e,t,n,r){let i="$"+t,o="${"+t+(r?":"+r:"")+"}",s="";return Array.isArray(n)&&(s=rG(n,t,r||"prometheus")),"string"==typeof n&&(s=rG([n],t,r||"raw")),(e=e.replaceAll(i,s)).replaceAll(o,s)}let rq=/\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;function rY(e){let t,n=new Set;for(;null!==(t=rq.exec(e));)t&&(t[1]?n.add(t[1]):t[2]&&n.add(t[2]));return Array.from(n.values())}function rZ(e){let t,n=new Map;for(;null!==(t=rq.exec(e));)if(t){let e;t[4]&&(e=t[4]),t[1]?n.set(t[1],rW(e)):t[2]&&n.set(t[2],rW(e))}return n}function rK(e,t){let n=rZ(e),r=Array.from(n.keys()),i=e;return r.sort((e,t)=>t.length-e.length).forEach(e=>{let r=t[e];r&&void 0!==r.value&&(i=rU(i,e,r?.value,n.get(e)))}),i}function rX(e,t){let n={};for(let[e,r]of Object.entries(t))n[e]=void 0===r.displayValue?r:{...r,value:r.displayValue};return rK(e,n)}let rJ=/\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g,rQ=/\$\{__data\[(\d+)\]\.fields\[(?:"|')([^"']+)(?:"|')\]\}/g,r0=/\$\{__data\.index\}/g,r1=/\$\{__data\.count\}/g,r2=/("|')?\$\{__data(?::([a-z]+))?\}("|')?/g;function r5(e,t){if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];return null==n?"":"object"==typeof n?JSON.stringify(n):String(n)}if(t.includes(".")){let n=t.split("."),r=e;for(let e of n){if(null==r||"object"!=typeof r)return"";r=r[e]}return null==r?"":"object"==typeof r?JSON.stringify(r):String(r)}return""}function r3(e){if(!e)return;let t=e.toLowerCase();return Object.values(r$).find(e=>e===t)}function r4(e,t,n={}){let{urlEncode:r=!0,index:i,count:o}=n,s=e,a=[];return void 0!==i&&(s=s.replaceAll(r0,String(i))),void 0!==o&&(s=s.replaceAll(r1,String(o))),s=s.replaceAll(r2,(e,n,r,i)=>{let o=r3(r)??r$.RAW;return o===r$.JSON?JSON.stringify(t):rG(Object.values(t).map(e=>JSON.stringify(e)),"",o)}),rJ.lastIndex=0,{text:s=s.replaceAll(rJ,(e,n,i,o)=>{let s=n??i??"",l=r5(t,s);""===l&&void 0===t[s]&&a.push(`Field "${s}" not found in data`);let u=r3(o);if(u)return rG([l],s,u);if(r){if(u===r$.RAW)return l;if(u!==r$.QUERYPARAM&&u!==r$.PERCENTENCODE)return encodeURIComponent(l)}return l}),errors:a.length>0?a:void 0}}function r6(e,t,n={}){let{urlEncode:r=!0}=n,i=e,o=[];return i=i.replaceAll(r1,String(t.length)),rQ.lastIndex=0,rJ.lastIndex=0,{text:i=(i=(i=i.replaceAll(r2,(e,n,r,i)=>{let o=r3(r)??r$.RAW,s=rG(Object.values(t).map(e=>JSON.stringify(e)),"",o);return n&&i?s:`${n??""}${s}${i??""}`})).replaceAll(rQ,(e,n,i)=>{let s=parseInt(n,10);if(s<0||s>=t.length)return o.push(`Index ${s} out of bounds (0-${t.length-1})`),e;let a=r5(t[s],i);return""===a&&void 0===t[s][i]&&o.push(`Field "${i}" not found in data at index ${s}`),r?encodeURIComponent(a):a})).replaceAll(rJ,(e,n,r,i)=>{let o=n??r??"";return rG(t.map(e=>r5(e,o)),o,r3(i)||r$.CSV)}),errors:o.length>0?o:void 0}}function r8(e){return rQ.lastIndex=0,rQ.test(e)||/\$\{__data\.fields(?:\[["'][^"']+["']\]|\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\}/.test(e)}function r9(e){return rQ.lastIndex=0,rQ.test(e)}function r7(e){return rJ.lastIndex=0,rQ.lastIndex=0,rJ.test(e)||rQ.test(e)}function ie(e){let t,n=new Set;for(rJ.lastIndex=0,rQ.lastIndex=0;null!==(t=rJ.exec(e));)n.add(t[1]??t[2]);for(;null!==(t=rQ.exec(e));)n.add(t[2]);return Array.from(n)}Symbol.for("constructDateFrom");let it={},ir={};function ii(e,t){try{let n=(it[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];if(n in ir)return ir[n];return is(n,n.split(":"))}catch{if(e in ir)return ir[e];let t=e?.match(io);if(t)return is(e,t.slice(1));return NaN}}let io=/([+-]\d\d):?(\d\d)?/;function is(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return ir[e]=60*n+r>0?60*n+r+i:60*n-r-i}class ia extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ii(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),ic(this,e)):this.setTime(Date.now())}static tz(e,...t){return t.length?new ia(...t,e):new ia(Date.now(),e)}withTimeZone(e){return new ia(+this,e)}getTimezoneOffset(){let e=-ii(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),iu(this),+this}[Symbol.for("constructDateFrom")](e){return new ia(+new Date(e),this.timeZone)}}let il=/^(get|set)(?!UTC)/;function iu(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(60*ii(e.timeZone,e))))}function ic(e,t){var n;let r=Array.isArray(t)?Date.UTC((n=t)[0],n.length>1?n[1]:0,n.length>2?n[2]:1,...n.slice(3)):+e.internal,i=ii(e.timeZone,e),o=i>0?Math.floor(i):Math.ceil(i),s=new Date(+e);s.setUTCHours(s.getUTCHours()-1);let a=-new Date(+e).getTimezoneOffset(),l=-new Date(+s).getTimezoneOffset(),u=a;if(a-l&&a!==o&&Date.prototype.getHours.apply(e)!==(Array.isArray(t)?t[3]||0:e.internal.getUTCHours())){let t=new Date(+e),n=a-o;n&&t.setUTCMinutes(t.getUTCMinutes()+n);let r=ii(e.timeZone,t);(r>0?Math.floor(r):Math.ceil(r))===o&&(u=l)}let c=u-o;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);let h=new Date(+e);h.setUTCSeconds(0);let d=a>0?h.getSeconds():(h.getSeconds()-60)%60,f=Math.round(-(60*ii(e.timeZone,e)))%60;(f||d)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+d);let p=ii(e.timeZone,e),g=p>0?Math.floor(p):Math.ceil(p),m=-new Date(+e).getTimezoneOffset()-g-c,v=g-o,y=v>0&&ih(e)-r==60*v*1e3&&ih(e,r-60*g*1e3)!==r;if(g!==o&&m&&!y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);let t=ii(e.timeZone,e),n=g-(t>0?Math.floor(t):Math.ceil(t));n&&m<0&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n)}iu(e);let x=(t?r:r+1e3*f)-e.internal;x&&18e5>Math.abs(x)&&(Date.prototype.setTime.call(e,+e+x),iu(e))}function ih(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-(60*ii(e.timeZone,n)))),+n}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!il.test(e))return;let t=e.replace(il,"$1UTC");ia.prototype[t]&&(e.startsWith("get")?ia.prototype[e]=function(){return this.internal[t]()}:(ia.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,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()),ic(e),+this},ia.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),iu(this),+this}))});class id extends ia{static tz(e,...t){return t.length?new id(...t,e):new id(Date.now(),e)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[e>0?"-":"+",t,n]}withTimeZone(e){return new id(+this,e)}[Symbol.for("constructDateFrom")](e){return new id(+new Date(e),this.timeZone)}}function ip(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function ig(e,t,n){let r,i=n?.toLowerCase();if(!n||"local"===i||"browser"===i)return(0,t0.format)(e,t);return(0,t0.format)(e,t,{in:(r="utc"===i?"UTC":n,e=>id.tz(r,+new Date(e)))})}function im(e){let t=e?.toLowerCase(),n=e;e&&"local"!==t&&"browser"!==t?"utc"===t&&(n="UTC"):n=Intl.DateTimeFormat().resolvedOptions().timeZone;try{let e=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"shortOffset"}).formatToParts(new Date).find(e=>"timeZoneName"===e.type),t=e?.value??"";if("GMT"===t)return"GMT+0";return t}catch{return"GMT+0"}}function iv(e){return e>15768e7?"{yyyy}":e>63072e6?"{MMM} {yyyy}":e>432e6&&e<1577664e4?"{MM}/{dd}":e>1728e5&&e<=432e6?"{MM}/{dd} {HH}:{mm}":{year:"{yearStyle|{yyyy}}\n{monthStyle|{MMM}}",month:"{MMM}",day:"{MM}/{dd}"}}let iy=(e,t)=>{if(!e)return{formattedDate:"",formattedTime:""};let n=new Date(e);return{formattedDate:t?t(n,"MMM dd, yyyy"):(0,t0.format)(n,"MMM dd, yyyy"),formattedTime:t?t(n,"HH:mm:ss"):(0,t0.format)(n,"HH:mm:ss")}};var ix=n(18264);function ib(e,t){let n=(0,w.useRef)(),r=!0;for(let e=0;e<t.length;e++)if(n.current?.deps[e]!==t[e]){r=!1;break}return(void 0===n.current||!1===r)&&(n.current={value:e(),deps:t}),n.current.value}function iw(e,t){let n=(0,w.useRef)();return(void 0===n.current||!1===ix(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}function iS(e){return!!e?.startsWith("/")}function iC(e){if(!e)throw Error("Input string cannot be empty");if(!iS(e))return RegExp(`^${e}$`);let t=e.match(/^\/(.+)\/([gimy]*)$/);if(!t)throw Error(`Invalid regular expression format: ${e}`);let[,n="",r=""]=t;try{return new RegExp(n,r)}catch(e){throw Error(`Failed to create RegExp ${e}`)}}function iA(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=rK(i,t);return n}function iM(e,t){let n={};for(let[r,i]of Object.entries(e))Array.isArray(i)?n[r]=i.map(e=>rK(e,t)):n[r]=function e(t,n){if(Array.isArray(t))return t.map(t=>e(t,n));for(let[e,r]of rZ(t)){let i,o=n[e];if(!o)continue;let s=o.options??[],a=s.map(e=>e.value),l=Array.isArray(o.value),u=void 0!==o.customAllValue;if(l)i=o.value;else if(u)try{let e=iC(o.customAllValue),t=s.filter(t=>e.test(t.value)).map(e=>e.value);i=t.length>0?t:a}catch{i=a}if(i&&(!r||r===r$.QUERYPARAM)){let o="$"+e,s=r?"${"+e+":"+r+"}":"${"+e+"}";return i.map(e=>{let r=t;return rK(r=(r=r.replaceAll(s,e)).replaceAll(o,e),n)})}}return rK(t,n)}(i,t);return n}function ik(e,t,n,r,i){let o=r4(e,t,{index:n,count:r}),s=o.text,a=[];return o.errors&&a.push(...o.errors.map(e=>e.replace("in data","in selection data"))),i&&(s=rK(s,i)),{text:s,errors:a.length>0?a:void 0}}function iT(e,t,n){let r=r6(e,t),i=r.text,o=[];return r.errors&&o.push(...r.errors.map(e=>e.replace("in data","in selection data"))),n&&(i=rK(i,n)),{text:i,errors:o.length>0?o:void 0}}function iI(e,t){let n=e.palette.text?.primary??"#222";return tK({echartsTheme:{title:{show:!1},textStyle:{color:n,fontFamily:e.typography.fontFamily,fontSize:12},grid:{top:5,right:20,bottom:0,left:20,containLabel:!0},color:["#56B4E9","#009E73","#0072B2","#CC79A7","#F0E442","#E69F00","#D55E00"],categoryAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},timeAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},valueAxis:{show:!0,axisLabel:{color:n,margin:12},axisLine:{show:!1},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.6}}},legend:{orient:"horizontal",textStyle:{color:n},pageTextStyle:{color:e.palette.grey[600]},pageIconColor:e?.palette?.action?.active,pageIconInactiveColor:e?.palette?.action?.disabled},toolbox:{show:!0,top:10,right:10,iconStyle:{borderColor:n}},tooltip:{backgroundColor:e.palette.designSystem?.grey[800],borderColor:e.palette.designSystem?.grey[800],textStyle:{color:"#fff",fontSize:11}},axisPointer:{lineStyle:{color:e.palette.grey[500]}},markLine:{symbol:"none",symbolSize:0,itemStyle:{color:e.palette.grey[500]},lineStyle:{type:"dashed",width:1}},line:{showSymbol:!1,symbol:"circle",symbolSize:4,smooth:!1,lineStyle:{width:1},emphasis:{lineStyle:{width:1.5}}},bar:{barMaxWidth:150,itemStyle:{borderWidth:0,borderRadius:0,borderColor:e.palette.grey[300]},label:{show:!1,color:n}},gauge:{detail:{fontSize:18,fontWeight:600,valueAnimation:!1},splitLine:{distance:0,length:4,lineStyle:{width:1}},splitNumber:12}},noDataOption:{title:{show:!0,textStyle:{color:n,fontSize:16,fontWeight:400},text:"No data",left:"center",top:"center"},xAxis:{show:!1},yAxis:{show:!1}},sparkline:{width:2,color:"#1976d2"},container:{padding:{default:parseInt(e.spacing(1.5),10)}},thresholds:{defaultColor:e.palette.success.main,palette:["#FFCC00",e.palette.warning.main,e.palette.error.main]}},t)}function iD(e,t=[]){if(!t.length)return{value:e};let n={value:e};return t.forEach(t=>{switch(t.kind){case"Value":{let r=t.spec;String(r.value)===String(e)&&(n.value=r.result.value||n.value,n.color=r.result.color);break}case"Range":{let r=t.spec;if(void 0===r.from&&void 0===r.to)break;let i=void 0!==r.from?r.from:-1/0,o=void 0!==r.to?r.to:1/0;e>=i&&e<=o&&(n.value=r.result.value||n.value,n.color=r.result.color);break}case"Regex":{let r=t.spec,i=e.toString();if(!r.pattern)break;let o=iC(r.pattern);i.match(o)&&null!==r.result.value&&(n.value=i.replace(o,r.result.value.toString()||"")||n.value,n.color=r.result.color);break}case"Misc":{let r=t.spec;(function(e,t){switch(e){case"empty":return""===t;case"null":return null==t;case"NaN":return Number.isNaN(t);case"true":return!0===t;case"false":return!1===t;default:return!1}})(r.value,e)&&(n.value=r.result.value||n.value,n.color=r.result.color)}}}),n}function iO(e,t){if(0===t.length)return e;let n={};for(let r of e){let e=Object.keys(r).filter(e=>t.includes(e)).map(e=>r[e]).join("|"),i=n[e];i?n[e]={...i,...r}:n[e]={...r}}return Object.values(n)}function iE(e,t,n){let r=[];for(let i of e){let e=Object.keys(i).filter(e=>t.includes(e)),o={};for(let t of e)o[t]=i[t],delete i[t];for(let t of e)r.push({...i,[n]:o[t]});0===e.length&&r.push(i)}return r}function i_(e,t){let n=[];for(let r of e){let e=Object.keys(r).filter(e=>RegExp("^(("+t+" #\\d+)|("+t+"))$").test(e)),i={};for(let t of e)i[t]=r[t],delete r[t];for(let o of e)n.push({...r,[t]:i[o]});0===e.length&&n.push(r)}return n}function iR(e){let t=[...e],n=Array.from(new Set(e.flatMap(Object.keys).map(e=>e.replace(/ #\d+/,"")).filter(e=>"value"!==e)));for(let e of n)t=i_(t,e);return iO(t,n)}function iP(e,t){let n=e;for(let e of t??[])if(!e.spec.disabled)switch(e.kind){case"JoinByColumnValue":e.spec.columns&&e.spec.columns.length>0&&(n=iO(n,e.spec.columns));break;case"MergeIndexedColumns":e.spec.column&&(n=i_(n,e.spec.column));break;case"MergeColumns":e.spec.columns&&e.spec.columns.length>0&&e.spec.name&&(n=iE(n,e.spec.columns,e.spec.name));break;case"MergeSeries":n=iR(n)}return n.map(e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}))}var iL=n(68102);function iN(e){return"number"==typeof e}function iB(e){return!!e&&"object"==typeof e&&"function"==typeof e.constructor&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function iF(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function ij(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function iz(e){return e&&!0===e.constructor.prototype.isUnit||!1}function iV(e){return"string"==typeof e}var iH=Array.isArray;function i$(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function iW(e){return Array.isArray(e)||i$(e)}function iG(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function iU(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function iq(e){return e&&!0===e.constructor.prototype.isRange||!1}function iY(e){return e&&!0===e.constructor.prototype.isIndex||!1}function iZ(e){return"boolean"==typeof e}function iK(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function iX(e){return e&&!0===e.constructor.prototype.isHelp||!1}function iJ(e){return"function"==typeof e}function iQ(e){return e instanceof Date}function i0(e){return e instanceof RegExp}function i1(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!iF(e)&&!ij(e))}function i2(e){return null===e}function i5(e){return void 0===e}function i3(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function i4(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function i6(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function i8(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function i9(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function i7(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function oe(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function ot(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function on(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function or(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function oi(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function oo(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function os(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function oa(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function ol(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function ou(e){return e&&!0===e.constructor.prototype.isChain||!1}function oc(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":iB(e)?"BigNumber":iF(e)?"Complex":ij(e)?"Fraction":i$(e)?"Matrix":iz(e)?"Unit":iY(e)?"Index":iq(e)?"Range":iK(e)?"ResultSet":or(e)?e.type:ou(e)?"Chain":iX(e)?"Help":"Object":"function"===t?"Function":t}function oh(e){var t=typeof e;if("number"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(function(e){return oh(e)});if(e instanceof Date)return new Date(e.valueOf());if(iB(e))return e;if(e instanceof RegExp)throw TypeError("Cannot clone "+e);return od(e,oh)}function od(e,t){var n={};for(var r in e)og(e,r)&&(n[r]=t(e[r]));return n}function of(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!of(e[r],t[r]))return!1;return!0}if("function"==typeof e)return e===t;if(!(e instanceof Object))return e===t;if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!of(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}function op(e,t,n){var r,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(r=n(),i=!1),r},set:function(e){r=e,i=!1},configurable:!0,enumerable:!0})}function og(e,t){return e&&Object.hasOwnProperty.call(e,t)}function om(e){return Object.keys(e).map(t=>e[t])}var ov=n(23420);function oy(e,t,n,r){function i(r){var i=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],o=e[i];void 0!==o&&(n[i]=o)}return n}(r,t.map(ob));return function(e,t,n){if(!t.filter(e=>{var t;return!((t=e)&&"?"===t[0])}).every(e=>void 0!==n[e])){var r=t.filter(e=>void 0===n[e]);throw Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(r.map(e=>'"'.concat(e,'"')).join(", "),"."))}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function ox(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function ob(e){return e&&"?"===e[0]?e.slice(1):e}function ow(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function oS(e,t,n){var r="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!ow(n))throw Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!ow(e))throw Error("Value must be an integer");e<0&&(e+=2**n),r="i".concat(n)}var i="";return e<0&&(e=-e,i="-"),"".concat(i).concat({2:"0b",8:"0o",16:"0x"}[t]).concat(e.toString(t)).concat(r)}function oC(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,r,i="auto";if(t&&(t.notation&&(i=t.notation),iN(t)?n=t:iN(t.precision)&&(n=t.precision),t.wordSize)&&"number"!=typeof(r=t.wordSize))throw Error('Option "wordSize" must be a number');switch(i){case"fixed":return oM(e,n);case"exponential":return ok(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=oT(oA(e),t),r=n.exponent,i=n.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(iN(t))for(;t>i.length||r-o+1>i.length;)i.push(0);else for(var s=Math.abs(r-o)-(i.length-1),a=0;a<s;a++)i.push(0);for(var l=Math.abs(r-o),u=1;l>0;)u++,l--;var c=i.slice(u).join(""),h=iN(t)&&c.length||c.match(/[1-9]/)?"."+c:"",d=i.slice(0,u).join("")+h+"e"+(r>=0?"+":"")+o.toString();return n.sign+d}(e,n);case"bin":return oS(e,2,r);case"oct":return oS(e,8,r);case"hex":return oS(e,16,r);case"auto":return(function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,i=n&&void 0!==n.upperExp?n.upperExp:5,o=oA(e),s=t?oT(o,t):o;if(s.exponent<r||s.exponent>=i)return ok(e,t);var a=s.coefficients,l=s.exponent;a.length<t&&(a=a.concat(oI(t-a.length))),a=a.concat(oI(l-a.length+1+(a.length<t?t-a.length:0))),a=oI(-l).concat(a);var u=l>0?l:0;return u<a.length-1&&a.splice(u+1,0,"."),s.sign+a.join("")})(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function oA(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;var s=r.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===s.length&&(s.push(0),i++),{sign:n,coefficients:s,exponent:i}}function oM(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=oA(e),r="number"==typeof t?oT(n,n.exponent+1+t):n,i=r.coefficients,o=r.exponent+1,s=o+(t||0);return i.length<s&&(i=i.concat(oI(s-i.length))),o<0&&(i=oI(-o+1).concat(i),o=1),o<i.length&&i.splice(o,0,0===o?"0.":"."),r.sign+i.join("")}function ok(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=oA(e),r=t?oT(n,t):n,i=r.coefficients,o=r.exponent;i.length<t&&(i=i.concat(oI(t-i.length)));var s=i.shift();return r.sign+s+(i.length>0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function oT(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function oI(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var oD=Number.EPSILON||2220446049250313e-31;function oO(e,t,n){if(null==n)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var r=Math.abs(e-t);return r<oD||r<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function oE(e,t,n){var r=new e.constructor(2),i="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!ow(n))throw Error("size must be an integer");if(e.greaterThan(r.pow(n-1).sub(1))||e.lessThan(r.pow(n-1).mul(-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw Error("Value must be an integer");e.lessThan(0)&&(e=e.add(r.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw Error("Base ".concat(t," not supported "))}}function o_(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function oR(e,t){var n=function(e,t){var n;if("number"==typeof e)return oC(e,t);if(iB(e))return function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n="auto";if(void 0!==t&&(t.notation&&(n=t.notation),"number"==typeof t?h=t:t.precision&&(h=t.precision),t.wordSize)&&"number"!=typeof(d=t.wordSize))throw Error('Option "wordSize" must be a number');switch(n){case"fixed":return r=e,i=h,r.toFixed(i);case"exponential":return o_(e,h);case"engineering":return o=e,s=h,l=(a=o.e)%3==0?a:a<0?a-3-a%3:a-a%3,-1!==(c=(u=o.mul(Math.pow(10,-l))).toPrecision(s)).indexOf("e")&&(c=u.toString()),c+"e"+(a>=0?"+":"")+l.toString();case"bin":return oE(e,2,d);case"oct":return oE(e,8,d);case"hex":return oE(e,16,d);case"auto":var r,i,o,s,a,l,u,c,h,d,f=t&&void 0!==t.lowerExp?t.lowerExp:-3,p=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var g=e.toSignificantDigits(h),m=g.e;return(m>=f&&m<p?g.toFixed():o_(e,h)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,t);if((n=e)&&"object"==typeof n&&"number"==typeof n.s&&"number"==typeof n.n&&"number"==typeof n.d)if(!t||"decimal"!==t.fraction)return e.s*e.n+"/"+e.d;else return e.toString();if(Array.isArray(e))return function e(t,n){if(!Array.isArray(t))return oR(t,n);for(var r="[",i=t.length,o=0;o<i;o++)0!==o&&(r+=", "),r+=e(t[o],n);return r+"]"}(e,t);if(iV(e))return'"'+e+'"';if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e)if("function"==typeof e.format)return e.format(t);else return e&&e.toString(t)!==({}).toString()?e.toString(t):"{"+Object.keys(e).map(n=>'"'+n+'": '+oR(e[n],t)).join(", ")+"}";return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function oP(e,t,n){if(!(this instanceof oP))throw SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=Error().stack}function oL(e,t,n){if(!(this instanceof oL))throw SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=Error().stack}function oN(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function oB(e,t){if(0===t.length){if(Array.isArray(e))throw new oP(e.length,0)}else!function e(t,n,r){var i,o=t.length;if(o!==n[r])throw new oP(o,n[r]);if(r<n.length-1){var s=r+1;for(i=0;i<o;i++){if(!Array.isArray(t[i]))throw new oP(n.length-1,n.length,"<");e(t[i],n,s)}}else for(i=0;i<o;i++)if(Array.isArray(t[i]))throw new oP(n.length+1,n.length,">")}(e,t,0)}function oF(e,t){if(!iN(e)||!ow(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new oL(e,t)}function oj(e,t,n){if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!iN(e)||!ow(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+oR(t)+")")}),function e(t,n,r,i){var o,s,a=t.length,l=n[r],u=Math.min(a,l);if(t.length=l,r<n.length-1){var c=r+1;for(o=0;o<u;o++)Array.isArray(s=t[o])||(s=[s],t[o]=s),e(s,n,c,i);for(o=u;o<l;o++)s=[],t[o]=s,e(s,n,c,i)}else{for(o=0;o<u;o++)for(;Array.isArray(t[o]);)t[o]=t[o][0];for(o=u;o<l;o++)t[o]=i}}(e,t,0,void 0!==n?n:0),e}function oz(e,t){var n=oV(e),r=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw Error("More than one wildcard in sizes");if(i>=0)if(t%n==0)r[i]=-t/n;else throw Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function oV(e){return e.reduce((e,t)=>e*t,1)}function oH(e,t,n,r){var i=r||oN(e);if(n)for(var o=0;o<n;o++)e=[e],i.unshift(1);for(e=function e(t,n,r){var i,o;if(Array.isArray(t)){var s=r+1;for(i=0,o=t.length;i<o;i++)t[i]=e(t[i],n,s)}else for(var a=r;a<n;a++)t=[t];return t}(e,t,0);i.length<t;)i.push(1);return e}function o$(e,t){for(var n,r=0,i=0;i<e.length;i++){var o=e[i],s=Array.isArray(o);if(0===i&&s&&(r=o.length),s&&o.length!==r)return;var a=s?o$(o,t):t(o);if(void 0===n)n=a;else if(n!==a)return"mixed"}return n}function oW(e,t){return -1!==e.indexOf(t)}function oG(e,t,n,r){if(!(this instanceof oG))throw SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=r?"-"+r:"")+" expected)",this.stack=Error().stack}oP.prototype=RangeError(),oP.prototype.constructor=RangeError,oP.prototype.name="DimensionError",oP.prototype.isDimensionError=!0,oL.prototype=RangeError(),oL.prototype.constructor=RangeError,oL.prototype.name="IndexError",oL.prototype.isIndexError=!0,oG.prototype=Error(),oG.prototype.constructor=Error,oG.prototype.name="ArgumentsError",oG.prototype.isArgumentsError=!0;var oU={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},oq=["Matrix","Array"],oY=["number","BigNumber","Fraction"];function oZ(e,t,n){var r;void 0!==e[t]&&(r=e[t],-1===n.indexOf(r))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}function oK(e,t){var n,r,i,o=(0,iL.A)({},oU,t);if("function"!=typeof Object.create)throw Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var s=((n={isNumber:iN,isComplex:iF,isBigNumber:iB,isFraction:ij,isUnit:iz,isString:iV,isArray:iH,isMatrix:i$,isCollection:iW,isDenseMatrix:iG,isSparseMatrix:iU,isRange:iq,isIndex:iY,isBoolean:iZ,isResultSet:iK,isHelp:iX,isFunction:iJ,isDate:iQ,isRegExp:i0,isObject:i1,isNull:i2,isUndefined:i5,isAccessorNode:i3,isArrayNode:i4,isAssignmentNode:i6,isBlockNode:i8,isConditionalNode:i9,isConstantNode:i7,isFunctionAssignmentNode:oe,isFunctionNode:ot,isIndexNode:on,isNode:or,isObjectNode:oi,isOperatorNode:oo,isParenthesisNode:os,isRangeNode:oa,isSymbolNode:ol,isChain:ou}).on=(r=new ov).on.bind(r),n.off=r.off.bind(r),n.once=r.once.bind(r),n.emit=r.emit.bind(r),n);s.config=function(e,t){function n(n){if(!n)return od(e,oh);var r=od(e,oh);oZ(n,"matrix",oq),oZ(n,"number",oY),function e(t,n){if(Array.isArray(n))throw TypeError("Arrays are not supported by deepExtend");for(var r in n)if(og(n,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(n[r]&&n[r].constructor===Object)void 0===t[r]&&(t[r]={}),t[r]&&t[r].constructor===Object?e(t[r],n[r]):t[r]=n[r];else if(Array.isArray(n[r]))throw TypeError("Arrays are not supported by deepExtend");else t[r]=n[r];return t}(e,n);var i=od(e,oh);return t("config",i,r,od(n,oh)),i}return n.MATRIX_OPTIONS=oq,n.NUMBER_OPTIONS=oY,Object.keys(oU).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}(o,s.emit),s.expression={transform:{},mathWithTransform:{config:s.config}};var a={},l=function(e,t,n){function r(e,n){n&&"function"==typeof n.transform?(t.expression.transform[e]=n.transform,og(s,e)||(t.expression.mathWithTransform[e]=n.transform)):(delete t.expression.transform[e],og(s,e)||(t.expression.mathWithTransform[e]=n))}function i(e){return"function"==typeof e&&"object"==typeof e.signatures}function o(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction}var s={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(a,l){var u=arguments.length;if(1!==u&&2!==u)throw new oG("import",u,1,2);l||(l={});var c={};for(var h in!function e(t,n,r){if(Array.isArray(n))n.forEach(n=>e(t,n));else if("object"==typeof n)for(var i in n)og(n,i)&&e(t,n[i],i);else if(ox(n)||void 0!==r){var s=ox(n)?o(n)?n.fn+".transform":n.fn:r;if(og(t,s)&&t[s]!==n&&!l.silent)throw Error('Cannot import "'+s+'" twice');t[s]=n}else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}(c,a),c)if(og(c,h)){var d,f=c[h];if(ox(f))!function(r,a){var l,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.fn;if(oW(u,"."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));var c=o(r)?t.expression.transform:t,h=u in t.expression.transform,d=og(c,u)?c[u]:void 0,f=function(){var n={};r.dependencies.map(ob).forEach(e=>{if(oW(e,"."))throw Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=t:"mathWithTransform"===e?n.mathWithTransform=t.expression.mathWithTransform:"classes"===e?n.classes=t:n[e]=t[e]});var o=r(n);if(o&&"function"==typeof o.transform)throw Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===d||a.override)return o;if(i(d)&&i(o))return e(d,o);if(a.silent)return d;throw Error('Cannot import "'+u+'": already exists')};r.meta&&!1===r.meta.lazy?c[u]=f():op(c,u,f),d&&h?function(e){delete t.expression.transform[e],og(s,e)?delete t.expression.mathWithTransform[e]:t.expression.mathWithTransform[e]=t[e]}(u):!o(r)&&(-1!==(l=r).fn.indexOf(".")||og(s,l.fn)||l.meta&&l.meta.isClass)||op(t.expression.mathWithTransform,u,()=>c[u]),n[u]=r,t.emit("import",u,f)}(f,l);else{if("function"==typeof(d=f)||"number"==typeof d||"string"==typeof d||"boolean"==typeof d||null===d||iz(d)||iF(d)||iB(d)||ij(d)||i$(d)||Array.isArray(d))!function(o,s,a){var l;if(a.wrap&&"function"==typeof s&&(s=function(e){var n=function(){for(var n=[],r=0,i=arguments.length;r<i;r++){var o=arguments[r];n[r]=o&&o.valueOf()}return e.apply(t,n)};return e.transform&&(n.transform=e.transform),n}(s)),"function"==typeof(l=s)&&"string"==typeof l.signature&&(s=e(o,{[s.signature]:s})),i(t[o])&&i(s)){s=a.override?e(o,s.signatures):e(t[o],s),t[o]=s,delete n[o],r(o,s),t.emit("import",o,function(){return s});return}if(void 0===t[o]||a.override){t[o]=s,delete n[o],r(o,s),t.emit("import",o,function(){return s});return}if(!a.silent)throw Error('Cannot import "'+o+'": already exists')}(h,f,l);else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}}}}(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.typed.apply(s.typed,t)},s,a);return s.import=l,s.on("config",()=>{om(a).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&l(e,{override:!0})})}),s.create=oK.bind(null,e),s.factory=oy,s.import(om((function e(t,n){for(var r in t)if(og(t,r)){var i=t[r];"object"==typeof i&&null!==i?e(i,n):n[r]=i}}(e,i={}),i))),s.ArgumentsError=oG,s.DimensionError=oP,s.IndexError=oL,s}var oX,oJ,oQ,o0,o1,o2,o5,o3,o4,o6,o8,o9,o7,se,st,sn,sr,si,so="0123456789abcdef",ss="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sa="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",sl={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},su=!0,sc="[DecimalError] ",sh=sc+"Invalid argument: ",sd=sc+"Precision limit exceeded",sf=sc+"crypto unavailable",sp="[object Decimal]",sg=Math.floor,sm=Math.pow,sv=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sy=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,sx=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,sb=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,sw=ss.length-1,sS=sa.length-1,sC={toStringTag:sp};function sA(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=sL(n)),o+=r;(n=7-(r=(s=e[t])+"").length)&&(o+=sL(n))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function sM(e,t,n){if(e!==~~e||e<t||e>n)throw Error(sh+e)}function sk(e,t,n,r){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=sm(10,7-t),a=e[i]%o|0,null==r?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(e[i+1]/o/100|0)==sm(10,t-2)-1||(a==o/2||0==a)&&(e[i+1]/o/100|0)==0:t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(r||n<4)&&9999==a||!r&&n>3&&4999==a):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==sm(10,t-3)-1,s}function sT(e,t,n){for(var r,i,o=[0],s=0,a=e.length;s<a;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=so.indexOf(e.charAt(s++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}sC.absoluteValue=sC.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),sD(e)},sC.ceil=function(){return sD(new this.constructor(this),this.e+1,2)},sC.clampedTo=sC.clamp=function(e,t){var n=this.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(sh+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new n(this)},sC.comparedTo=sC.cmp=function(e){var t,n,r,i,o=this.d,s=(e=new this.constructor(e)).d,a=this.s,l=e.s;if(!o||!s)return a&&l?a!==l?a:o===s?0:!o^a<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?a:s[0]?-l:0;if(a!==l)return a;if(this.e!==e.e)return this.e>e.e^a<0?1:-1;for(t=0,n=(r=o.length)<(i=s.length)?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^a<0?1:-1;return r===i?0:r>i^a<0?1:-1},sC.cosine=sC.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;(r=t.d.length)<32?i=(1/sW(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=s$(e,1,t.times(i),new e(1));for(var o=n;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}(r,sG(r,n)),r.precision=e,r.rounding=t,sD(2==si||3==si?n.neg():n,e,t,!0)):new r(1):new r(NaN)},sC.cubeRoot=sC.cbrt=function(){var e,t,n,r,i,o,s,a,l,u,c=this.constructor;if(!this.isFinite()||this.isZero())return new c(this);for(su=!1,(o=this.s*sm(this.s*this,1/3))&&Math.abs(o)!=1/0?r=new c(o.toString()):(n=sA(this.d),(o=((e=this.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=sm(n,1/3),e=sg((e+1)/3)-(e%3==(e<0?-1:2)),(r=new c(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=this.s),s=(e=c.precision)+3;;)if(r=sI((u=(l=(a=r).times(a).times(a)).plus(this)).plus(this).times(a),u.plus(l),s+2,1),sA(a.d).slice(0,s)===(n=sA(r.d)).slice(0,s)){if("9999"!=(n=n.slice(s-3,s+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(sD(r,e+1,1),t=!r.times(r).times(r).eq(this));break}if(!i&&(sD(a,e+1,0),a.times(a).times(a).eq(this))){r=a;break}s+=4,i=1}return su=!0,sD(r,e,c.rounding,t)},sC.decimalPlaces=sC.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-sg(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},sC.dividedBy=sC.div=function(e){return sI(this,new this.constructor(e))},sC.dividedToIntegerBy=sC.divToInt=function(e){var t=this.constructor;return sD(sI(this,new t(e),0,1,1),t.precision,t.rounding)},sC.equals=sC.eq=function(e){return 0===this.cmp(e)},sC.floor=function(){return sD(new this.constructor(this),this.e+1,3)},sC.greaterThan=sC.gt=function(e){return this.cmp(e)>0},sC.greaterThanOrEqualTo=sC.gte=function(e){var t=this.cmp(e);return 1==t||0===t},sC.hyperbolicCosine=sC.cosh=function(){var e,t,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?t=(1/sW(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=s$(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return sD(o,s.precision=n,s.rounding=r,!0)},sC.hyperbolicSine=sC.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=s$(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=s$(o,2,i=i.times(1/sW(5,e)),i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=n,sD(i,t,n,!0)},sC.hyperbolicTangent=sC.tanh=function(){var e,t,n=this.constructor;return this.isFinite()?this.isZero()?new n(this):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,sI(this.sinh(),this.cosh(),n.precision=e,n.rounding=t)):new n(this.s)},sC.inverseCosine=sC.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return -1!==n?0===n?e.isNeg()?sR(t,r,i):new t(0):new t(NaN):e.isZero()?sR(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},sC.inverseHyperbolicCosine=sC.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,su=!1,n=n.times(n).minus(1).sqrt().plus(n),su=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},sC.inverseHyperbolicSine=sC.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,su=!1,n=n.times(n).plus(1).sqrt().plus(n),su=!0,r.precision=e,r.rounding=t,n.ln())},sC.inverseHyperbolicTangent=sC.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,Math.max(r=i.sd(),e)<-(2*i.e)-1)?sD(new o(i),e,t,!0):(o.precision=n=r-i.e,i=sI(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5)):new o(NaN)},sC.inverseSine=sC.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t)?0===t?((e=sR(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2))},sC.inverseTangent=sC.atan=function(){var e,t,n,r,i,o,s,a,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);else if(u.abs().eq(1)&&h+4<=sS)return(s=sR(c,h+4,d).times(.25)).s=u.s,s}else{if(!u.s)return new c(NaN);if(h+4<=sS)return(s=sR(c,h+4,d).times(.5)).s=u.s,s}for(c.precision=a=h+10,c.rounding=1,e=n=Math.min(28,a/7+2|0);e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(su=!1,t=Math.ceil(a/7),r=1,l=u.times(u),s=new c(u),i=u;-1!==e;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),void 0!==(s=o.plus(i.div(r+=2))).d[t])for(e=t;s.d[e]===o.d[e]&&e--;);return n&&(s=s.times(2<<n-1)),su=!0,sD(s,c.precision=h,c.rounding=d,!0)},sC.isFinite=function(){return!!this.d},sC.isInteger=sC.isInt=function(){return!!this.d&&sg(this.e/7)>this.d.length-2},sC.isNaN=function(){return!this.s},sC.isNegative=sC.isNeg=function(){return this.s<0},sC.isPositive=sC.isPos=function(){return this.s>0},sC.isZero=function(){return!!this.d&&0===this.d[0]},sC.lessThan=sC.lt=function(e){return 0>this.cmp(e)},sC.lessThanOrEqualTo=sC.lte=function(e){return 1>this.cmp(e)},sC.logarithm=sC.log=function(e){var t,n,r,i,o,s,a,l=this.constructor,u=l.precision,c=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new l(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(t)if(n.length>1)i=!0;else{for(r=n[0];r%10==0;)r/=10;i=1!==r}if(su=!1,sk((a=sI(o=sz(this,s=u+5),t?s_(l,s+10):sz(e,s),s,1)).d,r=u,c))do if(s+=10,a=sI(o=sz(this,s),t?s_(l,s+10):sz(e,s),s,1),!i){+sA(a.d).slice(r+1,r+15)+1==1e14&&(a=sD(a,u+1,0));break}while(sk(a.d,r+=10,c));return su=!0,sD(a,u,c)},sC.minus=sC.sub=function(e){var t,n,r,i,o,s,a,l,u,c,h,d,f=this.constructor;if(e=new f(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new f(e.d||this.s!==e.s?this:NaN):e=new f(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(u=this.d,d=e.d,a=f.precision,l=f.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!u[0])return new f(3===l?-0:0);e=new f(this)}return su?sD(e,a,l):e}if(n=sg(e.e/7),c=sg(this.e/7),u=u.slice(),o=c-n){for((h=o<0)?(t=u,o=-o,s=d.length):(t=d,n=c,s=u.length),o>(r=Math.max(Math.ceil(a/7),s)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((h=(r=u.length)<(s=d.length))&&(s=r),r=0;r<s;r++)if(u[r]!=d[r]){h=u[r]<d[r];break}o=0}for(h&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,r=d.length-s;r>0;--r)u[s++]=0;for(r=d.length;r>o;){if(u[--r]<d[r]){for(i=r;i&&0===u[--i];)u[i]=1e7-1;--u[i],u[r]+=1e7}u[r]-=d[r]}for(;0===u[--s];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(e.d=u,e.e=sE(u,n),su?sD(e,a,l):e):new f(3===l?-0:0)},sC.modulo=sC.mod=function(e){var t,n=this.constructor;return(e=new n(e),this.d&&e.s&&(!e.d||e.d[0]))?e.d&&(!this.d||this.d[0])?(su=!1,9==n.modulo?(t=sI(this,e.abs(),0,3,1),t.s*=e.s):t=sI(this,e,0,n.modulo,1),t=t.times(e),su=!0,this.minus(t)):sD(new n(this),n.precision,n.rounding):new n(NaN)},sC.naturalExponential=sC.exp=function(){return sj(this)},sC.naturalLogarithm=sC.ln=function(){return sz(this)},sC.negated=sC.neg=function(){var e=new this.constructor(this);return e.s=-e.s,sD(e)},sC.plus=sC.add=function(e){var t,n,r,i,o,s,a,l,u,c,h=this.constructor;if(e=new h(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new h(e.d||this.s===e.s?this:NaN)):e=new h(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(u=this.d,c=e.d,a=h.precision,l=h.rounding,!u[0]||!c[0])return c[0]||(e=new h(this)),su?sD(e,a,l):e;if(o=sg(this.e/7),r=sg(e.e/7),u=u.slice(),i=o-r){for(i<0?(n=u,i=-i,s=c.length):(n=c,r=o,s=u.length),i>(s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((s=u.length)-(i=c.length)<0&&(i=s,n=c,c=u,u=n),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/1e7|0,u[i]%=1e7;for(t&&(u.unshift(t),++r),s=u.length;0==u[--s];)u.pop();return e.d=u,e.e=sE(u,r),su?sD(e,a,l):e},sC.precision=sC.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(sh+e);return this.d?(t=sP(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},sC.round=function(){var e=this.constructor;return sD(new e(this),this.e+1,e.rounding)},sC.sine=sC.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:s$(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=s$(e,2,t=t.times(1/sW(5,n)),t);for(var i,o=new e(5),s=new e(16),a=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}(r,sG(r,n)),r.precision=e,r.rounding=t,sD(si>2?n.neg():n,e,t,!0)):new r(NaN)},sC.squareRoot=sC.sqrt=function(){var e,t,n,r,i,o,s=this.d,a=this.e,l=this.s,u=this.constructor;if(1!==l||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?this:1/0);for(su=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=sA(s)).length+a)%2==0&&(t+="0"),l=Math.sqrt(t),a=sg((a+1)/2)-(a<0||a%2),r=new u(t=l==1/0?"5e"+a:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+a)):r=new u(l.toString()),n=(a=u.precision)+3;;)if(r=(o=r).plus(sI(this,o,n+2,1)).times(.5),sA(o.d).slice(0,n)===(t=sA(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(sD(r,a+1,1),e=!r.times(r).eq(this));break}if(!i&&(sD(o,a+1,0),o.times(o).eq(this))){r=o;break}n+=4,i=1}return su=!0,sD(r,a,u.rounding,e)},sC.tangent=sC.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=sI(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,sD(2==si||4==si?n.neg():n,e,t,!0)):new r(NaN)},sC.times=sC.mul=function(e){var t,n,r,i,o,s,a,l,u,c=this.constructor,h=this.d,d=(e=new c(e)).d;if(e.s*=this.s,!h||!h[0]||!d||!d[0])return new c(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?e.s/0:0*e.s);for(n=sg(this.e/7)+sg(e.e/7),(l=h.length)<(u=d.length)&&(o=h,h=d,d=o,s=l,l=u,u=s),o=[],r=s=l+u;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)a=o[i]+d[r]*h[i-r-1]+t,o[i--]=a%1e7|0,t=a/1e7|0;o[i]=(o[i]+t)%1e7|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=sE(o,n),su?sD(e,c.precision,c.rounding):e},sC.toBinary=function(e,t){return sU(this,2,e,t)},sC.toDecimalPlaces=sC.toDP=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(sM(e,0,1e9),void 0===t?t=r.rounding:sM(t,0,8),sD(n,e+n.e+1,t))},sC.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=sO(r,!0):(sM(e,0,1e9),void 0===t?t=i.rounding:sM(t,0,8),n=sO(r=sD(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},sC.toFixed=function(e,t){var n,r,i=this.constructor;return void 0===e?n=sO(this):(sM(e,0,1e9),void 0===t?t=i.rounding:sM(t,0,8),n=sO(r=sD(new i(this),e+this.e+1,t),!1,e+r.e+1)),this.isNeg()&&!this.isZero()?"-"+n:n},sC.toFraction=function(e){var t,n,r,i,o,s,a,l,u,c,h,d,f=this.d,p=this.constructor;if(!f)return new p(this);if(u=n=new p(1),r=l=new p(0),s=(o=(t=new p(r)).e=sP(f)-this.e-1)%7,t.d[0]=sm(10,s<0?7+s:s),null==e)e=o>0?t:u;else{if(!(a=new p(e)).isInt()||a.lt(u))throw Error(sh+a);e=a.gt(t)?o>0?t:u:a}for(su=!1,a=new p(sA(f)),c=p.precision,p.precision=o=7*f.length*2;h=sI(a,t,0,1,1),1!=(i=n.plus(h.times(r))).cmp(e);)n=r,r=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=sI(e.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=this.s,d=1>sI(u,r,o,1).minus(this).abs().cmp(sI(l,n,o,1).minus(this).abs())?[u,r]:[l,n],p.precision=c,su=!0,d},sC.toHexadecimal=sC.toHex=function(e,t){return sU(this,16,e,t)},sC.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:sM(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(su=!1,n=sI(n,e,0,t,1).times(e),su=!0,sD(n)):(e.s=n.s,n=e),n},sC.toNumber=function(){return+this},sC.toOctal=function(e,t){return sU(this,8,e,t)},sC.toPower=sC.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(sm(+a,u));if((a=new l(a)).eq(1))return a;if(r=l.precision,o=l.rounding,e.eq(1))return sD(a,r,o);if((t=sg(e.e/7))>=e.d.length-1&&(n=u<0?-u:u)<=0x1fffffffffffff)return i=sN(l,a,n,r),e.s<0?new l(1).div(i):sD(i,r,o);if((s=a.s)<0){if(t<e.d.length-1)return new l(NaN);if((1&e.d[t])==0&&(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(t=0!=(n=sm(+a,u))&&isFinite(n)?new l(n+"").e:sg(u*(Math.log("0."+sA(a.d))/Math.LN10+a.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(su=!1,l.rounding=a.s=1,n=Math.min(12,(t+"").length),(i=sj(e.times(sz(a,r+n)),r)).d&&sk((i=sD(i,r+5,1)).d,r,o)&&(t=r+10,+sA((i=sD(sj(e.times(sz(a,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=sD(i,r+1,0))),i.s=s,su=!0,l.rounding=o,sD(i,r,o))},sC.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=sO(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(sM(e,1,1e9),void 0===t?t=i.rounding:sM(t,0,8),n=sO(r=sD(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},sC.toSignificantDigits=sC.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(sM(e,1,1e9),void 0===t?t=n.rounding:sM(t,0,8)),sD(new n(this),e,t)},sC.toString=function(){var e=this.constructor,t=sO(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},sC.truncated=sC.trunc=function(){return sD(new this.constructor(this),this.e+1,1)},sC.valueOf=sC.toJSON=function(){var e=this.constructor,t=sO(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var sI=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s,a,l){var u,c,h,d,f,p,g,m,v,y,x,b,w,S,C,A,M,k,T,I,D=r.constructor,O=r.s==i.s?1:-1,E=r.d,_=i.d;if(!E||!E[0]||!_||!_[0])return new D(!r.s||!i.s||(E?_&&E[0]==_[0]:!_)?NaN:E&&0==E[0]||!_?0*O:O/0);for(l?(f=1,c=r.e-i.e):(l=1e7,f=7,c=sg(r.e/f)-sg(i.e/f)),T=_.length,M=E.length,y=(v=new D(O)).d=[],h=0;_[h]==(E[h]||0);h++);if(_[h]>(E[h]||0)&&c--,null==o?(S=o=D.precision,s=D.rounding):S=a?o+(r.e-i.e)+1:o,S<0)y.push(1),p=!0;else{if(S=S/f+2|0,h=0,1==T){for(d=0,_=_[0],S++;(h<M||d)&&S--;h++)C=d*l+(E[h]||0),y[h]=C/_|0,d=C%_|0;p=d||h<M}else{for((d=l/(_[0]+1)|0)>1&&(_=e(_,d,l),E=e(E,d,l),T=_.length,M=E.length),A=T,b=(x=E.slice(0,T)).length;b<T;)x[b++]=0;(I=_.slice()).unshift(0),k=_[0],_[1]>=l/2&&++k;do d=0,(u=t(_,x,T,b))<0?(w=x[0],T!=b&&(w=w*l+(x[1]||0)),(d=w/k|0)>1?(d>=l&&(d=l-1),m=(g=e(_,d,l)).length,b=x.length,1==(u=t(g,x,m,b))&&(d--,n(g,T<m?I:_,m,l))):(0==d&&(u=d=1),g=_.slice()),(m=g.length)<b&&g.unshift(0),n(x,g,b,l),-1==u&&(b=x.length,(u=t(_,x,T,b))<1&&(d++,n(x,T<b?I:_,b,l))),b=x.length):0===u&&(d++,x=[0]),y[h++]=d,u&&x[0]?x[b++]=E[A]||0:(x=[E[A]],b=1);while((A++<M||void 0!==x[0])&&S--);p=void 0!==x[0]}y[0]||y.shift()}if(1==f)v.e=c,sr=p;else{for(h=1,d=y[0];d>=10;d/=10)h++;v.e=h+c*f-1,sD(v,a?o+v.e+1:o,s,p)}return v}}();function sD(e,t,n,r){var i,o,s,a,l,u,c,h,d,f=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(i=1,a=h[0];a>=10;a/=10)i++;if((o=t-i)<0)o+=7,s=t,l=(c=h[d=0])/sm(10,i-s-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(a=h.length))if(r){for(;a++<=d;)h.push(0);c=l=0,i=1,o%=7,s=o-7+1}else break e;else{for(i=1,c=a=h[d];a>=10;a/=10)i++;o%=7,l=(s=o-7+i)<0?0:c/sm(10,i-s-1)%10|0}if(r=r||t<0||void 0!==h[d+1]||(s<0?c:c%sm(10,i-s-1)),u=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?s>0?c/sm(10,i-s):0:h[d-1])%10&1||n==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=sm(10,(7-t%7)%7),e.e=-t||0):h[0]=e.e=0,e;if(0==o?(h.length=d,a=1,d--):(h.length=d+1,a=sm(10,7-o),h[d]=s>0?(c/sm(10,i-s)%sm(10,s)|0)*a:0),u)for(;;)if(0==d){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,1e7==h[0]&&(h[0]=1));break}else{if(h[d]+=a,1e7!=h[d])break;h[d--]=0,a=1}for(o=h.length;0===h[--o];)h.pop()}return su&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function sO(e,t,n){if(!e.isFinite())return sV(e);var r,i=e.e,o=sA(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+sL(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+sL(-i-1)+o,n&&(r=n-s)>0&&(o+=sL(r))):i>=s?(o+=sL(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+sL(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=sL(r))),o}function sE(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function s_(e,t,n){if(t>sw)throw su=!0,n&&(e.precision=n),Error(sd);return sD(new e(ss),t,1,!0)}function sR(e,t,n){if(t>sS)throw Error(sd);return sD(new e(sa),t,n,!0)}function sP(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function sL(e){for(var t="";e--;)t+="0";return t}function sN(e,t,n,r){var i,o=new e(1),s=Math.ceil(r/7+4);for(su=!1;;){if(n%2&&sq((o=o.times(t)).d,s)&&(i=!0),0===(n=sg(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}sq((t=t.times(t)).d,s)}return su=!0,o}function sB(e){return 1&e.d[e.d.length-1]}function sF(e,t,n){for(var r,i,o=new e(t[0]),s=0;++s<t.length;){if(!(i=new e(t[s])).s){o=i;break}((r=o.cmp(i))===n||0===r&&o.s===n)&&(o=i)}return o}function sj(e,t){var n,r,i,o,s,a,l,u=0,c=0,h=0,d=e.constructor,f=d.rounding,p=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?!e.d[0]?1:e.s<0?0:1/0:e.s?e.s<0?0:e:0/0);for(null==t?(su=!1,l=p):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),h+=5;for(l+=r=Math.log(sm(2,h))/Math.LN10*2+5|0,n=o=s=new d(1),d.precision=l;;){if(o=sD(o.times(e),l,1),n=n.times(++c),sA((a=s.plus(sI(o,n,l,1))).d).slice(0,l)===sA(s.d).slice(0,l)){for(i=h;i--;)s=sD(s.times(s),l,1);if(null!=t)return d.precision=p,s;if(!(u<3&&sk(s.d,l-r,f,u)))return sD(s,d.precision=p,f,su=!0);d.precision=l+=10,n=o=a=new d(1),c=0,u++}s=a}}function sz(e,t){var n,r,i,o,s,a,l,u,c,h,d,f=1,p=e,g=p.d,m=p.constructor,v=m.rounding,y=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(null==t?(su=!1,c=y):c=t,m.precision=c+=10,r=(n=sA(g)).charAt(0),!(15e14>Math.abs(o=p.e)))return u=s_(m,c+2,y).times(o+""),p=sz(new m(r+"."+n.slice(1)),c-10).plus(u),m.precision=y,null==t?sD(p,y,v,su=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=sA((p=p.times(e)).d)).charAt(0),f++;for(o=p.e,r>1?(p=new m("0."+n),o++):p=new m(r+"."+n.slice(1)),h=p,l=s=p=sI(p.minus(1),p.plus(1),c,1),d=sD(p.times(p),c,1),i=3;;){if(s=sD(s.times(d),c,1),sA((u=l.plus(sI(s,new m(i),c,1))).d).slice(0,c)===sA(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(s_(m,c+2,y).times(o+""))),l=sI(l,new m(f),c,1),null!=t)return m.precision=y,l;if(!sk(l.d,c-10,v,a))return sD(l,m.precision=y,v,su=!0);m.precision=c+=10,u=s=p=sI(h.minus(1),h.plus(1),c,1),d=sD(p.times(p),c,1),i=a=1}l=u,i+=2}}function sV(e){return String(e.s*e.s/0)}function sH(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),su&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function s$(e,t,n,r,i){var o,s,a,l,u=e.precision,c=Math.ceil(u/7);for(su=!1,l=n.times(n),a=new e(r);;){if(s=sI(a.times(l),new e(t++*t++),u,1),a=i?r.plus(s):r.minus(s),r=sI(s.times(l),new e(t++*t++),u,1),void 0!==(s=a.plus(r)).d[c]){for(o=c;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=r,r=s,s=o}return su=!0,s.d.length=c+1,s}function sW(e,t){for(var n=e;--t;)n*=e;return n}function sG(e,t){var n,r=t.s<0,i=sR(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return si=r?4:1,t;if((n=t.divToInt(i)).isZero())si=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return si=sB(n)?r?2:3:r?4:1,t;si=sB(n)?r?1:4:r?3:2}return t.minus(i).abs()}function sU(e,t,n,r){var i,o,s,a,l,u,c,h,d,f=e.constructor,p=void 0!==n;if(p?(sM(n,1,1e9),void 0===r?r=f.rounding:sM(r,0,8)):(n=f.precision,r=f.rounding),e.isFinite()){for(s=(c=sO(e)).indexOf("."),p?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,s>=0&&(c=c.replace(".",""),(d=new f(1)).e=c.length-s,d.d=sT(sO(d),10,i),d.e=d.d.length),o=l=(h=sT(c,10,i)).length;0==h[--l];)h.pop();if(h[0]){if(s<0?o--:((e=new f(e)).d=h,e.e=o,h=(e=sI(e,d,n,r,0,i)).d,o=e.e,u=sr),s=h[n],a=i/2,u=u||void 0!==h[n+1],u=r<4?(void 0!==s||u)&&(0===r||r===(e.s<0?3:2)):s>a||s===a&&(4===r||u||6===r&&1&h[n-1]||r===(e.s<0?8:7)),h.length=n,u)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,c="";s<l;s++)c+=so.charAt(h[s]);if(p){if(l>1)if(16==t||8==t){for(s=16==t?4:3,--l;l%s;l++)c+="0";for(l=(h=sT(c,i,t)).length;!h[l-1];--l);for(s=1,c="1.";s<l;s++)c+=so.charAt(h[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}else c=p?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=sV(e);return e.s<0?"-"+c:c}function sq(e,t){if(e.length>t)return e.length=t,!0}function sY(e){return new this(e).abs()}function sZ(e){return new this(e).acos()}function sK(e){return new this(e).acosh()}function sX(e,t){return new this(e).plus(t)}function sJ(e){return new this(e).asin()}function sQ(e){return new this(e).asinh()}function s0(e){return new this(e).atan()}function s1(e){return new this(e).atanh()}function s2(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?sR(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=sR(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(sI(e,t,o,1)),t=sR(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(sI(e,t,o,1)):(n=sR(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function s5(e){return new this(e).cbrt()}function s3(e){return sD(e=new this(e),e.e+1,2)}function s4(e,t,n){return new this(e).clamp(t,n)}function s6(e){if(!e||"object"!=typeof e)throw Error(sc+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=sl[n]),void 0!==(r=e[n]))if(sg(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(sh+n+": "+r);if(n="crypto",i&&(this[n]=sl[n]),void 0!==(r=e[n]))if(!0===r||!1===r||0===r||1===r)if(r)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(sf);else this[n]=!1;else throw Error(sh+n+": "+r);return this}function s8(e){return new this(e).cos()}function s9(e){return new this(e).cosh()}function s7(e,t){return new this(e).div(t)}function ae(e){return new this(e).exp()}function at(e){return sD(e=new this(e),e.e+1,3)}function an(){var e,t,n=new this(0);for(e=0,su=!1;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return su=!0,new this(1/0);n=t}return su=!0,n.sqrt()}function ar(e){return e instanceof aA||e&&e.toStringTag===sp||!1}function ai(e){return new this(e).ln()}function ao(e,t){return new this(e).log(t)}function as(e){return new this(e).log(2)}function aa(e){return new this(e).log(10)}function al(){return sF(this,arguments,-1)}function au(){return sF(this,arguments,1)}function ac(e,t){return new this(e).mod(t)}function ah(e,t){return new this(e).mul(t)}function ad(e,t){return new this(e).pow(t)}function af(e){var t,n,r,i,o=0,s=new this(1),a=[];if(void 0===e?e=this.precision:sM(e,1,1e9),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=r/4}else throw Error(sf);else for(;o<r;)a[o++]=1e7*Math.random()|0;for(r=a[--o],e%=7,r&&e&&(i=sm(10,7-e),a[o]=(r/i|0)*i);0===a[o];o--)a.pop();if(o<0)n=0,a=[0];else{for(n=-1;0===a[0];n-=7)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return s.e=n,s.d=a,s}function ap(e){return sD(e=new this(e),e.e+1,this.rounding)}function ag(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function am(e){return new this(e).sin()}function av(e){return new this(e).sinh()}function ay(e){return new this(e).sqrt()}function ax(e,t){return new this(e).sub(t)}function ab(){var e=0,t=arguments,n=new this(t[0]);for(su=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return su=!0,sD(n,this.precision,this.rounding)}function aw(e){return new this(e).tan()}function aS(e){return new this(e).tanh()}function aC(e){return sD(e=new this(e),e.e+1,1)}sC[Symbol.for("nodejs.util.inspect.custom")]=sC.toString,sC[Symbol.toStringTag]="Decimal";var aA=sC.constructor=function e(t){var n,r,i;function o(e){var t,n,r;if(!(this instanceof o))return new o(e);if(this.constructor=o,ar(e)){this.s=e.s,su?!e.d||e.e>o.maxE?(this.e=NaN,this.d=null):e.e<o.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(r=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;su?t>o.maxE?(this.e=NaN,this.d=null):t<o.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return sH(this,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===n&&(e=e.slice(1)),this.s=1),sb.test(e)?sH(this,e):function(e,t){var n,r,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),sb.test(t))return sH(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(sy.test(t))n=16,t=t.toLowerCase();else if(sv.test(t))n=2;else if(sx.test(t))n=8;else throw Error(sh+t);for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),s=(o=t.indexOf("."))>=0,r=e.constructor,s&&(o=(a=(t=t.replace(".","")).length)-o,i=sN(r,new r(n),o,2*o)),o=c=(u=sT(t,n,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new r(0*e.s):(e.e=sE(u,c),e.d=u,su=!1,s&&(e=sI(e,i,4*a)),l&&(e=e.times(54>Math.abs(l)?sm(2,l):aA.pow(2,l))),su=!0,e)}(this,e);if("bigint"===r)return e<0?(e=-e,this.s=-1):this.s=1,sH(this,e.toString());throw Error(sh+e)}if(o.prototype=sC,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=s6,o.clone=e,o.isDecimal=ar,o.abs=sY,o.acos=sZ,o.acosh=sK,o.add=sX,o.asin=sJ,o.asinh=sQ,o.atan=s0,o.atanh=s1,o.atan2=s2,o.cbrt=s5,o.ceil=s3,o.clamp=s4,o.cos=s8,o.cosh=s9,o.div=s7,o.exp=ae,o.floor=at,o.hypot=an,o.ln=ai,o.log=ao,o.log10=aa,o.log2=as,o.max=al,o.min=au,o.mod=ac,o.mul=ah,o.pow=ad,o.random=af,o.round=ap,o.sign=ag,o.sin=am,o.sinh=av,o.sqrt=ay,o.sub=ax,o.sum=ab,o.tan=aw,o.tanh=aS,o.trunc=aC,void 0===t&&(t={}),t&&!0!==t.defaults)for(n=0,i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(sl);ss=new aA(ss),sa=new aA(sa);var aM={createBigNumberClass:oy("BigNumber",["?on","config"],e=>{var{on:t,config:n}=e,r=aA.clone({precision:n.precision,modulo:aA.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0})},ak={createMatrixClass:oy("Matrix",[],()=>{function e(){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0})},aT={MatrixDependencies:ak,createDenseMatrixClass:oy("DenseMatrix",["Matrix"],e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");if(t&&!iV(t))throw Error("Invalid datatype: "+t);if(i$(e))"DenseMatrix"===e.type?(this._data=oh(e._data),this._size=oh(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&iH(e.data)&&iH(e.size))this._data=e.data,this._size=e.size,oB(this._data,this._size),this._datatype=t||e.datatype;else if(iH(e))this._data=function e(t){for(var n=0,r=t.length;n<r;n++){var i=t[n];iH(i)?t[n]=e(i):i&&!0===i.isMatrix&&(t[n]=e(i.valueOf()))}return t}(e),this._size=oN(this._data),oB(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+oc(e)+")");else this._data=[],this._size=[0],this._datatype=t}function r(e,t,n){if(0===t.length){for(var r=e._data;iH(r);)r=r[0];return r}return e._size=t.slice(0),e._data=oj(e._data,e._size,n),e}function i(e,t,n){for(var i=e._size.slice(0),o=!1;i.length<t.length;)i.push(0),o=!0;for(var s=0,a=t.length;s<a;s++)t[s]>i[s]&&(i[s]=t[s],o=!0);o&&r(e,i,n)}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return o$(this._data,oc)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,r){switch(arguments.length){case 1:return function(e,t){if(!iY(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r=t.size();if(r.length!==e._size.length)throw new oP(r.length,e._size.length);for(var i=t.min(),o=t.max(),s=0,a=e._size.length;s<a;s++)oF(i[s],e._size[s]),oF(o[s],e._size[s]);return new n(function e(t,n,r,i){var o=i===r-1,s=n.dimension(i);return o?s.map(function(e){return oF(e,t.length),t[e]}).valueOf():s.map(function(o){return oF(o,t.length),e(t[o],n,r,i+1)}).valueOf()}(e._data,t,r.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var o,s=t.size(),a=t.isScalar();if(i$(n)?(o=n.size(),n=n.valueOf()):o=oN(n),a){if(0!==o.length)throw TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(s.length<e._size.length)throw new oP(s.length,e._size.length,"<");if(o.length<s.length){for(var l=0,u=0;1===s[l]&&1===o[l];)l++;for(;1===s[l];)u++,l++;n=oH(n,s.length,u,o)}if(!of(s,o))throw new oP(s,o,">");i(e,t.max().map(function(e){return e+1}),r);var c=s.length;!function e(t,n,r,i,o){var s=o===i-1,a=n.dimension(o);s?a.forEach(function(e,n){oF(e),t[e]=r[n[0]]}):a.forEach(function(s,a){oF(s),e(t[s],n,r[a[0]],i,o+1)})}(e._data,t,n,c,0)}return e}(this,e,t,r);default:throw SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){if(!iH(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new oP(e.length,this._size.length);for(var t=0;t<e.length;t++)oF(e[t],this._size[t]);for(var n=this._data,r=0,i=e.length;r<i;r++){var o=e[r];oF(o,n.length),n=n[o]}return n},n.prototype.set=function(e,t,n){if(!iH(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new oP(e.length,this._size.length,"<");i(this,e.map(function(e){return e+1}),n);var r,o,s,a=this._data;for(r=0,o=e.length-1;r<o;r++)oF(s=e[r],a.length),a=a[s];return oF(s=e[e.length-1],a.length),a[s]=t,this},n.prototype.resize=function(e,t,n){if(!iW(e))throw TypeError("Array or Matrix expected");var i=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return r(n?this.clone():this,i,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;n._data=function(e,t){var n=function(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw new oP(0,r,"!=");var i=oV(t=oz(t,r));if(r!==i)throw new oP(i,r,"!=");try{return function(e,t){for(var n,r=e,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var s=r.length/o,a=0;a<s;a++)n.push(r.slice(a*o,(a+1)*o));r=n}return r}(n,t)}catch(e){if(e instanceof oP)throw new oP(i,r,"!=");throw e}}(n._data,e);var r=n._size.reduce((e,t)=>e*t);return n._size=oz(e,r),n},n.prototype.clone=function(){return new n({data:oh(this._data),size:oh(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function n(r,i){return iH(r)?r.map(function(e,t){return n(e,i.concat(t))}):e(r,i,t)}(this._data,[]),i=void 0!==this._datatype?o$(r,oc):void 0;return new n(r,i)},n.prototype.forEach=function(e){var t=this;!function n(r,i){iH(r)?r.forEach(function(e,t){n(e,i.concat(t))}):e(r,i,t)}(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function* e(t,n){if(iH(t))for(var r=0;r<t.length;r++)yield*e(t[r],n.concat(r));else yield{value:t,index:n}};yield*e(this._data,[])},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var t of this._data)e.push(new n([t],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],r=this.size();if(2!==r.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,o=function(r){var o=i.map(e=>[e[r]]);t.push(new n(o,e._datatype))},s=0;s<r[1];s++)o(s);return t},n.prototype.toArray=function(){return oh(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return oR(this._data,e)},n.prototype.toString=function(){return oR(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(iB(e)&&(e=e.toNumber()),!iN(e)||!ow(e))throw TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=Math.min(this._size[0]-r,this._size[1]-t),o=[],s=0;s<i;s++)o[s]=this._data[s+r][s+t];return new n({data:o,size:[i],datatype:this._datatype})},n.diagonal=function(e,t,r,i){if(!iH(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(iB(e)&&(e=e.toNumber()),!iN(e)||!ow(e)||e<1)throw Error("Size values must be positive integers");return e}),r){if(iB(r)&&(r=r.toNumber()),!iN(r)||!ow(r))throw TypeError("The parameter k must be an integer number")}else r=0;var o,s=r>0?r:0,a=r<0?-r:0,l=e[0],u=e[1],c=Math.min(l-a,u-s);if(iH(t)){if(t.length!==c)throw Error("Invalid value array length");o=function(e){return t[e]}}else if(i$(t)){var h=t.size();if(1!==h.length||h[0]!==c)throw Error("Invalid matrix length");o=function(e){return t.get([e])}}else o=function(){return t};i||(i=iB(o(0))?o(0).mul(0):0);var d=[];if(e.length>0){d=oj(d,e,i);for(var f=0;f<c;f++)d[f+a][f+s]=o(f)}return new n({data:d,size:[l,u]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!iN(e)||!ow(e)||!iN(t)||!ow(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return oF(e,this._size[0]),oF(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r},n},{isClass:!0})};let aI=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},aD=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},aO=function(e,t){return((e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8)?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},aE=function(){throw SyntaxError("Invalid Param")};function a_(e,t){let n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):.5*Math.log((e*=.5)*e+(t*=.5)*t)+Math.LN2}let aR={re:0,im:0},aP=function(e,t){if(null==e)aR.re=aR.im=0;else if(void 0!==t)aR.re=e,aR.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)aR.re=e.re,aR.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return aL.INFINITY;aR.re=e.abs*Math.cos(e.arg),aR.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return aL.INFINITY;aR.re=e.r*Math.cos(e.phi),aR.im=e.r*Math.sin(e.phi)}else 2===e.length?(aR.re=e[0],aR.im=e[1]):aE();break;case"string":aR.im=aR.re=0;let n=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;null===n&&aE();for(let e=0;e<n.length;e++){let t=n[e];" "===t||" "===t||"\n"===t||("+"===t?r++:"-"===t?i++:("i"===t||"I"===t?(r+i===0&&aE()," "===n[e+1]||isNaN(n[e+1])?aR.im+=parseFloat((i%2?"-":"")+"1"):(aR.im+=parseFloat((i%2?"-":"")+n[e+1]),e++)):((r+i===0||isNaN(t))&&aE(),"i"===n[e+1]||"I"===n[e+1]?(aR.im+=parseFloat((i%2?"-":"")+t),e++):aR.re+=parseFloat((i%2?"-":"")+t)),r=i=0))}r+i>0&&aE();break;case"number":aR.im=0,aR.re=e;break;default:aE()}return isNaN(aR.re)||isNaN(aR.im),aR};function aL(e,t){if(!(this instanceof aL))return new aL(e,t);let n=aP(e,t);this.re=n.re,this.im=n.im}aL.prototype={re:0,im:0,sign:function(){let e=aO(this.re,this.im);return new aL(this.re/e,this.im/e)},add:function(e,t){let n=aP(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?aL.NAN:aL.INFINITY:new aL(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=aP(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?aL.NAN:aL.INFINITY:new aL(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=aP(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,s=0===n.re&&0===n.im;return r&&s||i&&o?aL.NAN:r||i?aL.INFINITY:0===n.im&&0===this.im?new aL(this.re*n.re,0):new aL(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=aP(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,s=0===n.re&&0===n.im;if(o&&s||r&&i)return aL.NAN;if(s||r)return aL.INFINITY;if(o||i)return aL.ZERO;if(0===n.im)return new aL(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new aL((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{let e=n.im/n.re,t=n.im*e+n.re;return new aL((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=aP(e,t),r=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return aL.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new aL(Math.pow(this.re,n.re),0);else if(0===this.re)switch((n.re%4+4)%4){case 0:return new aL(Math.pow(this.im,n.re),0);case 1:return new aL(0,Math.pow(this.im,n.re));case 2:return new aL(-Math.pow(this.im,n.re),0);case 3:return new aL(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return aL.ZERO;let i=Math.atan2(this.im,this.re),o=a_(this.re,this.im),s=Math.exp(n.re*o-n.im*i),a=n.im*o+n.re*i;return new aL(s*Math.cos(a),s*Math.sin(a))},sqrt:function(){let e=this.re,t=this.im;if(0===t)if(e>=0)return new aL(Math.sqrt(e),0);else return new aL(0,Math.sqrt(-e));let n=Math.sqrt(.5*(aO(e,t)+Math.abs(e))),r=Math.abs(t)/(2*n);return e>=0?new aL(n,t<0?-r:r):new aL(r,t<0?-n:n)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new aL(e,0):new aL(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e,t=this.re,n=this.im;return new aL(Math.expm1(t)*Math.cos(n)+-2*(e=Math.sin(.5*n))*e,Math.exp(t)*Math.sin(n))},log:function(){let e=this.re,t=this.im;return 0===t&&e>0?new aL(Math.log(e),0):new aL(a_(e,t),Math.atan2(t,e))},abs:function(){return aO(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new aL(Math.sin(e)*aI(t),Math.cos(e)*aD(t))},cos:function(){let e=this.re,t=this.im;return new aL(Math.cos(e)*aI(t),-Math.sin(e)*aD(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+aI(t);return new aL(Math.sin(e)/n,aD(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-aI(t);return new aL(-Math.sin(e)/n,aD(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*aI(2*t)+.5*Math.cos(2*e);return new aL(Math.cos(e)*aI(t)/n,Math.sin(e)*aD(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*aI(2*t)-.5*Math.cos(2*e);return new aL(Math.sin(e)*aI(t)/n,-Math.cos(e)*aD(t)/n)},asin:function(){let e=this.re,t=this.im,n=new aL(t*t-e*e+1,-2*e*t).sqrt(),r=new aL(n.re-t,n.im+e).log();return new aL(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new aL(t*t-e*e+1,-2*e*t).sqrt(),r=new aL(n.re-t,n.im+e).log();return new aL(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new aL(0,1/0);if(-1===t)return new aL(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new aL((1-t*t-e*e)/n,-2*e/n).log();return new aL(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new aL(Math.atan2(1,e),0);let n=e*e+t*t;return 0!==n?new aL(e/n,-t/n).atan():new aL(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new aL(0,1/0);let n=e*e+t*t;return 0!==n?new aL(e/n,-t/n).acos():new aL(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new aL(Math.PI/2,1/0);let n=e*e+t*t;return 0!==n?new aL(e/n,-t/n).asin():new aL(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new aL(aD(e)*Math.cos(t),aI(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new aL(aI(e)*Math.cos(t),aD(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=aI(e)+Math.cos(t);return new aL(aD(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=aI(e)-Math.cos(t);return new aL(aD(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-aI(2*e);return new aL(-2*aD(e)*Math.cos(t)/n,2*aI(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+aI(2*e);return new aL(2*aI(e)*Math.cos(t)/n,-2*aD(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new aL(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new aL(e<0?-n:n,0)}let n=new aL(e*e-t*t+1,2*e*t).sqrt();return new aL(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(0===t){if(e>1)return new aL(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new aL(Math.log(-e+t),Math.PI)}return new aL(0,Math.acos(e))}let n=new aL(e-1,t).sqrt(),r=new aL(e+1,t).sqrt();return new aL(e+n.re*r.re-n.im*r.im,t+n.re*r.im+n.im*r.re).log()},atanh:function(){let e=this.re,t=this.im;if(0===t)return 0===e?new aL(0,0):1===e?new aL(1/0,0):-1===e?new aL(-1/0,0):-1<e&&e<1?new aL(.5*Math.log((1+e)/(1-e)),0):e>1?new aL(.5*Math.log((e+1)/(e-1)),-Math.PI/2):new aL(.5*Math.log(-((1+e)/(1-e))),Math.PI/2);let n=1-e,r=1+e,i=n*n+t*t;if(0===i)return new aL(-1!==e?e/0:0,0!==t?t/0:0);let o=(r*n-t*t)/i,s=(t*n+r*t)/i;return new aL(a_(o,s)/2,Math.atan2(s,o)/2)},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new aL(0,Math.PI/2);let n=e*e+t*t;return 0!==n?new aL(e/n,-t/n).atanh():new aL(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new aL(1/0,0);let t=1/e;return new aL(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return 0!==n?new aL(e/n,-t/n).asinh():new aL(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return aL.INFINITY;let n=e*e+t*t;return 0!==n?new aL(e/n,-t/n).acosh():new aL(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return aL.INFINITY;if(this.isInfinite())return aL.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new aL(e/n,-t/n)},conjugate:function(){return new aL(this.re,-this.im)},neg:function(){return new aL(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new aL(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new aL(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new aL(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=aP(e,t);return Math.abs(n.re-this.re)<=aL.EPSILON&&Math.abs(n.im-this.im)<=aL.EPSILON},clone:function(){return new aL(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<aL.EPSILON&&(e=0),Math.abs(t)<aL.EPSILON&&(t=0),0===t)?n+e:(0!==e?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),1!==t&&(n+=t),n+"i")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},aL.ZERO=new aL(0,0),aL.ONE=new aL(1,0),aL.I=new aL(0,1),aL.PI=new aL(Math.PI,0),aL.E=new aL(Math.E,0),aL.INFINITY=new aL(1/0,1/0),aL.NAN=new aL(NaN,NaN),aL.EPSILON=1e-15;var aN=oy("Complex",[],()=>(aL.prototype.type="Complex",aL.prototype.isComplex=!0,aL.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},aL.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},aL.prototype.format=function(e){var t=this.im,n=this.re,r=oC(this.re,e),i=oC(this.im,e),o=iN(e)?e:e?e.precision:null;if(null!==o){var s=Math.pow(10,-o);Math.abs(n/t)<s&&(n=0),Math.abs(t/n)<s&&(t=0)}return 0===t?r:0===n?1===t?"i":-1===t?"-i":i+"i":t<0?-1===t?r+" - i":r+" - "+i.substring(1)+"i":1===t?r+" + i":r+" + "+i+"i"},aL.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return aL(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(iN(n)){if(iz(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),iN(r))return new aL({r:n,phi:r});throw TypeError("Phi is not a number nor an angle unit.")}throw TypeError("Radius r is not a number.");default:throw SyntaxError("Wrong number of arguments in function fromPolar")}},aL.prototype.valueOf=aL.prototype.toString,aL.fromJSON=function(e){return new aL(e)},aL.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},aL),{isClass:!0}),aB={s:1,n:0,d:1};function aF(e,t){if(isNaN(e=parseInt(e,10)))throw aG();return e*t}function aj(e,t){if(0===t)throw aW();var n=Object.create(a$.prototype);n.s=e<0?-1:1;var r=aH(e=e<0?-e:e,t);return n.n=e/r,n.d=t/r,n}function az(e){for(var t={},n=e,r=2,i=4;i<=n;){for(;n%r==0;)n/=r,t[r]=(t[r]||0)+1;i+=1+2*r++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var aV=function(e,t){var n,r=0,i=1,o=1,s=0,a=0,l=0,u=1,c=1,h=0,d=1,f=1,p=1;if(null==e);else if(void 0!==t){if(o=(r=e)*(i=t),r%1!=0||i%1!=0)throw aU()}else switch(typeof e){case"object":if("d"in e&&"n"in e)r=e.n,i=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(i=e[1]);else throw aG();o=r*i;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)r=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);d<=1e7&&p<=1e7;){if(e===(n=(h+f)/(d+p))){d+p<=1e7?(r=h+f,i=d+p):p>d?(r=f,i=p):(r=h,i=d);break}e>n?(h+=f,d+=p):(f+=h,p+=d),d>1e7?(r=f,i=p):(r=h,i=d)}r*=c}else(isNaN(e)||isNaN(t))&&(i=r=NaN);break;case"string":if(null===(d=e.match(/\d+|./g)))throw aG();if("-"===d[h]?(o=-1,h++):"+"===d[h]&&h++,d.length===h+1?a=aF(d[h++],o):"."===d[h+1]||"."===d[h]?("."!==d[h]&&(s=aF(d[h++],o)),(++h+1===d.length||"("===d[h+1]&&")"===d[h+3]||"'"===d[h+1]&&"'"===d[h+3])&&(a=aF(d[h],o),u=Math.pow(10,d[h].length),h++),("("===d[h]&&")"===d[h+2]||"'"===d[h]&&"'"===d[h+2])&&(l=aF(d[h+1],o),c=Math.pow(10,d[h+1].length)-1,h+=3)):"/"===d[h+1]||":"===d[h+1]?(a=aF(d[h],o),u=aF(d[h+2],1),h+=3):"/"===d[h+3]&&" "===d[h+1]&&(s=aF(d[h],o),a=aF(d[h+2],o),u=aF(d[h+4],1),h+=5),d.length<=h){o=r=l+(i=u*c)*s+c*a;break}default:throw aG()}if(0===i)throw aW();aB.s=o<0?-1:1,aB.n=Math.abs(r),aB.d=Math.abs(i)};function aH(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function a$(e,t){if(aV(e,t),!(this instanceof a$))return aj(aB.s*aB.n,aB.d);e=aH(aB.d,aB.n),this.s=aB.s,this.n=aB.n/e,this.d=aB.d/e}var aW=function(){return Error("Division by Zero")},aG=function(){return Error("Invalid argument")},aU=function(){return Error("Parameters must be integer")};a$.prototype={s:1,n:0,d:1,abs:function(){return aj(this.n,this.d)},neg:function(){return aj(-this.s*this.n,this.d)},add:function(e,t){return aV(e,t),aj(this.s*this.n*aB.d+aB.s*this.d*aB.n,this.d*aB.d)},sub:function(e,t){return aV(e,t),aj(this.s*this.n*aB.d-aB.s*this.d*aB.n,this.d*aB.d)},mul:function(e,t){return aV(e,t),aj(this.s*aB.s*this.n*aB.n,this.d*aB.d)},div:function(e,t){return aV(e,t),aj(this.s*aB.s*this.n*aB.d,this.d*aB.n)},clone:function(){return aj(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new a$(NaN);if(void 0===e)return aj(this.s*this.n%this.d,1);if(aV(e,t),0===aB.n&&0===this.d)throw aW();return aj(this.s*(aB.d*this.n)%(aB.n*this.d),aB.d*this.d)},gcd:function(e,t){return aV(e,t),aj(aH(aB.n,this.n)*aH(aB.d,this.d),aB.d*this.d)},lcm:function(e,t){return(aV(e,t),0===aB.n&&0===this.n)?aj(0,1):aj(aB.n*this.n,aH(aB.n,this.n)*aH(aB.d,this.d))},ceil:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new a$(NaN):aj(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new a$(NaN):aj(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new a$(NaN):aj(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return aV(e,t),aj(this.s*Math.round(this.n*aB.d/(this.d*aB.n))*aB.n,aB.d)},inverse:function(){return aj(this.s*this.d,this.n)},pow:function(e,t){if(aV(e,t),1===aB.d)if(aB.s<0)return aj(Math.pow(this.s*this.d,aB.n),Math.pow(this.n,aB.n));else return aj(Math.pow(this.s*this.n,aB.n),Math.pow(this.d,aB.n));if(this.s<0)return null;var n=az(this.n),r=az(this.d),i=1,o=1;for(var s in n)if("1"!==s){if("0"===s){i=0;break}if(n[s]*=aB.n,n[s]%aB.d!=0)return null;n[s]/=aB.d,i*=Math.pow(s,n[s])}for(var s in r)if("1"!==s){if(r[s]*=aB.n,r[s]%aB.d!=0)return null;r[s]/=aB.d,o*=Math.pow(s,r[s])}return aB.s<0?aj(o,i):aj(i,o)},equals:function(e,t){return aV(e,t),this.s*this.n*aB.d==aB.s*aB.n*this.d},compare:function(e,t){aV(e,t);var n=this.s*this.n*aB.d-aB.s*aB.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),r=1;r<n.length;r++){for(var i=aj(n[r-1],1),o=r-2;o>=0;o--)i=i.inverse().add(n[o]);if(Math.abs(i.sub(t).valueOf())<e)return i.mul(this.s)}return this},divisible:function(e,t){return aV(e,t),!(!(aB.n*this.d)||this.n*aB.d%(aB.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do r.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(1!==t);return r},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var r=function(e){for(;e%2==0;e/=2);for(;e%5==0;e/=5);if(1===e)return 0;for(var t=10%e,n=1;1!==t;n++)if(t=10*t%e,n>2e3)return 0;return n}(n),i=function(e,t){for(var n=1,r=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,t,e),i=0;i<300;i++){if(n===r)return i;n=10*n%e,r=10*r%e}return 0}(n,r),o=this.s<0?"-":"";if(o+=t/n|0,t%=n,(t*=10)&&(o+="."),r){for(var s=i;s--;)o+=t/n|0,t%=n,t*=10;o+="(";for(var s=r;s--;)o+=t/n|0,t%=n,t*=10;o+=")"}else for(var s=e;t&&s--;)o+=t/n|0,t%=n,t*=10;return o}};var aq=oy("Fraction",[],()=>(a$.prototype.type="Fraction",a$.prototype.isFraction=!0,a$.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},a$.fromJSON=function(e){return new a$(e)},a$),{isClass:!0}),aY=n(42915);function aZ(e,t){return!!e&&"object"==typeof e&&(!!og(aX,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function aK(e){return"object"==typeof e&&e&&e.constructor===Object}var aX={length:!0,name:!0},aJ={toString:!0,valueOf:!0,toLocaleString:!0};class aQ{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){var t,n,r=this.wrappedObject;if(aK(r)&&aZ(r,e))return r[e];if("function"==typeof r[e]&&(t=r,n=e,!(null==t||"function"!=typeof t[n]||og(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(og(aJ,n)||!(n in Object.prototype)&&!(n in Function.prototype))))throw Error('Cannot access method "'+e+'" as a property');throw Error('No access to property "'+e+'"')}set(e,t){return!function(e,t,n){if(aK(e)&&aZ(e,t))return e[t]=n;throw Error('No access to property "'+t+'"')}(this.wrappedObject,e,t),this}has(e){return e in this.wrappedObject}}function a0(e){return!!e&&(e instanceof Map||e instanceof aQ||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var a1=function(){return a1=aY.create,aY};function a2(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function a5(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function a3(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var a4={BigNumberDependencies:aM,ComplexDependencies:{createComplexClass:aN},DenseMatrixDependencies:aT,FractionDependencies:{createFractionClass:aq},createTyped:oy("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,o=a1();return o.types=[{name:"number",test:iN},{name:"Complex",test:iF},{name:"BigNumber",test:iB},{name:"Fraction",test:ij},{name:"Unit",test:iz},{name:"string",test:iV},{name:"Chain",test:ou},{name:"Array",test:iH},{name:"Matrix",test:i$},{name:"DenseMatrix",test:iG},{name:"SparseMatrix",test:iU},{name:"Range",test:iq},{name:"Index",test:iY},{name:"boolean",test:iZ},{name:"ResultSet",test:iK},{name:"Help",test:iX},{name:"function",test:iJ},{name:"Date",test:iQ},{name:"RegExp",test:i0},{name:"null",test:i2},{name:"undefined",test:i5},{name:"AccessorNode",test:i3},{name:"ArrayNode",test:i4},{name:"AssignmentNode",test:i6},{name:"BlockNode",test:i8},{name:"ConditionalNode",test:i9},{name:"ConstantNode",test:i7},{name:"FunctionNode",test:ot},{name:"FunctionAssignmentNode",test:oe},{name:"IndexNode",test:on},{name:"Node",test:or},{name:"ObjectNode",test:oi},{name:"OperatorNode",test:oo},{name:"ParenthesisNode",test:os},{name:"RangeNode",test:oa},{name:"SymbolNode",test:ol},{name:"Map",test:a0},{name:"Object",test:i1}],o.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||a2(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||a5(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||a5(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||a5(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||a3(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||a2(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||a3(e);try{return new i(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||a5(e);try{return new n(e)}catch(t){throw Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||a2(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||a3(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],o})},a6="equalScalar",a8=oy(a6,["typed","config"],e=>{var{typed:t,config:n}=e;return t(a6,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return oO(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||function(e,t,n){if(null==n)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var r=e.minus(t).abs();if(r.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return r.lte(i.times(n))}return!1}(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){var r;return r=n.epsilon,oO(e.re,t.re,r)&&oO(e.im,t.im,r)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw Error("Cannot compare units with different base");return this(e.value,t.value)}})});oy(a6,["typed","config"],e=>{var{typed:t,config:n}=e;return t(a6,{"number, number":function(e,t){return oO(e,t,n.epsilon)}})});var a9={typedDependencies:a4,createEqualScalar:a8},a7=oy("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");if(t&&!iV(t))throw Error("Invalid datatype: "+t);if(i$(e)){var n,r,s;n=this,r=e,s=t,"SparseMatrix"===r.type?(n._values=r._values?oh(r._values):void 0,n._index=oh(r._index),n._ptr=oh(r._ptr),n._size=oh(r._size),n._datatype=s||r._datatype):o(n,r.valueOf(),s||r._datatype)}else if(e&&iH(e.index)&&iH(e.ptr)&&iH(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(iH(e))o(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+oc(e)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function o(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var o=r.length,s=0,a=n,l=0;if(iV(i)&&(a=t.find(n,[i,i])||n,l=t.convert(0,i)),o>0){var u=0;do{e._ptr.push(e._index.length);for(var c=0;c<o;c++){var h=r[c];if(iH(h)){if(0===u&&s<h.length&&(s=h.length),u<h.length){var d=h[u];a(d,l)||(e._values.push(d),e._index.push(c))}}else 0===u&&s<1&&(s=1),a(h,l)||(e._values.push(h),e._index.push(c))}u++}while(u<s)}e._ptr.push(e._index.length),e._size=[o,s]}function s(e,t,n,r){if(n-t==0)return n;for(var i=t;i<n;i++)if(r[i]===e)return i;return t}function a(e,t,n,r,i,o,s){i.splice(e,0,r),o.splice(e,0,t);for(var a=n+1;a<s.length;a++)s[a]++}function l(e,r,i,o){var s,a,l,u=o||0,c=n,h=0;iV(e._datatype)&&(c=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype),u=t.convert(u,e._datatype));var d=!c(u,h),f=e._size[0],p=e._size[1];if(i>p){for(a=p;a<i;a++)if(e._ptr[a]=e._values.length,d)for(s=0;s<f;s++)e._values.push(u),e._index.push(s);e._ptr[i]=e._values.length}else i<p&&(e._ptr.splice(i+1,p-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(p=i,r>f){if(d){var g=0;for(a=0;a<p;a++){e._ptr[a]=e._ptr[a]+g,l=e._ptr[a+1]+g;var m=0;for(s=f;s<r;s++,m++)e._values.splice(l+m,0,u),e._index.splice(l+m,0,s),g++}e._ptr[p]=e._values.length}}else if(r<f){var v=0;for(a=0;a<p;a++){e._ptr[a]=e._ptr[a]-v;var y=e._ptr[a],x=e._ptr[a+1]-v;for(l=y;l<x;l++)(s=e._index[l])>r-1&&(e._values.splice(l,1),e._index.splice(l,1),v++)}e._ptr[a]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function u(e,t,n,r,i){var o,s,a=r[0],l=r[1],u=[];for(o=0;o<a;o++)for(s=0,u[o]=[];s<l;s++)u[o][s]=0;for(s=0;s<l;s++)for(var c=n[s],h=n[s+1],d=c;d<h;d++)u[o=t[d]][s]=e?i?oh(e[d]):e[d]:1;return u}return i.prototype=new r,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return o$(this._values,oc)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},i.prototype.subset=function(e,t,n){if(!this._values)throw Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!iY(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,r,o,s,a=t.size();if(a.length!==e._size.length)throw new oP(a.length,e._size.length);var l=t.min(),u=t.max();for(n=0,r=e._size.length;n<r;n++)oF(l[n],e._size[n]),oF(u[n],e._size[n]);var c=e._values,h=e._index,d=e._ptr,f=t.dimension(0),p=t.dimension(1),g=[],m=[];f.forEach(function(e,t){m[e]=t[0],g[e]=!0});var v=c?[]:void 0,y=[],x=[];return p.forEach(function(e){for(x.push(y.length),o=d[e],s=d[e+1];o<s;o++)!0===g[n=h[o]]&&(y.push(m[n]),v&&v.push(c[o]))}),x.push(y.length),new i({values:v,index:y,ptr:x,size:a,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var i,o=t.size(),s=t.isScalar();if(i$(n)?(i=n.size(),n=n.toArray()):i=oN(n),s){if(0!==i.length)throw TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(1!==o.length&&2!==o.length)throw new oP(o.length,e._size.length,"<");if(i.length<o.length){for(var a=0,l=0;1===o[a]&&1===i[a];)a++;for(;1===o[a];)l++,a++;n=oH(n,o.length,l,i)}if(!of(o,i))throw new oP(o,i,">");if(1===o.length)t.dimension(0).forEach(function(t,i){oF(t),e.set([t,0],n[i[0]],r)});else{var u=t.dimension(0),c=t.dimension(1);u.forEach(function(t,i){oF(t),c.forEach(function(o,s){oF(o),e.set([t,o],n[i[0]][s[0]],r)})})}}return e}(this,e,t,n);default:throw SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!iH(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new oP(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];oF(t,this._size[0]),oF(n,this._size[1]);var r=s(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},i.prototype.set=function(e,r,i){if(!iH(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new oP(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke set on a Pattern only matrix");var o=e[0],u=e[1],c=this._size[0],h=this._size[1],d=n,f=0;iV(this._datatype)&&(d=t.find(n,[this._datatype,this._datatype])||n,f=t.convert(0,this._datatype)),(o>c-1||u>h-1)&&(l(this,Math.max(o+1,c),Math.max(u+1,h),i),c=this._size[0],h=this._size[1]),oF(o,c),oF(u,h);var p=s(o,this._ptr[u],this._ptr[u+1],this._index);return p<this._ptr[u+1]&&this._index[p]===o?d(r,f)?function(e,t,n,r,i){n.splice(e,1),r.splice(e,1);for(var o=t+1;o<i.length;o++)i[o]--}(p,u,this._values,this._index,this._ptr):this._values[p]=r:a(p,o,u,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(e,t,n){if(!iW(e))throw TypeError("Array or Matrix expected");var r=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==r.length)throw Error("Only two dimensions matrix are supported");return r.forEach(function(e){if(!iN(e)||!ow(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+oR(r)+")")}),l(n?this.clone():this,r[0],r[1],t)},i.prototype.reshape=function(e,t){if(!iH(e))throw TypeError("Array expected");if(2!==e.length)throw Error("Sparse matrices can only be reshaped in two dimensions");e.forEach(function(t){if(!iN(t)||!ow(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+oR(e)+")")});var n=this._size[0]*this._size[1],r=(e=oz(e,n))[0]*e[1];if(n!==r)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var i=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return i;for(var o=[],l=0;l<i._ptr.length;l++)for(var u=0;u<i._ptr[l+1]-i._ptr[l];u++)o.push(l);for(var c=i._values.slice(),h=i._index.slice(),d=0;d<i._index.length;d++){var f=h[d],p=o[d],g=f*i._size[1]+p;o[d]=g%e[1],h[d]=Math.floor(g/e[1])}i._values.length=0,i._index.length=0,i._ptr.length=e[1]+1,i._size=e.slice();for(var m=0;m<i._ptr.length;m++)i._ptr[m]=0;for(var v=0;v<c.length;v++){var y=h[v],x=o[v],b=c[v];a(s(y,i._ptr[x],i._ptr[x+1],i._index),y,x,b,i._values,i._index,i._ptr)}return i},i.prototype.clone=function(){return new i({values:this._values?oh(this._values):void 0,index:oh(this._index),ptr:oh(this._ptr),size:oh(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,r){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(e,r,o,s,a){var l=[],u=[],c=[],h=n,d=0;iV(e._datatype)&&(h=t.find(n,[e._datatype,e._datatype])||n,d=t.convert(0,e._datatype));for(var f=function(e,t,n){e=s(e,t,n),h(e,d)||(l.push(e),u.push(t))},p=0;p<=o;p++){c.push(l.length);var g=e._ptr[p],m=e._ptr[p+1];if(a)for(var v=g;v<m;v++){var y=e._index[v];y>=0&&y<=r&&f(e._values[v],y-0,p-0)}else{for(var x={},b=g;b<m;b++)x[e._index[b]]=e._values[b];for(var w=0;w<=r;w++)f(w in x?x[w]:0,w-0,p-0)}}return c.push(l.length),new i({values:l,index:u,ptr:c,size:[r-0+1,o-0+1]})}(this,this._size[0]-1,this._size[1]-1,function(t,n,r){return e(t,[n,r],o)},r)},i.prototype.forEach=function(e,t){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],i=0;i<r;i++){var o=this._ptr[i],s=this._ptr[i+1];if(t)for(var a=o;a<s;a++){var l=this._index[a];e(this._values[a],[l,i],this)}else{for(var u={},c=o;c<s;c++)u[this._index[c]]=this._values[c];for(var h=0;h<n;h++)e(h in u?u[h]:0,[h,i],this)}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],r=this._ptr[t+1],i=n;i<r;i++){var o=this._index[i];yield{value:this._values[i],index:[o,t]}}},i.prototype.toArray=function(){return u(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return u(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),i="Sparse Matrix ["+oR(t,e)+" x "+oR(n,e)+"] density: "+oR(r,e)+"\n",o=0;o<n;o++)for(var s=this._ptr[o],a=this._ptr[o+1],l=s;l<a;l++)i+="\n ("+oR(this._index[l],e)+", "+oR(o,e)+") ==> "+(this._values?oR(this._values[l],e):"X");return i},i.prototype.toString=function(){return oR(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(iB(e)&&(e=e.toNumber()),!iN(e)||!ow(e))throw TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],o=this._size[1],s=Math.min(r-n,o-t),a=[],l=[],u=[];u[0]=0;for(var c=t;c<o&&a.length<s;c++)for(var h=this._ptr[c],d=this._ptr[c+1],f=h;f<d;f++){var p=this._index[f];if(p===c-t+n){a.push(this._values[f]),l[a.length-1]=p-n;break}}return u.push(a.length),new i({values:a,index:l,ptr:u,size:[s,1]})},i.fromJSON=function(e){return new i(e)},i.diagonal=function(e,r,o,s,a){if(!iH(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(iB(e)&&(e=e.toNumber()),!iN(e)||!ow(e)||e<1)throw Error("Size values must be positive integers");return e}),o){if(iB(o)&&(o=o.toNumber()),!iN(o)||!ow(o))throw TypeError("The parameter k must be an integer number")}else o=0;var l,u=n,c=0;iV(a)&&(u=t.find(n,[a,a])||n,c=t.convert(0,a));var h=o>0?o:0,d=o<0?-o:0,f=e[0],p=e[1],g=Math.min(f-d,p-h);if(iH(r)){if(r.length!==g)throw Error("Invalid value array length");l=function(e){return r[e]}}else if(i$(r)){var m=r.size();if(1!==m.length||m[0]!==g)throw Error("Invalid matrix length");l=function(e){return r.get([e])}}else l=function(){return r};for(var v=[],y=[],x=[],b=0;b<p;b++){x.push(v.length);var w=b-h;if(w>=0&&w<g){var S=l(w);u(S,c)||(y.push(w+d),v.push(S))}}return x.push(v.length),new i({values:v,index:y,ptr:x,size:[f,p]})},i.prototype.swapRows=function(e,t){if(!iN(e)||!ow(e)||!iN(t)||!ow(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return oF(e,this._size[0]),oF(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,n,r,i){for(var o=r[e],s=r[e+1],a=o;a<s;a++)i(n[a],t[a])},i._swapRows=function(e,t,n,r,i,o){for(var a=0;a<n;a++){var l=o[a],u=o[a+1],c=s(e,l,u,i),h=s(t,l,u,i);if(c<u&&h<u&&i[c]===e&&i[h]===t){if(r){var d=r[c];r[c]=r[h],r[h]=d}continue}if(c<u&&i[c]===e&&(h>=u||i[h]!==t)){var f=r?r[c]:void 0;i.splice(h,0,t),r&&r.splice(h,0,f),i.splice(h<=c?c+1:c,1),r&&r.splice(h<=c?c+1:c,1);continue}if(h<u&&i[h]===t&&(c>=u||i[c]!==e)){var p=r?r[h]:void 0;i.splice(c,0,e),r&&r.splice(c,0,p),i.splice(c<=h?h+1:h,1),r&&r.splice(c<=h?h+1:h,1)}}},i},{isClass:!0}),le="matrix",lt={DenseMatrixDependencies:aT,MatrixDependencies:ak,SparseMatrixDependencies:{MatrixDependencies:ak,equalScalarDependencies:a9,typedDependencies:a4,createSparseMatrixClass:a7},typedDependencies:a4,createMatrix:oy(le,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(le,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new i(e,n);throw TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})},ln="zeros",lr=oy(ln,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(ln,{"":function(){return"Array"===n.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===n.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var n,o=(n=!1,e.forEach(function(e,t,r){iB(e)&&(n=!0,r[t]=e.toNumber())}),n)?new i(0):0;if(e.forEach(function(e){if("number"!=typeof e||!ow(e)||e<0)throw Error("Parameters in function zeros must be positive integers")}),t){var s=r(t);return e.length>0?s.resize(e,o):s}var a=[];return e.length>0?oj(a,e,o):a}}),li=oy("algorithm11",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i,o){var s,a=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!a)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=n,g=0,m=i;"string"==typeof h&&(s=h,p=t.find(n,[s,s]),g=t.convert(0,s),r=t.convert(r,s),m=t.find(i,[s,s]));for(var v=[],y=[],x=[],b=0;b<f;b++){x[b]=y.length;for(var w=u[b],S=u[b+1],C=w;C<S;C++){var A=l[C],M=o?m(r,a[C]):m(a[C],r);p(M,g)||(y.push(A),v.push(M))}}return x[f]=y.length,e.createSparseMatrix({values:v,index:y,ptr:x,size:[d,f],datatype:s})}}),lo=oy("algorithm12",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){var s,a=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!a)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=i;"string"==typeof h&&(s=h,r=t.convert(r,s),p=t.find(i,[s,s]));for(var g=[],m=[],v=[],y=0;y<f;y++){for(var x=y+1,b=u[y],w=u[y+1],S=b;S<w;S++){var C=l[S];m[C]=a[S],v[C]=x}for(var A=0;A<d;A++)0===y&&(g[A]=[]),v[A]===x?g[A][y]=o?p(r,m[A]):p(m[A],r):g[A][y]=o?p(r,0):p(0,r)}return new n({data:g,size:[d,f],datatype:s})}}),ls=oy("algorithm14",["typed"],e=>{var{typed:t}=e;return function(e,n,r,i){var o,s=e._data,a=e._size,l=e._datatype,u=r;"string"==typeof l&&(o=l,n=t.convert(n,o),u=t.find(r,[o,o]));var c=a.length>0?function e(t,n,r,i,o,s,a){var l=[];if(n===r.length-1)for(var u=0;u<i;u++)l[u]=a?t(s,o[u]):t(o[u],s);else for(var c=0;c<i;c++)l[c]=e(t,n+1,r,r[n+1],o[c],s,a);return l}(u,0,a,a[0],s,n,i):[];return e.createDenseMatrix({data:c,size:oh(a),datatype:o})}});function la(e,t){var n;if(!ow(e)||!ow(t))throw Error("Parameters in function gcd must be integer numbers");for(;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}function ll(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ow(t)||t<0||t>15)throw Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(oM(e,t))}la.signature="number, number";var lu="Number of decimals in function round must be an integer",lc="round",lh=oy(lc,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,BigNumber:o,DenseMatrix:s}=e,a=li({typed:t,equalScalar:r}),l=lo({typed:t,DenseMatrix:s}),u=ls({typed:t});return t(lc,{number:ll,"number, number":ll,"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lu);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(lu);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lu);var n=t.toNumber();return e.round(n)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lu);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(lu);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lu);return e.round(t.toNumber())},"Array | Matrix":function(e){return function e(t,n,r){return t&&"function"==typeof t.map?t.map(function(t){return e(t,n,r)}):n(t)}(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return a(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"Array, number | BigNumber":function(e,t){return u(n(e),t,this,!1).valueOf()},"number | Complex | BigNumber | Fraction, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"number | Complex | BigNumber | Fraction, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber | Fraction, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),ld=oy("algorithm01",["typed"],e=>{var{typed:t}=e;return function(e,n,r,i){var o,s,a=e._data,l=e._size,u=e._datatype,c=n._values,h=n._index,d=n._ptr,f=n._size,p=n._datatype;if(l.length!==f.length)throw new oP(l.length,f.length);if(l[0]!==f[0]||l[1]!==f[1])throw RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");if(!c)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],m=l[1],v="string"==typeof u&&u===p?u:void 0,y=v?t.find(r,[v,v]):r,x=[];for(o=0;o<g;o++)x[o]=[];var b=[],w=[];for(s=0;s<m;s++){for(var S=s+1,C=d[s],A=d[s+1],M=C;M<A;M++)b[o=h[M]]=i?y(c[M],a[o][s]):y(a[o][s],c[M]),w[o]=S;for(o=0;o<g;o++)w[o]===S?x[o][s]=b[o]:x[o][s]=a[o][s]}return e.createDenseMatrix({data:x,size:[g,m],datatype:v})}}),lf=oy("algorithm04",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var o,s,a,l,u,c,h=e._values,d=e._index,f=e._ptr,p=e._size,g=e._datatype,m=r._values,v=r._index,y=r._ptr,x=r._size,b=r._datatype;if(p.length!==x.length)throw new oP(p.length,x.length);if(p[0]!==x[0]||p[1]!==x[1])throw RangeError("Dimension mismatch. Matrix A ("+p+") must match Matrix B ("+x+")");var w=p[0],S=p[1],C=n,A=0,M=i;"string"==typeof g&&g===b&&(o=g,C=t.find(n,[o,o]),A=t.convert(0,o),M=t.find(i,[o,o]));var k=h&&m?[]:void 0,T=[],I=[],D=h&&m?[]:void 0,O=h&&m?[]:void 0,E=[],_=[];for(a=0;a<S;a++){I[a]=T.length;var R=a+1;for(u=f[a],c=f[a+1],l=u;l<c;l++)s=d[l],T.push(s),E[s]=R,D&&(D[s]=h[l]);for(u=y[a],c=y[a+1],l=u;l<c;l++)if(E[s=v[l]]===R){if(D){var P=M(D[s],m[l]);C(P,A)?E[s]=null:D[s]=P}}else T.push(s),_[s]=R,O&&(O[s]=m[l]);if(D&&O)for(l=I[a];l<T.length;)E[s=T[l]]===R?(k[l]=D[s],l++):_[s]===R?(k[l]=O[s],l++):T.splice(l,1)}return I[S]=T.length,e.createSparseMatrix({values:k,index:T,ptr:I,size:[w,S],datatype:o})}}),lp=oy("algorithm10",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){var s,a=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!a)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=i;"string"==typeof h&&(s=h,r=t.convert(r,s),p=t.find(i,[s,s]));for(var g=[],m=[],v=[],y=0;y<f;y++){for(var x=y+1,b=u[y],w=u[y+1],S=b;S<w;S++){var C=l[S];m[C]=a[S],v[C]=x}for(var A=0;A<d;A++)0===y&&(g[A]=[]),v[A]===x?g[A][y]=o?p(r,m[A]):p(m[A],r):g[A][y]=r}return new n({data:g,size:[d,f],datatype:s})}}),lg=oy("algorithm13",["typed"],e=>{var{typed:t}=e;return function(e,n,r){var i,o=e._data,s=e._size,a=e._datatype,l=n._data,u=n._size,c=n._datatype,h=[];if(s.length!==u.length)throw new oP(s.length,u.length);for(var d=0;d<s.length;d++){if(s[d]!==u[d])throw RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+u+")");h[d]=s[d]}var f=r;"string"==typeof a&&a===c&&(i=a,f=t.find(r,[i,i]));var p=h.length>0?function e(t,n,r,i,o,s){var a=[];if(n===r.length-1)for(var l=0;l<i;l++)a[l]=t(o[l],s[l]);else for(var u=0;u<i;u++)a[u]=e(t,n+1,r,r[n+1],o[u],s[u]);return a}(f,0,h,h[0],o,l):[];return e.createDenseMatrix({data:p,size:h,datatype:i})}}),lm=oy("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:o}=e,s=ld({typed:t}),a=lf({typed:t,equalScalar:r}),l=lp({typed:t,DenseMatrix:o}),u=lg({typed:t}),c=ls({typed:t});return t("gcd",{"number, number":la,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var n=new i(0);!t.isZero();){var r=e.mod(t);e=t,t=r}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}})});let{round:lv}=oK({roundDependencies:{BigNumberDependencies:aM,DenseMatrixDependencies:aT,equalScalarDependencies:a9,matrixDependencies:lt,typedDependencies:a4,zerosDependencies:{BigNumberDependencies:aM,matrixDependencies:lt,typedDependencies:a4,createZeros:lr},createRound:lh}}),{gcd:ly}=oK({gcdDependencies:{BigNumberDependencies:aM,DenseMatrixDependencies:aT,equalScalarDependencies:a9,matrixDependencies:lt,typedDependencies:a4,createGcd:lm}}),lx=10;function lb(e,t){let n=t.startMs,r=e.values,i=[];for(let e of r){for(;n<e[0];)i.push([n,null]),n+=t.stepMs;i.push([n,e[1]]),n+=t.stepMs}for(;n<=t.endMs;)i.push([n,null]),n+=t.stepMs;return i}function lw(e){let t,n,r=[];for(let t of e)if(t&&"timeRange"in t){if(void 0===t||void 0===t.timeRange||void 0===t.stepMs)continue;if(r.push(t.stepMs),void 0===n){n=t.timeRange;continue}t.timeRange.start<n.start&&(n.start=t.timeRange.start),t.timeRange.end>n.end&&(n.end=t.timeRange.end)}else if(t&&"values"in t){for(let e=0;e<t.values.length;e++){let r=t.values[e];if(void 0===r)continue;let[i]=r,o=new Date(i),s=new Date(i);if(void 0===n){n={start:o,end:s};continue}o<n.start&&(n.start=o),s>n.end&&(n.end=s)}if(void 0===n)return;let e=n.start.valueOf(),r=n.end.valueOf(),i=r-e;return{startMs:e,endMs:r,rangeMs:i,stepMs:lx}}if(void 0===n)return;if(1===r.length)t=r[0];else{let e=ly(...r);t=e<lx?lx:e}let i=n.start.valueOf(),o=n.end.valueOf();return{startMs:i,endMs:o,stepMs:t,rangeMs:o-i}}function lS(e){return/^[0-9a-fA-F]+$/.test(e)}function lC(e){return e.spec?.spec?.display?.name?e.spec.spec.display.name:e.spec?.display?.name?e.spec.display.name:e.metadata.name}function lA(e){return e.spec?.spec?.display?.name?`${e.spec.spec.display.name} (ID: ${e.metadata.name})`:e.spec?.display?.name?`${e.spec.display.name} (ID: ${e.metadata.name})`:e.metadata.name}let lM=(0,w.createContext)(void 0);function lk(e){let{children:t,timeZone:n}=e;return(0,b.jsx)(lM.Provider,{value:n,children:t})}function lT(){let e=(0,w.useContext)(lM);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>ig(t,n,e),dateFormatOptionsWithUserTimeZone:t=>ip(t,e)}}function lI({label:e,color:t,size:n="small",onColorChange:r,onClear:i}){let[o,s]=(0,w.useState)(null),a=!!o,{thresholds:{defaultColor:l,palette:u}}=eI();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(lD,{size:n,"aria-label":`change ${e} color`,isSelected:a,iconColor:t,onClick:e=>{s(e.currentTarget)},children:(0,b.jsx)(G,{})}),(0,b.jsx)(eA.Ay,{"data-testid":"options color picker",open:a,anchorEl:o,onClose:()=>{s(null)},slotProps:{paper:{sx:{padding:e=>e.spacing(2)}}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,b.jsx)(eS,{color:t,palette:[l,...u],onChange:r,onClear:i})})]})}let lD=(0,I.A)($.A,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var lO=n(56599),lE=n(74628),l_=n(38662);function lR(e,t){return"ALL"!==t&&!!t[e.id]}var lP=n(83926),lL=n(1337),lN=n(54382),lB=n(29424),lF=n(67214);function lj(e){return(0,R.Ay)("MuiListItemButton",e)}let lz=(0,_.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),lV=(0,I.A)(lL.A,{shouldForwardProp:e=>(0,lP.A)(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,D.A)(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${lz.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,M.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${lz.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,M.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${lz.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,M.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,M.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${lz.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${lz.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),lH=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiListItemButton"}),{alignItems:r="center",autoFocus:i=!1,component:o="div",children:s,dense:a=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:c,selected:h=!1,className:d,...f}=n,p=w.useContext(lF.A),g=w.useMemo(()=>({dense:a||p.dense||!1,alignItems:r,disableGutters:l}),[r,p.dense,a,l]),m=w.useRef(null);(0,lN.A)(()=>{i&&m.current&&m.current.focus()},[i]);let v={...n,alignItems:r,dense:g.dense,disableGutters:l,divider:u,selected:h},y=(e=>{let{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=e,l=(0,A.A)({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled","flex-start"===t&&"alignItemsFlexStart",a&&"selected"]},lj,n);return{...n,...l}})(v),x=(0,lB.A)(m,t);return(0,b.jsx)(lF.A.Provider,{value:g,children:(0,b.jsx)(lV,{ref:x,href:f.href||f.to,component:(f.href||f.to)&&"div"===o?"button":o,focusVisibleClassName:(0,C.A)(y.focusVisible,c),ownerState:v,className:(0,C.A)(y.root,d),...f,classes:y,children:s})})});var l$=n(14045);let lW=(0,w.memo)(function({color:e,sx:t,...n}){return(0,b.jsx)(lE.A,{...n,sx:rV({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),lG=(0,w.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:r,isVisuallySelected:i,onMouseOver:o,onMouseOut:s,index:a,...l},u){let[c,h]=(0,w.useState)(n);return(0,b.jsxs)(lH,{...l,role:"listitem",sx:rV({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{r(t,e.id),e.onClick?.(t)},onMouseOver:t=>o?.(t,{id:e.id,index:a}),onMouseOut:t=>s?.(t,{id:e.id,index:a}),selected:i,ref:u,children:[(0,b.jsx)(lE.A,{sx:{display:"flex",alignItems:"center"},children:(0,b.jsx)(lW,{color:e.color})}),(0,b.jsx)(l$.A,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&h(!1)},onMouseOut:function(){n&&h(!0)}})]})}),lU=(0,w.memo)(lG);function lq({height:e,items:t,selectedItems:n,onLegendItemClick:r,onItemMouseOver:i,onItemMouseOut:o}){return(0,b.jsx)(lE.A,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,b.jsx)(lU,{item:e,index:t,isVisuallySelected:lR(e,n),onMouseOver:i,onMouseOut:o,onClick:r,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}function lY(e){e()}function lZ(e,t){return n=>e(t(n))}function lK(e){return void 0!==e}function lX(){}function lJ(e,t){return t(e)}function lQ(...e){return e}function l0(e){e(2)}function l1(e){return e(4)}function l2(e,t){return e(1,e=>t(0,e))}function l5(e,t){let n=e(1,e=>{n(),t(e)});return n}function l3(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function l4(e,t){return e===t}function l6(e=l4){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function l8(e){return t=>n=>{e(n)&&t(n)}}function l9(e){return t=>lZ(t,e)}function l7(e){return t=>()=>{t(e)}}function ue(e,...t){let n=function(...e){return t=>e.reduceRight(lJ,t)}(...t);return(t,r)=>{switch(t){case 2:l0(e);return;case 1:return e(1,n(r))}}}function ut(e,t){return n=>r=>{n(t=e(t,r))}}function un(e){return t=>n=>{e>0?e--:t(n)}}function ur(e){let t=null,n;return r=>i=>{t=i,n||(n=setTimeout(()=>{n=void 0,r(t)},e))}}function ui(...e){let t=Array.from({length:e.length}),n=0,r=null,i=2**e.length-1;return e.forEach((e,o)=>{let s=2**o;e(1,e=>{let a=n;n|=s,t[o]=e,a!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{let s=()=>{e([o].concat(t))};n===i?s():r=s}}function uo(e){let t=e,n=ua();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function us(e,t){var n;return n=uo(t),l2(e,n),n}function ua(){let e=[];return(t,n)=>{switch(t){case 0:e.slice().forEach(e=>{e(n)});return;case 2:e.splice(0);return;case 1:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function ul(e){var t;return t=ua(),l2(e,t),t}let uu={singleton:!0};function uc(e,t=[],n=uu){let{singleton:r}=n;return{constructor:e,dependencies:t,id:uh(),singleton:r}}let uh=()=>Symbol("id");function ud(...e){let t=ua(),n=Array.from({length:e.length}),r=0,i=2**e.length-1;return e.forEach((e,o)=>{let s=2**o;e(1,e=>{n[o]=e,(r|=s)===i&&t(0,n)})}),function(e,o){switch(e){case 2:return void l0(t);case 1:return r===i&&o(n),t(1,o)}}}function uf(e,t=l4){return ue(e,l6(t))}function up(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(lY)}}(...e.map(e=>e(1,n)))}}}let ug=1,um={0:"debug",3:"error",[ug]:"log",2:"warn"},uv=uc(()=>{let e=uo(3);return{log:uo((t,n,r=ug)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??l1(e))&&console[um[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),uy=new WeakMap;function ux(e){return"self"in e?e.document.documentElement:e}function ub(e){uy.delete(ux(e))}function uw(e,t){return!function(e){let t=ux(e),n=uy.get(t);if(void 0!==n)return n;let r="rtl"===t.ownerDocument.defaultView.getComputedStyle(t).direction;return uy.set(t,r),r}(e)?t:-t}function uS(e,t,n){return uC(e,t,n).callbackRef}function uC(e,t,n){let r=S().useRef(null),i=S().useMemo(()=>"u">typeof ResizeObserver?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return{callbackRef:e=>{e&&t?(i?.observe(e),r.current=e):(r.current&&i?.unobserve(r.current),r.current=null)},ref:r}}function uA(e,t,n,r,i,o,s,a,l){return uC(S().useCallback(n=>{let l,u=function(e,t,n,r){let i=e.length;if(0===i)return null;let o=[];for(let s=0;s<i;s++){let i=e.item(s);if(void 0===i.dataset.index)continue;let a=parseInt(i.dataset.index,10),l=parseFloat(i.dataset.knownSize),u=t(i,n);if(0===u&&r("Zero-sized element, this should not happen",{child:i},3),u===l)continue;let c=o[o.length-1];0===o.length||c.size!==u||c.endIndex!==a-1?o.push({endIndex:a,size:u,startIndex:a}):o[o.length-1].endIndex++}return o}(n.children,t,a?"offsetWidth":"offsetHeight",i),c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;let h=c.lastElementChild?.dataset.viewportType==="window";h&&(l=c.ownerDocument.defaultView);let d=s?a?s.scrollWidth:s.scrollHeight:h?a?l.document.documentElement.scrollWidth:l.document.documentElement.scrollHeight:a?c.scrollWidth:c.scrollHeight,f=s?a?s.offsetWidth:s.offsetHeight:h?a?l.innerWidth:l.innerHeight:a?c.offsetWidth:c.offsetHeight;r({scrollHeight:d,scrollTop:Math.max(s?a?uw(s,s.scrollLeft):s.scrollTop:h?a?uw(l,l.scrollX||l.document.documentElement.scrollLeft):l.scrollY||l.document.documentElement.scrollTop:a?uw(c,c.scrollLeft):c.scrollTop,0),viewportHeight:f}),o?.(a?uM("column-gap",getComputedStyle(n).columnGap,i):uM("row-gap",getComputedStyle(n).rowGap,i)),null!==u&&e(u)},[e,t,i,o,s,r,a]),n,l)}function uM(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function uk(e,t,n){let r=S().useRef(null),i=S().useCallback(n=>{let i,o;if(!n?.offsetParent)return;let a=n.getBoundingClientRect(),l=a.width;if(t){let e=t.getBoundingClientRect(),n=a.top-e.top;o=e.height-Math.max(0,n),i=n+t.scrollTop}else{let e=s.current.ownerDocument.defaultView;o=e.innerHeight-Math.max(0,a.top),i=a.top+e.scrollY}r.current={listHeight:a.height,offsetTop:i,visibleHeight:o,visibleWidth:l},e(r.current)},[e,t]),{callbackRef:o,ref:s}=uC(i,!0,n),a=S().useCallback(()=>{i(s.current)},[i,s]);return S().useEffect(()=>{if(t){t.addEventListener("scroll",a);let e=new ResizeObserver(()=>{requestAnimationFrame(a)});return e.observe(t),()=>{t.removeEventListener("scroll",a),e.unobserve(t)}}let e=s.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",a),e?.addEventListener("resize",a),()=>{e?.removeEventListener("scroll",a),e?.removeEventListener("resize",a)}},[a,t,s]),o}let uT=uc(()=>{let e=ua(),t=ua(),n=uo(0),r=ua(),i=uo(0),o=ua(),s=ua(),a=uo(0),l=uo(0),u=uo(0),c=uo(0),h=ua(),d=ua(),f=uo(!1),p=uo(!1),g=uo(!1);return l2(ue(e,l9(({scrollTop:e})=>e)),t),l2(ue(e,l9(({scrollHeight:e})=>e)),s),l2(t,i),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:a,horizontalDirection:p,scrollBy:d,scrollContainerState:e,scrollHeight:s,scrollingInProgress:f,scrollTo:h,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),uI={lvl:0};function uD(e,t){let n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]),o=[];for(let s=1;s<n;s++){let{index:n,value:a}=t(e[s]);o.push({end:n-1,start:r,value:i}),r=n,i=a}return o.push({end:1/0,start:r,value:i}),o}function uO(e){return e===uI}function uE(e,t){if(!uO(e))return t===e.k?e.v:t<e.k?uE(e.l,t):uE(e.r,t)}function u_(e,t,n="k"){if(uO(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=u_(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return u_(e.l,t,n)}function uR(e,t,n){return uO(e)?uj(t,n,1):t===e.k?uB(e,{k:t,v:n}):t<e.k?uV(uz(uB(e,{l:uR(e.l,t,n)}))):uV(uz(uB(e,{r:uR(e.r,t,n)})))}function uP(e,t,n){if(uO(e))return[];let r=u_(e,t)[0];return uD(function e(t,n,r){if(uO(t))return[];let{k:i,l:o,r:s,v:a}=t,l=[];return i>n&&(l=l.concat(e(o,n,r))),i>=n&&i<=r&&l.push({k:i,v:a}),i<=r&&(l=l.concat(e(s,n,r))),l}(e,r,n),({k:e,v:t})=>({index:e,value:t}))}function uL(e){return uO(e)?[]:[...uL(e.l),{k:e.k,v:e.v},...uL(e.r)]}function uN(e){let{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(uF(t))return uz(uB(e,{lvl:n-1}));if(!uO(t)&&!uO(t.r))return uB(t.r,{l:uB(t,{r:t.r.l}),lvl:n,r:uB(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(uF(e))return uV(uB(e,{lvl:n-1}));if(!uO(r)&&!uO(r.l)){let t=r.l,i=uF(t)?r.lvl-1:r.lvl;return uB(t,{l:uB(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:uV(uB(r,{l:t.r,lvl:i}))})}throw Error("Unexpected empty nodes")}function uB(e,t){return uj(void 0===t.k?e.k:t.k,void 0===t.v?e.v:t.v,void 0===t.lvl?e.lvl:t.lvl,void 0===t.l?e.l:t.l,void 0===t.r?e.r:t.r)}function uF(e){return uO(e)||e.lvl>e.r.lvl}function uj(e,t,n,r=uI,i=uI){return{k:e,l:r,lvl:n,r:i,v:t}}function uz(e){let{l:t}=e;return uO(t)||t.lvl!==e.lvl?e:uB(t,{r:uB(e,{l:t.r})})}function uV(e){let{lvl:t,r:n}=e;return uO(n)||uO(n.r)||n.lvl!==t||n.r.lvl!==t?e:uB(n,{l:uB(e,{r:n.l}),lvl:t+1})}function uH(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function u$(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let uW=uc(()=>({recalcInProgress:uo(!1)}),[],{singleton:!0});function uG(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let o=Math.floor((r+i)/2),s=n(e[o],t);if(0===s)return o;if(-1===s){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function uU(e,t){return Math.round(e.getBoundingClientRect()[t])}function uq(e){return!uO(e.groupOffsetTree)}function uY({index:e},t){return t===e?0:t<e?-1:1}function uZ({offset:e},t){return t===e?0:t<e?-1:1}function uK(e,t,n){if(0===t.length)return 0;let{index:r,offset:i,size:o}=t[uG(t,e,uY)],s=e-r,a=o*s+(s-1)*n+i;return a>0?a+n:a}function uX(e,t){if(!uq(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function uJ(e,t,n){if(void 0!==e.groupIndex)return t.groupIndices[e.groupIndex]+1;let r=uX("LAST"===e.index?n:e.index,t);return Math.max(0,Math.min(n,r))}function uQ(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,0);let o=e.sizeTree,s=o,a=0;if(n.length>0&&uO(o)&&2===t.length){let e=t[0].size,r=t[1].size;s=n.reduce((t,n)=>uR(uR(t,n,e),n+1,r),s)}else[s,a]=function(e,t){let n=uO(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),uO(e)){e=uR(e,0,i);continue}let s=uP(e,o-1,t+1);if(s.some(function(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}(r)))continue;let a=!1,l=!1;for(let{end:n,start:r,value:o}of s)a?(t>=r||i===o)&&(e=function e(t,n){if(uO(t))return uI;let{k:r,l:i,r:o}=t;if(n===r){if(uO(i))return o;if(uO(o))return i;let[e,n]=function e(t){return uO(t.r)?[t.k,t.v]:e(t.r)}(i);return uN(uB(t,{k:e,l:function e(t){return uO(t.r)?t.l:uN(uB(t,{r:e(t.r)}))}(i),v:n}))}return n<r?uN(uB(t,{l:e(i,n)})):uN(uB(t,{r:e(o,n)}))}(e,r)):(l=o!==i,a=!0),n>t&&t>=r&&o!==i&&(e=uR(e,t+1,o));l&&(e=uR(e,o,i))}return[e,n]}(s,t);if(s===o)return e;let{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:h}=u1(e.offsetTree,a,s,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>uR(e,t,uK(t,h,i)),uI),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:h,sizeTree:s}}function u0(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n!==e)}function u1(e,t,n,r){let i=e,o=0,s=0,a=0,l=0;if(0===t)i=[];else{l=uG(i,t-1,uY),a=i[l].offset;let e=u_(n,t-1);o=e[0],s=e[1],i.length&&i[l].size===u_(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}for(let{start:e,value:l}of uP(n,t,1/0)){let t=e-o,n=t*s+a+t*r;i.push({index:e,offset:n,size:l}),o=e,a=n,s=l}return{lastIndex:o,lastOffset:a,lastSize:s,offsetTree:i}}function u2(e){return{index:e.index,value:e}}let u5={offsetHeight:"height",offsetWidth:"width"},u3=uc(([{log:e},{recalcInProgress:t}])=>{let n=ua(),r=ua(),i=us(r,0),o=ua(),s=ua(),a=uo(0),l=uo([]),u=uo(void 0),c=uo(void 0),h=uo(void 0),d=uo(void 0),f=uo((e,t)=>uU(e,u5[t])),p=uo(void 0),g=uo(0),m={groupIndices:[],groupOffsetTree:uI,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:uI},v=us(ue(n,ui(l,e,g),ut(uQ,m),l6()),m),y=us(ue(l,l6(),ut((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),l9(({prev:e})=>e)),[]);l2(ue(l,l8(e=>e.length>0),ui(v,g),l9(([e,t,n])=>{let r=e.reduce((e,r,i)=>uR(e,r,uK(r,t.offsetTree,n)||i),uI);return{...t,groupIndices:e,groupOffsetTree:r}})),v),l2(ue(r,ui(v),l8(([e,{lastIndex:t}])=>e<t),l9(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),l2(u,c);let x=us(ue(u,l9(e=>void 0===e)),!0);l2(ue(c,l8(e=>void 0!==e&&uO(l1(v).sizeTree)),l9(e=>{let t=l1(h),n=l1(l).length>0;return void 0!==t&&0!==t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),l2(ue(d,l8(e=>void 0!==e&&e.length>0&&uO(l1(v).sizeTree)),l9(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),l2(ue(l,ui(h,c),l8(([,e,t])=>void 0!==e&&void 0!==t),l9(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let o=e[i],s=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==s&&r.push({startIndex:o+1,endIndex:s-1,size:n})}return r})),n);let b=ul(ue(n,ui(v),ut(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),l9(e=>e.changed)));ue(a,ut((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),l9(e=>e.diff))(1,e=>{let{groupIndices:n}=l1(v);if(e>0)t(0,!0),o(0,e+u0(e,n));else if(e<0){let t=l1(y);t.length>0&&(e-=u0(-e,t)),s(0,e)}}),ue(a,ui(e))(1,([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},3)});let w=ul(o);l2(ue(o,ui(v),l9(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=uE(t.sizeTree,0),o=0,s=0;for(;o<e;){let e=t.groupIndices[s],a=t.groupIndices.length===s+1?1/0:t.groupIndices[s+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+a-1,size:i,startIndex:e+1}),s++,o+=a+1}let a=uL(t.sizeTree);return o!==e&&a.shift(),a.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return uL(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=ul(ue(s,ui(v,g),l9(([e,{offsetTree:t},n])=>uK(-e,t,n))));return l2(ue(s,ui(v,g),l9(([e,t,n])=>{if(t.groupIndices.length>0){if(uO(t.sizeTree))return t;let r=uI,i=l1(y),o=0,s=0,a=0;for(;o<-e;){a=i[s];let e=i[s+1]-a-1;s++,o+=e+1}return r=uL(t.sizeTree).reduce((t,{k:n,v:r})=>uR(t,Math.max(0,n+e),r),r),o!==-e&&(r=uR(r,0,uE(t.sizeTree,a)),r=uR(r,1,u_(t.sizeTree,-e+1)[1])),{...t,sizeTree:r,...u1(t.offsetTree,0,r,n)}}let r=uL(t.sizeTree).reduce((t,{k:n,v:r})=>uR(t,Math.max(0,n+e),r),uI);return{...t,sizeTree:r,...u1(t.offsetTree,0,r,n)}})),v),{beforeUnshiftWith:w,data:p,defaultItemSize:c,firstItemIndex:a,fixedItemSize:u,fixedGroupSize:h,gap:g,groupIndices:l,heightEstimates:d,itemSize:f,listRefresh:b,shiftWith:s,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:i,totalCount:r,trackItemSizes:x,unshiftWith:o}},lQ(uv,uW),{singleton:!0});function u4(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let u6=uc(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let o=ua(),s=ua(),a=ul(ue(o,l9(u4)));return l2(ue(a,l9(e=>e.totalCount)),n),l2(ue(a,l9(e=>e.groupIndices)),e),l2(ue(ud(i,t,r),l8(([e,t])=>uq(t)),l9(([e,t,n])=>u_(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),l6(),l9(e=>[e])),s),{groupCounts:o,topItemsIndexes:s}},lQ(u3,uT)),u8=uc(([{log:e}])=>{let t=uo(!1),n=ul(ue(t,l8(e=>e),l6()));return t(1,t=>{t&&l1(e)("props updated",{},0)}),{didMount:n,propsReady:t}},lQ(uv),{singleton:!0}),u9="u">typeof document&&"scrollBehavior"in document.documentElement.style;function u7(e){let t="number"==typeof e?{index:e}:{...e};return t.align||(t.align="start"),t.behavior&&u9||(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}let ce=uc(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:s,headerHeight:a,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:h},{log:d}])=>{let f=ua(),p=ua(),g=uo(0),m=null,v=null,y=null;function x(){null!==m&&(m(),m=null),null!==y&&(y(),y=null),v&&(clearTimeout(v),v=null),l(0,!1)}return l2(ue(f,ui(n,h,r,g,a,s,d),ui(e,o,i),l9(([[e,n,r,i,o,s,a,u],h,d,g])=>{let b=u7(e),{align:w,behavior:S,offset:C}=b,A=i-1,M=uJ(b,n,A),k=uK(M,n.offsetTree,h)+s;"end"===w?(k+=d+u_(n.sizeTree,M)[1]-r+g,M===A&&(k+=a)):"center"===w?k+=(d+u_(n.sizeTree,M)[1]-r+g)/2:k-=o,void 0!==C&&0!==C&&(k+=C);let T=t=>{x(),t?(u("retrying to scroll to",{location:e},0),f(0,e)):(p(0,!0),u("list did not change, scroll successful",{},0))};if(x(),"smooth"===S){let e=!1;y=t(1,t=>{e=e||t}),m=l5(c,()=>{T(e)})}else m=l5(ue(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),T);return v=setTimeout(()=>{x()},1200),l(0,!0),u("scrolling from index to",{behavior:S,index:M,top:k},0),{behavior:S,top:k}})),u),{scrollTargetReached:p,scrollToIndex:f,topListHeight:g}},lQ(u3,uT,uv),{singleton:!0});function ct(e,t){0===e?t():requestAnimationFrame(()=>{ct(e-1,t)})}function cn(e,t){if(void 0===e)return 0;let n=t-1;return Math.max(0,Math.min("number"==typeof e?e:"LAST"===e.index?n:e.index,n))}function cr(e){return void 0===e||("number"==typeof e?0===e:0===e.index&&(void 0===e.align||"start"===e.align)&&(void 0===e.offset||0===e.offset))}let ci=uc(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:s}])=>{let a=uo(!0),l=uo(0),u=uo(!0);return l2(ue(s,ui(l),l8(([e,t])=>!cr(t)),l7(!1)),a),l2(ue(s,ui(l),l8(([e,t])=>!cr(t)),l7(!1)),u),ue(ud(t,s),ui(a,n,e,u),l8(([[,e],t,{sizeTree:n},r,i])=>e&&(!uO(n)||lK(r))&&!t&&!i),ui(l))(1,([,e])=>{if(void 0===e){a(0,!0),u(0,!0);return}l5(i,()=>{u(0,!0)}),ct(4,()=>{l5(r,()=>{a(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:a}},lQ(u3,uT,ce,u8),{singleton:!0});function co(e,t){return 1.01>Math.abs(e-t)}let cs="down",ca={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},cl=uc(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{let s=uo(!1),a=uo(!0),l=ua(),u=ua(),c=uo(4),h=uo(0),d=us(ue(up(ue(uf(i),un(1),l7(!0)),ue(uf(i),un(1),l7(!1),l3(100))),l6()),!1),f=us(ue(up(ue(n,l7(!0)),ue(n,l7(!1),l3(200))),l6()),!1);l2(ue(ud(uf(i),uf(h)),l9(([e,t])=>e<=t),l6()),a),l2(ue(a,ur(50)),u);let p=ul(ue(ud(r,uf(o),uf(t),uf(e),uf(c)),ut((e,[{scrollHeight:t,scrollTop:n},r,i,o,s])=>{let a={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-s){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:a}}return{atBottom:!1,notAtBottomBecause:a.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:a}},ca),l6((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),g=us(ue(r,ut((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!co(e.scrollHeight,t)){let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),l8(e=>e.changed),l9(e=>e.jump)),0);l2(ue(p,l9(e=>e.atBottom)),s),l2(ue(s,ur(50)),l);let m=uo(cs);l2(ue(r,l9(({scrollTop:e})=>e),l6(),ut((e,t)=>l1(f)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":cs,prevScrollTop:t},{direction:cs,prevScrollTop:0}),l9(e=>e.direction)),m),l2(ue(r,ur(50),l7("none")),m);let v=uo(0);return l2(ue(d,l8(e=>!e),l7(0)),v),l2(ue(i,ur(100),ui(d),l8(([e,t])=>t),ut(([e,t],[n])=>[t,n],[0,0]),l9(([e,t])=>t-e)),v),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:h,isAtBottom:s,isAtTop:a,isScrolling:d,lastJumpDueToItemResize:g,scrollDirection:m,scrollVelocity:v}},lQ(uT)),cu="bottom",cc="none";function ch(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===cs&&t===cu?e:0:"up"===n?"top"===t?e.main:e.reverse:t===cu?e.main:e.reverse}function cd(e,t){return"number"==typeof e?e:e[t]??0}let cf=uc(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let o=ua(),s=uo(0),a=uo(0),l=uo(0),u=us(ue(ud(uf(r),uf(i),uf(n),uf(o,u$),uf(l),uf(s),uf(t),uf(e),uf(a)),l9(([e,t,n,[r,i],o,s,a,l,u])=>{let c=e-l,h=Math.max(n-c,0),d=cc,f=cd(u,"top"),p=cd(u,cu);return r-=l,r+=n+a,i+=n+a,r>e+(s+a)-f&&(d="up"),(i-=l)<e-h+t+p&&(d=cs),d!==cc?[Math.max(c-n-ch(o,"top",d)-f,0),c-h-a+t+ch(o,cu,d)+p]:null}),l8(e=>null!==e),l6(u$)),[0,0]);return{increaseViewportBy:a,listBoundary:o,overscan:l,topListHeight:s,visibleRange:u}},lQ(uT),{singleton:!0}),cp={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function cg(e,t,n,r,i,o){let{lastIndex:s,lastOffset:a,lastSize:l}=i,u=0,c=0;if(e.length>0){u=e[0].offset;let t=e[e.length-1];c=t.offset+t.size}let h=n-s,d=u,f=a+h*l+(h-1)*r-c;return{bottom:c,firstItemIndex:o,items:cv(e,i,o),offsetBottom:f,offsetTop:u,top:d,topItems:cv(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function cm(e,t,n,r,i,o){let s=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-s>=e)break;s++}let a=e+s,l=cn(t,a);return cg(Array.from({length:a}).map((e,t)=>({data:o[t+l],index:t+l,offset:0,size:0})),[],a,i,n,r)}function cv(e,t,n){if(0===e.length)return[];if(!uq(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,o=[],s=uP(t.groupOffsetTree,r,i),a,l=0;for(let r of e){let e;(!a||a.end<r.index)&&(a=s.shift(),l=t.groupIndices.indexOf(a.start)),e=r.index===a.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function cy(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}let cx=uc(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:s,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:h},d,{didMount:f},{recalcInProgress:p}])=>{let g=uo([]),m=uo(0),v=ua(),y=uo(0);l2(o.topItemsIndexes,g);let x=us(ue(ud(f,p,uf(l,u$),uf(i),uf(r),uf(u),c,uf(g),uf(t),uf(n),uf(y),e),l8(([e,t,,n,,,,,,,,r])=>{let i=void 0!==r&&r.length!==n;return e&&!t&&!i}),l9(([,,[e,t],n,r,i,o,s,a,l,u,c])=>{var h;let{offsetTree:d,sizeTree:f}=r,p=l1(m);if(0===n)return{...cp,totalCount:n};if(0===e&&0===t)return 0===p?{...cp,totalCount:n}:cm(p,i,r,a,l,c||[]);if(uO(f))return p>0?null:cg(function(e,t,n){if(uq(t)){let r=uX(e,t);return[{index:u_(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(cn(i,n),r,c),[],n,l,r,a);let g=[];if(s.length>0){let e=s[0],t=s[s.length-1],n=0;for(let r of uP(f,e,t)){let i=r.value,o=Math.max(r.start,e),s=Math.min(r.end,t);for(let e=o;e<=s;e++)g.push({data:c?.[e],index:e,offset:n,size:i}),n+=i}}if(!o)return cg([],g,n,l,r,a);let v=s.length>0?s[s.length-1]+1:0,y=function(e,t,n,r=0){let i,o;return r>0&&(t=Math.max(t,e[uG(e,r,uY)].offset)),uD((i=uG(e,t,uZ),o=uG(e,n,uZ,i),e.slice(i,o+1)),u2)}(d,e,t,v);if(0===y.length)return null;let x=n-1,b=((n=>{for(let r of y){let i=r.value,o=i.offset,s=r.start,a=i.size;if(i.offset<e){let t=(s+=Math.floor((e-i.offset+l)/(a+l)))-r.start;o+=t*a+t*l}s<v&&(o+=(v-s)*a,s=v);let u=Math.min(r.end,x);for(let e=s;e<=u&&!(o>=t);e++)n.push({data:c?.[e],index:e,offset:o,size:a}),o+=a+l}})(h=[]),h),w=cy(u,"top"),S=cy(u,cu);if(b.length>0&&(w>0||S>0)){let e=b[0],t=b[b.length-1];if(w>0&&e.index>v){let t=Math.min(w,e.index-v),n=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=uP(f,i,i)[0]?.value??e.size;r-=t+l,n.unshift({data:c?.[i],index:i,offset:r,size:t})}b.unshift(...n)}if(S>0&&t.index<x){let e=Math.min(S,x-t.index),n=t.offset+t.size+l;for(let r=t.index+1;r<=t.index+e;r++){let e=uP(f,r,r)[0]?.value??t.size;b.push({data:c?.[r],index:r,offset:n,size:e}),n+=e+l}}}return cg(b,g,n,l,r,a)}),l8(e=>null!==e),l6()),cp);l2(ue(e,l8(lK),l9(e=>e?.length)),i),l2(ue(x,l9(e=>e.topListHeight)),h),l2(h,a),l2(ue(x,l9(e=>[e.top,e.bottom])),s),l2(ue(x,l9(e=>e.items)),v);let b=ul(ue(x,l8(({items:e})=>e.length>0),ui(i,e),l8(([{items:e},t])=>e[e.length-1].originalIndex===t-1),l9(([,e,t])=>[e-1,t]),l6(u$),l9(([e])=>e))),w=ul(ue(x,ur(200),l8(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),l9(({items:e})=>e[0].index),l6())),S=ul(ue(x,l8(({items:e})=>e.length>0),l9(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),l6(uH)));return{endReached:b,initialItemCount:m,itemsRendered:v,listState:x,minOverscanItemCount:y,rangeChanged:S,startReached:w,topItemsIndexes:g,...d}},lQ(u3,u6,cf,ci,ce,cl,u8,uW),{singleton:!0}),cb=uc(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let o=ua(),s=us(ue(ud(n,e,r,t,i),l9(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return l2(uf(s),o),{totalListHeight:s,totalListHeightChanged:o}},lQ(uT,cx),{singleton:!0}),cw=uc(([{viewportHeight:e},{totalListHeight:t}])=>{let n=uo(!1),r=us(ue(ud(n,e,t),l8(([e])=>e),l9(([,e,t])=>Math.max(0,e-t)),ur(0),l6()),0);return{alignToBottom:n,paddingTopAddition:r}},lQ(uT,cb),{singleton:!0}),cS=uc(()=>({context:uo(null)})),cC=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:s})=>t<s?{...i,align:n??"start",...void 0===r?{}:{behavior:r}}:e>o?{...i,align:n??"end",...void 0===r?{}:{behavior:r}}:null,cA=uc(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:s,scrollTop:a,viewportHeight:l},{scrollToIndex:u}])=>{let c=ua();return l2(ue(c,ui(t,l,n,o,i,r,a),ui(e),l9(([[e,t,n,r,i,o,a,l],u])=>{let{calculateViewLocation:c=cC,done:h,...d}=e,f=uJ(e,t,r-1),p=uK(f,t.offsetTree,u)+i+o,g=c({itemBottom:p+u_(t.sizeTree,f)[1],itemTop:p,locationParams:d,viewportBottom:l+n-a,viewportTop:l+o});return null===g?h?.():h&&l5(ue(s,l8(e=>!e),un(l1(s)?1:2)),h),g}),l8(e=>null!==e)),u),{scrollIntoView:c}},lQ(u3,uT,ce,cx,uv),{singleton:!0});function cM(e){return!1!==e&&("smooth"===e?"smooth":"auto")}let ck=uc(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:l,propsReady:u},{log:c},{scrollingInProgress:h},{context:d},{scrollIntoView:f}])=>{let p=uo(!1),g=ua(),m=null;function v(e){s(0,{align:"end",behavior:e,index:"LAST"})}function y(e){setTimeout(l5(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(l1(c)("scrolling to bottom due to increased size",{},0),v("auto"))}),100)}ue(ud(ue(uf(t),un(1)),l),ui(uf(p),o,a,h),l9(([[e,t],n,r,i,o])=>{let s,a=t&&i,l="auto";return a&&(s=r||o,l="function"==typeof n?cM(n(s)):s&&cM(n),a=a&&!1!==l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),l8(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0===l1(n)?m=l5(e,()=>{l1(c)("following output to ",{totalCount:r},0),v(t),m=null}):requestAnimationFrame(()=>{l1(c)("following output to ",{totalCount:r},0),v(t)})}),ue(ud(uf(p),t,u),l8(([e,,t])=>!1!==e&&t),ut(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),l8(({refreshed:e})=>e),ui(p,t))(1,([,e])=>{l1(a)&&y(!1!==e)}),g(1,()=>{y(!1!==l1(p))}),ud(uf(p),i)(1,([e,t])=>{!1===e||t.atBottom||"VIEWPORT_HEIGHT_DECREASING"!==t.notAtBottomBecause||v("auto")});let x=uo(null),b=ua();return l2(up(ue(uf(r),l9(e=>e?.length??0)),ue(uf(t))),b),ue(ud(ue(b,un(1)),l),ui(uf(x),a,h,d),l9(([[e,t],n,r,i,o])=>t&&r&&n?.({context:o,totalCount:e,scrollingInProgress:i})),l8(e=>!!e),ur(0))(1,t=>{null!==m&&(m(),m=null),void 0===l1(n)?m=l5(e,()=>{l1(c)("scrolling into view",{}),f(0,t),m=null}):requestAnimationFrame(()=>{l1(c)("scrolling into view",{}),f(0,t)})}),{autoscrollToBottom:g,followOutput:p,scrollIntoViewOnChange:x}},lQ(u3,cl,ce,ci,u8,uv,uT,cS,cA)),cT=uc(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:s},{didMount:a}])=>(l2(ue(a,ui(o),l8(([,e])=>0!==e),ui(i,r,t,n,e),l9(([[,e],t,n,r,i,o=[]])=>cm(e,t,n,r,i,o))),s),{}),lQ(u3,ci,cx,u8),{singleton:!0}),cI=uc(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=uo(0);return ue(e,ui(r),l8(([,e])=>0!==e),l9(([,e])=>({top:e})))(1,e=>{l5(ue(n,un(1),l8(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:r}},lQ(u8,uT,cx),{singleton:!0}),cD=uc(([{scrollVelocity:e}])=>{let t=uo(!1),n=ua(),r=uo(!1);return l2(ue(e,ui(r,t,n),l8(([e,t])=>!1!==t&&void 0!==t),l9(([e,t,n,r])=>{let{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),l6()),t),ue(ud(t,e,n),ui(r))(1,([[e,t,n],r])=>{e&&!1!==r&&void 0!==r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},lQ(cl),{singleton:!0}),cO=uc(([{scrollContainerState:e,scrollTo:t}])=>{let n=ua(),r=ua(),i=ua(),o=uo(!1),s=uo(void 0);return l2(ue(ud(n,r),l9(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),l2(ue(t,ui(r),l9(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:s,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},lQ(uT)),cE=uc(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:s,windowScrollContainerState:a,windowViewportRect:l}])=>{let u=ua(),c=uo(void 0),h=uo(null),d=uo(null);return l2(a,h),l2(l,d),ue(u,ui(t,r,s,h,d,n))(1,([e,t,n,r,i,o,s])=>{let a=uL(t.sizeTree).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:void 0===i?1/0:i.k-1,size:t,startIndex:e}});r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:a,scrollTop:n-=s})}),l2(ue(c,l8(lK),l9(c_)),i),l2(ue(o,ui(c),l8(([,e])=>void 0!==e),l6(),l9(([,e])=>e.ranges)),e),{getState:u,restoreStateFrom:c}},lQ(u3,uT,ci,u8,cO));function c_(e){return{align:"start",index:0,offset:e.scrollTop}}let cR=uc(([{topItemsIndexes:e}])=>{let t=uo(0);return l2(ue(t,l8(e=>e>=0),l9(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},lQ(cx));function cP(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let cL=cP(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),cN=uc(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:s,scrollDirection:a},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:h,sizes:d},{log:f},{recalcInProgress:p}])=>{let g=ul(ue(l,ui(s),ut(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:s},a])=>{let l=r+o,u=0;return t===s&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||0!=(u=l-n)&&(u+=a)),[u,i,s,l]},[0,[],0,0]),l8(([e])=>0!==e),ui(r,a,n,i,f,p),l8(([,e,t,n,,,r])=>!r&&!n&&0!==e&&"up"===t),l9(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},0),e))));function m(n){n>0?(t(0,{behavior:"auto",top:-n}),e(0,0)):(e(0,0),t(0,{behavior:"auto",top:-n}))}return ue(g,ui(e,o))(1,([t,n,r])=>{r&&cL()?e(0,n-t):m(-t)}),ue(ud(us(o,!1),e,p),l8(([e,t,n])=>!e&&!n&&0!==t),l9(([e,t])=>t),ur(1))(1,m),l2(ue(h,l9(e=>({top:-e}))),t),ue(u,ui(d,c),l9(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{if(0===t.length)return e*(n+i);let o=0,s=uE(r,0),a=0,l=0;for(;a<e;){a++,o+=s;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;a+r>e&&(o-=s,r=e-a+1),a+=r,o+=r*(n+i),l++}return o}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{e(0,0),p(0,!1)})})}),{deviation:e}},lQ(uT,cl,cx,u3,uv,uW)),cB=uc(([e,t,n,r,i,o,s,a,l,u,c])=>({...e,...t,...n,...r,...i,...o,...s,...a,...l,...u,...c}),lQ(cf,cT,u8,cD,cb,cI,cw,cO,cA,uv,cS)),cF=uc(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:s,heightEstimates:a,itemSize:l,sizeRanges:u,sizes:c,statefulTotalCount:h,totalCount:d,trackItemSizes:f},{initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:m},v,y,x,b,{scrollToIndex:w},S,{topItemCount:C},{groupCounts:A},M])=>{let{listState:k,minOverscanItemCount:T,topItemsIndexes:I,rangeChanged:D,...O}=b;return l2(D,M.scrollSeekRangeChanged),l2(ue(M.windowViewportRect,l9(e=>e.visibleHeight)),v.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:A,heightEstimates:a,initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:m,sizeRanges:u,topItemCount:C,topItemsIndexes:I,totalCount:d,...x,groupIndices:s,itemSize:l,listState:k,minOverscanItemCount:T,scrollToIndex:w,statefulTotalCount:h,trackItemSizes:f,rangeChanged:D,...O,...M,...v,sizes:c,...y}},lQ(u3,ci,uT,cE,ck,cx,ce,cN,cR,u6,cB)),cj=typeof document>"u"?S().useEffect:S().useLayoutEffect;function cz(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),s=Object.keys(t.events||{}),a=S().createContext({});function l(e,n){for(let i of(void 0!==e.propsReady&&(0,e.propsReady)(0,!1),r))(0,e[t.required[i]])(0,n[i]);for(let r of i)r in n&&(0,e[t.optional[r]])(0,n[r]);void 0!==e.propsReady&&(0,e.propsReady)(0,!0)}function u(e){return s.reduce((n,r)=>{var i;let o,s,a;return n[r]=(i=e[t.events[r]],a=()=>o?.(),function(e,t){switch(e){case 1:return t?s===t?void 0:(a(),s=t,o=i(1,t)):(a(),lX);case 2:a(),s=null;return}}),n},{})}return{Component:S().forwardRef(function(c,h){var d;let{children:f,...p}=c,[g]=S().useState(()=>{var t;let n,r;return n=new Map,l(t=(r=({constructor:e,dependencies:t,id:i,singleton:o})=>{if(o&&n.has(i))return n.get(i);let s=e(t.map(e=>r(e)));return o&&n.set(i,s),s})(e),p),t}),[m]=S().useState(()=>u(g));return cj(()=>{for(let e of s)e in p&&(0,m[e])(1,p[e]);return()=>{Object.values(m).map(l0)}},[p,m,g]),cj(()=>{l(g,p)}),S().useImperativeHandle(h,(d=o.reduce((e,n)=>(e[n]=e=>{(0,g[t.methods[n]])(0,e)},e),{}),()=>d)),(0,b.jsx)(a.Provider,{value:g,children:void 0===n?f:(0,b.jsx)(n,{...function(e,t){let n={},r={},i=0,o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}([...r,...i,...s],p),children:f})})}),useEmitter:(e,t)=>{let n=S().useContext(a)[e];cj(()=>n(1,t),[t,n])},useEmitterValue:parseInt(S().version,10)>=18?e=>{let t=S().useContext(a)[e],n=S().useCallback(e=>t(1,e),[t]);return S().useSyncExternalStore(n,()=>l1(t),()=>l1(t))}:e=>{let t=S().useContext(a)[e],[n,r]=S().useState(()=>l1(t));return cj(()=>t(1,e=>{e!==n&&r(()=>e)}),[t,n]),n},usePublisher:e=>{let t=S().useContext(a);return S().useCallback(n=>{(0,t[e])(0,n)},[t,e])}}}let cV=S().createContext(void 0),cH=S().createContext(void 0),c$="-webkit-sticky",cW="sticky",cG=cP(()=>{if(typeof document>"u")return cW;let e=document.createElement("div");return e.style.position=c$,e.style.position===c$?c$:cW}),cU=typeof document>"u"?S().useEffect:S().useLayoutEffect;function cq(e){return"self"in e}function cY(e,t,n,r=lX,i,o){let s=S().useRef(null),a=S().useRef(null),l=S().useRef(null),u=S().useCallback(n=>{let r,i,s,u=n.target;if("body"in u||cq(u)){let e=cq(u)?u:u.defaultView;s=!0===o?uw(e,e.scrollX):e.scrollY,r=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=!0===o?e.innerWidth:e.innerHeight}else s=!0===o?uw(u,u.scrollLeft):u.scrollTop,r=!0===o?u.scrollWidth:u.scrollHeight,i=!0===o?u.offsetWidth:u.offsetHeight;let c=()=>{e({scrollHeight:r,scrollTop:Math.max(s,0),viewportHeight:i})};!0===n.suppressFlushSync?c():eV().flushSync(c),null!==a.current&&(s===a.current||s<=0||s===r-i)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,o]);return S().useEffect(()=>{let e=i??s.current;return ub(e),r(i??s.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{ub(e),r(null),e.removeEventListener("scroll",u)}},[s,u,n,r,i]),{scrollByCallback:function(e){!0===o&&(e={...void 0===e.behavior?{}:{behavior:e.behavior},...void 0===e.top?{}:{left:uw(s.current,e.top)}}),s.current.scrollBy(e)},scrollerRef:s,scrollToCallback:function(n){let r,i,u,c=s.current;if(!c||(!0===o?"offsetWidth"in c&&0===c.offsetWidth:"offsetHeight"in c&&0===c.offsetHeight))return;let h="smooth"===n.behavior;cq(c)?(i=Math.max(uU(c.document.documentElement,!0===o?"width":"height"),!0===o?c.document.documentElement.scrollWidth:c.document.documentElement.scrollHeight),r=!0===o?c.innerWidth:c.innerHeight,u=!0===o?uw(c,c.scrollX):c.scrollY):(i=c[!0===o?"scrollWidth":"scrollHeight"],r=uU(c,!0===o?"width":"height"),u=!0===o?uw(c,c.scrollLeft):c.scrollTop);let d=i-r;if(void 0===n.top)return void c.scrollTo(n);let f=Math.ceil(Math.max(Math.min(d,n.top),0));if(n.top=f,co(r,i)||f===u){e({scrollHeight:i,scrollTop:u,viewportHeight:r}),h&&t(!0);return}h?(a.current=f,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,!0===o&&(n={...void 0===n.behavior?{}:{behavior:n.behavior},left:uw(c,f)}),c.scrollTo(n)}}}function cZ(e){return e}let cK=uc(()=>{let e=uo(e=>`Item ${e}`),t=uo(e=>`Group ${e}`),n=uo({}),r=uo(cZ),i=uo("div"),o=uo(lX),s=(e,t=null)=>us(ue(n,l9(t=>t[e]),l6()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:i,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),cX=uc(([e,t])=>({...e,...t}),lQ(cF,cK)),cJ=({height:e})=>(0,b.jsx)("div",{style:{height:e}}),cQ={overflowAnchor:"none",position:cG(),zIndex:1},c0={overflowAnchor:"none"},c1={...c0,display:"inline-block",height:"100%"},c2=S().memo(function({showTopList:e=!1}){let t=hu("listState"),n=hc("sizeRanges"),r=hu("useWindowScroll"),i=hu("customScrollParent"),o=hc("windowScrollContainerState"),s=hc("scrollContainerState"),a=hu("itemContent"),l=hu("context"),u=hu("groupContent"),c=hu("trackItemSizes"),h=hu("itemSize"),d=hu("log"),f=hc("gap"),p=hu("horizontalDirection"),{callbackRef:g}=uA(n,h,c,e?lX:i||r?o:s,d,f,i,p,hu("skipAnimationFrameInResizeObserver")),[m,v]=S().useState(0);hl("deviation",e=>{m!==e&&v(e)});let y=hu("EmptyPlaceholder"),x=hu("ScrollSeekPlaceholder")??cJ,C=hu("ListComponent"),A=hu("ItemComponent"),M=hu("GroupComponent"),k=hu("computeItemKey"),T=hu("isSeeking"),I=hu("groupIndices").length>0,D=hu("alignToBottom"),O=hu("initialItemFinalLocationReached"),E=e?{}:{boxSizing:"border-box",...p?{display:"inline-block",height:"100%",marginInlineStart:0===m?D?"auto":0:m,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:0===m?D?"auto":0:m,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...O?{}:{visibility:"hidden"}};return e||0!==t.totalCount||null==y?(0,b.jsx)(C,{...c9(C,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:E,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=k(n+t.firstItemIndex,e.data,l);return T?(0,w.createElement)(x,{...c9(x,l),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,w.createElement)(M,{...c9(M,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:cQ},u(e.index,l)):(0,w.createElement)(A,{...c9(A,l),...c7(A,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:p?c1:c0},I?a(e.index,e.groupIndex,e.data,l):a(e.index,e.data,l))})}):(0,b.jsx)(y,{...c9(y,l)})}),c5={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},c3={outline:"none",overflowX:"auto",position:"relative"},c4=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),c6=(e,t,n=0)=>({...c4(e),position:t?"relative":"absolute",top:t?-n:0}),c8={position:cG(),top:0,width:"100%",zIndex:1};function c9(e,t){if("string"!=typeof e)return{context:t}}function c7(e,t){return{item:"string"==typeof e?void 0:t}}let he=S().memo(function(){let e=hu("HeaderComponent"),t=hc("headerHeight"),n=hu("HeaderFooterTag"),r=uS(S().useMemo(()=>e=>{t(uU(e,"height"))},[t]),!0,hu("skipAnimationFrameInResizeObserver")),i=hu("context");return null!=e?(0,b.jsx)(n,{ref:r,children:(0,b.jsx)(e,{...c9(e,i)})}):null}),ht=S().memo(function(){let e=hu("FooterComponent"),t=hc("footerHeight"),n=hu("HeaderFooterTag"),r=uS(S().useMemo(()=>e=>{t(uU(e,"height"))},[t]),!0,hu("skipAnimationFrameInResizeObserver")),i=hu("context");return null!=e?(0,b.jsx)(n,{ref:r,children:(0,b.jsx)(e,{...c9(e,i)})}):null});function hn({useEmitter:e,useEmitterValue:t,usePublisher:n}){return S().memo(function({children:r,style:i,context:o,...s}){let a=n("scrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("scrollerRef"),h=t("horizontalDirection")||!1,{scrollByCallback:d,scrollerRef:f,scrollToCallback:p}=cY(a,u,l,c,void 0,h);return e("scrollTo",p),e("scrollBy",d),(0,b.jsx)(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...h?c3:c5,...i},tabIndex:0,...s,...c9(l,o),children:r})})}function hr({useEmitter:e,useEmitterValue:t,usePublisher:n}){return S().memo(function({children:r,style:i,context:o,...s}){let a=n("windowScrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("totalListHeight"),h=t("deviation"),d=t("customScrollParent"),f=S().useRef(null),{scrollByCallback:p,scrollerRef:g,scrollToCallback:m}=cY(a,u,l,t("scrollerRef"),d);return cU(()=>(g.current=d??f.current?.ownerDocument.defaultView,()=>{g.current=null}),[g,d]),e("windowScrollTo",m),e("scrollBy",p),(0,b.jsx)(l,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...0===c?void 0:{height:c+h}},...s,...c9(l,o),children:r})})}let hi=({children:e})=>{let t=S().useContext(cV),n=hc("viewportHeight"),r=hc("fixedItemHeight"),i=hu("alignToBottom"),o=hu("horizontalDirection"),s=uS(S().useMemo(()=>lZ(n,e=>uU(e,o?"width":"height")),[n,o]),!0,hu("skipAnimationFrameInResizeObserver"));return S().useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,b.jsx)("div",{"data-viewport-type":"element",ref:s,style:c4(i),children:e})},ho=({children:e})=>{let t=S().useContext(cV),n=hc("windowViewportRect"),r=hc("fixedItemHeight"),i=hu("customScrollParent"),o=hu("useWindowScroll"),s=hu("topListHeight"),a=uk(n,i,hu("skipAnimationFrameInResizeObserver")),l=hu("alignToBottom");return S().useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,b.jsx)("div",{"data-viewport-type":"window",ref:a,style:c6(l,o,s),children:e})},hs=({children:e})=>{let t=hu("TopItemListComponent")??"div",n=hu("headerHeight"),r={...c8,marginTop:`${n}px`},i=hu("context");return(0,b.jsx)(t,{style:r,...c9(t,i),children:e})},{Component:ha,useEmitter:hl,useEmitterValue:hu,usePublisher:hc}=cz(cX,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},S().memo(function(e){let t=hu("useWindowScroll"),n=hu("topItemsIndexes").length>0,r=hu("customScrollParent"),i=hu("context");return(0,b.jsxs)(r||t?hd:hh,{...e,context:i,children:[n&&(0,b.jsx)(hs,{children:(0,b.jsx)(c2,{showTopList:!0})}),(0,b.jsxs)(r||t?ho:hi,{children:[(0,b.jsx)(he,{}),(0,b.jsx)(c2,{}),(0,b.jsx)(ht,{})]})]})})),hh=hn({useEmitter:hl,useEmitterValue:hu,usePublisher:hc}),hd=hr({useEmitter:hl,useEmitterValue:hu,usePublisher:hc}),hf=uc(()=>{let e=uo(e=>(0,b.jsxs)("td",{children:["Item $",e]})),t=uo(null),n=uo(e=>(0,b.jsxs)("td",{colSpan:1e3,children:["Group ",e]})),r=uo(null),i=uo(null),o=uo({}),s=uo(cZ),a=uo(lX),l=(e,t=null)=>us(ue(o,l9(t=>t[e]),l6()),t);return{components:o,computeItemKey:s,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),hp=uc(([e,t])=>({...e,...t}),lQ(cF,hf)),hg=({height:e})=>(0,b.jsx)("tr",{children:(0,b.jsx)("td",{style:{height:e}})}),hm=({height:e})=>(0,b.jsx)("tr",{children:(0,b.jsx)("td",{style:{border:0,height:e,padding:0}})}),hv={overflowAnchor:"none"},hy={position:cG(),zIndex:2,overflowAnchor:"none"},hx=S().memo(function({showTopList:e=!1}){let t=hM("listState"),n=hM("computeItemKey"),r=hM("firstItemIndex"),i=hM("context"),o=hM("isSeeking"),s=hM("fixedHeaderHeight"),a=hM("groupIndices").length>0,l=hM("itemContent"),u=hM("groupContent"),c=hM("ScrollSeekPlaceholder")??hg,h=hM("GroupComponent"),d=hM("TableRowComponent"),f=(e?t.topItems:[]).reduce((e,t,n)=>(0===n?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let p=t.originalIndex,g=n(p+r,t.data,i),m=e?0===p?0:f[p-1]:0;return o?(0,w.createElement)(c,{...c9(c,i),height:t.size,index:t.index,key:g,type:t.type||"item"}):"group"===t.type?(0,w.createElement)(h,{...c9(h,i),"data-index":p,"data-item-index":t.index,"data-known-size":t.size,key:g,style:{...hy,top:s}},u(t.index,i)):(0,w.createElement)(d,{...c9(d,i),...c7(d,t.data),"data-index":p,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:g,style:e?{...hy,top:s+m}:hv},a?l(t.index,t.groupIndex,t.data,i):l(t.index,t.data,i))})}),hb=S().memo(function(){let e=hM("listState"),t=hM("topItemsIndexes").length>0,n=hk("sizeRanges"),r=hM("useWindowScroll"),i=hM("customScrollParent"),o=hk("windowScrollContainerState"),s=hk("scrollContainerState"),a=hM("trackItemSizes"),{callbackRef:l,ref:u}=uA(n,hM("itemSize"),a,i||r?o:s,hM("log"),void 0,i,!1,hM("skipAnimationFrameInResizeObserver")),[c,h]=S().useState(0);hA("deviation",e=>{c!==e&&(u.current.style.marginTop=`${e}px`,h(e))});let d=hM("EmptyPlaceholder"),f=hM("FillerRow")??hm,p=hM("TableBodyComponent"),g=hM("paddingTopAddition"),m=hM("statefulTotalCount"),v=hM("context");if(0===m&&null!=d)return(0,b.jsx)(d,{...c9(d,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),x=e.offsetTop+g+c-y,w=e.offsetBottom,C=x>0?(0,b.jsx)(f,{context:v,height:x},"padding-top"):null,A=w>0?(0,b.jsx)(f,{context:v,height:w},"padding-bottom"):null;return(0,b.jsxs)(p,{"data-testid":"virtuoso-item-list",ref:l,...c9(p,v),children:[C,t&&(0,b.jsx)(hx,{showTopList:!0}),(0,b.jsx)(hx,{}),A]})}),hw=({children:e})=>{let t=S().useContext(cV),n=hk("viewportHeight"),r=hk("fixedItemHeight"),i=uS(S().useMemo(()=>lZ(n,e=>uU(e,"height")),[n]),!0,hM("skipAnimationFrameInResizeObserver"));return S().useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,b.jsx)("div",{"data-viewport-type":"element",ref:i,style:c4(!1),children:e})},hS=({children:e})=>{let t=S().useContext(cV),n=hk("windowViewportRect"),r=hk("fixedItemHeight"),i=hM("customScrollParent"),o=hM("useWindowScroll"),s=uk(n,i,hM("skipAnimationFrameInResizeObserver"));return S().useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,b.jsx)("div",{"data-viewport-type":"window",ref:s,style:c6(!1,o),children:e})},{Component:hC,useEmitter:hA,useEmitterValue:hM,usePublisher:hk}=cz(hp,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},S().memo(function(e){let t=hM("useWindowScroll"),n=hM("customScrollParent"),r=hk("fixedHeaderHeight"),i=hk("fixedFooterHeight"),o=hM("fixedHeaderContent"),s=hM("fixedFooterContent"),a=hM("context"),l=uS(S().useMemo(()=>lZ(r,e=>uU(e,"height")),[r]),!0,hM("skipAnimationFrameInResizeObserver")),u=uS(S().useMemo(()=>lZ(i,e=>uU(e,"height")),[i]),!0,hM("skipAnimationFrameInResizeObserver")),c=n||t?hI:hT,h=n||t?hS:hw,d=hM("TableComponent"),f=hM("TableHeadComponent"),p=hM("TableFooterComponent"),g=o?(0,b.jsx)(f,{ref:l,style:{position:"sticky",top:0,zIndex:2},...c9(f,a),children:o()},"TableHead"):null,m=s?(0,b.jsx)(p,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...c9(p,a),children:s()},"TableFoot"):null;return(0,b.jsx)(c,{...e,...c9(c,a),children:(0,b.jsx)(h,{children:(0,b.jsxs)(d,{style:{borderSpacing:0,overflowAnchor:"none"},...c9(d,a),children:[g,(0,b.jsx)(hb,{},"TableBody"),m]})})})})),hT=hn({useEmitter:hA,useEmitterValue:hM,usePublisher:hk}),hI=hr({useEmitter:hA,useEmitterValue:hM,usePublisher:hk}),hD={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},hO={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:hE,floor:h_,max:hR,min:hP,round:hL}=Math;function hN(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function hB(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function hF(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}let hj=uc(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:s,scrollContainerState:a,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:h},d,f,{didMount:p,propsReady:g},{customScrollParent:m,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b},w])=>{let S=uo(0),C=uo(0),A=uo(hD),M=uo({height:0,width:0}),k=uo({height:0,width:0}),T=ua(),I=ua(),D=uo(0),O=uo(null),E=uo({column:0,row:0}),_=ua(),R=ua(),P=uo(!1),L=uo(0),N=uo(!0),B=uo(!1),F=uo(!1);ue(p,ui(L),l8(([e,t])=>!cr(t)))(1,()=>{N(0,!1)}),ue(ud(p,N,k,M,L,B),l8(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i))(1,([,,,,e])=>{void 0===e?N(0,!0):(B(0,!0),ct(1,()=>{T(0,e)}),l5(ue(u),()=>{t(0,[0,0]),N(0,!0)}))}),l2(ue(R,l8(e=>null!=e&&e.scrollTop>0),l7(0)),C),ue(p,ui(R),l8(([,e])=>null!=e))(1,([,e])=>{e&&(M(0,e.viewport),k(0,e.item),E(0,e.gap),e.scrollTop>0&&(P(0,!0),l5(ue(u,un(1)),e=>{P(0,!1)}),l(0,{top:e.scrollTop})))}),l2(ue(M,l9(({height:e})=>e)),h),l2(ue(ud(uf(M,hB),uf(k,hB),uf(E,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),uf(u)),l9(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),_),l2(ue(ud(uf(S),r,uf(E,hF),uf(k,hB),uf(M,hB),uf(O),uf(C),uf(P),uf(N),uf(L)),l8(([,,,,,,,e])=>!e),l9(([e,[t,n],r,i,o,s,a,,l,u])=>{let c,h,{column:d,row:f}=r,{height:p,width:g}=i,{width:m}=o;if(0===a&&(0===e||0===m))return hD;if(0===g){var v;let t=cn(u,e),n=t+Math.max(a-1,0);return v=hN(t,n,s),{...hO,items:v}}let y=hz(m,g,d);l?0===t&&0===n&&a>0?(c=0,h=a-1):(c=y*h_((t+f)/(p+f)),h=hP(e-1,hR(h=y*hE((n+f)/(p+f))-1,y-1)),c=hP(h,hR(0,c))):(c=0,h=-1);let x=hN(c,h,s),{bottom:b,top:w}=hV(o,r,i,x),S=hE(e/y);return{bottom:b,itemHeight:p,items:x,itemWidth:g,offsetBottom:S*p+(S-1)*f-b,offsetTop:w,top:w}})),A),l2(ue(O,l8(e=>null!==e),l9(e=>e.length)),S),l2(ue(ud(M,k,A,E),l8(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),l9(([e,t,{items:n},r])=>{let{bottom:i,top:o}=hV(e,r,t,n);return[o,i]}),l6(u$)),t);let j=uo(!1);l2(ue(u,ui(j),l9(([e,t])=>t||0!==e)),j);let z=ul(ue(ud(A,S),l8(([{items:e}])=>e.length>0),ui(j),l8(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),l9(([[,e]])=>e-1),l6())),V=ul(ue(uf(A),l8(({items:e})=>e.length>0&&0===e[0].index),l7(0),l6())),H=ul(ue(uf(A),ui(P),l8(([{items:e},t])=>e.length>0&&!t),l9(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),l6(uH),ur(0)));l2(H,f.scrollSeekRangeChanged),l2(ue(T,ui(M,k,S,E),l9(([e,t,n,r,i])=>{let o=u7(e),{align:s,behavior:a,offset:l}=o,u=o.index;"LAST"===u&&(u=r-1);let c=hH(t,i,n,u=hR(0,u,hP(r-1,u)));return"end"===s?c=hL(c-t.height+n.height):"center"===s&&(c=hL(c-t.height/2+n.height/2)),void 0!==l&&0!==l&&(c+=l),{behavior:a,top:c}})),l);let $=us(ue(A,l9(e=>e.offsetBottom+e.bottom)),0);return l2(ue(b,l9(e=>({height:e.visibleHeight,width:e.visibleWidth}))),M),{customScrollParent:m,data:O,deviation:D,footerHeight:i,gap:E,headerHeight:o,increaseViewportBy:e,initialItemCount:C,itemDimensions:k,overscan:n,restoreStateFrom:R,scrollBy:s,scrollContainerState:a,scrollHeight:I,scrollTo:l,scrollToIndex:T,scrollTop:u,smoothScrollTargetReached:c,totalCount:S,useWindowScroll:v,viewportDimensions:M,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b,...f,gridState:A,horizontalDirection:F,initialTopMostItemIndex:L,totalListHeight:$,...d,endReached:z,propsReady:g,rangeChanged:H,startReached:V,stateChanged:_,stateRestoreInProgress:P,...w}},lQ(cf,uT,cl,cD,u8,cO,uv));function hz(e,t,n){return hR(1,h_((e+n)/(h_(t)+n)))}function hV(e,t,n,r){let{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};let o=hH(e,t,n,r[0].index);return{bottom:hH(e,t,n,r[r.length-1].index)+i,top:o}}function hH(e,t,n,r){let i=h_(r/hz(e.width,n.width,t.column)),o=i*n.height+hR(0,i-1)*t.row;return o>0?o+t.row:o}let h$=uc(()=>{let e=uo(e=>`Item ${e}`),t=uo({}),n=uo(null),r=uo("virtuoso-grid-item"),i=uo("virtuoso-grid-list"),o=uo(cZ),s=uo("div"),a=uo(lX),l=(e,n=null)=>us(ue(t,l9(t=>t[e]),l6()),n),u=uo(!1),c=uo(!1);return l2(uf(c),u),{components:t,computeItemKey:o,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:s,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:i,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),hW=uc(([e,t])=>({...e,...t}),lQ(hj,h$)),hG=S().memo(function(){let e=hX("gridState"),t=hX("listClassName"),n=hX("itemClassName"),r=hX("itemContent"),i=hX("computeItemKey"),o=hX("isSeeking"),s=hJ("scrollHeight"),a=hX("ItemComponent"),l=hX("ListComponent"),u=hX("ScrollSeekPlaceholder"),c=hX("context"),h=hJ("itemDimensions"),d=hJ("gap"),f=hX("log"),p=hX("stateRestoreInProgress"),g=hJ("reportReadyState"),m=uS(S().useMemo(()=>e=>{s(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(null!==t){let{height:e,width:n}=t.getBoundingClientRect();h({height:e,width:n})}d({column:h1("column-gap",getComputedStyle(e).columnGap,f),row:h1("row-gap",getComputedStyle(e).rowGap,f)})},[s,h,d,f]),!0,!1);return cU(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),p?null:(0,b.jsx)(l,{className:t,ref:m,...c9(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let s=i(t.index,t.data,c);return o?(0,b.jsx)(u,{...c9(u,c),height:e.itemHeight,index:t.index,width:e.itemWidth},s):(0,w.createElement)(a,{...c9(a,c),className:n,"data-index":t.index,key:s},r(t.index,t.data,c))})})}),hU=S().memo(function(){let e=hX("HeaderComponent"),t=hJ("headerHeight"),n=hX("headerFooterTag"),r=uS(S().useMemo(()=>e=>{t(uU(e,"height"))},[t]),!0,!1),i=hX("context");return null!=e?(0,b.jsx)(n,{ref:r,children:(0,b.jsx)(e,{...c9(e,i)})}):null}),hq=S().memo(function(){let e=hX("FooterComponent"),t=hJ("footerHeight"),n=hX("headerFooterTag"),r=uS(S().useMemo(()=>e=>{t(uU(e,"height"))},[t]),!0,!1),i=hX("context");return null!=e?(0,b.jsx)(n,{ref:r,children:(0,b.jsx)(e,{...c9(e,i)})}):null}),hY=({children:e})=>{let t=S().useContext(cH),n=hJ("itemDimensions"),r=hJ("viewportDimensions"),i=uS(S().useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return S().useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,b.jsx)("div",{ref:i,style:c4(!1),children:e})},hZ=({children:e})=>{let t=S().useContext(cH),n=hJ("windowViewportRect"),r=hJ("itemDimensions"),i=hX("customScrollParent"),o=hX("useWindowScroll"),s=uk(n,i,!1);return S().useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,b.jsx)("div",{ref:s,style:c6(!1,o),children:e})},{useEmitter:hK,useEmitterValue:hX,usePublisher:hJ}=cz(hW,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},S().memo(function({...e}){let t=hX("useWindowScroll"),n=hX("customScrollParent"),r=n||t?h0:hQ,i=n||t?hZ:hY,o=hX("context");return(0,b.jsx)(r,{...e,...c9(r,o),children:(0,b.jsxs)(i,{children:[(0,b.jsx)(hU,{}),(0,b.jsx)(hG,{}),(0,b.jsx)(hq,{})]})})})),hQ=hn({useEmitter:hK,useEmitterValue:hX,usePublisher:hJ}),h0=hr({useEmitter:hK,useEmitterValue:hX,usePublisher:hJ});function h1(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function h2({items:e,height:t,width:n,selectedItems:r,onLegendItemClick:i,onItemMouseOver:o,onItemMouseOut:s}){let a=e.length>5;return(0,b.jsx)(ha,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,b.jsx)(lU,{item:t,index:e,truncateLabel:a,isVisuallySelected:lR(t,r),onClick:i,onMouseOver:o,onMouseOut:s,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function h5(e,t){return"function"==typeof e?e(t):e}function h3(e,t){return n=>{t.setState(t=>({...t,[e]:h5(n,t[e])}))}}function h4(e){return e instanceof Function}function h6(e,t,n){let r,i=[];return o=>{let s,a;n.key&&n.debug&&(s=Date.now());let l=e(o);if(!(l.length!==i.length||l.some((e,t)=>i[t]!==e)))return r;if(i=l,n.key&&n.debug&&(a=Date.now()),r=t(...l),null==n||null==n.onChange||n.onChange(r),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-s)*100)/100,t=Math.round((Date.now()-a)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
3
|
+
font-size: .6rem;
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function h8(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}let h9="debugHeaders";function h7(e,t,n){var r;let i={id:null!=(r=n.id)?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(i),e},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(i,e)}),i}function de(e,t,n,r){var i,o;let s=0,a=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&a(e.columns,t+1)},0)};a(e);let l=[],u=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let s,a=[...o].reverse()[0],l=e.column.depth===i.depth,u=!1;if(l&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),a&&(null==a?void 0:a.column)===s)a.subHeaders.push(e);else{let i=h7(n,s,{id:[r,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${o.filter(e=>e.column===s).length}`:void 0,depth:t,index:o.length});i.subHeaders.push(e),o.push(i)}i.headers.push(e),e.headerGroup=i}),l.push(i),t>0&&u(o,t-1)};u(t.map((e,t)=>h7(n,e,{depth:s,index:t})),s-1),l.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(i=null==(o=l[0])?void 0:o.headers)?i:[]),l}let dt=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(a._valuesCache.hasOwnProperty(t))return a._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return a._valuesCache[t]=n.accessorFn(a.original,r),a._valuesCache[t]},getUniqueValues:t=>{if(a._uniqueValuesCache.hasOwnProperty(t))return a._uniqueValuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return n.columnDef.getUniqueValues?a._uniqueValuesCache[t]=n.columnDef.getUniqueValues(a.original,r):a._uniqueValuesCache[t]=[a.getValue(t)],a._uniqueValuesCache[t]},renderValue:t=>{var n;return null!=(n=a.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=o?o:[],getLeafRows:()=>{var e,t;let n,r;return e=a.subRows,t=e=>e.subRows,n=[],(r=e=>{e.forEach(e=>{n.push(e);let i=t(e);null!=i&&i.length&&r(i)})})(e),n},getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let e=[],t=a;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:h6(()=>[e.getAllLeafColumns()],t=>t.map(t=>{var n;let r;return n=t.id,r={id:`${a.id}_${t.id}`,row:a,column:t,getValue:()=>a.getValue(n),renderValue:()=>{var t;return null!=(t=r.getValue())?t:e.options.renderFallbackValue},getContext:h6(()=>[e,t,a,r],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),h8(e.options,"debugCells","cell.getContext"))},e._features.forEach(n=>{null==n.createCell||n.createCell(r,t,a,e)},{}),r}),h8(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:h6(()=>[a.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),h8(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){let n=e._features[t];null==n||null==n.createRow||n.createRow(a,e)}return a},dn=(e,t,n)=>{var r,i;let o=null==n||null==(r=n.toString())?void 0:r.toLowerCase();return!!(null==(i=e.getValue(t))||null==(i=i.toString())||null==(i=i.toLowerCase())?void 0:i.includes(o))};dn.autoRemove=e=>df(e);let dr=(e,t,n)=>{var r;return!!(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};dr.autoRemove=e=>df(e);let di=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};di.autoRemove=e=>df(e);let ds=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};ds.autoRemove=e=>df(e);let da=(e,t,n)=>!n.some(n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))});da.autoRemove=e=>df(e)||!(null!=e&&e.length);let dl=(e,t,n)=>n.some(n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)});dl.autoRemove=e=>df(e)||!(null!=e&&e.length);let du=(e,t,n)=>e.getValue(t)===n;du.autoRemove=e=>df(e);let dc=(e,t,n)=>e.getValue(t)==n;dc.autoRemove=e=>df(e);let dh=(e,t,n)=>{let[r,i]=n,o=e.getValue(t);return o>=r&&o<=i};dh.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,i="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(r)?-1/0:r,s=null===n||Number.isNaN(i)?1/0:i;if(o>s){let e=o;o=s,s=e}return[o,s]},dh.autoRemove=e=>df(e)||df(e[0])&&df(e[1]);let dd={includesString:dn,includesStringSensitive:dr,equalsString:di,arrIncludes:ds,arrIncludesAll:da,arrIncludesSome:dl,equals:du,weakEquals:dc,inNumberRange:dh};function df(e){return null==e||""===e}function dp(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let dg={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+("number"==typeof r?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);null!=i&&(i*=1)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!(Array.isArray(n)&&n.every(e=>"number"==typeof e)))return;if(1===n.length)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2!=0?i[r]:(i[r-1]+i[r])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},dm=()=>({left:[],right:[]}),dv={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},dy=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dx=null;function db(e){return"touchstart"===e.type}function dw(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let dS=()=>({pageIndex:0,pageSize:10}),dC=()=>({top:[],bottom:[]}),dA=(e,t,n,r,i)=>{var o;let s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(o=s.subRows)&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(t=>dA(e,t.id,n,r,i))};function dM(e,t){let n=e.getState().rowSelection,r=[],i={},o=function(e,t){return e.map(e=>{var t;let s=dk(e,n);if(s&&(r.push(e),i[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:o(e.subRows)}),s)return e}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function dk(e,t){var n;return null!=(n=t[e.id])&&n}function dT(e,t,n){var r;if(!(null!=(r=e.subRows)&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(e=>{if((!o||i)&&(e.getCanSelect()&&(dk(e,t)?o=!0:i=!1),e.subRows&&e.subRows.length)){let n=dT(e,t);"all"===n?o=!0:("some"===n&&(o=!0),i=!1)}}),i?"all":!!o&&"some"}let dI=/([0-9]+)/gm;function dD(e,t){return e===t?0:e>t?1:-1}function dO(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function dE(e,t){let n=e.split(dI).filter(Boolean),r=t.split(dI).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),o=parseInt(t,10),s=[i,o].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(s[1]))return isNaN(i)?-1:1;if(i>o)return 1;if(o>i)return -1}return n.length-r.length}let d_={alphanumeric:(e,t,n)=>dE(dO(e.getValue(n)).toLowerCase(),dO(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>dE(dO(e.getValue(n)),dO(t.getValue(n))),text:(e,t,n)=>dD(dO(e.getValue(n)).toLowerCase(),dO(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>dD(dO(e.getValue(n)),dO(t.getValue(n))),datetime:(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},basic:(e,t,n)=>dD(e.getValue(n),t.getValue(n))},dR=[{createTable:e=>{e.getHeaderGroups=h6(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;let a=null!=(o=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],l=null!=(s=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[];return de(t,[...a,...n.filter(e=>!(null!=r&&r.includes(e.id))&&!(null!=i&&i.includes(e.id))),...l],e)},h8(e.options,h9,"getHeaderGroups")),e.getCenterHeaderGroups=h6(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>de(t,n=n.filter(e=>!(null!=r&&r.includes(e.id))&&!(null!=i&&i.includes(e.id))),e,"center"),h8(e.options,h9,"getCenterHeaderGroups")),e.getLeftHeaderGroups=h6(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;return de(t,null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"left")},h8(e.options,h9,"getLeftHeaderGroups")),e.getRightHeaderGroups=h6(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;return de(t,null!=(i=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],e,"right")},h8(e.options,h9,"getRightHeaderGroups")),e.getFooterGroups=h6(()=>[e.getHeaderGroups()],e=>[...e].reverse(),h8(e.options,h9,"getFooterGroups")),e.getLeftFooterGroups=h6(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),h8(e.options,h9,"getLeftFooterGroups")),e.getCenterFooterGroups=h6(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),h8(e.options,h9,"getCenterFooterGroups")),e.getRightFooterGroups=h6(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),h8(e.options,h9,"getRightFooterGroups")),e.getFlatHeaders=h6(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),h8(e.options,h9,"getFlatHeaders")),e.getLeftFlatHeaders=h6(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),h8(e.options,h9,"getLeftFlatHeaders")),e.getCenterFlatHeaders=h6(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),h8(e.options,h9,"getCenterFlatHeaders")),e.getRightFlatHeaders=h6(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),h8(e.options,h9,"getRightFlatHeaders")),e.getCenterLeafHeaders=h6(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),h8(e.options,h9,"getCenterLeafHeaders")),e.getLeftLeafHeaders=h6(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),h8(e.options,h9,"getLeftLeafHeaders")),e.getRightLeafHeaders=h6(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),h8(e.options,h9,"getRightLeafHeaders")),e.getLeafHeaders=h6(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var r,i,o,s,a,l;return[...null!=(r=null==(i=e[0])?void 0:i.headers)?r:[],...null!=(o=null==(s=t[0])?void 0:s.headers)?o:[],...null!=(a=null==(l=n[0])?void 0:l.headers)?a:[]].map(e=>e.getLeafHeaders()).flat()},h8(e.options,h9,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:h3("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;let i=e.columns;return null==(n=i.length?i.some(e=>e.getIsVisible()):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=h6(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),h8(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=h6(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],h8(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>h6(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),h8(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:h3("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=h6(e=>[dw(t,e)],t=>t.findIndex(t=>t.id===e.id),h8(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return(null==(r=dw(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;let i=dw(t,n);return(null==(r=i[i.length-1])?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=h6(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(null!=e&&e.length){let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}else i=r;var o=i;if(!(null!=t&&t.length)||!n)return o;let s=o.filter(e=>!t.includes(e.id));return"remove"===n?s:[...t.map(e=>o.find(t=>t.id===e)).filter(Boolean),...s]},h8(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:dm(),...e}),getDefaultOptions:e=>({onColumnPinningChange:h3("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,i,o,s,a,l;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=r&&r.includes(e))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=r&&r.includes(e))),...r]}:"left"===n?{left:[...(null!=(a=null==e?void 0:e.left)?a:[]).filter(e=>!(null!=r&&r.includes(e))),...r],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=r&&r.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=r&&r.includes(e))),right:(null!=(i=null==e?void 0:e.right)?i:[]).filter(e=>!(null!=r&&r.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,r,i;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(i=t.options.enableColumnPinning)?i:t.options.enablePinning)||r)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(e=>null==r?void 0:r.includes(e)),s=n.some(e=>null==i?void 0:i.includes(e));return o?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,r;let i=e.getIsPinned();return i?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[i])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=h6(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.column.id))},h8(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=h6(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),h8(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=h6(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),h8(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?dm():null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:dm())},e.getIsSomeColumnsPinned=t=>{var n,r,i;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(r=o.left)?void 0:r.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=h6(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),h8(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=h6(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),h8(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=h6(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!r.includes(e.id))},h8(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:h3("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?dd.includesString:"number"==typeof r?dd.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?dd.equals:Array.isArray(r)?dd.arrIncludes:dd.weakEquals},e.getFilterFn=()=>{var n,r;return h4(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:dd[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(i=t.options.enableFilters)||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var r,i;let o=e.getFilterFn(),s=null==t?void 0:t.find(t=>t.id===e.id),a=h5(n,s?s.value:void 0);if(dp(o,a,e))return null!=(r=null==t?void 0:t.filter(t=>t.id!==e.id))?r:[];let l={id:e.id,value:a};return s?null!=(i=null==t?void 0:t.map(t=>t.id===e.id?l:t))?i:[]:null!=t&&t.length?[...t,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var r;return null==(r=h5(t,e))?void 0:r.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&dp(t.getFilterFn(),e.value,t))&&!0})})},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:h3("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(i=t.options.enableFilters)||i)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>dd.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:r}=e.options;return h4(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:dd[r]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:h3("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return d_.datetime;if("string"==typeof n&&(r=!0,n.split(dI).length>1))return d_.alphanumeric}return r?d_.text:d_.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw Error();return h4(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:d_[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),o=null!=n;t.setSorting(s=>{let a,l=null==s?void 0:s.find(t=>t.id===e.id),u=null==s?void 0:s.findIndex(t=>t.id===e.id),c=[],h=o?n:"desc"===i;if("toggle"!=(a=null!=s&&s.length&&e.getCanMultiSort()&&r?l?"toggle":"add":null!=s&&s.length&&u!==s.length-1?"replace":l?"toggle":"replace")||o||i||(a="remove"),"add"===a){var d;(c=[...s,{id:e.id,desc:h}]).splice(0,c.length-(null!=(d=t.options.maxMultiSortColCount)?d:Number.MAX_SAFE_INTEGER))}else c="toggle"===a?s.map(t=>t.id===e.id?{...t,desc:h}:t):"remove"===a?s.filter(t=>t.id!==e.id):[{id:e.id,desc:h}];return c})},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;let o=e.getFirstSortDir(),s=e.getIsSorted();return s?(s===o||null!=(r=t.options.enableSortingRemoval)&&!r||!!n&&null!=(i=t.options.enableMultiRemove)&&!i)&&("desc"===s?"asc":"desc"):o},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let r=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:h3("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,r;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(r=t.options.enableGrouping)||r)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?dg.sum:"[object Date]"===Object.prototype.toString.call(r)?dg.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw Error();return h4(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:dg[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=n.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:h3("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t)return void e._queue(()=>{t=!0});if(null!=(r=null!=(i=e.options.autoResetAll)?i:e.options.autoResetExpanded)?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;let o=!0===r||!!(null!=r&&r[e.id]),s={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach(e=>{s[e]=!0}):s=r,n=null!=(i=n)?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=s;return n}return r})},e.getIsExpanded=()=>{var n;let r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,i;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(r=t.options.enableExpanding)||r)&&!!(null!=(i=e.subRows)&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)n=(r=t.getRow(r.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...dS(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:h3("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t)return void e._queue(()=>{t=!0});if(null!=(r=null!=(i=e.options.autoResetAll)?i:e.options.autoResetPageIndex)?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>h5(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?dS():null!=(n=e.initialState.pagination)?n:dS())},e.setPageIndex=t=>{e.setPagination(n=>{let r=h5(t,n.pageIndex);return r=Math.max(0,Math.min(r,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,h5(t,e.pageSize)),r=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:r,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var r;let i=h5(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...n,pageCount:i}}),e.getPageOptions=h6(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},h8(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return -1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:dC(),...e}),getDefaultOptions:e=>({onRowPinningChange:h3("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let o=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,r,i,o,a,l;return"bottom"===n?{top:(null!=(i=null==e?void 0:e.top)?i:[]).filter(e=>!(null!=s&&s.has(e))),bottom:[...(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)]}:"top"===n?{top:[...(null!=(a=null==e?void 0:e.top)?a:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)],bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=s&&s.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=s&&s.has(e))),bottom:(null!=(r=null==e?void 0:e.bottom)?r:[]).filter(e=>!(null!=s&&s.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:r,enablePinning:i}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:i)||n},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(e=>null==r?void 0:r.includes(e)),s=n.some(e=>null==i?void 0:i.includes(e));return o?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,r;let i=e.getIsPinned();if(!i)return -1;let o=null==(n="top"===i?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(r=null==o?void 0:o.indexOf(e.id))?r:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?dC():null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:dC())},e.getIsSomeRowsPinned=t=>{var n,r,i;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(r=o.top)?void 0:r.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,r)=>{var i;return(null==(i=e.options.keepPinnedRows)||i?(null!=n?n:[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r}))},e.getTopRows=h6(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),h8(e.options,"debugRows","getTopRows")),e.getBottomRows=h6(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),h8(e.options,"debugRows","getBottomRows")),e.getCenterRows=h6(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!r.has(e.id))},h8(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:h3("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=void 0!==t?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(t=>{dA(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=h6(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?dM(e,n):{rows:[],flatRows:[],rowsById:{}},h8(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=h6(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?dM(e,n):{rows:[],flatRows:[],rowsById:{}},h8(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=h6(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?dM(e,n):{rows:[],flatRows:[],rowsById:{}},h8(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=void 0!==n?n:!i,e.getCanSelect()&&i===n)return o;let a={...o};return dA(a,e.id,n,null==(s=null==r?void 0:r.selectChildren)||s,t),a})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return dk(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===dT(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===dT(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},{getDefaultColumnDef:()=>dv,getInitialState:e=>({columnSizing:{},columnSizingInfo:dy(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:h3("columnSizing",e),onColumnSizingInfoChange:h3("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:dv.minSize,null!=(r=null!=o?o:e.columnDef.size)?r:dv.size),null!=(i=e.columnDef.maxSize)?i:dv.maxSize)},e.getStart=h6(e=>[e,dw(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),h8(t.options,"debugColumns","getStart")),e.getAfter=h6(e=>[e,dw(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),h8(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{if(e.subHeaders.length)e.subHeaders.forEach(n);else{var r;t+=null!=(r=e.column.getSize())?r:0}};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=null==r?void 0:r.getCanResize();return o=>{if(!r||!i||(null==o.persist||o.persist(),db(o)&&o.touches&&o.touches.length>1))return;let s=e.getSize(),a=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],l=db(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var r,i;let o="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*o,a=Math.max(s/(null!=(i=null==e?void 0:e.startSize)?i:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*a,0))/100}),{...e,deltaOffset:s,deltaPercentage:a}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},h=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=n||("u">typeof document?document:null),f={moveHandler:e=>c("move",e.clientX),upHandler:e=>{null==d||d.removeEventListener("mousemove",f.moveHandler),null==d||d.removeEventListener("mouseup",f.upHandler),h(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c("move",e.touches[0].clientX),!1),upHandler:e=>{var t;null==d||d.removeEventListener("touchmove",p.moveHandler),null==d||d.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},g=!!function(){if("boolean"==typeof dx)return dx;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return dx=e}()&&{passive:!1};db(o)?(null==d||d.addEventListener("touchmove",p.moveHandler,g),null==d||d.addEventListener("touchend",p.upHandler,g)):(null==d||d.addEventListener("mousemove",f.moveHandler,g),null==d||d.addEventListener("mouseup",f.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?dy():null!=(n=e.initialState.columnSizingInfo)?n:dy())},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}];function dP(e){let t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}let dL={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},dN=RegExp(Object.keys(dL).join("|"),"g"),dB={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function dF(e,t,n){let r;return(e=dj(e,n),(t=dj(t,n)).length>e.length)?dB.NO_MATCH:e===t?dB.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?dB.EQUAL:e.startsWith(t)?dB.STARTS_WITH:e.includes(` ${t}`)?dB.WORD_STARTS_WITH:e.includes(t)?dB.CONTAINS:1===t.length?dB.NO_MATCH:(r="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{r+=e.substr(0,1)})}),r).includes(t)?dB.ACRONYM:function(e,t){var n;let r,i=0,o=0;function s(e,t,n){for(let r=n,o=t.length;r<o;r++)if(t[r]===e)return i+=1,r+1;return -1}let a=s(t[0],e,0);if(a<0)return dB.NO_MATCH;o=a;for(let n=1,r=t.length;n<r;n++)if(!((o=s(t[n],e,o))>-1))return dB.NO_MATCH;return n=o-a,r=i/t.length,dB.MATCHES+1/n*r}(e,t)}function dj(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(dN,e=>dL[e])),e}let dz={maxRanking:1/0,minRanking:-1/0};function dV(e,t,{isHeader:n,isLastColumn:r,isFirstColumn:i,defaultColumnHeight:o}={}){var s,a;let l=e.spacing(1),u=e.spacing(1.25),c=e.spacing(2),h=i?c:u,d=r?c:u,f=e.typography.body1.lineHeight,p=e.typography.body1.fontSize;"compact"===t&&(l=e.spacing(.5),u=e.spacing(.5),c=e.spacing(1),h=i?c:u,d=r?c:u,f=e.typography.body2.lineHeight,p=e.typography.body2.fontSize),"comfortable"===t&&(l=e.spacing(2),u=e.spacing(1.5),c=e.spacing(2),h=i?c:u,d=r?c:u,f=e.typography.body1.lineHeight,p=e.typography.body1.fontSize);let g=n||!o||"auto"===o?(s=f,a=l,("string"==typeof s?parseInt(s,10):s??0)+2*("string"==typeof a?parseInt(a,10):a)):o;return{padding:`${l} ${d} ${l} ${h}`,height:g,fontSize:p,lineHeight:f}}function dH(e,t){return e.map(({width:e,align:n,headerDescription:r,cellDescription:i,enableSorting:o,dataLink:s,enableResizing:a,...l})=>{var u,c,h,d,f,p,g;let m=a??t?.enableResizing??!1,v="auto"===e||void 0===e?(u=m,c=t?.minWidth,h=t?.maxWidth,u?{size:150,minSize:c??60,maxSize:h??1e3}:{size:0,minSize:0,maxSize:0}):(d=m,f=e,p=t?.minWidth,g=t?.maxWidth,d?{size:f,minSize:p??60,maxSize:g??1e3}:{size:f});return{...l,...v,enableSorting:!!o,enableResizing:m,meta:{align:n,headerDescription:r,cellDescription:i,dataLink:s}}})}var d$=n(32560),dW=n(22402);let dG=(0,dW.A)((0,b.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),dU=(0,dW.A)((0,b.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),dq=(0,dW.A)((0,b.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function dY(e){return(0,R.Ay)("MuiCheckbox",e)}let dZ=(0,_.A)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var dK=n(64606),dX=n(73397);let dJ=(0,I.A)(d$.A,{shouldForwardProp:e=>(0,lP.A)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,T.A)(n.size)}`],"default"!==n.color&&t[`color${(0,T.A)(n.color)}`]]}})((0,D.A)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,M.X4)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,O.A)()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,M.X4)(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter((0,O.A)()).map(([t])=>({props:{color:t},style:{[`&.${dZ.checked}, &.${dZ.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${dZ.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),dQ=(0,b.jsx)(dU,{}),d0=(0,b.jsx)(dG,{}),d1=(0,b.jsx)(dq,{}),d2=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiCheckbox"}),{checkedIcon:r=dQ,color:i="primary",icon:o=d0,indeterminate:s=!1,indeterminateIcon:a=d1,inputProps:l,size:u="medium",disableRipple:c=!1,className:h,slots:d={},slotProps:f={},...p}=n,g=s?a:o,m=s?a:r,v={...n,disableRipple:c,color:i,indeterminate:s,size:u},y=(e=>{let{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${(0,T.A)(r)}`,`size${(0,T.A)(i)}`]},s=(0,A.A)(o,dY,t);return{...t,...s}})(v),x=f.input??l,[S,M]=(0,dX.A)("root",{ref:t,elementType:dJ,className:(0,C.A)(y.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:d,slotProps:f,...p},ownerState:v,additionalProps:{type:"checkbox",icon:w.cloneElement(g,{fontSize:g.props.fontSize??u}),checkedIcon:w.cloneElement(m,{fontSize:m.props.fontSize??u}),disableRipple:c,slots:d,slotProps:{input:(0,dK.A)("function"==typeof x?x(v):x,{"data-indeterminate":s})}}});return(0,b.jsx)(S,{...M,classes:y})});function d5({color:e,density:t,...n}){let r="compact"===t;return(0,b.jsx)(d2,{size:r?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(r?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,M.X4)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:r?16:18}}})}var d3=n(3399),d4=n(76746),d6=n(97653),d8=n(76795),d9=n(45271);function d7(e){return(0,R.Ay)("MuiToolbar",e)}(0,_.A)("MuiToolbar",["root","gutters","regular","dense"]);let fe=(0,I.A)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,D.A)(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),ft=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiToolbar"}),{className:r,component:i="div",disableGutters:o=!1,variant:s="regular",...a}=n,l={...n,component:i,disableGutters:o,variant:s},u=(e=>{let{classes:t,disableGutters:n,variant:r}=e;return(0,A.A)({root:["root",!n&&"gutters",r]},d7,t)})(l);return(0,b.jsx)(fe,{as:i,className:(0,C.A)(u.root,r),ref:t,ownerState:l,...a})});var fn=n(35216),fr=n(96913),fi=n(70776);let fo=(0,dW.A)((0,b.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),fs=(0,dW.A)((0,b.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),fa=w.forwardRef(function(e,t){let{backIconButtonProps:n,count:r,disabled:i=!1,getItemAriaLabel:o,nextIconButtonProps:s,onPageChange:a,page:l,rowsPerPage:u,showFirstButton:c,showLastButton:h,slots:d={},slotProps:f={},...p}=e,g=(0,fn.I)(),m=d.firstButton??$.A,v=d.lastButton??$.A,y=d.nextButton??$.A,x=d.previousButton??$.A,w=d.firstButtonIcon??fs,S=d.lastButtonIcon??fo,C=d.nextButtonIcon??fi.A,A=d.previousButtonIcon??fr.A,M=g?v:m,k=g?y:x,T=g?x:y,I=g?m:v,D=g?f.lastButton:f.firstButton,O=g?f.nextButton:f.previousButton,E=g?f.previousButton:f.nextButton,_=g?f.firstButton:f.lastButton;return(0,b.jsxs)("div",{ref:t,...p,children:[c&&(0,b.jsx)(M,{onClick:e=>{a(e,0)},disabled:i||0===l,"aria-label":o("first",l),title:o("first",l),...D,children:g?(0,b.jsx)(S,{...f.lastButtonIcon}):(0,b.jsx)(w,{...f.firstButtonIcon})}),(0,b.jsx)(k,{onClick:e=>{a(e,l-1)},disabled:i||0===l,color:"inherit","aria-label":o("previous",l),title:o("previous",l),...O??n,children:g?(0,b.jsx)(C,{...f.nextButtonIcon}):(0,b.jsx)(A,{...f.previousButtonIcon})}),(0,b.jsx)(T,{onClick:e=>{a(e,l+1)},disabled:i||-1!==r&&l>=Math.ceil(r/u)-1,color:"inherit","aria-label":o("next",l),title:o("next",l),...E??s,children:g?(0,b.jsx)(A,{...f.previousButtonIcon}):(0,b.jsx)(C,{...f.nextButtonIcon})}),h&&(0,b.jsx)(I,{onClick:e=>{a(e,Math.max(0,Math.ceil(r/u)-1))},disabled:i||l>=Math.ceil(r/u)-1,"aria-label":o("last",l),title:o("last",l),..._,children:g?(0,b.jsx)(w,{...f.firstButtonIcon}):(0,b.jsx)(S,{...f.lastButtonIcon})})]})});var fl=n(63392);function fu(e){return(0,R.Ay)("MuiTablePagination",e)}let fc=(0,_.A)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),fh=(0,I.A)(d9.A,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,D.A)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),fd=(0,I.A)(ft,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${fc.actions}`]:t.actions,...t.toolbar})})((0,D.A)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${fc.actions}`]:{flexShrink:0,marginLeft:20}}))),ff=(0,I.A)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),fp=(0,I.A)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,D.A)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),fg=(0,I.A)(d8.A,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${fc.selectIcon}`]:t.selectIcon,[`& .${fc.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${fc.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),fm=(0,I.A)(d6.A,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),fv=(0,I.A)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,D.A)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function fy({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function fx(e){return`Go to ${e} page`}let fb=w.forwardRef(function(e,t){let n,r=(0,E.b)({props:e,name:"MuiTablePagination"}),{ActionsComponent:i=fa,backIconButtonProps:o,colSpan:s,component:a=d9.A,count:l,disabled:u=!1,getItemAriaLabel:c=fx,labelDisplayedRows:h=fy,labelRowsPerPage:d="Rows per page:",nextIconButtonProps:f,onPageChange:p,onRowsPerPageChange:g,page:m,rowsPerPage:y,rowsPerPageOptions:x=[10,25,50,100],SelectProps:S={},showFirstButton:M=!1,showLastButton:k=!1,slotProps:T={},slots:I={},...D}=r,O=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},fu,t)})(r),_=T?.select??S,R=_.native?"option":fm;(a===d9.A||"td"===a)&&(n=s||1e3);let P=(0,fl.A)(_.id),L=(0,fl.A)(_.labelId),N={slots:I,slotProps:T},[B,F]=(0,dX.A)("root",{ref:t,className:O.root,elementType:fh,externalForwardedProps:{...N,component:a,...D},ownerState:r,additionalProps:{colSpan:n}}),[j,z]=(0,dX.A)("toolbar",{className:O.toolbar,elementType:fd,externalForwardedProps:N,ownerState:r}),[V,H]=(0,dX.A)("spacer",{className:O.spacer,elementType:ff,externalForwardedProps:N,ownerState:r}),[$,W]=(0,dX.A)("selectLabel",{className:O.selectLabel,elementType:fp,externalForwardedProps:N,ownerState:r,additionalProps:{id:L}}),[G,U]=(0,dX.A)("select",{className:O.select,elementType:fg,externalForwardedProps:N,ownerState:r}),[q,Y]=(0,dX.A)("menuItem",{className:O.menuItem,elementType:R,externalForwardedProps:N,ownerState:r}),[Z,K]=(0,dX.A)("displayedRows",{className:O.displayedRows,elementType:fv,externalForwardedProps:N,ownerState:r});return(0,b.jsx)(B,{...F,children:(0,b.jsxs)(j,{...z,children:[(0,b.jsx)(V,{...H}),x.length>1&&(0,b.jsx)($,{...W,children:d}),x.length>1&&(0,b.jsx)(G,{variant:"standard",...!_.variant&&{input:v||(v=(0,b.jsx)(d4.Ay,{}))},value:y,onChange:g,id:P,labelId:L,..._,classes:{..._.classes,root:(0,C.A)(O.input,O.selectRoot,(_.classes||{}).root),select:(0,C.A)(O.select,(_.classes||{}).select),icon:(0,C.A)(O.selectIcon,(_.classes||{}).icon)},disabled:u,...U,children:x.map(e=>(0,w.createElement)(q,{...Y,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,b.jsx)(Z,{...K,children:h({from:0===l?0:m*y+1,to:-1===l?(m+1)*y:-1===y?l:Math.min(l,(m+1)*y),count:-1===l?-1:l,page:m})}),(0,b.jsx)(i,{className:O.actions,backIconButtonProps:o,count:l,nextIconButtonProps:f,onPageChange:p,page:m,rowsPerPage:y,showFirstButton:M,showLastButton:k,slotProps:T.actions,slots:I.actions,getItemAriaLabel:c,disabled:u})]})})}),fw={row:0,column:0},fS=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];var fC=n(91394);let fA=(0,I.A)(fC.A)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),fM={compact:"small",standard:"medium",comfortable:"medium"},fk=(0,w.forwardRef)(function({density:e,...t},n){return(0,b.jsx)(fA,{...t,tabIndex:-1,size:fM[e],ref:n,sx:{width:"100%"}})});var fT=n(5139);let fI=(0,w.forwardRef)(function(e,t){return(0,b.jsx)(fT.A,{...e,ref:t})});var fD=n(93399),fO=n(88091);function fE(e){return(0,R.Ay)("MuiLink",e)}let f_=(0,_.A)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var fR=n(95279);let fP={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},fL=(0,I.A)(fO.A,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`underline${(0,T.A)(n.underline)}`],"button"===n.component&&t.button]}})((0,D.A)(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:t})=>"always"===e&&"inherit"!==t.color,style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter((0,O.A)()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[t].mainChannel} / 0.4)`:(0,M.X4)(e.palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:(0,M.X4)(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:(0,M.X4)(e.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${f_.focusVisible}`]:{outline:"auto"}}}]}))),fN=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiLink"}),r=(0,lO.A)(),{className:i,color:o="primary",component:s="a",onBlur:a,onFocus:l,TypographyClasses:u,underline:c="always",variant:h="inherit",sx:d,...f}=n,[p,g]=w.useState(!1),m={...n,color:o,component:s,focusVisible:p,underline:c,variant:h},v=(e=>{let{classes:t,component:n,focusVisible:r,underline:i}=e,o={root:["root",`underline${(0,T.A)(i)}`,"button"===n&&"button",r&&"focusVisible"]};return(0,A.A)(o,fE,t)})(m);return(0,b.jsx)(fL,{color:o,className:(0,C.A)(v.root,i),classes:u,component:s,onBlur:e=>{(0,fD.A)(e.target)||g(!1),a&&a(e)},onFocus:e=>{(0,fD.A)(e.target)&&g(!0),l&&l(e)},ref:t,ownerState:m,variant:h,...f,sx:[...void 0===fP[o]?[{color:o}]:[],...Array.isArray(d)?d:[d]],style:{...f.style,..."always"===c&&"inherit"!==o&&!fP[o]&&{"--Link-underlineColor":(({theme:e,ownerState:t})=>{let n=t.color,r=(0,fR.Yn)(e,`palette.${n}.main`,!1)||(0,fR.Yn)(e,`palette.${n}`,!1)||t.color,i=(0,fR.Yn)(e,`palette.${n}.mainChannel`)||(0,fR.Yn)(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:(0,M.X4)(r,.4)})({theme:r,ownerState:m})}}})}),fB=(0,I.A)(d9.A)(({theme:e})=>({padding:0,backgroundColor:"inherit","&.MuiTableCell-head":{backgroundColor:e.palette.background.default},"&:focus-visible":{outline:`solid 1px ${e.palette.primary.main}`,outlineOffset:"-1px",borderRadius:0}}));function fF({children:e,density:t,variant:n,width:r,defaultColumnHeight:i,focusState:o="none",onFocusTrigger:s,isFirstColumn:a,isLastColumn:l,description:u,align:c,color:h,backgroundColor:d,dataLink:f,adjacentCellsValuesMap:p,...g}){let m=(0,lO.A)(),v=(0,w.useRef)(),y="head"===n;(0,w.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let x=e=>{s?.(e)},S=(0,w.useMemo)(()=>{if(f){if(p&&r7(f.url)){let{text:e}=r4(f.url,p,{urlEncode:!0});return{...f,url:e}}return f}},[f,p]);return(0,b.jsx)(fB,{...g,tabIndex:"none"!==o?0:-1,onFocus:e=>{let t=e.currentTarget?.querySelector('a[href], button, input, textarea, select, details,[role="button"]');t&&t.focus()},onClick:x,onKeyUp:x,style:{width:r},sx:{position:"relative",borderBottom:y?`solid 1px ${m.palette.grey[100]}`:`solid 1px ${m.palette.grey[50]}`,"&:hover #original-cell":{position:"absolute",top:0,left:0,zIndex:10,width:"fit-content",minWidth:"100%",whiteSpace:"nowrap",overflow:"visible",backgroundColor:`${d??m.palette.background.default} !important`,outline:`solid 1px ${m.palette.info.main}`,outlineOffset:"-1px"}},ref:v,children:(0,b.jsx)(lE.A,{id:"original-cell",sx:{...dV(m,t,{isHeader:y,isLastColumn:l,isFirstColumn:a,defaultColumnHeight:i}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:d??"inherit",color:h??"inherit"},title:u,"aria-label":u,textAlign:c,children:S?(0,b.jsx)(fN,{href:S.url,target:S.targetBlank?"_blank":"_self",rel:S.targetBlank?"noopener noreferrer":void 0,children:e}):e})})}var fj=n(91644);function fz(e){return(0,R.Ay)("MuiTableFooter",e)}(0,_.A)("MuiTableFooter",["root"]);let fV=(0,I.A)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),fH={variant:"footer"},f$="tfoot",fW=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiTableFooter"}),{className:r,component:i=f$,...o}=n,s={...n,component:i},a=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"]},fz,t)})(s);return(0,b.jsx)(fj.A.Provider,{value:fH,children:(0,b.jsx)(fV,{as:i,className:(0,C.A)(a.root,r),ref:t,role:i===f$?null:"rowgroup",ownerState:s,...o})})}),fG=(0,w.forwardRef)(function(e,t){return(0,b.jsx)(fW,{...e,ref:t})});var fU=n(70561);let fq=(0,w.forwardRef)(function(e,t){return(0,b.jsx)(fU.A,{...e,ref:t})}),fY=(0,dW.A)((0,b.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function fZ(e){return(0,R.Ay)("MuiTableSortLabel",e)}let fK=(0,_.A)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),fX=(0,I.A)(lL.A,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,D.A)(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${fK.icon}`]:{opacity:.5}},[`&.${fK.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${fK.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),fJ=(0,I.A)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,T.A)(n.direction)}`]]}})((0,D.A)(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),fQ=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiTableSortLabel"}),{active:r=!1,children:i,className:o,direction:s="asc",hideSortIcon:a=!1,IconComponent:l=fY,slots:u={},slotProps:c={},...h}=n,d={...n,active:r,direction:s,hideSortIcon:a,IconComponent:l},f=(e=>{let{classes:t,direction:n,active:r}=e,i={root:["root",r&&"active",`direction${(0,T.A)(n)}`],icon:["icon",`iconDirection${(0,T.A)(n)}`]};return(0,A.A)(i,fZ,t)})(d),p={slots:u,slotProps:c},[g,m]=(0,dX.A)("root",{elementType:fX,externalForwardedProps:p,ownerState:d,className:(0,C.A)(f.root,o),ref:t}),[v,y]=(0,dX.A)("icon",{elementType:fJ,externalForwardedProps:p,ownerState:d,className:f.icon});return(0,b.jsxs)(g,{disableRipple:!0,component:"span",...m,...h,children:[i,a&&!r?null:(0,b.jsx)(v,{as:l,...y})]})});var f0=n(6227);function f1({onSort:e,sortDirection:t,nextSortDirection:n,children:r,resizeConfig:i,...o}){let s=!!e,a=(0,b.jsx)(fO.A,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:r}),l=!!t;return(0,b.jsxs)(fF,{...o,children:[s?(0,b.jsx)(fQ,{onClick:e,direction:l?t:n,active:l,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${fK.icon}`]:{opacity:l?1:.5}}},children:a}):a,i&&(0,b.jsx)(lE.A,{onMouseDown:e=>{2===e.detail?i.resetSizeHandler():i.resizeHandler(e)},onTouchStart:i.resizeHandler,sx:{position:"absolute",height:"100%",top:0,right:"4px",cursor:"col-resize"},children:(0,b.jsx)(f0.A,{flexItem:!0,orientation:"vertical",sx:e=>({backgroundColor:i.isResizing?e.palette.action.active:e.palette.divider,borderRadius:"2px",borderWidth:"2px",height:"100%",touchAction:"none",transform:"translateX(4px)",userSelect:"none"})})})]})}let f2=(0,w.forwardRef)(function(e,t){return(0,b.jsx)(d3.A,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,M.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var f5=n(2582),f3=n(3725),f4=n(30443),f6=n(46823),f8=n(48865),f9=n(32398),f7=n(2203);function pe(e){return(0,R.Ay)("MuiTooltip",e)}let pt=(0,_.A)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),pn=(0,I.A)(f8.A,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((0,D.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${pt.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${pt.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),pr=(0,I.A)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${(0,T.A)(n.placement.split("-")[0])}`]]}})((0,D.A)(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:(0,M.X4)(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${pt.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${pt.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${pt.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${pt.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Math.round(16/14*1e5)/1e5}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${pt.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${pt.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),pi=(0,I.A)("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})((0,D.A)(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:(0,M.X4)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}))),po=!1,ps=new f3.E,pa={x:0,y:0};function pl(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}let pu=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiTooltip"}),{arrow:r=!1,children:i,classes:o,components:s={},componentsProps:a={},describeChild:l=!1,disableFocusListener:u=!1,disableHoverListener:c=!1,disableInteractive:h=!1,disableTouchListener:d=!1,enterDelay:f=100,enterNextDelay:p=0,enterTouchDelay:g=700,followCursor:m=!1,id:v,leaveDelay:y=0,leaveTouchDelay:x=1500,onClose:S,onOpen:M,open:k,placement:I="bottom",PopperComponent:D,PopperProps:O={},slotProps:_={},slots:R={},title:P,TransitionComponent:L,TransitionProps:N,...B}=n,F=w.isValidElement(i)?i:(0,b.jsx)("span",{children:i}),j=(0,lO.A)(),z=(0,fn.I)(),[V,H]=w.useState(),[$,W]=w.useState(null),G=w.useRef(!1),U=h||m,q=(0,f3.A)(),Y=(0,f3.A)(),Z=(0,f3.A)(),K=(0,f3.A)(),[X,J]=(0,f7.A)({controlled:k,default:!1,name:"Tooltip",state:"open"}),Q=X,ee=(0,fl.A)(v),et=w.useRef(),en=(0,f9.A)(()=>{void 0!==et.current&&(document.body.style.WebkitUserSelect=et.current,et.current=void 0),K.clear()});w.useEffect(()=>en,[en]);let er=e=>{ps.clear(),po=!0,J(!0),M&&!Q&&M(e)},ei=(0,f9.A)(e=>{ps.start(800+y,()=>{po=!1}),J(!1),S&&Q&&S(e),q.start(j.transitions.duration.shortest,()=>{G.current=!1})}),eo=e=>{G.current&&"touchstart"!==e.type||(V&&V.removeAttribute("title"),Y.clear(),Z.clear(),f||po&&p?Y.start(po?p:f,()=>{er(e)}):er(e))},es=e=>{Y.clear(),Z.start(y,()=>{ei(e)})},[,ea]=w.useState(!1),el=e=>{(0,fD.A)(e.target)||(ea(!1),es(e))},eu=e=>{V||H(e.currentTarget),(0,fD.A)(e.target)&&(ea(!0),eo(e))},ec=e=>{G.current=!0;let t=F.props;t.onTouchStart&&t.onTouchStart(e)};w.useEffect(()=>{if(Q)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&ei(e)}},[ei,Q]);let eh=(0,lB.A)((0,f4.A)(F),H,t);P||0===P||(Q=!1);let ed=w.useRef(),ef={},ep="string"==typeof P;l?(ef.title=Q||!ep||c?null:P,ef["aria-describedby"]=Q?ee:null):(ef["aria-label"]=ep?P:null,ef["aria-labelledby"]=Q&&!ep?ee:null);let eg={...ef,...B,...F.props,className:(0,C.A)(B.className,F.props.className),onTouchStart:ec,ref:eh,...m?{onMouseMove:e=>{let t=F.props;t.onMouseMove&&t.onMouseMove(e),pa={x:e.clientX,y:e.clientY},ed.current&&ed.current.update()}}:{}},em={};d||(eg.onTouchStart=e=>{ec(e),Z.clear(),q.clear(),en(),et.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",K.start(g,()=>{document.body.style.WebkitUserSelect=et.current,eo(e)})},eg.onTouchEnd=e=>{F.props.onTouchEnd&&F.props.onTouchEnd(e),en(),Z.start(x,()=>{ei(e)})}),!c&&(eg.onMouseOver=pl(eo,eg.onMouseOver),eg.onMouseLeave=pl(es,eg.onMouseLeave),U||(em.onMouseOver=eo,em.onMouseLeave=es)),!u&&(eg.onFocus=pl(eu,eg.onFocus),eg.onBlur=pl(el,eg.onBlur),U||(em.onFocus=eu,em.onBlur=el));let ev={...n,isRtl:z,arrow:r,disableInteractive:U,placement:I,PopperComponentProp:D,touch:G.current},ey="function"==typeof _.popper?_.popper(ev):_.popper,ex=w.useMemo(()=>{let e=[{name:"arrow",enabled:!!$,options:{element:$,padding:4}}];return O.popperOptions?.modifiers&&(e=e.concat(O.popperOptions.modifiers)),ey?.popperOptions?.modifiers&&(e=e.concat(ey.popperOptions.modifiers)),{...O.popperOptions,...ey?.popperOptions,modifiers:e}},[$,O.popperOptions,ey?.popperOptions]),eb=(e=>{let{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${(0,T.A)(o.split("-")[0])}`],arrow:["arrow"]};return(0,A.A)(s,pe,t)})(ev),ew="function"==typeof _.transition?_.transition(ev):_.transition,eS={slots:{popper:s.Popper,transition:s.Transition??L,tooltip:s.Tooltip,arrow:s.Arrow,...R},slotProps:{arrow:_.arrow??a.arrow,popper:{...O,...ey??a.popper},tooltip:_.tooltip??a.tooltip,transition:{...N,...ew??a.transition}}},[eC,eA]=(0,dX.A)("popper",{elementType:pn,externalForwardedProps:eS,ownerState:ev,className:(0,C.A)(eb.popper,O?.className)}),[eM,ek]=(0,dX.A)("transition",{elementType:f6.A,externalForwardedProps:eS,ownerState:ev}),[eT,eI]=(0,dX.A)("tooltip",{elementType:pr,className:eb.tooltip,externalForwardedProps:eS,ownerState:ev}),[eD,eO]=(0,dX.A)("arrow",{elementType:pi,className:eb.arrow,externalForwardedProps:eS,ownerState:ev,ref:W});return(0,b.jsxs)(w.Fragment,{children:[w.cloneElement(F,eg),(0,b.jsx)(eC,{as:D??f8.A,placement:I,anchorEl:m?{getBoundingClientRect:()=>({top:pa.y,left:pa.x,right:pa.x,bottom:pa.y,width:0,height:0})}:V,popperRef:ed,open:!!V&&Q,id:ee,transition:!0,...em,...eA,popperOptions:ex,children:({TransitionProps:e})=>(0,b.jsx)(eM,{timeout:j.transitions.duration.shorter,...e,...ek,children:(0,b.jsxs)(eT,{...eI,children:[P,r?(0,b.jsx)(eD,{...eO}):null]})})})]})});var pc=n(58597),ph=n(7800),pd=n(98599),pf=n(16979),pp=n(9323),pg=n(12933),pm=n(46177);let pv=(0,w.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...r},i){let[o,s]=(0,w.useState)(t),a=(0,w.useCallback)(e=>{n?.(e)},[n]),l=(0,w.useMemo)(()=>pm(a,e),[e,a]);return(0,b.jsx)(W.A,{ref:i,value:o,onChange:function(e){s(e.target.value),l(e.target.value)},...r})});function py({isSearchEnabled:e,globalFilter:t,onGlobalFilterChange:n,isColumnFilterEnabled:r,columns:i,width:o,columnFilterMenuMaxHeight:s=400,isExpandAllEnabled:a,isAllExpanded:l,onExpandAllChange:u}){let[c,h]=(0,w.useState)(null),d=!!c,[f,p]=(0,w.useState)(0),g=(0,w.useCallback)(()=>{n(""),p(e=>e+1)},[n]);return e||r||a?(0,b.jsxs)(H.A,{direction:"row",gap:1,alignItems:"center",justifyContent:"flex-end",width:o,padding:"0.5rem",sx:{backgroundColor:e=>e.palette.background.default},children:[e&&(0,b.jsx)(pv,{placeholder:"Search...",value:t,onChange:n,variant:"standard",slotProps:{htmlInput:{"aria-label":"search table"},input:{startAdornment:(0,b.jsx)(f5.A,{position:"start",children:(0,b.jsx)(pd,{fontSize:"small"})}),endAdornment:""!==t&&(0,b.jsx)(f5.A,{position:"end",children:(0,b.jsx)($.A,{onClick:g,children:(0,b.jsx)(ph,{fontSize:"small"})})})}},sx:{flexGrow:1}},f),a&&(0,b.jsx)(pu,{title:l?"Collapse all":"Expand all",children:(0,b.jsx)($.A,{onClick:u,color:"info","aria-label":l?"collapse all rows":"expand all rows",children:l?(0,b.jsx)(pf,{}):(0,b.jsx)(pp,{})})}),r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($.A,{onClick:e=>h(e.currentTarget),"aria-haspopup":"listbox","aria-expanded":d,color:"info",children:(0,b.jsx)(pg,{})}),(0,b.jsx)(pc.A,{anchorEl:c,open:d,onClose:()=>h(null),slotProps:{list:{dense:!0}},sx:{maxHeight:s},children:i.map(e=>{let t=e.columnDef.header,n="string"==typeof t?t:e.id;return(0,b.jsxs)(d6.A,{disabled:!e.getCanHide(),onClick:e.getCanHide()?e.getToggleVisibilityHandler():void 0,dense:!0,children:[(0,b.jsx)(d2,{checked:e.getIsVisible(),disabled:!e.getCanHide(),size:"small",disableRipple:!0,sx:{p:0,mr:1}}),(0,b.jsx)(l$.A,{primary:n})]},e.id)})})]})]}):null}pv.displayName="TextField";var px=n(347);let pb=(0,w.forwardRef)(function(e,t){return(0,b.jsx)(px.A,{...e,tabIndex:-1,ref:t,sx:rV({flexGrow:1},e.sx)})});function pw({width:e,height:t,density:n,defaultColumnWidth:r,defaultColumnHeight:i,onRowClick:o,onRowMouseOver:s,onRowMouseOut:a,rows:l,columns:u,headers:c,columnSizing:h,columnSizingInfo:d,cellConfigs:f,pagination:p,onPaginationChange:g,rowCount:m,toolbarConfig:v}){let y=(0,w.useRef)(null),x=(0,w.useRef)({startIndex:0,endIndex:0}),S=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:r}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[r,i]=(0,w.useState)(fw),[o,s]=(0,w.useState)(!1);return{activeCell:r,isActive:o,onTableKeyDown:(0,w.useCallback)(r=>{let o=r.key;(fS.includes(o)||"Home"===o||"End"===o||"PageDown"===o||"PageUp"===o)&&i(i=>{let s=i.row,a=i.column;"ArrowRight"===o&&a<t-1?(r.preventDefault(),a+=1):"ArrowLeft"===o&&a>0?(r.preventDefault(),a-=1):"ArrowDown"===o&&s<e-1?(r.preventDefault(),s+=1):"ArrowUp"===o&&s>0?(r.preventDefault(),s-=1):"Home"===o?(r.preventDefault(),s=0,a=0):"End"===o&&(r.preventDefault(),s=e-1,a=t-1);let l={column:a,row:s},u=n?.(r,i,l)||l;return u.row===i.row&&u.column===i.column?i:u})},[t,e,n]),onCellFocus:e=>{e.column===r.column&&e.row===r.row&&o||(s(!0),i(e))},onTableBlur:(0,w.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||(s(!1),i(fw))},[])}}({maxRows:n,maxColumns:r,onActiveCellChange:(r,i,o)=>{let s=r.key,a=o&&(i.column!==o.column||i.row!==o.row),l=o?.row??i.row;if("ArrowDown"===s&&a)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"end"});else if("ArrowUp"===s&&a)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"start"});else if(a&&("Home"===s||"End"===s))t.current?.scrollToIndex({index:Math.max(l-1,0),align:"start"});else if("PageDown"===s){r.preventDefault();let o=i.row;return o=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:o-1,align:"start"}),{row:o,column:i.column}}else if("PageUp"===s){let n=i.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:i.column}}return o}})}({visibleRange:x,virtualTable:y,maxRows:l.length+1,maxColumns:u.length}),C=e=>e.row===S.activeCell.row&&e.column===S.activeCell.column?S.isActive?"trigger-focus":"focus-next":"none",A=(0,w.useMemo)(()=>({Scroller:pb,Table:t=>(0,b.jsx)(fk,{...t,width:e,density:n,onKeyDown:S.onTableKeyDown,onBlur:S.onTableBlur}),TableHead:fq,TableFoot:fG,TableRow:({item:e,...t})=>{let r=l[t["data-index"]];if(!r)return null;let i={id:r.id,index:r.index};return(0,b.jsx)(f2,{...t,onClick:e=>o(e,r.id),density:n,onMouseOver:e=>{s?.(e,i)},onMouseOut:e=>{a?.(e,i)}})},TableBody:fI}),[n,S.onTableKeyDown,S.onTableBlur,o,a,s,l,e]),M=(e,t)=>{p&&g&&g({...p,pageIndex:t})},k=e=>{p&&g&&g({pageIndex:0,pageSize:parseInt(e.target.value,10)})},T=(0,w.useMemo)(()=>{let e={};return c.forEach(t=>{t.headers.filter(e=>e.column.getCanResize()).forEach(t=>{e[`--header-${t.id}-size`]=t.getSize(),e[`--col-${t.column.id}-size`]=t.column.getSize()})}),e},[d,h,c]);return(0,b.jsxs)(lE.A,{style:{width:e,height:t,...T},children:[(0,b.jsx)(py,{...v,width:e}),(0,b.jsx)(hC,{ref:y,totalCount:l.length,components:A,rangeChanged:e=>{x.current=e},fixedHeaderContent:()=>(0,b.jsx)(b.Fragment,{children:c.map(e=>(0,b.jsx)(f2,{density:n,children:e.headers.map((e,t,o)=>{var s,a,l,u,c;let h,d=e.column,f={row:0,column:t},p=d.getIsSorted(),g=d.getNextSortingOrder();return(0,b.jsx)(f1,{onSort:d.getCanSort()?d.getToggleSortingHandler():void 0,sortDirection:"string"==typeof p?p:void 0,nextSortDirection:"string"==typeof g?g:void 0,width:e.column.getCanResize()?`calc(var(--header-${e?.id}-size) * 1px)`:d.getSize()||r,defaultColumnHeight:i,align:d.columnDef.meta?.align,variant:"head",density:n,description:d.columnDef.meta?.headerDescription,focusState:C(f),onFocusTrigger:()=>S.onCellFocus(f),isFirstColumn:0===t,isLastColumn:t===o.length-1,resizeConfig:e.column.getCanResize()?{resizeHandler:e.getResizeHandler(),resetSizeHandler:e.column.resetSize,isResizing:e.column.getIsResizing()}:void 0,children:(s=d.columnDef.header,a=e.getContext(),s?"function"==typeof(u=l=s)&&(h=Object.getPrototypeOf(u)).prototype&&h.prototype.isReactComponent||"function"==typeof l||"object"==typeof(c=l)&&"symbol"==typeof c.$$typeof&&["react.memo","react.forward_ref"].includes(c.$$typeof.description)?w.createElement(s,a):s:null)},e.id)})},e.id))}),fixedFooterContent:p?()=>(0,b.jsx)(d3.A,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,b.jsx)(fb,{colSpan:u.length,count:m,page:p.pageIndex,rowsPerPage:p.pageSize,onPageChange:M,onRowsPerPageChange:k})}):void 0,itemContent:e=>{let t=l[e];return t?(0,b.jsx)(b.Fragment,{children:t.getVisibleCells().map((o,s,a)=>{let l,u={row:e+1,column:s},c=o.getContext(),h=f?.[c.cell.id],d=o.column.columnDef.cell,p="function"==typeof d?d(c):null,g=o.column.columnDef.meta?.cellDescription;"function"==typeof g?l=g(c):g&&"string"==typeof p&&(l=p);let m=Object.entries(t.original)?.filter(([e,t])=>["string","number"].includes(typeof t)).reduce((e,[t,n])=>({...e,[t]:String(n)}),{});return(0,b.jsx)(fF,{"data-testid":o.id,title:l||h?.text||p,width:o.column.getCanResize()?`calc(var(--col-${o.column.id}-size) * 1px)`:o.column.getSize()||r,defaultColumnHeight:i,align:o.column.columnDef.meta?.align,density:n,focusState:C(u),onFocusTrigger:()=>S.onCellFocus(u),isFirstColumn:0===s,isLastColumn:s===a.length-1,description:l,color:h?.textColor??void 0,backgroundColor:h?.backgroundColor??void 0,dataLink:o.column.columnDef.meta?.dataLink,adjacentCellsValuesMap:m,children:h?.text||p},o.id)})}):null}})]})}let pS=(e,t)=>`${t}`,pC={},pA=[];function pM({data:e,columns:t,cellConfigs:n,density:r="standard",defaultColumnWidth:i=150,defaultColumnHeight:o="auto",checkboxSelection:s,onRowSelectionChange:a,onSortingChange:l,getCheckboxColor:u,getRowId:c=pS,rowSelection:h=pC,sorting:d=pA,getItemActions:f,hasItemActions:p,pagination:g,onPaginationChange:m,rowSelectionVariant:v="standard",getSubRows:y,hiddenColumns:x,tableToolbarConfig:S,columnResizeMode:C="onChange",defaultColumnConfig:A,...M}){let k=(0,lO.A)(),T=!!y,[I,D]=(0,w.useState)({}),{globalFilter:O,setGlobalFilter:E,fuzzySearchOptions:_}=function(e,t,n,r){let[i,o]=(0,w.useState)(""),[s,a]=(0,w.useState)(n),l=(0,w.useCallback)(e=>{o(t=>(t?t&&!e&&r(s):(a(n),r(!0)),e))},[n,s,r]);return{globalFilter:i,setGlobalFilter:l,fuzzySearchOptions:{filterFns:{fuzzy:(e,n,r,i)=>{let o=function(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:dB.MATCHES,!n.accessors){let r=dF(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}let i=function(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],o="function"==typeof i?dz:{...dz,...i},s=function(e,t){let n=t;"object"==typeof t&&(n=t.accessor);let r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}(e,i);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:o})}return n}(e,n.accessors),o={rankedValue:e,rank:dB.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<i.length;e++){let r=i[e],s=dF(r.itemValue,t,n),{minRanking:a,maxRanking:l,threshold:u=n.threshold}=r.attributes;s<a&&s>=dB.MATCHES?s=a:s>l&&(s=l),(s=Math.min(s,l))>=u&&s>o.rank&&(o.rank=s,o.passed=!0,o.accessorIndex=e,o.accessorThreshold=u,o.rankedValue=r.itemValue)}return o}(e.getValue(n),r,{threshold:dB[t]});return i({itemRank:o}),o.passed}},globalFilterFn:e?"fuzzy":void 0,getFilteredRowModel:e?e=>h6(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{var i,o,s,a,l,u,c,h,d,f;let p,g,m,v,y,x,b,w,S,C;if(!t.rows.length||!(null!=n&&n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let A=[],M=[];(null!=n?n:[]).forEach(t=>{var n;let r=e.getColumn(t.id);if(!r)return;let i=r.getFilterFn();i&&A.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})});let k=(null!=n?n:[]).map(e=>e.id),T=e.getGlobalFilterFn(),I=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());r&&T&&I.length&&(k.push("__global__"),I.forEach(e=>{var t;M.push({id:e.id,filterFn:T,resolvedValue:null!=(t=null==T.resolveFilterValue?void 0:T.resolveFilterValue(r))?t:r})}));for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},A.length)for(let e=0;e<A.length;e++){let t=(p=A[e]).id;n.columnFilters[t]=p.filterFn(n,t,p.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(M.length){for(let e=0;e<M.length;e++){let t=(g=M[e]).id;if(g.filterFn(n,t,g.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return i=t.rows,o=e=>{for(let t=0;t<k.length;t++)if(!1===e.columnFilters[k[t]])return!1;return!0},e.options.filterFromLeafRows?(s=i,a=o,m=[],v={},y=null!=(u=(l=e).options.maxLeafRowFilterDepth)?u:100,{rows:(x=function(e,t){void 0===t&&(t=0);let n=[];for(let i=0;i<e.length;i++){var r;let o=e[i],s=dt(l,o.id,o.original,o.index,o.depth,void 0,o.parentId);if(s.columnFilters=o.columnFilters,null!=(r=o.subRows)&&r.length&&t<y){if(s.subRows=x(o.subRows,t+1),a(o=s)&&!s.subRows.length||a(o)||s.subRows.length){n.push(o),v[o.id]=o,m.push(o);continue}}else a(o=s)&&(n.push(o),v[o.id]=o,m.push(o))}return n})(s),flatRows:m,rowsById:v}):(c=i,h=o,b=[],w={},S=null!=(f=(d=e).options.maxLeafRowFilterDepth)?f:100,{rows:(C=function(e,t){void 0===t&&(t=0);let n=[];for(let i=0;i<e.length;i++){let o=e[i];if(h(o)){var r;if(null!=(r=o.subRows)&&r.length&&t<S){let e=dt(d,o.id,o.original,o.index,o.depth,void 0,o.parentId);e.subRows=C(o.subRows,t+1),o=e}n.push(o),b.push(o),w[o.id]=o}}return n})(c),flatRows:b,rowsById:w})},h8(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())):void 0,filterFromLeafRows:e,onGlobalFilterChange:l}}}(S?.isSearchEnabled,S?.fuzzyMatchThreshold??"CONTAINS",I,D),[R,P]=(0,w.useState)(x?.reduce((e,t)=>({...e,[t]:!1}),{})??{}),L=(0,w.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():a?.({[t.id]:!0})},[a,v]),N=(0,w.useCallback)((e,t,n)=>{let r=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;L(t,n,!!r?.metaKey||!!r?.shiftKey)},[L]),B=(0,w.useMemo)(()=>({id:"itemActions",header:"Actions",cell:({row:e})=>(0,b.jsx)(H.A,{direction:"row",alignItems:"center",children:f?.({id:e.id,data:e.original})}),enableSorting:!1,enableResizing:!1}),[f]),F=(0,w.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,b.jsx)(d5,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:k.palette.text.primary,density:r}),cell:({row:e,table:t})=>(0,b.jsx)(d5,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{N(n,t,e)},color:u?.(e.original),density:r}),enableSorting:!1,enableResizing:!1}),[k.palette.text.primary,r,u,N]),j=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=w.useState(()=>({current:function(e){var t,n;let r=[...dR,...null!=(t=e._features)?t:[]],i={_features:r},o=i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(i)),{}),s={...null!=(n=e.initialState)?n:{}};i._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});let a=[],l=!1,u={_features:r,options:{...o,...e},initialState:s,_queue:e=>{a.push(e),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{i.setState(i.initialState)},setOptions:e=>{var t;t=h5(e,i.options),i.options=i.options.mergeOptions?i.options.mergeOptions(o,t):{...o,...t}},getState:()=>i.options.state,setState:e=>{null==i.options.onStateChange||i.options.onStateChange(e)},_getRowId:(e,t,n)=>{var r;return null!=(r=null==i.options.getRowId?void 0:i.options.getRowId(e,t,n))?r:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?i.getPrePaginationRowModel():i.getRowModel()).rowsById[e];if(!n&&!(n=i.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:h6(()=>[i.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...i._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},h8(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:h6(()=>[i._getColumnDefs()],e=>{let t=function(e,n,r){return void 0===r&&(r=0),e.map(e=>{let o=function(e,t,n,r){var i,o;let s,a={...e._getDefaultColumnDef(),...t},l=a.accessorKey,u=null!=(i=null!=(o=a.id)?o:l?"function"==typeof String.prototype.replaceAll?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)?i:"string"==typeof a.header?a.header:void 0;if(a.accessorFn?s=a.accessorFn:l&&(s=l.includes(".")?e=>{let t=e;for(let e of l.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[a.accessorKey]),!u)throw Error();let c={id:`${String(u)}`,accessorFn:s,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:h6(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},h8(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:h6(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},h8(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(i,e,r,n);return o.columns=e.columns?t(e.columns,o,r+1):[],o})};return t(e)},h8(e,"debugColumns","getAllColumns")),getAllFlatColumns:h6(()=>[i.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),h8(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:h6(()=>[i.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),h8(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:h6(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),h8(e,"debugColumns","getAllLeafColumns")),getColumn:e=>i._getAllFlatColumnsById()[e]};Object.assign(i,u);for(let e=0;e<i._features.length;e++){let t=i._features[e];null==t||null==t.createTable||t.createTable(i)}return i}(t)})),[r,i]=w.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:(0,w.useMemo)(()=>{let e=dH(t,A);return p&&e.unshift(B),s&&e.unshift(F),e},[t,A,p,s,B,F]),getRowId:c,getCoreRowModel:e=>h6(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,o){void 0===i&&(i=0);let s=[];for(let l=0;l<t.length;l++){let u=dt(e,e._getRowId(t[l],l,o),t[l],l,i,void 0,null==o?void 0:o.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows){var a;u.originalSubRows=e.options.getSubRows(t[l],l),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return s};return n.rows=r(t),n},h8(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>h6(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let r=e.getState().sorting,i=[],o=r.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),s={};o.forEach(t=>{let n=e.getColumn(t.id);n&&(s[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let a=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let r=0;r<o.length;r+=1){var n;let i=o[r],a=s[i.id],l=a.sortUndefined,u=null!=(n=null==i?void 0:i.desc)&&n,c=0;if(l){let n=e.getValue(i.id),r=t.getValue(i.id),o=void 0===n,s=void 0===r;if(o||s){if("first"===l)return o?-1:1;if("last"===l)return o?1:-1;c=o&&s?0:o?l:-l}}if(0===c&&(c=a.sortingFn(e,t,i.id)),0!==c)return u&&(c*=-1),a.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))}),t};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},h8(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:g?e=>h6(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let r;if(!n.rows.length)return n;let{pageSize:i,pageIndex:o}=t,{rows:s,flatRows:a,rowsById:l}=n,u=i*o;s=s.slice(u,u+i),(r=e.options.paginateExpandedRows?{rows:s,flatRows:a,rowsById:l}:dP({rows:s,flatRows:a,rowsById:l})).flatRows=[];let c=e=>{r.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return r.rows.forEach(c),r},h8(e.options,"debugTable","getPaginationRowModel")):void 0,manualPagination:!g,enableRowSelection:!!s,onRowSelectionChange:e=>{let t="function"==typeof e?e(h):e;a?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(d):e;l?.(t)},onColumnVisibilityChange:P,getSubRows:y,getExpandedRowModel:T?e=>h6(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?dP(t):t,h8(e.options,"debugTable","getExpandedRowModel")):void 0,..._,sortDescFirst:!0,columnResizeMode:C,onExpandedChange:D,state:{rowSelection:h,sorting:d,globalFilter:S?.isSearchEnabled?O:void 0,columnVisibility:R,...g?{pagination:g}:{},expanded:I}}),z=(0,w.useCallback)((e,t)=>{let n=j.getRow(t);L(j,n,e.metaKey||e.shiftKey)},[L,j]);return(0,b.jsx)(pw,{...M,density:r,defaultColumnWidth:i,defaultColumnHeight:o,onRowClick:z,rows:j.getRowModel().rows,columns:j.getVisibleFlatColumns(),columnSizing:j.getState().columnSizing,columnSizingInfo:j.getState().columnSizingInfo,headers:j.getHeaderGroups(),cellConfigs:n,pagination:g,onPaginationChange:m,rowCount:j.getRowCount(),toolbarConfig:{isSearchEnabled:S?.isSearchEnabled,globalFilter:O,onGlobalFilterChange:E,isColumnFilterEnabled:S?.isColumnFilterEnabled,columns:j.getAllColumns(),columnFilterMenuMaxHeight:S?.columnFilterMenuMaxHeight,isExpandAllEnabled:T,isAllExpanded:j.getIsAllRowsExpanded(),onExpandAllChange:j.getToggleAllRowsExpandedHandler()}})}let pk=[{accessorKey:"label",header:"Name",enableSorting:!0,enableResizing:!0,cell:({getValue:e})=>(0,b.jsx)("span",{title:e(),children:e()})}],pT=e=>e.id,pI=e=>e.color;function pD({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:r,onItemMouseOut:i,height:o,width:s,columns:a=[],sorting:l,onSortingChange:u}){let c=(0,w.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[pT(t,n)]=!0,e),{}),[t,e]),h=(0,w.useMemo)(()=>{let e=Math.max(s-(a?.reduce((e,t)=>e+("number"==typeof t.width?t.width:150),0)??0)-45,60*pk.length)/pk.length;return[...pk.map(t=>({...t,width:e})),...a]},[a,s]);return(0,b.jsx)(pM,{height:o,width:s,rowSelection:c,onRowSelectionChange:n,onRowMouseOver:r,onRowMouseOut:i,sorting:l,onSortingChange:u,data:e,columns:h,density:"compact",defaultColumnWidth:"auto",getRowId:pT,getCheckboxColor:pI,checkboxSelection:!0,rowSelectionVariant:"legend"})}function pO({width:e,height:t,options:n,data:r,selectedItems:i,onSelectedItemsChange:o,onItemMouseOver:s,onItemMouseOut:a,tableProps:l}){let u,c=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,l_.jM)(i,e=>{if("ALL"===e)return{[t]:!0};let r=!!e[t];return n?(r?delete e[t]:e[t]=!0,e):r?"ALL":{[t]:!0}}))},h=nr(n.mode),d=r.length>=500,f={height:t,items:r,selectedItems:i,onLegendItemClick:c,onItemMouseOver:s,onItemMouseOut:a};return(u="table"===h?(0,b.jsx)(pD,{...f,onSelectedItemsChange:o,width:e,...l}):"right"===n.position||d?(0,b.jsx)(h2,{...f,width:e,onLegendItemClick:c}):(0,b.jsx)(lq,{...f,onLegendItemClick:c}),"right"===n.position)?(0,b.jsx)(lE.A,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0,backgroundColor:e=>`${e.palette.background.default}`},children:u}):(0,b.jsx)(lE.A,{style:{width:e,height:t},sx:{position:"absolute",bottom:0,backgroundColor:e=>`${e.palette.background.default}`},children:u})}let pE={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function p_({children:e,legendProps:t,width:n,height:r,spacing:i=0,legendSize:o,minChildrenWidth:s=100,minChildrenHeight:a=100}){let{content:l,legend:u,margin:c}=function({width:e,height:t,legendProps:n,legendSize:r,minChildrenHeight:i,minChildrenWidth:o,spacing:s,theme:a}){let l,u,c=n?.options,h={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!c)return h;let{position:d}=c;if("list"===nr(c.mode))l="right"===d?200:e,u=40,"right"===d?u=t:t>=300&&(u=100);else{let i=dV(a,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);l="right"===d?pE[r].right+o:e;let s=Math.min(pE[r].bottom,n.data.length+1);u="bottom"===d?s*i.height:t}let f="right"===d?e-l-s:e,p="bottom"===d?t-u-s:t;return"right"===d&&f<o||"bottom"===d&&p<i?h:{legend:{width:l,height:u,show:!0},content:{width:f,height:p},margin:{right:"right"===d?s:0,bottom:"bottom"===d?s:0}}}({width:n,height:r,legendProps:t,minChildrenHeight:a,minChildrenWidth:s,spacing:i,theme:(0,lO.A)(),legendSize:ni(o)});return(0,b.jsxs)(lE.A,{style:{width:n,height:r},sx:{position:"relative",overflow:"hidden"},children:[(0,b.jsx)(lE.A,{style:{width:l.width,height:l.height},sx:{marginRight:`${c.right}px`,marginBottom:`${c.bottom}px`},children:"function"==typeof e?e({width:l.width,height:l.height}):e}),t&&u.show&&(0,b.jsx)(pO,{...t,height:u.height,width:u.width})]})}var pR=n(91467),pP=n(66834),pL=n(92890),pN=n(39750);let pB=(0,I.A)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),pF=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),pj=({children:e,...t})=>(0,b.jsx)(pL.A,{...t,children:e});pj.Header=({children:e,onClose:t,...n})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(pR.A,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,b.jsx)($.A,{"aria-label":"Close",onClick:t,sx:pF,children:(0,b.jsx)(ph,{})})]}),pj.Form=pB,pj.Content=({children:e,sx:t,...n})=>(0,b.jsx)(pP.A,{dividers:!0,...n,sx:rV({minWidth:"500px",textWrap:"balance"},t),children:e}),pj.PrimaryButton=({children:e,...t})=>(0,b.jsx)(z.A,{variant:"contained",type:"submit",...t,children:e}),pj.SecondaryButton=({children:e,...t})=>(0,b.jsx)(z.A,{variant:"outlined",color:"secondary",...t,children:e}),pj.Actions=pN.A;let pz=e=>{let{description:t,isOpen:n,onCancel:r,onDiscardChanges:i}=e;return(0,b.jsxs)(pj,{open:n,"aria-labelledby":"discard-dialog",children:[(0,b.jsx)(pj.Header,{children:"Discard Changes"}),(0,b.jsx)(pj.Content,{children:t}),(0,b.jsxs)(pj.Actions,{children:[(0,b.jsx)(z.A,{variant:"contained",onClick:i,children:"Discard Changes"}),(0,b.jsx)(z.A,{variant:"outlined",color:"secondary",onClick:r,children:"Cancel"})]})]})};var pV=n(66395);let pH=({children:e})=>(0,b.jsx)(pV.Ay,{item:!0,xs:4,children:(0,b.jsx)(H.A,{spacing:3,children:e})});var p$=n(67987),pW=n(9799),pG=n(17366);let pU=({id:e,title:t,description:n,placement:r,children:i,enterDelay:o,enterNextDelay:s})=>{let a=(0,b.jsx)("span",{children:i});return(0,b.jsx)(pY,{arrow:!0,id:e,placement:r??"top",title:(0,b.jsx)(pq,{title:t,description:n}),enterDelay:o??500,enterNextDelay:s??500,children:a})},pq=({title:e,description:t})=>(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(fO.A,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,b.jsx)(fO.A,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),pY=(0,I.A)(({className:e,...t})=>(0,b.jsx)(pu,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${pt.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${pt.arrow}`]:{color:e.palette.background.tooltip}})),pZ=({label:e,control:t,description:n})=>{let r=rH("EditorSectionControl"),i=`${r}-control`,o=`${r}-label`;return(0,b.jsx)(p$.A,{children:(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,b.jsx)(pW.A,{id:o,htmlFor:i,children:e}),n&&(0,b.jsx)(pU,{description:n,enterDelay:100,children:(0,b.jsx)($.A,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,b.jsx)(pG,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,b.jsxs)(lE.A,{sx:{width:"180px",textAlign:"right"},children:[" ",S().cloneElement(t,{id:i,"aria-labelledby":o})]})]})})},pK=({children:e})=>(0,b.jsx)(pV.Ay,{container:!0,spacing:8,children:e}),pX=({title:e,children:t,icon:n})=>(0,b.jsxs)(lE.A,{children:[(0,b.jsxs)(lE.A,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,b.jsx)(fO.A,{variant:"overline",component:"h4",children:e}),n&&(0,b.jsx)(lE.A,{sx:{marginLeft:"auto"},children:n})]}),(0,b.jsx)(H.A,{spacing:1,children:t})]});var pJ=n(31271),pQ=n(81227);function p0({options:e,renderInput:t=e=>(0,b.jsx)(W.A,{...e}),id:n,"aria-labelledby":r,...i}){let o=e=>e.label??e.id;return(0,b.jsx)(pJ.A,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:o,options:e,renderInput:e=>t({...e,inputProps:{...e.inputProps,id:n,"aria-labelledby":r}}),renderOption:({key:e,...t},n)=>(0,b.jsx)("li",{...t,children:(0,b.jsxs)("div",{children:[(0,b.jsx)(fO.A,{variant:"body1",component:"div",children:o(n)}),n.description&&(0,b.jsx)(fO.A,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,pQ.Z)({stringify:e=>`${o(e)} ${e.description||""}`}),...i})}let p1=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function p2({onChange:e,value:t="standard"}){return(0,b.jsx)(pZ,{label:"Density",control:(0,b.jsx)(p0,{value:p1.find(e=>e.id===t),options:p1,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function p5(){return(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",children:[(0,b.jsx)(lE.A,{sx:{content:'""',width:8,height:8,boxSizing:"border-box",position:"absolute",backgroundColor:e=>e.palette.background.default,border:e=>`2px solid ${e.palette.info.main}`,borderRadius:"50%"}}),(0,b.jsx)(lE.A,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function p3(e){return(p3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p4(e,t,n){var r;return(r=function(e,t){if("object"!=p3(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=p3(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==p3(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p6(Object(n),!0).forEach(function(t){p4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p9={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},p7=Symbol("closestEdge");function ge(e){var t;return null!=(t=e[p7])?t:null}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gn(e,t){if(e){if("string"==typeof e)return gt(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(e,t):void 0}}function gr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}(e,t)||gn(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gi(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}var go=n(96907),gs="data-pdnd-honey-pot";function ga(e){return e instanceof Element&&e.hasAttribute(gs)}function gl(e){var t=gr(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?ga(n)?null!=r?r:null:n:null}var gu={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent"};function gc(e){var t=null;return function(){if(!t){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t={result:e.apply(this,r)}}return t.result}}var gh=gc(function(){return"u">typeof HTMLElement&&"function"==typeof HTMLElement.prototype.showPopover});function gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gd(Object(n),!0).forEach(function(t){p4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gp(e){var t,n,r,i,o={x:Math.min((i={x:Math.max((r={x:(n={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:n.y-1}).x,0),y:Math.max(r.y,0)}).x,window.innerWidth-2),y:Math.min(i.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function gg(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function gm(e){return function(e){if(Array.isArray(e))return gt(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||gn(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gv=gc(function(){return navigator.userAgent.includes("Firefox")}),gy=gc(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),gx={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if(!("u"<typeof window)&&gy()){var gb=gw();(0,go.bindAll)(window,[{type:"dragstart",listener:function(){gb.enterCount=0,gb.isOverWindow=!0}},{type:"drop",listener:gS},{type:"dragend",listener:gS},{type:"dragenter",listener:function(e){gb.isOverWindow||0!==gb.enterCount||(e[gx.isEnteringWindow]=!0),gb.isOverWindow=!0,gb.enterCount++}},{type:"dragleave",listener:function(e){gb.enterCount--,gb.isOverWindow&&0===gb.enterCount&&(e[gx.isLeavingWindow]=!0,gb.isOverWindow=!1)}}],{capture:!0})}function gw(){return{enterCount:0,isOverWindow:!1}}function gS(){gb=gw()}function gC(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var gA=(o=function(e){return e()},s=[],a=null,(l=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s=t,a||(a=requestAnimationFrame(function(){a=null,o.apply(void 0,s)}))}).cancel=function(){a&&(cancelAnimationFrame(a),a=null)},l),gM=(u=null,{schedule:function(e){u={frameId:requestAnimationFrame(function(){u=null,e()}),fn:e}},flush:function(){u&&(cancelAnimationFrame(u.frameId),u.fn(),u=null)}}),gk={isActive:!1};function gT(){return!gk.isActive}function gI(e){var t,n=e.event,r=null==(t=e.current[0])?void 0:t.dropEffect;null!=r&&n.dataTransfer&&(n.dataTransfer.dropEffect=r)}var gD=function(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(gT()){var o,s,a=function(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=gC(t);if("external"===n.startedFrom)return{input:i,dropTargets:[]};var o=r({input:i,source:n.payload,target:t.target,current:[]});return{input:i,dropTargets:o}}({event:t,dragType:n,getDropTargetsOver:r});gk.isActive=!0;var l={current:a};gI({event:t,current:a.dropTargets});var u=function(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function o(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,s={current:n,previous:i,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:s,nativeSetDragImage:r}}),gM.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:s}})})},dragUpdate:function(e){var r=e.current;gM.flush(),gA.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;gA(function(){gM.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,s=e.updatedSourcePayload;gM.flush(),gA.cancel(),o({eventName:"onDrop",payload:{source:null!=s?s:t,location:{current:r,previous:i,initial:n}}})}}}({source:n.payload,dispatchEvent:i,initial:a}),c=(0,go.bindAll)(window,[{type:"dragover",listener:function(e){d(e),u.drag({current:l.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return"dragleave"===n&&(gy()?!!gy()&&t.hasOwnProperty(gx.isLeavingWindow):null==r||(gv()?"nodeName"in r&&r.ownerDocument!==document:r instanceof HTMLIFrameElement))})({dragLeave:e})&&(h({input:l.current.input,dropTargets:[]}),"external"===n.startedFrom&&f())}},{type:"drop",listener:function(e){(l.current={dropTargets:l.current.dropTargets,input:gC(e)},l.current.dropTargets.length)?(e.preventDefault(),gI({event:e,current:l.current.dropTargets}),u.drop({current:l.current,updatedSourcePayload:"external"===n.type?n.getDropPayload(e):null}),p()):f()}},{type:"dragend",listener:function(e){l.current={dropTargets:l.current.dropTargets,input:gC(e)},f()}}].concat(gm([{type:"pointermove",listener:(s=0,function(){s<20?s++:o()})},{type:"pointerdown",listener:o=f}])),{capture:!0});u.start({nativeSetDragImage:t.dataTransfer?t.dataTransfer.setDragImage.bind(t.dataTransfer):null})}function h(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}({current:l.current.dropTargets,next:e.dropTargets});l.current=e,t&&u.dragUpdate({current:l.current})}function d(e){var t=gC(e),i=r({target:ga(e.target)?gl({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:l.current.dropTargets});i.length&&(e.preventDefault(),gI({event:e,current:i})),h({dropTargets:i,input:t})}function f(){l.current.dropTargets.length&&h({dropTargets:[],input:l.current.input}),u.drop({current:l.current,updatedSourcePayload:null}),p()}function p(){gk.isActive=!1,c()}},gO=new Map;function gE(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function g_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g_(Object(n),!0).forEach(function(t){p4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gP(e,t){var n="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return gL(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gL(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function gL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gN(e){return e.slice(0).reverse()}function gB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var gj=gc(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),gz="text/plain",gV=new WeakMap,gH=(c=null,{bindEvents:function(){return c=null,(0,go.bind)(window,{type:"pointermove",listener:function(e){c={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,r=t.payload;if("onDragStart"===n){var i,o,s,a=r.location.initial.input,l=null!=c?c:{x:a.clientX,y:a.clientY};(i=document.createElement("div")).setAttribute(gs,"true"),gh()&&i.setAttribute("popover","manual"),o=gp({client:l}),Object.assign(i.style,gf(gf({position:"fixed"},gh()?gu:{zIndex:0x7fffffff}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},gg({clientRect:o}))),document.body.appendChild(i),gh()&&i.showPopover(),s=(0,go.bind)(window,{type:"pointermove",listener:function(e){o=gp({client:{x:e.clientX,y:e.clientY}}),Object.assign(i.style,gg({clientRect:o}))},options:{capture:!0}}),e=function(e){var t,n,r,a=e.current;if(s(),n=(t={client:a,clientRect:o}).client,r=t.clientRect,n.x>=r.x&&n.x<=r.x+r.width&&n.y>=r.y&&n.y<=r.y+r.height)return void i.remove();function l(){u(),i.remove()}var u=(0,go.bindAll)(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}if("onDrop"===n){var u,h=r.location.current.input;null==(u=e)||u({current:{x:h.clientX,y:h.clientY}}),e=null,c=null}}}}),g$=function(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,o=e.defaultDropEffect,s=function(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(r){var i=r.eventName,o=r.payload;if("onGenerateDragPreview"===i){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var s,a=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return gB(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gB(e,void 0):void 0}}(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(s)throw i}}}}(e);try{for(a.s();!(s=a.n()).done;){var l=s.value;n(l)}}catch(e){a.e(e)}finally{a.f()}}if(t){for(var u=Array.from(t.active),c=0;c<u.length;c++){var h,d=u[c];t.active.has(d)&&(null==(h=d[i])||h.call(d,o))}"onDrop"===i&&(t.active.clear(),t=null)}},monitorForConsumers:function(r){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gF(Object(n),!0).forEach(function(t){p4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},r);return e.add(i),n(i),gc(function(){e.delete(i),t&&t.active.delete(i)})}}}(),a=function(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i="data-drop-target-for-".concat(t),o="[".concat(i,"]");function s(e){var t,n=e.eventName,i=e.payload,o=gP(i.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var s,a=t.value,l=r.get(a.element),u=gR(gR({},i),{},{self:a});null==l||null==(s=l[n])||s.call(l,u)}}catch(e){o.e(e)}finally{o.f()}}var a={onGenerateDragPreview:s,onDrag:s,onDragStart:s,onDrop:s,onDropTargetChange:function(e){var t,n=e.payload,i=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,s=gP(n.location.previous.dropTargets);try{for(s.s();!(t=s.n()).done;){var a,l,u=t.value;o.add(u.element);var c=r.get(u.element),h=i.has(u.element),d=gR(gR({},n),{},{self:u});null==c||null==(a=c.onDropTargetChange)||a.call(c,d),h||null==c||null==(l=c.onDragLeave)||l.call(c,d)}}catch(e){s.e(e)}finally{s.f()}var f,p=gP(n.location.current.dropTargets);try{for(p.s();!(f=p.n()).done;){var g,m,v=f.value;if(!o.has(v.element)){var y=gR(gR({},n),{},{self:v}),x=r.get(v.element);null==x||null==(g=x.onDropTargetChange)||g.call(x,y),null==x||null==(m=x.onDragEnter)||m.call(x,y)}}}catch(e){p.e(e)}finally{p.f()}}};return{dropTargetForConsumers:function(e){return gc(gi(gE(e.element,{attribute:i,value:"true"}),(r.set(e.element,e),function(){return r.delete(e.element)})))},getIsOver:function(e){var t=e.source,i=e.target,s=e.input,a=e.current,l=function e(t){var i,s,a,l,u=t.source,c=t.target,h=t.input,d=t.result,f=void 0===d?[]:d;if(null==c)return f;if(!(c instanceof Element))return c instanceof Node?e({source:u,target:c.parentElement,input:h,result:f}):f;var p=c.closest(o);if(null==p)return f;var g=r.get(p);if(null==g)return f;var m={input:h,source:u,element:g.element};if(g.canDrop&&!g.canDrop(m))return e({source:u,target:g.element.parentElement,input:h,result:f});var v=null!=(i=null==(s=g.getData)?void 0:s.call(g,m))?i:{},y=null!=(a=null==(l=g.getDropEffect)?void 0:l.call(g,m))?a:n,x={data:v,element:g.element,dropEffect:y,isActiveDueToStickiness:!1};return e({source:u,target:g.element.parentElement,input:h,result:[].concat(gm(f),[x])})}({source:t,target:i,input:s});if(l.length>=a.length)return l;for(var u=gN(a),c=gN(l),h=[],d=0;d<u.length;d++){var f,p=u[d],g=c[d];if(null!=g){h.push(g);continue}var m=h[d-1],v=u[d-1];if((null==m?void 0:m.element)!==(null==v?void 0:v.element))break;var y=r.get(p.element);if(!y)break;var x={input:s,source:t,element:y.element};if(y.canDrop&&!y.canDrop(x)||!(null!=(f=y.getIsSticky)&&f.call(y,x)))break;h.push(gR(gR({},p),{},{isActiveDueToStickiness:!0}))}return gN(h)},dispatchEvent:function(e){a[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function l(e){null==r||r(e),a.dispatchEvent(e),s.dispatchEvent(e),null==i||i(e)}function u(e){gD({event:e.event,dragType:e.dragType,getDropTargetsOver:a.getIsOver,dispatchEvent:l})}return{registerUsage:function(){var e,r;return r=function(e){var t=e.typeKey,n=e.mount,r=gO.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return gO.set(t,i),i}(e={typeKey:t,mount:function(){return n({canStart:gT,start:u})}}),function(){r.usageCount--,r.usageCount>0||(r.unmount(),gO.delete(e.typeKey))}},dropTarget:a.dropTargetForConsumers,monitor:s.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return gi(gH.bindEvents(),(0,go.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,r,i,o,s,a,l=t.target;if(l instanceof HTMLElement){var u=gV.get(l);if(u){var c=gC(t),h={element:u.element,dragHandle:null!=(n=u.dragHandle)?n:null,input:c};if(u.canDrag&&!u.canDrag(h))return void t.preventDefault();if(u.dragHandle){var d=gl({x:c.clientX,y:c.clientY});if(!u.dragHandle.contains(d))return void t.preventDefault()}var f=null!=(r=null==(i=u.getInitialDataForExternal)?void 0:i.call(u,h))?r:null;if(f)for(var p=0,g=Object.entries(f);p<g.length;p++){var m=gr(g[p],2),v=m[0],y=m[1];t.dataTransfer.setData(v,null!=y?y:"")}!gj()||t.dataTransfer.types.includes(gz)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(gz,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var x={element:u.element,dragHandle:null!=(o=u.dragHandle)?o:null,data:null!=(s=null==(a=u.getInitialData)?void 0:a.call(u,h))?s:{}};e.start({event:t,dragType:{type:"element",payload:x,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;null==(t=gV.get(i.source.element))||null==(n=t[r])||n.call(t,i)},onPostDispatch:gH.getOnPostDispatch()}),gW=g$.dropTarget,gG=g$.monitor;let gU={type:"idle"};function gq({elements:e,accessKey:t,axis:n="vertical",onChange:r}){return(0,w.useEffect)(()=>gG({onDrop({location:i,source:o}){var s,a;let l=i.current.dropTargets[0];if(!l)return;let u=o.data,c=l.data,h=e.findIndex(e=>e[t]===u[t]),d=e.findIndex(e=>e[t]===c[t]);d<0||h<0||r(function(e){var t=e.list,n=e.startIndex,r=e.finishIndex;if(-1===n||-1===r)return Array.from(t);var i=Array.from(t),o=gr(i.splice(n,1),1)[0];return i.splice(r,0,o),i}({list:(s={list:e,startIndex:h,indexOfTarget:d,closestEdgeOfTarget:ge(c),axis:n}).list,startIndex:a=s.startIndex,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(-1===t||-1===r||t===r)return t;if(null==n)return r;var o="vertical"===i&&"bottom"===n||"horizontal"===i&&"right"===n;return t<r?o?r:r-1:o?r+1:r}({closestEdgeOfTarget:s.closestEdgeOfTarget,startIndex:a,indexOfTarget:s.indexOfTarget,axis:s.axis})}))}}),[t,n,e,r])}function gY({children:e,data:t}){let n=(0,w.useRef)(null),[r,i]=(0,w.useState)(gU);return(0,w.useEffect)(()=>{let e=n.current;if(e){var r;return gi((r={element:e,getInitialData:()=>t,onDragStart(){i({type:"is-dragging"})},onDrop(){i(gU)}},gc(gi(g$.registerUsage(),(gV.set(r.element,r),function(){gV.delete(r.element)}),gE(r.element,{attribute:"draggable",value:"true"})))),gW({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>{var r,i,o,s,a,l,u,c,h;return s=(r={element:e,input:n,allowedEdges:["top","bottom"]}).element,a=r.input,l=r.allowedEdges,u={x:a.clientX,y:a.clientY},c=s.getBoundingClientRect(),h=null!=(i=null==(o=l.map(function(e){return{edge:e,value:p9[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:o.edge)?i:null,p8(p8({},t),{},p4({},p7,h))},getIsSticky:()=>!0,onDragEnter({self:e}){i({type:"is-dragging-over",closestEdge:ge(e.data)})},onDrag({self:e}){let t=ge(e.data);i(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){i(gU)},onDrop(){i(gU)}}))}},[t]),(0,b.jsxs)(H.A,{ref:n,spacing:1,style:{opacity:"is-dragging"===r.type?.5:"unset"},children:["is-dragging-over"===r.type&&"top"===r.closestEdge?(0,b.jsx)(p5,{}):null,e,"is-dragging-over"===r.type&&"bottom"===r.closestEdge?(0,b.jsx)(p5,{}):null]})}var gZ=n(53064);function gK(e,t){let n=t.indexOf(e);if(0===n)return t;let r=[...t];return r.splice(n,1),r.splice(n-1,0,e),r}function gX(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let r=[...t];return r.splice(n,1),r.splice(n+1,0,e),r}let gJ=(0,w.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:r,menuSx:i,...o},s){let[a,l]=(0,w.useState)(null),u=!!a;function c(e){l(null),e?.()}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($.A,{...o,ref:s,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){l(e.currentTarget)},children:(0,b.jsx)(gZ,{})}),(e||t||n||r)&&(0,b.jsxs)(pc.A,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:a,open:u,onClose:()=>c(void 0),sx:i,children:[e&&(0,b.jsx)(d6.A,{onClick:()=>c(e),children:"Move Up"}),t&&(0,b.jsx)(d6.A,{onClick:()=>c(t),children:"Move Down"}),n&&(0,b.jsx)(d6.A,{onClick:()=>c(n),children:"Move Left"}),r&&(0,b.jsx)(d6.A,{onClick:()=>c(r),children:"Move Right"}),r&&(0,b.jsx)(d6.A,{onClick:()=>c(r),children:"Move Right"})]})]})});var gQ=n(31789),g0=n(70320),g1=n(45827);let g2={...w}.useSyncExternalStore;function g5(e={}){let{themeId:t}=e;return function(e,n={}){let r=(0,g1.A)();r&&t&&(r=r[t]||r);let i="u">typeof window&&void 0!==window.matchMedia,{defaultMatches:o=!1,matchMedia:s=i?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:l=!1}=(0,g0.A)({name:"MuiUseMediaQuery",props:n,theme:r}),u="function"==typeof e?e(r):e;return(u=u.replace(/^@media( ?)/m,"")).includes("print")&&console.warn("MUI: You have provided a `print` query to the `useMediaQuery` hook.\nUsing the print media query to modify print styles can lead to unexpected results.\nConsider using the `displayPrint` field in the `sx` prop instead.\nMore information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."),(void 0!==g2?function(e,t,n,r,i){let o=w.useCallback(()=>t,[t]),s=w.useMemo(()=>{if(i&&n)return()=>n(e).matches;if(null!==r){let{matches:t}=r(e);return()=>t}return o},[o,e,r,i,n]),[a,l]=w.useMemo(()=>{if(null===n)return[o,()=>()=>{}];let t=n(e);return[()=>t.matches,e=>(t.addEventListener("change",e),()=>{t.removeEventListener("change",e)})]},[o,n,e]);return g2(l,a,s)}:function(e,t,n,r,i){let[o,s]=w.useState(()=>i&&n?n(e).matches:r?r(e).matches:t);return(0,gQ.A)(()=>{if(!n)return;let t=n(e),r=()=>{s(t.matches)};return r(),t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}},[e,n]),o})(u,o,s,a,l)}}g5();var g3=n(93724);let g4=g5({themeId:g3.A});var g6=n(10972),g8=n(46477),g9=n(55403),g7=n(32494),me=n(63025);function mt(e,t,n){let r=function(e,t,n){let r,i=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=(0,me.A)(t);if(t.fakeTransform)r=t.fakeTransform;else{let e=s.getComputedStyle(t);r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let a=0,l=0;if(r&&"none"!==r&&"string"==typeof r){let e=r.split("(")[1].split(")")[0].split(",");a=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+a-i.left}px)`:`translateX(${s.innerWidth+a-i.left}px)`:"right"===e?o?`translateX(-${i.right-o.left-a}px)`:`translateX(-${i.left+i.width-a}px)`:"up"===e?o?`translateY(${o.bottom+l-i.top}px)`:`translateY(${s.innerHeight+l-i.top}px)`:o?`translateY(-${i.top-o.top+i.height-l}px)`:`translateY(-${i.top+i.height-l}px)`}(e,t,"function"==typeof n?n():n);r&&(t.style.webkitTransform=r,t.style.transform=r)}let mn=w.forwardRef(function(e,t){let n=(0,lO.A)(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,container:l,direction:u="down",easing:c=r,in:h,onEnter:d,onEntered:f,onEntering:p,onExit:g,onExited:m,onExiting:v,style:y,timeout:x=i,TransitionComponent:S=g8.Ay,...C}=e,A=w.useRef(null),M=(0,lB.A)((0,f4.A)(a),A,t),k=e=>t=>{e&&(void 0===t?e(A.current):e(A.current,t))},T=k((e,t)=>{mt(u,e,l),(0,g7.q)(e),d&&d(e,t)}),I=k((e,t)=>{let r=(0,g7.c)({timeout:x,style:y,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...r}),e.style.transition=n.transitions.create("transform",{...r}),e.style.webkitTransform="none",e.style.transform="none",p&&p(e,t)}),D=k(f),O=k(v),E=k(e=>{let t=(0,g7.c)({timeout:x,style:y,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),mt(u,e,l),g&&g(e)}),_=k(e=>{e.style.webkitTransition="",e.style.transition="",m&&m(e)}),R=w.useCallback(()=>{A.current&&mt(u,A.current,l)},[u,l]);return w.useEffect(()=>{if(h||"down"===u||"right"===u)return;let e=(0,g9.A)(()=>{A.current&&mt(u,A.current,l)}),t=(0,me.A)(A.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,h,l]),w.useEffect(()=>{h||R()},[h,R]),(0,b.jsx)(S,{nodeRef:A,onEnter:T,onEntered:D,onEntering:I,onExit:E,onExited:_,onExiting:O,addEndListener:e=>{o&&o(A.current,e)},appear:s,in:h,timeout:x,...C,children:(e,{ownerState:t,...n})=>w.cloneElement(a,{ref:M,style:{visibility:"exited"!==e||h?void 0:"hidden",...y,...a.props.style},...n})})});var mr=n(11502);function mi(e){return(0,R.Ay)("MuiDrawer",e)}(0,_.A)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);let mo=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},ms=(0,I.A)(g6.A,{name:"MuiDrawer",slot:"Root",overridesResolver:mo})((0,D.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ma=(0,I.A)("div",{shouldForwardProp:lP.A,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:mo})({flex:"0 0 auto"}),ml=(0,I.A)(mr.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,T.A)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,T.A)(n.anchor)}`]]}})((0,D.A)(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>"left"===e.anchor&&"temporary"!==e.variant,style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"top"===e.anchor&&"temporary"!==e.variant,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"right"===e.anchor&&"temporary"!==e.variant,style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"bottom"===e.anchor&&"temporary"!==e.variant,style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),mu={left:"right",right:"left",top:"down",bottom:"up"},mc=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiDrawer"}),r=(0,lO.A)(),i=(0,fn.I)(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:s="left",BackdropProps:a,children:l,className:u,elevation:c=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:d,...f}={},onClose:p,open:g=!1,PaperProps:m={},SlideProps:v,TransitionComponent:y,transitionDuration:x=o,variant:S="temporary",slots:M={},slotProps:k={},...I}=n,D=w.useRef(!1);w.useEffect(()=>{D.current=!0},[]);let O=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?mu[t]:t}({direction:i?"rtl":"ltr"},s),_={...n,anchor:s,elevation:c,open:g,variant:S,...I},R=(e=>{let{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${(0,T.A)(n)}`],docked:[("permanent"===r||"persistent"===r)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,T.A)(n)}`,"temporary"!==r&&`paperAnchorDocked${(0,T.A)(n)}`]};return(0,A.A)(i,mi,t)})(_),P={slots:{transition:y,...M},slotProps:{paper:m,transition:v,...k,backdrop:(0,dK.A)(k.backdrop||{...a,...d},{transitionDuration:x})}},[L,N]=(0,dX.A)("root",{ref:t,elementType:ms,className:(0,C.A)(R.root,R.modal,u),shouldForwardComponentProp:!0,ownerState:_,externalForwardedProps:{...P,...I,...f},additionalProps:{open:g,onClose:p,hideBackdrop:h,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[B,F]=(0,dX.A)("paper",{elementType:ml,shouldForwardComponentProp:!0,className:(0,C.A)(R.paper,m.className),ownerState:_,externalForwardedProps:P,additionalProps:{elevation:"temporary"===S?c:0,square:!0}}),[j,z]=(0,dX.A)("docked",{elementType:ma,ref:t,className:(0,C.A)(R.root,R.docked,u),ownerState:_,externalForwardedProps:P,additionalProps:I}),[V,H]=(0,dX.A)("transition",{elementType:mn,ownerState:_,externalForwardedProps:P,additionalProps:{in:g,direction:mu[O],timeout:x,appear:D.current}}),$=(0,b.jsx)(B,{...F,children:l});if("permanent"===S)return(0,b.jsx)(j,{...z,children:$});let W=(0,b.jsx)(V,{...H,children:$});return"persistent"===S?(0,b.jsx)(j,{...z,children:W}):(0,b.jsx)(L,{...N,children:W})}),mh=({anchor:e="right",isOpen:t,onClose:n,PaperProps:r,children:i,...o})=>{let s=g4("(max-width:1080px)");return(0,b.jsx)(mc,{...o,open:t,onClose:n,anchor:e,PaperProps:{...r,sx:rV({width:s?"100%":"1080px",overflow:"hidden"},r?.sx)},"aria-hidden":!t,children:i})};var md=n(4884),mf=n(30730),mp=n(50821),mg=n(31831),mm=n(9971),mv=n(43059),my=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.getInitialData=function(e,t){return(0,mv.A)(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),o=r.dataToPoint(i);if(n)(0,md.__)(r.getAxes(),function(e,n){if("category"===e.type&&null!=t){var r=e.getTicksCoords(),s=e.getTickModel().get("alignWithLabel"),a=i[n],l="x1"===t[n]||"y1"===t[n];if(l&&!s&&(a+=1),!(r.length<2)){if(2===r.length){o[n]=e.toGlobalCoord(e.getExtent()[+!!l]);return}for(var u=void 0,c=void 0,h=1,d=0;d<r.length;d++){var f=r[d].coord,p=d===r.length-1?r[d-1].tickValue+h:r[d].tickValue;if(p===a){c=f;break}if(p<a)u=f;else if(null!=u&&p>a){c=(f+u)/2;break}1===d&&(h=p-r[0].tickValue)}null==c&&(u?u&&(c=r[r.length-1].coord):c=r[0].coord),o[n]=e.toGlobalCoord(c)}}});else{var s=this.getData(),a=s.getLayout("offset"),l=s.getLayout("size"),u=+!r.getBaseAxis().isHorizontal();o[u]+=a+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(mm.A);mm.A.registerClass(my);var mx=n(3818),mb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.getInitialData=function(){return(0,mv.A)(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=(0,mx.G_)(my.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(my),mw=n(33317),mS=n(79620),mC=n(45001),mA=n(68532),mM=n(63811),mk=n(23917),mT=n(35032),mI=n(72059),mD=n(73394),mO=n(89425),mE=n(55037),m_=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},mR=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return(0,mg.C6)(t,e),t.prototype.getDefaultShape=function(){return new m_},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),o=Math.max(t.r,0),s=(o-i)*.5,a=i+s,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=2*Math.PI,d=c?u-l<h:l-u<h;d||(l=u-(c?h:-h));var f=Math.cos(l),p=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(e.moveTo(f*i+n,p*i+r),e.arc(f*a+n,p*a+r,s,-Math.PI+l,l,!c)):e.moveTo(f*o+n,p*o+r),e.arc(n,r,o,l,u,!c),e.arc(g*a+n,m*a+r,s,u-2*Math.PI,u-Math.PI,!c),0!==i&&e.arc(n,r,i,u,l,c)},t}(mw.Ay),mP=n(31440),mL=n(43139),mN=n(18538),mB=n(23960);function mF(e,t,n){return t*Math.sin(e)*(n?-1:1)}function mj(e,t,n){return t*Math.cos(e)*(n?1:-1)}function mz(e,t,n){var r=e.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;(0,md.cy)(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:(0,md.Tj)(r,function(e){return(0,mB.lo)(e,i)})}}var mV=Math.max,mH=Math.min,m$=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get("coordinateSystem");("cartesian2d"===i||"polar"===i)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){(0,mC.traverseElements)(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i,o=this.group,s=e.getData(),a=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,h=function(e,t){var n=e.get("realtimeSort",!0),r=t.getBaseAxis();if(n&&"category"===r.type&&"cartesian2d"===t.type)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}(e,l);h&&this._enableRealtimeSort(h,s,n);var d=e.get("clip",!0)||h,f=function(e,t){var n=e.getArea&&e.getArea();if((0,mL.g)(e,"cartesian2d")){var r=e.getBaseAxis();if("category"!==r.type||!r.onBand){var i=t.getLayout("bandWidth");r.isHorizontal()?(n.x-=i,n.width+=2*i):(n.y-=i,n.height+=2*i)}}return n}(l,s);o.removeClipPath();var p=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],x=this._backgroundEls,b=r&&r.isInitSort,w=r&&"changeAxisOrder"===r.type;function S(e){var t,n,r,o=mX[l.type](s,e),a=(t=l,n=i,r=o,new("polar"===t.type?mk.A:mM.A)({shape:m3(n,r,t),silent:!0,z2:0}));return a.useStyle(m.getItemStyle()),"cartesian2d"===l.type?a.setShape("r",v):a.setShape("cornerRadius",v),y[e]=a,a}s.diff(a).add(function(t){var n=s.getItemModel(t),r=mX[l.type](s,t,n);if(g&&S(t),s.hasValue(t)&&mK[l.type](r)){var a=!1;d&&(a=mW[l.type](f,r));var m=mG[l.type](e,s,t,r,i,c,u.model,!1,p);h&&(m.forceLabelAnimation=!0),mQ(m,s,t,n,r,e,i,"polar"===l.type),b?m.attr({shape:r}):h?mU(h,c,m,r,t,i,!1,!1):(0,mA.LW)(m,{shape:r},e,t),s.setItemGraphicEl(t,m),o.add(m),m.ignore=a}}).update(function(t,n){var r=s.getItemModel(t),C=mX[l.type](s,t,r);if(g){var A=void 0;0===x.length?A=S(n):((A=x[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?A.setShape("r",v):A.setShape("cornerRadius",v),y[t]=A);var M=mX[l.type](s,t),k=m3(i,M,l);(0,mA.oi)(A,{shape:k},c,t)}var T=a.getItemGraphicEl(n);if(!s.hasValue(t)||!mK[l.type](C))return void o.remove(T);var I=!1;if(d&&(I=mW[l.type](f,C))&&o.remove(T),T?(0,mA.ap)(T):T=mG[l.type](e,s,t,C,i,c,u.model,!!T,p),h&&(T.forceLabelAnimation=!0),w){var D=T.getTextContent();if(D){var O=(0,mD.Lu)(D);null!=O.prevValue&&(O.prevValue=O.value)}}else mQ(T,s,t,r,C,e,i,"polar"===l.type);b?T.attr({shape:C}):h?mU(h,c,T,C,t,i,!0,w):(0,mA.oi)(T,{shape:C},e,t,null),s.setItemGraphicEl(t,T),T.ignore=I,o.add(T)}).remove(function(t){var n=a.getItemGraphicEl(t);n&&(0,mA.t5)(n,e,t)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new mS.A);C.removeAll();for(var A=0;A<y.length;++A)C.add(y[A]);o.add(C),this._backgroundEls=y,this._data=s},t.prototype._renderLarge=function(e,t,n){this._clear(),m2(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),m2(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&(0,mE.Ip)(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),function(e,t){var i=n(t);i=null==i?NaN:i,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})}),r.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:(0,md.Tj)(r,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),o=Number.MAX_VALUE,s=0,a=r.getOrdinalMeta().categories.length;s<a;++s){var l=e.rawIndexOf(i,r.getRawOrdinalNumber(s)),u=l<0?5e-324:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){(0,mA.t5)(t,e,(0,mT.z)(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(mP.A),mW={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,o=e.y+e.height,s=mV(t.x,e.x),a=mH(t.x+t.width,i),l=mV(t.y,e.y),u=mH(t.y+t.height,o),c=a<s,h=u<l;return t.x=c&&s>i?a:s,t.y=h&&l>o?u:l,t.width=c?0:a-s,t.height=h?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=mH(t.r,e.r),o=mV(t.r0,e.r0);t.r=i,t.r0=o;var s=i-o<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return s}},mG={cartesian2d:function(e,t,n,r,i,o,s,a,l){var u=new mM.A({shape:(0,md.X$)({},r),z2:1});return u.__dataIndex=n,u.name="item",o&&(u.shape[i?"height":"width"]=0),u},polar:function(e,t,n,r,i,o,s,a,l){var u,c,h=!i&&l?mR:mk.A,d=new h({shape:r,z2:1});if(d.name="item",u=mJ(i),c=h===mR,d.calculateTextPosition=function(e,t,n){var r=t.position;if(!r||r instanceof Array)return(0,mB.X4)(e,t,n);var i=u(r),o=null!=t.distance?t.distance:5,s=this.shape,a=s.cx,l=s.cy,h=s.r,d=s.r0,f=(h+d)/2,p=s.startAngle,g=s.endAngle,m=(p+g)/2,v=c?Math.abs(h-d)/2:0,y=Math.cos,x=Math.sin,b=a+h*y(p),w=l+h*x(p),S="left",C="top";switch(i){case"startArc":b=a+(d-o)*y(m),w=l+(d-o)*x(m),S="center",C="top";break;case"insideStartArc":b=a+(d+o)*y(m),w=l+(d+o)*x(m),S="center",C="bottom";break;case"startAngle":b=a+f*y(p)+mF(p,o+v,!1),w=l+f*x(p)+mj(p,o+v,!1),S="right",C="middle";break;case"insideStartAngle":b=a+f*y(p)+mF(p,-o+v,!1),w=l+f*x(p)+mj(p,-o+v,!1),S="left",C="middle";break;case"middle":b=a+f*y(m),w=l+f*x(m),S="center",C="middle";break;case"endArc":b=a+(h+o)*y(m),w=l+(h+o)*x(m),S="center",C="bottom";break;case"insideEndArc":b=a+(h-o)*y(m),w=l+(h-o)*x(m),S="center",C="top";break;case"endAngle":b=a+f*y(g)+mF(g,o+v,!0),w=l+f*x(g)+mj(g,o+v,!0),S="left",C="middle";break;case"insideEndAngle":b=a+f*y(g)+mF(g,-o+v,!0),w=l+f*x(g)+mj(g,-o+v,!0),S="right",C="middle";break;default:return(0,mB.X4)(e,t,n)}return(e=e||{}).x=b,e.y=w,e.align=S,e.verticalAlign=C,e},o){var f=d.shape,p=i?"r":"endAngle",g={};f[p]=i?r.r0:r.startAngle,g[p]=r[p],(a?mA.oi:mA.LW)(d,{shape:g},o)}return d}};function mU(e,t,n,r,i,o,s,a){o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),a||(s?mA.oi:mA.LW)(n,{shape:l},t,i,null);var l,u,c=t?e.baseAxis.model:null;(s?mA.oi:mA.LW)(n,{shape:u},c,i)}function mq(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var mY=["x","y","width","height"],mZ=["cx","cy","r","startAngle","endAngle"],mK={cartesian2d:function(e){return!mq(e,mY)},polar:function(e){return!mq(e,mZ)}},mX={cartesian2d:function(e,t,n){var r,i,o,s=e.getItemLayout(t),a=n?(r=n,i=s,(o=r.get(["itemStyle","borderColor"]))&&"none"!==o?Math.min(r.get(["itemStyle","borderWidth"])||0,isNaN(i.width)?Number.MAX_VALUE:Math.abs(i.width),isNaN(i.height)?Number.MAX_VALUE:Math.abs(i.height)):0):0,l=s.width>0?1:-1,u=s.height>0?1:-1;return{x:s.x+l*a/2,y:s.y+u*a/2,width:s.width-l*a,height:s.height-u*a}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function mJ(e){var t;return t=e?"Arc":"Angle",function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}function mQ(e,t,n,r,i,o,s,a){var l=t.getItemVisual(n,"style");if(a){if(!o.get("roundCap")){var u=e.shape,c=mz(r.getModel("itemStyle"),u,!0);(0,md.X$)(u,c),e.setShape(u)}}else{var h=r.get(["itemStyle","borderRadius"])||0;e.setShape("r",h)}e.useStyle(l);var d=r.getShallow("cursor");d&&e.attr("cursor",d);var f=a?s?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":s?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=(0,mD.lx)(r);(0,mD.qM)(e,p,{labelFetcher:o,labelDataIndex:n,defaultText:(0,mN.i)(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:f});var g=e.getTextContent();if(a&&g){var m=r.get(["label","position"]);e.textConfig.inside="middle"===m||null,function(e,t,n,r){if((0,md.Et)(r))return e.setTextConfig({rotation:r});if((0,md.cy)(t))return e.setTextConfig({rotation:0});var i,o=e.shape,s=o.clockwise?o.startAngle:o.endAngle,a=o.clockwise?o.endAngle:o.startAngle,l=n(t);switch(l){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=(s+a)/2;break;case"startAngle":case"insideStartAngle":i=s;break;case"endAngle":case"insideEndAngle":i=a;break;default:e.setTextConfig({rotation:0});return}var u=1.5*Math.PI-i;"middle"===l&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),e.setTextConfig({rotation:u})}(e,"outside"===m?f:m,mJ(s),r.get(["label","rotate"]))}(0,mD.Oh)(g,p,o.getRawValue(n),function(e){return(0,mN.T)(t,e)});var v=r.getModel(["emphasis"]);(0,mI.Lm)(e,v.get("focus"),v.get("blurScope"),v.get("disabled")),(0,mI.Mx)(e,r),null!=i.startAngle&&null!=i.endAngle&&i.startAngle===i.endAngle&&(e.style.fill="none",e.style.stroke="none",(0,md.__)(e.states,function(e){e.style&&(e.style.fill=e.style.stroke="none")}))}var m0=function(){},m1=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return(0,mg.C6)(t,e),t.prototype.getDefaultShape=function(){return new m0},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],s=[],a=this.barWidth,l=0;l<n.length;l+=3)s[r]=a,s[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],e.rect(o[0],o[1],s[0],s[1])},t}(mw.Ay);function m2(e,t,n,r){var i=e.getData(),o=+!!i.getLayout("valueAxisHorizontal"),s=i.getLayout("largeDataIndices"),a=i.getLayout("size"),l=e.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints");if(u){var c=new m1({shape:{points:u},incremental:!!r,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=s,c.barWidth=a,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var h=new m1({shape:{points:i.getLayout("largePoints")},incremental:!!r,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=s,h.barWidth=a,t.add(h),h.useStyle(i.getVisual("style")),(0,mT.z)(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",m5),h.on("mousemove",m5)),n&&n.push(h)}var m5=(0,mO.nF)(function(e){var t=function(e,t,n){for(var r=e.baseDimIdx,i=1-r,o=e.shape.points,s=e.largeDataIndices,a=[],l=[],u=e.barWidth,c=0,h=o.length/3;c<h;c++){var d=3*c;if(l[r]=u,l[i]=o[d+2],a[r]=o[d+r],a[i]=o[d+i],l[i]<0&&(a[i]+=l[i],l[i]=-l[i]),t>=a[0]&&t<=a[0]+l[0]&&n>=a[1]&&n<=a[1]+l[1])return s[c]}return -1}(this,e.offsetX,e.offsetY);(0,mT.z)(this).dataIndex=t>=0?t:null},30,!1);function m3(e,t,n){if((0,mL.g)(n,"cartesian2d")){var r=n.getArea();return{x:e?t.x:r.x,y:e?r.y:t.y,width:e?t.width:r.width,height:e?r.height:t.height}}var r=n.getArea();return{cx:r.cx,cy:r.cy,r0:e?r.r0:t.r0,r:e?r.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}}var m4=n(91247),m6=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},m8=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return(0,mg.C6)(t,e),t.prototype.getDefaultShape=function(){return new m6},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,o=t.width,s=t.angle,a=t.x-n(s)*o*(o>=i/3?1:2),l=t.y-r(s)*o*(o>=i/3?1:2);s=t.angle-Math.PI/2,e.moveTo(a,l),e.lineTo(t.x+n(s)*o,t.y+r(s)*o),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(s)*o,t.y-r(s)*o),e.lineTo(a,l)},t}(mw.Ay),m9=n(28887),m7=n(51484),ve=n(21916),vt=n(60253),vn=n(64586),vr=n(77324);function vi(e,t){var n=null==e?"":e+"";return t&&((0,md.Kg)(t)?n=t.replace("{value}",n):(0,md.Tn)(t)&&(n=t(e))),n}var vo=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var r,i,o=e.get(["axisLine","lineStyle","color"]),s=(r=e.get("center"),i=Math.min(n.getWidth(),n.getHeight()),{cx:(0,ve.lo)(r[0],n.getWidth()),cy:(0,ve.lo)(r[1],n.getHeight()),r:(0,ve.lo)(e.get("radius"),i/2)});this._renderMain(e,t,n,o,s),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var o=this.group,s=e.get("clockwise"),a=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?mR:mk.A,h=u.get("show"),d=u.getModel("lineStyle"),f=d.get("width"),p=[a,l];(0,vr.q)(p,!s),a=p[0];for(var g=(l=p[1])-a,m=a,v=[],y=0;h&&y<r.length;y++){var x=new c({shape:{startAngle:m,endAngle:l=a+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:s,r0:i.r-f,r:i.r},silent:!0});x.setStyle({fill:r[y][1]}),x.setStyle(d.getLineStyle(["color","width"])),v.push(x),m=l}v.reverse(),(0,md.__)(v,function(e){return o.add(e)});var b=function(e){var t;if(e<=0)return r[0][1];for(t=0;t<r.length;t++)if(r[t][0]>=e&&(0===t?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,b,i,a,l,s,f),this._renderTitleAndDetail(e,t,n,b,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,b,i,a,l,s,f)},t.prototype._renderTicks=function(e,t,n,r,i,o,s,a,l){for(var u,c,h=this.group,d=i.cx,f=i.cy,p=i.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),x=e.getModel("axisLabel"),b=e.get("splitNumber"),w=y.get("splitNumber"),S=(0,ve.lo)(v.get("length"),p),C=(0,ve.lo)(y.get("length"),p),A=o,M=(s-o)/b,k=M/w,T=v.getModel("lineStyle").getLineStyle(),I=y.getModel("lineStyle").getLineStyle(),D=v.get("distance"),O=0;O<=b;O++){if(u=Math.cos(A),c=Math.sin(A),v.get("show")){var E=D?D+l:l,_=new m9.A({shape:{x1:u*(p-E)+d,y1:c*(p-E)+f,x2:u*(p-S-E)+d,y2:c*(p-S-E)+f},style:T,silent:!0});"auto"===T.stroke&&_.setStyle({stroke:r(O/b)}),h.add(_)}if(x.get("show")){var E=x.get("distance")+D,R=vi((0,ve.LI)(O/b*(m-g)+g),x.get("formatter")),P=r(O/b),L=u*(p-S-E)+d,N=c*(p-S-E)+f,B=x.get("rotate"),F=0;"radial"===B?(F=-A+2*Math.PI)>Math.PI/2&&(F+=Math.PI):"tangential"===B?F=-A-Math.PI/2:(0,md.Et)(B)&&(F=B*Math.PI/180),0===F?h.add(new m7.Ay({style:(0,mD.VB)(x,{text:R,x:L,y:N,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:P}),silent:!0})):h.add(new m7.Ay({style:(0,mD.VB)(x,{text:R,x:L,y:N,verticalAlign:"middle",align:"center"},{inheritColor:P}),silent:!0,originX:L,originY:N,rotation:F}))}if(y.get("show")&&O!==b){var E=y.get("distance");E=E?E+l:l;for(var j=0;j<=w;j++){u=Math.cos(A),c=Math.sin(A);var z=new m9.A({shape:{x1:u*(p-E)+d,y1:c*(p-E)+f,x2:u*(p-C-E)+d,y2:c*(p-C-E)+f},silent:!0,style:I});"auto"===I.stroke&&z.setStyle({stroke:r((O+j/w)/b)}),h.add(z),A+=k}A-=k}else A+=M}},t.prototype._renderPointer=function(e,t,n,r,i,o,s,a,l){var u=this.group,c=this._data,h=this._progressEls,d=[],f=e.get(["pointer","show"]),p=e.getModel("progress"),g=p.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),x=+e.get("max"),b=[y,x],w=[o,s];function S(t,n){var r,o=m.getItemModel(t).getModel("pointer"),s=(0,ve.lo)(o.get("width"),i.r),a=(0,ve.lo)(o.get("length"),i.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=(0,ve.lo)(u[0],i.r),h=(0,ve.lo)(u[1],i.r),d=o.get("keepAspect");return(r=l?(0,vt.v5)(l,c-s/2,h-a,s,a,null,d):new m8({shape:{angle:-Math.PI/2,width:s,r:a,x:c,y:h}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function C(e,t){var n=p.get("roundCap")?mR:mk.A,r=p.get("overlap"),s=r?p.get("width"):l/m.count(),u=r?i.r-s:i.r-(e+1)*s,c=r?i.r:i.r-e*s,h=new n({shape:{startAngle:o,endAngle:t,cx:i.cx,cy:i.cy,clockwise:a,r0:u,r:c}});return r&&(h.z2=x-m.get(v,e)%x),h}(g||f)&&(m.diff(c).add(function(t){var n=m.get(v,t);if(f){var r=S(t,o);mA.LW(r,{rotation:-((isNaN(+n)?w[0]:(0,ve.Cb)(n,b,w,!0))+Math.PI/2)},e),u.add(r),m.setItemGraphicEl(t,r)}if(g){var i=C(t,o),s=p.get("clip");mA.LW(i,{shape:{endAngle:(0,ve.Cb)(n,b,w,s)}},e),u.add(i),(0,mT.a)(e.seriesIndex,m.dataType,t,i),d[t]=i}}).update(function(t,n){var r=m.get(v,t);if(f){var i=c.getItemGraphicEl(n),s=i?i.rotation:o,a=S(t,s);a.rotation=s,mA.oi(a,{rotation:-((isNaN(+r)?w[0]:(0,ve.Cb)(r,b,w,!0))+Math.PI/2)},e),u.add(a),m.setItemGraphicEl(t,a)}if(g){var l=h[n],y=C(t,l?l.shape.endAngle:o),x=p.get("clip");mA.oi(y,{shape:{endAngle:(0,ve.Cb)(r,b,w,x)}},e),u.add(y),(0,mT.a)(e.seriesIndex,m.dataType,t,y),d[t]=y}}).execute(),m.each(function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),i=n.get("focus"),o=n.get("blurScope"),s=n.get("disabled");if(f){var a=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(a instanceof vn.Ay){var c=a.style;a.useStyle((0,md.X$)({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else a.useStyle(l),"pointer"!==a.type&&a.setColor(u);a.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===a.style.fill&&a.setStyle("fill",r((0,ve.Cb)(m.get(v,e),b,[0,1],!0))),a.z2EmphasisLift=0,(0,mI.Mx)(a,t),(0,mI.Lm)(a,i,o,s)}if(g){var h=d[e];h.useStyle(m.getItemVisual(e,"style")),h.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,(0,mI.Mx)(h,t),(0,mI.Lm)(h,i,o,s)}}),this._progressEls=d)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),s=n.get("keepAspect"),a=(0,vt.v5)(i,t.cx-r/2+(0,ve.lo)(o[0],t.r),t.cy-r/2+(0,ve.lo)(o[1],t.r),r,r,null,s);a.z2=+!!n.get("showAbove"),a.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(a)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var o=this,s=e.getData(),a=s.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new mS.A,h=[],d=[],f=e.isAnimationEnabled(),p=e.get(["pointer","showAbove"]);s.diff(this._data).add(function(e){h[e]=new m7.Ay({silent:!0}),d[e]=new m7.Ay({silent:!0})}).update(function(e,t){h[e]=o._titleEls[t],d[e]=o._detailEls[t]}).execute(),s.each(function(t){var n=s.getItemModel(t),o=s.get(a,t),g=new mS.A,m=r((0,ve.Cb)(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),x=i.cx+(0,ve.lo)(y[0],i.r),b=i.cy+(0,ve.lo)(y[1],i.r),w=h[t];w.attr({z2:2*!p,style:(0,mD.VB)(v,{x:x,y:b,text:s.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(w)}var S=n.getModel("detail");if(S.get("show")){var C=S.get("offsetCenter"),A=i.cx+(0,ve.lo)(C[0],i.r),M=i.cy+(0,ve.lo)(C[1],i.r),k=(0,ve.lo)(S.get("width"),i.r),T=(0,ve.lo)(S.get("height"),i.r),I=e.get(["progress","show"])?s.getItemVisual(t,"style").fill:m,w=d[t],D=S.get("formatter");w.attr({z2:2*!p,style:(0,mD.VB)(S,{x:A,y:M,text:vi(o,D),width:isNaN(k)?null:k,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:I})}),(0,mD.Oh)(w,{normal:S},o,function(e){return vi(e,D)}),f&&(0,mD.xb)(w,t,s,e,{getFormattedLabel:function(e,t,n,r,i,s){return vi(s?s.interpolatedValue:o,D)}}),g.add(w)}c.add(g)}),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(mP.A),vs=n(85337),va=n(15764);function vl(e,t,n){t=(0,md.cy)(t)&&{coordDimensions:t}||(0,md.X$)({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=(0,vs.A)(r,t).dimensions,o=new va.A(i,e);return o.initData(r,n),o}var vu=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return(0,mg.C6)(t,e),t.prototype.getInitialData=function(e,t){return vl(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(mm.A),vc=n(1514),vh=n(10675),vd=2*Math.PI,vf=Math.PI/180;function vp(e,t){return vh.dV(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function vg(e,t){var n,r,i=vp(e,t),o=e.get("center"),s=e.get("radius");md.cy(s)||(s=[0,s]);var a=(0,ve.lo)(i.width,t.getWidth()),l=(0,ve.lo)(i.height,t.getHeight()),u=Math.min(a,l),c=(0,ve.lo)(s[0],u/2),h=(0,ve.lo)(s[1],u/2),d=e.coordinateSystem;if(d){var f=d.dataToPoint(o);n=f[0]||0,r=f[1]||0}else md.cy(o)||(o=[o,o]),n=(0,ve.lo)(o[0],a)+i.x,r=(0,ve.lo)(o[1],l)+i.y;return{cx:n,cy:r,r0:c,r:h}}function vm(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),r=t.mapDimension("value"),i=vp(e,n),o=vg(e,n),s=o.cx,a=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*vf,h=e.get("endAngle"),d=e.get("padAngle")*vf;h="auto"===h?c-vd:-h*vf;var f=e.get("minAngle")*vf+d,p=0;t.each(r,function(e){!isNaN(e)&&p++});var g=t.getSum(r),m=Math.PI/(g||p)*2,v=e.get("clockwise"),y=e.get("roseType"),x=e.get("stillShowZeroSum"),b=t.getDataExtent(r);b[0]=0;var w=v?1:-1,S=[c,h],C=w*d/2;(0,vr.q)(S,!v),c=S[0];var A=Math.abs((h=S[1])-c),M=A,k=0,T=c;if(t.setLayout({viewRect:i,r:l}),t.each(r,function(e,n){if(isNaN(e))return void t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:s,cy:a,r0:u,r:y?NaN:l});(r="area"!==y?0===g&&x?m:e*m:A/p)<f?(r=f,M-=f):k+=e;var r,i=T+w*r,o=0,c=0;d>r?c=o=T+w*r/2:(o=T+C,c=i-C),t.setItemLayout(n,{angle:r,startAngle:o,endAngle:c,clockwise:v,cx:s,cy:a,r0:u,r:y?(0,ve.Cb)(e,b,[u,l]):l}),T=i}),M<vd&&p)if(M<=.001){var I=A/p;t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n);r.angle=I;var i=0,o=0;I<d?o=i=c+w*(n+.5)*I:(i=c+w*n*I+C,o=c+w*(n+1)*I-C),r.startAngle=i,r.endAngle=o}})}else m=M/k,T=c,t.each(r,function(e,n){if(!isNaN(e)){var r=t.getItemLayout(n),i=r.angle===f?f:e*m,o=0,s=0;i<d?s=o=T+w*i/2:(o=T+C,s=T+w*i-C),r.startAngle=o,r.endAngle=s,T+=w*i}})})}var vv=n(88297),vy=n(45400),vx=n(28535);function vb(e,t,n,r,i,o,s,a){var l=n-e,u=r-t,c=Math.sqrt(l*l+u*u),h=((i-e)*(l/=c)+(o-t)*(u/=c))/c;a&&(h=Math.min(Math.max(h,0),1)),h*=c;var d=s[0]=e+h*l,f=s[1]=t+h*u;return Math.sqrt((d-i)*(d-i)+(f-o)*(f-o))}vr.A.CMD;var vw=new vy.A,vS=new vy.A,vC=new vy.A,vA=new vy.A,vM=new vy.A,vk=[],vT=new vy.A;function vI(e,t,n,r){var i="normal"===n,o=i?e:e.ensureState(n);o.ignore=t;var s=r.get("smooth");s&&!0===s&&(s=.3),o.shape=o.shape||{},s>0&&(o.shape.smooth=s);var a=r.getModel("lineStyle").getLineStyle();i?e.useStyle(a):o.style=a}function vD(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=vx.xg(r[0],r[1]),o=vx.xg(r[1],r[2]);if(!i||!o){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var s=Math.min(i,o)*n,a=vx.Cc([],r[1],r[0],s/i),l=vx.Cc([],r[1],r[2],s/o),u=vx.Cc([],a,l,.5);e.bezierCurveTo(a[0],a[1],a[0],a[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c<r.length;c++)e.lineTo(r[c][0],r[c][1])}var vO=n(6417),vE=Math.PI/180;function v_(e,t,n,r,i,o,s,a,l,u){if(!(e.length<2)){for(var c=e.length,h=0;h<c;h++)if("outer"===e[h].position&&"labelLine"===e[h].labelAlignTo){var d=e[h].label.x-u;e[h].linePoints[1][0]+=d,e[h].label.x=u}(0,vO.Xe)(e,l,l+s)&&function(e){for(var o={list:[],maxY:0},s={list:[],maxY:0},a=0;a<e.length;a++)if("none"===e[a].labelAlignTo){var l=e[a],u=l.label.y>n?s:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var h=l.label.x-t-l.len2*i,d=r+l.len;u.rB=Math.abs(h)<d?Math.sqrt(c*c/(1-h*h/d/d)):d,u.maxY=c}u.list.push(l)}f(o),f(s)}(e)}function f(e){for(var o=e.rB,s=o*o,a=0;a<e.list.length;a++){var l=e.list[a],u=Math.abs(l.label.y-n),c=r+l.len,h=t+(Math.sqrt(c*c*(1-Math.abs(u*u/s)))+l.len2)*i,d=h-l.label.x,f=l.targetTextWidth-d*i;vR(l,f,!0),l.label.x=h}}}function vR(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var r=e.label,i=r.style,o=e.rect,s=i.backgroundColor,a=i.padding,l=a?a[1]+a[3]:0,u=i.overflow,c=o.width+(s?0:l);if(t<c||n){var h=o.height;if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",t-l);var d=r.getBoundingRect();r.setStyle("width",Math.ceil(d.width)),r.setStyle("backgroundColor",s)}else{var f=t-l,p=t<c?f:n?f>e.unconstrainedWidth?null:f:null;r.setStyle("width",p)}var g=r.getBoundingRect();o.width=g.width;var m=(r.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function vP(e){return"center"===e.position}var vL=function(e){function t(t,n,r){var i=e.call(this)||this;i.z2=2;var o=new m7.Ay;return i.setTextContent(o),i.updateData(t,n,r,!0),i}return(0,mg.C6)(t,e),t.prototype.updateData=function(e,t,n,r){var i=e.hostModel,o=e.getItemModel(t),s=o.getModel("emphasis"),a=e.getItemLayout(t),l=(0,md.X$)(mz(o.getModel("itemStyle"),a,!0),a);if(isNaN(l.startAngle))return void this.setShape(l);if(r){this.setShape(l);var u=i.getShallow("animationType");i.ecModel.ssr?(mA.LW(this,{scaleX:0,scaleY:0},i,{dataIndex:t,isFrom:!0}),this.originX=l.cx,this.originY=l.cy):"scale"===u?(this.shape.r=a.r0,mA.LW(this,{shape:{r:a.r}},i,t)):null!=n?(this.setShape({startAngle:n,endAngle:n}),mA.LW(this,{shape:{startAngle:a.startAngle,endAngle:a.endAngle}},i,t)):(this.shape.endAngle=a.startAngle,mA.oi(this,{shape:{endAngle:a.endAngle}},i,t))}else(0,mA.ap)(this),mA.oi(this,{shape:l},i,t);this.useStyle(e.getItemVisual(t,"style")),(0,mI.Mx)(this,o);var c=(a.startAngle+a.endAngle)/2,h=i.get("selectedOffset"),d=Math.cos(c)*h,f=Math.sin(c)*h,p=o.getShallow("cursor");p&&this.attr("cursor",p),this._updateLabel(i,e,t),this.ensureState("emphasis").shape=(0,md.X$)({r:a.r+(s.get("scale")&&s.get("scaleSize")||0)},mz(s.getModel("itemStyle"),a)),(0,md.X$)(this.ensureState("select"),{x:d,y:f,shape:mz(o.getModel(["select","itemStyle"]),a)}),(0,md.X$)(this.ensureState("blur"),{shape:mz(o.getModel(["blur","itemStyle"]),a)});var g=this.getTextGuideLine(),m=this.getTextContent();g&&(0,md.X$)(g.ensureState("select"),{x:d,y:f}),(0,md.X$)(m.ensureState("select"),{x:d,y:f}),(0,mI.Lm)(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},t.prototype._updateLabel=function(e,t,n){var r=t.getItemModel(n),i=r.getModel("labelLine"),o=t.getItemVisual(n,"style"),s=o&&o.fill,a=o&&o.opacity;(0,mD.qM)(this,(0,mD.lx)(r),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:a,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var l=this.getTextContent();this.setTextConfig({position:null,rotation:null}),l.attr({z2:10});var u=e.get(["label","position"]);if("outside"!==u&&"outer"!==u)this.removeTextGuideLine();else{var c=this.getTextGuideLine();c||(c=new vv.A,this.setTextGuideLine(c)),function(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(!i){r&&e.removeTextGuideLine();return}for(var o=t.normal,s=o.get("show"),a=i.ignore,l=0;l<mI.wV.length;l++){var u=mI.wV[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?a:(0,md.bZ)(i.states[u]&&i.states[u].ignore,a))||!(0,md.bZ)(d,s)){var f=h?r:r&&r.states[u];f&&(f.ignore=!0),r&&vI(r,!0,u,c);continue}!r&&(r=new vv.A,e.setTextGuideLine(r),h||!a&&s||vI(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),vI(r,!1,u,c)}}if(r){(0,md.NT)(r.style,n),r.style.fill=null;var p=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=p||!1,r.buildPath=vD}}(this,function(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<mI.BV.length;r++){var i=mI.BV[r];n[i]=e.getModel([i,t])}return n}(r),{stroke:s,opacity:(0,md.WV)(i.get(["lineStyle","opacity"]),a,1)})}},t}(mk.A),vN=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n,r){var i,o=e.getData(),s=this._data,a=this.group;if(!s&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(i=l.startAngle)}if(this._emptyCircleSector&&a.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=new mk.A({shape:vg(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,a.add(c)}o.diff(s).add(function(e){var t=new vL(o,e,i);o.setItemGraphicEl(e,t),a.add(t)}).update(function(e,t){var n=s.getItemGraphicEl(t);n.updateData(o,e,i),n.off("click"),a.add(n),o.setItemGraphicEl(e,n)}).remove(function(t){var n=s.getItemGraphicEl(t);mA.t5(n,e,t)}).execute(),function(e){var t,n,r=e.getData(),i=[],o=!1,s=(e.get("minShowLabelAngle")||0)*vE,a=r.getLayout("viewRect"),l=r.getLayout("r"),u=a.width,c=a.x,h=a.y,d=a.height;function f(e){e.ignore=!0}r.each(function(e){var a,h,d,p,g=r.getItemGraphicEl(e),m=g.shape,v=g.getTextContent(),y=g.getTextGuideLine(),x=r.getItemModel(e),b=x.getModel("label"),w=b.get("position")||x.get(["emphasis","label","position"]),S=b.get("distanceToLabelLine"),C=b.get("alignTo"),A=(0,ve.lo)(b.get("edgeDistance"),u),M=b.get("bleedMargin"),k=x.getModel("labelLine"),T=k.get("length");T=(0,ve.lo)(T,u);var I=k.get("length2");if(I=(0,ve.lo)(I,u),Math.abs(m.endAngle-m.startAngle)<s){(0,md.__)(v.states,f),v.ignore=!0,y&&((0,md.__)(y.states,f),y.ignore=!0);return}if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(v)){var D=(m.startAngle+m.endAngle)/2,O=Math.cos(D),E=Math.sin(D);t=m.cx,n=m.cy;var _="inside"===w||"inner"===w;if("center"===w)a=m.cx,h=m.cy,p="center";else{var R=(_?(m.r+m.r0)/2*O:m.r*O)+t,P=(_?(m.r+m.r0)/2*E:m.r*E)+n;if(a=R+3*O,h=P+3*E,!_){var L=R+O*(T+l-m.r),N=P+E*(T+l-m.r),B=L+(O<0?-1:1)*I;a="edge"===C?O<0?c+A:c+u-A:B+(O<0?-S:S),h=N,d=[[R,P],[L,N],[B,N]]}p=_?"center":"edge"===C?O>0?"right":"left":O>0?"left":"right"}var F=Math.PI,j=0,z=b.get("rotate");if((0,md.Et)(z))j=F/180*z;else if("center"===w)j=0;else if("radial"===z||!0===z)j=O<0?-D+F:-D;else if("tangential"===z&&"outside"!==w&&"outer"!==w){var V=Math.atan2(O,E);V<0&&(V=2*F+V),E>0&&(V=F+V),j=V-F}if(o=!!j,v.x=a,v.y=h,v.rotation=j,v.setStyle({verticalAlign:"middle"}),_){v.setStyle({align:p});var H=v.states.select;H&&(H.x+=v.x,H.y+=v.y)}else{var $=v.getBoundingRect().clone();$.applyTransform(v.getComputedTransform());var W=(v.style.margin||0)+2.1;$.y-=W/2,$.height+=W,i.push({label:v,labelLine:y,position:w,len:T,len2:I,minTurnAngle:k.get("minTurnAngle"),maxSurfaceAngle:k.get("maxSurfaceAngle"),surfaceNormal:new vy.A(O,E),linePoints:d,textAlign:p,labelDistance:S,labelAlignTo:C,edgeDistance:A,bleedMargin:M,rect:$,unconstrainedWidth:$.width,labelStyleWidth:v.style.width})}g.setTextConfig({inside:_})}}),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,r,i,o,s,a){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<e.length;d++){var f=e[d].label;vP(e[d])||(f.x<t?(c=Math.min(c,f.x),l.push(e[d])):(h=Math.max(h,f.x),u.push(e[d])))}for(var d=0;d<e.length;d++){var p=e[d];if(!vP(p)&&p.linePoints){if(null!=p.labelStyleWidth)continue;var f=p.label,g=p.linePoints,m=void 0;m="edge"===p.labelAlignTo?f.x<t?g[2][0]-p.labelDistance-s-p.edgeDistance:s+i-p.edgeDistance-g[2][0]-p.labelDistance:"labelLine"===p.labelAlignTo?f.x<t?c-s-p.bleedMargin:s+i-h-p.bleedMargin:f.x<t?f.x-s-p.bleedMargin:s+i-f.x-p.bleedMargin,p.targetTextWidth=m,vR(p,m)}}v_(u,t,n,r,1,i,o,s,a,h),v_(l,t,n,r,-1,i,o,s,a,c);for(var d=0;d<e.length;d++){var p=e[d];if(!vP(p)&&p.linePoints){var f=p.label,g=p.linePoints,v="edge"===p.labelAlignTo,y=f.style.padding,x=y?y[1]+y[3]:0,b=f.style.backgroundColor?0:x,w=p.rect.width+b,S=g[1][0]-g[2][0];v?f.x<t?g[2][0]=s+p.edgeDistance+w+p.labelDistance:g[2][0]=s+i-p.edgeDistance-w-p.labelDistance:(f.x<t?g[2][0]=f.x+p.labelDistance:g[2][0]=f.x-p.labelDistance,g[1][0]=g[2][0]+S),g[1][1]=g[2][1]=f.y}}}(i,t,n,l,u,d,c,h);for(var p=0;p<i.length;p++){var g=i[p],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&((0,md.__)(m.states,f),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(v){var b=g.linePoints;y||!b?((0,md.__)(v.states,f),v.ignore=!0):(!function(e,t){if(t<=180&&t>0){t=t/180*Math.PI,vw.fromArray(e[0]),vS.fromArray(e[1]),vC.fromArray(e[2]),vy.A.sub(vA,vw,vS),vy.A.sub(vM,vC,vS);var n=vA.len(),r=vM.len();if(!(n<.001)&&!(r<.001)&&(vA.scale(1/n),vM.scale(1/r),Math.cos(t)<vA.dot(vM))){var i=vb(vS.x,vS.y,vC.x,vC.y,vw.x,vw.y,vk,!1);vT.fromArray(vk),vT.scaleAndAdd(vM,i/Math.tan(Math.PI-t));var o=vC.x!==vS.x?(vT.x-vS.x)/(vC.x-vS.x):(vT.y-vS.y)/(vC.y-vS.y);if(isNaN(o))return;o<0?vy.A.copy(vT,vS):o>1&&vy.A.copy(vT,vC),vT.toArray(e[1])}}}(b,g.minTurnAngle),function(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,vw.fromArray(e[0]),vS.fromArray(e[1]),vC.fromArray(e[2]),vy.A.sub(vA,vS,vw),vy.A.sub(vM,vC,vS);var r=vA.len(),i=vM.len();if(!(r<.001)&&!(i<.001)&&(vA.scale(1/r),vM.scale(1/i),vA.dot(t)<Math.cos(n))){var o=vb(vS.x,vS.y,vC.x,vC.y,vw.x,vw.y,vk,!1);vT.fromArray(vk);var s=Math.PI/2,a=s+Math.acos(vM.dot(t))-n;if(a>=s)vy.A.copy(vT,vC);else{vT.scaleAndAdd(vM,o/Math.tan(Math.PI/2-a));var l=vC.x!==vS.x?(vT.x-vS.x)/(vC.x-vS.x):(vT.y-vS.y)/(vC.y-vS.y);if(isNaN(l))return;l<0?vy.A.copy(vT,vS):l>1&&vy.A.copy(vT,vC)}vT.toArray(e[1])}}}(b,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:b}),m.__hostTarget.textGuideLineConfig={anchor:new vy.A(b[0][0],b[0][1])})}}}(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},t.type="pie",t}(mP.A),vB=n(84124),vF=n(88569),vj=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),vz=vB.$r(),vV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new vj(md.oI(this.getData,this),md.oI(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return vl(this,{coordDimensions:["value"],encodeDefaulter:md.cF(vF.ln,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=vz(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),function(e){o.push(e)}),i=r.seats=(0,ve.kM)(o,n.hostModel.get("percentPrecision"))}var s=e.prototype.getDataParams.call(this,t);return s.percent=i[t]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(e){vB.M5(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(mm.A),vH=n(74653),v$=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return(0,mg.C6)(t,e),t.prototype.getInitialData=function(e,t){return(0,mv.A)(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(mm.A),vW=n(22448),vG=n(51690),vU=function(){},vq=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return(0,mg.C6)(t,e),t.prototype.getDefaultShape=function(){return new vU},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,r=t.points,i=t.size,o=this.symbolProxy,s=o.shape,a=e.getContext?e.getContext():e,l=a&&i[0]<4,u=this.softClipShape;if(l){this._ctx=a;return}for(this._ctx=null,n=this._off;n<r.length;){var c=r[n++],h=r[n++];!(isNaN(c)||isNaN(h))&&(!u||u.contain(c,h))&&(s.x=c-i[0]/2,s.y=h-i[1]/2,s.width=i[0],s.height=i[1],o.buildPath(e,s,!0))}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.afterBrush=function(){var e,t=this.shape,n=t.points,r=t.size,i=this._ctx,o=this.softClipShape;if(i){for(e=this._off;e<n.length;){var s=n[e++],a=n[e++];!(isNaN(s)||isNaN(a))&&(!o||o.contain(s,a))&&i.fillRect(s-r[0]/2,a-r[1]/2,r[0],r[1])}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,o=Math.max(i[0],4),s=Math.max(i[1],4),a=r.length/2-1;a>=0;a--){var l=2*a,u=r[l]-o/2,c=r[l+1]-s/2;if(e>=u&&t>=c&&e<=u+o&&t<=c+s)return a}return -1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return(e=n[0],t=n[1],r.contain(e,t))?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],o=r[1],s=1/0,a=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var h=n[c++],d=n[c++];s=Math.min(h,s),l=Math.max(h,l),a=Math.min(d,a),u=Math.max(d,u)}e=this._rect=new vG.A(s-i/2,a-o/2,l-s+i,u-a+o)}return e},t}(mw.Ay),vY=function(){function e(){this.group=new mS.A}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild(function(e){if(null!=e.startIndex){var n=(e.endIndex-e.startIndex)*2,r=4*e.startIndex*2;t=new Float32Array(t.buffer,r,n)}e.setShape("points",t),e.reset()})},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var r=this._newAdded[0],i=t.getLayout("points"),o=r&&r.shape.points;if(o&&o.length<2e4){var s=o.length,a=new Float32Array(s+i.length);a.set(o),a.set(i,s),r.endIndex=e.end,r.setShape({points:a})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:i}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new vq({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n=n||{};var i=t.getVisual("symbolSize");e.setShape("size",i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=(0,vt.v5)(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("style"),a=s&&s.fill;a&&e.setColor(a);var l=(0,mT.z)(e);l.seriesIndex=r.seriesIndex,e.on("mousemove",function(t){l.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(l.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),vZ=n(97548),vK=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=(0,vZ.A)("").reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new vY:new vW.A,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(mP.A),vX=n(61413),vJ={color:"fill",borderColor:"stroke"},vQ={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},v0=(0,vB.$r)(),v1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return(0,mv.A)(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=v0(r).info),i},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(mm.A),v2=n(31393);function v5(e,t){return t=t||[0,0],md.Tj(["x","y"],function(n,r){var i=this.getAxis(n),o=t[r],s=e[r]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-s)-i.dataToCoord(o+s))},this)}function v3(e,t){return t=t||[0,0],md.Tj([0,1],function(n){var r=t[n],i=e[n]/2,o=[],s=[];return o[n]=r-i,s[n]=r+i,o[1-n]=s[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(s)[n])},this)}function v4(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function v6(e,t){return t=t||[0,0],md.Tj(["Radius","Angle"],function(n,r){var i=this["get"+n+"Axis"](),o=t[r],s=e[r]/2,a="category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(o-s)-i.dataToCoord(o+s));return"Angle"===n&&(a=a*Math.PI/180),a},this)}var v8=n(38513);function v9(e,t){t&&(t.font=t.textFont||t.font,(0,md.$3)(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),(0,md.$3)(t,"textAlign")&&(e.align=t.textAlign),(0,md.$3)(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),(0,md.$3)(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),(0,md.$3)(t,"textWidth")&&(e.width=t.textWidth),(0,md.$3)(t,"textHeight")&&(e.height=t.textHeight),(0,md.$3)(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),(0,md.$3)(t,"textPadding")&&(e.padding=t.textPadding),(0,md.$3)(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),(0,md.$3)(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),(0,md.$3)(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),(0,md.$3)(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),(0,md.$3)(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),(0,md.$3)(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),(0,md.$3)(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function v7(e,t,n){e.textPosition=e.textPosition||n.position||"inside",null!=n.offset&&(e.textOffset=n.offset),null!=n.rotation&&(e.textRotation=n.rotation),null!=n.distance&&(e.textDistance=n.distance);var r=e.textPosition.indexOf("inside")>=0,i=e.fill||"#000";ye(e,t);var o=null==e.textFill;return r?o&&(e.textFill=n.insideFill||"#fff",!e.textStroke&&n.insideStroke&&(e.textStroke=n.insideStroke),e.textStroke||(e.textStroke=i),null==e.textStrokeWidth&&(e.textStrokeWidth=2)):(o&&(e.textFill=e.fill||n.outsideFill||"#000"),!e.textStroke&&n.outsideStroke&&(e.textStroke=n.outsideStroke)),e.text=t.text,e.rich=t.rich,(0,md.__)(t.rich,function(e){ye(e,e)}),e}function ye(e,t){t&&((0,md.$3)(t,"fill")&&(e.textFill=t.fill),(0,md.$3)(t,"stroke")&&(e.textStroke=t.fill),(0,md.$3)(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),(0,md.$3)(t,"font")&&(e.font=t.font),(0,md.$3)(t,"fontStyle")&&(e.fontStyle=t.fontStyle),(0,md.$3)(t,"fontWeight")&&(e.fontWeight=t.fontWeight),(0,md.$3)(t,"fontSize")&&(e.fontSize=t.fontSize),(0,md.$3)(t,"fontFamily")&&(e.fontFamily=t.fontFamily),(0,md.$3)(t,"align")&&(e.textAlign=t.align),(0,md.$3)(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),(0,md.$3)(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),(0,md.$3)(t,"width")&&(e.textWidth=t.width),(0,md.$3)(t,"height")&&(e.textHeight=t.height),(0,md.$3)(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),(0,md.$3)(t,"padding")&&(e.textPadding=t.padding),(0,md.$3)(t,"borderColor")&&(e.textBorderColor=t.borderColor),(0,md.$3)(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),(0,md.$3)(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),(0,md.$3)(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),(0,md.$3)(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),(0,md.$3)(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),(0,md.$3)(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),(0,md.$3)(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),(0,md.$3)(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),(0,md.$3)(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),(0,md.$3)(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var yt=n(58391),yn=n(34780),yr=n(83742),yi=n(5486),yo={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},ys=(0,md.HP)(yo);(0,md.TS)(yi.Wx,function(e,t){return e[t]=1,e},{}),yi.Wx.join(", ");var ya=["","style","shape","extra"],yl=(0,vB.$r)();function yu(e,t,n,r,i){var o=e+"Animation",s=(0,mA.Jw)(e,r,i)||{},a=yl(t).userDuring;return s.duration>0&&(s.during=a?(0,md.oI)(yp,{el:t,userDuring:a}):null,s.setToFinal=!0,s.scope=e),(0,md.X$)(s,n[o]),s}function yc(e,t,n,r){if(e){var i=e.parent,o=yl(e).leaveToProps;if(o){var s=yu("update",e,t,n,0);s.done=function(){i.remove(e),r&&r()},e.animateTo(o,s)}else i.remove(e),r&&r()}}function yh(e){return"all"===e}var yd={},yf={setTransform:function(e,t){return yd.el[e]=t,this},getTransform:function(e){return yd.el[e]},setShape:function(e,t){var n=yd.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=yd.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=yd.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=yd.el.style;if(t)return t[e]},setExtra:function(e,t){return(yd.el.extra||(yd.el.extra={}))[e]=t,this},getExtra:function(e){var t=yd.el.extra;if(t)return t[e]}};function yp(){var e=this.el;if(e){var t=yl(e).userDuring,n=this.userDuring;if(t!==n){this.el=this.userDuring=null;return}yd.el=e,n(yf)}}function yg(e,t,n,r){var i,o=n[e];if(o){var s=t[e];if(s){var a=n.transition,l=o.transition;if(l)if(i||(i=r[e]={}),yh(l))(0,md.X$)(i,s);else for(var u=(0,vB.qB)(l),c=0;c<u.length;c++){var h=u[c],d=s[h];i[h]=d}else if(yh(a)||(0,md.qh)(a,e)>=0){i||(i=r[e]={});for(var f=(0,md.HP)(s),c=0;c<f.length;c++){var p,g,h=f[c],d=s[h];p=o[h],g=d,((0,md.Xj)(p)?p!==g:null!=p&&isFinite(p))&&(i[h]=d)}}}}}function ym(e,t,n){var r=t[e];if(r)for(var i=n[e]={},o=(0,md.HP)(r),s=0;s<o.length;s++){var a=o[s];i[a]=(0,yr.F)(r[a])}}var yv=(0,vB.$r)(),yy=["percent","easing","shape","style","extra"],yx="emphasis",yb="normal",yw="blur",yS="select",yC=[yb,yx,yw,yS],yA={normal:["itemStyle"],emphasis:[yx,"itemStyle"],blur:[yw,"itemStyle"],select:[yS,"itemStyle"]},yM={normal:["label"],emphasis:[yx,"label"],blur:[yw,"label"],select:[yS,"label"]},yk=["x","y"],yT={normal:{},emphasis:{},blur:{},select:{}},yI={cartesian2d:function(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:md.oI(v5,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:md.oI(v3,e)}}},single:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:(0,md.oI)(v4,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),o=n.dataToAngle(r[1]),s=e.coordToPoint([i,o]);return s.push(i,o*Math.PI/180),s},size:md.oI(v6,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function yD(e){return e instanceof mw.Ay}function yO(e){return e instanceof v8.Ay}var yE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n,r){this._progressiveEls=null;var i=this._data,o=e.getData(),s=this.group,a=yL(e,o,t,n);i||s.removeAll(),o.diff(i).add(function(t){yN(n,null,t,a(t,r),e,s,o)}).remove(function(t){var n=i.getItemGraphicEl(t);n&&yc(n,v0(n).option,e)}).update(function(t,l){yN(n,i.getItemGraphicEl(l),t,a(t,r),e,s,o)}).execute();var l=e.get("clip",!0)?(0,mE.Ip)(e.coordinateSystem,!1,e):null;l?s.setClipPath(l):s.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,r,i){var o=t.getData(),s=yL(t,o,n,r),a=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=yN(null,null,u,s(u,i),t,this.group,o);c&&(c.traverse(l),a.push(c))}},t.prototype.eachRendered=function(e){mC.traverseElements(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,r){var i=t.element;if(null==i||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},t.type="custom",t}(mP.A);function y_(e){var t,n=e.type;if("path"===n){var r=e.shape,i=null!=r.width&&null!=r.height?{x:r.x||0,y:r.y||0,width:r.width,height:r.height}:null,o=yG(r);v0(t=mC.makePath(o,null,i,r.layout||"center")).customPathData=o}else if("image"===n)v0(t=new vn.Ay({})).customImagePath=e.style.image;else if("text"===n)t=new m7.Ay({});else if("group"===n)t=new mS.A;else if("compoundPath"===n)throw Error('"compoundPath" is not supported yet.');else{var s=mC.getShapeClass(n);s||(0,yt.$8)(""),t=new s}return v0(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function yR(e,t,n,r,i,o,s){t.stopAnimation("keyframe"),t.attr(yv(t));var a=i&&i.normal.cfg;a&&t.setTextConfig(a),r&&null==r.transition&&(r.transition=yk);var l=r&&r.style;if(l){"text"===t.type&&((0,md.$3)(l,"textFill")&&(l.fill=l.textFill),(0,md.$3)(l,"textStroke")&&(l.stroke=l.textStroke));var u=void 0,c=yD(t)?l.decal:null;e&&c&&(c.dirty=!0,u=(0,yn.w)(c,e)),l.__decalPattern=u}if(yO(t)&&l){var u=l.__decalPattern;u&&(l.decal=u)}!function(e,t,n,r){var i,o,s=(r=r||{}).dataIndex,a=r.isInit,l=r.clearStyle,u=n.isAnimationEnabled(),c=yl(e),h=t.style;c.userDuring=t.during;var d={},f={};if(function(e,t){for(var n=0;n<ys.length;n++){var r=ys[n],i=yo[r],o=e[r];o&&(t[i[0]]=o[0],t[i[1]]=o[1])}for(var n=0;n<yi.Wx.length;n++){var s=yi.Wx[n];null!=e[s]&&(t[s]=e[s])}}(t,f),ym("shape",t,f),ym("extra",t,f),!a&&u&&(function(e,t,n){for(var r=t.transition,i=yh(r)?yi.Wx:(0,vB.qB)(r||[]),o=0;o<i.length;o++){var s=i[o];if("style"!==s&&"shape"!==s&&"extra"!==s){var a=e[s];n[s]=a}}}(e,t,d),yg("shape",e,t,d),yg("extra",e,t,d),function(e,t,n,r){if(n){var i,o=e.style;if(o){var s=n.transition,a=t.transition;if(s&&!yh(s)){var l=(0,vB.qB)(s);i||(i=r.style={});for(var u=0;u<l.length;u++){var c=l[u],h=o[c];i[c]=h}}else if(e.getAnimationStyleProps&&(yh(a)||yh(s)||(0,md.qh)(a,"style")>=0)){var d=e.getAnimationStyleProps(),f=d?d.style:null;if(f){i||(i=r.style={});for(var p=(0,md.HP)(n),u=0;u<p.length;u++){var c=p[u];if(f[c]){var h=o[c];i[c]=h}}}}}}}(e,t,h,d)),f.style=h,function(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,o=0;o<i.length;o++){var s=i[o];"style"===s.targetName&&s.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}(e,f,l),i=e,o=t,(0,md.$3)(o,"silent")&&(i.silent=o.silent),(0,md.$3)(o,"ignore")&&(i.ignore=o.ignore),i instanceof v8.Ay&&(0,md.$3)(o,"invisible")&&(i.invisible=o.invisible),i instanceof mw.Ay&&(0,md.$3)(o,"autoBatch")&&(i.autoBatch=o.autoBatch),u)if(a){var p={};(0,md.__)(ya,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(p[e]=p[e]||{}),(0,md.X$)(e?p[e]:p,n.enterFrom))});var g=yu("enter",e,t,n,s);g.duration>0&&e.animateFrom(p,g)}else{var m=e,v=t,y=s||0,x=n,b=d;if(b){var w=yu("update",m,v,x,y);w.duration>0&&m.animateFrom(b,w)}}(function(e,t){for(var n=yl(e).leaveToProps,r=0;r<ya.length;r++){var i=ya[r],o=i?t[i]:t;o&&o.leaveTo&&(n||(n=yl(e).leaveToProps={}),i&&(n[i]=n[i]||{}),(0,md.X$)(i?n[i]:n,o.leaveTo))}})(e,t),h?e.dirty():e.markRedraw()}(t,r,o,{dataIndex:n,isInit:s,clearStyle:!0}),function e(t,n,r){if(r.isAnimationEnabled()&&n){if((0,md.cy)(n))return void(0,md.__)(n,function(n){e(t,n,r)});var i=n.keyframes,o=n.duration;if(r&&null==o){var s=(0,mA.Jw)("enter",r,0);o=s&&s.duration}if(i&&o){var a=yv(t);(0,md.__)(ya,function(e){var r;e&&!t[e]||(i.sort(function(e,t){return e.percent-t.percent}),(0,md.__)(i,function(i){var s=t.animators,l=e?i[e]:i;if(l){var u=(0,md.HP)(l);if(e||(u=(0,md.pb)(u,function(e){return 0>(0,md.qh)(yy,e)})),u.length){r||((r=t.animate(e,n.loop,!0)).scope="keyframe");for(var c=0;c<s.length;c++)s[c]!==r&&s[c].targetName===r.targetName&&s[c].stopTracks(u);e&&(a[e]=a[e]||{});var h=e?a[e]:a;(0,md.__)(u,function(n){h[n]=((e?t[e]:t)||{})[n]}),r.whenWithKeys(o*i.percent,l,u,i.easing)}}}),r&&r.delay(n.delay||0).duration(o).start(n.easing))})}}}(t,r.keyframeAnimation,o)}function yP(e,t,n,r,i){var o=t.isGroup?null:t,s=i&&i[e].cfg;if(o){var a=o.ensureState(e);if(!1===r){var l=o.getState(e);l&&(l.style=null)}else a.style=r||null;s&&(a.textConfig=s),(0,mI.DW)(o)}}function yL(e,t,n,r){var i,o,s,a,l=e.get("renderItem"),u=e.coordinateSystem,c={};u&&(c=u.prepareCustoms?u.prepareCustoms(u):yI[u.type](u));for(var h=(0,md.NT)({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:function(e,n){return null==n&&(n=s),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,r){null==r&&(r=s);var i=t.getItemVisual(r,"style"),o=i&&i.fill,a=i&&i.opacity,l=b(r,yb).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:(0,md.Kg)(o)?o:"#000"},c=w(r,yb),h=mD.VB(c,null,u,!1,!0);h.text=c.getShallow("show")?(0,md.bZ)(e.getFormattedLabel(r,yb),(0,mN.i)(t,r)):null;var d=mD.sD(c,u,!1);return C(n,l),l=v7(l,h,d),n&&S(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=s),e=e||0;var r=t.getDimensionInfo(e);if(!r){var i=t.getDimensionIndex(e);return i>=0?t.getStore().get(i,n):void 0}var o=t.get(r.name,n),a=r&&r.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,r){null==r&&(r=s);var i=b(r,yx).getItemStyle(),o=w(r,yx),a=mD.VB(o,null,null,!0,!0);a.text=o.getShallow("show")?(0,md.WV)(e.getFormattedLabel(r,yx),e.getFormattedLabel(r,yb),(0,mN.i)(t,r)):null;var l=mD.sD(o,null,!0);return C(n,i),i=v7(i,a,l),n&&S(i,n),i.legacy=!0,i},visual:function(e,n){if(null==n&&(n=s),(0,md.$3)(vJ,e)){var r=t.getItemVisual(n,"style");return r?r[vJ[e]]:null}if((0,md.$3)(vQ,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===u.type){var t=u.getBaseAxis();return(0,mf.DL)((0,md.NT)({axis:t},e))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return mD.c8(e,n)}},c.api||{}),d={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:c.coordSys,dataInsideLength:t.count(),encode:(i=e.getData(),o={},(0,md.__)(i.dimensions,function(e){var t=i.getDimensionInfo(e);if(!t.isExtraCoord){var n=t.coordDim;(o[n]=o[n]||[])[t.coordDimIndex]=i.getDimensionIndex(e)}}),o)},f={},p={},g={},m={},v=0;v<yC.length;v++){var y=yC[v];g[y]=e.getModel(yA[y]),m[y]=e.getModel(yM[y])}function x(e){return e===s?a||(a=t.getItemModel(e)):t.getItemModel(e)}function b(e,n){return t.hasItemOption?e===s?f[n]||(f[n]=x(e).getModel(yA[n])):x(e).getModel(yA[n]):g[n]}function w(e,n){return t.hasItemOption?e===s?p[n]||(p[n]=x(e).getModel(yM[n])):x(e).getModel(yM[n]):m[n]}return function(e,n){return s=e,a=null,f={},p={},l&&l((0,md.NT)({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},d),h)};function S(e,t){for(var n in t)(0,md.$3)(t,n)&&(e[n]=t[n])}function C(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function yN(e,t,n,r,i,o,s){if(!r)return void o.remove(t);var a=yB(e,t,n,r,i,o);return a&&s.setItemGraphicEl(n,a),a&&(0,mI.Lm)(a,r.focus,r.blurScope,r.emphasisDisabled),a}function yB(e,t,n,r,i,o){var s,a=-1,l=t;t&&yF(t,r,i)&&(a=(0,md.qh)(o.childrenRef(),t),t=null);var u=!t,c=t;c?c.clearStates():(c=y_(r),l&&((s=c).copyTransform(l),yO(s)&&yO(l)&&(s.setStyle(l.style),s.z=l.z,s.z2=l.z2,s.zlevel=l.zlevel,s.invisible=l.invisible,s.ignore=l.ignore,yD(s)&&yD(l)&&s.setShape(l.shape)))),!1===r.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),yT.normal.cfg=yT.normal.conOpt=yT.emphasis.cfg=yT.emphasis.conOpt=yT.blur.cfg=yT.blur.conOpt=yT.select.cfg=yT.select.conOpt=null,yT.isLegacy=!1,function(e,t,n,r,i,o){if(!e.isGroup){yj(n,null,o),yj(n,yx,o);var s=o.normal.conOpt,a=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=s||null!=a||null!=u||null!=l){var c=e.getTextContent();if(!1===s)c&&e.removeTextContent();else{s=o.normal.conOpt=s||{type:"text"},c?c.clearStates():(c=y_(s),e.setTextContent(c)),yR(null,c,t,s,null,r,i);for(var h=s&&s.style,d=0;d<yC.length;d++){var f=yC[d];if(f!==yb){var p=o[f].conOpt;yP(f,c,p,yV(s,p,f),null)}}h?c.dirty():c.markRedraw()}}}}(c,n,r,i,u,yT),function(e,t,n,r,i){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var s=e.getClipPath();s&&yF(s,o,r)&&(s=null),s||(s=y_(o),e.setClipPath(s)),yR(null,s,t,o,null,r,i)}}(c,n,r,i,u),yR(e,c,n,r,yT,i,u),(0,md.$3)(r,"info")&&(v0(c).info=r.info);for(var h=0;h<yC.length;h++){var d=yC[h];if(d!==yb){var f=yz(r,d),p=yV(r,f,d);yP(d,c,f,p,yT)}}var g=c;if(!g.isGroup){var m=i.currentZ,v=i.currentZLevel;g.z=m,g.zlevel=v;var y=r.z2;null!=y&&(g.z2=y||0);for(var x=0;x<yC.length;x++)!function(e,t,n){var r=n===yb,i=r?t:yz(t,n),o=i?i.z2:null;null!=o&&((r?e:e.ensureState(n)).z2=o||0)}(g,r,yC[x])}return"group"===r.type&&function(e,t,n,r,i){var o=r.children,s=o?o.length:0,a=r.$mergeChildren,l="byName"===a||r.diffChildrenByName,u=!1===a;if(s||l||u){if(l){return p={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:i,group:t},new v2.A(p.oldChildren,p.newChildren,yH,yH,p).add(y$).update(y$).remove(yW).execute()}u&&t.removeAll();for(var c=0;c<s;c++){var h=o[c],d=t.childAt(c);h?(null==h.ignore&&(h.ignore=!1),yB(e,d,n,h,i,t)):d.ignore=!0}for(var f=t.childCount()-1;f>=c;f--){var p,g,m,v,y=t.childAt(f);g=t,m=y,v=i,m&&yc(m,v0(g).option,v)}}}(e,c,n,r,i),a>=0?o.replaceAt(c,a):o.add(c),c}function yF(e,t,n){var r,i=v0(e),o=t.type,s=t.shape,a=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==i.customGraphicType||"path"===o&&(r=s)&&((0,md.$3)(r,"pathData")||(0,md.$3)(r,"d"))&&yG(s)!==i.customPathData||"image"===o&&(0,md.$3)(a,"image")&&a.image!==i.customImagePath}function yj(e,t,n){var r,i,o=t?yz(e,t):e,s=t?yV(e,o,yx):e.style,a=e.type,l=o?o.textConfig:null,u=e.textContent,c=u?t?yz(u,t):u:null;if(s&&(n.isLegacy||(r=!!l,i=!!c,s&&(s.legacy||!1!==s.legacy&&!r&&!i&&"tspan"!==a&&("text"===a||(0,md.$3)(s,"text")))))){n.isLegacy=!0;var h=function(e,t,n){var r,i,o;if("text"===t)o=e;else{o={},(0,md.$3)(e,"text")&&(o.text=e.text),(0,md.$3)(e,"rich")&&(o.rich=e.rich),(0,md.$3)(e,"textFill")&&(o.fill=e.textFill),(0,md.$3)(e,"textStroke")&&(o.stroke=e.textStroke),(0,md.$3)(e,"fontFamily")&&(o.fontFamily=e.fontFamily),(0,md.$3)(e,"fontSize")&&(o.fontSize=e.fontSize),(0,md.$3)(e,"fontStyle")&&(o.fontStyle=e.fontStyle),(0,md.$3)(e,"fontWeight")&&(o.fontWeight=e.fontWeight),i={type:"text",style:o,silent:!0},r={};var s=(0,md.$3)(e,"textPosition");n?r.position=s?e.textPosition:"inside":s&&(r.position=e.textPosition),(0,md.$3)(e,"textPosition")&&(r.position=e.textPosition),(0,md.$3)(e,"textOffset")&&(r.offset=e.textOffset),(0,md.$3)(e,"textRotation")&&(r.rotation=e.textRotation),(0,md.$3)(e,"textDistance")&&(r.distance=e.textDistance)}return v9(o,e),(0,md.__)(o.rich,function(e){v9(e,e)}),{textConfig:r,textContent:i}}(s,a,!t);!l&&h.textConfig&&(l=h.textConfig),!c&&h.textContent&&(c=h.textContent)}if(!t&&c){var d=c;d.type||(d.type="text")}var f=t?n[t]:n.normal;f.cfg=l,f.conOpt=c}function yz(e,t){return t?e?e[t]:null:e}function yV(e,t,n){var r=t&&t.style;return null==r&&n===yx&&e&&(r=e.styleEmphasis),r}function yH(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function y$(e,t){var n=this.context,r=null!=e?n.newChildren[e]:null,i=null!=t?n.oldChildren[t]:null;yB(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function yW(e){var t=this.context,n=t.oldChildren[e];n&&yc(n,v0(n).option,t.seriesModel)}function yG(e){return e&&(e.pathData||e.d)}var yU=n(46979),yq=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=yU.yh.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,o){var s=this._getBrush(),a=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=e.length;c.width=t,c.height=n;for(var f=0;f<d;++f){var p=e[f],g=p[0],m=p[1],v=r(p[2]);h.globalAlpha=v,h.drawImage(s,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),x=y.data,b=0,w=x.length,S=this.minOpacity,C=this.maxOpacity-S;b<w;){var v=x[b+3]/256,A=4*Math.floor(255*v);if(v>0){var M=o(v)?a:l;v>0&&(v=v*C+S),x[b++]=M[A],x[b++]=M[A+1],x[b++]=M[A+2],x[b++]=M[A+3]*v*256}else b+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=yU.yh.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var r=e.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor="#000",r.beginPath(),r.arc(-t,t,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},e}();function yY(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var yZ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n){t.eachComponent("visualMap",function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var r,i=e.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):yY(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(yY(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){mC.traverseElements(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var o,s,a,l,u=e.coordinateSystem,c=(0,mL.g)(u,"cartesian2d");if(c){var h=u.getAxis("x"),d=u.getAxis("y");o=h.getBandWidth()+.5,s=d.getBandWidth()+.5,a=h.scale.getExtent(),l=d.scale.getExtent()}for(var f=this.group,p=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),x=(0,mD.lx)(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),C=b.get("disabled"),A=c?[p.mapDimension("x"),p.mapDimension("y"),p.mapDimension("value")]:[p.mapDimension("time"),p.mapDimension("value")],M=n;M<r;M++){var k=void 0,T=p.getItemVisual(M,"style");if(c){var I=p.get(A[0],M),D=p.get(A[1],M);if(isNaN(p.get(A[2],M))||isNaN(I)||isNaN(D)||I<a[0]||I>a[1]||D<l[0]||D>l[1])continue;var O=u.dataToPoint([I,D]);k=new mM.A({shape:{x:O[0]-o/2,y:O[1]-s/2,width:o,height:s},style:T})}else{if(isNaN(p.get(A[1],M)))continue;k=new mM.A({z2:1,shape:u.dataToRect([p.get(A[0],M)]).contentShape,style:T})}if(p.hasItemOption){var E=p.getItemModel(M),_=E.getModel("emphasis");g=_.getModel("itemStyle").getItemStyle(),m=E.getModel(["blur","itemStyle"]).getItemStyle(),v=E.getModel(["select","itemStyle"]).getItemStyle(),y=E.get(["itemStyle","borderRadius"]),w=_.get("focus"),S=_.get("blurScope"),C=_.get("disabled"),x=(0,mD.lx)(E)}k.shape.r=y;var R=e.getRawValue(M),P="-";R&&null!=R[2]&&(P=R[2]+""),(0,mD.qM)(k,x,{labelFetcher:e,labelDataIndex:M,defaultOpacity:T.opacity,defaultText:P}),k.ensureState("emphasis").style=g,k.ensureState("blur").style=m,k.ensureState("select").style=v,(0,mI.Lm)(k,w,S,C),k.incremental=i,i&&(k.states.emphasis.hoverLayer=!0),f.add(k),p.setItemGraphicEl(M,k),this._progressiveEls&&this._progressiveEls.push(k)}},t.prototype._renderOnGeo=function(e,t,n,r){var i,o,s,a,l,u,c,h=n.targetVisuals.inRange,d=n.targetVisuals.outOfRange,f=t.getData(),p=this._hmLayer||this._hmLayer||new yq;p.blurSize=t.get("blurSize"),p.pointSize=t.get("pointSize"),p.minOpacity=t.get("minOpacity"),p.maxOpacity=t.get("maxOpacity");var g=e.getViewRect().clone(),m=e.getRoamTransform();g.applyTransform(m);var v=Math.max(g.x,0),y=Math.max(g.y,0),x=Math.min(g.width+g.x,r.getWidth()),b=Math.min(g.height+g.y,r.getHeight()),w=x-v,S=b-y,C=[f.mapDimension("lng"),f.mapDimension("lat"),f.mapDimension("value")],A=f.mapArray(C,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=v,i[1]-=y,i.push(r),i}),M=n.getExtent(),k="visualMap.continuous"===n.type?(i=n.option.range,o=M[1]-M[0],i=[(i[0]-M[0])/o,(i[1]-M[0])/o],function(e){return e>=i[0]&&e<=i[1]}):(s=n.getPieceList(),a=n.option.selected,l=M[1]-M[0],u=(s=md.Tj(s,function(e){return{interval:[(e.interval[0]-M[0])/l,(e.interval[1]-M[0])/l]}})).length,c=0,function(e){var t;for(t=c;t<u;t++){var n=s[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}if(t===u)for(t=c-1;t>=0;t--){var n=s[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}return t>=0&&t<u&&a[t]});p.update(A,w,S,h.color.getNormalizer(),{inRange:h.color.getColorMapper(),outOfRange:d.color.getColorMapper()},k);var T=new vn.Ay({style:{width:w,height:S,x:v,y:y,image:p.canvas},silent:!0});this.group.add(T)},t.type="heatmap",t}(mP.A),yK=n(51907),yX=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.getInitialData=function(e,t){return(0,mv.A)(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=yK.A.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(mm.A),yJ=n(90652),yQ=n(36805),y0=["x","y","radius","angle","single"],y1=["cartesian2d","polar","singleAxis"];function y2(e){return e+"Axis"}function y5(e){var t=e.ecModel,n={infoList:[],infoMap:(0,md.nt)()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(y2(e),r);if(i){var o=i.getCoordSysModel();if(o){var s=o.uid,a=n.infoMap.get(s);a||(a={model:o,axisModels:[]},n.infoList.push(a),n.infoMap.set(s,a)),a.axisModels.push(i)}}}),n}var y3=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),y4=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return(0,mg.C6)(t,e),t.prototype.init=function(e,t,n){var r=y6(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=y6(e);(0,md.h1)(this.option,e,!0),(0,md.h1)(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;(0,md.__)([["start","startValue"],["end","endValue"]],function(e,r){"value"===this._rangePropMode[r]&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=(0,md.nt)();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return(0,md.__)(y0,function(n){var r=this.getReferringComponents(y2(n),vB.UW);if(r.specified){t=!0;var i=new y3;(0,md.__)(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0,i="vertical"===t?"y":"x",o=n.findComponents({mainType:i+"Axis"});if(s(o,i),r){var o=n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}});s(o,"single")}function s(t,n){var i=t[0];if(i){var o=new y3;if(o.add(i.componentIndex),e.set(n,o),r=!1,"x"===n||"y"===n){var s=i.getReferringComponents("grid",vB.US).models[0];s&&(0,md.__)(t,function(e){i.componentIndex!==e.componentIndex&&s===e.getReferringComponents("grid",vB.US).models[0]&&o.add(e.componentIndex)})}}}r&&(0,md.__)(y0,function(t){if(r){var i=n.findComponents({mainType:y2(t),filter:function(e){return"category"===e.get("type",!0)}});if(i[0]){var o=new y3;o.add(i[0].componentIndex),e.set(t,o),r=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){e||(e=t)},this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");(0,md.__)([["start","startValue"],["end","endValue"]],function(r,i){var o=null!=e[r[0]],s=null!=e[r[1]];o&&!s?t[i]="percent":!o&&s?t[i]="value":n?t[i]=n[i]:o&&(t[i]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){null==e&&(e=this.ecModel.getComponent(y2(t),n))},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){(0,md.__)(n.indexList,function(n){e.call(t,r,n)})})},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(y2(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;(0,md.__)([["start","startValue"],["end","endValue"]],function(r){(null!=e[r[0]]||null!=e[r[1]])&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;(0,md.__)(["start","startValue","end","endValue"],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],o=this._targetAxisInfoMap.get(i),s=0;s<o.indexList.length;s++){var a=this.getAxisProxy(i,o.indexList[s]);if(a.hostedBy(this))return a;t||(t=a)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t}(yQ.A);function y6(e){var t={};return(0,md.__)(["start","end","startValue","endValue","throttle"],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var y8=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.type="dataZoom.inside",t.defaultOption=(0,mx.G_)(y4.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(y4),y9=n(43583),y7=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(y9.A);function xe(e,t,n,r,i,o){e=e||0;var s,a=n[1]-n[0];if(null!=i&&(i=xn(i,[0,a])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var l=Math.abs(t[1]-t[0]);l=xn(l,[0,a]),i=o=xn(l,[i,o]),r=0}t[0]=xn(t[0],n),t[1]=xn(t[1],n);var u=xt(t,r);t[r]+=e;var c=i||0,h=n.slice();return u.sign<0?h[0]+=c:h[1]-=c,t[r]=xn(t[r],h),s=xt(t,r),null!=i&&(s.sign!==u.sign||s.span<i)&&(t[1-r]=t[r]+u.sign*i),s=xt(t,r),null!=o&&s.span>o&&(t[1-r]=t[r]+s.sign*o),t}function xt(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function xn(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var xr=n(16419),xi=n(77250),xo=n(31950),xs="\0_ec_interaction_mutex";function xa(e){return e[xs]||(e[xs]={})}xo.OH({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},md.lQ);var xl=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var r=(0,md.oI)(n._mousedownHandler,n),i=(0,md.oI)(n._mousemoveHandler,n),o=(0,md.oI)(n._mouseupHandler,n),s=(0,md.oI)(n._mousewheelHandler,n),a=(0,md.oI)(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=(0,md.NT)((0,md.o8)(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),(!0===e||"move"===e||"pan"===e)&&(t.on("mousedown",r),t.on("mousemove",i),t.on("mouseup",o)),(!0===e||"scale"===e||"zoom"===e)&&(t.on("mousewheel",s),t.on("pinch",a))},n.disable=function(){t.off("mousedown",r),t.off("mousemove",i),t.off("mouseup",o),t.off("mousewheel",s),t.off("pinch",a)},n}return(0,mg.C6)(t,e),t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype.setPointerChecker=function(e){this.pointerChecker=e},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!xi.W5(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(!(!this._dragging||!xh("moveOnMouseMove",e,this._opt)||"pinch"===e.gestureEvent||xa(this._zr).globalPan)){var t=e.offsetX,n=e.offsetY,r=this._x,i=this._y;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&xi.ds(e.event),xc(this,"pan","moveOnMouseMove",e,{dx:t-r,dy:n-i,oldX:r,oldY:i,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){xi.W5(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=xh("zoomOnMouseWheel",e,this._opt),n=xh("moveOnMouseWheel",e,this._opt),r=e.wheelDelta,i=Math.abs(r),o=e.offsetX,s=e.offsetY;if(0!==r&&(t||n)){if(t){var a=i>3?1.4:i>1?1.2:1.1;xu(this,"zoom","zoomOnMouseWheel",e,{scale:r>0?a:1/a,originX:o,originY:s,isAvailableBehavior:null})}if(n){var l=Math.abs(r);xu(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(r>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:s,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){if(!xa(this._zr).globalPan){var t=e.pinchScale>1?1.1:1/1.1;xu(this,"zoom",null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}(xr.A);function xu(e,t,n,r,i){e.pointerChecker&&e.pointerChecker(r,i.originX,i.originY)&&(xi.ds(r.event),xc(e,t,n,r,i))}function xc(e,t,n,r,i){i.isAvailableBehavior=(0,md.oI)(xh,null,n,r),e.trigger(t,i)}function xh(e,t,n){var r=n[e];return!e||r&&(!(0,md.Kg)(r)||t.event[r+"Key"])}var xd=(0,vB.$r)();function xf(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function xp(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function xg(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}var xm=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return(0,mg.C6)(t,e),t.prototype.render=function(t,n,r){var i;(e.prototype.render.apply(this,arguments),t.noTarget())?this._clear():(this.range=t.getPercentRange(),i={pan:(0,md.oI)(xv.pan,this),zoom:(0,md.oI)(xv.zoom,this),scrollMove:(0,md.oI)(xv.scrollMove,this)},xd(r).coordSysRecordMap.each(function(e){var n=e.dataZoomInfoMap.get(t.uid);n&&(n.getRange=i)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=xd(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var o=r[i],s=n.get(o),a=s.dataZoomInfoMap;if(a){var l=t.uid;a.get(l)&&(a.removeKey(l),a.keys().length||xf(n,s))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(y7),xv={zoom:function(e,t,n,r){var i=this.range,o=i.slice(),s=e.axisModels[0];if(s){var a=xx[t](null,[r.originX,r.originY],s,n,e),l=(a.signal>0?a.pixelStart+a.pixelLength-a.pixel:a.pixel-a.pixelStart)/a.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(xe(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}},pan:xy(function(e,t,n,r,i,o){var s=xx[r]([o.oldX,o.oldY],[o.newX,o.newY],t,i,n);return s.signal*(e[1]-e[0])*s.pixel/s.pixelLength}),scrollMove:xy(function(e,t,n,r,i,o){return xx[r]([0,0],[o.scrollDelta,o.scrollDelta],t,i,n).signal*(e[1]-e[0])*o.scrollDelta})};function xy(e){return function(t,n,r,i){var o=this.range,s=o.slice(),a=t.axisModels[0];if(a&&(xe(e(s,a,t,n,r,i),s,[0,100],"all"),this.range=s,o[0]!==s[0]||o[1]!==s[1]))return s}}var xx={grid:function(e,t,n,r,i){var o=n.axis,s={},a=i.model.coordinateSystem.getRect();return e=e||[0,0],"x"===o.dim?(s.pixel=t[0]-e[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s},polar:function(e,t,n,r,i){var o=n.axis,s={},a=i.model.coordinateSystem,l=a.getRadiusAxis().getExtent(),u=a.getAngleAxis().getExtent();return e=e?a.pointToCoord(e):[0,0],t=a.pointToCoord(t),"radiusAxis"===n.mainType?(s.pixel=t[0]-e[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=u[1]-u[0],s.pixelStart=u[0],s.signal=o.inverse?-1:1),s},singleAxis:function(e,t,n,r,i){var o=n.axis,s=i.model.coordinateSystem.getRect(),a={};return e=e||[0,0],"horizontal"===o.orient?(a.pixel=t[0]-e[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a}},xb=n(64218),xw=n(89972),xS=md.__,xC=ve.Y6,xA=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(n=t.get("coordinateSystem"),(0,md.qh)(y1,n)>=0){var n,r=y2(this._dimName),i=t.getReferringComponents(r,vB.US).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}},this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return md.o8(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,r=this.getAxisModel().axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],a=[];xS(["start","end"],function(l,u){var c=e[l],h=e[l+"Value"];"percent"===i[u]?(null==c&&(c=o[u]),h=r.parse(ve.Cb(c,o,n))):(t=!0,h=null==h?n[u]:r.parse(h),c=ve.Cb(h,n,o)),a[u]=null==h||isNaN(h)?n[u]:h,s[u]=null==c||isNaN(c)?o[u]:c}),xC(a),xC(s);var l=this._minMaxSpan;function u(e,t,n,i,o){var s=o?"Span":"ValueSpan";xe(0,e,n,"all",l["min"+s],l["max"+s]);for(var a=0;a<2;a++)t[a]=ve.Cb(e[a],n,i,!0),o&&(t[a]=r.parse(t[a]))}return t?u(a,s,n,o,!1):u(s,a,o,n,!0),{valueWindow:a,percentWindow:s}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t,n,r,i,o,s=this.getTargetSeriesModels();this._dataExtent=(t=this,n=this._dimName,r=[1/0,-1/0],xS(s,function(e){(0,xb.PN)(r,e.getData(),n)}),i=t.getAxisModel(),[(o=(0,xw.Tc)(i.axis.scale,i,r).calculate()).min,o.max]),this._updateMinMaxSpan();var a=this.calculateDataWindow(e.settledOption);this._valueWindow=a.valueWindow,this._percentWindow=a.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,r=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;"none"!==i&&xS(r,function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if("weakFilter"===i){var s=t.getStore(),a=md.Tj(r,function(e){return t.getDimensionIndex(e)},t);t.filterSelf(function(e){for(var t,n,i,l=0;l<r.length;l++){var u=s.get(a[l],e),c=!isNaN(u),h=u<o[0],d=u>o[1];if(c&&!h&&!d)return!0;c&&(i=!0),h&&(t=!0),d&&(n=!0)}return i&&t&&n})}else xS(r,function(n){if("empty"===i)e.setData(t=t.map(n,function(e){var t;return(t=e)>=o[0]&&t<=o[1]?e:NaN}));else{var r={};r[n]=o,t.selectRange(r)}});xS(r,function(e){t.setApproximateExtent(o,e)})}})}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;xS(["min","max"],function(r){var i=t.get(r+"Span"),o=t.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=ve.Cb(n[0]+o,n,[0,100],!0):null!=i&&(o=ve.Cb(i,[0,100],n,!0)-n[0]),e[r+"Span"]=i,e[r+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=ve.hb(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;0!==t[0]&&i.setDeterminedMinMax("min",+n[0].toFixed(r)),100!==t[1]&&i.setDeterminedMinMax("max",+n[1].toFixed(r)),i.freeze()}},e}();let xM={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(r,i){var o=e.getComponent(y2(r),i);t(r,i,o,n)})})}t(function(e,t,n,r){n.__dzAxisProxy=null});var n=[];t(function(t,r,i,o){i.__dzAxisProxy||(i.__dzAxisProxy=new xA(t,r,o,e),n.push(i.__dzAxisProxy))});var r=(0,md.nt)();return(0,md.__)(n,function(e){(0,md.__)(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent("dataZoom",function(e){e.eachTargetAxis(function(t,n){e.getAxisProxy(t,n).reset(e)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent("dataZoom",function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}})}};var xk=!1;function xT(e){xk||(xk=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,xM),e.registerAction("dataZoom",function(e,t){var n=function(e,t){var n,r=(0,md.nt)(),i=[],o=(0,md.nt)();e.eachComponent({mainType:"dataZoom",query:t},function(e){o.get(e.uid)||a(e)});do n=!1,e.eachComponent("dataZoom",s);while(n);function s(e){var t;!o.get(e.uid)&&(t=!1,e.eachTargetAxis(function(e,n){var i=r.get(e);i&&i[n]&&(t=!0)}),t)&&(a(e),n=!0)}function a(e){o.set(e.uid,!0),i.push(e),e.eachTargetAxis(function(e,t){(r.get(e)||r.set(e,[]))[t]=!0})}return i}(t,e);(0,md.__)(n,function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})}),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function xI(e){xT(e),e.registerComponentModel(y8),e.registerComponentView(xm),e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=xd(t),r=n.coordSysRecordMap||(n.coordSysRecordMap=(0,md.nt)());r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(e){var n=y5(e);(0,md.__)(n.infoList,function(n){var i,o,s,a=n.model.uid,l=r.get(a)||r.set(a,(s=(o={model:i=n.model,containsPoint:(0,md.cF)(xg,i),dispatchAction:(0,md.cF)(xp,t),dataZoomInfoMap:null,controller:null}).controller=new xl(t.getZr()),(0,md.__)(["pan","zoom","scrollMove"],function(e){s.on(e,function(t){var n=[];o.dataZoomInfoMap.each(function(r){if(t.isAvailableBehavior(r.model.option)){var i=(r.getRange||{})[e],s=i&&i(r.dzReferCoordSysInfo,o.model.mainType,o.controller,t);!r.model.get("disabled",!0)&&s&&n.push({dataZoomId:r.model.id,start:s[0],end:s[1]})}}),n.length&&o.dispatchAction(n)})}),o));(l.dataZoomInfoMap||(l.dataZoomInfoMap=(0,md.nt)())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var t,n,i,o,s,a=e.controller,l=e.dataZoomInfoMap;if(l){var u=l.keys()[0];null!=u&&(s=l.get(u))}if(!s)return void xf(r,e);var c=(n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,l.each(function(e){var r=e.model,s=!r.get("disabled",!0)&&(!r.get("zoomLock",!0)||"move");i[n+s]>i[n+t]&&(t=s),o=o&&r.get("preventDefaultMouseMove",!0)}),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}});a.enable(c.controlType,c.opt),a.setPointerChecker(e.containsPoint),mO.N(e,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var xD=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=(0,mx.G_)(y4.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(y4),xO=n(97451),xE=mM.A,x_="horizontal",xR="vertical",xP=["line","bar","candlestick","scatter"],xL={easing:"cubicOut",duration:100,delay:0},xN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return(0,mg.C6)(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=(0,md.oI)(this._onBrush,this),this._onBrushEnd=(0,md.oI)(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),mO.N(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1===t.get("show"))return void this.group.removeAll();if(t.noTarget()){this._clear(),this.group.removeAll();return}i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){mO.IU(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new mS.A;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect"),r=this._findCoordRect(),i={width:t.getWidth(),height:t.getHeight()},o=this._orient===x_?{right:i.width-r.x-r.width,top:i.height-30-7-7*!!n,width:r.width,height:30}:{right:7,top:r.y,width:30,height:r.height},s=vh.vs(e.option);(0,md.__)(["right","top","width","height"],function(e){"ph"===s[e]&&(s[e]=o[e])});var a=vh.dV(s,i);this._location={x:a.x,y:a.y},this._size=[a.width,a.height],this._orient===xR&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,s=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==x_||i?n===x_&&i?{scaleY:s?1:-1,scaleX:-1}:n!==xR||i?{scaleY:s?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:s?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:s?1:-1,scaleX:1});var a=e.getBoundingRect([o]);e.x=t.x-a.x,e.y=t.y-a.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get("brushSelect");n.add(new xE({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var i=new xE({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:(0,md.oI)(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),o=r.getShadowDim&&r.getShadowDim(),s=o&&i.getDimensionInfo(o)?r.getShadowDim():e.otherDim;if(null!=s){var a=this._shadowPolygonPts,l=this._shadowPolylinePts;if(i!==this._shadowData||s!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u,c=i.getDataExtent(s),h=(c[1]-c[0])*.3;c=[c[0]-h,c[1]+h];var d=[0,t[1]],f=[0,t[0]],p=[[t[0],0],[0,0]],g=[],m=f[1]/(i.count()-1),v=0,y=Math.round(i.count()/t[0]);i.each([s],function(e,t){if(y>0&&t%y){v+=m;return}var n=null==e||isNaN(e)||""===e,r=n?0:(0,ve.Cb)(e,c,d,!0);n&&!u&&t?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&u&&(p.push([v,0]),g.push([v,0])),p.push([v,r]),g.push([v,r]),v+=m,u=n}),a=this._shadowPolygonPts=p,l=this._shadowPolylinePts=g}this._shadowData=i,this._shadowDim=s,this._shadowSize=[t[0],t[1]];for(var x=this.dataZoomModel,b=0;b<3;b++){var w=function(e){var t=x.getModel(e?"selectedDataBackground":"dataBackground"),n=new mS.A,r=new xO.A({shape:{points:a},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new vv.A({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}(1===b);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}}}},t.prototype._prepareDataShadowInfo=function(){var e,t=this.dataZoomModel,n=t.get("showDataShadow");if(!1!==n){var r=this.ecModel;return t.eachTargetAxis(function(i,o){var s=t.getAxisProxy(i,o).getTargetSeriesModels();(0,md.__)(s,function(t){if(!e&&!(!0!==n&&0>(0,md.qh)(xP,t.get("type")))){var s,a=r.getComponent(y2(i),o).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[i],u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(s=u.getOtherAxis(a).inverse),l=t.getData().mapDimension(l),e={thisAxis:a,series:t,thisDim:i,otherDim:l,otherAxisInverse:s}}},this)},this),e}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,o=this._size,s=this.dataZoomModel,a=this.api,l=s.get("borderRadius")||0,u=s.get("brushSelect"),c=t.filler=new xE({silent:u,style:{fill:s.get("fillerColor")},textConfig:{position:"inside"}});i.add(c),i.add(new xE({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:s.get("dataBackgroundColor")||s.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),(0,md.__)([0,1],function(t){var o=s.get("handleIcon");!vt.$V[o]&&0>o.indexOf("path://")&&0>o.indexOf("image://")&&(o="path://"+o);var a=(0,vt.v5)(o,-1,0,2,2,null,!0);a.attr({cursor:xB(this._orient),draggable:!0,drift:(0,md.oI)(this._onDragMove,this,t),ondragend:(0,md.oI)(this._onDragEnd,this),onmouseover:(0,md.oI)(this._showDataInfo,this,!0),onmouseout:(0,md.oI)(this._showDataInfo,this,!1),z2:5});var l=a.getBoundingRect(),u=s.get("handleSize");this._handleHeight=(0,ve.lo)(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,a.setStyle(s.getModel("handleStyle").getItemStyle()),a.style.strokeNoScale=!0,a.rectHover=!0,a.ensureState("emphasis").style=s.getModel(["emphasis","handleStyle"]).getItemStyle(),(0,mI.iJ)(a);var c=s.get("handleColor");null!=c&&(a.style.fill=c),i.add(n[t]=a);var h=s.getModel("textStyle");e.add(r[t]=new m7.Ay({silent:!0,invisible:!0,style:(0,mD.VB)(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))},this);var h=c;if(u){var d=(0,ve.lo)(s.get("moveHandleSize"),o[1]),f=t.moveHandle=new mM.A({style:s.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),p=.8*d,g=t.moveHandleIcon=(0,vt.v5)(s.get("moveHandleIcon"),-p/2,-p/2,p,p,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,f.ensureState("emphasis").style=s.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=t.moveZone=new mM.A({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",function(){a.enterEmphasis(f)}).on("mouseout",function(){a.leaveEmphasis(f)}),i.add(f),i.add(g),i.add(h)}h.attr({draggable:!0,cursor:xB(this._orient),drift:(0,md.oI)(this._onDragMove,this,"all"),ondragstart:(0,md.oI)(this._showDataInfo,this,!0),ondragend:(0,md.oI)(this._onDragEnd,this),onmouseover:(0,md.oI)(this._showDataInfo,this,!0),onmouseout:(0,md.oI)(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[(0,ve.Cb)(e[0],[0,100],t,!0),(0,ve.Cb)(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),s=[0,100];xe(t,r,i,n.get("zoomLock")?"all":e,null!=o.minSpan?(0,ve.Cb)(o.minSpan,s,i,!0):null,null!=o.maxSpan?(0,ve.Cb)(o.maxSpan,s,i,!0):null);var a=this._range,l=this._range=(0,ve.Y6)([(0,ve.Cb)(r[0],i,s,!0),(0,ve.Cb)(r[1],i,s,!0)]);return!a||a[0]!==l[0]||a[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=(0,ve.Y6)(n.slice()),i=this._size;(0,md.__)([0,1],function(e){var r=t.handles[e],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:i[1]/2-o/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(o),t.moveZone.setShape(o),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",o.x+o.width/2));for(var s=t.dataShadowSegs,a=[0,r[0],r[1],i[0]],l=0;l<s.length;l++){var u=s[l],c=u.getClipPath();c||(c=new mM.A,u.setClipPath(c)),c.setShape({x:a[l],y:0,width:a[l+1]-a[l],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,o=["",""];if(t.get("showDetail")){var s=t.findRepresentativeAxisProxy();if(s){var a=s.getAxisModel().axis,l=this._range,u=e?s.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:s.getDataValueWindow();o=[this._formatLabel(u[0],a),this._formatLabel(u[1],a)]}}var c=(0,ve.Y6)(this._handleEnds.slice());function h(e){var t=mC.getTransform(n.handles[e].parent,this.group),s=mC.transformDirection(0===e?"right":"left",t),a=this._handleWidth/2+5,l=mC.applyTransform([c[e]+(0===e?-a:a),this._size[1]/2],t);r[e].setStyle({x:l[0],y:l[1],verticalAlign:i===x_?"middle":s,align:i===x_?s:"center",text:o[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get("labelFormatter"),i=n.get("labelPrecision");(null==i||"auto"===i)&&(i=t.getPixelPrecision());var o=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return(0,md.Tn)(r)?r(e,o):(0,md.Kg)(r)?r.replace("{value}",o):o},t.prototype._showDataInfo=function(e){e=this._dragging||e;var t=this._displayables,n=t.handleLabels;n[0].attr("invisible",!e),n[1].attr("invisible",!e),t.moveHandle&&this.api[e?"enterEmphasis":"leaveEmphasis"](t.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,xi.ds(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),o=mC.applyTransform([t,n],i,!0),s=this._updateInterval(e,o[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),s&&a&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),this.dataZoomModel.get("realtime")||this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0)&&!(n[0]>t[0])&&!(n[1]<0)&&!(n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new vy.A(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(new Date-this._brushStartTime<200&&5>Math.abs(n.width))){var r=this._getViewExtent(),i=[0,100];this._range=(0,ve.Y6)([(0,ve.Cb)(n.x,r,i,!0),(0,ve.Cb)(n.x+n.width,r,i,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(xi.ds(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new xE({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.attr("ignore",!1);var o=this._brushStart,s=this._displayables.sliderGroup,a=s.transformCoordToLocal(e,t),l=s.transformCoordToLocal(o.x,o.y),u=this._size;a[0]=Math.max(Math.min(u[0],a[0]),0),i.setShape({x:l[0],y:0,width:a[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?xL:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=y5(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return e},t.type="dataZoom.slider",t}(y7);function xB(e){return"vertical"===e?"ns-resize":"ew-resize"}function xF(e){e.registerComponentModel(xD),e.registerComponentView(xN),xT(e)}var xj=n(25744),xz=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return(0,mg.C6)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),md.cy(t)&&md.__(t,function(e,r){var i;md.Kg(e)&&(e={type:e}),t[r]=md.h1(e,"all"===(i=e.type)?{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])}:"inverse"===i?{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}:void 0)})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get("name");if(this.isSelected(r)){this.select(r),t=!0;break}}t||this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i,o=r.name;if(n.push(o),r.legendVisualProvider){var s=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(s)),s.length?t=t.concat(s):i=!0}else i=!0;i&&(0,vB.O0)(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get("data")||t,i=md.nt(),o=md.Tj(r,function(e){return((md.Kg(e)||md.Et(e))&&(e={name:e}),i.get(e.name))?null:(i.set(e.name,!0),new xj.A(e,this,this.ecModel))},this);this._data=md.pb(o,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;if("single"===this.get("selectedMode")){var n=this._data;md.__(n,function(e){t[e.get("name")]=!1})}t[e]=!0},t.prototype.unSelect=function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;md.__(e,function(e){t[e.get("name",!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;md.__(e,function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&md.qh(this._availableNames,e)>=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(yQ.A),xV=n(34196),xH=n(3306);function x$(e,t){var n=xH.QX(t.get("padding")),r=t.getItemStyle(["color","opacity"]);return r.fill=t.get("backgroundColor"),e=new mM.A({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:r,silent:!0,z2:-1})}var xW=md.cF,xG=md.__,xU=mS.A,xq=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return(0,mg.C6)(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new xU),this.group.add(this._selectorGroup=new xU),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var i=e.get("align"),o=e.get("orient");i&&"auto"!==i||(i="right"===e.get("left")&&"vertical"===o?"right":"left");var s=e.get("selector",!0),a=e.get("selectorPosition",!0);s&&(!a||"auto"===a)&&(a="horizontal"===o?"end":"start"),this.renderInner(i,e,t,n,s,o,a);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=vh.dV(l,u,c),d=this.layoutInner(e,i,h,r,s,a),f=vh.dV(md.NT({width:d.width,height:d.height},l),u,c);this.group.x=f.x-d.x,this.group.y=f.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=x$(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,o,s){var a=this.getContentGroup(),l=md.nt(),u=t.get("selectedMode"),c=[];n.eachRawSeries(function(e){e.get("legendHoverLink")||c.push(e.id)}),xG(t.getData(),function(i,o){var s=i.get("name");if(!this.newlineDisabled&&(""===s||"\n"===s)){var h=new xU;h.newline=!0,a.add(h);return}var d=n.getSeriesByName(s)[0];if(!l.get(s))if(d){var f=d.getData(),p=f.getVisual("legendLineStyle")||{},g=f.getVisual("legendIcon"),m=f.getVisual("style"),v=this._createItem(d,s,o,i,t,e,p,m,g,u,r);v.on("click",xW(xY,s,null,r,c)).on("mouseover",xW(xK,d.name,null,r,c)).on("mouseout",xW(xX,d.name,null,r,c)),n.ssr&&v.eachChild(function(e){var t=(0,mT.z)(e);t.seriesIndex=d.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(s,!0)}else n.eachRawSeries(function(a){if(!l.get(s)&&a.legendVisualProvider){var h=a.legendVisualProvider;if(h.containName(s)){var d=h.indexOfName(s),f=h.getItemVisual(d,"style"),p=h.getItemVisual(d,"legendIcon"),g=(0,xV.qg)(f.fill);g&&0===g[3]&&(g[3]=.2,f=md.X$(md.X$({},f),{fill:(0,xV.As)(g,"rgba")}));var m=this._createItem(a,s,o,i,t,e,{},f,p,u,r);m.on("click",xW(xY,null,s,r,c)).on("mouseover",xW(xK,null,s,r,c)).on("mouseout",xW(xX,null,s,r,c)),n.ssr&&m.eachChild(function(e){var t=(0,mT.z)(e);t.seriesIndex=a.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(s,!0)}}},this)},this),i&&this._createSelector(i,t,r,o,s)},t.prototype._createSelector=function(e,t,n,r,i){var o=this.getSelectorGroup();xG(e,function(e){var r=e.type,i=new m7.Ay({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect"})}});o.add(i);var s=t.getModel("selectorLabel"),a=t.getModel(["emphasis","selectorLabel"]);(0,mD.qM)(i,{normal:s,emphasis:a},{defaultText:e.title}),(0,mI.iJ)(i)})},t.prototype._createItem=function(e,t,n,r,i,o,s,a,l,u,c){var h=e.visualDrawType,d=i.get("itemWidth"),f=i.get("itemHeight"),p=i.isSelected(t),g=r.get("symbolRotate"),m=r.get("symbolKeepAspect"),v=r.get("icon"),y=function(e,t,n,r,i,o,s){function a(e,t){"auto"===e.lineWidth&&(e.lineWidth=2*(t.lineWidth>0)),xG(e,function(n,r){"inherit"===e[r]&&(e[r]=t[r])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");u.decal=h&&"inherit"!==h?(0,yn.w)(h,s):r.decal,"inherit"===u.fill&&(u.fill=r[i]),"inherit"===u.stroke&&(u.stroke=r[c]),"inherit"===u.opacity&&(u.opacity=("fill"===i?r:n).opacity),a(u,r);var d=t.getModel("lineStyle"),f=d.getLineStyle();if(a(f,n),"auto"===u.fill&&(u.fill=r.fill),"auto"===u.stroke&&(u.stroke=r.fill),"auto"===f.stroke&&(f.stroke=r.fill),!o){var p=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===p?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),f.stroke=d.get("inactiveColor"),f.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:f}}(l=v||l||"roundRect",r,s,a,h,p,c),x=new xU,b=r.getModel("textStyle");if(md.Tn(e.getLegendIcon)&&(!v||"inherit"===v))x.add(e.getLegendIcon({itemWidth:d,itemHeight:f,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));else{var w,S,C,A="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add((S=(w={itemWidth:d,itemHeight:f,icon:l,iconRotate:A,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}).icon||"roundRect",(C=(0,vt.v5)(S,0,0,w.itemWidth,w.itemHeight,w.itemStyle.fill,w.symbolKeepAspect)).setStyle(w.itemStyle),C.rotation=(w.iconRotate||0)*Math.PI/180,C.setOrigin([w.itemWidth/2,w.itemHeight/2]),S.indexOf("empty")>-1&&(C.style.stroke=C.style.fill,C.style.fill="#fff",C.style.lineWidth=2),C))}var M=i.get("formatter"),k=t;md.Kg(M)&&M?k=M.replace("{name}",null!=t?t:""):md.Tn(M)&&(k=M(t));var T=p?b.getTextColor():r.get("inactiveColor");x.add(new m7.Ay({style:(0,mD.VB)(b,{text:k,x:"left"===o?d+5:-5,y:f/2,fill:T,align:o,verticalAlign:"middle"},{inheritColor:T})}));var I=new mM.A({shape:x.getBoundingRect(),style:{fill:"transparent"}}),D=r.getModel("tooltip");return D.get("show")&&mC.setTooltipConfig({el:I,componentModel:i,itemName:t,itemTooltipOption:D.option}),x.add(I),x.eachChild(function(e){e.silent=!0}),I.silent=!u,this.getContentGroup().add(x),(0,mI.iJ)(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,r,i,o){var s=this.getContentGroup(),a=this.getSelectorGroup();vh.aP(e.get("orient"),s,e.get("itemGap"),n.width,n.height);var l=s.getBoundingRect(),u=[-l.x,-l.y];if(a.markRedraw(),s.markRedraw(),!i)return s.x=u[0],s.y=u[1],this.group.getBoundingRect();vh.aP("horizontal",a,e.get("selectorItemGap",!0));var c=a.getBoundingRect(),h=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),f=e.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===o?h[f]+=l[p]+d:u[f]+=c[p]+d,h[1-f]+=l[g]/2-c[g]/2,a.x=h[0],a.y=h[1],s.x=u[0],s.y=u[1];var v={x:0,y:0};return v[p]=l[p]+d+c[p],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+h[1-f]),v},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(y9.A);function xY(e,t,n,r){xX(e,t,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),xK(e,t,n,r)}function xZ(e){for(var t,n=e.getZr().storage.getDisplayList(),r=0,i=n.length;r<i&&!(t=n[r].states.emphasis);)r++;return t&&t.hoverLayer}function xK(e,t,n,r){xZ(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:r})}function xX(e,t,n,r){xZ(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:r})}function xJ(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function xQ(e,t,n){var r,i={},o="toggleSelected"===e;return n.eachComponent("legend",function(n){o&&null!=r?n[r?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),r=n.isSelected(t.name));var s=n.getData();(0,md.__)(s,function(e){var t=e.get("name");if("\n"!==t&&""!==t){var r=n.isSelected(t);i.hasOwnProperty(t)?i[t]=i[t]&&r:i[t]=r}})}),"allSelect"===e||"inverseSelect"===e?{selected:i}:{name:t.name,selected:i}}function x0(e){e.registerComponentModel(xz),e.registerComponentView(xq),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,xJ),e.registerSubTypeDefaulter("legend",function(){return"plain"}),e.registerAction("legendToggleSelect","legendselectchanged",(0,md.cF)(xQ,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",(0,md.cF)(xQ,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",(0,md.cF)(xQ,"inverseSelect")),e.registerAction("legendSelect","legendselected",(0,md.cF)(xQ,"select")),e.registerAction("legendUnSelect","legendunselected",(0,md.cF)(xQ,"unSelect"))}var x1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=(0,vh.vs)(t);e.prototype.init.call(this,t,n,r),x2(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),x2(this,this.option,t)},t.type="legend.scroll",t.defaultOption=(0,mx.G_)(xz.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(xz);function x2(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,(0,vh.YA)(t,n,{type:"box",ignoreSize:!!i})}var x5=mS.A,x3=["width","height"],x4=["x","y"],x6=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return(0,mg.C6)(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new x5),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new x5)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,o,s,a){var l=this;e.prototype.renderInner.call(this,t,n,r,i,o,s,a);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=md.cy(c)?c:[c,c];f("pagePrev",0);var d=n.getModel("pageTextStyle");function f(e,t){var r=mC.createIcon(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:md.oI(l._pageGo,l,e+"DataIndex",n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});r.name=e,u.add(r)}u.add(new m7.Ay({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),f("pageNext",1)},t.prototype.layoutInner=function(e,t,n,r,i,o){var s=this.getSelectorGroup(),a=e.getOrient().index,l=x3[a],u=x4[a],c=x3[1-a],h=x4[1-a];i&&vh.aP("horizontal",s,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),f=s.getBoundingRect(),p=[-f.x,-f.y],g=md.o8(n);i&&(g[l]=n[l]-f[l]-d);var m=this._layoutContentAndController(e,r,g,a,l,c,h,u);if(i){if("end"===o)p[a]+=m[l]+d;else{var v=f[l]+d;p[a]-=v,m[u]-=v}m[l]+=f[l]+d,p[1-a]+=m[h]+m[c]/2-f[c]/2,m[c]=Math.max(m[c],f[c]),m[h]=Math.min(m[h],f[h]+p[1-a]),s.x=p[0],s.y=p[1],s.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,r,i,o,s,a){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;vh.aP(e.get("orient"),l,e.get("itemGap"),r?n.width:null,r?null:n.height),vh.aP("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=c.getBoundingRect(),f=this._showController=h[i]>n[i],p=[-h.x,-h.y];t||(p[r]=l[a]);var g=[0,0],m=[-d.x,-d.y],v=md.bZ(e.get("pageButtonGap",!0),e.get("itemGap",!0));f&&("end"===e.get("pageButtonPosition",!0)?m[r]+=n[i]-d[i]:g[r]+=d[i]+v),m[1-r]+=h[o]/2-d[o]/2,l.setPosition(p),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[i]=f?n[i]:h[i],y[o]=Math.max(h[o],d[o]),y[s]=Math.min(0,d[s]+m[1-r]),u.__rectSize=n[i],f){var x={x:0,y:0};x[i]=Math.max(n[i]-d[i]-v,0),x[o]=y[o],u.setClipPath(new mM.A({shape:x})),u.__rectSize=x[i]}else c.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return null!=b.pageIndex&&mA.oi(l,{x:b.contentPosition[0],y:b.contentPosition[1]},f?e:null),this._updatePageInfoView(e,b),y},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;md.__(["pagePrev","pageNext"],function(r){var i=null!=t[r+"DataIndex"],o=n.childOfName(r);o&&(o.setStyle("fill",i?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=i?"pointer":"default")});var r=n.childOfName("pageText"),i=e.get("pageFormatter"),o=t.pageIndex,s=null!=o?o+1:0,a=t.pageCount;r&&i&&r.setStyle("text",md.Kg(i)?i.replace("{current}",null==s?"":s+"").replace("{total}",null==a?"":a+""):i({current:s,total:a}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,o=x3[i],s=x4[i],a=this._findTargetItemIndex(t),l=n.children(),u=l[a],c=l.length,h=+!!c,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[i]=-f.s;for(var p=a+1,g=f,m=f,v=null;p<=c;++p)(!(v=y(l[p]))&&m.e>g.s+r||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(var p=a-1,g=f,m=f,v=null;p>=-1;--p)(!(v=y(l[p]))||!x(m,v.s))&&g.i<m.i&&(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),n=t[s]+e[s];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function x(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){var t,n;return this._showController?(this.getContentGroup().eachChild(function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===e&&(t=i)}),null!=t?t:n):0},t.type="legend.scroll",t}(xq);function x8(e){(0,vH.Y)(x0),e.registerComponentModel(x1),e.registerComponentView(x6),e.registerAction("legendScroll","legendscroll",function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(e){e.setScrollDataIndex(n)})})}var x9=n(59738),x7=n(72106),be=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.type="dataZoom.select",t}(y4),bt=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.type="dataZoom.select",t}(y7);function bn(e){e.registerComponentModel(be),e.registerComponentView(bt),xT(e)}var br=function(){},bi={},bo=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;md.__(this.option.feature,function(e,n){var r=bi[n];r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),md.h1(e,r.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(yQ.A),bs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),e.get("show")){var o,s,a,l,u=+e.get("itemSize"),c="vertical"===e.get("orient"),h=e.get("feature")||{},d=this._features||(this._features={}),f=[];md.__(h,function(e,t){f.push(t)}),new v2.A(this._featureNames||[],f).add(p).update(p).remove(md.cF(p,null)).execute(),this._featureNames=f,o=e.getBoxLayoutParams(),s=e.get("padding"),a={width:n.getWidth(),height:n.getHeight()},l=(0,vh.dV)(o,a,s),(0,vh.aP)(e.get("orient"),i,e.get("itemGap"),l.width,l.height),(0,vh.m$)(i,o,a,s),i.add(x$(i.getBoundingRect(),e)),c||i.eachChild(function(e){var t=e.__title,r=e.ensureState("emphasis"),o=r.textConfig||(r.textConfig={}),s=e.getTextContent(),a=s&&s.ensureState("emphasis");if(a&&!md.Tn(a)&&t){var l=a.style||(a.style={}),c=mB.NO(t,m7.Ay.makeFont(l)),h=e.x+i.x,d=e.y+i.y+u,f=!1;d+c.height>n.getHeight()&&(o.position="top",f=!0);var p=f?-5-c.height:u+10;h+c.width/2>n.getWidth()?(o.position=["100%",p],l.align="right"):h-c.width/2<0&&(o.position=[0,p],l.align="left")}})}function p(o,s){var a,l,p,g,m,v,y,x,b,w,S,C=f[o],A=f[s],M=h[C],k=new xj.A(M,e,e.ecModel);if(r&&null!=r.newTitle&&r.featureName===C&&(M.title=r.newTitle),C&&!A){if(0===C.indexOf("my"))S={onclick:k.option.onclick,featureName:C};else{var T=bi[C];if(!T)return;S=new T}d[C]=S}else if(!(S=d[A]))return;S.uid=(0,mx.$Q)("toolbox-feature"),S.model=k,S.ecModel=t,S.api=n;var I=S instanceof br;if(!C&&A){I&&S.dispose&&S.dispose(t,n);return}if(!k.get("show")||I&&S.unusable){I&&S.remove&&S.remove(t,n);return}a=k,l=S,p=C,v=a.getModel("iconStyle"),y=a.getModel(["emphasis","iconStyle"]),x=l instanceof br&&l.getIcons?l.getIcons():a.get("icon"),b=a.get("title")||{},md.Kg(x)?(g={})[p]=x:g=x,md.Kg(b)?(m={})[p]=b:m=b,w=a.iconPaths={},md.__(g,function(r,o){var s=mC.createIcon(r,{},{x:-u/2,y:-u/2,width:u,height:u});s.setStyle(v.getItemStyle()),s.ensureState("emphasis").style=y.getItemStyle();var h=new m7.Ay({style:{text:m[o],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:(0,mD.c8)({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},t)},ignore:!0});s.setTextContent(h),mC.setTooltipConfig({el:s,componentModel:e,itemName:o,formatterParamsExtra:{title:m[o]}}),s.__title=m[o],s.on("mouseover",function(){var t=y.getItemStyle(),r=c?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";h.setStyle({fill:y.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),s.setTextConfig({position:y.get("textPosition")||r}),h.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==a.get(["iconStatus",o])&&n.leaveEmphasis(this),h.hide()}),("emphasis"===a.get(["iconStatus",o])?mI.HY:mI.SD)(s),i.add(s),s.on("click",md.oI(l.onclick,l,t,n,o)),w[o]=s}),k.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&("emphasis"===t?mI.HY:mI.SD)(r[e])},S instanceof br&&S.render&&S.render(k,t,n,r)}},t.prototype.updateView=function(e,t,n,r){md.__(this._features,function(e){e instanceof br&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.remove=function(e,t){md.__(this._features,function(n){n instanceof br&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){md.__(this._features,function(n){n instanceof br&&n.dispose&&n.dispose(e,t)})},t.type="toolbox",t}(y9.A),ba=n(35209),bl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.onclick=function(e,t){var n=this.model,r=n.get("name")||e.get("title.0.text")||"echarts",i="svg"===t.getZr().painter.getType(),o=i?"svg":n.get("type",!0)||"png",s=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),a=ba.A.browser;if((0,md.Tn)(MouseEvent)&&(a.newEdge||!a.ie&&!a.edge)){var l=document.createElement("a");l.download=r+"."+o,l.target="_blank",l.href=s;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||i){var c=s.split(","),h=c[0].indexOf("base64")>-1,d=i?decodeURIComponent(c[1]):c[1];h&&(d=window.atob(d));var f=r+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var p=d.length,g=new Uint8Array(p);p--;)g[p]=d.charCodeAt(p);var m=new Blob([g]);window.navigator.msSaveOrOpenBlob(m,f)}else{var v=document.createElement("iframe");document.body.appendChild(v);var y=v.contentWindow,x=y.document;x.open("image/svg+xml","replace"),x.write(d),x.close(),y.focus(),x.execCommand("SaveAs",!0,f),document.body.removeChild(v)}}else{var b=n.get("lang"),w='<body style="margin:0;"><img src="'+s+'" style="max-width:100%;" title="'+(b&&b[0]||"")+'" /></body>',S=window.open();S.document.write(w),S.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},t}(br),bu="__ec_magicType_stack__",bc=[["line","bar"],["stack"]],bh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return md.__(e.get("type"),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r,i=this.model,o=i.get(["seriesIndex",n]);if(bd[n]){var s={series:[]};md.__(bc,function(e){md.qh(e,n)>=0&&md.__(e,function(e){i.setIconStatus(e,"normal")})}),i.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var t=e.subType,r=e.id,o=bd[n](t,r,e,i);o&&(md.NT(o,e.option),s.series.push(o));var a=e.coordinateSystem;if(a&&"cartesian2d"===a.type&&("line"===n||"bar"===n)){var l=a.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,vB.US).models[0].componentIndex;s[u]=s[u]||[];for(var h=0;h<=c;h++)s[u][c]=s[u][c]||{};s[u][c].boundaryGap="bar"===n}}});var a=n;"stack"===n&&(r=md.h1({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(a="tiled")),t.dispatchAction({type:"changeMagicType",currentType:a,newOption:s,newTitle:r,featureName:"magicType"})}},t}(br),bd={line:function(e,t,n,r){if("bar"===e)return md.h1({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(e,t,n,r){if("line"===e)return md.h1({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(e,t,n,r){var i=n.get("stack")===bu;if("line"===e||"bar"===e)return r.setIconStatus("stack",i?"normal":"emphasis"),md.h1({id:t,stack:i?"":bu},r.get(["option","stack"])||{},!0)}};xo.OH({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var bf=Array(60).join("-");function bp(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var bg=RegExp("[ ]+","g"),bm=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:"hideTip"})});var n,r,i,o,s,a,l,u=t.getDom(),c=this.model;this._dom&&u.removeChild(this._dom);var h=document.createElement("div");h.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",h.style.backgroundColor=c.get("backgroundColor")||"#fff";var d=document.createElement("h4"),f=c.get("lang")||[];d.innerHTML=f[0]||c.get("title"),d.style.cssText="margin:10px 20px",d.style.color=c.get("textColor");var p=document.createElement("div"),g=document.createElement("textarea");p.style.cssText="overflow:auto";var m=c.get("optionToContent"),v=c.get("contentToOption"),y=(l=(n={},r=[],i=[],e.eachRawSeries(function(e){var t=e.coordinateSystem;if(t&&("cartesian2d"===t.type||"polar"===t.type)){var o=t.getBaseAxis();if("category"===o.type){var s=o.dim+"_"+o.index;n[s]||(n[s]={categoryAxis:o,valueAxis:t.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),n[s].series.push(e)}else r.push(e)}else r.push(e)}),{seriesGroupByCategoryAxis:n,other:r,meta:i}),{value:md.pb([(o=l.seriesGroupByCategoryAxis,s=[],md.__(o,function(e,t){var n=e.categoryAxis,r=e.valueAxis.dim,i=[" "].concat(md.Tj(e.series,function(e){return e.name})),o=[n.model.getCategories()];md.__(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(r),function(e){return e}))});for(var a=[i.join(" ")],l=0;l<o[0].length;l++){for(var u=[],c=0;c<o.length;c++)u.push(o[c][l]);a.push(u.join(" "))}s.push(a.join("\n"))}),s.join("\n\n"+bf+"\n\n")),(a=l.other,md.Tj(a,function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,function(){for(var e=arguments.length,i=arguments[e-1],o=t.getName(i),s=0;s<e-1;s++)r[s]=arguments[s];n.push((o?o+" ":"")+r.join(" "))}),n.join("\n")}).join("\n\n"+bf+"\n\n"))],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join("\n\n"+bf+"\n\n"),meta:l.meta});if(md.Tn(m)){var x=m(t.getOption());md.Kg(x)?p.innerHTML=x:md.n_(x)&&p.appendChild(x)}else{g.readOnly=c.get("readOnly");var b=g.style;b.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",b.color=c.get("textColor"),b.borderColor=c.get("textareaBorderColor"),b.backgroundColor=c.get("textareaColor"),g.value=y.value,p.appendChild(g)}var w=y.meta,S=document.createElement("div");S.style.cssText="position:absolute;bottom:5px;left:0;right:0";var C="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",A=document.createElement("div"),M=document.createElement("div");C+=";background-color:"+c.get("buttonColor")+";color:"+c.get("buttonTextColor");var k=this;function T(){u.removeChild(h),k._dom=null}(0,xi.q2)(A,"click",T),(0,xi.q2)(M,"click",function(){var e,n,r,i;if(null==v&&null!=m||null!=v&&null==m)return void T();try{md.Tn(v)?e=v(p,t.getOption()):(n=g.value,r=n.split(RegExp("\n*"+bf+"\n*","g")),i={series:[]},md.__(r,function(e,t){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(" ")>=0)return!0}(e)){var n=function(e){for(var t=e.split(/\n+/g),n=bp(t.shift()).split(bg),r=[],i=md.Tj(n,function(e){return{name:e,data:[]}}),o=0;o<t.length;o++){var s=bp(t[o]).split(bg);r.push(s.shift());for(var a=0;a<s.length;a++)i[a]&&(i[a].data[o]=s[a])}return{series:i,categories:r}}(e),r=w[t],o=r.axisDim+"Axis";r&&(i[o]=i[o]||[],i[o][r.axisIndex]={data:n.categories},i.series=i.series.concat(n.series))}else{var n=function(e){for(var t=e.split(/\n+/g),n=bp(t.shift()),r=[],i=0;i<t.length;i++){var o=bp(t[i]);if(o){var s=o.split(bg),a="",l=void 0,u=!1;isNaN(s[0])?(u=!0,a=s[0],s=s.slice(1),r[i]={name:a,value:[]},l=r[i].value):l=r[i]=[];for(var c=0;c<s.length;c++)l.push(+s[c]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(e);i.series.push(n)}}),e=i)}catch(e){throw T(),Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),T()}),A.innerHTML=f[1],M.innerHTML=f[2],M.style.cssText=A.style.cssText=C,c.get("readOnly")||S.appendChild(M),S.appendChild(A),h.appendChild(d),h.appendChild(p),h.appendChild(S),p.style.height=u.clientHeight-80+"px",u.appendChild(h),this._dom=h},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(br);xo.OH({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(e,t){var n=[];md.__(e.newOption.series,function(e){var r=t.getSeriesByName(e.name)[0];if(r){var i,o=r.get("data");n.push({name:e.name,data:(i=e.data,md.Tj(i,function(e,t){var n=o&&o[t];if(!md.Gv(n)||md.cy(n))return e;md.Gv(e)&&!md.cy(e)||(e={value:e});var r=null!=n.name&&null==e.name;return e=md.NT(e,n),r&&delete e.name,e}))})}else n.push(md.X$({type:"scatter"},e))}),t.mergeOption(md.NT({series:n},e.newOption))});var bv=md.__,by=(0,vB.$r)();function bx(e){var t=by(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var bb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.onclick=function(e,t){by(e).snapshots=null,t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(br);xo.OH({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var bw=Math.min,bS=Math.max,bC=Math.pow,bA="globalPan",bM={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},bk={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},bT={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},bI=0,bD=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new mS.A,n._uid="brushController_"+bI++,(0,md.__)(b2,function(e,t){this._handlers[t]=(0,md.oI)(e,this)},n),n}return(0,mg.C6)(t,e),t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t,n=this._zr;this._enableGlobalPan||(t=this._uid,xa(n)[bA]=t),(0,md.__)(this._handlers,function(e,t){n.on(t,e)}),this._brushType=e.brushType,this._brushOption=(0,md.h1)((0,md.o8)(bT),e,!0)},t.prototype._doDisableBrush=function(){var e,t,n=this._zr;e=this._uid,(t=xa(n))[bA]===e&&(t[bA]=null),(0,md.__)(this._handlers,function(e,t){n.off(t,e)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};(0,md.__)(e,function(e){t[e.panelId]=(0,md.o8)(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=(0,md.Tj)(e,function(e){return(0,md.h1)((0,md.o8)(bT),e,!0)});var t=this._covers,n=this._covers=[],r=this,i=this._creatingCover;return new v2.A(t,e,function(e,t){return o(e.__brushOption,t)},o).add(s).update(s).remove(function(e){t[e]!==i&&r.group.remove(t[e])}).execute(),this;function o(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function s(o,s){var a=e[o];if(null!=s&&t[s]===i)n[o]=t[s];else{var l=n[o]=null!=s?(t[s].__brushOption=a,t[s]):bE(r,bO(r,a));bP(r,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),bF(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(xr.A);function bO(e,t){var n=b3[t.brushType].createCover(e,t);return n.__brushOption=t,bR(n,t),e.group.add(n),n}function bE(e,t){var n=bL(t);return n.endCreating&&(n.endCreating(e,t),bR(t,t.__brushOption)),t}function b_(e,t){var n=t.__brushOption;bL(t).updateCoverShape(e,t,n.range,n)}function bR(e,t){var n=t.z;null==n&&(n=1e4),e.traverse(function(e){e.z=n,e.z2=n})}function bP(e,t){bL(t).updateCommon(e,t),b_(e,t)}function bL(e){return b3[e.__brushOption.brushType]}function bN(e,t,n){var r,i=e._panels;if(!i)return!0;var o=e._transform;return(0,md.__)(i,function(e){e.isTargetByCursor(t,n,o)&&(r=e)}),r}function bB(e,t){var n=e._panels;if(!n)return!0;var r=t.__brushOption.panelId;return null==r||n[r]}function bF(e){var t=e._covers,n=t.length;return(0,md.__)(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function bj(e,t){var n=(0,md.Tj)(e._covers,function(e){var t=e.__brushOption,n=(0,md.o8)(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function bz(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function bV(e,t,n,r){var i=new mS.A;return i.add(new mM.A({name:"main",style:bG(n),silent:!0,draggable:!0,cursor:"move",drift:(0,md.cF)(bY,e,t,i,["n","s","w","e"]),ondragend:(0,md.cF)(bj,t,{isEnd:!0})})),(0,md.__)(r,function(n){i.add(new mM.A({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:(0,md.cF)(bY,e,t,i,n),ondragend:(0,md.cF)(bj,t,{isEnd:!0})}))}),i}function bH(e,t,n,r){var i=r.brushStyle.lineWidth||0,o=bS(i,6),s=n[0][0],a=n[1][0],l=s-i/2,u=a-i/2,c=n[0][1],h=n[1][1],d=c-o+i/2,f=h-o+i/2,p=c-s,g=h-a,m=p+i,v=g+i;bW(e,t,"main",s,a,p,g),r.transformable&&(bW(e,t,"w",l,u,o,v),bW(e,t,"e",d,u,o,v),bW(e,t,"n",l,u,m,o),bW(e,t,"s",l,f,m,o),bW(e,t,"nw",l,u,o,o),bW(e,t,"ne",d,u,o,o),bW(e,t,"sw",l,f,o,o),bW(e,t,"se",d,f,o,o))}function b$(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(bG(n)),i.attr({silent:!r,cursor:r?"move":"default"}),(0,md.__)([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var i,o,s,a=t.childOfName(n.join("")),l=1===n.length?bq(e,n[0]):(("e"===(s=[bq(i=e,(o=n)[0]),bq(i,o[1])])[0]||"w"===s[0])&&s.reverse(),s.join(""));a&&a.attr({silent:!r,invisible:!r,cursor:r?bk[l]+"-resize":null})})}function bW(e,t,n,r,i,o,s){var a,l,u,c=t.childOfName(n);c&&c.setShape((l=bw((a=bX(e,t,[[r,i],[r+o,i+s]]))[0][0],a[1][0]),{x:l,y:u=bw(a[0][1],a[1][1]),width:bS(a[0][0],a[1][0])-l,height:bS(a[0][1],a[1][1])-u}))}function bG(e){return(0,md.NT)({strokeNoScale:!0},e.brushStyle)}function bU(e,t,n,r){var i=[bw(e,n),bw(t,r)],o=[bS(e,n),bS(t,r)];return[[i[0],o[0]],[i[1],o[1]]]}function bq(e,t){return({left:"w",right:"e",top:"n",bottom:"s"})[mC.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],mC.getTransform(e.group))]}function bY(e,t,n,r,i,o){var s=n.__brushOption,a=e.toRectRange(s.range),l=bK(t,i,o);(0,md.__)(r,function(e){var t=bM[e];a[t[0]][t[1]]+=l[t[0]]}),s.range=e.fromRectRange(bU(a[0][0],a[1][0],a[0][1],a[1][1])),bP(t,n),bj(t,{isEnd:!1})}function bZ(e,t,n,r){var i=t.__brushOption.range,o=bK(e,n,r);(0,md.__)(i,function(e){e[0]+=o[0],e[1]+=o[1]}),bP(e,t),bj(e,{isEnd:!1})}function bK(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function bX(e,t,n){var r=bB(e,t);return r&&!0!==r?r.clipPath(n,e._transform):(0,md.o8)(n)}function bJ(e){var t=e.event;t.preventDefault&&t.preventDefault()}function bQ(e,t,n){return e.childOfName("main").contain(t,n)}function b0(e,t,n,r){var i,o=e._creatingCover,s=e._creatingPanel,a=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],o=n[1]-r[1];return bC(i*i+o*o,.5)>6}(e)||o){if(s&&!o){"single"===a.brushMode&&bF(e);var l=(0,md.o8)(a);l.brushType=b1(l.brushType,s),l.panelId=!0===s?null:s.panelId,o=e._creatingCover=bO(e,l),e._covers.push(o)}if(o){var u=b3[b1(e._brushType,s)];o.__brushOption.range=u.getCreatingRange(bX(e,o,e._track)),r&&(bE(e,o),u.updateCommon(e,o)),b_(e,o),i={isEnd:r}}}else r&&"single"===a.brushMode&&a.removeOnClick&&bN(e,t,n)&&bF(e)&&(i={isEnd:r,removeOnClick:!0});return i}function b1(e,t){return"auto"===e?t.defaultBrushType:e}var b2={mousedown:function(e){if(this._dragging)b5(this,e);else if(!e.target||!e.target.draggable){bJ(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=bN(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(!function(e,t,n){if(!(!e._brushType||(r=e,i=t.offsetX,o=t.offsetY,s=r._zr,i<0||i>s.getWidth()||o<0||o>s.getHeight()))){var r,i,o,s,a=e._zr,l=e._covers,u=bN(e,t,n);if(!e._dragging)for(var c=0;c<l.length;c++){var h=l[c].__brushOption;if(u&&(!0===u||h.panelId===u.panelId)&&b3[h.brushType].contain(l[c],n[0],n[1]))return}u&&a.setCursorStyle("crosshair")}}(this,e,r),this._dragging){bJ(e);var i=b0(this,e,r,!1);i&&bj(this,i)}},mouseup:function(e){b5(this,e)}};function b5(e,t){if(e._dragging){bJ(t);var n=t.offsetX,r=t.offsetY,i=e.group.transformCoordToLocal(n,r),o=b0(e,t,i,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&bj(e,o)}}var b3={lineX:b4(0),lineY:b4(1),rect:{createCover:function(e,t){function n(e){return e}return bV({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=bz(e);return bU(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){bH(e,t,n,r)},updateCommon:b$,contain:bQ},polygon:{createCover:function(e,t){var n=new mS.A;return n.add(new vv.A({name:"main",style:bG(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new xO.A({name:"main",draggable:!0,drift:(0,md.cF)(bZ,e,t),ondragend:(0,md.cF)(bj,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:bX(e,t,n)})},updateCommon:b$,contain:bQ}};function b4(e){return{createCover:function(t,n){return bV({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=bz(t);return[bw(n[0][e],n[1][e]),bS(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var o,s=bB(t,n);if(!0!==s&&s.getLinearBrushOtherExtent)o=s.getLinearBrushOtherExtent(e);else{var a=t._zr;o=[0,[a.getWidth(),a.getHeight()][1-e]]}var l=[r,o];e&&l.reverse(),bH(t,n,l,i)},updateCommon:b$,contain:bQ}}var b6={axisPointer:1,tooltip:1,brush:1};function b8(e){return vG.A.create(e)}var b9=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],b7=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=wt(t,e);(0,md.__)(wn,function(e,t){(!n||!n.include||(0,md.qh)(n.include,t)>=0)&&e(i,r._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var r=wo[e.brushType](0,n,t);e.__rangeOffset={offset:wa[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){(0,md.__)(e,function(e){var r=this.findTargetInfo(e,t);r&&!0!==r&&(0,md.__)(r.coordSyses,function(r){var i=wo[e.brushType](1,r,e.range,!0);n(e,i.values,r,t)})},this)},e.prototype.setInputRanges=function(e,t){(0,md.__)(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var r,i,o,s,a,l=wo[e.brushType](0,n.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?wa[e.brushType](l.values,u.offset,(r=l.xyMinMax,i=u.xyMinMax,o=wu(r),s=wu(i),isNaN((a=[o[0]/s[0],o[1]/s[1]])[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}},this)},e.prototype.makePanelOpts=function(e,t){return(0,md.Tj)(this._targetInfoList,function(n){var r,i,o,s,a=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:(r=b8(r=a),function(e){return mC.clipPointsByRect(e,r)}),isTargetByCursor:(i=n.coordSysModel,o=b8(a),function(t,n){var r,s;return o.contain(n[0],n[1])&&(s=(r=e.getComponentByElement(t.topTarget))&&r.coordinateSystem,!r||r===i||!!b6.hasOwnProperty(r.mainType)||!s||s.model===i)}),getLinearBrushOtherExtent:(s=b8(s=a),function(e){var t=e?s.width:s.height,n=e?s.x:s.y;return[n,n+(t||0)]})}})},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return!0===r||r&&(0,md.qh)(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=wt(t,e),i=0;i<n.length;i++){var o=n[i],s=e.panelId;if(s){if(o.panelId===s)return o}else for(var a=0;a<wr.length;a++)if(wr[a](r,o))return o}return!0},e}();function we(e){return e[0]>e[1]&&e.reverse(),e}function wt(e,t){return(0,vB._e)(e,t,{includeMainTypes:b9})}var wn={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,o=(0,md.nt)(),s={},a={};(n||r||i)&&((0,md.__)(n,function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0}),(0,md.__)(r,function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0}),(0,md.__)(i,function(e){o.set(e.id,e),s[e.id]=!0,a[e.id]=!0}),o.each(function(e){var i=e.coordinateSystem,o=[];(0,md.__)(i.getCartesians(),function(e,t){((0,md.qh)(n,e.getAxis("x").model)>=0||(0,md.qh)(r,e.getAxis("y").model)>=0)&&o.push(e)}),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:wi.grid,xAxisDeclared:s[e.id],yAxisDeclared:a[e.id]})}))},geo:function(e,t){(0,md.__)(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:wi.geo})})}},wr=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],wi={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(mC.getTransform(e)),t}},wo={lineX:(0,md.cF)(ws,0),lineY:(0,md.cF)(ws,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),o=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),s=[we([i[0],o[0]]),we([i[1],o[1]])];return{values:s,xyMinMax:s}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:(0,md.Tj)(n,function(n){var o=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o}),xyMinMax:i}}};function ws(e,t,n,r){var i=n.getAxis(["x","y"][e]),o=we((0,md.Tj)([0,1],function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))})),s=[];return s[e]=o,s[1-e]=[NaN,NaN],{values:o,xyMinMax:s}}var wa={lineX:(0,md.cF)(wl,0),lineY:(0,md.cF)(wl,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return(0,md.Tj)(e,function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]})}};function wl(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function wu(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var wc=n(20020),wh=md.__,wd=(0,vB.S_)("toolbox-dataZoom_"),wf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,mg.C6)(t,e),t.prototype.render=function(e,t,n,r){var i,o,s,a,l,u,c,h,d;this._brushController||(this._brushController=new bD(n.getZr()),this._brushController.on("brush",md.oI(this._onBrush,this)).mount()),i=e,o=t,s=this,a=r,l=n,u=s._isZoomActive,a&&"takeGlobalCursor"===a.type&&(u="dataZoomSelect"===a.key&&a.dataZoomSelectActive),s._isZoomActive=u,i.setIconStatus("zoom",u?"emphasis":"normal"),c=new b7(wg(i),o,{include:["grid"]}).makePanelOpts(l,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}),s._brushController.setPanels(c).enableBrush(!!u&&!!c.length&&{brushType:"auto",brushStyle:i.getModel("brushStyle").getItemStyle()}),h=e,d=t,h.setIconStatus("back",bx(d).length>1?"emphasis":"normal")},t.prototype.onclick=function(e,t,n){wp[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n,r,i,o={},s=this.ecModel;this._brushController.updateCovers([]),new b7(wg(this.model),s,{include:["grid"]}).matchOutputRanges(t,s,function(e,t,n){if("cartesian2d"===n.type){var r=e.brushType;"rect"===r?(a("x",n,t[0]),a("y",n,t[1])):a({lineX:"x",lineY:"y"}[r],n,t)}}),n=s,r=o,i=bx(n),bv(r,function(e,t){for(var r=i.length-1;r>=0&&!i[r][t];r--);if(r<0){var o=n.queryComponents({mainType:"dataZoom",subType:"select",id:t})[0];if(o){var s=o.getPercentRange();i[0][t]={dataZoomId:t,start:s[0],end:s[1]}}}}),i.push(r),this._dispatchZoomAction(o)}function a(e,t,n){var r,i,a,l=t.getAxis(e),u=l.model,c=(r=e,i=u,s.eachComponent({mainType:"dataZoom",subType:"select"},function(e){e.getAxisModel(r,i.componentIndex)&&(a=e)}),a),h=c.findRepresentativeAxisProxy(u).getMinMaxSpan();(null!=h.minValueSpan||null!=h.maxValueSpan)&&(n=xe(0,n.slice(),l.scale.getExtent(),0,h.minValueSpan,h.maxValueSpan)),c&&(o[c.id]={dataZoomId:c.id,startValue:n[0],endValue:n[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];wh(e,function(e,n){t.push(md.o8(e))}),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(br),wp={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){var e,t,n;this._dispatchZoomAction((t=(e=bx(this.ecModel))[e.length-1],e.length>1&&e.pop(),n={},bv(t,function(t,r){for(var i=e.length-1;i>=0;i--)if(t=e[i][r]){n[r]=t;break}}),n))}};function wg(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}(0,wc.S)("dataZoom",function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var r=t.getModel(n),i=[],o=wg(r),s=(0,vB._e)(e,o);return wh(s.xAxisModels,function(e){return a(e,"xAxis","xAxisIndex")}),wh(s.yAxisModels,function(e){return a(e,"yAxis","yAxisIndex")}),i}function a(e,t,n){var o=e.componentIndex,s={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:wd+t+o};s[n]=o,i.push(s)}});var wm=n(55875),wv={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};let wy=function(e,t,n){var r=md.o8((wv[e]||{})[t]);return n&&md.cy(r)?r[r.length-1]:r};var wx=md.__,wb=md.Gv,ww=function(){function e(t){var n,r,i=t.mappingMethod,o=t.type,s=this.option=md.o8(t);this.type=o,this.mappingMethod=i,this._normalizeData=wE[i];var a=e.visualHandlers[o];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[i],"piecewise"===i?(wS(s),r=(n=s).pieceList,n.hasSpecialVisual=!1,md.__(r,function(e,t){e.originIndex=t,null!=e.visual&&(n.hasSpecialVisual=!0)})):"category"===i?s.categories?function(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(wx(t,function(e,t){n[e]=t}),!md.cy(r)){var i=[];md.Gv(r)?wx(r,function(e,t){var r=n[t];i[null!=r?r:-1]=e}):i[-1]=r,r=wO(e,i)}for(var o=t.length-1;o>=0;o--)null==r[o]&&(delete n[t[o]],t.pop())}(s):wS(s,!0):(md.vA("linear"!==i||s.dataExtent),wS(s))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return md.oI(this._normalizeData,this)},e.listVisualTypes=function(){return md.HP(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){md.Gv(e)?md.__(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,o=md.cy(t)?[]:md.Gv(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var s=n.call(r,e,t);i?o=s:o[t]=s}),o},e.retrieveVisuals=function(t){var n,r={};return t&&wx(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(r[i]=t[i],n=!0)}),n?r:null},e.prepareVisualTypes=function(e){if(md.cy(e))e=e.slice();else{if(!wb(e))return[];var t=[];wx(e,function(e,n){t.push(n)}),e=t}return e.sort(function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1}),e},e.dependsOn=function(e,t){return"color"===t?!!(e&&0===e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,o=0,s=t.length;o<s;o++){var a=t[o].value;if(null!=a){if(a===e||md.Kg(a)&&a===e+"")return o;n&&C(a,o)}}for(var o=0,s=t.length;o<s;o++){var l,u,c,h,d,f,p,g,m,v,y,x,b=t[o],w=b.interval,S=b.close;if(w){if(w[0]===-1/0){if(l=S[1],u=e,c=w[1],l?u<=c:u<c)return o}else if(w[1]===1/0){if(h=S[0],d=w[0],f=e,h?d<=f:d<f)return o}else{if(p=S[0],g=w[0],m=e,(p?g<=m:g<m)&&(v=S[1],y=e,x=w[1],v?y<=x:y<x))return o}n&&C(w[0],o),n&&C(w[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function C(t,n){var o=Math.abs(t-e);o<i&&(i=o,r=n)}},e.visualHandlers={color:{applyVisual:wM("color"),getColorMapper:function(){var e=this.option;return md.oI("category"===e.mappingMethod?function(e,t){return t||(e=this._normalizeData(e)),wk.call(this,e)}:function(t,n,r){var i=!!r;return n||(t=this._normalizeData(t)),r=xV.ad(t,e.parsedVisual,r),i?r:xV.As(r,"rgba")},this)},_normalizedToVisual:{linear:function(e){return xV.As(xV.ad(e,this.option.parsedVisual),"rgba")},category:wk,piecewise:function(e,t){var n=wD.call(this,t);return null==n&&(n=xV.As(xV.ad(e,this.option.parsedVisual),"rgba")),n},fixed:wT}},colorHue:wC(function(e,t){return xV.Yu(e,t)}),colorSaturation:wC(function(e,t){return xV.Yu(e,null,t)}),colorLightness:wC(function(e,t){return xV.Yu(e,null,null,t)}),colorAlpha:wC(function(e,t){return xV.hm(e,t)}),decal:{applyVisual:wM("decal"),_normalizedToVisual:{linear:null,category:wk,piecewise:null,fixed:null}},opacity:{applyVisual:wM("opacity"),_normalizedToVisual:wI([0,1])},liftZ:{applyVisual:wM("liftZ"),_normalizedToVisual:{linear:wT,category:wT,piecewise:wT,fixed:wT}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:wA,category:wk,piecewise:function(e,t){var n=wD.call(this,t);return null==n&&(n=wA.call(this,e)),n},fixed:wT}},symbolSize:{applyVisual:wM("symbolSize"),_normalizedToVisual:wI([0,1])}},e}();function wS(e,t){var n=e.visual,r=[];md.Gv(n)?wx(n,function(e){r.push(e)}):null!=n&&r.push(n),t||1!==r.length||({color:1,symbol:1}).hasOwnProperty(e.type)||(r[1]=r[0]),wO(e,r)}function wC(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r("color",e(n("color"),i))},_normalizedToVisual:wI([0,1])}}function wA(e){var t=this.option.visual;return t[Math.round((0,ve.Cb)(e,[0,1],[0,t.length-1],!0))]||{}}function wM(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function wk(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function wT(){return this.option.visual[0]}function wI(e){return{linear:function(t){return(0,ve.Cb)(t,e,this.option.visual,!0)},category:wk,piecewise:function(t,n){var r=wD.call(this,n);return null==r&&(r=(0,ve.Cb)(t,e,this.option.visual,!0)),r},fixed:wT}}function wD(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=ww.findPieceIndex(e,n),i=n[r];if(i&&i.visual)return i.visual[this.type]}}function wO(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=md.Tj(t,function(e){return xV.qg(e)||[0,0,0,1]})),t}var wE={linear:function(e){return(0,ve.Cb)(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=ww.findPieceIndex(e,t,!0);if(null!=n)return(0,ve.Cb)(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?-1:t},fixed:md.lQ},w_=n(80153),wR=md.__;function wP(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function wL(e,t,n){var r={};return wR(t,function(t){var i,o=r[t]=((i=function(){}).prototype.__hidden=i.prototype,new i);wR(e[t],function(e,r){if(ww.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),o[r]=new ww(i),"opacity"===r&&((i=md.o8(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new ww(i))}})}),r}var wN=ww.mapVisual,wB=ww.eachVisual,wF=md.cy,wj=md.__,wz=ve.Y6,wV=ve.Cb,wH=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return(0,mg.C6)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n,r,i=this.option;t||(n=this.replacableOptionKeys,md.__(n,function(t){e.hasOwnProperty(t)&&wP(e[t])&&(r=!0)}),r&&md.__(n,function(t){e.hasOwnProperty(t)&&wP(e[t])?i[t]=md.o8(e[t]):delete i[t]})),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=md.oI(e,this),this.controllerVisuals=wL(this.option.controller,t,e),this.targetVisuals=wL(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries(function(e,n){t.push(n)}):t=vB.qB(e),t},t.prototype.eachTargetSeries=function(e,t){md.__(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r,i=this.option,o=i.precision,s=this.dataBound,a=i.formatter;n=n||["<",">"],md.cy(e)&&(e=e.slice(),r=!0);var l=t?e:r?[u(e[0]),u(e[1])]:u(e);if(md.Kg(a))return a.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l);if(md.Tn(a))return r?a(e[0],e[1]):a(e);if(!r)return l;if(e[0]===s[0])return n[0]+" "+l[1];if(e[1]===s[1])return n[1]+" "+l[0];return l[0]+" - "+l[1];function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=wz([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],o=e.getDimensionInfo(i);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||(t.target={}),i=t.controller||(t.controller={});md.h1(r,n),md.h1(i,n);var o=this.isCategory();function s(n){wF(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}s.call(this,r),s.call(this,i),(function(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},wj(r,function(e,t){if(ww.isValidType(t)){var n=wy(t,"inactive",o);null!=n&&(i[t]=n,"color"!==t||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}}))}).call(this,r,"inRange","outOfRange"),(function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";wj(this.stateList,function(s){var a=this.itemSize,l=e[s];l||(l=e[s]={color:o?r:[r]}),null==l.symbol&&(l.symbol=t&&md.o8(t)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&md.o8(n)||(o?a[0]:[a[0],a[0]])),l.symbol=wN(l.symbol,function(e){return"none"===e?i:e});var u=l.symbolSize;if(null!=u){var c=-1/0;wB(u,function(e){e>c&&(c=e)}),l.symbolSize=wN(u,function(e){return wV(e,[0,c],[0,a[0]],!0)})}},this)}).call(this,i)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(yQ.A),w$=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=20),(null==t[1]||isNaN(t[1]))&&(t[1]=140)},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):md.cy(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),md.__(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=ve.Y6((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=wW(this,"outOfRange",this.getExtent()),n=wW(this,"inRange",this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var o=0,s=0,a=n.length,l=t.length;s<l&&(!n.length||t[s]<=n[0]);s++)t[s]<n[o]&&i(t[s],"outOfRange");for(var u=1;o<a;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(var u=1;s<l;s++)(!n.length||n[n.length-1]<t[s])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(t[s],"outOfRange"));var c=r.length;return{stops:r,outerColors:[c?r[0].color:"transparent",c?r[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=(0,mx.G_)(wH.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(wH);function wW(e,t,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],s=0;s<=200&&i<n[1];s++)o.push(i),i+=r;return o.push(n[1]),o}var wG=n(87142),wU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return(0,mg.C6)(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){(this.visualMapModel=e,!1===e.get("show"))?this.group.removeAll():this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=xH.QX(t.get("padding")||0),r=e.getBoundingRect();e.add(new mM.A({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var r=(n=n||{}).forceState,i=this.visualMapModel,o={};function s(e){return o[e]}function a(e,t){o[e]=t}"color"===t&&(o.color=i.get("contentColor"));var l=i.controllerVisuals[r||i.getValueState(e)],u=ww.prepareVisualTypes(l);return md.__(u,function(r){var i=l[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=l.__alphaForOpacity),ww.dependsOn(r,t)&&i&&i.applyVisual(e,s,a)}),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;vh.m$(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,r){},t.type="visualMap",t}(y9.A),wq=[["left","right","width"],["top","bottom","height"]];function wY(e,t,n){var r=e.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:t.getWidth(),height:t.getHeight()},s=+("horizontal"===r.orient),a=wq[s],l=[0,null,10],u={},c=0;c<3;c++)u[wq[1-s][c]]=l[c],u[a[c]]=2===c?n[0]:r[a[c]];var h=[["x","width",3],["y","height",0]][s],d=(0,vh.dV)(u,o,r.padding);return a[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function wZ(e,t){return md.__(e||[],function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")}),e}var wK=n(26889),wX=ve.Cb,wJ=md.__,wQ=Math.min,w0=Math.max,w1=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return(0,mg.C6)(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=md.oI(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=md.oI(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){r&&"selectDataRange"===r.type&&r.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),s=i.itemSize,a=this._shapes.mainGroup,l=this._applyTransform([s[0]/2,0===n?-o:s[1]+o],a),u=this._applyTransform(0===n?"bottom":"top",a),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new m7.Ay({style:(0,mD.VB)(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,o=this._useHandle,s=wY(t,this.api,r),a=n.mainGroup=this._createBarGroup(s),l=new mS.A;a.add(l),l.add(n.outOfRange=w2()),l.add(n.inRange=w2(null,o?w3(this._orient):null,md.oI(this._dragHandle,this,"all",!1),md.oI(this._dragHandle,this,"all",!0))),l.setClipPath(new mM.A({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=w0(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,a,0,r,c,i),this._createHandle(t,a,1,r,c,i)),this._createIndicator(t,a,r,c,i),e.add(a)},t.prototype._createHandle=function(e,t,n,r,i,o){var s=md.oI(this._dragHandle,this,n,!1),a=md.oI(this._dragHandle,this,n,!0),l=(0,mB.lo)(e.get("handleSize"),r[0]),u=(0,vt.v5)(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=w3(this._orient);u.attr({cursor:c,draggable:!0,drift:s,ondragend:a,onmousemove:function(e){xi.ds(e.event)}}),u.x=r[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),(0,mI.ix)(u,!0),t.add(u);var h=this.visualMapModel.textStyleModel,d=new m7.Ay({cursor:c,draggable:!0,drift:s,onmousemove:function(e){xi.ds(e.event)},ondragend:a,style:(0,mD.VB)(h,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var f=[l,0],p=this._shapes;p.handleThumbs[n]=u,p.handleLabelPoints[n]=f,p.handleLabels[n]=d},t.prototype._createIndicator=function(e,t,n,r,i){var o=(0,mB.lo)(e.get("indicatorSize"),n[0]),s=(0,vt.v5)(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);s.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var a=e.getModel("indicatorStyle").getItemStyle();if(s instanceof vn.Ay){var l=s.style;s.useStyle(md.X$({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},a))}else s.useStyle(a);t.add(s);var u=this.visualMapModel.textStyleModel,c=new m7.Ay({silent:!0,invisible:!0,style:(0,mD.VB)(u,{x:0,y:0,text:""})});this.group.add(c);var h=[("horizontal"===i?r/2:6)+n[0]/2,0],d=this._shapes;d.indicator=s,d.indicatorLabel=c,d.indicatorLabelPoint=h,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}!this.visualMapModel.get("realtime")===t&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?this._hovering||this._clearHoverLinkToSeries():w5(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[wX(t[0],n,r,!0),wX(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];xe(t,r,i,e,0);var o=n.getExtent();this._dataInterval=[wX(r[0],i,o,!0),wX(r[1],i,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],o=e?i:this._handleEnds,s=this._createBarVisual(this._dataInterval,n,o,"inRange"),a=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),r.outOfRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),this._updateHandle(o,s)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,i),s=[this.getControllerVisual(e[0],"symbolSize",i),this.getControllerVisual(e[1],"symbolSize",i)],a=this._createBarPoints(n,s);return{barColor:new wG.A(0,0,0,1,o),barPoints:a,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],r=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var i=1;i<100;i++){var o=e[0]+r*i;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:i/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new mS.A("horizontal"===t&&!n?{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2}:"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"===t&&!n?{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"left"===e?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,s=r.itemSize,a=r.getExtent();wJ([0,1],function(l){var u=i[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=wX(e[l],[0,s[1]],a,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/s[0],u.x=s[0]-h/2;var d=mC.applyTransform(n.handleLabelPoints[l],mC.getTransform(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,o=i.getExtent(),s=i.itemSize,a=[0,s[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),d=wX(e,o,a,!0),f=s[0]-h/2,p={x:u.x,y:u.y};u.y=d,u.x=f;var g=mC.applyTransform(l.indicatorLabelPoint,mC.getTransform(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+i.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var x={x:f,y:d,style:{fill:c}},b={style:{x:g[0],y:g[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var w={duration:100,easing:"cubicInOut",additive:!0};u.x=p.x,u.y=p.y,u.animateTo(x,w),m.animateTo(b,w)}else u.attr(x),m.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;C<S.length;C++)this.api.enterBlur(S[C])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=wQ(w0(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}}).on("mouseout",function(){e._hovering=!1,e._dragging||e._clearHoverLinkToSeries()})},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i,o,s,a,l,u=[0,r[1]],c=n.getExtent();e=wQ(w0(u[0],e),u[1]);var h=(i=n,o=c,s=u,a=6,(l=i.get("hoverLinkDataSize"))&&(a=wX(l,o,s,!0)/2),a),d=[e-h,e+h],f=wX(e,u,c,!0),p=[wX(d[0],u,c,!0),wX(d[1],u,c,!0)];d[0]<u[0]&&(p[0]=-1/0),d[1]>u[1]&&(p[1]=1/0),t&&(p[0]===-1/0?this._showIndicator(f,p[1],"< ",h):p[1]===1/0?this._showIndicator(f,p[0],"> ",h):this._showIndicator(f,f,"≈ ",h));var g=this._hoverLinkDataIndices,m=[];(t||w5(n))&&(m=this._hoverLinkDataIndices=n.findTargetDataIndices(p));var v=vB.D6(g,m);this._dispatchHighDown("downplay",wZ(v[0],n)),this._dispatchHighDown("highlight",wZ(v[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){if((0,wK.R)(e.target,function(e){var n=(0,mT.z)(e);if(null!=n.dataIndex)return t=n,!0},!0),t){var t,n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",wZ(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=mC.getTransform(t,r?null:this.group);return md.cy(e)?mC.applyTransform(e,i,n):mC.transformDirection(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(wU);function w2(e,t,n,r){return new xO.A({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){xi.ds(e.event)},ondragend:r})}function w5(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function w3(e){return"vertical"===e?"ns-resize":"ew-resize"}var w4={type:"selectDataRange",event:"dataRangeSelected",update:"update"},w6=function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})},w8=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",function(t){var r,i,o,s,a,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((r=t.stateList,i=t.targetVisuals,o=md.oI(t.getValueState,t),s=t.getDataDimensionIndex(e.getData()),a={},md.__(r,function(e){var t=ww.prepareVisualTypes(i[e]);a[e]=t}),{progress:function(e,t){function n(e){return(0,w_.Ez)(t,u,e)}function r(e,n){(0,w_.oZ)(t,u,e,n)}null!=s&&(l=t.getDimensionIndex(s));for(var l,u,c=t.getStore();null!=(u=e.next());){var h=t.getRawDataItem(u);if(!h||!1!==h.visualMap)for(var d=null!=s?c.get(l,u):u,f=o(d),p=i[f],g=a[f],m=0,v=g.length;m<v;m++){var y=g[m];p[y]&&p[y].applyVisual(d,n,r)}}}}))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(md.oI(w9,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}}),e.getData().setVisual("visualMeta",r)}}];function w9(e,t,n,r){for(var i=t.targetVisuals[r],o=ww.prepareVisualTypes(i),s={color:(0,w_.rI)(e.getData(),"color")},a=0,l=o.length;a<l;a++){var u=o[a],c=i["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,d)}return s.color;function h(e){return s[e]}function d(e,t){s[e]=t}}var w7=md.__;function Se(e){var t=e&&e.visualMap;md.cy(t)||(t=t?[t]:[]),w7(t,function(e){if(e){St(e,"splitList")&&!St(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&md.cy(t)&&w7(t,function(e){md.Gv(e)&&(St(e,"start")&&!St(e,"min")&&(e.min=e.start),St(e,"end")&&!St(e,"max")&&(e.max=e.end))})}})}function St(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var Sn=!1;function Sr(e){Sn||(Sn=!0,e.registerSubTypeDefaulter("visualMap",function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}),e.registerAction(w4,w6),(0,md.__)(w8,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(Se))}function Si(e){e.registerComponentModel(w$),e.registerComponentView(w1),Sr(e)}var So=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return(0,mg.C6)(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],Ss[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){"categories"===r?(e.mappingMethod="category",e.categories=md.o8(i)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=md.Tj(this._pieceList,function(e){return e=md.o8(e),"inRange"!==t&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=ww.listVisualTypes(),i=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}md.__(t.pieces,function(e){md.__(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),md.__(n,function(e,n){var r=!1;md.__(this.stateList,function(e){r=r||o(t,e,n)||o(t.target,e,n)},this),r||md.__(this.stateList,function(e){(t[e]||(t[e]={}))[n]=wy(n,"inRange"===e?"active":"inactive",i)})},this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,md.__(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),"single"===n.selectedMode){var o=!1;md.__(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(o?i[n]=!1:o=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=md.o8(e)},t.prototype.getValueState=function(e){var t=ww.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),function(t,r){ww.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var s=-1/0;return md.__(i,function(e){var t=e.interval;t&&(t[0]>s&&a([s,t[0]],"outOfRange"),a(t.slice()),s=t[1])},this),{stops:t,outerColors:n}}function a(i,o){var s=r.getRepresentValue({interval:i});o||(o=r.getValueState(s));var a=e(s,o);i[0]===-1/0?n[0]=a:i[1]===1/0?n[1]=a:t.push({value:i[0],color:a},{value:i[1],color:a})}},t.type="visualMap.piecewise",t.defaultOption=(0,mx.G_)(wH.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(wH),Ss={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;t.splitNumber=i=Math.max(parseInt(i,10),1);for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var s=0,a=r[0];s<i;a+=o,s++){var l=s===i-1?r[1]:a+o;e.push({interval:[a,l],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),(0,ve.sL)(e),md.__(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;md.__(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),Sa(t,e)},pieces:function(e){var t=this.option;md.__(t.pieces,function(t,n){md.Gv(t)||(t={value:t});var r={text:"",index:n};if(null!=t.label&&(r.text=t.label),t.hasOwnProperty("value")){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],s=r.close=[0,0],a=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var h=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&null==o[c];d++)o[c]=t[h[d]],s[c]=a[d],u[c]=2===d;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(s[0]=0),u[1]&&o[0]===-1/0&&(s[1]=0),o[0]===o[1]&&s[0]&&s[1]&&(r.value=o[0])}r.visual=ww.retrieveVisuals(t),e.push(r)},this),Sa(t,e),(0,ve.sL)(e),md.__(e,function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)},this)}};function Sa(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var Sl=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),r=t.textStyleModel,i=r.getFont(),o=r.getTextColor(),s=this._getItemAlign(),a=t.itemSize,l=this._getViewData(),u=l.endsText,c=md.Je(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],a,c,s),md.__(l.viewPieceList,function(r){var l=r.piece,u=new mS.A;u.onclick=md.oI(this._onItemClick,this,l),this._enableHoverLink(u,r.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,a[0],a[1]]),c){var d=this.visualMapModel.getValueState(h);u.add(new m7.Ay({style:{x:"right"===s?-n:a[0]+n,y:a[1]/2,text:l.text,verticalAlign:"middle",align:s,font:i,fill:o,opacity:"outOfRange"===d?.5:1}}))}e.add(u)},this),u&&this._renderEndsText(e,u[1],a,c,s),vh.aP(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",function(){return r("highlight")}).on("mouseout",function(){return r("downplay")});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:wZ(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return wY(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var o=new mS.A,s=this.visualMapModel.textStyleModel;o.add(new m7.Ay({style:(0,mD.VB)(s,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=md.Tj(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get("text"),r=e.get("orient"),i=e.get("inverse");return("horizontal"===r?i:!i)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add((0,vt.v5)(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=md.o8(n.selected),o=t.getSelectedMapKey(e);"single"===r||!0===r?(i[o]=!0,md.__(i,function(e,t){i[t]=t===o})):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type="visualMap.piecewise",t}(wU);function Su(e){e.registerComponentModel(So),e.registerComponentView(Sl),Sr(e)}function Sc(e,t){if(!e)return!1;for(var n=(0,md.cy)(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}var Sh=n(42345),Sd=n(56803);function Sf(e){(0,vB.M5)(e,"label",["show"])}var Sp=(0,vB.$r)(),Sg=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return(0,mg.C6)(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(ba.A.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),o=Sp(e)[i];if(!n||!n.data){Sp(e)[i]=null;return}o?o._mergeOption(n,t,!0):(r&&Sf(n),md.__(n.data,function(e){e instanceof Array?(Sf(e[0]),Sf(e[1])):Sf(e)}),o=this.createMarkerModelFromSeries(n,this,t),md.X$(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),Sp(e)[i]=o},this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),o=r.getName(e);return(0,Sd.Qx)("section",{header:this.name,blocks:[(0,Sd.Qx)("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return Sp(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(yQ.A);md.co(Sg,Sh.J.prototype);var Sm=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(Sg),Sv=n(41402),Sy=n(47163);function Sx(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function Sb(e,t,n,r,i,o){var s=[],a=(0,Sv.sJ)(t,r)?t.getCalculationInfo("stackResultDimension"):r,l=Sk(t,a,e),u=t.indicesOfNearest(a,l)[0];s[i]=t.get(n,u),s[o]=t.get(a,u);var c=t.get(r,u),h=ve.XV(t.get(r,u));return(h=Math.min(h,20))>=0&&(s[o]=+s[o].toFixed(h)),[s,c]}var Sw={min:(0,md.cF)(Sb,"min"),max:(0,md.cF)(Sb,"max"),average:(0,md.cF)(Sb,"average"),median:(0,md.cF)(Sb,"median")};function SS(e,t){if(t){var n,r=e.getData(),i=e.coordinateSystem,o=i&&i.dimensions;if(!(!isNaN(parseFloat((n=t).x))&&!isNaN(parseFloat(n.y)))&&!(0,md.cy)(t.coord)&&(0,md.cy)(o)){var s=SC(t,r,i,e);if((t=(0,md.o8)(t)).type&&Sw[t.type]&&s.baseAxis&&s.valueAxis){var a=(0,md.qh)(o,s.baseAxis.dim),l=(0,md.qh)(o,s.valueAxis.dim),u=Sw[t.type](r,s.baseDataDim,s.valueDataDim,a,l);t.coord=u[0],t.value=u[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&(0,md.cy)(o))for(var c=t.coord,h=0;h<2;h++)Sw[c[h]]&&(c[h]=Sk(r,r.mapDimension(o[h]),c[h]));else t.coord=[];return t}}function SC(e,t,n,r){var i,o,s,a={};return null!=e.valueIndex||null!=e.valueDim?(a.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,a.valueAxis=n.getAxis((i=r,o=a.valueDataDim,(s=i.getData().getDimensionInfo(o))&&s.coordDim)),a.baseAxis=n.getOtherAxis(a.valueAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim)):(a.baseAxis=r.getBaseAxis(),a.valueAxis=n.getOtherAxis(a.baseAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim),a.valueDataDim=t.mapDimension(a.valueAxis.dim)),a}function SA(e,t){return!e||!e.containData||!t.coord||!!Sx(t)||e.containData(t.coord)}function SM(e,t){return e?function(e,n,r,i){var o=i<2?e.coord&&e.coord[i]:e.value;return(0,Sy.Pn)(o,t[i])}:function(e,n,r,i){return(0,Sy.Pn)(e.value,t[i])}}function Sk(e,t,n){if("average"===n){var r=0,i=0;return e.each(t,function(e,t){!isNaN(e)&&(r+=e,i++)}),r/i}return"median"===n?e.getMedian(t):e.getDataExtent(t)[+("max"===n)]}var ST=(0,vB.$r)(),SI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.init=function(){this.markerGroupMap=(0,md.nt)()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){ST(e).keep=!1}),t.eachSeries(function(e){var i=Sg.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){ST(e).keep||r.group.remove(e.group)})},t.prototype.markKeep=function(e){ST(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;(0,md.__)(e,function(e){var r=Sg.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?(0,mI.QX)(e):(0,mI.JC)(e))})})},t.type="marker",t}(y9.A),SD=(0,vB.$r)(),SO=function(e,t,n,r){var i=r[0],o=r[1];if(i&&o){var s=SS(e,i),a=SS(e,o),l=s.coord,u=a.coord;l[0]=(0,md.Je)(l[0],-1/0),l[1]=(0,md.Je)(l[1],-1/0),u[0]=(0,md.Je)(u[0],1/0),u[1]=(0,md.Je)(u[1],1/0);var c=(0,md.Um)([{},s,a]);return c.coord=[s.coord,a.coord],c.x0=s.x,c.y0=s.y,c.x1=a.x,c.y1=a.y,c}};function SE(e){return!isNaN(e)&&!isFinite(e)}function S_(e,t,n,r){var i=1-e;return SE(t[i])&&SE(n[i])}function SR(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},o={coord:r,x:t.x1,y:t.y1};if((0,mL.g)(e,"cartesian2d"))return!!(n&&r&&(S_(1,n,r,e)||S_(0,n,r,e)))||!e||!e.containZone||!i.coord||!o.coord||!!Sx(i)||!!Sx(o)||e.containZone(i.coord,o.coord);return SA(e,i)||SA(e,o)}function SP(e,t,n,r,i){var o,s=r.coordinateSystem,a=e.getItemModel(t),l=ve.lo(a.get(n[0]),i.getWidth()),u=ve.lo(a.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),d=s.clampData(c),f=s.clampData(h),p=[];"x0"===n[0]?p[0]=d[0]>f[0]?h[0]:c[0]:p[0]=d[0]>f[0]?c[0]:h[0],"y0"===n[1]?p[1]=d[1]>f[1]?h[1]:c[1]:p[1]=d[1]>f[1]?c[1]:h[1],o=r.getMarkerPosition(p,n,!0)}else{var g=e.get(n[0],t),m=e.get(n[1],t),v=[g,m];s.clampData&&s.clampData(v,v),o=s.dataToPoint(v,!0)}if((0,mL.g)(s,"cartesian2d")){var y=s.getAxis("x"),x=s.getAxis("y"),g=e.get(n[0],t),m=e.get(n[1],t);SE(g)?o[0]=y.toGlobalCoord(y.getExtent()[+("x0"!==n[0])]):SE(m)&&(o[1]=x.toGlobalCoord(x.getExtent()[+("y0"!==n[1])]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var SL=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],SN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Sg.getMarkerModelFromSeries(e,"markArea");if(t){var r=t.getData();r.each(function(t){var i=(0,md.Tj)(SL,function(i){return SP(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape("points",i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,o=e.id,s=e.getData(),a=this.markerGroupMap,l=a.get(o)||a.set(o,{group:new mS.A});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){if(e){var r,i,o=(0,md.Tj)(e&&e.dimensions,function(e){var n=t.getData(),r=n.getDimensionInfo(n.mapDimension(e))||{};return(0,md.X$)((0,md.X$)({},r),{name:e,ordinalMeta:null})});i=(0,md.Tj)(["x0","y0","x1","y1"],function(e,t){return{name:e,type:o[t%2].type}}),r=new va.A(i,n)}else i=[{name:"value",type:"float"}],r=new va.A(i,n);var s=(0,md.Tj)(n.get("data"),(0,md.cF)(SO,t,e,n));e&&(s=(0,md.pb)(s,(0,md.cF)(SR,e)));var a=e?function(e,t,n,r){var o=e.coord[Math.floor(r/2)][r%2];return(0,Sy.Pn)(o,i[r])}:function(e,t,n,r){return(0,Sy.Pn)(e.value,i[r])};return r.initData(s,null,a),r.hasItemOption=!0,r}(i,e,t);t.setData(u),u.each(function(t){var n=(0,md.Tj)(SL,function(n){return SP(u,t,n,e,r)}),o=i.getAxis("x").scale,a=i.getAxis("y").scale,l=o.getExtent(),c=a.getExtent(),h=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],d=[a.parse(u.get("y0",t)),a.parse(u.get("y1",t))];ve.Y6(h),ve.Y6(d);var f=!(l[0]>h[1]||l[1]<h[0]||c[0]>d[1]||c[1]<d[0]);u.setItemLayout(t,{points:n,allClipped:!f});var p=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=(0,w_.rI)(s,"color");!p.fill&&(p.fill=g,(0,md.Kg)(p.fill)&&(p.fill=xV.hm(p.fill,.4))),p.stroke||(p.stroke=g),u.setItemVisual(t,"style",p)}),u.diff(SD(l).data).add(function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new xO.A({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}}).update(function(e,n){var r=SD(l).data.getItemGraphicEl(n),i=u.getItemLayout(e);i.allClipped?r&&l.group.remove(r):(r?mA.oi(r,{shape:{points:i.points}},t,e):r=new xO.A({shape:{points:i.points}}),u.setItemGraphicEl(e,r),l.group.add(r))}).remove(function(e){var t=SD(l).data.getItemGraphicEl(e);l.group.remove(t)}).execute(),u.eachItemGraphicEl(function(e,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),(0,mD.qM)(e,(0,mD.lx)(r),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:(0,md.Kg)(i.fill)?xV.hm(i.fill,1):"#000"}),(0,mI.Mx)(e,r),(0,mI.Lm)(e,null,null,r.get(["emphasis","disabled"])),(0,mT.z)(e).dataModel=t}),SD(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(SI),SB=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(Sg),SF=n(95163),Sj=m9.A.prototype,Sz=SF.A.prototype,SV=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function SH(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}(0,mg.C6)(function(){return null!==SV&&SV.apply(this,arguments)||this},SV);var S$=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return(0,mg.C6)(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new SV},t.prototype.buildPath=function(e,t){SH(t)?Sj.buildPath.call(this,e,t):Sz.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return SH(this.shape)?Sj.pointAt.call(this,e):Sz.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=SH(t)?[t.x2-t.x1,t.y2-t.y1]:Sz.tangentAt.call(this,e);return vx.S8(n,n)},t}(mw.Ay),SW=["fromSymbol","toSymbol"];function SG(e){return"_"+e+"Type"}function SU(e,t,n){var r=t.getItemVisual(n,e);if(!r||"none"===r)return r;var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),s=t.getItemVisual(n,e+"Offset"),a=t.getItemVisual(n,e+"KeepAspect"),l=vt.xU(i),u=vt.hV(s||0,l);return r+l+u+(o||"")+(a||"")}function Sq(e,t,n){var r=t.getItemVisual(n,e);if(r&&"none"!==r){var i=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),s=t.getItemVisual(n,e+"Offset"),a=t.getItemVisual(n,e+"KeepAspect"),l=vt.xU(i),u=vt.hV(s||0,l),c=vt.v5(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,a);return c.__specifiedRotation=null==o||isNaN(o)?void 0:o*Math.PI/180||0,c.name=e,c}}function SY(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var SZ=function(e){function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return(0,mg.C6)(t,e),t.prototype._createLine=function(e,t,n){var r,i,o=e.hostModel,s=(r=e.getItemLayout(t),SY((i=new S$({name:"line",subPixelOptimize:!0})).shape,r),i);s.shape.percent=0,mA.LW(s,{shape:{percent:1}},o,t),this.add(s),(0,md.__)(SW,function(n){var r=Sq(n,e,t);this.add(r),this[SG(n)]=SU(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=e.getItemLayout(t),s={shape:{}};SY(s.shape,o),mA.oi(i,s,r,t),(0,md.__)(SW,function(n){var r=SU(n,e,t),i=SG(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=Sq(n,e,t);this.add(o)}this[i]=r},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName("line"),o=n&&n.emphasisLineStyle,s=n&&n.blurLineStyle,a=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,h=n&&n.blurScope;if(!n||e.hasItemOption){var d=e.getItemModel(t),f=d.getModel("emphasis");o=f.getModel("lineStyle").getLineStyle(),s=d.getModel(["blur","lineStyle"]).getLineStyle(),a=d.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),c=f.get("focus"),h=f.get("blurScope"),l=(0,mD.lx)(d)}var p=e.getItemVisual(t,"style"),g=p.stroke;i.useStyle(p),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=s,i.ensureState("select").style=a,(0,md.__)(SW,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=p.opacity;for(var n=0;n<mI.BV.length;n++){var r=mI.BV[n],o=i.getState(r);if(o){var s=o.style||{},a=t.ensureState(r),l=a.style||(a.style={});null!=s.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=s.stroke),null!=s.opacity&&(l.opacity=s.opacity)}}t.markRedraw()}},this);var m=r.getRawValue(t);(0,mD.qM)(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:p.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?(0,ve.LI)(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var x=y.get("distance");(0,md.cy)(x)||(x=[x,x]),v.__labelDistance=x}this.setTextConfig({position:null,local:!0,inside:!1}),(0,mI.Lm)(this,c,h,u)},t.prototype.highlight=function(){(0,mI.HY)(this)},t.prototype.downplay=function(){(0,mI.SD)(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");SY(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this.childOfName("fromSymbol"),t=this.childOfName("toSymbol"),n=this.getTextContent();if(e||t||n&&!n.ignore){for(var r=1,i=this.parent;i;)i.scaleX&&(r/=i.scaleX),i=i.parent;var o=this.childOfName("line");if(this.__dirty||o.__dirty){var s=o.shape.percent,a=o.pointAt(0),l=o.pointAt(s),u=vx.jb([],l,a);if(vx.S8(u,u),e&&(e.setPosition(a),S(e,0),e.scaleX=e.scaleY=r*s,e.markRedraw()),t&&(t.setPosition(l),S(t,1),t.scaleX=t.scaleY=r*s,t.markRedraw()),n&&!n.ignore){n.x=n.y=0,n.originX=n.originY=0;var c=void 0,h=void 0,d=n.__labelDistance,f=d[0]*r,p=d[1]*r,g=s/2,m=o.tangentAt(g),v=[m[1],-m[0]],y=o.pointAt(g);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var x=m[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var b=-Math.atan2(m[1],m[0]);l[0]<a[0]&&(b=Math.PI+b),n.rotation=b}var w=void 0;switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-p,h="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=p,h="top";break;default:w=0,h="middle"}switch(n.__position){case"end":n.x=u[0]*f+l[0],n.y=u[1]*p+l[1],c=u[0]>.8?"left":u[0]<-.8?"right":"center",h=u[1]>.8?"top":u[1]<-.8?"bottom":"middle";break;case"start":n.x=-u[0]*f+a[0],n.y=-u[1]*p+a[1],c=u[0]>.8?"right":u[0]<-.8?"left":"center",h=u[1]>.8?"bottom":u[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":n.x=f*x+a[0],n.y=a[1]+w,c=m[0]<0?"right":"left",n.originX=-f*x,n.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":n.x=y[0],n.y=y[1]+w,c="center",n.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":n.x=-f*x+l[0],n.y=l[1]+w,c=m[0]>=0?"right":"left",n.originX=f*x,n.originY=-w}n.scaleX=n.scaleY=r,n.setStyle({verticalAlign:n.__verticalAlign||h,align:n.__align||c})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var r=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr("rotation",n)}},t}(mS.A),SK=function(){function e(e){this.group=new mS.A,this._LineCtor=e||SZ}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this.group,r=this._lineData;this._lineData=e,r||n.removeAll();var i=SX(e);e.diff(r).add(function(n){t._doAdd(e,n,i)}).update(function(n,o){t._doUpdate(r,e,o,n,i)}).remove(function(e){n.remove(r.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=SX(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){var t;e.isGroup||(t=e).animators&&t.animators.length>0||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var r=e.start;r<e.end;r++)if(SQ(t.getItemLayout(r))){var i=new this._LineCtor(t,r,this._seriesScope);i.traverse(n),this.group.add(i),t.setItemGraphicEl(r,i),this._progressiveEls.push(i)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){mC.traverseElements(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(SQ(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var o=e.getItemGraphicEl(n);SQ(t.getItemLayout(r))?(o?o.updateData(t,r,i):o=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,o),this.group.add(o)):this.group.remove(o)},e}();function SX(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:(0,mD.lx)(t)}}function SJ(e){return isNaN(e[0])||isNaN(e[1])}function SQ(e){return e&&!SJ(e[0])&&!SJ(e[1])}var S0=(0,vB.$r)(),S1=function(e,t,n,r){var i,o=e.getData();if((0,md.cy)(r))i=r;else{var s=r.type;if("min"===s||"max"===s||"average"===s||"median"===s||null!=r.xAxis||null!=r.yAxis){var a=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)a=t.getAxis(null!=r.yAxis?"y":"x"),l=(0,md.Je)(r.yAxis,r.xAxis);else{var u=SC(r,o,t,e);a=u.valueAxis;var c=(0,Sv.me)(o,u.valueDataDim);l=Sk(o,c,s)}var h=+("x"!==a.dim),d=1-h,f=(0,md.o8)(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var g=n.get("precision");g>=0&&(0,md.Et)(l)&&(l=+l.toFixed(Math.min(g,20))),f.coord[h]=p.coord[h]=l,i=[f,p,{type:s,valueIndex:r.valueIndex,value:l}]}else i=[]}var m=[SS(e,i[0]),SS(e,i[1]),(0,md.X$)({},i[2])];return m[2].type=m[2].type||null,(0,md.h1)(m[2],m[0]),(0,md.h1)(m[2],m[1]),m};function S2(e){return!isNaN(e)&&!isFinite(e)}function S5(e,t,n,r){var i=1-e,o=r.dimensions[e];return S2(t[i])&&S2(n[i])&&t[e]===n[e]&&r.getAxis(o).containData(t[e])}function S3(e,t){if("cartesian2d"===e.type){var n=t[0].coord,r=t[1].coord;if(n&&r&&(S5(1,n,r,e)||S5(0,n,r,e)))return!0}return SA(e,t[0])&&SA(e,t[1])}function S4(e,t,n,r,i){var o,s=r.coordinateSystem,a=e.getItemModel(t),l=ve.lo(a.get("x"),i.getWidth()),u=ve.lo(a.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=s.dimensions,h=e.get(c[0],t),d=e.get(c[1],t);o=s.dataToPoint([h,d])}if((0,mL.g)(s,"cartesian2d")){var f=s.getAxis("x"),p=s.getAxis("y"),c=s.dimensions;S2(e.get(c[0],t))?o[0]=f.toGlobalCoord(f.getExtent()[+!n]):S2(e.get(c[1],t))&&(o[1]=p.toGlobalCoord(p.getExtent()[+!n]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var S6=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Sg.getMarkerModelFromSeries(e,"markLine");if(t){var r=t.getData(),i=S0(t).from,o=S0(t).to;i.each(function(t){S4(i,t,!0,e,n),S4(o,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),o.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i,o,s,a,l,u,c,h,d,f=e.coordinateSystem,p=e.id,g=e.getData(),m=this.markerGroupMap,v=m.get(p)||m.set(p,new SK);this.group.add(v.group);var y=(i=f,o=e,s=t,a=i?(0,md.Tj)(i&&i.dimensions,function(e){var t=o.getData().getDimensionInfo(o.getData().mapDimension(e))||{};return(0,md.X$)((0,md.X$)({},t),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],l=new va.A(a,s),u=new va.A(a,s),c=new va.A([],s),h=(0,md.Tj)(s.get("data"),(0,md.cF)(S1,o,i,s)),i&&(h=(0,md.pb)(h,(0,md.cF)(S3,i))),d=SM(!!i,a),l.initData((0,md.Tj)(h,function(e){return e[0]}),null,d),u.initData((0,md.Tj)(h,function(e){return e[1]}),null,d),c.initData((0,md.Tj)(h,function(e){return e[2]})),c.hasItemOption=!0,{from:l,to:u,line:c}),x=y.from,b=y.to,w=y.line;S0(t).from=x,S0(t).to=b,t.setData(w);var S=t.get("symbol"),C=t.get("symbolSize"),A=t.get("symbolRotate"),M=t.get("symbolOffset");function k(t,n,i){var o=t.getItemModel(n);S4(t,n,i,e,r);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=(0,w_.rI)(g,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:(0,md.bZ)(o.get("symbolOffset",!0),M[+!i]),symbolRotate:(0,md.bZ)(o.get("symbolRotate",!0),A[+!i]),symbolSize:(0,md.bZ)(o.get("symbolSize"),C[+!i]),symbol:(0,md.bZ)(o.get("symbol",!0),S[+!i]),style:s})}(0,md.cy)(S)||(S=[S,S]),(0,md.cy)(C)||(C=[C,C]),(0,md.cy)(A)||(A=[A,A]),(0,md.cy)(M)||(M=[M,M]),y.from.each(function(e){k(x,e,!0),k(b,e,!1)}),w.each(function(e){var t=w.getItemModel(e).getModel("lineStyle").getLineStyle();w.setItemLayout(e,[x.getItemLayout(e),b.getItemLayout(e)]),null==t.stroke&&(t.stroke=x.getItemVisual(e,"style").fill),w.setItemVisual(e,{fromSymbolKeepAspect:x.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:x.getItemVisual(e,"symbolOffset"),fromSymbolRotate:x.getItemVisual(e,"symbolRotate"),fromSymbolSize:x.getItemVisual(e,"symbolSize"),fromSymbol:x.getItemVisual(e,"symbol"),toSymbolKeepAspect:b.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:b.getItemVisual(e,"symbolOffset"),toSymbolRotate:b.getItemVisual(e,"symbolRotate"),toSymbolSize:b.getItemVisual(e,"symbolSize"),toSymbol:b.getItemVisual(e,"symbol"),style:t})}),v.updateData(w),y.line.eachItemGraphicEl(function(e){(0,mT.z)(e).dataModel=t,e.traverse(function(e){(0,mT.z)(e).dataModel=t})}),this.markKeep(v),v.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(SI),S8=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(Sg);function S9(e,t,n){var r=t.coordinateSystem;e.each(function(i){var o,s=e.getItemModel(i),a=ve.lo(s.get("x"),n.getWidth()),l=ve.lo(s.get("y"),n.getHeight());if(isNaN(a)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var u=e.get(r.dimensions[0],i),c=e.get(r.dimensions[1],i);o=r.dataToPoint([u,c])}}else o=[a,l];isNaN(a)||(o[0]=a),isNaN(l)||(o[1]=l),e.setItemLayout(i,o)})}var S7=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return(0,mg.C6)(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Sg.getMarkerModelFromSeries(e,"markPoint");t&&(S9(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,r){var i,o,s,a,l,u,c,h=e.coordinateSystem,d=e.id,f=e.getData(),p=this.markerGroupMap,g=p.get(d)||p.set(d,new vW.A),m=(i=h,o=e,s=t,a=i?(0,md.Tj)(i&&i.dimensions,function(e){var t=o.getData().getDimensionInfo(o.getData().mapDimension(e))||{};return(0,md.X$)((0,md.X$)({},t),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],l=new va.A(a,s),u=(0,md.Tj)(s.get("data"),(0,md.cF)(SS,o)),i&&(u=(0,md.pb)(u,(0,md.cF)(SA,i))),c=SM(!!i,a),l.initData(u,null,c),l);t.setData(m),S9(t.getData(),e,r),m.each(function(e){var n=m.getItemModel(e),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),a=n.getShallow("symbolKeepAspect");if((0,md.Tn)(r)||(0,md.Tn)(i)||(0,md.Tn)(o)||(0,md.Tn)(s)){var l=t.getRawValue(e),u=t.getDataParams(e);(0,md.Tn)(r)&&(r=r(l,u)),(0,md.Tn)(i)&&(i=i(l,u)),(0,md.Tn)(o)&&(o=o(l,u)),(0,md.Tn)(s)&&(s=s(l,u))}var c=n.getModel("itemStyle").getItemStyle(),h=(0,w_.rI)(f,"color");c.fill||(c.fill=h),m.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:s,symbolKeepAspect:a,style:c})}),g.updateData(m),this.group.add(g.group),m.eachItemGraphicEl(function(e){e.traverse(function(e){(0,mT.z)(e).dataModel=t})}),this.markKeep(g),g.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(SI),Ce=n(37573);(0,vH.Y)([yJ.a,function(e){(0,vH.Y)(xI),(0,vH.Y)(xF)},function(e){(0,vH.Y)(x0),(0,vH.Y)(x8)},function(e){e.registerChartView(m$),e.registerSeriesModel(mb),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,md.cF(mf.Zp,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,(0,mf.KF)("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,(0,mp.A)("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})})},m4.a,function(e){e.registerChartView(vo),e.registerSeriesModel(vu)},function(e){e.registerChartView(vN),e.registerSeriesModel(vV),(0,vc.I)("pie",e.registerAction),e.registerLayout((0,md.cF)(vm,"pie")),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var r=e.getData();r.filterSelf(function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0})}}}),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension("value"),r=n.get(t,e);return!(0,md.Et)(r)||!!isNaN(r)||!(r<0)})}})},function(e){(0,vH.Y)(vX.a),e.registerSeriesModel(v$),e.registerChartView(vK),e.registerLayout((0,vZ.A)("scatter"))},function(e){e.registerChartView(yE),e.registerSeriesModel(v1)},function(e){e.registerChartView(yZ),e.registerSeriesModel(yX)},x9.a,x7.a,function(e){e.registerComponentModel(bo),e.registerComponentView(bs),bi.saveAsImage=bl,bi.magicType=bh,bi.dataView=bm,bi.dataZoom=wf,bi.restore=bb,(0,vH.Y)(bn)},wm.a,Ce.a,function(e){(0,vH.Y)(Si),(0,vH.Y)(Su)},function(e){e.registerComponentModel(Sm),e.registerComponentView(SN),e.registerPreprocessor(function(e){Sc(e.series,"markArea")&&(e.markArea=e.markArea||{})})},function(e){e.registerComponentModel(SB),e.registerComponentView(S6),e.registerPreprocessor(function(e){Sc(e.series,"markLine")&&(e.markLine=e.markLine||{})})},function(e){e.registerComponentModel(S8),e.registerComponentView(S7),e.registerPreprocessor(function(e){Sc(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}]);let Ct=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],Cn=["datazoom","downplay","highlight"],Cr=(0,w.memo)(function({option:e,theme:t,renderer:n,sx:r,style:i,onEvents:o,_instance:s,syncGroup:a,onChartInitialized:l}){let u=(0,w.useRef)(e),c=(0,w.useRef)(e),h=(0,w.useRef)(null),d=(0,w.useRef)(null);return(0,w.useLayoutEffect)(()=>{if(null!==h.current&&null===d.current&&(d.current=(0,xo.Ts)(h.current,t,{renderer:n??"canvas"}),void 0!==d.current))return d.current.setOption(u.current,!0),l?.(d.current),void 0!==s&&(s.current=d.current),()=>{null!==d.current&&(d.current.dispose(),d.current=null)}},[s,l,t,n]),(0,w.useEffect)(()=>{d.current&&a&&(d.current.group=a,(0,xo.Ng)([d.current]))},[a,d]),(0,w.useEffect)(()=>{void 0===c.current||ix(c.current,e)||d.current&&(d.current.setOption(e,!0),c.current=e)},[e]),(0,w.useLayoutEffect)(()=>{let e=pm(()=>{d.current&&d.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,w.useEffect)(()=>{let e=d.current;if(e&&void 0!==o)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n]??null;r&&function(t,n){var r,i;"function"==typeof n&&((r=t,Ct.includes(r))?e.on(t,t=>n(t,e)):(i=t,Cn.includes(i))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,r)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,w.useEffect)(()=>{pm(()=>{d.current&&d.current.resize()},200,{leading:!0})()},[r,i]),(0,b.jsx)(lE.A,{ref:h,sx:r,style:i})});var Ci=n(17157);function Co(e,t){return function(n){let r=new Date(Number(n));return e>15768e7?(0,Ci.formatWithTimeZone)(r,"yyyy",t):e>15552e6?(0,Ci.formatWithTimeZone)(r,"MMM yyyy",t):e>864e6?(0,Ci.formatWithTimeZone)(r,"dd.MM",t):e>1728e5?(0,Ci.formatWithTimeZone)(r,"dd.MM HH:mm",t):(0,Ci.formatWithTimeZone)(r,"HH:mm",t)}}var Cs=n(34007);function Ca(e){let{error:t}=e;return(0,b.jsx)(Cs.A,{severity:"error",children:t.message})}var Cl=n(77440);let Cu=[{id:"default",label:"Default",value:void 0},{id:"12",label:"12",value:12},{id:"14",label:"14",value:14},{id:"16",label:"16",value:16},{id:"20",label:"20",value:20},{id:"24",label:"24",value:24},{id:"28",label:"28",value:28},{id:"32",label:"32",value:32},{id:"36",label:"36",value:36},{id:"40",label:"40",value:40},{id:"48",label:"48",value:48},{id:"56",label:"56",value:56},{id:"64",label:"64",value:64},{id:"72",label:"72",value:72},{id:"96",label:"96",value:96},{id:"128",label:"128",value:128},{id:"160",label:"160",value:160},{id:"192",label:"192",value:192}];function Cc({value:e,onChange:t}){return(0,b.jsx)(pZ,{label:"Font Size",control:(0,b.jsx)(p0,{value:Cu.find(t=>t.value===e),options:Cu,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}function Ch({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:r,isValid:i,onActionChange:o,onSubmit:s,onDelete:a,onCancel:l,...u}){return(0,b.jsx)(H.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,b.jsxs)(b.Fragment,{children:[o&&(0,b.jsx)(z.A,{disabled:r,variant:"contained",onClick:()=>o("update"),children:"Edit"}),a&&(0,b.jsx)(z.A,{color:"error",disabled:r,variant:"outlined",onClick:a,children:"Delete"}),l&&(s||a)&&(0,b.jsx)(f0.A,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),l&&(0,b.jsx)(z.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]}):(0,b.jsxs)(b.Fragment,{children:[s&&(0,b.jsx)(z.A,{variant:"contained",disabled:!i,onClick:s,children:t}),l&&(0,b.jsx)(z.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]})})}let Cd=0;class Cf{constructor(e,t){this.from=e,this.to=t}}class Cp{constructor(e={}){this.id=Cd++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Cv.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Cp.closedBy=new Cp({deserialize:e=>e.split(" ")}),Cp.openedBy=new Cp({deserialize:e=>e.split(" ")}),Cp.group=new Cp({deserialize:e=>e.split(" ")}),Cp.isolate=new Cp({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Cp.contextHash=new Cp({perNode:!0}),Cp.lookAhead=new Cp({perNode:!0}),Cp.mounted=new Cp({perNode:!0});class Cg{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Cp.mounted.id]}}let Cm=Object.create(null);class Cv{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Cm,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),r=new Cv(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Cp.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(Cp.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}Cv.none=new Cv("",Object.create(null),0,8);class Cy{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let t of e){let e=t(n);if(e){r||(r=Object.assign({},n.props));let t=e[1],i=e[0];i.combine&&i.id in r&&(t=i.combine(r[i.id],t)),r[i.id]=t}}t.push(r?new Cv(n.name,r,n.id,n.flags):n)}return new Cy(t)}}let Cx=new WeakMap,Cb=new WeakMap;(h=y||(y={}))[h.ExcludeBuffers=1]="ExcludeBuffers",h[h.IncludeAnonymous=2]="IncludeAnonymous",h[h.IgnoreMounts=4]="IgnoreMounts",h[h.IgnoreOverlays=8]="IgnoreOverlays",h[h.EnterBracketed=16]="EnterBracketed";class Cw{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length)for(let[e,t]of(this.props=Object.create(null),i))this.props["number"==typeof e?e:e.id]=t}toString(){let e=Cg.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new CP(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new CP(Cx.get(this)||this.topNode);return r.moveTo(e,t),Cx.set(this,r._tree),r}get topNode(){return new CT(this,0,0,null)}resolve(e,t=0){let n=CM(Cx.get(this)||this.topNode,e,t,!1);return Cx.set(this,n),n}resolveInner(e,t=0){let n=CM(Cb.get(this)||this.topNode,e,t,!0);return Cb.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof CT?r:r.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(i||(i=[r])).push(o.resolve(t,n)),e=o}else{let o=Cg.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new CT(o.tree,o.overlay[0].from+e.from,-1,e);(i||(i=[r])).push(CM(s,t,n,!1))}}return i?C_(i):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,o=e.mode||0,s=(o&y.IncludeAnonymous)>0;for(let e=this.cursor(o|y.IncludeAnonymous);;){let o=!1;if(e.from<=i&&e.to>=r&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:CF(Cv.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new Cw(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new Cw(Cv.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=1024,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new CS(n,n.length):n,l=r.types,u=0,c=0;function h(e,t,n,i,o,s,a,l,u){let c=[],h=[];for(;e.length>i;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(d(r.types[a],c,h,s-o,l-s,u)),t.push(o-n)}function d(e,t,n,r,i,o,s){if(o){let e=[Cp.contextHash,o];s=s?[e].concat(s):[e]}if(i>25){let e=[Cp.lookAhead,i];s=s?[e].concat(s):[e]}return new Cw(e,t,n,r,s)}let f=[],p=[];for(;a.pos>0;)!function e(t,n,f,p,g,m){let{id:v,start:y,end:x,size:b}=a,w=c,S=u;if(b<0){if(a.next(),-1==b){let e=o[v];f.push(e),p.push(y-t);return}if(-3==b){u=v;return}if(-4==b){c=v;return}else throw RangeError(`Unrecognized record size: ${b}`)}let C=l[v],A,M,k=y-t;if(x-y<=i&&(M=function(e,t){let n=a.fork(),r=0,o=0,l=0,u=n.end-i,c={size:0,start:0,skip:0};t:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){c.size=r,c.start=o,c.skip=l,l+=4,r+=4,n.next();continue}let a=n.pos-e;if(e<0||a<i||n.start<u)break;let h=4*(n.id>=s),d=n.start;for(n.next();n.pos>a;){if(n.size<0)if(-3==n.size||-4==n.size)h+=4;else break t;else n.id>=s&&(h+=4);n.next()}o=d,r+=e,l+=h}return(t<0||r==e)&&(c.size=r,c.start=o,c.skip=l),c.size>4?c:void 0}(a.pos-n,g))){let e=new Uint16Array(M.size-M.skip),n=a.pos-M.size,i=e.length;for(;a.pos>n;)i=function e(t,n,r){let{id:i,start:o,end:l,size:h}=a;if(a.next(),h>=0&&i<s){let s=r;if(h>4){let i=a.pos-(h-4);for(;a.pos>i;)r=e(t,n,r)}n[--r]=s,n[--r]=l-t,n[--r]=o-t,n[--r]=i}else -3==h?u=i:-4==h&&(c=i);return r}(M.start,e,i);A=new CC(e,x-M.start,r),k=M.start-t}else{let t=a.pos-b;a.next();let n=[],o=[],l=v>=s?v:-1,u=0,c=x;for(;a.pos>t;)l>=0&&a.id==l&&a.size>=0?(a.end<=c-i&&(h(n,o,y,u,a.end,c,l,w,S),u=n.length,c=a.end),a.next()):m>2500?function(e,t,n,o){let s=[],l=0,u=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:r}=a;if(r>4)a.next();else if(u>-1&&t<u)break;else u<0&&(u=n-i),s.push(e,t,n),l++,a.next()}if(l){let t=new Uint16Array(4*l),i=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-i,t[n++]=s[e+2]-i,t[n++]=n;n.push(new CC(t,s[2]-i,r)),o.push(i-e)}}(y,t,n,o):e(y,t,n,o,l,m+1);if(l>=0&&u>0&&u<n.length&&h(n,o,y,u,y,c,l,w,S),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,r,i)=>{let o=0,s=n.length-1,a,l;if(s>=0&&(a=n[s])instanceof Cw){if(!s&&a.type==e&&a.length==i)return a;(l=a.prop(Cp.lookAhead))&&(o=r[s]+a.length+l)}return d(e,n,r,i,o,t)}}(C,S);A=CF(C,n,o,0,n.length,0,x-y,e,e)}else A=d(C,n,o,x-y,w-x,S)}f.push(A),p.push(k)}(e.start||0,e.bufferStart||0,f,p,-1,0);let g=null!=(t=e.length)?t:f.length?p[0]+f[0].length:0;return new Cw(l[e.topID],f.reverse(),p.reverse(),g)}(e)}}Cw.empty=new Cw(Cv.none,[],[],0);class CS{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new CS(this.buffer,this.index)}}class CC{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Cv.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}findChild(e,t,n,r,i){let{buffer:o}=this,s=-1;for(let a=e;a!=t&&(!CA(i,r,o[a+1],o[a+2])||(s=a,!(n>0)));a=o[a+3]);return s}slice(e,t,n){let r=this.buffer,i=new Uint16Array(t-e),o=0;for(let s=e,a=0;s<t;){i[a++]=r[s++],i[a++]=r[s++]-n;let t=i[a++]=r[s++]-n;i[a++]=r[s++]-e,o=Math.max(o,t)}return new CC(i,o,this.set)}}function CA(e,t,n,r){switch(e){case -2:return n<t;case -1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function CM(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof CT&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=r?0:y.IgnoreOverlays;if(r)for(let r=e,s=r.parent;s;s=(r=s).parent)r instanceof CT&&r.index<0&&(null==(i=s.enter(t,n,o))?void 0:i.from)!=r.from&&(e=s);for(;;){let r=e.enter(t,n,o);if(!r)return e;e=r}}class Ck{cursor(e=0){return new CP(this,e)}getChild(e,t=null,n=null){let r=CI(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return CI(this,e,t,n)}resolve(e,t=0){return CM(this,e,t,!1)}resolveInner(e,t=0){return CM(this,e,t,!0)}matchContext(e){return CD(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class CT extends Ck{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,i=0){for(let o=this;;){for(let{children:s,positions:a}=o._tree,l=t>0?s.length:-1;e!=l;e+=t){let l=s[e],u=a[e]+o.from,c;if(i&y.EnterBracketed&&l instanceof Cw&&(c=Cg.get(l))&&!c.overlay&&c.bracketed&&n>=u&&n<=u+l.length||CA(r,n,u,u+l.length)){if(l instanceof CC){if(i&y.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,t,n-u,r);if(s>-1)return new CE(new CO(o,l,e,u),null,s)}else if(i&y.IncludeAnonymous||!l.type.isAnonymous||CL(l)){let s;if(!(i&y.IgnoreMounts)&&(s=Cg.get(l))&&!s.overlay)return new CT(s.tree,u,e,o);let a=new CT(l,u,e,o);return i&y.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,n,r,i)}}}if(i&y.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&y.IgnoreOverlays)&&(r=Cg.get(this._tree))&&r.overlay){let i=e-this.from,o=n&y.EnterBracketed&&r.bracketed;for(let{from:e,to:n}of r.overlay)if((t>0||o?e<=i:e<i)&&(t<0||o?n>=i:n>i))return new CT(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function CI(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return o}for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function CD(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class CO{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class CE extends Ck{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new CE(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&y.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new CE(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new CE(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new CE(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1];e.push(n.slice(r,i,o)),t.push(0)}return new Cw(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function C_(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof CT&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new CR(i,n)}class CR{constructor(e,t){this.heads=e,this.node=t}get next(){return C_(this.heads)}}class CP{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~y.EnterBracketed,e instanceof CT)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof CT?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&y.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&y.IncludeAnonymous||e instanceof CC||!e.type.isAnonymous||CL(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)t:for(let r=this.index,i=this.stack.length;i>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break t}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new CE(this.buffer,t,this.stack[e]);return this.bufferNode=new CE(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return CD(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return CD(this._tree,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function CL(e){return e.children.some(e=>e instanceof CC||!e.type.isAnonymous||CL(e))}let CN=new WeakMap;function CB(e,t){if(!e.isAnonymous||t instanceof CC||t.type!=e)return 1;let n=CN.get(t);if(null==n){for(let r of(n=1,t.children)){if(r.type!=e||!(r instanceof Cw)){n=1;break}n+=CB(e,r)}CN.set(t,n)}return n}function CF(e,t,n,r,i,o,s,a,l){let u=0;for(let n=r;n<i;n++)u+=CB(e,t[n]);let c=Math.ceil(1.5*u/8),h=[],d=[];return!function t(n,r,i,s,a){for(let u=i;u<s;){let i=u,f=r[u],p=CB(e,n[u]);for(u++;u<s;u++){let t=CB(e,n[u]);if(p+t>=c)break;p+=t}if(u==i+1){if(p>c){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+a);continue}h.push(n[i])}else{let t=r[u-1]+n[u-1].length-f;h.push(CF(e,n,r,i,u,f,t,null,l))}d.push(f+a-o)}}(t,n,r,i,0),(a||l)(h,d,s)}class Cj{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new Cj(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let u=s<t.length?t[s]:null,c=u?u.fromA:1e9;if(c-a>=n)for(;o&&o.from<c;){let t=o;if(a>=t.from||c<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new Cj(e,n,t.tree,t.offset+l,s>0,!!u)}if(t&&r.push(t),o.to>c)break;o=i<e.length?e[i++]:null}if(!u)break;a=u.toA,l=u.toA-u.toB}return r}}class Cz{startParse(e,t,n){return"string"==typeof e&&(e=new CV(e)),n=n?n.length?n.map(e=>new Cf(e.from,e.to)):[new Cf(0,0)]:[new Cf(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class CV{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Cp({perNode:!0});class CH{constructor(e,t,n,r,i,o,s,a,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new CH(e,[],t,n,n,0,[],0,r?new C$(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=65535&e,{parser:i}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=i.dynamicPrecedence(r);if(s&&(this.score+=s),0==n){r<i.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(n-1)*3-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from;r<i.minRepeatTerm&&l==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-l;u>=2e3&&!(null==(t=this.p.parser.nodeSet.types[r])?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let c=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-c;if(r<i.minRepeatTerm||131072&e){let e=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,e,h+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=i.getGoto(e,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,i=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&0==this.buffer[e-4]&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&(0!=this.buffer[i-4]||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:i}=this.p;this.pos=r;let o=i.stateFlag(e,1);!o&&(r>n||t<=i.maxNode)&&(this.reducePos=r),this.pushState(e,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&0==e.buffer[t-4]&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new CH(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new CW(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=65535&t,i=this.stack.length-3*n;if(i<0||0>e.getGoto(this.stack[i],r,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-i;if(n>1){let r=65535&t,i=this.stack.length-3*n;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new C$(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class C${constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class CW{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class CG{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new CG(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new CG(this.stack,this.pos,this.index)}}function CU(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class Cq{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let CY=new Cq;class CZ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=CY,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=CY,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class CK{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;CX(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function CX(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;t:for(;(a&e[s])!=0;){let n=e[s+1];for(let r=s+3;r<n;r+=2)if((e[r+1]&a)>0){let n=e[r];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,r){let i=CJ(n,r,t);return i<0||CJ(n,r,e)<i}(n,t.token.value,i,o))){t.acceptToken(n);break}}let r=t.next,u=0,c=e[s+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){s=e[n+3*c-1];continue}for(;u<c;){let i=u+c>>1,o=n+i+(i<<1),a=e[o],l=e[o+1]||65536;if(r<a)c=i;else if(r>=l)u=i+1;else{s=e[o+2],t.advance();continue t}}break}}function CJ(e,t,n){for(let r=t,i;65535!=(i=e[r]);r++)if(i==n)return r-t;return -1}CK.prototype.contextual=CK.prototype.fallback=CK.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?CU(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(CX(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&r++,null==i)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}).prototype.contextual=CK.prototype.fallback=CK.prototype.extend=!1;let CQ="u">typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),C0=null;function C1(e,t,n){let r=e.cursor(y.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class C2{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?C1(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?C1(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof Cw){if(o==e){if(o<this.safeFrom)return null;let e=o+i.length;if(e<=this.safeTo){let t=i.prop(Cp.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}}class C5{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new Cq)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let r=0;r<i.length;r++){if((1<<r&o)==0)continue;let l=i[r],u=this.tokens[r];if((!n||l.fallback)&&((l.contextual||u.start!=e.pos||u.mask!=o||u.context!=s)&&(this.updateCachedToken(u,l,e),u.mask=o,u.context=s),u.lookAhead>u.end+25&&(a=Math.max(u.lookAhead,a)),0!=u.value)){let r=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||((n=new Cq).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Cq,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){(1&i)==0?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let a=o.stateSlot(i,e?2:1);;a+=3){if(65535==s[a])if(1==s[a+1])a=C9(s,a+2);else{0==r&&2==s[a+1]&&(r=this.putAction(C9(s,a+2),t,n,r));break}s[a]==t&&(r=this.putAction(C9(s,a+1),t,n,r))}return r}}class C3{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new CZ(t,r),this.tokens=new C5(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[CH.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>4*e.bufferLength?new C2(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let s=n[o];for(;;){if(this.tokens.mainToken=null,s.pos>r)i.push(s);else{if(this.advanceStack(s,i,n))continue;e||(e=[],t=[]),e.push(s);let r=this.tokens.getMainToken(s);t.push(r.value,r.end)}break}}if(!i.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return CQ&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw CQ&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,i);if(n)return CQ&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort((e,t)=>t.score-e.score);i.length>e;)i.pop();i.some(e=>e.reducePos>r)&&this.recovering--}else if(i.length>1){n:for(let e=0;e<i.length-1;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let r=i[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500)if((t.score-r.score||t.buffer.length-r.buffer.length)>0)i.splice(n--,1);else{i.splice(e--,1);continue n}}}i.length>12&&(i.sort((e,t)=>t.score-e.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let e=1;e<i.length;e++)i[e].pos<this.minStackPos&&(this.minStackPos=i[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,o=CQ?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(r);s;){let r=this.parser.nodeSet.types[s.type.id]==s.type?i.getGoto(e.state,s.type.id):-1;if(r>-1&&s.length&&(!t||(s.prop(Cp.contextHash)||0)==n))return e.useNode(s,r),CQ&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(s.type.id)})`),!0;if(!(s instanceof Cw)||0==s.children.length||s.positions[0]>0)break;let a=s.children[0];if(a instanceof Cw&&0==s.positions[0])s=a;else break}}let s=i.stateSlot(e.state,4);if(s>0)return e.reduce(s),CQ&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(65535&s)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let s=0;s<a.length;){let l=a[s++],u=a[s++],c=a[s++],h=s==a.length||!n,d=h?e:e.split(),f=this.tokens.mainToken;if(d.apply(l,u,f?f.start:d.pos,c),CQ&&console.log(o+this.stackID(d)+` (via ${(65536&l)==0?"shift":`reduce of ${i.getName(65535&l)}`} for ${i.getName(u)} @ ${r}${d==e?"":", split"})`),h)return!0;d.pos>r?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return C4(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=t[o<<1],l=t[(o<<1)+1],u=CQ?this.stackID(s)+" -> ":"";if(s.deadEnd&&(i||(i=!0,s.restart(),CQ&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let c=s.split(),h=u;for(let e=0;e<10&&c.forceReduce()&&(CQ&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)CQ&&(h=this.stackID(c)+" -> ");for(let e of s.recoverByInsert(a))CQ&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),CQ&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),C4(s,n)):(!r||r.score<c.score)&&(r=c)}return r}stackToTree(e){return e.close(),Cw.build({buffer:CG.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(C0||(C0=new WeakMap)).get(e);return t||C0.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function C4(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class C6{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class C8 extends Cz{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=Cp[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let o=t[n+-r];for(let s=-r;s>0;s--)i(t[n++],e,o);n++}}}this.nodeSet=new Cy(t.map((t,i)=>Cv.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=CU(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(C7),this.states=CU(e.states,Uint32Array),this.data=CU(e.stateData),this.goto=CU(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new CK(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new C3(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return -1;for(let i=r[t+1];;){let t=r[i++],o=1&t,s=r[i++];if(o&&n)return s;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return s;if(o)return -1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),o;;i+=3){if(65535==(o=n[i]))if(1==n[i+1])o=n[i=C9(n,i+2)];else if(2==n[i+1])return C9(n,i+2);else break;if(o==t||0==o)return C9(n,i+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=C9(this.data,n+2);else break;r=t(C9(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=C9(this.data,n+2);else break;if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(C8.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let i=e.specializers.find(e=>e.from==n.external);if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=C7(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;65535!=(i=this.data[n++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[i]=1;return new C6(e,n,r)}static deserialize(e){return new C8(e)}}function C9(e,t){return e[t]|e[t+1]<<16}function C7(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}let Ae=0;class At{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Ae++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof At&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new At("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new Ar(e);return e=>e.modified.indexOf(t)>-1?e:Ar.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let An=0;class Ar{constructor(e){this.name=e,this.instances=[],this.id=An++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var r,i;return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every((e,t)=>e==i[t]))});if(n)return n;let r=[],i=new At(e.name,r,e,t);for(let e of t)e.instances.push(i);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)r.push(Ar.get(t,e));return i}}function Ai(e){let t=Object.create(null);for(let n in e){let r=e[n];for(let e of(Array.isArray(r)||(r=[r]),n.split(" ")))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),(t+=r[0].length)==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){i=0;break}if("/"!=s)throw RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw RangeError("Invalid path: "+e);let l=new As(r,i,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return Ao.add(t)}let Ao=new Cp({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new As(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class As{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function Aa(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}As.empty=new As([],2,null);class Al{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:o,from:s,to:a}=e;if(s>=n||a<=t)return;o.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=r,u=function(e){let t=e.type.prop(Ao);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||As.empty,c=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(i,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,s),l),u.opaque)return;let h=e.tree&&e.tree.prop(Cp.mounted);if(h&&h.overlay){let o=e.node.enter(h.overlay[0].from+s,1),u=this.highlighters.filter(e=>!e.scope||e.scope(h.tree.type)),c=e.firstChild();for(let d=0,f=s;;d++){let p=d<h.overlay.length?h.overlay[d]:null,g=p?p.from+s:a,m=Math.max(t,f),v=Math.min(n,g);if(m<v&&c)for(;e.from<v&&(this.highlightRange(e,m,v,r,i),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!p||g>n)break;(f=p.to+s)>t&&(this.highlightRange(o.cursor(),Math.max(t,p.from+s),Math.min(n,f),"",u),this.startSpan(Math.min(n,f),l))}c&&e.parent()}else if(e.firstChild()){h&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}}let Au=At.define,Ac=Au(),Ah=Au(),Ad=Au(Ah),Af=Au(Ah),Ap=Au(),Ag=Au(Ap),Am=Au(Ap),Av=Au(),Ay=Au(Av),Ax=Au(),Ab=Au(),Aw=Au(),AS=Au(Aw),AC=Au(),AA={comment:Ac,lineComment:Au(Ac),blockComment:Au(Ac),docComment:Au(Ac),name:Ah,variableName:Au(Ah),typeName:Ad,tagName:Au(Ad),propertyName:Af,attributeName:Au(Af),className:Au(Ah),labelName:Au(Ah),namespace:Au(Ah),macroName:Au(Ah),literal:Ap,string:Ag,docString:Au(Ag),character:Au(Ag),attributeValue:Au(Ag),number:Am,integer:Au(Am),float:Au(Am),bool:Au(Ap),regexp:Au(Ap),escape:Au(Ap),color:Au(Ap),url:Au(Ap),keyword:Ax,self:Au(Ax),null:Au(Ax),atom:Au(Ax),unit:Au(Ax),modifier:Au(Ax),operatorKeyword:Au(Ax),controlKeyword:Au(Ax),definitionKeyword:Au(Ax),moduleKeyword:Au(Ax),operator:Ab,derefOperator:Au(Ab),arithmeticOperator:Au(Ab),logicOperator:Au(Ab),bitwiseOperator:Au(Ab),compareOperator:Au(Ab),updateOperator:Au(Ab),definitionOperator:Au(Ab),typeOperator:Au(Ab),controlOperator:Au(Ab),punctuation:Aw,separator:Au(Aw),bracket:AS,angleBracket:Au(AS),squareBracket:Au(AS),paren:Au(AS),brace:Au(AS),content:Av,heading:Ay,heading1:Au(Ay),heading2:Au(Ay),heading3:Au(Ay),heading4:Au(Ay),heading5:Au(Ay),heading6:Au(Ay),contentSeparator:Au(Av),list:Au(Av),quote:Au(Av),emphasis:Au(Av),strong:Au(Av),link:Au(Av),monospace:Au(Av),strikethrough:Au(Av),inserted:Au(),deleted:Au(),changed:Au(),invalid:Au(),meta:AC,documentMeta:Au(AC),annotation:Au(AC),processingInstruction:Au(AC),definition:At.defineModifier("definition"),constant:At.defineModifier("constant"),function:At.defineModifier("function"),standard:At.defineModifier("standard"),local:At.defineModifier("local"),special:At.defineModifier("special")};for(let e in AA){let t=AA[e];t instanceof At&&(t.name=e)}Aa([{tag:AA.link,class:"tok-link"},{tag:AA.heading,class:"tok-heading"},{tag:AA.emphasis,class:"tok-emphasis"},{tag:AA.strong,class:"tok-strong"},{tag:AA.keyword,class:"tok-keyword"},{tag:AA.atom,class:"tok-atom"},{tag:AA.bool,class:"tok-bool"},{tag:AA.url,class:"tok-url"},{tag:AA.labelName,class:"tok-labelName"},{tag:AA.inserted,class:"tok-inserted"},{tag:AA.deleted,class:"tok-deleted"},{tag:AA.literal,class:"tok-literal"},{tag:AA.string,class:"tok-string"},{tag:AA.number,class:"tok-number"},{tag:[AA.regexp,AA.escape,AA.special(AA.string)],class:"tok-string2"},{tag:AA.variableName,class:"tok-variableName"},{tag:AA.local(AA.variableName),class:"tok-variableName tok-local"},{tag:AA.definition(AA.variableName),class:"tok-variableName tok-definition"},{tag:AA.special(AA.variableName),class:"tok-variableName2"},{tag:AA.definition(AA.propertyName),class:"tok-propertyName tok-definition"},{tag:AA.typeName,class:"tok-typeName"},{tag:AA.namespace,class:"tok-namespace"},{tag:AA.className,class:"tok-className"},{tag:AA.macroName,class:"tok-macroName"},{tag:AA.propertyName,class:"tok-propertyName"},{tag:AA.operator,class:"tok-operator"},{tag:AA.comment,class:"tok-comment"},{tag:AA.meta,class:"tok-meta"},{tag:AA.invalid,class:"tok-invalid"},{tag:AA.punctuation,class:"tok-punctuation"}]);let AM=Ai({String:AA.string,Number:AA.number,"True False":AA.bool,PropertyName:AA.propertyName,Null:AA.null,", :":AA.separator,"[ ]":AA.squareBracket,"{ }":AA.brace}),Ak=C8.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[AM],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),AT=[],AI=[],AD="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<AD.length;e++)(e%2?AI:AT).push(t+=AD[e]);function AO(e){return e>=127462&&e<=127487}function AE(e,t,n){if(t==e.length)return t;t&&AR(e.charCodeAt(t))&&AP(e.charCodeAt(t-1))&&t--;let r=A_(e,t);for(t+=AL(r);t<e.length;){let i=A_(e,t);if(8205==r||8205==i||n&&function(e){if(e<768)return!1;for(let t=0,n=AT.length;;){let r=t+n>>1;if(e<AT[r])n=r;else{if(!(e>=AI[r]))return!0;t=r+1}if(t==n)return!1}}(i))t+=AL(i),r=i;else if(AO(i)){let n=0,r=t-2;for(;r>=0&&AO(A_(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function A_(e,t){let n=e.charCodeAt(t);if(!AP(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return AR(r)?(n-55296<<10)+(r-56320)+65536:n}function AR(e){return e>=56320&&e<57344}function AP(e){return e>=55296&&e<56320}function AL(e){return e<65536?1:2}class AN{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=AW(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),AF.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=AW(this,e,t);let n=[];return this.decompose(e,t,n,0),AF.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Az(this),i=new Az(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new Az(this,e)}iterRange(e,t=this.length){return new AV(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new AH(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new AB(e):AF.from(AB.split(e,[])):AN.empty}}class AB extends AN{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.text[i],s=r+o.length;if((t?n:s)>=e)return new A$(r,s,n,o);r=s+1,n++}}decompose(e,t,n,r){var i;let o=e<=0&&t>=this.length?this:new AB((i=this.text,Aj(i,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=Aj(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new AB(t,e.length+o.length));else{let e=t.length>>1;n.push(new AB(t.slice(0,e)),new AB(t.slice(e)))}}else n.push(o)}replace(e,t,n){var r;if(!(n instanceof AB))return super.replace(e,t,n);[e,t]=AW(this,e,t);let i=Aj(this.text,Aj(n.text,(r=this.text,Aj(r,[""],0,e))),t),o=this.length+n.length-(t-e);return i.length<=32?new AB(i,o):AF.from(AB.split(i,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=AW(this,e,t);let r="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let s=this.text[o],a=i+s.length;i>e&&o&&(r+=n),e<a&&t>i&&(r+=s.slice(Math.max(0,e-i),t-i)),i=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let i of e)n.push(i),r+=i.length+1,32==n.length&&(t.push(new AB(n,r)),n=[],r=-1);return r>-1&&t.push(new AB(n,r)),t}}class AF extends AN{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.children[i],s=r+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,r);r=s+1,n=a+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e<=a&&t>=o){let i=r&(o<=e|2*(a>=t));o>=e&&a<=t&&!i?n.push(s):s.decompose(e-o,t-o,n,i)}o=a+1}}replace(e,t,n){if([e,t]=AW(this,e,t),n.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let o=this.children[r],s=i+o.length;if(e>=i&&t<=s){let a=o.replace(e-i,t-i,n),l=this.lines-o.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let i=this.children.slice();return i[r]=a,new AF(i,this.length-(t-e)+n.length)}return super.replace(i,s,a)}i=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=AW(this,e,t);let r="";for(let i=0,o=0;i<this.children.length&&o<=t;i++){let s=this.children[i],a=o+s.length;o>e&&i&&(r+=n),e<a&&t>o&&(r+=s.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof AF))return 0;let n=0,[r,i,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,i+=t){if(r==o||i==s)return n;let a=this.children[r],l=e.children[i];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new AB(n,t)}let r=Math.max(32,n>>5),i=r<<1,o=r>>1,s=[],a=0,l=-1,u=[];function c(){0!=a&&(s.push(1==u.length?u[0]:AF.from(u,l)),l=-1,a=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>i&&t instanceof AF)for(let n of t.children)e(n);else t.lines>o&&(a>o||!a)?(c(),s.push(t)):t instanceof AB&&a&&(n=u[u.length-1])instanceof AB&&t.lines+n.lines<=32?(a+=t.lines,l+=t.length+1,u[u.length-1]=new AB(n.text.concat(t.text),n.length+1+t.length)):(a+t.lines>r&&c(),a+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==s.length?s[0]:new AF(s,t)}}function Aj(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}AN.empty=new AB([""],0);class Az{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof AB?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,s=r instanceof AB?r.text.length:r.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof AB){let i=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=0==e?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[o+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof AB?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class AV{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Az(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class AH{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"u">typeof Symbol&&(AN.prototype[Symbol.iterator]=function(){return this.iter()},Az.prototype[Symbol.iterator]=AV.prototype[Symbol.iterator]=AH.prototype[Symbol.iterator]=function(){return this});class A${constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function AW(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function AG(e,t,n=!0,r=!0){return function(e,t,n=!0,r=!0){return(n?AE:function(e,t,n){for(;t>1;){let r=AE(e,t-2,n);if(r<t)return r;t--}return 0})(e,t,r)}(e,t,n,r)}function AU(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return r>=56320&&r<57344?(n-55296<<10)+(r-56320)+65536:n}function Aq(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function AY(e){return e<65536?1:2}let AZ=/\r\n?|\n/;var AK=((d=AK||(AK={}))[d.Simple=0]="Simple",d[d.TrackDel=1]="TrackDel",d[d.TrackBefore=2]="TrackBefore",d[d.TrackAfter=3]="TrackAfter",d);class AX{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,i),r+=i):r+=o,n+=i}}iterChangedRanges(e,t=!1){A1(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new AX(e)}composeDesc(e){return this.empty?e:e.empty?this:A5(this,e)}mapDesc(e,t=!1){return e.empty?this:A2(this,e,t)}mapPos(e,t=-1,n=AK.Simple){let r=0,i=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],a=this.sections[o++],l=r+s;if(a<0){if(l>e)return i+(e-r);i+=s}else{if(n!=AK.Simple&&l>=e&&(n==AK.TrackDel&&r<e&&l>e||n==AK.TrackBefore&&r<e||n==AK.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==r||t<0?i:i+a;i+=a}r=l}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],o=this.sections[n++],s=r+i;if(o>=0&&r<=t&&s>=e)return!(r<e)||!(s>t)||"cover";r=s}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new AX(e)}static create(e){return new AX(e)}}class AJ extends AX{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return A1(this,(t,n,r,i,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return A2(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,i=0;r<t.length;r+=2){let o=t[r],s=t[r+1];if(s>=0){t[r]=s,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(AN.empty);n.push(o?e.slice(i,i+o):AN.empty)}i+=o}return new AJ(t,n)}compose(e){return this.empty?e:e.empty?this:A5(this,e,!0)}map(e,t=!1){return e.empty?this:A2(this,e,t,!0)}iterChanges(e,t=!1){A1(this,e,t)}get desc(){return AX.create(this.sections)}filter(e){let t=[],n=[],r=[],i=new A3(this);r:for(let o=0,s=0;;){let a=o==e.length?1e9:e[o++];for(;s<a||s==a&&0==i.len;){if(i.done)break r;let e=Math.min(i.len,a-s);AQ(r,e,-1);let o=-1==i.ins?-1:0==i.off?i.ins:0;AQ(t,e,o),o>0&&A0(n,t,i.text),i.forward(e),s+=e}let l=e[o++];for(;s<l;){if(i.done)break r;let e=Math.min(i.len,l-s);AQ(t,e,-1),AQ(r,e,-1==i.ins?-1:0==i.off?i.ins:0),i.forward(e),s+=e}}return{changes:new AJ(t,n),filtered:AX.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],i=[],o=0,s=null;function a(e=!1){if(!e&&!r.length)return;o<t&&AQ(r,t-o,-1);let n=new AJ(r,i);s=s?s.compose(n.map(s)):n,r=[],i=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof AJ){if(l.length!=t)throw RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:u}=l;if(e>s||e<0||s>t)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let c=u?"string"==typeof u?AN.of(u.split(n||AZ)):u:AN.empty,h=c.length;if(e==s&&0==h)return;e<o&&a(),e>o&&AQ(r,e-o,-1),AQ(r,s-e,h),A0(i,r,c),o=s}}(e),a(!s),s}static empty(e){return new AJ(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if("number"==typeof i)t.push(i,-1);else if(!Array.isArray(i)||"number"!=typeof i[0]||i.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==i.length)t.push(i[0],0);else{for(;n.length<r;)n.push(AN.empty);n[r]=AN.of(i.slice(1)),t.push(i[0],n[r].length)}}return new AJ(t,n)}static createSet(e,t){return new AJ(e,t)}}function AQ(e,t,n,r=!1){if(0==t&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function A0(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(AN.empty);e.push(n)}}function A1(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let u=i,c=o,h=AN.empty;for(;u+=a,c+=l,l&&r&&(h=h.append(r[s-2>>1])),!n&&s!=e.sections.length&&!(e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,u,o,c,h),i=u,o=c}}}function A2(e,t,n,r=!1){let i=[],o=r?[]:null,s=new A3(e),a=new A3(t);for(let e=-1;;)if(s.done&&a.len||a.done&&s.len)throw Error("Mismatched change set lengths");else if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);AQ(i,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(AQ(i,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(AQ(i,0,s.ins),o&&A0(o,i,s.text),e=s.i),s.forward(n),t-=n}a.next()}else if(s.ins>=0){let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else if(0==a.ins&&a.len<n)n-=a.len,a.next();else break;AQ(i,t,e<s.i?s.ins:0),o&&e<s.i&&A0(o,i,s.text),e=s.i,s.forward(s.len-n)}else if(s.done&&a.done)return o?AJ.createSet(i,o):AX.create(i);else throw Error("Mismatched change set lengths")}function A5(e,t,n=!1){let r=[],i=n?[]:null,o=new A3(e),s=new A3(t);for(let e=!1;;)if(o.done&&s.done)return i?AJ.createSet(r,i):AX.create(r);else if(0==o.ins)AQ(r,o.len,0,e),o.next();else if(0!=s.len||s.done)if(o.done||s.done)throw Error("Mismatched change set lengths");else{let t=Math.min(o.len2,s.len),n=r.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;AQ(r,t,n,e),i&&n&&A0(i,r,s.text)}else -1==s.ins?(AQ(r,o.off?0:o.len,t,e),i&&A0(i,r,o.textBit(t))):(AQ(r,o.off?0:o.len,s.off?0:s.ins,e),i&&!s.off&&A0(i,r,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||r.length>n),o.forward2(t),s.forward(t)}else AQ(r,0,s.ins,e),i&&A0(i,r,s.text),s.next()}class A3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?AN.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?AN.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class A4{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new A4(n,r,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return A6.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return A6.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return A6.range(e.anchor,e.head)}static create(e,t,n,r){return new A4(e,t,n,r)}}class A6{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:A6.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new A6([this.main],0)}addRange(e,t=!0){return A6.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,A6.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new A6(e.ranges.map(e=>A4.fromJSON(e)),e.main)}static single(e,t=e){return new A6([A6.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=n:i.from<n)return A6.normalized(e.slice(),t);n=i.to}return new A6(e,t)}static cursor(e,t=0,n,r){return A4.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let o=null==r?7:Math.min(6,r);return i||e==t||(i=t<e?1:-1),i&&(o|=i<0?8:16),t<e?A4.create(t,e,32|o,n):A4.create(e,t,o,n)}static undirectionalRange(e,t){return A4.create(e,t,64,void 0)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1];if(r.empty?r.from<=i.to:r.from<i.to){let o=i.from,s=Math.max(r.to,i.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?A6.range(s,o):A6.range(o,s))}}return new A6(e,t)}}function A8(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let A9=0;class A7{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=A9++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}get reader(){return this}static define(e={}){return new A7(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?Me:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new Mt([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new Mt(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new Mt(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function Me(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class Mt{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=A9++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>1,s=2==this.type,a=!1,l=!1,u=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:((null!=(t=e[n.id])?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||Mr(e,u)){let t=n(e);if(s?!Mn(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[i];if(null!=l){let i=Mf(t,l);if(this.dependencies.every(n=>n instanceof A7?t.facet(n)===e.facet(n):!(n instanceof Mo)||t.field(n,!1)==e.field(n,!1))||(s?Mn(a=n(e),i,r):r(a=n(e),i)))return e.values[o]=i,0}else a=n(e);return e.values[o]=a,1}}}}function Mn(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Mr(e,t){let n=!1;for(let r of t)1&Md(e,r)&&(n=!0);return n}let Mi=A7.define({static:!0});class Mo{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let t=new Mo(A9++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Mi).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Mi),i=n.facet(Mi),o;return(o=r.find(e=>e.field==this))&&o!=i.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,Mi.of({field:this,create:e})]}get extension(){return this}}function Ms(e){return t=>new Ml(t,e)}let Ma={highest:Ms(0),high:Ms(1),default:Ms(2),low:Ms(3),lowest:Ms(4)};class Ml{constructor(e,t){this.inner=e,this.prec=t}}class Mu{of(e){return new Mc(this,e)}reconfigure(e){return Mu.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Mc{constructor(e,t){this.compartment=e,this.inner=t}}class Mh{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var r,i,o;let s,a,l=[],u=Object.create(null),c=new Map;for(let n of(r=e,i=t,o=c,s=[[],[],[],[],[]],a=new Map,!function e(t,n){let r=a.get(t);if(null!=r){if(r<=n)return;let e=s[r].indexOf(t);e>-1&&s[r].splice(e,1),t instanceof Mc&&o.delete(t.compartment)}if(a.set(t,n),Array.isArray(t))for(let r of t)e(r,n);else if(t instanceof Mc){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=i.get(t.compartment)||t.inner;o.set(t.compartment,r),e(r,n)}else if(t instanceof Ml)e(t.inner,t.prec);else if(t instanceof Mo)s[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof Mt)s[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let r=t.extension;if(!r)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(r,n)}}(r,2),s.reduce((e,t)=>e.concat(t))))n instanceof Mo?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let h=Object.create(null),d=[],f=[];for(let e of l)h[e.id]=f.length<<1,f.push(t=>e.slot(t));let p=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],r=t[0].facet,i=p&&p[e]||[];if(t.every(e=>0==e.type))if(h[r.id]=d.length<<1|1,Me(i,t))d.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));d.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(h[e.id]=d.length<<1|1,d.push(e.value)):(h[e.id]=f.length<<1,f.push(t=>e.dynamicSlot(t)));h[r.id]=f.length<<1,f.push(e=>(function(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),o=r.filter(e=>!(1&e)),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<r.length;t++){let o=Mf(e,r[t]);if(2==i[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of r)Md(e,t);return e.values[s]=a(e),1},update(e,n){if(!Mr(e,o))return 0;let r=a(e);return t.compare(r,e.values[s])?0:(e.values[s]=r,1)},reconfigure(e,i){let o=Mr(e,r),l=i.config.facets[t.id],u=i.facet(t);if(l&&!o&&Me(n,l))return e.values[s]=u,0;let c=a(e);return t.compare(c,u)?(e.values[s]=u,0):(e.values[s]=c,1)}}})(e,r,t))}}return new Mh(e,c,f.map(e=>e(h)),h,d,u)}}function Md(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Mf(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let Mp=A7.define(),Mg=A7.define({combine:e=>e.some(e=>e),static:!0}),Mm=A7.define({combine:e=>e.length?e[0]:void 0,static:!0}),Mv=A7.define(),My=A7.define(),Mx=A7.define(),Mb=A7.define({combine:e=>!!e.length&&e[0]});class Mw{constructor(e,t){this.type=e,this.value=t}static define(){return new MS}}class MS{of(e){return new Mw(this,e)}}class MC{constructor(e){this.map=e}of(e){return new MA(this,e)}}class MA{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new MA(this.type,t)}is(e){return this.type==e}static define(e={}){return new MC(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}MA.reconfigure=MA.define(),MA.appendConfig=MA.define();class MM{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&A8(n,t.newLength),i.some(e=>e.type==MM.time)||(this.annotations=i.concat(MM.time.of(Date.now())))}static create(e,t,n,r,i,o){return new MM(e,t,n,r,i,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(MM.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function Mk(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=AJ.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):null==(r=e.selection)?void 0:r.map(i),effects:MA.mapEffects(e.effects,i).concat(MA.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function MT(e,t,n){let r=t.selection,i=MD(t.annotations);return t.userEvent&&(i=i.concat(MM.userEvent.of(t.userEvent))),{changes:t.changes instanceof AJ?t.changes:AJ.of(t.changes||[],n,e.facet(Mm)),selection:r&&(r instanceof A6?r:A6.single(r.anchor,r.head)),effects:MD(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}MM.time=Mw.define(),MM.userEvent=Mw.define(),MM.addToHistory=Mw.define(),MM.remote=Mw.define();let MI=[];function MD(e){return null==e?MI:Array.isArray(e)?e:[e]}var MO=((f=MO||(MO={}))[f.Word=0]="Word",f[f.Space=1]="Space",f[f.Other=2]="Other",f);let ME=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{r=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class M_{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Md(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return Md(this,n),Mf(this,n)}update(...e){return function e(t,n,r){let i=MT(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(r=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(r=!1);let o=!!n[e].sequential;i=Mk(i,MT(t,n[e],o?i.changes.newLength:t.doc.length),o)}let o=MM.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(Mx),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=Mk(r,MT(t,o,e.changes.newLength),!0))}return r==e?e:MM.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(t){let n=t.startState,r=!0;for(let e of n.facet(Mv)){let n=e(t);if(!1===n){r=!1;break}Array.isArray(n)&&(r=!0===r?n:function(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else{if(!(i<t.length))return n;o=t[i++],s=t[i++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}(r,n))}if(!0!==r){let e,i;if(!1===r)i=t.changes.invertedDesc,e=AJ.empty(n.doc.length);else{let n=t.changes.filter(r);e=n.changes,i=n.filtered.mapDesc(n.changes).invertedDesc}t=MM.create(n,e,t.selection&&t.selection.map(i),MA.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let i=n.facet(My);for(let r=i.length-1;r>=0;r--){let o=i[r](t);t=o instanceof MM?o:Array.isArray(o)&&1==o.length&&o[0]instanceof MM?o[0]:e(n,MD(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:i}=n;for(let t of e.effects)t.is(Mu.reconfigure)?(n&&(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),n=null),i.set(t.value.compartment,t.value.extension)):t.is(MA.reconfigure)?(n=null,r=t.value):t.is(MA.appendConfig)&&(n=null,r=MD(r).concat(t.value));t=n?e.startState.values.slice():new M_(n=Mh.resolve(r,i,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(Mg)?e.newSelection:e.newSelection.asSingle();new M_(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:A6.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=MD(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(l);let u=r.mapDesc(a,!0);i.push(s.range.map(u)),r=r.compose(l),o=MA.mapEffects(o,l).concat(MA.mapEffects(MD(s.effects),u))}return{changes:r,selection:A6.create(i,t.mainIndex),effects:o}}changes(e=[]){return e instanceof AJ?e:AJ.of(e,this.doc.length,this.facet(M_.lineSeparator))}toText(e){return AN.of(e.split(this.facet(M_.lineSeparator)||AZ))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(Md(this,t),Mf(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Mo&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let i=n[t],o=e[t];r.push(i.init(e=>i.spec.fromJSON(o,e)))}}return M_.create({doc:e.doc,selection:A6.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Mh.resolve(e.extensions||[],new Map),n=e.doc instanceof AN?e.doc:AN.of((e.doc||"").split(t.staticFacet(M_.lineSeparator)||AZ)),r=e.selection?e.selection instanceof A6?e.selection:A6.single(e.selection.anchor,e.selection.head):A6.single(0);return A8(r,n.length),t.staticFacet(Mg)||(r=r.asSingle()),new M_(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(M_.tabSize)}get lineBreak(){return this.facet(M_.lineSeparator)||"\n"}get readOnly(){return this.facet(Mb)}phrase(e,...t){for(let t of this.facet(M_.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Mp))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){var t;let n=this.languageDataAt("wordChars",e);return t=n.length?n[0]:"",e=>{if(!/\S/.test(e))return MO.Space;if(function(e){if(r)return r.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ME.test(n)))return!0}return!1}(e))return MO.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return MO.Word;return MO.Other}}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=AG(t,o,!1);if(i(t.slice(e,o))!=MO.Word)break;o=e}for(;s<r;){let e=AG(t,s);if(i(t.slice(s,e))!=MO.Word)break;s=e}return o==s?null:A6.range(o+n,s+n)}}function MR(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],o=r[e];if(void 0===o)r[e]=i;else if(o===i||void 0===i);else if(Object.hasOwnProperty.call(n,e))r[e]=n[e](o,i);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}M_.allowMultipleSelections=Mg,M_.tabSize=A7.define({combine:e=>e.length?e[0]:4}),M_.lineSeparator=Mm,M_.readOnly=Mb,M_.phrases=A7.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),M_.languageData=Mp,M_.changeFilter=Mv,M_.transactionFilter=My,M_.transactionExtender=Mx,Mu.reconfigure=MA.define();class MP{eq(e){return this==e}range(e,t=e){return MN.create(e,t,this)}}function ML(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}MP.prototype.startSide=MP.prototype.endSide=0,MP.prototype.point=!1,MP.prototype.mapMode=AK.TrackDel;class MN{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new MN(e,t,n)}}function MB(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class MF{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,s=i.length;;){if(o==s)return o;let r=o+s>>1,a=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return a>=0?o:s;a>=0?s=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i<o;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}map(e,t){let n=[],r=[],i=[],o=-1,s=-1;for(let a=0;a<this.value.length;a++){let l=this.value[a],u=this.from[a]+e,c=this.to[a]+e,h,d;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(h=d=e,l.startSide!=l.endSide&&(d=t.mapPos(u,l.endSide))<h))continue}else if((h=t.mapPos(u,l.startSide))>(d=t.mapPos(c,l.endSide))||h==d&&l.startSide>0&&l.endSide<=0)continue;0>(d-h||l.endSide-l.startSide)||(o<0&&(o=h),l.point&&(s=Math.max(s,d-h)),n.push(l),r.push(h-o),i.push(d-o))}return{mapped:n.length?new MF(r,i,n,s):null,pos:o}}}class Mj{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new Mj(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(MB)),this.isEmpty)return t.length?Mj.of(t):this;let s=new MH(this,null,-1).goto(0),a=0,l=[],u=new Mz;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];u.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(s.chunkIndex)||i<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||r>s.to||i<s.from||o(s.from,s.to,s.value))&&!u.addInner(s.from,s.to,s.value)&&l.push(MN.create(s.from,s.to,s.value)),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?Mj.empty:this.nextLayer.update({add:l,filter:o,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i],a=e.touchesRange(o,o+s.length);if(!1===a)r=Math.max(r,s.maxPoint),t.push(s),n.push(e.mapPos(o));else if(!0===a){let{mapped:i,pos:a}=s.map(o,e);i&&(r=Math.max(r,i.maxPoint),t.push(i),n.push(a))}}let i=this.nextLayer.map(e);return 0==t.length?i:new Mj(n,t,i||Mj.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],o=this.chunk[r];if(t>=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return M$.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return M$.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),a=MV(o,s,n),l=new MG(o,a,i),u=new MG(s,a,i);n.iterGaps((e,t,n)=>MU(l,e,u,t,n,r)),n.empty&&0==n.length&&MU(l,0,u,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=0x3b9ac9ff);let i=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(i.length!=o.length)return!1;if(!i.length)return!0;let s=MV(i,o),a=new MG(i,s,0).goto(n),l=new MG(o,s,0).goto(n);for(;;){if(a.to!=l.to||!Mq(a.active,l.active)||a.point&&(!l.point||!ML(a.point,l.point)))return!1;if(a.to>r)return!0;a.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new MG(e,null,i).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),i=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,a);r.point(s,e,o.point,n,i,o.pointRank),a=Math.min(o.openEnd(e),n.length)}else e>s&&(r.span(s,e,o.active,a),a=o.openEnd(e));if(o.to>n)return a+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new Mz;for(let r of e instanceof MN?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(MB(t,r)>0)return e.slice().sort(MB);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return Mj.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=Mj.empty;r=r.nextLayer)t=new Mj(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}Mj.empty=new Mj([],[],null,-1),Mj.empty.nextLayer=Mj.empty;class Mz{finishChunk(e){this.chunks.push(new MF(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Mz)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Mj.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Mj.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function MV(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=r.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||i.add(e.chunk[t])}return i}class MH{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class M${constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let i=0;i<e.length;i++)for(let o=e[i];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new MH(o,t,n,i));return 1==r.length?r[0]:new M$(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)MW(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)MW(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),MW(this.heap,0)}}}function MW(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),0>n.compare(i))break;e[r]=n,e[t]=i,t=r}}class MG{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=M$.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){MY(this.active,e),MY(this.activeTo,e),MY(this.activeRank,e),this.minActive=MK(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;MZ(this.active,t,n),MZ(this.activeTo,t,r),MZ(this.activeRank,t,i),e&&MZ(e,t,this.cursor.from),this.minActive=MK(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&MY(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(e.point)if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}else this.addActive(n),this.cursor.next()}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function MU(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t,u=!!o.boundChange;for(let t=!1;;){let r=e.to+l-n.to,i=r||e.endSide-n.endSide,c=i<0?e.to+l:n.to,h=Math.min(c,s);if(e.point||n.point?(e.point&&n.point&&ML(e.point,n.point)&&Mq(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,h,e.point,n.point),t=!1):(t&&o.boundChange(a),h>a&&!Mq(e.active,n.active)&&o.compareRange(a,h,e.active,n.active),u&&h<s&&(r||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>s)break;a=c,i<=0&&e.next(),i>=0&&n.next()}}function Mq(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!ML(e[n],t[n]))return!1;return!0}function MY(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function MZ(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function MK(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)0>(t[i]-r||e[i].endSide-e[n].endSide)&&(n=i,r=t[i]);return n}function MX(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=AG(e,i));return r}function MJ(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=AG(e,r)}return!0===r?-1:e.length}let MQ="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),M0="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),M1="u">typeof globalThis?globalThis:"u">typeof window?window:{};class M2{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,i,o,s){let a=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==i)return o.push(t[0]+";");for(let n in i){let s=i[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),s,o);else if(s&&"object"==typeof s){if(!l)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(r(n),s,a,u)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+s+";")}(a.length||u)&&o.push((n&&!l&&!s?t.map(n):t).join(", ")+" {"+a.join(" ")+"}")}(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=M1[MQ]||1;return M1[MQ]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[M0],i=n&&n.nonce;r?i&&r.setNonce(i):r=new M3(e,i),r.mount(Array.isArray(t)?t:[t],e)}}let M5=new Map;class M3{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=M5.get(n);if(t)return e[M0]=t;this.sheet=new r.CSSStyleSheet,M5.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[M0]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),i--,s=-1),-1==s){if(this.modules.splice(i++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var M4={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},M6={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},M8="u">typeof navigator&&/Mac/.test(navigator.platform),M9="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),M7=0;M7<10;M7++)M4[48+M7]=M4[96+M7]=String(M7);for(var M7=1;M7<=24;M7++)M4[M7+111]="F"+M7;for(var M7=65;M7<=90;M7++)M4[M7]=String.fromCharCode(M7+32),M6[M7]=String.fromCharCode(M7);for(var ke in M4)M6.hasOwnProperty(ke)||(M6[ke]=M4[ke]);function kt(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let kn="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},kr="u">typeof document?document:{documentElement:{style:{}}},ki=/Edge\/(\d+)/.exec(kn.userAgent),ko=/MSIE \d/.test(kn.userAgent),ks=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(kn.userAgent),ka=!!(ko||ks||ki),kl=!ka&&/gecko\/(\d+)/i.test(kn.userAgent),ku=!ka&&/Chrome\/(\d+)/.exec(kn.userAgent),kc="webkitFontSmoothing"in kr.documentElement.style,kh=!ka&&/Apple Computer/.test(kn.vendor),kd=kh&&(/Mobile\/\w+/.test(kn.userAgent)||kn.maxTouchPoints>2);var kf={mac:kd||/Mac/.test(kn.platform),windows:/Win/.test(kn.platform),linux:/Linux|X11/.test(kn.platform),ie:ka,ie_version:ko?kr.documentMode||6:ks?+ks[1]:ki?+ki[1]:0,gecko:kl,gecko_version:kl?+(/Firefox\/(\d+)/.exec(kn.userAgent)||[0,0])[1]:0,chrome:!!ku,chrome_version:ku?+ku[1]:0,ios:kd,android:/Android\b/.test(kn.userAgent),webkit:kc,webkit_version:kc?+(/\bAppleWebKit\/(\d+)/.exec(kn.userAgent)||[0,0])[1]:0,safari:kh,safari_version:kh?+(/\bVersion\/(\d+(\.\d+)?)/.exec(kn.userAgent)||[0,0])[1]:0,tabSize:null!=kr.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function kp(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}let kg=Object.create(null);function km(e,t,n){if(e==t)return!0;e||(e=kg),t||(t=kg);let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(-1==i.indexOf(o)||e[o]!==t[o]))return!1;return!0}function kv(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,"style"==i?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,"style"==i?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}class ky{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return -1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var kx=((p=kx||(kx={}))[p.Text=0]="Text",p[p.WidgetBefore=1]="WidgetBefore",p[p.WidgetAfter=2]="WidgetAfter",p[p.WidgetRange=3]="WidgetRange",p);class kb extends MP{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new kw(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new kC(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:o}=kA(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new kC(e,n,r,t,e.widget||null,!0)}static line(e){return new kS(e)}static set(e,t=!1){return Mj.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}kb.none=Mj.empty;class kw extends kb{constructor(e){let{start:t,end:n}=kA(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?kp(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||kg}eq(e){return this==e||e instanceof kw&&this.tagName==e.tagName&&km(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}kw.prototype.point=!1;class kS extends kb{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof kS&&this.spec.class==e.spec.class&&km(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}kS.prototype.mapMode=AK.TrackBefore,kS.prototype.point=!0;class kC extends kb{constructor(e,t,n,r,i,o){super(t,n,i,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?AK.TrackBefore:AK.TrackAfter:AK.TrackDel}get type(){return this.startSide!=this.endSide?kx.WidgetRange:this.startSide<=0?kx.WidgetBefore:kx.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof kC&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function kA(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function kM(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}kC.prototype.point=!0;class kk extends MP{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof kk&&this.tagName==e.tagName&&km(this.attributes,e.attributes)}static create(e){return new kk(e.tagName,e.attributes||kg,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return Mj.of(e,t)}}function kT(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function kI(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function kD(e,t){if(!t.anchorNode)return!1;try{return kI(e,t.anchorNode)}catch(e){return!1}}function kO(e){return 3==e.nodeType?kH(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function kE(e,t,n,r){return!!n&&(kP(e,t,n,r,-1)||kP(e,t,n,r,1))}function k_(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function kR(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function kP(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:kL(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=k_(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?kL(e):0}}}function kL(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function kN(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function kB(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(r>.995&&r<1.005||!isFinite(r)||1>Math.abs(t.height-e.offsetHeight))&&(r=1),{scaleX:n,scaleY:r}}function kF(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let o=e.parentNode;o;)if(o==n.body||(!t||r)&&i)break;else if(1==o.nodeType)!i&&o.scrollHeight>o.clientHeight&&(i=o),t&&!r&&o.scrollWidth>o.clientWidth&&(r=o),o=o.assignedSlot||o.parentNode;else if(11==o.nodeType)o=o.host;else break;return{x:r,y:i}}kk.prototype.startSide=kk.prototype.endSide=-1;class kj{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?kL(t):0),n,Math.min(e.focusOffset,n?kL(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let kz=null;function kV(e){if(e.setActive)return e.setActive();if(kz)return e.focus(kz);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==kz?{get preventScroll(){return kz={preventScroll:!0},!0}}:void 0),!kz){kz=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function kH(e,t,n=t){let r=i||(i=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function k$(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function kW(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function kG(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r>0)return{node:n,offset:r};else if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;r=kL(n=n.childNodes[r-1])}else{if(!n.parentNode||kR(n))return null;r=k_(n),n=n.parentNode}}function kU(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};else if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||kR(n))return null;r=k_(n)+1,n=n.parentNode}}kf.safari&&kf.safari_version>=26&&(kz=!1);class kq{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new kq(e.parentNode,k_(e),t)}static after(e,t){return new kq(e.parentNode,k_(e)+1,t)}}var kY=((g=kY||(kY={}))[g.LTR=0]="LTR",g[g.RTL=1]="RTL",g);let kZ=kY.LTR,kK=kY.RTL;function kX(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let kJ=kX("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),kQ=kX("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),k0=Object.create(null),k1=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);k0[t]=n,k0[n]=-t}function k2(e){return e<=247?kJ[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?kQ[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let k5=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class k3{get dir(){return this.level%2?kK:kZ}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==n)return o;(i<0||(0!=r?r<0?s.from<t:s.to>t:e[i].level>s.level))&&(i=o)}}if(i<0)throw RangeError("Index out of range");return i}}let k4=[];function k6(e){return[new k3(0,e,0)]}let k8="",k9=A7.define(),k7=A7.define(),Te=A7.define(),Tt=A7.define(),Tn=A7.define(),Tr=A7.define(),Ti=A7.define(),To=A7.define(),Ts=A7.define(),Ta=A7.define({combine:e=>e.some(e=>e)}),Tl=A7.define({combine:e=>e.some(e=>e)}),Tu=A7.define();class Tc{constructor(e,t,n,r,i,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=o}map(e){return e.empty?this:new Tc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Tc(A6.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let Th=MA.define({map:(e,t)=>e.map(t)}),Td=MA.define();function Tf(e,t,n){let r=e.facet(Tt);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let Tp=A7.define({combine:e=>!e.length||e[0]}),Tg=0,Tm=A7.define({combine:e=>e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})});class Tv{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Tm.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Tm.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:i,decorations:o}=t||{};return new Tv(Tg++,e,n,r,e=>{let t=[];return o&&t.push(Tw.of(t=>{let n=t.plugin(e);return n?o(n):kb.none})),i&&t.push(i(e)),t})}static fromClass(e,t){return Tv.define((t,n)=>new e(t,n),t)}}class Ty{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Tf(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Tf(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null==(t=this.value)?void 0:t.destroy)try{this.value.destroy()}catch(t){Tf(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let Tx=A7.define(),Tb=A7.define(),Tw=A7.define(),TS=A7.define(),TC=A7.define(),TA=A7.define(),TM=A7.define();function Tk(e,t){let n=e.state.facet(TM);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return Mj.spans(r,t.from,t.to,{point(){},span(e,n,r,o){let s=e-t.from,a=n-t.from,l=i;for(let e=r.length-1;e>=0;e--,o--){let n=r[e].spec.bidiIsolate,i;if(null==n&&(n=function(e,t,n){for(let r=t;r<n;r++){let t=k2(e.charCodeAt(r));if(1==t)break;if(2==t||4==t)return kK}return kZ}(t.text,s,a)),o>0&&l.length&&(i=l[l.length-1]).to==s&&i.direction==n)i.to=a,l=i.inner;else{let e={from:s,to:a,direction:n,inner:[]};l.push(e),l=e.inner}}}}),i}let TT=A7.define();function TI(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(TT)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(r=Math.max(r,s.top)),null!=s.bottom&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}let TD=A7.define();class TO{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new TO(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,i=0,o=0;;){let s=Math.min(r<e.length?e[r].fromB:1e9,i<t.length?t[i]:1e9);if(1e9==s)break;let a=s+o,l=s,u=a;for(;;)if(i<t.length&&t[i]<=l){let n=t[i+1];i+=2,l=Math.max(l,n);for(let t=r;t<e.length&&e[t].fromB<=l;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(r<e.length&&e[r].fromB<=l){let t=e[r++];l=Math.max(l,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new TO(a,u,s,l))}return n}}class TE{constructor(e,t,n){for(let r of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=AJ.empty(this.startState.doc.length),n))this.changes=this.changes.compose(r.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new TO(e,t,n,i))),this.changedRanges=r}static create(e,t,n){return new TE(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}let T_=[];class TR{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return T_}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;null==t[r]&&e.removeAttribute(r)}for(let n in t){let r=t[n];"style"==n?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=k_(this.dom),r=this.length?e>0:t>0;return new kq(this.parent.dom,n+ +!!r,0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof TN)return e;return null}static get(e){return e.cmTile}}class TP extends TR{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t=this.dom,n=null,r,i=(null==e?void 0:e.node)==t?e:null,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=s.dom&&(i.written=!0),s.dom.parentNode==t)for(;r&&r!=s.dom;)r=TL(r);else t.insertBefore(s.dom,r);n=s.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=TL(r);this.length=o}}function TL(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class TN extends TP{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=TR.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&i++,r=t.pop()}else{let o=n.children[r++];if(o instanceof TB)t.push(r),n=o,r=0;else{let t=i+o.length,n=e(o,i);if(void 0!==n)return n;i=t+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,o=-1;if(this.blockTiles((s,a)=>{let l=a+s.length;if(e>=a&&e<=l){if(s.isWidget()&&t>=-1&&t<=1){if(32&s.flags)return!0;16&s.flags&&(n=void 0)}(a<e||e==l&&(t<-1?s.length:s.covers(1)))&&(!n||!s.isWidget()&&n.isWidget())&&(n=s,r=e-a),(l>e||e==a&&(t>1?s.length:s.covers(-1)))&&(!i||!s.isWidget()&&i.isWidget())&&(i=s,o=e-a)}}),!n&&!i)throw Error("No tile at position "+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:o}}}class TB extends TP{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new TB(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class TF extends TP{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new TF(t||document.createElement("div"),e);return t&&n||(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,o=null,s=-1;!function e(a,l){for(let u=0,c=0;u<a.children.length&&c<=l;u++){let h=a.children[u],d=c+h.length;d>=l&&(h.isComposite()?e(h,l-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}(o,h)))&&(d>l||32&h.flags)?(o=h,s=l-c):(c<l||16&h.flags&&!h.isHidden)&&(r=h,i=l-c)),c=d}}(this,e);let a=(t<0?r:o)||r||o;return a?{tile:a,offset:a==r?i:s}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=kO(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new kq(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,16&e.flags?1:32&e.flags?-1:t);let i=n.tile.parent,o=!1;for(let e of i.children){if(o)return new kq(e.dom,0);e==n.tile&&(o=!0)}}return new kq(this.dom,0)}}class Tj extends TP{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new Tj(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class Tz extends TR{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,o=0;0==e&&t<0||e==n&&t>=0?!(kf.chrome||kf.gecko)&&(e?(r--,o=1):i<n&&(i++,o=-1)):t<0?r--:i<n&&i++;let s=kH(this.dom,r,i).getClientRects();if(!s.length)return null;let a=s[(o?o<0:t>=0)?0:s.length-1];return kf.safari&&!o&&0==a.width&&(a=Array.prototype.find.call(s,e=>e.width)||a),o?kN(a,o<0):a||null}static of(e,t){let n=new Tz(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class TV extends TR{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return kN(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let i=r?t.length-1:0;n=t[i],e>0?0!=i:i!=t.length-1&&!(n.top<n.bottom);i+=r?-1:1);return kN(n,!r)}}get overrideDOMText(){if(!this.length)return AN.empty;let{root:e}=this;if(!e)return AN.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,i){return!i&&(i=e.toDOM(t),e.editable||(i.contentEditable="false")),new TV(i,n,e,r)}}class TH extends TR{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return AN.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class T${constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:o,parents:s}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(i==r.children.length){if(!e&&!s.length)break;n&&n.leave(r),o=!!r.breakAfter,({tile:r,index:i}=s.pop()),i++}else{let a=r.children[i],l=a.breakAfter;(t>0?a.length<=e:a.length<e)&&(!n||!1!==n.skip(a,0,a.length)||!a.isComposite)?(o=!!l,i++,e-=a.length):(s.push({tile:r,index:i}),r=a,i=0,n&&a.isComposite()&&n.enter(a))}else if(i==r.length)o=!!r.breakAfter,({tile:r,index:i}=s.pop()),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;return this.tile=r,this.index=i,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class TW{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class TG{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var i;this.flushBuffer();let o=this.ensureMarks(t,n),s=o.lastChild;s&&s.isText()&&!(8&s.flags)&&s.length+e.length<512?(this.cache.reused.set(s,2),(o.children[o.children.length-1]=new Tz(s.dom,s.text+e)).parent=o):o.append(r||Tz.of(e,null==(i=this.cache.find(Tz))?void 0:i.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?TJ(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof Tj&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(TJ(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=TR.get(n.dom);e&&e.setDOM(TJ(n.dom))}let e=Tj.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=TR.get(e.text);i&&this.cache.reused.set(i,2);let o=new Tz(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let i=this.ensureMarks(t,n);r||16&e.flags||i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=TX);let r=TF.start(e,t||(null==(n=this.cache.find(TF))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let r=this.curLine;for(let i=e.length-1;i>=0;i--){let o=e[i],s;if(t>0&&(s=r.lastChild)&&s instanceof Tj&&s.mark.eq(o))r=s,t--;else{let e=Tj.of(o,null==(n=this.cache.find(Tj,e=>e.mark.eq(o)))?void 0:n.dom);r.append(e),r=e,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!TK(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(kf.ios&&TK(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(T0,0,32)||new TV(T0.toDOM(),0,T0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=102*e.rank+e.value.rank,n=new TW(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&0>(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to);)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof TB&&r.wrapper.eq(n.wrapper))t=r;else{let r=TB.of(n.wrapper,null==(e=this.cache.find(TB,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(r),t=r}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(TH,void 0,1);return n&&(n.flags=t),n||new TH(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class TU{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error("Ran out of text content when drawing inline views");this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let Tq=[TV,TF,Tz,Tj,TH,TB,TN];for(let e=0;e<Tq.length;e++)Tq[e].bucket=e;class TY{constructor(e){this.view=e,this.buckets=Tq.map(()=>[]),this.index=Tq.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],o=this.index[r];for(let e=i.length-1;e>=0;e--){let s=(e+o)%i.length,a=i[s];if((!t||t(a))&&!this.reused.has(a))return i.splice(s,1),s<o&&this.index[r]--,this.reused.set(a,n),a}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,o=0;;i++){if(i==r.length){if(o)return null;o=1,i=0}let s=r[i];if(!this.reused.has(s)&&(0==o?s.widget.compare(e):s.widget.constructor==e.constructor&&e.updateDOM(s.dom,this.view,s.widget))){if(r.splice(i,1),i<this.index[0]&&this.index[0]--,s.widget==e&&s.length==t&&(497&s.flags)==n)return this.reused.set(s,1),s;return this.reused.set(s,2),new TV(s.dom,t,e,-498&s.flags|n)}}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class TZ{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new TY(e),this.text=new TU(e.state.doc),this.builder=new TG(this.cache,new TN(e,e.contentDOM),Mj.iter(n)),this.cache.reused.set(t,2),this.old=new T$(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,o=0;;){let s=o<e.length?e[o++]:null,a=s?s.fromA:this.old.root.length;if(a>r){let e=a-r;this.preserve(e,!o,!s),r=a,i+=e}if(!s)break;t&&s.fromA<=t.range.fromA&&s.toA>=t.range.toA?(this.forward(s.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,s.toA),this.emit(t.range.toB,s.toB)):(this.forward(s.fromA,s.toA),this.emit(i,s.toB)),i=s.toB,r=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Tj&&t.push(r.mark)}return t}(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?TV.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.ensureLine(null),this.builder.addInlineWidget(o,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)):this.builder.addText(e.text,r,i,this.cache.reuse(e)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof TH)this.cache.add(e);else{if(!(e instanceof Tj))return!1;this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Tj&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=i=0):e instanceof Tj&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,o=Mj.spans(this.decorations,e,t,{point:(e,t,o,s,a,l)=>{var u,c,h;if(o instanceof kC){if(this.disallowBlockEffectsFor[l]){if(o.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=s.length,a>s.length)r.continueWidget(t-e);else{let i,l=o.widget||(o.block?TQ.block:TQ.inline),c=(i=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(i|=256),i),h=this.cache.findWidget(l,t-e,c)||TV.of(l,this.view,t-e,c);o.block?(o.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(h)):(r.ensureLine(n),r.addInlineWidget(h,s,a))}n=null}else{let e,t;c=n,e=(h=o).spec.attributes,t=h.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&kp(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,o,s)=>{for(let i=e;i<t;){let a=this.text.next(Math.min(512,t-i));null==a?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(a,o,i==e?s:o.length),i+=a.length),n=null}i=o.length}});this.openWidget=o>i,this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=TR.get(r);if(r==this.view.contentDOM)break;e instanceof Tj?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof TB||("DIV"!=r.nodeName||n||r==this.view.contentDOM?n||t.push(Tj.of(new kw({tagName:r.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}(r)}),r)):n=new TF(r,TX))}return{line:n,marks:t}}}function TK(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}let TX={class:"cm-line"};function TJ(e){let t=TR.get(e);return t&&t.setDOM(e.cloneNode()),e}class TQ extends ky{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}TQ.inline=new TQ("span"),TQ.block=new TQ("div");let T0=new class extends ky{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class T1{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=kb.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new TN(e,e.contentDOM),this.updateInner([new TO(0,0,0,e.state.doc.length)],null)}update(e){var t,n,r,i,o,s,a,l,u;let c,h,d,f=e.changedRanges;this.minWidth>0&&f.length&&(f.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let p=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null==(t=this.domChanged)?void 0:t.newSel)?p=this.domChanged.newSel.head:(n=e.changes,r=this.hasComposition,c=!1,r&&n.iterChangedRanges((e,t)=>{e<r.to&&t>r.from&&(c=!0)}),c||e.selectionSet||(p=e.state.selection.main.head)));let g=p>-1?function(e,t,n){let r=T5(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc;return{range:new TO(l.mapPos(o),l.mapPos(s),o,s),text:i}}(this.view,e.changes,p):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;f=new TO(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(f.slice())}this.hasComposition=g?{from:g.range.fromB,to:g.range.toB}:null,(kf.ie||kf.chrome)&&!g&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let m=this.decorations,v=this.blockWrappers;this.updateDeco();let y=(i=m,o=this.decorations,s=e.changes,h=new T3,Mj.compare(i,o,s,h),h.changes);y.length&&(f=TO.extendWithRanges(f,y));let x=(a=v,l=this.blockWrappers,u=e.changes,d=new T4,Mj.compare(a,l,u,d),d.changes);return x.length&&(f=TO.extendWithRanges(f,x)),g&&!f.some(e=>e.fromA<=g.range.fromA&&e.toA>=g.range.toA)&&(f=g.range.addToSet(f.slice())),(!(2&this.tile.flags)||0!=f.length)&&(this.updateInner(f,g),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new TZ(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&TR.get(t.text)&&r.cache.reused.set(TR.get(t.text),2),this.tile=r.run(e,t),T2(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=kf.chrome||kf.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof T6&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(Td)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,s=!o&&!(this.view.state.facet(Tp)||r.tabIndex>-1)&&kD(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||t||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),kf.gecko&&l.empty&&!this.hasComposition&&1==(n=u).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(e,u.node.childNodes[u.offset]||null)),u=c=new kq(e,0),a=!0}let h=this.view.observer.selectionRange;!a&&h.focusNode&&(kE(u.node,u.offset,h.anchorNode,h.anchorOffset)&&kE(c.node,c.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,l))||(this.view.observer.ignore(()=>{kf.android&&kf.chrome&&r.contains(h.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let e=kT(this.view.root);if(e)if(l.empty){if(kf.gecko){var t,n;let e=(t=u.node,n=u.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?kG:kU)(u.node,u.offset);t&&(u=new kq(t.node,t.offset))}}e.collapse(u.node,u.offset),null!=l.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=l.bidiLevel)}else if(e.extend){e.collapse(u.node,u.offset);try{e.extend(c.node,c.offset)}catch(e){}}else{let t=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),t.setEnd(c.node,c.offset),t.setStart(u.node,u.offset),e.removeAllRanges(),e.addRange(t)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new kq(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new kq(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&kE(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=kT(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=0==kL(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!TR.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,o,s=-1,a=!1;return(this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(i=!0)}else{let u=l+t.length;if(l<=e&&(n=t,r=e-l,i=u<e),u>=e&&!o&&(o=t,s=e-l,a=l>e),l>e&&o)return!0}}),n||o)?(i&&o?n=null:a&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(s,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof T6?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let r of t.children){if(r.length>=n){let t=e(r,n);if(t)return t}if((n-=r.length)<0)break}else if(t.isText()&&n<t.length){let e=AG(t.text,n);if(e==n)return null;let r=kH(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==kY.LTR,l=0,u=(e,c,h)=>{for(let d=0;d<e.children.length&&!(c>r);d++){let r=e.children[d],f=c+r.length,p=r.dom.getBoundingClientRect(),{height:g}=p;if(h&&!d&&(l+=p.top-h.top),r instanceof TB)f>n&&u(r,c,p);else if(c>=n&&(l>0&&t.push(-l),t.push(g+l),l=0,o)){let e=r.dom.lastChild,t=e?kO(e):[];if(t.length){let e=t[t.length-1],n=a?e.right-p.left:p.right-e.left;n>s&&(s=n,this.minWidth=i,this.minWidthFrom=c,this.minWidthTo=f)}}h&&d==e.children.length-1&&(l+=h.bottom-p.bottom),c=f+r.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?kY.RTL:kY.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=kO(r.dom);if(1!=e.length)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement("div"),n,r,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=kO(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.view.state.doc.length;if(o>n){let r=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(kb.replace({widget:new T6(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return kb.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Tw).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(TC).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(Mj.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(TS).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){var t;if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(Tu))try{if(t(this.view,e.range,e))return!0}catch(e){Tf(this.view.state,e,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,null!=(t=n.assoc)?t:n.empty?0:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=TI(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(!function(e,t,n,r,i,o,s,a){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,h=!1;c&&!h;)if(1==c.nodeType){let e,d=c==l.body,f=1,p=1;if(d)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:f,scaleY:p}=kB(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let g=0,m=0;if("nearest"==i)t.top<e.top+s?(m=t.top-(e.top+s),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+s)):t.bottom>e.bottom-s&&(m=t.bottom-e.bottom+s,n<0&&t.top-m<e.top&&(m=t.top-(e.top+s)));else{let r=t.bottom-t.top,o=e.bottom-e.top;m=("center"==i&&r<=o?t.top+r/2-o/2:"start"==i||"center"==i&&n<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==r?t.left<e.left+o?(g=t.left-(e.left+o),n>0&&t.right>e.right+g&&(g=t.right-e.right+o)):t.right>e.right-o&&(g=t.right-e.right+o,n<0&&t.left<e.left+g&&(g=t.left-(e.left+o))):g=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==a?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m)if(d)u.scrollBy(g,m);else{let e=0,n=0;if(m){let e=c.scrollTop;c.scrollTop+=m/p,n=(c.scrollTop-e)*p}if(g){let t=c.scrollLeft;c.scrollLeft+=g/f,e=(c.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-g)&&(r="nearest"),n&&1>Math.abs(n-m)&&(i="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==kY.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(n.head,1);e&&e.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){T2(this.tile)}}function T2(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let r of(null==n&&e.destroy(),e.children))T2(r,t)}function T5(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=kG(n.focusNode,n.focusOffset),i=kU(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let t=TR.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let e=TR.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let T3=class{constructor(){this.changes=[]}compareRange(e,t){kM(e,t,this.changes)}comparePoint(e,t){kM(e,t,this.changes)}boundChange(e){kM(e,e,this.changes)}};class T4{constructor(){this.changes=[]}compareRange(e,t){kM(e,t,this.changes)}comparePoint(){}boundChange(e){kM(e,e,this.changes)}}class T6 extends ky{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function T8(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==kx.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function T9(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let t=function(e,t,n,r,i){var o;let s=r.head-e.from,a=k3.find(t,s,null!=(o=r.bidiLevel)?o:-1,r.assoc),l=t[a],u=l.side(i,n);if(s==u){let e=a+=i?1:-1;if(e<0||e>=t.length)return null;s=(l=t[a=e]).side(!i,n),u=l.side(i,n)}let c=AG(e.text,s,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),k8=e.text.slice(Math.min(s,c),Math.max(s,c));let h=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return h&&c==u&&h.level+ +!i<l.level?A6.cursor(h.side(!i,n)+e.from,h.forward(i,n)?1:-1,h.level):A6.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}(i,o,s,a,n),u=k8;if(!t){if(i.number==(n?e.state.doc.lines:1))return a;u="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return t;l=r(u)}a=t}}function T7(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,o)=>{if(t>e&&t<i){let o=r||n||(t-e<i-t?-1:1);t=o<0?e:i,r=o}});if(!r)return t}}function Ie(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let t=T7(e,i.from,0);t!=i.from&&(o=A6.cursor(t,-1))}else{let t=T7(e,i.from,-1),n=T7(e,i.to,1);(t!=i.from||n!=i.to)&&(o=i.undirectional?A6.undirectionalRange(i.from,i.to):A6.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?A6.create(n,t.mainIndex):t}function It(e,t,n){let r=T7(e.state.facet(TA).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:A6.cursor(r,r<n.from?1:-1)}class In{constructor(e,t){this.pos=e,this.assoc=t}}function Ir(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),o=i.top+e.viewState.paddingTop,{x:s,y:a}=t,l=a-o,u;for(;;){if(l<0)return new In(0,1);if(l>e.viewState.docHeight)return new In(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==r)break;if(u.type==kx.Text){if(r<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?u.from:u.to,r>0?-1:1);if(t&&(r<0?t.top<=l+o:t.bottom>=l+o))break}let t=e.viewState.heightOracle.textHeight/2;l=r>0?u.bottom+t:u.top-t}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==kx.Text){let t=function(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+MJ(s,o,e.state.tabSize)}(e,i,u,s,a);return new In(t,t==u.from?1:-1)}}if(u.type!=kx.Text)return l<(u.top+u.bottom)/2?new In(u.from,1):new In(u.to,-1);let c=e.docView.lineAt(u.from,2);return c&&c.length==u.length||(c=e.docView.lineAt(u.from,-2)),new Ii(e,s,a,e.textDirectionAt(u.from)).scanTile(c,u.from)}class Ii{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[k3.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[k3.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r,i,o=0,s=e.length-1,a=new Set,l=this.bidiIn(e[0],e[s]),u=-1,c=1e9,h;for(;o<s;){let n=s-o,d=o+s>>1;i:if(a.has(d)){let e=o+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!a.has(e)){d=e;break i}++e==s&&(e=o)}break}a.add(d);let f=t(d);if(f)for(let t=0;t<f.length;t++){let n=f[t],a=0;if(0!=n.width||!(f.length>1)){if(n.bottom<this.y)(!r||r.bottom<n.bottom)&&(r=n),a=1;else if(n.top>this.y)(!i||i.top>n.top)&&(i=n),a=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<c&&(u=d,c=t,h=n),e&&(a=e<0==(this.baseDir==kY.LTR)?-1:1)}-1==a&&(!l||this.baseDirAt(e[d],1))?s=d:1==a&&(!l||this.baseDirAt(e[d+1],-1))&&(o=d+1)}}}if(!h){if(!i&&!r)return{i:e[0],after:!1};let n=r&&(!i||this.y-r.bottom<i.top-this.y)?r:i;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(c&&!n){let{top:n,bottom:o}=h;if(r&&r.bottom>(n+n+o)/3)return this.y=r.bottom-1,this.scan(e,t,!0);if(i&&i.top<(n+o+o)/3)return this.y=i.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==kY.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=AG(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,o=n[r+1]-t;return kH(e.dom,i,o).getClientRects()});return r.after?new In(n[r.i+1],-1):new In(n[r.i],1)}scanTile(e,t){if(!e.length)return new In(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:kH(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],o=n[r.i];return i.isText()?this.scanText(i,o):i.isComposite()?this.scanTile(i,o):r.after?new In(n[r.i+1],-1):new In(o,1)}}class Io{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(M_.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=""}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=TR.get(r),o=r.nextSibling;if(o==t){(null==i?void 0:i.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let s=TR.get(o);(i&&s?i.breakAfter:(i?i.breakAfter:kR(r))||kR(o)&&("BR"!=r.nodeName||(null==i?void 0:i.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=TR.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}(o,t)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,o=1,s;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=r.exec(t))&&(i=s.index,o=s[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=i+o}}readNode(e){let t=TR.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<kL(t))return!1;if(t==e)return!0;n=k_(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class Is{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Ia{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:o}=e.docView,s=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=function e(t,n,r,i){if(t.isComposite()){let o=-1,s=-1,a=-1,l=-1;for(let u=0,c=i,h=i;u<t.children.length;u++){let i=t.children[u],d=c+i.length;if(c<n&&d>r)return e(i,n,r,c);if(d>=n&&-1==o&&(o=u,s=c),c>r&&i.dom.parentNode==t.dom){a=u,l=h;break}h=d,c=d+i.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(o?t.children[o-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=i||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new Is(n,r)),(i!=n||o!=r)&&t.push(new Is(i,o))),t}(e),n=new Io(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?A6.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!kI(e.contentDOM,t.focusNode)?s.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!kI(e.contentDOM,t.anchorNode)?s.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),a=e.viewport;if((kf.ios||kf.chrome)&&n!=r&&Math.min(n,r)<=s.main.from&&Math.max(n,r)>=s.main.to&&(a.from>0||a.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),o=a.from-t,s=a.to-i;(0==o||1==o||0==t)&&(0==s||-1==s||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&s.ranges.length>1)this.newSel=s.replaceRange(A6.range(r,n));else if(e.lineWrapping&&r==n&&!(s.main.empty&&s.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=A6.create([A6.cursor(n,r)])}else this.newSel=A6.single(r,n)}}}function Il(e,t){let n,{newSel:r}=t,{state:i}=e,o=i.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,a=o.from,l=null;(8===s||kf.android&&t.text.length<r-e)&&(a=o.to,l="end");let u=i.doc.sliceString(e,r,""),c,h;!o.empty&&o.from>=e&&o.to<=r&&(t.typeOver||u!=t.text)&&u.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&u.slice(o.to-e)==t.text.slice(c=t.text.length-(u.length-(o.to-e)))?n={from:o.from,to:o.to,insert:AN.of(t.text.slice(o.from-e,c).split(""))}:(h=Ic(u,t.text,a-e,l))&&(kf.chrome&&13==s&&h.toB==h.from+2&&""==t.text.slice(h.from,h.toB)&&h.toB--,n={from:e+h.from,to:e+h.toA,insert:AN.of(t.text.slice(h.from,h.toB).split(""))})}else r&&(!e.hasFocus&&i.facet(Tp)||Ih(r,o))&&(r=null);if(!n&&!r)return!1;if((kf.mac||kf.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=A6.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:AN.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:i.toText(e.inputState.insertingText)}:kf.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=A6.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:AN.of([" "])}),n)return Iu(e,n,r,s);if(!r||Ih(r,o))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),"select.pointer"==(n=e.inputState.lastSelectionOrigin)&&(r=Ie(i.facet(TA).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}}function Iu(e,t,n,r=-1){let i;if(kf.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(kf.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&k$(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&k$(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&k$(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>i||(i=function(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,r=n<0?o.from:o.to,a=T7(i.facet(TA).map(t=>t(e)),r,n);t.from==a&&(s=a)}if(s>-1)r={changes:t,selection:A6.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?i.sliceDoc(o.from,t.from):"",s=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=i.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let l=e.state.sliceDoc(t.from,t.to),u,c=n&&T5(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let h=o.to-t.to;r=i.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let r=n.to-h,c=r-l.length;if(e.state.sliceDoc(c,r)!=l||r>=u.from&&c<=u.to)return{range:n};let d=i.changes({from:c,to:r,insert:t.insert}),f=n.to-o.to;return{changes:d,range:a?A6.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(d)}})}else r={changes:s,selection:a&&i.selection.replaceRange(a)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}(e,t,n));return e.state.facet(Tr).some(n=>n(e,t.from,t.to,s,a))||e.dispatch(a()),!0}function Ic(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if("end"==r){let e=Math.max(0,o-Math.min(s,a));n-=s+e-o}if(s<o&&e.length<t.length){let e=n<=o&&n>=s?o-n:0;o-=e,a=o+(a-s),s=o}else if(a<o){let e=n<=o&&n>=a?o-n:0;o-=e,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function Ih(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class Id{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,kf.safari&&e.contentDOM.addEventListener("input",()=>null),kf.gecko&&function(e){IL.has(e)||(IL.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(r=TR.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(If(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(If(t.value,r))}}for(let e in Ix)n(e).handlers.push(Ix[e]);for(let e in Ib)n(e).observers.push(Ib[e]);return t}(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let i=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=i&&(r.removeEventListener(e,this.handleEvent),o=null),o||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&0>Im.indexOf(e.keyCode)&&(this.tabFocusMode=-1),kf.android&&kf.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(kf.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(Ip.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||Ig.indexOf(e.key)>-1&&e.ctrlKey)){var t;let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&kf.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&(t=this.view.win).visualViewport&&t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return 229!=e.keyCode&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,k$(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(kf.safari&&!kf.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function If(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){Tf(n.state,e)}}}let Ip=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ig="dthko",Im=[16,17,18,20,91,92,224,225];function Iv(e){return .7*Math.max(0,e)+8}class Iy{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=kF(e.contentDOM),this.atoms=e.state.facet(TA).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(M_.allowMultipleSelections)&&function(e,t){let n=e.state.facet(k9);return n.length?n[0](t):kf.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=kT(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==ID(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>(t=this.startEvent,Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))))return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=TI(this.view);e.clientX-l.left<=i+6?n=-Iv(i-e.clientX):e.clientX+l.right>=s-6&&(n=Iv(e.clientX-s)),e.clientY-l.top<=o+6?r=-Iv(o-e.clientY):e.clientY+l.bottom>=a-6&&(r=Iv(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Ie(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let Ix=Object.create(null),Ib=Object.create(null),Iw=kf.ie&&kf.ie_version<15||kf.ios&&kf.webkit_version<604;function IS(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function IC(e,t){t=IS(e.state,To,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(null!=IE&&n.selection.ranges.every(e=>e.empty)&&IE==o.toString()){let e=-1;r=n.changeByRange(r=>{let a=n.doc.lineAt(r.from);if(a.from==e)return{range:r};e=a.from;let l=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:A6.cursor(r.from+l.length)}})}else r=s?n.changeByRange(e=>{let t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:A6.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}function IA(e,t,n,r){if(1==r)return A6.cursor(t,n);{if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return A6.cursor(t);0==o?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=AG(i.text,o,!1):a=AG(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let e=AG(i.text,s,!1);if(r(i.text.slice(e,s))!=l)break;s=e}for(;a<i.length;){let e=AG(i.text,a);if(r(i.text.slice(a,e))!=l)break;a=e}return A6.undirectionalRange(s+i.from,a+i.from)}(e.state,t,n);let i=e.docView.lineAt(t,n),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,A6.undirectionalRange(s,a)}}Ib.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Ib.wheel=Ib.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},Ix.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),Ib.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")},Ib.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Ix.mousedown=(e,t)=>{var n,r;let i,o,s;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let a=null;for(let n of e.state.facet(Te))if(a=n(e,t))break;if(a||0!=t.button||(n=e,r=t,i=n.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),o=ID(r),s=n.state.selection,a={update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),s=s.map(e.changes))},get(e,t,r){let a=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),l,u=IA(n,a.pos,a.assoc,o);if(i.pos!=a.pos&&!t){let e=IA(n,i.pos,i.assoc,o),t=Math.min(e.from,u.from),r=Math.max(e.to,u.to);u=t<u.from?A6.range(t,r,u.assoc):A6.range(r,t,u.assoc)}return t?s.replaceRange(s.main.extend(u.from,u.to,u.assoc)):r&&1==o&&s.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return A6.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n))}return null}(s,a.pos))?l:r?s.addRange(u):A6.create([u])}}),a){let n=!e.hasFocus;e.inputState.startMouseSelection(new Iy(e,t,a,n)),n&&e.observer.ignore(()=>{kV(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let IM=kf.ie&&kf.ie_version<=11,Ik=null,IT=0,II=0;function ID(e){if(!IM)return e.detail;let t=Ik,n=II;return Ik=e,II=Date.now(),IT=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(IT+1)%3:1}function IO(e,t,n,r){let i;if(!(n=IS(e.state,To,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=r&&s&&((i=e.state.facet(k7)).length?i[0](t):kf.mac?!t.altKey:!t.ctrlKey)?{from:s.from,to:s.to}:null,l={from:o,insert:n},u=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Ix.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=A6.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",IS(e.state,Ts,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},Ix.dragend=e=>(e.inputState.draggedContent=null,!1),Ix.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&IO(e,t,r.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return IO(e,t,n,!0),!0}return!1},Ix.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=Iw?null:t.clipboardData;return n?(IC(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(!function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),IC(e,n.value)},50)}(e),!1)};let IE=null;Ix.copy=Ix.cut=(e,t)=>{if(!kD(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:IS(e,Ts,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!i)return!1;IE=i?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Iw?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,n),!1)};let I_=Mw.define();function IR(e,t){let n=[];for(let r of e.facet(Ti)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:I_.of(!0)}):null}function IP(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=IR(e.state,t);n?e.dispatch(n):e.update([])}},10)}Ib.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),IP(e)},Ib.blur=e=>{e.observer.clearSelectionRange(),IP(e)},Ib.compositionstart=Ib.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},Ib.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,kf.chrome&&kf.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},Ib.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Ix.beforeinput=(e,t)=>{var n,r;let i;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let r=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),i=t.getTargetRanges();if(r&&i.length){let t=i[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return Iu(e,{from:n,to:o,insert:e.state.toText(r)},null),!0}}if(kf.chrome&&kf.android&&(i=Ip.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){let t=(null==(r=window.visualViewport)?void 0:r.height)||0;setTimeout(()=>{var n;((null==(n=window.visualViewport)?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return kf.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),kf.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>Ib.compositionend(e,t),20),!1};let IL=new Set,IN=["pre-wrap","normal","pre-line","break-spaces"],IB=!1;class IF{constructor(e){this.lineWrapping=e,this.doc=AN.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return IN.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,i,o){let s=IN.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,a){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class Ij{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Iz{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return"number"==typeof this._content?kx.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof kC?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Iz(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var IV=((m=IV||(IV={}))[m.ByPos=0]="ByPos",m[m.ByHeight=1]="ByHeight",m[m.ByPosNoHeight=2]="ByPosNoHeight",m);class IH{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(IB=!0),this.height=e)}replace(e,t,n){return IH.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,o=n.doc;for(let s=r.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:u,toB:c}=r[s],h=i.lineAt(a,IV.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=l?h:i.lineAt(l,IV.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;s>0&&h.from<=r[s-1].toA;)a=r[s-1].fromA,u=r[s-1].fromB,s--,a<h.from&&(h=i.lineAt(a,IV.ByPosNoHeight,n,0,0));u+=h.from-a,a=h.from;let f=IK.build(n.setDoc(o),e,u,c);i=I$(i,i.replace(a,l,f))}return i.updateHeight(n,0)}static empty(){return new IU(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,i=0;for(;;)if(t==n)if(r>2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else if(i>2*r){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,i-=t.size}else break;else if(r<i){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(i+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new IY(IH.of(e.slice(0,t)),o,IH.of(e.slice(n)))}}function I$(e,t){return e==t?e:(e.constructor!=t.constructor&&(IB=!0),t)}IH.prototype.size=1;let IW=kb.replace({});class IG extends IH{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Iz(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Iz(r,0,n,this.spaceAbove,IW):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let o=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(o):o}forEachLine(e,t,n,r,i,o){e<=i+this.length&&t>=i&&o(this.lineAt(0,IV.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class IU extends IG{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Iz(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof IU||r instanceof Iq&&4&r.flags)&&10>Math.abs(this.length-r.length)?(r instanceof Iq?r=new IU(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):IH.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Iq extends IH{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,o,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);o=t/i,this.length>i+1&&(s=(this.height-t)/(this.length-i-1))}else o=this.height/i;return{firstLine:n,lastLine:r,perLine:o,perChar:s}}blockAt(e,t,n,r){let{firstLine:i,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(i),l=s+o.length*a,u=Math.max(n,e-l/2);return new Iz(o.from,o.length,u,l,0)}{let r=Math.max(0,Math.min(o-i,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(i+r);return new Iz(a,l,n+s*r,s,0)}}lineAt(e,t,n,r,i){if(t==IV.ByHeight)return this.blockAt(e,n,r,i);if(t==IV.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new Iz(t,r-t,0,0,0)}let{firstLine:o,perLine:s,perChar:a}=this.heightMetrics(n,i),l=n.doc.lineAt(e),u=s+l.length*a,c=l.number-o,h=r+s*c+a*(l.from-i-c);return new Iz(l.from,l.length,Math.max(r,Math.min(h,r+this.height-u)),u,0)}forEachLine(e,t,n,r,i,o){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);for(let u=e,c=r;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-s;c+=a*n+l*(e-i-n)}let r=a+l*t.length;o(new Iz(t.from,t.length,c,r,0)),c+=r,u=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof Iq?n[n.length-1]=new Iq(e.length+r):n.push(null,new Iq(r-1))}if(e>0){let t=n[0];t instanceof Iq?n[0]=new Iq(e+t.length):n.unshift(new Iq(e-1),null)}return IH.of(n)}decomposeLeft(e,t){t.push(new Iq(e-1),null)}decomposeRight(e,t){t.push(null,new Iq(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),s=-1;for(r.from>t&&n.push(new Iq(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++],a=0;i<0&&(a=-i,i=r.heights[r.index++]),-1==s?s=i:Math.abs(i-s)>=.001&&(s=-2);let l=new IU(t,i,a);l.outdated=!1,n.push(l),o+=t+1}o<=i&&n.push(null,new Iq(i-o).updateHeight(e,o));let a=IH.of(n);return(s<0||Math.abs(a.height-this.height)>=.001||Math.abs(s-this.heightMetrics(e,t).perLine)>=.001)&&(IB=!0),I$(this,a)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class IY extends IH{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let o=r+this.left.height,s=i+this.left.length+this.break,a=t==IV.ByHeight?e<o:e<s,l=a?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,o,s);if(this.break||(a?l.to<s:l.from>s))return l;let u=t==IV.ByPosNoHeight?IV.ByPosNoHeight:IV.ByPos;return a?l.join(this.right.lineAt(s,u,n,o,s)):this.left.lineAt(s,u,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let s=r+this.left.height,a=i+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,i,o),t>=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,IV.ByPos,n,r,i);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,i,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&IZ(i,o-1),t<this.length){let e=i.length;this.decomposeRight(t,i),IZ(i,e)}return IH.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?IH.of(this.break?[e,null,t]:[e,t]):(this.left=I$(this.left,e),this.right=I$(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:o}=this,s=t+i.length+this.break,a=null;return(r&&r.from<=t+i.length&&r.more?a=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=s+o.length&&r.more?a=o=o.updateHeight(e,s,n,r):o.updateHeight(e,s,n),a)?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function IZ(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof Iq&&(r=e[t+1])instanceof Iq&&e.splice(t-1,3,new Iq(n.length+1+r.length))}class IK{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof IU?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new IU(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new IG(o,r,n)):(o||i||r>=5)&&this.addLineDeco(r,i,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new IU(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Iq(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof IU)return e;let t=new IU(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof IU||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new IU(0,-1,0));let n=e;for(let e of this.nodes)e instanceof IU&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let i=new IK(n,e);return Mj.spans(t,n,r,i,0),i.finish(n)}}class IX{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&kM(e,t,this.changes,5)}}class IJ{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return kb.replace({widget:new IQ(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class IQ extends ky{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class I0{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=I3,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=kY.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(Tb).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new IF(n),this.stateDeco=I4(t),this.heightMap=IH.empty().applyChanges(this.stateDeco,AN.empty,this.heightOracle.setDoc(t.doc),[new TO(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=kb.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new I1(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?I3:new I6(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(I8(e,this.scaler))})}update(e,t=null){var n,r;let i;this.state=e.state;let o=this.stateDeco;this.stateDeco=I4(this.state);let s=e.changedRanges,a=TO.extendWithRanges(s,(n=this.stateDeco,r=e?e.changes:AJ.empty(this.state.doc.length),i=new IX,Mj.compare(o,n,r,i,0),i.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);IB=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||IB)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Tl)&&(this.mustEnforceCursorAssoc=!0)}measure(){var e;let t,n,{view:r}=this,i=r.contentDOM,o=window.getComputedStyle(i),s=this.heightOracle,a=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?kY.RTL:kY.LTR;let l=this.heightOracle.mustRefreshForWrapping(a)||"refresh"===this.mustMeasureContent,u=i.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let h=0,d=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=kB(i,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,h|=16,l=c=!0)}let f=(parseInt(o.paddingTop)||0)*this.scaleY,p=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=p)&&(this.paddingTop=f,this.paddingBottom=p,h|=18),this.editorWidth!=r.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=r.scrollDOM.clientWidth,h|=16);let g=kF(this.view.contentDOM,!1).y;g!=this.scrollParent&&(this.scrollParent=g,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=kW(this.scrollParent||r.win);let v=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();o=Math.max(o,r.left),s=Math.min(s,r.right),a=Math.max(a,r.top),l=Math.min(t==e.parentNode?i.innerHeight:l,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}})(i,this.paddingTop),y=v.top-this.pixelViewport.top,x=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(c=!0)),!this.inView&&!this.scrollTarget&&(t=(e=r.dom).getBoundingClientRect(),n=e.ownerDocument.defaultView||window,!(t.left<n.innerWidth)||!(t.right>0)||!(t.top<n.innerHeight)||!(t.bottom>0)))return 0;let w=u.width;if((this.contentDOMWidth!=w||this.editorHeight!=r.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=r.scrollDOM.clientHeight,h|=16),c){let e=r.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(e)&&(l=!0),l||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:t,charWidth:n,textHeight:i}=r.docView.measureTextSize();(l=t>0&&s.refresh(a,t,n,i,Math.max(5,w/n),e))&&(r.docView.minWidth=0,h|=16)}for(let t of(y>0&&x>0?d=Math.max(y,x):y<0&&x<0&&(d=Math.min(y,x)),IB=!1,this.viewports)){let n=t.from==this.viewport.from?e:r.docView.measureVisibleLineHeights(t);this.heightMap=(l?IH.empty().applyChanges(this.stateDeco,AN.empty,this.heightOracle,[new TO(0,0,0,r.state.doc.length)]):this.heightMap).updateHeight(s,0,l,new Ij(t.from,n))}IB&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(2&h&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(2&h||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,r)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,r.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new I1(r.lineAt(o-1e3*n,IV.ByHeight,i,0,0).from,r.lineAt(s+(1-n)*1e3,IV.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=r.lineAt(e,IV.ByPos,i,0,0),s;s="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<a.from?o.top:o.bottom-n,a=new I1(r.lineAt(s-500,IV.ByHeight,i,0,0).from,r.lineAt(s+n+500,IV.ByHeight,i,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new I1(this.heightMap.lineAt(n,IV.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,IV.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,IV.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,IV.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=s+Math.max(10,Math.min(n,250)))&&r>o-2e3&&i<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new IJ(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,o=r<<1;if(this.defaultTextDirection!=kY.LTR&&!n)return[];let s=[],a=(r,o,l,u)=>{if(o-r<i)return;let c=this.state.selection.main,h=[c.from];for(let e of(c.empty||h.push(c.to),h))if(e>r&&e<o){a(r,e-10,l,u),a(e+10,o,l,u);return}let d=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-o)<i&&!h.some(t=>e.from<t&&e.to>t));if(!d){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(A6.cursor(o),!1,!0).head;e>r&&(o=e)}let e=this.gapSize(l,r,o,u),i=n||e<2e6?e:2e6;d=new IJ(r,o,e,i)}s.push(d)},l=t=>{var i,s,l;let u,c,h,d,f;if(t.length<o||t.type!=kx.Text)return;let p=(i=t.from,s=t.to,l=this.stateDeco,h=[],d=i,f=0,Mj.spans(l,i,s,{span(){},point(e,t){e>d&&(h.push({from:d,to:e}),f+=e-d),d=t}},20),d<s&&(h.push({from:d,to:s}),f+=s-d),{total:f,ranges:h});if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let r=I5(p,g),o=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-o,n=r+o}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;u=I2(p,e),c=I2(p,n)}else{let n,i,o=p.total*this.heightOracle.charWidth,s=r*this.heightOracle.charWidth,a=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=n.size-n.displaySize);let l=this.pixelViewport.left+a,h=this.pixelViewport.right+a;if(null!=g){let e=I5(p,g),t=((h-l)/2+s)/o;n=e-t,i=e+t}else n=(l-s)/o,i=(h+s)/o;u=I2(p,n),c=I2(p,i)}u>t.from&&a(t.from,u,t,p),c<t.to&&a(c,t.to,t,p)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,r){let i=I5(r,n)-I5(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){IJ.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=kb.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];Mj.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let i=this.visibleRanges[t],o=n[t];(i.from!=o.from||i.to!=o.to)&&(r|=4,e&&e.mapPos(i.from,-1)==o.from&&e.mapPos(i.to,1)==o.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||I8(this.heightMap.lineAt(e,IV.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||I8(this.heightMap.lineAt(this.scaler.fromDOM(e),IV.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return I8(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class I1{constructor(e,t){this.from=e,this.to=t}}function I2({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function I5(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}let I3={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function I4(e){let t=e.facet(Tw).filter(e=>"function"!=typeof e),n=e.facet(TC).filter(e=>"function"!=typeof e);return n.length&&t.push(Mj.join(n)),t}class I6{constructor(e,t,n){let r=0,i=0,o=0;for(let s of(this.viewports=n.map(({from:n,to:i})=>{let o=t.lineAt(n,IV.ByPos,e,0,0).top,s=t.lineAt(i,IV.ByPos,e,0,0).bottom;return r+=s-o,{from:n,to:i,top:o,bottom:s,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r),this.viewports))s.domTop=o+(s.top-i)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),i=s.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(e){return e instanceof I6&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function I8(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Iz(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>I8(e,t)):e._content)}let I9=A7.define({combine:e=>e.join(" ")}),I7=A7.define({combine:e=>e.indexOf(!0)>-1}),De=M2.newName(),Dt=M2.newName(),Dn=M2.newName(),Dr={"&light":"."+Dt,"&dark":"."+Dn};function Di(e,t,n){return new M2(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let Do=Di("."+De,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Dr),Ds={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Da=kf.ie&&kf.ie_version<=11;class Dl{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new kj,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(kf.ie&&kf.ie_version<=11||kf.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&kf.android&&!1!==e.constructor.EDIT_CONTEXT&&!(kf.chrome&&kf.chrome_version<126)&&(this.editContext=new Dh(e),e.state.facet(Tp)&&(e.contentDOM.editContext=this.editContext.editContext)),Da&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null==(e=this.view.docView)?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Tp)?n.root.activeElement!=this.dom:!kD(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(kf.ie&&kf.ie_version<=11||kf.android&&kf.chrome)&&!n.state.selection.main.empty&&r.focusNode&&kE(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=kT(e.root);if(!t)return!1;let n=kf.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Dc(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?Dc(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=kD(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,kL(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:r=kL(n=e)}else{if(n==e)return!0;r=k_(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Ds),Da&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Da&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&k$(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null==(n=this.delayedAndroidKey)?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&kD(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Ia(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Il(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!Ih(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=Du(t,e.previousSibling||e.target.previousSibling,-1),r=Du(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Tp)!=e.state.facet(Tp)&&(e.view.contentDOM.editContext=e.state.facet(Tp)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let r of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Du(e,t,n){for(;t;){let r=TR.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function Dc(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return kE(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}class Dh{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});for(let n in this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:o}=r,s=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let l=a-s>n.text.length;s==this.from&&i<this.from?s=i:a==this.to&&i>this.to&&(a=i);let u=Ic(e.state.sliceDoc(s,a),n.text,(l?r.from:r.to)-s,l?"end":null);if(!u){let t=A6.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Ih(t,r)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+s,to:u.toA+s,insert:AN.of(n.text.slice(u.from,u.toB).split("\n"))};if((kf.mac||kf.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:s,to:a,insert:AN.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);Iu(e,c,A6.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(i<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(r)?1:2}px`;n.push(kb.mark({attributes:{style:e}}).range(i,o))}}}e.dispatch({effects:Td.of(kb.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{let t=kT(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,o,s,a,l)=>{if(n)return;let u=l.length-(o-i);if(r&&o>=r.to)if(r.from==i&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(i+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Dd{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new I0(this,e.state||M_.create(e)),e.scrollTo&&e.scrollTo.is(Th)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Tm).map(e=>new Ty(e)),this.plugins))t.update(this);this.observer=new Dl(this),this.inputState=new Id(this),this.inputState.ensureHandlers(this.plugins),this.docView=new T1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null==(t=document.fonts)?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof MM?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=t.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,s=0,a=null;e.some(e=>e.annotation(I_))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(a=IR(i,o))||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(M_.phrases)!=this.state.facet(M_.phrases))return this.setState(i);r=TE.create(this,i,e),r.flags|=s;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:n,y:r}=this.state.facet(Dd.cursorScrollMargin);c=new Tc(e.empty?e:A6.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",r,n)}for(let e of t.effects)e.is(Th)&&(c=e.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=Dg.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(TD)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(I9)!=r.state.facet(I9)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(Tn))try{e(r)}catch(e){Tf(this.state,e,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!Il(this,u)&&l.force&&k$(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new I0(this,e),this.plugins=e.facet(Tm).map(e=>new Ty(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new T1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Tm),n=e.state.facet(Tm);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Ty(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){Tf(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(kW(n||this.win))i=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,o=e.top}this.updateState=1;let s=this.viewState.measure();if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(e=>{try{return e.read(this)}catch(e){return Tf(this.state,e),Dp}}),u=TE.create(this,this.state,[]),c=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=Dp)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){Tf(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-o)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Tn))e(t)}get themeClasses(){return De+" "+(this.state.facet(I7)?Dn:Dt)+" "+this.state.facet(I9)}updateAttrs(){let e=Dm(this,Tx,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Tp)?"true":"false",class:"cm-content",style:`${kf.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Dm(this,Tb,t);let n=this.observer.ignore(()=>{let n=kv(this.contentDOM,this.contentAttrs,t),r=kv(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Dd.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(TD);let e=this.state.facet(Dd.cspNonce);M2.mount(this.root,this.styleModules.concat(Do).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if((this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e)&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return It(this,e,T9(this,e,t,n))}moveByGroup(e,t){return It(this,e,T9(this,e,t,t=>{var n;let r,i;return n=e.head,i=(r=this.state.charCategorizer(n))(t),e=>{let t=r(e);return i==MO.Space&&(i=t),i==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return A6.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let i=T8(e,t.head,t.assoc||-1),o=r&&i.type==kx.Text&&(e.lineWrapping||i.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),s=e.posAtCoords({x:n==(r==kY.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=s)return A6.cursor(s,n?-1:1)}return A6.cursor(n?i.to:i.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return It(this,e,function(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return A6.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),c=e.documentTop;if(u)null==s&&(s=u.left-l.left),a=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(i);null==s&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-t.from))),a=(o<0?t.top:t.bottom)+c}let h=l.left+s,d=e.viewState.heightOracle.textHeight>>1,f=null!=r?r:d;for(let t=0;;t+=d){let r=a+(f+t)*o,i=Ir(e,{x:h,y:r},!1,o);if(n?r>l.bottom:r<l.top)return A6.cursor(i.pos,i.assoc);let u=e.coordsAtPos(i.pos,i.assoc),c=u?(u.top+u.bottom)/2:0;if(!u||(n?c>a:c<a))return A6.cursor(i.pos,i.assoc,void 0,s)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Ir(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Ir(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r);return kN(n,i[k3.find(i,e-r.from,-1,t)].dir==kY.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Ta)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Df)return k6(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!e(i.inner,o.inner))return!1}return!0}(r.isolates,n=Tk(this,e))))return r.order;n||(n=Tk(this,e));let r=function(e,t,n){if(!e)return[new k3(0,0,+(t==kK))];if(t==kZ&&!n.length&&!k5.test(e))return k6(e.length);if(n.length)for(;e.length>k4.length;)k4[k4.length]=256;let r=[],i=+(t!=kZ);return function e(t,n,r,i,o,s,a){let l=n%2?2:1;!function(e,t,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:t,a=o<r.length?r[o].from:n,l=o?256:i;for(let t=s,n=l,r=l;t<a;t++){let i=k2(e.charCodeAt(t));512==i?i=n:8==i&&4==r&&(i=16),k4[t]=4==i?2:i,7&i&&(r=i),n=i}for(let e=s,t=l,r=l;e<a;e++){let i=k4[e];if(128==i)e<a-1&&t==k4[e+1]&&24&t?i=k4[e]=t:k4[e]=256;else if(64==i){let i=e+1;for(;i<a&&64==k4[i];)i++;let o=e&&8==t||i<n&&8==k4[i]?1==r?1:8:256;for(let t=e;t<i;t++)k4[t]=o;e=i-1}else 8==i&&1==r&&(k4[e]=1);t=i,7&i&&(r=i)}}}(t,o,s,i,l),function(e,t,n,r,i){let o=1==i?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let u=s?r[s-1].to:t,c=s<r.length?r[s].from:n;for(let t=u,n,r,s;t<c;t++)if(r=k0[n=e.charCodeAt(t)])if(r<0){for(let e=a-3;e>=0;e-=3)if(k1[e+1]==-r){let n=k1[e+2],r=2&n?i:4&n?1&n?o:i:0;r&&(k4[t]=k4[k1[e]]=r),a=e;break}}else if(189==k1.length)break;else k1[a++]=t,k1[a++]=n,k1[a++]=l;else if(2==(s=k4[t])||1==s){let e=s==i;l=+!e;for(let t=a-3;t>=0;t-=3){let n=k1[t+2];if(2&n)break;if(e)k1[t+2]|=2;else{if(4&n)break;k1[t+2]|=4}}}}}(t,o,s,i,l),function(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=i<n.length?n[i].from:t;for(let l=s;l<a;){let s=k4[l];if(256==s){let s=l+1;for(;;)if(s==a){if(i==n.length)break;s=n[i++].to,a=i<n.length?n[i].from:t}else if(256==k4[s])s++;else break;let u=1==o,c=u==((s<t?k4[s]:r)==1)?u?1:2:r;for(let t=s,r=i,o=r?n[r-1].to:e;t>l;)t==o&&(t=n[--r].from,o=r?n[r-1].to:e),k4[--t]=c;l=s}else o=s,l++}}}(o,s,i,l),function t(n,r,i,o,s,a,l){let u=o%2?2:1;if(o%2==s%2)for(let c=r,h=0;c<i;){let r=!0,d=!1;if(h==a.length||c<a[h].from){let e=k4[c];e!=u&&(r=!1,d=16==e)}let f=r||1!=u?null:[],p=r?o:o+1,g=c;o:for(;;)if(h<a.length&&g==a[h].from){if(d)break;let t=a[h];if(!r)for(let e=t.to,n=h+1;;){if(e==i)break o;if(n<a.length&&a[n].from==e)e=a[n++].to;else if(k4[e]==u)break o;else break}h++,f?f.push(t):(t.from>c&&l.push(new k3(c,t.from,p)),e(n,t.direction==kZ!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==i||(r?k4[g]!=u:k4[g]==u))break;else g++;f?t(n,c,g,o+1,s,f,l):c<g&&l.push(new k3(c,g,p)),c=g}else for(let c=i,h=a.length;c>r;){let i=!0,d=!1;if(!h||c>a[h-1].to){let e=k4[c-1];e!=u&&(i=!1,d=16==e)}let f=i||1!=u?null:[],p=i?o:o+1,g=c;o:for(;;)if(h&&g==a[h-1].to){if(d)break;let t=a[--h];if(!i)for(let e=t.from,n=h;;){if(e==r)break o;if(n&&a[n-1].to==e)e=a[--n].from;else if(k4[e-1]==u)break o;else break}f?f.push(t):(t.to<c&&l.push(new k3(t.to,c,p)),e(n,t.direction==kZ!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==r||(i?k4[g-1]!=u:k4[g-1]==u))break;else g--;f?t(n,g,c,o+1,s,f,l):g<c&&l.push(new k3(g,c,p)),c=g}}(t,o,s,n,r,i,a)}(e,i,i,n,0,e.length,r),r}(e.text,t,n);return this.bidiCache.push(new Dg(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||kf.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{kV(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),this.plugins))e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var n,r,i,o;return Th.of(new Tc("number"==typeof e?A6.cursor(e):e,null!=(n=t.y)?n:"nearest",null!=(r=t.x)?r:"nearest",null!=(i=t.yMargin)?i:5,null!=(o=t.xMargin)?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Th.of(new Tc(A6.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Tv.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Tv.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=M2.newName(),r=[I9.of(n),TD.of(Di(`.${n}`,e))];return t&&t.dark&&r.push(I7.of(!0)),r}static baseTheme(e){return Ma.lowest(TD.of(Di("."+De,e,Dr)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&TR.get(n)||TR.get(e);return(null==(t=null==r?void 0:r.root)?void 0:t.view)||null}}Dd.styleModule=TD,Dd.inputHandler=Tr,Dd.clipboardInputFilter=To,Dd.clipboardOutputFilter=Ts,Dd.scrollHandler=Tu,Dd.focusChangeEffect=Ti,Dd.perLineTextDirection=Ta,Dd.exceptionSink=Tt,Dd.updateListener=Tn,Dd.editable=Tp,Dd.mouseSelectionStyle=Te,Dd.dragMovesSelection=k7,Dd.clickAddsSelectionRange=k9,Dd.decorations=Tw,Dd.blockWrappers=TS,Dd.outerDecorations=TC,Dd.atomicRanges=TA,Dd.bidiIsolatedRanges=TM,Dd.cursorScrollMargin=A7.define({combine:e=>{let t=5,n=5;for(let r of e)"number"==typeof r?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),Dd.scrollMargins=TT,Dd.darkTheme=I7,Dd.cspNonce=A7.define({combine:e=>e.length?e[0]:""}),Dd.contentAttributes=Tb,Dd.editorAttributes=Tx,Dd.lineWrapping=Dd.contentAttributes.of({class:"cm-lineWrapping"}),Dd.announce=MA.define();let Df=4096,Dp={};class Dg{constructor(e,t,n,r,i,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:kY.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir!=r||t.touchesRange(o.from,o.to)||n.push(new Dg(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function Dm(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&kp(o,n)}return n}let Dv=kf.mac?"mac":kf.windows?"win":kf.linux?"linux":"key";function Dy(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let Dx=Ma.default(Dd.domEventHandlers({keydown:(e,t)=>DM(DS(t.state),e,t,"editor")})),Db=A7.define({enables:Dx}),Dw=new WeakMap;function DS(e){let t=e.facet(Db),n=Dw.get(t);return n||Dw.set(t,n=function(e,t=Dv){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,r,o,s,a)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),h=r.split(/ (?!$)/).map(e=>(function(e,t){let n,r,i,o,s=e.split(/-(?!$)/),a=s[s.length-1];"Space"==a&&(a=" ");for(let e=0;e<s.length-1;++e){let a=s[e];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))"mac"==t?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+a)}return n&&(a="Alt-"+a),r&&(a="Ctrl-"+a),o&&(a="Meta-"+a),i&&(a="Shift-"+a),a})(e,t));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=DC={view:t,prefix:n,scope:e};return setTimeout(()=>{DC==r&&(DC=null)},4e3),!0}]})}let d=h.join(" ");i(d,!1);let f=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null==(u=null==(l=c._any)?void 0:l.run)?void 0:u.slice())||[]});o&&f.run.push(o),s&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,DA))}let i=r[t]||r.key;if(i)for(let t of e)o(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&o(t,"Shift-"+i,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let DC=null,DA=null;function DM(e,t,n,r){var i;DA=t;let o=("Esc"==(i=!(M8&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||M9&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?M6:M4)[t.keyCode]||t.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),s=AY(AU(o,0))==o.length&&" "!=o,a="",l=!1,u=!1,c=!1;DC&&DC.view==n&&DC.scope==r&&(a=DC.prefix+" ",0>Im.indexOf(t.keyCode)&&(u=!0,DC=null));let h=new Set,d=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},f=e[r],p,g;return f&&(d(f[a+Dy(o,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(kf.windows&&t.ctrlKey&&t.altKey)&&!(kf.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=M4[t.keyCode])&&p!=o?d(f[a+Dy(p,t,!0)])?l=!0:t.shiftKey&&(g=M6[t.keyCode])!=o&&g!=p&&d(f[a+Dy(g,t,!1)])&&(l=!0):s&&t.shiftKey&&d(f[a+Dy(o,t,!0)])&&(l=!0),!l&&d(f._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),DA=null,l}class Dk{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==kY.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=DT(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),f=T8(e,r,1),p=T8(e,i,-1),g=f.type==kx.Text?f:null,m=p.type==kx.Text?p:null;if(g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=DI(e,r,1,g)),m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=DI(e,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let t=g?x(n.from,null,g):b(f,!1),r=m?x(null,n.to,m):b(p,!0),i=[];return(g||f).to<(m||p).from-(g&&m?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(v(h,t.bottom,d,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==kx.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(i).concat(y(r))}function v(e,n,r,i){return new Dk(t,e-l.left,n-l.top,Math.max(0,r-e),i-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(v(n[i],e,n[i+1],t));return r}function x(t,n,r){let i=1e9,s=-1e9,a=[];function l(t,n,l,u,c){let f=e.coordsAtPos(t,t==r.to?-2:2),p=e.coordsAtPos(l,l==r.from?2:-2);f&&p&&(i=Math.min(f.top,p.top,i),s=Math.max(f.bottom,p.bottom,s),c==kY.LTR?a.push(o&&n?h:f.left,o&&u?d:p.right):a.push(!o&&u?h:p.left,!o&&n?d:f.right))}let u=null!=t?t:r.from,c=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>u&&r.from<c)for(let i=Math.max(r.from,u),o=Math.min(r.to,c);;){let r=e.state.doc.lineAt(i);for(let s of e.bidiSpans(r)){let e=s.from+r.from,a=s.to+r.from;if(e>=o)break;a>i&&l(Math.max(e,i),null==t&&e<=u,Math.min(a,o),null==n&&a>=c,s.dir)}if((i=r.to+1)>=o)break}return 0==a.length&&l(u,null==t,c,null==n,e.textDirection),{top:i,bottom:s,horizontal:a}}function b(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let i=DT(e);return[new Dk(t,r.left-i.left,r.top-i.top,null,r.bottom-r.top)]}}}function DT(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==kY.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function DI(e,t,n,r){let i=e.coordsAtPos(t,2*n);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return null==a||null==l?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}class DD{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(DO)!=e.state.facet(DO)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(DO);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,kf.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let DO=A7.define();function DE(e){return[Tv.define(t=>new DD(t,e)),DO.of(e)]}let D_=A7.define({combine:e=>MR(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function DR(e){return e.startState.facet(D_)!=e.state.facet(D_)}let DP=DE({above:!0,markers(e){let{state:t}=e,n=t.facet(D_),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(o&&kf.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=i.empty?i:A6.cursor(i.head,i.assoc);for(let i of Dk.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=DR(e);return n&&DL(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){DL(t.state,e)},class:"cm-cursorLayer"});function DL(e,t){t.style.animationDuration=e.facet(D_).cursorBlinkRate+"ms"}let DN=DE({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of Dk.forRange(e,"cm-selectionBackground",n))t.push(r);if(kf.ios&&!n.empty&&e.state.facet(D_).iosSelectionHandles){for(let r of Dk.forRange(e,"cm-selectionHandle cm-selectionHandle-start",A6.cursor(n.from,1)))t.push(r);for(let r of Dk.forRange(e,"cm-selectionHandle cm-selectionHandle-end",A6.cursor(n.to,1)))t.push(r)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||DR(e),class:"cm-selectionLayer"}),DB=Ma.highest(Dd.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),DF=MA.define({map:(e,t)=>null==e?null:t.mapPos(e)}),Dj=Mo.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(DF)?t.value:e,e))}),Dz=Tv.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Dj);null==n?null!=this.cursor&&(null==(t=this.cursor)||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Dj)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Dj),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Dj)!=e&&this.view.dispatch({effects:DF.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function DV(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}class DH{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,i)=>{let o=n(e,t,r);o&&i(r,r+e[0].length,o)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let t=new Mz,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))DV(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return(e.docChanged&&e.changes.iterChanges((t,i,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),r=Math.max(s,r))}),e.viewportMoved||r-n>1e3)?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),s=Math.min(i.to,r);if(s>=o){let n=e.state.doc.lineAt(o),r=n.to<s?e.state.doc.lineAt(s):n,a=Math.max(i.from,n.from),l=Math.min(i.to,r.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;s<r.to;s++)if(this.boundary.test(r.text[s-r.from])){l=s;break}}let u=[],c,h=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,h);else DV(e.state.doc,this.regexp,a,l,(t,n)=>this.addMatch(n,e,t,h));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:u})}}return t}}let D$=null!=/x/.unicode?"gu":"g",DW=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u2028\u2029\uFEFF-]",D$),DG={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},DU=null,Dq=A7.define({combine(e){let t=MR(e,{render:null,specialChars:DW,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==DU&&"u">typeof document&&document.body){let t=document.body.style;DU=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return DU||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,D$)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,D$)),t}}),DY=null;class DZ extends ky{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(DG[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class DK extends ky{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}let DX=kb.line({class:"cm-activeLine"}),DJ=Tv.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(DX.range(i.from)),t=i.from)}return kb.set(n)}},{decorations:e=>e.decorations});class DQ extends ky{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?kO(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=kN(t[0],"rtl"!=n.direction),i=parseInt(n.lineHeight);return r.bottom-r.top>1.5*i?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}}function D0(e,t){var n;let r,i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(i),s=i-o.from,a=s>2e3?-1:s==o.length?(n=t.clientX,(r=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((r.left-n)/e.defaultCharacterWidth)):-1):MX(o.text,e.state.tabSize,i-o.from);return{line:o.number,col:a,off:s}}let D1={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},D2={style:"cursor: crosshair"},D5="-10000px";class D3{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],a=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(a=e)}if(a<0)o[n]=this.createTooltipView(r,n?o[n-1]:null),s&&(s[n]=!!r.above);else{let r=o[n]=this.tooltipViews[a];s&&(s[n]=t[a]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null==(n=e.destroy)||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=r,this.tooltips=i,this.tooltipViews=o,!0}}function D4(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let D6=A7.define({combine:e=>{var t,n,r;return{position:kf.ios?"absolute":(null==(t=e.find(e=>e.position))?void 0:t.position)||"fixed",parent:(null==(n=e.find(e=>e.parent))?void 0:n.parent)||null,tooltipSpace:(null==(r=e.find(e=>e.tooltipSpace))?void 0:r.tooltipSpace)||D4}}}),D8=new WeakMap,D9=Tv.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(D6);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new D3(e,On,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(D6);if(r.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=r.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=D5,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null==(e=t.destroy)||e.call(t);this.parent&&this.container.remove(),null==(t=this.resizeObserver)||t.disconnect(),null==(n=this.intersectionObserver)||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(kf.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=TI(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(D6).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],u=this.manager.tooltipViews[a],{dom:c}=u,h=e.pos[a],d=e.size[a];if(!h||!1!==l.clip&&(h.bottom<=Math.max(n.top,r.top)||h.top>=Math.min(n.bottom,r.bottom)||h.right<Math.max(n.left,r.left)-.1||h.left>Math.min(n.right,r.right)+.1)){c.style.top=D5;continue}let f=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=7*!!f,g=d.right-d.left,m=null!=(t=D8.get(u))?t:d.bottom-d.top,v=u.offset||Ot,y=this.view.textDirection==kY.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(h.left-14*!!f+v.x,r.right-g)):Math.min(Math.max(r.left,h.left-g+14*!!f-v.x),r.right-g),b=this.above[a];!l.strictSide&&(b?h.top-m-p-v.y<r.top:h.bottom+m+p+v.y>r.bottom)&&b==r.bottom-h.bottom>h.top-r.top&&(b=this.above[a]=!b);let w=(b?h.top-r.top:r.bottom-h.bottom)-p;if(w<m&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=D5;continue}D8.set(u,m),c.style.height=(m=w)/o+"px"}else c.style.height&&(c.style.height="");let S=b?h.top-m-p-v.y:h.bottom+p+v.y,C=x+g;if(!0!==u.overlap)for(let e of s)e.left<C&&e.right>x&&e.top<S+m&&e.bottom>S&&(S=b?e.top-m-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",D7(c,(x-e.parent.left)/i)):(c.style.top=S/o+"px",D7(c,x/i)),f){let e=h.left+(y?v.x:-v.x)-(x+14-7);f.style.left=e/i+"px"}!0!==u.overlap&&s.push({left:x,top:S,right:C,bottom:S+m}),c.classList.toggle("cm-tooltip-above",b),c.classList.toggle("cm-tooltip-below",!b),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView)&&(this.inView=this.view.inView,!this.inView))for(let e of this.manager.tooltipViews)e.dom.style.top=D5}},{eventObservers:{scroll(){this.maybeMeasure()}}});function D7(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let Oe=Dd.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ot={x:0,y:0},On=A7.define({enables:[D9,Oe]}),Or=A7.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class Oi{static create(e){return new Oi(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new D3(e,Or,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null==(e=t.destroy)||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r){if(void 0===t)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let Oo=On.compute([Or],e=>{let t=e.facet(Or);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!=(t=e.end)?t:e.pos})),create:Oi.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),Os=A7.define();class Oa{constructor(e,t,n,r,i,o){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(null==(r=e.posAtCoords(t)))return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),s=o&&o.dir==kY.RTL?-1:1;i=t.x<n.left?-s:s}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),o=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&"then"in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,o(e))},t=>Tf(e.state,t,"hover tooltip"))}else o(i)}get tooltip(){let e=this.view.plugin(D9),t=e?e.manager.tooltips.findIndex(e=>e.create==Oi.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:i}=this;if(r.length&&!this.locked.has(r)&&i&&!function(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let e=s.getBoundingClientRect();i=Math.min(e.top,i),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=r+4&&t.clientY>=i-4&&t.clientY<=o+4}(i.dom,e)||this.pending){let{pos:i}=r[0]||this.pending,o=null!=(n=null==(t=r[0])?void 0:t.end)?n:i;(i==o?this.view.posAtCoords(this.lastMove)!=i:!function(e,t,n,r,i){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let a=e.posAtCoords({x:r,y:i},!1);return a>=t&&a<=n}(this.view,i,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t);let{active:r}=this;!r.length||this.locked.has(r)||this.view.dom.contains(n.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Ol(e,t){let n=e.plugin(D9);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}let Ou=MA.define(),Oc=A7.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function Oh(e,t){let n=e.plugin(Od),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}let Od=Tv.fromClass(class{constructor(e){this.input=e.state.facet(Og),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(Oc);for(let n of(this.top=new Of(e,!0,t.topContainer),this.bottom=new Of(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(Oc);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Of(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Of(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Og);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],o=[],s=[];for(let n of t){let t=this.specs.indexOf(n),a;t<0?(a=n(e.view),s.push(a)):(a=this.panels[t]).update&&a.update(e),r.push(a),(a.top?i:o).push(a)}for(let e of(this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(o),s))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Dd.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Of{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Op(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Op(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Op(e){let t=e.nextSibling;return e.remove(),t}let Og=A7.define({enables:Od}),Om=Mo.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(Ov)?e=[n.value].concat(e):n.is(Oy)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>Og.computeN([e],t=>t.field(e))}),Ov=MA.define(),Oy=MA.define();class Ox extends MP{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ox.prototype.elementClass="",Ox.prototype.toDOM=void 0,Ox.prototype.mapMode=AK.TrackBefore,Ox.prototype.startSide=Ox.prototype.endSide=-1,Ox.prototype.point=!0;let Ob=A7.define(),Ow=A7.define(),OS={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Mj.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},OC=A7.define();function OA(e){return[Ok(),OC.of({...OS,...e})]}let OM=A7.define({combine:e=>e.some(e=>e)});function Ok(e){let t=[OT];return e&&!1===e.fixed&&t.push(OM.of(!0)),t}let OT=Tv.fromClass(class{constructor(e){for(let t of(this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(OC).map(t=>new OE(e,t)),this.fixed=!e.state.facet(OM),this.gutters))"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(OM)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Mj.iter(this.view.state.facet(Ob),this.view.viewport.from),r=[],i=this.gutters.map(e=>new OO(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==kx.Text&&t){for(let e of(OD(n,r,o.from),i))e.line(this.view,o,r);t=!1}else if(o.widget)for(let e of i)e.widget(this.view,o)}else if(e.type==kx.Text)for(let t of(OD(n,r,e.from),i))t.line(this.view,e,r);else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(OC),n=e.state.facet(OC),r=e.docChanged||e.heightChanged||e.viewportChanged||!Mj.eq(e.startState.facet(Ob),e.state.facet(Ob),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new OE(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>i.indexOf(e)&&e.destroy();for(let e of i)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Dd.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==kY.LTR?{left:r,right:i}:{right:r,left:i}})});function OI(e){return Array.isArray(e)?e:[e]}function OD(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class OO{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Mj.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let t=new O_(e,o,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,o,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];OD(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;(0!=r.length||o.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(Ow)){let i=n(e,t.widget,t);i&&(r||(r=[])).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class OE{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,s,r)&&r.preventDefault()});this.markers=OI(t.markers(e)),t.initialSpacer&&(this.spacer=new O_(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=OI(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!Mj.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class O_{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)&&this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let i=0,o=0;;){let s=o,a=i<t.length?t[i++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!a)break;a.toDOM&&(l?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let OR=A7.define(),OP=A7.define(),OL=A7.define({combine:e=>MR(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class ON extends Ox{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function OB(e,t){return e.state.facet(OL).formatNumber(t,e.state)}let OF=OC.compute([OL],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(OR),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new ON(OB(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(OP)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(OL)!=e.state.facet(OL),initialSpacer:e=>new ON(OB(e,Oj(e.state.doc.lines))),updateSpacer(e,t){let n=OB(t.view,Oj(t.view.state.doc.lines));return n==e.number?e:new ON(n)},domEventHandlers:e.facet(OL).domEventHandlers,side:"before"}));function Oj(e){let t=9;for(;t<e;)t=10*t+9;return t}let Oz=new class extends Ox{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},OV=Ob.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Oz.range(i)))}return Mj.of(t)}),OH=new Cp,O$=new Cp;class OW{constructor(e,t,n=[],r=""){this.data=e,this.name=r,M_.prototype.hasOwnProperty("tree")||Object.defineProperty(M_.prototype,"tree",{get(){return Oq(this)}}),this.parser=t,this.extension=[O2.of(this),M_.languageData.of((e,t,n)=>{let r=OG(e,t,n),i=r.type.prop(OH);if(!i)return[];let o=e.facet(i),s=r.type.prop(O$);if(s){let i=r.resolve(t-r.from,n);for(let t of s)if(t.test(i,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return OG(e,t,n).type.prop(OH)==this.data}findRegions(e){let t=e.facet(O2);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(OH)==this.data)return void n.push({from:t,to:t+e.length});let i=e.prop(Cp.mounted);if(i){if(i.tree.prop(OH)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Cw&&r(i,e.positions[n]+t)}};return r(Oq(e),0),n}get allowsNesting(){return!0}}function OG(e,t,n){let r=e.facet(O2),i=Oq(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,y.ExcludeBuffers|y.EnterBracketed))e.type.isTop&&(i=e);return i}OW.setState=MA.define();class OU extends OW{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,A7.define({combine:t?e=>e.concat(t):void 0}));return new OU(n,e.parser.configure({props:[OH.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new OU(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Oq(e){let t=e.field(OW.state,!1);return t?t.tree:Cw.empty}class OY{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let OZ=null;class OK{constructor(e,t,n=[],r,i,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new OK(e,t,[],Cw.empty,0,n,[],null)}startParse(){return this.parser.startParse(new OY(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Cw.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(Cj.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Cj.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=OZ;OZ=this;try{return e()}finally{OZ=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=OX(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=Cj.applyChanges(n,t),r=Cw.empty,i=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(s=[],this.skipped)){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&s.push({from:n,to:r})}}return new OK(this.parser,t,n,r,i,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=OX(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Cz{createParse(t,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let t=OZ;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new Cw(Cv.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return OZ}}function OX(e,t,n){return Cj.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class OJ{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new OJ(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=OK.create(e.facet(O2).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new OJ(n)}}OW.state=Mo.define({create:OJ.init,update(e,t){for(let e of t.effects)if(e.is(OW.setState))return e.value;return t.startState.facet(O2)!=t.state.facet(O2)?OJ.init(t.state):e.apply(t)}});let OQ=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(OQ=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let O0="u">typeof navigator&&(null==(x=navigator.scheduling)?void 0:x.isInputPending)?()=>navigator.scheduling.isInputPending():null,O1=Tv.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(OW.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(OW.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=OQ(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(OW.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!O0?Math.max(25,e.timeRemaining()-5):1e9),s=i.context.treeLen<r&&n.doc.length>r+1e3,a=i.context.work(()=>O0&&O0()||Date.now()>o,r+1e5*!s);this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:OW.setState.of(new OJ(i.context))})),this.chunkBudget>0&&!(a&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Tf(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),O2=A7.define({combine:e=>e.length?e[0]:null,enables:e=>[OW.state,O1,Dd.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class O5{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let O3=A7.define(),O4=A7.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function O6(e){let t=e.facet(O4);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function O8(e,t){let n="",r=e.tabSize,i=e.facet(O4)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function O9(e,t){for(let n of(e instanceof M_&&(e=new O7(e)),e.state.facet(O3))){let r=n(e,t);if(void 0!==r)return r}let n=Oq(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return Et(r,e,n)}(e,n,t):null}class O7{constructor(e,t={}){this.state=e,this.options=t,this.unit=O6(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;if(null!=r&&r>=n.from&&r<=n.to)if(i&&r==e)return{text:"",from:e};else if(t<0?r<e:r<=e)return{text:n.text.slice(r-n.from),from:r};else return{text:n.text.slice(0,r-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return MX(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let Ee=new Cp;function Et(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(Ee);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Cp.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>(function(e,t,n,r){let i=e.textAfter,o=i.match(/^\s*/)[0].length,s=n&&i.slice(o,o+n.length)==n||r==e.pos+o,a=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=s)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}(e):null;return a?s?e.column(a.from):e.column(a.to):e.baseIndent+(s?0:+e.unit)})(e,!0,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?En:null}(r.node);if(e)return e(Er.create(t,n,r))}return 0}function En(){return 0}class Er extends O7{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Er(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Et(this.context.next,this.base,this.pos)}}function Ei({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}let Eo=A7.define(),Es=new Cp;function Ea(e,t,n){for(let r of e.facet(Eo)){let i=r(e,t,n);if(i)return i}return function(e,t,n){let r=Oq(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let i=s.node;if(i.to<=n||i.from>n)continue;if(o&&i.from<t)break;let a=i.type.prop(Es);if(a&&(i.to<r.length-50||r.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(i))){let r=a(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function El(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let Eu=MA.define({map:El}),Ec=MA.define({map:El});function Eh(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let Ed=Mo.define({create:()=>kb.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=Ef(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(Eu)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,r.value.from,r.value.to)?n.push(r.value):r.is(Ec)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(Ex),i=n.map(e=>(r?kb.replace({widget:new EC(r(t.state,e))}):ES).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=Ef(e,t.selection.main.head)),e},provide:e=>Dd.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(ES.range(r,i))}return kb.set(t,!0)}});function Ef(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Ep(e,t,n){var r;let i=null;return null==(r=e.field(Ed,!1))||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Eg(e,t){return e.field(Ed,!1)?t:t.concat(MA.appendConfig.of(Eb()))}function Em(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return Dd.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}let Ev=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Eh(e)){let n=Ea(e.state,t.from,t.to);if(n)return e.dispatch({effects:Eg(e.state,[Eu.of(n),Em(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Ed,!1))return!1;let t=[];for(let n of Eh(e)){let r=Ep(e.state,n.from,n.to);r&&t.push(Ec.of(r),Em(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=Ea(t,i.from,i.to);o&&n.push(Eu.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:Eg(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(Ed,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Ec.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Ey={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Ex=A7.define({combine:e=>MR(e,Ey)});function Eb(e){let t=[Ed,Ek];return e&&t.push(Ex.of(e)),t}function Ew(e,t){let{state:n}=e,r=n.facet(Ex),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Ep(e.state,n.from,n.to);r&&e.dispatch({effects:Ec.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}let ES=kb.replace({widget:new class extends ky{toDOM(e){return Ew(e,null)}}});class EC extends ky{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ew(e,this.value)}}let EA={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class EM extends Ox{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}let Ek=Dd.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ET{constructor(e,t){let n;function r(e){let t=M2.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof OW?e=>e.prop(OH)==o.data:o?e=>e==o:void 0,this.style=Aa(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new M2(n):null,this.themeType=t.themeType}static define(e,t){return new ET(e,t||{})}}let EI=A7.define(),ED=A7.define({combine:e=>e.length?[e[0]]:null});function EO(e){let t=e.facet(EI);return t.length?t:e.facet(ED)}function EE(e,t){let n=[E_],r;return e instanceof ET&&(e.module&&n.push(Dd.styleModule.of(e.module)),r=e.themeType),(null==t?void 0:t.fallback)?n.push(ED.of(e)):r?n.push(EI.computeN([Dd.darkTheme],t=>t.facet(Dd.darkTheme)==("dark"==r)?[e]:[])):n.push(EI.of(e)),n}let E_=Ma.high(Tv.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=Oq(e.state),this.decorations=this.buildDeco(e,EO(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Oq(e.state),n=EO(e.state),r=n!=EO(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return kb.none;let n=new Mz;for(let{from:r,to:i}of e.visibleRanges)!function(e,t,n,r=0,i=e.length){let o=new Al(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=kb.mark({class:r})))},r,i);return n.finish()}},{decorations:e=>e.decorations})),ER=ET.define([{tag:AA.meta,color:"#404740"},{tag:AA.link,textDecoration:"underline"},{tag:AA.heading,textDecoration:"underline",fontWeight:"bold"},{tag:AA.emphasis,fontStyle:"italic"},{tag:AA.strong,fontWeight:"bold"},{tag:AA.strikethrough,textDecoration:"line-through"},{tag:AA.keyword,color:"#708"},{tag:[AA.atom,AA.bool,AA.url,AA.contentSeparator,AA.labelName],color:"#219"},{tag:[AA.literal,AA.inserted],color:"#164"},{tag:[AA.string,AA.deleted],color:"#a11"},{tag:[AA.regexp,AA.escape,AA.special(AA.string)],color:"#e40"},{tag:AA.definition(AA.variableName),color:"#00f"},{tag:AA.local(AA.variableName),color:"#30a"},{tag:[AA.typeName,AA.namespace],color:"#085"},{tag:AA.className,color:"#167"},{tag:[AA.special(AA.variableName),AA.macroName],color:"#256"},{tag:AA.definition(AA.propertyName),color:"#00c"},{tag:AA.comment,color:"#940"},{tag:AA.invalid,color:"#f00"}]),EP=Dd.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),EL="()[]{}",EN=A7.define({combine:e=>MR(e,{afterCursor:!0,brackets:EL,maxScanDistance:1e4,renderMatch:Ej})}),EB=kb.mark({class:"cm-matchingBracket"}),EF=kb.mark({class:"cm-nonmatchingBracket"});function Ej(e){let t=[],n=e.matched?EB:EF;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ez(e){let t=[],n=e.facet(EN);for(let r of e.selection.ranges){if(!r.empty)continue;let i=EG(e,r.head,-1,n)||r.head>0&&EG(e,r.head-1,1,n)||n.afterCursor&&(EG(e,r.head,1,n)||r.head<e.doc.length&&EG(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return kb.set(t,!0)}let EV=[Tv.fromClass(class{constructor(e){this.paused=!1,this.decorations=Ez(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=Ez(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),EP],EH=new Cp;function E$(e,t,n){let r=e.prop(t<0?Cp.openedBy:Cp.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function EW(e){let t=e.type.prop(EH);return t?t(e.node):e}function EG(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||EL,s=Oq(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let r=E$(e.type,n,o);if(r&&e.from<e.to){let i=EW(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i){let o=t.parent,s={from:n.from,to:n.to},a=0,l=null==o?void 0:o.cursor();if(l&&(e<0?l.childBefore(t.from):l.childAfter(t.to)))do if(e<0?l.to<=t.from:l.from>=t.to){if(0==a&&r.indexOf(l.type.name)>-1&&l.from<l.to){let e=EW(l);return{start:s,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(E$(l.type,e,i))a++;else if(E$(l.type,-e,i)){if(0==a){let e=EW(l);return{start:s,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}a--}}while(e<0?l.prevSibling():l.nextSibling());return{start:s,matched:!1}}(n,e,i,r,o)}}return function(e,t,n,r,i,o,s){if(n<0?!t:t==e.doc.length)return null;let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0)&&r.resolveInner(a+e,1).type==i)if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};h--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,s,a.type,i,o)}let EU=Object.create(null),Eq=[Cv.none],EY=[],EZ=Object.create(null),EK=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])EK[e]=function(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||AA[n];r?"function"==typeof r?t.length?t=t.map(r):EX(n,`Modifier ${n} used at start of tag`):t.length?EX(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:EX(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(e=>e.id),o=EZ[i];if(o)return o.id;let s=EZ[i]=Cv.define({id:Eq.length,name:r,props:[Ai({[r]:n})]});return Eq.push(s),s.id}(EU,t);function EX(e,t){EY.indexOf(e)>-1||(EY.push(e),console.warn(t))}kY.RTL,kY.LTR;let EJ=OU.define({name:"json",parser:Ak.configure({props:[Ee.add({Object:Ei({except:/^\s*\}/}),Array:Ei({except:/^\s*\]/})}),Es.add({"Object Array":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});class EQ{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class E0{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(_r).markerFilter;r&&(e=r(e,n));let i=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Mz,s=[],a=0,l=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,r=e==i.length?null:i[e];if(!r&&!s.length)break;if(s.length)t=a,n=s.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if((t=r.from)>c)break;n=r.to,s.push(r),e++}for(;e<i.length;){let r=i[e];if(r.from==t&&(r.to>r.from||r.to==t))s.push(r),e++,n=Math.min(r.to,n);else{n=Math.min(r.from,n);break}}n=Math.min(n,c);let h=!1;if(s.some(e=>e.from==t&&(e.to==n||n==c))&&!(h=t==n)&&n-t<10){let e=t-(u+l.value.length);e>0&&(l.next(e),u=t);for(let e=t;;){if(e>=n){h=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let d=_f(s);if(h)o.add(t,t,kb.widget({widget:new _a(d),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,kb.mark({class:"cm-lintRange cm-lintRange-"+d+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>n)}))}if((a=n)==c)break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1)}let h=o.finish();return new E0(h,t,E1(h))}}function E1(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&0>i.diagnostics.indexOf(t)))if(r){if(0>i.diagnostics.indexOf(r.diagnostic))return!1;r=new EQ(r.from,n,r.diagnostic)}else r=new EQ(e,n,t||i.diagnostics[0])}),r}function E2(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(_r).hideOn(e,n,r);if(null!=i)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(E3))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function E5(e,t){return e.field(E8,!1)?t:t.concat(MA.appendConfig.of(_w))}let E3=MA.define(),E4=MA.define(),E6=MA.define(),E8=Mo.define({create:()=>new E0(kb.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=E1(n,e.selected.diagnostic,i)||E1(n,null,i)}!n.size&&i&&t.state.facet(_r).autoPanel&&(i=null),e=new E0(n,i,r)}for(let n of t.effects)if(n.is(E3)){let r=t.state.facet(_r).autoPanel?n.value.length?_u.open:null:e.panel;e=E0.init(n.value,r,t.state)}else n.is(E4)?e=new E0(e.diagnostics,n.value?_u.open:null,e.selected):n.is(E6)&&(e=new E0(e.diagnostics,e.panel,n.value));return e},provide:e=>[Og.from(e,e=>e.panel),Dd.decorations.from(e,e=>e.diagnostics)]}),E9=kb.mark({class:"cm-lintRange cm-lintRange-active"});function E7(e,t){return kt("ul",{class:"cm-tooltip-lint"},t.map(t=>_s(e,t,!1)))}let _e=e=>{let t=e.state.field(E8,!1);return!!t&&!!t.panel&&(e.dispatch({effects:E4.of(!1)}),!0)},_t=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(E8,!1);t&&t.panel||e.dispatch({effects:E5(e.state,[E4.of(!0)])});let n=Oh(e,_u.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(E8,!1);if(!t)return!1;let n=e.state.selection.main,r=E1(t.diagnostics,null,n.to+1);return(!!r||!!(r=E1(t.diagnostics,null,0))&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!function(e,t,n={}){var r;let i=e.state.facet(Os).map(t=>e.plugin(t)).filter(e=>!!e);if(n.tooltip&&n.tooltip.active){let e=i.find(e=>e.field==n.tooltip.active);e&&(i=[e])}for(let o of i)o.activateHover(e,t,1,null!=(r=n.until)?r:()=>!1)}(e,r.from,{tooltip:_b,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],_n=Tv.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(_r);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(_r);t.length&&function(e,t,n){let r=[],i=-1;for(let o of e)o.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{var n,r;this.view.state.doc==e.doc&&this.view.dispatch((n=this.view.state,r=t.reduce((e,t)=>e.concat(t)),{effects:E5(n,[E3.of(r)])}))},e=>{Tf(this.view.state,e)})}}update(e){let t=e.state.facet(_r);(e.docChanged||t!=e.startState.facet(_r)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),_r=A7.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...MR(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:_i,tooltipFilter:_i,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})})});function _i(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function _o(e){let t=[];if(e)s:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue s}}t.push("")}return t}function _s(e,t,n){var r;let i=n?_o(t.actions):[];return kt("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},kt("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(r=t.actions)?void 0:r.map((n,r)=>{let o=!1,s=r=>{if(r.preventDefault(),o)return;o=!0;let i=E1(e.state.field(E8).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:a}=n,l=i[r]?a.indexOf(i[r]):-1,u=l<0?a:[a.slice(0,l),kt("u",a.slice(l,l+1)),a.slice(l+1)];return kt("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${i[r]})"`}.`},u)}),t.source&&kt("div",{class:"cm-diagnosticSource"},t.source))}class _a extends ky{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return kt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class _l{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=_s(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _u{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)_e(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],r=_o(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=E1(this.view.state.field(E8).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=kt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=kt("div",{class:"cm-panel-lint"},this.list,kt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>_e(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(E8).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(E8),n=0,r=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,s,{spec:a})=>{for(let e of a.diagnostics){if(o.has(e))continue;o.add(e);let s=-1,a;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){s=t;break}s<0?(a=new _l(this.view,e),this.items.splice(n,0,a),r=!0):(a=this.items[s],s>n&&(this.items.splice(n,s-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),i=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new _l(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=E1(this.view.state.field(E8).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:E6.of(t)})}static open(e){return new _u(e)}}function _c(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function _h(e){return _c(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let _d=Dd.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:_h("#f11")},".cm-lintRange-warning":{backgroundImage:_h("orange")},".cm-lintRange-info":{backgroundImage:_h("#999")},".cm-lintRange-hint":{backgroundImage:_h("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function _f(e){let t="hint",n=1;for(let i of e){var r;let e="error"==(r=i.severity)?4:"warning"==r?3:"info"==r?2:1;e>n&&(n=e,t=i.severity)}return t}class _p extends Ox{constructor(e){super(),this.diagnostics=e,this.severity=_f(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,r=e.state.facet(_S).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function r(){let r,i=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(i.from)&&e.dispatch({effects:_v.of({pos:i.from,above:!1,clip:!1,create:()=>({dom:E7(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,r=n=>{let i=t.getBoundingClientRect();if(!(n.clientX>i.left-10)||!(n.clientX<i.right+10)||!(n.clientY>i.top-10)||!(n.clientY<i.bottom+10)){for(let e=n.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",r),e.state.field(_y)&&e.dispatch({effects:_v.of(null)})}},window.addEventListener("mousemove",r)}let{hoverTime:i}=e.state.facet(_S),o=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}})(e,t,n)),t}}let _g=OA({class:"cm-gutter-lint",markers:e=>e.state.field(_m),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(_m).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new _p(r):null}}),_m=Mo.define({create:()=>Mj.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(_S).markerFilter;for(let r of t.effects)if(r.is(E3)){let i=r.value;n&&(i=n(i||[],t.state)),e=function(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new _p(n[e]).range(+e));return Mj.of(r,!0)}(t.state.doc,i.slice(0))}return e}}),_v=MA.define(),_y=Mo.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=E2(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(_v)?t.value:e,e)),provide:e=>On.from(e)}),_x=Dd.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:_c('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:_c('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:_c('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),_b=function(e,t={}){let n=MA.define(),r=new WeakMap,i=Mo.define({create:()=>[],update(e,o){let s=r.get(e);if(e.length&&(t.hideOnChange&&(o.docChanged||o.selection)||s&&s(o)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(o,e)))),o.docChanged&&e.length){let t=[];for(let n of e){let e=o.changes.mapPos(n.pos,-1,AK.TrackDel);if(null!=e){let r=Object.assign(Object.create(null),n);r.pos=e,null!=r.end&&(r.end=o.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of o.effects)t.is(n)&&(e=t.value,s=void 0),(t.is(Ou)&&!t.value||t.value==i)&&(e=[]);return e.length&&s&&r.set(e,s),e},provide:e=>Or.from(e)}),o=Tv.define(o=>new Oa(o,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,o,Os.of(o),Oo]}}(function(e,t,n){let{diagnostics:r}=e.state.field(E8),i,o=-1,s=-1;r.between(t-(n<0),t+ +(n>0),(e,r,{spec:a})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=a.diagnostics,o=e,s=r,!1});let a=e.state.facet(_r).tooltipFilter;return(i&&a&&(i=a(i,e.state)),i)?{pos:o,end:s,above:!0,create:()=>({dom:E7(e,i)})}:null},{hideOn:E2}),_w=[E8,Dd.decorations.compute([E8],e=>{let{selected:t,panel:n}=e.field(E8);return t&&n&&t.from!=t.to?kb.set([E9.range(t.from,t.to)]):kb.none}),_b,_d],_S=A7.define({combine:e=>MR(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var _C=n(49257);function _A(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}let _M=_A(function(e,t,n=t.selection.ranges){let r=[],i=-1;a:for(let{from:e,to:o}of n){let n=r.length,s=1e9,a;for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(void 0==a&&!(a=_I(t,l.from).line))continue a;if(l.from>i&&(e==o||o>l.from)){i=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),r.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(s<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=s);r.length==n+1&&(r[n].single=!0)}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:s}of r)(s||!o)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null},0),_k=_A(_D,0),_T=_A((e,t)=>_D(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function _I(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function _D(e,t,n=t.selection.ranges){let r=n.map(e=>_I(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let o,s,a=e.sliceDoc(r-50,r),l=e.sliceDoc(i,i+50),u=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,h=a.length-u;if(a.slice(h-t.length,h)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?o=s=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+50),s=e.sliceDoc(i-50,i));let d=/^\s*/.exec(o)[0].length,f=/\s*$/.exec(s)[0].length,p=s.length-f-n.length;return o.slice(d,d+t.length)==t&&s.slice(p,p+n.length)==n?{open:{pos:r+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:i-f-n.length,margin:+!!/\s/.test(s.charAt(p-1))}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:o,close:s}=n;e.push({from:o.pos-i.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+i.close.length})}return{changes:e}}return null}let _O=Mw.define(),_E=Mw.define(),__=A7.define(),_R=A7.define({combine:e=>MR(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),_P=Mo.define({create:()=>_q.empty,update(e,t){let n=t.state.facet(_R),r=t.annotation(_O);if(r){let i=_z.fromTransaction(t,r.selection),o=r.side,s=0==o?e.undone:e.done;return s=i?_V(s,s.length,n.minDepth,i):_W(s,t.startState.selection),new _q(0==o?r.rest:s,0==o?s:r.rest)}let i=t.annotation(_E);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(MM.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=_z.fromTransaction(t),s=t.annotation(MM.time),a=t.annotation(MM.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new _q(e.done.map(_z.fromJSON),e.undone.map(_z.fromJSON))});function _L(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(_P,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}let _N=_L(0,!1),_B=_L(1,!1),_F=_L(0,!0),_j=_L(1,!0);class _z{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new _z(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new _z(e.changes&&AJ.fromJSON(e.changes),[],e.mapped&&AX.fromJSON(e.mapped),e.startSelection&&A6.fromJSON(e.startSelection),e.selectionsAfter.map(A6.fromJSON))}static fromTransaction(e,t){let n=_$;for(let t of e.startState.facet(__)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new _z(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,_$)}static selection(e){return new _z(void 0,_$,void 0,void 0,e)}}function _V(e,t,n,r){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(r),i}function _H(e,t){return e.length?t.length?e.concat(t):e:t}let _$=[];function _W(e,t){if(!e.length)return[_z.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),_V(e,e.length-1,1e9,n.setSelAfter(r)))}}function _G(e,t){if(!e.length)return e;let n=e.length,r=_$;for(;n;){let i=function(e,t,n){let r=_H(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):_$,n);if(!e.changes)return _z.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new _z(i,MA.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[_z.selection(r)]:_$}let _U=/^(input\.type|delete)($|\.)/;class _q{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new _q(this.done,this.undone):this}addChanges(e,t,n,r,i){var o,s;let a,l,u=this.done,c=u[u.length-1];return new _q(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||_U.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(o=c.changes,s=e.changes,a=[],l=!1,o.iterChangedRanges((e,t)=>a.push(e,t)),s.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<a.length;){let t=a[e++],i=a[e++];r>=t&&n<=i&&(l=!0)}}),l))||"input.type.compose"==n)?_V(u,u.length-1,r.minDepth,new _z(e.changes.compose(c.changes),_H(MA.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,_$)):_V(u,u.length,r.minDepth,e),_$,t,n)}addSelection(e,t,n,r){var i;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:_$;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new _q(_W(this.done,e),this.undone,t,n)}addMapping(e){return new _q(_G(this.done,e),_G(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],o=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length){let n,s;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:_O.of({side:e,rest:(n=r[r.length-1],(s=r.slice())[r.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),s),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!i.changes)return null;let n=1==r.length?_$:r.slice(0,r.length-1);return i.mapped&&(n=_G(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:_O.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}_q.empty=new _q(_$,_$);let _Y=[{key:"Mod-z",run:_N,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:_B,preventDefault:!0},{linux:"Ctrl-Shift-z",run:_B,preventDefault:!0},{key:"Mod-u",run:_F,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:_j,preventDefault:!0}];function _Z(e,t){return A6.create(e.ranges.map(t),e.mainIndex)}function _K(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function _X({state:e,dispatch:t},n){let r=_Z(e.selection,n);return!r.eq(e.selection,!0)&&(t(_K(e,r)),!0)}function _J(e,t){return A6.cursor(t?e.to:e.from)}function _Q(e,t){return _X(e,n=>n.empty?e.moveByChar(n,t):_J(n,t))}function _0(e){return e.textDirectionAt(e.state.selection.main.head)==kY.LTR}let _1=e=>_Q(e,!_0(e)),_2=e=>_Q(e,_0(e));function _5(e,t){return _X(e,n=>n.empty?e.moveByGroup(n,t):_J(n,t))}function _3(e,t,n){let r,i,o=Oq(e).resolveInner(t.head),s=n?Cp.closedBy:Cp.openedBy;for(let r=t.head;;){let t=n?o.childAfter(r):o.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,s)?r=n?t.to:t.from:o=t}return i=o.type.prop(s)&&(r=n?EG(e,o.from,1):EG(e,o.to,-1))&&r.matched?n?r.end.to:r.end.from:n?o.to:o.from,A6.cursor(i,n?-1:1)}function _4(e,t){return _X(e,n=>{if(!n.empty)return _J(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let _6=e=>_4(e,!1),_8=e=>_4(e,!0);function _9(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Dd.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function _7(e,t){let n,r=_9(e),{state:i}=e,o=_Z(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):_J(n,t));if(o.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+r.marginTop,l=s.bottom-r.marginBottom;t&&t.top>a&&t.bottom<l&&(n=Dd.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(_K(i,o),{effects:n}),!0}let Re=e=>_7(e,!1),Rt=e=>_7(e,!0);function Rn(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=A6.cursor(r.from+n))}return i}function Rr(e,t,n){let r=_Z(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=A6.range(e.head,e.anchor));let r=n(e);return A6.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(_K(e.state,r)),!0)}function Ri(e,t){return Rr(e,t,n=>e.moveByChar(n,t))}let Ro=e=>Ri(e,!_0(e)),Rs=e=>Ri(e,_0(e));function Ra(e,t){return Rr(e,t,n=>e.moveByGroup(n,t))}function Rl(e,t){return Rr(e,t,n=>e.moveVertically(n,t))}let Ru=e=>Rl(e,!1),Rc=e=>Rl(e,!0);function Rh(e,t){return Rr(e,t,n=>e.moveVertically(n,t,_9(e).height))}let Rd=e=>Rh(e,!1),Rf=e=>Rh(e,!0),Rp=({state:e,dispatch:t})=>(t(_K(e,{anchor:0})),!0),Rg=({state:e,dispatch:t})=>(t(_K(e,{anchor:e.doc.length})),!0),Rm=({state:e,dispatch:t})=>(t(_K(e,{anchor:e.selection.main.anchor,head:0})),!0),Rv=({state:e,dispatch:t})=>(t(_K(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Ry(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let o=n.doc.lineAt(r.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<o.from||r.head>o.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(_K(n,A6.create(i,i.length-1))),!0)}function Rx(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:o}=r;if(i==o){let s=t(r);s<i?(n="delete.backward",s=Rb(e,s,!1)):s>i&&(n="delete.forward",s=Rb(e,s,!0)),i=Math.min(i,s),o=Math.max(o,s)}else i=Rb(e,i,!1),o=Rb(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:A6.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?Dd.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Rb(e,t,n){if(e instanceof Dd)for(let r of e.state.facet(Dd.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let Rw=(e,t,n)=>Rx(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,i-s.from))){if(" "==a[a.length-1])return i-1;let e=MX(a,o.tabSize)%O6(o)||O6(o);for(let t=0;t<e&&" "==a[a.length-1-t];t++)i--;l=i}else(l=AG(s.text,i-s.from,t,t)+s.from)==i&&s.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,i-s.from))&&(l=AG(s.text,l-s.from,!1,!1)+s.from);return l}),RS=e=>Rw(e,!1,!0),RC=e=>Rw(e,!0,!1),RA=(e,t)=>Rx(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let e=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let a=AG(o.text,r-o.from,t)+o.from,l=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),u=s(l);if(null!=e&&u!=e)break;(" "!=l||r!=n.head)&&(e=u),r=a}return r}),RM=e=>RA(e,!1);function Rk(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function RT(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of Rk(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),s=o.length+1;if(n)for(let n of(r.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))i.push(A6.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)));else for(let n of(r.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))i.push(A6.range(n.anchor-s,n.head-s))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:A6.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function RI(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of Rk(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let RD=RE(!1),RO=RE(!0);function RE(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,o=t.doc.lineAt(r),s=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Oq(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Cp.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=o.to?o:t.doc.lineAt(i)).to);let a=new O7(t,{simulateBreak:r,simulateDoubleBreak:!!s}),l=O9(a,r);for(null==l&&(l=MX(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;s?{from:r,to:i}=s:r>o.from&&r<o.from+100&&!/\S/.test(o.text.slice(0,r))&&(r=o.from);let u=["",O8(t,l)];return s&&u.push(O8(t,a.lineIndent(o.from,-1))),{changes:{from:r,to:i,insert:AN.of(u)},range:A6.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function R_(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let s=e.doc.lineAt(o);s.number>n&&(r.empty||r.to>s.from)&&(t(s,i,r),n=s.number),o=s.to+1}let o=e.changes(i);return{changes:i,range:A6.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let RR=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(R_(e,(t,n)=>{n.push({from:t.from,insert:e.facet(O4)})}),{userEvent:"input.indent"})),!0),RP=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(R_(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=MX(r,e.tabSize),o=0,s=O8(e,Math.max(0,i-O6(e)));for(;o<r.length&&o<s.length&&r.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:s.slice(o)})}),{userEvent:"delete.dedent"})),!0),RL=[{key:"Ctrl-b",run:_1,shift:Ro,preventDefault:!0},{key:"Ctrl-f",run:_2,shift:Rs},{key:"Ctrl-p",run:_6,shift:Ru},{key:"Ctrl-n",run:_8,shift:Rc},{key:"Ctrl-a",run:e=>_X(e,t=>A6.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Rr(e,!1,t=>A6.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>_X(e,t=>A6.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Rr(e,!0,t=>A6.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:RC},{key:"Ctrl-h",run:RS},{key:"Ctrl-k",run:e=>Rx(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:RM},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:AN.of(["",""])},range:A6.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:AG(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:AG(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(i,n))},range:A6.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Rt}],RN=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>_X(e,t=>_3(e.state,t,!_0(e))),shift:e=>{let t=!_0(e);return Rr(e,t,n=>_3(e.state,n,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>_X(e,t=>_3(e.state,t,_0(e))),shift:e=>{let t=_0(e);return Rr(e,t,n=>_3(e.state,n,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>RT(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>RI(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>RT(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>RI(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>Ry(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>Ry(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=A6.create([n.main]):n.main.empty||(r=A6.create([A6.cursor(n.main.head)])),!!r&&(t(_K(e,r)),!0)}},{key:"Mod-Enter",run:RO},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Rk(e).map(({from:t,to:n})=>A6.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:A6.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=_Z(e.selection,t=>{let n=Oq(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return A6.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(_K(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:RP},{key:"Mod-]",run:RR},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new O7(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=R_(e,(t,i,o)=>{let s=O9(r,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=O8(e,s);(a!=l||o.from<t.from+a.length)&&(n[t.from]=s,i.push({from:t.from,to:t.from+a.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Rk(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=_Z(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=_Z(e.selection,t=>{let r=EG(e,t.head,-1)||EG(e,t.head,1)||t.head>0&&EG(e,t.head-1,1)||t.head<e.doc.length&&EG(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return A6.cursor(i)}),!!n&&(t(_K(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=_I(e.state,n.from);return r.line?_M(e):!!r.block&&_T(e)}},{key:"Alt-A",run:_k},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:_1,shift:Ro,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>_5(e,!_0(e)),shift:e=>Ra(e,!_0(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>_X(e,t=>Rn(e,t,!_0(e))),shift:e=>{let t=!_0(e);return Rr(e,t,n=>Rn(e,n,t))},preventDefault:!0},{key:"ArrowRight",run:_2,shift:Rs,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>_5(e,_0(e)),shift:e=>Ra(e,_0(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>_X(e,t=>Rn(e,t,_0(e))),shift:e=>{let t=_0(e);return Rr(e,t,n=>Rn(e,n,t))},preventDefault:!0},{key:"ArrowUp",run:_6,shift:Ru,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Rp,shift:Rm},{mac:"Ctrl-ArrowUp",run:Re,shift:Rd},{key:"ArrowDown",run:_8,shift:Rc,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Rg,shift:Rv},{mac:"Ctrl-ArrowDown",run:Rt,shift:Rf},{key:"PageUp",run:Re,shift:Rd},{key:"PageDown",run:Rt,shift:Rf},{key:"Home",run:e=>_X(e,t=>Rn(e,t,!1)),shift:e=>Rr(e,!1,t=>Rn(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:Rp,shift:Rm},{key:"End",run:e=>_X(e,t=>Rn(e,t,!0)),shift:e=>Rr(e,!0,t=>Rn(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:Rg,shift:Rv},{key:"Enter",run:RD,shift:RD},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:RS,shift:RS,preventDefault:!0},{key:"Delete",run:RC,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:RM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>RA(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>Rx(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>Rx(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(RL.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),RB={key:"Tab",run:RR,shift:RP},RF="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class Rj{constructor(e,t,n=0,r=e.length,i,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(RF(e)):RF,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return AU(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Aq(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=AY(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,o=!0;;e++){let n=r.charCodeAt(e),s=this.match(n,i,o,this.bufferPos+this.bufferStart,e==r.length-1);if(s)return this.value=s,this;if(e==r.length-1)break;o&&e<t.length&&t.charCodeAt(e)==n?i++:o=!1}}}match(e,t,n,r,i){let o=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],s=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?o={from:n.from,to:r,precise:i&&n.precise}:(n.index++,s=!0)),s?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?o={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}"u">typeof Symbol&&(Rj.prototype[Symbol.iterator]=function(){return this});let Rz={from:-1,to:-1,match:/.*/.exec(""),precise:!0},RV="gm"+(null==/x/.unicode?"":"u");class RH{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Rz,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new RG(e,t,n,r,i);this.re=new RegExp(t,RV+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=RU(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=RU(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let R$=new WeakMap;class RW{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=R$.get(e);if(!r||r.from>=n||r.to<=t){let r=new RW(t,e.sliceString(t,n));return R$.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to<n&&(i+=e.sliceString(r.to,n)),R$.set(e,new RW(o,i)),new RW(t,i.slice(t-o,n-o))}}class RG{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Rz,this.matchPos=RU(e,r),this.re=new RegExp(t,RV+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=RW.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=RU(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=RW.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function RU(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}"u">typeof Symbol&&(RH.prototype[Symbol.iterator]=RG.prototype[Symbol.iterator]=function(){return this});let Rq={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},RY=A7.define({combine:e=>MR(e,Rq,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),RZ=kb.mark({class:"cm-selectionMatch"}),RK=kb.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function RX(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=MO.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=MO.Word)}let RJ=Tv.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(RY),{state:n}=e,r=n.selection;if(r.ranges.length>1)return kb.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return kb.none;let e=n.wordAt(i.head);if(!e)return kb.none;s=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return kb.none;if(t.wholeWords){var a,l,u;if(o=n.sliceDoc(i.from,i.to),!(RX(s=n.charCategorizer(i.head),n,i.from,i.to)&&(a=s,l=i.from,u=i.to,a(n.sliceDoc(l,l+1))==MO.Word&&a(n.sliceDoc(u-1,u))==MO.Word)))return kb.none}else if(!(o=n.sliceDoc(i.from,i.to)))return kb.none}let c=[];for(let r of e.visibleRanges){let e=new Rj(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||RX(s,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?c.push(RK.range(r,o)):(r>=i.to||o<=i.from)&&c.push(RZ.range(r,o)),c.length>t.maxMatches))return kb.none}}return kb.set(c)}},{decorations:e=>e.decorations}),RQ=Dd.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),R0=A7.define({combine:e=>MR(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Px(e),scrollToMatch:e=>Dd.scrollIntoView(e)})});class R1{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,RV),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new R9(this):new R3(this)}getCursor(e,t=0,n){let r=e.doc?e:M_.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?R4(this,r,t,n):R5(this,r,t,n)}}class R2{constructor(e){this.spec=e}}function R5(e,t,n,r){var i,o,s,a;let l;return e.wholeWord&&(s=t.doc,a=t.charCategorizer(t.selection.main.head),l=(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=s.sliceString(r,Math.min(s.length,t+2))),(a(R6(n,e-r))!=MO.Word||a(R8(n,e-r))!=MO.Word)&&(a(R8(n,t-r))!=MO.Word||a(R6(n,t-r))!=MO.Word))),e.test&&(i=e.test,o=l,l=(e,n,r,s)=>(!o||!!o(e,n,r,s))&&i(e>=s&&n<=s+r.length?r.slice(e-s,n-s):t.doc.sliceString(e,n),t,e,n)),new Rj(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),l)}class R3 extends R2{constructor(e){super(e)}nextMatch(e,t,n){let r=R5(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=R5(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=R5(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=R5(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=R5(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function R4(e,t,n,r){var i,o,s;let a;return e.wholeWord&&(s=t.charCategorizer(t.selection.main.head),a=(e,t,n)=>!n[0].length||(s(R6(n.input,n.index))!=MO.Word||s(R8(n.input,n.index))!=MO.Word)&&(s(R8(n.input,n.index+n[0].length))!=MO.Word||s(R6(n.input,n.index+n[0].length))!=MO.Word)),e.test&&(i=e.test,o=a,a=(e,n,r)=>(!o||o(e,n,r))&&i(r[0],t,e,n)),new RH(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:a},n,r)}function R6(e,t){return e.slice(AG(e,t,!1),t)}function R8(e,t){return e.slice(t,AG(e,t))}class R9 extends R2{nextMatch(e,t,n){let r=R4(this.spec,e,n,e.doc.length).next();return r.done&&(r=R4(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=R4(this.spec,e,i,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(i==t||s.from>i+10))return s;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=R4(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=R4(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let R7=MA.define(),Pe=MA.define(),Pt=Mo.define({create:e=>new Pn(Pf(e).create(),null),update(e,t){for(let n of t.effects)n.is(R7)?e=new Pn(n.value.create(),e.panel):n.is(Pe)&&(e=new Pn(e.query,n.value?Pd:null));return e},provide:e=>Og.from(e,e=>e.panel)});class Pn{constructor(e,t){this.query=e,this.panel=t}}let Pr=kb.mark({class:"cm-searchMatch"}),Pi=kb.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Po=Tv.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Pt))}update(e){let t=e.state.field(Pt);(t!=e.startState.field(Pt)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return kb.none;let{view:n}=this,r=new Mz;for(let t=0,i=n.visibleRanges,o=i.length;t<o;t++){let{from:s,to:a}=i[t];for(;t<o-1&&a>i[t+1].from-500;)a=i[++t].to;e.highlight(n.state,s,a,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Pi:Pr)})}return r.finish()}},{decorations:e=>e.decorations});function Ps(e){return t=>{let n=t.state.field(Pt,!1);return n&&n.query.spec.valid?e(t,n):Pm(t)}}let Pa=Ps((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=A6.single(r.from,r.to),o=e.state.facet(R0);return e.dispatch({selection:i,effects:[PS(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),Pg(e),!0}),Pl=Ps((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=A6.single(i.from,i.to),s=e.state.facet(R0);return e.dispatch({selection:o,effects:[PS(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),Pg(e),!0}),Pu=Ps((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:A6.create(n.map(e=>A6.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),Pc=Ps((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,u,c=[];s.precise?s.from==r&&s.to==i&&(u=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:u}),s=t.nextMatch(n,s.from,s.to),c.push(Dd.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):s=t.nextMatch(n,s.from,s.to);let h=e.state.changes(a);return s&&(l=A6.single(s.from,s.to).map(h),c.push(PS(e,s)),c.push(n.facet(R0).scrollToMatch(l.main,e))),e.dispatch({changes:h,selection:l,effects:c,userEvent:"input.replace"}),!0}),Ph=Ps((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:o}=r;o&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Dd.announce.of(r),userEvent:"input.replace.all"}),!0});function Pd(e){return e.state.facet(R0).createPanel(e)}function Pf(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let u=e.facet(R0);return new R1({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!=(r=null==t?void 0:t.caseSensitive)?r:u.caseSensitive,literal:null!=(i=null==t?void 0:t.literal)?i:u.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:u.regexp,wholeWord:null!=(s=null==t?void 0:t.wholeWord)?s:u.wholeWord})}function Pp(e){let t=Oh(e,Pd);return t&&t.dom.querySelector("[main-field]")}function Pg(e){let t=Pp(e);t&&t==e.root.activeElement&&t.select()}let Pm=e=>{let t=e.state.field(Pt,!1);if(t&&t.panel){let n=Pp(e);if(n&&n!=e.root.activeElement){let r=Pf(e.state,t.query.spec);r.valid&&e.dispatch({effects:R7.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Pe.of(!0),t?R7.of(Pf(e.state,t.query.spec)):MA.appendConfig.of(PA)]});return!0},Pv=e=>{let t=e.state.field(Pt,!1);if(!t||!t.panel)return!1;let n=Oh(e,Pd);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Pe.of(!1)}),!0},Py=[{key:"Mod-f",run:Pm,scope:"editor search-panel"},{key:"F3",run:Pa,shift:Pl,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Pa,shift:Pl,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Pv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let t=new Rj(e.doc,e.sliceDoc(r,i));!t.next().done;){if(o.length>1e3)return!1;t.value.from==r&&(s=o.length),o.push(A6.range(t.value.from,t.value.to))}return t(e.update({selection:A6.create(o,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{var t;let n,r,i,o,{state:s}=e,a=String(s.doc.lineAt(e.state.selection.main.head).number),{close:l,result:u}=(t={label:s.phrase("Go to line"),input:{type:"text",name:"line",value:a},focus:!0,submitLabel:s.phrase("go")},r=new Promise(e=>n=e),i=e=>(function(e,t,n){let r=t.content?t.content(e,()=>s(null)):null;if(!r){if(r=kt("form"),t.input){let e=kt("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),r.appendChild(kt("label",(t.label||"")+": ",e))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(kt("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i="FORM"==r.nodeName?[r]:r.querySelectorAll("form");for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),s(null)):13==e.keyCode&&(e.preventDefault(),s(t))}),t.addEventListener("submit",e=>{e.preventDefault(),s(t)})}let o=kt("div",r,kt("button",{onclick:()=>s(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xd7"]));function s(t){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(o.className=t.class),o.classList.add("cm-dialog"),{dom:o,top:t.top,mount:()=>{if(t.focus){let e;(e="string"==typeof t.focus?r.querySelector(t.focus):r.querySelector("input")||r.querySelector("button"))&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}})(e,t,n),e.state.field(Om,!1)?e.dispatch({effects:Ov.of(i)}):e.dispatch({effects:MA.appendConfig.of(Om.init(()=>[i]))}),{close:o=Oy.of(i),result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(Om).indexOf(i)>-1&&e.dispatch({effects:o})}),t))});return u.then(t=>{let n=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!n)return void e.dispatch({effects:l});let r=s.doc.lineAt(s.selection.main.head),[,i,o,a,u]=n,c=a?+a.slice(1):0,h=o?+o:r.number;if(o&&u){let e=h/100;i&&(e=e*("-"==i?-1:1)+r.number/s.doc.lines),h=Math.round(s.doc.lines*e)}else o&&i&&(h=h*("-"==i?-1:1)+r.number);let d=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),f=A6.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[l,Dd.scrollIntoView(f.from,{y:"center"})],selection:f})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=A6.create(n.ranges.map(t=>e.wordAt(t.head)||A6.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new Rj(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new Rj(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(A6.range(i.from,i.to),!1),effects:Dd.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class Px{constructor(e){this.view=e;let t=this.query=e.state.field(Pt).query.spec;function n(e,t,n){return kt("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=kt("input",{value:t.search,placeholder:Pb(e,"Find"),"aria-label":Pb(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=kt("input",{value:t.replace,placeholder:Pb(e,"Replace"),"aria-label":Pb(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=kt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=kt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=kt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=kt("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Pa(e),[Pb(e,"next")]),n("prev",()=>Pl(e),[Pb(e,"previous")]),n("select",()=>Pu(e),[Pb(e,"all")]),kt("label",null,[this.caseField,Pb(e,"match case")]),kt("label",null,[this.reField,Pb(e,"regexp")]),kt("label",null,[this.wordField,Pb(e,"by word")]),...e.state.readOnly?[]:[kt("br"),this.replaceField,n("replace",()=>Pc(e),[Pb(e,"replace")]),n("replaceAll",()=>Ph(e),[Pb(e,"replace all")])],kt("button",{name:"close",onclick:()=>Pv(e),"aria-label":Pb(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new R1({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:R7.of(e)}))}keydown(e){var t;(t=this.view,DM(DS(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Pl:Pa)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Pc(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(R7)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(R0).top}}function Pb(e,t){return e.state.phrase(t)}let Pw=/[\s\.,:;?!]/;function PS(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-30),s=Math.min(i,n+30),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let e=0;e<30;e++)if(!Pw.test(a[e+1])&&Pw.test(a[e])){a=a.slice(e);break}}if(s!=i){for(let e=a.length-1;e>a.length-30;e--)if(!Pw.test(a[e-1])&&Pw.test(a[e])){a=a.slice(0,e);break}}return Dd.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}let PC=Dd.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),PA=[Pt,Ma.low(Po),PC];class PM{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Oq(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(PD(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function Pk(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class PT{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function PI(e){return e.selection.main.from}function PD(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let PO=Mw.define(),PE=new WeakMap;function P_(e){if(!Array.isArray(e))return e;let t=PE.get(e);return t||PE.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=Pk(t)+Pk(n)+"*$";return[RegExp("^"+r),new RegExp(r)]}(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}(e)),t}let PR=MA.define(),PP=MA.define();class PL{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=AU(e,t),r=AY(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(AU(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(1==t.length){let r=AU(e,0),i=AY(r),o=i==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,i])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let i=0,o=Math.min(e.length,200);i<o&&l<a;){let o=AU(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=AY(o)}if(l<a)return null}let u=0,c=0,h=!1,d=0,f=-1,p=-1,g=/[a-z]/.test(e),m=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&c<a;){let l=AU(e,r);s<0&&(u<a&&l==t[u]&&(i[u++]=r),d<a&&(l==t[d]||l==n[d]?(0==d&&(f=r),p=r+1,d++):d=0));let y,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=Aq(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!r||1==x&&g||0==v&&0!=x)&&(t[c]==l||n[c]==l&&(h=!0)?o[c++]=r:o.length&&(m=!1)),v=x,r+=AY(l)}return c==a&&0==o[0]&&m?this.result(-100+(h?-200:0),o,e):d==a&&0==f?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):d==a?this.ret(-900-e.length,[f,p]):c==a?this.result(-100+(h?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?AY(AU(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}}class PN{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let PB=A7.define({combine:e=>MR(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Pj,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>PF(e(n),t(n)),optionClass:(e,t)=>n=>PF(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function PF(e,t){return e?t?e+" "+t:e:t}function Pj(e,t,n,r,i,o){let s=e.textDirection==kY.RTL,a=s,l=!1,u="top",c,h,d=t.left-i.left,f=i.right-t.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d<Math.min(p,f)?a=!1:!a&&f<Math.min(p,d)&&(a=!0),p<=(a?d:f))c=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,h=Math.min(400,a?d:f);else{l=!0,h=Math.min(400,(s?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${h/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}let Pz=MA.define();function PV(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}class PH{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:i,selected:o}=r.open,s=e.state.facet(PB);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement("span");i.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>s&&i.appendChild(document.createTextNode(o.slice(s,t)));let a=i.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<o.length&&i.appendChild(document.createTextNode(o.slice(s))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=PV(i.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:Pz.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(PB).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:PP.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:o,disabled:s}=n.open;r.open&&r.open.options==i||(this.range=PV(i.length,o,e.state.facet(PB).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),s!=(null==(t=r.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=PV(t.options.length,t.selected,this.view.state.facet(PB).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o="string"==typeof i?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>Tf(this.view.state,e,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let r,i,o,s=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),s=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return s&&(t=this.list,n=s,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.height/t.offsetHeight,i.top<r.top?t.scrollTop-=(r.top-i.top)/o:i.bottom>r.bottom&&(t.scrollTop+=(i.bottom-r.bottom)/o)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(PB).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let i=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:a}=e[o],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;e!=i&&(o>n.from||0==n.from)&&(i=e,"string"!=typeof l&&l.header?r.appendChild(l.header(l)):r.appendChild(document.createElement("completion-section")).textContent=e)}let u=r.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(s);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(s,this.view.state,this.view,a);t&&u.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function P$(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class PW{constructor(e,t,n,r,i,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new PW(this.options,PY(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i,o){if(r&&!o&&e.some(e=>e.isPending))return r.setDisabled();let s=function(e,t){let n=[],r=null,i=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},s=t.facet(PB);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)o(new PT(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),a,l=s.filterStrict?new PN(n):new PL(n);for(let t of r.result.options)if(a=l.match(t.label)){let n=t.displayLabel?e?e(t,a.matched):[]:a.matched,s=a.score+(t.boost||0);if(o(new PT(t,r.source,n,s)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;i||(i=Object.create(null)),i[e]=Math.max(s,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0;for(let n of r.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?i[t.name]-i[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let a=[],l=null,u=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||u(e.completion,t.completion))){let t=e.completion;l&&l.label==t.label&&l.detail==t.detail&&(null==l.type||null==t.type||l.type==t.type)&&l.apply==t.apply&&l.boost==t.boost?P$(e.completion)>P$(l)&&(a[a.length-1]=e):a.push(e),l=e.completion}return a}(e,t);if(!s.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let a=t.facet(PB).selectOnOpen?0:-1;if(r&&r.selected!=a&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){a=t;break}}return new PW(s,PY(n,a),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:P2,above:i.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new PW(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new PW(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class PG{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new PG(PZ,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(PB),r=(n.override||t.languageDataAt("autocomplete",PI(t)).map(P_)).map(t=>(this.active.find(e=>e.source==t)||new PX(t,+!!this.active.some(e=>0!=e.state))).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open,o=e.effects.some(e=>e.is(PQ));for(let s of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||o?i=PW.build(r,t,this.id,i,n,o):i&&i.disabled&&!r.some(e=>e.isPending)&&(i=null),!i&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new PX(e.source,0):e)),e.effects))s.is(Pz)&&(i=i&&i.setSelected(s.value,this.id));return r==this.active&&i==this.open?this:new PG(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?PU:Pq}}let PU={"aria-autocomplete":"list"},Pq={};function PY(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let PZ=[];function PK(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(PO);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class PX{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=PK(e,t),r=this;for(let t of((8&n||16&n&&this.touches(e))&&(r=new PX(r.source,0)),4&n&&0==r.state&&(r=new PX(this.source,1)),r=r.updateFor(e,n),e.effects))if(t.is(PR))r=new PX(r.source,1,t.value);else if(t.is(PP))r=new PX(r.source,0);else if(t.is(PQ))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(PI(e.state))}}class PJ extends PX{constructor(e,t,n,r,i,o){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),s=PI(e.state);if(s>o||!r||2&t&&(PI(e.startState)==this.from||s<this.limit))return new PX(this.source,4&t?1:0);let a=e.changes.mapPos(this.limit);return!function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):PD(e,!0).test(i)}(r.validFor,e.state,i,o)?r.update&&(r=r.update(r,i,o,new PM(e.state,s,!1)))?new PJ(this.source,this.explicit,a,r,r.from,null!=(n=r.to)?n:PI(e.state)):new PX(this.source,1,this.explicit):new PJ(this.source,this.explicit,a,r,i,o)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new PJ(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new PX(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let PQ=MA.define({map:(e,t)=>e.map(e=>e.map(t))}),P0=Mo.define({create:()=>PG.start(),update:(e,t)=>e.update(t),provide:e=>[On.from(e,e=>e.tooltip),Dd.contentAttributes.from(e,e=>e.attrs)]});function P1(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(P0).active.find(e=>e.source==t.source);return r instanceof PJ&&("string"==typeof n?e.dispatch({...function(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:A6.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,r.from,r.to),annotations:PO.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}let P2=e=>new PH(e,P0,P1);function P5(e,t="option"){return n=>{let r=n.state.field(P0,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(PB).interactionDelay)return!1;let i=1,o;"page"==t&&(o=Ol(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:Pz.of(a)}),!0}}let P3=e=>!!e.state.field(P0,!1)&&(e.dispatch({effects:PR.of(!0)}),!0);class P4{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let P6=Tv.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(P0).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(P0),n=e.state.facet(PB);if(!e.selectionSet&&!e.docChanged&&e.startState.field(P0)==t)return;let r=e.transactions.some(e=>{let t=PK(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){Tf(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(PR)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(P0);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(PB).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=PI(t),r=new PM(t,n,e.explicit,this.view),i=new P4(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(e=>{i.context.aborted||(i.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:PP.of(null)}),Tf(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(PB).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(PB),r=this.view.state.field(P0);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(void 0===o.done)continue;if(this.running.splice(i--,1),o.done){let r=PI(o.updates.length?o.updates[0].startState:this.view.state),i=Math.min(r,o.done.from+ +!o.active.explicit),s=new PJ(o.active.source,o.active.explicit,i,o.done,o.done.from,null!=(e=o.done.to)?e:r);for(let e of o.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=r.active.find(e=>e.source==o.active.source);if(s&&s.isPending)if(null==o.done){let e=new PX(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:PQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(P0,!1);if(t&&t.tooltip&&this.view.state.facet(PB).closeOnBlur){let n=t.open&&Ol(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:PP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:PR.of(!1)}),20),this.composing=0}}}),P8="object"==typeof navigator&&/Win/.test(navigator.platform),P9=Ma.highest(Dd.domEventHandlers({keydown(e,t){let n=t.state.field(P0,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(P8&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&P1(t,r),!1}})),P7=Dd.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Le={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Lt=MA.define({map(e,t){let n=t.mapPos(e,-1,AK.TrackAfter);return null==n?void 0:n}}),Ln=new class extends MP{};Ln.startSide=1,Ln.endSide=-1;let Lr=Mo.define({create:()=>Mj.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Lt)&&(e=e.update({add:[Ln.range(n.value,n.value+1)]}));return e}}),Li="()[]{}<>\xab\xbb\xbb\xab[]{}";function Lo(e){for(let t=0;t<Li.length;t+=2)if(Li.charCodeAt(t)==e)return Li.charAt(t+1);return Aq(e<128?e:e+1)}function Ls(e,t){return e.languageDataAt("closeBrackets",t)[0]||Le}let La="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Ll=Dd.inputHandler.of((e,t,n,r)=>{if((La?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||2==r.length&&1==AY(AU(r,0))||t!=i.from||n!=i.to)return!1;let o=function(e,t){let n=Ls(e,e.selection.main.head),r=n.brackets||Le.brackets;for(let i of r){let o=Lo(AU(i,0));if(t==i)return o==i?function(e,t,n,r){let i=r.stringPrefixes||Le.stringPrefixes,o=null,s=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Lt.of(r.to+t.length),range:A6.range(r.anchor+t.length,r.head+t.length)};let s=r.head,a=Lh(e.doc,s),l;if(a==t){if(Ld(e,s))return{changes:{insert:t+t,from:s},effects:Lt.of(s+t.length),range:A6.cursor(s+t.length)};else if(Lc(e,s)){let r=n&&e.sliceDoc(s,s+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:s,to:s+r.length,insert:r},range:A6.cursor(s+r.length)}}}else if(n&&e.sliceDoc(s-2*t.length,s)==t+t&&(l=Lf(e,s-2*t.length,i))>-1&&Ld(e,l))return{changes:{insert:t+t+t+t,from:s},effects:Lt.of(s+t.length),range:A6.cursor(s+t.length)};else if(e.charCategorizer(s)(a)!=MO.Word&&Lf(e,s,i)>-1&&!function(e,t,n,r){let i=Oq(e).resolveInner(t,-1),o=r.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&r.indexOf(s.slice(0,a))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=i.to==t&&i.parent;if(!l)break;i=l}return!1}(e,s,t,i))return{changes:{insert:t+t,from:s},effects:Lt.of(s+t.length),range:A6.cursor(s+t.length)};return{range:o=r}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,r.indexOf(i+i+i)>-1,n):function(e,t,n,r){let i=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:Lt.of(o.to+t.length),range:A6.range(o.anchor+t.length,o.head+t.length)};let s=Lh(e.doc,o.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:Lt.of(o.head+t.length),range:A6.cursor(o.head+t.length)}:{range:i=o}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,o,n.before||Le.before);if(t==o&&Lc(e,e.selection.main.from))return function(e,t){let n=null,r=e.changeByRange(r=>r.empty&&Lh(e.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:A6.cursor(r.head+t.length)}:n={range:r});return n?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}(e,o)}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}),Lu=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Ls(e,e.selection.main.head).brackets||Le.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){var i,o;let r,s=(i=e.doc,o=t.head,AY(AU(r=i.sliceString(o-2,o),0))==r.length?r:r.slice(1));for(let r of n)if(r==s&&Lh(e.doc,t.head)==Lo(AU(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:A6.cursor(t.head-r.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function Lc(e,t){let n=!1;return e.field(Lr).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function Lh(e,t){let n=e.sliceString(t,t+2);return n.slice(0,AY(AU(n,0)))}function Ld(e,t){let n=Oq(e).resolveInner(t+1);return n.parent&&n.from==t}function Lf(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=MO.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=MO.Word)return n}return -1}let Lp=[{key:"Ctrl-Space",run:P3},{mac:"Alt-`",run:P3},{mac:"Alt-i",run:P3},{key:"Escape",run:e=>{let t=e.state.field(P0,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:PP.of(null)}),!0)}},{key:"ArrowDown",run:P5(!0)},{key:"ArrowUp",run:P5(!1)},{key:"PageDown",run:P5(!0,"page")},{key:"PageUp",run:P5(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(P0,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(PB).interactionDelay)&&P1(e,t.open.options[t.open.selected])}}],Lg=Ma.highest(Db.computeN([PB],e=>e.facet(PB).defaultKeymap?[Lp]:[]));var Lm=function(e){let t;void 0===e&&(e={});var n=e.crosshairCursor,r=[];!1!==e.closeBracketsKeymap&&(r=r.concat(Lu)),!1!==e.defaultKeymap&&(r=r.concat(RN)),!1!==e.searchKeymap&&(r=r.concat(Py)),!1!==e.historyKeymap&&(r=r.concat(_Y)),!1!==e.foldKeymap&&(r=r.concat(Ev)),!1!==e.completionKeymap&&(r=r.concat(Lp)),!1!==e.lintKeymap&&(r=r.concat(_t));var i=[];return!1!==e.lineNumbers&&i.push(function(e={}){return[OL.of(e),Ok(),OF]}()),!1!==e.highlightActiveLineGutter&&i.push(OV),!1!==e.highlightSpecialChars&&i.push(function(e={}){return[Dq.of(e),DY||(DY=Tv.fromClass(class{constructor(e){this.view=e,this.decorations=kb.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Dq)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new DH({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=AU(t[0],0);if(9==o){let e=i.lineAt(r),t=n.state.tabSize,o=MX(e.text,t,r-e.from);return kb.replace({widget:new DK((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=kb.replace({widget:new DZ(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Dq);e.startState.facet(Dq)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&i.push(function(e={}){return[_P,_R.of(e),Dd.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?_N:"historyRedo"==e.inputType?_B:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push(function(e={}){let t={...EA,...e},n=new EM(t,!0),r=new EM(t,!1),i=Tv.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(O2)!=e.state.facet(O2)||e.startState.field(Ed,!1)!=e.state.field(Ed,!1)||Oq(e.startState)!=Oq(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new Mz;for(let i of e.viewportLineBlocks){let o=Ep(e.state,i.from,i.to)?r:Ea(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[i,OA({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(i))?void 0:t.markers)||Mj.empty},initialSpacer:()=>new EM(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let r=Ep(e.state,t.from,t.to);if(r)return e.dispatch({effects:Ec.of(r)}),!0;let i=Ea(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:Eu.of(i)}),!0)}}}),Eb()]}()),!1!==e.drawSelection&&i.push(function(e={}){return[D_.of(e),DP,DN,DB,Tl.of(!0)]}()),!1!==e.dropCursor&&i.push([Dj,Dz]),!1!==e.allowMultipleSelections&&i.push(M_.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push(M_.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=O9(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=O8(s,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&i.push(EE(ER,{fallback:!0})),!1!==e.bracketMatching&&i.push(function(e={}){return[EN.of(e),EV]}()),!1!==e.closeBrackets&&i.push([Ll,Lr]),!1!==e.autocompletion&&i.push(function(e={}){return[P9,P0,PB.of(e),P6,Lg,P7]}()),!1!==e.rectangularSelection&&i.push((t=e=>e.altKey&&0==e.button,Dd.mouseSelectionStyle.of((e,n)=>{let r,i;return t(n)?(r=D0(e,n),i=e.state.selection,r?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(r.line).from),n=e.state.doc.lineAt(t);r={line:n.number,col:r.col,off:Math.min(r.off,n.length)},i=i.map(e.changes)}},get(t,n,o){let s=D0(e,t);if(!s)return i;let a=function(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=a&&o.push(A6.range(n.from+s,n.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=MJ(n.text,s,e.tabSize,!0);if(r<0)o.push(A6.cursor(n.to));else{let t=MJ(n.text,a,e.tabSize);o.push(A6.range(n.from+r,n.from+t))}}}return o}(e.state,r,s);return a.length?o?A6.create(a.concat(i.ranges)):A6.create(a):i}}:null):null}))),!1!==(void 0!==n&&n)&&i.push(function(e={}){let[t,n]=D1[e.key||"Alt"],r=Tv.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,Dd.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(r))?void 0:t.isDown)?D2:null})]}()),!1!==e.highlightActiveLine&&i.push(DJ),!1!==e.highlightSelectionMatches&&i.push([RQ,RJ]),e.tabSize&&"number"==typeof e.tabSize&&i.push(O4.of(" ".repeat(e.tabSize))),i.concat([Db.of(r.flat())]).filter(Boolean)};let Lv="#e06c75",Ly="#abb2bf",Lx="#7d8799",Lb="#d19a66",Lw="#2c313a",LS="#282c34",LC="#353a42",LA="#528bff",LM=[Dd.theme({"&":{color:Ly,backgroundColor:LS},".cm-content":{caretColor:LA},".cm-cursor, .cm-dropCursor":{borderLeftColor:LA},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:Ly},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:LS,color:Lx,border:"none"},".cm-activeLineGutter":{backgroundColor:Lw},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:LC},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:LC,borderBottomColor:LC},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Lw,color:Ly}}},{dark:!0}),EE(ET.define([{tag:AA.keyword,color:"#c678dd"},{tag:[AA.name,AA.deleted,AA.character,AA.propertyName,AA.macroName],color:Lv},{tag:[AA.function(AA.variableName),AA.labelName],color:"#61afef"},{tag:[AA.color,AA.constant(AA.name),AA.standard(AA.name)],color:Lb},{tag:[AA.definition(AA.name),AA.separator],color:Ly},{tag:[AA.typeName,AA.className,AA.number,AA.changed,AA.annotation,AA.modifier,AA.self,AA.namespace],color:"#e5c07b"},{tag:[AA.operator,AA.operatorKeyword,AA.url,AA.escape,AA.regexp,AA.link,AA.special(AA.string)],color:"#56b6c2"},{tag:[AA.meta,AA.comment],color:Lx},{tag:AA.strong,fontWeight:"bold"},{tag:AA.emphasis,fontStyle:"italic"},{tag:AA.strikethrough,textDecoration:"line-through"},{tag:AA.link,color:Lx,textDecoration:"underline"},{tag:AA.heading,fontWeight:"bold",color:Lv},{tag:[AA.atom,AA.bool,AA.special(AA.variableName)],color:Lb},{tag:[AA.processingInstruction,AA.string,AA.inserted],color:"#98c379"},{tag:AA.invalid,color:"#ffffff"}]))];var Lk=Dd.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),LT=function(e){let t;void 0===e&&(e={});var n=e,r=n.indentWithTab,i=n.editable,o=n.readOnly,s=n.theme,a=void 0===s?"light":s,l=n.placeholder,u=void 0===l?"":l,c=n.basicSetup,h=void 0===c||c,d=[];switch((void 0===r||r)&&d.unshift(Db.of([RB])),h&&("boolean"==typeof h?d.unshift(Lm()):d.unshift(Lm(h))),u&&d.unshift((t=Tv.fromClass(class{constructor(e){this.view=e,this.placeholder=u?kb.set([kb.widget({widget:new DQ(u),side:1}).range(0)]):kb.none}get decorations(){return this.view.state.doc.length?kb.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof u?[t,Dd.contentAttributes.of({"aria-placeholder":u})]:t)),a){case"light":d.push(Lk);break;case"dark":d.push(LM);break;case"none":break;default:d.push(a)}return!1===(void 0===i||i)&&d.push(Dd.editable.of(!1)),void 0!==o&&o&&d.push(M_.readOnly.of(!0)),[...d]};class LI{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class LD{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var LO=null,LE=Mw.define(),L_=[],LR=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],LP=(0,w.forwardRef)((e,t)=>{var n,r,i,o,s,a,l,u,c,h,d,f,p,g,m,v,y,x,S,C,A,M,k,T,I,D,O,E,_,R,P,L,N,B,F,j,z,V,H,$,W,G,U,q,Y,Z,K,X,J,Q=e.className,ee=e.value,et=void 0===ee?"":ee,en=e.selection,er=e.extensions,ei=e.onChange,eo=e.onStatistics,es=e.onCreateEditor,ea=e.onUpdate,el=e.autoFocus,eu=e.theme,ec=void 0===eu?"light":eu,eh=e.height,ed=e.minHeight,ef=e.maxHeight,ep=e.width,eg=e.minWidth,em=e.maxWidth,ev=e.basicSetup,ey=e.placeholder,ex=e.indentWithTab,eb=e.editable,ew=e.readOnly,eS=e.root,eC=e.initialState,eA=(0,_C.A)(e,LR),eM=(0,w.useRef)(null),ek=(r=(n={root:eS,value:et,autoFocus:el,theme:ec,height:eh,minHeight:ed,maxHeight:ef,width:ep,minWidth:eg,maxWidth:em,basicSetup:ev,placeholder:ey,indentWithTab:ex,editable:eb,readOnly:ew,selection:en,onChange:ei,onStatistics:eo,onCreateEditor:es,onUpdate:ea,extensions:void 0===er?[]:er,initialState:eC}).value,i=n.selection,o=n.onChange,s=n.onStatistics,a=n.onCreateEditor,l=n.onUpdate,c=void 0===(u=n.extensions)?L_:u,h=n.autoFocus,f=void 0===(d=n.theme)?"light":d,g=void 0===(p=n.height)?null:p,v=void 0===(m=n.minHeight)?null:m,x=void 0===(y=n.maxHeight)?null:y,C=void 0===(S=n.width)?null:S,M=void 0===(A=n.minWidth)?null:A,T=void 0===(k=n.maxWidth)?null:k,D=void 0===(I=n.placeholder)?"":I,E=void 0===(O=n.editable)||O,R=void 0!==(_=n.readOnly)&&_,L=void 0===(P=n.indentWithTab)||P,B=void 0===(N=n.basicSetup)||N,F=n.root,j=n.initialState,V=(z=(0,w.useState)())[0],H=z[1],W=($=(0,w.useState)())[0],G=$[1],q=(U=(0,w.useState)())[0],Y=U[1],Z=(0,w.useState)(()=>({current:null}))[0],K=(0,w.useState)(()=>({current:null}))[0],X=Dd.theme({"&":{height:g,minHeight:v,maxHeight:x,width:C,minWidth:M,maxWidth:T},"& .cm-scroller":{height:"100% !important"}}),J=[Dd.updateListener.of(e=>{e.docChanged&&"function"==typeof o&&!e.transactions.some(e=>e.annotation(LE))&&(Z.current?Z.current.reset():(Z.current=new LI(()=>{if(K.current){var e=K.current;K.current=null,e()}Z.current=null},200),("u"<typeof window?new LD:(!LO&&(LO=new LD),LO)).add(Z.current)),o(e.state.doc.toString(),e)),s&&s({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)})}),X,...LT({theme:f,editable:E,readOnly:R,placeholder:D,indentWithTab:L,basicSetup:B})],l&&"function"==typeof l&&J.push(Dd.updateListener.of(l)),J=J.concat(c),(0,w.useLayoutEffect)(()=>{if(V&&!q){var e={doc:r,selection:i,extensions:J},t=j?M_.fromJSON(j.json,e,j.fields):M_.create(e);if(Y(t),!W){var n=new Dd({state:t,parent:V,root:F});G(n),a&&a(n,t)}}return()=>{W&&(Y(void 0),G(void 0))}},[V,q]),(0,w.useEffect)(()=>{n.container&&H(n.container)},[n.container]),(0,w.useEffect)(()=>()=>{W&&(W.destroy(),G(void 0)),Z.current&&(Z.current.cancel(),Z.current=null)},[W]),(0,w.useEffect)(()=>{h&&W&&W.focus()},[h,W]),(0,w.useEffect)(()=>{W&&W.dispatch({effects:MA.reconfigure.of(J)})},[f,c,g,v,x,C,M,T,D,E,R,L,B,o,l]),(0,w.useEffect)(()=>{if(void 0!==r){var e=W?W.state.doc.toString():"";if(W&&r!==e){var t=Z.current&&!Z.current.isDone,n=()=>{W&&r!==W.state.doc.toString()&&W.dispatch({changes:{from:0,to:W.state.doc.toString().length,insert:r||""},annotations:[LE.of(!0)]})};t?K.current=n:n()}}},[r,W]),{state:q,setState:Y,view:W,setView:G,container:V,setContainer:H}),eT=ek.state,eI=ek.view,eD=ek.container,eO=ek.setContainer;(0,w.useImperativeHandle)(t,()=>({editor:eM.current,state:eT,view:eI}),[eM,eD,eT,eI]);var eE=(0,w.useCallback)(e=>{eM.current=e,eO(e)},[eO]);if("string"!=typeof et)throw Error("value must be typeof string but got "+typeof et);return(0,b.jsx)("div",(0,iL.A)({ref:eE,className:("string"==typeof ec?"cm-theme-"+ec:"cm-theme")+(Q?" "+Q:"")},eA))});function LL(e){let t=(0,lO.A)(),n="dark"===t.palette.mode,[r,i]=(0,w.useState)(()=>JSON.stringify(e.value,null,2)),[o,s]=(0,w.useState)(r);return(0,b.jsx)(LP,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new O5(EJ),function(e,t={}){return[_r.of({source:e,config:t}),_n,_w]}(e=>{try{JSON.parse(e.state.doc.toString())}catch(i){var t;let n;if(!(i instanceof SyntaxError))throw i;let r=(t=e.state.doc,(n=i.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=i.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0);return[{from:r,message:i.message,severity:"error",to:r}]}return[]}),function(e={}){return[_S.of(e),_m,_g,_x,_y]}()],value:r,onChange:t=>{i(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==r&&void 0!==e.onChange&&(e.onChange(r),s(r))},placeholder:e.placeholder})}LP.displayName="CodeMirror";var LN=n(10740);let LB=e=>{let{mode:t,url:n,name:r,newTabOpen:i,renderVariables:o,tooltip:s}=e;return(0,b.jsxs)(H.A,{direction:"column",gap:2,flexGrow:1,children:[(0,b.jsx)(pv,{label:n.label,error:n.error?.hasError,helperText:n.error?.helperText,onChange:n.onChange,placeholder:n.placeholder,multiline:!0,maxRows:5,required:!0,fullWidth:!0,value:n.value}),(r||s)&&(0,b.jsxs)(H.A,{gap:1,direction:"inline"===t?"row":"column",children:[r&&(0,b.jsx)(pv,{sx:{flexGrow:"1"},label:r.label,onChange:r?.onChange,placeholder:r?.placeholder,value:r?.value}),s&&(0,b.jsx)(pv,{sx:{flexGrow:"1"},label:s.label,onChange:s?.onChange,placeholder:s?.placeholder,value:s?.value})]}),(0,b.jsxs)(H.A,{direction:"row",gap:1,children:[o&&(0,b.jsx)(LN.A,{label:o.label,control:(0,b.jsx)(d2,{checked:o.value,onChange:e=>{o?.onChange(e.target.checked)}})}),(0,b.jsx)(LN.A,{label:i.label,control:(0,b.jsx)(d2,{checked:i.value,onChange:e=>{i?.onChange(e.target.checked)}})})]})]})},LF=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function Lj({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,b.jsx)(pZ,{label:"Mode",control:(0,b.jsx)(p0,{value:LF.find(e=>e.id===n),options:LF,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var Lz=n(69402);function LV(e){return(0,R.Ay)("MuiSkeleton",e)}(0,_.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);let LH=(0,Lz.keyframes)`
|
|
6
|
+
0% {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
50% {
|
|
11
|
+
opacity: 0.4;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
100% {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
`,L$=(0,Lz.keyframes)`
|
|
18
|
+
0% {
|
|
19
|
+
transform: translateX(-100%);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
50% {
|
|
23
|
+
/* +0.5s of delay between each loop */
|
|
24
|
+
transform: translateX(100%);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
100% {
|
|
28
|
+
transform: translateX(100%);
|
|
29
|
+
}
|
|
30
|
+
`,LW="string"!=typeof LH?(0,Lz.css)`
|
|
31
|
+
animation: ${LH} 2s ease-in-out 0.5s infinite;
|
|
32
|
+
`:null,LG="string"!=typeof L$?(0,Lz.css)`
|
|
33
|
+
&::after {
|
|
34
|
+
animation: ${L$} 2s linear 0.5s infinite;
|
|
35
|
+
}
|
|
36
|
+
`:null,LU=(0,I.A)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!1!==n.animation&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})((0,D.A)(({theme:e})=>{let t=String(e.shape.borderRadius).match(/[\d.\-+]*\s*(.*)/)[1]||"px",n=parseFloat(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:(0,M.X4)(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:LW||{animation:`${LH} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
|
|
37
|
+
90deg,
|
|
38
|
+
transparent,
|
|
39
|
+
${(e.vars||e).palette.action.hover},
|
|
40
|
+
transparent
|
|
41
|
+
)`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:LG||{"&::after":{animation:`${L$} 2s linear 0.5s infinite`}}}]}})),Lq=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiSkeleton"}),{animation:r="pulse",className:i,component:o="span",height:s,style:a,variant:l="text",width:u,...c}=n,h={...n,animation:r,component:o,variant:l,hasChildren:!!c.children},d=(e=>{let{classes:t,variant:n,animation:r,hasChildren:i,width:o,height:s}=e;return(0,A.A)({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!s&&"heightAuto"]},LV,t)})(h);return(0,b.jsx)(LU,{as:o,ref:t,className:(0,C.A)(d.root,i),ownerState:h,...c,style:{width:u,height:s,...a}})});function LY(e){let{message:t}=e;return(0,b.jsx)(H.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,b.jsx)(fO.A,{children:t})})}function LZ(e){let{resource:t}=e;return(0,b.jsx)(LY,{message:`No ${t}`})}function LK(e){let{variant:t="rounded"}=e;return(0,b.jsx)(H.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,b.jsx)(Lq,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let LX=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function LJ({onChange:e,value:t="desc"}){return(0,b.jsx)(pZ,{label:"Sort",control:(0,b.jsx)(p0,{value:LX.find(e=>e.id===t),options:LX,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function LQ({onChange:e,value:t,...n}){let r=t=>{e(t)};return(0,b.jsxs)(j,{"aria-label":"Sort",...n,children:[(0,b.jsx)(z.A,{onClick:()=>r(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,b.jsx)(z.A,{onClick:()=>r("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,b.jsx)(z.A,{onClick:()=>r("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}var L0=n(61375),L1=n(31729);let L2=(0,n(68335).A)();var L5=n(86742),L3=n(86067);function L4({inputRef:e,label:t,color:n,value:r,mode:i,onChange:o,onColorChange:s,onBlur:a,onDelete:l}){let[u,c]=(0,w.useState)(0);return(0,b.jsxs)(H.A,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,b.jsx)(lI,{label:t,color:n,onColorChange:s}),(0,b.jsx)(pW.A,{htmlFor:t,children:t}),(0,b.jsx)(W.A,{id:t,inputRef:e,type:"number",value:0===r?"":r,placeholder:"0",onChange:o,onBlur:a,onKeyDown:e=>{"Enter"===e.key&&(a(),c(u+1))},InputProps:{endAdornment:"percent"===i?(0,b.jsx)(lE.A,{paddingX:1,children:"%"}):void 0}},u),(0,b.jsx)($.A,{"aria-label":`delete threshold ${t}`,size:"small",onClick:l,children:(0,b.jsx)(L3,{})})]})}function L6({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:r}){let{thresholds:{defaultColor:i,palette:o}}=eI(),s=e?.defaultColor??i,a=e?.steps,l=(0,w.useRef)(null),u=(0,w.useRef)(!1);(0,w.useEffect)(()=>{l.current&&u.current&&(l.current?.focus(),u.current=!1)},[a?.length]);let c=()=>{if(void 0!==a){let n=[...a];n.sort((e,t)=>e.value-t.value),void 0!==e&&t((0,l_.jM)(e,e=>{e.steps=n}))}};return(0,b.jsxs)(pX,{title:"Thresholds",icon:(0,b.jsx)(pU,{description:"Add threshold",children:(0,b.jsx)($.A,{size:"small","aria-label":"add threshold",onClick:()=>{u.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t((0,l_.jM)(e,e=>{e.steps=[{value:10}]})):t((0,l_.jM)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??L8();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,b.jsx)(L5,{})})}),children:[(0,b.jsx)(pZ,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,b.jsxs)(L0.A,{exclusive:!0,disabled:r,value:e?.mode??"absolute",onChange:(n,r)=>{let i="percent"===r?"percent":void 0;void 0!==e?t((0,l_.jM)(e,e=>{e.mode=i})):t({mode:i})},sx:{height:"36px",marginLeft:"auto"},children:[(0,b.jsx)(L1.A,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,b.jsx)(L1.A,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),a&&a.map((n,r)=>(0,b.jsx)(L4,{inputRef:r===a.length-1?l:void 0,label:`T${r+1}`,color:n.color??o[r]??s,value:n.value,mode:e?.mode,onColorChange:n=>{void 0!==e&&t((0,l_.jM)(e,e=>{if(void 0!==e.steps){let t=e.steps[r];t&&(t.color=n)}}))},onChange:n=>{void 0!==e&&t((0,l_.jM)(e,e=>{let t=e.steps?.[r];t&&(t.value=Number(n.target.value))}))},onDelete:()=>{void 0!==e&&t((0,l_.jM)(e,e=>{e.steps&&e.steps.splice(r,1)}))},onBlur:c},r)).reverse(),!n&&(0,b.jsxs)(L2,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,b.jsx)(lI,{label:"default",color:s,onColorChange:n=>{void 0!==e?t((0,l_.jM)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,b.jsx)(fO.A,{children:"Default"})]})]})}let L8=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");var L9=n(24300),L7=n(26684),Ne=n(51327),Nt=n(87169);function Nn({props:e,name:t}){return(0,Ne.A)({props:e,name:t,defaultTheme:Nt.A,themeId:g3.A})}let Nr=["localeText"],Ni=w.createContext(null),No=function(e){let{localeText:t}=e,n=(0,_C.A)(e,Nr),{utils:r,localeText:i}=w.useContext(Ni)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:s,dateFormats:a,dateLibInstance:l,adapterLocale:u,localeText:c}=Nn({props:n,name:"MuiLocalizationProvider"}),h=w.useMemo(()=>(0,iL.A)({},c,i,t),[c,i,t]),d=w.useMemo(()=>{if(!s)return r||null;let e=new s({locale:u,formats:a,instance:l});if(!e.isMUIAdapter)throw Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
|
|
42
|
+
`));return e},[s,u,a,l,r]),f=w.useMemo(()=>d?{minDate:d.date("1900-01-01T00:00:00.000"),maxDate:d.date("2099-12-31T00:00:00.000")}:null,[d]),p=w.useMemo(()=>({utils:d,defaultDates:f,localeText:h}),[f,d,h]);return(0,b.jsx)(Ni.Provider,{value:p,children:o})};var Ns=n(62688),Na=n.n(Ns);let Nl={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(null===t||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"};(0,iL.A)({},Nl);let Nu=()=>{let e=w.useContext(Ni);if(null===e)throw Error("MUI X: Can not find the date and time pickers localization context.\nIt looks like you forgot to wrap your component in LocalizationProvider.\nThis can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package");if(null===e.utils)throw Error("MUI X: Can not find the date and time pickers adapter from its localization context.\nIt looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.");let t=w.useMemo(()=>(0,iL.A)({},Nl,e.localeText),[e.localeText]);return w.useMemo(()=>(0,iL.A)({},e,{localeText:t}),[e,t])},Nc=e=>{let t=Nu().utils,n=w.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},Nh=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n))},Nd=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{let l=Nh(s,s.date(void 0,a),e);n&&s.isBefore(i,l)&&(i=l),t&&s.isAfter(r,l)&&(r=l);let u=e,c=e;for(s.isBefore(e,i)&&(u=i,c=null),s.isAfter(e,r)&&(c&&(c=r),u=null);u||c;){if(u&&s.isAfter(u,r)&&(u=null),c&&s.isBefore(c,i)&&(c=null),u){if(!o(u))return u;u=s.addDays(u,1)}if(c){if(!o(c))return c;c=s.addDays(c,-1)}}return null},Nf=(e,t,n)=>null!=t&&e.isValid(t)?t:n,Np=(e,t)=>{let n=[e.startOfYear(t)];for(;n.length<12;){let t=n[n.length-1];n.push(e.addMonths(t,1))}return n},Ng=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),Nm=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},Nv=["year","month","day"],Ny=e=>Nv.includes(e);var Nx=n(33868),Nb=n(87034),Nw=n(22857);let NS=(0,dW.A)((0,b.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),NC=(0,dW.A)((0,b.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),NA=(0,dW.A)((0,b.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,dW.A)((0,b.jsx)("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),(0,dW.A)((0,b.jsxs)(w.Fragment,{children:[(0,b.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,b.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let NM=(0,dW.A)((0,b.jsx)("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),Nk=(0,dW.A)((0,b.jsxs)(w.Fragment,{children:[(0,b.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,b.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),NT=(0,dW.A)((0,b.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function NI(e){return(0,R.Ay)("MuiDateTimePickerTabs",e)}(0,_.A)("MuiDateTimePickerTabs",["root"]);let ND=(0,I.A)(Nb.A,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${Nw.A.indicator}`]:{bottom:"auto",top:0}}})),NO=function(e){let t=Nn({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,b.jsx)(NM,{}),onViewChange:r,timeIcon:i=(0,b.jsx)(Nk,{}),view:o,hidden:s="u"<typeof window||window.innerHeight<667,className:a,sx:l}=t,u=Nu().localeText,c=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"]},NI,t)})(t);return s?null:(0,b.jsxs)(ND,{ownerState:t,variant:"fullWidth",value:Ny(o)?"date":"time",onChange:(e,t)=>{r("date"===t?"day":"hours")},className:(0,C.A)(a,c.root),sx:l,children:[(0,b.jsx)(Nx.A,{value:"date","aria-label":u.dateTableLabel,icon:(0,b.jsx)(w.Fragment,{children:n})}),(0,b.jsx)(Nx.A,{value:"time","aria-label":u.timeTableLabel,icon:(0,b.jsx)(w.Fragment,{children:i})})]})};function NE(e){return(0,R.Ay)("MuiPickersToolbarText",e)}let N_=(0,_.A)("MuiPickersToolbarText",["root","selected"]),NR=["className","selected","value"],NP=(0,I.A)(fO.A,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${N_.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${N_.selected}`]:{color:(e.vars||e).palette.text.primary}})),NL=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersToolbarText"}),{className:r,value:i}=n,o=(0,_C.A)(n,NR),s=(e=>{let{classes:t,selected:n}=e;return(0,A.A)({root:["root",n&&"selected"]},NE,t)})(n);return(0,b.jsx)(NP,(0,iL.A)({ref:t,className:(0,C.A)(s.root,r),component:"span"},o,{children:i}))});function NN(e){return(0,R.Ay)("MuiPickersToolbar",e)}let NB=(0,_.A)("MuiPickersToolbar",["root","content"]),NF=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Nj=(0,I.A)("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Nz=(0,I.A)("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),NV=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersToolbar"}),{children:r,className:i,toolbarTitle:o,hidden:s,titleId:a}=n,l=(0,_C.A)(n,NF),u=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],content:["content"]},NN,t)})(n);return s?null:(0,b.jsxs)(Nj,(0,iL.A)({ref:t,className:(0,C.A)(u.root,i),ownerState:n},l,{children:[(0,b.jsx)(fO.A,{color:"text.secondary",variant:"overline",id:a,children:o}),(0,b.jsx)(Nz,{className:u.content,ownerState:n,children:r})]}))}),NH=["align","className","selected","typographyClassName","value","variant","width"],N$=(0,I.A)(z.A,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),NW=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersToolbarButton"}),{align:r,className:i,selected:o,typographyClassName:s,value:a,variant:l,width:u}=n,c=(0,_C.A)(n,NH),h=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"]},NN,t)})(n);return(0,b.jsx)(N$,(0,iL.A)({variant:"text",ref:t,className:(0,C.A)(h.root,i)},u?{sx:{width:u}}:{},c,{children:(0,b.jsx)(NL,{align:r,className:s,variant:l,value:a,selected:o})}))});function NG(e){return(0,R.Ay)("MuiDateTimePickerToolbar",e)}let NU=(0,_.A)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),Nq=["hours","minutes","seconds"],NY=e=>Nq.includes(e),NZ=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,NK=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),NX=(e,t)=>(n,r)=>e?t.isAfter(n,r):NK(n,t)>NK(r,t);function NJ(e,t,n,r){let i=Nu().utils;return{meridiemMode:e?i.getHours(e)>=12?"pm":"am":null,handleMeridiemChange:w.useCallback(o=>{var s;let a;n(null==e?null:(s=!!t,a=NZ(i.getHours(e),o,s),i.setHours(e,a)),r??"partial")},[t,e,n,r,i])}}let NQ=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],N0=(0,I.A)(NV,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${NB.content} .${N_.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),N1=(0,I.A)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),N2=(0,I.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&"desktop"!==t,style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&"desktop"!==t&&n,style:{flexDirection:"column-reverse"}}]}),N5=(0,I.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),N3=(0,I.A)(NL,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),N4=(0,I.A)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${NU.ampmLabel}`]:t.ampmLabel},{[`&.${NU.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${NU.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function N6(e){let t=Nn({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:u,toolbarPlaceholder:c="––",views:h,disabled:d,readOnly:f,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=t,v=(0,_C.A)(t,NQ),y=(0,fn.I)(),x=(0,iL.A)({},t,{isRtl:y}),S=Nu().utils,{meridiemMode:M,handleMeridiemChange:k}=NJ(i,n,o),T=!!(n&&!r),I="desktop"===p,D=Nu().localeText,O=(e=>{let{classes:t,isLandscape:n,isRtl:r}=e;return(0,A.A)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},NG,t)})(x),E=g??D.dateTimePickerToolbarTitle,_=w.useMemo(()=>i?u?S.formatByString(i,u):S.format(i,"shortDate"):c,[i,u,c,S]);return(0,b.jsxs)(N0,(0,iL.A)({isLandscape:a,className:(0,C.A)(O.root,m),toolbarTitle:E},v,{ownerState:x,children:[(0,b.jsxs)(N1,{className:O.dateContainer,ownerState:x,children:[h.includes("year")&&(0,b.jsx)(NW,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:"year"===s,value:i?S.format(i,"year"):"–"}),h.includes("day")&&(0,b.jsx)(NW,{tabIndex:-1,variant:I?"h5":"h4",onClick:()=>l("day"),selected:"day"===s,value:_})]}),(0,b.jsxs)(N2,{className:O.timeContainer,ownerState:x,children:[(0,b.jsxs)(N5,{className:O.timeDigitsContainer,ownerState:x,children:[h.includes("hours")&&(0,b.jsxs)(w.Fragment,{children:[(0,b.jsx)(NW,{variant:I?"h5":"h3",width:I&&!a?48:void 0,onClick:()=>l("hours"),selected:"hours"===s,value:i?n?S.format(i,"hours12h"):S.format(i,"hours24h"):"--"}),(0,b.jsx)(N3,{variant:I?"h5":"h3",value:":",className:O.separator,ownerState:x}),(0,b.jsx)(NW,{variant:I?"h5":"h3",width:I&&!a?48:void 0,onClick:()=>l("minutes"),selected:"minutes"===s||!h.includes("minutes")&&"hours"===s,value:i?S.format(i,"minutes"):"--",disabled:!h.includes("minutes")})]}),h.includes("seconds")&&(0,b.jsxs)(w.Fragment,{children:[(0,b.jsx)(N3,{variant:I?"h5":"h3",value:":",className:O.separator,ownerState:x}),(0,b.jsx)(NW,{variant:I?"h5":"h3",width:I&&!a?48:void 0,onClick:()=>l("seconds"),selected:"seconds"===s,value:i?S.format(i,"seconds"):"--"})]})]}),T&&!I&&(0,b.jsxs)(N4,{className:O.ampmSelection,ownerState:x,children:[(0,b.jsx)(NW,{variant:"subtitle2",selected:"am"===M,typographyClassName:O.ampmLabel,value:Nm(S,"am"),onClick:f?void 0:()=>k("am"),disabled:d}),(0,b.jsx)(NW,{variant:"subtitle2",selected:"pm"===M,typographyClassName:O.ampmLabel,value:Nm(S,"pm"),onClick:f?void 0:()=>k("pm"),disabled:d})]}),n&&I&&(0,b.jsx)(NW,{variant:"h5",onClick:()=>l("meridiem"),selected:"meridiem"===s,value:i&&M?Nm(S,M):"--",width:48})]})]}))}var N8=n(54553),N9=n(77893);function N7(e){return(0,R.Ay)("MuiPickersArrowSwitcher",e)}(0,_.A)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let Be=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Bt=["ownerState"],Bn=["ownerState"],Br=(0,I.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),Bi=(0,I.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),Bo=(0,I.A)($.A,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Bs=w.forwardRef(function(e,t){let n=(0,fn.I)(),r=Nn({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:o,slots:s,slotProps:a,isNextDisabled:l,isNextHidden:u,onGoToNext:c,nextLabel:h,isPreviousDisabled:d,isPreviousHidden:f,onGoToPrevious:p,previousLabel:g,labelId:m}=r,v=(0,_C.A)(r,Be),y=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},N7,t)})(r),x=s?.previousIconButton??Bo,w=(0,N9.A)({elementType:x,externalSlotProps:a?.previousIconButton,additionalProps:{size:"medium",title:g,"aria-label":g,disabled:d,edge:"end",onClick:p},ownerState:(0,iL.A)({},r,{hidden:f}),className:(0,C.A)(y.button,y.previousIconButton)}),S=s?.nextIconButton??Bo,M=(0,N9.A)({elementType:S,externalSlotProps:a?.nextIconButton,additionalProps:{size:"medium",title:h,"aria-label":h,disabled:l,edge:"start",onClick:c},ownerState:(0,iL.A)({},r,{hidden:u}),className:(0,C.A)(y.button,y.nextIconButton)}),k=s?.leftArrowIcon??NC,T=(0,N9.A)({elementType:k,externalSlotProps:a?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:y.leftArrowIcon}),I=(0,_C.A)(T,Bt),D=s?.rightArrowIcon??NA,O=(0,N9.A)({elementType:D,externalSlotProps:a?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:y.rightArrowIcon}),E=(0,_C.A)(O,Bn);return(0,b.jsxs)(Br,(0,iL.A)({ref:t,className:(0,C.A)(y.root,o),ownerState:r},v,{children:[(0,b.jsx)(x,(0,iL.A)({},w,{children:n?(0,b.jsx)(D,(0,iL.A)({},E)):(0,b.jsx)(k,(0,iL.A)({},I))})),i?(0,b.jsx)(fO.A,{variant:"subtitle1",component:"span",id:m,children:i}):(0,b.jsx)(Bi,{className:y.spacer,ownerState:r}),(0,b.jsx)(S,(0,iL.A)({},M,{children:n?(0,b.jsx)(k,(0,iL.A)({},I)):(0,b.jsx)(D,(0,iL.A)({},E))}))]}))});var Ba=n(83183),Bl=n(89369);function Bu({onChange:e,onViewChange:t,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){let l=w.useRef(n),u=w.useRef(i),c=w.useRef(i.includes(n)?n:i[0]),[h,d]=(0,Bl.A)({name:"useViews",state:"view",controlled:r,default:c.current}),f=w.useRef(o?h:null),[p,g]=(0,Bl.A)({name:"useViews",state:"focusedView",controlled:s,default:f.current});w.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(e=>!i.includes(e)))&&(d(i.includes(n)?n:i[0]),u.current=i,l.current=n)},[n,d,h,i]);let m=i.indexOf(h),v=i[m-1]??null,y=i[m+1]??null,x=(0,Ba.A)((e,t)=>{t?g(e):g(t=>e===t?null:t),a?.(e,t)}),b=(0,Ba.A)(e=>{x(e,!0),e!==h&&(d(e),t&&t(e))}),S=(0,Ba.A)(()=>{y&&b(y)}),C=(0,Ba.A)((t,n,r)=>{let o="finish"===n,s=r?i.indexOf(r)<i.length-1:!!y;if(e(t,o&&s?"partial":n,r),r&&r!==h){let e=i[i.indexOf(r)+1];e&&b(e)}else o&&S()});return{view:h,setView:b,focusedView:p,setFocusedView:x,nextView:y,previousView:v,defaultView:i.includes(n)?n:i[0],goToNextView:S,setValueAndGoToNextView:C}}let Bc=(0,I.A)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function Bh(e){return(0,R.Ay)("MuiTimeClock",e)}function Bd(e){return(0,R.Ay)("MuiClockPointer",e)}(0,_.A)("MuiTimeClock",["root","arrowSwitcher"]),(0,_.A)("MuiClockPointer",["root","thumb"]);let Bf=["className","hasSelected","isInner","type","viewValue"],Bp=(0,I.A)("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),Bg=(0,I.A)("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function Bm(e){let t,n=Nn({props:e,name:"MuiClockPointer"}),{className:r,isInner:i,type:o,viewValue:s}=n,a=(0,_C.A)(n,Bf),l=w.useRef(o);w.useEffect(()=>{l.current=o},[o]);let u=(0,iL.A)({},n,{shouldAnimate:l.current!==o}),c=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],thumb:["thumb"]},Bd,t)})(u);return(0,b.jsx)(Bp,(0,iL.A)({style:(t=360/("hours"===o?12:60)*s,"hours"===o&&s>12&&(t-=360),{height:Math.round((i?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,C.A)(c.root,r),ownerState:u},a,{children:(0,b.jsx)(Bg,{ownerState:u,className:c.thumb})}))}let Bv=110,By=110,Bx=Bv,Bb=0,Bw=Bx-Bv,BS=Bb-By,BC=(e,t,n)=>{let r=t-Bv,i=n-By,o=180/Math.PI*(Math.atan2(Bw,BS)-Math.atan2(r,i));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(r**2+i**2)}};function BA(e){return(0,R.Ay)("MuiClock",e)}(0,_.A)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let BM=(0,I.A)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),Bk=(0,I.A)("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),BT=(0,I.A)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),BI=(0,I.A)("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),BD=(0,I.A)("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),BO=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:36,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),BE=(0,I.A)($.A,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,iL.A)({},BO(e,"am"),{position:"absolute",left:8})),B_=(0,I.A)($.A,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,iL.A)({},BO(e,"pm"),{position:"absolute",right:8})),BR=(0,I.A)(fO.A,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function BP(e){let t=Nn({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:u,minutesStep:c=1,onChange:h,selectedId:d,type:f,viewValue:p,viewRange:[g,m],disabled:v=!1,readOnly:y,className:x}=t,S=Nu().utils,M=Nu().localeText,k=w.useRef(!1),T=(e=>{let{classes:t,meridiemMode:n}=e;return(0,A.A)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},BA,t)})(t),I=l(p,f),D=!n&&"hours"===f&&(p<1||p>12),O=(e,t)=>{v||y||l(e,f)||h(e,t)},E=(e,t)=>{let{offsetX:r,offsetY:i}=e;if(void 0===r){let t=e.target.getBoundingClientRect();r=e.changedTouches[0].clientX-t.left,i=e.changedTouches[0].clientY-t.top}O("seconds"===f||"minutes"===f?((e,t,n=1)=>{let{value:r}=BC(6*n,e,t);return r*n%60})(r,i,c):((e,t,n)=>{let{value:r,distance:i}=BC(30,e,t),o=r||12;return n?o%=12:i<74&&(o+=12,o%=24),o})(r,i,!!n),t)},_=e=>{k.current=!0,E(e,"shallow")},R=w.useMemo(()=>"hours"===f||p%5==0,[f,p]),P="minutes"===f?c:1,L=w.useRef(null);(0,gQ.A)(()=>{i&&L.current.focus()},[i]);let N=e=>Math.max(g,Math.min(m,e)),B=e=>(e+(m+1))%(m+1);return(0,b.jsxs)(BM,{className:(0,C.A)(T.root,x),children:[(0,b.jsxs)(Bk,{className:T.clock,children:[(0,b.jsx)(BI,{onTouchMove:_,onTouchStart:_,onTouchEnd:e=>{k.current&&(E(e,"finish"),k.current=!1),e.preventDefault()},onMouseUp:e=>{k.current&&(k.current=!1),E(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&E(e.nativeEvent,"shallow")},ownerState:{disabled:v},className:T.squareMask}),!I&&(0,b.jsxs)(w.Fragment,{children:[(0,b.jsx)(BD,{className:T.pin}),null!=s&&(0,b.jsx)(Bm,{type:f,viewValue:p,isInner:D,hasSelected:R})]}),(0,b.jsx)(BT,{"aria-activedescendant":d,"aria-label":M.clockLabelText(f,s,S,null==s?null:S.format(s,"fullTime")),ref:L,role:"listbox",onKeyDown:e=>{if(!k.current)switch(e.key){case"Home":O(g,"partial"),e.preventDefault();break;case"End":O(m,"partial"),e.preventDefault();break;case"ArrowUp":O(B(p+P),"partial"),e.preventDefault();break;case"ArrowDown":O(B(p-P),"partial"),e.preventDefault();break;case"PageUp":O(N(p+5),"partial"),e.preventDefault();break;case"PageDown":O(N(p-5),"partial"),e.preventDefault();break;case"Enter":case" ":O(p,"finish"),e.preventDefault()}},tabIndex:0,className:T.wrapper,children:o})]}),n&&r&&(0,b.jsxs)(w.Fragment,{children:[(0,b.jsx)(BE,{onClick:y?void 0:()=>a("am"),disabled:v||null===u,ownerState:t,className:T.amButton,title:Nm(S,"am"),children:(0,b.jsx)(BR,{variant:"caption",className:T.meridiemText,children:Nm(S,"am")})}),(0,b.jsx)(B_,{disabled:v||null===u,onClick:y?void 0:()=>a("pm"),ownerState:t,className:T.pmButton,title:Nm(S,"pm"),children:(0,b.jsx)(BR,{variant:"caption",className:T.meridiemText,children:Nm(S,"pm")})})]})]})}function BL(e){return(0,R.Ay)("MuiClockNumber",e)}let BN=(0,_.A)("MuiClockNumber",["root","selected","disabled"]),BB=["className","disabled","index","inner","label","selected"],BF=(0,I.A)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${BN.disabled}`]:t.disabled},{[`&.${BN.selected}`]:t.selected}]})(({theme:e})=>({height:36,width:36,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${BN.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${BN.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,iL.A)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Bj(e){let t=Nn({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=t,l=(0,_C.A)(t,BB),u=(e=>{let{classes:t,selected:n,disabled:r}=e;return(0,A.A)({root:["root",n&&"selected",r&&"disabled"]},BL,t)})(t),c=i%12/12*Math.PI*2-Math.PI/2,h=91*(o?.65:1),d=Math.round(Math.cos(c)*h),f=Math.round(Math.sin(c)*h);return(0,b.jsx)(BF,(0,iL.A)({className:(0,C.A)(u.root,n),"aria-disabled":!!r||void 0,"aria-selected":!!a||void 0,role:"option",style:{transform:`translate(${d}px, ${f+92}px`},ownerState:t},l,{children:s}))}let Bz=({utils:e,value:t,isDisabled:n,getClockNumberText:r,selectedId:i})=>{let o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([e,o],s)=>{let a=e===t;return(0,b.jsx)(Bj,{label:o,id:a?i:void 0,index:s+1,inner:!1,disabled:n(e),selected:a,"aria-label":r(o)},e)})},BV=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:i,valueManager:o})=>{let s,a=Nu().utils,l=w.useRef(n),u=t??l.current??o.emptyValue,c=w.useMemo(()=>o.getTimezone(a,u),[a,o,u]),h=(0,Ba.A)(e=>null==c?e:o.setTimezone(a,c,e));return s=e||c||(r?a.getTimezone(r):"default"),{value:w.useMemo(()=>o.setTimezone(a,s,u),[o,a,s,u]),handleValueChange:(0,Ba.A)((e,...t)=>{let n=h(e);i?.(n,...t)}),timezone:s}},BH=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:i,onChange:o,valueManager:s})=>{let[a,l]=(0,Bl.A)({name:e,state:"value",controlled:n,default:r??s.emptyValue});return BV({timezone:t,value:a,defaultValue:void 0,referenceDate:i,onChange:(0,Ba.A)((e,...t)=>{l(e),o?.(e,...t)}),valueManager:s})},B$={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},BW=(e,t,n)=>{if(t===B$.year)return e.startOfYear(n);if(t===B$.month)return e.startOfMonth(n);if(t===B$.day)return e.startOfDay(n);let r=n;return t<B$.minutes&&(r=e.setMinutes(r,0)),t<B$.seconds&&(r=e.setSeconds(r,0)),t<B$.milliseconds&&(r=e.setMilliseconds(r,0)),r},BG=(e,t)=>{let n=e.formatTokenMap[t];if(null==n)throw Error(`MUI X: The token "${t}" is not supported by the Date and Time Pickers.
|
|
43
|
+
Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.`);return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},BU=(e,t)=>{let n=[],r=e.date(void 0,"default"),i=e.startOfWeek(r),o=e.endOfWeek(r),s=i;for(;e.isBefore(s,o);)n.push(s),s=e.addDays(s,1);return n.map(n=>e.formatByString(n,t))},Bq=(e,t,n,r)=>{switch(n){case"month":return Np(e,e.date(void 0,t)).map(t=>e.formatByString(t,r));case"weekDay":return BU(e,r);case"meridiem":{let n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,r))}default:return[]}},BY=["0","1","2","3","4","5","6","7","8","9"],BZ=(e,t)=>{if("0"===t[0])return e;let n=[],r="";for(let i=0;i<e.length;i+=1){r+=e[i];let o=t.indexOf(r);o>-1&&(n.push(o.toString()),r="")}return n.join("")},BK=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),BX=(e,t)=>{let n=BZ(e,t);return" "!==n&&!Number.isNaN(Number(n))},BJ=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},BQ=(e,t,n,r,i)=>{if("day"===i.type&&"digit-with-letter"===i.contentType){let r=e.setDate(n.longestMonth,t);return e.formatByString(r,i.format)}let o=t.toString();return i.hasLeadingZerosInInput&&(o=BJ(o,i.maxLength)),BK(o,r)},B0=(e,t,n)=>{let r=e.value||e.placeholder,i="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(BZ(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!i&&1===r.length&&(r=`${r}\u200e`),"input-rtl"===t&&(r=`\u2068${r}\u2069`),r},B1=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),B2=(e,t,n,r)=>{if("digit"!==t)return!1;let i=e.date(void 0,"default");switch(n){case"year":if("dayjs"===e.lib&&"YY"===r)return!0;return e.formatByString(e.setYear(i,1),r).startsWith("0");case"month":return e.formatByString(e.startOfYear(i),r).length>1;case"day":return e.formatByString(e.startOfMonth(i),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),r).length>1;case"hours":return e.formatByString(e.setHours(i,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),r).length>1;default:throw Error("Invalid section type")}},B5=(e,t)=>{},B3={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},B4=(e,t,n,r,i)=>[...n].sort((e,t)=>B3[e.type]-B3[t.type]).reduce((n,r)=>!i||r.modified?((e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{let r=BU(e,t.format),i=e.formatByString(n,t.format),o=r.indexOf(i),s=r.indexOf(t.value);return e.addDays(n,s-o)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),i=e.getHours(r);if(t&&i>=12)return e.addHours(r,-12);if(!t&&i<12)return e.addHours(r,12);return r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}})(e,r,t,n):n,r),B6=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){let n=t.findIndex(t=>t.type===e);return -1===n?null:n}return e},B8=["value","referenceDate"],B9={emptyValue:null,getTodayValue:Ng,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=(0,_C.A)(e,B8);return null!=t&&r.utils.isValid(t)?t:null!=n?n:(({props:e,utils:t,granularity:n,timezone:r,getTodayDate:i})=>{let o=i?i():BW(t,n,Ng(t,r));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=BW(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=BW(t,n,e.maxDate));let s=NX(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&s(e.minTime,o)&&(o=BW(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:Nh(t,o,e.minTime))),null!=e.maxTime&&s(o,e.maxTime)&&(o=BW(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:Nh(t,o,e.maxTime))),o})(r)},cleanValue:(e,t)=>null!=t&&e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!(e.isValid(t)||null==t||e.isValid(n))&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>null!=t&&e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},B7={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&n?n:r(t),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{let r=e.map(e=>{let r=B0(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${r}${e.endSeparator}`}).join("");return n?`\u2066${r}\u2069`:r},getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:e=>e,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:null!=n&&e.isValid(n)?n:t.referenceValue})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},Fe=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Ft=(0,I.A)(Bc,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),Fn=(0,I.A)(Bs,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),Fr=["hours","minutes"],Fi=w.forwardRef(function(e,t){let n=Nu().utils,r=Nn({props:e,name:"MuiTimeClock"}),{ampm:i=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:s,slots:a,slotProps:l,value:u,defaultValue:c,referenceDate:h,disableIgnoringDatePartForTimeValidation:d=!1,maxTime:f,minTime:p,disableFuture:g,disablePast:m,minutesStep:v=1,shouldDisableTime:y,showViewSwitcher:x,onChange:S,view:M,views:k=Fr,openTo:T,onViewChange:I,focusedView:D,onFocusedViewChange:O,className:E,disabled:_,readOnly:R,timezone:P}=r,L=(0,_C.A)(r,Fe),{value:N,handleValueChange:B,timezone:F}=BH({name:"TimeClock",timezone:P,value:u,defaultValue:c,referenceDate:h,onChange:S,valueManager:B9}),j=(({value:e,referenceDate:t,utils:n,props:r,timezone:i})=>{let o=w.useMemo(()=>B9.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:B$.day,timezone:i,getTodayDate:()=>Ng(n,i,"date")}),[]);return e??o})({value:N,referenceDate:h,utils:n,props:r,timezone:F}),z=Nu().localeText,V=Nc(F),{view:H,setView:$,previousView:W,nextView:G,setValueAndGoToNextView:U}=Bu({view:M,views:k,openTo:T,onViewChange:I,onChange:B,focusedView:D,onFocusedViewChange:O}),{meridiemMode:q,handleMeridiemChange:Y}=NJ(j,i,U),Z=w.useCallback((e,t)=>{let r=NX(d,n),o="hours"===t||"minutes"===t&&k.includes("seconds"),s=({start:e,end:t})=>!(p&&r(p,t)||f&&r(e,f)||g&&r(e,V)||m&&r(V,o?t:e)),a=(e,r=1)=>{if(e%r!=0)return!1;if(y)switch(t){case"hours":return!y(n.setHours(j,e),"hours");case"minutes":return!y(n.setMinutes(j,e),"minutes");case"seconds":return!y(n.setSeconds(j,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=NZ(e,q,i),r=n.setHours(j,t);if(n.getHours(r)!==t)return!0;return!s({start:n.setSeconds(n.setMinutes(r,0),0),end:n.setSeconds(n.setMinutes(r,59),59)})||!a(t)}case"minutes":{let t=n.setMinutes(j,e);return!s({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!a(e,v)}case"seconds":{let t=n.setSeconds(j,e);return!s({start:t,end:t})||!a(e)}default:throw Error("not supported")}},[i,j,d,f,q,p,v,y,n,g,m,V,k]),K=(0,N8.A)(),X=w.useMemo(()=>{switch(H){case"hours":{let e,t=(e,t)=>{let r=NZ(e,q,i);U(n.setHours(j,r),t,"hours")},r=n.getHours(j);return e=i?r>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:r,children:(({ampm:e,value:t,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{let s=t?o.getHours(t):null,a=[],l=+!!e,u=e?12:23,c=t=>null!==s&&(e?12===t?12===s||0===s:s===t||s-12===t:s===t);for(let t=l;t<=u;t+=1){let s=t.toString();0===t&&(s="00");let l=!e&&(0===t||t>12);s=o.formatNumber(s);let u=c(t);a.push((0,b.jsx)(Bj,{id:u?i:void 0,index:t,inner:l,selected:u,disabled:r(t),label:s,"aria-label":n(s)},t))}return a})({value:N,utils:n,ampm:i,onChange:t,getClockNumberText:z.hoursClockNumberText,isDisabled:e=>_||Z(e,"hours"),selectedId:K}),viewRange:e}}case"minutes":{let e=n.getMinutes(j),t=(e,t)=>{U(n.setMinutes(j,e),t,"minutes")};return{viewValue:e,onChange:t,children:Bz({utils:n,value:e,onChange:t,getClockNumberText:z.minutesClockNumberText,isDisabled:e=>_||Z(e,"minutes"),selectedId:K}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds(j),t=(e,t)=>{U(n.setSeconds(j,e),t,"seconds")};return{viewValue:e,onChange:t,children:Bz({utils:n,value:e,onChange:t,getClockNumberText:z.secondsClockNumberText,isDisabled:e=>_||Z(e,"seconds"),selectedId:K}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[H,n,N,i,z.hoursClockNumberText,z.minutesClockNumberText,z.secondsClockNumberText,q,U,j,Z,K,_]),J=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],arrowSwitcher:["arrowSwitcher"]},Bh,t)})(r);return(0,b.jsxs)(Ft,(0,iL.A)({ref:t,className:(0,C.A)(J.root,E),ownerState:r},L,{children:[(0,b.jsx)(BP,(0,iL.A)({autoFocus:s??!!D,ampmInClock:o&&k.includes("hours"),value:N,type:H,ampm:i,minutesStep:v,isTimeDisabled:Z,meridiemMode:q,handleMeridiemChange:Y,selectedId:K,disabled:_,readOnly:R},X)),x&&(0,b.jsx)(Fn,{className:J.arrowSwitcher,slots:a,slotProps:l,onGoToPrevious:()=>$(W),isPreviousDisabled:!W,previousLabel:z.openPreviousView,onGoToNext:()=>$(G),isNextDisabled:!G,nextLabel:z.openNextView,ownerState:r})]}))}),Fo=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:w,readOnly:S,disabled:C,sx:A,autoFocus:M,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:T,timezone:I})=>(0,b.jsx)(Fi,{view:e,onViewChange:t,focusedView:n&&NY(n)?n:null,onFocusedViewChange:r,views:i.filter(NY),value:o,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:w,readOnly:S,disabled:C,sx:A,autoFocus:M,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:T,timezone:I}),Fs=({props:e,value:t,timezone:n,adapter:r})=>{if(null===t)return null;let{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:s,disablePast:a,disableFuture:l}=e,u=r.utils.date(void 0,n),c=Nf(r.utils,e.minDate,r.defaultDates.minDate),h=Nf(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(i&&i(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(s&&s(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,u)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,u)):return"disablePast";case!!(c&&r.utils.isBeforeDay(t,c)):return"minDate";case!!(h&&r.utils.isAfterDay(t,h)):return"maxDate";default:return null}};Fs.valueManager=B9;let Fa=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{let l=Nu();return w.useCallback(u=>null!==Fs({adapter:l,value:u,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}}),[l,e,t,n,r,i,o,s,a])};var Fl=n(44394),Fu=n(96313);let Fc=e=>(0,R.Ay)("MuiPickersFadeTransitionGroup",e);(0,_.A)("MuiPickersFadeTransitionGroup",["root"]);let Fh=(0,I.A)(Fl.A,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function Fd(e){let t=Nn({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,s=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"]},Fc,t)})(t),a=(0,lO.A)();return i?n:(0,b.jsx)(Fh,{className:(0,C.A)(s.root,r),children:(0,b.jsx)(Fu.A,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}var Ff=n(95591);function Fp(e){return(0,R.Ay)("MuiPickersDay",e)}let Fg=(0,_.A)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Fm=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],Fv=({theme:e})=>(0,iL.A)({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,M.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,M.X4)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Fg.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Fg.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Fg.disabled}:not(.${Fg.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Fg.disabled}&.${Fg.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${Fg.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),Fy=(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},Fx=(0,I.A)(lL.A,{name:"MuiPickersDay",slot:"Root",overridesResolver:Fy})(Fv),Fb=(0,I.A)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Fy})(({theme:e})=>(0,iL.A)({},Fv({theme:e}),{opacity:0,pointerEvents:"none"})),Fw=()=>{},FS=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersDay"}),{autoFocus:r=!1,className:i,day:o,disabled:s=!1,disableHighlightToday:a=!1,disableMargin:l=!1,isAnimating:u,onClick:c,onDaySelect:h,onFocus:d=Fw,onBlur:f=Fw,onKeyDown:p=Fw,onMouseDown:g=Fw,onMouseEnter:m=Fw,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:S,today:M=!1}=n,k=(0,_C.A)(n,Fm),T=(0,iL.A)({},n,{autoFocus:r,disabled:s,disableHighlightToday:a,disableMargin:l,selected:y,showDaysOutsideCurrentMonth:x,today:M}),I=(e=>{let{selected:t,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,u=s&&!a;return(0,A.A)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},Fp,l)})(T),D=Nu().utils,O=w.useRef(null),E=(0,Ff.A)(O,t);return((0,gQ.A)(()=>{!r||s||u||v||O.current.focus()},[r,s,u,v]),v&&!x)?(0,b.jsx)(Fb,{className:(0,C.A)(I.root,I.hiddenDaySpacingFiller,i),ownerState:T,role:k.role}):(0,b.jsx)(Fx,(0,iL.A)({className:(0,C.A)(I.root,i),ref:E,centerRipple:!0,disabled:s,tabIndex:y?0:-1,onKeyDown:e=>p(e,o),onFocus:e=>d(e,o),onBlur:e=>f(e,o),onMouseEnter:e=>m(e,o),onClick:e=>{s||h(o),v&&e.currentTarget.focus(),c&&c(e)},onMouseDown:e=>{g(e),v&&e.preventDefault()}},k,{ownerState:T,children:S||D.format(o,"dayOfMonth")}))}),FC=w.memo(FS);var FA=n(7490);function FM(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var Fk=n(64863),FT=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=FM(e.className,t):e.setAttribute("class",FM(e.className&&e.className.baseVal||"",t))})},FI=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.addClass(i,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r&&n?n+"-":"",o=r?""+i+e:n[e],s=r?o+"-active":n[e+"Active"],a=r?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:s,doneClassName:a}},t}(0,FA.A)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r,i=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(i+=" "+o),"active"===n&&e&&(0,Fk.F)(e),i&&(this.appliedClasses[t][n]=i,r=i,e&&r&&r.split(" ").forEach(function(t){e.classList?e.classList.add(t):(e.classList?t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" "))||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&FT(e,r),i&&FT(e,i),o&&FT(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,_C.A)(e,["classNames"]));return S().createElement(g8.Ay,(0,iL.A)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(S().Component);FI.defaultProps={classNames:""},FI.propTypes={};let FD=e=>(0,R.Ay)("MuiPickersSlideTransition",e),FO=(0,_.A)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),FE=["children","className","reduceAnimations","slideDirection","transKey","classes"],F_=(0,I.A)(Fl.A,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${FO["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${FO["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${FO.slideEnterActive}`]:t.slideEnterActive},{[`.${FO.slideExit}`]:t.slideExit},{[`.${FO["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${FO["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{let t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${FO["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${FO["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${FO.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${FO.slideExit}`]:{transform:"translate(0%)"},[`& .${FO["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${FO["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),FR=e=>(0,R.Ay)("MuiDayCalendar",e);(0,_.A)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let FP=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],FL=["ownerState"],FN=(0,I.A)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),FB=(0,I.A)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),FF=(0,I.A)(fO.A,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),Fj=(0,I.A)(fO.A,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),Fz=(0,I.A)(fO.A,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,iL.A)({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),FV=(0,I.A)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),FH=(0,I.A)(function(e){let t=Nn({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=t,s=(0,_C.A)(t,FE),a=(e=>{let{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,A.A)(r,FD,t)})(t),l=(0,lO.A)();if(i)return(0,b.jsx)("div",{className:(0,C.A)(a.root,r),children:n});let u={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return(0,b.jsx)(F_,{className:(0,C.A)(a.root,r),childFactory:e=>w.cloneElement(e,{classNames:u}),role:"presentation",children:(0,b.jsx)(FI,(0,iL.A)({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},s,{children:n}),o)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),F$=(0,I.A)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),FW=(0,I.A)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function FG(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=e,l=(0,_C.A)(e,FP),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:d,slots:f,slotProps:p,timezone:g}=t,m=Nu().utils,v=Nc(g),y=null!==r&&m.isSameDay(n,r),x=i.some(e=>m.isSameDay(e,n)),S=m.isSameDay(n,v),C=f?.day??FC,A=(0,N9.A)({elementType:C,externalSlotProps:p?.day,additionalProps:(0,iL.A)({disableHighlightToday:c,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:h,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:(0,iL.A)({},t,{day:n,selected:x})}),M=(0,_C.A)(A,FL),k=w.useMemo(()=>u||o(n),[u,o,n]),T=w.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),I=w.useMemo(()=>{let e=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(e)):m.isSameDay(n,e)},[s,n,d,m]),D=w.useMemo(()=>{let e=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(e)):m.isSameDay(n,e)},[s,n,d,m]);return(0,b.jsx)(C,(0,iL.A)({},M,{day:n,disabled:k,autoFocus:a&&y,today:S,outsideCurrentMonth:T,isFirstVisibleCell:I,isLastVisibleCell:D,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":S?"date":void 0}))}function FU(e){let t,n=Nn({props:e,name:"MuiDayCalendar"}),r=Nu().utils,{onFocusedDayChange:i,className:o,currentMonth:s,selectedDays:a,focusedDay:l,loading:u,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:h,readOnly:d,reduceAnimations:f,renderLoading:p=()=>(0,b.jsx)("span",{children:"..."}),slideDirection:g,TransitionProps:m,disablePast:v,disableFuture:y,minDate:x,maxDate:S,shouldDisableDate:M,shouldDisableMonth:k,shouldDisableYear:T,dayOfWeekFormatter:I=e=>r.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:D,onFocusedViewChange:O,gridLabelId:E,displayWeekNumber:_,fixedWeekNumber:R,autoFocus:P,timezone:L}=n,N=Nc(L),B=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},FR,t)})(n),F=(0,fn.I)(),j=Fa({shouldDisableDate:M,shouldDisableMonth:k,shouldDisableYear:T,minDate:x,maxDate:S,disablePast:v,disableFuture:y,timezone:L}),z=Nu().localeText,[V,H]=(0,Bl.A)({name:"DayCalendar",state:"hasFocus",controlled:D,default:P??!1}),[$,W]=w.useState(()=>l||N),G=(0,Ba.A)(e=>{d||c(e)}),U=e=>{j(e)||(i(e),W(e),O?.(!0),H(!0))},q=(0,Ba.A)((e,t)=>{switch(e.key){case"ArrowUp":U(r.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":U(r.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let n=r.addDays(t,F?1:-1),i=r.addMonths(t,F?1:-1);U(Nd({utils:r,date:n,minDate:F?n:r.startOfMonth(i),maxDate:F?r.endOfMonth(i):n,isDateDisabled:j,timezone:L})||n),e.preventDefault();break}case"ArrowRight":{let n=r.addDays(t,F?-1:1),i=r.addMonths(t,F?-1:1);U(Nd({utils:r,date:n,minDate:F?r.startOfMonth(i):n,maxDate:F?n:r.endOfMonth(i),isDateDisabled:j,timezone:L})||n),e.preventDefault();break}case"Home":U(r.startOfWeek(t)),e.preventDefault();break;case"End":U(r.endOfWeek(t)),e.preventDefault();break;case"PageUp":U(r.addMonths(t,1)),e.preventDefault();break;case"PageDown":U(r.addMonths(t,-1)),e.preventDefault()}}),Y=(0,Ba.A)((e,t)=>U(t)),Z=(0,Ba.A)((e,t)=>{V&&r.isSameDay($,t)&&O?.(!1)}),K=r.getMonth(s),X=r.getYear(s),J=w.useMemo(()=>a.filter(e=>!!e).map(e=>r.startOfDay(e)),[r,a]),Q=`${X}-${K}`,ee=w.useMemo(()=>w.createRef(),[Q]),et=w.useMemo(()=>{let e=r.startOfMonth(s),t=r.endOfMonth(s);return j($)||r.isAfterDay($,t)||r.isBeforeDay($,e)?Nd({utils:r,date:$,minDate:e,maxDate:t,disablePast:v,disableFuture:y,isDateDisabled:j,timezone:L}):$},[s,y,v,$,j,r,L]),en=w.useMemo(()=>{let e=r.getWeekArray(s),t=r.addMonths(s,1);for(;R&&e.length<R;){let n=r.getWeekArray(t),i=r.isSameDay(e[e.length-1][0],n[0][0]);n.slice(+!!i).forEach(t=>{e.length<R&&e.push(t)}),t=r.addMonths(t,1)}return e},[s,R,r]);return(0,b.jsxs)(FN,{role:"grid","aria-labelledby":E,className:B.root,children:[(0,b.jsxs)(FB,{role:"row",className:B.header,children:[_&&(0,b.jsx)(Fj,{variant:"caption",role:"columnheader","aria-label":z.calendarWeekNumberHeaderLabel,className:B.weekNumberLabel,children:z.calendarWeekNumberHeaderText}),(t=r.startOfWeek(N),[0,1,2,3,4,5,6].map(e=>r.addDays(t,e))).map((e,t)=>(0,b.jsx)(FF,{variant:"caption",role:"columnheader","aria-label":r.format(e,"weekday"),className:B.weekDayLabel,children:I(e)},t.toString()))]}),u?(0,b.jsx)(FV,{className:B.loadingContainer,children:p()}):(0,b.jsx)(FH,(0,iL.A)({transKey:Q,onExited:h,reduceAnimations:f,slideDirection:g,className:(0,C.A)(o,B.slideTransition)},m,{nodeRef:ee,children:(0,b.jsx)(F$,{ref:ee,role:"rowgroup",className:B.monthContainer,children:en.map((e,t)=>(0,b.jsxs)(FW,{role:"row",className:B.weekContainer,"aria-rowindex":t+1,children:[_&&(0,b.jsx)(Fz,{className:B.weekNumber,role:"rowheader","aria-label":z.calendarWeekNumberAriaLabelText(r.getWeekNumber(e[0])),children:z.calendarWeekNumberText(r.getWeekNumber(e[0]))}),e.map((e,t)=>(0,b.jsx)(FG,{parentProps:n,day:e,selectedDays:J,focusableDay:et,onKeyDown:q,onFocus:Y,onBlur:Z,onDaySelect:G,isDateDisabled:j,currentMonthNumber:K,isViewFocused:V,"aria-colindex":t+1},e.toString()))]},`week-${e[0]}`))})}))]})}function Fq(e){return(0,R.Ay)("MuiPickersMonth",e)}let FY=(0,_.A)("MuiPickersMonth",["root","monthButton","disabled","selected"]),FZ=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],FK=(0,I.A)("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),FX=(0,I.A)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${FY.disabled}`]:t.disabled},{[`&.${FY.selected}`]:t.selected}]})(({theme:e})=>(0,iL.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,M.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,M.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${FY.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${FY.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),FJ=w.memo(function(e){let t=Nn({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:r,children:i,disabled:o,selected:s,value:a,tabIndex:l,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":f,"aria-label":p,slots:g,slotProps:m}=t,v=(0,_C.A)(t,FZ),y=w.useRef(null),x=(e=>{let{disabled:t,selected:n,classes:r}=e;return(0,A.A)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},Fq,r)})(t);(0,gQ.A)(()=>{n&&y.current?.focus()},[n]);let S=g?.monthButton??FX,M=(0,N9.A)({elementType:S,externalSlotProps:m?.monthButton,additionalProps:{children:i,disabled:o,tabIndex:l,ref:y,type:"button",role:"radio","aria-current":f,"aria-checked":s,"aria-label":p,onClick:e=>u(e,a),onKeyDown:e=>c(e,a),onFocus:e=>h(e,a),onBlur:e=>d(e,a)},ownerState:t,className:x.monthButton});return(0,b.jsx)(FK,(0,iL.A)({className:(0,C.A)(x.root,r),ownerState:t},v,{children:(0,b.jsx)(S,(0,iL.A)({},M))}))});function FQ(e){return(0,R.Ay)("MuiMonthCalendar",e)}(0,_.A)("MuiMonthCalendar",["root"]);let F0=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],F1=(0,I.A)("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:320,boxSizing:"border-box"}),F2=w.forwardRef(function(e,t){let n,r,i,o=(n=Nu().utils,r=Nu().defaultDates,i=Nn({props:e,name:"MuiMonthCalendar"}),(0,iL.A)({disableFuture:!1,disablePast:!1},i,{minDate:Nf(n,i.minDate,r.minDate),maxDate:Nf(n,i.maxDate,r.maxDate)})),{className:s,value:a,defaultValue:l,referenceDate:u,disabled:c,disableFuture:h,disablePast:d,maxDate:f,minDate:p,onChange:g,shouldDisableMonth:m,readOnly:v,autoFocus:y=!1,onMonthFocus:x,hasFocus:S,onFocusedViewChange:M,monthsPerRow:k=3,timezone:T,gridLabelId:I,slots:D,slotProps:O}=o,E=(0,_C.A)(o,F0),{value:_,handleValueChange:R,timezone:P}=BH({name:"MonthCalendar",timezone:T,value:a,defaultValue:l,referenceDate:u,onChange:g,valueManager:B9}),L=Nc(P),N=(0,fn.I)(),B=Nu().utils,F=w.useMemo(()=>B9.getInitialReferenceValue({value:_,utils:B,props:o,timezone:P,referenceDate:u,granularity:B$.month}),[]),j=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"]},FQ,t)})(o),z=w.useMemo(()=>B.getMonth(L),[B,L]),V=w.useMemo(()=>null!=_?B.getMonth(_):null,[_,B]),[H,$]=w.useState(()=>V||B.getMonth(F)),[W,G]=(0,Bl.A)({name:"MonthCalendar",state:"hasFocus",controlled:S,default:y??!1}),U=(0,Ba.A)(e=>{G(e),M&&M(e)}),q=w.useCallback(e=>{let t=B.startOfMonth(d&&B.isAfter(L,p)?L:p),n=B.startOfMonth(h&&B.isBefore(L,f)?L:f),r=B.startOfMonth(e);return!!(B.isBefore(r,t)||B.isAfter(r,n))||!!m&&m(r)},[h,d,f,p,L,m,B]),Y=(0,Ba.A)((e,t)=>{v||R(B.setMonth(_??F,t))}),Z=(0,Ba.A)(e=>{!q(B.setMonth(_??F,e))&&($(e),U(!0),x&&x(e))});w.useEffect(()=>{$(e=>null!==V&&e!==V?V:e)},[V]);let K=(0,Ba.A)((e,t)=>{switch(e.key){case"ArrowUp":Z((12+t-3)%12),e.preventDefault();break;case"ArrowDown":Z((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":Z((12+t+(N?1:-1))%12),e.preventDefault();break;case"ArrowRight":Z((12+t+(N?-1:1))%12),e.preventDefault()}}),X=(0,Ba.A)((e,t)=>{Z(t)}),J=(0,Ba.A)((e,t)=>{H===t&&U(!1)});return(0,b.jsx)(F1,(0,iL.A)({ref:t,className:(0,C.A)(j.root,s),ownerState:o,role:"radiogroup","aria-labelledby":I},E,{children:Np(B,_??F).map(e=>{let t=B.getMonth(e),n=B.format(e,"monthShort"),r=B.format(e,"month"),i=c||q(e);return(0,b.jsx)(FJ,{selected:t===V,value:t,onClick:Y,onKeyDown:K,autoFocus:W&&t===H,disabled:i,tabIndex:t!==H||i?-1:0,onFocus:X,onBlur:J,"aria-current":z===t?"date":void 0,"aria-label":r,monthsPerRow:k,slots:D,slotProps:O,children:n},n)})}))});function F5(e){return(0,R.Ay)("MuiPickersYear",e)}let F3=(0,_.A)("MuiPickersYear",["root","yearButton","selected","disabled"]),F4=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],F6=(0,I.A)("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),F8=(0,I.A)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${F3.disabled}`]:t.disabled},{[`&.${F3.selected}`]:t.selected}]})(({theme:e})=>(0,iL.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:(0,M.X4)(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,M.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${F3.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${F3.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),F9=w.memo(function(e){let t=Nn({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:r,children:i,disabled:o,selected:s,value:a,tabIndex:l,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":f,slots:p,slotProps:g}=t,m=(0,_C.A)(t,F4),v=w.useRef(null),y=(e=>{let{disabled:t,selected:n,classes:r}=e;return(0,A.A)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},F5,r)})(t);(0,gQ.A)(()=>{n&&v.current?.focus()},[n]);let x=p?.yearButton??F8,S=(0,N9.A)({elementType:x,externalSlotProps:g?.yearButton,additionalProps:{children:i,disabled:o,tabIndex:l,ref:v,type:"button",role:"radio","aria-current":f,"aria-checked":s,onClick:e=>u(e,a),onKeyDown:e=>c(e,a),onFocus:e=>h(e,a),onBlur:e=>d(e,a)},ownerState:t,className:y.yearButton});return(0,b.jsx)(F6,(0,iL.A)({className:(0,C.A)(y.root,r),ownerState:t},m,{children:(0,b.jsx)(x,(0,iL.A)({},S))}))});function F7(e){return(0,R.Ay)("MuiYearCalendar",e)}(0,_.A)("MuiYearCalendar",["root"]);let je=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],jt=(0,I.A)("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:320,maxHeight:280,boxSizing:"border-box",position:"relative"}),jn=w.forwardRef(function(e,t){let n,r,i,o=(n=Nu().utils,r=Nu().defaultDates,i=Nn({props:e,name:"MuiYearCalendar"}),(0,iL.A)({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:Nf(n,i.minDate,r.minDate),maxDate:Nf(n,i.maxDate,r.maxDate)})),{autoFocus:s,className:a,value:l,defaultValue:u,referenceDate:c,disabled:h,disableFuture:d,disablePast:f,maxDate:p,minDate:g,onChange:m,readOnly:v,shouldDisableYear:y,onYearFocus:x,hasFocus:S,onFocusedViewChange:M,yearsOrder:k="asc",yearsPerRow:T,timezone:I,gridLabelId:D,slots:O,slotProps:E}=o,_=(0,_C.A)(o,je),{value:R,handleValueChange:P,timezone:L}=BH({name:"YearCalendar",timezone:I,value:l,defaultValue:u,referenceDate:c,onChange:m,valueManager:B9}),N=Nc(L),B=(0,fn.I)(),F=Nu().utils,j=w.useMemo(()=>B9.getInitialReferenceValue({value:R,utils:F,props:o,timezone:L,referenceDate:c,granularity:B$.year}),[]),z=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"]},F7,t)})(o),V=w.useMemo(()=>F.getYear(N),[F,N]),H=w.useMemo(()=>null!=R?F.getYear(R):null,[R,F]),[$,W]=w.useState(()=>H||F.getYear(j)),[G,U]=(0,Bl.A)({name:"YearCalendar",state:"hasFocus",controlled:S,default:s??!1}),q=(0,Ba.A)(e=>{U(e),M&&M(e)}),Y=w.useCallback(e=>!!(f&&F.isBeforeYear(e,N)||d&&F.isAfterYear(e,N)||g&&F.isBeforeYear(e,g)||p&&F.isAfterYear(e,p))||!!y&&y(F.startOfYear(e)),[d,f,p,g,N,y,F]),Z=(0,Ba.A)((e,t)=>{v||P(F.setYear(R??j,t))}),K=(0,Ba.A)(e=>{Y(F.setYear(R??j,e))||(W(e),q(!0),x?.(e))});w.useEffect(()=>{W(e=>null!==H&&e!==H?H:e)},[H]);let X="desc"!==k?+T:-1*T,J=B&&"asc"===k||!B&&"desc"===k?-1:1,Q=(0,Ba.A)((e,t)=>{switch(e.key){case"ArrowUp":K(t-X),e.preventDefault();break;case"ArrowDown":K(t+X),e.preventDefault();break;case"ArrowLeft":K(t-J),e.preventDefault();break;case"ArrowRight":K(t+J),e.preventDefault()}}),ee=(0,Ba.A)((e,t)=>{K(t)}),et=(0,Ba.A)((e,t)=>{$===t&&q(!1)}),en=w.useRef(null),er=(0,Ff.A)(t,en);w.useEffect(()=>{if(s||null===en.current)return;let e=en.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,r=en.current.clientHeight,i=en.current.scrollTop;t>r||n<i||(en.current.scrollTop=n+t-r/2-t/2)},[s]);let ei=F.getYearRange([g,p]);return"desc"===k&&ei.reverse(),(0,b.jsx)(jt,(0,iL.A)({ref:er,className:(0,C.A)(z.root,a),ownerState:o,role:"radiogroup","aria-labelledby":D},_,{children:ei.map(e=>{let t=F.getYear(e),n=h||Y(e);return(0,b.jsx)(F9,{selected:t===H,value:t,onClick:Z,onKeyDown:Q,autoFocus:G&&t===$,disabled:n,tabIndex:t!==$||n?-1:0,onFocus:ee,onBlur:et,"aria-current":V===t?"date":void 0,yearsPerRow:T,slots:O,slotProps:E,children:F.format(e,"year")},F.format(e,"year"))})}))}),jr=e=>(0,R.Ay)("MuiPickersCalendarHeader",e),ji=(0,_.A)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),jo=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],js=["ownerState"],ja=(0,I.A)("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),jl=(0,I.A)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,iL.A)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),ju=(0,I.A)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),jc=(0,I.A)($.A,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${ji.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),jh=(0,I.A)(NS,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),jd=w.forwardRef(function(e,t){let n=Nu().localeText,r=Nu().utils,i=Nn({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:s,currentMonth:a,disabled:l,disableFuture:u,disablePast:c,maxDate:h,minDate:d,onMonthChange:f,onViewChange:p,view:g,reduceAnimations:m,views:v,labelId:y,className:x,timezone:S,format:M=`${r.formats.month} ${r.formats.year}`}=i,k=(0,_C.A)(i,jo),T=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},jr,t)})(i),I=o?.switchViewButton??jc,D=(0,N9.A)({elementType:I,externalSlotProps:s?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:i,className:T.switchViewButton}),O=o?.switchViewIcon??jh,E=(0,N9.A)({elementType:O,externalSlotProps:s?.switchViewIcon,ownerState:i,className:T.switchViewIcon}),_=(0,_C.A)(E,js),R=function(e,{disableFuture:t,maxDate:n,timezone:r}){let i=Nu().utils;return w.useMemo(()=>{let o=i.date(void 0,r),s=i.startOfMonth(t&&i.isBefore(o,n)?o:n);return!i.isAfter(s,e)},[t,n,e,i,r])}(a,{disableFuture:u,maxDate:h,timezone:S}),P=function(e,{disablePast:t,minDate:n,timezone:r}){let i=Nu().utils;return w.useMemo(()=>{let o=i.date(void 0,r),s=i.startOfMonth(t&&i.isAfter(o,n)?o:n);return!i.isBefore(s,e)},[t,n,e,i,r])}(a,{disablePast:c,minDate:d,timezone:S});if(1===v.length&&"year"===v[0])return null;let L=r.formatByString(a,M);return(0,b.jsxs)(ja,(0,iL.A)({},k,{ownerState:i,className:(0,C.A)(T.root,x),ref:t,children:[(0,b.jsxs)(jl,{role:"presentation",onClick:()=>{if(1!==v.length&&p&&!l)if(2===v.length)p(v.find(e=>e!==g)||v[0]);else{let e=+(0===v.indexOf(g));p(v[e])}},ownerState:i,"aria-live":"polite",className:T.labelContainer,children:[(0,b.jsx)(Fd,{reduceAnimations:m,transKey:L,children:(0,b.jsx)(ju,{id:y,ownerState:i,className:T.label,children:L})}),v.length>1&&!l&&(0,b.jsx)(I,(0,iL.A)({},D,{children:(0,b.jsx)(O,(0,iL.A)({},_))}))]}),(0,b.jsx)(Fu.A,{in:"day"===g,appear:!m,enter:!m,children:(0,b.jsx)(Bs,{slots:o,slotProps:s,onGoToPrevious:()=>f(r.addMonths(a,-1),"right"),isPreviousDisabled:P,previousLabel:n.previousMonth,onGoToNext:()=>f(r.addMonths(a,1),"left"),isNextDisabled:R,nextLabel:n.nextMonth})})]}))}),jf="u">typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),jp=jf&&jf[1]?parseInt(jf[1],10):null,jg=jf&&jf[2]?parseInt(jf[2],10):null,jm=jp&&jp<10||jg&&jg<13||!1,jv=e=>(0,R.Ay)("MuiDateCalendar",e);(0,_.A)("MuiDateCalendar",["root","viewTransitionContainer"]);let jy=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],jx=(0,I.A)(Bc,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),jb=(0,I.A)(Fd,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),jw=w.forwardRef(function(e,t){let n,r,i,o,s=Nu().utils,a=(0,N8.A)(),l=(n=Nu().utils,r=Nu().defaultDates,i=g4("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||jm,o=Nn({props:e,name:"MuiDateCalendar"}),(0,iL.A)({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>(0,b.jsx)("span",{children:"..."})),minDate:Nf(n,o.minDate,r.minDate),maxDate:Nf(n,o.maxDate,r.maxDate)})),{autoFocus:u,onViewChange:c,value:h,defaultValue:d,referenceDate:f,disableFuture:p,disablePast:g,onChange:m,onYearChange:v,onMonthChange:y,reduceAnimations:x,shouldDisableDate:S,shouldDisableMonth:M,shouldDisableYear:k,view:T,views:I,openTo:D,className:O,disabled:E,readOnly:_,minDate:R,maxDate:P,disableHighlightToday:L,focusedView:N,onFocusedViewChange:B,showDaysOutsideCurrentMonth:F,fixedWeekNumber:j,dayOfWeekFormatter:z,slots:V,slotProps:H,loading:$,renderLoading:W,displayWeekNumber:G,yearsOrder:U,yearsPerRow:q,monthsPerRow:Y,timezone:Z}=l,K=(0,_C.A)(l,jy),{value:X,handleValueChange:J,timezone:Q}=BH({name:"DateCalendar",timezone:Z,value:h,defaultValue:d,referenceDate:f,onChange:m,valueManager:B9}),{view:ee,setView:et,focusedView:en,setFocusedView:er,goToNextView:ei,setValueAndGoToNextView:eo}=Bu({view:T,views:I,openTo:D,onChange:J,onViewChange:c,autoFocus:u,focusedView:N,onFocusedViewChange:B}),{referenceDate:es,calendarState:ea,changeFocusedDay:el,changeMonth:eu,handleChangeMonth:ec,isDateDisabled:eh,onMonthSwitchingAnimationEnd:ed}=(e=>{let t,{value:n,referenceDate:r,disableFuture:i,disablePast:o,disableSwitchToMonthOnDayFocus:s=!1,maxDate:a,minDate:l,onMonthChange:u,reduceAnimations:c,shouldDisableDate:h,timezone:d}=e,f=Nu().utils,p=w.useRef((t=!!c,(e,n)=>{switch(n.type){case"changeMonth":return(0,iL.A)({},e,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"changeMonthTimezone":{let t=n.newTimezone;if(f.getTimezone(e.currentMonth)===t)return e;let r=f.setTimezone(e.currentMonth,t);return f.getMonth(r)!==f.getMonth(e.currentMonth)&&(r=f.setMonth(r,f.getMonth(e.currentMonth))),(0,iL.A)({},e,{currentMonth:r})}case"finishMonthSwitchingAnimation":return(0,iL.A)({},e,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=e.focusedDay&&null!=n.focusedDay&&f.isSameDay(n.focusedDay,e.focusedDay))return e;let r=null!=n.focusedDay&&!s&&!f.isSameMonth(e.currentMonth,n.focusedDay);return(0,iL.A)({},e,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:r&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:r?f.startOfMonth(n.focusedDay):e.currentMonth,slideDirection:null!=n.focusedDay&&f.isAfterDay(n.focusedDay,e.currentMonth)?"left":"right"})}default:throw Error("missing support")}})).current,g=w.useMemo(()=>B9.getInitialReferenceValue({value:n,utils:f,timezone:d,props:e,referenceDate:r,granularity:B$.day}),[r,d]),[m,v]=w.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:f.startOfMonth(g),slideDirection:"left"});w.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:f.getTimezone(g)})},[g,f]);let y=w.useCallback(e=>{v((0,iL.A)({type:"changeMonth"},e)),u&&u(e.newMonth)},[u]),x=w.useCallback(e=>{f.isSameMonth(e,m.currentMonth)||y({newMonth:f.startOfMonth(e),direction:f.isAfterDay(e,m.currentMonth)?"left":"right"})},[m.currentMonth,y,f]),b=Fa({shouldDisableDate:h,minDate:l,maxDate:a,disableFuture:i,disablePast:o,timezone:d}),S=w.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:g,calendarState:m,changeMonth:x,changeFocusedDay:(0,Ba.A)((e,t)=>{b(e)||v({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:b,onMonthSwitchingAnimationEnd:S,handleChangeMonth:y}})({value:X,referenceDate:f,reduceAnimations:x,onMonthChange:y,minDate:R,maxDate:P,shouldDisableDate:S,disablePast:g,disableFuture:p,timezone:Q}),ef=E&&X||R,ep=E&&X||P,eg=`${a}-grid-label`,em=null!==en,ev=V?.calendarHeader??jd,ey=(0,N9.A)({elementType:ev,externalSlotProps:H?.calendarHeader,additionalProps:{views:I,view:ee,currentMonth:ea.currentMonth,onViewChange:et,onMonthChange:(e,t)=>ec({newMonth:e,direction:t}),minDate:ef,maxDate:ep,disabled:E,disablePast:g,disableFuture:p,reduceAnimations:x,timezone:Q,labelId:eg},ownerState:l}),ex=(0,Ba.A)(e=>{let t=s.startOfMonth(e),n=s.endOfMonth(e),r=eh(e)?Nd({utils:s,date:e,minDate:s.isBefore(R,t)?t:R,maxDate:s.isAfter(P,n)?n:P,disablePast:g,disableFuture:p,isDateDisabled:eh,timezone:Q}):e;r?(eo(r,"finish"),y?.(t)):(ei(),eu(t)),el(r,!0)}),eb=(0,Ba.A)(e=>{let t=s.startOfYear(e),n=s.endOfYear(e),r=eh(e)?Nd({utils:s,date:e,minDate:s.isBefore(R,t)?t:R,maxDate:s.isAfter(P,n)?n:P,disablePast:g,disableFuture:p,isDateDisabled:eh,timezone:Q}):e;r?(eo(r,"finish"),v?.(r)):(ei(),eu(t)),el(r,!0)}),ew=(0,Ba.A)(e=>e?J(Nh(s,e,X??es),"finish",ee):J(e,"finish",ee));w.useEffect(()=>{null!=X&&s.isValid(X)&&eu(X)},[X]);let eS=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},jv,t)})(l),eC={disablePast:g,disableFuture:p,maxDate:P,minDate:R},eA={disableHighlightToday:L,readOnly:_,disabled:E,timezone:Q,gridLabelId:eg,slots:V,slotProps:H},eM=w.useRef(ee);w.useEffect(()=>{eM.current!==ee&&(en===eM.current&&er(ee,!0),eM.current=ee)},[en,er,ee]);let ek=w.useMemo(()=>[X],[X]);return(0,b.jsxs)(jx,(0,iL.A)({ref:t,className:(0,C.A)(eS.root,O),ownerState:l},K,{children:[(0,b.jsx)(ev,(0,iL.A)({},ey,{slots:V,slotProps:H})),(0,b.jsx)(jb,{reduceAnimations:x,className:eS.viewTransitionContainer,transKey:ee,ownerState:l,children:(0,b.jsxs)("div",{children:["year"===ee&&(0,b.jsx)(jn,(0,iL.A)({},eC,eA,{value:X,onChange:eb,shouldDisableYear:k,hasFocus:em,onFocusedViewChange:e=>er("year",e),yearsOrder:U,yearsPerRow:q,referenceDate:es})),"month"===ee&&(0,b.jsx)(F2,(0,iL.A)({},eC,eA,{hasFocus:em,className:O,value:X,onChange:ex,shouldDisableMonth:M,onFocusedViewChange:e=>er("month",e),monthsPerRow:Y,referenceDate:es})),"day"===ee&&(0,b.jsx)(FU,(0,iL.A)({},ea,eC,eA,{onMonthSwitchingAnimationEnd:ed,onFocusedDayChange:el,reduceAnimations:x,selectedDays:ek,onSelectedDaysChange:ew,shouldDisableDate:S,shouldDisableMonth:M,shouldDisableYear:k,hasFocus:em,onFocusedViewChange:e=>er("day",e),showDaysOutsideCurrentMonth:F,fixedWeekNumber:j,dayOfWeekFormatter:z,displayWeekNumber:G,loading:$,renderLoading:W}))]})})]}))}),jS=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minDate:f,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:w,onYearChange:S,yearsOrder:C,yearsPerRow:A,slots:M,slotProps:k,loading:T,renderLoading:I,disableHighlightToday:D,readOnly:O,disabled:E,showDaysOutsideCurrentMonth:_,dayOfWeekFormatter:R,sx:P,autoFocus:L,fixedWeekNumber:N,displayWeekNumber:B,timezone:F})=>(0,b.jsx)(jw,{view:e,onViewChange:t,views:n.filter(Ny),focusedView:r&&Ny(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minDate:f,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:w,onYearChange:S,yearsOrder:C,yearsPerRow:A,slots:M,slotProps:k,loading:T,renderLoading:I,disableHighlightToday:D,readOnly:O,disabled:E,showDaysOutsideCurrentMonth:_,dayOfWeekFormatter:R,sx:P,autoFocus:L,fixedWeekNumber:N,displayWeekNumber:B,timezone:F});function jC(e){let{props:t,validator:n,value:r,timezone:i,onError:o}=e,s=Nu(),a=w.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:t}),u=n.valueManager.hasError(l);return w.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]),{validationError:l,hasValidationError:u,getValidationErrorForNewValue:(0,Ba.A)(e=>n({adapter:s,value:e,timezone:i,props:t}))}}let jA=["className","sx"],jM=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?jM(t.shadowRoot):t:null};function jk(){return"u"<typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function jT(e){return(0,R.Ay)("MuiPickersLayout",e)}let jI=(0,_.A)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),jD=["onAccept","onClear","onCancel","onSetToday","actions"];function jO(e){let{onAccept:t,onClear:n,onCancel:r,onSetToday:i,actions:o}=e,s=(0,_C.A)(e,jD),a=Nu().localeText;if(null==o||0===o.length)return null;let l=o?.map(e=>{switch(e){case"clear":return(0,b.jsx)(z.A,{onClick:n,children:a.clearButtonLabel},e);case"cancel":return(0,b.jsx)(z.A,{onClick:r,children:a.cancelButtonLabel},e);case"accept":return(0,b.jsx)(z.A,{onClick:t,children:a.okButtonLabel},e);case"today":return(0,b.jsx)(z.A,{onClick:i,children:a.todayButtonLabel},e);default:return null}});return(0,b.jsx)(pN.A,(0,iL.A)({},s,{children:l}))}var jE=n(76477),j_=n(79223),jR=n(6835);function jP(e){return(0,R.Ay)("MuiListItem",e)}function jL(e){return(0,R.Ay)("MuiListItemSecondaryAction",e)}(0,_.A)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,_.A)("MuiListItemSecondaryAction",["root","disableGutters"]);let jN=(0,I.A)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),jB=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:r,...i}=n,o=w.useContext(lF.A),s={...n,disableGutters:o.disableGutters},a=(e=>{let{disableGutters:t,classes:n}=e;return(0,A.A)({root:["root",t&&"disableGutters"]},jL,n)})(s);return(0,b.jsx)(jN,{className:(0,C.A)(a.root,r),ownerState:s,ref:t,...i})});jB.muiName="ListItemSecondaryAction";let jF=(0,I.A)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]}})((0,D.A)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${lz.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),jj=(0,I.A)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),jz=w.forwardRef(function(e,t){let n=(0,E.b)({props:e,name:"MuiListItem"}),{alignItems:r="center",children:i,className:o,component:s,components:a={},componentsProps:l={},ContainerComponent:u="li",ContainerProps:{className:c,...h}={},dense:d=!1,disableGutters:f=!1,disablePadding:p=!1,divider:g=!1,secondaryAction:m,slotProps:v={},slots:y={},...x}=n,S=w.useContext(lF.A),M=w.useMemo(()=>({dense:d||S.dense||!1,alignItems:r,disableGutters:f}),[r,S.dense,d,f]),k=w.useRef(null),T=w.Children.toArray(i),I=T.length&&(0,jR.A)(T[T.length-1],["ListItemSecondaryAction"]),D={...n,alignItems:r,dense:M.dense,disableGutters:f,disablePadding:p,divider:g,hasSecondaryAction:I},O=(e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=e;return(0,A.A)({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider","flex-start"===t&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},jP,n)})(D),_=(0,lB.A)(k,t),R=y.root||a.Root||jF,P=v.root||l.root||{},L={className:(0,C.A)(O.root,P.className,o),...x},N=s||"li";return I?(N=L.component||s?N:"div","li"===u&&("li"===N?N="div":"li"===L.component&&(L.component="div")),(0,b.jsx)(lF.A.Provider,{value:M,children:(0,b.jsxs)(jj,{as:u,className:(0,C.A)(O.container,c),ref:_,ownerState:D,...h,children:[(0,b.jsx)(R,{...P,...!(0,j_.A)(R)&&{as:N,ownerState:{...D,...P.ownerState}},...L,children:T}),T.pop()]})})):(0,b.jsx)(lF.A.Provider,{value:M,children:(0,b.jsxs)(R,{...P,as:N,ref:_,...!(0,j_.A)(R)&&{ownerState:{...D,...P.ownerState}},...L,children:[T,m&&(0,b.jsx)(jB,{children:m})]})})});var jV=n(47601);let jH=["items","changeImportance","isLandscape","onChange","isValid"],j$=["getValue"];function jW(e){let{items:t,changeImportance:n="accept",onChange:r,isValid:i}=e,o=(0,_C.A)(e,jH);if(null==t||0===t.length)return null;let s=t.map(e=>{let{getValue:t}=e,o=(0,_C.A)(e,j$),s=t({isValid:i});return(0,iL.A)({},o,{label:o.label,onClick:()=>{r(s,n,o)},disabled:!i(s)})});return(0,b.jsx)(jE.A,(0,iL.A)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(e=>(0,b.jsx)(jz,{children:(0,b.jsx)(jV.A,(0,iL.A)({},e))},e.id??e.label))}))}let jG=(0,I.A)("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${jI.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${jI.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${jI.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${jI.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${jI.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${jI.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${jI.shortcuts}`]:{gridColumn:3}}}]}),jU=(0,I.A)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),jq=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersLayout"}),{toolbar:r,content:i,tabs:o,actionBar:s,shortcuts:a}=(e=>{let{wrapperVariant:t,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:u,onChange:c,onSelectShortcut:h,isValid:d,isLandscape:f,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=e,x=(e=>{let{classes:t,isLandscape:n}=e;return(0,A.A)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},jT,t)})(e),w=v?.actionBar??jO,S=(0,N9.A)({elementType:w,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:"desktop"===t?[]:["cancel","accept"]},className:x.actionBar,ownerState:(0,iL.A)({},e,{wrapperVariant:t})}),C=(0,b.jsx)(w,(0,iL.A)({},S)),M=v?.toolbar,k=(0,N9.A)({elementType:M,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:f,onChange:c,value:u,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:x.toolbar,ownerState:(0,iL.A)({},e,{wrapperVariant:t})}),T=null!==k.view&&M?(0,b.jsx)(M,(0,iL.A)({},k)):null,I=v?.tabs,D=s&&I?(0,b.jsx)(I,(0,iL.A)({view:s,onViewChange:l,className:x.tabs},y?.tabs)):null,O=v?.shortcuts??jW,E=(0,N9.A)({elementType:O,externalSlotProps:y?.shortcuts,additionalProps:{isValid:d,isLandscape:f,onChange:h},className:x.shortcuts,ownerState:{isValid:d,isLandscape:f,onChange:h,wrapperVariant:t}});return{toolbar:T,content:m,tabs:D,actionBar:C,shortcuts:s&&O?(0,b.jsx)(O,(0,iL.A)({},E)):null}})(n),{sx:l,className:u,isLandscape:c,wrapperVariant:h}=n,d=(e=>{let{isLandscape:t,classes:n}=e;return(0,A.A)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},jT,n)})(n);return(0,b.jsxs)(jG,{ref:t,sx:l,className:(0,C.A)(d.root,u),ownerState:n,children:[c?a:r,c?r:a,(0,b.jsx)(jU,{className:d.contentWrapper,children:"desktop"===h?(0,b.jsxs)(w.Fragment,{children:[i,o]}):(0,b.jsxs)(w.Fragment,{children:[o,i]})}),s]})}),jY=["props","ref"],jZ=(0,I.A)(jq)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),jK=({adapter:e,value:t,timezone:n,props:r})=>{if(null===t)return null;let{minTime:i,maxTime:o,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:u,disableFuture:c}=r,h=e.utils.date(void 0,n),d=NX(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(i&&d(i,t)):return"minTime";case!!(o&&d(t,o)):return"maxTime";case!!(c&&e.utils.isAfter(t,h)):return"disableFuture";case!!(u&&e.utils.isBefore(t,h)):return"disablePast";case!!(a&&a(t,"hours")):return"shouldDisableTime-hours";case!!(a&&a(t,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(t,"seconds")):return"shouldDisableTime-seconds";case!!(s&&e.utils.getMinutes(t)%s!=0):return"minutesStep";default:return null}};jK.valueManager=B9;let jX=({adapter:e,value:t,timezone:n,props:r})=>{let i=Fs({adapter:e,value:t,timezone:n,props:r});return null!==i?i:jK({adapter:e,value:t,timezone:n,props:r})};jX.valueManager=B9;let jJ=w.forwardRef(function(e,t){let n,r,i,o,s,a=(n=Nu().utils,r=Nu().defaultDates,o=(i=Nn({props:e,name:"MuiStaticDateTimePicker"})).ampm??n.is12HourCycleInCurrentLocale(),s=w.useMemo(()=>i.localeText?.toolbarTitle==null?i.localeText:(0,iL.A)({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle}),[i.localeText]),(0,iL.A)({},i,(({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{let i,o=n??r;if(null!=e)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}})({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:Nf(n,i.minDateTime??i.minDate,r.minDate),maxDate:Nf(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:(0,iL.A)({toolbar:N6,tabs:NO},i.slots),slotProps:(0,iL.A)({},i.slotProps,{toolbar:(0,iL.A)({ampm:o},i.slotProps?.toolbar)})})),l=a.displayStaticWrapperAs??"mobile",u=a.ampmInClock??"desktop"===l,c=(0,iL.A)({day:jS,month:jS,year:jS,hours:Fo,minutes:Fo,seconds:Fo},a.viewRenderers),{renderPicker:h}=(e=>{let{props:t,ref:n}=e,r=(0,_C.A)(e,jY),{localeText:i,slots:o,slotProps:s,className:a,sx:l,displayStaticWrapperAs:u,autoFocus:c}=t,{layoutProps:h,renderCurrentView:d}=(({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{let u=(({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i})=>{let{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:u="desktop"===r,timezone:c,referenceDate:h}=e,{current:d}=w.useRef(l),{current:f}=w.useRef(void 0!==a),[p,g]=w.useState(c),m=Nu().utils,v=Nu(),{isOpen:y,setIsOpen:x}=(({open:e,onOpen:t,onClose:n})=>{let r=w.useRef("boolean"==typeof e).current,[i,o]=w.useState(!1);return w.useEffect(()=>{if(r){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[r,e]),{isOpen:i,setIsOpen:w.useCallback(e=>{r||o(e),e&&t&&t(),!e&&n&&n()},[r,t,n])}})(e),{timezone:b,value:S,handleValueChange:C}=BV({timezone:c,value:a,defaultValue:d,referenceDate:h,onChange:s,valueManager:t}),[A,M]=w.useState(()=>{let e;return{draft:e=void 0!==S?S:void 0!==d?d:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),k=t.getTimezone(m,A.draft);p!==c&&(g(c),c&&k&&c!==k&&M(e=>(0,iL.A)({},e,{draft:t.setTimezone(m,c,e.draft)})));let{getValidationErrorForNewValue:T}=jC({props:e,validator:i,timezone:b,value:A.draft,onError:e.onError}),I=(0,Ba.A)(e=>{let n={action:e,dateState:A,hasChanged:n=>!t.areValuesEqual(m,e.value,n),isControlled:f,closeOnSelect:u},r=(e=>{let{action:t,hasChanged:n,dateState:r,isControlled:i}=e,o=!i&&!r.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(r.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(r.lastPublishedValue)))})(n),i=(e=>{let{action:t,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=e,s=!i&&!r.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(s&&["accept","today","clear"].includes(t.pickerAction))||n(r.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!s||n(r.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(r.lastCommittedValue)})(n),s=(e=>{let{action:t,closeOnSelect:n}=e;return"setValueFromAction"===t.name||("setValueFromView"===t.name?"finish"===t.selectionState&&n:"setValueFromShortcut"===t.name&&"accept"===t.changeImportance)})(n);M(t=>(0,iL.A)({},t,{draft:e.value,lastPublishedValue:r?e.value:t.lastPublishedValue,lastCommittedValue:i?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let a=null,l=()=>(a||(a={validationError:"setValueFromField"===e.name?e.context.validationError:T(e.value)},"setValueFromShortcut"===e.name&&(a.shortcut=e.shortcut)),a);r&&C(e.value,l()),i&&o&&o(e.value,l()),s&&x(!1)});if(A.lastControlledValue!==a){let e=t.areValuesEqual(m,A.draft,S);M(t=>(0,iL.A)({},t,{lastControlledValue:a},e?{}:{lastCommittedValue:S,lastPublishedValue:S,draft:S,hasBeenModifiedSinceMount:!0}))}let D=(0,Ba.A)(()=>{I({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),O=(0,Ba.A)(()=>{I({value:A.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=(0,Ba.A)(()=>{I({value:A.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),_=(0,Ba.A)(()=>{I({value:A.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),R=(0,Ba.A)(()=>{I({value:t.getTodayValue(m,b,n),name:"setValueFromAction",pickerAction:"today"})}),P=(0,Ba.A)(e=>{e.preventDefault(),x(!0)}),L=(0,Ba.A)(e=>{e?.preventDefault(),x(!1)}),N=(0,Ba.A)((e,t="partial")=>I({name:"setValueFromView",value:e,selectionState:t})),B=(0,Ba.A)((e,t,n)=>I({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),F=(0,Ba.A)((e,t)=>I({name:"setValueFromField",value:e,context:t})),j={onClear:D,onAccept:O,onDismiss:E,onCancel:_,onSetToday:R,onOpen:P,onClose:L},z={value:A.draft,onChange:F},V=w.useMemo(()=>t.cleanValue(m,A.draft),[m,t,A.draft]),H=(0,iL.A)({},j,{value:V,onChange:N,onSelectShortcut:B,isValid:n=>{let r=i({adapter:v,value:n,timezone:b,props:e});return!t.hasError(r)}}),$=w.useMemo(()=>({onOpen:P,onClose:L,open:y}),[y,L,P]);return{open:y,fieldProps:z,viewProps:{value:V,onChange:N,onClose:L,open:y},layoutProps:H,actions:j,contextValue:$}})({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o}),c=(({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{let{onChange:s,open:a,onClose:l}=t,{view:u,views:c,openTo:h,onViewChange:d,viewRenderers:f,timezone:p}=e,g=(0,_C.A)(e,jA),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:S}=Bu({view:u,views:c,openTo:h,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:C,viewModeLookup:A}=w.useMemo(()=>c.reduce((e,t)=>{let n;return n=null!=f[t]?"UI":"field",e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0),e},{hasUIView:!1,viewModeLookup:{}}),[f,c]),M=w.useMemo(()=>c.reduce((e,t)=>null!=f[t]&&NY(t)?e+1:e,0),[f,c]),k=A[m],T=(0,Ba.A)(()=>"UI"===k),[I,D]=w.useState("UI"===k?m:null);return I!==m&&"UI"===A[m]&&D(m),(0,gQ.A)(()=>{"field"===k&&a&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),(0,gQ.A)(()=>{if(!a)return;let e=m;"field"===k&&null!=I&&(e=I),e!==y&&"UI"===A[e]&&"UI"===A[y]&&(e=y),e!==m&&v(e),b(e,!0)},[a]),{hasUIView:C,shouldRestoreFocus:T,layoutProps:{views:c,view:I,onViewChange:v},renderCurrentView:()=>{if(null==I)return null;let e=f[I];if(null==e)return null;let r=(0,iL.A)({},g,n,t,{views:c,timezone:p,onChange:S,view:I,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:M>1,timeViewsCount:M});return i?i(f,I,r):e(r)}}})({props:e,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:a}),h=(({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{let{orientation:i}=e,o=((e,t)=>{var n;let[r,i]=w.useState(jk);return(0,gQ.A)(()=>{let e=()=>{i(jk())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),(Array.isArray(n=["hours","minutes","seconds"])?!n.every(t=>-1!==e.indexOf(t)):-1===e.indexOf(n))&&"landscape"===(t||r)})(n.views,i),s=(0,fn.I)();return{layoutProps:(0,iL.A)({},n,t,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}})({props:e,wrapperVariant:r,propsFromPickerValue:u.layoutProps,propsFromPickerViews:c.layoutProps}),d=function(e){let{props:t,pickerValueResponse:n}=e;return w.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:c.renderCurrentView,hasUIView:c.hasUIView,shouldRestoreFocus:c.shouldRestoreFocus,layoutProps:h.layoutProps,contextValue:u.contextValue,ownerState:d}})((0,iL.A)({},r,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),f=o?.layout??jZ;return{renderPicker:()=>(0,b.jsx)(No,{localeText:i,children:(0,b.jsx)(f,(0,iL.A)({},h,s?.layout,{slots:o,slotProps:s,sx:[...Array.isArray(l)?l:[l],...Array.isArray(s?.layout?.sx)?s.layout.sx:[s?.layout?.sx]],className:(0,C.A)(a,s?.layout?.className),ref:n,children:d()}))})}})({props:(0,iL.A)({},a,{viewRenderers:c,displayStaticWrapperAs:l,ampmInClock:u,yearsPerRow:a.yearsPerRow??("mobile"===l?3:4),slotProps:(0,iL.A)({},a.slotProps,{tabs:(0,iL.A)({hidden:"desktop"===l},a.slotProps?.tabs),toolbar:(0,iL.A)({hidden:"desktop"===l,ampmInClock:u},a.slotProps?.toolbar)})}),valueManager:B9,valueType:"date-time",validator:jX,ref:t});return h()});jJ.propTypes={ampm:Na().bool,ampmInClock:Na().bool,autoFocus:Na().bool,className:Na().string,dayOfWeekFormatter:Na().func,defaultValue:Na().object,disabled:Na().bool,disableFuture:Na().bool,disableHighlightToday:Na().bool,disableIgnoringDatePartForTimeValidation:Na().bool,disablePast:Na().bool,displayStaticWrapperAs:Na().oneOf(["desktop","mobile"]),displayWeekNumber:Na().bool,fixedWeekNumber:Na().number,loading:Na().bool,localeText:Na().object,maxDate:Na().object,maxDateTime:Na().object,maxTime:Na().object,minDate:Na().object,minDateTime:Na().object,minTime:Na().object,minutesStep:Na().number,monthsPerRow:Na().oneOf([3,4]),onAccept:Na().func,onChange:Na().func,onClose:Na().func,onError:Na().func,onMonthChange:Na().func,onViewChange:Na().func,onYearChange:Na().func,openTo:Na().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:Na().oneOf(["landscape","portrait"]),readOnly:Na().bool,reduceAnimations:Na().bool,referenceDate:Na().object,renderLoading:Na().func,shouldDisableDate:Na().func,shouldDisableMonth:Na().func,shouldDisableTime:Na().func,shouldDisableYear:Na().func,showDaysOutsideCurrentMonth:Na().bool,slotProps:Na().object,slots:Na().object,sx:Na().oneOfType([Na().arrayOf(Na().oneOfType([Na().func,Na().object,Na().bool])),Na().func,Na().object]),timezone:Na().string,value:Na().object,view:Na().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:Na().shape({day:Na().func,hours:Na().func,minutes:Na().func,month:Na().func,seconds:Na().func,year:Na().func}),views:Na().arrayOf(Na().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:Na().oneOf(["asc","desc"]),yearsPerRow:Na().oneOf([3,4])};let jQ=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(""===s)throw Error("MUI X: Should not call `commitToken` with an empty token");let l=BG(e,s),u=B2(e,l.contentType,l.type,s),c=n?u:"digit"===l.contentType,h=null!=t&&e.isValid(t),d=h?e.formatByString(t,s):"",f=null;if(c)if(u)f=""===d?e.formatByString(o,s).length:d.length;else{if(null==l.maxLength)throw Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);f=l.maxLength,h&&(d=BK(BJ(BZ(d,i),f),i))}return(0,iL.A)({},l,{format:s,maxLength:f,value:d,placeholder:((e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}})(e,r,l,s),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:c,startSeparator:a,endSeparator:"",modified:!1})},j0=e=>{let t=(({utils:e,format:t})=>{let n=10,r=t,i=e.expandFormat(t);for(;i!==r;)if(r=i,i=e.expandFormat(r),(n-=1)<0)throw Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=(({utils:e,expandedFormat:t})=>{let n=[],{start:r,end:i}=e.escapedCharacters,o=RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g"),s=null;for(;s=o.exec(t);)n.push({start:s.index,end:o.lastIndex-1});return n})((0,iL.A)({},e,{expandedFormat:t})),r=(e=>{let{utils:t,expandedFormat:n,escapedParts:r}=e,i=t.date(void 0),o=[],s="",a=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),l=/^([a-zA-Z]+)/,u=RegExp(`^(${a.join("|")})*$`),c=RegExp(`^(${a.join("|")})`),h=e=>r.find(t=>t.start<=e&&t.end>=e),d=0;for(;d<n.length;){let t=h(d),r=null!=t,a=l.exec(n.slice(d))?.[1];if(!r&&null!=a&&u.test(a)){let t=a;for(;t.length>0;){let n=c.exec(t)[1];t=t.slice(n.length),o.push(jQ((0,iL.A)({},e,{now:i,token:n,startSeparator:s}))),s=""}d+=a.length}else{let e=n[d];r&&t?.start===d||t?.end===d||(0===o.length?s+=e:o[o.length-1].endSeparator+=e),d+=1}}return 0===o.length&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o})((0,iL.A)({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let r=n=>{let r=n;return e&&null!==r&&r.includes(" ")&&(r=`\u2069${r}\u2066`),"spacious"===t&&["/",".","-"].includes(r)&&(r=` ${r} `),r};return n.startSeparator=r(n.startSeparator),n.endSeparator=r(n.endSeparator),n}))((0,iL.A)({},e,{sections:r}))},j1=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:u,autoFocus:c=!1},fieldValueManager:h,applyCharacterEditing:d,resetCharacterQuery:f,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:S,areAllSectionsEmpty:C,sectionsValueBoundaries:A}=e,M=w.useRef(null),k=(0,Ff.A)(r,M),T=Nu().localeText,I=Nu().utils,D=(0,N8.A)(),[O,E]=w.useState(!1),_=w.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!M.current)return;let t=document.getSelection();if(!t)return;if(null==g){t.rangeCount>0&&M.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),O&&M.current.getRoot().blur();return}if(!M.current.getRoot().contains(jM(document)))return;let n=new window.Range;e="all"===g?M.current.getRoot():"empty"===m.sections[g].type?M.current.getSectionContainer(g):M.current.getSectionContent(g),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=jM(document);return e&&M.current&&M.current.getRoot().contains(e)?M.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!M.current||null!=_.getActiveSectionIndexFromDOM())return;let t=B6(e,m.sections);E(!0),M.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!M.current)return;let t=B6(e,m.sections);E(null!==("all"===t?0:t)),p(e)},isFieldFocused:()=>{let e=jM(document);return!!M.current&&M.current.getRoot().contains(e)}}),[g,p,m.sections,O]),R=(0,Ba.A)(e=>{if(!M.current)return;let t=m.sections[e];M.current.getSectionContent(e).innerHTML=t.value||t.placeholder,_.syncSelectionToDOM()}),P=(0,Ba.A)((e,...t)=>{!e.isDefaultPrevented()&&M.current&&(E(!0),o?.(e,...t),"all"===g?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void p(S.startIndex);let t=0,n=0;for(;n<e&&t<m.sections.length;){let e=m.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}p(t-1)}):O?M.current.getRoot().contains(e.target)||p(S.startIndex):(E(!0),p(S.startIndex)))}),L=(0,Ba.A)(e=>{if(a?.(e),!M.current||"all"!==g)return;let t=e.target.textContent??"";M.current.getRoot().innerHTML=m.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),_.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(f(),y(),p("all")):t.length>1?b(t):("all"===g&&p(0),d({keyPressed:t,sectionIndex:0}))}),N=(0,Ba.A)(e=>{if(l?.(e),n||"all"!==g)return void e.preventDefault();let t=e.clipboardData.getData("text");e.preventDefault(),f(),b(t)}),B=(0,Ba.A)((...e)=>{s?.(...e),O||!M.current||(E(!0),null==M.current.getSectionIndexFromDOMElement(jM(document))&&p(S.startIndex))}),F=(0,Ba.A)((...e)=>{i?.(...e),setTimeout(()=>{if(!M.current)return;let e=jM(document);M.current.getRoot().contains(e)||(E(!1),p(null))})}),j=(0,Ba.A)(e=>t=>{t.isDefaultPrevented()||p(e)}),z=(0,Ba.A)(e=>{e.preventDefault()}),V=(0,Ba.A)(e=>()=>{p(e)}),H=(0,Ba.A)(e=>{if(e.preventDefault(),n||t||"number"!=typeof g)return;let r=m.sections[g],i=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(i),s=/^[0-9]+$/.test(i),a=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(i);"letter"===r.contentType&&o||"digit"===r.contentType&&s||"digit-with-letter"===r.contentType&&a?(f(),x({activeSection:r,newSectionValue:i,shouldGoToNextSection:!0})):o||s||(f(),b(i))}),$=(0,Ba.A)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),W=(0,Ba.A)(e=>{if(!M.current)return;let t=e.target,r=t.textContent??"",i=M.current.getSectionIndexFromDOMElement(t),o=m.sections[i];if(n||!M.current)return void R(i);if(0===r.length){if(""===o.value)return void R(i);let t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void R(i):(f(),void v())}d({keyPressed:r,sectionIndex:i}),R(i)});(0,gQ.A)(()=>{if(O&&M.current){if("all"===g)M.current.getRoot().focus();else if("number"==typeof g){let e=M.current.getSectionContent(g);e&&e.focus()}}},[g,O]);let G=w.useMemo(()=>m.sections.reduce((e,t)=>(e[t.type]=A[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[A,m.sections]),U="all"===g,q=w.useMemo(()=>m.sections.map((e,r)=>{let i=!U&&!t&&!n;return{container:{"data-sectionindex":r,onClick:j(r)},content:{tabIndex:U||r>0?-1:0,contentEditable:!U&&!t&&!n,role:"spinbutton",id:`${D}-${e.type}`,"aria-labelledby":`${D}-${e.type}`,"aria-readonly":n,"aria-valuenow":((e,t)=>{if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{let n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);if(n)return+(t.getHours(n)>=12);return}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);let n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}})(e,I),"aria-valuemin":G[e.type].minimum,"aria-valuemax":G[e.type].maximum,"aria-valuetext":e.value?((e,t)=>{if(e.value)switch(e.type){case"month":{if("digit"===e.contentType)return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");let n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return"digit"===e.contentType?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;default:return}})(e,I):T.empty,"aria-label":T[e.type],"aria-disabled":t,spellCheck:!i&&void 0,autoCapitalize:i?"off":void 0,autoCorrect:i?"off":void 0,[parseInt(w.version,10)>=17?"enterKeyHint":"enterkeyhint"]:i?"next":void 0,children:e.value||e.placeholder,onInput:W,onPaste:H,onFocus:V(r),onDragOver:$,onMouseUp:z,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[m.sections,V,H,$,W,j,z,t,n,U,T,I,G,D]),Y=(0,Ba.A)(e=>{b(e.target.value)}),Z=w.useMemo(()=>C?"":h.getV7HiddenInputValueFromSections(m.sections),[C,m.sections,h]);return w.useEffect(()=>{if(null==M.current)throw Error("MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`\nYou probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.\n\nIf you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:\n\n<DatePicker slots={{ textField: MyCustomTextField }} />\n\nLearn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element");c&&M.current&&M.current.getSectionContent(S.startIndex).focus()},[]),{interactions:_,returnedValue:{autoFocus:c,readOnly:n,focused:u??O,sectionListRef:k,onBlur:F,onClick:P,onFocus:B,onInput:L,onPaste:N,enableAccessibleFieldDOMStructure:!0,elements:q,tabIndex:0===g?-1:0,contentEditable:U,value:Z,onChange:Y,areAllSectionsEmpty:C}}},j2=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),j5=e=>{let t=(0,fn.I)(),n=w.useRef(void 0),r=w.useRef(void 0),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:u},internalProps:{readOnly:c=!1,disabled:h=!1},parsedSelectedSections:d,activeSectionIndex:f,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:S,clearValue:C,setTempAndroidValueStr:A,setSelectedSections:M,getSectionsFromValue:k,areAllSectionsEmpty:T,localizedDigits:I}=e,D=w.useRef(null),O=(0,Ff.A)(l,D),E=w.useMemo(()=>((e,t,n)=>{let r=0,i=+!!n,o=[];for(let s=0;s<e.length;s+=1){let a=e[s],l=B0(a,n?"input-rtl":"input-ltr",t),u=`${a.startSeparator}${l}${a.endSeparator}`,c=j2(u).length,h=u.length,d=j2(l),f=i+(""===d?0:l.indexOf(d[0]))+a.startSeparator.length,p=f+d.length;o.push((0,iL.A)({},a,{start:r,end:r+c,startInInput:f,endInInput:p})),r+=c,i+=h}return o})(p.sections,I,t),[p.sections,I,t]),_=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!D.current)return;if(null==d){D.current.scrollLeft&&(D.current.scrollLeft=0);return}if(D.current!==jM(document))return;let e=D.current.scrollTop;if("all"===d)D.current.select();else{let e=E[d],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==D.current.selectionStart||n!==D.current.selectionEnd)&&D.current===jM(document)&&D.current.setSelectionRange(t,n),clearTimeout(r.current),r.current=setTimeout(()=>{D.current&&D.current===jM(document)&&D.current.selectionStart===D.current.selectionEnd&&(D.current.selectionStart!==t||D.current.selectionEnd!==n)&&_.syncSelectionToDOM()})}D.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=D.current.selectionStart??0,t=D.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=E[0].startInInput?1:E.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?E.length-1:n-1},focusField:(e=0)=>{jM(document)!==D.current&&(D.current?.focus(),M(e))},setSelectedSections:e=>M(e),isFieldFocused:()=>D.current===jM(document)}),[D,d,E,M]),R=()=>{let e,t=D.current.selectionStart??0;M(-1===(e=t<=E[0].startInInput||t>=E[E.length-1].endInInput?1:E.findIndex(e=>e.startInInput-e.startSeparator.length>t))?E.length-1:e-1)},P=(0,Ba.A)((...e)=>{i?.(...e);let t=D.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===D.current&&null==f&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?M("all"):R())})}),L=(0,Ba.A)((e,...t)=>{e.isDefaultPrevented()||(o?.(e,...t),R())}),N=(0,Ba.A)(e=>{if(s?.(e),e.preventDefault(),c||h)return;let t=e.clipboardData.getData("text");if("number"==typeof d){let e=p.sections[d],n=/^[a-zA-Z]+$/.test(t),r=/^[0-9]+$/.test(t),i=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&r||"digit-with-letter"===e.contentType&&i){y(),x({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||r)return}y(),b(t)}),B=(0,Ba.A)((...e)=>{a?.(...e),M(null)}),F=(0,Ba.A)(e=>{let n;if(c)return;let r=e.target.value;if(""===r){y(),C();return}let i=e.nativeEvent.data,o=i&&i.length>1,s=o?i:r,a=j2(s);if("all"===d&&M(f),null==f||o)return void b(o?i:a);if("all"===d&&1===a.length)n=a;else{let e=j2(g.getV6InputValueFromSections(E,I,t)),r=-1,i=-1;for(let t=0;t<e.length;t+=1)-1===r&&e[t]!==a[t]&&(r=t),-1===i&&e[e.length-t-1]!==a[a.length-t-1]&&(i=t);let o=E[f];if(r<o.start||e.length-i-1>o.end)return;let s=a.length-e.length+o.end-j2(o.endSeparator||"").length;n=a.slice(o.start+j2(o.startSeparator||"").length,s)}if(0===n.length){navigator.userAgent.toLowerCase().includes("android")&&A(s),y(),S();return}v({keyPressed:n,sectionIndex:f})}),j=w.useMemo(()=>void 0!==u?u:g.getV6InputValueFromSections(k(m.emptyValue),I,t),[u,g,k,m.emptyValue,I,t]),z=w.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,I,t),[p.sections,g,p.tempValueStrAndroid,I,t]);return w.useEffect(()=>(D.current&&D.current===jM(document)&&M("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]),{interactions:_,returnedValue:{readOnly:c,onBlur:B,onClick:L,onFocus:P,onPaste:N,inputRef:O,enableAccessibleFieldDOMStructure:!1,placeholder:j,inputMode:w.useMemo(()=>null==f||"letter"===p.sections[f].contentType?"text":"numeric",[f,p.sections]),autoComplete:"off",value:!(D.current&&D.current===jM(document))&&T?"":z,onChange:F}}},j3=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],j4=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],j6=["minDateTime","maxDateTime"];[...j3,...j4,...j6];let j8=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],j9=["clearable","onClear","InputProps","sx","slots","slotProps"],j7=["ownerState"];var ze=n(54227),zt=n(75472);function zn(e){return(0,R.Ay)("MuiPickersTextField",e)}(0,_.A)("MuiPickersTextField",["root","focused","disabled","error","required"]);var zr=n(42872);function zi(e){return(0,R.Ay)("MuiPickersInputBase",e)}let zo=(0,_.A)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function zs(e){return(0,R.Ay)("MuiPickersOutlinedInput",e)}let za=(0,iL.A)({},zo,(0,_.A)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),zl=["children","className","label","notched","shrink"],zu=(0,I.A)("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),zc=(0,I.A)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),zh=(0,I.A)("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function zd(e){let{className:t,label:n}=e,r=(0,_C.A)(e,zl),i=null!=n&&""!==n,o=(0,iL.A)({},e,{withLabel:i});return(0,b.jsx)(zu,(0,iL.A)({"aria-hidden":!0,className:t},r,{ownerState:o,children:(0,b.jsx)(zh,{ownerState:o,children:i?(0,b.jsx)(zc,{children:n}):(0,b.jsx)(zc,{className:"notranslate",children:""})})}))}var zf=n(85235);function zp(e){return(0,R.Ay)("MuiPickersSectionList",e)}let zg=(0,_.A)("MuiPickersSectionList",["root","section","sectionContent"]),zm=["slots","slotProps","elements","sectionListRef"],zv=(0,I.A)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),zy=(0,I.A)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),zx=(0,I.A)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),zb=(0,I.A)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"});function zw(e){let{slots:t,slotProps:n,element:r,classes:i}=e,o=t?.section??zy,s=(0,N9.A)({elementType:o,externalSlotProps:n?.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=t?.sectionContent??zb,l=(0,N9.A)({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),u=t?.sectionSeparator??zx,c=(0,N9.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),h=(0,N9.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return(0,b.jsxs)(o,(0,iL.A)({},s,{children:[(0,b.jsx)(u,(0,iL.A)({},c)),(0,b.jsx)(a,(0,iL.A)({},l)),(0,b.jsx)(u,(0,iL.A)({},h))]}))}let zS=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersSectionList"}),{slots:r,slotProps:i,elements:o,sectionListRef:s}=n,a=(0,_C.A)(n,zm),l=(e=>{let{classes:t}=e;return(0,A.A)({root:["root"],section:["section"],sectionContent:["sectionContent"]},zp,t)})(n),u=w.useRef(null),c=(0,Ff.A)(t,u),h=e=>{if(!u.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return u.current};w.useImperativeHandle(s,()=>({getRoot:()=>h("getRoot"),getSectionContainer:e=>h("getSectionContainer").querySelector(`.${zg.section}[data-sectionindex="${e}"]`),getSectionContent:e=>h("getSectionContent").querySelector(`.${zg.section}[data-sectionindex="${e}"] .${zg.sectionContent}`),getSectionIndexFromDOMElement(e){let t=h("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(zg.section)?n=e:e.classList.contains(zg.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let d=r?.root??zv,f=(0,N9.A)({elementType:d,externalSlotProps:i?.root,externalForwardedProps:a,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:l.root,ownerState:{}});return(0,b.jsx)(d,(0,iL.A)({},f,{children:f.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,b.jsx)(w.Fragment,{children:o.map((e,t)=>(0,b.jsx)(zw,{slots:r,slotProps:i,element:e,classes:l},t))})}))}),zC=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],zA=(0,I.A)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,iL.A)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Math.round(.15/16*1e5)/1e5}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),zM=(0,I.A)(zv,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:t,filled:n,label:r})=>!e&&!t&&!n&&null==r,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),zk=(0,I.A)(zy,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),zT=(0,I.A)(zb,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),zI=(0,I.A)(zx,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),zD=(0,I.A)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,iL.A)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),zO=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersInputBase"}),{elements:r,areAllSectionsEmpty:i,value:o,onChange:s,id:a,endAdornment:l,startAdornment:u,renderSuffix:c,slots:h,slotProps:d,contentEditable:f,tabIndex:p,onInput:g,onPaste:m,onKeyDown:v,name:y,readOnly:x,inputProps:S,inputRef:C,sectionListRef:M}=n,k=(0,_C.A)(n,zC),T=w.useRef(null),I=(0,Ff.A)(t,T),D=(0,Ff.A)(S?.ref,C),O=(0,fn.I)(),E=(0,zr.A)();if(!E)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");w.useEffect(()=>{E&&E.setAdornedStart(!!u)},[E,u]),w.useEffect(()=>{E&&(i?E.onEmpty():E.onFilled())},[E,i]);let _=(0,iL.A)({},n,E,{isRtl:O}),R=(e=>{let{focused:t,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:u,startAdornment:c}=e,h={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${(0,zf.A)(a)}`,"small"===l&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,A.A)(h,zi,i)})(_),P=h?.root||zA,L=(0,N9.A)({elementType:P,externalSlotProps:d?.root,externalForwardedProps:k,additionalProps:{"aria-invalid":E.error,ref:I},className:R.root,ownerState:_}),N=h?.input||zM;return(0,b.jsxs)(P,(0,iL.A)({},L,{children:[u,(0,b.jsx)(zS,{sectionListRef:M,elements:r,contentEditable:f,tabIndex:p,className:R.sectionsContainer,onFocus:e=>{E.disabled?e.stopPropagation():E.onFocus?.(e)},onBlur:E.onBlur,onInput:g,onPaste:m,onKeyDown:v,slots:{root:N,section:zk,sectionContent:zT,sectionSeparator:zI},slotProps:{root:{ownerState:_},sectionContent:{className:zo.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?zo.sectionBefore:zo.sectionAfter})}}),l,c?c((0,iL.A)({},E)):null,(0,b.jsx)(zD,(0,iL.A)({name:y,className:R.input,value:o,onChange:s,id:a,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:E.required,disabled:E.disabled},S,{ref:D}))]}))}),zE=["label","autoFocus","ownerState","notched"],z_=(0,I.A)(zA,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${za.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${za.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${za.focused} .${za.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${za.disabled}`]:{[`& .${za.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${za.error} .${za.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{color:t},style:{[`&.${za.focused}:not(.${za.error}) .${za.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),zR=(0,I.A)(zM,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),zP=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersOutlinedInput"}),{label:r,ownerState:i,notched:o}=n,s=(0,_C.A)(n,zE),a=(0,zr.A)(),l=(0,iL.A)({},n,i,a,{color:a?.color||"primary"}),u=(e=>{let{classes:t}=e,n=(0,A.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},zs,t);return(0,iL.A)({},t,n)})(l);return(0,b.jsx)(zO,(0,iL.A)({slots:{root:z_,input:zR},renderSuffix:e=>(0,b.jsx)(zd,{shrink:!!(o||e.adornedStart||e.focused||e.filled),notched:!!(o||e.adornedStart||e.focused||e.filled),className:u.notchedOutline,label:null!=r&&""!==r&&a?.required?(0,b.jsxs)(w.Fragment,{children:[r," ","*"]}):r,ownerState:l})},s,{label:r,classes:u,ref:t}))});zP.muiName="Input";var zL=n(57867);function zN(e){return(0,R.Ay)("MuiPickersFilledInput",e)}let zB=(0,iL.A)({},zo,(0,_.A)("MuiPickersFilledInput",["root","underline","input"])),zF=["label","autoFocus","disableUnderline","ownerState"],zj=(0,I.A)(zA,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,zL.MC)(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${zB.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${zB.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${zB.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${zB.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${zB.disabled}, .${zB.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${zB.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),zz=(0,I.A)(zM,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),zV=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersFilledInput"}),{label:r,disableUnderline:i=!1,ownerState:o}=n,s=(0,_C.A)(n,zF),a=(0,zr.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,r=(0,A.A)({root:["root",!n&&"underline"],input:["input"]},zN,t);return(0,iL.A)({},t,r)})((0,iL.A)({},n,o,a,{color:a?.color||"primary"}));return(0,b.jsx)(zO,(0,iL.A)({slots:{root:zj,input:zz},slotProps:{root:{disableUnderline:i}}},s,{label:r,classes:l,ref:t}))});function zH(e){return(0,R.Ay)("MuiPickersFilledInput",e)}zV.muiName="Input";let z$=(0,iL.A)({},zo,(0,_.A)("MuiPickersInput",["root","input"])),zW=["label","autoFocus","disableUnderline","ownerState"],zG=(0,I.A)(zA,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${z$.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${z$.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${z$.disabled}, .${z$.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${z$.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),zU=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersInput"}),{label:r,disableUnderline:i=!1,ownerState:o}=n,s=(0,_C.A)(n,zW),a=(0,zr.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,r=(0,A.A)({root:["root",!n&&"underline"],input:["input"]},zH,t);return(0,iL.A)({},t,r)})((0,iL.A)({},n,o,a,{disableUnderline:i,color:a?.color||"primary"}));return(0,b.jsx)(zO,(0,iL.A)({slots:{root:zG}},s,{label:r,classes:l,ref:t}))});zU.muiName="Input";let zq=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],zY={standard:zU,filled:zV,outlined:zP},zZ=(0,I.A)(p$.A,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),zK=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiPickersTextField"}),{onFocus:r,onBlur:i,className:o,color:s="primary",disabled:a=!1,error:l=!1,variant:u="outlined",required:c=!1,InputProps:h,inputProps:d,inputRef:f,sectionListRef:p,elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onPaste:S,onInput:M,endAdornment:k,startAdornment:T,tabIndex:I,contentEditable:D,focused:O,value:E,onChange:_,fullWidth:R,id:P,name:L,helperText:N,FormHelperTextProps:B,label:F,InputLabelProps:j}=n,z=(0,_C.A)(n,zq),V=w.useRef(null),H=(0,Ff.A)(t,V),$=(0,N8.A)(P),W=N&&$?`${$}-helper-text`:void 0,G=F&&$?`${$}-label`:void 0,U=(0,iL.A)({},n,{color:s,disabled:a,error:l,focused:O,required:c,variant:u}),q=(e=>{let{focused:t,disabled:n,classes:r,required:i}=e;return(0,A.A)({root:["root",t&&!n&&"focused",n&&"disabled",i&&"required"]},zn,r)})(U),Y=zY[u];return(0,b.jsxs)(zZ,(0,iL.A)({className:(0,C.A)(q.root,o),ref:H,focused:O,onFocus:r,onBlur:i,disabled:a,variant:u,error:l,color:s,fullWidth:R,required:c,ownerState:U},z,{children:[(0,b.jsx)(ze.A,(0,iL.A)({htmlFor:$,id:G},j,{children:F})),(0,b.jsx)(Y,(0,iL.A)({elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onInput:M,onPaste:S,endAdornment:k,startAdornment:T,tabIndex:I,contentEditable:D,value:E,onChange:_,id:$,fullWidth:R,inputProps:d,inputRef:f,sectionListRef:p,label:F,name:L,role:"group","aria-labelledby":G,"aria-describedby":W,"aria-live":W?"polite":void 0},h)),N&&(0,b.jsx)(zt.A,(0,iL.A)({id:W},B,{children:N}))]}))}),zX=["enableAccessibleFieldDOMStructure"],zJ=["InputProps","readOnly"],zQ=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],z0=["slots","slotProps","InputProps","inputProps"],z1=w.forwardRef(function(e,t){let n=Nn({props:e,name:"MuiDateTimeField"}),{slots:r,slotProps:i,InputProps:o,inputProps:s}=n,a=(0,_C.A)(n,z0),l=r?.textField??(e.enableAccessibleFieldDOMStructure?zK:W.A),u=(0,N9.A)({elementType:l,externalSlotProps:i?.textField,externalForwardedProps:a,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,iL.A)({},s,u.inputProps),u.InputProps=(0,iL.A)({},o,u.InputProps);let c=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,_C.A)(e,zX);if(t){let{InputProps:e,readOnly:t}=n,r=(0,_C.A)(n,zJ);return(0,iL.A)({},r,{InputProps:(0,iL.A)({},e??{},{readOnly:t})})}let{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:u}=n,c=(0,_C.A)(n,zQ);return(0,iL.A)({},c,{InputProps:(0,iL.A)({},a??{},{readOnly:s}),inputProps:(0,iL.A)({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:u})})})((e=>{let t,n,r,i,o,{forwardedProps:s,internalProps:a}=(t=Nu().utils,n=Nu().defaultDates,r=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h,i=(0,iL.A)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??r,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:Nf(t,e.minDateTime??e.minDate,n.minDate),maxDate:Nf(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime}),o="date-time",w.useMemo(()=>{let e=(0,iL.A)({},i),t={},n=n=>{e.hasOwnProperty(n)&&(t[n]=e[n],delete e[n])};return j8.forEach(n),j3.forEach(n),j4.forEach(n),j6.forEach(n),{forwardedProps:e,internalProps:t}},[i,o]));return(e=>{let t=Nu().utils,{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:u,clearable:c,onClear:h},fieldValueManager:d,valueManager:f,validator:p}=e,g=(0,fn.I)(),m=(e=>{let t=Nu().utils,n=Nu().localeText,r=Nu(),i=(0,fn.I)(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:u,internalProps:{value:c,defaultValue:h,referenceDate:d,onChange:f,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=e,{timezone:S,value:C,handleValueChange:A}=BV({timezone:x,value:c,defaultValue:h,referenceDate:d,onChange:f,valueManager:o}),M=w.useMemo(()=>{let e;return e=t.date(void 0),"0"===t.formatByString(t.setSeconds(e,0),"s")?BY:Array.from({length:10}).map((n,r)=>t.formatByString(t.setSeconds(e,r),"s"))},[t]),k=w.useMemo(()=>((e,t,n)=>{let r=e.date(void 0,n),i=e.endOfYear(r),o=e.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=Np(e,r).reduce((t,n)=>{let r=e.getDaysInMonth(n);return r>t.maxDaysInMonth?{maxDaysInMonth:r,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:4===e.formatByString(e.date(void 0,"system"),t).length?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(i)+1}),day:({currentDate:t})=>({minimum:1,maximum:null!=t&&e.isValid(t)?e.getDaysInMonth(t):s,longestMonth:a}),weekDay:({format:t,contentType:n})=>{if("digit"===n){let n=BU(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{let i=e.getHours(o);return BZ(e.formatByString(e.endOfDay(r),n),t)!==i.toString()?{minimum:1,maximum:Number(BZ(e.formatByString(e.startOfDay(r),n),t))}:{minimum:0,maximum:i}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}})(t,M,S),[t,M,S]),T=w.useCallback((e,r=null)=>s.getSectionsFromValue(t,e,r,e=>j0({utils:t,localeText:n,localizedDigits:M,format:p,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i})),[s,p,n,M,i,y,t,g,b]),[I,D]=w.useState(()=>{let e=T(C);B5(e,a);let n={sections:e,value:C,referenceValue:o.emptyValue,tempValueStrAndroid:null},r=Math.max(...e.map(e=>B$[e.type]??1)),i=o.getInitialReferenceValue({referenceDate:d,value:C,utils:t,props:u,granularity:r,timezone:S});return(0,iL.A)({},n,{referenceValue:i})}),[O,E]=(0,Bl.A)({controlled:m,default:null,name:"useField",state:"selectedSections"}),_=e=>{E(e),v?.(e)},R=w.useMemo(()=>B6(O,I.sections),[O,I.sections]),P="all"===R?0:R,L=({value:e,referenceValue:n,sections:i})=>{if(D(t=>(0,iL.A)({},t,{sections:i,value:e,referenceValue:n,tempValueStrAndroid:null})),o.areValuesEqual(t,I.value,e))return;let s={validationError:l({adapter:r,value:e,timezone:S,props:u})};A(e,s)},N=(e,t)=>{let n=[...I.sections];return n[e]=(0,iL.A)({},n[e],{value:t,modified:!0}),n};return w.useEffect(()=>{let e=T(I.value);B5(e,a),D(t=>(0,iL.A)({},t,{sections:e}))},[p,t.locale,i]),w.useEffect(()=>{o.areValuesEqual(t,I.value,C)&&o.getTimezone(t,I.value)===o.getTimezone(t,C)||D(e=>(0,iL.A)({},e,{value:C,referenceValue:s.updateReferenceValue(t,C,e.referenceValue),sections:T(C)}))},[C]),{state:I,activeSectionIndex:P,parsedSelectedSections:R,setSelectedSections:_,clearValue:()=>{L({value:o.emptyValue,referenceValue:I.referenceValue,sections:T(o.emptyValue)})},clearActiveSection:()=>{if(null==P)return;let e=I.sections[P],n=s.getActiveDateManager(t,I,e),r=n.getSections(I.sections).filter(e=>""!==e.value).length===+(""!==e.value),i=N(P,""),o=r?null:t.getInvalidDate(),a=n.getNewValuesFromNewActiveDate(o);L((0,iL.A)({},a,{sections:i}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:r})=>{let i,o;r&&P<I.sections.length-1&&_(P+1);let a=s.getActiveDateManager(t,I,e),l=N(P,n),u=a.getSections(l),c=((e,t,n)=>{let r=t.some(e=>"day"===e.type),i=[],o=[];for(let e=0;e<t.length;e+=1){let s=t[e];r&&"weekDay"===s.type||(i.push(s.format),o.push(B0(s,"non-input",n)))}let s=i.join(" "),a=o.join(" ");return e.parse(a,s)})(t,u,M);if(null!=c&&t.isValid(c)){let e=B4(t,c,u,a.referenceDate,!0);i=a.getNewValuesFromNewActiveDate(e),o=!0}else i=a.getNewValuesFromNewActiveDate(c),o=(null!=c&&!t.isValid(c))!=(null!=a.date&&!t.isValid(a.date));return o?L((0,iL.A)({},i,{sections:l})):D(e=>(0,iL.A)({},e,i,{sections:l,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let r=s.parseValueStr(e,I.referenceValue,(e,r)=>{let o=t.parse(e,p);if(null==o||!t.isValid(o))return null;let s=j0({utils:t,localeText:n,localizedDigits:M,format:p,date:o,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i});return B4(t,o,s,r,!1)}),o=s.updateReferenceValue(t,r,I.referenceValue);L({value:r,referenceValue:o,sections:T(r,I.sections)})},setTempAndroidValueStr:e=>D(t=>(0,iL.A)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:T,sectionsValueBoundaries:k,localizedDigits:M,timezone:S}})(e),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:S,clearActiveSection:C,updateSectionValue:A,setTempAndroidValueStr:M,sectionsValueBoundaries:k,localizedDigits:T,timezone:I}=m,D=(({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{let s=Nu().utils,[a,l]=w.useState(null),u=(0,Ba.A)(()=>l(null));w.useEffect(()=>{null!=a&&e[a.sectionIndex]?.type!==a.sectionType&&u()},[e,a,u]),w.useEffect(()=>{if(null!=a){let e=setTimeout(()=>u(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[a,u]);let c=({keyPressed:t,sectionIndex:n},r,i)=>{let o=t.toLowerCase(),s=e[n];if(null!=a&&(!i||i(a.value))&&a.sectionIndex===n){let e=`${a.value}${o}`,t=r(e,s);if(null==t.saveQuery)return l({sectionIndex:n,value:e,sectionType:s.type}),t}let c=r(o,s);return null==c.saveQuery||c.saveQuery?(l({sectionIndex:n,value:o,sectionType:s.type}),null!=c.saveQuery?null:c):(u(),null)};return{applyCharacterEditing:(0,Ba.A)(a=>{var l;let u,h,d,f=e[a.sectionIndex],p=BX(a.keyPressed,r)?(l=(0,iL.A)({},a,{keyPressed:BK(a.keyPressed,r)}),u=(e,t)=>{let i=BZ(e,r),o=Number(i),a=n[t.type]({currentDate:null,format:t.format,contentType:t.contentType});if(o>a.maximum)return{saveQuery:!1};if(o<a.minimum)return{saveQuery:!0};let l=10*o>a.maximum||i.length===a.maximum.toString().length;return{sectionValue:BQ(s,o,a,r,t),shouldGoToNextSection:l}},c(l,(e,t)=>{if("digit"===t.contentType||"digit-with-letter"===t.contentType)return u(e,t);if("month"===t.type){let n=B2(s,"digit","month","MM"),r=u(e,{type:t.type,format:"MM",hasLeadingZerosInFormat:n,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(null!=r.saveQuery)return r;let i=B1(s,r.sectionValue,"MM",t.format);return(0,iL.A)({},r,{sectionValue:i})}if("weekDay"===t.type){let n=u(e,t);if(null!=n.saveQuery)return n;let r=BU(s,t.format)[Number(n.sectionValue)-1];return(0,iL.A)({},n,{sectionValue:r})}return{saveQuery:!1}},e=>BX(e,r))):(h=(e,t,n)=>{let r=t.filter(e=>e.toLowerCase().startsWith(n));return 0===r.length?{saveQuery:!1}:{sectionValue:r[0],shouldGoToNextSection:1===r.length}},d=(e,t,n,r)=>{let i=e=>Bq(s,o,t.type,e);if("letter"===t.contentType)return h(t.format,i(t.format),e);if(n&&null!=r&&"letter"===BG(s,n).contentType){let t=i(n),o=h(n,t,e);return null!=o.saveQuery?{saveQuery:!1}:(0,iL.A)({},o,{sectionValue:r(o.sectionValue,t)})}return{saveQuery:!1}},c(a,(e,t)=>{switch(t.type){case"month":return d(e,t,s.formats.month,e=>B1(s,e,s.formats.month,t.format));case"weekDay":return d(e,t,s.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return d(e,t);default:return{saveQuery:!1}}}));null==p?i(null):t({activeSection:f,newSectionValue:p.sectionValue,shouldGoToNextSection:p.shouldGoToNextSection})}),resetCharacterQuery:u}})({sections:v.sections,updateSectionValue:A,sectionsValueBoundaries:k,localizedDigits:T,setTempAndroidValueStr:M,timezone:I}),{resetCharacterQuery:O}=D,E=f.areValuesEqual(t,v.value,f.emptyValue),_=o?j1:j5,R=w.useMemo(()=>((e,t)=>{let n={};if(!t)return e.forEach((t,r)=>{let i=r===e.length-1?null:r+1;n[r]={leftIndex:0===r?null:r-1,rightIndex:i}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let r={},i={},o=0,s=0,a=e.length-1;for(;a>=0;){-1===(s=e.findIndex((e,t)=>t>=o&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator))&&(s=e.length-1);for(let e=s;e>=o;e-=1)i[e]=a,r[a]=e,a-=1;o=s+1}return e.forEach((t,o)=>{let s=i[o],a=0===s?null:r[s-1],l=s===e.length-1?null:r[s+1];n[o]={leftIndex:a,rightIndex:l}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}})(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:P,interactions:L}=_((0,iL.A)({},e,m,D,{areAllSectionsEmpty:E,sectionOrder:R})),N=(0,Ba.A)(e=>{if(l?.(e),!s)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),b("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==x)b(R.startIndex);else if("all"===x)b(R.endIndex);else{let e=R.neighbors[x].rightIndex;null!==e&&b(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)b(R.endIndex);else if("all"===x)b(R.startIndex);else{let e=R.neighbors[x].leftIndex;null!==e&&b(e)}break;case"Delete"===e.key:if(e.preventDefault(),a)break;null==x||"all"===x?S():C(),O();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),a||null==y)break;"all"===x&&b(y);let n=v.sections[y],r=d.getActiveDateManager(t,v,n),o=((e,t,n,r,i,o,s,a)=>{let l=(e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return -1;case"PageUp":return 5;case"PageDown":return -5;default:return 0}})(r),u="Home"===r,c="End"===r,h=""===n.value||u||c;if("digit"===n.contentType||"digit-with-letter"===n.contentType){let r,d=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),f="minutes"===n.type&&a?.minutesStep?a.minutesStep:1;if(h){if("year"===n.type&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);r=l>0||u?d.minimum:d.maximum}else r=parseInt(BZ(n.value,o),10)+l*f;return(r%f!=0&&((l<0||u)&&(r+=f-(f+r)%f),(l>0||c)&&(r-=r%f)),r>d.maximum)?BQ(e,d.minimum+(r-d.maximum-1)%(d.maximum-d.minimum+1),d,o,n):r<d.minimum?BQ(e,d.maximum-(d.minimum-r-1)%(d.maximum-d.minimum+1),d,o,n):BQ(e,r,d,o,n)}let d=Bq(e,t,n.type,n.format);if(0===d.length)return n.value;if(h)return l>0||u?d[0]:d[d.length-1];let f=((d.indexOf(n.value)+l)%d.length+d.length)%d.length;return d[f]})(t,I,n,e.key,k,T,r.date,{minutesStep:i});A({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,gQ.A)(()=>{L.syncSelectionToDOM()});let{hasValidationError:B}=jC({props:n,validator:p,timezone:I,value:v.value,onError:n.onError}),F=w.useMemo(()=>void 0!==u?u:B,[B,u]);w.useEffect(()=>{F||null!=y||O()},[v.referenceValue,y,F]),w.useEffect(()=>{null!=v.tempValueStrAndroid&&null!=y&&(O(),C())},[v.sections]),w.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:L.getActiveSectionIndexFromDOM,setSelectedSections:L.setSelectedSections,focusField:L.focusField,isFieldFocused:L.isFieldFocused}));let j={onKeyDown:N,onClear:(0,Ba.A)((e,...t)=>{e.preventDefault(),h?.(e,...t),S(),L.isFieldFocused()?b(R.startIndex):L.focusField(0)}),error:F,clearable:!!(c&&!E&&!a&&!s)};return(0,iL.A)({},e.forwardedProps,j,{disabled:s,readOnly:a},P)})({forwardedProps:s,internalProps:a,valueManager:B9,fieldValueManager:B7,validator:jX,valueType:"date-time"})})(u)),h=(e=>{let t=Nu().localeText,{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=e,l=(0,_C.A)(e,j9),u=s?.clearButton??$.A,c=(0,N9.A)({elementType:u,externalSlotProps:a?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),h=(0,_C.A)(c,j7),d=s?.clearIcon??NT,f=(0,N9.A)({elementType:d,externalSlotProps:a?.clearIcon,ownerState:{}});return(0,iL.A)({},l,{InputProps:(0,iL.A)({},i,{endAdornment:(0,b.jsxs)(w.Fragment,{children:[n&&(0,b.jsx)(f5.A,{position:"end",sx:{marginRight:i?.endAdornment?-1:-1.5},children:(0,b.jsx)(u,(0,iL.A)({},h,{onClick:r,children:(0,b.jsx)(d,(0,iL.A)({fontSize:"small"},f))}))}),i?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})})((0,iL.A)({},c,{slots:r,slotProps:i}));return(0,b.jsx)(l,(0,iL.A)({},h))});var z2=n(65130),z5=n(43628),z3=n(47196),z4=n(54266),z6=n(54708),z8=n(38086),z9=n(16299),z7=n(85910),Ve=n(44766),Vt=n(65043),Vn=n(72710),Vr=n(96962),Vi=n(47918),Vo=n(54354),Vs=n(8151),Va=n(91733),Vl=n(99042),Vu=n(89321),Vc=n(51148),Vh=n(55578),Vd=n(18463),Vf=n(54752),Vp=n(36163),Vg=n(28850),Vm=n(45350),Vv=n(67619),Vy=n(39270),Vx=n(56756),Vb=n(268),Vw=n(12282),VS=n(41042),VC=n(38267),VA=n(47025),VM=n(30118),Vk=n(84253),VT=n(98608),VI=n(8643),VD=n(18109),VO=n(19681),VE=n(73206),V_=n(53819),VR=n(96058),VP=n(682),VL=n(67671);let VN={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},VB={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class VF{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=VN,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=e=>void 0===e?new Date:null===e?null:new Date(e),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=e=>e,this.toJsDate=e=>e,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=e=>e.match(/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,this.longFormatters[t])(e,this.locale.formatLong):e}).join(""),this.formatNumber=e=>e,this.getDayOfWeek=e=>e.getDay()+1;const{locale:t,formats:n,longFormatters:r,lib:i}=e;this.locale=t,this.formats=(0,iL.A)({},VB,n),this.longFormatters=r,this.lib=i||"date-fns"}}class Vj extends VF{constructor({locale:e,formats:t}={}){super({locale:e??VL.c,formats:t,longFormatters:Vn.m}),this.parse=(e,t)=>""===e?null:(0,Vw.qg)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,Vb.f)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,Vr.GP)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,Vg.n)(e,t),this.isSameYear=(e,t)=>(0,Vv.s)(e,t),this.isSameMonth=(e,t)=>(0,Vy.t)(e,t),this.isSameDay=(e,t)=>(0,Vm.r)(e,t),this.isSameHour=(e,t)=>(0,Vx.l)(e,t),this.isAfter=(e,t)=>(0,Vf.d)(e,t),this.isAfterYear=(e,t)=>(0,Vf.d)(e,(0,Vt.Q)(t)),this.isAfterDay=(e,t)=>(0,Vf.d)(e,(0,z7.D)(t)),this.isBefore=(e,t)=>(0,Vp.Y)(e,t),this.isBeforeYear=(e,t)=>(0,Vp.Y)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,Vp.Y)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,VP.v)(e,{start:t,end:n}),this.startOfYear=e=>(0,VR.D)(e),this.startOfMonth=e=>(0,VO.w)(e),this.startOfWeek=e=>(0,V_.k)(e,{locale:this.locale}),this.startOfDay=e=>(0,VD.o)(e),this.endOfYear=e=>(0,Vt.Q)(e),this.endOfMonth=e=>(0,VE.p)(e),this.endOfWeek=e=>(0,Ve.$)(e,{locale:this.locale}),this.endOfDay=e=>(0,z7.D)(e),this.addYears=(e,t)=>(0,z9.e)(e,t),this.addMonths=(e,t)=>(0,z8.P)(e,t),this.addWeeks=(e,t)=>(0,z6.J)(e,t),this.addDays=(e,t)=>(0,z2.f)(e,t),this.addHours=(e,t)=>(0,z4.L)(e,t),this.addMinutes=(e,t)=>(0,z3.z)(e,t),this.addSeconds=(e,t)=>(0,z5.p)(e,t),this.getYear=e=>(0,Vd.C)(e),this.getMonth=e=>(0,Vl.t)(e),this.getDate=e=>(0,Vi.p)(e),this.getHours=e=>(0,Vs.q)(e),this.getMinutes=e=>(0,Va.O)(e),this.getSeconds=e=>(0,Vu.S)(e),this.getMilliseconds=e=>(0,Vc.D)(e),this.setYear=(e,t)=>(0,VI.i)(e,t),this.setMonth=(e,t)=>(0,VM.Z)(e,t),this.setDate=(e,t)=>(0,VS.X)(e,t),this.setHours=(e,t)=>(0,VC.a)(e,t),this.setMinutes=(e,t)=>(0,VA.g)(e,t),this.setSeconds=(e,t)=>(0,Vk.g)(e,t),this.setMilliseconds=(e,t)=>(0,VT.$)(e,t),this.getDaysInMonth=e=>(0,Vo.P)(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),r=0,i=t,o=[];for(;this.isBefore(i,n);){let e=Math.floor(r/7);o[e]=o[e]||[],o[e].push(i),i=this.addDays(i,1),r+=1}return o},this.getWeekNumber=e=>(0,Vh.N)(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),r=this.endOfYear(t),i=[],o=n;for(;this.isBefore(o,r);)i.push(o),o=this.addYears(o,1);return i}}}let Vz="yyyy-MM-dd HH:mm:ss";function VV(e,t){let n,r;return e?(0,tQ.bB)(e)?e.pastDuration:(n=ig(e.start,Vz,t),r=ig(e.end,Vz,t),`${n} - ${r}`):"Custom Time Range"}let VH=({initialTimeRange:e,onChange:t,onCancel:n,timeZone:r})=>{let i=["local","browser"].includes(r.toLowerCase())?Intl.DateTimeFormat().resolvedOptions().timeZone:r,[o,s]=(0,w.useState)(e),[a,l]=(0,w.useState)(!0),u=(e,t)=>{s(n=>({...n,[t]:e}))},c=e=>{u(e,"start")},h=e=>{u(e,"end")},d=()=>{var e,t;let n={start:o.start,end:o.end};if(e=n.start,t=n.end,(0,t0.isValid)(e)&&(0,t0.isValid)(t)?!!(0,t0.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return n};return(0,b.jsx)(No,{dateAdapter:Vj,children:(0,b.jsxs)(H.A,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[a&&(0,b.jsxs)(lE.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,b.jsx)(fO.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,b.jsx)(jJ,{timezone:i,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new id(o.start,i),onChange:e=>{null!==e&&c(e)},onAccept:()=>{l(!1)}})]}),!a&&(0,b.jsxs)(lE.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,b.jsx)(fO.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,b.jsx)(jJ,{timezone:i,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new id(o.end,i),minDateTime:new id(o.start,i),onChange:e=>{null!==e&&h(e)},onAccept:e=>{null!==e&&(l(!0),h(e))}})]}),(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,b.jsx)(Cl.ErrorBoundary,{FallbackComponent:Ca,children:(0,b.jsx)(z1,{"data-testid":"start_time_input",timezone:i,label:"Start Time",value:new id(o.start,i),onChange:e=>{e&&c(e)},onBlur:()=>d(),format:Vz})}),(0,b.jsx)(Cl.ErrorBoundary,{FallbackComponent:Ca,children:(0,b.jsx)(z1,{"data-testid":"end_time_input",timezone:i,label:"End Time",value:new id(o.end,i),onChange:e=>{e&&h(e)},onBlur:()=>d(),format:Vz})})]}),(0,b.jsxs)(H.A,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,b.jsx)(z.A,{variant:"contained",onClick:()=>{let e;(e=d())&&t(e)},fullWidth:!0,children:"Apply"}),(0,b.jsx)(z.A,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function V$({value:e,timeOptions:t,onChange:n,height:r,showCustomTimeRange:i=!0,timeZone:o,timeZoneOptions:s,onTimeZoneChange:a}){let l,{timeZone:u}=lT(),c=o??u,h=(0,w.useRef)(),[d,f]=(0,w.useState)(!1),p=(0,w.useMemo)(()=>(0,tQ.bB)(e)?(0,tQ.b5)(e):e,[e]),g=(0,w.useMemo)(()=>{var t;return{value:t=(0,tQ.bB)(e)?void 0:e,display:VV(t,c)}},[e,c]),[m,v]=(0,w.useState)(!1),y=s??t2(),[x,S]=(0,w.useState)(null),C=y.find(e=>e.value===c)?.display??c,A=im(c),M=im("local"),k=y.map(e=>({id:e.value,label:e.display}));{let e=y.find(e=>e.value===c);e&&(l={id:e.value,label:e.display})}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eA.Ay,{anchorEl:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:!!x,onClose:()=>S(null),sx:e=>({padding:e.spacing(1)}),children:(0,b.jsx)(lE.A,{sx:{p:1,minWidth:260},onClick:e=>{e.stopPropagation()},children:(0,b.jsx)(p0,{options:k,value:l,onChange:(e,t)=>{if(t){let e=y.find(e=>e.value===t.id);e&&a?.(e)}S(null)},disableClearable:!0,renderInput:e=>(0,b.jsx)(W.A,{...e,placeholder:"Search timezones",size:"small"})})})}),(0,b.jsx)(eA.Ay,{anchorEl:h.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>f(!1),sx:e=>({padding:e.spacing(2)}),children:(0,b.jsx)(VH,{initialTimeRange:p,onChange:e=>{n(e),f(!1),v(!1)},onCancel:()=>f(!1),timeZone:c})}),(0,b.jsx)(lE.A,{ref:h,children:(0,b.jsxs)(d8.A,{open:m,value:VV(e,c),onClick:()=>v(!m),IconComponent:L9,renderValue:()=>(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,b.jsx)("span",{children:t.find(t=>VV(t.value,c)===VV(e,c))?.display??VV(e,c)}),A!==M&&(0,b.jsxs)(lE.A,{sx:{typography:"caption",color:"text.secondary"},children:["\xb7 ",A]})]}),inputProps:{"aria-label":`Select time range. Currently set to ${e}`},sx:{".MuiSelect-icon":{marginTop:"1px",transform:"none"},".MuiSelect-select.MuiSelect-outlined.MuiInputBase-input":{paddingRight:"36px"},".MuiSelect-select":r?{lineHeight:r,paddingY:0}:{}},children:[(0,b.jsx)(d6.A,{disableRipple:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{cursor:"default","&:hover":{backgroundColor:"transparent"},py:.5,px:1},children:(0,b.jsxs)(lE.A,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,b.jsxs)(lE.A,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,b.jsx)(lE.A,{sx:{typography:"subtitle1"},children:"Time Range"}),(0,b.jsxs)(lE.A,{sx:{color:"text.secondary",typography:"caption",mt:.25},children:["Timezone: ",C]})]}),(0,b.jsx)(lE.A,{sx:{display:"flex",alignItems:"center",pr:1,ml:1.5},children:(0,b.jsx)($.A,{size:"small","aria-label":"Select timezone",onClick:e=>{e.preventDefault(),e.stopPropagation(),S(e.currentTarget)},children:(0,b.jsx)(L7,{fontSize:"small"})})})]})}),t.map((e,t)=>(0,b.jsx)(d6.A,{value:VV(e.value,c),onClick:()=>{n(e.value)},children:e.display},t)),i&&(0,b.jsx)(d6.A,{value:VV(g.value,c),onClick:()=>f(!0),children:g.display})]})})]})}function VW({value:e,onChange:t,timeZoneOptions:n,variant:r="standard",heightPx:i,...o}){let s,a=(0,w.useMemo)(()=>n??t2(),[n]);i&&(s="number"==typeof i?`${i}px`:i);let l=(0,w.useMemo)(()=>({minWidth:"compact"===r?"80px":"150px",...s&&{lineHeight:s,paddingY:0},...o.sx}),[r,s,o.sx]);return(0,b.jsx)(d8.A,{...o,value:e,onChange:(e,n)=>{var r;let i;r=e.target.value,(i=a.find(e=>e.value===r))&&t&&t(i)},sx:l,size:"compact"===r?"small":"medium",children:a.map(e=>(0,b.jsx)(d6.A,{value:e.value,children:e.display},e.value))})}function VG(e){let{markerColor:t,sx:n}=e;return(0,b.jsx)(lE.A,{sx:rV({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function VU(e){let{formattedY:t,markerColor:n,metricName:r,metricLabels:i}=e;return(0,b.jsxs)(H.A,{spacing:.5,children:[(0,b.jsxs)(lE.A,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,b.jsx)(VG,{markerColor:n,sx:{marginTop:.25}}),(0,b.jsxs)(lE.A,{component:"span",children:[r,(0,b.jsx)(lE.A,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,b.jsx)(f0.A,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,b.jsx)(lE.A,{sx:e=>({color:e.palette.common.white}),children:i.map(e=>{if(e){let[t,n]=e.split("="),r=void 0!==n?`${t}: `:t,i=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,b.jsxs)(lE.A,{sx:{display:"flex",gap:"4px"},children:[(0,b.jsx)(fO.A,{sx:{fontSize:"11px"},children:r}),(0,b.jsx)(fO.A,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:i})]},e)}})})]})}let Vq=375,VY=650,VZ=650,VK=500,VX=.75,VJ=8,VQ=750,V0="nearby series showing in tooltip",V1="emphasized series showing as bold in tooltip",V2="#2E313E",V5=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),V3={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},V4=[],V6=()=>{let[e,t]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=e=>t({page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.zrX??e.offsetX,y:e.zrY??e.offsetY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),e},V8={wrapLabels:!0,enablePinning:!0},V9="Click chart to pin",V7="Click chart to unpin";function He(e){let{seriesName:t,formattedY:n,markerColor:r,totalSeries:i,emphasizeText:o=!1,wrapLabels:s=!0}=e,a=t.split("{"),l=(a[1]??t).replace(/[{}]/g,"").split(",");if(1===i&&l.length>1){let e=a[0]?`${a[0]}:`:"value:";return(0,b.jsx)(VU,{formattedY:n,metricName:e,metricLabels:l,markerColor:r})}let u=t.replace(/[,]/g,", ");return(0,b.jsxs)(lE.A,{sx:{display:"table-row",paddingTop:.5},children:[(0,b.jsxs)(lE.A,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,b.jsx)(VG,{markerColor:r,sx:{marginTop:.5}}),(0,b.jsx)(lE.A,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:VK,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:s?"normal":"nowrap"}),"aria-label":o?V1:V0,children:u})]}),(0,b.jsx)(lE.A,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}var Ht=n(36961);function Hn(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0}function Hr(e,t,n,r,i){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=n>0?n:VZ,s=r>0?r:VY,a=e.page.x+32,l=e.page.y+16;if(i){let e=i.getBoundingClientRect();a=a-e.left+i.scrollLeft,l=l-e.top+i.scrollTop;let t=e.top+i.scrollHeight;l+o>t&&(l=Math.max(t-o-16,VJ/2))}else l+o>window.innerHeight+window.scrollY&&(l=Math.max(window.innerHeight+window.scrollY-o-16,VJ/2));return a+s>window.innerWidth&&(a=e.page.x-s-32),a<32&&(a=32),l<VJ/2&&(l=VJ/2),`translate3d(${a}px, ${l}px, 0)`}function Hi(e,t,n){return{minWidth:Vq,maxWidth:VY,maxHeight:(n?n-VJ:void 0)??VZ,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??V2,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"opacity 0.1s ease-out, visibility 0.1s ease-out",zIndex:null!==t?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}}function Ho(e,t){try{let n=t.convertToPixel("grid",[e,0]);return n?.[0]??null}catch{return null}}function Hs(e,t,n,r){let i=n[e];if(!i)return t;let o=i.stack;if(!o)return t;let s=o.toString(),a=(r.get(s)??0)+t;return r.set(s,a),a}function Ha(e,t,n){let r,i,o=t.indexOf(e);if(-1===o)return 20;let s=o>0?t[o-1]??null:null,a=o<t.length-1?t[o+1]??null:null,l=Ho(e,n);if(null===l)return 20;if(null!==s&&null!==a){let e=Ho(s,n)??l,t=Ho(a,n)??l;r=(l+e)/2,i=(l+t)/2}else if(null!==s){let e=Ho(s,n)??l;r=(l+e)/2,i=l+(l-r)}else{if(null===a)return 20;let e=Ho(a,n)??l;i=(l+e)/2,r=l-(i-l)}return Math.max(1,i-r)}function Hl(e,t,n,r){let i=t/Math.max(1,r),o=n-t/2+e*i;return{left:o,right:o+i}}function Hu(e,t,n){try{let r=n.convertToPixel("grid",[0,e]),i=n.convertToPixel("grid",[0,t]);if(!r||!i||void 0===r[1]||void 0===i[1])return null;return{top:Math.min(i[1],r[1]),bottom:Math.max(i[1],r[1])}}catch{return null}}let Hc=5.5,Hh=30,Hd=5;function Hf(e,t,n,r,i,o,s,a,l){let u=n[0]??null,c=n[1]??null;if(null===u||null===c||void 0===i.dispatchAction||!Array.isArray(e))return V4;let h=rj(e[0]?.values,u);if(null===h)return V4;let d=null;if(void 0!==a){let e=i.convertToPixel("grid",[0,c]),t=i.convertToPixel("grid",[0,c+r]);e&&t&&void 0!==e[1]&&void 0!==t[1]&&(d=Math.abs(t[1]-e[1]))}let f=l??Ho(h,i),p=function(e,t,n,r,i,o,s,a,l){let u=[],c=e.length,h=new Map,d=[],f=e[0]?.values;if(f&&f.length>0){let e=new Set;for(let[t]of f)e.has(t)||(e.add(t),d.push(t));d=d.sort((e,t)=>e-t)}let p=[];for(let e=0;e<c;e++)(t[e]?.type??"line")==="bar"&&p.push(e);let g=null,m=null;p.length>0&&null!==i&&(g=Ha(n,d,l),m=Ho(n,l));for(let d=0;d<c;d++){let c,f=t[d];if(!f)continue;let v=e[d];if(!v)continue;let y=v.values;if(!y||!Array.isArray(y))continue;let x=f.type??"line",b=f.name?f.name.toString():"",w=f.id?f.id.toString():"",S=(f.color??"#000").toString(),C=-1,A=0;for(let e=0;e<y.length;e++){let t=y[e];if(t&&t[0]===n){C=e,A=t[0],c=t[1];break}}if(-1===C||null==c)continue;let M=!1,k=c,T=1/0;if("line"===x)if(k=Hs(d,c,t,h),void 0!==o&&null!==a)try{let e=l.convertToPixel({seriesIndex:d},[C,k]);if(e&&void 0!==e[1]){let t=Math.abs(o-e[1]);M=t<=a,T=t}else{let e=Math.abs(k-r);M=e<=s,T=e}}catch{let e=Math.abs(k-r);M=e<=s,T=e}else{let e=Math.abs(k-r);M=e<=s,T=e}else if("bar"===x){if(null===i||null===g||null===m)continue;let e=p.indexOf(d);if(-1===e)continue;let n=Hl(e,g,m,p.length);if(!(i>=n.left&&i<=n.right))continue;let o=f.stack,s=!0;if(o){let e=o.toString(),n=Hu(h.get(e)??0,k=Hs(d,c,t,h),l);if(n){let e=l.convertToPixel("grid",[0,r]);e&&void 0!==e[1]&&(s=e[1]>=n.top&&e[1]<=n.bottom)}}else k=c;if(!s)continue;T=Math.abs(i-(n.left+n.right)/2),M=!0}M&&u.push({seriesIdx:d,datumIdx:C,seriesId:w,seriesName:b,date:n,markerColor:S,x:A,y:c,visualY:k,distance:T})}return u}(e,t,h,c,f,a,r,d,i),g=function(e){if(0===e.length)return null;let t=null;for(let n of e)(null===t||n.distance<t.distance)&&(t=n);return t}(p),m=new Set;for(let e of p)m.add(e.seriesIdx);let v=[];for(let t=0;t<e.length;t++)m.has(t)||v.push(t);return function(e,t,n,r,i,o){let s=[],a=[],l=[...o],u=[],c=[],h=new Map,d=[];for(let i of e){let e=r?.get(i.seriesId)??n,o=i.y,f=rp(o,e),p=null!==t&&i.seriesIdx===t.seriesIdx;if(p){a.push(i.seriesIdx);let e=h.get(o)??0;h.set(o,e+1),e>0&&c.push({seriesIndex:i.seriesIdx,dataIndex:i.datumIdx,seriesName:i.seriesName,yValue:o}),u.push({seriesIndex:i.seriesIdx,dataIndex:i.datumIdx,seriesName:i.seriesName,yValue:o})}else l.push(i.seriesIdx);d.push({seriesIdx:i.seriesIdx,datumIdx:i.datumIdx,seriesName:i.seriesName,date:i.date,x:i.x,y:o,formattedY:f,markerColor:i.markerColor,isClosestToCursor:p}),s.push(i.seriesIdx)}return rB(i,s,a,l,u,c),d}(p,g,o,s,i,v)}function Hp(e,t,n,r,i){let o=[],s=t[0]??null,a=t[1]??null;if(null===s||null===a)return o;let l=[],u=[],c=[],h=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<h;t++){let d=e.timeSeries[t];if(void 0===d||o.length>=1e3)break;let f=d.name?d.name.toString():"",p=d.color??"#000";if(Array.isArray(d.data))for(let g=0;g<d.data.length;g++){let m=e.xAxis[g]??0,v=d.data[g];if(null!=v&&s===g&&"-"!==v&&a<=v+n&&a>=v-n){let e=Hm({valueToCheck:a,baseValue:v,percentage:Math.max(h>Hd?2:5,100/h)});e?u.push(t):(c.push(t),r?.dispatchAction!==void 0&&r.dispatchAction({type:"downplay",seriesIndex:t}));let n=m>0x174876e7ff?m:1e3*m,s=rp(v,i);o.push({seriesIdx:t,datumIdx:g,seriesName:f,date:n,x:m,y:v,formattedY:s,markerColor:p.toString(),isClosestToCursor:e}),l.push(t)}}}return r?.dispatchAction!==void 0&&(r.dispatchAction({type:"downplay",seriesIndex:c}),u.length>0?r.dispatchAction({type:"highlight",seriesIndex:u,notBlur:!1,escapeConnect:!0}):r.dispatchAction({type:"highlight",seriesIndex:l,notBlur:!0,escapeConnect:!0})),o}function Hg({mousePos:e,pinnedPos:t,data:n,seriesMapping:r,chart:i,format:o,seriesFormatMap:s,showAllSeries:a=!1}){if(void 0===i||null===e)return V4;let l=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&i.getDom()===e&&(l=!0)}}if(null!==t&&(e=t,l=!0),!1===l||null===n||void 0===i._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return V4;let u=e.plotCanvas.y,c=e.plotCanvas.x,h=rN(c,u,i);if(null!==h){let e=i._model.getComponent("yAxis").axis.scale,t="log"===e.type,l=e._interval;if(t&&e.base){let t=e.base,n=e._extent,r=t**n[0];l=(t**n[1]-r)/100}let d=Hv({yInterval:l,totalSeries:n.length,showAllSeries:a}),f=r.some(e=>void 0!==e.yAxisIndex&&e.yAxisIndex>0);return Hf(n,r,h,d,i,o,s,f?u:void 0,c)}return V4}function Hm({valueToCheck:e,baseValue:t,percentage:n}){let r=n/100*t;return e>=t-r&&e<=t+r}function Hv({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let r=.3*e;return t>Hd?Math.max(r,e*Hh/t):Math.max(r,e*Hc)}function Hy(e){let{series:t,wrapLabels:n}=e,r=(0,w.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===r?null:(0,b.jsx)(lE.A,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:r.map(({datumIdx:e,seriesIdx:t,seriesName:i,y:o,formattedY:s,markerColor:a,isClosestToCursor:l})=>{if(null===e||null===t)return null;let u=t.toString()+e.toString();return(0,b.jsx)(He,{seriesName:i,y:o,formattedY:s,markerColor:a,totalSeries:r.length,wrapLabels:n,emphasizeText:l},u)})})}var Hx=n(68003),Hb=n(4491),Hw=n(29917);let HS=(0,w.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:r,enablePinning:i=!0,onShowAllClick:o,onUnpinClick:s}){let a,l,u,{formatWithUserTimeZone:c}=lT(),h=e[0]?.date??null;if(null===h)return null;let d=i&&t>5;return(0,b.jsxs)(lE.A,{sx:e=>({width:"100%",maxWidth:VY,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??V2,position:"sticky",top:0,left:0}),children:[(0,b.jsxs)(lE.A,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(l=c(a=new Date(h),"MMM dd, yyyy - "),u=c(a,"HH:mm:ss"),(0,b.jsxs)(lE.A,{children:[(0,b.jsx)(fO.A,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:l}),(0,b.jsx)(fO.A,{variant:"caption",children:(0,b.jsx)("strong",{children:u})})]})),(0,b.jsxs)(H.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,b.jsxs)(H.A,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,b.jsx)(fO.A,{sx:{fontSize:11},children:"Show All"}),(0,b.jsx)(Hx.A,{checked:r,size:"small",onChange:(e,t)=>{if(void 0!==o)return o(t)},sx:e=>({"& .MuiSwitch-switchBase":{color:e.palette.common.white},"& .MuiSwitch-track":{backgroundColor:e.palette.common.white}})})]}),i&&(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",children:[(0,b.jsx)(fO.A,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?V7:V9}),n?(0,b.jsx)(Hb,{onClick:()=>{void 0!==s&&s()},sx:{fontSize:16,cursor:"pointer"}}):(0,b.jsx)(Hw,{sx:{fontSize:16}})]})]})]}),(0,b.jsx)(f0.A,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),HC=(0,w.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:r,enablePinning:i=!0,wrapLabels:o,format:s,seriesFormatMap:a,onUnpinClick:l,pinnedPos:u}){var c,h,d,f,p,g,m,v,y,x,S,C,A,M,k,T,I;let[D,O]=(0,w.useState)(!1),E=(0,w.useRef)(),_=(0,w.useRef)(null),R=V6(),{height:P,width:L,ref:N}=(void 0===c&&(c={}),h=c.onResize,(d=(0,w.useRef)(void 0)).current=h,f=c.round||Math.round,p=(0,w.useRef)(),m=(g=(0,w.useState)({width:void 0,height:void 0}))[0],v=g[1],y=(0,w.useRef)(!1),(0,w.useEffect)(function(){return y.current=!1,function(){y.current=!0}},[]),x=(0,w.useRef)({width:void 0,height:void 0}),S=(0,w.useCallback)(function(e){return p.current&&p.current.box===c.box&&p.current.round===f||(p.current={box:c.box,round:f,instance:new ResizeObserver(function(e){var t=e[0],n="border-box"===c.box?"borderBoxSize":"device-pixel-content-box"===c.box?"devicePixelContentBoxSize":"contentBoxSize",r=Hn(t,n,"inlineSize"),i=Hn(t,n,"blockSize"),o=r?f(r):void 0,s=i?f(i):void 0;if(x.current.width!==o||x.current.height!==s){var a={width:o,height:s};x.current.width=o,x.current.height=s,d.current?d.current(a):y.current||v(a)}})}),p.current.instance.observe(e,{box:c.box}),function(){p.current&&p.current.instance.unobserve(e)}},[c.box,f]),C=c.ref,A=(0,w.useRef)(null),(M=(0,w.useRef)(null)).current=C,k=(0,w.useRef)(null),(0,w.useEffect)(function(){T()}),T=(0,w.useCallback)(function(){var e=k.current,t=M.current,n=e||(t?t instanceof Element?t:t.current:null);A.current&&A.current.element===n&&A.current.subscriber===S||(A.current&&A.current.cleanup&&A.current.cleanup(),A.current={element:n,subscriber:S,cleanup:n?S(n):void 0})},[S]),(0,w.useEffect)(function(){return function(){A.current&&A.current.cleanup&&(A.current.cleanup(),A.current=null)}},[]),I=(0,w.useCallback)(function(e){k.current=e,T()},[T]),(0,w.useMemo)(function(){return{ref:I,width:m.width,height:m.height}},[I,m.width,m.height])),B=null!==u&&i,F=(0,w.useCallback)(e=>{_.current=e,N(e)},[N]),j=e?document.querySelector(e):void 0;if((0,w.useLayoutEffect)(()=>{if(null===R)return;let e=_.current;if(!e)return;let t=e.getBoundingClientRect();if(0===t.height||0===t.width)return;let n=Hr(R,u,t.height,t.width,j);n&&n!==E.current&&(E.current=n,e.style.transform=n)}),null===R||null===R.target||null===n||null===u&&"CANVAS"!==R.target.tagName)return null;let z=t.current,V=j?j.getBoundingClientRect().height:void 0;E.current=Hr(R,u,P??0,L??0,j);let $=Hg({mousePos:R,data:n,seriesMapping:r,pinnedPos:u,chart:z,format:s,seriesFormatMap:a,showAllSeries:D});if(0===$.length)return null;let W=n.length;return(0,b.jsx)(Ht.A,{container:j,children:(0,b.jsx)(lE.A,{ref:F,sx:e=>Hi(e,u,V),style:{transform:E.current},children:(0,b.jsxs)(H.A,{spacing:.5,children:[(0,b.jsx)(HS,{nearbySeries:$,totalSeries:W,enablePinning:i,isTooltipPinned:B,showAllSeries:D,onShowAllClick:e=>O(e),onUnpinClick:l}),(0,b.jsx)(Hy,{series:$,wrapLabels:o})]})})})}),HA=(0,I.A)(z.A)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),HM=(0,w.forwardRef)(function(e,t){return(0,b.jsx)(HA,{ref:t,variant:"outlined",color:"secondary",...e})}),Hk=Object.entries(rf).map(([e,t])=>({...t,id:e,group:t.group||"Decimal"})).filter(e=>!e.disableSelectorOption);function HT({value:e,onChange:t,disabled:n=!1,...r}){let i=rf[e?.unit||"decimal"];return(0,b.jsx)(p0,{value:{id:e?.unit||"decimal",...i},options:Hk,groupBy:e=>e.group??"Decimal",onChange:(e,n)=>{null===n?t(void 0):t({unit:n.id})},disabled:n,disableClearable:!0,renderInput:({InputProps:e,...r})=>(0,b.jsx)(W.A,{...r,slotProps:{input:{...e,endAdornment:(0,b.jsxs)(b.Fragment,{children:[e.endAdornment,(0,b.jsx)(f5.A,{position:"end",children:(0,b.jsx)($.A,{size:"small","aria-label":"clear unit",onClick:()=>t(void 0),disabled:n,tabIndex:-1,children:(0,b.jsx)(ph,{fontSize:"small"})})})]})}}}),...r})}let HI=[{id:"default",label:"Default",decimalPlaces:void 0},{id:"0",label:"0",decimalPlaces:0},{id:"1",label:"1",decimalPlaces:1},{id:"2",label:"2",decimalPlaces:2},{id:"3",label:"3",decimalPlaces:3},{id:"4",label:"4",decimalPlaces:4}];function HD({value:e,onChange:t,disabled:n=!1}){var r;let i=rC(e),o=rA(e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(pZ,{label:"Short values",control:(0,b.jsx)(Hx.A,{checked:!!o&&nl(e.shortValues),onChange:(n,r)=>{o&&t({...e,shortValues:r})},disabled:!o})}),(0,b.jsx)(pZ,{label:"Unit",control:(0,b.jsx)(HT,{value:e,onChange:e=>{t(e||{unit:"decimal"})},disabled:n})}),(0,b.jsx)(pZ,{label:"Decimals",control:(0,b.jsx)(p0,{value:(r=e.decimalPlaces,HI.find(e=>e.decimalPlaces===r)),options:HI,getOptionLabel:e=>e.label,onChange:(n,r)=>(({decimalPlaces:n})=>{i&&t({...e,decimalPlaces:n})})(r),disabled:!i,disableClearable:!0})})]})}function HO({name:e,height:t}){return(0,b.jsx)(lE.A,{style:{maxWidth:t,top:`calc(${t}px / 2)`},sx:{display:"inline-block",position:"absolute",transform:"translateX(-50%) rotate(-90deg)",transformOrigin:"top",textAlign:"center",zIndex:1},children:(0,b.jsx)(fO.A,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var HE=n(74626);let H_=iI((0,HE.A)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),HR={chartsTheme:H_,enablePinning:!1,enableSyncGrouping:!0,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var HP=n(52855);let HL={defaultProps:{variant:"standard",severity:"success"},styleOverrides:{standardError:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.error.dark,color:e.palette.error.light,[`& .${HP.A.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${HP.A.icon}`]:{color:e.palette.error.main}},standardInfo:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.info.dark,color:e.palette.info.light,[`& .${HP.A.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${HP.A.icon}`]:{color:e.palette.info.main}},standardSuccess:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.success.dark,color:e.palette.success.light,[`& .${HP.A.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${HP.A.icon}`]:{color:e.palette.success.main}},standardWarning:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.warning.dark,color:e.palette.warning.light,[`& .${HP.A.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${HP.A.icon}`]:{color:e.palette.warning.main}},root:{["& ."+f_.root]:{textDecoration:"underline"}}}},HN={styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},HB={50:"#E7F1FC",100:"#D0E3FA",150:"#B8D5F7",200:"#A1C7F5",300:"#72ABF0",400:"#438FEB",500:"#1473E6",600:"#105CB8",700:"#0C458A",800:"#082E5C",850:"#062345",900:"#04172E",950:"#020C17"},HF="#FFFFFF",Hj={50:"#F0F1F6",100:"#E1E3ED",150:"#D2D5E4",200:"#C3C7DB",300:"#A4ACC8",400:"#8690B6",500:"#717CA4",600:"#535D83",700:"#3E4662",800:"#2A2E42",850:"#1F2331",900:"#151721",950:"#0A0C10"},Hz={50:"#EAF9F1",100:"#D5F2E3",150:"#C1ECD4",200:"#ACE5C6",300:"#82D9AA",400:"#59CC8D",500:"#2FBF71",600:"#26995A",700:"#1C7344",800:"#134C2D",850:"#0E3922",900:"#092617",950:"#05130B"},HV={50:"#FFF5E8",100:"#FFECD2",150:"#FFE2BB",200:"#FFD9A4",300:"#FFC577",400:"#FFB249",500:"#FF9F1C",600:"#CC7F16",700:"#995F11",800:"#66400B",850:"#4D3008",900:"#332006",950:"#1A1003"},HH={50:"#EFE9FD",100:"#E0D2FC",150:"#D0BCFA",200:"#C1A6F8",300:"#A179F5",400:"#824DF1",500:"#6320EE",600:"#4F1ABE",700:"#3B138F",800:"#280D5F",850:"#1E0A47",900:"#140630",950:"#0A0318"},H$={50:"#FDEDED",100:"#FBDADA",150:"#F9C8C8",200:"#F7B5B5",300:"#F29191",400:"#EE6C6C",500:"#EA4747",600:"#BD3939",700:"#902B2B",800:"#621D1D",850:"#4C1616",900:"#350F0F",950:"#1F0808"},HW=e=>"light"===e?{main:HB["500"],dark:HB["600"],light:HB["50"]}:{main:HB["400"],dark:HB["800"],light:HB["200"]},HG={fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,h1:{fontSize:"1.5rem",fontWeight:600,lineHeight:"32px"},h2:{fontSize:"1.25rem",fontWeight:600,lineHeight:"28px"},h3:{fontSize:"1rem",fontWeight:600,lineHeight:"24px"},h4:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px"},h5:void 0,h6:void 0,body1:{fontSize:"0.875rem",fontWeight:400,lineHeight:"20px"},body2:{fontSize:"0.75rem",fontWeight:400,lineHeight:"18px"},subtitle1:{fontSize:"1rem",fontWeight:400,lineHeight:"24px",letterSpacing:"0.02rem"},subtitle2:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px",letterSpacing:"0.03rem",textTransform:"uppercase"},button:{fontSize:"0.875rem",fontWeight:600,lineHeight:"1.25rem",textTransform:"none",letterSpacing:"0.03rem"},caption:{fontSize:"0.6875rem",fontWeight:400,lineHeight:"16px"}},HU=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function Hq(e,t={},n=!1){var r,i;let o;return(0,HE.A)({palette:function(e){let t,n,r,i;return{mode:e,primary:HW(e),secondary:"light"===e?{main:Hj["600"],dark:Hj["900"],light:Hj["100"]}:{main:HF,dark:HF,light:HF},grey:"light"===e?{50:Hj["50"],100:Hj["100"],200:Hj["200"],300:Hj["300"],400:Hj["400"],500:Hj["500"],600:Hj["600"],700:Hj["700"],800:Hj["800"],900:Hj["900"],950:Hj["950"]}:{50:Hj["950"],100:Hj["900"],200:Hj["800"],300:Hj["700"],400:Hj["600"],500:Hj["500"],600:Hj["400"],700:Hj["300"],800:Hj["200"],900:Hj["100"],950:Hj["50"]},background:(t=HB["150"],n="rgba(21, 23, 33, 0.75)","light"===e?{navigation:t,overlay:n,default:HF,paper:Hj["50"],code:Hj["50"],tooltip:Hj["100"],lighter:Hj["50"],border:Hj["100"]}:{navigation:t,overlay:n,default:Hj["900"],paper:Hj["850"],code:Hj["800"],tooltip:Hj["600"],lighter:Hj["700"],border:Hj["600"]}),text:(r=Hj["800"],i=Hj["300"],"light"===e?{navigation:r,accent:i,primary:Hj["800"],secondary:Hj["700"],disabled:Hj["300"],link:HB["500"],linkHover:HB["600"]}:{navigation:r,accent:i,primary:HF,secondary:Hj["50"],disabled:Hj["600"],link:HB["400"],linkHover:HB["500"]}),error:"light"===e?{main:H$["500"],dark:H$["600"],light:H$["50"]}:{main:H$["400"],dark:H$["800"],light:H$["300"]},warning:"light"===e?{main:HV["500"],dark:HV["700"],light:HV["50"]}:{main:HV["400"],dark:HV["800"],light:HV["300"]},info:HW(e),success:"light"===e?{main:Hz["500"],dark:Hz["700"],light:Hz["50"]}:{main:Hz["400"],dark:Hz["800"],light:Hz["300"]},common:{white:HF,black:"#000000"},designSystem:{blue:HB,green:Hz,grey:Hj,orange:HV,purple:HH,red:H$}}}(e),typography:HG,mixins:{},components:(r=e,i=n,o={MuiAlert:HL,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:HN,MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:HU}},MuiDialog:{styleOverrides:{paper:HU}},MuiPopover:{styleOverrides:{paper:HU}}},i?o:{MuiCssBaseline:{styleOverrides:{body:{colorScheme:r}}},...o}),...t})}var HY=n(87275),HZ=n(11061),HK=n(78536),HX=n(1355);function HJ({value:e,onChange:t}){return(0,b.jsxs)(H.A,{direction:"row",children:[(0,b.jsx)(pJ.A,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,b.jsx)(W.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,b.jsx)(LN.A,{label:"Enabled",labelPlacement:"start",control:(0,b.jsx)(Hx.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function HQ({value:e,onChange:t}){return(0,b.jsxs)(H.A,{direction:"row",gap:1,alignItems:"center",children:[(0,b.jsx)(pJ.A,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,b.jsx)(W.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,r)=>{t({...e,spec:{...e.spec,columns:r}})}}),(0,b.jsx)(pv,{id:"merge-columns-name",variant:"outlined",label:"Output Name",value:e.spec.name??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,name:n}})},required:!0}),(0,b.jsx)(LN.A,{label:"Enabled",labelPlacement:"start",control:(0,b.jsx)(Hx.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function H0({value:e,onChange:t}){return(0,b.jsxs)(H.A,{direction:"row",children:[(0,b.jsx)(pv,{id:"merge-indexed-columns",variant:"outlined",label:"Column",placeholder:"Example: 'value' for merging 'value #1', 'value #2' and 'value #...'",value:e.spec.column??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,column:n}})},required:!0}),(0,b.jsx)(LN.A,{label:"Enabled",labelPlacement:"start",control:(0,b.jsx)(Hx.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function H1({value:e,onChange:t}){return(0,b.jsx)(H.A,{direction:"row",children:(0,b.jsx)(LN.A,{label:"Enabled",labelPlacement:"start",control:(0,b.jsx)(Hx.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function H2({value:e,onChange:t,...n}){return(0,b.jsxs)(H.A,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,b.jsxs)(pv,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,b.jsx)(d6.A,{value:"JoinByColumnValue",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Join by column value"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,b.jsx)(d6.A,{value:"MergeColumns",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Merge columns"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,b.jsx)(d6.A,{value:"MergeIndexedColumns",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Merge indexed columns"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,b.jsx)(d6.A,{value:"MergeSeries",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Merge series"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,b.jsx)(HJ,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,b.jsx)(HQ,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,b.jsx)(H0,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,b.jsx)(H1,{value:e,onChange:t})]})}function H5({index:e,value:t,isCollapsed:n,onChange:r,onCollapse:i,onDelete:o,...s}){return(0,b.jsxs)(H.A,{...s,children:[(0,b.jsxs)(H.A,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,b.jsxs)(H.A,{direction:"row",gap:1,children:[(0,b.jsx)($.A,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>i(!n),children:n?(0,b.jsx)(HZ,{}):(0,b.jsx)(HY,{})}),(0,b.jsx)(fO.A,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,b.jsx)("span",{children:(0,b.jsx)("strong",{children:rD[t.kind]})}):(0,b.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,b.jsxs)(H.A,{direction:"row",gap:1,children:[n&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(pu,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,b.jsx)($.A,{size:"small",sx:{marginLeft:"auto"},onClick:function(){r({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,b.jsx)(HK,{}):(0,b.jsx)(HX,{})})}),(0,b.jsx)(f0.A,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,b.jsx)(pu,{title:"Remove transformation",placement:"top",children:(0,b.jsx)($.A,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,b.jsx)(L3,{})})})]})]}),!n&&(0,b.jsx)(H2,{value:t,onChange:r})]})}function H3({value:e,onChange:t,...n}){let[r,i]=(0,w.useState)(e.map(()=>!0));return(0,b.jsxs)(H.A,{gap:1,...n,children:[e.map((n,o)=>(0,b.jsx)(H5,{index:o,value:n,isCollapsed:r[o]??!0,onChange:n=>{let r;(r=[...e])[o]=n,t(r)},onDelete:()=>{let n;(n=[...e]).splice(o,1),t(n),i(e=>(e.splice(o,1),[...e]))},onCollapse:e=>{i(t=>(t[o]=e,[...t]))}},o)),(0,b.jsx)(z.A,{variant:"contained",startIcon:(0,b.jsx)(L5,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),i(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function H4(e){let{value:t,onChange:n,timeOptions:r,height:i}=e,o=(0,w.useMemo)(()=>{if(t&&!r.some(e=>e.value.pastDuration===t))return(0,b.jsx)(d6.A,{value:t,children:t})},[r,t]);return(0,b.jsx)(p$.A,{children:(0,b.jsx)(lE.A,{children:(0,b.jsxs)(d8.A,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[r.map((e,t)=>(0,b.jsx)(d6.A,{value:e.value.pastDuration,children:e.display},t)),o]})})})}function H6({repeatItems:e,maxPer:t,gap:n,renderItem:r,containerSx:i,rowSx:o}){let{rows:s,perRow:a}=(0,w.useMemo)(()=>{let n=Math.max(1,t),r=[];for(let t=0;t<e.length;t+=n)r.push(e.slice(t,t+n));return{rows:r,perRow:n}},[t,e]);return(0,b.jsx)(lE.A,{sx:[{display:"flex",flexDirection:"column",width:"100%",height:"100%",gap:`${n}px`},...Array.isArray(i)?i:[i]],children:s.map((e,t)=>(0,b.jsx)(lE.A,{sx:[{display:"flex",gap:`${n}px`},...Array.isArray(o)?o:[o]],children:e.map((e,i)=>(0,b.jsx)(lE.A,{sx:{width:`calc((100% - ${n*(a-1)}px) / ${a})`,overflow:"hidden"},children:r(e,{rowIndex:t,colIndex:i})},`${t}-${i}`))},t))})}var H8=n(54381);let H9=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,b.jsx)(H.A,{gap:1,direction:"row",...n,children:(0,b.jsx)(W.A,{label:"Value",placeholder:"Exact value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{...e.spec,value:n.target.value}}),fullWidth:!0})});case"Range":return(0,b.jsxs)(H.A,{gap:1,direction:"row",...n,children:[(0,b.jsx)(W.A,{label:"From",placeholder:"Start of range",value:e.spec?.from??"",onChange:n=>t({...e,spec:{...e.spec,from:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0}),(0,b.jsx)(W.A,{label:"To",placeholder:"End of range (inclusive)",value:e.spec?.to??"",onChange:n=>t({...e,spec:{...e.spec,to:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0})]});case"Regex":return(0,b.jsx)(H.A,{gap:1,direction:"row",...n,children:(0,b.jsx)(W.A,{label:"Regular Expression",placeholder:"JavaScript regular expression",value:e.spec?.pattern??"",onChange:n=>t({...e,spec:{...e.spec,pattern:n.target.value}}),fullWidth:!0})});case"Misc":return(0,b.jsx)(H.A,{gap:1,direction:"row",...n,children:(0,b.jsxs)(W.A,{select:!0,label:"Value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{value:n.target.value}}),SelectProps:{renderValue:e=>{switch(e){case"empty":return"Empty";case"null":return"Null";case"NaN":return"NaN";case"true":return"True";case"false":return"False";default:return String(e)}}},fullWidth:!0,children:[(0,b.jsx)(d6.A,{value:"empty",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Empty"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Matches empty string"})]})}),(0,b.jsx)(d6.A,{value:"null",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Null"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Matches null or undefined"})]})}),(0,b.jsx)(d6.A,{value:"NaN",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"NaN"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,b.jsx)(d6.A,{value:"true",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"True"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Matches true boolean"})]})}),(0,b.jsx)(d6.A,{value:"false",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"False"}),(0,b.jsx)(fO.A,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},H7=({mapping:e,onChange:t,onDelete:n,...r})=>{let i=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,b.jsxs)(H8.A,{container:!0,spacing:2,...r,children:[(0,b.jsx)(H8.A,{size:{xs:5},children:(0,b.jsxs)(H.A,{direction:"row",gap:1,width:"100%",children:[(0,b.jsxs)(W.A,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,b.jsx)(d6.A,{value:"Value",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Value"}),"Value"!==e.kind&&(0,b.jsx)(fO.A,{variant:"caption",children:"Matches an exact text value"})]})}),(0,b.jsx)(d6.A,{value:"Range",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Range"}),"Range"!==e.kind&&(0,b.jsx)(fO.A,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,b.jsx)(d6.A,{value:"Regex",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Regex"}),"Regex"!==e.kind&&(0,b.jsx)(fO.A,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,b.jsx)(d6.A,{value:"Misc",children:(0,b.jsxs)(H.A,{children:[(0,b.jsx)(fO.A,{children:"Misc"}),"Misc"!==e.kind&&(0,b.jsx)(fO.A,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,b.jsx)(H9,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,b.jsx)(H8.A,{size:{xs:4},children:(0,b.jsx)(W.A,{label:"Display text",value:e.spec?.result?.value??"",onChange:n=>t({...e,spec:{...e.spec,result:{...e.spec?.result,value:n.target.value}}}),fullWidth:!0})}),(0,b.jsx)(H8.A,{size:{xs:1},children:(0,b.jsx)(H.A,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,b.jsx)(lI,{label:"Color",color:e.spec.result.color??"#000",onColorChange:i,onClear:()=>i(void 0)}):(0,b.jsx)($.A,{onClick:()=>i("#000"),children:(0,b.jsx)(L5,{})})})}),(0,b.jsx)(H8.A,{size:{xs:1},textAlign:"end",children:(0,b.jsx)(pu,{title:"Remove mapping settings",placement:"top",children:(0,b.jsx)($.A,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,b.jsx)(L3,{})})})})]})},$e=({mappings:e,onChange:t})=>{let[n,r]=(0,w.useState)(e);return(0,b.jsxs)(H.A,{spacing:1,children:[(0,b.jsxs)(H8.A,{container:!0,spacing:2,children:[(0,b.jsx)(H8.A,{size:{xs:5},children:(0,b.jsx)(fO.A,{variant:"subtitle1",children:"Condition"})}),(0,b.jsx)(H8.A,{size:{xs:4},children:(0,b.jsx)(fO.A,{variant:"subtitle1",children:"Display Text"})}),(0,b.jsx)(H8.A,{size:{xs:1},textAlign:"center",children:(0,b.jsx)(fO.A,{variant:"subtitle1",children:"Color"})}),(0,b.jsx)(H8.A,{size:{xs:1}})]}),(0,b.jsx)(H.A,{gap:1.5,divider:(0,b.jsx)(f0.A,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,i)=>(0,b.jsx)(H7,{mapping:e,onChange:e=>{let o;(o=[...n])[i]=e,r(o),t(o)},onDelete:()=>{let e;(e=[...n]).splice(i,1),r(e),t(e)}},i))}),(0,b.jsx)(z.A,{variant:"contained",startIcon:(0,b.jsx)(L5,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),r(e),t(e)},children:"Add value mappings"})]})}}}]);
|