@perses-dev/table-plugin 0.6.1 → 0.7.0
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/{6487.ac0b3bec.js → 6487.b74a51ce.js} +1 -1
- package/__mf/js/{Table.dcb50d79.js → Table.ae720bb0.js} +3 -3
- package/__mf/js/async/3090.f748dadb.js +2 -0
- package/__mf/js/async/{3224.673940ed.js → 3224.fbb884ab.js} +1 -1
- package/__mf/js/async/3598.193e9962.js +1 -0
- package/__mf/js/async/3980.9246eb0c.js +2 -0
- package/__mf/js/async/{6333.35401612.js.LICENSE.txt → 3980.9246eb0c.js.LICENSE.txt} +2 -2
- package/__mf/js/async/{4075.16e3dc8a.js → 4075.4fb81a28.js} +1 -1
- package/__mf/js/async/{5377.05ab91aa.js → 5377.0695a823.js} +1 -1
- package/__mf/js/async/5503.6fa43555.js +1 -0
- package/__mf/js/async/5901.2aaa62a6.js +2 -0
- package/__mf/js/async/7179.516df6f8.js +73 -0
- package/__mf/js/async/8970.e4194572.js +7 -0
- package/__mf/js/async/__federation_expose_Table.12e32a6d.js +1 -0
- package/__mf/js/main.8865f4ed.js +1 -0
- package/mf-manifest.json +64 -96
- package/mf-stats.json +64 -96
- package/package.json +5 -5
- package/__mf/css/async/2569.cbbd94a8.css +0 -1
- package/__mf/css/async/8433.cbbd94a8.css +0 -1
- package/__mf/js/async/133.46388a8d.js +0 -1
- package/__mf/js/async/2292.42e8992b.js +0 -2
- package/__mf/js/async/232.ab228ab3.js +0 -1
- package/__mf/js/async/2641.78a9e888.js +0 -1
- package/__mf/js/async/3079.9e782657.js +0 -23
- package/__mf/js/async/4062.0dd7dc24.js +0 -1
- package/__mf/js/async/52.77f8a241.js +0 -2
- package/__mf/js/async/5409.33ed27cd.js +0 -1
- package/__mf/js/async/5767.f16855a4.js +0 -1
- package/__mf/js/async/5998.ac755fc8.js +0 -73
- package/__mf/js/async/6277.853e296a.js +0 -23
- package/__mf/js/async/6333.35401612.js +0 -2
- package/__mf/js/async/654.0d5da894.js +0 -1
- package/__mf/js/async/6913.1b3a7693.js +0 -1
- package/__mf/js/async/7606.4ba8e3ec.js +0 -1
- package/__mf/js/async/894.0035563b.js +0 -1
- package/__mf/js/async/8981.3989d84b.js +0 -1
- package/__mf/js/async/9057.2b54c435.js +0 -1
- package/__mf/js/async/922.d9680010.js +0 -7
- package/__mf/js/async/__federation_expose_Table.07bc26cc.js +0 -1
- package/__mf/js/main.62569baf.js +0 -1
- /package/__mf/js/async/{2292.42e8992b.js.LICENSE.txt → 3090.f748dadb.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{52.77f8a241.js.LICENSE.txt → 5901.2aaa62a6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5998.ac755fc8.js.LICENSE.txt → 7179.516df6f8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{922.d9680010.js.LICENSE.txt → 8970.e4194572.js.LICENSE.txt} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 922.d9680010.js.LICENSE.txt */
|
|
2
|
-
(self.webpackChunkTable=self.webpackChunkTable||[]).push([["922"],{74183:function(e,t,n){"use strict";n.d(t,{A:()=>u,X:()=>a});var i=n(88500);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var s={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)}},l=Symbol("closestEdge");function a(e,t){var n,r,a=t.element,u=t.input,c=t.allowedEdges,h={x:u.clientX,y:u.clientY},d=a.getBoundingClientRect(),f=null!==(n=null===(r=c.map(function(e){return{edge:e,value:s[e](d,h)}}).sort(function(e,t){return e.value-t.value})[0])||void 0===r?void 0:r.edge)&&void 0!==n?n:null;return o(o({},e),{},(0,i.Z)({},l,f))}function u(e){var t;return null!==(t=e[l])&&void 0!==t?t:null}},39020:function(e,t,n){"use strict";n.d(t,{h:()=>r});var i=n(10228);function r(e){var t=e.list,n=e.startIndex;return function(e){var t=e.list,n=e.startIndex,r=e.finishIndex;if(-1===n||-1===r)return Array.from(t);var o=Array.from(t),s=o.splice(n,1),l=(0,i.Z)(s,1)[0];return o.splice(r,0,l),o}({list:t,startIndex:n,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,i=e.indexOfTarget,r=e.axis;if(-1===t||-1===i||t===i)return t;if(null==n)return i;var o="vertical"===r&&"bottom"===n||"horizontal"===r&&"right"===n;return t<i?o?i:i-1:o?i+1:i}({closestEdgeOfTarget:e.closestEdgeOfTarget,startIndex:n,indexOfTarget:e.indexOfTarget,axis:e.axis})})}},62422:function(e,t,n){"use strict";n.d(t,{$:()=>i.$});var i=n(65331)},55255:function(e,t,n){"use strict";n.d(t,{wO:()=>U,En:()=>Y,sd:()=>K});var i,r,o,s,l,a,u=n(10228),c=n(70501),h="data-pdnd-honey-pot";function d(e){return e instanceof Element&&e.hasAttribute(h)}function f(e){var t=document.elementsFromPoint(e.x,e.y),n=(0,u.Z)(t,2),i=n[0],r=n[1];return i?d(i)?null!=r?r:null:i:null}var p=n(88500);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,p.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e){var t,n,i,r,o={x:Math.min((r={x:Math.max((i={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(i.y,0)}).x,window.innerWidth-2),y:Math.min(r.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function b(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")}}var y=n(15629),w=n(28451);function x(e){return function(e){if(Array.isArray(e))return(0,y.Z)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,w.Z)(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.")}()}function S(e){var t=null;return function(){if(!t){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];t={result:e.apply(this,i)}}return t.result}}var k=S(function(){return navigator.userAgent.includes("Firefox")}),C=S(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),M={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function T(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}}!function(){if("undefined"!=typeof window){if(C()){var e=t();(0,c.bindAll)(window,[{type:"dragstart",listener:function(){e.enterCount=0,e.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function(t){e.isOverWindow||0!==e.enterCount||(t[M.isEnteringWindow]=!0),e.isOverWindow=!0,e.enterCount++}},{type:"dragleave",listener:function(t){e.enterCount--,e.isOverWindow&&0===e.enterCount&&(t[M.isLeavingWindow]=!0,e.isOverWindow=!1)}}],{capture:!0})}}function t(){return{enterCount:0,isOverWindow:!1}}function n(){e=t()}}();var D=(i=function(e){return e()},r=[],o=null,(s=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];r=t,!o&&(o=requestAnimationFrame(function(){o=null,i.apply(void 0,r)}))}).cancel=function(){o&&(cancelAnimationFrame(o),o=null)},s),P=(l=null,{schedule:function(e){l={frameId:requestAnimationFrame(function(){l=null,e()}),fn:e}},flush:function(){l&&(cancelAnimationFrame(l.frameId),l.fn(),l=null)}}),R={isActive:!1};function A(){return!R.isActive}function O(e){var t,n=e.event,i=null===(t=e.current[0])||void 0===t?void 0:t.dropEffect;null!=i&&n.dataTransfer&&(n.dataTransfer.dropEffect=i)}var I=function(e){var t,n,i=e.event,r=e.dragType,o=e.getDropTargetsOver,s=e.dispatchEvent;if(A()){var l=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=T(t);if("external"===n.startedFrom)return{input:r,dropTargets:[]};var o=i({input:r,source:n.payload,target:t.target,current:[]});return{input:r,dropTargets:o}}({event:i,dragType:r,getDropTargetsOver:o});R.isActive=!0;var a={current:l};O({event:i,current:l.dropTargets});var u=function(e){var t=e.source,n=e.initial,i=e.dispatchEvent,r={dropTargets:[]};function o(e){i(e),r={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var i=e.nativeSetDragImage,s={current:n,previous:r,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:s,nativeSetDragImage:i}}),P.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:s}})})},dragUpdate:function(e){var i=e.current;P.flush(),D.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:r,current:i}}})},drag:function(e){var i=e.current;D(function(){P.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:r,current:i}}})})},drop:function(e){var i=e.current,s=e.updatedSourcePayload;P.flush(),D.cancel(),o({eventName:"onDrop",payload:{source:null!=s?s:t,location:{current:i,previous:r,initial:n}}})}}}({source:r.payload,dispatchEvent:s,initial:l}),h=(0,c.bindAll)(window,[{type:"dragover",listener:function(e){m(e),u.drag({current:a.current})}},{type:"dragenter",listener:m},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,i=t.relatedTarget;return"dragleave"===n&&(C()?!!C()&&t.hasOwnProperty(M.isLeavingWindow):null==i||(k()?"nodeName"in i&&i.ownerDocument!==document:i instanceof HTMLIFrameElement))})({dragLeave:e})&&(p({input:a.current.input,dropTargets:[]}),"external"===r.startedFrom&&g())}},{type:"drop",listener:function(e){if(a.current={dropTargets:a.current.dropTargets,input:T(e)},!a.current.dropTargets.length){g();return}e.preventDefault(),O({event:e,current:a.current.dropTargets}),u.drop({current:a.current,updatedSourcePayload:"external"===r.type?r.getDropPayload(e):null}),v()}},{type:"dragend",listener:function(e){a.current={dropTargets:a.current.dropTargets,input:T(e)},g()}}].concat(x([{type:"pointermove",listener:(n=0,function(){if(n<20){n++;return}t()})},{type:"pointerdown",listener:t=g}])),{capture:!0});u.start({nativeSetDragImage:i.dataTransfer?i.dataTransfer.setDragImage.bind(i.dataTransfer):null})}function p(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var i=0;i<t.length;i++)if(t[i].element!==n[i].element)return!0;return!1}({current:a.current.dropTargets,next:e.dropTargets});a.current=e,t&&u.dragUpdate({current:a.current})}function m(e){var t=T(e),n=o({target:d(e.target)?f({x:t.clientX,y:t.clientY}):e.target,input:t,source:r.payload,current:a.current.dropTargets});n.length&&(e.preventDefault(),O({event:e,current:n})),p({dropTargets:n,input:t})}function g(){a.current.dropTargets.length&&p({dropTargets:[],input:a.current.input}),u.drop({current:a.current,updatedSourcePayload:null}),v()}function v(){R.isActive=!1,h()}},E=new Map,L=n(65331);function B(e,t){var n=t.attribute,i=t.value;return e.setAttribute(n,i),function(){return e.removeAttribute(n)}}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(t){(0,p.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return N(e,void 0);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)?N(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function j(e){return e.slice(0).reverse()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var $=S(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),W="text/plain",_=new WeakMap,q=(a=null,{bindEvents:function(){return a=null,(0,c.bind)(window,{type:"pointermove",listener:function(e){a={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,i=t.payload;if("onDragStart"===n){var r,o,s,l,u,d=i.location.initial.input;r=({initial:null!==(u=a)&&void 0!==u?u:{x:d.clientX,y:d.clientY}}).initial,(o=document.createElement("div")).setAttribute(h,"true"),s=v({client:r}),Object.assign(o.style,g(g({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},b({clientRect:s})),{},{pointerEvents:"auto",zIndex:0x7fffffff})),document.body.appendChild(o),l=(0,c.bind)(window,{type:"pointermove",listener:function(e){s=v({client:{x:e.clientX,y:e.clientY}}),Object.assign(o.style,b({clientRect:s}))},options:{capture:!0}}),e=function(e){var t,n,i,r=e.current;if(l(),n=(t={client:r,clientRect:s}).client,i=t.clientRect,n.x>=i.x&&n.x<=i.x+i.width&&n.y>=i.y&&n.y<=i.y+i.height){o.remove();return}function a(){u(),o.remove()}var u=(0,c.bindAll)(window,[{type:"pointerdown",listener:a},{type:"pointermove",listener:a},{type:"focusin",listener:a},{type:"focusout",listener:a},{type:"dragstart",listener:a},{type:"dragenter",listener:a},{type:"dragover",listener:a}],{capture:!0})}}if("onDrop"===n){var f,p=i.location.current.input;null===(f=e)||void 0===f||f({current:{x:p.clientX,y:p.clientY}}),e=null,a=null}}}}),G=function(e){var t=e.typeKey,n=e.mount,i=e.dispatchEventToSource,r=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(i){var r=i.eventName,o=i.payload;if("onGenerateDragPreview"===r){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var s,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return H(e,void 0);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)?H(e,t):void 0}}(e))){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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 o,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}(e);try{for(l.s();!(s=l.n()).done;){var a=s.value;n(a)}}catch(e){l.e(e)}finally{l.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[r])||void 0===h||h.call(d,o))}"onDrop"===r&&(t.active.clear(),t=null)}},monitorForConsumers:function(i){var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){(0,p.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},i);return e.add(r),n(r),function(){e.delete(r),t&&t.active.delete(r)}}}}(),l=function(e){var t=e.typeKey,n=e.defaultDropEffect,i=new WeakMap,r="data-drop-target-for-".concat(t),o="[".concat(r,"]");function s(e){var t,n=e.eventName,r=e.payload,o=V(r.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var s,l=t.value,a=i.get(l.element),u=F(F({},r),{},{self:l});null==a||null===(s=a[n])||void 0===s||s.call(a,u)}}catch(e){o.e(e)}finally{o.f()}}var l={onGenerateDragPreview:s,onDrag:s,onDragStart:s,onDrop:s,onDropTargetChange:function(e){var t,n=e.payload,r=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,s=V(n.location.previous.dropTargets);try{for(s.s();!(t=s.n()).done;){var l,a,u=t.value;o.add(u.element);var c=i.get(u.element),h=r.has(u.element),d=F(F({},n),{},{self:u});null==c||null===(l=c.onDropTargetChange)||void 0===l||l.call(c,d),h||null==c||null===(a=c.onDragLeave)||void 0===a||a.call(c,d)}}catch(e){s.e(e)}finally{s.f()}var f,p=V(n.location.current.dropTargets);try{for(p.s();!(f=p.n()).done;){var m,g,v=f.value;if(!o.has(v.element)){var b=F(F({},n),{},{self:v}),y=i.get(v.element);null==y||null===(m=y.onDropTargetChange)||void 0===m||m.call(y,b),null==y||null===(g=y.onDragEnter)||void 0===g||g.call(y,b)}}}catch(e){p.e(e)}finally{p.f()}}};return{dropTargetForConsumers:function(e){return(0,L.$)(B(e.element,{attribute:r,value:"true"}),(i.set(e.element,e),function(){return i.delete(e.element)}))},getIsOver:function(e){var t=e.source,r=e.target,s=e.input,l=e.current,a=function e(t){var r,s,l,a,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 m=i.get(p);if(null==m)return f;var g={input:h,source:u,element:m.element};if(m.canDrop&&!m.canDrop(g))return e({source:u,target:m.element.parentElement,input:h,result:f});var v=null!==(r=null===(s=m.getData)||void 0===s?void 0:s.call(m,g))&&void 0!==r?r:{},b=null!==(l=null===(a=m.getDropEffect)||void 0===a?void 0:a.call(m,g))&&void 0!==l?l:n,y={data:v,element:m.element,dropEffect:b,isActiveDueToStickiness:!1};return e({source:u,target:m.element.parentElement,input:h,result:[].concat(x(f),[y])})}({source:t,target:r,input:s});if(a.length>=l.length)return a;for(var u=j(l),c=j(a),h=[],d=0;d<u.length;d++){var f,p=u[d],m=c[d];if(null!=m){h.push(m);continue}var g=h[d-1],v=u[d-1];if((null==g?void 0:g.element)!==(null==v?void 0:v.element))break;var b=i.get(p.element);if(!b)break;var y={input:s,source:t,element:b.element};if(b.canDrop&&!b.canDrop(y)||!(null!==(f=b.getIsSticky)&&void 0!==f&&f.call(b,y)))break;h.push(F(F({},p),{},{isActiveDueToStickiness:!0}))}return j(h)},dispatchEvent:function(e){l[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function a(e){null==i||i(e),l.dispatchEvent(e),s.dispatchEvent(e),null==r||r(e)}function u(e){I({event:e.event,dragType:e.dragType,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}return{registerUsage:function(){var e,i;return i=function(e){var t=e.typeKey,n=e.mount,i=E.get(t);if(i)return i.usageCount++,i;var r={typeKey:t,unmount:n(),usageCount:1};return E.set(t,r),r}(e={typeKey:t,mount:function(){return n({canStart:A,start:u})}}),function(){i.usageCount--,!(i.usageCount>0)&&(i.unmount(),E.delete(e.typeKey))}},dropTarget:l.dropTargetForConsumers,monitor:s.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return(0,L.$)(q.bindEvents(),(0,c.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,i,r,o,s,l,a=t.target;if(!(a instanceof HTMLElement))return null;var c=_.get(a);if(!c)return null;var h=T(t),d={element:c.element,dragHandle:null!==(n=c.dragHandle)&&void 0!==n?n:null,input:h};if(c.canDrag&&!c.canDrag(d))return t.preventDefault(),null;if(c.dragHandle){var p=f({x:h.clientX,y:h.clientY});if(!c.dragHandle.contains(p))return t.preventDefault(),null}var m=null!==(i=null===(r=c.getInitialDataForExternal)||void 0===r?void 0:r.call(c,d))&&void 0!==i?i:null;if(m)for(var g=0,v=Object.entries(m);g<v.length;g++){var b=(0,u.Z)(v[g],2),y=b[0],w=b[1];t.dataTransfer.setData(y,null!=w?w:"")}!$()||t.dataTransfer.types.includes(W)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(W,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var x={element:c.element,dragHandle:null!==(o=c.dragHandle)&&void 0!==o?o:null,data:null!==(s=null===(l=c.getInitialData)||void 0===l?void 0:l.call(c,d))&&void 0!==s?s:{}};e.start({event:t,dragType:{type:"element",payload:x,startedFrom:"internal"}})}}}))},dispatchEventToSource:function(e){var t,n,i=e.eventName,r=e.payload;null===(t=_.get(r.source.element))||void 0===t||null===(n=t[i])||void 0===n||n.call(t,r)},onPostDispatch:q.getOnPostDispatch()}),U=G.dropTarget,K=G.monitor;function Y(e){return(0,L.$)(G.registerUsage(),(_.set(e.element,e),function(){_.delete(e.element)}),B(e.element,{attribute:"draggable",value:"true"}))}},65331:function(e,t,n){"use strict";function i(){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()})}}n.d(t,{$:()=>i})},73957:function(e,t,n){"use strict";n.d(t,{ZP:()=>B});var i=n(54538),r=n(90496),o=n(82267),s=n(6595),l=n(49106),a=n(41825),u=n(94680),c=n(77999),h=n(51183),d=n(94776),f=n(42777),p=n(24255),m=n(24246);function g(e,t,n){let i=function(e,t,n){let i;let r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=(0,p.Z)(t);if(t.fakeTransform)i=t.fakeTransform;else{let e=s.getComputedStyle(t);i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let l=0,a=0;if(i&&"none"!==i&&"string"==typeof i){let e=i.split("(")[1].split(")")[0].split(",");l=parseInt(e[4],10),a=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+l-r.left}px)`:`translateX(${s.innerWidth+l-r.left}px)`:"right"===e?o?`translateX(-${r.right-o.left-l}px)`:`translateX(-${r.left+r.width-l}px)`:"up"===e?o?`translateY(${o.bottom+a-r.top}px)`:`translateY(${s.innerHeight+a-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-a}px)`:`translateY(-${r.top+r.height-a}px)`}(e,t,"function"==typeof n?n():n);i&&(t.style.webkitTransform=i,t.style.transform=i)}let v=i.forwardRef(function(e,t){let n=(0,d.Z)(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:s,appear:l=!0,children:v,container:b,direction:y="down",easing:w=r,in:x,onEnter:S,onEntered:k,onEntering:C,onExit:M,onExited:T,onExiting:D,style:P,timeout:R=o,TransitionComponent:A=a.ZP,...O}=e,I=i.useRef(null),E=(0,h.Z)((0,u.Z)(v),I,t),L=e=>t=>{e&&(void 0===t?e(I.current):e(I.current,t))},B=L((e,t)=>{g(y,e,b),(0,f.n)(e),S&&S(e,t)}),Z=L((e,t)=>{let i=(0,f.C)({timeout:R,style:P,easing:w},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...i}),e.style.transition=n.transitions.create("transform",{...i}),e.style.webkitTransform="none",e.style.transform="none",C&&C(e,t)}),F=L(k),V=L(D),N=L(e=>{let t=(0,f.C)({timeout:R,style:P,easing:w},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),g(y,e,b),M&&M(e)}),j=L(e=>{e.style.webkitTransition="",e.style.transition="",T&&T(e)}),H=i.useCallback(()=>{I.current&&g(y,I.current,b)},[y,b]);return i.useEffect(()=>{if(x||"down"===y||"right"===y)return;let e=(0,c.Z)(()=>{I.current&&g(y,I.current,b)}),t=(0,p.Z)(I.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[y,x,b]),i.useEffect(()=>{x||H()},[x,H]),(0,m.jsx)(A,{nodeRef:I,onEnter:B,onEntered:F,onEntering:Z,onExit:N,onExited:j,onExiting:V,addEndListener:e=>{s&&s(I.current,e)},appear:l,in:x,timeout:R,...O,children:(e,{ownerState:t,...n})=>i.cloneElement(v,{ref:E,style:{visibility:"exited"!==e||x?void 0:"hidden",...P,...v.props.style},...n})})});var b=n(28866),y=n(51640),w=n(73037),x=n(12709),S=n(82319),k=n(51751),C=n(44124),M=n(6749);function T(e){return(0,M.ZP)("MuiDrawer",e)}(0,C.Z)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);var D=n(16351),P=n(27834);let R=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},A=e=>{let{classes:t,anchor:n,variant:i}=e,r={root:["root",`anchor${(0,y.Z)(n)}`],docked:[("permanent"===i||"persistent"===i)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,y.Z)(n)}`,"temporary"!==i&&`paperAnchorDocked${(0,y.Z)(n)}`]};return(0,o.Z)(r,T,t)},O=(0,x.ZP)(l.Z,{name:"MuiDrawer",slot:"Root",overridesResolver:R})((0,S.Z)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),I=(0,x.ZP)("div",{shouldForwardProp:w.Z,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:R})({flex:"0 0 auto"}),E=(0,x.ZP)(b.Z,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,y.Z)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,y.Z)(n.anchor)}`]]}})((0,S.Z)(({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}`}}]}))),L={left:"right",right:"left",top:"down",bottom:"up"},B=i.forwardRef(function(e,t){let n=(0,k.i)({props:e,name:"MuiDrawer"}),o=(0,d.Z)(),l=(0,s.V)(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{anchor:u="left",BackdropProps:c,children:h,className:f,elevation:p=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:b,...y}={},onClose:w,open:x=!1,PaperProps:S={},SlideProps:C,TransitionComponent:M,transitionDuration:T=a,variant:R="temporary",slots:B={},slotProps:Z={},...F}=n,V=i.useRef(!1);i.useEffect(()=>{V.current=!0},[]);let N=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?L[t]:t}({direction:l?"rtl":"ltr"},u),j={...n,anchor:u,elevation:p,open:x,variant:R,...F},H=A(j),z={slots:{transition:M,...B},slotProps:{paper:S,transition:C,...Z,backdrop:(0,P.Z)(Z.backdrop||{...c,...b},{transitionDuration:T})}},[$,W]=(0,D.Z)("root",{ref:t,elementType:O,className:(0,r.Z)(H.root,H.modal,f),shouldForwardComponentProp:!0,ownerState:j,externalForwardedProps:{...z,...F,...y},additionalProps:{open:x,onClose:w,hideBackdrop:g,slots:{backdrop:z.slots.backdrop},slotProps:{backdrop:z.slotProps.backdrop}}}),[_,q]=(0,D.Z)("paper",{elementType:E,shouldForwardComponentProp:!0,className:(0,r.Z)(H.paper,S.className),ownerState:j,externalForwardedProps:z,additionalProps:{elevation:"temporary"===R?p:0,square:!0}}),[G,U]=(0,D.Z)("docked",{elementType:I,ref:t,className:(0,r.Z)(H.root,H.docked,f),ownerState:j,externalForwardedProps:z,additionalProps:F}),[K,Y]=(0,D.Z)("transition",{elementType:v,ownerState:j,externalForwardedProps:z,additionalProps:{in:x,direction:L[N],timeout:T,appear:V.current}}),J=(0,m.jsx)(_,{...q,children:h});if("permanent"===R)return(0,m.jsx)(G,{...U,children:J});let X=(0,m.jsx)(K,{...Y,children:J});return"persistent"===R?(0,m.jsx)(G,{...U,children:X}):(0,m.jsx)($,{...W,children:X})})},73845:function(e,t,n){"use strict";n.d(t,{Z:()=>y});var i=n(54538),r=n(90496),o=n(82267),s=n(16838),l=n(12709),a=n(82319),u=n(51751),c=n(73037),h=n(14544),d=n(16758),f=n(51183),p=n(78849),m=n(3552),g=n(24246);let v=e=>{let{alignItems:t,classes:n,dense:i,disabled:r,disableGutters:s,divider:l,selected:a}=e,u=(0,o.Z)({root:["root",i&&"dense",!s&&"gutters",l&&"divider",r&&"disabled","flex-start"===t&&"alignItemsFlexStart",a&&"selected"]},m.t,n);return{...n,...u}},b=(0,l.ZP)(h.Z,{shouldForwardProp:e=>(0,c.Z)(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,a.Z)(({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"}},[`&.${m.Z.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${m.Z.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${m.Z.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,s.Fq)(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,s.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${m.Z.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${m.Z.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}}]}))),y=i.forwardRef(function(e,t){let n=(0,u.i)({props:e,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:s=!1,component:l="div",children:a,dense:c=!1,disableGutters:h=!1,divider:m=!1,focusVisibleClassName:y,selected:w=!1,className:x,...S}=n,k=i.useContext(p.Z),C=i.useMemo(()=>({dense:c||k.dense||!1,alignItems:o,disableGutters:h}),[o,k.dense,c,h]),M=i.useRef(null);(0,d.Z)(()=>{s&&M.current&&M.current.focus()},[s]);let T={...n,alignItems:o,dense:C.dense,disableGutters:h,divider:m,selected:w},D=v(T),P=(0,f.Z)(M,t);return(0,g.jsx)(p.Z.Provider,{value:C,children:(0,g.jsx)(b,{ref:P,href:S.href||S.to,component:(S.href||S.to)&&"div"===l?"button":l,focusVisibleClassName:(0,r.Z)(D.focusVisible,y),ownerState:T,className:(0,r.Z)(D.root,x),...S,classes:D,children:a})})})},3552:function(e,t,n){"use strict";n.d(t,{Z:()=>s,t:()=>o});var i=n(44124),r=n(6749);function o(e){return(0,r.ZP)("MuiListItemButton",e)}let s=(0,i.Z)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"])},25329:function(e,t,n){"use strict";n.d(t,{Z:()=>v});var i=n(54538),r=n(90496),o=n(82267),s=n(32641),l=n(12709),a=n(51751),u=n(44124),c=n(6749);function h(e){return(0,c.ZP)("MuiTableFooter",e)}(0,u.Z)("MuiTableFooter",["root"]);var d=n(24246);let f=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},h,t)},p=(0,l.ZP)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),m={variant:"footer"},g="tfoot",v=i.forwardRef(function(e,t){let n=(0,a.i)({props:e,name:"MuiTableFooter"}),{className:i,component:o=g,...l}=n,u={...n,component:o},c=f(u);return(0,d.jsx)(s.Z.Provider,{value:m,children:(0,d.jsx)(p,{as:o,className:(0,r.Z)(c.root,i),ref:t,role:o===g?null:"rowgroup",ownerState:u,...l})})})},42158:function(e,t,n){"use strict";n.d(t,{Z:()=>$});var i,r=n(54538),o=n(90496),s=n(82267),l=n(12709),a=n(82319),u=n(51751),c=n(55879),h=n(10517),d=n(63767),f=n(96205),p=n(44124),m=n(6749);function g(e){return(0,m.ZP)("MuiToolbar",e)}(0,p.Z)("MuiToolbar",["root","gutters","regular","dense"]);var v=n(24246);let b=e=>{let{classes:t,disableGutters:n,variant:i}=e;return(0,s.Z)({root:["root",!n&&"gutters",i]},g,t)},y=(0,l.ZP)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,a.Z)(({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}]}))),w=r.forwardRef(function(e,t){let n=(0,u.i)({props:e,name:"MuiToolbar"}),{className:i,component:r="div",disableGutters:s=!1,variant:l="regular",...a}=n,c={...n,component:r,disableGutters:s,variant:l},h=b(c);return(0,v.jsx)(y,{as:r,className:(0,o.Z)(h.root,i),ref:t,ownerState:c,...a})});var x=n(6595),S=n(67665),k=n(63633),C=n(75094),M=n(90247);let T=(0,M.Z)((0,v.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),D=(0,M.Z)((0,v.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),P=r.forwardRef(function(e,t){let{backIconButtonProps:n,count:i,disabled:r=!1,getItemAriaLabel:o,nextIconButtonProps:s,onPageChange:l,page:a,rowsPerPage:u,showFirstButton:c,showLastButton:h,slots:d={},slotProps:f={},...p}=e,m=(0,x.V)(),g=d.firstButton??C.Z,b=d.lastButton??C.Z,y=d.nextButton??C.Z,w=d.previousButton??C.Z,M=d.firstButtonIcon??D,P=d.lastButtonIcon??T,R=d.nextButtonIcon??k.Z,A=d.previousButtonIcon??S.Z,O=m?b:g,I=m?y:w,E=m?w:y,L=m?g:b,B=m?f.lastButton:f.firstButton,Z=m?f.nextButton:f.previousButton,F=m?f.previousButton:f.nextButton,V=m?f.firstButton:f.lastButton;return(0,v.jsxs)("div",{ref:t,...p,children:[c&&(0,v.jsx)(O,{onClick:e=>{l(e,0)},disabled:r||0===a,"aria-label":o("first",a),title:o("first",a),...B,children:m?(0,v.jsx)(P,{...f.lastButtonIcon}):(0,v.jsx)(M,{...f.firstButtonIcon})}),(0,v.jsx)(I,{onClick:e=>{l(e,a-1)},disabled:r||0===a,color:"inherit","aria-label":o("previous",a),title:o("previous",a),...Z??n,children:m?(0,v.jsx)(R,{...f.nextButtonIcon}):(0,v.jsx)(A,{...f.previousButtonIcon})}),(0,v.jsx)(E,{onClick:e=>{l(e,a+1)},disabled:r||-1!==i&&a>=Math.ceil(i/u)-1,color:"inherit","aria-label":o("next",a),title:o("next",a),...F??s,children:m?(0,v.jsx)(A,{...f.previousButtonIcon}):(0,v.jsx)(R,{...f.nextButtonIcon})}),h&&(0,v.jsx)(L,{onClick:e=>{l(e,Math.max(0,Math.ceil(i/u)-1))},disabled:r||a>=Math.ceil(i/u)-1,"aria-label":o("last",a),title:o("last",a),...V,children:m?(0,v.jsx)(M,{...f.firstButtonIcon}):(0,v.jsx)(P,{...f.lastButtonIcon})})]})});var R=n(56839);function A(e){return(0,m.ZP)("MuiTablePagination",e)}let O=(0,p.Z)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var I=n(16351);let E=(0,l.ZP)(f.Z,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,a.Z)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),L=(0,l.ZP)(w,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${O.actions}`]:t.actions,...t.toolbar})})((0,a.Z)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${O.actions}`]:{flexShrink:0,marginLeft:20}}))),B=(0,l.ZP)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),Z=(0,l.ZP)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,a.Z)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),F=(0,l.ZP)(d.Z,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${O.selectIcon}`]:t.selectIcon,[`& .${O.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${O.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),V=(0,l.ZP)(h.Z,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),N=(0,l.ZP)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,a.Z)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function j({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function H(e){return`Go to ${e} page`}let z=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},A,t)},$=r.forwardRef(function(e,t){let n;let s=(0,u.i)({props:e,name:"MuiTablePagination"}),{ActionsComponent:l=P,backIconButtonProps:a,colSpan:h,component:d=f.Z,count:p,disabled:m=!1,getItemAriaLabel:g=H,labelDisplayedRows:b=j,labelRowsPerPage:y="Rows per page:",nextIconButtonProps:w,onPageChange:x,onRowsPerPageChange:S,page:k,rowsPerPage:C,rowsPerPageOptions:M=[10,25,50,100],SelectProps:T={},showFirstButton:D=!1,showLastButton:A=!1,slotProps:O={},slots:$={},...W}=s,_=z(s),q=O?.select??T,G=q.native?"option":V;(d===f.Z||"td"===d)&&(n=h||1e3);let U=(0,R.Z)(q.id),K=(0,R.Z)(q.labelId),Y={slots:$,slotProps:O},[J,X]=(0,I.Z)("root",{ref:t,className:_.root,elementType:E,externalForwardedProps:{...Y,component:d,...W},ownerState:s,additionalProps:{colSpan:n}}),[Q,ee]=(0,I.Z)("toolbar",{className:_.toolbar,elementType:L,externalForwardedProps:Y,ownerState:s}),[et,en]=(0,I.Z)("spacer",{className:_.spacer,elementType:B,externalForwardedProps:Y,ownerState:s}),[ei,er]=(0,I.Z)("selectLabel",{className:_.selectLabel,elementType:Z,externalForwardedProps:Y,ownerState:s,additionalProps:{id:K}}),[eo,es]=(0,I.Z)("select",{className:_.select,elementType:F,externalForwardedProps:Y,ownerState:s}),[el,ea]=(0,I.Z)("menuItem",{className:_.menuItem,elementType:G,externalForwardedProps:Y,ownerState:s}),[eu,ec]=(0,I.Z)("displayedRows",{className:_.displayedRows,elementType:N,externalForwardedProps:Y,ownerState:s});return(0,v.jsx)(J,{...X,children:(0,v.jsxs)(Q,{...ee,children:[(0,v.jsx)(et,{...en}),M.length>1&&(0,v.jsx)(ei,{...er,children:y}),M.length>1&&(0,v.jsx)(eo,{variant:"standard",...!q.variant&&{input:i||(i=(0,v.jsx)(c.ZP,{}))},value:C,onChange:S,id:U,labelId:K,...q,classes:{...q.classes,root:(0,o.Z)(_.input,_.selectRoot,(q.classes||{}).root),select:(0,o.Z)(_.select,(q.classes||{}).select),icon:(0,o.Z)(_.selectIcon,(q.classes||{}).icon)},disabled:m,...es,children:M.map(e=>(0,r.createElement)(el,{...ea,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,v.jsx)(eu,{...ec,children:b({from:0===p?0:k*C+1,to:-1===p?(k+1)*C:-1===C?p:Math.min(p,(k+1)*C),count:-1===p?-1:p,page:k})}),(0,v.jsx)(l,{className:_.actions,backIconButtonProps:a,count:p,nextIconButtonProps:w,onPageChange:x,page:k,rowsPerPage:C,showFirstButton:D,showLastButton:A,slotProps:O.actions,slots:$.actions,getItemAriaLabel:g,disabled:m})]})})})},78214:function(e,t,n){"use strict";n.d(t,{Z:()=>y});var i=n(82267),r=n(90496),o=n(54538),s=n(14544),l=n(90247),a=n(24246);let u=(0,l.Z)((0,a.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");var c=n(12709),h=n(82319),d=n(51751),f=n(51640),p=n(23147),m=n(16351);let g=e=>{let{classes:t,direction:n,active:r}=e,o={root:["root",r&&"active",`direction${(0,f.Z)(n)}`],icon:["icon",`iconDirection${(0,f.Z)(n)}`]};return(0,i.Z)(o,p.l,t)},v=(0,c.ZP)(s.Z,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,h.Z)(({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,[`& .${p.Z.icon}`]:{opacity:.5}},[`&.${p.Z.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${p.Z.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),b=(0,c.ZP)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,f.Z)(n.direction)}`]]}})((0,h.Z)(({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)"}}]}))),y=o.forwardRef(function(e,t){let n=(0,d.i)({props:e,name:"MuiTableSortLabel"}),{active:i=!1,children:o,className:s,direction:l="asc",hideSortIcon:c=!1,IconComponent:h=u,slots:f={},slotProps:p={},...y}=n,w={...n,active:i,direction:l,hideSortIcon:c,IconComponent:h},x=g(w),S={slots:f,slotProps:p},[k,C]=(0,m.Z)("root",{elementType:v,externalForwardedProps:S,ownerState:w,className:(0,r.Z)(x.root,s),ref:t}),[M,T]=(0,m.Z)("icon",{elementType:b,externalForwardedProps:S,ownerState:w,className:x.icon});return(0,a.jsxs)(k,{disableRipple:!0,component:"span",...C,...y,children:[o,c&&!i?null:(0,a.jsx)(M,{as:h,...T})]})})},23147:function(e,t,n){"use strict";n.d(t,{Z:()=>s,l:()=>o});var i=n(44124),r=n(6749);function o(e){return(0,r.ZP)("MuiTableSortLabel",e)}let s=(0,i.Z)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"])},98346:function(e,t,n){"use strict";n.d(t,{Z:()=>w});var i=n(54538),r=n(90496),o=n(16819),s=n(82267),l=n(16838),a=n(14544),u=n(51640),c=n(12709),h=n(82319),d=n(90433),f=n(51751),p=n(87462),m=n(94996),g=n(19984),v=n(24246);let b=e=>{let{classes:t,fullWidth:n,selected:i,disabled:r,size:o,color:l}=e,a={root:["root",i&&"selected",r&&"disabled",n&&"fullWidth",`size${(0,u.Z)(o)}`,l]};return(0,s.Z)(a,p.a,t)},y=(0,c.ZP)(a.Z,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`size${(0,u.Z)(n.size)}`]]}})((0,h.Z)(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${p.Z.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,l.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${p.Z.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,l.Fq)(e.palette.text.primary,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,l.Fq)(e.palette.text.primary,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,l.Fq)(e.palette.text.primary,e.palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter((0,d.Z)()).map(([t])=>({props:{color:t},style:{[`&.${p.Z.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,l.Fq)(e.palette[t].main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,l.Fq)(e.palette[t].main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,l.Fq)(e.palette[t].main,e.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),w=i.forwardRef(function(e,t){var n;let{value:s,...l}=i.useContext(m.Z),a=i.useContext(g.Z),u=(0,o.Z)({...l,selected:(n=e.value,void 0!==s&&void 0!==n&&(Array.isArray(s)?s.includes(n):n===s))},e),c=(0,f.i)({props:u,name:"MuiToggleButton"}),{children:h,className:d,color:p="standard",disabled:w=!1,disableFocusRipple:x=!1,fullWidth:S=!1,onChange:k,onClick:C,selected:M,size:T="medium",value:D,...P}=c,R={...c,color:p,disabled:w,disableFocusRipple:x,fullWidth:S,size:T},A=b(R);return(0,v.jsx)(y,{className:(0,r.Z)(l.className,A.root,d,a||""),disabled:w,focusRipple:!x,ref:t,onClick:e=>{(!C||(C(e,D),!e.defaultPrevented))&&k&&k(e,D)},onChange:k,value:D,ownerState:R,"aria-pressed":M,...P,children:h})})},87462:function(e,t,n){"use strict";n.d(t,{Z:()=>s,a:()=>o});var i=n(44124),r=n(6749);function o(e){return(0,r.ZP)("MuiToggleButton",e)}let s=(0,i.Z)("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"])},5404:function(e,t,n){"use strict";n.d(t,{Z:()=>x});var i=n(54538),r=n(90496),o=n(82267),s=n(65124),l=n(12709),a=n(82319),u=n(51751),c=n(51640),h=n(44124),d=n(6749);function f(e){return(0,d.ZP)("MuiToggleButtonGroup",e)}let p=(0,h.Z)("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]);var m=n(94996),g=n(19984),v=n(87462),b=n(24246);let y=e=>{let{classes:t,orientation:n,fullWidth:i,disabled:r}=e,s={root:["root",n,i&&"fullWidth"],grouped:["grouped",`grouped${(0,c.Z)(n)}`,r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,o.Z)(s,f,t)},w=(0,l.ZP)("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${p.grouped}`]:t.grouped},{[`& .${p.grouped}`]:t[`grouped${(0,c.Z)(n.orientation)}`]},{[`& .${p.firstButton}`]:t.firstButton},{[`& .${p.lastButton}`]:t.lastButton},{[`& .${p.middleButton}`]:t.middleButton},t.root,"vertical"===n.orientation&&t.vertical,n.fullWidth&&t.fullWidth]}})((0,a.Z)(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${p.grouped}`]:{[`&.${p.selected} + .${p.grouped}.${p.selected}`]:{borderTop:0,marginTop:0}},[`& .${p.firstButton},& .${p.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${p.lastButton},& .${p.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${p.lastButton}.${v.Z.disabled},& .${p.middleButton}.${v.Z.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${p.grouped}`]:{[`&.${p.selected} + .${p.grouped}.${p.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${p.firstButton},& .${p.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${p.lastButton},& .${p.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${p.lastButton}.${v.Z.disabled},& .${p.middleButton}.${v.Z.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),x=i.forwardRef(function(e,t){let n=(0,u.i)({props:e,name:"MuiToggleButtonGroup"}),{children:o,className:l,color:a="standard",disabled:c=!1,exclusive:h=!1,fullWidth:d=!1,onChange:f,orientation:p="horizontal",size:v="medium",value:x,...S}=n,k={...n,disabled:c,fullWidth:d,orientation:p,size:v},C=y(k),M=i.useCallback((e,t)=>{let n;if(!f)return;let i=x&&x.indexOf(t);x&&i>=0?(n=x.slice()).splice(i,1):n=x?x.concat(t):[t],f(e,n)},[f,x]),T=i.useCallback((e,t)=>{f&&f(e,x===t?null:t)},[f,x]),D=i.useMemo(()=>({className:C.grouped,onChange:h?T:M,value:x,size:v,fullWidth:d,color:a,disabled:c}),[C.grouped,h,T,M,x,v,d,a,c]),P=(0,s.Z)(o),R=P.length,A=e=>{let t=0===e,n=e===R-1;return t&&n?"":t?C.firstButton:n?C.lastButton:C.middleButton};return(0,b.jsx)(w,{role:"group",className:(0,r.Z)(C.root,l),ref:t,ownerState:k,...S,children:(0,b.jsx)(m.Z.Provider,{value:D,children:P.map((e,t)=>(0,b.jsx)(g.Z.Provider,{value:A(t),children:e},t))})})})},19984:function(e,t,n){"use strict";n.d(t,{Z:()=>i});let i=n(54538).createContext(void 0)},94996:function(e,t,n){"use strict";n.d(t,{Z:()=>i});let i=n(54538).createContext({})},68014:function(e,t,n){"use strict";n.d(t,{Z:()=>s});var i=n(22179),r=n(53126),o=n(92994);function s({props:e,name:t}){return(0,i.Z)({props:e,name:t,defaultTheme:r.Z,themeId:o.Z})}},12434:function(e,t,n){"use strict";n.d(t,{Z:()=>i});let i=(0,n(79886).Z)()},51727:function(e,t,n){"use strict";n.d(t,{H:()=>J});var i=n(29435),r=n(32791),o=n(14336),s=n(22694),l=n(5154),a=n(39489),u=n(6341),c=n(13189),h=n(35918),d=n(89880),f=n(58006),p=n(16332),m=n(71721),g=n(61721),v=n(28904),b=n(7785),y=n(38364),w=n(18340),x=n(20506),S=n(74265),k=n(26635),C=n(41275),M=n(14107),T=n(50436),D=n(97912),P=n(59250),R=n(3303),A=n(78374),O=n(53743),I=n(18070),E=n(83709),L=n(63200),B=n(36292),Z=n(11136),F=n(33518),V=n(44138),N=n(28140),j=n(23033),H=n(50007),z=n(24575),$=n(5149),W=n(18874),_=n(62511),q=n(14257),G=n(70252);let U={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"},K={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 Y{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=U,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;let{locale:t,formats:n,longFormatters:i,lib:r}=e;this.locale=t,this.formats=(0,G.Z)({},K,n),this.longFormatters=i,this.lib=r||"date-fns"}}class J extends Y{constructor({locale:e,formats:t}={}){super({locale:e??q._,formats:t,longFormatters:f.G}),this.parse=(e,t)=>""===e?null:(0,I.Qc)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,O.J)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,p.WU)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,T.X)(e,t),this.isSameYear=(e,t)=>(0,P.F)(e,t),this.isSameMonth=(e,t)=>(0,R.x)(e,t),this.isSameDay=(e,t)=>(0,D.K)(e,t),this.isSameHour=(e,t)=>(0,A.f)(e,t),this.isAfter=(e,t)=>(0,C.A)(e,t),this.isAfterYear=(e,t)=>(0,C.A)(e,(0,d.w)(t)),this.isAfterDay=(e,t)=>(0,C.A)(e,(0,c.i)(t)),this.isBefore=(e,t)=>(0,M.R)(e,t),this.isBeforeYear=(e,t)=>(0,M.R)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,M.R)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,_._)(e,{start:t,end:n}),this.startOfYear=e=>(0,W.e)(e),this.startOfMonth=e=>(0,H.N)(e),this.startOfWeek=e=>(0,$.z)(e,{locale:this.locale}),this.startOfDay=e=>(0,j.b)(e),this.endOfYear=e=>(0,d.w)(e),this.endOfMonth=e=>(0,z.V)(e),this.endOfWeek=e=>(0,h.v)(e,{locale:this.locale}),this.endOfDay=e=>(0,c.i)(e),this.addYears=(e,t)=>(0,u.B)(e,t),this.addMonths=(e,t)=>(0,a.z)(e,t),this.addWeeks=(e,t)=>(0,l.j)(e,t),this.addDays=(e,t)=>(0,i.E)(e,t),this.addHours=(e,t)=>(0,s.T)(e,t),this.addMinutes=(e,t)=>(0,o.m)(e,t),this.addSeconds=(e,t)=>(0,r.v)(e,t),this.getYear=e=>(0,k.S)(e),this.getMonth=e=>(0,y.j)(e),this.getDate=e=>(0,m._)(e),this.getHours=e=>(0,v.p)(e),this.getMinutes=e=>(0,b.q)(e),this.getSeconds=e=>(0,w.C)(e),this.getMilliseconds=e=>(0,x.p)(e),this.setYear=(e,t)=>(0,N.M)(e,t),this.setMonth=(e,t)=>(0,Z.q)(e,t),this.setDate=(e,t)=>(0,E.G)(e,t),this.setHours=(e,t)=>(0,L.B)(e,t),this.setMinutes=(e,t)=>(0,B.H)(e,t),this.setSeconds=(e,t)=>(0,F.O)(e,t),this.setMilliseconds=(e,t)=>(0,V.I)(e,t),this.getDaysInMonth=e=>(0,g.N)(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),i=0,r=t,o=[];for(;this.isBefore(r,n);){let e=Math.floor(i/7);o[e]=o[e]||[],o[e].push(r),r=this.addDays(r,1),i+=1}return o},this.getWeekNumber=e=>(0,S.Q)(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),i=this.endOfYear(t),r=[],o=n;for(;this.isBefore(o,i);)r.push(o),o=this.addYears(o,1);return r}}}},94913:function(e,t,n){"use strict";n.d(t,{l:()=>tm});var i,r=n(70252),o=n(97784),s=n(54538),l=n(8695),a=n(68014),u=n(25399),c=n(64757),h=n(96858),d=n(81925),f=n(6595),p=n(96361),m=n(33835),g=n(65048),v=n(9831),b=n(25839);let y=({utils:e,format:t})=>{let n=10,i=t,r=e.expandFormat(t);for(;r!==i;)if(i=r,r=e.expandFormat(i),(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 r},w=({utils:e,expandedFormat:t})=>{let n=[],{start:i,end:r}=e.escapedCharacters,o=RegExp(`(\\${i}[^\\${r}]*\\${r})+`,"g"),s=null;for(;s=o.exec(t);)n.push({start:s.index,end:o.lastIndex-1});return n},x=(e,t,n,i)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),i).length,format:i});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:i});case"day":return t.fieldDayPlaceholder({format:i});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:i});case"hours":return t.fieldHoursPlaceholder({format:i});case"minutes":return t.fieldMinutesPlaceholder({format:i});case"seconds":return t.fieldSecondsPlaceholder({format:i});case"meridiem":return t.fieldMeridiemPlaceholder({format:i});default:return i}},S=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:i,localizedDigits:o,now:s,token:l,startSeparator:a})=>{if(""===l)throw Error("MUI X: Should not call `commitToken` with an empty token");let u=(0,g.z1)(e,l),c=(0,g.Su)(e,u.contentType,u.type,l),h=n?c:"digit"===u.contentType,d=null!=t&&e.isValid(t),f=d?e.formatByString(t,l):"",p=null;if(h){if(c)p=""===f?e.formatByString(s,l).length:f.length;else{if(null==u.maxLength)throw Error(`MUI X: The token ${l} should have a 'maxDigitNumber' property on it's adapter`);p=u.maxLength,d&&(f=(0,g.Gq)((0,g.Yb)((0,g.Ay)(f,o),p),o))}}return(0,r.Z)({},u,{format:l,maxLength:p,value:f,placeholder:x(e,i,u,l),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:h,startSeparator:a,endSeparator:"",modified:!1})},k=e=>{let{utils:t,expandedFormat:n,escapedParts:i}=e,o=t.date(void 0),s=[],l="",a=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),u=/^([a-zA-Z]+)/,c=RegExp(`^(${a.join("|")})*$`),h=RegExp(`^(${a.join("|")})`),d=e=>i.find(t=>t.start<=e&&t.end>=e),f=0;for(;f<n.length;){let t=d(f),i=null!=t,a=u.exec(n.slice(f))?.[1];if(!i&&null!=a&&c.test(a)){let t=a;for(;t.length>0;){let n=h.exec(t)[1];t=t.slice(n.length),s.push(S((0,r.Z)({},e,{now:o,token:n,startSeparator:l}))),l=""}f+=a.length}else{let e=n[f];i&&t?.start===f||t?.end===f||(0===s.length?l+=e:s[s.length-1].endSeparator+=e),f+=1}}return 0===s.length&&l.length>0&&s.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:l,endSeparator:"",modified:!1}),s},C=({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let i=n=>{let i=n;return e&&null!==i&&i.includes(" ")&&(i=`\u2069${i}\u2066`),"spacious"===t&&["/",".","-"].includes(i)&&(i=` ${i} `),i};return n.startSeparator=i(n.startSeparator),n.endSeparator=i(n.endSeparator),n}),M=e=>{let t=y(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=w((0,r.Z)({},e,{expandedFormat:t})),i=k((0,r.Z)({},e,{expandedFormat:t,escapedParts:n}));return C((0,r.Z)({},e,{sections:i}))};var T=n(89681),D=n(1556);let P=e=>{let t=(0,m.nB)(),n=(0,b.M)(),i=(0,m.Do)(),o=(0,f.V)(),{valueManager:l,fieldValueManager:a,valueType:u,validator:c,internalProps:h,internalProps:{value:d,defaultValue:p,referenceDate:y,onChange:w,format:x,formatDensity:S="dense",selectedSections:k,onSelectedSectionsChange:C,shouldRespectLeadingZeros:P=!1,timezone:R,enableAccessibleFieldDOMStructure:A=!1}}=e,{timezone:O,value:I,handleValueChange:E}=(0,T.w)({timezone:R,value:d,defaultValue:p,referenceDate:y,onChange:w,valueManager:l}),L=s.useMemo(()=>(0,g.S9)(t),[t]),B=s.useMemo(()=>(0,g.IE)(t,L,O),[t,L,O]),Z=s.useCallback((e,i=null)=>a.getSectionsFromValue(t,e,i,e=>M({utils:t,localeText:n,localizedDigits:L,format:x,date:e,formatDensity:S,shouldRespectLeadingZeros:P,enableAccessibleFieldDOMStructure:A,isRtl:o})),[a,x,n,L,o,P,t,S,A]),[F,V]=s.useState(()=>{let e=Z(I);(0,g.wz)(e,u);let n={sections:e,value:I,referenceValue:l.emptyValue,tempValueStrAndroid:null},i=(0,D.hV)(e),o=l.getInitialReferenceValue({referenceDate:y,value:I,utils:t,props:h,granularity:i,timezone:O});return(0,r.Z)({},n,{referenceValue:o})}),[N,j]=(0,v.Z)({controlled:k,default:null,name:"useField",state:"selectedSections"}),H=e=>{j(e),C?.(e)},z=s.useMemo(()=>(0,g.eM)(N,F.sections),[N,F.sections]),$="all"===z?0:z,W=({value:e,referenceValue:n,sections:o})=>{if(V(t=>(0,r.Z)({},t,{sections:o,value:e,referenceValue:n,tempValueStrAndroid:null})),l.areValuesEqual(t,F.value,e))return;let s={validationError:c({adapter:i,value:e,timezone:O,props:h})};E(e,s)},_=(e,t)=>{let n=[...F.sections];return n[e]=(0,r.Z)({},n[e],{value:t,modified:!0}),n};return s.useEffect(()=>{let e=Z(F.value);(0,g.wz)(e,u),V(t=>(0,r.Z)({},t,{sections:e}))},[x,t.locale,o]),s.useEffect(()=>{let e;l.areValuesEqual(t,F.value,I)&&l.getTimezone(t,F.value)===l.getTimezone(t,I)||V(e=>(0,r.Z)({},e,{value:I,referenceValue:a.updateReferenceValue(t,I,e.referenceValue),sections:Z(I)}))},[I]),{state:F,activeSectionIndex:$,parsedSelectedSections:z,setSelectedSections:H,clearValue:()=>{W({value:l.emptyValue,referenceValue:F.referenceValue,sections:Z(l.emptyValue)})},clearActiveSection:()=>{if(null==$)return;let e=F.sections[$],n=a.getActiveDateManager(t,F,e),i=n.getSections(F.sections).filter(e=>""!==e.value).length===+(""!==e.value),o=_($,""),s=i?null:t.getInvalidDate(),l=n.getNewValuesFromNewActiveDate(s);W((0,r.Z)({},l,{sections:o}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:i})=>{let o,s;i&&$<F.sections.length-1&&H($+1);let l=a.getActiveDateManager(t,F,e),u=_($,n),c=l.getSections(u),h=(0,g.lt)(t,c,L);if(null!=h&&t.isValid(h)){let e=(0,g.$9)(t,h,c,l.referenceDate,!0);o=l.getNewValuesFromNewActiveDate(e),s=!0}else o=l.getNewValuesFromNewActiveDate(h),s=(null!=h&&!t.isValid(h))!=(null!=l.date&&!t.isValid(l.date));return s?W((0,r.Z)({},o,{sections:u})):V(e=>(0,r.Z)({},e,o,{sections:u,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let i=a.parseValueStr(e,F.referenceValue,(e,i)=>{let r=t.parse(e,x);if(null==r||!t.isValid(r))return null;let s=M({utils:t,localeText:n,localizedDigits:L,format:x,date:r,formatDensity:S,shouldRespectLeadingZeros:P,enableAccessibleFieldDOMStructure:A,isRtl:o});return(0,g.$9)(t,r,s,i,!1)}),r=a.updateReferenceValue(t,i,F.referenceValue);W({value:i,referenceValue:r,sections:Z(i,F.sections)})},setTempAndroidValueStr:e=>V(t=>(0,r.Z)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:Z,sectionsValueBoundaries:B,localizedDigits:L,timezone:O}},R=e=>null!=e.saveQuery,A=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:i,setTempAndroidValueStr:o,timezone:l})=>{let a=(0,m.nB)(),[u,c]=s.useState(null),h=(0,d.Z)(()=>c(null));s.useEffect(()=>{null!=u&&e[u.sectionIndex]?.type!==u.sectionType&&h()},[e,u,h]),s.useEffect(()=>{if(null!=u){let e=setTimeout(()=>h(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[u,h]);let f=({keyPressed:t,sectionIndex:n},i,r)=>{let o=t.toLowerCase(),s=e[n];if(null!=u&&(!r||r(u.value))&&u.sectionIndex===n){let e=`${u.value}${o}`,t=i(e,s);if(!R(t))return c({sectionIndex:n,value:e,sectionType:s.type}),t}let l=i(o,s);return R(l)&&!l.saveQuery?(h(),null):(c({sectionIndex:n,value:o,sectionType:s.type}),R(l))?null:l},p=e=>{let t=(e,t,n)=>{let i=t.filter(e=>e.toLowerCase().startsWith(n));return 0===i.length?{saveQuery:!1}:{sectionValue:i[0],shouldGoToNextSection:1===i.length}},n=(e,n,i,o)=>{let s=e=>(0,g.wk)(a,l,n.type,e);if("letter"===n.contentType)return t(n.format,s(n.format),e);if(i&&null!=o&&"letter"===(0,g.z1)(a,i).contentType){let n=s(i),l=t(i,n,e);return R(l)?{saveQuery:!1}:(0,r.Z)({},l,{sectionValue:o(l.sectionValue,n)})}return{saveQuery:!1}};return f(e,(e,t)=>{switch(t.type){case"month":return n(e,t,a.formats.month,e=>(0,g.Yo)(a,e,a.formats.month,t.format));case"weekDay":return n(e,t,a.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return n(e,t);default:return{saveQuery:!1}}})},v=e=>{let t=(e,t)=>{let r=(0,g.Ay)(e,i),o=Number(r),s=n[t.type]({currentDate:null,format:t.format,contentType:t.contentType});if(o>s.maximum)return{saveQuery:!1};if(o<s.minimum)return{saveQuery:!0};let l=10*o>s.maximum||r.length===s.maximum.toString().length;return{sectionValue:(0,g.P$)(a,o,s,i,t),shouldGoToNextSection:l}};return f(e,(e,n)=>{if("digit"===n.contentType||"digit-with-letter"===n.contentType)return t(e,n);if("month"===n.type){let i=(0,g.Su)(a,"digit","month","MM"),o=t(e,{type:n.type,format:"MM",hasLeadingZerosInFormat:i,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(R(o))return o;let s=(0,g.Yo)(a,o.sectionValue,"MM",n.format);return(0,r.Z)({},o,{sectionValue:s})}if("weekDay"===n.type){let i=t(e,n);if(R(i))return i;let o=(0,g.R7)(a,n.format)[Number(i.sectionValue)-1];return(0,r.Z)({},i,{sectionValue:o})}return{saveQuery:!1}},e=>(0,g.j5)(e,i))};return{applyCharacterEditing:(0,d.Z)(n=>{let s=e[n.sectionIndex],l=(0,g.j5)(n.keyPressed,i)?v((0,r.Z)({},n,{keyPressed:(0,g.Gq)(n.keyPressed,i)})):p(n);if(null==l){o(null);return}t({activeSection:s,newSectionValue:l.sectionValue,shouldGoToNextSection:l.shouldGoToNextSection})}),resetCharacterQuery:h}};var O=n(97048),I=n(5056),E=n(45052);let L=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:i,onBlur:r,onClick:o,onFocus:l,onInput:a,onPaste:u,focused:c,autoFocus:f=!1},fieldValueManager:p,applyCharacterEditing:v,resetCharacterQuery:y,setSelectedSections:w,parsedSelectedSections:x,state:S,clearActiveSection:k,clearValue:C,updateSectionValue:M,updateValueFromValueStr:T,sectionOrder:D,areAllSectionsEmpty:P,sectionsValueBoundaries:R}=e,A=s.useRef(null),L=(0,O.Z)(i,A),B=(0,b.M)(),Z=(0,m.nB)(),F=(0,I.Z)(),[V,N]=s.useState(!1),j=s.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!A.current)return;let t=document.getSelection();if(!t)return;if(null==x){t.rangeCount>0&&A.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),V&&A.current.getRoot().blur();return}if(!A.current.getRoot().contains((0,E.vY)(document)))return;let n=new window.Range;e="all"===x?A.current.getRoot():"empty"===S.sections[x].type?A.current.getSectionContainer(x):A.current.getSectionContent(x),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=(0,E.vY)(document);return e&&A.current&&A.current.getRoot().contains(e)?A.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!A.current||null!=j.getActiveSectionIndexFromDOM())return;let t=(0,g.eM)(e,S.sections);N(!0),A.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!A.current)return;let t=(0,g.eM)(e,S.sections);N(null!==("all"===t?0:t)),w(e)},isFieldFocused:()=>{let e=(0,E.vY)(document);return!!A.current&&A.current.getRoot().contains(e)}}),[x,w,S.sections,V]),H=(0,d.Z)(e=>{if(!A.current)return;let t=S.sections[e];A.current.getSectionContent(e).innerHTML=t.value||t.placeholder,j.syncSelectionToDOM()}),z=(0,d.Z)((e,...t)=>{!e.isDefaultPrevented()&&A.current&&(N(!0),o?.(e,...t),"all"===x?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e){w(D.startIndex);return}let t=0,n=0;for(;n<e&&t<S.sections.length;){let e=S.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}w(t-1)}):V?A.current.getRoot().contains(e.target)||w(D.startIndex):(N(!0),w(D.startIndex)))}),$=(0,d.Z)(e=>{if(a?.(e),!A.current||"all"!==x)return;let t=e.target.textContent??"";A.current.getRoot().innerHTML=S.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),j.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(y(),C(),w("all")):t.length>1?T(t):("all"===x&&w(0),v({keyPressed:t,sectionIndex:0}))}),W=(0,d.Z)(e=>{if(u?.(e),n||"all"!==x){e.preventDefault();return}let t=e.clipboardData.getData("text");e.preventDefault(),y(),T(t)}),_=(0,d.Z)((...e)=>{l?.(...e),!V&&A.current&&(N(!0),null==A.current.getSectionIndexFromDOMElement((0,E.vY)(document))&&w(D.startIndex))}),q=(0,d.Z)((...e)=>{r?.(...e),setTimeout(()=>{if(!A.current)return;let e=(0,E.vY)(document);A.current.getRoot().contains(e)||(N(!1),w(null))})}),G=(0,d.Z)(e=>t=>{!t.isDefaultPrevented()&&w(e)}),U=(0,d.Z)(e=>{e.preventDefault()}),K=(0,d.Z)(e=>()=>{w(e)}),Y=(0,d.Z)(e=>{if(e.preventDefault(),n||t||"number"!=typeof x)return;let i=S.sections[x],r=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(r),s=/^[0-9]+$/.test(r),l=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(r);"letter"===i.contentType&&o||"digit"===i.contentType&&s||"digit-with-letter"===i.contentType&&l?(y(),M({activeSection:i,newSectionValue:r,shouldGoToNextSection:!0})):o||s||(y(),T(r))}),J=(0,d.Z)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),X=(0,d.Z)(e=>{if(!A.current)return;let t=e.target,i=t.textContent??"",r=A.current.getSectionIndexFromDOMElement(t),o=S.sections[r];if(n||!A.current){H(r);return}if(0===i.length){if(""===o.value){H(r);return}let t=e.nativeEvent.inputType;if("insertParagraph"===t||"insertLineBreak"===t){H(r);return}y(),k();return}v({keyPressed:i,sectionIndex:r}),H(r)});(0,h.Z)(()=>{if(V&&A.current){if("all"===x)A.current.getRoot().focus();else if("number"==typeof x){let e=A.current.getSectionContent(x);e&&e.focus()}}},[x,V]);let Q=s.useMemo(()=>S.sections.reduce((e,t)=>(e[t.type]=R[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[R,S.sections]),ee="all"===x,et=s.useMemo(()=>S.sections.map((e,i)=>{let r=!ee&&!t&&!n;return{container:{"data-sectionindex":i,onClick:G(i)},content:{tabIndex:ee||i>0?-1:0,contentEditable:!ee&&!t&&!n,role:"spinbutton",id:`${F}-${e.type}`,"aria-labelledby":`${F}-${e.type}`,"aria-readonly":n,"aria-valuenow":(0,g.J9)(e,Z),"aria-valuemin":Q[e.type].minimum,"aria-valuemax":Q[e.type].maximum,"aria-valuetext":e.value?(0,g.dI)(e,Z):B.empty,"aria-label":B[e.type],"aria-disabled":t,spellCheck:!r&&void 0,autoCapitalize:r?"off":void 0,autoCorrect:r?"off":void 0,[parseInt(s.version,10)>=17?"enterKeyHint":"enterkeyhint"]:r?"next":void 0,children:e.value||e.placeholder,onInput:X,onPaste:Y,onFocus:K(i),onDragOver:J,onMouseUp:U,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[S.sections,K,Y,J,X,G,U,t,n,ee,B,Z,Q,F]),en=(0,d.Z)(e=>{T(e.target.value)}),ei=s.useMemo(()=>P?"":p.getV7HiddenInputValueFromSections(S.sections),[P,S.sections,p]);return s.useEffect(()=>{if(null==A.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");f&&A.current&&A.current.getSectionContent(D.startIndex).focus()},[]),{interactions:j,returnedValue:{autoFocus:f,readOnly:n,focused:c??V,sectionListRef:L,onBlur:q,onClick:z,onFocus:_,onInput:$,onPaste:W,enableAccessibleFieldDOMStructure:!0,elements:et,tabIndex:0===x?-1:0,contentEditable:ee,value:ei,onChange:en,areAllSectionsEmpty:P}}},B=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),Z=(e,t,n)=>{let i=0,o=+!!n,s=[];for(let l=0;l<e.length;l+=1){let a=e[l],u=(0,g.tg)(a,n?"input-rtl":"input-ltr",t),c=`${a.startSeparator}${u}${a.endSeparator}`,h=B(c).length,d=c.length,f=B(u),p=o+(""===f?0:u.indexOf(f[0]))+a.startSeparator.length,m=p+f.length;s.push((0,r.Z)({},a,{start:i,end:i+h,startInInput:p,endInInput:m})),i+=h,o+=d}return s},F=e=>{let t=(0,f.V)(),n=s.useRef(void 0),i=s.useRef(void 0),{forwardedProps:{onFocus:r,onClick:o,onPaste:l,onBlur:a,inputRef:u,placeholder:c},internalProps:{readOnly:h=!1,disabled:p=!1},parsedSelectedSections:m,activeSectionIndex:v,state:b,fieldValueManager:y,valueManager:w,applyCharacterEditing:x,resetCharacterQuery:S,updateSectionValue:k,updateValueFromValueStr:C,clearActiveSection:M,clearValue:T,setTempAndroidValueStr:D,setSelectedSections:P,getSectionsFromValue:R,areAllSectionsEmpty:A,localizedDigits:I}=e,L=s.useRef(null),F=(0,O.Z)(u,L),V=s.useMemo(()=>Z(b.sections,I,t),[b.sections,I,t]),N=s.useMemo(()=>({syncSelectionToDOM:()=>{if(!L.current)return;if(null==m){L.current.scrollLeft&&(L.current.scrollLeft=0);return}if(L.current!==(0,E.vY)(document))return;let e=L.current.scrollTop;if("all"===m)L.current.select();else{let e=V[m],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==L.current.selectionStart||n!==L.current.selectionEnd)&&L.current===(0,E.vY)(document)&&L.current.setSelectionRange(t,n),clearTimeout(i.current),i.current=setTimeout(()=>{L.current&&L.current===(0,E.vY)(document)&&L.current.selectionStart===L.current.selectionEnd&&(L.current.selectionStart!==t||L.current.selectionEnd!==n)&&N.syncSelectionToDOM()})}L.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=L.current.selectionStart??0,t=L.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=V[0].startInInput?1:V.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?V.length-1:n-1},focusField:(e=0)=>{(0,E.vY)(document)!==L.current&&(L.current?.focus(),P(e))},setSelectedSections:e=>P(e),isFieldFocused:()=>L.current===(0,E.vY)(document)}),[L,m,V,P]),j=()=>{let e;let t=L.current.selectionStart??0;P(-1===(e=t<=V[0].startInInput?1:t>=V[V.length-1].endInInput?1:V.findIndex(e=>e.startInInput-e.startSeparator.length>t))?V.length-1:e-1)},H=(0,d.Z)((...e)=>{r?.(...e);let t=L.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===L.current&&null==v&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?P("all"):j())})}),z=(0,d.Z)((e,...t)=>{!e.isDefaultPrevented()&&(o?.(e,...t),j())}),$=(0,d.Z)(e=>{if(l?.(e),e.preventDefault(),h||p)return;let t=e.clipboardData.getData("text");if("number"==typeof m){let e=b.sections[m],n=/^[a-zA-Z]+$/.test(t),i=/^[0-9]+$/.test(t),r=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&i||"digit-with-letter"===e.contentType&&r){S(),k({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||i)return}S(),C(t)}),W=(0,d.Z)((...e)=>{a?.(...e),P(null)}),_=(0,d.Z)(e=>{let n;if(h)return;let i=e.target.value;if(""===i){S(),T();return}let r=e.nativeEvent.data,o=r&&r.length>1,s=o?r:i,l=B(s);if("all"===m&&P(v),null==v||o){C(o?r:l);return}if("all"===m&&1===l.length)n=l;else{let e=B(y.getV6InputValueFromSections(V,I,t)),i=-1,r=-1;for(let t=0;t<e.length;t+=1)-1===i&&e[t]!==l[t]&&(i=t),-1===r&&e[e.length-t-1]!==l[l.length-t-1]&&(r=t);let o=V[v];if(i<o.start||e.length-r-1>o.end)return;let s=l.length-e.length+o.end-B(o.endSeparator||"").length;n=l.slice(o.start+B(o.startSeparator||"").length,s)}if(0===n.length){(0,g.Dt)()&&D(s),S(),M();return}x({keyPressed:n,sectionIndex:v})}),q=s.useMemo(()=>void 0!==c?c:y.getV6InputValueFromSections(R(w.emptyValue),I,t),[c,y,R,w.emptyValue,I,t]),G=s.useMemo(()=>b.tempValueStrAndroid??y.getV6InputValueFromSections(b.sections,I,t),[b.sections,y,b.tempValueStrAndroid,I,t]);s.useEffect(()=>(L.current&&L.current===(0,E.vY)(document)&&P("all"),()=>{clearTimeout(n.current),clearTimeout(i.current)}),[]);let U=s.useMemo(()=>null==v||"letter"===b.sections[v].contentType?"text":"numeric",[v,b.sections]);return{interactions:N,returnedValue:{readOnly:h,onBlur:W,onClick:z,onFocus:H,onPaste:$,inputRef:F,enableAccessibleFieldDOMStructure:!1,placeholder:q,inputMode:U,autoComplete:"off",value:!(L.current&&L.current===(0,E.vY)(document))&&A?"":G,onChange:_}}},V=e=>{let t=(0,m.nB)(),{internalProps:n,internalProps:{unstableFieldRef:i,minutesStep:o,enableAccessibleFieldDOMStructure:l=!1,disabled:a=!1,readOnly:u=!1},forwardedProps:{onKeyDown:c,error:v,clearable:b,onClear:y},fieldValueManager:w,valueManager:x,validator:S}=e,k=(0,f.V)(),C=P(e),{state:M,activeSectionIndex:T,parsedSelectedSections:D,setSelectedSections:R,clearValue:O,clearActiveSection:I,updateSectionValue:E,setTempAndroidValueStr:B,sectionsValueBoundaries:Z,localizedDigits:V,timezone:N}=C,j=A({sections:M.sections,updateSectionValue:E,sectionsValueBoundaries:Z,localizedDigits:V,setTempAndroidValueStr:B,timezone:N}),{resetCharacterQuery:H}=j,z=x.areValuesEqual(t,M.value,x.emptyValue),$=l?L:F,W=s.useMemo(()=>(0,g.N2)(M.sections,k&&!l),[M.sections,k,l]),{returnedValue:_,interactions:q}=$((0,r.Z)({},e,C,j,{areAllSectionsEmpty:z,sectionOrder:W})),G=(0,d.Z)(e=>{if(c?.(e),!a)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),R("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==D)R(W.startIndex);else if("all"===D)R(W.endIndex);else{let e=W.neighbors[D].rightIndex;null!==e&&R(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==D)R(W.endIndex);else if("all"===D)R(W.startIndex);else{let e=W.neighbors[D].leftIndex;null!==e&&R(e)}break;case"Delete"===e.key:if(e.preventDefault(),u)break;null==D||"all"===D?O():I(),H();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),u||null==T)break;"all"===D&&R(T);let n=M.sections[T],i=w.getActiveDateManager(t,M,n),r=(0,g.o$)(t,N,n,e.key,Z,V,i.date,{minutesStep:o});E({activeSection:n,newSectionValue:r,shouldGoToNextSection:!1})}}});(0,h.Z)(()=>{q.syncSelectionToDOM()});let{hasValidationError:U}=(0,p.V)({props:n,validator:S,timezone:N,value:M.value,onError:n.onError}),K=s.useMemo(()=>void 0!==v?v:U,[U,v]);s.useEffect(()=>{K||null!=T||H()},[M.referenceValue,T,K]),s.useEffect(()=>{null!=M.tempValueStrAndroid&&null!=T&&(H(),I())},[M.sections]),s.useImperativeHandle(i,()=>({getSections:()=>M.sections,getActiveSectionIndex:q.getActiveSectionIndexFromDOM,setSelectedSections:q.setSelectedSections,focusField:q.focusField,isFieldFocused:q.isFieldFocused}));let Y={onKeyDown:G,onClear:(0,d.Z)((e,...t)=>{e.preventDefault(),y?.(e,...t),O(),q.isFieldFocused()?R(W.startIndex):q.focusField(0)}),error:K,clearable:!!(b&&!z&&!u&&!a)};return(0,r.Z)({},e.forwardedProps,Y,{disabled:a,readOnly:u},_)};var N=n(60191);let j=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],H=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],z=["minDateTime","maxDateTime"];[...j,...H,...z];let $=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],W=(e,t)=>s.useMemo(()=>{let n=(0,r.Z)({},e),i={},o=e=>{n.hasOwnProperty(e)&&(i[e]=n[e],delete n[e])};return $.forEach(o),"date"===t?j.forEach(o):"time"===t?H.forEach(o):"date-time"===t&&(j.forEach(o),H.forEach(o),z.forEach(o)),{forwardedProps:n,internalProps:i}},[e,t]);var _=n(39399);let q=e=>{let t=(0,m.nB)(),n=(0,m.PP)(),i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h;return(0,r.Z)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:(0,_.US)(t,e.minDateTime??e.minDate,n.minDate),maxDate:(0,_.US)(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime})},G=e=>{let{forwardedProps:t,internalProps:n}=W(q(e),"date-time");return V({forwardedProps:t,internalProps:n,valueManager:c.h,fieldValueManager:c.a,validator:N.P,valueType:"date-time"})};var U=n(75094),K=n(90496),Y=n(82267),J=n(51640),X=n(52054),Q=n(29992),ee=n(36683),et=n(12709),en=n(82319),ei=n(51751),er=n(44124),eo=n(6749);function es(e){return(0,eo.ZP)("MuiInputAdornment",e)}let el=(0,er.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var ea=n(24246);let eu=e=>{let{classes:t,disablePointerEvents:n,hiddenLabel:i,position:r,size:o,variant:s}=e,l={root:["root",n&&"disablePointerEvents",r&&`position${(0,J.Z)(r)}`,s,i&&"hiddenLabel",o&&`size${(0,J.Z)(o)}`]};return(0,Y.Z)(l,es,t)},ec=(0,et.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`position${(0,J.Z)(n.position)}`],!0===n.disablePointerEvents&&t.disablePointerEvents,t[n.variant]]}})((0,en.Z)(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${el.positionStart}&:not(.${el.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),eh=s.forwardRef(function(e,t){let n=(0,ei.i)({props:e,name:"MuiInputAdornment"}),{children:r,className:o,component:l="div",disablePointerEvents:a=!1,disableTypography:u=!1,position:c,variant:h,...d}=n,f=(0,ee.Z)()||{},p=h;h&&f.variant,f&&!p&&(p=f.variant);let m={...n,hiddenLabel:f.hiddenLabel,size:f.size,disablePointerEvents:a,position:c,variant:p},g=eu(m);return(0,ea.jsx)(Q.Z.Provider,{value:null,children:(0,ea.jsx)(ec,{as:l,ownerState:m,className:(0,K.Z)(g.root,o),ref:t,...d,children:"string"!=typeof r||u?(0,ea.jsxs)(s.Fragment,{children:["start"===c?i||(i=(0,ea.jsx)("span",{className:"notranslate","aria-hidden":!0,children:""})):null,r]}):(0,ea.jsx)(X.Z,{color:"textSecondary",children:r})})})});var ed=n(63640);let ef=["clearable","onClear","InputProps","sx","slots","slotProps"],ep=["ownerState"],em=e=>{let t=(0,b.M)(),{clearable:n,onClear:i,InputProps:l,sx:a,slots:c,slotProps:h}=e,d=(0,o.Z)(e,ef),f=c?.clearButton??U.Z,p=(0,u.Z)({elementType:f,externalSlotProps:h?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),m=(0,o.Z)(p,ep),g=c?.clearIcon??ed.Rk,v=(0,u.Z)({elementType:g,externalSlotProps:h?.clearIcon,ownerState:{}});return(0,r.Z)({},d,{InputProps:(0,r.Z)({},l,{endAdornment:(0,ea.jsxs)(s.Fragment,{children:[n&&(0,ea.jsx)(eh,{position:"end",sx:{marginRight:l?.endAdornment?-1:-1.5},children:(0,ea.jsx)(f,(0,r.Z)({},m,{onClick:i,children:(0,ea.jsx)(g,(0,r.Z)({fontSize:"small"},v))}))}),l?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(a)?a:[a]]})};var eg=n(68808),ev=n(32931),eb=n(90192);function ey(e){return(0,eo.ZP)("MuiPickersTextField",e)}function ew(e){return(0,eo.ZP)("MuiPickersInputBase",e)}(0,er.Z)("MuiPickersTextField",["root","focused","disabled","error","required"]);let ex=(0,er.Z)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function eS(e){return(0,eo.ZP)("MuiPickersOutlinedInput",e)}let ek=(0,r.Z)({},ex,(0,er.Z)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),eC=["children","className","label","notched","shrink"],eM=(0,et.ZP)("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}}),eT=(0,et.ZP)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),eD=(0,et.ZP)("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 eP(e){let{className:t,label:n}=e,i=(0,o.Z)(e,eC),s=null!=n&&""!==n,l=(0,r.Z)({},e,{withLabel:s});return(0,ea.jsx)(eM,(0,r.Z)({"aria-hidden":!0,className:t},i,{ownerState:l,children:(0,ea.jsx)(eD,{ownerState:l,children:s?(0,ea.jsx)(eT,{children:n}):(0,ea.jsx)(eT,{className:"notranslate",children:""})})}))}var eR=n(3150);function eA(e){return(0,eo.ZP)("MuiPickersSectionList",e)}let eO=(0,er.Z)("MuiPickersSectionList",["root","section","sectionContent"]),eI=["slots","slotProps","elements","sectionListRef"],eE=(0,et.ZP)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),eL=(0,et.ZP)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),eB=(0,et.ZP)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),eZ=(0,et.ZP)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),eF=e=>{let{classes:t}=e;return(0,Y.Z)({root:["root"],section:["section"],sectionContent:["sectionContent"]},eA,t)};function eV(e){let{slots:t,slotProps:n,element:i,classes:o}=e,s=t?.section??eL,l=(0,u.Z)({elementType:s,externalSlotProps:n?.section,externalForwardedProps:i.container,className:o.section,ownerState:{}}),a=t?.sectionContent??eZ,c=(0,u.Z)({elementType:a,externalSlotProps:n?.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),h=t?.sectionSeparator??eB,d=(0,u.Z)({elementType:h,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),f=(0,u.Z)({elementType:h,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return(0,ea.jsxs)(s,(0,r.Z)({},l,{children:[(0,ea.jsx)(h,(0,r.Z)({},d)),(0,ea.jsx)(a,(0,r.Z)({},c)),(0,ea.jsx)(h,(0,r.Z)({},f))]}))}let eN=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:l,elements:c,sectionListRef:h}=n,d=(0,o.Z)(n,eI),f=eF(n),p=s.useRef(null),m=(0,O.Z)(t,p),g=e=>{if(!p.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return p.current};s.useImperativeHandle(h,()=>({getRoot:()=>g("getRoot"),getSectionContainer:e=>g("getSectionContainer").querySelector(`.${eO.section}[data-sectionindex="${e}"]`),getSectionContent:e=>g("getSectionContent").querySelector(`.${eO.section}[data-sectionindex="${e}"] .${eO.sectionContent}`),getSectionIndexFromDOMElement(e){let t=g("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(eO.section)?n=e:e.classList.contains(eO.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let v=i?.root??eE,b=(0,u.Z)({elementType:v,externalSlotProps:l?.root,externalForwardedProps:d,additionalProps:{ref:m,suppressContentEditableWarning:!0},className:f.root,ownerState:{}});return(0,ea.jsx)(v,(0,r.Z)({},b,{children:b.contentEditable?c.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,ea.jsx)(s.Fragment,{children:c.map((e,t)=>(0,ea.jsx)(eV,{slots:i,slotProps:l,element:e,classes:f},t))})}))}),ej=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],eH=e=>Math.round(1e5*e)/1e5,ez=(0,et.ZP)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,r.Z)({},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:`${eH(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),e$=(0,et.ZP)(eE,{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:i})=>!e&&!t&&!n&&null==i,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),eW=(0,et.ZP)(eL,{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"})),e_=(0,et.ZP)(eZ,{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"})),eq=(0,et.ZP)(eB,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),eG=(0,et.ZP)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,r.Z)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),eU=e=>{let{focused:t,disabled:n,error:i,classes:r,fullWidth:o,readOnly:s,color:l,size:a,endAdornment:u,startAdornment:c}=e,h={root:["root",t&&!n&&"focused",n&&"disabled",s&&"readOnly",i&&"error",o&&"fullWidth",`color${(0,eR.Z)(l)}`,"small"===a&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,Y.Z)(h,ew,r)},eK=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:l,value:c,onChange:h,id:d,endAdornment:p,startAdornment:m,renderSuffix:g,slots:v,slotProps:b,contentEditable:y,tabIndex:w,onInput:x,onPaste:S,onKeyDown:k,name:C,readOnly:M,inputProps:T,inputRef:D,sectionListRef:P}=n,R=(0,o.Z)(n,ej),A=s.useRef(null),I=(0,O.Z)(t,A),E=(0,O.Z)(T?.ref,D),L=(0,f.V)(),B=(0,ee.Z)();if(!B)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");s.useEffect(()=>{B&&B.setAdornedStart(!!m)},[B,m]),s.useEffect(()=>{B&&(l?B.onEmpty():B.onFilled())},[B,l]);let Z=(0,r.Z)({},n,B,{isRtl:L}),F=eU(Z),V=v?.root||ez,N=(0,u.Z)({elementType:V,externalSlotProps:b?.root,externalForwardedProps:R,additionalProps:{"aria-invalid":B.error,ref:I},className:F.root,ownerState:Z}),j=v?.input||e$;return(0,ea.jsxs)(V,(0,r.Z)({},N,{children:[m,(0,ea.jsx)(eN,{sectionListRef:P,elements:i,contentEditable:y,tabIndex:w,className:F.sectionsContainer,onFocus:e=>{if(B.disabled){e.stopPropagation();return}B.onFocus?.(e)},onBlur:B.onBlur,onInput:x,onPaste:S,onKeyDown:k,slots:{root:j,section:eW,sectionContent:e_,sectionSeparator:eq},slotProps:{root:{ownerState:Z},sectionContent:{className:ex.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?ex.sectionBefore:ex.sectionAfter})}}),p,g?g((0,r.Z)({},B)):null,(0,ea.jsx)(eG,(0,r.Z)({name:C,className:F.input,value:c,onChange:h,id:d,"aria-hidden":"true",tabIndex:-1,readOnly:M,required:B.required,disabled:B.disabled},T,{ref:E}))]}))}),eY=["label","autoFocus","ownerState","notched"],eJ=(0,et.ZP)(ez,{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 .${ek.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ek.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ek.focused} .${ek.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${ek.disabled}`]:{[`& .${ek.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${ek.error} .${ek.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:{[`&.${ek.focused}:not(.${ek.error}) .${ek.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),eX=(0,et.ZP)(e$,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),eQ=e=>{let{classes:t}=e,n=(0,Y.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},eS,t);return(0,r.Z)({},t,n)},e0=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:l,notched:u}=n,c=(0,o.Z)(n,eY),h=(0,ee.Z)(),d=(0,r.Z)({},n,l,h,{color:h?.color||"primary"}),f=eQ(d);return(0,ea.jsx)(eK,(0,r.Z)({slots:{root:eJ,input:eX},renderSuffix:e=>(0,ea.jsx)(eP,{shrink:!!(u||e.adornedStart||e.focused||e.filled),notched:!!(u||e.adornedStart||e.focused||e.filled),className:f.notchedOutline,label:null!=i&&""!==i&&h?.required?(0,ea.jsxs)(s.Fragment,{children:[i," ","*"]}):i,ownerState:d})},c,{label:i,classes:f,ref:t}))});e0.muiName="Input";var e1=n(35315);function e2(e){return(0,eo.ZP)("MuiPickersFilledInput",e)}let e5=(0,r.Z)({},ex,(0,er.Z)("MuiPickersFilledInput",["root","underline","input"])),e3=["label","autoFocus","disableUnderline","ownerState"],e4=(0,et.ZP)(ez,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,e1.x9)(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}},[`&.${e5.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${e5.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"},[`&.${e5.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${e5.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(.${e5.disabled}, .${e5.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${e5.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),e8=(0,et.ZP)(e$,{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}}]}),e9=e=>{let{classes:t,disableUnderline:n}=e,i=(0,Y.Z)({root:["root",!n&&"underline"],input:["input"]},e2,t);return(0,r.Z)({},t,i)},e6=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:s=!1,ownerState:l}=n,u=(0,o.Z)(n,e3),c=(0,ee.Z)(),h=e9((0,r.Z)({},n,l,c,{color:c?.color||"primary"}));return(0,ea.jsx)(eK,(0,r.Z)({slots:{root:e4,input:e8},slotProps:{root:{disableUnderline:s}}},u,{label:i,classes:h,ref:t}))});function e7(e){return(0,eo.ZP)("MuiPickersFilledInput",e)}e6.muiName="Input";let te=(0,r.Z)({},ex,(0,er.Z)("MuiPickersInput",["root","input"])),tt=["label","autoFocus","disableUnderline","ownerState"],tn=(0,et.ZP)(ez,{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"},[`&.${te.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${te.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(.${te.disabled}, .${te.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${te.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),ti=e=>{let{classes:t,disableUnderline:n}=e,i=(0,Y.Z)({root:["root",!n&&"underline"],input:["input"]},e7,t);return(0,r.Z)({},t,i)},tr=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:s=!1,ownerState:l}=n,u=(0,o.Z)(n,tt),c=(0,ee.Z)(),h=ti((0,r.Z)({},n,l,c,{disableUnderline:s,color:c?.color||"primary"}));return(0,ea.jsx)(eK,(0,r.Z)({slots:{root:tn}},u,{label:i,classes:h,ref:t}))});tr.muiName="Input";let to=["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"],ts={standard:tr,filled:e6,outlined:e0},tl=(0,et.ZP)(eb.Z,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ta=e=>{let{focused:t,disabled:n,classes:i,required:r}=e;return(0,Y.Z)({root:["root",t&&!n&&"focused",n&&"disabled",r&&"required"]},ey,i)},tu=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:l,className:u,color:c="primary",disabled:h=!1,error:d=!1,variant:f="outlined",required:p=!1,InputProps:m,inputProps:g,inputRef:v,sectionListRef:b,elements:y,areAllSectionsEmpty:w,onClick:x,onKeyDown:S,onKeyUp:k,onPaste:C,onInput:M,endAdornment:T,startAdornment:D,tabIndex:P,contentEditable:R,focused:A,value:E,onChange:L,fullWidth:B,id:Z,name:F,helperText:V,FormHelperTextProps:N,label:j,InputLabelProps:H}=n,z=(0,o.Z)(n,to),$=s.useRef(null),W=(0,O.Z)(t,$),_=(0,I.Z)(Z),q=V&&_?`${_}-helper-text`:void 0,G=j&&_?`${_}-label`:void 0,U=(0,r.Z)({},n,{color:c,disabled:h,error:d,focused:A,required:p,variant:f}),Y=ta(U),J=ts[f];return(0,ea.jsxs)(tl,(0,r.Z)({className:(0,K.Z)(Y.root,u),ref:W,focused:A,onFocus:i,onBlur:l,disabled:h,variant:f,error:d,color:c,fullWidth:B,required:p,ownerState:U},z,{children:[(0,ea.jsx)(eg.Z,(0,r.Z)({htmlFor:_,id:G},H,{children:j})),(0,ea.jsx)(J,(0,r.Z)({elements:y,areAllSectionsEmpty:w,onClick:x,onKeyDown:S,onKeyUp:k,onInput:M,onPaste:C,endAdornment:T,startAdornment:D,tabIndex:P,contentEditable:R,value:E,onChange:L,id:_,fullWidth:B,inputProps:g,inputRef:v,sectionListRef:b,label:j,name:F,role:"group","aria-labelledby":G,"aria-describedby":q,"aria-live":q?"polite":void 0},m)),V&&(0,ea.jsx)(ev.Z,(0,r.Z)({id:q},N,{children:V}))]}))}),tc=["enableAccessibleFieldDOMStructure"],th=["InputProps","readOnly"],td=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],tf=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,o.Z)(e,tc);if(t){let{InputProps:e,readOnly:t}=n,i=(0,o.Z)(n,th);return(0,r.Z)({},i,{InputProps:(0,r.Z)({},e??{},{readOnly:t})})}let{onPaste:i,onKeyDown:s,inputMode:l,readOnly:a,InputProps:u,inputProps:c,inputRef:h}=n,d=(0,o.Z)(n,td);return(0,r.Z)({},d,{InputProps:(0,r.Z)({},u??{},{readOnly:a}),inputProps:(0,r.Z)({},c??{},{inputMode:l,onPaste:i,onKeyDown:s,ref:h})})},tp=["slots","slotProps","InputProps","inputProps"],tm=s.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:s,InputProps:c,inputProps:h}=n,d=(0,o.Z)(n,tp),f=i?.textField??(e.enableAccessibleFieldDOMStructure?tu:l.Z),p=(0,u.Z)({elementType:f,externalSlotProps:s?.textField,externalForwardedProps:d,ownerState:n,additionalProps:{ref:t}});p.inputProps=(0,r.Z)({},h,p.inputProps),p.InputProps=(0,r.Z)({},c,p.InputProps);let m=tf(G(p)),g=em((0,r.Z)({},m,{slots:i,slotProps:s}));return(0,ea.jsx)(f,(0,r.Z)({},g))})},53578:function(e,t,n){"use strict";n.d(t,{_:()=>c,y:()=>u});var i=n(70252),r=n(97784),o=n(54538),s=n(68014),l=n(24246);let a=["localeText"],u=o.createContext(null),c=function(e){let{localeText:t}=e,n=(0,r.Z)(e,a),{utils:c,localeText:h}=o.useContext(u)??{utils:void 0,localeText:void 0},{children:d,dateAdapter:f,dateFormats:p,dateLibInstance:m,adapterLocale:g,localeText:v}=(0,s.Z)({props:n,name:"MuiLocalizationProvider"}),b=o.useMemo(()=>(0,i.Z)({},v,h,t),[v,h,t]),y=o.useMemo(()=>{if(!f)return c||null;let e=new f({locale:g,formats:p,instance:m});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(`
|
|
3
|
-
`));return e},[f,g,p,m,c]),w=o.useMemo(()=>y?{minDate:y.date("1900-01-01T00:00:00.000"),maxDate:y.date("2099-12-31T00:00:00.000")}:null,[y]),x=o.useMemo(()=>({utils:y,defaultDates:w,localeText:b}),[w,y,b]);return(0,l.jsx)(u.Provider,{value:x,children:d})}},52583:function(e,t,n){"use strict";n.d(t,{S:()=>iE});var i=n(70252),r=n(54538),o=n.n(r),s=n(23615),l=n.n(s),a=n(68014),u=n(33835),c=n(39399),h=n(90496),d=n(49408),f=n(51781),p=n(16052),m=n(12709),g=n(82267),v=n(63640),b=n(25839),y=n(6749),w=n(44124);function x(e){return(0,y.ZP)("MuiDateTimePickerTabs",e)}(0,w.Z)("MuiDateTimePickerTabs",["root"]);var S=n(24246);let k=e=>(0,c.Fb)(e)?"date":"time",C=e=>"date"===e?"day":"hours",M=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"]},x,t)},T=(0,m.ZP)(f.Z,{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}`,[`& .${p.Z.indicator}`]:{bottom:"auto",top:0}}})),D=function(e){let t=(0,a.Z)({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,S.jsx)(v.x,{}),onViewChange:i,timeIcon:o=(0,S.jsx)(v.wZ,{}),view:s,hidden:l="undefined"==typeof window||window.innerHeight<667,className:u,sx:c}=t,f=(0,b.M)(),p=M(t);return l?null:(0,S.jsxs)(T,{ownerState:t,variant:"fullWidth",value:k(s),onChange:(e,t)=>{i(C(t))},className:(0,h.Z)(u,p.root),sx:c,children:[(0,S.jsx)(d.Z,{value:"date","aria-label":f.dateTableLabel,icon:(0,S.jsx)(r.Fragment,{children:n})}),(0,S.jsx)(d.Z,{value:"time","aria-label":f.timeTableLabel,icon:(0,S.jsx)(r.Fragment,{children:o})})]})};var P=n(97784),R=n(6595),A=n(52054);function O(e){return(0,y.ZP)("MuiPickersToolbarText",e)}let I=(0,w.Z)("MuiPickersToolbarText",["root","selected"]),E=["className","selected","value"],L=e=>{let{classes:t,selected:n}=e;return(0,g.Z)({root:["root",n&&"selected"]},O,t)},B=(0,m.ZP)(A.Z,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${I.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${I.selected}`]:{color:(e.vars||e).palette.text.primary}})),Z=r.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersToolbarText"}),{className:r,value:o}=n,s=(0,P.Z)(n,E),l=L(n);return(0,S.jsx)(B,(0,i.Z)({ref:t,className:(0,h.Z)(l.root,r),component:"span"},s,{children:o}))});function F(e){return(0,y.ZP)("MuiPickersToolbar",e)}let V=(0,w.Z)("MuiPickersToolbar",["root","content"]),N=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],j=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],content:["content"]},F,t)},H=(0,m.ZP)("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"}}]})),z=(0,m.ZP)("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"}}]}),$=r.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersToolbar"}),{children:r,className:o,toolbarTitle:s,hidden:l,titleId:u}=n,c=(0,P.Z)(n,N),d=j(n);return l?null:(0,S.jsxs)(H,(0,i.Z)({ref:t,className:(0,h.Z)(d.root,o),ownerState:n},c,{children:[(0,S.jsx)(A.Z,{color:"text.secondary",variant:"overline",id:u,children:s}),(0,S.jsx)(z,{className:d.content,ownerState:n,children:r})]}))});var W=n(48565);let _=["align","className","selected","typographyClassName","value","variant","width"],q=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"]},F,t)},G=(0,m.ZP)(W.Z,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),U=r.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersToolbarButton"}),{align:r,className:o,selected:s,typographyClassName:l,value:u,variant:c,width:d}=n,f=(0,P.Z)(n,_),p=q(n);return(0,S.jsx)(G,(0,i.Z)({variant:"text",ref:t,className:(0,h.Z)(p.root,o)},d?{sx:{width:d}}:{},f,{children:(0,S.jsx)(Z,{align:r,className:l,variant:c,value:u,selected:s})}))});function K(e){return(0,y.ZP)("MuiDateTimePickerToolbar",e)}let Y=(0,w.Z)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);var J=n(35211);function X(e,t,n,i){let o=(0,u.nB)();return{meridiemMode:(0,J.xX)(e,o),handleMeridiemChange:r.useCallback(r=>{n(null==e?null:(0,J.wp)(e,r,!!t,o),i??"partial")},[t,e,n,i,o])}}let Q=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],ee=e=>{let{classes:t,isLandscape:n,isRtl:i}=e;return(0,g.Z)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",i&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",i&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},K,t)},et=(0,m.ZP)($,{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}`,[`& .${V.content} .${I.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}}]})),en=(0,m.ZP)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),ei=(0,m.ZP)("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"}}]}),er=(0,m.ZP)("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}}]}),eo=(0,m.ZP)(Z,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),es=(0,m.ZP)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${Y.ampmLabel}`]:t.ampmLabel},{[`&.${Y.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Y.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function el(e){let t=(0,a.Z)({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:o,value:s,onChange:l,view:d,isLandscape:f,onViewChange:p,toolbarFormat:m,toolbarPlaceholder:g="––",views:v,disabled:y,readOnly:w,toolbarVariant:x="mobile",toolbarTitle:k,className:C}=t,M=(0,P.Z)(t,Q),T=(0,R.V)(),D=(0,i.Z)({},t,{isRtl:T}),A=(0,u.nB)(),{meridiemMode:O,handleMeridiemChange:I}=X(s,n,l),E=!!(n&&!o),L="desktop"===x,B=(0,b.M)(),Z=ee(D),F=k??B.dateTimePickerToolbarTitle,V=r.useMemo(()=>s?m?A.formatByString(s,m):A.format(s,"shortDate"):g,[s,m,g,A]);return(0,S.jsxs)(et,(0,i.Z)({isLandscape:f,className:(0,h.Z)(Z.root,C),toolbarTitle:F},M,{ownerState:D,children:[(0,S.jsxs)(en,{className:Z.dateContainer,ownerState:D,children:[v.includes("year")&&(0,S.jsx)(U,{tabIndex:-1,variant:"subtitle1",onClick:()=>p("year"),selected:"year"===d,value:s?A.format(s,"year"):"–"}),v.includes("day")&&(0,S.jsx)(U,{tabIndex:-1,variant:L?"h5":"h4",onClick:()=>p("day"),selected:"day"===d,value:V})]}),(0,S.jsxs)(ei,{className:Z.timeContainer,ownerState:D,children:[(0,S.jsxs)(er,{className:Z.timeDigitsContainer,ownerState:D,children:[v.includes("hours")&&(0,S.jsxs)(r.Fragment,{children:[(0,S.jsx)(U,{variant:L?"h5":"h3",width:L&&!f?48:void 0,onClick:()=>p("hours"),selected:"hours"===d,value:s?n?A.format(s,"hours12h"):A.format(s,"hours24h"):"--"}),(0,S.jsx)(eo,{variant:L?"h5":"h3",value:":",className:Z.separator,ownerState:D}),(0,S.jsx)(U,{variant:L?"h5":"h3",width:L&&!f?48:void 0,onClick:()=>p("minutes"),selected:"minutes"===d||!v.includes("minutes")&&"hours"===d,value:s?A.format(s,"minutes"):"--",disabled:!v.includes("minutes")})]}),v.includes("seconds")&&(0,S.jsxs)(r.Fragment,{children:[(0,S.jsx)(eo,{variant:L?"h5":"h3",value:":",className:Z.separator,ownerState:D}),(0,S.jsx)(U,{variant:L?"h5":"h3",width:L&&!f?48:void 0,onClick:()=>p("seconds"),selected:"seconds"===d,value:s?A.format(s,"seconds"):"--"})]})]}),E&&!L&&(0,S.jsxs)(es,{className:Z.ampmSelection,ownerState:D,children:[(0,S.jsx)(U,{variant:"subtitle2",selected:"am"===O,typographyClassName:Z.ampmLabel,value:(0,c.lu)(A,"am"),onClick:w?void 0:()=>I("am"),disabled:y}),(0,S.jsx)(U,{variant:"subtitle2",selected:"pm"===O,typographyClassName:Z.ampmLabel,value:(0,c.lu)(A,"pm"),onClick:w?void 0:()=>I("pm"),disabled:y})]}),n&&L&&(0,S.jsx)(U,{variant:"h5",onClick:()=>p("meridiem"),selected:"meridiem"===d,value:s&&O?(0,c.lu)(A,O):"--",width:48})]})]}))}let ea=({openTo:e,defaultOpenTo:t,views:n,defaultViews:i})=>{let r;let o=n??i;if(null!=e)r=e;else if(o.includes(t))r=t;else if(o.length>0)r=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:r}};var eu=n(5056),ec=n(25399),eh=n(75094);function ed(e){return(0,y.ZP)("MuiPickersArrowSwitcher",e)}(0,w.Z)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let ef=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],ep=["ownerState"],em=["ownerState"],eg=(0,m.ZP)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),ev=(0,m.ZP)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),eb=(0,m.ZP)(eh.Z,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),ey=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},ed,t)},ew=r.forwardRef(function(e,t){let n=(0,R.V)(),r=(0,a.Z)({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:l,slotProps:u,isNextDisabled:c,isNextHidden:d,onGoToNext:f,nextLabel:p,isPreviousDisabled:m,isPreviousHidden:g,onGoToPrevious:b,previousLabel:y,labelId:w}=r,x=(0,P.Z)(r,ef),k=ey(r),C=l?.previousIconButton??eb,M=(0,ec.Z)({elementType:C,externalSlotProps:u?.previousIconButton,additionalProps:{size:"medium",title:y,"aria-label":y,disabled:m,edge:"end",onClick:b},ownerState:(0,i.Z)({},r,{hidden:g}),className:(0,h.Z)(k.button,k.previousIconButton)}),T=l?.nextIconButton??eb,D=(0,ec.Z)({elementType:T,externalSlotProps:u?.nextIconButton,additionalProps:{size:"medium",title:p,"aria-label":p,disabled:c,edge:"start",onClick:f},ownerState:(0,i.Z)({},r,{hidden:d}),className:(0,h.Z)(k.button,k.nextIconButton)}),O=l?.leftArrowIcon??v.Y4,I=(0,ec.Z)({elementType:O,externalSlotProps:u?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:k.leftArrowIcon}),E=(0,P.Z)(I,ep),L=l?.rightArrowIcon??v.LZ,B=(0,ec.Z)({elementType:L,externalSlotProps:u?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:r,className:k.rightArrowIcon}),Z=(0,P.Z)(B,em);return(0,S.jsxs)(eg,(0,i.Z)({ref:t,className:(0,h.Z)(k.root,s),ownerState:r},x,{children:[(0,S.jsx)(C,(0,i.Z)({},M,{children:n?(0,S.jsx)(L,(0,i.Z)({},Z)):(0,S.jsx)(O,(0,i.Z)({},E))})),o?(0,S.jsx)(A.Z,{variant:"subtitle1",component:"span",id:w,children:o}):(0,S.jsx)(ev,{className:k.spacer,ownerState:r}),(0,S.jsx)(T,(0,i.Z)({},D,{children:n?(0,S.jsx)(O,(0,i.Z)({},E)):(0,S.jsx)(L,(0,i.Z)({},Z))}))]}))});var ex=n(81925),eS=n(9831);function ek({onChange:e,onViewChange:t,openTo:n,view:i,views:o,autoFocus:s,focusedView:l,onFocusedViewChange:a}){let u=r.useRef(n),c=r.useRef(o),h=r.useRef(o.includes(n)?n:o[0]),[d,f]=(0,eS.Z)({name:"useViews",state:"view",controlled:i,default:h.current}),p=r.useRef(s?d:null),[m,g]=(0,eS.Z)({name:"useViews",state:"focusedView",controlled:l,default:p.current});r.useEffect(()=>{(u.current&&u.current!==n||c.current&&c.current.some(e=>!o.includes(e)))&&(f(o.includes(n)?n:o[0]),c.current=o,u.current=n)},[n,f,d,o]);let v=o.indexOf(d),b=o[v-1]??null,y=o[v+1]??null,w=(0,ex.Z)((e,t)=>{t?g(e):g(t=>e===t?null:t),a?.(e,t)}),x=(0,ex.Z)(e=>{w(e,!0),e!==d&&(f(e),t&&t(e))}),S=(0,ex.Z)(()=>{y&&x(y)}),k=(0,ex.Z)((t,n,i)=>{let r="finish"===n,s=i?o.indexOf(i)<o.length-1:!!y;if(e(t,r&&s?"partial":n,i),i&&i!==d){let e=o[o.indexOf(i)+1];e&&x(e)}else r&&S()});return{view:d,setView:x,focusedView:m,setFocusedView:w,nextView:y,previousView:b,defaultView:o.includes(n)?n:o[0],goToNextView:S,setValueAndGoToNextView:k}}let eC=(0,m.ZP)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function eM(e){return(0,y.ZP)("MuiTimeClock",e)}(0,w.Z)("MuiTimeClock",["root","arrowSwitcher"]);var eT=n(96858);let eD=110,eP=110,eR=eD,eA=0,eO=eR-eD,eI=eA-eP,eE=e=>180/Math.PI*e,eL=(e,t,n)=>{let i=t-eD,r=n-eP,o=eE(Math.atan2(eO,eI)-Math.atan2(i,r));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(i**2+r**2)}},eB=(e,t,n=1)=>{let{value:i}=eL(6*n,e,t);return i*n%60},eZ=(e,t,n)=>{let{value:i,distance:r}=eL(30,e,t),o=i||12;return n?o%=12:r<74&&(o+=12,o%=24),o};function eF(e){return(0,y.ZP)("MuiClockPointer",e)}(0,w.Z)("MuiClockPointer",["root","thumb"]);let eV=["className","hasSelected","isInner","type","viewValue"],eN=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],thumb:["thumb"]},eF,t)},ej=(0,m.ZP)("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"])}}]})),eH=(0,m.ZP)("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 ez(e){let t;let n=(0,a.Z)({props:e,name:"MuiClockPointer"}),{className:o,isInner:s,type:l,viewValue:u}=n,c=(0,P.Z)(n,eV),d=r.useRef(l);r.useEffect(()=>{d.current=l},[l]);let f=(0,i.Z)({},n,{shouldAnimate:d.current!==l}),p=eN(f);return(0,S.jsx)(ej,(0,i.Z)({style:(t=360/("hours"===l?12:60)*u,"hours"===l&&u>12&&(t-=360),{height:Math.round((s?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,h.Z)(p.root,o),ownerState:f},c,{children:(0,S.jsx)(eH,{ownerState:f,className:p.thumb})}))}function e$(e){return(0,y.ZP)("MuiClock",e)}(0,w.Z)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let eW=e=>{let{classes:t,meridiemMode:n}=e;return(0,g.Z)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},e$,t)},e_=(0,m.ZP)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),eq=(0,m.ZP)("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"}),eG=(0,m.ZP)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),eU=(0,m.ZP)("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"}}}]}),eK=(0,m.ZP)("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%)"})),eY=(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}}}]}),eJ=(0,m.ZP)(eh.Z,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,i.Z)({},eY(e,"am"),{position:"absolute",left:8})),eX=(0,m.ZP)(eh.Z,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,i.Z)({},eY(e,"pm"),{position:"absolute",right:8})),eQ=(0,m.ZP)(A.Z,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function e0(e){let t=(0,a.Z)({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:i,autoFocus:o,children:s,value:l,handleMeridiemChange:d,isTimeDisabled:f,meridiemMode:p,minutesStep:m=1,onChange:g,selectedId:v,type:y,viewValue:w,viewRange:[x,k],disabled:C=!1,readOnly:M,className:T}=t,D=(0,u.nB)(),P=(0,b.M)(),R=r.useRef(!1),A=eW(t),O=f(w,y),I=!n&&"hours"===y&&(w<1||w>12),E=(e,t)=>{!(C||M||f(e,y))&&g(e,t)},L=(e,t)=>{let{offsetX:i,offsetY:r}=e;if(void 0===i){let t=e.target.getBoundingClientRect();i=e.changedTouches[0].clientX-t.left,r=e.changedTouches[0].clientY-t.top}E("seconds"===y||"minutes"===y?eB(i,r,m):eZ(i,r,!!n),t)},B=e=>{R.current=!0,L(e,"shallow")},Z=r.useMemo(()=>"hours"===y||w%5==0,[y,w]),F="minutes"===y?m:1,V=r.useRef(null);(0,eT.Z)(()=>{o&&V.current.focus()},[o]);let N=e=>Math.max(x,Math.min(k,e)),j=e=>(e+(k+1))%(k+1);return(0,S.jsxs)(e_,{className:(0,h.Z)(A.root,T),children:[(0,S.jsxs)(eq,{className:A.clock,children:[(0,S.jsx)(eU,{onTouchMove:B,onTouchStart:B,onTouchEnd:e=>{R.current&&(L(e,"finish"),R.current=!1),e.preventDefault()},onMouseUp:e=>{R.current&&(R.current=!1),L(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&L(e.nativeEvent,"shallow")},ownerState:{disabled:C},className:A.squareMask}),!O&&(0,S.jsxs)(r.Fragment,{children:[(0,S.jsx)(eK,{className:A.pin}),null!=l&&(0,S.jsx)(ez,{type:y,viewValue:w,isInner:I,hasSelected:Z})]}),(0,S.jsx)(eG,{"aria-activedescendant":v,"aria-label":P.clockLabelText(y,l,D,null==l?null:D.format(l,"fullTime")),ref:V,role:"listbox",onKeyDown:e=>{if(!R.current)switch(e.key){case"Home":E(x,"partial"),e.preventDefault();break;case"End":E(k,"partial"),e.preventDefault();break;case"ArrowUp":E(j(w+F),"partial"),e.preventDefault();break;case"ArrowDown":E(j(w-F),"partial"),e.preventDefault();break;case"PageUp":E(N(w+5),"partial"),e.preventDefault();break;case"PageDown":E(N(w-5),"partial"),e.preventDefault();break;case"Enter":case" ":E(w,"finish"),e.preventDefault()}},tabIndex:0,className:A.wrapper,children:s})]}),n&&i&&(0,S.jsxs)(r.Fragment,{children:[(0,S.jsx)(eJ,{onClick:M?void 0:()=>d("am"),disabled:C||null===p,ownerState:t,className:A.amButton,title:(0,c.lu)(D,"am"),children:(0,S.jsx)(eQ,{variant:"caption",className:A.meridiemText,children:(0,c.lu)(D,"am")})}),(0,S.jsx)(eX,{disabled:C||null===p,onClick:M?void 0:()=>d("pm"),ownerState:t,className:A.pmButton,title:(0,c.lu)(D,"pm"),children:(0,S.jsx)(eQ,{variant:"caption",className:A.meridiemText,children:(0,c.lu)(D,"pm")})})]})]})}function e1(e){return(0,y.ZP)("MuiClockNumber",e)}let e2=(0,w.Z)("MuiClockNumber",["root","selected","disabled"]),e5=["className","disabled","index","inner","label","selected"],e3=e=>{let{classes:t,selected:n,disabled:i}=e;return(0,g.Z)({root:["root",n&&"selected",i&&"disabled"]},e1,t)},e4=(0,m.ZP)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${e2.disabled}`]:t.disabled},{[`&.${e2.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},[`&.${e2.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${e2.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,i.Z)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function e8(e){let t=(0,a.Z)({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:o,inner:s,label:l,selected:u}=t,c=(0,P.Z)(t,e5),d=e3(t),f=o%12/12*Math.PI*2-Math.PI/2,p=91*(s?.65:1),m=Math.round(Math.cos(f)*p),g=Math.round(Math.sin(f)*p);return(0,S.jsx)(e4,(0,i.Z)({className:(0,h.Z)(d.root,n),"aria-disabled":!!r||void 0,"aria-selected":!!u||void 0,role:"option",style:{transform:`translate(${m}px, ${g+92}px`},ownerState:t},c,{children:l}))}let e9=({ampm:e,value:t,getClockNumberText:n,isDisabled:i,selectedId:r,utils:o})=>{let s=t?o.getHours(t):null,l=[],a=+!!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=a;t<=u;t+=1){let s=t.toString();0===t&&(s="00");let a=!e&&(0===t||t>12);s=o.formatNumber(s);let u=c(t);l.push((0,S.jsx)(e8,{id:u?r:void 0,index:t,inner:a,selected:u,disabled:i(t),label:s,"aria-label":n(s)},t))}return l},e6=({utils:e,value:t,isDisabled:n,getClockNumberText:i,selectedId:r})=>{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 l=e===t;return(0,S.jsx)(e8,{label:o,id:l?r:void 0,index:s+1,inner:!1,disabled:n(e),selected:l,"aria-label":i(o)},e)})};var e7=n(89681),te=n(64757),tt=n(1556);let tn=({value:e,referenceDate:t,utils:n,props:i,timezone:o})=>{let s=r.useMemo(()=>te.h.getInitialReferenceValue({value:e,utils:n,props:i,referenceDate:t,granularity:tt.Kn.day,timezone:o,getTodayDate:()=>(0,c.X$)(n,o,"date")}),[]);return e??s},ti=["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"],tr=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],arrowSwitcher:["arrowSwitcher"]},eM,t)},to=(0,m.ZP)(eC,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),ts=(0,m.ZP)(ew,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),tl=["hours","minutes"],ta=r.forwardRef(function(e,t){let n=(0,u.nB)(),o=(0,a.Z)({props:e,name:"MuiTimeClock"}),{ampm:s=n.is12HourCycleInCurrentLocale(),ampmInClock:l=!1,autoFocus:c,slots:d,slotProps:f,value:p,defaultValue:m,referenceDate:g,disableIgnoringDatePartForTimeValidation:v=!1,maxTime:y,minTime:w,disableFuture:x,disablePast:k,minutesStep:C=1,shouldDisableTime:M,showViewSwitcher:T,onChange:D,view:R,views:A=tl,openTo:O,onViewChange:I,focusedView:E,onFocusedViewChange:L,className:B,disabled:Z,readOnly:F,timezone:V}=o,N=(0,P.Z)(o,ti),{value:j,handleValueChange:H,timezone:z}=(0,e7.m)({name:"TimeClock",timezone:V,value:p,defaultValue:m,referenceDate:g,onChange:D,valueManager:te.h}),$=tn({value:j,referenceDate:g,utils:n,props:o,timezone:z}),W=(0,b.M)(),_=(0,u.mX)(z),{view:q,setView:G,previousView:U,nextView:K,setValueAndGoToNextView:Y}=ek({view:R,views:A,openTo:O,onViewChange:I,onChange:H,focusedView:E,onFocusedViewChange:L}),{meridiemMode:Q,handleMeridiemChange:ee}=X($,s,Y),et=r.useCallback((e,t)=>{let i=(0,J.X4)(v,n),r="hours"===t||"minutes"===t&&A.includes("seconds"),o=({start:e,end:t})=>!(w&&i(w,t)||y&&i(e,y)||x&&i(e,_)||k&&i(_,r?t:e)),l=(e,i=1)=>{if(e%i!=0)return!1;if(M)switch(t){case"hours":return!M(n.setHours($,e),"hours");case"minutes":return!M(n.setMinutes($,e),"minutes");case"seconds":return!M(n.setSeconds($,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=(0,J.b_)(e,Q,s),i=n.setHours($,t);if(n.getHours(i)!==t)return!0;return!o({start:n.setSeconds(n.setMinutes(i,0),0),end:n.setSeconds(n.setMinutes(i,59),59)})||!l(t)}case"minutes":{let t=n.setMinutes($,e);return!o({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!l(e,C)}case"seconds":{let t=n.setSeconds($,e);return!o({start:t,end:t})||!l(e)}default:throw Error("not supported")}},[s,$,v,y,Q,w,C,M,n,x,k,_,A]),en=(0,eu.Z)(),ei=r.useMemo(()=>{switch(q){case"hours":{let e;let t=(e,t)=>{let i=(0,J.b_)(e,Q,s);Y(n.setHours($,i),t,"hours")},i=n.getHours($);return e=s?i>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:i,children:e9({value:j,utils:n,ampm:s,onChange:t,getClockNumberText:W.hoursClockNumberText,isDisabled:e=>Z||et(e,"hours"),selectedId:en}),viewRange:e}}case"minutes":{let e=n.getMinutes($),t=(e,t)=>{Y(n.setMinutes($,e),t,"minutes")};return{viewValue:e,onChange:t,children:e6({utils:n,value:e,onChange:t,getClockNumberText:W.minutesClockNumberText,isDisabled:e=>Z||et(e,"minutes"),selectedId:en}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds($),t=(e,t)=>{Y(n.setSeconds($,e),t,"seconds")};return{viewValue:e,onChange:t,children:e6({utils:n,value:e,onChange:t,getClockNumberText:W.secondsClockNumberText,isDisabled:e=>Z||et(e,"seconds"),selectedId:en}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[q,n,j,s,W.hoursClockNumberText,W.minutesClockNumberText,W.secondsClockNumberText,Q,Y,$,et,en,Z]),er=tr(o);return(0,S.jsxs)(to,(0,i.Z)({ref:t,className:(0,h.Z)(er.root,B),ownerState:o},N,{children:[(0,S.jsx)(e0,(0,i.Z)({autoFocus:c??!!E,ampmInClock:l&&A.includes("hours"),value:j,type:q,ampm:s,minutesStep:C,isTimeDisabled:et,meridiemMode:Q,handleMeridiemChange:ee,selectedId:en,disabled:Z,readOnly:F},ei)),T&&(0,S.jsx)(ts,{className:er.arrowSwitcher,slots:d,slotProps:f,onGoToPrevious:()=>G(U),isPreviousDisabled:!U,previousLabel:W.openPreviousView,onGoToNext:()=>G(K),isNextDisabled:!K,nextLabel:W.openNextView,ownerState:o})]}))}),tu=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:i,views:r,value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:m,minutesStep:g,ampm:v,ampmInClock:b,slots:y,slotProps:w,readOnly:x,disabled:k,sx:C,autoFocus:M,showViewSwitcher:T,disableIgnoringDatePartForTimeValidation:D,timezone:P})=>(0,S.jsx)(ta,{view:e,onViewChange:t,focusedView:n&&(0,J.Is)(n)?n:null,onFocusedViewChange:i,views:r.filter(J.Is),value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:m,minutesStep:g,ampm:v,ampmInClock:b,slots:y,slotProps:w,readOnly:x,disabled:k,sx:C,autoFocus:M,showViewSwitcher:T,disableIgnoringDatePartForTimeValidation:D,timezone:P});var tc=n(24303);let th=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:o,disableFuture:s,disablePast:l,timezone:a})=>{let c=(0,u.Do)();return r.useCallback(r=>null!==(0,tc.q)({adapter:c,value:r,timezone:a,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:o,disableFuture:s,disablePast:l}}),[c,e,t,n,i,o,s,l,a])},td=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return(0,i.Z)({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{let e=o.newTimezone;if(n.getTimezone(r.currentMonth)===e)return r;let t=n.setTimezone(r.currentMonth,e);return n.getMonth(t)!==n.getMonth(r.currentMonth)&&(t=n.setMonth(t,n.getMonth(r.currentMonth))),(0,i.Z)({},r,{currentMonth:t})}case"finishMonthSwitchingAnimation":return(0,i.Z)({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=r.focusedDay&&null!=o.focusedDay&&n.isSameDay(o.focusedDay,r.focusedDay))return r;let s=null!=o.focusedDay&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return(0,i.Z)({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:s&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:s?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:null!=o.focusedDay&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw Error("missing support")}},tf=e=>{let{value:t,referenceDate:n,disableFuture:o,disablePast:s,disableSwitchToMonthOnDayFocus:l=!1,maxDate:a,minDate:c,onMonthChange:h,reduceAnimations:d,shouldDisableDate:f,timezone:p}=e,m=(0,u.nB)(),g=r.useRef(td(!!d,l,m)).current,v=r.useMemo(()=>te.h.getInitialReferenceValue({value:t,utils:m,timezone:p,props:e,referenceDate:n,granularity:tt.Kn.day}),[n,p]),[b,y]=r.useReducer(g,{isMonthSwitchingAnimating:!1,focusedDay:v,currentMonth:m.startOfMonth(v),slideDirection:"left"});r.useEffect(()=>{y({type:"changeMonthTimezone",newTimezone:m.getTimezone(v)})},[v,m]);let w=r.useCallback(e=>{y((0,i.Z)({type:"changeMonth"},e)),h&&h(e.newMonth)},[h]),x=r.useCallback(e=>{!m.isSameMonth(e,b.currentMonth)&&w({newMonth:m.startOfMonth(e),direction:m.isAfterDay(e,b.currentMonth)?"left":"right"})},[b.currentMonth,w,m]),S=th({shouldDisableDate:f,minDate:c,maxDate:a,disableFuture:o,disablePast:s,timezone:p}),k=r.useCallback(()=>{y({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:v,calendarState:b,changeMonth:x,changeFocusedDay:(0,ex.Z)((e,t)=>{S(e)||y({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:S,onMonthSwitchingAnimationEnd:k,handleChangeMonth:w}};var tp=n(16317),tm=n(69761),tg=n(94776);let tv=e=>(0,y.ZP)("MuiPickersFadeTransitionGroup",e);(0,w.Z)("MuiPickersFadeTransitionGroup",["root"]);let tb=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"]},tv,t)},ty=(0,m.ZP)(tp.Z,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function tw(e){let t=(0,a.Z)({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,s=tb(t),l=(0,tg.Z)();return r?n:(0,S.jsx)(ty,{className:(0,h.Z)(s.root,i),children:(0,S.jsx)(tm.Z,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:l.transitions.duration.enteringScreen,enter:l.transitions.duration.enteringScreen,exit:0},children:n},o)})}var tx=n(14544),tS=n(97048),tk=n(16838);function tC(e){return(0,y.ZP)("MuiPickersDay",e)}let tM=(0,w.Z)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),tT=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],tD=e=>{let{selected:t,disableMargin:n,disableHighlightToday:i,today:r,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:l,classes:a}=e,u=s&&!l;return(0,g.Z)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!i&&r&&"today",s&&l&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},tC,a)},tP=({theme:e})=>(0,i.Z)({},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,tk.Fq)(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,tk.Fq)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${tM.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${tM.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}},[`&.${tM.disabled}:not(.${tM.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${tM.disabled}&.${tM.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(.${tM.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),tR=(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]},tA=(0,m.ZP)(tx.Z,{name:"MuiPickersDay",slot:"Root",overridesResolver:tR})(tP),tO=(0,m.ZP)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:tR})(({theme:e})=>(0,i.Z)({},tP({theme:e}),{opacity:0,pointerEvents:"none"})),tI=()=>{},tE=r.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersDay"}),{autoFocus:o=!1,className:s,day:l,disabled:c=!1,disableHighlightToday:d=!1,disableMargin:f=!1,isAnimating:p,onClick:m,onDaySelect:g,onFocus:v=tI,onBlur:b=tI,onKeyDown:y=tI,onMouseDown:w=tI,onMouseEnter:x=tI,outsideCurrentMonth:k,selected:C=!1,showDaysOutsideCurrentMonth:M=!1,children:T,today:D=!1}=n,R=(0,P.Z)(n,tT),A=(0,i.Z)({},n,{autoFocus:o,disabled:c,disableHighlightToday:d,disableMargin:f,selected:C,showDaysOutsideCurrentMonth:M,today:D}),O=tD(A),I=(0,u.nB)(),E=r.useRef(null),L=(0,tS.Z)(E,t);return((0,eT.Z)(()=>{!o||c||p||k||E.current.focus()},[o,c,p,k]),k&&!M)?(0,S.jsx)(tO,{className:(0,h.Z)(O.root,O.hiddenDaySpacingFiller,s),ownerState:A,role:R.role}):(0,S.jsx)(tA,(0,i.Z)({className:(0,h.Z)(O.root,s),ref:L,centerRipple:!0,disabled:c,tabIndex:C?0:-1,onKeyDown:e=>y(e,l),onFocus:e=>v(e,l),onBlur:e=>b(e,l),onMouseEnter:e=>x(e,l),onClick:e=>{c||g(l),k&&e.currentTarget.focus(),m&&m(e)},onMouseDown:e=>{w(e),k&&e.preventDefault()}},R,{ownerState:A,children:T||I.format(l,"dayOfMonth")}))}),tL=r.memo(tE);var tB=n(54652);function tZ(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var tF=n(41825),tV=n(98683),tN=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=tZ(e.className,t):e.setAttribute("class",tZ(e.className&&e.className.baseVal||"",t))})},tj=function(e){function t(){for(var t,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.addClass(r,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,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,i="string"==typeof n,r=i&&n?n+"-":"",o=i?""+r+e:n[e],s=i?o+"-active":n[e+"Active"],l=i?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:s,doneClassName:l}},t}(0,tB.Z)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i,r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&(0,tV.Q)(e),r&&(this.appliedClasses[t][n]=r,i=r,e&&i&&i.split(" ").forEach(function(t){return function(e,t){if(e.classList)e.classList.add(t);else(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))}(e,t)}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&tN(e,i),r&&tN(e,r),o&&tN(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,P.Z)(e,["classNames"]));return o().createElement(tF.ZP,(0,i.Z)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(o().Component);tj.defaultProps={classNames:""},tj.propTypes={};let tH=e=>(0,y.ZP)("MuiPickersSlideTransition",e),tz=(0,w.Z)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),t$=["children","className","reduceAnimations","slideDirection","transKey","classes"],tW=e=>{let{classes:t,slideDirection:n}=e,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,g.Z)(i,tH,t)},t_=(0,m.ZP)(tp.Z,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${tz["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${tz["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${tz.slideEnterActive}`]:t.slideEnterActive},{[`.${tz.slideExit}`]:t.slideExit},{[`.${tz["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${tz["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},[`& .${tz["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${tz["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${tz.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${tz.slideExit}`]:{transform:"translate(0%)"},[`& .${tz["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${tz["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),tq=e=>(0,y.ZP)("MuiDayCalendar",e);(0,w.Z)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let tG=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],tU=["ownerState"],tK=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},tq,t)},tY=(0,m.ZP)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),tJ=(0,m.ZP)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),tX=(0,m.ZP)(A.Z,{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})),tQ=(0,m.ZP)(A.Z,{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})),t0=(0,m.ZP)(A.Z,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,i.Z)({},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"})),t1=(0,m.ZP)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),t2=(0,m.ZP)(function(e){let t=(0,a.Z)({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:o,reduceAnimations:s,transKey:l}=t,u=(0,P.Z)(t,t$),c=tW(t),d=(0,tg.Z)();if(s)return(0,S.jsx)("div",{className:(0,h.Z)(c.root,o),children:n});let f={exit:c.exit,enterActive:c.enterActive,enter:c.enter,exitActive:c.exitActive};return(0,S.jsx)(t_,{className:(0,h.Z)(c.root,o),childFactory:e=>r.cloneElement(e,{classNames:f}),role:"presentation",children:(0,S.jsx)(tj,(0,i.Z)({mountOnEnter:!0,unmountOnExit:!0,timeout:d.transitions.duration.complex,classNames:f},u,{children:n}),l)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),t5=(0,m.ZP)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),t3=(0,m.ZP)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function t4(e){let{parentProps:t,day:n,focusableDay:o,selectedDays:s,isDateDisabled:l,currentMonthNumber:a,isViewFocused:c}=e,h=(0,P.Z)(e,tG),{disabled:d,disableHighlightToday:f,isMonthSwitchingAnimating:p,showDaysOutsideCurrentMonth:m,slots:g,slotProps:v,timezone:b}=t,y=(0,u.nB)(),w=(0,u.mX)(b),x=null!==o&&y.isSameDay(n,o),k=s.some(e=>y.isSameDay(e,n)),C=y.isSameDay(n,w),M=g?.day??tL,T=(0,ec.Z)({elementType:M,externalSlotProps:v?.day,additionalProps:(0,i.Z)({disableHighlightToday:f,showDaysOutsideCurrentMonth:m,role:"gridcell",isAnimating:p,"data-timestamp":y.toJsDate(n).valueOf()},h),ownerState:(0,i.Z)({},t,{day:n,selected:k})}),D=(0,P.Z)(T,tU),R=r.useMemo(()=>d||l(n),[d,l,n]),A=r.useMemo(()=>y.getMonth(n)!==a,[y,n,a]),O=r.useMemo(()=>{let e=y.startOfMonth(y.setMonth(n,a));return m?y.isSameDay(n,y.startOfWeek(e)):y.isSameDay(n,e)},[a,n,m,y]),I=r.useMemo(()=>{let e=y.endOfMonth(y.setMonth(n,a));return m?y.isSameDay(n,y.endOfWeek(e)):y.isSameDay(n,e)},[a,n,m,y]);return(0,S.jsx)(M,(0,i.Z)({},D,{day:n,disabled:R,autoFocus:c&&x,today:C,outsideCurrentMonth:A,isFirstVisibleCell:O,isLastVisibleCell:I,selected:k,tabIndex:x?0:-1,"aria-selected":k,"aria-current":C?"date":void 0}))}function t8(e){let t=(0,a.Z)({props:e,name:"MuiDayCalendar"}),n=(0,u.nB)(),{onFocusedDayChange:o,className:s,currentMonth:l,selectedDays:d,focusedDay:f,loading:p,onSelectedDaysChange:m,onMonthSwitchingAnimationEnd:g,readOnly:v,reduceAnimations:y,renderLoading:w=()=>(0,S.jsx)("span",{children:"..."}),slideDirection:x,TransitionProps:k,disablePast:C,disableFuture:M,minDate:T,maxDate:D,shouldDisableDate:P,shouldDisableMonth:A,shouldDisableYear:O,dayOfWeekFormatter:I=e=>n.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:E,onFocusedViewChange:L,gridLabelId:B,displayWeekNumber:Z,fixedWeekNumber:F,autoFocus:V,timezone:N}=t,j=(0,u.mX)(N),H=tK(t),z=(0,R.V)(),$=th({shouldDisableDate:P,shouldDisableMonth:A,shouldDisableYear:O,minDate:T,maxDate:D,disablePast:C,disableFuture:M,timezone:N}),W=(0,b.M)(),[_,q]=(0,eS.Z)({name:"DayCalendar",state:"hasFocus",controlled:E,default:V??!1}),[G,U]=r.useState(()=>f||j),K=(0,ex.Z)(e=>{!v&&m(e)}),Y=e=>{$(e)||(o(e),U(e),L?.(!0),q(!0))},J=(0,ex.Z)((e,t)=>{switch(e.key){case"ArrowUp":Y(n.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":Y(n.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let i=n.addDays(t,z?1:-1),r=n.addMonths(t,z?1:-1);Y((0,c.xP)({utils:n,date:i,minDate:z?i:n.startOfMonth(r),maxDate:z?n.endOfMonth(r):i,isDateDisabled:$,timezone:N})||i),e.preventDefault();break}case"ArrowRight":{let i=n.addDays(t,z?-1:1),r=n.addMonths(t,z?-1:1);Y((0,c.xP)({utils:n,date:i,minDate:z?n.startOfMonth(r):i,maxDate:z?i:n.endOfMonth(r),isDateDisabled:$,timezone:N})||i),e.preventDefault();break}case"Home":Y(n.startOfWeek(t)),e.preventDefault();break;case"End":Y(n.endOfWeek(t)),e.preventDefault();break;case"PageUp":Y(n.addMonths(t,1)),e.preventDefault();break;case"PageDown":Y(n.addMonths(t,-1)),e.preventDefault()}}),X=(0,ex.Z)((e,t)=>Y(t)),Q=(0,ex.Z)((e,t)=>{_&&n.isSameDay(G,t)&&L?.(!1)}),ee=n.getMonth(l),et=n.getYear(l),en=r.useMemo(()=>d.filter(e=>!!e).map(e=>n.startOfDay(e)),[n,d]),ei=`${et}-${ee}`,er=r.useMemo(()=>r.createRef(),[ei]),eo=r.useMemo(()=>{let e=n.startOfMonth(l),t=n.endOfMonth(l);return $(G)||n.isAfterDay(G,t)||n.isBeforeDay(G,e)?(0,c.xP)({utils:n,date:G,minDate:e,maxDate:t,disablePast:C,disableFuture:M,isDateDisabled:$,timezone:N}):G},[l,M,C,G,$,n,N]),es=r.useMemo(()=>{let e=n.getWeekArray(l),t=n.addMonths(l,1);for(;F&&e.length<F;){let i=n.getWeekArray(t),r=n.isSameDay(e[e.length-1][0],i[0][0]);i.slice(+!!r).forEach(t=>{e.length<F&&e.push(t)}),t=n.addMonths(t,1)}return e},[l,F,n]);return(0,S.jsxs)(tY,{role:"grid","aria-labelledby":B,className:H.root,children:[(0,S.jsxs)(tJ,{role:"row",className:H.header,children:[Z&&(0,S.jsx)(tQ,{variant:"caption",role:"columnheader","aria-label":W.calendarWeekNumberHeaderLabel,className:H.weekNumberLabel,children:W.calendarWeekNumberHeaderText}),(0,c.D1)(n,j).map((e,t)=>(0,S.jsx)(tX,{variant:"caption",role:"columnheader","aria-label":n.format(e,"weekday"),className:H.weekDayLabel,children:I(e)},t.toString()))]}),p?(0,S.jsx)(t1,{className:H.loadingContainer,children:w()}):(0,S.jsx)(t2,(0,i.Z)({transKey:ei,onExited:g,reduceAnimations:y,slideDirection:x,className:(0,h.Z)(s,H.slideTransition)},k,{nodeRef:er,children:(0,S.jsx)(t5,{ref:er,role:"rowgroup",className:H.monthContainer,children:es.map((e,i)=>(0,S.jsxs)(t3,{role:"row",className:H.weekContainer,"aria-rowindex":i+1,children:[Z&&(0,S.jsx)(t0,{className:H.weekNumber,role:"rowheader","aria-label":W.calendarWeekNumberAriaLabelText(n.getWeekNumber(e[0])),children:W.calendarWeekNumberText(n.getWeekNumber(e[0]))}),e.map((e,n)=>(0,S.jsx)(t4,{parentProps:t,day:e,selectedDays:en,focusableDay:eo,onKeyDown:J,onFocus:X,onBlur:Q,onDaySelect:K,isDateDisabled:$,currentMonthNumber:ee,isViewFocused:_,"aria-colindex":n+1},e.toString()))]},`week-${e[0]}`))})}))]})}function t9(e){return(0,y.ZP)("MuiPickersMonth",e)}let t6=(0,w.Z)("MuiPickersMonth",["root","monthButton","disabled","selected"]),t7=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],ne=e=>{let{disabled:t,selected:n,classes:i}=e;return(0,g.Z)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},t9,i)},nt=(0,m.ZP)("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%"}}]}),nn=(0,m.ZP)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${t6.disabled}`]:t.disabled},{[`&.${t6.selected}`]:t.selected}]})(({theme:e})=>(0,i.Z)({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,tk.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,tk.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${t6.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${t6.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),ni=r.memo(function(e){let t=(0,a.Z)({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:o,children:s,disabled:l,selected:u,value:c,tabIndex:d,onClick:f,onKeyDown:p,onFocus:m,onBlur:g,"aria-current":v,"aria-label":b,slots:y,slotProps:w}=t,x=(0,P.Z)(t,t7),k=r.useRef(null),C=ne(t);(0,eT.Z)(()=>{n&&k.current?.focus()},[n]);let M=y?.monthButton??nn,T=(0,ec.Z)({elementType:M,externalSlotProps:w?.monthButton,additionalProps:{children:s,disabled:l,tabIndex:d,ref:k,type:"button",role:"radio","aria-current":v,"aria-checked":u,"aria-label":b,onClick:e=>f(e,c),onKeyDown:e=>p(e,c),onFocus:e=>m(e,c),onBlur:e=>g(e,c)},ownerState:t,className:C.monthButton});return(0,S.jsx)(nt,(0,i.Z)({className:(0,h.Z)(C.root,o),ownerState:t},x,{children:(0,S.jsx)(M,(0,i.Z)({},T))}))});function nr(e){return(0,y.ZP)("MuiMonthCalendar",e)}(0,w.Z)("MuiMonthCalendar",["root"]);let no=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],ns=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"]},nr,t)},nl=(0,m.ZP)("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:320,boxSizing:"border-box"}),na=r.forwardRef(function(e,t){let n=function(e,t){let n=(0,u.nB)(),r=(0,u.PP)(),o=(0,a.Z)({props:e,name:t});return(0,i.Z)({disableFuture:!1,disablePast:!1},o,{minDate:(0,c.US)(n,o.minDate,r.minDate),maxDate:(0,c.US)(n,o.maxDate,r.maxDate)})}(e,"MuiMonthCalendar"),{className:o,value:s,defaultValue:l,referenceDate:d,disabled:f,disableFuture:p,disablePast:m,maxDate:g,minDate:v,onChange:b,shouldDisableMonth:y,readOnly:w,autoFocus:x=!1,onMonthFocus:k,hasFocus:C,onFocusedViewChange:M,monthsPerRow:T=3,timezone:D,gridLabelId:A,slots:O,slotProps:I}=n,E=(0,P.Z)(n,no),{value:L,handleValueChange:B,timezone:Z}=(0,e7.m)({name:"MonthCalendar",timezone:D,value:s,defaultValue:l,referenceDate:d,onChange:b,valueManager:te.h}),F=(0,u.mX)(Z),V=(0,R.V)(),N=(0,u.nB)(),j=r.useMemo(()=>te.h.getInitialReferenceValue({value:L,utils:N,props:n,timezone:Z,referenceDate:d,granularity:tt.Kn.month}),[]),H=ns(n),z=r.useMemo(()=>N.getMonth(F),[N,F]),$=r.useMemo(()=>null!=L?N.getMonth(L):null,[L,N]),[W,_]=r.useState(()=>$||N.getMonth(j)),[q,G]=(0,eS.Z)({name:"MonthCalendar",state:"hasFocus",controlled:C,default:x??!1}),U=(0,ex.Z)(e=>{G(e),M&&M(e)}),K=r.useCallback(e=>{let t=N.startOfMonth(m&&N.isAfter(F,v)?F:v),n=N.startOfMonth(p&&N.isBefore(F,g)?F:g),i=N.startOfMonth(e);return!!(N.isBefore(i,t)||N.isAfter(i,n))||!!y&&y(i)},[p,m,g,v,F,y,N]),Y=(0,ex.Z)((e,t)=>{!w&&B(N.setMonth(L??j,t))}),J=(0,ex.Z)(e=>{!K(N.setMonth(L??j,e))&&(_(e),U(!0),k&&k(e))});r.useEffect(()=>{_(e=>null!==$&&e!==$?$:e)},[$]);let X=(0,ex.Z)((e,t)=>{switch(e.key){case"ArrowUp":J((12+t-3)%12),e.preventDefault();break;case"ArrowDown":J((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":J((12+t+(V?1:-1))%12),e.preventDefault();break;case"ArrowRight":J((12+t+(V?-1:1))%12),e.preventDefault()}}),Q=(0,ex.Z)((e,t)=>{J(t)}),ee=(0,ex.Z)((e,t)=>{W===t&&U(!1)});return(0,S.jsx)(nl,(0,i.Z)({ref:t,className:(0,h.Z)(H.root,o),ownerState:n,role:"radiogroup","aria-labelledby":A},E,{children:(0,c.SV)(N,L??j).map(e=>{let t=N.getMonth(e),n=N.format(e,"monthShort"),i=N.format(e,"month"),r=f||K(e);return(0,S.jsx)(ni,{selected:t===$,value:t,onClick:Y,onKeyDown:X,autoFocus:q&&t===W,disabled:r,tabIndex:t!==W||r?-1:0,onFocus:Q,onBlur:ee,"aria-current":z===t?"date":void 0,"aria-label":i,monthsPerRow:T,slots:O,slotProps:I,children:n},n)})}))});function nu(e){return(0,y.ZP)("MuiPickersYear",e)}let nc=(0,w.Z)("MuiPickersYear",["root","yearButton","selected","disabled"]),nh=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],nd=e=>{let{disabled:t,selected:n,classes:i}=e;return(0,g.Z)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},nu,i)},nf=(0,m.ZP)("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%"}}]}),np=(0,m.ZP)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${nc.disabled}`]:t.disabled},{[`&.${nc.selected}`]:t.selected}]})(({theme:e})=>(0,i.Z)({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,tk.Fq)(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,tk.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${nc.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${nc.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),nm=r.memo(function(e){let t=(0,a.Z)({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:o,children:s,disabled:l,selected:u,value:c,tabIndex:d,onClick:f,onKeyDown:p,onFocus:m,onBlur:g,"aria-current":v,slots:b,slotProps:y}=t,w=(0,P.Z)(t,nh),x=r.useRef(null),k=nd(t);(0,eT.Z)(()=>{n&&x.current?.focus()},[n]);let C=b?.yearButton??np,M=(0,ec.Z)({elementType:C,externalSlotProps:y?.yearButton,additionalProps:{children:s,disabled:l,tabIndex:d,ref:x,type:"button",role:"radio","aria-current":v,"aria-checked":u,onClick:e=>f(e,c),onKeyDown:e=>p(e,c),onFocus:e=>m(e,c),onBlur:e=>g(e,c)},ownerState:t,className:k.yearButton});return(0,S.jsx)(nf,(0,i.Z)({className:(0,h.Z)(k.root,o),ownerState:t},w,{children:(0,S.jsx)(C,(0,i.Z)({},M))}))});function ng(e){return(0,y.ZP)("MuiYearCalendar",e)}(0,w.Z)("MuiYearCalendar",["root"]);let nv=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],nb=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"]},ng,t)},ny=(0,m.ZP)("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"}),nw=r.forwardRef(function(e,t){let n=function(e,t){let n=(0,u.nB)(),r=(0,u.PP)(),o=(0,a.Z)({props:e,name:t});return(0,i.Z)({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:(0,c.US)(n,o.minDate,r.minDate),maxDate:(0,c.US)(n,o.maxDate,r.maxDate)})}(e,"MuiYearCalendar"),{autoFocus:o,className:s,value:l,defaultValue:d,referenceDate:f,disabled:p,disableFuture:m,disablePast:g,maxDate:v,minDate:b,onChange:y,readOnly:w,shouldDisableYear:x,onYearFocus:k,hasFocus:C,onFocusedViewChange:M,yearsOrder:T="asc",yearsPerRow:D,timezone:A,gridLabelId:O,slots:I,slotProps:E}=n,L=(0,P.Z)(n,nv),{value:B,handleValueChange:Z,timezone:F}=(0,e7.m)({name:"YearCalendar",timezone:A,value:l,defaultValue:d,referenceDate:f,onChange:y,valueManager:te.h}),V=(0,u.mX)(F),N=(0,R.V)(),j=(0,u.nB)(),H=r.useMemo(()=>te.h.getInitialReferenceValue({value:B,utils:j,props:n,timezone:F,referenceDate:f,granularity:tt.Kn.year}),[]),z=nb(n),$=r.useMemo(()=>j.getYear(V),[j,V]),W=r.useMemo(()=>null!=B?j.getYear(B):null,[B,j]),[_,q]=r.useState(()=>W||j.getYear(H)),[G,U]=(0,eS.Z)({name:"YearCalendar",state:"hasFocus",controlled:C,default:o??!1}),K=(0,ex.Z)(e=>{U(e),M&&M(e)}),Y=r.useCallback(e=>!!(g&&j.isBeforeYear(e,V)||m&&j.isAfterYear(e,V)||b&&j.isBeforeYear(e,b)||v&&j.isAfterYear(e,v))||!!x&&x(j.startOfYear(e)),[m,g,v,b,V,x,j]),J=(0,ex.Z)((e,t)=>{!w&&Z(j.setYear(B??H,t))}),X=(0,ex.Z)(e=>{Y(j.setYear(B??H,e))||(q(e),K(!0),k?.(e))});r.useEffect(()=>{q(e=>null!==W&&e!==W?W:e)},[W]);let Q="desc"!==T?+D:-1*D,ee=N&&"asc"===T||!N&&"desc"===T?-1:1,et=(0,ex.Z)((e,t)=>{switch(e.key){case"ArrowUp":X(t-Q),e.preventDefault();break;case"ArrowDown":X(t+Q),e.preventDefault();break;case"ArrowLeft":X(t-ee),e.preventDefault();break;case"ArrowRight":X(t+ee),e.preventDefault()}}),en=(0,ex.Z)((e,t)=>{X(t)}),ei=(0,ex.Z)((e,t)=>{_===t&&K(!1)}),er=r.useRef(null),eo=(0,tS.Z)(t,er);r.useEffect(()=>{if(o||null===er.current)return;let e=er.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,i=er.current.clientHeight,r=er.current.scrollTop;!(t>i)&&!(n<r)&&(er.current.scrollTop=n+t-i/2-t/2)},[o]);let es=j.getYearRange([b,v]);return"desc"===T&&es.reverse(),(0,S.jsx)(ny,(0,i.Z)({ref:eo,className:(0,h.Z)(z.root,s),ownerState:n,role:"radiogroup","aria-labelledby":O},L,{children:es.map(e=>{let t=j.getYear(e),n=p||Y(e);return(0,S.jsx)(nm,{selected:t===W,value:t,onClick:J,onKeyDown:et,autoFocus:G&&t===_,disabled:n,tabIndex:t!==_||n?-1:0,onFocus:en,onBlur:ei,"aria-current":$===t?"date":void 0,yearsPerRow:D,slots:I,slotProps:E,children:j.format(e,"year")},j.format(e,"year"))})}))}),nx=e=>(0,y.ZP)("MuiPickersCalendarHeader",e),nS=(0,w.Z)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),nk=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],nC=["ownerState"],nM=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},nx,t)},nT=(0,m.ZP)("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}),nD=(0,m.ZP)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,i.Z)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),nP=(0,m.ZP)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),nR=(0,m.ZP)(eh.Z,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${nS.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),nA=(0,m.ZP)(v.ch,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),nO=r.forwardRef(function(e,t){let n=(0,b.M)(),o=(0,u.nB)(),s=(0,a.Z)({props:e,name:"MuiPickersCalendarHeader"}),{slots:l,slotProps:c,currentMonth:d,disabled:f,disableFuture:p,disablePast:m,maxDate:g,minDate:v,onMonthChange:y,onViewChange:w,view:x,reduceAnimations:k,views:C,labelId:M,className:T,timezone:D,format:R=`${o.formats.month} ${o.formats.year}`}=s,A=(0,P.Z)(s,nk),O=nM(s),I=l?.switchViewButton??nR,E=(0,ec.Z)({elementType:I,externalSlotProps:c?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(x)},ownerState:s,className:O.switchViewButton}),L=l?.switchViewIcon??nA,B=(0,ec.Z)({elementType:L,externalSlotProps:c?.switchViewIcon,ownerState:s,className:O.switchViewIcon}),Z=(0,P.Z)(B,nC),F=function(e,{disableFuture:t,maxDate:n,timezone:i}){let o=(0,u.nB)();return r.useMemo(()=>{let r=o.date(void 0,i),s=o.startOfMonth(t&&o.isBefore(r,n)?r:n);return!o.isAfter(s,e)},[t,n,e,o,i])}(d,{disableFuture:p,maxDate:g,timezone:D}),V=function(e,{disablePast:t,minDate:n,timezone:i}){let o=(0,u.nB)();return r.useMemo(()=>{let r=o.date(void 0,i),s=o.startOfMonth(t&&o.isAfter(r,n)?r:n);return!o.isBefore(s,e)},[t,n,e,o,i])}(d,{disablePast:m,minDate:v,timezone:D});if(1===C.length&&"year"===C[0])return null;let N=o.formatByString(d,R);return(0,S.jsxs)(nT,(0,i.Z)({},A,{ownerState:s,className:(0,h.Z)(O.root,T),ref:t,children:[(0,S.jsxs)(nD,{role:"presentation",onClick:()=>{if(1!==C.length&&w&&!f){if(2===C.length)w(C.find(e=>e!==x)||C[0]);else{let e=+(0===C.indexOf(x));w(C[e])}}},ownerState:s,"aria-live":"polite",className:O.labelContainer,children:[(0,S.jsx)(tw,{reduceAnimations:k,transKey:N,children:(0,S.jsx)(nP,{id:M,ownerState:s,className:O.label,children:N})}),C.length>1&&!f&&(0,S.jsx)(I,(0,i.Z)({},E,{children:(0,S.jsx)(L,(0,i.Z)({},Z))}))]}),(0,S.jsx)(tm.Z,{in:"day"===x,appear:!k,enter:!k,children:(0,S.jsx)(ew,{slots:l,slotProps:c,onGoToPrevious:()=>y(o.addMonths(d,-1),"right"),isPreviousDisabled:V,previousLabel:n.previousMonth,onGoToNext:()=>y(o.addMonths(d,1),"left"),isNextDisabled:F,nextLabel:n.nextMonth})})]}))});var nI=n(76439);let nE="undefined"!=typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),nL=nE&&nE[1]?parseInt(nE[1],10):null,nB=nE&&nE[2]?parseInt(nE[2],10):null,nZ=nL&&nL<10||nB&&nB<13||!1,nF=()=>(0,nI.Z)("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||nZ,nV=e=>(0,y.ZP)("MuiDateCalendar",e);(0,w.Z)("MuiDateCalendar",["root","viewTransitionContainer"]);let nN=["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"],nj=e=>{let{classes:t}=e;return(0,g.Z)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},nV,t)},nH=(0,m.ZP)(eC,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),nz=(0,m.ZP)(tw,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),n$=r.forwardRef(function(e,t){let n=(0,u.nB)(),o=(0,eu.Z)(),s=function(e,t){let n=(0,u.nB)(),r=(0,u.PP)(),o=nF(),s=(0,a.Z)({props:e,name:t});return(0,i.Z)({},s,{loading:s.loading??!1,disablePast:s.disablePast??!1,disableFuture:s.disableFuture??!1,openTo:s.openTo??"day",views:s.views??["year","day"],reduceAnimations:s.reduceAnimations??o,renderLoading:s.renderLoading??(()=>(0,S.jsx)("span",{children:"..."})),minDate:(0,c.US)(n,s.minDate,r.minDate),maxDate:(0,c.US)(n,s.maxDate,r.maxDate)})}(e,"MuiDateCalendar"),{autoFocus:l,onViewChange:d,value:f,defaultValue:p,referenceDate:m,disableFuture:g,disablePast:v,onChange:b,onYearChange:y,onMonthChange:w,reduceAnimations:x,shouldDisableDate:k,shouldDisableMonth:C,shouldDisableYear:M,view:T,views:D,openTo:R,className:A,disabled:O,readOnly:I,minDate:E,maxDate:L,disableHighlightToday:B,focusedView:Z,onFocusedViewChange:F,showDaysOutsideCurrentMonth:V,fixedWeekNumber:N,dayOfWeekFormatter:j,slots:H,slotProps:z,loading:$,renderLoading:W,displayWeekNumber:_,yearsOrder:q,yearsPerRow:G,monthsPerRow:U,timezone:K}=s,Y=(0,P.Z)(s,nN),{value:J,handleValueChange:X,timezone:Q}=(0,e7.m)({name:"DateCalendar",timezone:K,value:f,defaultValue:p,referenceDate:m,onChange:b,valueManager:te.h}),{view:ee,setView:et,focusedView:en,setFocusedView:ei,goToNextView:er,setValueAndGoToNextView:eo}=ek({view:T,views:D,openTo:R,onChange:X,onViewChange:d,autoFocus:l,focusedView:Z,onFocusedViewChange:F}),{referenceDate:es,calendarState:el,changeFocusedDay:ea,changeMonth:eh,handleChangeMonth:ed,isDateDisabled:ef,onMonthSwitchingAnimationEnd:ep}=tf({value:J,referenceDate:m,reduceAnimations:x,onMonthChange:w,minDate:E,maxDate:L,shouldDisableDate:k,disablePast:v,disableFuture:g,timezone:Q}),em=O&&J||E,eg=O&&J||L,ev=`${o}-grid-label`,eb=null!==en,ey=H?.calendarHeader??nO,ew=(0,ec.Z)({elementType:ey,externalSlotProps:z?.calendarHeader,additionalProps:{views:D,view:ee,currentMonth:el.currentMonth,onViewChange:et,onMonthChange:(e,t)=>ed({newMonth:e,direction:t}),minDate:em,maxDate:eg,disabled:O,disablePast:v,disableFuture:g,reduceAnimations:x,timezone:Q,labelId:ev},ownerState:s}),eS=(0,ex.Z)(e=>{let t=n.startOfMonth(e),i=n.endOfMonth(e),r=ef(e)?(0,c.xP)({utils:n,date:e,minDate:n.isBefore(E,t)?t:E,maxDate:n.isAfter(L,i)?i:L,disablePast:v,disableFuture:g,isDateDisabled:ef,timezone:Q}):e;r?(eo(r,"finish"),w?.(t)):(er(),eh(t)),ea(r,!0)}),eC=(0,ex.Z)(e=>{let t=n.startOfYear(e),i=n.endOfYear(e),r=ef(e)?(0,c.xP)({utils:n,date:e,minDate:n.isBefore(E,t)?t:E,maxDate:n.isAfter(L,i)?i:L,disablePast:v,disableFuture:g,isDateDisabled:ef,timezone:Q}):e;r?(eo(r,"finish"),y?.(r)):(er(),eh(t)),ea(r,!0)}),eM=(0,ex.Z)(e=>e?X((0,c.zu)(n,e,J??es),"finish",ee):X(e,"finish",ee));r.useEffect(()=>{null!=J&&n.isValid(J)&&eh(J)},[J]);let eT=nj(s),eD={disablePast:v,disableFuture:g,maxDate:L,minDate:E},eP={disableHighlightToday:B,readOnly:I,disabled:O,timezone:Q,gridLabelId:ev,slots:H,slotProps:z},eR=r.useRef(ee);r.useEffect(()=>{eR.current!==ee&&(en===eR.current&&ei(ee,!0),eR.current=ee)},[en,ei,ee]);let eA=r.useMemo(()=>[J],[J]);return(0,S.jsxs)(nH,(0,i.Z)({ref:t,className:(0,h.Z)(eT.root,A),ownerState:s},Y,{children:[(0,S.jsx)(ey,(0,i.Z)({},ew,{slots:H,slotProps:z})),(0,S.jsx)(nz,{reduceAnimations:x,className:eT.viewTransitionContainer,transKey:ee,ownerState:s,children:(0,S.jsxs)("div",{children:["year"===ee&&(0,S.jsx)(nw,(0,i.Z)({},eD,eP,{value:J,onChange:eC,shouldDisableYear:M,hasFocus:eb,onFocusedViewChange:e=>ei("year",e),yearsOrder:q,yearsPerRow:G,referenceDate:es})),"month"===ee&&(0,S.jsx)(na,(0,i.Z)({},eD,eP,{hasFocus:eb,className:A,value:J,onChange:eS,shouldDisableMonth:C,onFocusedViewChange:e=>ei("month",e),monthsPerRow:U,referenceDate:es})),"day"===ee&&(0,S.jsx)(t8,(0,i.Z)({},el,eD,eP,{onMonthSwitchingAnimationEnd:ep,onFocusedDayChange:ea,reduceAnimations:x,selectedDays:eA,onSelectedDaysChange:eM,shouldDisableDate:k,shouldDisableMonth:C,shouldDisableYear:M,hasFocus:eb,onFocusedViewChange:e=>ei("day",e),showDaysOutsideCurrentMonth:V,fixedWeekNumber:N,dayOfWeekFormatter:j,displayWeekNumber:_,loading:$,renderLoading:W}))]})})]}))}),nW=({view:e,onViewChange:t,views:n,focusedView:i,onFocusedViewChange:r,value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:h,disableFuture:d,disablePast:f,minDate:p,maxDate:m,shouldDisableDate:g,shouldDisableMonth:v,shouldDisableYear:b,reduceAnimations:y,onMonthChange:w,monthsPerRow:x,onYearChange:k,yearsOrder:C,yearsPerRow:M,slots:T,slotProps:D,loading:P,renderLoading:R,disableHighlightToday:A,readOnly:O,disabled:I,showDaysOutsideCurrentMonth:E,dayOfWeekFormatter:L,sx:B,autoFocus:Z,fixedWeekNumber:F,displayWeekNumber:V,timezone:N})=>(0,S.jsx)(n$,{view:e,onViewChange:t,views:n.filter(c.Fb),focusedView:i&&(0,c.Fb)(i)?i:null,onFocusedViewChange:r,value:o,defaultValue:s,referenceDate:l,onChange:a,className:u,classes:h,disableFuture:d,disablePast:f,minDate:p,maxDate:m,shouldDisableDate:g,shouldDisableMonth:v,shouldDisableYear:b,reduceAnimations:y,onMonthChange:w,monthsPerRow:x,onYearChange:k,yearsOrder:C,yearsPerRow:M,slots:T,slotProps:D,loading:P,renderLoading:R,disableHighlightToday:A,readOnly:O,disabled:I,showDaysOutsideCurrentMonth:E,dayOfWeekFormatter:L,sx:B,autoFocus:Z,fixedWeekNumber:F,displayWeekNumber:V,timezone:N}),n_=({open:e,onOpen:t,onClose:n})=>{let i=r.useRef("boolean"==typeof e).current,[o,s]=r.useState(!1);return r.useEffect(()=>{if(i){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");s(e)}},[i,e]),{isOpen:o,setIsOpen:r.useCallback(e=>{i||s(e),e&&t&&t(),!e&&n&&n()},[i,t,n])}};var nq=n(96361);let nG=e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r}=e,o=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(i.lastPublishedValue)))},nU=e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r,closeOnSelect:o}=e,s=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(s&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!s||n(i.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(i.lastCommittedValue)},nK=e=>{let{action:t,closeOnSelect:n}=e;return"setValueFromAction"===t.name||("setValueFromView"===t.name?"finish"===t.selectionState&&n:"setValueFromShortcut"===t.name&&"accept"===t.changeImportance)},nY=({props:e,valueManager:t,valueType:n,wrapperVariant:o,validator:s})=>{let{onAccept:l,onChange:a,value:c,defaultValue:h,closeOnSelect:d="desktop"===o,timezone:f,referenceDate:p}=e,{current:m}=r.useRef(h),{current:g}=r.useRef(void 0!==c),[v,b]=r.useState(f),y=(0,u.nB)(),w=(0,u.Do)(),{isOpen:x,setIsOpen:S}=n_(e),{timezone:k,value:C,handleValueChange:M}=(0,e7.w)({timezone:f,value:c,defaultValue:m,referenceDate:p,onChange:a,valueManager:t}),[T,D]=r.useState(()=>{let e;return{draft:e=void 0!==C?C:void 0!==m?m:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:c,hasBeenModifiedSinceMount:!1}}),P=t.getTimezone(y,T.draft);v!==f&&(b(f),f&&P&&f!==P&&D(e=>(0,i.Z)({},e,{draft:t.setTimezone(y,f,e.draft)})));let{getValidationErrorForNewValue:R}=(0,nq.V)({props:e,validator:s,timezone:k,value:T.draft,onError:e.onError}),A=(0,ex.Z)(e=>{let n={action:e,dateState:T,hasChanged:n=>!t.areValuesEqual(y,e.value,n),isControlled:g,closeOnSelect:d},r=nG(n),o=nU(n),s=nK(n);D(t=>(0,i.Z)({},t,{draft:e.value,lastPublishedValue:r?e.value:t.lastPublishedValue,lastCommittedValue:o?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let a=null,u=()=>(a||(a={validationError:"setValueFromField"===e.name?e.context.validationError:R(e.value)},"setValueFromShortcut"!==e.name||(a.shortcut=e.shortcut)),a);r&&M(e.value,u()),o&&l&&l(e.value,u()),s&&S(!1)});if(T.lastControlledValue!==c){let e=t.areValuesEqual(y,T.draft,C);D(t=>(0,i.Z)({},t,{lastControlledValue:c},e?{}:{lastCommittedValue:C,lastPublishedValue:C,draft:C,hasBeenModifiedSinceMount:!0}))}let O=(0,ex.Z)(()=>{A({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),I=(0,ex.Z)(()=>{A({value:T.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=(0,ex.Z)(()=>{A({value:T.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),L=(0,ex.Z)(()=>{A({value:T.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),B=(0,ex.Z)(()=>{A({value:t.getTodayValue(y,k,n),name:"setValueFromAction",pickerAction:"today"})}),Z=(0,ex.Z)(e=>{e.preventDefault(),S(!0)}),F=(0,ex.Z)(e=>{e?.preventDefault(),S(!1)}),V=(0,ex.Z)((e,t="partial")=>A({name:"setValueFromView",value:e,selectionState:t})),N=(0,ex.Z)((e,t,n)=>A({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),j=(0,ex.Z)((e,t)=>A({name:"setValueFromField",value:e,context:t})),H={onClear:O,onAccept:I,onDismiss:E,onCancel:L,onSetToday:B,onOpen:Z,onClose:F},z={value:T.draft,onChange:j},$=r.useMemo(()=>t.cleanValue(y,T.draft),[y,t,T.draft]),W=(0,i.Z)({},H,{value:$,onChange:V,onSelectShortcut:N,isValid:n=>{let i=s({adapter:w,value:n,timezone:k,props:e});return!t.hasError(i)}}),_=r.useMemo(()=>({onOpen:Z,onClose:F,open:x}),[x,F,Z]);return{open:x,fieldProps:z,viewProps:{value:$,onChange:V,onClose:F,open:x},layoutProps:W,actions:H,contextValue:_}},nJ=["className","sx"],nX=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:o,rendererInterceptor:s,fieldRef:l})=>{let{onChange:a,open:u,onClose:c}=t,{view:h,views:d,openTo:f,onViewChange:p,viewRenderers:m,timezone:g}=e,v=(0,P.Z)(e,nJ),{view:b,setView:y,defaultView:w,focusedView:x,setFocusedView:S,setValueAndGoToNextView:k}=ek({view:h,views:d,openTo:f,onChange:a,onViewChange:p,autoFocus:o}),{hasUIView:C,viewModeLookup:M}=r.useMemo(()=>d.reduce((e,t)=>{let n;return n=null!=m[t]?"UI":"field",e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0),e},{hasUIView:!1,viewModeLookup:{}}),[m,d]),T=r.useMemo(()=>d.reduce((e,t)=>null!=m[t]&&(0,J.Is)(t)?e+1:e,0),[m,d]),D=M[b],R=(0,ex.Z)(()=>"UI"===D),[A,O]=r.useState("UI"===D?b:null);return A!==b&&"UI"===M[b]&&O(b),(0,eT.Z)(()=>{"field"===D&&u&&(c(),setTimeout(()=>{l?.current?.setSelectedSections(b),l?.current?.focusField(b)}))},[b]),(0,eT.Z)(()=>{if(!u)return;let e=b;"field"===D&&null!=A&&(e=A),e!==w&&"UI"===M[e]&&"UI"===M[w]&&(e=w),e!==b&&y(e),S(e,!0)},[u]),{hasUIView:C,shouldRestoreFocus:R,layoutProps:{views:d,view:A,onViewChange:y},renderCurrentView:()=>{if(null==A)return null;let e=m[A];if(null==e)return null;let r=(0,i.Z)({},v,n,t,{views:d,timezone:g,onChange:k,view:A,onViewChange:y,focusedView:x,onFocusedViewChange:S,showViewSwitcher:T>1,timeViewsCount:T});return s?s(m,A,r):e(r)}}};var nQ=n(45052);function n0(){return"undefined"==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"}let n1=(e,t)=>{let[n,i]=r.useState(n0);return(0,eT.Z)(()=>{let e=()=>{i(n0())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),!(0,nQ.kI)(e,["hours","minutes","seconds"])&&"landscape"===(t||n)},n2=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{let{orientation:o}=e,s=n1(n.views,o),l=(0,R.V)();return{layoutProps:(0,i.Z)({},n,t,{isLandscape:s,isRtl:l,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}},n5=({props:e,valueManager:t,valueType:n,wrapperVariant:i,additionalViewProps:o,validator:s,autoFocusView:l,rendererInterceptor:a,fieldRef:u})=>{let c=nY({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:s}),h=nX({props:e,additionalViewProps:o,autoFocusView:l,fieldRef:u,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),d=n2({props:e,wrapperVariant:i,propsFromPickerValue:c.layoutProps,propsFromPickerViews:h.layoutProps}),f=function(e){let{props:t,pickerValueResponse:n}=e;return r.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:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:h.renderCurrentView,hasUIView:h.hasUIView,shouldRestoreFocus:h.shouldRestoreFocus,layoutProps:d.layoutProps,contextValue:c.contextValue,ownerState:f}};var n3=n(53578);function n4(e){return(0,y.ZP)("MuiPickersLayout",e)}let n8=(0,w.Z)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]);var n9=n(70616);let n6=["onAccept","onClear","onCancel","onSetToday","actions"];function n7(e){let{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:s}=e,l=(0,P.Z)(e,n6),a=(0,b.M)();if(null==s||0===s.length)return null;let u=s?.map(e=>{switch(e){case"clear":return S.jsx(W.Z,{onClick:n,children:a.clearButtonLabel},e);case"cancel":return S.jsx(W.Z,{onClick:r,children:a.cancelButtonLabel},e);case"accept":return S.jsx(W.Z,{onClick:t,children:a.okButtonLabel},e);case"today":return S.jsx(W.Z,{onClick:o,children:a.todayButtonLabel},e);default:return null}});return(0,S.jsx)(n9.Z,(0,i.Z)({},l,{children:u}))}var ie=n(71852),it=n(88653),ii=n(82319),ir=n(51751),io=n(70777),is=n(51183),il=n(78849);function ia(e){return(0,y.ZP)("MuiListItem",e)}(0,w.Z)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);var iu=n(3552);function ic(e){return(0,y.ZP)("MuiListItemSecondaryAction",e)}(0,w.Z)("MuiListItemSecondaryAction",["root","disableGutters"]);let ih=e=>{let{disableGutters:t,classes:n}=e;return(0,g.Z)({root:["root",t&&"disableGutters"]},ic,n)},id=(0,m.ZP)("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}}]}),ip=r.forwardRef(function(e,t){let n=(0,ir.i)({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...o}=n,s=r.useContext(il.Z),l={...n,disableGutters:s.disableGutters},a=ih(l);return(0,S.jsx)(id,{className:(0,h.Z)(a.root,i),ownerState:l,ref:t,...o})});ip.muiName="ListItemSecondaryAction";let im=e=>{let{alignItems:t,classes:n,dense:i,disableGutters:r,disablePadding:o,divider:s,hasSecondaryAction:l}=e;return(0,g.Z)({root:["root",i&&"dense",!r&&"gutters",!o&&"padding",s&&"divider","flex-start"===t&&"alignItemsFlexStart",l&&"secondaryAction"],container:["container"]},ia,n)},ig=(0,m.ZP)("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,ii.Z)(({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:{[`& > .${iu.Z.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}}]}))),iv=(0,m.ZP)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),ib=r.forwardRef(function(e,t){let n=(0,ir.i)({props:e,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:l,components:a={},componentsProps:u={},ContainerComponent:c="li",ContainerProps:{className:d,...f}={},dense:p=!1,disableGutters:m=!1,disablePadding:g=!1,divider:v=!1,secondaryAction:b,slotProps:y={},slots:w={},...x}=n,k=r.useContext(il.Z),C=r.useMemo(()=>({dense:p||k.dense||!1,alignItems:i,disableGutters:m}),[i,k.dense,p,m]),M=r.useRef(null),T=r.Children.toArray(o),D=T.length&&(0,io.Z)(T[T.length-1],["ListItemSecondaryAction"]),P={...n,alignItems:i,dense:C.dense,disableGutters:m,disablePadding:g,divider:v,hasSecondaryAction:D},R=im(P),A=(0,is.Z)(M,t),O=w.root||a.Root||ig,I=y.root||u.root||{},E={className:(0,h.Z)(R.root,I.className,s),...x},L=l||"li";return D?(L=E.component||l?L:"div","li"===c&&("li"===L?L="div":"li"===E.component&&(E.component="div")),(0,S.jsx)(il.Z.Provider,{value:C,children:(0,S.jsxs)(iv,{as:c,className:(0,h.Z)(R.container,d),ref:A,ownerState:P,...f,children:[(0,S.jsx)(O,{...I,...!(0,it.Z)(O)&&{as:L,ownerState:{...P,...I.ownerState}},...E,children:T}),T.pop()]})})):(0,S.jsx)(il.Z.Provider,{value:C,children:(0,S.jsxs)(O,{...I,as:L,ref:A,...!(0,it.Z)(O)&&{ownerState:{...P,...I.ownerState}},...E,children:[T,b&&(0,S.jsx)(ip,{children:b})]})})});var iy=n(52889);let iw=["items","changeImportance","isLandscape","onChange","isValid"],ix=["getValue"];function iS(e){let{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,s=(0,P.Z)(e,iw);if(null==t||0===t.length)return null;let l=t.map(e=>{let{getValue:t}=e,s=(0,P.Z)(e,ix),l=t({isValid:o});return(0,i.Z)({},s,{label:s.label,onClick:()=>{r(l,n,s)},disabled:!o(l)})});return(0,S.jsx)(ie.Z,(0,i.Z)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(s.sx)?s.sx:[s.sx]]},s,{children:l.map(e=>(0,S.jsx)(ib,{children:(0,S.jsx)(iy.Z,(0,i.Z)({},e))},e.id??e.label))}))}let ik=e=>{let{classes:t,isLandscape:n}=e;return(0,g.Z)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},n4,t)},iC=e=>{let{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:s,view:l,views:a,onViewChange:u,value:c,onChange:h,onSelectShortcut:d,isValid:f,isLandscape:p,disabled:m,readOnly:g,children:v,slots:b,slotProps:y}=e,w=ik(e),x=b?.actionBar??n7,k=(0,ec.Z)({elementType:x,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:s,actions:"desktop"===t?[]:["cancel","accept"]},className:w.actionBar,ownerState:(0,i.Z)({},e,{wrapperVariant:t})}),C=(0,S.jsx)(x,(0,i.Z)({},k)),M=b?.toolbar,T=(0,ec.Z)({elementType:M,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:p,onChange:h,value:c,view:l,onViewChange:u,views:a,disabled:m,readOnly:g},className:w.toolbar,ownerState:(0,i.Z)({},e,{wrapperVariant:t})}),D=null!==T.view&&M?(0,S.jsx)(M,(0,i.Z)({},T)):null,P=b?.tabs,R=l&&P?(0,S.jsx)(P,(0,i.Z)({view:l,onViewChange:u,className:w.tabs},y?.tabs)):null,A=b?.shortcuts??iS,O=(0,ec.Z)({elementType:A,externalSlotProps:y?.shortcuts,additionalProps:{isValid:f,isLandscape:p,onChange:d},className:w.shortcuts,ownerState:{isValid:f,isLandscape:p,onChange:d,wrapperVariant:t}});return{toolbar:D,content:v,tabs:R,actionBar:C,shortcuts:l&&A?(0,S.jsx)(A,(0,i.Z)({},O)):null}},iM=e=>{let{isLandscape:t,classes:n}=e;return(0,g.Z)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},n4,n)},iT=(0,m.ZP)("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${n8.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${n8.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${n8.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${n8.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${n8.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${n8.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${n8.shortcuts}`]:{gridColumn:3}}}]}),iD=(0,m.ZP)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),iP=r.forwardRef(function(e,t){let n=(0,a.Z)({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:l,shortcuts:u}=iC(n),{sx:c,className:d,isLandscape:f,wrapperVariant:p}=n,m=iM(n);return(0,S.jsxs)(iT,{ref:t,sx:c,className:(0,h.Z)(m.root,d),ownerState:n,children:[f?u:i,f?i:u,(0,S.jsx)(iD,{className:m.contentWrapper,children:"desktop"===p?(0,S.jsxs)(r.Fragment,{children:[o,s]}):(0,S.jsxs)(r.Fragment,{children:[s,o]})}),l]})}),iR=["props","ref"],iA=(0,m.ZP)(iP)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),iO=e=>{let{props:t,ref:n}=e,r=(0,P.Z)(e,iR),{localeText:o,slots:s,slotProps:l,className:a,sx:u,displayStaticWrapperAs:c,autoFocus:d}=t,{layoutProps:f,renderCurrentView:p}=n5((0,i.Z)({},r,{props:t,autoFocusView:d??!1,additionalViewProps:{},wrapperVariant:c})),m=s?.layout??iA;return{renderPicker:()=>(0,S.jsx)(n3._,{localeText:o,children:(0,S.jsx)(m,(0,i.Z)({},f,l?.layout,{slots:s,slotProps:l,sx:[...Array.isArray(u)?u:[u],...Array.isArray(l?.layout?.sx)?l.layout.sx:[l?.layout?.sx]],className:(0,h.Z)(a,l?.layout?.className),ref:n,children:p()}))})}};var iI=n(60191);let iE=r.forwardRef(function(e,t){let n=function(e,t){let n=(0,u.nB)(),o=(0,u.PP)(),s=(0,a.Z)({props:e,name:t}),l=s.ampm??n.is12HourCycleInCurrentLocale(),h=r.useMemo(()=>s.localeText?.toolbarTitle==null?s.localeText:(0,i.Z)({},s.localeText,{dateTimePickerToolbarTitle:s.localeText.toolbarTitle}),[s.localeText]);return(0,i.Z)({},s,ea({views:s.views,openTo:s.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:l,localeText:h,orientation:s.orientation??"portrait",disableIgnoringDatePartForTimeValidation:s.disableIgnoringDatePartForTimeValidation??!!(s.minDateTime||s.maxDateTime||s.disablePast||s.disableFuture),disableFuture:s.disableFuture??!1,disablePast:s.disablePast??!1,minDate:(0,c.US)(n,s.minDateTime??s.minDate,o.minDate),maxDate:(0,c.US)(n,s.maxDateTime??s.maxDate,o.maxDate),minTime:s.minDateTime??s.minTime,maxTime:s.maxDateTime??s.maxTime,slots:(0,i.Z)({toolbar:el,tabs:D},s.slots),slotProps:(0,i.Z)({},s.slotProps,{toolbar:(0,i.Z)({ampm:l},s.slotProps?.toolbar)})})}(e,"MuiStaticDateTimePicker"),o=n.displayStaticWrapperAs??"mobile",s=n.ampmInClock??"desktop"===o,l=(0,i.Z)({day:nW,month:nW,year:nW,hours:tu,minutes:tu,seconds:tu},n.viewRenderers),{renderPicker:h}=iO({props:(0,i.Z)({},n,{viewRenderers:l,displayStaticWrapperAs:o,ampmInClock:s,yearsPerRow:n.yearsPerRow??("mobile"===o?3:4),slotProps:(0,i.Z)({},n.slotProps,{tabs:(0,i.Z)({hidden:"desktop"===o},n.slotProps?.tabs),toolbar:(0,i.Z)({hidden:"desktop"===o,ampmInClock:s},n.slotProps?.toolbar)})}),valueManager:te.h,valueType:"date-time",validator:iI.P,ref:t});return h()});iE.propTypes={ampm:l().bool,ampmInClock:l().bool,autoFocus:l().bool,className:l().string,dayOfWeekFormatter:l().func,defaultValue:l().object,disabled:l().bool,disableFuture:l().bool,disableHighlightToday:l().bool,disableIgnoringDatePartForTimeValidation:l().bool,disablePast:l().bool,displayStaticWrapperAs:l().oneOf(["desktop","mobile"]),displayWeekNumber:l().bool,fixedWeekNumber:l().number,loading:l().bool,localeText:l().object,maxDate:l().object,maxDateTime:l().object,maxTime:l().object,minDate:l().object,minDateTime:l().object,minTime:l().object,minutesStep:l().number,monthsPerRow:l().oneOf([3,4]),onAccept:l().func,onChange:l().func,onClose:l().func,onError:l().func,onMonthChange:l().func,onViewChange:l().func,onYearChange:l().func,openTo:l().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:l().oneOf(["landscape","portrait"]),readOnly:l().bool,reduceAnimations:l().bool,referenceDate:l().object,renderLoading:l().func,shouldDisableDate:l().func,shouldDisableMonth:l().func,shouldDisableTime:l().func,shouldDisableYear:l().func,showDaysOutsideCurrentMonth:l().bool,slotProps:l().object,slots:l().object,sx:l().oneOfType([l().arrayOf(l().oneOfType([l().func,l().object,l().bool])),l().func,l().object]),timezone:l().string,value:l().object,view:l().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:l().shape({day:l().func,hours:l().func,minutes:l().func,month:l().func,seconds:l().func,year:l().func}),views:l().arrayOf(l().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:l().oneOf(["asc","desc"]),yearsPerRow:l().oneOf([3,4])}},25839:function(e,t,n){"use strict";n.d(t,{M:()=>r});var i=n(33835);let r=()=>(0,i.Do)().localeText},63640:function(e,t,n){"use strict";n.d(t,{LZ:()=>a,Rk:()=>h,Y4:()=>l,ch:()=>s,wZ:()=>c,x:()=>u});var i=n(90247),r=n(54538),o=n(24246);let s=(0,i.Z)((0,o.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),l=(0,i.Z)((0,o.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),a=(0,i.Z)((0,o.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,i.Z)((0,o.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,i.Z)((0,o.jsxs)(r.Fragment,{children:[(0,o.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,o.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let u=(0,i.Z)((0,o.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"),c=(0,i.Z)((0,o.jsxs)(r.Fragment,{children:[(0,o.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,o.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),h=(0,i.Z)((0,o.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")},65048:function(e,t,n){"use strict";n.d(t,{$9:()=>D,Ay:()=>c,Dt:()=>P,E1:()=>x,Gq:()=>h,IE:()=>k,J9:()=>I,N2:()=>R,P$:()=>p,R7:()=>s,S9:()=>u,Su:()=>y,Yb:()=>f,Yo:()=>v,dI:()=>O,eM:()=>A,j5:()=>d,lt:()=>w,no:()=>S,o$:()=>m,tg:()=>g,wk:()=>l,wz:()=>C,z1:()=>r});var i=n(39399);let r=(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.
|
|
4
|
-
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}},o=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return -1;case"PageUp":return 5;case"PageDown":return -5;default:return 0}},s=(e,t)=>{let n=[],i=e.date(void 0,"default"),r=e.startOfWeek(i),o=e.endOfWeek(i),s=r;for(;e.isBefore(s,o);)n.push(s),s=e.addDays(s,1);return n.map(n=>e.formatByString(n,t))},l=(e,t,n,r)=>{switch(n){case"month":return(0,i.SV)(e,e.date(void 0,t)).map(t=>e.formatByString(t,r));case"weekDay":return s(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[]}},a=["0","1","2","3","4","5","6","7","8","9"],u=e=>{let t=e.date(void 0);return"0"===e.formatByString(e.setSeconds(t,0),"s")?a:Array.from({length:10}).map((n,i)=>e.formatByString(e.setSeconds(t,i),"s"))},c=(e,t)=>{if("0"===t[0])return e;let n=[],i="";for(let r=0;r<e.length;r+=1){i+=e[r];let o=t.indexOf(i);o>-1&&(n.push(o.toString()),i="")}return n.join("")},h=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),d=(e,t)=>{let n=c(e,t);return" "!==n&&!Number.isNaN(Number(n))},f=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},p=(e,t,n,i,r)=>{if("day"===r.type&&"digit-with-letter"===r.contentType){let i=e.setDate(n.longestMonth,t);return e.formatByString(i,r.format)}let o=t.toString();return r.hasLeadingZerosInInput&&(o=f(o,r.maxLength)),h(o,i)},m=(e,t,n,i,r,s,a,u)=>{let h=o(i),d="Home"===i,f="End"===i,m=""===n.value||d||f;return"digit"===n.contentType||"digit-with-letter"===n.contentType?(()=>{let i=r[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),o=t=>p(e,t,i,s,n),l="minutes"===n.type&&u?.minutesStep?u.minutesStep:1,g=parseInt(c(n.value,s),10)+h*l;if(m){if("year"===n.type&&!f&&!d)return e.formatByString(e.date(void 0,t),n.format);g=h>0||d?i.minimum:i.maximum}return o((g%l!=0&&((h<0||d)&&(g+=l-(l+g)%l),(h>0||f)&&(g-=g%l)),g>i.maximum)?i.minimum+(g-i.maximum-1)%(i.maximum-i.minimum+1):g<i.minimum?i.maximum-(i.minimum-g-1)%(i.maximum-i.minimum+1):g)})():(()=>{let i=l(e,t,n.type,n.format);if(0===i.length)return n.value;if(m)return h>0||d?i[0]:i[i.length-1];let r=((i.indexOf(n.value)+h)%i.length+i.length)%i.length;return i[r]})()},g=(e,t,n)=>{let i=e.value||e.placeholder,r="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(i=Number(c(i,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!r&&1===i.length&&(i=`${i}\u200e`),"input-rtl"===t&&(i=`\u2068${i}\u2069`),i},v=(e,t,n,i)=>e.formatByString(e.parse(t,n),i),b=(e,t)=>4===e.formatByString(e.date(void 0,"system"),t).length,y=(e,t,n,i)=>{if("digit"!==t)return!1;let r=e.date(void 0,"default");switch(n){case"year":if(b(e,i))return"0001"===e.formatByString(e.setYear(r,1),i);return"01"===e.formatByString(e.setYear(r,2001),i);case"month":return e.formatByString(e.startOfYear(r),i).length>1;case"day":return e.formatByString(e.startOfMonth(r),i).length>1;case"weekDay":return e.formatByString(e.startOfWeek(r),i).length>1;case"hours":return e.formatByString(e.setHours(r,1),i).length>1;case"minutes":return e.formatByString(e.setMinutes(r,1),i).length>1;case"seconds":return e.formatByString(e.setSeconds(r,1),i).length>1;default:throw Error("Invalid section type")}},w=(e,t,n)=>{let i=t.some(e=>"day"===e.type),r=[],o=[];for(let e=0;e<t.length;e+=1){let s=t[e];i&&"weekDay"===s.type||(r.push(s.format),o.push(g(s,"non-input",n)))}let s=r.join(" "),l=o.join(" ");return e.parse(l,s)},x=e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),S=(e,t,n)=>{let i=e.map(e=>{let i=g(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${i}${e.endSeparator}`}).join("");return n?`\u2066${i}\u2069`:i},k=(e,t,n)=>{let r=e.date(void 0,n),o=e.endOfYear(r),l=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:u}=(0,i.SV)(e,r).reduce((t,n)=>{let i=e.getDaysInMonth(n);return i>t.maxDaysInMonth?{maxDaysInMonth:i,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:b(e,t)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:t})=>({minimum:1,maximum:null!=t&&e.isValid(t)?e.getDaysInMonth(t):a,longestMonth:u}),weekDay:({format:t,contentType:n})=>{if("digit"===n){let n=s(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(l);return c(e.formatByString(e.endOfDay(r),n),t)!==i.toString()?{minimum:1,maximum:Number(c(e.formatByString(e.startOfDay(r),n),t))}:{minimum:0,maximum:i}},minutes:()=>({minimum:0,maximum:e.getMinutes(l)}),seconds:()=>({minimum:0,maximum:e.getSeconds(l)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},C=(e,t)=>{},M=(e,t,n,i)=>{switch(t.type){case"year":return e.setYear(i,e.getYear(n));case"month":return e.setMonth(i,e.getMonth(n));case"weekDay":{let i=s(e,t.format),r=e.formatByString(n,t.format),o=i.indexOf(r),l=i.indexOf(t.value);return e.addDays(n,l-o)}case"day":return e.setDate(i,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),r=e.getHours(i);if(t&&r>=12)return e.addHours(i,-12);if(!t&&r<12)return e.addHours(i,12);return i}case"hours":return e.setHours(i,e.getHours(n));case"minutes":return e.setMinutes(i,e.getMinutes(n));case"seconds":return e.setSeconds(i,e.getSeconds(n));default:return i}},T={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},D=(e,t,n,i,r)=>[...n].sort((e,t)=>T[e.type]-T[t.type]).reduce((n,i)=>!r||i.modified?M(e,i,t,n):n,i),P=()=>navigator.userAgent.toLowerCase().includes("android"),R=(e,t)=>{let n={};if(!t)return e.forEach((t,i)=>{let r=i===e.length-1?null:i+1;n[i]={leftIndex:0===i?null:i-1,rightIndex:r}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let i={},r={},o=0,s=0,l=e.length-1;for(;l>=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)r[e]=l,i[l]=e,l-=1;o=s+1}return e.forEach((t,o)=>{let s=r[o],l=0===s?null:i[s-1],a=s===e.length-1?null:i[s+1];n[o]={leftIndex:l,rightIndex:a}}),{neighbors:n,startIndex:i[0],endIndex:i[e.length-1]}},A=(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},O=(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}},I=(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}}},33835:function(e,t,n){"use strict";n.d(t,{PP:()=>u,Do:()=>l,nB:()=>a,mX:()=>c});var i=n(70252),r=n(54538),o=n(53578);let s={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,i)=>`Select ${e}. ${i||null!==t&&n.isValid(t)?`Selected time is ${i??n.format(t,"fullTime")}`:"No time selected"}`,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,i.Z)({},s);let l=()=>{let e=r.useContext(o.y);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=r.useMemo(()=>(0,i.Z)({},s,e.localeText),[e.localeText]);return r.useMemo(()=>(0,i.Z)({},e,{localeText:t}),[e,t])},a=()=>l().utils,u=()=>l().defaultDates,c=e=>{let t=a(),n=r.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current}},89681:function(e,t,n){"use strict";n.d(t,{m:()=>a,w:()=>l});var i=n(54538),r=n(81925),o=n(9831),s=n(33835);let l=({timezone:e,value:t,defaultValue:n,referenceDate:o,onChange:l,valueManager:a})=>{let u;let c=(0,s.nB)(),h=i.useRef(n),d=t??h.current??a.emptyValue,f=i.useMemo(()=>a.getTimezone(c,d),[c,a,d]),p=(0,r.Z)(e=>null==f?e:a.setTimezone(c,f,e));return u=e||f||(o?c.getTimezone(o):"default"),{value:i.useMemo(()=>a.setTimezone(c,u,d),[a,c,u,d]),handleValueChange:(0,r.Z)((e,...t)=>{let n=p(e);l?.(n,...t)}),timezone:u}},a=({name:e,timezone:t,value:n,defaultValue:i,referenceDate:s,onChange:a,valueManager:u})=>{let[c,h]=(0,o.Z)({name:e,state:"value",controlled:n,default:i??u.emptyValue});return l({timezone:t,value:c,defaultValue:void 0,referenceDate:s,onChange:(0,r.Z)((e,...t)=>{h(e),a?.(e,...t)}),valueManager:u})}},39399:function(e,t,n){"use strict";n.d(t,{D1:()=>f,Fb:()=>d,LZ:()=>l,SV:()=>a,US:()=>s,X$:()=>u,ai:()=>o,lu:()=>c,xP:()=>r,zu:()=>i});let i=(e,t,n)=>{let i=t;return i=e.setHours(i,e.getHours(n)),i=e.setMinutes(i,e.getMinutes(n)),i=e.setSeconds(i,e.getSeconds(n)),i=e.setMilliseconds(i,e.getMilliseconds(n))},r=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:s,utils:l,timezone:a})=>{let u=i(l,l.date(void 0,a),e);n&&l.isBefore(o,u)&&(o=u),t&&l.isAfter(r,u)&&(r=u);let c=e,h=e;for(l.isBefore(e,o)&&(c=o,h=null),l.isAfter(e,r)&&(h&&(h=r),c=null);c||h;){if(c&&l.isAfter(c,r)&&(c=null),h&&l.isBefore(h,o)&&(h=null),c){if(!s(c))return c;c=l.addDays(c,1)}if(h){if(!s(h))return h;h=l.addDays(h,-1)}}return null},o=(e,t)=>null!=t&&e.isValid(t)?t:null,s=(e,t,n)=>null!=t&&e.isValid(t)?t:n,l=(e,t,n)=>!(e.isValid(t)||null==t||e.isValid(n))&&null!=n||e.isEqual(t,n),a=(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},u=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),c=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},h=["year","month","day"],d=e=>h.includes(e),f=(e,t)=>{let n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(t=>e.addDays(n,t))}},1556:function(e,t,n){"use strict";n.d(t,{Kn:()=>o,hV:()=>s,yw:()=>a});var i=n(35211),r=n(39399);let o={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},s=e=>Math.max(...e.map(e=>o[e.type]??1)),l=(e,t,n)=>{if(t===o.year)return e.startOfYear(n);if(t===o.month)return e.startOfMonth(n);if(t===o.day)return e.startOfDay(n);let i=n;return t<o.minutes&&(i=e.setMinutes(i,0)),t<o.seconds&&(i=e.setSeconds(i,0)),t<o.milliseconds&&(i=e.setMilliseconds(i,0)),i},a=({props:e,utils:t,granularity:n,timezone:o,getTodayDate:s})=>{let a=s?s():l(t,n,(0,r.X$)(t,o));null!=e.minDate&&t.isAfterDay(e.minDate,a)&&(a=l(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,a)&&(a=l(t,n,e.maxDate));let u=(0,i.X4)(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&u(e.minTime,a)&&(a=l(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:(0,r.zu)(t,a,e.minTime))),null!=e.maxTime&&u(a,e.maxTime)&&(a=l(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:(0,r.zu)(t,a,e.maxTime))),a}},35211:function(e,t,n){"use strict";n.d(t,{Is:()=>r,X4:()=>u,b_:()=>s,wp:()=>l,xX:()=>o});let i=["hours","minutes","seconds"],r=e=>i.includes(e),o=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,s=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,l=(e,t,n,i)=>{let r=s(i.getHours(e),t,n);return i.setHours(e,r)},a=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),u=(e,t)=>(n,i)=>e?t.isAfter(n,i):a(n,t)>a(i,t)},45052:function(e,t,n){"use strict";function i(e,t){return Array.isArray(t)?t.every(t=>-1!==e.indexOf(t)):-1!==e.indexOf(t)}n.d(t,{kI:()=>i,vY:()=>r});let r=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?r(t.shadowRoot):t:null}},64757:function(e,t,n){"use strict";n.d(t,{a:()=>u,h:()=>a});var i=n(97784),r=n(39399),o=n(1556),s=n(65048);let l=["value","referenceDate"],a={emptyValue:null,getTodayValue:r.X$,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=(0,i.Z)(e,l);return null!=t&&r.utils.isValid(t)?t:null!=n?n:(0,o.yw)(r)},cleanValue:r.ai,areValuesEqual:r.LZ,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)},u={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,i)=>!e.isValid(t)&&n?n:i(t),getV7HiddenInputValueFromSections:s.E1,getV6InputValueFromSections:s.no,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)}},96361:function(e,t,n){"use strict";n.d(t,{V:()=>s});var i=n(54538),r=n(81925),o=n(33835);function s(e){let{props:t,validator:n,value:s,timezone:l,onError:a}=e,u=(0,o.Do)(),c=i.useRef(n.valueManager.defaultErrorState),h=n({adapter:u,value:s,timezone:l,props:t}),d=n.valueManager.hasError(h);return i.useEffect(()=>{a&&!n.valueManager.isSameError(h,c.current)&&a(h,s),c.current=h},[n,a,h,s]),{validationError:h,hasValidationError:d,getValidationErrorForNewValue:(0,r.Z)(e=>n({adapter:u,value:e,timezone:l,props:t}))}}},24303:function(e,t,n){"use strict";n.d(t,{q:()=>o});var i=n(39399),r=n(64757);let o=({props:e,value:t,timezone:n,adapter:r})=>{if(null===t)return null;let{shouldDisableDate:o,shouldDisableMonth:s,shouldDisableYear:l,disablePast:a,disableFuture:u}=e,c=r.utils.date(void 0,n),h=(0,i.US)(r.utils,e.minDate,r.defaultDates.minDate),d=(0,i.US)(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(s&&s(t)):return"shouldDisableMonth";case!!(l&&l(t)):return"shouldDisableYear";case!!(u&&r.utils.isAfterDay(t,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(t,c)):return"disablePast";case!!(h&&r.utils.isBeforeDay(t,h)):return"minDate";case!!(d&&r.utils.isAfterDay(t,d)):return"maxDate";default:return null}};o.valueManager=r.h},60191:function(e,t,n){"use strict";n.d(t,{P:()=>l});var i=n(24303),r=n(35211),o=n(64757);let s=({adapter:e,value:t,timezone:n,props:i})=>{if(null===t)return null;let{minTime:o,maxTime:s,minutesStep:l,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:u=!1,disablePast:c,disableFuture:h}=i,d=e.utils.date(void 0,n),f=(0,r.X4)(u,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(o&&f(o,t)):return"minTime";case!!(s&&f(t,s)):return"maxTime";case!!(h&&e.utils.isAfter(t,d)):return"disableFuture";case!!(c&&e.utils.isBefore(t,d)):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!!(l&&e.utils.getMinutes(t)%l!=0):return"minutesStep";default:return null}};s.valueManager=o.h;let l=({adapter:e,value:t,timezone:n,props:r})=>{let o=(0,i.q)({adapter:e,value:t,timezone:n,props:r});return null!==o?o:s({adapter:e,value:t,timezone:n,props:r})};l.valueManager=o.h},12711:function(){},89479:function(){},99511:function(){},53213:function(){},97313:function(e,t,n){"use strict";n.d(t,{ZP:()=>nN});var i=n(70252),r=n(97784),o=n(54538),s=n(69444),l=n(69485),a=n(61262),u=n(19294);function c(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}let h=c(function(e,t,n=t.selection.ranges){let i=[],r=-1;for(let{from:e,to:o}of n){let n=i.length,s=1e9,l=p(t,e).line;if(l){for(let n=e;n<=o;){let a=t.doc.lineAt(n);if(a.from>r&&(e==o||o>a.from)){r=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+l.length)==l?e:-1;e<a.text.length&&e<s&&(s=e),i.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(s<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=s);i.length==n+1&&(i[n].single=!0)}}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:s}of i)(s||!o)&&e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,o=i+r.length;" "==t.text[o-t.from]&&o++,e.push({from:i,to:o})}return{changes:e}}return null},0),d=c(m,0),f=c((e,t)=>m(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>i.from?t[o].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function p(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function m(e,t,n=t.selection.ranges){let i=n.map(e=>p(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let o,s,l=e.sliceDoc(i-50,i),a=e.sliceDoc(r,r+50),u=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,h=l.length-u;if(l.slice(h-t.length,h)==t&&a.slice(c,c+n.length)==n)return{open:{pos:i-u,margin:u&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?o=s=e.sliceDoc(i,r):(o=e.sliceDoc(i,i+50),s=e.sliceDoc(r-50,r));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:i+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:r-f-n.length,margin:+!!/\s/.test(s.charAt(p-1))}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t=0,n;t<r.length;t++)if(n=r[t]){let r=i[t],{open:o,close:s}=n;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+r.close.length})}return{changes:e}}return null}let g=s.q6.define(),v=s.q6.define(),b=s.r$.define(),y=s.r$.define({combine:e=>(0,s.BO)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),w=s.QQ.define({create:()=>E.empty,update(e,t){let n=t.state.facet(y),i=t.annotation(g);if(i){let r=T.fromTransaction(t,i.selection),o=i.side,s=0==o?e.undone:e.done;return s=r?D(s,s.length,n.minDepth,r):A(s,t.startState.selection),new E(0==o?i.rest:s,0==o?s:i.rest)}let r=t.annotation(v);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(s.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=T.fromTransaction(t),l=t.annotation(s.YW.time),a=t.annotation(s.YW.userEvent);return o?e=e.addChanges(o,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new E(e.done.map(T.fromJSON),e.undone.map(T.fromJSON))});function x(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(w,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}let S=x(0,!1),k=x(1,!1),C=x(0,!0),M=x(1,!0);class T{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new T(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new T(e.changes&&s.as.fromJSON(e.changes),[],e.mapped&&s.n0.fromJSON(e.mapped),e.startSelection&&s.jT.fromJSON(e.startSelection),e.selectionsAfter.map(s.jT.fromJSON))}static fromTransaction(e,t){let n=R;for(let t of e.startState.facet(b)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new T(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,R)}static selection(e){return new T(void 0,R,void 0,void 0,e)}}function D(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function P(e,t){return e.length?t.length?e.concat(t):e:t}let R=[];function A(e,t){if(!e.length)return[T.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),D(e,e.length-1,1e9,n.setSelAfter(i)))}}function O(e,t){if(!e.length)return e;let n=e.length,i=R;for(;n;){let r=function(e,t,n){let i=P(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):R,n);if(!e.changes)return T.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(o):o;return new T(r,s.Py.mapEffects(e.effects,t),l,e.startSelection.map(o),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[T.selection(i)]:R}let I=/^(input\.type|delete)($|\.)/;class E{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new E(this.done,this.undone):this}addChanges(e,t,n,i,r){var o,l;let a,u,c=this.done,h=c[c.length-1];return new E(c=h&&h.changes&&!h.changes.empty&&e.changes&&(!n||I.test(n))&&(!h.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(o=h.changes,l=e.changes,a=[],u=!1,o.iterChangedRanges((e,t)=>a.push(e,t)),l.iterChangedRanges((e,t,n,i)=>{for(let e=0;e<a.length;){let t=a[e++],r=a[e++];i>=t&&n<=r&&(u=!0)}}),u))||"input.type.compose"==n)?D(c,c.length-1,i.minDepth,new T(e.changes.compose(h.changes),P(s.Py.mapEffects(e.effects,h.changes),h.effects),h.mapped,h.startSelection,R)):D(c,c.length,i.minDepth,e),R,t,n)}addSelection(e,t,n,i){var r;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:R;return o.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(r=o[o.length-1]).ranges.length==e.ranges.length&&0===r.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length?this:new E(A(this.done,e),this.undone,t,n)}addMapping(e){return new E(O(this.done,e),O(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length){let n,s;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:g.of({side:e,rest:(n=i[i.length-1],(s=i.slice())[i.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(!r.changes)return null;{let n=1==i.length?R:i.slice(0,i.length-1);return r.mapped&&(n=O(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:g.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}E.empty=new E(R,R);let L=[{key:"Mod-z",run:S,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:k,preventDefault:!0},{linux:"Ctrl-Shift-z",run:k,preventDefault:!0},{key:"Mod-u",run:C,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:M,preventDefault:!0}];function B(e,t){return s.jT.create(e.ranges.map(t),e.mainIndex)}function Z(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function F({state:e,dispatch:t},n){let i=B(e.selection,n);return!i.eq(e.selection,!0)&&(t(Z(e,i)),!0)}function V(e,t){return s.jT.cursor(t?e.to:e.from)}function N(e,t){return F(e,n=>n.empty?e.moveByChar(n,t):V(n,t))}function j(e){return e.textDirectionAt(e.state.selection.main.head)==l.Nm.LTR}let H=e=>N(e,!j(e)),z=e=>N(e,j(e));function $(e,t){return F(e,n=>n.empty?e.moveByGroup(n,t):V(n,t))}function W(e,t,n){let i,r,o=(0,a.qz)(e).resolveInner(t.head),l=n?u.md.closedBy:u.md.openedBy;for(let i=t.head;;){let t=n?o.childAfter(i):o.childBefore(i);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,l)?i=n?t.to:t.from:o=t}return r=o.type.prop(l)&&(i=n?(0,a.Um)(e,o.from,1):(0,a.Um)(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,s.jT.cursor(r,n?-1:1)}function _(e,t){return F(e,n=>{if(!n.empty)return V(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;let q=e=>_(e,!1),G=e=>_(e,!0);function U(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,r;if(t){for(let t of e.state.facet(l.tk.scrollMargins)){let r=t(e);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(i=Math.max(null==r?void 0:r.bottom,i))}r=e.scrollDOM.clientHeight-n-i}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function K(e,t){let n,i=U(e),{state:r}=e,o=B(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):V(n,t));if(o.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+i.marginTop,u=s.bottom-i.marginBottom;t&&t.top>a&&t.bottom<u&&(n=l.tk.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(Z(r,o),{effects:n}),!0}let Y=e=>K(e,!1),J=e=>K(e,!0);function X(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=s.jT.cursor(i.from+n))}return r}function Q(e,t){let n=B(e.state.selection,e=>{let n=t(e);return s.jT.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(Z(e.state,n)),!0)}function ee(e,t){return Q(e,n=>e.moveByChar(n,t))}let et=e=>ee(e,!j(e)),en=e=>ee(e,j(e));function ei(e,t){return Q(e,n=>e.moveByGroup(n,t))}function er(e,t){return Q(e,n=>e.moveVertically(n,t))}let eo=e=>er(e,!1),es=e=>er(e,!0);function el(e,t){return Q(e,n=>e.moveVertically(n,t,U(e).height))}let ea=e=>el(e,!1),eu=e=>el(e,!0),ec=({state:e,dispatch:t})=>(t(Z(e,{anchor:0})),!0),eh=({state:e,dispatch:t})=>(t(Z(e,{anchor:e.doc.length})),!0),ed=({state:e,dispatch:t})=>(t(Z(e,{anchor:e.selection.main.anchor,head:0})),!0),ef=({state:e,dispatch:t})=>(t(Z(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function ep(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:o}=i;if(r==o){let s=t(i);s<r?(n="delete.backward",s=em(e,s,!1)):s>r&&(n="delete.forward",s=em(e,s,!0)),r=Math.min(r,s),o=Math.max(o,s)}else r=em(e,r,!1),o=em(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:s.jT.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?l.tk.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function em(e,t,n){if(e instanceof l.tk)for(let i of e.state.facet(l.tk.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}let eg=(e,t,n)=>ep(e,i=>{let r=i.from,{state:o}=e,l=o.doc.lineAt(r),u,c;if(n&&!t&&r>l.from&&r<l.from+200&&!/[^ \t]/.test(u=l.text.slice(0,r-l.from))){if(" "==u[u.length-1])return r-1;let e=(0,s.IS)(u,o.tabSize)%(0,a.y1)(o)||(0,a.y1)(o);for(let t=0;t<e&&" "==u[u.length-1-t];t++)r--;c=r}else(c=(0,s.cp)(l.text,r-l.from,t,t)+l.from)==r&&l.number!=(t?o.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,r-l.from))&&(c=(0,s.cp)(l.text,c-l.from,!1,!1)+l.from);return c}),ev=e=>eg(e,!1,!0),eb=e=>eg(e,!0,!1),ey=(e,t)=>ep(e,n=>{let i=n.head,{state:r}=e,o=r.doc.lineAt(i),l=r.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let a=(0,s.cp)(o.text,i-o.from,t)+o.from,u=o.text.slice(Math.min(i,a)-o.from,Math.max(i,a)-o.from),c=l(u);if(null!=e&&c!=e)break;(" "!=u||i!=n.head)&&(e=c),i=a}return i}),ew=e=>ey(e,!1);function ex(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),o=e.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(i)}else t.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return t}function eS(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of ex(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),l=o.length+1;if(n)for(let n of(i.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))r.push(s.jT.range(Math.min(e.doc.length,n.anchor+l),Math.min(e.doc.length,n.head+l)));else for(let n of(i.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))r.push(s.jT.range(n.anchor-l,n.head-l))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:s.jT.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function ek(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of ex(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let eC=eT(!1),eM=eT(!0);function eT(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,o=t.doc.lineAt(i),l=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,a.qz)(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),o;return i&&r&&i.to<=t&&r.from>=t&&(o=i.type.prop(u.md.closedBy))&&o.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=o.to?o:t.doc.lineAt(r)).to);let c=new a.Gn(t,{simulateBreak:i,simulateDoubleBreak:!!l}),h=(0,a.K0)(c,i);for(null==h&&(h=(0,s.IS)(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<o.to&&/\s/.test(o.text[r-o.from]);)r++;l?{from:i,to:r}=l:i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let d=["",(0,a.SS)(t,h)];return l&&d.push((0,a.SS)(t,c.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:s.xv.of(d)},range:s.jT.cursor(i+1+d[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function eD(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let s=e.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(t(s,r,i),n=s.number),o=s.to+1}let o=e.changes(r);return{changes:r,range:s.jT.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}let eP=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eD(e,(t,n)=>{n.push({from:t.from,insert:e.facet(a.c)})}),{userEvent:"input.indent"})),!0),eR=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(eD(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=(0,s.IS)(i,e.tabSize),o=0,l=(0,a.SS)(e,Math.max(0,r-(0,a.y1)(e)));for(;o<i.length&&o<l.length&&i.charCodeAt(o)==l.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),eA=[{key:"Ctrl-b",run:H,shift:et,preventDefault:!0},{key:"Ctrl-f",run:z,shift:en},{key:"Ctrl-p",run:q,shift:eo},{key:"Ctrl-n",run:G,shift:es},{key:"Ctrl-a",run:e=>F(e,t=>s.jT.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Q(e,t=>s.jT.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>F(e,t=>s.jT.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Q(e,t=>s.jT.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:eb},{key:"Ctrl-h",run:ev},{key:"Ctrl-k",run:e=>ep(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:ew},{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:s.xv.of(["",""])},range:s.jT.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,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,s.cp)(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:(0,s.cp)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(r,n))},range:s.jT.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:J}],eO=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>F(e,t=>W(e.state,t,!j(e))),shift:e=>Q(e,t=>W(e.state,t,!j(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>F(e,t=>W(e.state,t,j(e))),shift:e=>Q(e,t=>W(e.state,t,j(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>eS(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>ek(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>eS(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>ek(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=s.jT.create([n.main]):n.main.empty||(i=s.jT.create([s.jT.cursor(n.main.head)])),!!i&&(t(Z(e,i)),!0)}},{key:"Mod-Enter",run:eM},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=ex(e).map(({from:t,to:n})=>s.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:s.jT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=B(e.selection,t=>{let n=(0,a.qz)(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;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 s.jT.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(Z(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:eR},{key:"Mod-]",run:eP},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new a.Gn(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=eD(e,(t,r,o)=>{let s=(0,a.K0)(i,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let l=/^\s*/.exec(t.text)[0],u=(0,a.SS)(e,s);(l!=u||o.from<t.from+l.length)&&(n[t.from]=s,r.push({from:t.from,to:t.from+l.length,insert:u}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ex(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=B(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=B(e.selection,t=>{let i=(0,a.Um)(e,t.head,-1)||(0,a.Um)(e,t.head,1)||t.head>0&&(0,a.Um)(e,t.head-1,1)||t.head<e.doc.length&&(0,a.Um)(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let r=i.start.from==t.head?i.end.to:i.end.from;return s.jT.cursor(r)}),!!n&&(t(Z(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=p(e.state,n.from);return i.line?h(e):!!i.block&&f(e)}},{key:"Alt-A",run:d},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:H,shift:et,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>$(e,!j(e)),shift:e=>ei(e,!j(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>F(e,t=>X(e,t,!j(e))),shift:e=>Q(e,t=>X(e,t,!j(e))),preventDefault:!0},{key:"ArrowRight",run:z,shift:en,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>$(e,j(e)),shift:e=>ei(e,j(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>F(e,t=>X(e,t,j(e))),shift:e=>Q(e,t=>X(e,t,j(e))),preventDefault:!0},{key:"ArrowUp",run:q,shift:eo,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ec,shift:ed},{mac:"Ctrl-ArrowUp",run:Y,shift:ea},{key:"ArrowDown",run:G,shift:es,preventDefault:!0},{mac:"Cmd-ArrowDown",run:eh,shift:ef},{mac:"Ctrl-ArrowDown",run:J,shift:eu},{key:"PageUp",run:Y,shift:ea},{key:"PageDown",run:J,shift:eu},{key:"Home",run:e=>F(e,t=>X(e,t,!1)),shift:e=>Q(e,t=>X(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:ec,shift:ed},{key:"End",run:e=>F(e,t=>X(e,t,!0)),shift:e=>Q(e,t=>X(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:eh,shift:ef},{key:"Enter",run:eC,shift:eC},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ev,shift:ev},{key:"Delete",run:eb},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ew},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>ey(e,!0)},{mac:"Mod-Backspace",run:e=>ep(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)})},{mac:"Mod-Delete",run:e=>ep(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})}].concat(eA.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),eI={key:"Tab",run:eP,shift:eR};var eE=n(59718);let eL="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class eB{constructor(e,t,n=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(eL(e)):eL,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(0,s.gm)(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=(0,s.bg)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,s.nZ)(e);let i=this.normalize(t);if(i.length)for(let e=0,r=n;;e++){let o=i.charCodeAt(e),s=this.match(o,r,this.bufferPos+this.bufferStart);if(e==i.length-1){if(s)return this.value=s,this;break}r==n&&e<t.length&&t.charCodeAt(e)==o&&r++}}}match(e,t,n){let i=null;for(let t=0;t<this.matches.length;t+=2){let r=this.matches[t],o=!1;this.query.charCodeAt(r)==e&&(r==this.query.length-1?i={from:this.matches[t+1],to:n}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?i={from:t,to:n}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(eB.prototype[Symbol.iterator]=function(){return this});let eZ={from:-1,to:-1,match:/.*/.exec("")},eF="gm"+(null==/x/.unicode?"":"u");class eV{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=eZ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new eH(e,t,n,i,r);this.re=new RegExp(t,eF+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=ez(e,i),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,i=n+t[0].length;if(this.matchPos=ez(this.text,i+ +(n==i)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,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 eN=new WeakMap;class ej{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=eN.get(e);if(!i||i.from>=n||i.to<=t){let i=new ej(t,e.sliceString(t,n));return eN.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to<n&&(r+=e.sliceString(i.to,n)),eN.set(e,new ej(o,r)),new ej(t,r.slice(t-o,n-o))}}class eH{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=eZ,this.matchPos=ez(e,i),this.re=new RegExp(t,eF+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=ej.get(e,i,this.chunkEnd(i+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,match:t},this.matchPos=ez(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ej.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function ez(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}function e$(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=(0,eE.Z)("input",{class:"cm-textfield",name:"line",value:t});function i(){let t=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!t)return;let{state:i}=e,r=i.doc.lineAt(i.selection.main.head),[,o,a,u,c]=t,h=u?+u.slice(1):0,d=a?+a:r.number;if(a&&c){let e=d/100;o&&(e=e*("-"==o?-1:1)+r.number/i.doc.lines),d=Math.round(i.doc.lines*e)}else a&&o&&(d=d*("-"==o?-1:1)+r.number);let f=i.doc.line(Math.max(1,Math.min(i.doc.lines,d))),p=s.jT.cursor(f.from+Math.max(0,Math.min(h,f.length)));e.dispatch({effects:[eW.of(!1),l.tk.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:(0,eE.Z)("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:eW.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),i())},onsubmit:e=>{e.preventDefault(),i()}},(0,eE.Z)("label",e.state.phrase("Go to line"),": ",n)," ",(0,eE.Z)("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),(0,eE.Z)("button",{name:"close",onclick:()=>{e.dispatch({effects:eW.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["\xd7"]))}}"undefined"!=typeof Symbol&&(eV.prototype[Symbol.iterator]=eH.prototype[Symbol.iterator]=function(){return this});let eW=s.Py.define(),e_=s.QQ.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(eW)&&(e=n.value);return e},provide:e=>l.mH.from(e,e=>e?e$:null)}),eq=l.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),eG={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},eU=s.r$.define({combine:e=>(0,s.BO)(e,eG,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),eK=l.p.mark({class:"cm-selectionMatch"}),eY=l.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function eJ(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=s.D0.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=s.D0.Word)}let eX=l.lg.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(eU),{state:n}=e,i=n.selection;if(i.ranges.length>1)return l.p.none;let r=i.main,o,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return l.p.none;let e=n.wordAt(r.head);if(!e)return l.p.none;a=n.charCategorizer(r.head),o=n.sliceDoc(e.from,e.to)}else{let e=r.to-r.from;if(e<t.minSelectionLength||e>200)return l.p.none;if(t.wholeWords){var u,c,h;if(o=n.sliceDoc(r.from,r.to),!(eJ(a=n.charCategorizer(r.head),n,r.from,r.to)&&(u=a,c=r.from,h=r.to,u(n.sliceDoc(c,c+1))==s.D0.Word&&u(n.sliceDoc(h-1,h))==s.D0.Word)))return l.p.none}else if(!(o=n.sliceDoc(r.from,r.to)))return l.p.none}let d=[];for(let i of e.visibleRanges){let e=new eB(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!a||eJ(a,n,i,o))&&(r.empty&&i<=r.from&&o>=r.to?d.push(eY.range(i,o)):(i>=r.to||o<=r.from)&&d.push(eK.range(i,o)),d.length>t.maxMatches))return l.p.none}}return l.p.set(d)}},{decorations:e=>e.decorations}),eQ=l.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),e0=({state:e,dispatch:t})=>{let{selection:n}=e,i=s.jT.create(n.ranges.map(t=>e.wordAt(t.head)||s.jT.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)},e1=s.r$.define({combine:e=>(0,s.BO)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tw(e),scrollToMatch:e=>l.tk.scrollIntoView(e)})});class e2{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,eF),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}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}create(){return this.regexp?new e7(this):new e4(this)}getCursor(e,t=0,n){let i=e.doc?e:s.yy.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?e8(this,i,t,n):e3(this,i,t,n)}}class e5{constructor(e){this.spec=e}}function e3(e,t,n,i){var r,o;return new eB(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,o=t.charCategorizer(t.selection.main.head),(e,t,n,i)=>((i>e||i+n.length<t)&&(i=Math.max(0,e-2),n=r.sliceString(i,Math.min(r.length,t+2))),(o(e9(n,e-i))!=s.D0.Word||o(e6(n,e-i))!=s.D0.Word)&&(o(e6(n,t-i))!=s.D0.Word||o(e9(n,t-i))!=s.D0.Word))):void 0)}class e4 extends e5{constructor(e){super(e)}nextMatch(e,t,n){let i=e3(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);i=e3(this.spec,e,0,n).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==n?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=e3(this.spec,e,n,i),o=null;for(;!r.nextOverlapping().done;)o=r.value;if(o)return o;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=e3(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=e3(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function e8(e,t,n,i){var r;return new eV(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(e9(n.input,n.index))!=s.D0.Word||r(e6(n.input,n.index))!=s.D0.Word)&&(r(e6(n.input,n.index+n[0].length))!=s.D0.Word||r(e9(n.input,n.index+n[0].length))!=s.D0.Word)):void 0},n,i)}function e9(e,t){return e.slice((0,s.cp)(e,t,!1),t)}function e6(e,t){return e.slice(t,(0,s.cp)(e,t))}class e7 extends e5{nextMatch(e,t,n){let i=e8(this.spec,e,n,e.doc.length).next();return i.done&&(i=e8(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),o=e8(this.spec,e,r,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(r==t||s.from>r+10))return s;if(r==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 i=+n.slice(0,t);if(i>0&&i<e.match.length)return e.match[i]+n.slice(t)}return t})}matchAll(e,t){let n=e8(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=e8(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let te=s.Py.define(),tt=s.Py.define(),tn=s.QQ.define({create:e=>new ti(tp(e).create(),null),update(e,t){for(let n of t.effects)n.is(te)?e=new ti(n.value.create(),e.panel):n.is(tt)&&(e=new ti(e.query,n.value?tf:null));return e},provide:e=>l.mH.from(e,e=>e.panel)});class ti{constructor(e,t){this.query=e,this.panel=t}}let tr=l.p.mark({class:"cm-searchMatch"}),to=l.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ts=l.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(tn))}update(e){let t=e.state.field(tn);(t!=e.startState.field(tn)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return l.p.none;let{view:n}=this,i=new s.f_;for(let t=0,r=n.visibleRanges,o=r.length;t<o;t++){let{from:s,to:l}=r[t];for(;t<o-1&&l>r[t+1].from-500;)l=r[++t].to;e.highlight(n.state,s,l,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?to:tr)})}return i.finish()}},{decorations:e=>e.decorations});function tl(e){return t=>{let n=t.state.field(tn,!1);return n&&n.query.spec.valid?e(t,n):tv(t)}}let ta=tl((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=s.jT.single(i.from,i.to),o=e.state.facet(e1);return e.dispatch({selection:r,effects:[tk(e,i),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),tg(e),!0}),tu=tl((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let o=s.jT.single(r.from,r.to),l=e.state.facet(e1);return e.dispatch({selection:o,effects:[tk(e,r),l.scrollToMatch(o.main,e)],userEvent:"select.search"}),tg(e),!0}),tc=tl((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:s.jT.create(n.map(e=>s.jT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),th=tl((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,i,i);if(!o)return!1;let a=o,u=[],c,h,d=[];if(a.from==i&&a.to==r&&(h=n.toText(t.getReplacement(a)),u.push({from:a.from,to:a.to,insert:h}),a=t.nextMatch(n,a.from,a.to),d.push(l.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),a){let t=0==u.length||u[0].from>=o.to?0:o.to-o.from-h.length;c=s.jT.single(a.from-t,a.to-t),d.push(tk(e,a)),d.push(n.facet(e1).scrollToMatch(c.main,e))}return e.dispatch({changes:u,selection:c,effects:d,userEvent:"input.replace"}),!0}),td=tl((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:i}=e;return{from:n,to:i,insert:t.getReplacement(e)}});if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:l.tk.announce.of(i),userEvent:"input.replace.all"}),!0});function tf(e){return e.state.facet(e1).createPanel(e)}function tp(e,t){var n,i,r,o,s;let l=e.selection.main,a=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!a)return t;let u=e.facet(e1);return new e2({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:u.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:u.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:u.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:u.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:u.wholeWord})}function tm(e){let t=(0,l.Sd)(e,tf);return t&&t.dom.querySelector("[main-field]")}function tg(e){let t=tm(e);t&&t==e.root.activeElement&&t.select()}let tv=e=>{let t=e.state.field(tn,!1);if(t&&t.panel){let n=tm(e);if(n&&n!=e.root.activeElement){let i=tp(e.state,t.query.spec);i.valid&&e.dispatch({effects:te.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[tt.of(!0),t?te.of(tp(e.state,t.query.spec)):s.Py.appendConfig.of(tM)]});return!0},tb=e=>{let t=e.state.field(tn,!1);if(!t||!t.panel)return!1;let n=(0,l.Sd)(e,tf);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:tt.of(!1)}),!0},ty=[{key:"Mod-f",run:tv,scope:"editor search-panel"},{key:"F3",run:ta,shift:tu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ta,shift:tu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tb,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:i,to:r}=n.main,o=[],l=0;for(let t=new eB(e.doc,e.sliceDoc(i,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==i&&(l=o.length),o.push(s.jT.range(t.value.from,t.value.to))}return t(e.update({selection:s.jT.create(o,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=(0,l.Sd)(e,e$);if(!t){let n=[eW.of(!0)];null==e.state.field(e_,!1)&&n.push(s.Py.appendConfig.of([e_,eq])),e.dispatch({effects:n}),t=(0,l.Sd)(e,e$)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return e0({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),o=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new eB(e.doc,t,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new eB(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}else{if(n&&i.some(e=>e.from==r.value.from))continue;if(o){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(s.jT.range(r.from,r.to),!1),effects:l.tk.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class tw{constructor(e){this.view=e;let t=this.query=e.state.field(tn).query.spec;function n(e,t,n){return(0,eE.Z)("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=(0,eE.Z)("input",{value:t.search,placeholder:tx(e,"Find"),"aria-label":tx(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,eE.Z)("input",{value:t.replace,placeholder:tx(e,"Replace"),"aria-label":tx(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,eE.Z)("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=(0,eE.Z)("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=(0,eE.Z)("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=(0,eE.Z)("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>ta(e),[tx(e,"next")]),n("prev",()=>tu(e),[tx(e,"previous")]),n("select",()=>tc(e),[tx(e,"all")]),(0,eE.Z)("label",null,[this.caseField,tx(e,"match case")]),(0,eE.Z)("label",null,[this.reField,tx(e,"regexp")]),(0,eE.Z)("label",null,[this.wordField,tx(e,"by word")]),...e.state.readOnly?[]:[(0,eE.Z)("br"),this.replaceField,n("replace",()=>th(e),[tx(e,"replace")]),n("replaceAll",()=>td(e),[tx(e,"replace all")])],(0,eE.Z)("button",{name:"close",onclick:()=>tb(e),"aria-label":tx(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new e2({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:te.of(e)}))}keydown(e){(0,l.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?tu:ta)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),th(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(te)&&!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(e1).top}}function tx(e,t){return e.state.phrase(t)}let tS=/[\s\.,:;?!]/;function tk(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,o=Math.max(i.from,t-30),s=Math.min(r,n+30),a=e.state.sliceDoc(o,s);if(o!=i.from){for(let e=0;e<30;e++)if(!tS.test(a[e+1])&&tS.test(a[e])){a=a.slice(e);break}}if(s!=r){for(let e=a.length-1;e>a.length-30;e--)if(!tS.test(a[e-1])&&tS.test(a[e])){a=a.slice(0,e);break}}return l.tk.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${i.number}.`)}let tC=l.tk.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"}}),tM=[tn,s.Wl.low(ts),tC];class tT{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=(0,a.qz)(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),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(tA(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}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 tD(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 tP{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function tR(e){return e.selection.main.from}function tA(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}let tO=s.q6.define(),tI=new WeakMap;function tE(e){if(!Array.isArray(e))return e;let t=tI.get(e);return t||tI.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=tD(t)+tD(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}(e)),t}let tL=s.Py.define(),tB=s.Py.define();class tZ{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=(0,s.gm)(e,t),i=(0,s.nZ)(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push((0,s.gm)(o==r?r.toLowerCase():o,0)),t+=i}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:i,precise:r,byWord:o}=this;if(1==t.length){let i=(0,s.gm)(e,0),r=(0,s.nZ)(i),o=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,r])}let l=e.indexOf(this.pattern);if(0==l)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,u=0;if(l<0){for(let r=0,o=Math.min(e.length,200);r<o&&u<a;){let o=(0,s.gm)(e,r);(o==t[u]||o==n[u])&&(i[u++]=r),r+=(0,s.nZ)(o)}if(u<a)return null}let c=0,h=0,d=!1,f=0,p=-1,m=-1,g=/[a-z]/.test(e),v=!0;for(let i=0,u=Math.min(e.length,200),b=0;i<u&&h<a;){let u=(0,s.gm)(e,i);l<0&&(c<a&&u==t[c]&&(r[c++]=i),f<a&&(u==t[f]||u==n[f]?(0==f&&(p=i),m=i+1,f++):f=0));let y,w=u<255?u>=48&&u<=57||u>=97&&u<=122?2:+(u>=65&&u<=90):(y=(0,s.bg)(u))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!i||1==w&&g||0==b&&0!=w)&&(t[h]==u||n[h]==u&&(d=!0)?o[h++]=i:o.length&&(v=!1)),b=w,i+=(0,s.nZ)(u)}return h==a&&0==o[0]&&v?this.result(-100+(d?-200:0),o,e):f==a&&0==p?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):f==a?this.ret(-900-e.length,[p,m]):h==a?this.result(-100+(d?-200:0)+-700+(v?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?(0,s.nZ)((0,s.gm)(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class tF{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 tV=s.r$.define({combine:e=>(0,s.BO)(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:tj,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(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=>tN(e(n),t(n)),optionClass:(e,t)=>n=>tN(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function tN(e,t){return e?t?e+" "+t:e:t}function tj(e,t,n,i,r,o){let s=e.textDirection==l.Nm.RTL,a=s,u=!1,c="top",h,d,f=t.left-r.left,p=r.right-t.right,m=i.right-i.left,g=i.bottom-i.top;if(a&&f<Math.min(m,p)?a=!1:!a&&p<Math.min(m,f)&&(a=!0),m<=(a?f:p))h=Math.max(r.top,Math.min(n.top,r.bottom-g))-t.top,d=Math.min(400,a?f:p);else{u=!0,d=Math.min(400,(s?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=g||e>t.top?h=n.bottom-t.top:(c="bottom",h=t.bottom-n.top)}let v=(t.bottom-t.top)/o.offsetHeight,b=(t.right-t.left)/o.offsetWidth;return{style:`${c}: ${h/v}px; max-width: ${d/b}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":a?"left":"right")}}function tH(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 i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}class tz{constructor(e,t,n){let i;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:o,selected:s}=r.open,l=e.state.facet(tV);this.optionContent=(i=l.addToOptions.slice(),l.icons&&i.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}),i.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>s&&r.appendChild(document.createTextNode(o.slice(s,t)));let l=r.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(o.slice(t,n))),l.className="cm-completionMatchedText",s=n}return s<o.length&&r.appendChild(document.createTextNode(o.slice(s))),r},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}),i.sort((e,t)=>e.position-t.position).map(e=>e.render)),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=tH(o.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t=n.target,r;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(r=/-(\d+)$/.exec(t.id))&&+r[1]<i.length){this.applyCompletion(e,i[+r[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(tV).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:tB.of(null)})}),this.showOptions(o,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),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:o,disabled:s}=n.open;i.open&&i.open.options==r||(this.range=tH(r.length,o,e.state.facet(tV).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),s!=(null===(t=i.open)||void 0===t?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;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=tH(t.options.length,t.selected,this.view.state.facet(tV).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let r="string"==typeof i?document.createTextNode(i):i(n);if(!r)return;"then"in r?r.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>(0,l.OO)(this.view.state,e,"completion info")):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let i,r,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"):n--;return s&&(t=this.list,n=s,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o=i.height/t.offsetHeight,r.top<i.top?t.scrollTop-=(i.top-r.top)/o:r.bottom>i.bottom&&(t.scrollTop+=(r.bottom-i.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(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(tV).positionInfo(this.view,t,i,n,r,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 i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",e=>{e.target==i&&e.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:l}=e[o],{section:a}=s;if(a){let e="string"==typeof a?a:a.name;e!=r&&(o>n.from||0==n.from)&&(r=e,"string"!=typeof a&&a.header?i.appendChild(a.header(a)):i.appendChild(document.createElement("completion-section")).textContent=e)}let u=i.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,l);t&&u.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function t$(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class tW{constructor(e,t,n,i,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new tW(this.options,tU(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r,o){if(i&&!o&&e.some(e=>e.isPending))return i.setDisabled();let s=function(e,t){let n=[],i=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},o=t.facet(tV);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)r(new tP(t,i.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(i.from,i.to),s,l=o.filterStrict?new tF(n):new tZ(n);for(let t of i.result.options)if(s=l.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched;r(new tP(t,i.source,n,s.score+(t.boost||0)))}}}if(i){let e=Object.create(null),t=0;for(let n of i.sort((e,t)=>{var n,i;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(i=t.rank)&&void 0!==i?i: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 s=[],l=null,a=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||a(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?t$(e.completion)>t$(l)&&(s[s.length-1]=e):s.push(e),l=e.completion}return s}(e,t);if(!s.length)return i&&e.some(e=>e.isPending)?i.setDisabled():null;let l=t.facet(tV).selectOnOpen?0:-1;if(i&&i.selected!=l&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){l=t;break}}return new tW(s,tU(n,l),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:t5,above:r.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new tW(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new tW(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class t_{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new t_(tK,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(tV),i=(n.override||t.languageDataAt("autocomplete",tR(t)).map(tE)).map(t=>(this.active.find(e=>e.source==t)||new tJ(t,+!!this.active.some(e=>0!=e.state))).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open,o=e.effects.some(e=>e.is(tQ));for(let s of(r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let r=n==e.length,o=i==t.length;if(r||o)return r==o;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||o?r=tW.build(i,t,this.id,r,n,o):r&&r.disabled&&!i.some(e=>e.isPending)&&(r=null),!r&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new tJ(e.source,0):e)),e.effects))s.is(t0)&&(r=r&&r.setSelected(s.value,this.id));return i==this.active&&r==this.open?this:new t_(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?tq:tG}}let tq={"aria-autocomplete":"list"},tG={};function tU(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let tK=[];function tY(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(tO);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 tJ{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=tY(e,t),i=this;for(let t of((8&n||16&n&&this.touches(e))&&(i=new tJ(i.source,0)),4&n&&0==i.state&&(i=new tJ(this.source,1)),i=i.updateFor(e,n),e.effects))if(t.is(tL))i=new tJ(i.source,1,t.value);else if(t.is(tB))i=new tJ(i.source,0);else if(t.is(tQ))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(tR(e.state))}}class tX extends tJ{constructor(e,t,n,i,r,o){super(e,3,t),this.limit=n,this.result=i,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),s=tR(e.state);if(s>o||!i||2&t&&(tR(e.startState)==this.from||s<this.limit))return new tJ(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):tA(e,!0).test(r)}(i.validFor,e.state,r,o)?i.update&&(i=i.update(i,r,o,new tT(e.state,s,!1)))?new tX(this.source,this.explicit,l,i,i.from,null!==(n=i.to)&&void 0!==n?n:tR(e.state)):new tJ(this.source,1,this.explicit):new tX(this.source,this.explicit,l,i,r,o)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new tX(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new tJ(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let tQ=s.Py.define({map:(e,t)=>e.map(e=>e.map(t))}),t0=s.Py.define(),t1=s.QQ.define({create:()=>t_.start(),update:(e,t)=>e.update(t),provide:e=>[l.hJ.from(e,e=>e.tooltip),l.tk.contentAttributes.from(e,e=>e.attrs)]});function t2(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(t1).active.find(e=>e.source==t.source);return i instanceof tX&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,i){let{main:r}=e.selection,o=n-r.from,l=i-r.from;return Object.assign(Object.assign({},e.changeByRange(a=>{if(a!=r&&n!=i&&e.sliceDoc(a.from+o,a.from+l)!=e.sliceDoc(n,i))return{range:a};let u=e.toText(t);return{changes:{from:a.from+o,to:i==r.from?a.to:a.from+l,insert:u},range:s.jT.cursor(a.from+o+u.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,i.from,i.to)),{annotations:tO.of(t.completion)})):n(e,t.completion,i.from,i.to),!0)}let t5=e=>new tz(e,t1,t2);function t3(e,t="option"){return n=>{let i=n.state.field(t1,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(tV).interactionDelay)return!1;let r=1,o;"page"==t&&(o=(0,l.gB)(n,i.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=i.open.options,a=i.open.selected>-1?i.open.selected+r*(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:t0.of(a)}),!0}}let t4=e=>!!e.state.field(t1,!1)&&(e.dispatch({effects:tL.of(!0)}),!0);class t8{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let t9=l.lg.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(t1).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(t1),n=e.state.facet(tV);if(!e.selectionSet&&!e.docChanged&&e.startState.field(t1)==t)return;let i=e.transactions.some(e=>{let t=tY(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(i||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){(0,l.OO)(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(tL)))&&(this.pendingStart=!0);let r=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(),r):-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(t1);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(tV).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=tR(t),i=new tT(t,n,e.explicit,this.view),r=new t8(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:tB.of(null)}),(0,l.OO)(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(tV).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(tV),i=this.view.state.field(t1);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(void 0===o.done)continue;if(this.running.splice(r--,1),o.done){let i=tR(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(i,o.done.from+ +!o.active.explicit),s=new tX(o.active.source,o.active.explicit,r,o.done,o.done.from,null!==(e=o.done.to)&&void 0!==e?e:i);for(let e of o.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=i.active.find(e=>e.source==o.active.source);if(s&&s.isPending){if(null==o.done){let e=new tJ(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||i.open&&i.open.disabled)&&this.view.dispatch({effects:tQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(t1,!1);if(t&&t.tooltip&&this.view.state.facet(tV).closeOnBlur){let n=t.open&&(0,l.gB)(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:tB.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:tL.of(!1)}),20),this.composing=0}}}),t6="object"==typeof navigator&&/Win/.test(navigator.platform),t7=s.Wl.highest(l.tk.domEventHandlers({keydown(e,t){let n=t.state.field(t1,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(t6&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&t2(t,i),!1}})),ne=l.tk.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"},".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"}}}),nt={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},nn=s.Py.define({map(e,t){let n=t.mapPos(e,-1,s.gc.TrackAfter);return null==n?void 0:n}}),ni=new class extends s.uU{};ni.startSide=1,ni.endSide=-1;let nr=s.QQ.define({create:()=>s.Xs.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(nn)&&(e=e.update({add:[ni.range(n.value,n.value+1)]}));return e}}),no="()[]{}<>\xab\xbb\xbb\xab[]{}";function ns(e){for(let t=0;t<no.length;t+=2)if(no.charCodeAt(t)==e)return no.charAt(t+1);return(0,s.bg)(e<128?e:e+1)}function nl(e,t){return e.languageDataAt("closeBrackets",t)[0]||nt}let na="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),nu=l.tk.inputHandler.of((e,t,n,i)=>{if((na?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==(0,s.nZ)((0,s.gm)(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=nl(e,e.selection.main.head),i=n.brackets||nt.brackets;for(let r of i){let o=ns((0,s.gm)(r,0));if(t==r)return o==r?function(e,t,n,i){let r=i.stringPrefixes||nt.stringPrefixes,o=null,l=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:nn.of(i.to+t.length),range:s.jT.range(i.anchor+t.length,i.head+t.length)};let l=i.head,u=nd(e.doc,l),c;if(u==t){if(nf(e,l))return{changes:{insert:t+t,from:l},effects:nn.of(l+t.length),range:s.jT.cursor(l+t.length)};if(nh(e,l)){let i=n&&e.sliceDoc(l,l+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+i.length,insert:i},range:s.jT.cursor(l+i.length)}}}else if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(c=np(e,l-2*t.length,r))>-1&&nf(e,c))return{changes:{insert:t+t+t+t,from:l},effects:nn.of(l+t.length),range:s.jT.cursor(l+t.length)};else if(e.charCategorizer(l)(u)!=s.D0.Word&&np(e,l,r)>-1&&!function(e,t,n,i){let r=(0,a.qz)(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&i.indexOf(s.slice(0,l))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let a=r.to==t&&r.parent;if(!a)break;r=a}return!1}(e,l,t,r))return{changes:{insert:t+t,from:l},effects:nn.of(l+t.length),range:s.jT.cursor(l+t.length)};return{range:o=i}});return o?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,i.indexOf(r+r+r)>-1,n):function(e,t,n,i){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:nn.of(o.to+t.length),range:s.jT.range(o.anchor+t.length,o.head+t.length)};let l=nd(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:nn.of(o.head+t.length),range:s.jT.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,o,n.before||nt.before);if(t==o&&nh(e,e.selection.main.from))return function(e,t,n){let i=null,r=e.changeByRange(t=>t.empty&&nd(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:s.jT.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,o)}return null}(e.state,i);return!!o&&(e.dispatch(o),!0)}),nc=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=nl(e,e.selection.main.head).brackets||nt.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,o;let i;let l=(r=e.doc,o=t.head,i=r.sliceString(o-2,o),(0,s.nZ)((0,s.gm)(i,0))==i.length?i:i.slice(1));for(let i of n)if(i==l&&nd(e.doc,t.head)==ns((0,s.gm)(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:s.jT.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function nh(e,t){let n=!1;return e.field(nr).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function nd(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,s.nZ)((0,s.gm)(n,0)))}function nf(e,t){let n=(0,a.qz)(e).resolveInner(t+1);return n.parent&&n.from==t}function np(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=s.D0.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=s.D0.Word)return n}return -1}let nm=[{key:"Ctrl-Space",run:t4},{mac:"Alt-`",run:t4},{key:"Escape",run:e=>{let t=e.state.field(t1,!1);return!!(t&&t.active.some(e=>0!=e.state))&&(e.dispatch({effects:tB.of(null)}),!0)}},{key:"ArrowDown",run:t3(!0)},{key:"ArrowUp",run:t3(!1)},{key:"PageDown",run:t3(!0,"page")},{key:"PageUp",run:t3(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(t1,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(tV).interactionDelay)&&t2(e,t.open.options[t.open.selected])}}],ng=s.Wl.highest(l.$f.computeN([tV],e=>e.facet(tV).defaultKeymap?[nm]:[]));var nv=n(68799),nb=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(nc)),!1!==e.defaultKeymap&&(n=n.concat(eO)),!1!==e.searchKeymap&&(n=n.concat(ty)),!1!==e.historyKeymap&&(n=n.concat(L)),!1!==e.foldKeymap&&(n=n.concat(a.e7)),!1!==e.completionKeymap&&(n=n.concat(nm)),!1!==e.lintKeymap&&(n=n.concat(nv.Fv));var i=[];if(!1!==e.lineNumbers&&i.push((0,l.Eu)()),!1!==e.highlightActiveLineGutter&&i.push((0,l.HQ)()),!1!==e.highlightSpecialChars&&i.push((0,l.AE)()),!1!==e.history&&i.push(function(e={}){return[w,y.of(e),l.tk.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?S:"historyRedo"==e.inputType?k:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&i.push((0,a.mi)()),!1!==e.drawSelection&&i.push((0,l.Uw)()),!1!==e.dropCursor&&i.push((0,l.qr)()),!1!==e.allowMultipleSelections&&i.push(s.yy.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push((0,a.nY)()),!1!==e.syntaxHighlighting&&i.push((0,a.nF)(a.R_,{fallback:!0})),!1!==e.bracketMatching&&i.push((0,a.n$)()),!1!==e.closeBrackets&&i.push([nu,nr]),!1!==e.autocompletion&&i.push(function(e={}){return[t7,t1,tV.of(e),t9,ng,ne]}()),!1!==e.rectangularSelection&&i.push((0,l.Zs)()),!1!==t&&i.push((0,l.S2)()),!1!==e.highlightActiveLine&&i.push((0,l.ZO)()),!1!==e.highlightSelectionMatches){let e;i.push(e=[eQ,eX])}return e.tabSize&&"number"==typeof e.tabSize&&i.push(a.c.of(" ".repeat(e.tabSize))),i.concat([l.$f.of(n.flat())]).filter(Boolean)},ny=n(94197);let nw="#e06c75",nx="#abb2bf",nS="#7d8799",nk="#d19a66",nC="#2c313a",nM="#282c34",nT="#353a42",nD="#528bff",nP=l.tk.theme({"&":{color:nx,backgroundColor:nM},".cm-content":{caretColor:nD},".cm-cursor, .cm-dropCursor":{borderLeftColor:nD},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:nx},".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:nM,color:nS,border:"none"},".cm-activeLineGutter":{backgroundColor:nC},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:nT},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nT,borderBottomColor:nT},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:nC,color:nx}}},{dark:!0}),nR=a.Qf.define([{tag:ny.pJ.keyword,color:"#c678dd"},{tag:[ny.pJ.name,ny.pJ.deleted,ny.pJ.character,ny.pJ.propertyName,ny.pJ.macroName],color:nw},{tag:[ny.pJ.function(ny.pJ.variableName),ny.pJ.labelName],color:"#61afef"},{tag:[ny.pJ.color,ny.pJ.constant(ny.pJ.name),ny.pJ.standard(ny.pJ.name)],color:nk},{tag:[ny.pJ.definition(ny.pJ.name),ny.pJ.separator],color:nx},{tag:[ny.pJ.typeName,ny.pJ.className,ny.pJ.number,ny.pJ.changed,ny.pJ.annotation,ny.pJ.modifier,ny.pJ.self,ny.pJ.namespace],color:"#e5c07b"},{tag:[ny.pJ.operator,ny.pJ.operatorKeyword,ny.pJ.url,ny.pJ.escape,ny.pJ.regexp,ny.pJ.link,ny.pJ.special(ny.pJ.string)],color:"#56b6c2"},{tag:[ny.pJ.meta,ny.pJ.comment],color:nS},{tag:ny.pJ.strong,fontWeight:"bold"},{tag:ny.pJ.emphasis,fontStyle:"italic"},{tag:ny.pJ.strikethrough,textDecoration:"line-through"},{tag:ny.pJ.link,color:nS,textDecoration:"underline"},{tag:ny.pJ.heading,fontWeight:"bold",color:nw},{tag:[ny.pJ.atom,ny.pJ.bool,ny.pJ.special(ny.pJ.variableName)],color:nk},{tag:[ny.pJ.processingInstruction,ny.pJ.string,ny.pJ.inserted],color:"#98c379"},{tag:ny.pJ.invalid,color:"#ffffff"}]),nA=[nP,(0,a.nF)(nR)];var nO=l.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),nI=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:i=!1,theme:r="light",placeholder:o="",basicSetup:a=!0}=e,u=[];switch(t&&u.unshift(l.$f.of([eI])),a&&("boolean"==typeof a?u.unshift(nb()):u.unshift(nb(a))),o&&u.unshift((0,l.W$)(o)),r){case"light":u.push(nO);break;case"dark":u.push(nA);break;case"none":break;default:u.push(r)}return!1===n&&u.push(l.tk.editable.of(!1)),i&&u.push(s.yy.readOnly.of(!0)),[...u]},nE=e=>({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)}),nL=s.q6.define(),nB=[],nZ=n(24246),nF=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nV=(0,o.forwardRef)((e,t)=>{var{className:n,value:a="",selection:u,extensions:c=[],onChange:h,onStatistics:d,onCreateEditor:f,onUpdate:p,autoFocus:m,theme:g="light",height:v,minHeight:b,maxHeight:y,width:w,minWidth:x,maxWidth:S,basicSetup:k,placeholder:C,indentWithTab:M,editable:T,readOnly:D,root:P,initialState:R}=e,A=(0,r.Z)(e,nF),O=(0,o.useRef)(null),{state:I,view:E,container:L,setContainer:B}=function(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:a,onUpdate:u,extensions:c=nB,autoFocus:h,theme:d="light",height:f=null,minHeight:p=null,maxHeight:m=null,width:g=null,minWidth:v=null,maxWidth:b=null,placeholder:y="",editable:w=!0,readOnly:x=!1,indentWithTab:S=!0,basicSetup:k=!0,root:C,initialState:M}=e,[T,D]=(0,o.useState)(),[P,R]=(0,o.useState)(),[A,O]=(0,o.useState)(),I=l.tk.theme({"&":{height:f,minHeight:p,maxHeight:m,width:g,minWidth:v,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),E=[l.tk.updateListener.of(e=>{e.docChanged&&"function"==typeof i&&!e.transactions.some(e=>e.annotation(nL))&&i(e.state.doc.toString(),e),r&&r(nE(e))}),I,...nI({theme:d,editable:w,readOnly:x,placeholder:y,indentWithTab:S,basicSetup:k})];return u&&"function"==typeof u&&E.push(l.tk.updateListener.of(u)),E=E.concat(c),(0,o.useLayoutEffect)(()=>{if(T&&!A){var e={doc:t,selection:n,extensions:E},i=M?s.yy.fromJSON(M.json,e,M.fields):s.yy.create(e);if(O(i),!P){var r=new l.tk({state:i,parent:T,root:C});R(r),a&&a(r,i)}}return()=>{P&&(O(void 0),R(void 0))}},[T,A]),(0,o.useEffect)(()=>{e.container&&D(e.container)},[e.container]),(0,o.useEffect)(()=>()=>{P&&(P.destroy(),R(void 0))},[P]),(0,o.useEffect)(()=>{h&&P&&P.focus()},[h,P]),(0,o.useEffect)(()=>{P&&P.dispatch({effects:s.Py.reconfigure.of(E)})},[d,c,f,p,m,g,v,b,y,w,x,S,k,i,u]),(0,o.useEffect)(()=>{if(void 0!==t){var e=P?P.state.doc.toString():"";P&&t!==e&&P.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[nL.of(!0)]})}},[t,P]),{state:A,setState:O,view:P,setView:R,container:T,setContainer:D}}({root:P,value:a,autoFocus:m,theme:g,height:v,minHeight:b,maxHeight:y,width:w,minWidth:x,maxWidth:S,basicSetup:k,placeholder:C,indentWithTab:M,editable:T,readOnly:D,selection:u,onChange:h,onStatistics:d,onCreateEditor:f,onUpdate:p,extensions:c,initialState:R});(0,o.useImperativeHandle)(t,()=>({editor:O.current,state:I,view:E}),[O,L,I,E]);var Z=(0,o.useCallback)(e=>{O.current=e,B(e)},[B]);if("string"!=typeof a)throw Error("value must be typeof string but got "+typeof a);var F="string"==typeof g?"cm-theme-"+g:"cm-theme";return(0,nZ.jsx)("div",(0,i.Z)({ref:Z,className:""+F+(n?" "+n:"")},A))});nV.displayName="CodeMirror";let nN=nV},49966:function(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var r=n(63778);function o(e){return void 0===e?void 0:"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,n){var s=t.map(function(t){var s=null==n?t:i(i({},t),{options:i(i({},o(n)),o(t.options))});return(0,r.bind)(e,s)});return function(){s.forEach(function(e){return e()})}}},63778:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var n=t.type,i=t.listener,r=t.options;return e.addEventListener(n,i,r),function(){e.removeEventListener(n,i,r)}}},70501:function(e,t,n){"use strict";t.bindAll=t.bind=void 0;var i=n(63778);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return i.bind}});var r=n(49966);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})},79349:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},73140:function(e,t,n){var i=n(88799),r=n(85638);e.exports=function(e,t,n){(void 0===n||r(e[t],n))&&(void 0!==n||t in e)||i(e,t,n)}},71928:function(e,t,n){var i=n(88799),r=n(85638),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];o.call(e,t)&&r(s,n)&&(void 0!==n||t in e)||i(e,t,n)}},88799:function(e,t,n){var i=n(42630);e.exports=function(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},80158:function(e,t,n){var i=n(11611),r=Object.create,o=function(){function e(){}return function(t){if(!i(t))return{};if(r)return r(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},49819:function(e,t,n){var i=n(18911)();e.exports=i},59464:function(e,t,n){var i=n(11611),r=n(56016),o=n(21586),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return o(e);var t=r(e),n=[];for(var l in e)"constructor"==l&&(t||!s.call(e,l))||n.push(l);return n}},40015:function(e,t,n){var i=n(23694),r=n(73140),o=n(49819),s=n(68867),l=n(11611),a=n(53893),u=n(97494);e.exports=function e(t,n,c,h,d){t!==n&&o(n,function(o,a){if(d||(d=new i),l(o))s(t,n,a,c,e,h,d);else{var f=h?h(u(t,a),o,a+"",t,n,d):void 0;void 0===f&&(f=o),r(t,a,f)}},a)}},68867:function(e,t,n){var i=n(73140),r=n(2734),o=n(63428),s=n(37561),l=n(97635),a=n(2900),u=n(19785),c=n(36468),h=n(43854),d=n(28338),f=n(11611),p=n(40861),m=n(48519),g=n(97494),v=n(89328);e.exports=function(e,t,n,b,y,w,x){var S=g(e,n),k=g(t,n),C=x.get(k);if(C){i(e,n,C);return}var M=w?w(S,k,n+"",e,t,x):void 0,T=void 0===M;if(T){var D=u(k),P=!D&&h(k),R=!D&&!P&&m(k);M=k,D||P||R?u(S)?M=S:c(S)?M=s(S):P?(T=!1,M=r(k,!0)):R?(T=!1,M=o(k,!0)):M=[]:p(k)||a(k)?(M=S,a(S)?M=v(S):(!f(S)||d(S))&&(M=l(k))):T=!1}T&&(x.set(k,M),y(M,k,b,w,x),x.delete(k)),i(e,n,M)}},1197:function(e,t,n){var i=n(31137),r=n(11871),o=n(63132);e.exports=function(e,t){return o(r(e,t,i),e+"")}},54459:function(e,t,n){var i=n(551),r=n(42630),o=n(31137),s=r?function(e,t){return r(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:o;e.exports=s},74833:function(e,t,n){var i=n(56127),r=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(r,""):e}},95825:function(e,t,n){var i=n(59942);e.exports=function(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}},2734:function(e,t,n){e=n.nmd(e);var i=n(77400),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,s=o&&o.exports===r?i.Buffer:void 0,l=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,i=l?l(n):new e.constructor(n);return e.copy(i),i}},63428:function(e,t,n){var i=n(95825);e.exports=function(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},37561:function(e){e.exports=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}},35159:function(e,t,n){var i=n(71928),r=n(88799);e.exports=function(e,t,n,o){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var u=t[l],c=o?o(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),s?r(n,u,c):i(n,u,c)}return n}},7270:function(e,t,n){var i=n(1197),r=n(57535);e.exports=function(e){return i(function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:void 0,l=o>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,l&&r(n[0],n[1],l)&&(s=o<3?void 0:s,o=1),t=Object(t);++i<o;){var a=n[i];a&&e(t,a,i,s)}return t})}},18911:function(e){e.exports=function(e){return function(t,n,i){for(var r=-1,o=Object(t),s=i(t),l=s.length;l--;){var a=s[e?l:++r];if(!1===n(o[a],a,o))break}return t}}},42630:function(e,t,n){var i=n(81822),r=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},2173:function(e,t,n){var i=n(58023)(Object.getPrototypeOf,Object);e.exports=i},97635:function(e,t,n){var i=n(80158),r=n(2173),o=n(56016);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:i(r(e))}},57535:function(e,t,n){var i=n(85638),r=n(80068),o=n(42383),s=n(11611);e.exports=function(e,t,n){if(!s(n))return!1;var l=typeof t;return("number"==l?!!(r(n)&&o(t,n.length)):"string"==l&&t in n)&&i(n[t],e)}},21586:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},11871:function(e,t,n){var i=n(79349),r=Math.max;e.exports=function(e,t,n){return t=r(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,l=r(o.length-t,0),a=Array(l);++s<l;)a[s]=o[t+s];s=-1;for(var u=Array(t+1);++s<t;)u[s]=o[s];return u[t]=n(a),i(e,this,u)}}},97494:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},63132:function(e,t,n){var i=n(54459),r=n(49591)(i);e.exports=r},49591:function(e){var t=Date.now;e.exports=function(e){var n=0,i=0;return function(){var r=t(),o=16-(r-i);if(i=r,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},56127:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},551:function(e){e.exports=function(e){return function(){return e}}},66726:function(e,t,n){var i=n(11611),r=n(82846),o=n(91936),s=Math.max,l=Math.min;e.exports=function(e,t,n){var a,u,c,h,d,f,p=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=a,i=u;return a=u=void 0,p=t,h=e.apply(i,n)}function y(e){var n=e-f,i=e-p;return void 0===f||n>=t||n<0||g&&i>=c}function w(){var e,n,i,o=r();if(y(o))return x(o);d=setTimeout(w,(e=o-f,n=o-p,i=t-e,g?l(i,c-n):i))}function x(e){return(d=void 0,v&&a)?b(e):(a=u=void 0,h)}function S(){var e,n=r(),i=y(n);if(a=arguments,u=this,f=n,i){if(void 0===d)return p=e=f,d=setTimeout(w,t),m?b(e):h;if(g)return clearTimeout(d),d=setTimeout(w,t),b(f)}return void 0===d&&(d=setTimeout(w,t)),h}return t=o(t)||0,i(n)&&(m=!!n.leading,c=(g="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,a=f=u=d=void 0},S.flush=function(){return void 0===d?h:x(r())},S}},31137:function(e){e.exports=function(e){return e}},36468:function(e,t,n){var i=n(80068),r=n(92360);e.exports=function(e){return r(e)&&i(e)}},40861:function(e,t,n){var i=n(99736),r=n(2173),o=n(92360),s=Object.prototype,l=Function.prototype.toString,a=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=i(e))return!1;var t=r(e);if(null===t)return!0;var n=a.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},55193:function(e,t,n){var i=n(99736),r=n(92360);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==i(e)}},53893:function(e,t,n){var i=n(98213),r=n(59464),o=n(80068);e.exports=function(e){return o(e)?i(e,!0):r(e)}},15409:function(e,t,n){var i=n(40015),r=n(7270)(function(e,t,n){i(e,t,n)});e.exports=r},82846:function(e,t,n){var i=n(77400);e.exports=function(){return i.Date.now()}},91936:function(e,t,n){var i=n(74833),r=n(11611),o=n(55193),s=0/0,l=/^[-+]0x[0-9a-f]+$/i,a=/^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(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var n=a.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):l.test(e)?s:+e}},89328:function(e,t,n){var i=n(35159),r=n(53893);e.exports=function(e){return i(e,r(e))}},59986:function(e,t,n){"use strict";t.default=void 0;var i,r=(i=n(30265))&&i.__esModule?i:{default:i};t.default=(0,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")},20791:function(e,t,n){"use strict";t.default=void 0;var i,r=(i=n(30265))&&i.__esModule?i:{default:i};t.default=(0,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")},80354:function(e,t,n){"use strict";t.default=void 0;var i,r=(i=n(30265))&&i.__esModule?i:{default:i};t.default=(0,r.default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},11682:function(e,t,n){"use strict";t.default=void 0;var i,r=(i=n(30265))&&i.__esModule?i:{default:i};t.default=(0,r.default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},1889:function(e,t,n){"use strict";t.default=void 0;var i,r=(i=n(30265))&&i.__esModule?i:{default:i};t.default=(0,r.default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},78439:function(e,t,n){"use strict";n.d(t,{wT:()=>eA,Ds:()=>eO});var i,r,o,s,l,a,u=n(54538),c=n.n(u),h=n(6085);let d=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(i=e(t[n]))&&(r&&(r+=" "),r+=i);else for(n in t)t[n]&&(r&&(r+=" "),r+=n)}return r}(e))&&(i&&(i+=" "),i+=t);return i},f={data:""},p=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||f,m=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,g=/\/\*[^]*?\*\/| +/g,v=/\n+/g,b=(e,t)=>{let n="",i="",r="";for(let o in e){let s=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+s+";":i+="f"==o[1]?b(s,o):o+"{"+b(s,"k"==o[1]?"":t)+"}":"object"==typeof s?i+=b(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=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=b.p?b.p(o,s):o+":"+s+";")}return n+(t&&r?t+"{"+r+"}":r)+i},y={},w=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+w(e[n]);return t}return e},x=(e,t,n,i,r)=>{var o;let s=w(e),l=y[s]||(y[s]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(s));if(!y[l]){let t=s!==e?e:(e=>{let t,n,i=[{}];for(;t=m.exec(e.replace(g,""));)t[4]?i.shift():t[3]?(n=t[3].replace(v," ").trim(),i.unshift(i[0][n]=i[0][n]||{})):i[0][t[1]]=t[2].replace(v," ").trim();return i[0]})(e);y[l]=b(r?{["@keyframes "+l]:t}:t,n?"":"."+l)}let a=n&&y.g?y.g:null;return n&&(y.g=y[l]),o=y[l],a?t.data=t.data.replace(a,o):-1===t.data.indexOf(o)&&(t.data=i?o+t.data:t.data+o),l},S=(e,t,n)=>e.reduce((e,i,r)=>{let o=t[r];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?"":b(e,""):!1===e?"":e}return e+i+(null==o?"":o)},"");function k(e){let t=this||{},n=e.call?e(t.p):e;return x(n.unshift?n.raw?S(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,p(t.target),t.g,t.o,t.k)}function C(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function M(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),e}function T(){return(T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function D(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function P(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}function R(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}k.bind({g:1}),k.bind({k:1});var A=function(){return""},O=c().createContext({enqueueSnackbar:A,closeSnackbar:A}),I="@media (max-width:599.95px)",E="@media (min-width:600px)",L=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},B=function(e){return""+L(e.vertical)+L(e.horizontal)},Z=function(e){return!!e||0===e},F="unmounted",V="exited",N="entering",j="entered",H="exiting",z=function(e){function t(t){n=e.call(this,t)||this;var n,i,r=t.appear;return n.appearStatus=null,t.in?r?(i=V,n.appearStatus=N):i=j:i=t.unmountOnExit||t.mountOnEnter?F:V,n.state={status:i},n.nextCallback=null,n}D(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===F?{status:V}: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!==N&&n!==j&&(t=N):(n===N||n===j)&&(t=H)}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===N?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===V&&this.setState({status:F})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.getTimeouts();if(!e&&!n){this.safeSetState({status:j},function(){t.props.onEntered&&t.props.onEntered(t.node,e)});return}this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:N},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(i.enter,function(){t.safeSetState({status:j},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();if(!t){this.safeSetState({status:V},function(){e.props.onExited&&e.props.onExited(e.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:H},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:V},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;if(!this.node||n){setTimeout(this.nextCallback,0);return}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===F)return null;var t=this.props;return(0,t.children)(e,P(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},M(t,[{key:"node",get:function(){var e,t=null===(e=this.props.nodeRef)||void 0===e?void 0:e.current;if(!t)throw Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(c().Component);function $(){}function W(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function _(e,t){return(0,u.useMemo)(function(){return null==e&&null==t?null:function(n){W(e,n),W(t,n)}},[e,t])}function q(e){var t=e.timeout,n=e.style,i=void 0===n?{}:n,r=e.mode;return{duration:"object"==typeof t?t[r]||0:t,easing:i.transitionTimingFunction,delay:i.transitionDelay}}z.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:$,onEntering:$,onEntered:$,onExit:$,onExiting:$,onExited:$};var G={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},U=function(e){e.scrollTop=e.scrollTop},K=function(e){return Math.round(e)+"ms"};function Y(e,t){void 0===e&&(e=["all"]);var n=t||{},i=n.duration,r=void 0===i?300:i,o=n.easing,s=void 0===o?G.easeInOut:o,l=n.delay,a=void 0===l?0:l;return(Array.isArray(e)?e:[e]).map(function(e){return e+" "+("string"==typeof r?r:K(r))+" "+s+" "+("string"==typeof a?a:K(a))}).join(",")}function J(e){return(e&&e.ownerDocument||document).defaultView||window}function X(e,t){if(t){var n=function(e,t){var n,i=t.getBoundingClientRect(),r=J(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=r.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var s=0,l=0;if(n&&"none"!==n&&"string"==typeof n){var a=n.split("(")[1].split(")")[0].split(",");s=parseInt(a[4],10),l=parseInt(a[5],10)}switch(e){case"left":return"translateX("+(r.innerWidth+s-i.left)+"px)";case"right":return"translateX(-"+(i.left+i.width-s)+"px)";case"up":return"translateY("+(r.innerHeight+l-i.top)+"px)";default:return"translateY(-"+(i.top+i.height-l)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var Q=(0,u.forwardRef)(function(e,t){var n=e.children,i=e.direction,r=void 0===i?"down":i,o=e.in,s=e.style,l=e.timeout,a=void 0===l?0:l,c=e.onEnter,h=e.onEntered,d=e.onExit,f=e.onExited,p=P(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),m=(0,u.useRef)(null),g=_(n.ref,m),v=_(g,t),b=(0,u.useCallback)(function(){m.current&&X(r,m.current)},[r]);return(0,u.useEffect)(function(){if(!o&&"down"!==r&&"right"!==r){var e=function(e,t){var n;function i(){for(var i=this,r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}return void 0===t&&(t=166),i.clear=function(){clearTimeout(n)},i}(function(){m.current&&X(r,m.current)}),t=J(m.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[r,o]),(0,u.useEffect)(function(){o||b()},[o,b]),(0,u.createElement)(z,Object.assign({appear:!0,nodeRef:m,onEnter:function(e,t){X(r,e),U(e),c&&c(e,t)},onEntered:h,onEntering:function(e){var t=(null==s?void 0:s.transitionTimingFunction)||G.easeOut,n=q({timeout:a,mode:"enter",style:T({},s,{transitionTimingFunction:t})});e.style.webkitTransition=Y("-webkit-transform",n),e.style.transition=Y("transform",n),e.style.webkitTransform="none",e.style.transform="none"},onExit:function(e){var t=(null==s?void 0:s.transitionTimingFunction)||G.sharp,n=q({timeout:a,mode:"exit",style:T({},s,{transitionTimingFunction:t})});e.style.webkitTransition=Y("-webkit-transform",n),e.style.transition=Y("transform",n),X(r,e),d&&d(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",f&&f(e)},in:o,timeout:a},p),function(e,t){return(0,u.cloneElement)(n,T({ref:v,style:T({visibility:"exited"!==e||o?void 0:"hidden"},s,{},n.props.style)},t))})});Q.displayName="Slide";var ee=function(e){return c().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))},et={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:c().createElement(function(){return c().createElement(ee,null,c().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:c().createElement(function(){return c().createElement(ee,null,c().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:c().createElement(function(){return c().createElement(ee,null,c().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:c().createElement(function(){return c().createElement(ee,null,c().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:Q,transitionDuration:{enter:225,exit:195}},en=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:et.autoHideDuration},ei=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"])?T({},et.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?T({},et.transitionDuration,{},t):et.transitionDuration};function er(e){return Object.entries(e).reduce(function(e,t){var n,i=t[0],r=t[1];return T({},e,((n={})[i]=k(r),n))},{})}var eo="notistack-CollapseWrapper",es=er({root:{height:0},entered:{height:"auto"}}),el=(0,u.forwardRef)(function(e,t){var n=e.children,i=e.in,r=e.onExited,o=(0,u.useRef)(null),s=(0,u.useRef)(null),l=_(t,s),a=function(){return o.current?o.current.clientHeight:0};return(0,u.createElement)(z,{in:i,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=a(),n=q({timeout:175,mode:"enter"}),i=n.duration,r=n.easing;e.style.transitionDuration="string"==typeof i?i:i+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=r||""},onExit:function(e){e.style.height=a()+"px"},onExited:r,onExiting:function(e){U(e);var t=q({timeout:175,mode:"exit"}),n=t.duration,i=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=i||""},nodeRef:s,timeout:175},function(e,t){return(0,u.createElement)("div",Object.assign({ref:l,className:d(es.root,"entered"===e&&es.entered),style:T({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:Y("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!i&&{visibility:"hidden"})},t),(0,u.createElement)("div",{ref:o,className:eo,style:{display:"flex",width:"100%"}},n))})});el.displayName="Collapse";var ea={right:"left",left:"right",bottom:"up",top:"down"},eu=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 i;return T({},t,((i={})[n]=e[n],i))},{})},ec=function(){};function eh(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];var s=[].concat(r);t&&-1===s.indexOf(t)&&s.push(t),e.apply(this,s),n.apply(this,s)}},ec)}var ed="undefined"!=typeof window?u.useLayoutEffect:u.useEffect;function ef(e){var t=(0,u.useRef)(e);return ed(function(){t.current=e}),(0,u.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var ep=(0,u.forwardRef)(function(e,t){var n=e.children,i=e.className,r=e.autoHideDuration,o=e.disableWindowBlurListener,s=void 0!==o&&o,l=e.onClose,a=e.id,c=e.open,h=e.SnackbarProps,f=void 0===h?{}:h,p=(0,u.useRef)(),m=ef(function(){l&&l.apply(void 0,arguments)}),g=ef(function(e){l&&null!=e&&(p.current&&clearTimeout(p.current),p.current=setTimeout(function(){m(null,"timeout",a)},e))});(0,u.useEffect)(function(){return c&&g(r),function(){p.current&&clearTimeout(p.current)}},[c,r,g]);var v=function(){p.current&&clearTimeout(p.current)},b=(0,u.useCallback)(function(){null!=r&&g(.5*r)},[r,g]);return(0,u.useEffect)(function(){if(!s&&c)return window.addEventListener("focus",b),window.addEventListener("blur",v),function(){window.removeEventListener("focus",b),window.removeEventListener("blur",v)}},[s,b,c]),(0,u.createElement)("div",Object.assign({ref:t},f,{className:d("notistack-Snackbar",i),onMouseEnter:function(e){f.onMouseEnter&&f.onMouseEnter(e),v()},onMouseLeave:function(e){f.onMouseLeave&&f.onMouseLeave(e),b()}}),n)});ep.displayName="Snackbar";var em=er({root:((i={display:"flex",flexWrap:"wrap",flexGrow:1})[E]={flexGrow:"initial",minWidth:"288px"},i)}),eg=(0,u.forwardRef)(function(e,t){var n=e.className,i=P(e,["className"]);return c().createElement("div",Object.assign({ref:t,className:d(em.root,n)},i))});eg.displayName="SnackbarContent";var ev=er({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"}}),eb="notistack-snackbar",ey=(0,u.forwardRef)(function(e,t){var n=e.id,i=e.message,r=e.action,o=e.iconVariant,s=e.variant,l=e.hideIconVariant,a=e.style,u=e.className,h=o[s],f=r;return"function"==typeof f&&(f=f(n)),c().createElement(eg,{ref:t,role:"alert","aria-describedby":eb,style:a,className:d("notistack-MuiContent","notistack-MuiContent-"+s,ev.root,ev[s],u,!l&&h&&ev.lessPadding)},c().createElement("div",{id:eb,className:ev.message},l?null:h,i),f&&c().createElement("div",{className:ev.action},f))});ey.displayName="MaterialDesignContent";var ew=(0,u.memo)(ey),ex=er({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),eS=function(e){var t,n=(0,u.useRef)(),i=(0,u.useState)(!0),r=i[0],o=i[1],s=eh([e.snack.onClose,e.onClose]),l=(0,u.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,u.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var a=e.snack,h=e.classes,f=e.Component,p=(0,u.useMemo)(function(){return eu(h)},[h]),m=a.open,g=a.SnackbarProps,v=a.TransitionComponent,b=a.TransitionProps,y=a.transitionDuration,w=a.disableWindowBlurListener,x=a.content,S=P(a,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),k=T({direction:"center"!==(t=S.anchorOrigin).horizontal?ea[t.horizontal]:ea[t.vertical],timeout:y},b),C=x;"function"==typeof C&&(C=C(S.id,S.message));var M=["onEnter","onEntered","onExit","onExited"].reduce(function(t,n){var i;return T({},t,((i={})[n]=eh([e.snack[n],e[n]],S.id),i))},{});return c().createElement(el,{in:r,onExited:M.onExited},c().createElement(ep,{open:m,id:S.id,disableWindowBlurListener:w,autoHideDuration:S.autoHideDuration,className:d(ex.wrappedRoot,p.root,p["anchorOrigin"+B(S.anchorOrigin)]),SnackbarProps:g,onClose:s},c().createElement(v,Object.assign({},k,{appear:!0,in:m,onExit:M.onExit,onExited:l,onEnter:M.onEnter,onEntered:eh([M.onEntered,function(){e.snack.requestClose&&s(null,"instructed",e.snack.id)}],S.id)}),C||c().createElement(void 0===f?ew:f,Object.assign({},S)))))},ek=20,eC=6,eM=2,eT="."+eo,eD=er({root:((r={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:Y(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[eT]={padding:eC+"px 0px",transition:"padding 300ms ease 0ms"},r.maxWidth="calc(100% - "+2*ek+"px)",r[I]={width:"100%",maxWidth:"calc(100% - 32px)"},r),rootDense:((o={})[eT]={padding:eM+"px 0px"},o),top:{top:ek-eC+"px",flexDirection:"column"},bottom:{bottom:ek-eC+"px",flexDirection:"column-reverse"},left:((s={left:ek+"px"})[E]={alignItems:"flex-start"},s[I]={left:"16px"},s),right:((l={right:ek+"px"})[E]={alignItems:"flex-end"},l[I]={right:"16px"},l),center:((a={left:"50%",transform:"translateX(-50%)"})[E]={alignItems:"center"},a)}),eP=(0,u.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,i=e.anchorOrigin,r=e.dense,o=e.children,s=d("notistack-SnackbarContainer",eD[i.vertical],eD[i.horizontal],eD.root,n.containerRoot,n["containerAnchorOrigin"+B(i)],r&&eD.rootDense);return c().createElement("div",{className:s},o)}),eR=function(e){return!("string"==typeof e||(0,u.isValidElement)(e))},eA=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 i,r=eR(e)?e:t,o=eR(e)?e.message:e,s=r.key,l=r.preventDuplicate,a=P(r,["key","preventDuplicate"]),u=Z(s),c=u?s:new Date().getTime()+Math.random(),h=(i=n.props,function(e,t){return(void 0===t&&(t=!1),t)?T({},et[e],{},i[e],{},a[e]):"autoHideDuration"===e?en(a.autoHideDuration,i.autoHideDuration):"transitionDuration"===e?ei(a.transitionDuration,i.transitionDuration):a[e]||i[e]||et[e]}),f=T({id:c},a,{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:d(n.props.className,a.className)});return f.persist&&(f.autoHideDuration=void 0),n.setState(function(e){if(void 0===l&&n.props.preventDuplicate||l){var t=function(e){return u?e.id===c:e.message===o},i=e.queue.findIndex(t)>-1,r=e.snacks.findIndex(t)>-1;if(i||r)return e}return n.handleDisplaySnack(T({},e,{queue:[].concat(e.queue,[f])}))}),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?T({},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,i=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(i=!0);var r=e.snacks.map(function(e){return t||e.persist&&!i?T({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),T({},e,{open:!1})):T({},e,{requestClose:!0})});return T({},e,{snacks:r})},n.handleEnteredSnack=function(e,t,i){if(!Z(i))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===i?T({},e,{entered:!0}):T({},e)})}})},n.handleCloseSnack=function(e,t,i){n.props.onClose&&n.props.onClose(e,t,i);var r=void 0===i;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return r||e.id===i?e.entered?T({},e,{open:!1}):T({},e,{requestClose:!0}):T({},e)}),queue:n.filter(function(e){return e.id!==i})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});Z(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!Z(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var i=n.processQueue(T({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===i.queue.length?i:n.handleDismissOldest(i)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(R(n)),closeSnackbar:n.closeSnackbar.bind(R(n))}},n}return D(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,i=n.domRoot,r=n.children,o=n.dense,s=void 0!==o&&o,l=n.Components,a=void 0===l?{}:l,u=n.classes,d=this.state.snacks.reduce(function(e,t){var n,i=B(t.anchorOrigin),r=e[i]||[];return T({},e,((n={})[i]=[].concat(r,[t]),n))},{}),f=Object.keys(d).map(function(t){var n=d[t],i=n[0];return c().createElement(eP,{key:t,dense:s,anchorOrigin:i.anchorOrigin,classes:u},n.map(function(t){return c().createElement(eS,{key:t.id,snack:t,classes:u,Component:a[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:eh([e.handleExitedSnack,e.props.onExited],t.id),onEntered:eh([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return c().createElement(O.Provider,{value:t},r,i?(0,h.createPortal)(f,i):f)},M(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||et.maxSnack}}]),t}(u.Component),eO=function(){return(0,u.useContext)(O)}},68715:function(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 i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r={error:null},o=function(e){function t(){for(var t,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))||this).state=r,t.resetErrorBoundary=function(){for(var e,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,i),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(r)},o.componentDidCatch=function(e,t){var n,i;null==(n=(i=this.props).onError)||n.call(i,e,t)},o.componentDidUpdate=function(e,t){var n,i,r,o,s=this.state.error,l=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(i=l)&&(i=[]),n.length!==i.length||n.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(r=(o=this.props).onResetKeysChange)||r.call(o,e.resetKeys,l),this.reset())},o.render=function(){var e=this.state.error,t=this.props,i=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof i)return i(s);if(r)return n.createElement(r,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),i=t[0],r=t[1];if(null!=e)throw e;if(null!=i)throw i;return r},e.withErrorBoundary=function(e,t){var i=function(i){return n.createElement(o,t,n.createElement(e,i))},r=e.displayName||e.name||"Unknown";return i.displayName="withErrorBoundary("+r+")",i},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(54538))},15629:function(e,t,n){"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}n.d(t,{Z:()=>i})},88500:function(e,t,n){"use strict";function i(e){return(i="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 r(e,t,n){var r;return(r=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==i(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},10228:function(e,t,n){"use strict";n.d(t,{Z:()=>r});var i=n(28451);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,l=[],a=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(i=o.call(n)).done)&&(l.push(i.value),l.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return l}}(e,t)||(0,i.Z)(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.")}()}},28451:function(e,t,n){"use strict";n.d(t,{Z:()=>r});var i=n(15629);function r(e,t){if(e){if("string"==typeof e)return(0,i.Z)(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)?(0,i.Z)(e,t):void 0}}},10225:function(e,t,n){"use strict";n.d(t,{ap:()=>A,AV:()=>I});var i=n(19294);class r{constructor(e,t,n,i,r,o,s,l,a,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=o,this.buffer=s,this.bufferBase=l,this.curContext=a,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 i=e.parser.context;return new r(e,[],t,n,n,0,[],0,i?new o(i,i.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,i=65535&e,{parser:r}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let s=r.dynamicPrecedence(i);if(s&&(this.score+=s),0==n){this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(n-1)*3-(262144&e?6:0),a=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-a;u>=2e3&&!(null===(t=this.p.parser.nodeSet.types[i])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=u));let c=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-c;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,a,e,h+4,!0)}if(262144&e)this.state=this.stack[l];else{let e=this.stack[l-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,a)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,i=this.buffer.length;if(0==i&&e.parent&&(i=e.bufferBase-e.parent.bufferBase,e=e.parent),i>0&&0==e.buffer[i-4]&&e.buffer[i-1]>-1){if(t==n)return;if(e.buffer[i-2]>=t){e.buffer[i-2]=n;return}}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4]){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;(i>this.pos||t<=r.maxNode)&&(this.pos=i,r.stateFlag(e,1)||(this.reducePos=i)),this.pushState(e,n),this.shiftContext(t,n),t<=r.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,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-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new r(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,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 s(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 i=0,r;i<t.length;i+=2)(r=t[i+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[i],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}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,i=65535&t,r=this.stack.length-3*n;if(r<0||0>e.getGoto(this.stack[r],i,!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=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,r+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 o(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class o{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class s{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 l{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 l(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 l(this.stack,this.pos,this.index)}}function a(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let o=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),o+=r,n)break;o*=46}n?n[r++]=o:n=new t(o)}return n}class u{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let c=new u;class h{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=c,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,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}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,i;if(t>=0&&t<this.chunk.length)n=this.pos+e,i=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)i=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)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}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=c,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 i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class d{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;f(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function f(e,t,n,i,r,o){let s=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&e[s])!=0;){let n=e[s+1];for(let i=s+3;i<n;i+=2)if((e[i+1]&l)>0){let n=e[i];if(a.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,i){let r=p(n,i,t);return r<0||p(n,i,e)<r}(n,t.token.value,r,o))){t.acceptToken(n);break}}let i=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 r=u+c>>1,o=n+r+(r<<1),l=e[o],a=e[o+1]||65536;if(i<l)c=r;else if(i>=a)u=r+1;else{s=e[o+2],t.advance();continue e}}break}}function p(e,t,n){for(let i=t,r;65535!=(r=e[i]);i++)if(r==n)return i-t;return -1}d.prototype.contextual=d.prototype.fallback=d.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?a(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(f(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&i++,null==r)break;e.reset(r,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}).prototype.contextual=d.prototype.fallback=d.prototype.extend=!1;let m="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),g=null;function v(e,t,n){let r=e.cursor(i.vj.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 b{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?v(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?v(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 o=n.children[r],s=this.start[t]+n.positions[r];if(s>e)return this.nextStart=s,null;if(o instanceof i.mp){if(s==e){if(s<this.safeFrom)return null;let e=s+o.length;if(e<=this.safeTo){let t=o.prop(i.md.lookAhead);if(!t||e+t<this.fragment.to)return o}}this.index[t]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+o.length}}}class y{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new u)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,o=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,l=0;for(let i=0;i<r.length;i++){if((1<<i&o)==0)continue;let a=r[i],u=this.tokens[i];if((!n||a.fallback)&&((a.contextual||u.start!=e.pos||u.mask!=o||u.context!=s)&&(this.updateCachedToken(u,a,e),u.mask=o,u.context=s),u.lookAhead>u.end+25&&(l=Math.max(u.lookAhead,l)),0!=u.value)){let i=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!a.extend&&(n=u,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),n||e.pos!=this.stream.end||((n=new u).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 u,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){(1&r)==0?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let l=o.stateSlot(r,e?2:1);;l+=3){if(65535==s[l]){if(1==s[l+1])l=C(s,l+2);else{0==i&&2==s[l+1]&&(i=this.putAction(C(s,l+2),t,n,i));break}}s[l]==t&&(i=this.putAction(C(s,l+1),t,n,i))}return i}}class w{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,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 h(t,i),this.tokens=new y(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[r.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>4*e.bufferLength?new b(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=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>i)r.push(s);else{if(this.advanceStack(s,r,n))continue;e||(e=[],t=[]),e.push(s);let i=this.tokens.getMainToken(s);t.push(i.value,i.end)}break}}if(!r.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 m&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw m&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+i);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,r);if(n)return m&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1){t:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)r.splice(n--,1);else{r.splice(e--,1);continue t}}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[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:o}=this,s=m?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 l=this.fragments.nodeAt(r);l;){let r=this.parser.nodeSet.types[l.type.id]==l.type?o.getGoto(e.state,l.type.id):-1;if(r>-1&&l.length&&(!t||(l.prop(i.md.contextHash)||0)==n))return e.useNode(l,r),m&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(l.type.id)})`),!0;if(!(l instanceof i.mp)||0==l.children.length||l.positions[0]>0)break;let a=l.children[0];if(a instanceof i.mp&&0==l.positions[0])l=a;else break}}let l=o.stateSlot(e.state,4);if(l>0)return e.reduce(l),m&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(65535&l)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let i=0;i<a.length;){let l=a[i++],u=a[i++],c=a[i++],h=i==a.length||!n,d=h?e:e.split(),f=this.tokens.mainToken;if(d.apply(l,u,f?f.start:d.pos,c),m&&console.log(s+this.stackID(d)+` (via ${(65536&l)==0?"shift":`reduce of ${o.getName(65535&l)}`} for ${o.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 x(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let o=0;o<e.length;o++){let s=e[o],l=t[o<<1],a=t[(o<<1)+1],u=m?this.stackID(s)+" -> ":"";if(s.deadEnd&&(r||(r=!0,s.restart(),m&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let c=s.split(),h=u;for(let e=0;c.forceReduce()&&e<10&&(m&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)m&&(h=this.stackID(c)+" -> ");for(let e of s.recoverByInsert(l))m&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(a==s.pos&&(a++,l=0),s.recoverByDelete(l,a),m&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),x(s,n)):(!i||i.score<s.score)&&(i=s)}return i}stackToTree(e){return e.close(),i.mp.build({buffer:l.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=(g||(g=new WeakMap)).get(e);return t||g.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function x(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class S{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class k extends i._b{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 o(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=i.md[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)o(i,e,t[n++]);else{let r=t[n+-i];for(let s=-i;s>0;s--)o(t[n++],e,r);n++}}}this.nodeSet=new i.Lj(t.map((t,o)=>i.Jq.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:r[o],top:n.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=i.L3;let s=a(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(M),this.states=a(e.states,Uint32Array),this.data=a(e.stateData),this.goto=a(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new d(s,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 i=new w(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let t=i[r++],o=1&t,s=i[r++];if(o&&n)return s;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return s;if(o)return -1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(e,i?2:1),o;;r+=3){if(65535==(o=n[r])){if(1==n[r+1])o=n[r=C(n,r+2)];else if(2==n[r+1])return C(n,r+2);else break}if(o==t||0==o)return C(n,r+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),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=C(this.data,n+2);else break}i=t(C(this.data,n+1))}return i}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=C(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(k.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,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=M(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 i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],r;65535!=(r=this.data[n++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[r]=1;return new S(e,n,i)}static deserialize(e){return new k(e)}}function C(e,t){return e[t]|e[t+1]<<16}function M(e){if(e.external){let t=+!!e.extend;return(n,i)=>e.external(n,i)<<1|t}return e.get}var T=n(94197);let D=(0,T.Gv)({String:T.pJ.string,Number:T.pJ.number,"True False":T.pJ.bool,PropertyName:T.pJ.propertyName,Null:T.pJ.null,", :":T.pJ.separator,"[ ]":T.pJ.squareBracket,"{ }":T.pJ.brace}),P=k.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:[D],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});var R=n(61262);let A=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(o){var t,n;let i;if(!(o instanceof SyntaxError))throw o;let r=(t=o,n=e.state.doc,(i=t.message.match(/at position (\d+)/))?Math.min(+i[1],n.length):(i=t.message.match(/at line (\d+) column (\d+)/))?Math.min(n.line(+i[1]).from+ +i[2]-1,n.length):0);return[{from:r,message:o.message,severity:"error",to:r}]}return[]},O=R.qp.define({name:"json",parser:P.configure({props:[R.uj.add({Object:(0,R.tC)({except:/^\s*\}/}),Array:(0,R.tC)({except:/^\s*\]/})}),R.x0.add({"Object Array":R.Dv})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function I(){return new R.ri(O)}},61262:function(e,t,n){"use strict";n.d(t,{Dv:()=>N,Gn:()=>A,K0:()=>R,Qf:()=>es,R_:()=>ed,SS:()=>P,Um:()=>eC,c:()=>T,e7:()=>K,mi:()=>er,n$:()=>ew,nF:()=>ec,nY:()=>Z,qp:()=>f,qz:()=>p,ri:()=>C,tC:()=>B,uj:()=>O,x0:()=>V,y1:()=>D});var i,r=n(19294),o=n(69444),s=n(69485),l=n(94197),a=n(76007);let u=new r.md,c=new r.md;class h{constructor(e,t,n=[],i=""){this.data=e,this.name=i,o.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(o.yy.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[k.of(this),o.yy.languageData.of((e,t,n)=>{let i=d(e,t,n),r=i.type.prop(u);if(!r)return[];let o=e.facet(r),s=i.type.prop(c);if(s){let r=i.resolve(t-i.from,n);for(let t of s)if(t.test(r,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 d(e,t,n).type.prop(u)==this.data}findRegions(e){let t=e.facet(k);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(u)==this.data){n.push({from:t,to:t+e.length});return}let o=e.prop(r.md.mounted);if(o){if(o.tree.prop(u)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(i(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let o=e.children[n];o instanceof r.mp&&i(o,e.positions[n]+t)}};return i(p(e),0),n}get allowsNesting(){return!0}}function d(e,t,n){let i=e.facet(k),o=p(e).topNode;if(!i||i.allowsNesting)for(let e=o;e;e=e.enter(t,n,r.vj.ExcludeBuffers))e.type.isTop&&(o=e);return o}h.setState=o.Py.define();class f extends h{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,o.r$.define({combine:t?e=>e.concat(t):void 0}));return new f(n,e.parser.configure({props:[u.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new f(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(h.state,!1);return t?t.tree:r.mp.empty}class m{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 g=null;class v{constructor(e,t,n=[],i,r,o,s,l){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new v(e,t,[],r.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new m(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=r.mp.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 i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(r.i9.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,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(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=g;g=this;try{return e()}finally{g=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=b(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:o,viewport:s,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=r.i9.applyChanges(n,t),i=r.mp.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length)for(let t of(l=[],this.skipped)){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&l.push({from:n,to:i})}}return new v(this.parser,t,n,i,o,s,l,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:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=b(this.fragments,n,i),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 r._b{createParse(t,n,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let t=g;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new r.mp(r.Jq.none,[],[],s-o)},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 g}}function b(e,t,n){return r.i9.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class y{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 y(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=v.create(e.facet(k).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new y(n)}}h.state=o.QQ.define({create:y.init,update(e,t){for(let e of t.effects)if(e.is(h.setState))return e.value;return t.startState.facet(k)!=t.state.facet(k)?y.init(t.state):e.apply(t)}});let w=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(w=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let x="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,S=s.lg.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(h.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(h.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=w(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:i}}=this.view,r=n.field(h.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!x?Math.max(25,e.timeRemaining()-5):1e9),s=r.context.treeLen<i&&n.doc.length>i+1e3,l=r.context.work(()=>x&&x()||Date.now()>o,i+1e5*!s);this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:h.setState.of(new y(r.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,s.OO)(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()}}}),k=o.r$.define({combine:e=>e.length?e[0]:null,enables:e=>[h.state,S,s.tk.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class C{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let M=o.r$.define(),T=o.r$.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 D(e){let t=e.facet(T);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function P(e,t){let n="",i=e.tabSize,r=e.facet(T)[0];if(" "==r){for(;t>=i;)n+=" ",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function R(e,t){for(let n of(e instanceof o.yy&&(e=new A(e)),e.state.facet(M))){let i=n(e,t);if(void 0!==i)return i}let n=p(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t&&(t.from!=i.node.from||t.type!=i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return I(i,e,n)}(e,n,t):null}class A{constructor(e,t={}){this.state=e,this.options=t,this.unit=D(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return(0,o.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let O=new r.md;function I(e,t,n){for(let i=e;i;i=i.next){let e=function(e){let t=e.type.prop(O);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(r.md.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>(function(e,t,n,i,r){let o=e.textAfter,s=o.match(/^\s*/)[0].length,l=i&&o.slice(s,s+i.length)==i||r==e.pos+s,a=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.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=r.to}}(e):null;return a?l?e.column(a.from):e.column(a.to):e.baseIndent+(l?0:+e.unit)})(e,!0,1,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?E:null}(i.node);if(e)return e(L.create(t,n,i))}return 0}function E(){return 0}class L extends A{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 L(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 I(this.context.next,this.base,this.pos)}}function B({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}function Z(){return o.yy.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:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let o=n.sliceString(r.from,i);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,l=-1,a=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==l)continue;l=t.from;let n=R(s,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=P(s,n);i!=r&&a.push({from:t.from,to:t.from+i.length,insert:r})}return a.length?[e,{changes:a,sequential:!0}]:e})}let F=o.r$.define(),V=new r.md;function N(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}function j(e,t,n){for(let i of e.facet(F)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=p(e);if(i.length<n)return null;let r=i.resolveStack(n,1),o=null;for(let s=r;s;s=s.next){let r=s.node;if(r.to<=n||r.from>n)continue;if(o&&r.from<t)break;let l=r.type.prop(V);if(l&&(r.to<i.length-50||i.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(r))){let i=l(r,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(o=i)}}return o}(e,t,n)}function H(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let z=o.Py.define({map:H}),$=o.Py.define({map:H});function W(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 _=o.QQ.define({create:()=>s.p.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))if(n.is(z)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,n.value.from,n.value.to)){let{preparePlaceholder:i}=t.state.facet(J),r=i?s.p.replace({widget:new et(i(t.state,n.value))}):ee;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is($)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:i}=t.selection.main;e.between(i,i,(e,t)=>{e<i&&t>i&&(n=!0)}),n&&(e=e.update({filterFrom:i,filterTo:i,filter:(e,t)=>t<=i||e>=i}))}return e},provide:e=>s.tk.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 i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw RangeError("Invalid JSON for fold state");t.push(ee.range(i,r))}return s.p.set(t,!0)}});function q(e,t,n){var i;let r=null;return null===(i=e.field(_,!1))||void 0===i||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function G(e,t){return e.field(_,!1)?t:t.concat(o.Py.appendConfig.of(X()))}function U(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return s.tk.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let K=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of W(e)){let n=j(e.state,t.from,t.to);if(n)return e.dispatch({effects:G(e.state,[z.of(n),U(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(_,!1))return!1;let t=[];for(let n of W(e)){let i=q(e.state,n.from,n.to);i&&t.push($.of(i),U(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),o=j(t,r.from,r.to);o&&n.push(z.of(o)),i=(o?e.lineBlockAt(o.to):r).to+1}return n.length&&e.dispatch({effects:G(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(_,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push($.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Y={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},J=o.r$.define({combine:e=>(0,o.BO)(e,Y)});function X(e){let t=[_,eo];return e&&t.push(J.of(e)),t}function Q(e,t){let{state:n}=e,i=n.facet(J),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=q(e.state,n.from,n.to);i&&e.dispatch({effects:$.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}let ee=s.p.replace({widget:new class extends s.l9{toDOM(e){return Q(e,null)}}});class et extends s.l9{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Q(e,this.value)}}let en={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ei extends s.SJ{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}}function er(e={}){let t=Object.assign(Object.assign({},en),e),n=new ei(t,!0),i=new ei(t,!1),r=s.lg.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(k)!=e.state.facet(k)||e.startState.field(_,!1)!=e.state.field(_,!1)||p(e.startState)!=p(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new o.f_;for(let r of e.viewportLineBlocks){let o=q(e.state,r.from,r.to)?i:j(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:l}=t;return[r,(0,s.v5)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||o.Xs.empty},initialSpacer:()=>new ei(t,!1),domEventHandlers:Object.assign(Object.assign({},l),{click:(e,t,n)=>{if(l.click&&l.click(e,t,n))return!0;let i=q(e.state,t.from,t.to);if(i)return e.dispatch({effects:$.of(i)}),!0;let r=j(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:z.of(r)}),!0)}})}),X()]}let eo=s.tk.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 es{constructor(e,t){let n;function i(e){let t=a.V.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof h?e=>e.prop(u)==o.data:o?e=>e==o:void 0,this.style=(0,l.QR)(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new a.V(n):null,this.themeType=t.themeType}static define(e,t){return new es(e,t||{})}}let el=o.r$.define(),ea=o.r$.define({combine:e=>e.length?[e[0]]:null});function eu(e){let t=e.facet(el);return t.length?t:e.facet(ea)}function ec(e,t){let n=[eh],i;return e instanceof es&&(e.module&&n.push(s.tk.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(ea.of(e)):i?n.push(el.computeN([s.tk.darkTheme],t=>t.facet(s.tk.darkTheme)==("dark"==i)?[e]:[])):n.push(el.of(e)),n}let eh=o.Wl.high(s.lg.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,eu(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=p(e.state),n=eu(e.state),i=n!=eu(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return s.p.none;let n=new o.f_;for(let{from:i,to:r}of e.visibleRanges)(0,l.bW)(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=s.p.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),ed=es.define([{tag:l.pJ.meta,color:"#404740"},{tag:l.pJ.link,textDecoration:"underline"},{tag:l.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:l.pJ.emphasis,fontStyle:"italic"},{tag:l.pJ.strong,fontWeight:"bold"},{tag:l.pJ.strikethrough,textDecoration:"line-through"},{tag:l.pJ.keyword,color:"#708"},{tag:[l.pJ.atom,l.pJ.bool,l.pJ.url,l.pJ.contentSeparator,l.pJ.labelName],color:"#219"},{tag:[l.pJ.literal,l.pJ.inserted],color:"#164"},{tag:[l.pJ.string,l.pJ.deleted],color:"#a11"},{tag:[l.pJ.regexp,l.pJ.escape,l.pJ.special(l.pJ.string)],color:"#e40"},{tag:l.pJ.definition(l.pJ.variableName),color:"#00f"},{tag:l.pJ.local(l.pJ.variableName),color:"#30a"},{tag:[l.pJ.typeName,l.pJ.namespace],color:"#085"},{tag:l.pJ.className,color:"#167"},{tag:[l.pJ.special(l.pJ.variableName),l.pJ.macroName],color:"#256"},{tag:l.pJ.definition(l.pJ.propertyName),color:"#00c"},{tag:l.pJ.comment,color:"#940"},{tag:l.pJ.invalid,color:"#f00"}]),ef=s.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ep="()[]{}",em=o.r$.define({combine:e=>(0,o.BO)(e,{afterCursor:!0,brackets:ep,maxScanDistance:1e4,renderMatch:eb})}),eg=s.p.mark({class:"cm-matchingBracket"}),ev=s.p.mark({class:"cm-nonmatchingBracket"});function eb(e){let t=[],n=e.matched?eg:ev;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let ey=[o.QQ.define({create:()=>s.p.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],i=t.state.facet(em);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=eC(t.state,e.head,-1,i)||e.head>0&&eC(t.state,e.head-1,1,i)||i.afterCursor&&(eC(t.state,e.head,1,i)||e.head<t.state.doc.length&&eC(t.state,e.head+1,-1,i));r&&(n=n.concat(i.renderMatch(r,t.state)))}return s.p.set(n,!0)},provide:e=>s.tk.decorations.from(e)}),ef];function ew(e={}){return[em.of(e),ey]}let ex=new r.md;function eS(e,t,n){let i=e.prop(t<0?r.md.openedBy:r.md.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==+(t<0))return[n[i+t]]}return null}function ek(e){let t=e.type.prop(ex);return t?t(e.node):e}function eC(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||ep,s=p(e),l=s.resolveInner(t,n);for(let e=l;e;e=e.parent){let i=eS(e.type,n,o);if(i&&e.from<e.to){let r=ek(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return function(e,t,n,i,r,o,s){let l=i.parent,a={from:r.from,to:r.to},u=0,c=null==l?void 0:l.cursor();if(c&&(n<0?c.childBefore(i.from):c.childAfter(i.to)))do if(n<0?c.to<=i.from:c.from>=i.to){if(0==u&&o.indexOf(c.type.name)>-1&&c.from<c.to){let e=ek(c);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(eS(c.type,n,s))u++;else if(eS(c.type,-n,s)){if(0==u){let e=ek(c);return{start:a,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}(0,0,n,e,r,i,o)}}return function(e,t,n,i,r,o,s){let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),a=s.indexOf(l);if(a<0||a%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 l=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)&&i.resolveInner(l+e,1).type==r){if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:l+e,to:l+e+1},matched:t>>1==a>>1};h--}}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,s,l.type,r,o)}let eM=Object.create(null),eT=[r.Jq.none],eD=[],eP=Object.create(null),eR=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"]])eR[e]=function(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||l.pJ[n];i?"function"==typeof i?t.length?t=t.map(i):eA(n,`Modifier ${n} used at start of tag`):t.length?eA(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:eA(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),o=i+" "+n.map(e=>e.id),s=eP[o];if(s)return s.id;let a=eP[o]=r.Jq.define({id:eT.length,name:i,props:[(0,l.Gv)({[i]:n})]});return eT.push(a),a.id}(eM,t);function eA(e,t){eD.indexOf(e)>-1||(eD.push(e),console.warn(t))}s.Nm.RTL,s.Nm.LTR},68799:function(e,t,n){"use strict";n.d(t,{Fv:()=>b,Q2:()=>N,ir:()=>x});var i=n(69485),r=n(69444),o=n(59718);class s{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class l{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,s=n.facet(w).markerFilter;s&&(o=s(o,n));let u=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),c=new r.f_,h=[],d=0;for(let e=0;;){let t,r,o=e==u.length?null:u[e];if(!o&&!h.length)break;for(h.length?(t=d,r=h.reduce((e,t)=>Math.min(e,t.to),o&&o.from>t?o.from:1e8)):(t=o.from,r=o.to,h.push(o),e++);e<u.length;){let n=u[e];if(n.from==t&&(n.to>n.from||n.to==t))h.push(n),e++,r=Math.min(n.to,r);else{r=Math.min(n.from,r);break}}let s=A(h);if(h.some(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from))c.add(t,t,i.p.widget({widget:new C(s),diagnostics:h.slice()}));else{let e=h.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");c.add(t,r,i.p.mark({class:"cm-lintRange cm-lintRange-"+s+e,diagnostics:h.slice(),inclusiveEnd:h.some(e=>e.to>r)}))}d=r;for(let e=0;e<h.length;e++)h[e].to<=d&&h.splice(e--,1)}let f=c.finish();return new l(f,t,a(f))}}function a(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!(t&&0>r.diagnostics.indexOf(t))){if(i){if(0>r.diagnostics.indexOf(i.diagnostic))return!1;i=new s(i.from,n,i.diagnostic)}else i=new s(e,n,t||r.diagnostics[0])}}),i}function u(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(w).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(h))||e.changes.touchesRange(o.from,Math.max(o.to,i)))}function c(e,t){return e.field(p,!1)?t:t.concat(r.Py.appendConfig.of(F))}let h=r.Py.define(),d=r.Py.define(),f=r.Py.define(),p=r.QQ.define({create:()=>new l(i.p.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=a(n,e.selected.diagnostic,r)||a(n,null,r)}!n.size&&r&&t.state.facet(w).autoPanel&&(r=null),e=new l(n,r,i)}for(let n of t.effects)if(n.is(h)){let i=t.state.facet(w).autoPanel?n.value.length?T.open:null:e.panel;e=l.init(n.value,i,t.state)}else n.is(d)?e=new l(e.diagnostics,n.value?T.open:null,e.selected):n.is(f)&&(e=new l(e.diagnostics,e.panel,n.value));return e},provide:e=>[i.mH.from(e,e=>e.panel),i.tk.decorations.from(e,e=>e.diagnostics)]}),m=i.p.mark({class:"cm-lintRange cm-lintRange-active"});function g(e,t){return(0,o.Z)("ul",{class:"cm-tooltip-lint"},t.map(t=>k(e,t,!1)))}let v=e=>{let t=e.state.field(p,!1);return!!t&&!!t.panel&&(e.dispatch({effects:d.of(!1)}),!0)},b=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(p,!1);t&&t.panel||e.dispatch({effects:c(e.state,[d.of(!0)])});let n=(0,i.Sd)(e,T.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(p,!1);if(!t)return!1;let n=e.state.selection.main,i=t.diagnostics.iter(n.to+1);return(!!i.value||!!(i=t.diagnostics.iter(0)).value&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)}}],y=i.lg.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(w);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(w);t.length&&function(e,t,n){let i=[],r=-1;for(let o of e)o.then(n=>{i.push(n),clearTimeout(r),i.length==e.length?t(i):r=setTimeout(()=>t(i),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{if(this.view.state.doc==e.doc){var n,i;this.view.dispatch((n=this.view.state,i=t.reduce((e,t)=>e.concat(t)),{effects:c(n,[h.of(i)])}))}},e=>{(0,i.OO)(this.view.state,e)})}}update(e){let t=e.state.facet(w);(e.docChanged||t!=e.startState.facet(w)||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)}}),w=r.r$.define({combine:e=>Object.assign({sources:e.map(e=>e.source).filter(e=>null!=e)},(0,r.BO)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function x(e,t={}){return[w.of({source:e,config:t}),y,F]}function S(e){let t=[];if(e)n:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue n}}t.push("")}return t}function k(e,t,n){var i;let r=n?S(t.actions):[];return(0,o.Z)("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},(0,o.Z)("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let s=!1,l=i=>{if(i.preventDefault(),s)return;s=!0;let r=a(e.state.field(p).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:u}=n,c=r[i]?u.indexOf(r[i]):-1,h=c<0?u:[u.slice(0,c),(0,o.Z)("u",u.slice(c,c+1)),u.slice(c+1)];return(0,o.Z)("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${u}${c<0?"":` (access key "${r[i]})"`}.`},h)}),t.source&&(0,o.Z)("div",{class:"cm-diagnosticSource"},t.source))}class C extends i.l9{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return(0,o.Z)("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class M{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=k(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class T{constructor(e){this.view=e,this.items=[],this.list=(0,o.Z)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)v(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],i=S(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=a(this.view.state.field(p).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=(0,o.Z)("div",{class:"cm-panel-lint"},this.list,(0,o.Z)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>v(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(p).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(p),n=0,i=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,s,{spec:l})=>{for(let e of l.diagnostics){if(o.has(e))continue;o.add(e);let s=-1,l;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){s=t;break}s<0?(l=new M(this.view,e),this.items.splice(n,0,l),i=!0):(l=this.items[s],s>n&&(this.items.splice(n,s-n),i=!0)),t&&l.diagnostic==t.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),r=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new M(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.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"),i&&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=a(this.view.state.field(p).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:f.of(t)})}static open(e){return new T(e)}}function D(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 P(e){return D(`<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 R=i.tk.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:P("#d11")},".cm-lintRange-warning":{backgroundImage:P("orange")},".cm-lintRange-info":{backgroundImage:P("#999")},".cm-lintRange-hint":{backgroundImage:P("#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}}});function A(e){let t="hint",n=1;for(let r of e){var i;let e="error"==(i=r.severity)?4:"warning"==i?3:"info"==i?2:1;e>n&&(n=e,t=r.severity)}return t}class O extends i.SJ{constructor(e){super(),this.diagnostics=e,this.severity=A(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,i=e.state.facet(V).tooltipFilter;return i&&(n=i(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function i(){let i,r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:L.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:g(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,i=n=>{let r=t.getBoundingClientRect();if(!(n.clientX>r.left-10)||!(n.clientX<r.right+10)||!(n.clientY>r.top-10)||!(n.clientY<r.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",i),e.state.field(B)&&e.dispatch({effects:L.of(null)})}},window.addEventListener("mousemove",i)}let{hoverTime:r}=e.state.facet(V),o=setTimeout(i,r);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(i,r)}})(e,t,n)),t}}let I=(0,i.v5)({class:"cm-gutter-lint",markers:e=>e.state.field(E),widgetMarker:(e,t,n)=>{let i=[];return e.state.field(E).between(n.from,n.to,(e,t,r)=>{e>n.from&&e<n.to&&i.push(...r.diagnostics)}),i.length?new O(i):null}}),E=r.QQ.define({create:()=>r.Xs.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(V).markerFilter;for(let i of t.effects)if(i.is(h)){let o=i.value;n&&(o=n(o||[],t.state)),e=function(e,t){let n=Object.create(null);for(let i of t){let t=e.lineAt(i.from);(n[t.from]||(n[t.from]=[])).push(i)}let i=[];for(let e in n)i.push(new O(n[e]).range(+e));return r.Xs.of(i,!0)}(t.state.doc,o.slice(0))}return e}}),L=r.Py.define(),B=r.QQ.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=u(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce((e,t)=>t.is(L)?t.value:e,e)),provide:e=>i.hJ.from(e)}),Z=i.tk.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:D('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:D('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:D('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),F=[p,i.tk.decorations.compute([p],e=>{let{selected:t,panel:n}=e.field(p);return t&&n&&t.from!=t.to?i.p.set([m.range(t.from,t.to)]):i.p.none}),(0,i.bF)(function(e,t,n){let{diagnostics:i}=e.state.field(p),r,o=-1,s=-1;i.between(t-+(n<0),t+ +(n>0),(e,i,{spec:l})=>{if(t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t<i||n<0)))return r=l.diagnostics,o=e,s=i,!1});let l=e.state.facet(w).tooltipFilter;return(r&&l&&(r=l(r,e.state)),r)?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create:()=>({dom:g(e,r)})}:null},{hideOn:u}),R],V=r.r$.define({combine:e=>(0,r.BO)(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function N(e={}){return[V.of(e),E,I,Z,B]}},69444:function(e,t,n){"use strict";let i;n.d(t,{Py:()=>ef,q6:()=>ec,n0:()=>R,Xs:()=>eD,xv:()=>d,YW:()=>ep,as:()=>A,IS:()=>eN,gm:()=>S,jT:()=>V,gc:()=>P,bg:()=>k,uU:()=>ek,f_:()=>eP,yy:()=>ex,BO:()=>eS,QQ:()=>G,r$:()=>H,D0:()=>ey,nZ:()=>C,cp:()=>x,Gz:()=>ej,Wl:()=>Y});let r=[],o=[];function s(e){return e>=127462&&e<=127487}function l(e,t,n){if(t==e.length)return t;t&&u(e.charCodeAt(t))&&c(e.charCodeAt(t-1))&&t--;let i=a(e,t);for(t+=h(i);t<e.length;){let l=a(e,t);if(8205==i||8205==l||n&&function(e){if(e<768)return!1;for(let t=0,n=r.length;;){let i=t+n>>1;if(e<r[i])n=i;else{if(!(e>=o[i]))return!0;t=i+1}if(t==n)return!1}}(l))t+=h(l),i=l;else if(s(l)){let n=0,i=t-2;for(;i>=0&&s(a(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function a(e,t){let n=e.charCodeAt(t);if(!c(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return u(i)?(n-55296<<10)+(i-56320)+65536:n}function u(e){return e>=56320&&e<57344}function c(e){return e>=55296&&e<56320}function h(e){return e<65536?1:2}(()=>{let e="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 t=0,n=0;t<e.length;t++)(t%2?o:r).push(n+=e[t])})();class d{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]=w(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),p.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=w(this,e,t);let n=[];return this.decompose(e,t,n,0),p.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),i=new g(this),r=new g(e);for(let e=t,o=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new g(this,e)}iterRange(e,t=this.length){return new v(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new b(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}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 f(e):p.from(f.split(e,[])):d.empty}}class f extends d{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,i){for(let r=0;;r++){let o=this.text[r],s=i+o.length;if((t?n:s)>=e)return new y(i,s,n,o);i=s+1,n++}}decompose(e,t,n,i){var r;let o=e<=0&&t>=this.length?this:new f((r=this.text,m(r,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=m(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new f(t,e.length+o.length));else{let e=t.length>>1;n.push(new f(t.slice(0,e)),new f(t.slice(e)))}}else n.push(o)}replace(e,t,n){var i,r;if(!(n instanceof f))return super.replace(e,t,n);[e,t]=w(this,e,t);let o=m(this.text,m(n.text,(i=this.text,r=0,m(i,[""],0,e))),t),s=this.length+n.length-(t-e);return o.length<=32?new f(o,s):p.from(f.split(o,[]),s)}sliceString(e,t=this.length,n="\n"){[e,t]=w(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let s=this.text[o],l=r+s.length;r>e&&o&&(i+=n),e<l&&t>r&&(i+=s.slice(Math.max(0,e-r),t-r)),r=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new f(n,i)),n=[],i=-1);return i>-1&&t.push(new f(n,i)),t}}class p extends d{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,i){for(let r=0;;r++){let o=this.children[r],s=i+o.length,l=n+o.lines-1;if((t?l:s)>=e)return o.lineInner(e,t,n,i);i=s+1,n=l+1}}decompose(e,t,n,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let s=this.children[r],l=o+s.length;if(e<=l&&t>=o){let r=i&(+(o<=e)|2*(l>=t));o>=e&&l<=t&&!r?n.push(s):s.decompose(e-o,t-o,n,r)}o=l+1}}replace(e,t,n){if([e,t]=w(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],s=r+o.length;if(e>=r&&t<=s){let l=o.replace(e-r,t-r,n),a=this.lines-o.lines+l.lines;if(l.lines<a>>4&&l.lines>a>>6){let r=this.children.slice();return r[i]=l,new p(r,this.length-(t-e)+n.length)}return super.replace(r,s,l)}r=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=w(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let s=this.children[r],l=o+s.length;o>e&&r&&(i+=n),e<l&&t>o&&(i+=s.sliceString(e-o,t-o,n)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof p))return 0;let n=0,[i,r,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==s)return n;let l=this.children[i],a=e.children[r];if(l!=a)return n+l.scanIdentical(a,t);n+=l.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 f(n,t)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,s=[],l=0,a=-1,u=[];function c(){0!=l&&(s.push(1==u.length?u[0]:p.from(u,a)),a=-1,l=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>r&&t instanceof p)for(let n of t.children)e(n);else t.lines>o&&(l>o||!l)?(c(),s.push(t)):t instanceof f&&l&&(n=u[u.length-1])instanceof f&&t.lines+n.lines<=32?(l+=t.lines,a+=t.length+1,u[u.length-1]=new f(n.text.concat(t.text),n.length+1+t.length)):(l+t.lines>i&&c(),l+=t.lines,a+=t.length+1,u.push(t))}(t);return c(),1==s.length?s[0]:new p(s,t)}}function m(e,t,n=0,i=1e9){for(let r=0,o=0,s=!0;o<e.length&&r<=i;o++){let l=e[o],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),s?(t[t.length-1]+=l,s=!1):t.push(l)),r=a+1}return t}d.empty=new f([""],0);class g{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 f?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,s=i instanceof f?i.text.length:i.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&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof f){let r=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[o+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof f?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class v{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new g(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:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.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 b{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=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=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(d.prototype[Symbol.iterator]=function(){return this.iter()},g.prototype[Symbol.iterator]=v.prototype[Symbol.iterator]=b.prototype[Symbol.iterator]=function(){return this});class y{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function w(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function x(e,t,n=!0,i=!0){return function(e,t,n=!0,i=!0){return(n?l:function(e,t,n){for(;t>0;){let i=l(e,t-2,n);if(i<t)return i;t--}return 0})(e,t,i)}(e,t,n,i)}function S(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return i>=56320&&i<57344?(n-55296<<10)+(i-56320)+65536:n}function k(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function C(e){return e<65536?1:2}let M=/\r\n?|\n/;var T,D,P=((T=P||(P={}))[T.Simple=0]="Simple",T[T.TrackDel=1]="TrackDel",T[T.TrackBefore=2]="TrackBefore",T[T.TrackAfter=3]="TrackAfter",T);class R{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,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,r),i+=r):i+=o,n+=r}}iterChangedRanges(e,t=!1){E(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new R(e)}composeDesc(e){return this.empty?e:e.empty?this:B(this,e)}mapDesc(e,t=!1){return e.empty?this:L(this,e,t)}mapPos(e,t=-1,n=P.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],l=this.sections[o++],a=i+s;if(l<0){if(a>e)return r+(e-i);r+=s}else{if(n!=P.Simple&&a>=e&&(n==P.TrackDel&&i<e&&a>e||n==P.TrackBefore&&i<e||n==P.TrackAfter&&a>e))return null;if(a>e||a==e&&t<0&&!s)return e==i||t<0?r:r+l;r+=l}i=a}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=this.sections[n++],o=this.sections[n++],s=i+r;if(o>=0&&i<=t&&s>=e)return!(i<e)||!(s>t)||"cover";i=s}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}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 R(e)}static create(e){return new R(e)}}class A extends R{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 E(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return L(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],s=t[i+1];if(s>=0){t[i]=s,t[i+1]=o;let l=i>>1;for(;n.length<l;)n.push(d.empty);n.push(o?e.slice(r,r+o):d.empty)}r+=o}return new A(t,n)}compose(e){return this.empty?e:e.empty?this:B(this,e,!0)}map(e,t=!1){return e.empty?this:L(this,e,t,!0)}iterChanges(e,t=!1){E(this,e,t)}get desc(){return R.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new Z(this);i:for(let o=0,s=0;;){let l=o==e.length?1e9:e[o++];for(;s<l||s==l&&0==r.len;){if(r.done)break i;let e=Math.min(r.len,l-s);O(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;O(t,e,o),o>0&&I(n,t,r.text),r.forward(e),s+=e}let a=e[o++];for(;s<a;){if(r.done)break i;let e=Math.min(r.len,a-s);O(t,e,-1),O(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),s+=e}}return{changes:new A(t,n),filtered:R.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,s=null;function l(e=!1){if(!e&&!i.length)return;o<t&&O(i,t-o,-1);let n=new A(i,r);s=s?s.compose(n.map(s)):n,i=[],r=[],o=0}return!function e(a){if(Array.isArray(a))for(let t of a)e(t);else if(a instanceof A){if(a.length!=t)throw RangeError(`Mismatched change set length (got ${a.length}, expected ${t})`);l(),s=s?s.compose(a.map(s)):a}else{let{from:e,to:s=e,insert:u}=a;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?d.of(u.split(n||M)):u:d.empty,h=c.length;if(e==s&&0==h)return;e<o&&l(),e>o&&O(i,e-o,-1),O(i,s-e,h),I(r,i,c),o=s}}(e),l(!s),s}static empty(e){return new A(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(d.empty);n[i]=d.of(r.slice(1)),t.push(r[0],n[i].length)}}return new A(t,n)}static createSet(e,t){return new A(e,t)}}function O(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function I(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(d.empty);e.push(n)}}function E(e,t,n){let i=e.inserted;for(let r=0,o=0,s=0;s<e.sections.length;){let l=e.sections[s++],a=e.sections[s++];if(a<0)r+=l,o+=l;else{let u=r,c=o,h=d.empty;for(;u+=l,c+=a,a&&i&&(h=h.append(i[s-2>>1])),!n&&s!=e.sections.length&&!(e.sections[s+1]<0);)l=e.sections[s++],a=e.sections[s++];t(r,u,o,c,h),r=u,o=c}}}function L(e,t,n,i=!1){let r=[],o=i?[]:null,s=new Z(e),l=new Z(t);for(let e=-1;;){if(s.done&&l.len||l.done&&s.len)throw Error("Mismatched change set lengths");if(-1==s.ins&&-1==l.ins){let e=Math.min(s.len,l.len);O(r,e,-1),s.forward(e),l.forward(e)}else if(l.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(l.len<s.len||l.len==s.len&&!n))){let t=l.len;for(O(r,l.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(O(r,0,s.ins),o&&I(o,r,s.text),e=s.i),s.forward(n),t-=n}l.next()}else if(s.ins>=0){let t=0,n=s.len;for(;n;)if(-1==l.ins){let e=Math.min(n,l.len);t+=e,n-=e,l.forward(e)}else if(0==l.ins&&l.len<n)n-=l.len,l.next();else break;O(r,t,e<s.i?s.ins:0),o&&e<s.i&&I(o,r,s.text),e=s.i,s.forward(s.len-n)}else if(s.done&&l.done)return o?A.createSet(r,o):R.create(r);else throw Error("Mismatched change set lengths")}}function B(e,t,n=!1){let i=[],r=n?[]:null,o=new Z(e),s=new Z(t);for(let e=!1;;){if(o.done&&s.done)return r?A.createSet(i,r):R.create(i);if(0==o.ins)O(i,o.len,0,e),o.next();else if(0!=s.len||s.done){if(o.done||s.done)throw Error("Mismatched change set lengths");{let t=Math.min(o.len2,s.len),n=i.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;O(i,t,n,e),r&&n&&I(r,i,s.text)}else -1==s.ins?(O(i,o.off?0:o.len,t,e),r&&I(r,i,o.textBit(t))):(O(i,o.off?0:o.len,s.off?0:s.ins,e),r&&!s.off&&I(r,i,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||i.length>n),o.forward2(t),s.forward(t)}}else O(i,0,s.ins,e),r&&I(r,i,s.text),s.next()}}class Z{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?d.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?d.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 F{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}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 bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 0xffffff==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new F(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return V.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return V.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!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 V.range(e.anchor,e.head)}static create(e,t,n){return new F(e,t,n)}}class V{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:V.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 V([this.main],0)}addRange(e,t=!0){return V.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,V.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 V(e.ranges.map(e=>F.fromJSON(e)),e.main)}static single(e,t=e){return new V([V.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,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return V.normalized(e.slice(),t);n=r.to}return new V(e,t)}static cursor(e,t=0,n,i){return F.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:0xffffff)<<6)}static range(e,t,n,i){let r=(null!=n?n:0xffffff)<<6|(null==i?7:Math.min(6,i));return t<e?F.create(t,e,48|r):F.create(e,t,8*(t>e)|r)}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 i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let o=r.from,s=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?V.range(s,o):V.range(o,s))}}return new V(e,t)}}function N(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let j=0;class H{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=j++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new H(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:z),!!e.static,e.enables)}of(e){return new $([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new $(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new $(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function z(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class ${constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=j++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,s=2==this.type,l=!1,a=!1,u=[];for(let n of this.dependencies)"doc"==n?l=!0:"selection"==n?a=!0:((null!==(t=e[n.id])&&void 0!==t?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(l&&t.docChanged||a&&(t.docChanged||t.selection)||_(e,u)){let t=n(e);if(s?!W(t,e.values[o],i):!i(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let l,a=t.config.address[r];if(null!=a){let r=en(t,a);if(this.dependencies.every(n=>n instanceof H?t.facet(n)===e.facet(n):!(n instanceof G)||t.field(n,!1)==e.field(n,!1))||(s?W(l=n(e),r,i):i(l=n(e),r)))return e.values[o]=r,0}else l=n(e);return e.values[o]=l,1}}}}function W(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function _(e,t){let n=!1;for(let i of t)1&et(e,i)&&(n=!0);return n}let q=H.define({static:!0});class G{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new G(j++,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(q).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 i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>{let i=e.facet(q),r=n.facet(q),o;return(o=i.find(e=>e.field==this))&&o!=r.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,q.of({field:this,create:e})]}get extension(){return this}}let U={lowest:4,low:3,default:2,high:1,highest:0};function K(e){return t=>new J(t,e)}let Y={highest:K(U.highest),high:K(U.high),default:K(U.default),low:K(U.low),lowest:K(U.lowest)};class J{constructor(e,t){this.inner=e,this.prec=t}}class X{of(e){return new Q(this,e)}reconfigure(e){return X.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Q{constructor(e,t){this.compartment=e,this.inner=t}}class ee{constructor(e,t,n,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,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 i,r,o;let s,l,a=[],u=Object.create(null),c=new Map;for(let n of(i=e,r=t,o=c,s=[[],[],[],[],[]],l=new Map,!function e(t,n){let i=l.get(t);if(null!=i){if(i<=n)return;let e=s[i].indexOf(t);e>-1&&s[i].splice(e,1),t instanceof Q&&o.delete(t.compartment)}if(l.set(t,n),Array.isArray(t))for(let i of t)e(i,n);else if(t instanceof Q){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let i=r.get(t.compartment)||t.inner;o.set(t.compartment,i),e(i,n)}else if(t instanceof J)e(t.inner,t.prec);else if(t instanceof G)s[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof $)s[n].push(t),t.facet.extensions&&e(t.facet.extensions,U.default);else{let i=t.extension;if(!i)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(i,n)}}(i,U.default),s.reduce((e,t)=>e.concat(t))))n instanceof G?a.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let h=Object.create(null),d=[],f=[];for(let e of a)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],i=t[0].facet,r=p&&p[e]||[];if(t.every(e=>0==e.type)){if(h[i.id]=d.length<<1|1,z(r,t))d.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));d.push(n&&i.compare(e,n.facet(i))?n.facet(i):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[i.id]=f.length<<1,f.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),o=i.filter(e=>!(1&e)),s=e[t.id]>>1;function l(e){let n=[];for(let t=0;t<i.length;t++){let o=en(e,i[t]);if(2==r[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of i)et(e,t);return e.values[s]=l(e),1},update(e,n){if(!_(e,o))return 0;let i=l(e);return t.compare(i,e.values[s])?0:(e.values[s]=i,1)},reconfigure(e,r){let o=_(e,i),a=r.config.facets[t.id],u=r.facet(t);if(a&&!o&&z(n,a))return e.values[s]=u,0;let c=l(e);return t.compare(c,u)?(e.values[s]=u,0):(e.values[s]=c,1)}}})(e,i,t))}}return new ee(e,c,f.map(e=>e(h)),h,d,u)}}function et(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function en(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let ei=H.define(),er=H.define({combine:e=>e.some(e=>e),static:!0}),eo=H.define({combine:e=>e.length?e[0]:void 0,static:!0}),es=H.define(),el=H.define(),ea=H.define(),eu=H.define({combine:e=>!!e.length&&e[0]});class ec{constructor(e,t){this.type=e,this.value=t}static define(){return new eh}}class eh{of(e){return new ec(this,e)}}class ed{constructor(e){this.map=e}of(e){return new ef(this,e)}}class ef{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 ef(this.type,t)}is(e){return this.type==e}static define(e={}){return new ed(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}ef.reconfigure=ef.define(),ef.appendConfig=ef.define();class ep{constructor(e,t,n,i,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&N(n,t.newLength),r.some(e=>e.type==ep.time)||(this.annotations=r.concat(ep.time.of(Date.now())))}static create(e,t,n,i,r,o){return new ep(e,t,n,i,r,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(ep.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function em(e,t,n){var i;let r,o,s;return n?(r=t.changes,o=A.empty(t.changes.length),s=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(r)),{changes:s,selection:t.selection?t.selection.map(o):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:ef.mapEffects(e.effects,r).concat(ef.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function eg(e,t,n){let i=t.selection,r=eb(t.annotations);return t.userEvent&&(r=r.concat(ep.userEvent.of(t.userEvent))),{changes:t.changes instanceof A?t.changes:A.of(t.changes||[],n,e.facet(eo)),selection:i&&(i instanceof V?i:V.single(i.anchor,i.head)),effects:eb(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}ep.time=ec.define(),ep.userEvent=ec.define(),ep.addToHistory=ec.define(),ep.remote=ec.define();let ev=[];function eb(e){return null==e?ev:Array.isArray(e)?e:[e]}var ey=((D=ey||(ey={}))[D.Word=0]="Word",D[D.Space=1]="Space",D[D.Other=2]="Other",D);let ew=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class ex{constructor(e,t,n,i,r,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)et(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 et(this,n),en(this,n)}update(...e){return function e(t,n,i){let r=eg(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(i=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(i=!1);let o=!!n[e].sequential;r=em(r,eg(t,n[e],o?r.changes.newLength:t.doc.length),o)}let o=ep.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(ea),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=em(i,eg(t,o,e.changes.newLength),!0))}return i==e?e:ep.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(t){let n=t.startState,i=!0;for(let e of n.facet(es)){let n=e(t);if(!1===n){i=!1;break}Array.isArray(n)&&(i=!0===i?n:function(e,t){let n=[];for(let i=0,r=0;;){let o,s;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],s=e[i++];else{if(!(r<t.length))return n;o=t[r++],s=t[r++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}(i,n))}if(!0!==i){let e,r;if(!1===i)r=t.changes.invertedDesc,e=A.empty(n.doc.length);else{let n=t.changes.filter(i);e=n.changes,r=n.filtered.mapDesc(n.changes).invertedDesc}t=ep.create(n,e,t.selection&&t.selection.map(r),ef.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let r=n.facet(el);for(let i=r.length-1;i>=0;i--){let o=r[i](t);t=o instanceof ep?o:Array.isArray(o)&&1==o.length&&o[0]instanceof ep?o[0]:e(n,eb(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(X.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(ef.reconfigure)?(n=null,i=t.value):t.is(ef.appendConfig)&&(n=null,i=eb(i).concat(t.value));t=n?e.startState.values.slice():new ex(n=ee.resolve(i,r,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(er)?e.newSelection:e.newSelection.asSingle();new ex(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:V.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],o=eb(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),l=this.changes(s.changes),a=l.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(a);let u=i.mapDesc(l,!0);r.push(s.range.map(u)),i=i.compose(a),o=ef.mapEffects(o,a).concat(ef.mapEffects(eb(s.effects),u))}return{changes:i,selection:V.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof A?e:A.of(e,this.doc.length,this.facet(ex.lineSeparator))}toText(e){return d.of(e.split(this.facet(ex.lineSeparator)||M))}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:(et(this,t),en(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof G&&null!=this.config.address[i.id]&&(t[n]=i.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 i=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],o=e[t];i.push(r.init(e=>r.spec.fromJSON(o,e)))}}return ex.create({doc:e.doc,selection:V.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=ee.resolve(e.extensions||[],new Map),n=e.doc instanceof d?e.doc:d.of((e.doc||"").split(t.staticFacet(ex.lineSeparator)||M)),i=e.selection?e.selection instanceof V?e.selection:V.single(e.selection.anchor,e.selection.head):V.single(0);return N(i,n.length),t.staticFacet(er)||(i=i.asSingle()),new ex(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(ex.tabSize)}get lineBreak(){return this.facet(ex.lineSeparator)||"\n"}get readOnly(){return this.facet(eu)}phrase(e,...t){for(let t of this.facet(ex.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 i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(ei))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){var t;return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return ey.Space;if(function(e){if(i)return i.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ew.test(n)))return!0}return!1}(e))return ey.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ey.Word;return ey.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=x(t,o,!1);if(r(t.slice(e,o))!=ey.Word)break;o=e}for(;s<i;){let e=x(t,s);if(r(t.slice(s,e))!=ey.Word)break;s=e}return o==s?null:V.range(o+n,s+n)}}function eS(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=i[e];if(void 0===o)i[e]=r;else if(o===r||void 0===r);else if(Object.hasOwnProperty.call(n,e))i[e]=n[e](o,r);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}ex.allowMultipleSelections=er,ex.tabSize=H.define({combine:e=>e.length?e[0]:4}),ex.lineSeparator=eo,ex.readOnly=eu,ex.phrases=H.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),ex.languageData=ei,ex.changeFilter=es,ex.transactionFilter=el,ex.transactionExtender=ea,X.reconfigure=ef.define();class ek{eq(e){return this==e}range(e,t=e){return eC.create(e,t,this)}}ek.prototype.startSide=ek.prototype.endSide=0,ek.prototype.point=!1,ek.prototype.mapMode=P.TrackDel;class eC{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new eC(e,t,n)}}function eM(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class eT{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let o=i,s=r.length;;){if(o==s)return o;let i=o+s>>1,l=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==o)return l>=0?o:s;l>=0?s=i:o=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],o=-1,s=-1;for(let l=0;l<this.value.length;l++){let a=this.value[l],u=this.from[l]+e,c=this.to[l]+e,h,d;if(u==c){let e=t.mapPos(u,a.startSide,a.mapMode);if(null==e||(h=d=e,a.startSide!=a.endSide&&(d=t.mapPos(u,a.endSide))<h))continue}else if((h=t.mapPos(u,a.startSide))>(d=t.mapPos(c,a.endSide))||h==d&&a.startSide>0&&a.endSide<=0)continue;0>(d-h||a.endSide-a.startSide)||(o<0&&(o=h),a.point&&(s=Math.max(s,d-h)),n.push(a),i.push(h-o),r.push(d-o))}return{mapped:n.length?new eT(i,r,n,s):null,pos:o}}}class eD{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new eD(e,t,n,i)}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:i=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(eM)),this.isEmpty)return t.length?eD.of(t):this;let s=new eA(this,null,-1).goto(0),l=0,a=[],u=new eP;for(;s.value||l<t.length;)if(l<t.length&&(s.from-t[l].from||s.startSide-t[l].value.startSide)>=0){let e=t[l++];u.addInner(e.from,e.to,e.value)||a.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(s.chunkIndex)<t[l].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||r<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||r<s.from||o(s.from,s.to,s.value))&&!u.addInner(s.from,s.to,s.value)&&a.push(eC.create(s.from,s.to,s.value)),s.next());return u.finishInner(this.nextLayer.isEmpty&&!a.length?eD.empty:this.nextLayer.update({add:a,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],s=this.chunk[r],l=e.touchesRange(o,o+s.length);if(!1===l)i=Math.max(i,s.maxPoint),t.push(s),n.push(e.mapPos(o));else if(!0===l){let{mapped:r,pos:l}=s.map(o,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(l))}}let r=this.nextLayer.map(e);return 0==t.length?r:new eD(n,t,r||eD.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return eO.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return eO.from(e).goto(t)}static compare(e,t,n,i,r=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),l=eR(o,s,n),a=new eE(o,l,r),u=new eE(s,l,r);n.iterGaps((e,t,n)=>eL(a,e,u,t,n,i)),n.empty&&0==n.length&&eL(a,0,u,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=0x3b9ac9ff);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=o.length)return!1;if(!r.length)return!0;let s=eR(r,o),l=new eE(r,s,0).goto(n),a=new eE(o,s,0).goto(n);for(;;){if(l.to!=a.to||!eB(l.active,a.active)||l.point&&(!a.point||!l.point.eq(a.point)))return!1;if(l.to>i)return!0;l.next(),a.next()}}static spans(e,t,n,i,r=-1){let o=new eE(e,null,r).goto(t),s=t,l=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,l);i.point(s,e,o.point,n,r,o.pointRank),l=Math.min(o.openEnd(e),n.length)}else e>s&&(i.span(s,e,o.active,l),l=o.openEnd(e));if(o.to>n)return l+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new eP;for(let i of e instanceof eC?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(eM(t,i)>0)return e.slice().sort(eM);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return eD.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=eD.empty;i=i.nextLayer)t=new eD(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}eD.empty=new eD([],[],null,-1),eD.empty.nextLayer=eD.empty;class eP{finishChunk(e){this.chunks.push(new eT(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 eP)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<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(eD.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=eD.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function eR(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=i.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))||r.add(e.chunk[t])}return r}class eA{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}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 i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}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}{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 eO{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new eA(o,t,n,r));return 1==i.length?i[0]:new eO(i)}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--)eI(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--)eI(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(),eI(this.heap,0)}}}function eI(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}class eE{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=eO.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){eZ(this.active,e),eZ(this.activeTo,e),eZ(this.activeRank,e),this.minActive=eV(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;eF(this.active,t,n),eF(this.activeTo,t,i),eF(this.activeRank,t,r),e&&eF(e,t,this.cursor.from),this.minActive=eV(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&0>(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&eZ(n,i)}else if(this.cursor.value){if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{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 eL(e,t,n,i,r,o){e.goto(t),n.goto(i);let s=i+r,l=i,a=i-t;for(;;){let t=e.to+a-n.to,i=t||e.endSide-n.endSide,r=i<0?e.to+a:n.to,u=Math.min(r,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&eB(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(l,u,e.point,n.point):u>l&&!eB(e.active,n.active)&&o.compareRange(l,u,e.active,n.active),r>s)break;(t||e.openEnd!=n.openEnd)&&o.boundChange&&o.boundChange(r),l=r,i<=0&&e.next(),i>=0&&n.next()}}function eB(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function eZ(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function eF(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function eV(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)0>(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function eN(e,t,n=e.length){let i=0;for(let r=0;r<n&&r<e.length;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=x(e,r));return i}function ej(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=x(e,i)}return!0===i?-1:e.length}},69485:function(e,t,n){"use strict";let i;n.d(t,{l9:()=>ec,Zs:()=>ip,SJ:()=>iH,Uw:()=>nU,lg:()=>e5,tk:()=>nM,v5:()=>iq,$f:()=>nE,$1:()=>nZ,AE:()=>ii,qr:()=>n3,Sd:()=>iZ,W$:()=>ih,gB:()=>iE,bF:()=>iI,Eu:()=>i9,HQ:()=>rt,ZO:()=>il,OO:()=>eQ,p:()=>ed,mH:()=>ij,hJ:()=>iD,S2:()=>iv,Nm:()=>eC});for(var r,o,s,l=n(69444),a=n(76007),u={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:"'"},c={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},h="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),d="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),f=0;f<10;f++)u[48+f]=u[96+f]=String(f);for(var f=1;f<=24;f++)u[f+111]="F"+f;for(var f=65;f<=90;f++)u[f]=String.fromCharCode(f+32),c[f]=String.fromCharCode(f);for(var p in u)c.hasOwnProperty(p)||(c[p]=u[p]);function m(e){let t;return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function g(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function v(e,t){if(!t.anchorNode)return!1;try{return g(e,t.anchorNode)}catch(e){return!1}}function b(e){return 3==e.nodeType?R(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function y(e,t,n,i){return!!n&&(S(e,t,n,i,-1)||S(e,t,n,i,1))}function w(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function x(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function S(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:k(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=w(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?k(e):0}}}function k(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function C(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function M(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(i>.995&&i<1.005||!isFinite(i)||1>Math.abs(t.height-e.offsetHeight))&&(i=1),{scaleX:n,scaleY:i}}class T{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?k(t):0),n,Math.min(e.focusOffset,n?k(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let D=null;function P(e){if(e.setActive)return e.setActive();if(D)return e.focus(D);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==D?{get preventScroll(){return D={preventScroll:!0},!0}}:void 0),!D){D=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],r=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}}}function R(e,t,n=t){let r=i||(i=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function A(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function O(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function I(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function E(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i>0)return{node:n,offset:i};if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;i=k(n=n.childNodes[i-1])}else{if(!n.parentNode||x(n))return null;i=w(n),n=n.parentNode}}}function L(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||x(n))return null;i=w(n)+1,n=n.parentNode}}}class B{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new B(e.parentNode,w(e),t)}static after(e,t){return new B(e.parentNode,w(e)+1,t)}}let Z=[];class F{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n=this.dom,i=null,r;for(let o of this.children){if(7&o.flags){if(!o.dom&&(r=i?i.nextSibling:n.firstChild)){let e=F.get(r);(!e||!e.parent&&e.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=i?i.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&r!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;r&&r!=o.dom;)r=V(r);else n.insertBefore(o.dom,r);i=o.dom}for((r=i?i.nextSibling:n.firstChild)&&t&&t.node==n&&(t.written=!0);r;)r=V(r)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let i=0==k(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}n=i<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!F.get(n);)n=n.nextSibling;if(!n)return this.length;for(let e=0,t=0;;e++){let i=this.children[e];if(i.dom==n)return t;t+=i.length+i.breakAfter}}domBoundsAround(e,t,n=0){let i=-1,r=-1,o=-1,s=-1;for(let l=0,a=n,u=n;l<this.children.length;l++){let n=this.children[l],c=a+n.length;if(a<e&&c>t)return n.domBoundsAround(e,t,a);if(c>=e&&-1==i&&(i=l,r=a),a>t&&n.dom.parentNode==this.dom){o=l,s=u;break}u=c,a=c+n.breakAfter}return{from:r,to:s<0?n+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Z){this.markDirty();for(let i=e;i<t;i++){let e=this.children[i];e.parent==this&&0>n.indexOf(e)&&e.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let e=0;e<n.length;e++)n[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new N(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,i,r,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function V(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}F.prototype.breakAfter=0;class N{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function j(e,t,n,i,r,o,s,l,a){let{children:u}=e,c=u.length?u[t]:null,h=o.length?o[o.length-1]:null,d=h?h.breakAfter:s;if(!(t==i&&c&&!s&&!d&&o.length<2&&c.merge(n,r,o.length?h:null,0==n,l,a))){if(i<u.length){let e=u[i];e&&(r<e.length||e.breakAfter&&(null==h?void 0:h.breakAfter))?(t==i&&(e=e.split(r),r=0),!d&&h&&e.merge(0,r,h,!0,0,a)?o[o.length-1]=e:((r||e.children.length&&!e.children[0].length)&&e.merge(0,r,null,!1,0,a),o.push(e))):(null==e?void 0:e.breakAfter)&&(h?h.breakAfter=1:s=1),i++}for(c&&(c.breakAfter=s,n>0&&(!s&&o.length&&c.merge(n,c.length,o[0],!1,l,0)?c.breakAfter=o.shift().breakAfter:(n<c.length||c.children.length&&0==c.children[c.children.length-1].length)&&c.merge(n,c.length,null,!1,l,0),t++));t<i&&o.length;)if(u[i-1].become(o[o.length-1]))i--,o.pop(),a=o.length?0:l;else if(u[t].become(o[0]))t++,o.shift(),l=o.length?0:a;else break;!o.length&&t&&i<u.length&&!u[t-1].breakAfter&&u[i].merge(0,0,u[t-1],!1,l,a)&&t--,(t<i||o.length)&&e.replaceChildren(t,i,o)}}function H(e,t,n,i,r,o){let s=e.childCursor(),{i:l,off:a}=s.findPos(n,1),{i:u,off:c}=s.findPos(t,-1),h=t-n;for(let e of i)h+=e.length;e.length+=h,j(e,u,c,l,a,i,0,r,o)}let z="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},$="undefined"!=typeof document?document:{documentElement:{style:{}}},W=/Edge\/(\d+)/.exec(z.userAgent),_=/MSIE \d/.test(z.userAgent),q=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(z.userAgent),G=!!(_||q||W),U=!G&&/gecko\/(\d+)/i.test(z.userAgent),K=!G&&/Chrome\/(\d+)/.exec(z.userAgent),Y="webkitFontSmoothing"in $.documentElement.style,J=!G&&/Apple Computer/.test(z.vendor),X=J&&(/Mobile\/\w+/.test(z.userAgent)||z.maxTouchPoints>2);var Q={mac:X||/Mac/.test(z.platform),windows:/Win/.test(z.platform),linux:/Linux|X11/.test(z.platform),ie:G,ie_version:_?$.documentMode||6:q?+q[1]:W?+W[1]:0,gecko:U,gecko_version:U?+(/Firefox\/(\d+)/.exec(z.userAgent)||[0,0])[1]:0,chrome:!!K,chrome_version:K?+K[1]:0,ios:X,android:/Android\b/.test(z.userAgent),webkit:Y,safari:J,webkit_version:Y?+(/\bAppleWebKit\/(\d+)/.exec(z.userAgent)||[0,0])[1]:0,tabSize:null!=$.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class ee extends F{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags)&&(!n||n instanceof ee&&!(this.length-(t-e)+n.length>256)&&!(8&n.flags))&&(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ee(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new B(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let i=e.nodeValue.length;t>i&&(t=i);let r=t,o=t,s=0;0==t&&n<0||t==i&&n>=0?!(Q.chrome||Q.gecko)&&(t?(r--,s=1):o<i&&(o++,s=-1)):n<0?r--:o<i&&o++;let l=R(e,r,o).getClientRects();if(!l.length)return null;let a=l[(s?s<0:n>=0)?0:l.length-1];return Q.safari&&!s&&0==a.width&&(a=Array.prototype.find.call(l,e=>e.width)||a),s?C(a,s<0):a||null}(this.dom,e,t)}}class et extends F{constructor(e,t=[],n=0){for(let i of(super(),this.mark=e,this.children=t,this.length=n,t))i.setParent(this)}setAttrs(e){if(O(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,i,r,o){return(!n||!!(n instanceof et&&n.mark.eq(this.mark))&&(!e||!(r<=0))&&(!(t<this.length)||!(o<=0)))&&(H(this,e,t,n?n.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],n=0,i=-1,r=0;for(let o of this.children){let s=n+o.length;s>e&&t.push(n<e?o.split(e-n):o),i<0&&n>=e&&(i=r),n=s,r++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new et(this.mark,t,o)}domAtPos(e){return er(this,e)}coordsAt(e,t){return eo(this,e,t)}}class en extends F{static create(e,t,n){return new en(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=en.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,i,r,o){return(!n||n instanceof en&&!!this.widget.compare(n.widget)&&(!(e>0)||!(r<=0))&&(!(t<this.length)||!(o<=0)))&&(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof en&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(0==this.length)return l.xv.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,i=this.posAtStart;return n?n.slice(i,i+this.length):l.xv.empty}domAtPos(e){return(this.length?0==e:this.side>0)?B.before(this.dom):B.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let i=this.dom.getClientRects(),r=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let t=o?i.length-1:0;r=i[t],e>0?0!=t:t!=i.length-1&&!(r.top<r.bottom);t+=o?-1:1);return C(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class ei extends F{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof ei&&e.side==this.side}split(){return new ei(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?B.before(this.dom):B.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return l.xv.empty}get isHidden(){return!0}}function er(e,t){let n=e.dom,{children:i}=e,r=0;for(let e=0;r<i.length;r++){let o=i[r],s=e+o.length;if(!(s==e&&0>=o.getSide())){if(t>e&&t<s&&o.dom.parentNode==n)return o.domAtPos(t-e);if(t<=e)break;e=s}}for(let e=r;e>0;e--){let t=i[e-1];if(t.dom.parentNode==n)return t.domAtPos(t.length)}for(let e=r;e<i.length;e++){let t=i[e];if(t.dom.parentNode==n)return t.domAtPos(0)}return new B(n,0)}function eo(e,t,n){let i=null,r=-1,o=null,s=-1;!function e(t,l){for(let a=0,u=0;a<t.children.length&&u<=l;a++){let c=t.children[a],h=u+c.length;h>=l&&(c.children.length?e(c,l-u):(!o||o.isHidden&&n>0)&&(h>l||u==h&&c.getSide()>0)?(o=c,s=l-u):(u<l||u==h&&0>c.getSide()&&!c.isHidden)&&(i=c,r=l-u)),u=h}}(e,t);let l=(n<0?i:o)||i||o;return l?l.coordsAt(Math.max(0,l==i?r:s),n):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=b(t);return n[n.length-1]||null}(e)}function es(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}ee.prototype.children=en.prototype.children=ei.prototype.children=Z;let el=Object.create(null);function ea(e,t,n){if(e==t)return!0;e||(e=el),t||(t=el);let i=Object.keys(e),r=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function eu(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}class ec{eq(e){return!1}updateDOM(e,t){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 eh=((r=eh||(eh={}))[r.Text=0]="Text",r[r.WidgetBefore=1]="WidgetBefore",r[r.WidgetAfter=2]="WidgetAfter",r[r.WidgetRange=3]="WidgetRange",r);class ed extends l.uU{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new ef(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 em(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:o}=eg(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new em(e,n,i,t,e.widget||null,!0)}static line(e){return new ep(e)}static set(e,t=!1){return l.Xs.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}ed.none=l.Xs.empty;class ef extends ed{constructor(e){let{start:t,end:n}=eg(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof ef&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&ea(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}ef.prototype.point=!1;class ep extends ed{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ep&&this.spec.class==e.spec.class&&ea(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)}}ep.prototype.mapMode=l.gc.TrackBefore,ep.prototype.point=!0;class em extends ed{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?l.gc.TrackBefore:l.gc.TrackAfter:l.gc.TrackDel}get type(){return this.startSide!=this.endSide?eh.WidgetRange:this.startSide<=0?eh.WidgetBefore:eh.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof em&&(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 eg(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function ev(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}em.prototype.point=!0;class eb extends F{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,i,r,o){if(n){if(!(n instanceof eb))return!1;this.dom||n.transferDOM(this)}return i&&this.setDeco(n?n.attrs:null),H(this,e,t,n?n.children.slice():[],r,o),!0}split(e){let t=new eb;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:i}=this.childPos(e);i&&(t.append(this.children[n].split(i),0),this.children[n].merge(i,this.children[n].length,null,!1,0,0),n++);for(let e=n;e<this.children.length;e++)t.append(this.children[e],0);for(;n>0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){ea(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){!function e(t,n,i){let r,{children:o}=t;i>0&&n instanceof et&&o.length&&(r=o[o.length-1])instanceof et&&r.mark.eq(n.mark)?e(r,n.children[0],i-1):(o.push(n),n.setParent(t)),t.length+=n.length}(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=es(t,this.attrs||{})),n&&(this.attrs=es({class:n},this.attrs||{}))}domAtPos(e){return er(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(O(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(eu(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&F.get(i)instanceof et;)i=i.lastChild;if(!i||!this.length||"BR"!=i.nodeName&&(null===(n=F.get(i))||void 0===n?void 0:n.isEditable)==!1&&(!Q.ios||!this.children.some(e=>e instanceof ee))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof ee)||/[^ -~]/.test(n.text))return null;let i=b(n.dom);if(1!=i.length)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=eo(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(2>Math.abs(t-e.lineHeight)&&e.textHeight<t){let i=(t-e.textHeight)/2;return{top:n.top+i,bottom:n.bottom-i,left:n.left,right:n.left}}}return n}become(e){return e instanceof eb&&0==this.children.length&&0==e.children.length&&ea(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,i=0;n<e.children.length;n++){let r=e.children[n],o=i+r.length;if(o>=t){if(r instanceof eb)return r;if(o>t)break}i=o+r.breakAfter}return null}}class ey extends F{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,i,r,o){return(!n||n instanceof ey&&!!this.widget.compare(n.widget)&&(!(e>0)||!(r<=0))&&(!(t<this.length)||!(o<=0)))&&(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return 0==e?B.before(this.dom):B.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new ey(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Z}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):l.xv.empty}domBoundsAround(){return null}become(e){return e instanceof ey&&e.widget.constructor==this.widget.constructor&&(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof ew?null:C(this.dom.getBoundingClientRect(),this.length?0==e:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t!=n&&(e<0?t<0:n>0)}}class ew extends ec{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}}class ex{constructor(e,t,n,i){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ey&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new eb),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(eS(new ei(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof ey||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skip);if(this.skip=0,i)throw Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(eS(new ee(this.text.slice(this.textOff,this.textOff+i)),t),n),this.atCursorPos=!0,this.textOff+=i,e-=i,n=0}}span(e,t,n,i){this.buildText(t-e,n,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,n,i,r,o){if(this.disallowBlockEffectsFor[o]&&n instanceof em){if(n.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=t-e;if(n instanceof em){if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ey(n.widget||ek.block,s,n));else{let o=en.create(n.widget||ek.inline,s,s?0:n.startSide),l=this.atCursorPos&&!o.isEditable&&r<=i.length&&(e<t||n.startSide>0),a=!o.isEditable&&(e<t||r>i.length||n.startSide<=0),u=this.getLine();2!=this.pendingBuffer||l||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),l&&(u.append(eS(new ei(1),i),r),r=i.length+Math.max(0,r-i.length)),u.append(eS(o,i),r),this.atCursorPos=a,this.pendingBuffer=a?e<t||r>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,i,r){let o=new ex(e,t,n,r);return o.openEnd=l.Xs.spans(i,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function eS(e,t){for(let n of t)e=new et(n,[e],e.length);return e}class ek extends ec{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}}ek.inline=new ek("span"),ek.block=new ek("div");var eC=((o=eC||(eC={}))[o.LTR=0]="LTR",o[o.RTL=1]="RTL",o);let eM=eC.LTR,eT=eC.RTL;function eD(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}let eP=eD("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),eR=eD("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),eA=Object.create(null),eO=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);eA[t]=n,eA[n]=-t}function eI(e){return e<=247?eP[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?eR[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let eE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class eL{get dir(){return this.level%2?eT:eM}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,i){let r=-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;(r<0||(0!=i?i<0?s.from<t:s.to>t:e[r].level>s.level))&&(r=o)}}if(r<0)throw RangeError("Index out of range");return r}}let eB=[];function eZ(e){return[new eL(0,e,0)]}let eF="",eV=l.r$.define(),eN=l.r$.define(),ej=l.r$.define(),eH=l.r$.define(),ez=l.r$.define(),e$=l.r$.define(),eW=l.r$.define(),e_=l.r$.define(),eq=l.r$.define(),eG=l.r$.define({combine:e=>e.some(e=>e)}),eU=l.r$.define({combine:e=>e.some(e=>e)}),eK=l.r$.define();class eY{constructor(e,t="nearest",n="nearest",i=5,r=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new eY(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 eY(l.jT.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let eJ=l.Py.define({map:(e,t)=>e.map(t)}),eX=l.Py.define();function eQ(e,t,n){let i=e.facet(eH);i.length?i[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}let e0=l.r$.define({combine:e=>!e.length||e[0]}),e1=0,e2=l.r$.define();class e5{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.extension=r(this)}static define(e,t){let{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new e5(e1++,e,n,i,e=>{let t=[e2.of(e)];return o&&t.push(e9.of(t=>{let n=t.plugin(e);return n?o(n):ed.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return e5.define(t=>new e(t),t)}}class e3{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}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(eQ(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.create(e)}catch(t){eQ(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){eQ(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let e4=l.r$.define(),e8=l.r$.define(),e9=l.r$.define(),e6=l.r$.define(),e7=l.r$.define(),te=l.r$.define();function tt(e,t){let n=e.state.facet(te);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return l.Xs.spans(i,t.from,t.to,{point(){},span(e,n,i,o){let s=e-t.from,l=n-t.from,a=r;for(let e=i.length-1;e>=0;e--,o--){let n=i[e].spec.bidiIsolate,r;if(null==n&&(n=function(e,t,n){for(let i=t;i<n;i++){let t=eI(e.charCodeAt(i));if(1==t)break;if(2==t||4==t)return eT}return eM}(t.text,s,l)),o>0&&a.length&&(r=a[a.length-1]).to==s&&r.direction==n)r.to=l,a=r.inner;else{let e={from:s,to:l,direction:n,inner:[]};a.push(e),a=e.inner}}}}),r}let tn=l.r$.define();function ti(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet(tn)){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&&(i=Math.max(i,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:t,right:n,top:i,bottom:r}}let tr=l.r$.define();class to{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}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 i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),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 i=0,r=0,o=0,s=0;;i++){let l=i==e.length?null:e[i],a=o-s,u=l?l.fromB:1e9;for(;r<t.length&&t[r]<u;){let e=t[r],i=t[r+1],o=Math.max(s,e),l=Math.min(u,i);if(o<=l&&new to(o+a,l+a,o,l).addToSet(n),i>u)break;r+=2}if(!l)return n;new to(l.fromA,l.toA,l.fromB,l.toB).addToSet(n),o=l.toA,s=l.toB}}}class ts{constructor(e,t,n){for(let i of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=l.as.empty(this.startState.doc.length),n))this.changes=this.changes.compose(i.changes);let i=[];this.changes.iterChangedRanges((e,t,n,r)=>i.push(new to(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new ts(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}}class tl extends F{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=ed.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.setDOM(e.contentDOM),this.children=[new eb],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new to(0,0,0,e.state.doc.length)],0,null)}update(e){var t,n,i,r,o,s;let a,u;let c=e.changedRanges;this.minWidth>0&&c.length&&(c.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 h=-1;!(this.view.inputState.composing>=0)||this.view.observer.editContext||((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?h=this.domChanged.newSel.head:(n=e.changes,i=this.hasComposition,a=!1,i&&n.iterChangedRanges((e,t)=>{e<i.to&&t>i.from&&(a=!0)}),a||e.selectionSet||(h=e.state.selection.main.head)));let d=h>-1?function(e,t,n){let i=ta(e,n);if(!i)return null;let{node:r,from:o,to:s}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||e.state.doc.sliceString(i.from,i.to)!=l)return null;let a=t.invertedDesc,u=new to(a.mapPos(o),a.mapPos(s),o,s),c=[];for(let t=r.parentNode;;t=t.parentNode){let n=F.get(t);if(n instanceof et)c.push({node:t,deco:n.mark});else{if(n instanceof eb||"DIV"==t.nodeName&&t.parentNode==e.contentDOM)return{range:u,text:r,marks:c,line:t};if(t==e.contentDOM)return null;c.push({node:t,deco:new ef({inclusive:!0,attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}(t),tagName:t.tagName.toLowerCase()})})}}}(this.view,e.changes,h):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:n}=this.hasComposition;c=new to(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(c.slice())}this.hasComposition=d?{from:d.range.fromB,to:d.range.toB}:null,(Q.ie||Q.chrome)&&!d&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let f=(r=this.decorations,o=this.updateDeco(),s=e.changes,u=new tu,l.Xs.compare(r,o,s,u),u.changes);return c=to.extendWithRanges(c,f),(!!(7&this.flags)||0!=c.length)&&(this.updateInner(c,e.startState.doc.length,d),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=Q.chrome||Q.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||i.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(e=>e.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof ey&&e.widget instanceof ew&&r.push(e.dom);i.updateGaps(r)}updateChildren(e,t,n){let i=n?n.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let e=i.length-1;;e--){let t=e>=0?i[e]:null;if(!t)break;let{fromA:o,toA:s,fromB:l,toB:a}=t,u,c,h,d;if(n&&n.range.fromB<a&&n.range.toB>l){let e=ex.build(this.view.state.doc,l,n.range.fromB,this.decorations,this.dynamicDecorationMap),t=ex.build(this.view.state.doc,n.range.toB,a,this.decorations,this.dynamicDecorationMap);c=e.breakAtStart,h=e.openStart,d=t.openEnd;let i=this.compositionView(n);t.breakAtStart?i.breakAfter=1:t.content.length&&i.merge(i.length,i.length,t.content[0],!1,t.openStart,0)&&(i.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&i.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),u=e.content.concat(i).concat(t.content)}else({content:u,breakAtStart:c,openStart:h,openEnd:d}=ex.build(this.view.state.doc,l,a,this.decorations,this.dynamicDecorationMap));let{i:f,off:p}=r.findPos(s,1),{i:m,off:g}=r.findPos(o,-1);j(this,m,g,f,p,u,c,h,d)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(eX)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new ee(e.text.nodeValue);for(let{deco:n}of(t.flags|=8,e.marks))t=new et(n,[t],t.length);let n=new eb;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|+!!t.children.some(e=>7&e.flags),this.markedForComposition.add(t);let n=F.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),i=this.children[n.i];t(e.line,i);for(let r=e.marks.length-1;r>=-1;r--)n=i.childPos(n.off,1),i=i.children[n.i],t(r>=0?e.marks[r].node:e.text,i)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,r=i==this.dom,o=!r&&!(this.view.state.facet(e0)||this.dom.tabIndex>-1)&&v(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(r||t||o))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),u=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(Q.gecko&&l.empty&&!this.hasComposition&&1==(n=a).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(()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null)),a=u=new B(e,0),s=!0}let c=this.view.observer.selectionRange;!s&&c.focusNode&&(y(a.node,a.offset,c.anchorNode,c.anchorOffset)&&y(u.node,u.offset,c.focusNode,c.focusOffset)||this.suppressWidgetCursorChange(c,l))||(this.view.observer.ignore(()=>{Q.android&&Q.chrome&&this.dom.contains(c.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}(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=m(this.view.root);if(e){if(l.empty){if(Q.gecko){var t,n;let e=(t=a.node,n=a.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?E:L)(a.node,a.offset);t&&(a=new B(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=l.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=l.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(u.node,u.offset)}catch(e){}}else{let t=document.createRange();l.anchor>l.head&&([a,u]=[u,a]),t.setEnd(u.node,u.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,u)),this.impreciseAnchor=a.precise?null:new B(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new B(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&y(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=m(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=eb.find(this,t.head);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let l=this.coordsAt(t.head,-1),a=this.coordsAt(t.head,1);if(!l||!a||l.bottom>a.top)return;let u=this.domAtPos(t.head+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(i,r)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let i=e.offset;!n&&i<t.childNodes.length;i++){let e=F.get(t.childNodes[i]);e instanceof eb&&(n=e.domAtPos(0))}for(let i=e.offset-1;!n&&i>=0;i--){let e=F.get(t.childNodes[i]);e instanceof eb&&(n=e.domAtPos(e.length))}return n?new B(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let e=F.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let e=this.children[t];if(n<e.length||e instanceof eb)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,i=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let s=this.children[o],l=r-s.breakAfter,a=l-s.length;if(l<e)break;if(a<=e&&(a<e||s.covers(-1))&&(l>e||s.covers(1))&&(!n||s instanceof eb&&!(n instanceof eb&&t>=0)))n=s,i=a;else if(n&&a==e&&l==e&&s instanceof ey&&2>Math.abs(t)){if(s.deco.startSide<0)break;o&&(n=null)}r=a}return n?n.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),i=this.children[t];if(!(i instanceof eb))return null;for(;i.children.length;){let{i:e,off:t}=i.childPos(n,1);for(;;e++){if(e==i.children.length)return null;if((i=i.children[e]).length)break}n=t}if(!(i instanceof ee))return null;let r=(0,l.cp)(i.text,n);if(r==n)return null;let o=R(i.dom,n,r).getClientRects();for(let e=0;e<o.length;e++){let t=o[e];if(e==o.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==eC.LTR;for(let e=0,a=0;a<this.children.length;a++){let u=this.children[a],c=e+u.length;if(c>i)break;if(e>=n){let n=u.dom.getBoundingClientRect();if(t.push(n.height),o){let t=u.dom.lastChild,i=t?b(t):[];if(i.length){let t=i[i.length-1],o=l?t.right-n.left:n.right-t.left;o>s&&(s=o,this.minWidth=r,this.minWidthFrom=e,this.minWidthTo=c)}}}e=c+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?eC.RTL:eC.LTR}measureTextSize(){for(let e of this.children)if(e instanceof eb){let t=e.measureTextSize();if(t)return t}let e=document.createElement("div"),t,n,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=b(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,i=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new N(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.length;if(o>n){let i=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(ed.replace({widget:new ew(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return ed.set(e)}updateDeco(){let e=1,t=this.view.state.facet(e9).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(e6).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(l.Xs.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){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(eK))try{if(t(this.view,e.range,e))return!0}catch(e){eQ(this.view.state,e,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!n)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,i.left),top:Math.min(n.top,i.top),right:Math.max(n.right,i.right),bottom:Math.max(n.bottom,i.bottom)});let r=ti(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;!function(e,t,n,i,r,o,s,l){let a=e.ownerDocument,u=a.defaultView||window;for(let c=e,h=!1;c&&!h;)if(1==c.nodeType){let e,d=c==a.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}=M(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let m=0,g=0;if("nearest"==r)t.top<e.top?(g=t.top-(e.top+s),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+s)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+s,n<0&&t.top-g<e.top&&(g=t.top-(e.top+s)));else{let i=t.bottom-t.top,o=e.bottom-e.top;g=("center"==r&&i<=o?t.top+i/2-o/2:"start"==r||"center"==r&&n<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==i?t.left<e.left?(m=t.left-(e.left+o),n>0&&t.right>e.right+m&&(m=t.right-e.right+o)):t.right>e.right&&(m=t.right-e.right+o,n<0&&t.left<e.left+m&&(m=t.left-(e.left+o))):m=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==l?t.left-o:t.right-(e.right-e.left)+o)-e.left,m||g){if(d)u.scrollBy(m,g);else{let e=0,n=0;if(g){let e=c.scrollTop;c.scrollTop+=g/p,n=(c.scrollTop-e)*p}if(m){let t=c.scrollLeft;c.scrollLeft+=m/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-m)&&(i="nearest"),n&&1>Math.abs(n-g)&&(r="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,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==eC.LTR)}}function ta(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=E(n.focusNode,n.focusOffset),r=L(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=F.get(r.node);if(!t||t instanceof ee&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=F.get(i.node);!e||e instanceof ee&&e.text!=i.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=i,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let tu=class{constructor(){this.changes=[]}compareRange(e,t){ev(e,t,this.changes)}comparePoint(e,t){ev(e,t,this.changes)}boundChange(e){ev(e,e,this.changes)}};function tc(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function th(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function td(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function tf(e,t,n){let i=e.nodeValue.length,r=-1,o=1e9,s=0;for(let l=0;l<i;l++){let i=R(e,l,l+1).getClientRects();for(let a=0;a<i.length;a++){let u=i[a];if(u.top==u.bottom)continue;s||(s=t-u.left);let c=(u.top>n?u.top-n:n-u.bottom)-1;if(u.left-1<=t&&u.right+1>=t&&c<o){let n=t>=(u.left+u.right)/2,i=n;if((Q.chrome||Q.gecko)&&R(e,l).getBoundingClientRect().left==u.right&&(i=!n),c<=0)return{node:e,offset:l+ +!!i};r=l+ +!!i,o=c}}}return{node:e,offset:r>-1?r:s>0?e.nodeValue.length:0}}function tp(e,t,n,i=-1){var r,o;let s=e.contentDOM.getBoundingClientRect(),l=s.top+e.viewState.paddingTop,a,{docHeight:u}=e.viewState,{x:c,y:h}=t,d=h-l;if(d<0)return 0;if(d>u)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,r=!1;(a=e.elementAtHeight(d)).type!=eh.Text;)for(;!((d=i>0?a.bottom+t:a.top-t)>=0)||!(d<=u);){if(r)return n?null:0;r=!0,i=-i}h=l+d;let f=a.from;if(f<e.viewport.from)return 0==e.viewport.from?0:n?null:tm(e,s,a,c,h);if(f>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:tm(e,s,a,c,h);let p=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:p,g=m.elementFromPoint(c,h);g&&!e.contentDOM.contains(g)&&(g=null),!g&&(c=Math.max(s.left+1,Math.min(s.right-1,c)),(g=m.elementFromPoint(c,h))&&!e.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&(null===(r=e.docView.nearest(g))||void 0===r?void 0:r.isEditable)!=!1){if(p.caretPositionFromPoint){let e=p.caretPositionFromPoint(c,h);e&&({offsetNode:v,offset:y}=e)}else if(p.caretRangeFromPoint){let t=p.caretRangeFromPoint(c,h);t&&({startContainer:v,startOffset:y}=t,(!e.contentDOM.contains(v)||Q.safari&&function(e,t,n){let i;if(3!=e.nodeType||t!=(i=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return R(e,i-1,i).getBoundingClientRect().left>n}(v,y,c)||Q.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return n-(1==e.nodeType?e.getBoundingClientRect():R(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(v,y,c))&&(v=void 0))}v&&(y=Math.min(k(v),y))}if(!v||!e.docView.dom.contains(v)){let t=eb.find(e.docView,f);if(!t)return d>a.top+a.height/2?a.to:a.from;({node:v,offset:y}=function e(t,n,i){let r,o,s,l,a,u,c,h,d=!1;for(let m=t.firstChild;m;m=m.nextSibling){let t=b(m);for(let g=0;g<t.length;g++){var f,p;let v=t[g];u&&tc(u,v)&&(v=th(td(v,u.bottom),u.top));let b=(f=v).left>n?f.left-n:Math.max(0,n-f.right),y=(p=v).top>i?p.top-i:Math.max(0,i-p.bottom);if(0==b&&0==y)return 3==m.nodeType?tf(m,n,i):e(m,n,i);if(!a||h>y||h==y&&c>b){a=m,u=v,c=b,h=y;let e=y?i<v.top?-1:1:b?n<v.left?-1:1:0;d=!e||(e>0?g<t.length-1:g>0)}0==b?i>v.bottom&&(!s||s.bottom<v.bottom)?(r=m,s=v):i<v.top&&(!l||l.top>v.top)&&(o=m,l=v):s&&tc(s,v)?s=td(s,v.bottom):l&&tc(l,v)&&(l=th(l,v.top))}}if(s&&s.bottom>=i?(a=r,u=s):l&&l.top<=i&&(a=o,u=l),!a)return{node:t,offset:0};let m=Math.max(u.left,Math.min(u.right,n));if(3==a.nodeType)return tf(a,m,i);if(d&&"false"!=a.contentEditable)return e(a,m,i);let g=Array.prototype.indexOf.call(t.childNodes,a)+ +(n>=(u.left+u.right)/2);return{node:t,offset:g}}(t.dom,c,h))}let w=e.docView.nearest(v);if(!w)return null;if(!w.isWidget||(null===(o=w.dom)||void 0===o?void 0:o.nodeType)!=1)return w.localPosFromDOM(v,y)+w.posAtStart;{let e=w.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?w.posAtStart:w.posAtEnd}}function tm(e,t,n,i,r){let o=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+(0,l.Gz)(s,o,e.state.tabSize)}function tg(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){for(let e of n.type)if(e.to>t||e.to==t&&(e.to==n.to||e.type==eh.Text))return e}return n}function tv(e,t,n,i){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),s=e.textDirectionAt(r.from);for(let a=t,u=null;;){let t=function(e,t,n,i,r){var o;let s=i.head-e.from,a=eL.find(t,s,null!==(o=i.bidiLevel)&&void 0!==o?o:-1,i.assoc),u=t[a],c=u.side(r,n);if(s==c){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;s=(u=t[a=e]).side(!r,n),c=u.side(r,n)}let h=(0,l.cp)(e.text,s,u.forward(r,n));(h<u.from||h>u.to)&&(h=c),eF=e.text.slice(Math.min(s,h),Math.max(s,h));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return d&&h==c&&d.level+ +!r<u.level?l.jT.cursor(d.side(!r,n)+e.from,d.forward(r,n)?1:-1,d.level):l.jT.cursor(h+e.from,u.forward(r,n)?-1:1,u.level)}(r,o,s,a,n),c=eF;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),o=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(u){if(!u(c))return a}else{if(!i)return t;u=i(c)}a=t}}function tb(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,o)=>{if(t>e&&t<r){let o=i||n||(t-e<r-t?-1:1);t=o<0?e:r,i=o}});if(!i)return t}}function ty(e,t,n){let i=tb(e.state.facet(e7).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:l.jT.cursor(i,i<n.from?1:-1)}class tw{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(l.yy.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=""}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=i.nextSibling;if(r==t)break;let o=F.get(i),s=F.get(r);(o&&s?o.breakAfter:(o?o.breakAfter:x(i))||x(r)&&("BR"!=i.nodeName||i.cmIgnore)&&this.text.length>e)&&this.lineBreak(),i=r}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,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,s;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=i.exec(t))&&(r=s.index,o=s[0].length),this.append(t.slice(n,r<0?t.length:r)),r<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=r+o}}readNode(e){if(e.cmIgnore)return;let t=F.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<k(t))return!1;if(t==e)return!0;n=w(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class tx{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class tS{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new tx(n,i)),(r!=n||o!=i)&&t.push(new tx(r,o))),t}(e),n=new tw(t,e.state);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,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?l.jT.single(n+t,i+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!g(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!g(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Q.ios||Q.chrome)&&e.state.selection.main.empty&&n!=i&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,i),r=Math.max(n,i),o=s.from-t,l=s.to-r;(0==o||1==o||0==t)&&(0==l||-1==l||r==e.state.doc.length)&&(n=0,i=e.state.doc.length)}this.newSel=l.jT.single(i,n)}}}function tk(e,t){let n;let{newSel:i}=t,r=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:i,to:s}=t.bounds,a=r.from,u=null;(8===o||Q.android&&t.text.length<s-i)&&(a=r.to,u="end");let c=function(e,t,n,i){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let s=e.length,l=t.length;for(;s>0&&l>0&&e.charCodeAt(s-1)==t.charCodeAt(l-1);)s--,l--;if("end"==i){let e=Math.max(0,o-Math.min(s,l));n-=s+e-o}if(s<o&&e.length<t.length){let e=n<=o&&n>=s?o-n:0;o-=e,l=o+(l-s),s=o}else if(l<o){let e=n<=o&&n>=l?o-n:0;o-=e,s=o+(s-l),l=o}return{from:o,toA:s,toB:l}}(e.state.doc.sliceString(i,s,""),t.text,a-i,u);c&&(Q.chrome&&13==o&&c.toB==c.from+2&&""==t.text.slice(c.from,c.toB)&&c.toB--,n={from:i+c.from,to:i+c.toA,insert:l.xv.of(t.text.slice(c.from,c.toB).split(""))})}else i&&(!e.hasFocus&&e.state.facet(e0)||i.main.eq(r))&&(i=null);if(!n&&!i)return!1;if(!n&&t.typeOver&&!r.empty&&i&&i.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:(Q.mac||Q.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=l.jT.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:l.xv.of([n.insert.toString().replace("."," ")])}):n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:Q.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=l.jT.single(i.main.anchor-1,i.main.head-1)),n={from:r.from,to:r.to,insert:l.xv.of([" "])}),n)return tC(e,n,i,o);if(!i||i.main.eq(r))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}}function tC(e,t,n,i=-1){let r;if(Q.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(Q.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&&A(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>o.head)&&A(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&A(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>r||(r=function(e,t,n){let i,r=e.state,o=r.selection.main;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?r.sliceDoc(o.from,t.from):"",s=o.to>t.to?r.sliceDoc(t.to,o.to):"";i=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=r.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=o.to&&t.to>=o.to-10){let u=e.state.sliceDoc(t.from,t.to),c,h=n&&ta(e,n.main.head);if(h){let e=t.insert.length-(t.to-t.from);c={from:h.from,to:h.to-e}}else c=e.state.doc.lineAt(o.head);let d=o.to-t.to,f=o.to-o.from;i=r.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let i=n.to-d,h=i-u.length;if(n.to-n.from!=f||e.state.sliceDoc(h,i)!=u||n.to>=c.from&&n.from<=c.to)return{range:n};let p=r.changes({from:h,to:i,insert:t.insert}),m=n.to-o.to;return{changes:p,range:a?l.jT.range(Math.max(0,a.anchor+m),Math.max(0,a.head+m)):n.map(p)}})}else i={changes:s,selection:a&&r.selection.replaceRange(a)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(e$).some(n=>n(e,t.from,t.to,s,a))||e.dispatch(a()),!0}class tM{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){var t;this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=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.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Q.safari&&e.contentDOM.addEventListener("input",()=>null),Q.gecko&&(t=e.contentDOM.ownerDocument,tY.has(t)||(tY.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{})))}handleEvent(e){!(!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=F.get(n))&&i.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;if(e&&e.domEventHandlers)for(let i in e.domEventHandlers){let r=e.domEventHandlers[i];r&&n(i).handlers.push(tT(t.value,r))}if(e&&e.domEventObservers)for(let i in e.domEventObservers){let r=e.domEventObservers[i];r&&n(i).observers.push(tT(t.value,r))}}for(let e in tI)n(e).handlers.push(tI[e]);for(let e in tE)n(e).observers.push(tE[e]);return t}(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=r&&(i.removeEventListener(e,this.handleEvent),o=null),o||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){let t;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))||((this.tabFocusMode>0&&27!=e.keyCode&&0>tR.indexOf(e.keyCode)&&(this.tabFocusMode=-1),Q.android&&Q.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))?(this.view.observer.delayAndroidKey(e.key,e.keyCode),!0):Q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=tD.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||tP.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(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,A(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(Q.safari&&!Q.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 tT(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){eQ(n.state,e)}}}let tD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],tP="dthko",tR=[16,17,18,20,91,92,224,225];function tA(e){return .7*Math.max(0,e)+8}class tO{constructor(e,t,n,i){var r,o;let s;this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t=e.ownerDocument,n,i;for(let r=e.parentNode;r&&r!=t.body&&(!n||!i);)if(1==r.nodeType)!i&&r.scrollHeight>r.clientHeight&&(i=r),!n&&r.scrollWidth>r.clientWidth&&(n=r),r=r.assignedSlot||r.parentNode;else if(11==r.nodeType)r=r.host;else break;return{x:n,y:i}}(e.contentDOM),this.atoms=e.state.facet(e7).map(t=>t(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(l.yy.allowMultipleSelections)&&(r=e,o=t,(s=r.state.facet(eV)).length?s[0](o):Q.mac?o.metaKey:o.ctrlKey),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=m(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[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==tW(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>Math.max(Math.abs((t=this.startEvent).clientX-e.clientX),Math.abs(t.clientY-e.clientY)))return;this.select(this.lastEvent=e);let n=0,i=0,r=0,o=0,s=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=ti(this.view);e.clientX-a.left<=r+6?n=-tA(r-e.clientX):e.clientX+a.right>=s-6&&(n=tA(e.clientX-s)),e.clientY-a.top<=o+6?i=-tA(o-e.clientY):e.clientY+a.bottom>=l-6&&(i=tA(e.clientY-l)),this.setScrollSpeed(n,i)}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)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let i=e.ranges[n],r=null;if(i.empty){let e=tb(this.atoms,i.from,0);e!=i.from&&(r=l.jT.cursor(e,-1))}else{let e=tb(this.atoms,i.from,-1),t=tb(this.atoms,i.to,1);(e!=i.from||t!=i.to)&&(r=l.jT.range(i.from==i.anchor?e:t,i.from==i.head?e:t))}r&&(t||(t=e.ranges.slice()),t[n]=r)}return t?l.jT.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(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 tI=Object.create(null),tE=Object.create(null),tL=Q.ie&&Q.ie_version<15||Q.ios&&Q.webkit_version<604;function tB(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function tZ(e,t){t=tB(e.state,e_,t);let{state:n}=e,i,r=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(null!=tq&&n.selection.ranges.every(e=>e.empty)&&tq==o.toString()){let e=-1;i=n.changeByRange(i=>{let a=n.doc.lineAt(i.from);if(a.from==e)return{range:i};e=a.from;let u=n.toText((s?o.line(r++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:u},range:l.jT.cursor(i.from+u.length)}})}else i=s?n.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:l.jT.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function tF(e,t,n,i){if(1==i)return l.jT.cursor(t,n);if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return l.jT.cursor(t);0==o?n=1:o==r.length&&(n=-1);let s=o,a=o;n<0?s=(0,l.cp)(r.text,o,!1):a=(0,l.cp)(r.text,o);let u=i(r.text.slice(s,a));for(;s>0;){let e=(0,l.cp)(r.text,s,!1);if(i(r.text.slice(e,s))!=u)break;s=e}for(;a<r.length;){let e=(0,l.cp)(r.text,a);if(i(r.text.slice(a,e))!=u)break;a=e}return l.jT.range(s+r.from,a+r.from)}(e.state,t,n);{let n=eb.find(e.docView,t),i=e.state.doc.lineAt(n?n.posAtEnd:t),r=n?n.posAtStart:i.from,o=n?n.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,l.jT.range(r,o)}}tE.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},tI.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),tE.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},tE.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},tI.mousedown=(e,t)=>{var n,i;let r,o,s;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let a=null;for(let n of e.state.facet(ej))if(a=n(e,t))break;if(a||0!=t.button||(r=tN(n=e,i=t),o=tW(i),s=n.state.selection,a={update(e){e.docChanged&&(r.pos=e.changes.mapPos(r.pos),s=s.map(e.changes))},get(e,t,i){let a=tN(n,e),u,c=tF(n,a.pos,a.bias,o);if(r.pos!=a.pos&&!t){let e=tF(n,r.pos,r.bias,o),t=Math.min(e.from,c.from),i=Math.max(e.to,c.to);c=t<c.from?l.jT.range(t,i):l.jT.range(i,t)}return t?s.replaceRange(s.main.extend(c.from,c.to)):i&&1==o&&s.ranges.length>1&&(u=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:r}=e.ranges[n];if(i<=t&&r>=t)return l.jT.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))?u:i?s.addRange(c):l.jT.create([c])}}),a){let n=!e.hasFocus;e.inputState.startMouseSelection(new tO(e,t,a,n)),n&&e.observer.ignore(()=>{P(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),!1===i.dragging}return!1};let tV=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function tN(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:function(e,t,n,i){let r=eb.find(e.docView,t);if(!r)return 1;let o=t-r.posAtStart;if(0==o)return 1;if(o==r.length)return -1;let s=r.coordsAt(o,-1);if(s&&tV(n,i,s))return -1;let l=r.coordsAt(o,1);return l&&tV(n,i,l)?1:s&&s.bottom>=i?-1:1}(e,n,t.clientX,t.clientY)}}let tj=Q.ie&&Q.ie_version<=11,tH=null,tz=0,t$=0;function tW(e){if(!tj)return e.detail;let t=tH,n=t$;return tH=e,t$=Date.now(),tz=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(tz+1)%3:1}function t_(e,t,n,i){let r;if(!(n=tB(e.state,e_,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,l=i&&s&&((r=e.state.facet(eN)).length?r[0](t):Q.mac?!t.altKey:!t.ctrlKey)?{from:s.from,to:s.to}:null,a={from:o,insert:n},u=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}tI.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.nearest(t.target);if(i&&i.isWidget){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=l.jT.range(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",tB(e.state,eq,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},tI.dragend=e=>(e.inputState.draggedContent=null,!1),tI.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&t_(e,t,i.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)||(i[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return t_(e,t,n,!0),!0}return!1},tI.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=tL?null:t.clipboardData;return n?(tZ(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(),tZ(e,n.value)},50)}(e),!1)};let tq=null;tI.copy=tI.cut=(e,t)=>{let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let o=e.doc.lineAt(i);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:tB(e,eq,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;tq=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=tL?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 i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};let tG=l.q6.define();function tU(e,t){let n=[];for(let i of e.facet(eW)){let r=i(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:tG.of(!0)}):null}function tK(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=tU(e.state,t);n?e.dispatch(n):e.update([])}},10)}tE.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),tK(e)},tE.blur=e=>{e.observer.clearSelectionRange(),tK(e)},tE.compositionstart=tE.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},tE.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,Q.chrome&&Q.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},tE.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},tI.beforeinput=(e,t)=>{var n,i;let r;if("insertReplacementText"==t.inputType&&e.observer.editContext){let i=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),r=t.getTargetRanges();if(i&&r.length){let t=r[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return tC(e,{from:n,to:o,insert:e.state.toText(i)},null),!0}}if(Q.chrome&&Q.android&&(r=tD.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Q.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),Q.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>tE.compositionend(e,t),20),!1};let tY=new Set,tJ=["pre-wrap","normal","pre-line","break-spaces"],tX=!1;class tQ{constructor(e){this.lineWrapping=e,this.doc=l.xv.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)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return tJ.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,o){let s=tJ.indexOf(e)>-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,l){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 l}}class t0{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class t1{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?eh.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 em?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 t1(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var t2=((s=t2||(t2={}))[s.ByPos=0]="ByPos",s[s.ByHeight=1]="ByHeight",s[s.ByPosNoHeight=2]="ByPosNoHeight",s);class t5{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&&(tX=!0),this.height=e)}replace(e,t,n){return t5.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:a,fromB:u,toB:c}=i[s],h=r.lineAt(l,t2.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=a?h:r.lineAt(a,t2.ByPosNoHeight,n,0,0);for(c+=d.to-a,a=d.to;s>0&&h.from<=i[s-1].toA;)l=i[s-1].fromA,u=i[s-1].fromB,s--,l<h.from&&(h=r.lineAt(l,t2.ByPosNoHeight,n,0,0));u+=h.from-l,l=h.from;let f=ne.build(n.setDoc(o),e,u,c);r=t3(r,r.replace(l,a,f))}return r.updateHeight(n,0)}static empty(){return new t8(0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n){if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else if(r>2*i){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,r-=t.size}else break}else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new t6(t5.of(e.slice(0,t)),o,t5.of(e.slice(n)))}}function t3(e,t){return e==t?e:(e.constructor!=t.constructor&&(tX=!0),t)}t5.prototype.size=1;class t4 extends t5{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,i){return new t1(i,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,i,r){return this.blockAt(0,n,i,r)}forEachLine(e,t,n,i,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,n,i,r))}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class t8 extends t4{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,i){return new t1(i,this.length,n,this.height,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof t8||i instanceof t9&&4&i.flags)&&10>Math.abs(this.length-i.length)?(i instanceof t9?i=new t8(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):t5.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(n||this.outdated)&&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 t9 extends t5{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,o,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*r);o=t/r,this.length>r+1&&(s=(this.height-t)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:i,perLine:o,perChar:s}}blockAt(e,t,n,i){let{firstLine:r,lastLine:o,perLine:s,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(r),a=s+o.length*l,u=Math.max(n,e-a/2);return new t1(o.from,o.length,u,a,0)}{let i=Math.max(0,Math.min(o-r,Math.floor((e-n)/s))),{from:l,length:a}=t.doc.line(r+i);return new t1(l,a,n+s*i,s,0)}}lineAt(e,t,n,i,r){if(t==t2.ByHeight)return this.blockAt(e,n,i,r);if(t==t2.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new t1(t,i-t,0,0,0)}let{firstLine:o,perLine:s,perChar:l}=this.heightMetrics(n,r),a=n.doc.lineAt(e),u=s+a.length*l,c=a.number-o,h=i+s*c+l*(a.from-r-c);return new t1(a.from,a.length,Math.max(i,Math.min(h,i+this.height-u)),u,0)}forEachLine(e,t,n,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:s,perLine:l,perChar:a}=this.heightMetrics(n,r);for(let u=e,c=i;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-s;c+=l*n+a*(e-r-n)}let i=l+a*t.length;o(new t1(t.from,t.length,c,i,0)),c+=i,u=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof t9?n[n.length-1]=new t9(e.length+i):n.push(null,new t9(i-1))}if(e>0){let t=n[0];t instanceof t9?n[0]=new t9(e+t.length):n.unshift(new t9(e-1),null)}return t5.of(n)}decomposeLeft(e,t){t.push(new t9(e-1),null)}decomposeRight(e,t){t.push(null,new t9(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],o=Math.max(t,i.from),s=-1;for(i.from>t&&n.push(new t9(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++];-1==s?s=r:Math.abs(r-s)>=.001&&(s=-2);let l=new t8(t,r);l.outdated=!1,n.push(l),o+=t+1}o<=r&&n.push(null,new t9(r-o).updateHeight(e,o));let l=t5.of(n);return(s<0||Math.abs(l.height-this.height)>=.001||Math.abs(s-this.heightMetrics(e,t).perLine)>=.001)&&(tX=!0),t3(this,l)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class t6 extends t5{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,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let o=i+this.left.height,s=r+this.left.length+this.break,l=t==t2.ByHeight?e<o:e<s,a=l?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,o,s);if(this.break||(l?a.to<s:a.from>s))return a;let u=t==t2.ByPosNoHeight?t2.ByPosNoHeight:t2.ByPos;return l?a.join(this.right.lineAt(s,u,n,o,s)):this.left.lineAt(s,u,n,i,r).join(a)}forEachLine(e,t,n,i,r,o){let s=i+this.left.height,l=r+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,n,i,r,o),t>=l&&this.right.forEachLine(e,t,n,s,l,o);else{let a=this.lineAt(l,t2.ByPos,n,i,r);e<a.from&&this.left.forEachLine(e,a.from-1,n,i,r,o),a.to>=e&&a.from<=t&&o(a),t>a.to&&this.right.forEachLine(a.to+1,t,n,s,l,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)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-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of n)r.push(e);if(e>0&&t7(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),t7(r,e)}return t5.of(r)}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,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?t5.of(this.break?[e,null,t]:[e,t]):(this.left=t3(this.left,e),this.right=t3(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,i){let{left:r,right:o}=this,s=t+r.length+this.break,l=null;return(i&&i.from<=t+r.length&&i.more?l=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=s+o.length&&i.more?l=o=o.updateHeight(e,s,n,i):o.updateHeight(e,s,n),l)?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function t7(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof t9&&(i=e[t+1])instanceof t9&&e.splice(t-1,3,new t9(n.length+1+i.length))}class ne{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 t8?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new t8(e-this.pos,-1)),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 i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new t4(o,i,n)):(o||r||i>=5)&&this.addLineDeco(i,r,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 t8(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new t9(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 t8)return e;let t=new t8(0,-1);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 i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.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 t8||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new t8(0,-1));let n=e;for(let e of this.nodes)e instanceof t8&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new ne(n,e);return l.Xs.spans(t,n,i,r,0),r.finish(n)}}class nt{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&ev(e,t,this.changes,5)}}class nn{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return ed.replace({widget:new ni(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class ni extends ec{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 nr{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=na,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=eC.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(e8).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new tQ(t),this.stateDeco=e.facet(e9).filter(e=>"function"!=typeof e),this.heightMap=t5.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle.setDoc(e.doc),[new to(0,0,0,e.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=ed.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new no(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?na:new nu(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(nc(e,this.scaler))})}update(e,t=null){var n,i;let r;this.state=e.state;let o=this.stateDeco;this.stateDeco=this.state.facet(e9).filter(e=>"function"!=typeof e);let s=e.changedRanges,a=to.extendWithRanges(s,(n=this.stateDeco,i=e?e.changes:l.as.empty(this.state.doc.length),r=new nt,l.Xs.compare(o,n,i,r,0),r.changes)),u=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);tX=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=u||tX)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let h=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<h.from||t.range.head>h.to)||!this.viewportIsAppropriate(h))&&(h=this.getViewport(0,t));let d=h.from!=this.viewport.from||h.to!=this.viewport.to;this.viewport=h,e.flags|=this.updateForViewport(),(d||!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.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(eU)&&(this.mustEnforceCursorAssoc=!0)}measure(e){var t;let n,i,r=e.contentDOM,o=window.getComputedStyle(r),s=this.heightOracle,a=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?eC.RTL:eC.LTR;let u=this.heightOracle.mustRefreshForWrapping(a),c=r.getBoundingClientRect(),h=u||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let d=0,f=0;if(c.width&&c.height){let{scaleX:e,scaleY:t}=M(r,c);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,d|=16,u=h=!0)}let p=(parseInt(o.paddingTop)||0)*this.scaleY,m=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=m)&&(this.paddingTop=p,this.paddingBottom=m,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(h=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=I(e.scrollDOM);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(),i=e.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),s=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();o=Math.max(o,i.left),s=Math.min(s,i.right),l=Math.max(l,i.top),a=Math.min(t==e.parentNode?r.innerHeight:a,i.bottom)}t="absolute"==i.position||"fixed"==i.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:l-(n.top+t),bottom:Math.max(l,a)-(n.top+t)}})(r,this.paddingTop),b=v.top-this.pixelViewport.top,y=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(h=!0)),!this.inView&&!this.scrollTarget&&(n=(t=e.dom).getBoundingClientRect(),i=t.ownerDocument.defaultView||window,!(n.left<i.innerWidth)||!(n.right>0)||!(n.top<i.innerHeight)||!(n.bottom>0)))return 0;let x=c.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),h){let t=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(t)&&(u=!0),u||s.lineWrapping&&Math.abs(x-this.contentDOMWidth)>s.charWidth){let{lineHeight:n,charWidth:i,textHeight:r}=e.docView.measureTextSize();(u=n>0&&s.refresh(a,n,i,r,x/i,t))&&(e.docView.minWidth=0,d|=16)}for(let n of(b>0&&y>0?f=Math.max(b,y):b<0&&y<0&&(f=Math.min(b,y)),tX=!1,this.viewports)){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(u?t5.empty().applyChanges(this.stateDeco,l.xv.empty,this.heightOracle,[new to(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,u,new t0(n.from,i))}tX&&(d|=2)}let S=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(2&d&&(d|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),d|=this.updateForViewport()),(2&d||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(u?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}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)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,l=new no(i.lineAt(o-1e3*n,t2.ByHeight,r,0,0).from,i.lineAt(s+(1-n)*1e3,t2.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<l.from||e>l.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=i.lineAt(e,t2.ByPos,r,0,0),s;s="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<l.from?o.top:o.bottom-n,l=new no(i.lineAt(s-500,t2.ByHeight,r,0,0).from,i.lineAt(s+n+500,t2.ByHeight,r,0,0).to)}}return l}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new no(this.heightMap.lineAt(n,t2.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,t2.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,t2.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,t2.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=s+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new nn(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=eC.LTR&&!n)return[];let s=[],a=(i,o,u,c)=>{if(o-i<r)return;let h=this.state.selection.main,d=[h.from];for(let e of(h.empty||d.push(h.to),d))if(e>i&&e<o){a(i,e-10,u,c),a(e+10,o,u,c);return}let f=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=u.from&&e.to<=u.to&&Math.abs(e.from-i)<r&&Math.abs(e.to-o)<r&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(o<u.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(l.jT.cursor(o),!1,!0).head;e>i&&(o=e)}let e=this.gapSize(u,i,o,c),r=n||e<2e6?e:2e6;f=new nn(i,o,e,r)}s.push(f)},u=t=>{var r,s,u;let c,h,d,f,p;if(t.length<o||t.type!=eh.Text)return;let m=(r=t.from,s=t.to,u=this.stateDeco,d=[],f=r,p=0,l.Xs.spans(u,r,s,{span(){},point(e,t){e>f&&(d.push({from:f,to:e}),p+=e-f),f=t}},20),f<s&&(d.push({from:f,to:s}),p+=s-f),{total:p,ranges:d});if(m.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,r=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let i=nl(m,g),o=((this.visibleBottom-this.visibleTop)/2+r)/t.height;e=i-o,n=i+o}else e=(this.visibleTop-t.top-r)/t.height,n=(this.visibleBottom-t.top+r)/t.height;c=ns(m,e),h=ns(m,n)}else{let n,r,o=m.total*this.heightOracle.charWidth,s=i*this.heightOracle.charWidth,l=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+l<this.pixelViewport.left&&(l=n.size-n.displaySize);let a=this.pixelViewport.left+l,u=this.pixelViewport.right+l;if(null!=g){let e=nl(m,g),t=((u-a)/2+s)/o;n=e-t,r=e+t}else n=(a-s)/o,r=(u+s)/o;c=ns(m,n),h=ns(m,r)}c>t.from&&a(t.from,c,t,m),h<t.to&&a(h,t.to,t,m)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(u):u(e);return s}gapSize(e,t,n,i){let r=nl(i,n)-nl(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){nn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ed.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=[];l.Xs.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let t=0;t<n.length&&!(8&i);t++){let r=this.visibleRanges[t],o=n[t];r.from==o.from&&r.to==o.to||(i|=4,e&&e.mapPos(r.from,-1)==o.from&&e.mapPos(r.to,1)==o.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||nc(this.heightMap.lineAt(e,t2.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)||nc(this.heightMap.lineAt(this.scaler.fromDOM(e),t2.ByHeight,this.heightOracle,0,0),this.scaler)}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 nc(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 no{constructor(e,t){this.from=e,this.to=t}}function ns({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],o=r-n;if(i<=o)return n+i;i-=o}}function nl(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}let na={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class nu{constructor(e,t,n){let i=0,r=0,o=0;for(let s of(this.viewports=n.map(({from:n,to:r})=>{let o=t.lineAt(n,t2.ByPos,e,0,0).top,s=t.lineAt(r,t2.ByPos,e,0,0).bottom;return i+=s-o,{from:n,to:r,top:o,bottom:s,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i),this.viewports))s.domTop=o+(s.top-r)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),r=s.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof nu&&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 nc(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new t1(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>nc(e,t)):e._content)}let nh=l.r$.define({combine:e=>e.join(" ")}),nd=l.r$.define({combine:e=>e.indexOf(!0)>-1}),nf=a.V.newName(),np=a.V.newName(),nm=a.V.newName(),ng={"&light":"."+np,"&dark":"."+nm};function nv(e,t,n){return new a.V(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 nb=nv("."+nf,{"&":{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":{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-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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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-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"},".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"}},ng),ny={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},nw=Q.ie&&Q.ie_version<=11;class nx{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new T,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);(Q.ie&&Q.ie_version<=11||Q.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&&!1!==e.constructor.EDIT_CONTEXT&&!(Q.chrome&&Q.chrome_version<126)&&(this.editContext=new nC(e),e.state.facet(e0)&&(e.contentDOM.editContext=this.editContext.editContext)),nw&&(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?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,i=this.selectionRange;if(n.state.facet(e0)?n.root.activeElement!=this.dom:!v(this.dom,i))return;let r=i.anchorNode&&n.docView.nearest(i.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Q.ie&&Q.ie_version<=11||Q.android&&Q.chrome)&&!n.state.selection.main.empty&&i.focusNode&&y(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=m(e.root);if(!t)return!1;let n=Q.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 nk(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?nk(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=v(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,k(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:i=k(n=e)}else{if(n==e)return!0;i=w(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(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,ny),nw&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),nw&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;this.delayedAndroidKey||(this.flushingAndroidKey=this.view.win.requestAnimationFrame(()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&A(this.dom,e.key,e.keyCode))})),this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?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,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!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:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&v(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new tS(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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,i=tk(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=nS(t,e.previousSibling||e.target.previousSibling,-1),i=nS(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):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(e0)!=e.state.facet(e0)&&(e.view.contentDOM.editContext=e.state.facet(e0)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let i of(this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect(),this.scrollTargets))i.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 nS(e,t,n){for(;t;){let i=F.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function nk(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);return y(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class nC{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=t=>{let n=e.state.selection.main,{anchor:i,head:r}=n,o=this.toEditorPos(t.updateRangeStart),s=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:o,drifted:!1});let a={from:o,to:s,insert:l.xv.of(t.text.split("\n"))};if(a.from==this.from&&i<this.from?a.from=i:a.to==this.to&&i>this.to&&(a.to=i),a.from==a.to&&!a.insert.length){let i=l.jT.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));i.main.eq(n)||e.dispatch({selection:i,userEvent:"select"});return}if((Q.mac||Q.android)&&a.from==r-1&&/^\. ?$/.test(t.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(a={from:o,to:s,insert:l.xv.of([t.text.replace("."," ")])}),this.pendingContextChange=a,!e.state.readOnly){let n=this.to-this.from+(a.to-a.from+a.insert.length);tC(e,a,l.jT.single(this.toEditorPos(t.selectionStart,n),this.toEditorPos(t.selectionEnd,n)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if("None"!=t&&"None"!=i){let r=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(r<o){let e=`text-decoration: underline ${"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${"Thin"==i?1:2}px`;n.push(ed.mark({attributes:{style:e}}).range(r,o))}}}e.dispatch({effects:eX.of(ed.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=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=m(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,s,l,a)=>{if(n)return;let u=a.length-(o-r);if(i&&o>=i.to){if(i.from==r&&i.to==o&&i.insert.eq(a)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}i=null,this.revertPending(e.state)}if(r+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+a.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),a.toString()),this.to+=u}t+=u}),i&&!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))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}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 nM{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.composing>0}get compositionStarted(){return 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 nr(e.state||l.yy.create(e)),e.scrollTo&&e.scrollTo.is(eJ)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(e2).map(e=>new e3(e)),this.plugins))t.update(this);this.observer=new nx(this),this.inputState=new tM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new tl(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=1==e.length&&e[0]instanceof l.YW?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,i,r=this.state;for(let t of e){if(t.startState!=r)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,s=0,a=null;e.some(e=>e.annotation(tG))?(this.inputState.notifiedFocused=o,s=1):o==this.inputState.notifiedFocused||(this.inputState.notifiedFocused=o,(a=tU(r,o))||(s=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),((c=this.observer.readChange())&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(l.yy.phrases)!=this.state.facet(l.yy.phrases))return this.setState(r);i=ts.create(this,r,e),i.flags|=s;let h=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(h&&(h=h.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;h=new eY(e.empty?e:l.jT.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(eJ)&&(h=e.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=nP.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(tr)!=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(i.startState.facet(nh)!=i.state.facet(nh)&&(this.viewState.mustMeasureContent=!0),(t||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(ez))try{e(i)}catch(e){eQ(this.state,e,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!tk(this,c)&&u.force&&A(this.contentDOM,u.key,u.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 nr(e),this.plugins=e.facet(e2).map(e=>new e3(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new tl(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(e2),n=e.state.facet(e2);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new e3(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,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){eQ(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.scrollDOM,i=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0){if(I(n))r=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,o=e.top}}this.updateState=1;let s=this.viewState.measure(this);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 l=[];4&s||([this.measureRequests,l]=[l,this.measureRequests]);let a=l.map(e=>{try{return e.read(this)}catch(e){return eQ(this.state,e),nD}}),u=ts.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<l.length;e++)if(a[e]!=nD)try{let t=l[e];t.write&&t.write(a[e],this)}catch(e){eQ(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}{let e=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(e>1||e<-1){i+=e,n.scrollTop=i/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(ez))e(t)}get themeClasses(){return nf+" "+(this.state.facet(nd)?nm:np)+" "+this.state.facet(nh)}updateAttrs(){let e=nR(this,e4,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(e0)?"true":"false",class:"cm-content",style:`${Q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),nR(this,e8,t);let n=this.observer.ignore(()=>{let n=eu(this.contentDOM,this.contentAttrs,t),i=eu(this.dom,this.editorAttrs,e);return n||i});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(nM.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(tr);let e=this.state.facet(nM.cspNonce);a.V.mount(this.root,this.styleModules.concat(nb).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.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.spec==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 ty(this,e,tv(this,e,t,n))}moveByGroup(e,t){return ty(this,e,tv(this,e,t,t=>{var n;let i,r;return n=e.head,r=(i=this.state.charCategorizer(n))(t),e=>{let t=i(e);return r==l.D0.Space&&(r=t),r==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return l.jT.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,i){let r=tg(e,t.head),o=i&&r.type==eh.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(r.from),s=e.posAtCoords({x:n==(i==eC.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=s)return l.jT.cursor(s,n?-1:1)}return l.jT.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return ty(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return l.jT.cursor(r,t.assoc);let s=t.goalColumn,a,u=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),h=e.documentTop;if(c)null==s&&(s=c.left-u.left),a=o<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==s&&(s=Math.min(u.right-u.left,e.defaultCharacterWidth*(r-t.from))),a=(o<0?t.top:t.bottom)+h}let d=u.left+s,f=null!=i?i:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=a+(f+t)*o,i=tp(e,{x:d,y:n},!1,o);if(n<u.top||n>u.bottom||(o<0?i<r:i>r)){let t=e.docView.coordsForChar(i),r=!t||n<t.top?-1:1;return l.jT.cursor(i,r,void 0,s)}}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),tp(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 i=this.state.doc.lineAt(e),r=this.bidiSpans(i);return C(n,r[eL.find(r,e-i.from,-1,t)].dir==eC.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(eG)||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>nT)return eZ(e.length);let t=this.textDirectionAt(e.from),n;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++){let r=t[i],o=n[i];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!e(r.inner,o.inner))return!1}return!0}(i.isolates,n=tt(this,e))))return i.order;n||(n=tt(this,e));let i=function(e,t,n){if(!e)return[new eL(0,0,+(t==eT))];if(t==eM&&!n.length&&!eE.test(e))return eZ(e.length);if(n.length)for(;e.length>eB.length;)eB[eB.length]=256;let i=[],r=+(t!=eM);return function e(t,n,i,r,o,s,l){let a=n%2?2:1;!function(e,t,n,i,r){for(let o=0;o<=i.length;o++){let s=o?i[o-1].to:t,l=o<i.length?i[o].from:n,a=o?256:r;for(let t=s,n=a,i=a;t<l;t++){let r=eI(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),eB[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=s,t=a,i=a;e<l;e++){let r=eB[e];if(128==r)e<l-1&&t==eB[e+1]&&24&t?r=eB[e]=t:eB[e]=256;else if(64==r){let r=e+1;for(;r<l&&64==eB[r];)r++;let o=e&&8==t||r<n&&8==eB[r]?1==i?1:8:256;for(let t=e;t<r;t++)eB[t]=o;e=r-1}else 8==r&&1==i&&(eB[e]=1);t=r,7&r&&(i=r)}}}(t,o,s,r,a),function(e,t,n,i,r){let o=1==r?2:1;for(let s=0,l=0,a=0;s<=i.length;s++){let u=s?i[s-1].to:t,c=s<i.length?i[s].from:n;for(let t=u,n,i,s;t<c;t++)if(i=eA[n=e.charCodeAt(t)]){if(i<0){for(let e=l-3;e>=0;e-=3)if(eO[e+1]==-i){let n=eO[e+2],i=2&n?r:4&n?1&n?o:r:0;i&&(eB[t]=eB[eO[e]]=i),l=e;break}}else if(189==eO.length)break;else eO[l++]=t,eO[l++]=n,eO[l++]=a}else if(2==(s=eB[t])||1==s){let e=s==r;a=+!e;for(let t=l-3;t>=0;t-=3){let n=eO[t+2];if(2&n)break;if(e)eO[t+2]|=2;else{if(4&n)break;eO[t+2]|=4}}}}}(t,o,s,r,a),function(e,t,n,i){for(let r=0,o=i;r<=n.length;r++){let s=r?n[r-1].to:e,l=r<n.length?n[r].from:t;for(let a=s;a<l;){let s=eB[a];if(256==s){let s=a+1;for(;;)if(s==l){if(r==n.length)break;s=n[r++].to,l=r<n.length?n[r].from:t}else if(256==eB[s])s++;else break;let u=1==o,c=u==((s<t?eB[s]:i)==1)?u?1:2:i;for(let t=s,i=r,o=i?n[i-1].to:e;t>a;)t==o&&(t=n[--i].from,o=i?n[i-1].to:e),eB[--t]=c;a=s}else o=s,a++}}}(o,s,r,a),function t(n,i,r,o,s,l,a){let u=o%2?2:1;if(o%2==s%2)for(let c=i,h=0;c<r;){let i=!0,d=!1;if(h==l.length||c<l[h].from){let e=eB[c];e!=u&&(i=!1,d=16==e)}let f=i||1!=u?null:[],p=i?o:o+1,m=c;r:for(;;)if(h<l.length&&m==l[h].from){if(d)break;let t=l[h];if(!i)for(let e=t.to,n=h+1;;){if(e==r)break r;if(n<l.length&&l[n].from==e)e=l[n++].to;else if(eB[e]==u)break r;else break}h++,f?f.push(t):(t.from>c&&a.push(new eL(c,t.from,p)),e(n,t.direction==eM!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,a),c=t.to),m=t.to}else if(m==r||(i?eB[m]!=u:eB[m]==u))break;else m++;f?t(n,c,m,o+1,s,f,a):c<m&&a.push(new eL(c,m,p)),c=m}else for(let c=r,h=l.length;c>i;){let r=!0,d=!1;if(!h||c>l[h-1].to){let e=eB[c-1];e!=u&&(r=!1,d=16==e)}let f=r||1!=u?null:[],p=r?o:o+1,m=c;r:for(;;)if(h&&m==l[h-1].to){if(d)break;let t=l[--h];if(!r)for(let e=t.from,n=h;;){if(e==i)break r;if(n&&l[n-1].to==e)e=l[--n].from;else if(eB[e-1]==u)break r;else break}f?f.push(t):(t.to<c&&a.push(new eL(t.to,c,p)),e(n,t.direction==eM!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,a),c=t.from),m=t.from}else if(m==i||(r?eB[m-1]!=u:eB[m-1]==u))break;else m--;f?t(n,m,c,o+1,s,f,a):m<c&&a.push(new eL(m,c,p)),c=m}}(t,o,s,n,i,r,l)}(e,r,r,n,0,e.length,i),i}(e.text,t,n);return this.bidiCache.push(new nP(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Q.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{P(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={}){return eJ.of(new eY("number"==typeof e?l.jT.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return eJ.of(new eY(l.jT.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 e5.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return e5.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=a.V.newName(),i=[nh.of(n),tr.of(nv(`.${n}`,e))];return t&&t.dark&&i.push(nd.of(!0)),i}static baseTheme(e){return l.Wl.lowest(tr.of(nv("."+nf,e,ng)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&F.get(n)||F.get(e);return(null===(t=null==i?void 0:i.rootView)||void 0===t?void 0:t.view)||null}}nM.styleModule=tr,nM.inputHandler=e$,nM.clipboardInputFilter=e_,nM.clipboardOutputFilter=eq,nM.scrollHandler=eK,nM.focusChangeEffect=eW,nM.perLineTextDirection=eG,nM.exceptionSink=eH,nM.updateListener=ez,nM.editable=e0,nM.mouseSelectionStyle=ej,nM.dragMovesSelection=eN,nM.clickAddsSelectionRange=eV,nM.decorations=e9,nM.outerDecorations=e6,nM.atomicRanges=e7,nM.bidiIsolatedRanges=te,nM.scrollMargins=tn,nM.darkTheme=nd,nM.cspNonce=l.r$.define({combine:e=>e.length?e[0]:""}),nM.contentAttributes=e8,nM.editorAttributes=e4,nM.lineWrapping=nM.contentAttributes.of({class:"cm-lineWrapping"}),nM.announce=l.Py.define();let nT=4096,nD={};class nP{constructor(e,t,n,i,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:eC.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=i||t.touchesRange(o.from,o.to)||n.push(new nP(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function nR(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],o="function"==typeof t?t(e):t;o&&es(o,n)}return n}let nA=Q.mac?"mac":Q.windows?"win":Q.linux?"linux":"key";function nO(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 nI=l.Wl.default(nM.domEventHandlers({keydown:(e,t)=>nN(nB(t.state),e,t,"editor")})),nE=l.r$.define({enables:nI}),nL=new WeakMap;function nB(e){let t=e.facet(nE),n=nL.get(t);return n||nL.set(t,n=function(e,t=nA){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[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,i,o,s,l)=>{var a,u;let c=n[e]||(n[e]=Object.create(null)),h=i.split(/ (?!$)/).map(e=>(function(e,t){let n,i,r,o;let s=e.split(/-(?!$)/),l=s[s.length-1];"Space"==l&&(l=" ");for(let e=0;e<s.length-1;++e){let l=s[e];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))"mac"==t?o=!0:i=!0;else throw Error("Unrecognized modifier name: "+l)}return n&&(l="Alt-"+l),i&&(l="Ctrl-"+l),o&&(l="Meta-"+l),r&&(l="Shift-"+l),l})(e,t));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");r(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=nF={view:t,prefix:n,scope:e};return setTimeout(()=>{nF==i&&(nF=null)},4e3),!0}]})}let d=h.join(" ");r(d,!1);let f=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null===(u=null===(a=c._any)||void 0===a?void 0:a.run)||void 0===u?void 0:u.slice())||[]});o&&f.run.push(o),s&&(f.preventDefault=!0),l&&(f.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.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:r}=i;for(let t in e)e[t].run.push(e=>r(e,nV))}let r=i[t]||i.key;if(r)for(let t of e)o(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}function nZ(e,t,n){return nN(nB(e.state),t,e,n)}let nF=null,nV=null;function nN(e,t,n,i){var r;nV=t;let o=("Esc"==(r=!(h&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||d&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?c:u)[t.keyCode]||t.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),s=(0,l.gm)(o,0),a=(0,l.nZ)(s)==o.length&&" "!=o,f="",p=!1,m=!1,g=!1;nF&&nF.view==n&&nF.scope==i&&(f=nF.prefix+" ",0>tR.indexOf(t.keyCode)&&(m=!0,nF=null));let v=new Set,b=e=>{if(e){for(let t of e.run)if(!v.has(t)&&(v.add(t),t(n)))return e.stopPropagation&&(g=!0),!0;e.preventDefault&&(e.stopPropagation&&(g=!0),m=!0)}return!1},y=e[i],w,x;return y&&(b(y[f+nO(o,t,!a)])?p=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Q.windows&&t.ctrlKey&&t.altKey)&&(w=u[t.keyCode])&&w!=o?b(y[f+nO(w,t,!0)])?p=!0:t.shiftKey&&(x=c[t.keyCode])!=o&&x!=w&&b(y[f+nO(x,t,!1)])&&(p=!0):a&&t.shiftKey&&b(y[f+nO(o,t,!0)])&&(p=!0),!p&&b(y._any)&&(p=!0)),m&&(p=!0),p&&g&&t.stopPropagation(),nV=null,p}class nj{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}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 i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),o=e.textDirection==eC.LTR,s=e.contentDOM,l=s.getBoundingClientRect(),a=nH(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=l.right-(c?parseInt(c.paddingRight):0),f=tg(e,i),p=tg(e,r),m=f.type==eh.Text?f:null,g=p.type==eh.Text?p:null;if(m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=nz(e,i,1,m)),g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=nz(e,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return b(y(n.from,n.to,m));{let t=m?y(n.from,null,m):w(f,!1),i=g?y(null,n.to,g):w(p,!0),r=[];return(m||f).to<(g||p).from-(m&&g?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<i.top?r.push(v(h,t.bottom,d,i.top)):t.bottom<i.top&&e.elementAtHeight((t.bottom+i.top)/2).type==eh.Text&&(t.bottom=i.top=(t.bottom+i.top)/2),b(t).concat(r).concat(b(i))}function v(e,n,i,r){return new nj(t,e-a.left,n-a.top,i-e,r-n)}function b({top:e,bottom:t,horizontal:n}){let i=[];for(let r=0;r<n.length;r+=2)i.push(v(n[r],e,n[r+1],t));return i}function y(t,n,i){let r=1e9,s=-1e9,l=[];function a(t,n,a,u,c){let f=e.coordsAtPos(t,t==i.to?-2:2),p=e.coordsAtPos(a,a==i.from?2:-2);f&&p&&(r=Math.min(f.top,p.top,r),s=Math.max(f.bottom,p.bottom,s),c==eC.LTR?l.push(o&&n?h:f.left,o&&u?d:p.right):l.push(!o&&u?h:p.left,!o&&n?d:f.right))}let u=null!=t?t:i.from,c=null!=n?n:i.to;for(let i of e.visibleRanges)if(i.to>u&&i.from<c)for(let r=Math.max(i.from,u),o=Math.min(i.to,c);;){let i=e.state.doc.lineAt(r);for(let s of e.bidiSpans(i)){let e=s.from+i.from,l=s.to+i.from;if(e>=o)break;l>r&&a(Math.max(e,r),null==t&&e<=u,Math.min(l,o),null==n&&l>=c,s.dir)}if((r=i.to+1)>=o)break}return 0==l.length&&a(u,null==t,c,null==n,e.textDirection),{top:r,bottom:s,horizontal:l}}function w(e,t){let n=l.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=nH(e);return[new nj(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}}}function nH(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==eC.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function nz(e,t,n,i){let r=e.coordsAtPos(t,2*n);if(!r)return i;let o=e.dom.getBoundingClientRect(),s=(r.top+r.bottom)/2,l=e.posAtCoords({x:o.left+1,y:s}),a=e.posAtCoords({x:o.right-1,y:s});return null==l||null==a?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}class n${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(nW)!=e.state.facet(nW)&&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(nW);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 i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let nW=l.r$.define();function n_(e){return[e5.define(t=>new n$(t,e)),nW.of(e)]}let nq=!(Q.ios&&Q.webkit&&Q.webkit_version<534),nG=l.r$.define({combine:e=>(0,l.BO)(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function nU(e={}){return[nG.of(e),nY,nX,n0,eU.of(!0)]}function nK(e){return e.startState.facet(nG)!=e.state.facet(nG)}let nY=n_({above:!0,markers(e){let{state:t}=e,n=t.facet(nG),i=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty?!o||nq:n.drawRangeCursor){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:l.jT.cursor(r.head,r.head>r.anchor?-1:1);for(let r of nj.forRange(e,t,n))i.push(r)}}return i},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=nK(e);return n&&nJ(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){nJ(t.state,e)},class:"cm-cursorLayer"});function nJ(e,t){t.style.animationDuration=e.facet(nG).cursorBlinkRate+"ms"}let nX=n_({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:nj.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||nK(e),class:"cm-selectionLayer"}),nQ={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};nq&&(nQ[".cm-line"].caretColor=nQ[".cm-content"].caretColor="transparent !important");let n0=l.Wl.highest(nM.theme(nQ)),n1=l.Py.define({map:(e,t)=>null==e?null:t.mapPos(e)}),n2=l.QQ.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(n1)?t.value:e,e))}),n5=e5.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(n2);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(n2)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(n2),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.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(n2)!=e&&this.view.dispatch({effects:n1.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 n3(){return[n2,n5]}function n4(e,t,n,i,r){t.lastIndex=0;for(let o=e.iterRange(n,i),s=n,l;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;l=t.exec(o.value);)r(s+l.index,l)}class n8{constructor(e){let{regexp:t,decoration:n,decorate:i,boundary:r,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,i)this.addMatch=(e,t,n,r)=>i(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,i,r)=>{let o=n(e,t,i);o&&r(i,i+e[0].length,o)};else if(n)this.addMatch=(e,t,i,r)=>r(i,i+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new l.f_,n=t.add.bind(t);for(let{from:t,to:i}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 i=[];for(let{from:r,to:o}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=o:i.push({from:r,to:o});return i}(e,this.maxLength))n4(e.state.doc,this.regexp,t,i,(t,i)=>this.addMatch(i,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return(e.docChanged&&e.changes.iterChanges((t,r,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(s,i))}),e.viewportMoved||i-n>1e3)?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let o=Math.max(r.from,n),s=Math.min(r.to,i);if(s>o){let n=e.state.doc.lineAt(o),i=n.to<s?e.state.doc.lineAt(s):n,l=Math.max(r.from,n.from),a=Math.min(r.to,i.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){l=o;break}for(;s<i.to;s++)if(this.boundary.test(i.text[s-i.from])){a=s;break}}let u=[],c,h=(e,t,n)=>u.push(n.range(e,t));if(n==i)for(this.regexp.lastIndex=l-n.from;(c=this.regexp.exec(n.text))&&c.index<a-n.from;)this.addMatch(c,e,c.index+n.from,h);else n4(e.state.doc,this.regexp,l,a,(t,n)=>this.addMatch(n,e,t,h));t=t.update({filterFrom:l,filterTo:a,filter:(e,t)=>e<l||t>a,add:u})}}return t}}let n9=null!=/x/.unicode?"gu":"g",n6=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u2028\u2029\uFEFF-]",n9),n7={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"},ie=null,it=l.r$.define({combine(e){let t=(0,l.BO)(e,{render:null,specialChars:n6,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==ie&&"undefined"!=typeof document&&document.body){let t=document.body.style;ie=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)!=null}return ie||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,n9)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,n9)),t}});function ii(e={}){return[it.of(e),ir||(ir=e5.fromClass(class{constructor(e){this.view=e,this.decorations=ed.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(it)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new n8({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,o=(0,l.gm)(t[0],0);if(9==o){let e=r.lineAt(i),t=n.state.tabSize,o=(0,l.IS)(e.text,t,i-e.from);return ed.replace({widget:new is((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=ed.replace({widget:new io(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(it);e.startState.facet(it)!=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}))]}let ir=null;class io extends ec{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),i=e.state.phrase("Control character")+" "+(n7[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let o=document.createElement("span");return o.textContent=n,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class is extends ec{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}}function il(){return iu}let ia=ed.line({class:"cm-activeLine"}),iu=e5.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 i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(ia.range(r.from)),t=r.from)}return ed.set(n)}},{decorations:e=>e.decorations});class ic extends ec{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)),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?b(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=C(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}function ih(e){return e5.fromClass(class{constructor(t){this.view=t,this.placeholder=e?ed.set([ed.widget({widget:new ic(e),side:1}).range(0)]):ed.none}get decorations(){return this.view.state.doc.length?ed.none:this.placeholder}},{decorations:e=>e.decorations})}function id(e,t){var n;let i,r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(r),s=r-o.from,a=s>2e3?-1:s==o.length?(n=t.clientX,(i=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((i.left-n)/e.defaultCharacterWidth)):-1):(0,l.IS)(o.text,e.state.tabSize,r-o.from);return{line:o.number,col:a,off:s}}function ip(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return nM.mouseSelectionStyle.of((e,n)=>{let i,r;return t(n)?(i=id(e,n),r=e.state.selection,i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),n=e.state.doc.lineAt(t);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},r=r.map(e.changes)}},get(t,n,o){let s=id(e,t);if(!s)return r;let a=function(e,t,n){let i=Math.min(t.line,n.line),r=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=i;t<=r;t++){let n=e.doc.line(t);n.length<=a&&o.push(l.jT.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=i;t<=r;t++){let n=e.doc.line(t),i=(0,l.Gz)(n.text,s,e.tabSize,!0);if(i<0)o.push(l.jT.cursor(n.to));else{let t=(0,l.Gz)(n.text,a,e.tabSize);o.push(l.jT.range(n.from+i,n.from+t))}}}return o}(e.state,i,s);return a.length?o?l.jT.create(a.concat(r.ranges)):l.jT.create(a):r}}:null):null})}let im={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},ig={style:"cursor: crosshair"};function iv(e={}){let[t,n]=im[e.key||"Alt"],i=e5.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[i,nM.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.isDown)?ig:null})]}let ib="-10000px";class iy{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===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<r.length;n++){let i=r[n],l=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(l=e)}if(l<0)o[n]=this.createTooltipView(i,n?o[n-1]:null),s&&(s[n]=!!i.above);else{let i=o[n]=this.tooltipViews[l];s&&(s[n]=t[l]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function iw(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let ix=l.r$.define({combine:e=>{var t,n,i;return{position:Q.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(i=e.find(e=>e.tooltipSpace))||void 0===i?void 0:i.tooltipSpace)||iw}}}),iS=new WeakMap,ik=e5.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(ix);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 iy(e,iD,(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,i=e.state.facet(ix);if(i.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=i.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=i.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),i=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=ib,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),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)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||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(Q.gecko)n=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==ib&&"0px"==e.style.left){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}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 i=this.view.scrollDOM.getBoundingClientRect(),r=ti(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.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(ix).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:i,scaleX:r,scaleY:o}=e,s=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],u=this.manager.tooltipViews[l],{dom:c}=u,h=e.pos[l],d=e.size[l];if(!h||!1!==a.clip&&(h.bottom<=Math.max(n.top,i.top)||h.top>=Math.min(n.bottom,i.bottom)||h.right<Math.max(n.left,i.left)-.1||h.left>Math.min(n.right,i.right)+.1)){c.style.top=ib;continue}let f=a.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=7*!!f,m=d.right-d.left,g=null!==(t=iS.get(u))&&void 0!==t?t:d.bottom-d.top,v=u.offset||iT,b=this.view.textDirection==eC.LTR,y=d.width>i.right-i.left?b?i.left:i.right-d.width:b?Math.max(i.left,Math.min(h.left-14*!!f+v.x,i.right-m)):Math.min(Math.max(i.left,h.left-m+14*!!f-v.x),i.right-m),w=this.above[l];!a.strictSide&&(w?h.top-g-p-v.y<i.top:h.bottom+g+p+v.y>i.bottom)&&w==i.bottom-h.bottom>h.top-i.top&&(w=this.above[l]=!w);let x=(w?h.top-i.top:i.bottom-h.bottom)-p;if(x<g&&!1!==u.resize){if(x<this.view.defaultLineHeight){c.style.top=ib;continue}iS.set(u,g),c.style.height=(g=x)/o+"px"}else c.style.height&&(c.style.height="");let S=w?h.top-g-p-v.y:h.bottom+p+v.y,k=y+m;if(!0!==u.overlap)for(let e of s)e.left<k&&e.right>y&&e.top<S+g&&e.bottom>S&&(S=w?e.top-g-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",iC(c,(y-e.parent.left)/r)):(c.style.top=S/o+"px",iC(c,y/r)),f){let e=h.left+(b?v.x:-v.x)-(y+14-7);f.style.left=e/r+"px"}!0!==u.overlap&&s.push({left:y,top:S,right:k,bottom:S+g}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),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=ib}},{eventObservers:{scroll(){this.maybeMeasure()}}});function iC(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let iM=nM.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"}}}),iT={x:0,y:0},iD=l.r$.define({enables:[ik,iM]}),iP=l.r$.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class iR{static create(e){return new iR(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new iy(e,iP,(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)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i){if(void 0===t)t=i;else if(t!==i)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 iA=iD.compute([iP],e=>{let t=e.facet(iP);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)&&void 0!==t?t:e.pos})),create:iR.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class iO{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,this.hoverTime=r,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(){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.nearest(t.target);if(!n)return;let i,r=1;if(n instanceof en)i=n.posAtStart;else{if(null==(i=e.posAtCoords(t)))return;let n=e.coordsAtPos(i);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(i)).find(e=>e.from<=i&&e.to>=i),s=o&&o.dir==eC.RTL?-1:1;r=t.x<n.left?-s:s}let o=this.source(e,i,r);if(null==o?void 0:o.then){let t=this.pending={pos:i};o.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>eQ(e.state,t,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(ik),t=e?e.manager.tooltips.findIndex(e=>e.create==iR.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:i,tooltip:r}=this;if(i.length&&r&&!function(e,t){let{left:n,right:i,top:r,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let e=s.getBoundingClientRect();r=Math.min(e.top,r),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=i+4&&t.clientY>=r-4&&t.clientY<=o+4}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,o=null!==(n=null===(t=i[0])||void 0===t?void 0:t.end)&&void 0!==n?n:r;(r==o?this.view.posAtCoords(this.lastMove)!=r:!function(e,t,n,i,r,o){let s=e.scrollDOM.getBoundingClientRect(),l=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>i||s.right<i||s.top>r||Math.min(s.bottom,l)<r)return!1;let a=e.posAtCoords({x:i,y:r},!1);return a>=t&&a<=n}(this.view,r,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){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),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function iI(e,t={}){let n=l.Py.define(),i=l.QQ.define({create:()=>[],update(e,i){if(e.length&&(t.hideOnChange&&(i.docChanged||i.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(i,e))),i.docChanged)){let t=[];for(let n of e){let e=i.changes.mapPos(n.pos,-1,l.gc.TrackDel);if(null!=e){let r=Object.assign(Object.create(null),n);r.pos=e,null!=r.end&&(r.end=i.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of i.effects)t.is(n)&&(e=t.value),t.is(iL)&&(e=[]);return e},provide:e=>iP.from(e)});return{active:i,extension:[i,e5.define(r=>new iO(r,e,i,n,t.hoverTime||300)),iA]}}function iE(e,t){let n=e.plugin(ik);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}let iL=l.Py.define(),iB=l.r$.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function iZ(e,t){let n=e.plugin(iF),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}let iF=e5.fromClass(class{constructor(e){this.input=e.state.facet(ij),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(iB);for(let n of(this.top=new iV(e,!0,t.topContainer),this.bottom=new iV(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(iB);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new iV(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new iV(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(ij);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],o=[],s=[];for(let n of t){let t=this.specs.indexOf(n),l;t<0?(l=n(e.view),s.push(l)):(l=this.panels[t]).update&&l.update(e),i.push(l),(l.top?r:o).push(l)}for(let e of(this.specs=t,this.panels=i,this.top.sync(r),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=>nM.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class iV{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=iN(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=iN(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 iN(e){let t=e.nextSibling;return e.remove(),t}let ij=l.r$.define({enables:iF});class iH extends l.uU{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}iH.prototype.elementClass="",iH.prototype.toDOM=void 0,iH.prototype.mapMode=l.gc.TrackBefore,iH.prototype.startSide=iH.prototype.endSide=-1,iH.prototype.point=!0;let iz=l.r$.define(),i$=l.r$.define(),iW={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>l.Xs.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},i_=l.r$.define();function iq(e){return[iU(),i_.of(Object.assign(Object.assign({},iW),e))]}let iG=l.r$.define({combine:e=>e.some(e=>e)});function iU(e){let t=[iK];return e&&!1===e.fixed&&t.push(iG.of(!0)),t}let iK=e5.fromClass(class{constructor(e){for(let t of(this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(i_).map(t=>new iQ(e,t)),this.gutters))this.dom.appendChild(t.dom);this.fixed=!e.state.facet(iG),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(iG)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=l.Xs.iter(this.view.state.facet(iz),this.view.viewport.from),i=[],r=this.gutters.map(e=>new iX(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==eh.Text&&t){for(let e of(iJ(n,i,o.from),r))e.line(this.view,o,i);t=!1}else if(o.widget)for(let e of r)e.widget(this.view,o)}else if(e.type==eh.Text)for(let t of(iJ(n,i,e.from),r))t.line(this.view,e,i);else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(i_),n=e.state.facet(i_),i=e.docChanged||e.heightChanged||e.viewportChanged||!l.Xs.eq(e.startState.facet(iz),e.state.facet(iz),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new iQ(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>r.indexOf(e)&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>nM.scrollMargins.of(t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==eC.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null})});function iY(e){return Array.isArray(e)?e:[e]}function iJ(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class iX{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=l.Xs.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let t=new i0(e,o,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];iJ(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),i=n?[n]:null;for(let n of e.state.facet(i$)){let r=n(e,t.widget,t);r&&(i||(i=[])).push(r)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class iQ{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,i=>{let r=i.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let e=r.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=i.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,s,i)&&i.preventDefault()});this.markers=iY(t.markers(e)),t.initialSpacer&&(this.spacer=new i0(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=iY(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!l.Xs.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 i0{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){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,i)&&this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let s=o,l=r<t.length?t[r++]:null,a=!1;if(l){let e=l.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(l)){s=e,a=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!l)break;l.toDOM&&(a?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),a&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let i1=l.r$.define(),i2=l.r$.define(),i5=l.r$.define({combine:e=>(0,l.BO)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class i3 extends iH{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function i4(e,t){return e.state.facet(i5).formatNumber(t,e.state)}let i8=i_.compute([i5],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(i1),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new i3(i4(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(i2)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(i5)!=e.state.facet(i5),initialSpacer:e=>new i3(i4(e,i6(e.state.doc.lines))),updateSpacer(e,t){let n=i4(t.view,i6(t.view.state.doc.lines));return n==e.number?e:new i3(n)},domEventHandlers:e.facet(i5).domEventHandlers}));function i9(e={}){return[i5.of(e),iU(),i8]}function i6(e){let t=9;for(;t<e;)t=10*t+9;return t}let i7=new class extends iH{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},re=iz.compute(["selection"],e=>{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(i7.range(r)))}return l.Xs.of(t)});function rt(){return re}},19294:function(e,t,n){"use strict";var i,r;n.d(t,{Jq:()=>h,L3:()=>o,Lj:()=>d,_b:()=>L,i9:()=>E,md:()=>a,mp:()=>m,vj:()=>i});let o=1024,s=0;class l{constructor(e,t){this.from=e,this.to=t}}class a{constructor(e={}){this.id=s++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=h.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}a.closedBy=new a({deserialize:e=>e.split(" ")}),a.openedBy=new a({deserialize:e=>e.split(" ")}),a.group=new a({deserialize:e=>e.split(" ")}),a.isolate=new a({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),a.contextHash=new a({perNode:!0}),a.lookAhead=new a({perNode:!0}),a.mounted=new a({perNode:!0});class u{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[a.mounted.id]}}let c=Object.create(null);class h{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):c,n=+!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),i=new h(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),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 i}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(a.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 i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(a.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}h.none=new h("",Object.create(null),0,8);class d{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 i=null;for(let t of e){let e=t(n);e&&(i||(i=Object.assign({},n.props)),i[e[0].id]=e[1])}t.push(i?new h(n.name,i,n.id,n.flags):n)}return new d(t)}}let f=new WeakMap,p=new WeakMap;(r=i||(i={}))[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays";class m{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length)for(let[e,t]of(this.props=Object.create(null),r))this.props["number"==typeof e?e:e.id]=t}toString(){let e=u.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 P(this.topNode,e)}cursorAt(e,t=0,n=0){let i=new P(f.get(this)||this.topNode);return i.moveTo(e,t),f.set(this,i._tree),i}get topNode(){return new x(this,0,0,null)}resolve(e,t=0){let n=y(f.get(this)||this.topNode,e,t,!1);return f.set(this,n),n}resolveInner(e,t=0){let n=y(p.get(this)||this.topNode,e,t,!0);return p.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof x?i:i.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[i])).push(o.resolve(t,n)),e=o}else{let o=u.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new x(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(y(s,t,n,!1))}}return r?T(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:o=this.length}=e,s=e.mode||0,l=(s&i.IncludeAnonymous)>0;for(let e=this.cursor(s|i.IncludeAnonymous);;){let i=!1;if(e.from<=o&&e.to>=r&&(!l&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;i=!0}for(;i&&n&&(l||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;i=!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:I(h.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new m(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new m(h.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=o,reused:s=[],minRepeatType:l=i.types.length}=e,u=Array.isArray(n)?new g(n,n.length):n,c=i.types,h=0,d=0;function f(e,t,n,r,o,s,l,a,u){let c=[],h=[];for(;e.length>r;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(p(i.types[l],c,h,s-o,a-s,u)),t.push(o-n)}function p(e,t,n,i,r,o,s){if(o){let e=[a.contextHash,o];s=s?[e].concat(s):[e]}if(r>25){let e=[a.lookAhead,r];s=s?[e].concat(s):[e]}return new m(e,t,n,i,s)}let b=[],y=[];for(;u.pos>0;)!function e(t,n,o,g,b,y){let{id:w,start:x,end:S,size:k}=u,C=d,M=h;for(;k<0;){if(u.next(),-1==k){let e=s[w];o.push(e),g.push(x-t);return}if(-3==k){h=w;return}if(-4==k){d=w;return}else throw RangeError(`Unrecognized record size: ${k}`)}let T=c[w],D,P,R=x-t;if(S-x<=r&&(P=function(e,t){let n=u.fork(),i=0,o=0,s=0,a=n.end-r,c={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){c.size=i,c.start=o,c.skip=s,s+=4,i+=4,n.next();continue}let u=n.pos-e;if(e<0||u<r||n.start<a)break;let h=4*(n.id>=l),d=n.start;for(n.next();n.pos>u;){if(n.size<0){if(-3==n.size)h+=4;else break e}else n.id>=l&&(h+=4);n.next()}o=d,i+=e,s+=h}return(t<0||i==e)&&(c.size=i,c.start=o,c.skip=s),c.size>4?c:void 0}(u.pos-n,b))){let e=new Uint16Array(P.size-P.skip),n=u.pos-P.size,r=e.length;for(;u.pos>n;)r=function e(t,n,i){let{id:r,start:o,end:s,size:a}=u;if(u.next(),a>=0&&r<l){let l=i;if(a>4){let r=u.pos-(a-4);for(;u.pos>r;)i=e(t,n,i)}n[--i]=l,n[--i]=s-t,n[--i]=o-t,n[--i]=r}else -3==a?h=r:-4==a&&(d=r);return i}(P.start,e,r);D=new v(e,S-P.start,i),R=P.start-t}else{let t=u.pos-k;u.next();let n=[],o=[],s=w>=l?w:-1,c=0,h=S;for(;u.pos>t;)s>=0&&u.id==s&&u.size>=0?(u.end<=h-r&&(f(n,o,x,c,u.end,h,s,C,M),c=n.length,h=u.end),u.next()):y>2500?function(e,t,n,o){let s=[],l=0,a=-1;for(;u.pos>t;){let{id:e,start:t,end:n,size:i}=u;if(i>4)u.next();else if(a>-1&&t<a)break;else a<0&&(a=n-r),s.push(e,t,n),l++,u.next()}if(l){let t=new Uint16Array(4*l),r=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]-r,t[n++]=s[e+2]-r,t[n++]=n;n.push(new v(t,s[2]-r,i)),o.push(r-e)}}(x,t,n,o):e(x,t,n,o,s,y+1);if(s>=0&&c>0&&c<n.length&&f(n,o,x,c,x,h,s,C,M),n.reverse(),o.reverse(),s>-1&&c>0){let e=function(e,t){return(n,i,r)=>{let o=0,s=n.length-1,l,u;if(s>=0&&(l=n[s])instanceof m){if(!s&&l.type==e&&l.length==r)return l;(u=l.prop(a.lookAhead))&&(o=i[s]+l.length+u)}return p(e,n,i,r,o,t)}}(T,M);D=I(T,n,o,0,n.length,0,S-x,e,e)}else D=p(T,n,o,S-x,C-S,M)}o.push(D),g.push(R)}(e.start||0,e.bufferStart||0,b,y,-1,0);let w=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new m(c[e.topID],b.reverse(),y.reverse(),w)}(e)}}m.empty=new m(h.none,[],[],0);class g{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 g(this.buffer,this.index)}}class v{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return h.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],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,n,i,r){let{buffer:o}=this,s=-1;for(let l=e;l!=t&&(!b(r,i,o[l+1],o[l+2])||(s=l,!(n>0)));l=o[l+3]);return s}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let s=e,l=0;s<t;){r[l++]=i[s++],r[l++]=i[s++]-n;let t=r[l++]=i[s++]-n;r[l++]=i[s++]-e,o=Math.max(o,t)}return new v(r,o,this.set)}}function b(e,t,n,i){switch(e){case -2:return n<t;case -1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function y(e,t,n,r){for(var o;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 x&&e.index<0?null:e.parent;if(!t)return e;e=t}let s=r?0:i.IgnoreOverlays;if(r)for(let i=e,r=i.parent;r;r=(i=r).parent)i instanceof x&&i.index<0&&(null===(o=r.enter(t,n,s))||void 0===o?void 0:o.from)!=i.from&&(e=r);for(;;){let i=e.enter(t,n,s);if(!i)return e;e=i}}class w{cursor(e=0){return new P(this,e)}getChild(e,t=null,n=null){let i=S(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return S(this,e,t,n)}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}matchContext(e){return k(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 x extends w{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}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,o=0){for(let s=this;;){for(let{children:l,positions:a}=s._tree,c=t>0?l.length:-1;e!=c;e+=t){let c=l[e],h=a[e]+s.from;if(b(r,n,h,h+c.length)){if(c instanceof v){if(o&i.ExcludeBuffers)continue;let l=c.findChild(0,c.buffer.length,t,n-h,r);if(l>-1)return new M(new C(s,c,e,h),null,l)}else if(o&i.IncludeAnonymous||!c.type.isAnonymous||R(c)){let l;if(!(o&i.IgnoreMounts)&&(l=u.get(c))&&!l.overlay)return new x(l.tree,h,e,s);let a=new x(c,h,e,s);return o&i.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?c.children.length-1:0,t,n,r)}}}if(o&i.IncludeAnonymous||!s.type.isAnonymous||(e=s.index>=0?s.index+t:t<0?-1:s._parent._tree.children.length,!(s=s._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)}enter(e,t,n=0){let r;if(!(n&i.IgnoreOverlays)&&(r=u.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:e,to:i}of r.overlay)if((t>0?e<=n:e<n)&&(t<0?i>=n:i>n))return new x(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 S(e,t,n,i){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return o}for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function k(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class C{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class M extends w{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:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new M(this.context,this,r)}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)}enter(e,t,n=0){if(n&i.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new M(this.context,this,o)}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 M(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 M(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];e.push(n.slice(i,r,o)),t.push(0)}return new m(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function T(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof x&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new D(r,n)}class D{constructor(e,t){this.heads=e,this.node=t}get next(){return T(this.heads)}}class P{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof x)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:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof x?(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:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}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&i.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&i.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&i.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,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let e=n._tree.children[r];if(this.mode&i.IncludeAnonymous||e instanceof v||!e.type.isAnonymous||R(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)e:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=r+1;break e}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new M(this.buffer,t,this.stack[e]);return this.bufferNode=new M(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return k(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return k(this._tree,e,i);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function R(e){return e.children.some(e=>e instanceof v||!e.type.isAnonymous||R(e))}let A=new WeakMap;function O(e,t){if(!e.isAnonymous||t instanceof v||t.type!=e)return 1;let n=A.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof m)){n=1;break}n+=O(e,i)}A.set(t,n)}return n}function I(e,t,n,i,r,o,s,l,a){let u=0;for(let n=i;n<r;n++)u+=O(e,t[n]);let c=Math.ceil(1.5*u/8),h=[],d=[];return!function t(n,i,r,s,l){for(let u=r;u<s;){let r=u,f=i[u],p=O(e,n[u]);for(u++;u<s;u++){let t=O(e,n[u]);if(p+t>=c)break;p+=t}if(u==r+1){if(p>c){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+l);continue}h.push(n[r])}else{let t=i[u-1]+n[u-1].length-f;h.push(I(e,n,i,r,u,f,t,null,a))}d.push(f+l-o)}}(t,n,i,r,0),(l||a)(h,d,s)}class E{constructor(e,t,n,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=+!!r|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new E(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let s=0,l=0,a=0;;s++){let u=s<t.length?t[s]:null,c=u?u.fromA:1e9;if(c-l>=n)for(;o&&o.from<c;){let t=o;if(l>=t.from||c<=t.to||a){let e=Math.max(t.from,l)-a,n=Math.min(t.to,c)-a;t=e>=n?null:new E(e,n,t.tree,t.offset+a,s>0,!!u)}if(t&&i.push(t),o.to>c)break;o=r<e.length?e[r++]:null}if(!u)break;l=u.toA,a=u.toA-u.toB}return i}}class L{startParse(e,t,n){return"string"==typeof e&&(e=new B(e)),n=n?n.length?n.map(e=>new l(e.from,e.to)):[new l(0,0)]:[new l(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class B{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 a({perNode:!0})},94197:function(e,t,n){"use strict";n.d(t,{Gv:()=>a,QR:()=>h,bW:()=>d,pJ:()=>R});var i=n(19294);let r=0;class o{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=r++}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 o&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new o("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 l(e);return e=>e.modified.indexOf(t)>-1?e:l.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let s=0;class l{constructor(e){this.name=e,this.instances=[],this.id=s++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i,r;return n.base==e&&(i=t,r=n.modified,i.length==r.length&&i.every((e,t)=>e==r[t]))});if(n)return n;let i=[],r=new o(e.name,i,e,t);for(let e of t)e.instances.push(r);let s=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].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 s)i.push(l.get(t,e));return r}}function a(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let e of(Array.isArray(i)||(i=[i]),n.split(" ")))if(e){let n=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),(t+=i[0].length)==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){r=0;break}if("/"!=s)throw RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,l=n[s];if(!l)throw RangeError("Invalid path: "+e);let a=new c(i,r,s>0?n.slice(0,s):null);t[l]=a.sort(t[l])}}return u.add(t)}let u=new i.md;class c{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}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 h(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:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}function d(e,t,n,i=0,r=e.length){let o=new f(i,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),i,r,"",o.highlighters),o.flush(r)}c.empty=new c([],2,null);class f{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,o){let{type:s,from:l,to:a}=e;if(l>=n||a<=t)return;s.isTop&&(o=this.highlighters.filter(e=>!e.scope||e.scope(s)));let h=r,d=function(e){let t=e.type.prop(u);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||c.empty,f=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(o,d.tags);if(f&&(h&&(h+=" "),h+=f,1==d.mode&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(t,l),h),d.opaque)return;let p=e.tree&&e.tree.prop(i.md.mounted);if(p&&p.overlay){let i=e.node.enter(p.overlay[0].from+l,1),s=this.highlighters.filter(e=>!e.scope||e.scope(p.tree.type)),u=e.firstChild();for(let c=0,d=l;;c++){let f=c<p.overlay.length?p.overlay[c]:null,m=f?f.from+l:a,g=Math.max(t,d),v=Math.min(n,m);if(g<v&&u)for(;e.from<v&&(this.highlightRange(e,g,v,r,o),this.startSpan(Math.min(v,e.to),h),!(e.to>=m)&&e.nextSibling()););if(!f||m>n)break;(d=f.to+l)>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,d),"",s),this.startSpan(Math.min(n,d),h))}u&&e.parent()}else if(e.firstChild()){p&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,o),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}let p=o.define,m=p(),g=p(),v=p(g),b=p(g),y=p(),w=p(y),x=p(y),S=p(),k=p(S),C=p(),M=p(),T=p(),D=p(T),P=p(),R={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:v,tagName:p(v),propertyName:b,attributeName:p(b),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:y,string:w,docString:p(w),character:p(w),attributeValue:p(w),number:x,integer:p(x),float:p(x),bool:p(y),regexp:p(y),escape:p(y),color:p(y),url:p(y),keyword:C,self:p(C),null:p(C),atom:p(C),unit:p(C),modifier:p(C),operatorKeyword:p(C),controlKeyword:p(C),definitionKeyword:p(C),moduleKeyword:p(C),operator:M,derefOperator:p(M),arithmeticOperator:p(M),logicOperator:p(M),bitwiseOperator:p(M),compareOperator:p(M),updateOperator:p(M),definitionOperator:p(M),typeOperator:p(M),controlOperator:p(M),punctuation:T,separator:p(T),bracket:D,angleBracket:p(D),squareBracket:p(D),paren:p(D),brace:p(D),content:S,heading:k,heading1:p(k),heading2:p(k),heading3:p(k),heading4:p(k),heading5:p(k),heading6:p(k),contentSeparator:p(S),list:p(S),quote:p(S),emphasis:p(S),strong:p(S),link:p(S),monospace:p(S),strikethrough:p(S),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:P,documentMeta:p(P),annotation:p(P),processingInstruction:p(P),definition:o.defineModifier("definition"),constant:o.defineModifier("constant"),function:o.defineModifier("function"),standard:o.defineModifier("standard"),local:o.defineModifier("local"),special:o.defineModifier("special")};for(let e in R){let t=R[e];t instanceof o&&(t.name=e)}h([{tag:R.link,class:"tok-link"},{tag:R.heading,class:"tok-heading"},{tag:R.emphasis,class:"tok-emphasis"},{tag:R.strong,class:"tok-strong"},{tag:R.keyword,class:"tok-keyword"},{tag:R.atom,class:"tok-atom"},{tag:R.bool,class:"tok-bool"},{tag:R.url,class:"tok-url"},{tag:R.labelName,class:"tok-labelName"},{tag:R.inserted,class:"tok-inserted"},{tag:R.deleted,class:"tok-deleted"},{tag:R.literal,class:"tok-literal"},{tag:R.string,class:"tok-string"},{tag:R.number,class:"tok-number"},{tag:[R.regexp,R.escape,R.special(R.string)],class:"tok-string2"},{tag:R.variableName,class:"tok-variableName"},{tag:R.local(R.variableName),class:"tok-variableName tok-local"},{tag:R.definition(R.variableName),class:"tok-variableName tok-definition"},{tag:R.special(R.variableName),class:"tok-variableName2"},{tag:R.definition(R.propertyName),class:"tok-propertyName tok-definition"},{tag:R.typeName,class:"tok-typeName"},{tag:R.namespace,class:"tok-namespace"},{tag:R.className,class:"tok-className"},{tag:R.macroName,class:"tok-macroName"},{tag:R.propertyName,class:"tok-propertyName"},{tag:R.operator,class:"tok-operator"},{tag:R.comment,class:"tok-comment"},{tag:R.meta,class:"tok-meta"},{tag:R.invalid,class:"tok-invalid"},{tag:R.punctuation,class:"tok-punctuation"}])},22577:function(e,t,n){"use strict";n.d(t,{b7:()=>s,ie:()=>o});var i=n(54538),r=n(80900);function o(e,t){var n,r,o;return e?"function"==typeof(r=n=e)&&(()=>{let e=Object.getPrototypeOf(r);return e.prototype&&e.prototype.isReactComponent})()||"function"==typeof n||"object"==typeof(o=n)&&"symbol"==typeof o.$$typeof&&["react.memo","react.forward_ref"].includes(o.$$typeof.description)?i.createElement(e,t):e:null}function s(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=i.useState(()=>({current:(0,r.W_)(t)})),[o,s]=i.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{s(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}},80900:function(e,t,n){"use strict";function i(e,t){return"function"==typeof e?e(t):e}function r(e,t){return n=>{t.setState(t=>({...t,[e]:i(n,t[e])}))}}function o(e){return e instanceof Function}function s(e,t,n){let i,r=[];return o=>{let s,l;n.key&&n.debug&&(s=Date.now());let a=e(o);if(!(a.length!==r.length||a.some((e,t)=>r[t]!==e)))return i;if(r=a,n.key&&n.debug&&(l=Date.now()),i=t(...a),null==n||null==n.onChange||n.onChange(i),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-s)*100)/100,t=Math.round((Date.now()-l)*100)/100,i=t/16,r=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${r(t,5)} /${r(e,5)} ms`,`
|
|
5
|
-
font-size: .6rem;
|
|
6
|
-
font-weight: bold;
|
|
7
|
-
color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return i}}function l(e,t,n,i){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:i}}n.d(t,{G_:()=>_,W_:()=>$,sC:()=>W,tj:()=>q});let a="debugHeaders";function u(e,t,n){var i;let r={id:null!=(i=n.id)?i: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(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(r,e)}),r}function c(e,t,n,i){var r,o;let s=0,l=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&&l(e.columns,t+1)},0)};l(e);let a=[],c=(e,t)=>{let r={depth:t,id:[i,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let s;let l=[...o].reverse()[0],a=e.column.depth===r.depth,c=!1;if(a&&e.column.parent?s=e.column.parent:(s=e.column,c=!0),l&&(null==l?void 0:l.column)===s)l.subHeaders.push(e);else{let r=u(n,s,{id:[i,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:c,placeholderId:c?`${o.filter(e=>e.column===s).length}`:void 0,depth:t,index:o.length});r.subHeaders.push(e),o.push(r)}r.headers.push(e),e.headerGroup=r}),a.push(r),t>0&&c(o,t-1)};c(t.map((e,t)=>u(n,e,{depth:s,index:t})),s-1),a.reverse();let h=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,i=[0];return e.subHeaders&&e.subHeaders.length?(i=[],h(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:r}=e;t+=n,i.push(r)})):t=1,n+=Math.min(...i),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return h(null!=(r=null==(o=a[0])?void 0:o.headers)?r:[]),a}let h=(e,t,n,i,r,o,a)=>{let u={id:t,index:i,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(u._valuesCache.hasOwnProperty(t))return u._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return u._valuesCache[t]=n.accessorFn(u.original,i),u._valuesCache[t]},getUniqueValues:t=>{if(u._uniqueValuesCache.hasOwnProperty(t))return u._uniqueValuesCache[t];let n=e.getColumn(t);return null!=n&&n.accessorFn?(n.columnDef.getUniqueValues?u._uniqueValuesCache[t]=n.columnDef.getUniqueValues(u.original,i):u._uniqueValuesCache[t]=[u.getValue(t)],u._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=u.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=o?o:[],getLeafRows:()=>(function(e,t){let n=[],i=e=>{e.forEach(e=>{n.push(e);let r=t(e);null!=r&&r.length&&i(r)})};return i(e),n})(u.subRows,e=>e.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let e=[],t=u;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:s(()=>[e.getAllLeafColumns()],t=>t.map(t=>(function(e,t,n,i){let r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:()=>{var t;return null!=(t=r.getValue())?t:e.options.renderFallbackValue},getContext:s(()=>[e,n,t,r],(e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue}),l(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{null==i.createCell||i.createCell(r,n,t,e)},{}),r})(e,u,t,t.id)),l(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:s(()=>[u.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),l(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(u,e)}return u},d=(e,t,n)=>{var i,r;let o=null==n||null==(i=n.toString())?void 0:i.toLowerCase();return!!(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(o))};d.autoRemove=e=>S(e);let f=(e,t,n)=>{var i;return!!(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};f.autoRemove=e=>S(e);let p=(e,t,n)=>{var i;return(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};p.autoRemove=e=>S(e);let m=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};m.autoRemove=e=>S(e);let g=(e,t,n)=>!n.some(n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))});g.autoRemove=e=>S(e)||!(null!=e&&e.length);let v=(e,t,n)=>n.some(n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)});v.autoRemove=e=>S(e)||!(null!=e&&e.length);let b=(e,t,n)=>e.getValue(t)===n;b.autoRemove=e=>S(e);let y=(e,t,n)=>e.getValue(t)==n;y.autoRemove=e=>S(e);let w=(e,t,n)=>{let[i,r]=n,o=e.getValue(t);return o>=i&&o<=r};w.resolveFilterValue=e=>{let[t,n]=e,i="number"!=typeof t?parseFloat(t):t,r="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(i)?-1/0:i,s=null===n||Number.isNaN(r)?1/0:r;if(o>s){let e=o;o=s,s=e}return[o,s]},w.autoRemove=e=>S(e)||S(e[0])&&S(e[1]);let x={includesString:d,includesStringSensitive:f,equalsString:p,arrIncludes:m,arrIncludesAll:g,arrIncludesSome:v,equals:b,weakEquals:y,inNumberRange:w};function S(e){return null==e||""===e}function k(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let C={sum:(e,t,n)=>n.reduce((t,n)=>{let i=n.getValue(e);return t+("number"==typeof i?i:0)},0),min:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i>n||void 0===i&&n>=n)&&(i=n)}),i},max:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i<n||void 0===i&&n>=n)&&(i=n)}),i},extent:(e,t,n)=>{let i,r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===i?n>=n&&(i=r=n):(i>n&&(i=n),r<n&&(r=n)))}),[i,r]},mean:(e,t)=>{let n=0,i=0;if(t.forEach(t=>{let r=t.getValue(e);null!=r&&(r*=1)>=r&&(++n,i+=r)}),n)return i/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 i=Math.floor(n.length/2),r=n.sort((e,t)=>e-t);return n.length%2!=0?r[i]:(r[i-1]+r[i])/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},M=()=>({left:[],right:[]}),T={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},D=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),P=null;function R(e){return"touchstart"===e.type}function A(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let O=()=>({pageIndex:0,pageSize:10}),I=()=>({top:[],bottom:[]}),E=(e,t,n,i,r)=>{var o;let s=r.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),s.getCanSelect()&&(e[t]=!0)):delete e[t],i&&null!=(o=s.subRows)&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(t=>E(e,t.id,n,i,r))};function L(e,t){let n=e.getState().rowSelection,i=[],r={},o=function(e,t){return e.map(e=>{var t;let s=B(e,n);if(s&&(i.push(e),r[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:i,rowsById:r}}function B(e,t){var n;return null!=(n=t[e.id])&&n}function Z(e,t,n){var i;if(!(null!=(i=e.subRows)&&i.length))return!1;let r=!0,o=!1;return e.subRows.forEach(e=>{if((!o||r)&&(e.getCanSelect()&&(B(e,t)?o=!0:r=!1),e.subRows&&e.subRows.length)){let n=Z(e,t);"all"===n?o=!0:("some"===n&&(o=!0),r=!1)}}),r?"all":!!o&&"some"}let F=/([0-9]+)/gm;function V(e,t){return e===t?0:e>t?1:-1}function N(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function j(e,t){let n=e.split(F).filter(Boolean),i=t.split(F).filter(Boolean);for(;n.length&&i.length;){let e=n.shift(),t=i.shift(),r=parseInt(e,10),o=parseInt(t,10),s=[r,o].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(s[1]))return isNaN(r)?-1:1;if(r>o)return 1;if(o>r)return -1}return n.length-i.length}let H={alphanumeric:(e,t,n)=>j(N(e.getValue(n)).toLowerCase(),N(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>j(N(e.getValue(n)),N(t.getValue(n))),text:(e,t,n)=>V(N(e.getValue(n)).toLowerCase(),N(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>V(N(e.getValue(n)),N(t.getValue(n))),datetime:(e,t,n)=>{let i=e.getValue(n),r=t.getValue(n);return i>r?1:i<r?-1:0},basic:(e,t,n)=>V(e.getValue(n),t.getValue(n))},z=[{createTable:e=>{e.getHeaderGroups=s(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>{var o,s;let l=null!=(o=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],a=null!=(s=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[];return c(t,[...l,...n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),...a],e)},l(e.options,a,"getHeaderGroups")),e.getCenterHeaderGroups=s(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>c(t,n=n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),e,"center"),l(e.options,a,"getCenterHeaderGroups")),e.getLeftHeaderGroups=s(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var r;return c(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"left")},l(e.options,a,"getLeftHeaderGroups")),e.getRightHeaderGroups=s(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var r;return c(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"right")},l(e.options,a,"getRightHeaderGroups")),e.getFooterGroups=s(()=>[e.getHeaderGroups()],e=>[...e].reverse(),l(e.options,a,"getFooterGroups")),e.getLeftFooterGroups=s(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),l(e.options,a,"getLeftFooterGroups")),e.getCenterFooterGroups=s(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),l(e.options,a,"getCenterFooterGroups")),e.getRightFooterGroups=s(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),l(e.options,a,"getRightFooterGroups")),e.getFlatHeaders=s(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,a,"getFlatHeaders")),e.getLeftFlatHeaders=s(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,a,"getLeftFlatHeaders")),e.getCenterFlatHeaders=s(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,a,"getCenterFlatHeaders")),e.getRightFlatHeaders=s(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),l(e.options,a,"getRightFlatHeaders")),e.getCenterLeafHeaders=s(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),l(e.options,a,"getCenterLeafHeaders")),e.getLeftLeafHeaders=s(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),l(e.options,a,"getLeftLeafHeaders")),e.getRightLeafHeaders=s(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),l(e.options,a,"getRightLeafHeaders")),e.getLeafHeaders=s(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var i,r,o,s,l,a;return[...null!=(i=null==(r=e[0])?void 0:r.headers)?i:[],...null!=(o=null==(s=t[0])?void 0:s.headers)?o:[],...null!=(l=null==(a=n[0])?void 0:a.headers)?l:[]].map(e=>e.getLeafHeaders()).flat()},l(e.options,a,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:r("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,i;let r=e.columns;return null==(n=r.length?r.some(e=>e.getIsVisible()):null==(i=t.getState().columnVisibility)?void 0:i[e.id])||n},e.getCanHide=()=>{var n,i;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(i=t.options.enableHiding)||i)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=s(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),l(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=s(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],l(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>s(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),l(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:r("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=s(e=>[A(t,e)],t=>t.findIndex(t=>t.id===e.id),l(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var i;return(null==(i=A(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;let r=A(t,n);return(null==(i=r[r.length-1])?void 0:i.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=s(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>i=>{let r=[];if(null!=e&&e.length){let t=[...e],n=[...i];for(;n.length&&t.length;){let e=t.shift(),i=n.findIndex(t=>t.id===e);i>-1&&r.push(n.splice(i,1)[0])}r=[...r,...n]}else r=i;return function(e,t,n){if(!(null!=t&&t.length)||!n)return e;let i=e.filter(e=>!t.includes(e.id));return"remove"===n?i:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...i]}(r,t,n)},l(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:M(),...e}),getDefaultOptions:e=>({onColumnPinningChange:r("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let i=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,r,o,s,l,a;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=i&&i.includes(e))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=i&&i.includes(e))),...i]}:"left"===n?{left:[...(null!=(l=null==e?void 0:e.left)?l:[]).filter(e=>!(null!=i&&i.includes(e))),...i],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=i&&i.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=i&&i.includes(e))),right:(null!=(r=null==e?void 0:e.right)?r:[]).filter(e=>!(null!=i&&i.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,i,r;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(i=null!=(r=t.options.enableColumnPinning)?r:t.options.enablePinning)||i)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:i,right:r}=t.getState().columnPinning,o=n.some(e=>null==i?void 0:i.includes(e)),s=n.some(e=>null==r?void 0:r.includes(e));return o?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();return r?null!=(n=null==(i=t.getState().columnPinning)||null==(i=i[r])?void 0:i.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=s(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.column.id))},l(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=s(()=>[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"})),l(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=s(()=>[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"})),l(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?M():null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:M())},e.getIsSomeColumnsPinned=t=>{var n,i,r;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.left)?void 0:i.length)||(null==(r=o.right)?void 0:r.length))},e.getLeftLeafColumns=s(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),l(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=s(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),l(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=s(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.id))},l(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:r("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"string"==typeof i?x.includesString:"number"==typeof i?x.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?x.equals:Array.isArray(i)?x.arrIncludes:x.weakEquals},e.getFilterFn=()=>{var n,i;return o(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(i=t.options.filterFns)?void 0:i[e.columnDef.filterFn])?n:x[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,r;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(i=t.options.enableColumnFilters)||i)&&(null==(r=t.options.enableFilters)||r)&&!!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,i;return null!=(n=null==(i=t.getState().columnFilters)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var r,o;let s=e.getFilterFn(),l=null==t?void 0:t.find(t=>t.id===e.id),a=i(n,l?l.value:void 0);if(k(s,a,e))return null!=(r=null==t?void 0:t.filter(t=>t.id!==e.id))?r:[];let u={id:e.id,value:a};return l?null!=(o=null==t?void 0:t.map(t=>t.id===e.id?u:t))?o:[]:null!=t&&t.length?[...t,u]:[u]})}},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=i(t,e))?void 0:r.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&k(t.getFilterFn(),e.value,t))})})},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.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:r("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let i=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof i||"number"==typeof i}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,r,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(i=t.options.enableGlobalFilter)||i)&&(null==(r=t.options.enableFilters)||r)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>x.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:i}=e.options;return o(i)?i:"auto"===i?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[i])?t:x[i]},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:r("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),i=!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 H.datetime;if("string"==typeof n&&(i=!0,n.split(F).length>1))return H.alphanumeric}return i?H.text:H.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,i;if(!e)throw Error();return o(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(i=t.options.sortingFns)?void 0:i[e.columnDef.sortingFn])?n:H[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{let r=e.getNextSortingOrder(),o=null!=n;t.setSorting(s=>{let l;let a=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"===r;if("toggle"!=(l=null!=s&&s.length&&e.getCanMultiSort()&&i?a?"toggle":"add":null!=s&&s.length&&u!==s.length-1?"replace":a?"toggle":"replace")||o||r||(l="remove"),"add"===l){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"===l?s.map(t=>t.id===e.id?{...t,desc:h}:t):"remove"===l?s.filter(t=>t.id!==e.id):[{id:e.id,desc:h}];return c})},e.getFirstSortDir=()=>{var n,i;return(null!=(n=null!=(i=e.columnDef.sortDescFirst)?i:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var i,r;let o=e.getFirstSortDir(),s=e.getIsSorted();return s?(s===o||null!=(i=t.options.enableSortingRemoval)&&!i||!!n&&null!=(r=t.options.enableMultiRemove)&&!r)&&("desc"===s?"asc":"desc"):o},e.getCanSort=()=>{var n,i;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(i=t.options.enableSorting)||i)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return null!=(n=null!=(i=e.columnDef.enableMultiSort)?i:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let i=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!i&&(i.desc?"desc":"asc")},e.getSortIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().sorting)?void 0:i.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 i=>{n&&(null==i.persist||i.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(i))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.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:r("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,i;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(i=t.options.enableGrouping)||i)&&(!!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],i=null==n?void 0:n.getValue(e.id);return"number"==typeof i?C.sum:"[object Date]"===Object.prototype.toString.call(i)?C.extent:void 0},e.getAggregationFn=()=>{var n,i;if(!e)throw Error();return o(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(i=t.options.aggregationFns)?void 0:i[e.columnDef.aggregationFn])?n:C[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.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 i=t.getColumn(n);return null!=i&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{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:r("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,r;if(!t){e._queue(()=>{t=!0});return}if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetExpanded)?i:!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,i;e.setExpanded(t?{}:null!=(n=null==(i=e.initialState)?void 0:i.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(i=>{var r;let o=!0===i||!!(null!=i&&i[e.id]),s={};if(!0===i?Object.keys(t.getRowModel().rowsById).forEach(e=>{s[e]=!0}):s=i,n=null!=(r=n)?r:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=s;return n}return i})},e.getIsExpanded=()=>{var n;let i=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===i||(null==i?void 0:i[e.id]))},e.getCanExpand=()=>{var n,i,r;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(i=t.options.enableExpanding)||i)&&!!(null!=(r=e.subRows)&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)n=(i=t.getRow(i.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...O(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:r("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,r;if(!t){e._queue(()=>{t=!0});return}if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetPageIndex)?i:!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=>i(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?O():null!=(n=e.initialState.pagination)?n:O())},e.setPageIndex=t=>{e.setPagination(n=>{let r=i(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,i;e.setPageIndex(t?0:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageIndex)?n:0)},e.resetPageSize=t=>{var n,i;e.setPageSize(t?10:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,i(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 o=i(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}}),e.getPageOptions=s(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},l(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:I(),...e}),getDefaultOptions:e=>({onRowPinningChange:r("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,r)=>{let o=i?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...r?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,i,r,o,l,a;return"bottom"===n?{top:(null!=(r=null==e?void 0:e.top)?r:[]).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!=(l=null==e?void 0:e.top)?l:[]).filter(e=>!(null!=s&&s.has(e))),...Array.from(s)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).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!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=s&&s.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:i,enablePinning:r}=t.options;return"function"==typeof i?i(e):null==(n=null!=i?i:r)||n},e.getIsPinned=()=>{let n=[e.id],{top:i,bottom:r}=t.getState().rowPinning,o=n.some(e=>null==i?void 0:i.includes(e)),s=n.some(e=>null==r?void 0:r.includes(e));return o?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();if(!r)return -1;let o=null==(n="top"===r?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(i=null==o?void 0:o.indexOf(e.id))?i:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?I():null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:I())},e.getIsSomeRowsPinned=t=>{var n,i,r;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.top)?void 0:i.length)||(null==(r=o.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,i)=>{var r;return(null==(r=e.options.keepPinnedRows)||r?(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:i}))},e.getTopRows=s(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),l(e.options,"debugRows","getTopRows")),e.getBottomRows=s(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),l(e.options,"debugRows","getBottomRows")),e.getCenterRows=s(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let i=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!i.has(e.id))},l(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:r("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 i={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(e=>{e.getCanSelect()&&(i[e.id]=!0)}):r.forEach(e=>{delete i[e.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let i=void 0!==t?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(t=>{E(r,t.id,i,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=s(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?L(e,n):{rows:[],flatRows:[],rowsById:{}},l(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=s(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?L(e,n):{rows:[],flatRows:[],rowsById:{}},l(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=s(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?L(e,n):{rows:[],flatRows:[],rowsById:{}},l(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),i=!!(t.length&&Object.keys(n).length);return i&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),i=!!t.length;return i&&t.some(e=>!n[e.id])&&(i=!1),i},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,i)=>{let r=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=void 0!==n?n:!r,e.getCanSelect()&&r===n)return o;let l={...o};return E(l,e.id,n,null==(s=null==i?void 0:i.selectChildren)||s,t),l})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return B(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===Z(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===Z(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 i;t&&e.toggleSelected(null==(i=n.target)?void 0:i.checked)}}}},{getDefaultColumnDef:()=>T,getInitialState:e=>({columnSizing:{},columnSizingInfo:D(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:r("columnSizing",e),onColumnSizingInfoChange:r("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,r;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:T.minSize,null!=(i=null!=o?o:e.columnDef.size)?i:T.size),null!=(r=e.columnDef.maxSize)?r:T.maxSize)},e.getStart=s(e=>[e,A(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),l(t.options,"debugColumns","getStart")),e.getAfter=s(e=>[e,A(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),l(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var n,i;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(i=t.options.enableColumnResizing)||i)},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 i;t+=null!=(i=e.column.getSize())?i: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 i=t.getColumn(e.column.id),r=null==i?void 0:i.getCanResize();return o=>{if(!i||!r||(null==o.persist||o.persist(),R(o)&&o.touches&&o.touches.length>1))return;let s=e.getSize(),l=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[i.id,i.getSize()]],a=R(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var i,r;let o="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(i=null==e?void 0:e.startOffset)?i:0))*o,l=Math.max(s/(null!=(r=null==e?void 0:e.startSize)?r:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*l,0))/100}),{...e,deltaOffset:s,deltaPercentage:l}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},h=e=>c("move",e),d=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=n||"undefined"!=typeof document?document:null,p={moveHandler:e=>h(e.clientX),upHandler:e=>{null==f||f.removeEventListener("mousemove",p.moveHandler),null==f||f.removeEventListener("mouseup",p.upHandler),d(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(e.touches[0].clientX),!1),upHandler:e=>{var t;null==f||f.removeEventListener("touchmove",m.moveHandler),null==f||f.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(null==(t=e.touches[0])?void 0:t.clientX)}},g=!!function(){if("boolean"==typeof P)return P;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 P=e}()&&{passive:!1};R(o)?(null==f||f.addEventListener("touchmove",m.moveHandler,g),null==f||f.addEventListener("touchend",m.upHandler,g)):(null==f||f.addEventListener("mousemove",p.moveHandler,g),null==f||f.addEventListener("mouseup",p.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:i.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?D():null!=(n=e.initialState.columnSizingInfo)?n:D())},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 $(e){var t,n;let r=[...z,...null!=(t=e._features)?t:[]],o={_features:r},a=o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o)),{}),u=e=>o.options.mergeOptions?o.options.mergeOptions(a,e):{...a,...e},c={...null!=(n=e.initialState)?n:{}};o._features.forEach(e=>{var t;c=null!=(t=null==e.getInitialState?void 0:e.getInitialState(c))?t:c});let h=[],d=!1,f={_features:r,options:{...a,...e},initialState:c,_queue:e=>{h.push(e),d||(d=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();d=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{let t=i(e,o.options);o.options=u(t)},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,n)=>{var i;return null!=(i=null==o.options.getRowId?void 0:o.options.getRowId(e,t,n))?i:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!n&&!(n=o.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:s(()=>[o.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},...o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},l(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:s(()=>[o._getColumnDefs()],e=>{let t=function(e,n,i){return void 0===i&&(i=0),e.map(e=>{let r=function(e,t,n,i){var r,o;let a;let u={...e._getDefaultColumnDef(),...t},c=u.accessorKey,h=null!=(r=null!=(o=u.id)?o:c?"function"==typeof String.prototype.replaceAll?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)?r:"string"==typeof u.header?u.header:void 0;if(u.accessorFn?a=u.accessorFn:c&&(a=c.includes(".")?e=>{let t=e;for(let e of c.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[u.accessorKey]),!h)throw Error();let d={id:`${String(h)}`,accessorFn:a,parent:i,depth:n,columnDef:u,columns:[],getFlatColumns:s(()=>[!0],()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},l(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:s(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=d.columns)&&t.length?e(d.columns.flatMap(e=>e.getLeafColumns())):[d]},l(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(d,e);return d}(o,e,i,n);return r.columns=e.columns?t(e.columns,r,i+1):[],r})};return t(e)},l(e,"debugColumns","getAllColumns")),getAllFlatColumns:s(()=>[o.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),l(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:s(()=>[o.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),l(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:s(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),l(e,"debugColumns","getAllLeafColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,f);for(let e=0;e<o._features.length;e++){let t=o._features[e];null==t||null==t.createTable||t.createTable(o)}return o}function W(){return e=>s(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},i=function(t,r,o){void 0===r&&(r=0);let s=[];for(let a=0;a<t.length;a++){let u=h(e,e._getRowId(t[a],a,o),t[a],a,r,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 l;u.originalSubRows=e.options.getSubRows(t[a],a),null!=(l=u.originalSubRows)&&l.length&&(u.subRows=i(u.originalSubRows,r+1,u))}}return s};return n.rows=i(t),n},l(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function _(e){return e=>s(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let i;if(!n.rows.length)return n;let{pageSize:r,pageIndex:o}=t,{rows:s,flatRows:l,rowsById:a}=n,u=r*o;s=s.slice(u,u+r),(i=e.options.paginateExpandedRows?{rows:s,flatRows:l,rowsById:a}:function(e){let t=[],n=e=>{var i;t.push(e),null!=(i=e.subRows)&&i.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:s,flatRows:l,rowsById:a})).flatRows=[];let c=e=>{i.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return i.rows.forEach(c),i},l(e.options,"debugTable","getPaginationRowModel"))}function q(){return e=>s(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let i=e.getState().sorting,r=[],o=i.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 l=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let i=0;i<o.length;i+=1){var n;let r=o[i],l=s[r.id],a=l.sortUndefined,u=null!=(n=null==r?void 0:r.desc)&&n,c=0;if(a){let n=e.getValue(r.id),i=t.getValue(r.id),o=void 0===n,s=void 0===i;if(o||s){if("first"===a)return o?-1:1;if("last"===a)return o?1:-1;c=o&&s?0:o?a:-a}}if(0===c&&(c=l.sortingFn(e,t,r.id)),0!==c)return u&&(c*=-1),l.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=l(e.subRows))}),t};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},l(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}},59718:function(e,t,n){"use strict";function i(){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 i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}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 i=0;i<n.length;i++)e(t,n[i]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}n.d(t,{Z:()=>i})},53094:function(e,t,n){"use strict";n.d(t,{gW:()=>I});var i=n(54538);function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(n=o[i])>=0||(r[n]=e[n]);return r}function s(e){var t=(0,i.useRef)(e),n=(0,i.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var l,a=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},u=function(e){return"touches"in e},c=function(e){return e&&e.ownerDocument.defaultView||self},h=function(e,t,n){var i=e.getBoundingClientRect(),r=u(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:a((r.pageX-(i.left+c(e).pageXOffset))/i.width),top:a((r.pageY-(i.top+c(e).pageYOffset))/i.height)}},d=function(e){u(e)||e.preventDefault()},f=i.memo(function(e){var t=e.onMove,n=e.onKey,l=o(e,["onMove","onKey"]),a=(0,i.useRef)(null),f=s(t),p=s(n),m=(0,i.useRef)(null),g=(0,i.useRef)(!1),v=(0,i.useMemo)(function(){var e=function(e){d(e),(u(e)?e.touches.length>0:e.buttons>0)&&a.current?f(h(a.current,e,m.current)):n(!1)},t=function(){return n(!1)};function n(n){var i=g.current,r=c(a.current),o=n?r.addEventListener:r.removeEventListener;o(i?"touchmove":"mousemove",e),o(i?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,i=a.current;if(i&&(d(t),(!g.current||u(t))&&i)){if(u(t)){g.current=!0;var r=t.changedTouches||[];r.length&&(m.current=r[0].identifier)}i.focus(),f(h(i,t,m.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),p({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]},[p,f]),b=v[0],y=v[1],w=v[2];return(0,i.useEffect)(function(){return w},[w]),i.createElement("div",r({},l,{onTouchStart:b,onMouseDown:b,className:"react-colorful__interactive",ref:a,onKeyDown:y,tabIndex:0,role:"slider"}))}),p=function(e){return e.filter(Boolean).join(" ")},m=function(e){var t=e.color,n=e.left,r=e.top,o=p(["react-colorful__pointer",e.className]);return i.createElement("div",{className:o,style:{top:100*(void 0===r?.5:r)+"%",left:100*n+"%"}},i.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},g=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},v=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?g(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?g(parseInt(e.substring(6,8),16)/255,2):1}},b=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:g(e.h),s:g(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:g(r/2),a:g(i,2)}},y=function(e){var t=b(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},w=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),s=i*(1-n),l=i*(1-(t-o)*n),a=i*(1-(1-t+o)*n),u=o%6;return{r:g(255*[i,l,s,s,a,i][u]),g:g(255*[a,i,i,l,s,s][u]),b:g(255*[s,s,a,i,i,l][u]),a:g(r,2)}},x=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},S=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r<1?x(g(255*r)):"";return"#"+x(t)+x(n)+x(i)+o},k=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),s=o-Math.min(t,n,i),l=s?o===t?(n-i)/s:o===n?2+(i-t)/s:4+(t-n)/s:0;return{h:g(60*(l<0?l+6:l)),s:g(o?s/o*100:0),v:g(o/255*100),a:r}},C=i.memo(function(e){var t=e.hue,n=e.onChange,r=p(["react-colorful__hue",e.className]);return i.createElement("div",{className:r},i.createElement(f,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:a(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":g(t),"aria-valuemax":"360","aria-valuemin":"0"},i.createElement(m,{className:"react-colorful__hue-pointer",left:t/360,color:y({h:t,s:100,v:100,a:1})})))}),M=i.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:y({h:t.h,s:100,v:100,a:1})};return i.createElement("div",{className:"react-colorful__saturation",style:r},i.createElement(f,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:a(t.s+100*e.left,0,100),v:a(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+g(t.s)+"%, Brightness "+g(t.v)+"%"},i.createElement(m,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:y(t)})))}),T=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},D="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,P=new Map,R=function(e){D(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!P.has(t)){var i=t.createElement("style");i.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}',P.set(t,i);var r=l||n.nc;r&&i.setAttribute("nonce",r),t.head.appendChild(i)}},[])},A=function(e){var t,n,l,a,u,c=e.className,h=e.colorModel,d=e.color,f=void 0===d?h.defaultColor:d,m=e.onChange,g=o(e,["className","colorModel","color","onChange"]),v=(0,i.useRef)(null);R(v);var b=(t=s(m),l=(n=(0,i.useState)(function(){return h.toHsva(f)}))[0],a=n[1],u=(0,i.useRef)({color:f,hsva:l}),(0,i.useEffect)(function(){if(!h.equal(f,u.current.color)){var e=h.toHsva(f);u.current={hsva:e,color:f},a(e)}},[f,h]),(0,i.useEffect)(function(){var e;T(l,u.current.hsva)||h.equal(e=h.fromHsva(l),u.current.color)||(u.current={hsva:l,color:e},t(e))},[l,h,t]),[l,(0,i.useCallback)(function(e){a(function(t){return Object.assign({},t,e)})},[])]),y=b[0],w=b[1],x=p(["react-colorful",c]);return i.createElement("div",r({},g,{ref:v,className:x}),i.createElement(M,{hsva:y,onChange:w}),i.createElement(C,{hue:y.h,onChange:w,className:"react-colorful__last-control"}))},O={defaultColor:"000",toHsva:function(e){return k(v(e))},fromHsva:function(e){return S(w({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||T(v(e),v(t))}},I=function(e){return i.createElement(A,r({},e,{colorModel:O}))}},83675:function(e,t,n){"use strict";let i;n.d(t,{OO:()=>tN,_n:()=>t1});var r=n(24246),o=n(54538),s=n(6085);function l(e){e()}function a(e,t){return n=>e(t(n))}function u(e){return void 0!==e}function c(){}function h(e,t){return t(e)}function d(...e){return e}function f(e,t){e(0,t)}function p(e){e(2)}function m(e){return e(4)}function g(e,t){return e(1,e=>t(0,e))}function v(e,t){let n=e(1,e=>{n(),t(e)});return n}function b(e){let t,n;return i=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{i(t)},e)}}function y(e,t){return e===t}function w(e=y){let t;return n=>i=>{e(t,i)||(t=i,n(i))}}function x(e){return t=>n=>{e(n)&&t(n)}}function S(e){return t=>a(t,e)}function k(e){return t=>()=>{t(e)}}function C(e,...t){let n=function(...e){return t=>e.reduceRight(h,t)}(...t);return(t,i)=>{switch(t){case 2:p(e);return;case 1:return e(1,n(i))}}}function M(e,t){return n=>i=>{n(t=e(t,i))}}function T(e){return t=>n=>{e>0?e--:t(n)}}function D(e){let t=null,n;return i=>r=>{t=r,n||(n=setTimeout(()=>{n=void 0,i(t)},e))}}function P(...e){let t=Array(e.length),n=0,i=null,r=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{let s=Math.pow(2,o);e(1,e=>{let l=n;n|=s,t[o]=e,l!==r&&n===r&&i&&(i(),i=null)})}),e=>o=>{let s=()=>{e([o].concat(t))};n===r?s():i=s}}function R(e){let t=e,n=O();return(e,i)=>{switch(e){case 0:t=i;break;case 1:i(t);break;case 4:return t}return n(e,i)}}function A(e,t){var n;return g(e,n=R(t)),n}function O(){let e=[];return(t,n)=>{switch(t){case 0:e.slice().forEach(e=>{e(n)});return;case 2:e.splice(0,e.length);return;case 1:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function I(e){var t;return g(e,t=O()),t}function E(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:L(),singleton:n}}let L=()=>Symbol();function B(...e){let t=O(),n=Array(e.length),i=0,r=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{let s=Math.pow(2,o);e(1,e=>{n[o]=e,(i|=s)===r&&t(0,n)})}),function(e,o){switch(e){case 2:p(t);return;case 1:return i===r&&o(n),t(1,o)}}}function Z(e,t=y){return C(e,w(t))}function F(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(l)}}(...e.map(e=>e(1,n)))}}}var V=((i=V||{})[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i);let N={0:"debug",3:"error",1:"log",2:"warn"},j=()=>typeof globalThis>"u"?window:globalThis,H=E(()=>{let e=R(3);return{log:R((t,n,i=1)=>{var r;i>=(null!=(r=j().VIRTUOSO_LOG_LEVEL)?r:m(e))&&console[N[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function z(e,t,n){return $(e,t,n).callbackRef}function $(e,t,n){let i=o.useRef(null),r=e=>{};if("u">typeof ResizeObserver){let s=o.useMemo(()=>new ResizeObserver(t=>{let i=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?i():requestAnimationFrame(i)}),[e]);r=e=>{e&&t?(s.observe(e),i.current=e):(i.current&&s.unobserve(i.current),i.current=null)}}return{callbackRef:r,ref:i}}function W(e,t,n,i,r,s,l,a,u){return $(o.useCallback(n=>{let o=function(e,t,n,i){let r=e.length;if(0===r)return null;let o=[];for(let s=0;s<r;s++){let r=e.item(s);if(void 0===r.dataset.index)continue;let l=parseInt(r.dataset.index),a=parseFloat(r.dataset.knownSize),u=t(r,n);if(0===u&&i("Zero-sized element, this should not happen",{child:r},V.ERROR),u===a)continue;let c=o[o.length-1];0===o.length||c.size!==u||c.endIndex!==l-1?o.push({endIndex:l,size:u,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,a?"offsetWidth":"offsetHeight",r),u=n.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;let c="window"===u.lastElementChild.dataset.viewportType,h=l?a?l.scrollLeft:l.scrollTop:c?a?window.pageXOffset||document.documentElement.scrollLeft:window.pageYOffset||document.documentElement.scrollTop:a?u.scrollLeft:u.scrollTop;i({scrollHeight:l?a?l.scrollWidth:l.scrollHeight:c?a?document.documentElement.scrollWidth:document.documentElement.scrollHeight:a?u.scrollWidth:u.scrollHeight,scrollTop:Math.max(h,0),viewportHeight:l?a?l.offsetWidth:l.offsetHeight:c?a?window.innerWidth:window.innerHeight:a?u.offsetWidth:u.offsetHeight}),null==s||s(a?_("column-gap",getComputedStyle(n).columnGap,r):_("row-gap",getComputedStyle(n).rowGap,r)),null!==o&&e(o)},[e,t,r,s,l,i]),n,u)}function _(e,t,n){return"normal"===t||null!=t&&t.endsWith("px")||n(`${e} was not resolved to pixel value correctly`,t,V.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function q(e,t,n){let i=o.useRef(null),r=o.useCallback(n=>{let r,o;if(!(null!=n&&n.offsetParent))return;let s=n.getBoundingClientRect(),l=s.width;if(t){let e=t.getBoundingClientRect(),n=s.top-e.top;o=e.height-Math.max(0,n),r=n+t.scrollTop}else o=window.innerHeight-Math.max(0,s.top),r=s.top+window.pageYOffset;i.current={offsetTop:r,visibleHeight:o,visibleWidth:l},e(i.current)},[e,t]),{callbackRef:s,ref:l}=$(r,!0,n),a=o.useCallback(()=>{r(l.current)},[r,l]);return o.useEffect(()=>{if(!t)return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)};{t.addEventListener("scroll",a);let e=new ResizeObserver(()=>{requestAnimationFrame(a)});return e.observe(t),()=>{t.removeEventListener("scroll",a),e.unobserve(t)}}},[a,t]),s}let G=E(()=>{let e=O(),t=O(),n=R(0),i=O(),r=R(0),o=O(),s=O(),l=R(0),a=R(0),u=R(0),c=R(0),h=O(),d=O(),f=R(!1),p=R(!1),m=R(!1);return g(C(e,S(({scrollTop:e})=>e)),t),g(C(e,S(({scrollHeight:e})=>e)),s),g(t,r),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:a,footerHeight:c,headerHeight:l,horizontalDirection:p,scrollBy:d,scrollContainerState:e,scrollHeight:s,scrollingInProgress:f,scrollTo:h,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:i,statefulScrollTop:r,viewportHeight:o}},[],{singleton:!0}),U={lvl:0};function K(e,t){let n=e.length;if(0===n)return[];let{index:i,value:r}=t(e[0]),o=[];for(let s=1;s<n;s++){let{index:n,value:l}=t(e[s]);o.push({end:n-1,start:i,value:r}),i=n,r=l}return o.push({end:1/0,start:i,value:r}),o}function Y(e){return e===U}function J(e,t){if(!Y(e))return t===e.k?e.v:t<e.k?J(e.l,t):J(e.r,t)}function X(e,t,n="k"){if(Y(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let i=X(e.r,t,n);return i[0]===-1/0?[e.k,e.v]:i}return X(e.l,t,n)}function Q(e,t,n){return Y(e)?eo(t,n,1):t===e.k?ei(e,{k:t,v:n}):t<e.k?el(es(ei(e,{l:Q(e.l,t,n)}))):el(es(ei(e,{r:Q(e.r,t,n)})))}function ee(e,t,n){if(Y(e))return[];let i=X(e,t)[0];return K(function e(t,n,i){if(Y(t))return[];let{k:r,l:o,r:s,v:l}=t,a=[];return r>n&&(a=a.concat(e(o,n,i))),r>=n&&r<=i&&a.push({k:r,v:l}),r<=i&&(a=a.concat(e(s,n,i))),a}(e,i,n),({k:e,v:t})=>({index:e,value:t}))}function et(e){return Y(e)?[]:[...et(e.l),{k:e.k,v:e.v},...et(e.r)]}function en(e){let{l:t,lvl:n,r:i}=e;if(i.lvl>=n-1&&t.lvl>=n-1)return e;if(n>i.lvl+1){if(er(t))return es(ei(e,{lvl:n-1}));if(!Y(t)&&!Y(t.r))return ei(t.r,{l:ei(t,{r:t.r.l}),lvl:n,r:ei(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(er(e))return el(ei(e,{lvl:n-1}));if(Y(i)||Y(i.l))throw Error("Unexpected empty nodes");{let t=i.l,r=er(t)?i.lvl-1:i.lvl;return ei(t,{l:ei(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:el(ei(i,{l:t.r,lvl:r}))})}}function ei(e,t){return eo(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function er(e){return Y(e)||e.lvl>e.r.lvl}function eo(e,t,n,i=U,r=U){return{k:e,l:i,lvl:n,r,v:t}}function es(e){let{l:t}=e;return Y(t)||t.lvl!==e.lvl?e:ei(t,{r:ei(e,{l:t.r})})}function el(e){let{lvl:t,r:n}=e;return Y(n)||Y(n.r)||n.lvl!==t||n.r.lvl!==t?e:ei(n,{l:ei(e,{r:n.l}),lvl:t+1})}function ea(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function eu(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let ec=E(()=>({recalcInProgress:R(!1)}),[],{singleton:!0});function eh(e,t,n,i=0){let r=e.length-1;for(;i<=r;){let o=Math.floor((i+r)/2),s=n(e[o],t);if(0===s)return o;if(-1===s){if(r-i<2)return o-1;r=o-1}else{if(r===i)return o;i=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function ed(e,t){return Math.round(e.getBoundingClientRect()[t])}function ef(e){return!Y(e.groupOffsetTree)}function ep({index:e},t){return t===e?0:t<e?-1:1}function em({offset:e},t){return t===e?0:t<e?-1:1}function eg(e,t,n){if(0===t.length)return 0;let{index:i,offset:r,size:o}=t[eh(t,e,ep)],s=e-i,l=o*s+(s-1)*n+r;return l>0?l+n:l}function ev(e,t){if(!ef(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function eb(e,t,n){if("u">typeof e.groupIndex)return t.groupIndices[e.groupIndex]+1;{let i=ev("LAST"===e.index?n:e.index,t);return Math.max(0,i,Math.min(n,i))}}function ey(e,[t,n,i,r]){t.length>0&&i("received item sizes",t,V.DEBUG);let o=e.sizeTree,s=o,l=0;if(n.length>0&&Y(o)&&2===t.length){let e=t[0].size,i=t[1].size;s=n.reduce((t,n)=>Q(Q(t,n,e),n+1,i),s)}else[s,l]=function(e,t){let n=Y(e)?0:1/0;for(let i of t){let{endIndex:t,size:r,startIndex:o}=i;if(n=Math.min(n,o),Y(e)){e=Q(e,0,r);continue}let s=ee(e,o-1,t+1);if(s.some(function(e){let{endIndex:t,size:n,startIndex:i}=e;return e=>e.start===i&&(e.end===t||e.end===1/0)&&e.value===n}(i)))continue;let l=!1,a=!1;for(let{end:n,start:i,value:o}of s)l?(t>=i||r===o)&&(e=function e(t,n){if(Y(t))return U;let{k:i,l:r,r:o}=t;if(n!==i)return n<i?en(ei(t,{l:e(r,n)})):en(ei(t,{r:e(o,n)}));if(Y(r))return o;if(Y(o))return r;{let[e,n]=function e(t){return Y(t.r)?[t.k,t.v]:e(t.r)}(r);return en(ei(t,{k:e,l:function e(t){return Y(t.r)?t.l:en(ei(t,{r:e(t.r)}))}(r),v:n}))}}(e,i)):(a=o!==r,l=!0),n>t&&t>=i&&o!==r&&(e=Q(e,t+1,o));a&&(e=Q(e,o,r))}return[e,n]}(s,t);if(s===o)return e;let{lastIndex:a,lastOffset:u,lastSize:c,offsetTree:h}=ex(e.offsetTree,l,s,r);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>Q(e,t,eg(t,h,r)),U),lastIndex:a,lastOffset:u,lastSize:c,offsetTree:h,sizeTree:s}}function ew(e,t){let n=0,i=0;for(;n<e;)n+=t[i+1]-t[i]-1,i++;return i-+(n!==e)}function ex(e,t,n,i){let r=e,o=0,s=0,l=0,a=0;if(0!==t){a=eh(r,t-1,ep),l=r[a].offset;let e=X(n,t-1);o=e[0],s=e[1],r.length&&r[a].size===X(n,t)[1]&&(a-=1),r=r.slice(0,a+1)}else r=[];for(let{start:e,value:a}of ee(n,t,1/0)){let t=e-o,n=t*s+l+t*i;r.push({index:e,offset:n,size:a}),o=e,l=n,s=a}return{lastIndex:o,lastOffset:l,lastSize:s,offsetTree:r}}function eS(e){return{index:e.index,value:e}}let ek={offsetHeight:"height",offsetWidth:"width"},eC=E(([{log:e},{recalcInProgress:t}])=>{let n=O(),i=O(),r=A(i,0),o=O(),s=O(),l=R(0),a=R([]),u=R(void 0),c=R(void 0),h=R((e,t)=>ed(e,ek[t])),d=R(void 0),f=R(0),p={groupIndices:[],groupOffsetTree:U,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:U},v=A(C(n,P(a,e,f),M(ey,p),w()),p),b=A(C(a,w(),M((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),S(({prev:e})=>e)),[]);g(C(a,x(e=>e.length>0),P(v,f),S(([e,t,n])=>{let i=e.reduce((e,i,r)=>Q(e,i,eg(i,t.offsetTree,n)||r),U);return{...t,groupIndices:e,groupOffsetTree:i}})),v),g(C(i,P(v),x(([e,{lastIndex:t}])=>e<t),S(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),g(u,c);let y=A(C(u,S(e=>void 0===e)),!0);g(C(c,x(e=>void 0!==e&&Y(m(v).sizeTree)),S(e=>[{endIndex:0,size:e,startIndex:0}])),n);let k=I(C(n,P(v),M(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:p}),S(e=>e.changed)));C(l,M((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),S(e=>e.diff))(1,e=>{let{groupIndices:n}=m(v);if(e>0)t(0,!0),o(0,e+ew(e,n));else if(e<0){let t=m(b);t.length>0&&(e-=ew(-e,t)),s(0,e)}}),C(l,P(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:l},V.ERROR)});let T=I(o);g(C(o,P(v),S(([e,t])=>{let n=t.groupIndices.length>0,i=[],r=t.lastSize;if(n){let n=J(t.sizeTree,0),o=0,s=0;for(;o<e;){let e=t.groupIndices[s],l=t.groupIndices.length===s+1?1/0:t.groupIndices[s+1]-e-1;i.push({endIndex:e,size:n,startIndex:e}),i.push({endIndex:e+1+l-1,size:r,startIndex:e+1}),s++,o+=l+1}let l=et(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:i})=>{let r=t.ranges;return 0!==t.prevSize&&(r=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:i,ranges:r}},{prevIndex:e,prevSize:0,ranges:i}).ranges}return et(t.sizeTree).reduce((t,{k:n,v:i})=>({prevIndex:n+e,prevSize:i,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:r,ranges:[]}).ranges})),n);let D=I(C(s,P(v,f),S(([e,{offsetTree:t},n])=>eg(-e,t,n))));return g(C(s,P(v,f),S(([e,t,n])=>{if(t.groupIndices.length>0){if(Y(t.sizeTree))return t;let i=U,r=m(b),o=0,s=0,l=0;for(;o<-e;){l=r[s];let e=r[s+1]-l-1;s++,o+=e+1}return i=et(t.sizeTree).reduce((t,{k:n,v:i})=>Q(t,Math.max(0,n+e),i),i),o!==-e&&(i=Q(i,0,J(t.sizeTree,l)),i=Q(i,1,X(t.sizeTree,-e+1)[1])),{...t,sizeTree:i,...ex(t.offsetTree,0,i,n)}}{let i=et(t.sizeTree).reduce((t,{k:n,v:i})=>Q(t,Math.max(0,n+e),i),U);return{...t,sizeTree:i,...ex(t.offsetTree,0,i,n)}}})),v),{beforeUnshiftWith:T,data:d,defaultItemSize:c,firstItemIndex:l,fixedItemSize:u,gap:f,groupIndices:a,itemSize:h,listRefresh:k,shiftWith:s,shiftWithOffset:D,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:i,trackItemSizes:y,unshiftWith:o}},d(H,ec),{singleton:!0});function eM(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let eT=E(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:i,scrollTop:r}])=>{let o=O(),s=O(),l=I(C(o,S(eM)));return g(C(l,S(e=>e.totalCount)),n),g(C(l,S(e=>e.groupIndices)),e),g(C(B(r,t,i),x(([e,t])=>ef(t)),S(([e,t,n])=>X(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),w(),S(e=>[e])),s),{groupCounts:o,topItemsIndexes:s}},d(eC,G)),eD=E(([{log:e}])=>{let t=R(!1),n=I(C(t,x(e=>e),w()));return t(1,t=>{t&&m(e)("props updated",{},V.DEBUG)}),{didMount:n,propsReady:t}},d(H),{singleton:!0}),eP="u">typeof document&&"scrollBehavior"in document.documentElement.style;function eR(e){let t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),t.behavior&&eP||(t.behavior="auto"),t.offset||(t.offset=0),t}let eA=E(([{gap:e,listRefresh:t,sizes:n,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:o,footerHeight:s,headerHeight:l,scrollingInProgress:a,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:h},{log:d}])=>{let f=O(),p=O(),m=R(0),b=null,y=null,w=null;function x(){b&&(b(),b=null),w&&(w(),w=null),y&&(clearTimeout(y),y=null),a(0,!1)}return g(C(f,P(n,h,i,m,l,s,d),P(e,o,r),S(([[e,n,i,r,o,s,l,u],h,d,m])=>{let g=eR(e),{align:S,behavior:k,offset:M}=g,T=r-1,D=eb(g,n,T),P=eg(D,n.offsetTree,h)+s;"end"===S?(P+=d+X(n.sizeTree,D)[1]-i+m,D===T&&(P+=l)):"center"===S?P+=(d+X(n.sizeTree,D)[1]-i+m)/2:P-=o,M&&(P+=M);let R=t=>{x(),t?(u("retrying to scroll to",{location:e},V.DEBUG),f(0,e)):(p(0,!0),u("list did not change, scroll successful",{},V.DEBUG))};if(x(),"smooth"===k){let e=!1;w=t(1,t=>{e=e||t}),b=v(c,()=>{R(e)})}else b=v(C(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),R);return y=setTimeout(()=>{x()},1200),a(0,!0),u("scrolling from index to",{behavior:k,index:D,top:P},V.DEBUG),{behavior:k,top:P}})),u),{scrollTargetReached:p,scrollToIndex:f,topListHeight:m}},d(eC,G,H),{singleton:!0});function eO(e,t){0==e?t():requestAnimationFrame(()=>{eO(e-1,t)})}function eI(e,t){return"number"==typeof e?e:"LAST"===e.index?t-1:e.index}let eE=E(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:i},{scrollTargetReached:r,scrollToIndex:o},{didMount:s}])=>{let l=R(!0),a=R(0),c=R(!0);return g(C(s,P(a),x(([e,t])=>!!t),k(!1)),l),g(C(s,P(a),x(([e,t])=>!!t),k(!1)),c),C(B(t,s),P(l,n,e,c),x(([[,e],t,{sizeTree:n},i,r])=>e&&(!Y(n)||u(i))&&!t&&!r),P(a))(1,([,e])=>{v(r,()=>{c(0,!0)}),eO(4,()=>{v(i,()=>{l(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:a,scrolledToInitialItem:l}},d(eC,G,eA,eD),{singleton:!0});function eL(e,t){return 1.01>Math.abs(e-t)}let eB="down",eZ={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},eF=E(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:i,scrollTop:r,viewportHeight:o}])=>{let s=R(!1),l=R(!0),a=O(),u=O(),c=R(4),h=R(0),d=A(C(F(C(Z(r),T(1),k(!0)),C(Z(r),T(1),k(!1),b(100))),w()),!1),f=A(C(F(C(n,k(!0)),C(n,k(!1),b(200))),w()),!1);g(C(B(Z(r),Z(h)),S(([e,t])=>e<=t),w()),l),g(C(l,D(50)),u);let p=I(C(B(i,Z(o),Z(t),Z(e),Z(c)),M((e,[{scrollHeight:t,scrollTop:n},i,r,o,s])=>{let l;let a={scrollHeight:t,scrollTop:n,viewportHeight:i};if(n+i-t>-s){let t,i;return n>e.state.scrollTop?(t="SCROLLED_DOWN",i=e.state.scrollTop-n):(t="SIZE_DECREASED",i=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:i,state:a}}return{atBottom:!1,notAtBottomBecause:a.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":i<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:a}},eZ),w((e,t)=>e&&e.atBottom===t.atBottom))),v=A(C(i,M((e,{scrollHeight:t,scrollTop:n,viewportHeight:i})=>{if(eL(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{let r=t-(n+i)<1;return e.scrollTop!==n&&r?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),x(e=>e.changed),S(e=>e.jump)),0);g(C(p,S(e=>e.atBottom)),s),g(C(s,D(50)),a);let y=R(eB);g(C(i,S(({scrollTop:e})=>e),w(),M((e,t)=>m(f)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":eB,prevScrollTop:t},{direction:eB,prevScrollTop:0}),S(e=>e.direction)),y),g(C(i,D(50),k("none")),y);let E=R(0);return g(C(d,x(e=>!e),k(0)),E),g(C(r,D(100),P(d),x(([e,t])=>!!t),M(([e,t],[n])=>[t,n],[0,0]),S(([e,t])=>t-e)),E),{atBottomState:p,atBottomStateChange:a,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:h,isAtBottom:s,isAtTop:l,isScrolling:d,lastJumpDueToItemResize:v,scrollDirection:y,scrollVelocity:E}},d(G)),eV="bottom",eN="none";function ej(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===eB&&t===eV?e:0:"up"===n?"top"===t?e.main:e.reverse:t===eV?e.main:e.reverse}function eH(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}let ez=E(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:i,viewportHeight:r}])=>{let o=O(),s=R(0),l=R(0),a=R(0),u=A(C(B(Z(i),Z(r),Z(n),Z(o,eu),Z(a),Z(s),Z(t),Z(e),Z(l)),S(([e,t,n,[i,r],o,s,l,a,u])=>{let c=e-a,h=Math.max(n-c,0),d=eN,f=eH(u,"top"),p=eH(u,eV);return i-=a,i+=n+l,r+=n+l,i>e+(s+l)-f&&(d="up"),(r-=a)<e-h+t+p&&(d=eB),d!==eN?[Math.max(c-n-ej(o,"top",d)-f,0),c-h-l+t+ej(o,eV,d)+p]:null}),x(e=>null!=e),w(eu)),[0,0]);return{increaseViewportBy:l,listBoundary:o,overscan:a,topListHeight:s,visibleRange:u}},d(G),{singleton:!0}),e$={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function eW(e,t,n,i,r,o){let{lastIndex:s,lastOffset:l,lastSize:a}=r,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=l+h*a+(h-1)*i-c;return{bottom:c,firstItemIndex:o,items:eq(e,r,o),offsetBottom:f,offsetTop:u,top:d,topItems:eq(t,r,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function e_(e,t,n,i,r,o){let s=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-s>=e)break;s++}let l=e+s,a=eI(t,l);return eW(Array.from({length:l}).map((e,t)=>({data:o[t+a],index:t+a,offset:0,size:0})),[],l,r,n,i)}function eq(e,t,n){if(0===e.length)return[];if(!ef(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let i=e[0].index,r=e[e.length-1].index,o=[],s=ee(t.groupOffsetTree,i,r),l,a=0;for(let i of e){let e;(!l||l.end<i.index)&&(l=s.shift(),a=t.groupIndices.indexOf(l.start)),e=i.index===l.start?{index:a,type:"group"}:{groupIndex:a,index:i.index-(a+1)+n},o.push({...e,data:i.data,offset:i.offset,originalIndex:i.index,size:i.size})}return o}let eG=E(([{data:e,firstItemIndex:t,gap:n,sizes:i,totalCount:r},o,{listBoundary:s,topListHeight:l,visibleRange:a},{initialTopMostItemIndex:c,scrolledToInitialItem:h},{topListHeight:d},f,{didMount:p},{recalcInProgress:v}])=>{let b=R([]),y=R(0),k=O();g(o.topItemsIndexes,b);let M=A(C(B(p,v,Z(a,eu),Z(r),Z(i),Z(c),h,Z(b),Z(t),Z(n),e),x(([e,t,,n,,,,,,,i])=>{let r=i&&i.length!==n;return e&&!t&&!r}),S(([,,[e,t],n,i,r,o,s,l,a,u])=>{var c;let{offsetTree:h,sizeTree:d}=i,f=m(y);if(0===n)return{...e$,totalCount:n};if(0===e&&0===t)return 0===f?{...e$,totalCount:n}:e_(f,r,i,l,a,u||[]);if(Y(d))return f>0?null:eW(function(e,t,n){if(ef(t)){let i=ev(e,t);return[{index:X(t.groupOffsetTree,i)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:i,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(eI(r,n),i,u),[],n,a,i,l);let p=[];if(s.length>0){let e=s[0],t=s[s.length-1],n=0;for(let i of ee(d,e,t)){let r=i.value,o=Math.max(i.start,e),s=Math.min(i.end,t);for(let e=o;e<=s;e++)p.push({data:null==u?void 0:u[e],index:e,offset:n,size:r}),n+=r}}if(!o)return eW([],p,n,a,i,l);let g=s.length>0?s[s.length-1]+1:0,v=function(e,t,n,i=0){return i>0&&(t=Math.max(t,e[eh(e,i,ep)].offset)),K(function(e,t,n,i){let r=eh(e,t,i),o=eh(e,n,i,r);return e.slice(r,o+1)}(e,t,n,em),eS)}(h,e,t,g);if(0===v.length)return null;let b=n-1;return eW(((n=>{for(let i of v){let r=i.value,o=r.offset,s=i.start,l=r.size;if(r.offset<e){let t=(s+=Math.floor((e-r.offset+a)/(l+a)))-i.start;o+=t*l+t*a}s<g&&(o+=(g-s)*l,s=g);let c=Math.min(i.end,b);for(let e=s;e<=c&&!(o>=t);e++)n.push({data:null==u?void 0:u[e],index:e,offset:o,size:l}),o+=l+a}})(c=[]),c),p,n,a,i,l)}),x(e=>null!==e),w()),e$);g(C(e,x(u),S(e=>null==e?void 0:e.length)),r),g(C(M,S(e=>e.topListHeight)),d),g(d,l),g(C(M,S(e=>[e.top,e.bottom])),s),g(C(M,S(e=>e.items)),k);let T=I(C(M,x(({items:e})=>e.length>0),P(r,e),x(([{items:e},t])=>e[e.length-1].originalIndex===t-1),S(([,e,t])=>[e-1,t]),w(eu),S(([e])=>e))),E=I(C(M,D(200),x(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),S(({items:e})=>e[0].index),w())),L=I(C(M,x(({items:e})=>e.length>0),S(({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}}),w(ea)));return{endReached:T,initialItemCount:y,itemsRendered:k,listState:M,rangeChanged:L,startReached:E,topItemsIndexes:b,...f}},d(eC,eT,ez,eE,eA,eF,eD,ec),{singleton:!0}),eU=E(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:i},{listState:r}])=>{let o=O(),s=A(C(B(n,e,i,t,r),S(([e,t,n,i,r])=>e+t+n+i+r.offsetBottom+r.bottom)),0);return g(Z(s),o),{totalListHeight:s,totalListHeightChanged:o}},d(G,eG),{singleton:!0}),eK=E(([{viewportHeight:e},{totalListHeight:t}])=>{let n=R(!1),i=A(C(B(n,e,t),x(([e])=>e),S(([,e,t])=>Math.max(0,e-t)),D(0),w()),0);return{alignToBottom:n,paddingTopAddition:i}},d(G,eU),{singleton:!0});function eY(e){return!!e&&("smooth"===e?"smooth":"auto")}let eJ=(e,t)=>"function"==typeof e?eY(e(t)):t&&eY(e),eX=E(([{listRefresh:e,totalCount:t},{atBottomState:n,isAtBottom:i},{scrollToIndex:r},{scrolledToInitialItem:o},{didMount:s,propsReady:l},{log:a},{scrollingInProgress:u}])=>{let c=R(!1),h=O(),d=null;function f(e){r(0,{align:"end",behavior:e,index:"LAST"})}function p(e){setTimeout(v(n,t=>{!e||t.atBottom||"SIZE_INCREASED"!==t.notAtBottomBecause||d||(m(a)("scrolling to bottom due to increased size",{},V.DEBUG),f("auto"))}),100)}return C(B(C(Z(t),T(1)),s),P(Z(c),i,o,u),S(([[e,t],n,i,r,o])=>{let s=t&&r,l="auto";return s&&(l=eJ(n,i||o),s=s&&!!l),{followOutputBehavior:l,shouldFollow:s,totalCount:e}}),x(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:n})=>{d&&(d(),d=null),d=v(e,()=>{m(a)("following output to ",{totalCount:n},V.DEBUG),f(t),d=null})}),C(B(Z(c),t,l),x(([e,,t])=>e&&t),M(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),x(({refreshed:e})=>e),P(c,t))(1,([,e])=>{m(o)&&p(!1!==e)}),h(1,()=>{p(!1!==m(c))}),B(Z(c),n)(1,([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&f("auto")}),{autoscrollToBottom:h,followOutput:c}},d(eC,eF,eA,eE,eD,H,G)),eQ=E(([{data:e,firstItemIndex:t,gap:n,sizes:i},{initialTopMostItemIndex:r},{initialItemCount:o,listState:s},{didMount:l}])=>(g(C(l,P(o),x(([,e])=>0!==e),P(r,i,t,n,e),S(([[,e],t,n,i,r,o=[]])=>e_(e,t,n,i,r,o))),s),{}),d(eC,eE,eG,eD),{singleton:!0}),e0=E(([{didMount:e},{scrollTo:t},{listState:n}])=>{let i=R(0);return C(e,P(i),x(([,e])=>0!==e),S(([,e])=>({top:e})))(1,e=>{v(C(n,T(1),x(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:i}},d(eD,G,eG),{singleton:!0}),e1=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:i,...r},viewportBottom:o,viewportTop:s})=>t<s?{...r,align:null!=n?n:"start",behavior:i}:e>o?{...r,align:null!=n?n:"end",behavior:i}:null,e2=E(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:r,headerHeight:o,scrollingInProgress:s,scrollTop:l,viewportHeight:a},{scrollToIndex:u}])=>{let c=O();return g(C(c,P(t,a,n,o,r,i,l),P(e),S(([[e,t,n,i,r,o,l,a],u])=>{let{align:c,behavior:h,calculateViewLocation:d=e1,done:f,...p}=e,g=eb(e,t,i-1),b=eg(g,t.offsetTree,u)+r+o,y=d({itemBottom:b+X(t.sizeTree,g)[1],itemTop:b,locationParams:{align:c,behavior:h,...p},viewportBottom:a+n-l,viewportTop:a+o});return y?f&&v(C(s,x(e=>!e),T(m(s)?1:2)),f):f&&f(),y}),x(e=>null!==e)),u),{scrollIntoView:c}},d(eC,G,eA,eG,H),{singleton:!0}),e5=E(([{scrollVelocity:e}])=>{let t=R(!1),n=O(),i=R(!1);return g(C(e,P(i,t,n),x(([e,t])=>!!t),S(([e,t,n,i])=>{let{enter:r,exit:o}=t;if(n){if(o(e,i))return!1}else if(r(e,i))return!0;return n}),w()),t),C(B(t,e,n),P(i))(1,([[e,t,n],i])=>{e&&i&&i.change&&i.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:e}},d(eF),{singleton:!0}),e3=E(([{scrollContainerState:e,scrollTo:t}])=>{let n=O(),i=O(),r=O(),o=R(!1),s=R(void 0);return g(C(B(n,i),S(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:i}])=>({scrollHeight:e,scrollTop:Math.max(0,t-i),viewportHeight:n}))),e),g(C(t,P(i),S(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),r),{customScrollParent:s,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:i}},d(G)),e4=E(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:s,windowScrollContainerState:l,windowViewportRect:a}])=>{let c=O(),h=R(void 0),d=R(null),f=R(null);return g(l,d),g(a,f),C(c,P(t,i,s,d,f,n))(1,([e,t,n,i,r,o,s])=>{let l=et(t.sizeTree).map(({k:e,v:t},n,i)=>{let r=i[n+1];return{endIndex:r?r.k-1:1/0,size:t,startIndex:e}});i&&null!==r&&null!==o&&(n=r.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=s})}),g(C(h,x(u),S(e8)),r),g(C(o,P(h),x(([,e])=>void 0!==e),w(),S(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:h}},d(eC,G,eE,eD,e3));function e8(e){return{align:"start",index:0,offset:e.scrollTop}}let e9=E(([{topItemsIndexes:e}])=>{let t=R(0);return g(C(t,x(e=>e>=0),S(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},d(eG));function e6(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let e7=e6(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),te=E(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:i},{isAtBottom:r,isScrolling:o,lastJumpDueToItemResize:s,scrollDirection:l},{listState:a},{beforeUnshiftWith:u,gap:c,shiftWithOffset:h,sizes:d},{log:f},{recalcInProgress:p}])=>{let m=I(C(a,P(s),M(([,e,t,n],[{bottom:i,items:r,offsetBottom:o,totalCount:s},l])=>{let a=i+o,u=0;return t===s&&e.length>0&&r.length>0&&(0===r[0].originalIndex&&0===e[0].originalIndex||0!=(u=a-n)&&(u+=l)),[u,r,s,a]},[0,[],0,0]),x(([e])=>0!==e),P(i,l,n,r,f,p),x(([,e,t,n,,,i])=>!i&&!n&&0!==e&&"up"===t),S(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},V.DEBUG),e))));function v(n){var i,r;n>0?(t(0,{behavior:"auto",top:-n}),i=0,e(0,0)):(r=0,e(0,0),t(0,{behavior:"auto",top:-n}))}return C(m,P(e,o))(1,([t,n,i])=>{i&&e7()?e(0,n-t):v(-t)}),C(B(A(o,!1),e,p),x(([e,t,n])=>!e&&!n&&0!==t),S(([e,t])=>t),D(1))(1,v),g(C(h,S(e=>({top:-e}))),t),C(u,P(d,c),S(([e,{groupIndices:t,lastSize:n,sizeTree:i},r])=>{if(0===t.length)return e*(n+r);{let o=0,s=J(i,0),l=0,a=0;for(;l<e;){l++,o+=s;let i=t.length===a+1?1/0:t[a+1]-t[a]-1;l+i>e&&(o-=s,i=e-l+1),l+=i,o+=i*(n+r),a++}return o}}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{var t;t=0,e(0,0),p(0,!1)})})}),{deviation:e}},d(G,eF,eG,eC,H,ec)),tt=E(([e,t,n,i,r,o,s,l,a,u])=>({...e,...t,...n,...i,...r,...o,...s,...l,...a,...u}),d(ez,eQ,eD,e5,eU,e0,eK,e3,e2,H)),tn=E(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:i,gap:r,groupIndices:o,itemSize:s,sizeRanges:l,sizes:a,statefulTotalCount:u,totalCount:c,trackItemSizes:h},{initialItemFinalLocationReached:d,initialTopMostItemIndex:f,scrolledToInitialItem:p},m,v,b,{listState:y,topItemsIndexes:w,...x},{scrollToIndex:k},M,{topItemCount:T},{groupCounts:D},P])=>(g(x.rangeChanged,P.scrollSeekRangeChanged),g(C(P.windowViewportRect,S(e=>e.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:i,gap:r,groupCounts:D,initialItemFinalLocationReached:d,initialTopMostItemIndex:f,scrolledToInitialItem:p,sizeRanges:l,topItemCount:T,topItemsIndexes:w,totalCount:c,...b,groupIndices:o,itemSize:s,listState:y,scrollToIndex:k,statefulTotalCount:u,trackItemSizes:h,...x,...P,...m,sizes:a,...v}),d(eC,eE,G,e4,eX,eG,eA,te,e9,eT,tt)),ti="u">typeof document?o.useLayoutEffect:o.useEffect;function tr(e,t,n){let i=Object.keys(t.required||{}),s=Object.keys(t.optional||{}),l=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),u=o.createContext({});function h(e,n){var r,o,l,a;for(let s of(e.propsReady&&(r=e.propsReady,r(0,!1)),i)){o=e[t.required[s]],o(0,n[s])}for(let i of s){i in n&&(l=e[t.optional[i]],l(0,n[i]))}e.propsReady&&(a=e.propsReady,a(0,!0))}function d(e){return a.reduce((n,i)=>(n[i]=function(e){let t,n;let i=()=>null==t?void 0:t();return function(r,o){switch(r){case 1:return o?n===o?void 0:(i(),n=o,t=e(1,o)):(i(),c);case 2:i(),n=null;return}}}(e[t.events[i]]),n),{})}return{Component:o.forwardRef((c,f)=>{var m;let{children:g,...v}=c,[b]=o.useState(()=>{var t;return h(t=function(e){let t=new Map,n=({constructor:e,dependencies:i,id:r,singleton:o})=>{if(o&&t.has(r))return t.get(r);let s=e(i.map(e=>n(e)));return o&&t.set(r,s),s};return n(e)}(e),v),t}),[y]=o.useState(()=>d(b));return ti(()=>{for(let e of a)e in v&&(0,y[e])(1,v[e]);return()=>{Object.values(y).map(p)}},[v,y,b]),ti(()=>{h(b,v)}),o.useImperativeHandle(f,(m=l.reduce((e,n)=>(e[n]=e=>{var i;i=b[t.methods[n]],i(0,e)},e),{}),()=>m)),(0,r.jsx)(u.Provider,{value:b,children:n?(0,r.jsx)(n,{...function(e,t){let n={},i={},r=0,o=e.length;for(;r<o;)i[e[r]]=1,r+=1;for(let e in t)Object.hasOwn(i,e)||(n[e]=t[e]);return n}([...i,...s,...a],v),children:g}):g})}),useEmitter:(e,t)=>{let n=o.useContext(u)[e];ti(()=>n(1,t),[t,n])},useEmitterValue:o.version.startsWith("18")?e=>{let t=o.useContext(u)[e],n=o.useCallback(e=>t(1,e),[t]);return o.useSyncExternalStore(n,()=>m(t),()=>m(t))}:e=>{let t=o.useContext(u)[e],[n,i]=o.useState(()=>m(t));return ti(()=>t(1,e=>{e!==n&&i(()=>e)}),[t,n]),n},usePublisher:e=>{var t;return o.useCallback((t=o.useContext(u)[e],e=>(function(e,t){e(0,t)})(t,e)),[e])}}}let to=o.createContext(void 0),ts=o.createContext(void 0),tl="u">typeof document?o.useLayoutEffect:o.useEffect;function ta(e,t,n,i=c,r,l){let a=o.useRef(null),u=o.useRef(null),h=o.useRef(null),d=o.useCallback(n=>{let i=n.target,r=i===window||i===document,o=l?r?window.pageXOffset||document.documentElement.scrollLeft:i.scrollLeft:r?window.pageYOffset||document.documentElement.scrollTop:i.scrollTop,a=l?r?document.documentElement.scrollWidth:i.scrollWidth:r?document.documentElement.scrollHeight:i.scrollHeight,c=l?r?window.innerWidth:i.offsetWidth:r?window.innerHeight:i.offsetHeight,d=()=>{e({scrollHeight:a,scrollTop:Math.max(o,0),viewportHeight:c})};n.suppressFlushSync?d():s.flushSync(d),null!==u.current&&(o===u.current||o<=0||o===a-c)&&(u.current=null,t(!0),h.current&&(clearTimeout(h.current),h.current=null))},[e,t]);return o.useEffect(()=>{let e=r||a.current;return i(r||a.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{i(null),e.removeEventListener("scroll",d)}},[a,d,n,i,r]),{scrollByCallback:function(e){l&&(e={behavior:e.behavior,left:e.top}),a.current.scrollBy(e)},scrollerRef:a,scrollToCallback:function(n){let i,r,o;let s=a.current;if(!s||(l?"offsetWidth"in s&&0===s.offsetWidth:"offsetHeight"in s&&0===s.offsetHeight))return;let c="smooth"===n.behavior;s===window?(r=Math.max(ed(document.documentElement,l?"width":"height"),l?document.documentElement.scrollWidth:document.documentElement.scrollHeight),i=l?window.innerWidth:window.innerHeight,o=l?document.documentElement.scrollLeft:document.documentElement.scrollTop):(r=s[l?"scrollWidth":"scrollHeight"],i=ed(s,l?"width":"height"),o=s[l?"scrollLeft":"scrollTop"]);let d=r-i;if(n.top=Math.ceil(Math.max(Math.min(d,n.top),0)),eL(i,r)||n.top===o){e({scrollHeight:r,scrollTop:o,viewportHeight:i}),c&&t(!0);return}c?(u.current=n.top,h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,u.current=null,t(!0)},1e3)):u.current=null,l&&(n={behavior:n.behavior,left:n.top}),s.scrollTo(n)}}}let tu="-webkit-sticky",tc="sticky",th=e6(()=>{if(typeof document>"u")return tc;let e=document.createElement("div");return e.style.position=tu,e.style.position===tu?tu:tc});function td(e){return e}let tf=E(()=>{let e=R(e=>`Item ${e}`),t=R(null),n=R(e=>`Group ${e}`),i=R({}),r=R(td),o=R("div"),s=R(c),l=(e,t=null)=>A(C(i,S(t=>t[e]),w()),t);return{components:i,computeItemKey:r,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FooterComponent:l("Footer"),GroupComponent:l("Group","div"),groupContent:n,HeaderComponent:l("Header"),HeaderFooterTag:o,ItemComponent:l("Item","div"),itemContent:e,ListComponent:l("List","div"),ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TopItemListComponent:l("TopItemList")}}),tp=E(([e,t])=>({...e,...t}),d(tn,tf)),tm=({height:e})=>(0,r.jsx)("div",{style:{height:e}}),tg={overflowAnchor:"none",position:th(),zIndex:1},tv={overflowAnchor:"none"},tb={...tv,display:"inline-block",height:"100%"},ty=o.memo(function({showTopList:e=!1}){let t=tB("listState"),n=tZ("sizeRanges"),i=tB("useWindowScroll"),s=tB("customScrollParent"),l=tZ("windowScrollContainerState"),a=tZ("scrollContainerState"),u=tB("itemContent"),h=tB("context"),d=tB("groupContent"),f=tB("trackItemSizes"),p=tB("itemSize"),m=tB("log"),g=tZ("gap"),v=tB("horizontalDirection"),{callbackRef:b}=W(n,p,f,e?c:s||i?l:a,m,g,s,v,tB("skipAnimationFrameInResizeObserver")),[y,w]=o.useState(0);tL("deviation",e=>{y!==e&&w(e)});let x=tB("EmptyPlaceholder"),S=tB("ScrollSeekPlaceholder")||tm,k=tB("ListComponent"),C=tB("ItemComponent"),M=tB("GroupComponent"),T=tB("computeItemKey"),D=tB("isSeeking"),P=tB("groupIndices").length>0,R=tB("alignToBottom"),A=tB("initialItemFinalLocationReached"),O=e?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:0!==y?y:R?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==y?y:R?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...A?{}:{visibility:"hidden"}};return!e&&0===t.totalCount&&x?(0,r.jsx)(x,{...tC(x,h)}):(0,r.jsx)(k,{...tC(k,h),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:b,style:O,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,i=T(n+t.firstItemIndex,e.data,h);return D?(0,o.createElement)(S,{...tC(S,h),height:e.size,index:e.index,key:i,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,o.createElement)(M,{...tC(M,h),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:i,style:tg},d(e.index,h)):(0,o.createElement)(C,{...tC(C,h),...tM(C,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:i,style:v?tb:tv},P?u(e.index,e.groupIndex,e.data,h):u(e.index,e.data,h))})})}),tw={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},tx={outline:"none",overflowX:"auto",position:"relative"},tS=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),tk={position:th(),top:0,width:"100%",zIndex:1};function tC(e,t){if("string"!=typeof e)return{context:t}}function tM(e,t){return{item:"string"==typeof e?void 0:t}}let tT=o.memo(function(){let e=tB("HeaderComponent"),t=tZ("headerHeight"),n=tB("HeaderFooterTag"),i=z(o.useMemo(()=>e=>{t(ed(e,"height"))},[t]),!0,tB("skipAnimationFrameInResizeObserver")),s=tB("context");return e?(0,r.jsx)(n,{ref:i,children:(0,r.jsx)(e,{...tC(e,s)})}):null}),tD=o.memo(function(){let e=tB("FooterComponent"),t=tZ("footerHeight"),n=tB("HeaderFooterTag"),i=z(o.useMemo(()=>e=>{t(ed(e,"height"))},[t]),!0,tB("skipAnimationFrameInResizeObserver")),s=tB("context");return e?(0,r.jsx)(n,{ref:i,children:(0,r.jsx)(e,{...tC(e,s)})}):null});function tP({useEmitter:e,useEmitterValue:t,usePublisher:n}){return o.memo(function({children:i,style:o,...s}){let l=n("scrollContainerState"),a=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("scrollerRef"),h=t("context"),d=t("horizontalDirection")||!1,{scrollByCallback:f,scrollerRef:p,scrollToCallback:m}=ta(l,u,a,c,void 0,d);return e("scrollTo",m),e("scrollBy",f),(0,r.jsx)(a,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...d?tx:tw,...o},tabIndex:0,...s,...tC(a,h),children:i})})}function tR({useEmitter:e,useEmitterValue:t,usePublisher:n}){return o.memo(function({children:i,style:o,...s}){let l=n("windowScrollContainerState"),a=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),h=t("totalListHeight"),d=t("deviation"),f=t("customScrollParent"),p=t("context"),{scrollByCallback:m,scrollerRef:g,scrollToCallback:v}=ta(l,u,a,c,f);return tl(()=>(g.current=f||window,()=>{g.current=null}),[g,f]),e("windowScrollTo",v),e("scrollBy",m),(0,r.jsx)(a,{"data-virtuoso-scroller":!0,style:{position:"relative",...o,...0!==h?{height:h+d}:{}},...s,...tC(a,p),children:i})})}let tA=({children:e})=>{let t=o.useContext(to),n=tZ("viewportHeight"),i=tZ("fixedItemHeight"),s=tB("alignToBottom"),l=tB("horizontalDirection"),u=z(o.useMemo(()=>a(n,e=>ed(e,l?"width":"height")),[n,l]),!0,tB("skipAnimationFrameInResizeObserver"));return o.useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,r.jsx)("div",{"data-viewport-type":"element",ref:u,style:tS(s),children:e})},tO=({children:e})=>{let t=o.useContext(to),n=tZ("windowViewportRect"),i=tZ("fixedItemHeight"),s=q(n,tB("customScrollParent"),tB("skipAnimationFrameInResizeObserver")),l=tB("alignToBottom");return o.useEffect(()=>{t&&(i(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,r.jsx)("div",{"data-viewport-type":"window",ref:s,style:tS(l),children:e})},tI=({children:e})=>{let t=tB("TopItemListComponent")||"div",n=tB("headerHeight"),i={...tk,marginTop:`${n}px`},o=tB("context");return(0,r.jsx)(t,{style:i,...tC(t,o),children:e})},{Component:tE,useEmitter:tL,useEmitterValue:tB,usePublisher:tZ}=tr(tp,{events:{atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",endReached:"endReached",groupIndices:"groupIndices",isScrolling:"isScrolling",itemsRendered:"itemsRendered",rangeChanged:"rangeChanged",startReached:"startReached",totalListHeightChanged:"totalListHeightChanged"},methods:{autoscrollToBottom:"autoscrollToBottom",getState:"getState",scrollBy:"scrollBy",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollToIndex:"scrollToIndex"},optional:{alignToBottom:"alignToBottom",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",components:"components",computeItemKey:"computeItemKey",context:"context",customScrollParent:"customScrollParent",data:"data",defaultItemHeight:"defaultItemHeight",firstItemIndex:"firstItemIndex",fixedItemHeight:"fixedItemHeight",followOutput:"followOutput",groupContent:"groupContent",groupCounts:"groupCounts",headerFooterTag:"HeaderFooterTag",horizontalDirection:"horizontalDirection",increaseViewportBy:"increaseViewportBy",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",initialTopMostItemIndex:"initialTopMostItemIndex",itemContent:"itemContent",itemSize:"itemSize",logLevel:"logLevel",overscan:"overscan",restoreStateFrom:"restoreStateFrom",scrollerRef:"scrollerRef",scrollSeekConfiguration:"scrollSeekConfiguration",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver",topItemCount:"topItemCount",totalCount:"totalCount",useWindowScroll:"useWindowScroll"},required:{}},o.memo(function(e){let t=tB("useWindowScroll"),n=tB("topItemsIndexes").length>0,i=tB("customScrollParent"),o=tB("context"),s=i||t?tV:tF,l=i||t?tO:tA;return(0,r.jsxs)(s,{...e,...tC(s,o),children:[n&&(0,r.jsx)(tI,{children:(0,r.jsx)(ty,{showTopList:!0})}),(0,r.jsxs)(l,{children:[(0,r.jsx)(tT,{}),(0,r.jsx)(ty,{}),(0,r.jsx)(tD,{})]})]})})),tF=tP({useEmitter:tL,useEmitterValue:tB,usePublisher:tZ}),tV=tR({useEmitter:tL,useEmitterValue:tB,usePublisher:tZ}),tN=tE,tj=E(()=>{let e=R(e=>(0,r.jsxs)("td",{children:["Item $",e]})),t=R(null),n=R(null),i=R(null),o=R({}),s=R(td),l=R(c),a=(e,t=null)=>A(C(o,S(t=>t[e]),w()),t);return{components:o,computeItemKey:s,context:t,EmptyPlaceholder:a("EmptyPlaceholder"),FillerRow:a("FillerRow"),fixedFooterContent:i,fixedHeaderContent:n,itemContent:e,ScrollerComponent:a("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TableBodyComponent:a("TableBody","tbody"),TableComponent:a("Table","table"),TableFooterComponent:a("TableFoot","tfoot"),TableHeadComponent:a("TableHead","thead"),TableRowComponent:a("TableRow","tr")}}),tH=E(([e,t])=>({...e,...t}),d(tn,tj)),tz=({height:e})=>(0,r.jsx)("tr",{children:(0,r.jsx)("td",{style:{height:e}})}),t$=({height:e})=>(0,r.jsx)("tr",{children:(0,r.jsx)("td",{style:{border:0,height:e,padding:0}})}),tW={overflowAnchor:"none"},t_=o.memo(function({showTopList:e=!1}){let t=tJ("listState"),n=tJ("computeItemKey"),i=tJ("firstItemIndex"),s=tJ("isSeeking"),l=tJ("ScrollSeekPlaceholder")||tz,a=tJ("context"),u=tJ("TableRowComponent"),c=tJ("fixedHeaderHeight"),h=tJ("itemContent"),d=(e?t.topItems:[]).reduce((e,t,n)=>(0===n?e.push(t.size):e.push(e[n-1]+t.size),e),[]),f=(e?t.topItems:t.items).map(t=>{let r=t.originalIndex,f=n(r+i,t.data,a),p=e?0===r?0:d[r-1]:0;return s?(0,o.createElement)(l,{...tC(l,a),height:t.size,index:t.index,key:f,type:t.type||"item"}):(0,o.createElement)(u,{...tC(u,a),...tM(u,t.data),"data-index":r,"data-item-index":t.index,"data-known-size":t.size,key:f,style:e?{overflowAnchor:"none",position:"sticky",top:c+p,zIndex:2}:tW},h(t.index,t.data,a))});return(0,r.jsx)(r.Fragment,{children:f})}),tq=o.memo(function(){let e=tJ("listState"),t=tJ("topItemsIndexes").length>0,n=tX("sizeRanges"),i=tJ("useWindowScroll"),s=tJ("customScrollParent"),l=tX("windowScrollContainerState"),a=tX("scrollContainerState"),u=tJ("trackItemSizes"),{callbackRef:c,ref:h}=W(n,tJ("itemSize"),u,s||i?l:a,tJ("log"),void 0,s,!1,tJ("skipAnimationFrameInResizeObserver")),[d,f]=o.useState(0);tY("deviation",e=>{d!==e&&(h.current.style.marginTop=`${e}px`,f(e))});let p=tJ("EmptyPlaceholder"),m=tJ("FillerRow")||t$,g=tJ("TableBodyComponent"),v=tJ("paddingTopAddition"),b=tJ("statefulTotalCount"),y=tJ("context");if(0===b&&p)return(0,r.jsx)(p,{...tC(p,y)});let w=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),x=e.offsetTop+v+d-w,S=e.offsetBottom,k=x>0?(0,r.jsx)(m,{context:y,height:x},"padding-top"):null,C=S>0?(0,r.jsx)(m,{context:y,height:S},"padding-bottom"):null;return(0,r.jsxs)(g,{"data-testid":"virtuoso-item-list",ref:c,...tC(g,y),children:[k,t&&(0,r.jsx)(t_,{showTopList:!0}),(0,r.jsx)(t_,{}),C]})}),tG=({children:e})=>{let t=o.useContext(to),n=tX("viewportHeight"),i=tX("fixedItemHeight"),s=z(o.useMemo(()=>a(n,e=>ed(e,"height")),[n]),!0,tJ("skipAnimationFrameInResizeObserver"));return o.useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,r.jsx)("div",{"data-viewport-type":"element",ref:s,style:tS(!1),children:e})},tU=({children:e})=>{let t=o.useContext(to),n=tX("windowViewportRect"),i=tX("fixedItemHeight"),s=q(n,tJ("customScrollParent"),tJ("skipAnimationFrameInResizeObserver"));return o.useEffect(()=>{t&&(i(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,r.jsx)("div",{"data-viewport-type":"window",ref:s,style:tS(!1),children:e})},{Component:tK,useEmitter:tY,useEmitterValue:tJ,usePublisher:tX}=tr(tH,{events:{atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",endReached:"endReached",groupIndices:"groupIndices",isScrolling:"isScrolling",itemsRendered:"itemsRendered",rangeChanged:"rangeChanged",startReached:"startReached",totalListHeightChanged:"totalListHeightChanged"},methods:{getState:"getState",scrollBy:"scrollBy",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollToIndex:"scrollToIndex"},optional:{alignToBottom:"alignToBottom",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",components:"components",computeItemKey:"computeItemKey",context:"context",customScrollParent:"customScrollParent",data:"data",defaultItemHeight:"defaultItemHeight",firstItemIndex:"firstItemIndex",fixedFooterContent:"fixedFooterContent",fixedHeaderContent:"fixedHeaderContent",fixedItemHeight:"fixedItemHeight",followOutput:"followOutput",groupCounts:"groupCounts",increaseViewportBy:"increaseViewportBy",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",initialTopMostItemIndex:"initialTopMostItemIndex",itemContent:"itemContent",itemSize:"itemSize",logLevel:"logLevel",overscan:"overscan",restoreStateFrom:"restoreStateFrom",scrollerRef:"scrollerRef",scrollSeekConfiguration:"scrollSeekConfiguration",topItemCount:"topItemCount",totalCount:"totalCount",useWindowScroll:"useWindowScroll"},required:{}},o.memo(function(e){let t=tJ("useWindowScroll"),n=tJ("customScrollParent"),i=tX("fixedHeaderHeight"),s=tX("fixedFooterHeight"),l=tJ("fixedHeaderContent"),u=tJ("fixedFooterContent"),c=tJ("context"),h=z(o.useMemo(()=>a(i,e=>ed(e,"height")),[i]),!0,tJ("skipAnimationFrameInResizeObserver")),d=z(o.useMemo(()=>a(s,e=>ed(e,"height")),[s]),!0,tJ("skipAnimationFrameInResizeObserver")),f=n||t?t0:tQ,p=n||t?tU:tG,m=tJ("TableComponent"),g=tJ("TableHeadComponent"),v=tJ("TableFooterComponent"),b=l?(0,r.jsx)(g,{ref:h,style:{position:"sticky",top:0,zIndex:2},...tC(g,c),children:l()},"TableHead"):null,y=u?(0,r.jsx)(v,{ref:d,style:{bottom:0,position:"sticky",zIndex:1},...tC(v,c),children:u()},"TableFoot"):null;return(0,r.jsx)(f,{...e,...tC(f,c),children:(0,r.jsx)(p,{children:(0,r.jsxs)(m,{style:{borderSpacing:0,overflowAnchor:"none"},...tC(m,c),children:[b,(0,r.jsx)(tq,{},"TableBody"),y]})})})})),tQ=tP({useEmitter:tY,useEmitterValue:tJ,usePublisher:tX}),t0=tR({useEmitter:tY,useEmitterValue:tJ,usePublisher:tX}),t1=tK,t2={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},t5={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:t3,floor:t4,max:t8,min:t9,round:t6}=Math;function t7(e,t,n){return Array.from({length:t-e+1}).map((t,i)=>({data:null===n?null:n[i+e],index:i+e}))}function ne(e,t){return e&&e.width===t.width&&e.height===t.height}function nt(e,t){return e&&e.column===t.column&&e.row===t.row}let nn=E(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:i},{footerHeight:r,headerHeight:o,scrollBy:s,scrollContainerState:l,scrollTo:a,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:h},d,f,{didMount:p,propsReady:m},{customScrollParent:b,useWindowScroll:y,windowScrollContainerState:M,windowScrollTo:E,windowViewportRect:L},F])=>{let V=R(0),N=R(0),j=R(t2),H=R({height:0,width:0}),z=R({height:0,width:0}),$=O(),W=O(),_=R(0),q=R(null),G=R({column:0,row:0}),U=O(),K=O(),Y=R(!1),J=R(0),X=R(!0),Q=R(!1),ee=R(!1);C(p,P(J),x(([e,t])=>!!t))(1,()=>{X(0,!1)}),C(B(p,X,z,H,J,Q),x(([e,t,n,i,,r])=>e&&!t&&0!==n.height&&0!==i.height&&!r))(1,([,,,,e])=>{Q(0,!0),eO(1,()=>{$(0,e)}),v(C(u),()=>{t(0,[0,0]),X(0,!0)})}),g(C(K,x(e=>null!=e&&e.scrollTop>0),k(0)),N),C(p,P(K),x(([,e])=>null!=e))(1,([,e])=>{e&&(H(0,e.viewport),z(0,e.item),G(0,e.gap),e.scrollTop>0&&(Y(0,!0),v(C(u,T(1)),e=>{Y(0,!1)}),a(0,{top:e.scrollTop})))}),g(C(H,S(({height:e})=>e)),h),g(C(B(Z(H,ne),Z(z,ne),Z(G,(e,t)=>e&&e.column===t.column&&e.row===t.row),Z(u)),S(([e,t,n,i])=>({gap:n,item:t,scrollTop:i,viewport:e}))),U),g(C(B(Z(V),i,Z(G,nt),Z(z,ne),Z(H,ne),Z(q),Z(N),Z(Y),Z(X),Z(J)),x(([,,,,,,,e])=>!e),S(([e,[t,n],i,r,o,s,l,,a,u])=>{let c,h;let{column:d,row:f}=i,{height:p,width:m}=r,{width:g}=o;if(0===l&&(0===e||0===g))return t2;if(0===m){var v;let t=eI(u,e),n=t+Math.max(l-1,0);return v=t7(t,n,s),{...t5,items:v}}let b=ni(g,m,d);a?0===t&&0===n&&l>0?(c=0,h=l-1):(c=b*t4((t+f)/(p+f)),h=t9(e-1,t8(h=b*t3((n+f)/(p+f))-1,b-1)),c=t9(h,t8(0,c))):(c=0,h=-1);let y=t7(c,h,s),{bottom:w,top:x}=nr(o,i,r,y),S=t3(e/b);return{bottom:w,itemHeight:p,items:y,itemWidth:m,offsetBottom:S*p+(S-1)*f-w,offsetTop:x,top:x}})),j),g(C(q,x(e=>null!==e),S(e=>e.length)),V),g(C(B(H,z,j,G),x(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),S(([e,t,{items:n},i])=>{let{bottom:r,top:o}=nr(e,i,t,n);return[o,r]}),w(eu)),t);let et=R(!1);g(C(u,P(et),S(([e,t])=>t||0!==e)),et);let en=I(C(B(j,V),x(([{items:e}])=>e.length>0),P(et),x(([[e,t],n])=>{let i=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&i}),S(([[,e]])=>e-1),w())),ei=I(C(Z(j),x(({items:e})=>e.length>0&&0===e[0].index),k(0),w())),er=I(C(Z(j),P(Y),x(([{items:e},t])=>e.length>0&&!t),S(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),w(ea),D(0)));g(er,f.scrollSeekRangeChanged),g(C($,P(H,z,V,G),S(([e,t,n,i,r])=>{let o=eR(e),{align:s,behavior:l,offset:a}=o,u=o.index;"LAST"===u&&(u=i-1);let c=no(t,r,n,u=t8(0,u,t9(i-1,u)));return"end"===s?c=t6(c-t.height+n.height):"center"===s&&(c=t6(c-t.height/2+n.height/2)),a&&(c+=a),{behavior:l,top:c}})),a);let eo=A(C(j,S(e=>e.offsetBottom+e.bottom)),0);return g(C(L,S(e=>({height:e.visibleHeight,width:e.visibleWidth}))),H),{customScrollParent:b,data:q,deviation:_,footerHeight:r,gap:G,headerHeight:o,increaseViewportBy:e,initialItemCount:N,itemDimensions:z,overscan:n,restoreStateFrom:K,scrollBy:s,scrollContainerState:l,scrollHeight:W,scrollTo:a,scrollToIndex:$,scrollTop:u,smoothScrollTargetReached:c,totalCount:V,useWindowScroll:y,viewportDimensions:H,windowScrollContainerState:M,windowScrollTo:E,windowViewportRect:L,...f,gridState:j,horizontalDirection:ee,initialTopMostItemIndex:J,totalListHeight:eo,...d,endReached:en,propsReady:m,rangeChanged:er,startReached:ei,stateChanged:U,stateRestoreInProgress:Y,...F}},d(ez,G,eF,e5,eD,e3,H));function ni(e,t,n){return t8(1,t4((e+n)/(t4(t)+n)))}function nr(e,t,n,i){let{height:r}=n;if(void 0===r||0===i.length)return{bottom:0,top:0};let o=no(e,t,n,i[0].index);return{bottom:no(e,t,n,i[i.length-1].index)+r,top:o}}function no(e,t,n,i){let r=t4(i/ni(e.width,n.width,t.column)),o=r*n.height+t8(0,r-1)*t.row;return o>0?o+t.row:o}let ns=E(()=>{let e=R(e=>`Item ${e}`),t=R({}),n=R(null),i=R("virtuoso-grid-item"),r=R("virtuoso-grid-list"),o=R(td),s=R("div"),l=R(c),a=(e,n=null)=>A(C(t,S(t=>t[e]),w()),n),u=R(!1),h=R(!1);return g(Z(h),u),{components:t,computeItemKey:o,context:n,FooterComponent:a("Footer"),HeaderComponent:a("Header"),headerFooterTag:s,itemClassName:i,ItemComponent:a("Item","div"),itemContent:e,listClassName:r,ListComponent:a("List","div"),readyStateChanged:u,reportReadyState:h,ScrollerComponent:a("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder","div")}}),nl=E(([e,t])=>({...e,...t}),d(nn,ns)),na=o.memo(function(){let e=np("gridState"),t=np("listClassName"),n=np("itemClassName"),i=np("itemContent"),s=np("computeItemKey"),l=np("isSeeking"),a=nm("scrollHeight"),u=np("ItemComponent"),c=np("ListComponent"),h=np("ScrollSeekPlaceholder"),d=np("context"),f=nm("itemDimensions"),p=nm("gap"),m=np("log"),g=np("stateRestoreInProgress"),v=nm("reportReadyState"),b=z(o.useMemo(()=>e=>{a(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(t){let{height:e,width:n}=t.getBoundingClientRect();f({height:e,width:n})}p({column:nb("column-gap",getComputedStyle(e).columnGap,m),row:nb("row-gap",getComputedStyle(e).rowGap,m)})},[a,f,p,m]),!0,!1);return tl(()=>{e.itemHeight>0&&e.itemWidth>0&&v(!0)},[e]),g?null:(0,r.jsx)(c,{className:t,ref:b,...tC(c,d),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let a=s(t.index,t.data,d);return l?(0,r.jsx)(h,{...tC(h,d),height:e.itemHeight,index:t.index,width:e.itemWidth},a):(0,o.createElement)(u,{...tC(u,d),className:n,"data-index":t.index,key:a},i(t.index,t.data,d))})})}),nu=o.memo(function(){let e=np("HeaderComponent"),t=nm("headerHeight"),n=np("headerFooterTag"),i=z(o.useMemo(()=>e=>{t(ed(e,"height"))},[t]),!0,!1),s=np("context");return e?(0,r.jsx)(n,{ref:i,children:(0,r.jsx)(e,{...tC(e,s)})}):null}),nc=o.memo(function(){let e=np("FooterComponent"),t=nm("footerHeight"),n=np("headerFooterTag"),i=z(o.useMemo(()=>e=>{t(ed(e,"height"))},[t]),!0,!1),s=np("context");return e?(0,r.jsx)(n,{ref:i,children:(0,r.jsx)(e,{...tC(e,s)})}):null}),nh=({children:e})=>{let t=o.useContext(ts),n=nm("itemDimensions"),i=nm("viewportDimensions"),s=z(o.useMemo(()=>e=>{i(e.getBoundingClientRect())},[i]),!0,!1);return o.useEffect(()=>{t&&(i({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,i,n]),(0,r.jsx)("div",{ref:s,style:tS(!1),children:e})},nd=({children:e})=>{let t=o.useContext(ts),n=nm("windowViewportRect"),i=nm("itemDimensions"),s=q(n,np("customScrollParent"),!1);return o.useEffect(()=>{t&&(i({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,i]),(0,r.jsx)("div",{ref:s,style:tS(!1),children:e})},{useEmitter:nf,useEmitterValue:np,usePublisher:nm}=tr(nl,{events:{atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",endReached:"endReached",isScrolling:"isScrolling",rangeChanged:"rangeChanged",readyStateChanged:"readyStateChanged",startReached:"startReached",stateChanged:"stateChanged"},methods:{scrollBy:"scrollBy",scrollTo:"scrollTo",scrollToIndex:"scrollToIndex"},optional:{components:"components",computeItemKey:"computeItemKey",context:"context",customScrollParent:"customScrollParent",data:"data",headerFooterTag:"headerFooterTag",increaseViewportBy:"increaseViewportBy",initialItemCount:"initialItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",itemClassName:"itemClassName",itemContent:"itemContent",listClassName:"listClassName",logLevel:"logLevel",overscan:"overscan",restoreStateFrom:"restoreStateFrom",scrollerRef:"scrollerRef",scrollSeekConfiguration:"scrollSeekConfiguration",totalCount:"totalCount",useWindowScroll:"useWindowScroll"}},o.memo(function({...e}){let t=np("useWindowScroll"),n=np("customScrollParent"),i=n||t?nv:ng,o=n||t?nd:nh,s=np("context");return(0,r.jsx)(i,{...e,...tC(i,s),children:(0,r.jsxs)(o,{children:[(0,r.jsx)(nu,{}),(0,r.jsx)(na,{}),(0,r.jsx)(nc,{})]})})})),ng=tP({useEmitter:nf,useEmitterValue:np,usePublisher:nm}),nv=tR({useEmitter:nf,useEmitterValue:np,usePublisher:nm});function nb(e,t,n){return"normal"===t||null!=t&&t.endsWith("px")||n(`${e} was not resolved to pixel value correctly`,t,V.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}},76007:function(e,t,n){"use strict";n.d(t,{V:()=>s});let i="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class s{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,r,o,s){let l=[],a=/^@(\w+)\b/.exec(t[0]),u=a&&"keyframes"==a[1];if(a&&null==r)return o.push(t[0]+";");for(let n in r){let s=r[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(!a)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(i(n),s,l,u)}else null!=s&&l.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+s+";")}(l.length||u)&&o.push((!n||a||s?t:t.map(n)).join(", ")+" {"+l.join(" ")+"}")}(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=o[i]||1;return o[i]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[r],o=n&&n.nonce;i?o&&i.setNonce(o):i=new a(e,o),i.mount(Array.isArray(t)?t:[t],e)}}let l=new Map;class a{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=l.get(n);if(t)return e[r]=t;this.sheet=new i.CSSStyleSheet,l.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[r]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<r&&s>-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],i++)}else{for(;r<s;)i+=this.modules[r++].rules.length;i+=o.rules.length,r++}}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)}}}}]);
|