/*! For license information please see 44.bundle.js.LICENSE.txt */ (self.webpackChunkfront=self.webpackChunkfront||[]).push([[44],{23:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}},119:function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n(95093))},244:(e,t,n)=>{"use strict";function r(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}n.d(t,{A:()=>r})},411:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var r=n(96540);n(74848);const o=r.createContext(),i=()=>r.useContext(o)??!1},655:(e,t,n)=>{"use strict";var r=n(36955),o=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},836:(e,t,n)=>{"use strict";n.d(t,{A:()=>a,Q:()=>i});var r=n(96540),o=n(54405);function i(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function s(e){if(r.isValidElement(e)||(0,o.Hy)(e)||!i(e))return e;const t={};return Object.keys(e).forEach((n=>{t[n]=s(e[n])})),t}function a(e,t,n={clone:!0}){const l=n.clone?{...e}:e;return i(e)&&i(t)&&Object.keys(t).forEach((u=>{r.isValidElement(t[u])||(0,o.Hy)(t[u])?l[u]=t[u]:i(t[u])&&Object.prototype.hasOwnProperty.call(e,u)&&i(e[u])?l[u]=a(e[u],t[u],n):n.clone?l[u]=i(t[u])?s(t[u]):t[u]:l[u]=t[u]})),l}},1152:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(97164).A},1221:function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n(95093))},1321:(e,t,n)=>{"use strict";function r(e=[]){return([,t])=>t&&function(e,t=[]){if(!function(e){return"string"==typeof e.main}(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||"string"!=typeof e[n])return!1;return!0}(t,e)}n.d(t,{A:()=>r})},1625:(e,t,n)=>{"use strict";var r=n(79504);e.exports=r({}.isPrototypeOf)},1632:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1200?"上午":1200===r?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(95093))},1713:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(96540).createContext(void 0)},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1908:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>i});var r=n(61626);const o={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function i(e,t,n="Mui"){const i=o[t];return i?`${n}-${i}`:`${r.A.generate(e)}-${t}`}},2360:(e,t,n)=>{"use strict";var r,o=n(28551),i=n(96801),s=n(88727),a=n(30421),l=n(20397),u=n(4055),h=n(66119),c="prototype",d="script",m=h("IE_PROTO"),p=function(){},f=function(e){return"<"+d+">"+e+""},g=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?g(r):(t=u("iframe"),n="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F):g(r);for(var o=s.length;o--;)delete y[c][s[o]];return y()};a[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[c]=o(e),n=new p,p[c]=null,n[m]=e):n=y(),void 0===t?n:i.f(n,t)}},2478:(e,t,n)=>{"use strict";var r=n(79504),o=n(48981),i=Math.floor,s=r("".charAt),a=r("".replace),l=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,c,d){var m=n+e.length,p=r.length,f=h;return void 0!==c&&(c=o(c),f=u),a(d,f,(function(o,a){var u;switch(s(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,m);case"<":u=c[l(a,1,-1)];break;default:var h=+a;if(0===h)return o;if(h>p){var d=i(h/10);return 0===d?o:d<=p?void 0===r[d-1]?s(a,1):r[d-1]+s(a,1):o}u=r[h-1]}return void 0===u?"":u}))}},3035:function(e,t,n){!function(e){"use strict";function t(e,t,n,r){var o={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?o[n][2]?o[n][2]:o[n][1]:r?o[n][0]:o[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(95093))},3072:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,h=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,f=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,w=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case h:case c:case i:case a:case s:case m:return e;default:switch(e=e&&e.$$typeof){case u:case d:case g:case f:case l:return e;default:return t}}case o:return t}}}function S(e){return b(e)===c}t.AsyncMode=h,t.ConcurrentMode=c,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=g,t.Memo=f,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=m,t.isAsyncMode=function(e){return S(e)||b(e)===h},t.isConcurrentMode=S,t.isContextConsumer=function(e){return b(e)===u},t.isContextProvider=function(e){return b(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===i},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===f},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===a},t.isStrictMode=function(e){return b(e)===s},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===c||e===a||e===s||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d||e.$$typeof===w||e.$$typeof===v||e.$$typeof===_||e.$$typeof===y)},t.typeOf=b},3322:function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једног минута"],mm:["минут","минута","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],d:["један дан","једног дана"],dd:["дан","дана","дана"],M:["један месец","једног месеца"],MM:["месец","месеца","месеци"],y:["једну годину","једне године"],yy:["годину","године","година"]},correctGrammaticalCase:function(e,t){return e%10>=1&&e%10<=4&&(e%100<10||e%100>=20)?e%10==1?t[0]:t[1]:t[2]},translate:function(e,n,r,o){var i,s=t.words[r];return 1===r.length?"y"===r&&n?"једна година":o||n?s[0]:s[1]:(i=t.correctGrammaticalCase(e,s),"yy"===r&&n&&"годину"===i?e+" година":e+" "+i)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:t.translate,dd:t.translate,M:t.translate,MM:t.translate,y:t.translate,yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(95093))},3508:function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(95093))},3576:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(96540);const o="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},3709:(e,t,n)=>{"use strict";function r(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return e.get(s(e,t))}function i(e,t,n){return e.set(s(e,t),n),n}function s(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>u}),n(16280);var a=new WeakMap;class l{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o,s,l;r(this,"row",null),r(this,"col",null),l=!1,function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(o=this,s=a),s.set(o,l),i(a,this,n),void 0!==e&&void 0!==t&&(this.row=e,this.col=t)}isValid(e){const{countRows:t,countCols:n,countRowHeaders:r,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-r||this.row>=t||this.col>=n)}isEqual(e){return e===this||this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return o(a,this)}isSouthEastOf(e){return this.row>=e.row&&(o(a,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(o(a,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(o(a,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(o(a,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=null===this.row?this.row:Math.max(this.row,0),this.col=null===this.col?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(null==e?void 0:e.row)&&(this.row=e.row),Number.isInteger(null==e?void 0:e.col)&&(this.col=e.col),e instanceof l&&i(a,this,e.isRtl()),this}clone(){return new l(this.row,this.col,o(a,this))}toObject(){return{row:this.row,col:this.col}}}const u=l},3949:(e,t,n)=>{"use strict";n(7588)},4055:(e,t,n)=>{"use strict";var r=n(44576),o=n(20034),i=r.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},4076:(e,t,n)=>{"use strict";function r(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach((e=>n.searchParams.append("args[]",e))),`Minified MUI error #${e}; visit ${n} for the full message.`}n.d(t,{A:()=>r})},4146:(e,t,n)=>{"use strict";var r=n(73404),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var u=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var o=m(n);o&&o!==p&&e(t,o,r)}var s=h(n);c&&(s=s.concat(c(n)));for(var a=l(t),f=l(n),g=0;g{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},4495:(e,t,n)=>{"use strict";var r=n(39519),o=n(79039),i=n(44576).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},4894:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(0,n(28040).A)()},4977:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>d,Dg:()=>m}),n(96540);var r=n(57514),o=n(17437),i=n(74848);function s(e){const{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>{return t(null==(r=e)||0===Object.keys(r).length?n:e);var r}:t;return(0,i.jsx)(o.mL,{styles:r})}var a=n(14921);const l=function({styles:e,themeId:t,defaultTheme:n={}}){const r=(0,a.A)(n),o="function"==typeof e?e(t&&r[t]||r):e;return(0,i.jsx)(s,{styles:o})};var u=n(4894),h=n(31355);const c=function(e){return(0,i.jsx)(l,{...e,defaultTheme:u.A,themeId:h.A})};function d(e){return function(t){return(0,i.jsx)(c,{styles:"function"==typeof e?n=>e({theme:n,...t}):e})}}function m(){return r.A}},5784:function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function r(e){return e>1&&e<5}function o(e,t,n,o){var i=e+" ";switch(n){case"s":return t||o?"pár sekúnd":"pár sekundami";case"ss":return t||o?i+(r(e)?"sekundy":"sekúnd"):i+"sekundami";case"m":return t?"minúta":o?"minútu":"minútou";case"mm":return t||o?i+(r(e)?"minúty":"minút"):i+"minútami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?i+(r(e)?"hodiny":"hodín"):i+"hodinami";case"d":return t||o?"deň":"dňom";case"dd":return t||o?i+(r(e)?"dni":"dní"):i+"dňami";case"M":return t||o?"mesiac":"mesiacom";case"MM":return t||o?i+(r(e)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return t||o?"rok":"rokom";case"yy":return t||o?i+(r(e)?"roky":"rokov"):i+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:case 4:case 5:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(95093))},6181:function(e,t,n){!function(e){"use strict";function t(e,t,n,r){var o={s:["çend sanîye","çend sanîyeyan"],ss:[e+" sanîye",e+" sanîyeyan"],m:["deqîqeyek","deqîqeyekê"],mm:[e+" deqîqe",e+" deqîqeyan"],h:["saetek","saetekê"],hh:[e+" saet",e+" saetan"],d:["rojek","rojekê"],dd:[e+" roj",e+" rojan"],w:["hefteyek","hefteyekê"],ww:[e+" hefte",e+" hefteyan"],M:["mehek","mehekê"],MM:[e+" meh",e+" mehan"],y:["salek","salekê"],yy:[e+" sal",e+" salan"]};return t?o[n][0]:o[n][1]}e.defineLocale("ku-kmr",{months:"Rêbendan_Sibat_Adar_Nîsan_Gulan_Hezîran_Tîrmeh_Tebax_Îlon_Cotmeh_Mijdar_Berfanbar".split("_"),monthsShort:"Rêb_Sib_Ada_Nîs_Gul_Hez_Tîr_Teb_Îlo_Cot_Mij_Ber".split("_"),monthsParseExact:!0,weekdays:"Yekşem_Duşem_Sêşem_Çarşem_Pêncşem_În_Şemî".split("_"),weekdaysShort:"Yek_Du_Sê_Çar_Pên_În_Şem".split("_"),weekdaysMin:"Ye_Du_Sê_Ça_Pê_În_Şe".split("_"),meridiem:function(e,t,n){return e<12?n?"bn":"BN":n?"pn":"PN"},meridiemParse:/bn|BN|pn|PN/,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM[a] YYYY[an]",LLL:"Do MMMM[a] YYYY[an] HH:mm",LLLL:"dddd, Do MMMM[a] YYYY[an] HH:mm",ll:"Do MMM[.] YYYY[an]",lll:"Do MMM[.] YYYY[an] HH:mm",llll:"ddd[.], Do MMM[.] YYYY[an] HH:mm"},calendar:{sameDay:"[Îro di saet] LT [de]",nextDay:"[Sibê di saet] LT [de]",nextWeek:"dddd [di saet] LT [de]",lastDay:"[Duh di saet] LT [de]",lastWeek:"dddd[a borî di saet] LT [de]",sameElse:"L"},relativeTime:{future:"di %s de",past:"berî %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,w:t,ww:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(?:yê|ê|\.)/,ordinal:function(e,t){var n=t.toLowerCase();return n.includes("w")||n.includes("m")?e+".":e+function(e){var t=(e=""+e).substring(e.length-1),n=e.length>1?e.substring(e.length-2):"";return 12==n||13==n||"2"!=t&&"3"!=t&&"50"!=n&&"70"!=t&&"80"!=t?"ê":"yê"}(e)},week:{dow:1,doy:4}})}(n(95093))},6469:(e,t,n)=>{"use strict";var r=n(78227),o=n(2360),i=n(24913).f,s=r("unscopables"),a=Array.prototype;void 0===a[s]&&i(a,s,{configurable:!0,value:o(null)}),e.exports=function(e){a[s][e]=!0}},6833:(e,t,n)=>{"use strict";n.d(t,{sd:()=>y,f4:()=>g,Mt:()=>w,F3:()=>v}),n(16280);var r=n(24360),o=(n(98992),n(81454),n(71409)),i=n(83986);const s="asc",a=new Map([[s,[-1,1]],["desc",[1,-1]]]),l=e=>`The priority '${e}' is already declared in a map.`,u=e=>`The priority '${e}' is not a number.`;var h=n(85428);n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);const c=e=>`'${e}' value is already declared in a unique set.`,d=e=>`There is already registered "${e}" plugin.`,m=function(){let{errorPriorityExists:e,errorPriorityNaN:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=new Map;return e=(0,i.Tn)(e)?e:l,t=(0,i.Tn)(t)?t:u,{addItem:function(r,i){if(!(0,o.kf)(r))throw new Error(t(r));if(n.has(r))throw new Error(e(r));n.set(r,i)},getItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;const[t,r]=a.get(e)||a.get(s);return[...n].sort(((e,n)=>e[0]e[1]))}}}({errorPriorityExists:e=>`There is already registered plugin on priority "${e}".`,errorPriorityNaN:e=>`The priority "${e}" is not a number.`}),p=function(){let{errorItemExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new Set;return e=(0,i.Tn)(e)?e:c,{addItem:function(n){if(t.has(n))throw new Error(e(n));t.add(n)},clear:function(){t.clear()},getItems:function(){return[...t]}}}({errorItemExists:d}),f=(0,h.u)({errorIdExists:d});function g(){return[...m.getItems(),...p.getItems()]}function y(e){const t=(0,r.Ob)(e);return f.getItem(t)}function w(e){return!!y(e)}function v(e,t,n){[e,t,n]=function(e,t,n){return"function"==typeof e&&(e=(t=e).PLUGIN_KEY,n=t.PLUGIN_PRIORITY),[e,t,n]}(e,t,n),void 0===y(e)&&function(e,t,n){const o=(0,r.Ob)(e);if(f.hasItem(o))throw new Error(d(o));void 0===n?p.addItem(o):m.addItem(n,o),f.addItem(o,t)}(e,t,n)}},6947:function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-ps",{months:"كانون الثاني_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_تشري الأوّل_تشرين الثاني_كانون الأوّل".split("_"),monthsShort:"ك٢_شباط_آذار_نيسان_أيّار_حزيران_تمّوز_آب_أيلول_ت١_ت٢_ك١".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).split("").reverse().join("").replace(/[١٢](?![\u062a\u0643])/g,(function(e){return n[e]})).split("").reverse().join("").replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n(95093))},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7196:(e,t,n)=>{"use strict";n.d(t,{EU:()=>u,NI:()=>l,iZ:()=>c,kW:()=>d,vf:()=>h,zu:()=>i});var r=n(836),o=n(63132);const i={xs:0,sm:600,md:900,lg:1200,xl:1536},s={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${i[e]}px)`},a={containerQueries:e=>({up:t=>{let n="number"==typeof t?t:i[t]||t;return"number"==typeof n&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function l(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||s;return t.reduce(((r,o,i)=>(r[e.up(e.keys[i])]=n(t[i]),r)),{})}if("object"==typeof t){const e=r.breakpoints||s;return Object.keys(t).reduce(((s,l)=>{if((0,o.ob)(e.keys,l)){const e=(0,o.CT)(r.containerQueries?r:a,l);e&&(s[e]=n(t[l],l))}else if(Object.keys(e.values||i).includes(l))s[e.up(l)]=n(t[l],l);else{const e=l;s[e]=t[e]}return s}),{})}return n(t)}function u(e={}){const t=e.keys?.reduce(((t,n)=>(t[e.up(n)]={},t)),{});return t||{}}function h(e,t){return e.reduce(((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function c(e,...t){const n=u(e),o=[n,...t].reduce(((e,t)=>(0,r.A)(e,t)),{});return h(Object.keys(n),o)}function d({values:e,breakpoints:t,base:n}){const r=n||function(e,t){if("object"!=typeof e)return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach(((t,r)=>{r{null!=e[t]&&(n[t]=!0)})),n}(e,t),o=Object.keys(r);if(0===o.length)return e;let i;return o.reduce(((t,n,r)=>(Array.isArray(e)?(t[n]=null!=e[r]?e[r]:e[i],i=r):"object"==typeof e?(t[n]=null!=e[n]?e[n]:e[i],i=n):t[n]=e,t)),{})}},7306:function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n(95093))},7388:(e,t,n)=>{"use strict";n.d(t,{A:()=>be});var r=n(96540),o=n(34164),i=n(836),s=n(21362),a=n(17726),l=n(4076),u=n(91092),h=n(33983),c=n(39407),d=n(411),m=n(53948),p=n(71026),f=n(10104),g=n(26739),y=n(20439),w=n(65418),v=n(41538),_=n(38572),b=n(41558),S=n(49565),C=n(96148),E=n(1908);function M(e){return(0,E.Ay)("MuiPopover",e)}(0,C.A)("MuiPopover",["root","paper"]);var T=n(85078),R=n(98663),A=n(74848);function N(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function L(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function x(e){return[e.horizontal,e.vertical].map((e=>"number"==typeof e?`${e}px`:e)).join(" ")}function O(e){return"function"==typeof e?e():e}const I=(0,g.Ay)(b.A,{name:"MuiPopover",slot:"Root"})({}),k=(0,g.Ay)(S.A,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),D=r.forwardRef((function(e,t){const n=(0,y.b)({props:e,name:"MuiPopover"}),{action:i,anchorEl:a,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:c="anchorEl",children:d,className:m,container:p,elevation:g=8,marginThreshold:b=16,open:S,PaperProps:C={},slots:E={},slotProps:D={},transformOrigin:P={vertical:"top",horizontal:"left"},TransitionComponent:H,transitionDuration:F="auto",TransitionProps:Y={},disableScrollLock:V=!1,...U}=n,B=r.useRef(),W={...n,anchorOrigin:l,anchorReference:c,elevation:g,marginThreshold:b,transformOrigin:P,TransitionComponent:H,transitionDuration:F,TransitionProps:Y},j=(e=>{const{classes:t}=e;return(0,s.A)({root:["root"],paper:["paper"]},M,t)})(W),z=r.useCallback((()=>{if("anchorPosition"===c)return u;const e=O(a),t=(e&&1===e.nodeType?e:(0,h.A)(B.current).body).getBoundingClientRect();return{top:t.top+N(t,l.vertical),left:t.left+L(t,l.horizontal)}}),[a,l.horizontal,l.vertical,u,c]),G=r.useCallback((e=>({vertical:N(e,P.vertical),horizontal:L(e,P.horizontal)})),[P.horizontal,P.vertical]),$=r.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},n=G(t);if("none"===c)return{top:null,left:null,transformOrigin:x(n)};const r=z();let o=r.top-n.vertical,i=r.left-n.horizontal;const s=o+t.height,l=i+t.width,u=(0,v.A)(O(a)),h=u.innerHeight-b,d=u.innerWidth-b;if(null!==b&&oh){const e=s-h;o-=e,n.vertical+=e}if(null!==b&&id){const e=l-d;i-=e,n.horizontal+=e}return{top:`${Math.round(o)}px`,left:`${Math.round(i)}px`,transformOrigin:x(n)}}),[a,c,z,G,b]),[K,X]=r.useState(S),q=r.useCallback((()=>{const e=B.current;if(!e)return;const t=$(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,X(!0)}),[$]);r.useEffect((()=>(V&&window.addEventListener("scroll",q),()=>window.removeEventListener("scroll",q))),[a,V,q]),r.useEffect((()=>{S&&q()})),r.useImperativeHandle(i,(()=>S?{updatePosition:()=>{q()}}:null),[S,q]),r.useEffect((()=>{if(!S)return;const e=(0,w.A)((()=>{q()})),t=(0,v.A)(O(a));return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[a,S,q]);let Q=F;const J={slots:{transition:H,...E},slotProps:{transition:Y,paper:C,...D}},[Z,ee]=(0,T.A)("transition",{elementType:_.A,externalForwardedProps:J,ownerState:W,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),q()},onExited:t=>{e.onExited?.(t),X(!1)}}),additionalProps:{appear:!0,in:S}});"auto"!==F||Z.muiSupportAuto||(Q=void 0);const te=p||(a?(0,h.A)(O(a)).body:void 0),[ne,{slots:re,slotProps:oe,...ie}]=(0,T.A)("root",{ref:t,elementType:I,externalForwardedProps:{...J,...U},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:E.backdrop},slotProps:{backdrop:(0,R.A)("function"==typeof D.backdrop?D.backdrop(W):D.backdrop,{invisible:!0})},container:te,open:S},ownerState:W,className:(0,o.A)(j.root,m)}),[se,ae]=(0,T.A)("paper",{ref:B,className:j.paper,elementType:k,externalForwardedProps:J,shouldForwardComponentProp:!0,additionalProps:{elevation:g,style:K?void 0:{opacity:0}},ownerState:W});return(0,A.jsx)(ne,{...ie,...!(0,f.A)(ne)&&{slots:re,slotProps:oe,disableScrollLock:V},children:(0,A.jsx)(Z,{...ee,timeout:Q,children:(0,A.jsx)(se,{...ae,children:d})})})}));var P=n(98855);function H(e){return(0,E.Ay)("MuiMenu",e)}(0,C.A)("MuiMenu",["root","paper","list"]);const F={vertical:"top",horizontal:"right"},Y={vertical:"top",horizontal:"left"},V=(0,g.Ay)(D,{shouldForwardProp:e=>(0,P.A)(e)||"classes"===e,name:"MuiMenu",slot:"Root"})({}),U=(0,g.Ay)(k,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),B=(0,g.Ay)(p.A,{name:"MuiMenu",slot:"List"})({outline:0}),W=r.forwardRef((function(e,t){const n=(0,y.b)({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:a,className:l,disableAutoFocusItem:u=!1,MenuListProps:h={},onClose:c,open:p,PaperProps:f={},PopoverClasses:g,transitionDuration:w="auto",TransitionProps:{onEntering:v,..._}={},variant:b="selectedMenu",slots:S={},slotProps:C={},...E}=n,M=(0,d.I)(),R={...n,autoFocus:i,disableAutoFocusItem:u,MenuListProps:h,onEntering:v,PaperProps:f,transitionDuration:w,TransitionProps:_,variant:b},N=(e=>{const{classes:t}=e;return(0,s.A)({root:["root"],paper:["paper"],list:["list"]},H,t)})(R),L=i&&!u&&p,x=r.useRef(null);let O=-1;r.Children.map(a,((e,t)=>{r.isValidElement(e)&&(e.props.disabled||("selectedMenu"===b&&e.props.selected||-1===O)&&(O=t))}));const I={slots:S,slotProps:{list:h,transition:_,paper:f,...C}},k=(0,m.A)({elementType:S.root,externalSlotProps:C.root,ownerState:R,className:[N.root,l]}),[D,P]=(0,T.A)("paper",{className:N.paper,elementType:U,externalForwardedProps:I,shouldForwardComponentProp:!0,ownerState:R}),[W,j]=(0,T.A)("list",{className:(0,o.A)(N.list,h.className),elementType:B,shouldForwardComponentProp:!0,externalForwardedProps:I,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{"Tab"===e.key&&(e.preventDefault(),c&&c(e,"tabKeyDown"))})(t),e.onKeyDown?.(t)}}),ownerState:R}),z="function"==typeof I.slotProps.transition?I.slotProps.transition(R):I.slotProps.transition;return(0,A.jsx)(V,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:M?"right":"left"},transformOrigin:M?F:Y,slots:{root:S.root,paper:D,backdrop:S.backdrop,...S.transition&&{transition:S.transition}},slotProps:{root:k,paper:P,backdrop:"function"==typeof C.backdrop?C.backdrop(R):C.backdrop,transition:{...z,onEntering:(...e)=>{((e,t)=>{x.current&&x.current.adjustStyleForScrollbar(e,{direction:M?"rtl":"ltr"}),v&&v(e,t)})(...e),z?.onEntering?.(...e)}}},open:p,ref:t,transitionDuration:w,ownerState:R,...E,classes:g,children:(0,A.jsx)(W,{actions:x,autoFocus:i&&(-1===O||u),autoFocusItem:L,variant:b,...j,children:a})})}));function j(e){return(0,E.Ay)("MuiNativeSelect",e)}const z=(0,C.A)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),G=(0,g.Ay)("select")((({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${z.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>"filled"!==e.variant&&"outlined"!==e.variant,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]}))),$=(0,g.Ay)(G,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:P.A,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${z.multiple}`]:t.multiple}]}})({}),K=(0,g.Ay)("svg")((({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${z.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]}))),X=(0,g.Ay)(K,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${(0,c.A)(n.variant)}`],n.open&&t.iconOpen]}})({}),q=r.forwardRef((function(e,t){const{className:n,disabled:i,error:a,IconComponent:l,inputRef:u,variant:h="standard",...d}=e,m={...e,disabled:i,variant:h,error:a},p=(e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,l={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${(0,c.A)(n)}`,i&&"iconOpen",r&&"disabled"]};return(0,s.A)(l,j,t)})(m);return(0,A.jsxs)(r.Fragment,{children:[(0,A.jsx)($,{ownerState:m,className:(0,o.A)(p.select,n),disabled:i,ref:u||t,...d}),e.multiple?null:(0,A.jsx)(X,{as:l,ownerState:m,className:p.icon})]})}));var Q=n(99692),J=n(23),Z=n(30301),ee=n(1152);function te(e){return(0,E.Ay)("MuiSelect",e)}const ne=(0,C.A)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var re;const oe=(0,g.Ay)(G,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${ne.select}`]:t.select},{[`&.${ne.select}`]:t[n.variant]},{[`&.${ne.error}`]:t.error},{[`&.${ne.multiple}`]:t.multiple}]}})({[`&.${ne.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),ie=(0,g.Ay)(K,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${(0,c.A)(n.variant)}`],n.open&&t.iconOpen]}})({}),se=(0,g.Ay)("input",{shouldForwardProp:e=>(0,J.A)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function ae(e,t){return"object"==typeof t&&null!==t?e===t:String(e)===String(t)}function le(e){return null==e||"string"==typeof e&&!e.trim()}const ue=r.forwardRef((function(e,t){const{"aria-describedby":n,"aria-label":i,autoFocus:a,autoWidth:d,children:m,className:p,defaultOpen:f,defaultValue:g,disabled:y,displayEmpty:w,error:v=!1,IconComponent:_,inputRef:b,labelId:S,MenuProps:C={},multiple:E,name:M,onBlur:T,onChange:R,onClose:N,onFocus:L,onOpen:x,open:O,readOnly:I,renderValue:k,required:D,SelectDisplayProps:P={},tabIndex:H,type:F,value:Y,variant:V="standard",...U}=e,[B,j]=(0,ee.A)({controlled:Y,default:g,name:"Select"}),[z,G]=(0,ee.A)({controlled:O,default:f,name:"Select"}),$=r.useRef(null),K=r.useRef(null),[X,q]=r.useState(null),{current:J}=r.useRef(null!=O),[ne,ue]=r.useState(),he=(0,Z.A)(t,b),ce=r.useCallback((e=>{K.current=e,e&&q(e)}),[]),de=X?.parentNode;r.useImperativeHandle(he,(()=>({focus:()=>{K.current.focus()},node:$.current,value:B})),[B]),r.useEffect((()=>{f&&z&&X&&!J&&(ue(d?null:de.clientWidth),K.current.focus())}),[X,d]),r.useEffect((()=>{a&&K.current.focus()}),[a]),r.useEffect((()=>{if(!S)return;const e=(0,h.A)(K.current).getElementById(S);if(e){const t=()=>{getSelection().isCollapsed&&K.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[S]);const me=(e,t)=>{e?x&&x(t):N&&N(t),J||(ue(d?null:de.clientWidth),G(e))},pe=r.Children.toArray(m),fe=e=>t=>{let n;if(t.currentTarget.hasAttribute("tabindex")){if(E){n=Array.isArray(B)?B.slice():[];const t=B.indexOf(e.props.value);-1===t?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),B!==n&&(j(n),R)){const r=t.nativeEvent||t,o=new r.constructor(r.type,r);Object.defineProperty(o,"target",{writable:!0,value:{value:n,name:M}}),R(o,e)}E||me(!1,t)}},ge=null!==X&&z;let ye,we;delete U["aria-invalid"];const ve=[];let _e=!1,be=!1;((0,Q.lq)({value:B})||w)&&(k?ye=k(B):_e=!0);const Se=pe.map((e=>{if(!r.isValidElement(e))return null;let t;if(E){if(!Array.isArray(B))throw new Error((0,l.A)(2));t=B.some((t=>ae(t,e.props.value))),t&&_e&&ve.push(e.props.children)}else t=ae(B,e.props.value),t&&_e&&(we=e.props.children);return t&&(be=!0),r.cloneElement(e,{"aria-selected":t?"true":"false",onClick:fe(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));_e&&(ye=E?0===ve.length?null:ve.reduce(((e,t,n)=>(e.push(t),n{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,l={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${(0,c.A)(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return(0,s.A)(l,te,t)})(Te),Ae={...C.PaperProps,...C.slotProps?.paper},Ne=(0,u.A)();return(0,A.jsxs)(r.Fragment,{children:[(0,A.jsx)(oe,{as:"div",ref:ce,tabIndex:Ce,role:"combobox","aria-controls":ge?Ne:void 0,"aria-disabled":y?"true":void 0,"aria-expanded":ge?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[S,Me].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":D?"true":void 0,"aria-invalid":v?"true":void 0,onKeyDown:e=>{I||[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),me(!0,e))},onMouseDown:y||I?null:e=>{0===e.button&&(e.preventDefault(),K.current.focus(),me(!0,e))},onBlur:e=>{!ge&&T&&(Object.defineProperty(e,"target",{writable:!0,value:{value:B,name:M}}),T(e))},onFocus:L,...P,ownerState:Te,className:(0,o.A)(P.className,Re.select,p),id:Me,children:le(ye)?re||(re=(0,A.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"​"})):ye}),(0,A.jsx)(se,{"aria-invalid":v,value:Array.isArray(B)?B.join(","):B,name:M,ref:$,"aria-hidden":!0,onChange:e=>{const t=pe.find((t=>t.props.value===e.target.value));void 0!==t&&(j(t.props.value),R&&R(e,t))},tabIndex:-1,disabled:y,className:Re.nativeInput,autoFocus:a,required:D,...U,ownerState:Te}),(0,A.jsx)(ie,{as:_,className:Re.icon,ownerState:Te}),(0,A.jsx)(W,{id:`menu-${M||""}`,anchorEl:de,open:ge,onClose:e=>{me(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...C,slotProps:{...C.slotProps,list:{"aria-labelledby":S,role:"listbox","aria-multiselectable":E?"true":void 0,disableListWrap:!0,id:Ne,...C.MenuListProps},paper:{...Ae,style:{minWidth:Ee,...null!=Ae?Ae.style:null}}},children:Se})]})}));var he=n(93583),ce=n(76761),de=n(41811),me=n(78164),pe=n(63984),fe=n(47195);const ge={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>(0,P.A)(e)&&"variant"!==e},ye=(0,g.Ay)(me.A,ge)(""),we=(0,g.Ay)(fe.A,ge)(""),ve=(0,g.Ay)(pe.A,ge)(""),_e=r.forwardRef((function(e,t){const n=(0,y.b)({name:"MuiSelect",props:e}),{autoWidth:l=!1,children:u,classes:h={},className:c,defaultOpen:d=!1,displayEmpty:m=!1,IconComponent:p=de.A,id:f,input:g,inputProps:w,label:v,labelId:_,MenuProps:b,multiple:S=!1,native:C=!1,onClose:E,onOpen:M,open:T,renderValue:R,SelectDisplayProps:N,variant:L="outlined",...x}=n,O=C?q:ue,I=(0,ce.A)(),k=(0,he.A)({props:n,muiFormControl:I,states:["variant","error"]}),D=k.variant||L,P={...n,variant:D,classes:h},H=(e=>{const{classes:t}=e,n=(0,s.A)({root:["root"]},te,t);return{...t,...n}})(P),{root:F,...Y}=H,V=g||{standard:(0,A.jsx)(ye,{ownerState:P}),outlined:(0,A.jsx)(we,{label:v,ownerState:P}),filled:(0,A.jsx)(ve,{ownerState:P})}[D],U=(0,Z.A)(t,(0,a.A)(V));return(0,A.jsx)(r.Fragment,{children:r.cloneElement(V,{inputComponent:O,inputProps:{children:u,error:k.error,IconComponent:p,variant:D,type:void 0,multiple:S,...C?{id:f}:{autoWidth:l,defaultOpen:d,displayEmpty:m,labelId:_,MenuProps:b,onClose:E,onOpen:M,open:T,renderValue:R,SelectDisplayProps:{id:f,...N}},...w,classes:w?(0,i.A)(Y,w.classes):Y,...g?g.props.inputProps:{}},...(S&&C||m)&&"outlined"===D?{notched:!0}:{},ref:U,className:(0,o.A)(V.props.className,c,H.root),...!g&&{variant:D},...x})})}));_e.muiName="Select";const be=_e},7588:(e,t,n)=>{"use strict";var r=n(46518),o=n(69565),i=n(72652),s=n(79306),a=n(28551),l=n(1767),u=n(9539),h=n(84549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:h},{forEach:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}if(h)return o(h,this,e);var t=l(this),n=0;i(t,(function(t){e(t,n++)}),{IS_RECORD:!0})}})},8235:function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n(95093))},8861:(e,t,n)=>{"use strict";n.d(t,{A:()=>C});var r=n(96540),o=n(34164),i=n(21362),s=n(17437),a=n(26739),l=n(39241),u=n(20439),h=n(39407),c=n(1321),d=n(96148),m=n(1908);function p(e){return(0,m.Ay)("MuiCircularProgress",e)}(0,d.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var f=n(74848);const g=s.i7` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,y=s.i7` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; } 50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; } 100% { stroke-dasharray: 1px, 200px; stroke-dashoffset: -126px; } `,w="string"!=typeof g?s.AH` animation: ${g} 1.4s linear infinite; `:null,v="string"!=typeof y?s.AH` animation: ${y} 1.4s ease-in-out infinite; `:null,_=(0,a.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${(0,h.A)(n.color)}`]]}})((0,l.A)((({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:w||{animation:`${g} 1.4s linear infinite`}},...Object.entries(e.palette).filter((0,c.A)()).map((([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})))]})))),b=(0,a.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),S=(0,a.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${(0,h.A)(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((0,l.A)((({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink,style:v||{animation:`${y} 1.4s ease-in-out infinite`}}]})))),C=r.forwardRef((function(e,t){const n=(0,u.b)({props:e,name:"MuiCircularProgress"}),{className:r,color:s="primary",disableShrink:a=!1,size:l=40,style:c,thickness:d=3.6,value:m=0,variant:g="indeterminate",...y}=n,w={...n,color:s,disableShrink:a,size:l,thickness:d,value:m,variant:g},v=(e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,s={root:["root",n,`color${(0,h.A)(r)}`],svg:["svg"],circle:["circle",`circle${(0,h.A)(n)}`,o&&"circleDisableShrink"]};return(0,i.A)(s,p,t)})(w),C={},E={},M={};if("determinate"===g){const e=2*Math.PI*((44-d)/2);C.strokeDasharray=e.toFixed(3),M["aria-valuenow"]=Math.round(m),C.strokeDashoffset=`${((100-m)/100*e).toFixed(3)}px`,E.transform="rotate(-90deg)"}return(0,f.jsx)(_,{className:(0,o.A)(v.root,r),style:{width:l,height:l,...E,...c},ownerState:w,ref:t,role:"progressbar",...M,...y,children:(0,f.jsx)(b,{className:v.svg,ownerState:w,viewBox:"22 22 44 44",children:(0,f.jsx)(S,{className:v.circle,style:C,ownerState:w,cx:44,cy:44,r:(44-d)/2,fill:"none",strokeWidth:d})})})}))},8872:(e,t,n)=>{"use strict";n(18237)},9033:function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n(95093))},9417:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{A:()=>r})},9539:(e,t,n)=>{"use strict";var r=n(69565),o=n(28551),i=n(55966);e.exports=function(e,t,n){var s,a;o(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw n;return n}s=r(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw n;if(a)throw s;return o(s),n}},9792:(e,t,n)=>{"use strict";n.d(t,{A:()=>y});var r=n(96540),o=n(34164),i=n(21362),s=n(39407),a=n(26739),l=n(39241),u=n(20439),h=n(96148),c=n(1908);function d(e){return(0,c.Ay)("MuiSvgIcon",e)}(0,h.A)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var m=n(74848);const p=(0,a.Ay)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,s.A)(n.color)}`],t[`fontSize${(0,s.A)(n.fontSize)}`]]}})((0,l.A)((({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter((([,e])=>e&&e.main)).map((([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}}))),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]})))),f=r.forwardRef((function(e,t){const n=(0,u.b)({props:e,name:"MuiSvgIcon"}),{children:a,className:l,color:h="inherit",component:c="svg",fontSize:f="medium",htmlColor:g,inheritViewBox:y=!1,titleAccess:w,viewBox:v="0 0 24 24",..._}=n,b=r.isValidElement(a)&&"svg"===a.type,S={...n,color:h,component:c,fontSize:f,instanceFontSize:e.fontSize,inheritViewBox:y,viewBox:v,hasSvgAsChild:b},C={};y||(C.viewBox=v);const E=(e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root","inherit"!==t&&`color${(0,s.A)(t)}`,`fontSize${(0,s.A)(n)}`]};return(0,i.A)(o,d,r)})(S);return(0,m.jsxs)(p,{as:c,className:(0,o.A)(E.root,l),focusable:"false",color:g,"aria-hidden":!w||void 0,role:w?"img":void 0,ref:t,...C,..._,...b&&a.props,ownerState:S,children:[b?a.props.children:a,w?(0,m.jsx)("title",{children:w}):null]})}));f.muiName="SvgIcon";const g=f;function y(e,t){function n(t,n){return(0,m.jsx)(g,{"data-testid":void 0,ref:n,...t,children:e})}return n.muiName=g.muiName,r.memo(r.forwardRef(n))}},10104:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){return"string"==typeof e}},10350:(e,t,n)=>{"use strict";var r=n(43724),o=n(39297),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),l=a&&"something"===function(){}.name,u=a&&(!r||r&&s(i,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:u}},10540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},10644:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{A:()=>r})},10757:(e,t,n)=>{"use strict";var r=n(97751),o=n(94901),i=n(1625),s=n(7040),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,a(e))}},11025:function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n(95093))},11056:(e,t,n)=>{"use strict";var r=n(24913).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},11080:(e,t,n)=>{"use strict";n.d(t,{L3:()=>d,M8:()=>m,VA:()=>p,aZ:()=>l}),n(16280);var r=n(63487),o=n(34647);const i=new WeakMap,{register:s,getItem:a,hasItem:l,getNames:u,getValues:h}=(0,o.A)("editors");function c(e){const t={},n=e;this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in t||(t[e.guid]=new n(e)),t[e.guid]},r.R.getSingleton().add("afterDestroy",(function(){t[this.guid]=null}))}function d(e,t){let n;if("function"==typeof e)i.get(e)||p(null,e),n=i.get(e);else{if("string"!=typeof e)throw Error('Only strings and functions can be passed as "editor" parameter');n=a(e)}if(!n)throw Error(`No editor registered under name "${e}"`);return n.getInstance(t)}function m(e){if("function"==typeof e)return e;if(!l(e))throw Error(`No registered editor found under "${e}" name`);return a(e).getConstructor()}function p(e,t){e&&"string"!=typeof e&&(e=(t=e).EDITOR_TYPE);const n=new c(t);"string"==typeof e&&s(e,n),i.set(t,n)}},11108:(e,t,n)=>{"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,{A:()=>r})},11470:function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var r=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],o=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,i=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:i,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:i,monthsRegex:o,monthsShortRegex:o,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n(95093))},11713:function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n(95093))},11885:function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n(95093))},12211:(e,t,n)=>{"use strict";var r=n(79039);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},13317:(e,t,n)=>{"use strict";n.d(t,{v:()=>o,z:()=>i}),n(98992),n(54520);var r=n(77325);function o(e,t){return(0,r.YD)(e,(e=>e-t.filter((t=>te>=n?e+o:e))}},13431:(e,t,n)=>{"use strict";n.d(t,{A:()=>a,q:()=>s});const r=/^(\r\n|\n\r|\r|\n)/,o=/^[^\t\r\n]+/,i=/^\t/;function s(e){const t=[[""]];if(0===e.length)return t;let n,s=0,a=0;for(;e.length>0&&n!==e.length;)if(n=e.length,e.match(i))e=e.replace(i,""),s+=1,t[a][s]="";else if(e.match(r))e=e.replace(r,""),s=0,a+=1,t[a]=[""];else{let n="";if(e.startsWith('"')){let t=0,r=!0;for(;r;){const o=e.slice(0,1);'"'===o&&(t+=1),n+=o,(0===(e=e.slice(1)).length||e.match(/^[\t\r\n]/)&&t%2==0)&&(r=!1)}n=n.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,(e=>new Array(Math.floor(e.length/2)).fill('"').join("")))}else{const t=e.match(o);n=t?t[0]:"",e=e.slice(n.length)}t[a][s]=n}return t}function a(e){let t,n,r,o,i,s="";for(t=0,n=e.length;t0&&(s+="\t"),i=e[t][r],"string"==typeof i?i.indexOf("\n")>-1?s+=`"${i.replace(/"/g,'""')}"`:s+=i:s+=null==i?"":i;t!==n-1&&(s+="\n")}return s}},13579:(e,t,n)=>{"use strict";var r=n(46518),o=n(69565),i=n(72652),s=n(79306),a=n(28551),l=n(1767),u=n(9539),h=n(84549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:h},{some:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}if(h)return o(h,this,e);var t=l(this),n=0;return i(t,(function(t,r){if(e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},13609:(e,t,n)=>{"use strict";var r=n(46518),o=n(48981),i=n(26198),s=n(34527),a=n(84606),l=n(96837);r({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=o(this),n=i(t),r=arguments.length;if(r){l(n+r);for(var u=n;u--;){var h=u+r;u in t?t[h]=t[u]:a(t,h)}for(var c=0;c{"use strict";var r=n(20034);e.exports=function(e){return r(e)||null===e}},13968:(e,t,n)=>{"use strict";function r(e){return window.requestAnimationFrame(e)}function o(e){window.cancelAnimationFrame(e)}function i(){return"ontouchstart"in window}function s(){return"undefined"!=typeof window}let a;function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a||(a="object"==typeof Intl?new Intl.Collator(e,t).compare:"function"==typeof String.prototype.localeCompare?(e,t)=>`${e}`.localeCompare(t):(e,t)=>e===t?0:e>t?-1:1,a)}n.d(t,{II:()=>l,Nt:()=>s,uU:()=>o,xi:()=>r,yd:()=>i})},14292:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(96540);function o(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)}},14601:(e,t,n)=>{"use strict";var r=n(97751),o=n(39297),i=n(66699),s=n(1625),a=n(52967),l=n(77740),u=n(11056),h=n(23167),c=n(32603),d=n(77584),m=n(80747),p=n(43724),f=n(96395);e.exports=function(e,t,n,g){var y="stackTraceLimit",w=g?2:1,v=e.split("."),_=v[v.length-1],b=r.apply(null,v);if(b){var S=b.prototype;if(!f&&o(S,"cause")&&delete S.cause,!n)return b;var C=r("Error"),E=t((function(e,t){var n=c(g?t:e,void 0),r=g?new b(e):new b;return void 0!==n&&i(r,"message",n),m(r,E,r.stack,2),this&&s(S,this)&&h(r,this,E),arguments.length>w&&d(r,arguments[w]),r}));if(E.prototype=S,"Error"!==_?a?a(E,C):l(E,C,{name:!0}):p&&y in b&&(u(E,b,y),u(E,b,"prepareStackTrace")),l(E,b),!f)try{S.name!==_&&i(S,"name",_),S.constructor=E}catch(e){}return E}}},14921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(65387),o=n(96540),i=n(24684);const s=(0,r.A)(),a=function(e=s){return function(e=null){const t=o.useContext(i.T);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}(e)}},15024:(e,t,n)=>{"use strict";var r=n(46518),o=n(83650),i=n(39835);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("symmetricDifference")||!i("symmetricDifference")},{symmetricDifference:o})},15867:function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n(95093))},15870:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(96540);const o={};function i(e,t){const n=r.useRef(o);return n.current===o&&(n.current=e(t)),n}},16193:(e,t,n)=>{"use strict";var r=n(79504),o=Error,i=r("".replace),s=String(new o("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(s);e.exports=function(e,t){if(l&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=i(e,a,"");return e}},16280:(e,t,n)=>{"use strict";var r=n(46518),o=n(44576),i=n(18745),s=n(14601),a="WebAssembly",l=o[a],u=7!==new Error("e",{cause:7}).cause,h=function(e,t){var n={};n[e]=s(e,t,u),r({global:!0,constructor:!0,arity:1,forced:u},n)},c=function(e,t){if(l&&l[e]){var n={};n[e]=s(a+"."+e,t,u),r({target:a,stat:!0,constructor:!0,arity:1,forced:u},n)}};h("Error",(function(e){return function(t){return i(e,this,arguments)}})),h("EvalError",(function(e){return function(t){return i(e,this,arguments)}})),h("RangeError",(function(e){return function(t){return i(e,this,arguments)}})),h("ReferenceError",(function(e){return function(t){return i(e,this,arguments)}})),h("SyntaxError",(function(e){return function(t){return i(e,this,arguments)}})),h("TypeError",(function(e){return function(t){return i(e,this,arguments)}})),h("URIError",(function(e){return function(t){return i(e,this,arguments)}})),c("CompileError",(function(e){return function(t){return i(e,this,arguments)}})),c("LinkError",(function(e){return function(t){return i(e,this,arguments)}})),c("RuntimeError",(function(e){return function(t){return i(e,this,arguments)}}))},16618:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(r=+e,o={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2]);var r,o}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n(95093))},16823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},17160:function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n(95093))},17241:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(96540).createContext(null)},17357:function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n(95093))},17437:(e,t,n)=>{"use strict";n.d(t,{AH:()=>d,i7:()=>m,mL:()=>c});var r,o,i=n(24684),s=n(96540),a=n(30041),l=n(71287),u=n(43174),h=(n(55655),n(4146),function(e,t){var n=arguments;if(null==t||!i.h.call(t,"css"))return s.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=i.E,o[1]=(0,i.c)(e,t);for(var a=2;a11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n(95093))},17642:(e,t,n)=>{"use strict";var r=n(46518),o=n(83440),i=n(79039);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("difference",(function(e){return 0===e.size}))||i((function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size}))},{difference:o})},17726:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(96540);function o(e){return parseInt(r.version,10)>=19?e?.props?.ref||null:e?.ref||null}},17730:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],o=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:o,monthsShortRegex:o,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n(95093))},18014:(e,t,n)=>{"use strict";var r=n(91291),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},18107:(e,t,n)=>{"use strict";var r=n(46518),o=n(48981),i=n(26198),s=n(91291),a=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=i(t),r=s(e),a=r>=0?r:n+r;return a<0||a>=n?void 0:t[a]}}),a("at")},18111:(e,t,n)=>{"use strict";var r=n(46518),o=n(44576),i=n(90679),s=n(28551),a=n(94901),l=n(42787),u=n(62106),h=n(97040),c=n(79039),d=n(39297),m=n(78227),p=n(57657).IteratorPrototype,f=n(43724),g=n(96395),y="constructor",w="Iterator",v=m("toStringTag"),_=TypeError,b=o[w],S=g||!a(b)||b.prototype!==p||!c((function(){b({})})),C=function(){if(i(this,p),l(this)===p)throw new _("Abstract class Iterator not directly constructable")},E=function(e,t){f?u(p,e,{configurable:!0,get:function(){return t},set:function(t){if(s(this),this===p)throw new _("You can't redefine this property");d(this,e)?this[e]=t:h(this,e,t)}}):p[e]=t};d(p,v)||E(v,w),!S&&d(p,y)&&p[y]!==Object||E(y,C),C.prototype=p,r({global:!0,constructor:!0,forced:S},{Iterator:C})},18139:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(49649);function o(e){const{variants:t,...n}=e,o={variants:t,style:(0,r.tT)(n),isProcessed:!0};return o.style===n||t&&t.forEach((e=>{"function"!=typeof e.style&&(e.style=(0,r.tT)(e.style))})),o}},18237:(e,t,n)=>{"use strict";var r=n(46518),o=n(72652),i=n(79306),s=n(28551),a=n(1767),l=n(9539),u=n(84549),h=n(18745),c=n(79039),d=TypeError,m=c((function(){[].keys().reduce((function(){}),void 0)})),p=!m&&u("reduce",d);r({target:"Iterator",proto:!0,real:!0,forced:m||p},{reduce:function(e){s(this);try{i(e)}catch(e){l(this,"throw",e)}var t=arguments.length<2,n=t?void 0:arguments[1];if(p)return h(p,this,t?[e]:[e,n]);var r=a(this),u=0;if(o(r,(function(r){t?(t=!1,n=r):n=e(n,r,u),u++}),{IS_RECORD:!0}),t)throw new d("Reduce of empty iterator with no initial value");return n}})},18745:(e,t,n)=>{"use strict";var r=n(40616),o=Function.prototype,i=o.apply,s=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},19462:(e,t,n)=>{"use strict";var r=n(69565),o=n(2360),i=n(66699),s=n(56279),a=n(78227),l=n(91181),u=n(55966),h=n(57657).IteratorPrototype,c=n(62529),d=n(9539),m=n(91385),p=a("toStringTag"),f="IteratorHelper",g="WrapForValidIterator",y="normal",w="throw",v=l.set,_=function(e){var t=l.getterFor(e?g:f);return s(o(h),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return c(void 0,!0);try{var r=n.nextHandler();return n.returnHandlerResult?r:c(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),o=n.iterator;if(n.done=!0,e){var i=u(o,"return");return i?r(i,o):c(void 0,!0)}if(n.inner)try{d(n.inner.iterator,y)}catch(e){return d(o,w,e)}if(n.openIters)try{m(n.openIters,y)}catch(e){return d(o,w,e)}return o&&d(o,y),c(void 0,!0)}})},b=_(!0),S=_(!1);i(S,p,"Iterator Helper"),e.exports=function(e,t,n){var r=function(r,o){o?(o.iterator=r.iterator,o.next=r.next):o=r,o.type=t?g:f,o.returnHandlerResult=!!n,o.nextHandler=e,o.counter=0,o.done=!1,v(this,o)};return r.prototype=t?b:S,r}},19617:(e,t,n)=>{"use strict";var r=n(25397),o=n(35610),i=n(26198),s=function(e){return function(t,n,s){var a=r(t),l=i(a);if(0===l)return!e&&-1;var u,h=o(s,l);if(e&&n!=n){for(;l>h;)if((u=a[h++])!=u)return!0}else for(;l>h;h++)if((e||h in a)&&a[h]===n)return e||h||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},19750:(e,t,n)=>{"use strict";function r(e,t){const n={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const i=o;if("components"===i||"slots"===i)n[i]={...e[i],...n[i]};else if("componentsProps"===i||"slotProps"===i){const o=e[i],s=t[i];if(s)if(o){n[i]={...s};for(const e in o)if(Object.prototype.hasOwnProperty.call(o,e)){const t=e;n[i][t]=r(o[t],s[t])}}else n[i]=s;else n[i]=o||{}}else void 0===n[i]&&(n[i]=e[i])}return n}n.d(t,{A:()=>r})},20034:(e,t,n)=>{"use strict";var r=n(94901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},20091:(e,t,n)=>{"use strict";n.d(t,{$w:()=>ee,Bq:()=>v,C0:()=>oe,D1:()=>K,DK:()=>Y,De:()=>_,E3:()=>Z,Gq:()=>F,I6:()=>te,Ie:()=>S,JC:()=>B,K7:()=>I,LL:()=>j,Ly:()=>a,Mv:()=>E,ON:()=>q,Oe:()=>h,PA:()=>i,Pe:()=>d,Sx:()=>R,Vp:()=>L,XJ:()=>$,Xu:()=>W,Xy:()=>J,ZK:()=>Q,aM:()=>ne,aO:()=>c,c6:()=>M,cY:()=>A,cr:()=>u,eU:()=>V,fX:()=>P,gd:()=>H,gj:()=>re,h$:()=>D,hY:()=>x,iQ:()=>y,kp:()=>l,nB:()=>g,p6:()=>k,sb:()=>ie,v1:()=>N,vZ:()=>z,v_:()=>O,vg:()=>b,vy:()=>w,xM:()=>U,yn:()=>m,yq:()=>s,zN:()=>T,zO:()=>X}),n(16280),n(44114),n(98992),n(54520),n(3949);var r=n(24360),o=n(66422);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1,r=null,o=e;for(;null!==o;){if(n===t){r=o;break}o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE?o=o.host:(n+=1,o=o.parentNode)}return r}function s(e,t){const n=e.closest(".handsontable");return!!n&&(n.parentNode===t||n===t)}function a(e){return function(e){return Object.getPrototypeOf(e.parent)&&e.frameElement}(e)&&e.parent}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:o}=Node;let i=e;for(;null!=i&&i!==n;){const{nodeType:e,nodeName:n}=i;if(e===r&&(t.includes(n)||t.includes(i)))return i;const{host:s}=i;i=s&&e===o?s:i.parentNode}return null}function u(e,t,n){const r=[];let o=e;for(;o&&(o=l(o,t,n),o&&(!n||n.contains(o)));)r.push(o),o=o.host&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE?o.host:o.parentNode;const i=r.length;return i?r[i-1]:null}function h(e,t){const n={element:void 0,classNames:[]};let r=e;for(;null!==r&&r!==e.ownerDocument.documentElement&&!n.element;){if("string"==typeof t&&r.classList.contains(t))n.element=r,n.classNames.push(t);else if(t instanceof RegExp){const e=Array.from(r.classList).filter((e=>t.test(e)));e.length&&(n.element=r,n.classNames.push(...e))}r=r.parentElement}return n}function c(e,t){let n=e.parentNode,r=[];for("string"==typeof t?r=e.defaultView?Array.prototype.slice.call(e.querySelectorAll(t),0):Array.prototype.slice.call(e.ownerDocument.querySelectorAll(t),0):r.push(t);null!==n;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function d(e){let t=0,n=e;if(n.previousSibling)for(;n=n.previousSibling;)t+=1;return t}function m(e,t,n){const r=n.parentElement.querySelector(`.ht_clone_${e}`);return r?r.contains(t):null}function p(e){return e&&e.length?e.filter((e=>!!e)):[]}function f(e,t){if(!e||!e.length)return t?{regexFree:[],regexes:[]}:[];const n=[],r=[];return r.push(...e.filter((e=>{const r=e instanceof RegExp;return r&&t&&n.push(e),!r}))),t?{regexFree:r,regexes:n}:r}function g(e,t){return void 0!==e.classList&&"string"==typeof t&&""!==t&&e.classList.contains(t)}function y(e,t){"string"==typeof t&&(t=t.split(" ")),(t=p(t)).length>0&&e.classList.add(...t)}function w(e,t){"string"==typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);let{regexFree:n,regexes:r}=f(t,!0);n=p(n),n.length>0&&e.classList.remove(...n),r.forEach((t=>{e.classList.forEach((n=>{t.test(n)&&e.classList.remove(n)}))}))}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(t)||(t=[[t,n]]),t.forEach((t=>{Array.isArray(t)&&""!==t[0]&&e.setAttribute(...t)}))}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"string"==typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);const{regexFree:n,regexes:r}=f(t,!0);n.forEach((t=>{""!==t&&e.removeAttribute(t)})),r.forEach((t=>{e.getAttributeNames().forEach((n=>{t.test(n)&&e.removeAttribute(n)}))}))}function b(e){if(3===e.nodeType)e.parentNode.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1){const t=e.childNodes;for(let e=t.length-1;e>=0;e--)b(t[e])}}function S(e){let t;for(;t=e.lastChild;)e.removeChild(t)}const C=/(<(.*)>|&(.*);)/;function E(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];C.test(t)?e.innerHTML=n?(0,r.aj)(t):t:M(e,t)}function M(e,t){const n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?n.textContent=t:(S(e),e.appendChild(e.ownerDocument.createTextNode(t)))}function T(e){const t=e.ownerDocument.documentElement,n=e.ownerDocument.defaultView;let r=e;for(;r!==t;){if(null===r)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(r.host){if(r.host.impl)return T(r.host.impl);if(r.host)return T(r.host);throw new Error("Lost in Web Components world")}return!1}if("none"===n.getComputedStyle(r).display)return!1;r=r.parentNode}return!0}function R(e){const t=e.ownerDocument.defaultView;let n=e;for(;n.parentNode;){if("0px"===n.style.height||"0"===n.style.height)return"hidden"===t.getComputedStyle(n).overflow;n=n.parentNode}return!1}function A(e){const t=e.ownerDocument,n=t.defaultView,r=t.documentElement;let o,i,s,a=e;for(o=a.offsetLeft,i=a.offsetTop,s=a;(a=a.offsetParent)&&a!==t.body&&"offsetLeft"in a;)o+=a.offsetLeft,i+=a.offsetTop,s=a;return s&&"fixed"===s.style.position&&(o+=n.pageXOffset||r.scrollLeft,i+=n.pageYOffset||r.scrollTop),{left:o,top:i}}function N(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollY}function L(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).scrollX}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e===t?N(t):e.scrollTop}function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e===t?L(t):e.scrollLeft}function I(e){let t=e.ownerDocument,n=t?t.defaultView:void 0;t||(t=e.document?e.document:e,n=t.defaultView);const r=["auto","scroll"];let o=e.parentNode;for(;o&&o.style&&t.body!==o;){let{overflow:e,overflowX:t,overflowY:i}=o.style;if([e,t,i].includes("scroll"))return o;if(({overflow:e,overflowX:t,overflowY:i}=n.getComputedStyle(o)),r.includes(e)||r.includes(t)||r.includes(i))return o;if(o.clientHeight<=o.scrollHeight+1&&(r.includes(i)||r.includes(e)))return o;if(o.clientWidth<=o.scrollWidth+1&&(r.includes(t)||r.includes(e)))return o;o=o.parentNode}return n}function k(e){return e.scrollHeight-e.clientHeight}function D(e){return e.scrollWidth-e.clientWidth}function P(e){const t=e.ownerDocument,n=t.defaultView;let r=e.parentNode;for(;r&&r.style&&t.body!==r;){if("visible"!==r.style.overflow&&""!==r.style.overflow)return r;const e=n.getComputedStyle(r),t=["scroll","hidden","auto"],o=e.getPropertyValue("overflow"),i=e.getPropertyValue("overflow-y"),s=e.getPropertyValue("overflow-x");if(t.includes(o)||t.includes(i)||t.includes(s))return r;r=r.parentNode}return n}function H(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;if(!e)return;if(e===n)return"width"===t?`${n.innerWidth}px`:"height"===t?`${n.innerHeight}px`:void 0;const r=e.style[t];if(""!==r&&void 0!==r)return r;const o=n.getComputedStyle(e);return""!==o[t]&&void 0!==o[t]?o[t]:void 0}function F(e){return e.offsetWidth}function Y(e){return e.offsetHeight}function V(e){return e.clientHeight||e.innerHeight}function U(e){return e.clientWidth||e.innerWidth}function B(e){return e.selectionStart?e.selectionStart:0}function W(e){return e.selectionEnd?e.selectionEnd:0}function j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;e.getSelection&&(e.getSelection().empty?e.getSelection().empty():e.getSelection().removeAllRanges&&e.getSelection().removeAllRanges())}function z(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(r){const o=e.parentNode,i=o.style.display;o.style.display="block",e.setSelectionRange(t,n),o.style.display=i}}}let G;function $(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return void 0===G&&(G=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;const t=e.createElement("div");t.style.height="200px",t.style.width="100%";const n=e.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(t),(e.body||e.documentElement).appendChild(n);const r=t.offsetWidth;n.style.overflow="scroll";let o=t.offsetWidth;return r===o&&(o=n.clientWidth),(e.body||e.documentElement).removeChild(n),r-o}(e)),G}function K(e){return e instanceof Window?e.document.body.scrollHeight>e.innerHeight:e.offsetWidth!==e.clientWidth}function X(e){return e instanceof Window?e.document.body.scrollWidth>e.innerWidth:e.offsetHeight!==e.clientHeight}function q(e,t,n){e.style.transform=`translate3d(${t},${n},0)`}function Q(e){e.style.transform&&""!==e.style.transform&&(e.style.transform="")}function J(e){return e&&(["INPUT","SELECT","TEXTAREA"].indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function Z(e){return J(e)&&!1===e.hasAttribute("data-hot-input")}function ee(e){return!e.parentNode}function te(e,t){new IntersectionObserver(((n,r)=>{n.forEach((n=>{n.isIntersecting&&null!==e.offsetParent&&(t(),r.unobserve(e))}))}),{root:e.ownerDocument.body}).observe(e)}function ne(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e.ownerDocument,i=r.createRange(),s=r.defaultView.getSelection();v(e,"contenteditable",!0),n&&v(e,...(0,o.MG)()),t&&y(e,"invisibleSelection"),i.selectNodeContents(e),s.removeAllRanges(),s.addRange(i)}function re(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e.ownerDocument.defaultView.getSelection();e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),n.removeAllRanges(),t&&w(e,"invisibleSelection"),e.removeAttribute("contenteditable")}function oe(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];ne(e,n),t(),re(e,n)}function ie(e){var t;const n=null==e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView.Element;return!!(n&&null!==n&&e instanceof n)}},20116:(e,t,n)=>{"use strict";var r=n(46518),o=n(69565),i=n(72652),s=n(79306),a=n(28551),l=n(1767),u=n(9539),h=n(84549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:h},{find:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}if(h)return o(h,this,e);var t=l(this),n=0;return i(t,(function(t,r){if(e(t,n++))return r(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},20397:(e,t,n)=>{"use strict";var r=n(97751);e.exports=r("document","documentElement")},20439:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var r=n(96540),o=n(19750);n(74848);const i=r.createContext(void 0);function s(e){return function({props:e,name:t}){return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?(0,o.A)(i.defaultProps,r):i.styleOverrides||i.variants?r:(0,o.A)(i,r)}({props:e,name:t,theme:{components:r.useContext(i)}})}(e)}},20838:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),r=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],o=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsRegex:o,monthsShortRegex:o,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:r,longMonthsParse:r,shortMonthsParse:r,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(95093))},21135:function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(95093))},21234:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>a,p0:()=>o});const r={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function i(e){return`${Math.round(e)}ms`}function s(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function a(e){const t={...r,...e.easing},n={...o,...e.duration};return{getAutoHeightDuration:s,create:(e=["all"],r={})=>{const{duration:o=n.standard,easing:s=t.easeInOut,delay:a=0,...l}=r;return(Array.isArray(e)?e:[e]).map((e=>`${e} ${"string"==typeof o?o:i(o)} ${s} ${"string"==typeof a?a:i(a)}`)).join(",")},...e,easing:t,duration:n}}},21362:(e,t,n)=>{"use strict";function r(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",a=!0;for(let e=0;er})},21827:function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){return 0===this.day()?"[la scorsa] dddd [alle] LT":"[lo scorso] dddd [alle] LT"},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(95093))},22195:(e,t,n)=>{"use strict";var r=n(79504),o=r({}.toString),i=r("".slice);e.exports=function(e){return i(o(e),8,-1)}},22257:(e,t,n)=>{"use strict";n.d(t,{KN:()=>s,oh:()=>l,ub:()=>a}),n(44114),n(79978),n(98992),n(54520),n(81454),n(8872);var r=n(65615);const o={" ":" ","&":"&","<":"<",">":">"},i=new RegExp(Object.keys(o).map((e=>`(${e})`)).join("|"),"gi");function s(e){const t=e.hasColHeaders(),n=e.hasRowHeaders(),o=[t?-1:0,n?-1:0,e.countRows()-1,e.countCols()-1],i=e.getData(...o),s=i.length,a=s>0?i[0].length:0,l=["","
"],u=t?["",""]:[],h=["",""],c=n?1:0,d=t?1:0;for(let o=0;o${e.getColHeader(t-c)}`;else if(a)u=`${e.getRowHeader(o-d)}`;else{const n=i[o][t],{hidden:s,rowspan:a,colspan:l}=e.getCellMeta(o-d,t-c);if(!s){const e=[];if(a&&e.push(`rowspan="${a}"`),l&&e.push(`colspan="${l}"`),(0,r.Im)(n))u=``;else{const t=n.toString().replace(//g,">").replace(/((\r\n|\n)?|\r\n|\n)/g,"
\r\n").replace(/\x20/gi," ").replace(/\t/gi," ");u=`${t}`}}}l.push(u)}const m=["",...l,""].join("");s?u.splice(1,0,m):h.splice(-1,0,m)}return l.splice(1,0,u.join(""),h.join("")),l.join("")}function a(e){const t=e.length,n=[""];for(let o=0;o");for(let e=0;e/g,">").replace(/((\r\n|\n)?|\r\n|\n)/g,"
\r\n").replace(/\x20{2,}/gi,(e=>`${" ".repeat(e.length-1)} `)).replace(/\t/gi," ");a.push(`
`)}n.push("",...a,""),o+1===t&&n.push("")}return n.push("
${n}
"),n.join("")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;const n={},r=t.createDocumentFragment(),s=t.createElement("div");r.appendChild(s);let a=e;if("string"==typeof a){const e=a.replace(/]*?>([\s\S]*?)<\/\s*td>/g,(e=>{const t=e.match(/]*?>/g)[0];return`${t}${e.substring(t.length,e.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(//g,"\n").replace("\n","").replaceAll(/<\/(.*)>\s+$/gm,"").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/gm,"")}`}));s.insertAdjacentHTML("afterbegin",`${e}`),a=s.querySelector("table")}if(!a||!function(e){return"TABLE"===(e&&e.nodeName||"")}(a))return;const l=s.querySelector('meta[name$="enerator"]'),u=null!==a.querySelector("tbody th"),h=a.querySelector("tr"),c=h?Array.from(h.cells).reduce(((e,t)=>e+t.colSpan),0)-(u?1:0):0,d=a.tFoot&&Array.from(a.tFoot.rows)||[],m=[];let p=!1,f=0,g=0;if(a.tHead){const e=Array.from(a.tHead.rows).filter((e=>{const t=null!==e.querySelector("td");return t&&m.push(e),!t}));f=e.length,p=f>0,f>1?n.nestedHeaders=Array.from(e).reduce(((e,t)=>{const n=Array.from(t.cells).reduce(((e,t,n)=>{if(u&&0===n)return e;const{colSpan:r,innerHTML:o}=t,i=r>1?{label:o,colspan:r}:o;return e.push(i),e}),[]);return e.push(n),e}),[]):p&&(n.colHeaders=Array.from(e[0].children).reduce(((e,t,n)=>(u&&0===n||e.push(t.innerHTML),e)),[]))}m.length&&(n.fixedRowsTop=m.length),d.length&&(n.fixedRowsBottom=d.length);const y=[...m,...Array.from(a.tBodies).reduce(((e,t)=>(e.push(...Array.from(t.rows)),e)),[]),...d];g=y.length;const w=new Array(g);for(let e=0;evoid 0===e));if("TD"===s){if(u>1||h>1){for(let t=e;t[\r\n]?[\x20]{0,3}/gim,"\r\n"):a.replace(/[\r\n]?/gim,"\r\n"),w[e][c]=t.replace(i,(e=>o[e]))}else _.push(a)}}return v.length&&(n.mergeCells=v),_.length&&(n.rowHeaders=_),w.length&&(n.data=w),n}},22274:function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"én time",hh:"%d timer",d:"én dag",dd:"%d dager",w:"én uke",ww:"%d uker",M:"én måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(95093))},22489:(e,t,n)=>{"use strict";var r=n(46518),o=n(69565),i=n(79306),s=n(28551),a=n(1767),l=n(19462),u=n(96319),h=n(96395),c=n(9539),d=n(30684),m=n(84549),p=!h&&!d("filter",(function(){})),f=!h&&!p&&m("filter",TypeError),g=h||p||f,y=l((function(){for(var e,t,n=this.iterator,r=this.predicate,i=this.next;;){if(e=s(o(i,n)),this.done=!!e.done)return;if(t=e.value,u(n,r,[t,this.counter++],!0))return t}}));r({target:"Iterator",proto:!0,real:!0,forced:g},{filter:function(e){s(this);try{i(e)}catch(e){c(this,"throw",e)}return f?o(f,this,e):new y(a(this),{predicate:e})}})},22812:e=>{"use strict";var t=TypeError;e.exports=function(e,n){if(e{"use strict";var r=n(85072),o=n.n(r),i=n(97825),s=n.n(i),a=n(77659),l=n.n(a),u=n(55056),h=n.n(u),c=n(10540),d=n.n(c),m=n(41113),p=n.n(m),f=n(47400),g={};g.styleTagTransform=p(),g.setAttributes=h(),g.insert=l().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=d(),o()(f.A,g),f.A&&f.A.locals&&f.A.locals},23167:(e,t,n)=>{"use strict";var r=n(94901),o=n(20034),i=n(52967);e.exports=function(e,t,n){var s,a;return i&&r(s=t.constructor)&&s!==n&&o(a=s.prototype)&&a!==n.prototype&&i(e,a),e}},23215:(e,t,n)=>{"use strict";n(81148)},23827:function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n(95093))},24337:(e,t,n)=>{"use strict";n.d(t,{c:()=>o,q:()=>r});const r=e=>e.scrollTop;function o(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??("number"==typeof n?n:n[t.mode]||0),easing:o.transitionTimingFunction??("object"==typeof r?r[t.mode]:r),delay:o.transitionDelay}}},24360:(e,t,n)=>{"use strict";n.d(t,{Pi:()=>ie,DU:()=>oe,aj:()=>le,Kq:()=>ae,V2:()=>se,Ob:()=>re}),n(44114);const{entries:r,setPrototypeOf:o,isFrozen:i,getPrototypeOf:s,getOwnPropertyDescriptor:a}=Object;let{freeze:l,seal:u,create:h}=Object,{apply:c,construct:d}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),u||(u=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),d||(d=function(e,t){return new e(...t)});const m=A(Array.prototype.forEach),p=A(Array.prototype.lastIndexOf),f=A(Array.prototype.pop),g=A(Array.prototype.push),y=A(Array.prototype.splice),w=A(String.prototype.toLowerCase),v=A(String.prototype.toString),_=A(String.prototype.match),b=A(String.prototype.replace),S=A(String.prototype.indexOf),C=A(String.prototype.trim),E=A(Object.prototype.hasOwnProperty),M=A(RegExp.prototype.test),T=(R=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:w;o&&o(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(i(t)||(t[r]=e),o=e)}e[o]=!0}return e}function L(e){for(let t=0;t/gm),G=u(/\$\{[\w\W]*/gm),$=u(/^data-[\-\w.\u00B7-\uFFFF]+$/),K=u(/^aria-[\-\w]+$/),X=u(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=u(/^(?:\w+script|data):/i),Q=u(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=u(/^html$/i),Z=u(/^[a-z][.\w]*(-[.\w]+)+$/i);var ee=Object.freeze({__proto__:null,ARIA_ATTR:K,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:Z,DATA_ATTR:$,DOCTYPE_NAME:J,ERB_EXPR:z,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:j,TMPLIT_EXPR:G});const te=function(){return"undefined"==typeof window?null:window};var ne=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:o}=t;const i=o,s=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:u,Node:c,Element:d,NodeFilter:R,NamedNodeMap:A=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:L,DOMParser:j,trustedTypes:z}=t,G=d.prototype,$=O(G,"cloneNode"),K=O(G,"remove"),q=O(G,"nextSibling"),Q=O(G,"childNodes"),Z=O(G,"parentNode");if("function"==typeof u){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let ne,re="";const{implementation:oe,createNodeIterator:ie,createDocumentFragment:se,getElementsByTagName:ae}=o,{importNode:le}=i;let ue={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof r&&"function"==typeof Z&&oe&&void 0!==oe.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ce,TMPLIT_EXPR:de,DATA_ATTR:me,ARIA_ATTR:pe,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:ye}=ee;let{IS_ALLOWED_URI:we}=ee,ve=null;const _e=N({},[...I,...k,...D,...H,...Y]);let be=null;const Se=N({},[...V,...U,...B,...W]);let Ce=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,Me=null,Te=!0,Re=!0,Ae=!1,Ne=!0,Le=!1,xe=!0,Oe=!1,Ie=!1,ke=!1,De=!1,Pe=!1,He=!1,Fe=!0,Ye=!1,Ve=!0,Ue=!1,Be={},We=null;const je=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ze=null;const Ge=N({},["audio","video","img","source","image","track"]);let $e=null;const Ke=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Je=Qe,Ze=!1,et=null;const tt=N({},[Xe,qe,Qe],v);let nt=N({},["mi","mo","mn","ms","mtext"]),rt=N({},["annotation-xml"]);const ot=N({},["title","style","font","a","script"]);let it=null;const st=["application/xhtml+xml","text/html"];let at=null,lt=null;const ut=o.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!lt||lt!==e){if(e&&"object"==typeof e||(e={}),e=x(e),it=-1===st.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,at="application/xhtml+xml"===it?v:w,ve=E(e,"ALLOWED_TAGS")?N({},e.ALLOWED_TAGS,at):_e,be=E(e,"ALLOWED_ATTR")?N({},e.ALLOWED_ATTR,at):Se,et=E(e,"ALLOWED_NAMESPACES")?N({},e.ALLOWED_NAMESPACES,v):tt,$e=E(e,"ADD_URI_SAFE_ATTR")?N(x(Ke),e.ADD_URI_SAFE_ATTR,at):Ke,ze=E(e,"ADD_DATA_URI_TAGS")?N(x(Ge),e.ADD_DATA_URI_TAGS,at):Ge,We=E(e,"FORBID_CONTENTS")?N({},e.FORBID_CONTENTS,at):je,Ee=E(e,"FORBID_TAGS")?N({},e.FORBID_TAGS,at):x({}),Me=E(e,"FORBID_ATTR")?N({},e.FORBID_ATTR,at):x({}),Be=!!E(e,"USE_PROFILES")&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,xe=!1!==e.SAFE_FOR_XML,Oe=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,Ve=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,we=e.ALLOWED_URI_REGEXP||X,Je=e.NAMESPACE||Qe,nt=e.MATHML_TEXT_INTEGRATION_POINTS||nt,rt=e.HTML_INTEGRATION_POINTS||rt,Ce=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Re=!1),Pe&&(De=!0),Be&&(ve=N({},Y),be=[],!0===Be.html&&(N(ve,I),N(be,V)),!0===Be.svg&&(N(ve,k),N(be,U),N(be,W)),!0===Be.svgFilters&&(N(ve,D),N(be,U),N(be,W)),!0===Be.mathMl&&(N(ve,H),N(be,B),N(be,W))),e.ADD_TAGS&&(ve===_e&&(ve=x(ve)),N(ve,e.ADD_TAGS,at)),e.ADD_ATTR&&(be===Se&&(be=x(be)),N(be,e.ADD_ATTR,at)),e.ADD_URI_SAFE_ATTR&&N($e,e.ADD_URI_SAFE_ATTR,at),e.FORBID_CONTENTS&&(We===je&&(We=x(We)),N(We,e.FORBID_CONTENTS,at)),Ve&&(ve["#text"]=!0),Oe&&N(ve,["html","head","body"]),ve.table&&(N(ve,["tbody"]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ne=e.TRUSTED_TYPES_POLICY,re=ne.createHTML("")}else void 0===ne&&(ne=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(z,s)),null!==ne&&"string"==typeof re&&(re=ne.createHTML(""));l&&l(e),lt=e}},dt=N({},[...k,...D,...P]),mt=N({},[...H,...F]),pt=function(e){g(n.removed,{element:e});try{Z(e).removeChild(e)}catch(t){K(e)}},ft=function(e,t){try{g(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){g(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(De||Pe)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},gt=function(e){let t=null,n=null;if(ke)e=""+e;else{const t=_(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===it&&Je===Qe&&(e=''+e+"");const r=ne?ne.createHTML(e):e;if(Je===Qe)try{t=(new j).parseFromString(r,it)}catch(e){}if(!t||!t.documentElement){t=oe.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Ze?re:r}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Je===Qe?ae.call(t,Oe?"html":"body")[0]:Oe?t.documentElement:i},yt=function(e){return ie.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof L&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof A)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof c&&e instanceof c};function _t(e,t,r){m(e,(e=>{e.call(n,t,r,lt)}))}const bt=function(e){let t=null;if(_t(ue.beforeSanitizeElements,e,null),wt(e))return pt(e),!0;const r=at(e.nodeName);if(_t(ue.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),xe&&e.hasChildNodes()&&!vt(e.firstElementChild)&&M(/<[/\w!]/g,e.innerHTML)&&M(/<[/\w!]/g,e.textContent))return pt(e),!0;if(7===e.nodeType)return pt(e),!0;if(xe&&8===e.nodeType&&M(/<[/\w]/g,e.data))return pt(e),!0;if(!ve[r]||Ee[r]){if(!Ee[r]&&Ct(r)){if(Ce.tagNameCheck instanceof RegExp&&M(Ce.tagNameCheck,r))return!1;if(Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(r))return!1}if(Ve&&!We[r]){const t=Z(e)||e.parentNode,n=Q(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const o=$(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,q(e))}}return pt(e),!0}return e instanceof d&&!function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=w(e.tagName),r=w(t.tagName);return!!et[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||nt[r]):Boolean(dt[n]):e.namespaceURI===Xe?t.namespaceURI===Qe?"math"===n:t.namespaceURI===qe?"math"===n&&rt[r]:Boolean(mt[n]):e.namespaceURI===Qe?!(t.namespaceURI===qe&&!rt[r])&&!(t.namespaceURI===Xe&&!nt[r])&&!mt[n]&&(ot[n]||!dt[n]):!("application/xhtml+xml"!==it||!et[e.namespaceURI]))}(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!M(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,m([he,ce,de],(e=>{t=b(t,e," ")})),e.textContent!==t&&(g(n.removed,{element:e.cloneNode()}),e.textContent=t)),_t(ue.afterSanitizeElements,e,null),!1):(pt(e),!0)},St=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in o||n in ut))return!1;if(Re&&!Me[t]&&M(me,t));else if(Te&&M(pe,t));else if(!be[t]||Me[t]){if(!(Ct(e)&&(Ce.tagNameCheck instanceof RegExp&&M(Ce.tagNameCheck,e)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(e))&&(Ce.attributeNameCheck instanceof RegExp&&M(Ce.attributeNameCheck,t)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(t))||"is"===t&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&M(Ce.tagNameCheck,n)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))))return!1}else if($e[t]);else if(M(we,b(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==S(n,"data:")||!ze[e])if(Ae&&!M(fe,b(n,ge,"")));else if(n)return!1;return!0},Ct=function(e){return"annotation-xml"!==e&&_(e,ye)},Et=function(e){_t(ue.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||wt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:s,namespaceURI:a,value:l}=i,u=at(s),h=l;let c="value"===s?h:C(h);if(r.attrName=u,r.attrValue=c,r.keepAttr=!0,r.forceKeepAttr=void 0,_t(ue.uponSanitizeAttribute,e,r),c=r.attrValue,!Ye||"id"!==u&&"name"!==u||(ft(s,e),c="user-content-"+c),xe&&M(/((--!?|])>)|<\/(style|title)/i,c)){ft(s,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){ft(s,e);continue}if(!Ne&&M(/\/>/i,c)){ft(s,e);continue}Le&&m([he,ce,de],(e=>{c=b(c,e," ")}));const d=at(e.nodeName);if(St(d,u,c)){if(ne&&"object"==typeof z&&"function"==typeof z.getAttributeType)if(a);else switch(z.getAttributeType(d,u)){case"TrustedHTML":c=ne.createHTML(c);break;case"TrustedScriptURL":c=ne.createScriptURL(c)}if(c!==h)try{a?e.setAttributeNS(a,s,c):e.setAttribute(s,c),wt(e)?pt(e):f(n.removed)}catch(t){ft(s,e)}}else ft(s,e)}_t(ue.afterSanitizeAttributes,e,null)},Mt=function e(t){let n=null;const r=yt(t);for(_t(ue.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)_t(ue.uponSanitizeShadowNode,n,null),bt(n),Et(n),n.content instanceof a&&e(n.content);_t(ue.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,l=null;if(Ze=!e,Ze&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw T("toString is not a function");if("string"!=typeof(e=e.toString()))throw T("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ie||ct(t),n.removed=[],"string"==typeof e&&(Ue=!1),Ue){if(e.nodeName){const t=at(e.nodeName);if(!ve[t]||Ee[t])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=gt("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!De&&!Le&&!Oe&&-1===e.indexOf("<"))return ne&&He?ne.createHTML(e):e;if(r=gt(e),!r)return De?null:He?re:""}r&&ke&&pt(r.firstChild);const u=yt(Ue?e:r);for(;s=u.nextNode();)bt(s),Et(s),s.content instanceof a&&Mt(s.content);if(Ue)return e;if(De){if(Pe)for(l=se.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(be.shadowroot||be.shadowrootmode)&&(l=le.call(i,l,!0)),l}let h=Oe?r.outerHTML:r.innerHTML;return Oe&&ve["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&M(J,r.ownerDocument.doctype.name)&&(h="\n"+h),Le&&m([he,ce,de],(e=>{h=b(h,e," ")})),ne&&He?ne.createHTML(h):h},n.setConfig=function(){ct(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ie=!0},n.clearConfig=function(){lt=null,Ie=!1},n.isValidAttribute=function(e,t,n){lt||ct({});const r=at(e),o=at(t);return St(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&g(ue[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=p(ue[e],t);return-1===n?void 0:y(ue[e],n,1)[0]}return f(ue[e])},n.removeHooks=function(e){ue[e]=[]},n.removeAllHooks=function(){ue={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function re(e){return e[0].toUpperCase()+e.substr(1)}function oe(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()}function ie(e){return/^([0-9][0-9]?%$)|(^100%$)/.test(e)}function se(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return`${e}`.replace(/(?:\\)?\[([^[\]]+)]/g,((e,n)=>"\\"===e.charAt(0)?e.substr(1,e.length-1):void 0===t[n]?"":t[n]))}function ae(e){return le(`${e}`,{ALLOWED_TAGS:[]})}function le(e,t){return ne.sanitize(e,t)}},24457:function(e,t,n){!function(e){"use strict";function t(e,t,n){var r=" ";return(e%100>=20||e>=100&&e%100==0)&&(r=" de "),e+r+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n(95093))},24496:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n(95093))},24659:(e,t,n)=>{"use strict";var r=n(79039),o=n(6980);e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",o(1,7)),7!==e.stack)}))},24684:(e,t,n)=>{"use strict";n.d(t,{E:()=>f,T:()=>h,c:()=>m,h:()=>c,w:()=>u});var r=n(96540),o=n(55655),i=n(30041),s=n(43174),a=n(71287),l=r.createContext("undefined"!=typeof HTMLElement?(0,o.A)({key:"css"}):null),u=(l.Provider,function(e){return(0,r.forwardRef)((function(t,n){var o=(0,r.useContext)(l);return e(t,o,n)}))}),h=r.createContext({}),c={}.hasOwnProperty,d="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",m=function(e,t){var n={};for(var r in t)c.call(t,r)&&(n[r]=t[r]);return n[d]=e,n},p=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return(0,i.SF)(t,n,r),(0,a.s)((function(){return(0,i.sk)(t,n,r)})),null},f=u((function(e,t,n){var o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var a=e[d],l=[o],u="";"string"==typeof e.className?u=(0,i.Rk)(t.registered,l,e.className):null!=e.className&&(u=e.className+" ");var m=(0,s.J)(l,void 0,r.useContext(h));u+=t.key+"-"+m.name;var f={};for(var g in e)c.call(e,g)&&"css"!==g&&g!==d&&(f[g]=e[g]);return f.className=u,n&&(f.ref=n),r.createElement(r.Fragment,null,r.createElement(p,{cache:t,serialized:m,isStringTag:"string"==typeof a}),r.createElement(a,f))}))},24890:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,v:()=>i});var r=n(96148),o=n(1908);function i(e){return(0,o.Ay)("MuiOutlinedInput",e)}const s={...n(26410).A,...(0,r.A)("MuiOutlinedInput",["root","notchedOutline","input"])}},24902:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(96540);function o(...e){const t=r.useRef(void 0),n=r.useCallback((t=>{const n=e.map((e=>{if(null==e)return null;if("function"==typeof e){const n=e,r=n(t);return"function"==typeof r?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}));return()=>{n.forEach((e=>e?.()))}}),e);return r.useMemo((()=>e.every((e=>null==e))?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=n(e))}),e)}},24913:(e,t,n)=>{"use strict";var r=n(43724),o=n(35917),i=n(48686),s=n(28551),a=n(56969),l=TypeError,u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,c="enumerable",d="configurable",m="writable";t.f=r?i?function(e,t,n){if(s(e),t=a(t),s(n),"function"==typeof e&&"prototype"===t&&"value"in n&&m in n&&!n[m]){var r=h(e,t);r&&r[m]&&(e[t]=n.value,n={configurable:d in n?n[d]:r[d],enumerable:c in n?n[c]:r[c],writable:!1})}return u(e,t,n)}:u:function(e,t,n){if(s(e),t=a(t),s(n),o)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},25155:(e,t,n)=>{"use strict";n.d(t,{CA:()=>o,Ml:()=>a,d:()=>i,kH:()=>l,nO:()=>s,zg:()=>u});var r=n(20091);function o(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function i(e){return!1===e.isImmediatePropagationEnabled}function s(e){return 2===e.button}function a(e){return 0===e.button}function l(e){return e instanceof TouchEvent}function u(e,t){const n={x:e.offsetX,y:e.offsetY};let o=e.target;if(!(0,r.sb)(t)||o!==t&&o.contains(t))return n;for(;o!==t;)n.x+=o.offsetLeft,n.y+=o.offsetTop,o=o.offsetParent;return n}},25170:(e,t,n)=>{"use strict";var r=n(46706),o=n(94402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},25177:function(e,t,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(95093))},25397:(e,t,n)=>{"use strict";var r=n(47055),o=n(67750);e.exports=function(e){return r(o(e))}},25745:(e,t,n)=>{"use strict";var r=n(77629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},26111:function(e,t,n){!function(e){"use strict";function t(e,t,n,r){var o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?o[n][0]:o[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(95093))},26198:(e,t,n)=>{"use strict";var r=n(18014);e.exports=function(e){return r(e.length)}},26269:e=>{"use strict";e.exports={}},26308:function(e,t,n){!function(e){"use strict";function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return r+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return r+(1===e?"dan":"dana");case"MM":return r+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return r+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n(95093))},26410:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,g:()=>i});var r=n(96148),o=n(1908);function i(e){return(0,o.Ay)("MuiInputBase",e)}const s=(0,r.A)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"])},26435:function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n(95093))},26739:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>a});var r=n(63248),o=n(4894),i=n(31355),s=n(98855);const a=(0,r.Ay)({themeId:i.A,defaultTheme:o.A,rootShouldForwardProp:s.A})},27088:function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n(95093))},27476:(e,t,n)=>{"use strict";var r=n(22195),o=n(79504);e.exports=function(e){if("Function"===r(e))return o(e)}},28040:(e,t,n)=>{"use strict";n.d(t,{A:()=>J});var r=n(4076),o=n(836),i=n(82777);const s={black:"#000",white:"#fff"},a={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},l={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},u={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},h={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},c={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},d={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},m={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function p(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:s.white,default:s.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const f=p();function g(){return{text:{primary:s.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:s.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const y=g();function w(e,t,n,r){const o=r.light||r,s=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,i.a)(e.main,o):"dark"===t&&(e.dark=(0,i.e$)(e.main,s)))}function v(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:v=.2,..._}=e,b=e.primary||function(e="light"){return"dark"===e?{main:c[200],light:c[50],dark:c[400]}:{main:c[700],light:c[400],dark:c[800]}}(t),S=e.secondary||function(e="light"){return"dark"===e?{main:l[200],light:l[50],dark:l[400]}:{main:l[500],light:l[300],dark:l[700]}}(t),C=e.error||function(e="light"){return"dark"===e?{main:u[500],light:u[300],dark:u[700]}:{main:u[700],light:u[400],dark:u[800]}}(t),E=e.info||function(e="light"){return"dark"===e?{main:d[400],light:d[300],dark:d[700]}:{main:d[700],light:d[500],dark:d[900]}}(t),M=e.success||function(e="light"){return"dark"===e?{main:m[400],light:m[300],dark:m[700]}:{main:m[800],light:m[500],dark:m[900]}}(t),T=e.warning||function(e="light"){return"dark"===e?{main:h[400],light:h[300],dark:h[700]}:{main:"#ed6c02",light:h[500],dark:h[900]}}(t);function R(e){return(0,i.eM)(e,y.text.primary)>=n?y.text.primary:f.text.primary}const A=({color:e,name:t,mainShade:n=500,lightShade:o=300,darkShade:i=700})=>{if(!(e={...e}).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error((0,r.A)(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw new Error((0,r.A)(12,t?` (${t})`:"",JSON.stringify(e.main)));return w(e,"light",o,v),w(e,"dark",i,v),e.contrastText||(e.contrastText=R(e.main)),e};let N;return"light"===t?N=p():"dark"===t&&(N=g()),(0,o.A)({common:{...s},mode:t,primary:A({color:b,name:"primary"}),secondary:A({color:S,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:A({color:C,name:"error"}),warning:A({color:T,name:"warning"}),info:A({color:E,name:"info"}),success:A({color:M,name:"success"}),grey:a,contrastThreshold:n,getContrastText:R,augmentColor:A,tonalOffset:v,...N},_)}function _(e=""){function t(...n){if(!n.length)return"";const r=n[0];return"string"!=typeof r||r.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, ${r}`:`, var(--${e?`${e}-`:""}${r}${t(...n.slice(1))})`}return(n,...r)=>`var(--${e?`${e}-`:""}${n}${t(...r)})`}var b=n(33372),S=n(93781);function C(e){const t={};return Object.entries(e).forEach((e=>{const[n,r]=e;"object"==typeof r&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)})),t}const E=(e,t,n,r=[])=>{let o=e;t.forEach(((e,i)=>{i===t.length-1?Array.isArray(o)?o[Number(e)]=n:o&&"object"==typeof o&&(o[e]=n):o&&"object"==typeof o&&(o[e]||(o[e]=r.includes(e)?[]:{}),o=o[e])}))};function M(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},i={},s={};var a,l;return a=(e,t,a)=>{if(!("string"!=typeof t&&"number"!=typeof t||r&&r(e,t))){const r=`--${n?`${n}-`:""}${e.join("-")}`,l=((e,t)=>"number"==typeof t?["lineHeight","fontWeight","opacity","zIndex"].some((t=>e.includes(t)))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t)(e,t);Object.assign(o,{[r]:l}),E(i,e,`var(${r})`,a),E(s,e,`var(${r}, ${l})`,a)}},l=e=>"vars"===e[0],function e(t,n=[],r=[]){Object.entries(t).forEach((([t,o])=>{(!l||l&&!l([...n,t]))&&null!=o&&("object"==typeof o&&Object.keys(o).length>0?e(o,[...n,t],Array.isArray(o)?[...r,t]:r):a([...n,t],o,r))}))}(e),{css:o,vars:i,varsWithDefaults:s}}const T=function(e,t={}){const{getSelector:n=y,disableCssColorScheme:r,colorSchemeSelector:i}=t,{colorSchemes:s={},components:a,defaultColorScheme:l="light",...u}=e,{vars:h,css:c,varsWithDefaults:d}=M(u,t);let m=d;const p={},{[l]:f,...g}=s;if(Object.entries(g||{}).forEach((([e,n])=>{const{vars:r,css:i,varsWithDefaults:s}=M(n,t);m=(0,o.A)(m,s),p[e]={css:i,vars:r}})),f){const{css:e,vars:n,varsWithDefaults:r}=M(f,t);m=(0,o.A)(m,r),p[l]={css:e,vars:n}}function y(t,n){let r=i;if("class"===i&&(r=".%s"),"data"===i&&(r="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(r=`[${i}="%s"]`),t){if("media"===r){if(e.defaultColorScheme===t)return":root";const r=s[t]?.palette?.mode||t;return{[`@media (prefers-color-scheme: ${r})`]:{":root":n}}}if(r)return e.defaultColorScheme===t?`:root, ${r.replace("%s",String(t))}`:r.replace("%s",String(t))}return":root"}return{vars:m,generateThemeVars:()=>{let e={...h};return Object.entries(p).forEach((([,{vars:t}])=>{e=(0,o.A)(e,t)})),e},generateStyleSheets:()=>{const t=[],o=e.defaultColorScheme||"light";function i(e,n){Object.keys(n).length&&t.push("string"==typeof e?{[e]:{...n}}:e)}i(n(void 0,{...c}),c);const{[o]:a,...l}=p;if(a){const{css:e}=a,t=s[o]?.palette?.mode,l=!r&&t?{colorScheme:t,...e}:{...e};i(n(o,{...l}),l)}return Object.entries(l).forEach((([e,{css:t}])=>{const o=s[e]?.palette?.mode,a=!r&&o?{colorScheme:o,...t}:{...t};i(n(e,{...a}),a)})),t}}};var R=n(98762),A=n(95548),N=n(65387);const L={textTransform:"uppercase"},x='"Roboto", "Helvetica", "Arial", sans-serif';function O(e,t){const{fontFamily:n=x,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:u=16,allVariants:h,pxToRem:c,...d}="function"==typeof t?t(e):t,m=r/14,p=c||(e=>e/u*m+"rem"),f=(e,t,r,o,i)=>{return{fontFamily:n,fontWeight:e,fontSize:p(t),lineHeight:r,...n===x?{letterSpacing:(s=o/t,Math.round(1e5*s)/1e5+"em")}:{},...i,...h};var s},g={h1:f(i,96,1.167,-1.5),h2:f(i,60,1.2,-.5),h3:f(s,48,1.167,0),h4:f(s,34,1.235,.25),h5:f(s,24,1.334,0),h6:f(a,20,1.6,.15),subtitle1:f(s,16,1.75,.15),subtitle2:f(a,14,1.57,.1),body1:f(s,16,1.5,.15),body2:f(s,14,1.43,.15),button:f(a,14,1.75,.4,L),caption:f(s,12,1.66,.4),overline:f(s,12,2.66,1,L),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,o.A)({htmlFontSize:u,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l,...g},d,{clone:!1})}function I(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const k=["none",I(0,2,1,-1,0,1,1,0,0,1,3,0),I(0,3,1,-2,0,2,2,0,0,1,5,0),I(0,3,3,-2,0,3,4,0,0,1,8,0),I(0,2,4,-1,0,4,5,0,0,1,10,0),I(0,3,5,-1,0,5,8,0,0,1,14,0),I(0,3,5,-1,0,6,10,0,0,1,18,0),I(0,4,5,-2,0,7,10,1,0,2,16,1),I(0,5,5,-3,0,8,10,1,0,3,14,2),I(0,5,6,-3,0,9,12,1,0,3,16,2),I(0,6,6,-3,0,10,14,1,0,4,18,3),I(0,6,7,-4,0,11,15,1,0,4,20,3),I(0,7,8,-4,0,12,17,2,0,5,22,4),I(0,7,8,-4,0,13,19,2,0,5,24,4),I(0,7,9,-4,0,14,21,2,0,5,26,4),I(0,8,9,-5,0,15,22,2,0,6,28,5),I(0,8,10,-5,0,16,24,2,0,6,30,5),I(0,8,11,-5,0,17,26,2,0,6,32,5),I(0,9,11,-5,0,18,28,2,0,7,34,6),I(0,9,12,-6,0,19,29,2,0,7,36,6),I(0,10,13,-6,0,20,31,3,0,8,38,7),I(0,10,13,-6,0,21,33,3,0,8,40,7),I(0,10,14,-6,0,22,35,3,0,8,42,7),I(0,11,14,-7,0,23,36,3,0,9,44,8),I(0,11,15,-7,0,24,38,3,0,9,46,8)];var D=n(21234);const P={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function H(e={}){const t={...e};return function e(t){const n=Object.entries(t);for(let i=0;i(0,o.A)(e,t)),p),p.unstable_sxConfig={...R.A,...c?.unstable_sxConfig},p.unstable_sx=function(e){return(0,A.A)({sx:e,theme:this})},p.toRuntimeSource=H,p};var Y=n(34578);const V=[...Array(25)].map(((e,t)=>{if(0===t)return"none";const n=(0,Y.A)(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`}));function U(e){return{inputPlaceholder:"dark"===e?.5:.42,inputUnderline:"dark"===e?.7:.42,switchTrackDisabled:"dark"===e?.2:.12,switchTrack:"dark"===e?.3:.38}}function B(e){return"dark"===e?V:[]}function W(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const j=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if("class"===o&&(i=".%s"),"data"===o&&(i="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if("dark"===t){const o={};return(s=e.cssVarPrefix,[...[...Array(25)].map(((e,t)=>`--${s?`${s}-`:""}overlays-${t}`)),`--${s?`${s}-`:""}palette-AppBar-darkBg`,`--${s?`${s}-`:""}palette-AppBar-darkColor`]).forEach((e=>{o[e]=n[e],delete n[e]})),"media"===i?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:o}}:i?{[i.replace("%s",t)]:o,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...o}}}if(i&&"media"!==i)return`${r}, ${i.replace("%s",String(t))}`}else if(t){if("media"===i)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}var s;return r};function z(e,t,n){!e[t]&&n&&(e[t]=n)}function G(e){return"string"==typeof e&&e.startsWith("hsl")?(0,i.YL)(e):e}function $(e,t){`${t}Channel`in e||(e[`${t}Channel`]=(0,i.Me)(G(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().\nTo suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}const K=e=>{try{return e()}catch(e){}},X=(e="mui")=>_(e);function q(e,t,n,r){if(!t)return;t=!0===t?{}:t;const o="dark"===r?"dark":"light";if(!n)return void(e[r]=function(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...o}=e,i=v(t);return{palette:i,opacity:{...U(i.mode),...n},overlays:r||B(i.mode),...o}}({...t,palette:{mode:o,...t?.palette}}));const{palette:i,...s}=F({...n,palette:{mode:o,...t?.palette}});return e[r]={...t,palette:i,opacity:{...U(o),...t?.opacity},overlays:t?.overlays||B(o)},s}function Q(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...!0!==n&&n,palette:v({...!0===n?{}:n.palette,mode:t})})}function J(e={},...t){const{palette:n,cssVariables:s=!1,colorSchemes:a=(n?void 0:{light:!0}),defaultColorScheme:l=n?.mode,...u}=e,h=l||"light",c=a?.[h],d={...a,...n?{[h]:{..."boolean"!=typeof c&&c,palette:n}}:void 0};if(!1===s){if(!("colorSchemes"in e))return F(e,...t);let r=n;"palette"in e||d[h]&&(!0!==d[h]?r=d[h].palette:"dark"===h&&(r={mode:"dark"}));const o=F({...e,palette:r},...t);return o.defaultColorScheme=h,o.colorSchemes=d,"light"===o.palette.mode&&(o.colorSchemes.light={...!0!==d.light&&d.light,palette:o.palette},Q(o,"dark",d.dark)),"dark"===o.palette.mode&&(o.colorSchemes.dark={...!0!==d.dark&&d.dark,palette:o.palette},Q(o,"light",d.light)),o}return n||"light"in d||"light"!==h||(d.light=!0),function(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:s,disableCssColorScheme:a=!1,cssVarPrefix:l="mui",shouldSkipGeneratingVar:u=W,colorSchemeSelector:h=(n.light&&n.dark?"media":void 0),rootSelector:c=":root",...d}=e,m=Object.keys(n)[0],p=s||(n.light&&"light"!==m?"light":m),f=X(l),{[p]:g,light:y,dark:w,...v}=n,_={...v};let E=g;if(("dark"===p&&!("dark"in n)||"light"===p&&!("light"in n))&&(E=!0),!E)throw new Error((0,r.A)(21,p));const M=q(_,E,d,p);y&&!_.light&&q(_,y,void 0,"light"),w&&!_.dark&&q(_,w,void 0,"dark");let N={defaultColorScheme:p,...M,cssVarPrefix:l,colorSchemeSelector:h,rootSelector:c,getCssVar:f,colorSchemes:_,font:{...C(M.typography),...M.font},spacing:(L=d.spacing,"number"==typeof L?`${L}px`:"string"==typeof L||"function"==typeof L||Array.isArray(L)?L:"8px")};var L;Object.keys(N.colorSchemes).forEach((e=>{const t=N.colorSchemes[e].palette,n=e=>{const n=e.split("-"),r=n[1],o=n[2];return f(e,t[r][o])};var r;if("light"===t.mode&&(z(t.common,"background","#fff"),z(t.common,"onBackground","#000")),"dark"===t.mode&&(z(t.common,"background","#000"),z(t.common,"onBackground","#fff")),r=t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach((e=>{r[e]||(r[e]={})})),"light"===t.mode){z(t.Alert,"errorColor",(0,i.Nd)(t.error.light,.6)),z(t.Alert,"infoColor",(0,i.Nd)(t.info.light,.6)),z(t.Alert,"successColor",(0,i.Nd)(t.success.light,.6)),z(t.Alert,"warningColor",(0,i.Nd)(t.warning.light,.6)),z(t.Alert,"errorFilledBg",n("palette-error-main")),z(t.Alert,"infoFilledBg",n("palette-info-main")),z(t.Alert,"successFilledBg",n("palette-success-main")),z(t.Alert,"warningFilledBg",n("palette-warning-main")),z(t.Alert,"errorFilledColor",K((()=>t.getContrastText(t.error.main)))),z(t.Alert,"infoFilledColor",K((()=>t.getContrastText(t.info.main)))),z(t.Alert,"successFilledColor",K((()=>t.getContrastText(t.success.main)))),z(t.Alert,"warningFilledColor",K((()=>t.getContrastText(t.warning.main)))),z(t.Alert,"errorStandardBg",(0,i.j4)(t.error.light,.9)),z(t.Alert,"infoStandardBg",(0,i.j4)(t.info.light,.9)),z(t.Alert,"successStandardBg",(0,i.j4)(t.success.light,.9)),z(t.Alert,"warningStandardBg",(0,i.j4)(t.warning.light,.9)),z(t.Alert,"errorIconColor",n("palette-error-main")),z(t.Alert,"infoIconColor",n("palette-info-main")),z(t.Alert,"successIconColor",n("palette-success-main")),z(t.Alert,"warningIconColor",n("palette-warning-main")),z(t.AppBar,"defaultBg",n("palette-grey-100")),z(t.Avatar,"defaultBg",n("palette-grey-400")),z(t.Button,"inheritContainedBg",n("palette-grey-300")),z(t.Button,"inheritContainedHoverBg",n("palette-grey-A100")),z(t.Chip,"defaultBorder",n("palette-grey-400")),z(t.Chip,"defaultAvatarColor",n("palette-grey-700")),z(t.Chip,"defaultIconColor",n("palette-grey-700")),z(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),z(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),z(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),z(t.LinearProgress,"primaryBg",(0,i.j4)(t.primary.main,.62)),z(t.LinearProgress,"secondaryBg",(0,i.j4)(t.secondary.main,.62)),z(t.LinearProgress,"errorBg",(0,i.j4)(t.error.main,.62)),z(t.LinearProgress,"infoBg",(0,i.j4)(t.info.main,.62)),z(t.LinearProgress,"successBg",(0,i.j4)(t.success.main,.62)),z(t.LinearProgress,"warningBg",(0,i.j4)(t.warning.main,.62)),z(t.Skeleton,"bg",`rgba(${n("palette-text-primaryChannel")} / 0.11)`),z(t.Slider,"primaryTrack",(0,i.j4)(t.primary.main,.62)),z(t.Slider,"secondaryTrack",(0,i.j4)(t.secondary.main,.62)),z(t.Slider,"errorTrack",(0,i.j4)(t.error.main,.62)),z(t.Slider,"infoTrack",(0,i.j4)(t.info.main,.62)),z(t.Slider,"successTrack",(0,i.j4)(t.success.main,.62)),z(t.Slider,"warningTrack",(0,i.j4)(t.warning.main,.62));const e=(0,i.Y9)(t.background.default,.8);z(t.SnackbarContent,"bg",e),z(t.SnackbarContent,"color",K((()=>t.getContrastText(e)))),z(t.SpeedDialAction,"fabHoverBg",(0,i.Y9)(t.background.paper,.15)),z(t.StepConnector,"border",n("palette-grey-400")),z(t.StepContent,"border",n("palette-grey-400")),z(t.Switch,"defaultColor",n("palette-common-white")),z(t.Switch,"defaultDisabledColor",n("palette-grey-100")),z(t.Switch,"primaryDisabledColor",(0,i.j4)(t.primary.main,.62)),z(t.Switch,"secondaryDisabledColor",(0,i.j4)(t.secondary.main,.62)),z(t.Switch,"errorDisabledColor",(0,i.j4)(t.error.main,.62)),z(t.Switch,"infoDisabledColor",(0,i.j4)(t.info.main,.62)),z(t.Switch,"successDisabledColor",(0,i.j4)(t.success.main,.62)),z(t.Switch,"warningDisabledColor",(0,i.j4)(t.warning.main,.62)),z(t.TableCell,"border",(0,i.j4)((0,i.Cg)(t.divider,1),.88)),z(t.Tooltip,"bg",(0,i.Cg)(t.grey[700],.92))}if("dark"===t.mode){z(t.Alert,"errorColor",(0,i.j4)(t.error.light,.6)),z(t.Alert,"infoColor",(0,i.j4)(t.info.light,.6)),z(t.Alert,"successColor",(0,i.j4)(t.success.light,.6)),z(t.Alert,"warningColor",(0,i.j4)(t.warning.light,.6)),z(t.Alert,"errorFilledBg",n("palette-error-dark")),z(t.Alert,"infoFilledBg",n("palette-info-dark")),z(t.Alert,"successFilledBg",n("palette-success-dark")),z(t.Alert,"warningFilledBg",n("palette-warning-dark")),z(t.Alert,"errorFilledColor",K((()=>t.getContrastText(t.error.dark)))),z(t.Alert,"infoFilledColor",K((()=>t.getContrastText(t.info.dark)))),z(t.Alert,"successFilledColor",K((()=>t.getContrastText(t.success.dark)))),z(t.Alert,"warningFilledColor",K((()=>t.getContrastText(t.warning.dark)))),z(t.Alert,"errorStandardBg",(0,i.Nd)(t.error.light,.9)),z(t.Alert,"infoStandardBg",(0,i.Nd)(t.info.light,.9)),z(t.Alert,"successStandardBg",(0,i.Nd)(t.success.light,.9)),z(t.Alert,"warningStandardBg",(0,i.Nd)(t.warning.light,.9)),z(t.Alert,"errorIconColor",n("palette-error-main")),z(t.Alert,"infoIconColor",n("palette-info-main")),z(t.Alert,"successIconColor",n("palette-success-main")),z(t.Alert,"warningIconColor",n("palette-warning-main")),z(t.AppBar,"defaultBg",n("palette-grey-900")),z(t.AppBar,"darkBg",n("palette-background-paper")),z(t.AppBar,"darkColor",n("palette-text-primary")),z(t.Avatar,"defaultBg",n("palette-grey-600")),z(t.Button,"inheritContainedBg",n("palette-grey-800")),z(t.Button,"inheritContainedHoverBg",n("palette-grey-700")),z(t.Chip,"defaultBorder",n("palette-grey-700")),z(t.Chip,"defaultAvatarColor",n("palette-grey-300")),z(t.Chip,"defaultIconColor",n("palette-grey-300")),z(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),z(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),z(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),z(t.LinearProgress,"primaryBg",(0,i.Nd)(t.primary.main,.5)),z(t.LinearProgress,"secondaryBg",(0,i.Nd)(t.secondary.main,.5)),z(t.LinearProgress,"errorBg",(0,i.Nd)(t.error.main,.5)),z(t.LinearProgress,"infoBg",(0,i.Nd)(t.info.main,.5)),z(t.LinearProgress,"successBg",(0,i.Nd)(t.success.main,.5)),z(t.LinearProgress,"warningBg",(0,i.Nd)(t.warning.main,.5)),z(t.Skeleton,"bg",`rgba(${n("palette-text-primaryChannel")} / 0.13)`),z(t.Slider,"primaryTrack",(0,i.Nd)(t.primary.main,.5)),z(t.Slider,"secondaryTrack",(0,i.Nd)(t.secondary.main,.5)),z(t.Slider,"errorTrack",(0,i.Nd)(t.error.main,.5)),z(t.Slider,"infoTrack",(0,i.Nd)(t.info.main,.5)),z(t.Slider,"successTrack",(0,i.Nd)(t.success.main,.5)),z(t.Slider,"warningTrack",(0,i.Nd)(t.warning.main,.5));const e=(0,i.Y9)(t.background.default,.98);z(t.SnackbarContent,"bg",e),z(t.SnackbarContent,"color",K((()=>t.getContrastText(e)))),z(t.SpeedDialAction,"fabHoverBg",(0,i.Y9)(t.background.paper,.15)),z(t.StepConnector,"border",n("palette-grey-600")),z(t.StepContent,"border",n("palette-grey-600")),z(t.Switch,"defaultColor",n("palette-grey-300")),z(t.Switch,"defaultDisabledColor",n("palette-grey-600")),z(t.Switch,"primaryDisabledColor",(0,i.Nd)(t.primary.main,.55)),z(t.Switch,"secondaryDisabledColor",(0,i.Nd)(t.secondary.main,.55)),z(t.Switch,"errorDisabledColor",(0,i.Nd)(t.error.main,.55)),z(t.Switch,"infoDisabledColor",(0,i.Nd)(t.info.main,.55)),z(t.Switch,"successDisabledColor",(0,i.Nd)(t.success.main,.55)),z(t.Switch,"warningDisabledColor",(0,i.Nd)(t.warning.main,.55)),z(t.TableCell,"border",(0,i.Nd)((0,i.Cg)(t.divider,1),.68)),z(t.Tooltip,"bg",(0,i.Cg)(t.grey[700],.92))}$(t.background,"default"),$(t.background,"paper"),$(t.common,"background"),$(t.common,"onBackground"),$(t,"divider"),Object.keys(t).forEach((e=>{const n=t[e];"tonalOffset"!==e&&n&&"object"==typeof n&&(n.main&&z(t[e],"mainChannel",(0,i.Me)(G(n.main))),n.light&&z(t[e],"lightChannel",(0,i.Me)(G(n.light))),n.dark&&z(t[e],"darkChannel",(0,i.Me)(G(n.dark))),n.contrastText&&z(t[e],"contrastTextChannel",(0,i.Me)(G(n.contrastText))),"text"===e&&($(t[e],"primary"),$(t[e],"secondary")),"action"===e&&(n.active&&$(t[e],"active"),n.selected&&$(t[e],"selected")))}))})),N=t.reduce(((e,t)=>(0,o.A)(e,t)),N);const x={prefix:l,disableCssColorScheme:a,shouldSkipGeneratingVar:u,getSelector:j(N)},{vars:O,generateThemeVars:I,generateStyleSheets:k}=T(N,x);return N.vars=O,Object.entries(N.colorSchemes[N.defaultColorScheme]).forEach((([e,t])=>{N[e]=t})),N.generateThemeVars=I,N.generateStyleSheets=k,N.generateSpacing=function(){return(0,b.A)(d.spacing,(0,S.LX)(this))},N.getColorSchemeSelector=function(e){return function(t){return"media"===e?`@media (prefers-color-scheme: ${t})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${t}"] &`:"class"===e?`.${t} &`:"data"===e?`[data-${t}] &`:`${e.replace("%s",t)} &`:"&"}}(h),N.spacing=N.generateSpacing(),N.shouldSkipGeneratingVar=u,N.unstable_sxConfig={...R.A,...d?.unstable_sxConfig},N.unstable_sx=function(e){return(0,A.A)({sx:e,theme:this})},N.toRuntimeSource=H,N}({...u,colorSchemes:d,defaultColorScheme:h,..."boolean"!=typeof s&&s},...t)}},28061:(e,t,n)=>{"use strict";n.d(t,{A:()=>i}),n(16280),n(44114);var r=n(25155);let o=0;const i=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;var t,n,r;t=this,r=void 0,(n=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(n="context"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];function s(e){n.call(this,function(e){const t=e.stopImmediatePropagation;return e.stopImmediatePropagation=function(){t.apply(this),(0,r.CA)(this)},e}(e))}return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:s,options:i,eventManager:this}),e.addEventListener(t,s,i),o+=1,()=>{this.removeEventListener(e,t,n)}}removeEventListener(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=this.context.eventListeners.length;for(;s;)if(s-=1,r=this.context.eventListeners[s],r.event===t&&r.element===e){if(n&&n!==r.callback)continue;if(i&&r.eventManager!==this)continue;this.context.eventListeners.splice(s,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options),o-=1}}clearEvents(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.context)return;let t=this.context.eventListeners.length;for(;t;){t-=1;const n=this.context.eventListeners[t];e&&n.eventManager!==this||(this.context.eventListeners.splice(t,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options),o-=1)}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,t){let n=e.document,r=e;n||(n=e.ownerDocument?e.ownerDocument:e,r=n.defaultView);const o={bubbles:!0,cancelable:"mousemove"!==t,view:r,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};let i;n.createEvent?(i=n.createEvent("MouseEvents"),i.initMouseEvent(t,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,o.relatedTarget||n.body.parentNode)):i=n.createEventObject(),e.dispatchEvent?e.dispatchEvent(i):e.fireEvent(`on${t}`,i)}}},28298:function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n(95093))},28527:(e,t,n)=>{"use strict";var r=n(97080),o=n(94402).has,i=n(25170),s=n(83789),a=n(40507),l=n(9539);e.exports=function(e){var t=r(this),n=s(e);if(i(t){"use strict";var r=n(20034),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not an object")}},28861:function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n(95093))},28959:function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(r=+e,o={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2]);var r,o}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n(95093))},29231:function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n(95093))},29309:(e,t,n)=>{"use strict";var r=n(46518),o=n(44576),i=n(59225).set,s=n(79472),a=o.setImmediate?s(i,!1):i;r({global:!0,bind:!0,enumerable:!0,forced:o.setImmediate!==a},{setImmediate:a})},29849:function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n(95093))},30016:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(96540),o=n(34164),i=n(21362),s=n(26739),a=n(20439),l=n(85078),u=n(99798),h=n(96148),c=n(1908);function d(e){return(0,c.Ay)("MuiBackdrop",e)}(0,h.A)("MuiBackdrop",["root","invisible"]);var m=n(74848);const p=(0,s.Ay)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),f=r.forwardRef((function(e,t){const n=(0,a.b)({props:e,name:"MuiBackdrop"}),{children:r,className:s,component:h="div",invisible:c=!1,open:f,components:g={},componentsProps:y={},slotProps:w={},slots:v={},TransitionComponent:_,transitionDuration:b,...S}=n,C={...n,component:h,invisible:c},E=(e=>{const{classes:t,invisible:n}=e,r={root:["root",n&&"invisible"]};return(0,i.A)(r,d,t)})(C),M={slots:{transition:_,root:g.Root,...v},slotProps:{...y,...w}},[T,R]=(0,l.A)("root",{elementType:p,externalForwardedProps:M,className:(0,o.A)(E.root,s),ownerState:C}),[A,N]=(0,l.A)("transition",{elementType:u.A,externalForwardedProps:M,ownerState:C});return(0,m.jsx)(A,{in:f,timeout:b,...S,...N,children:(0,m.jsx)(T,{"aria-hidden":!0,...R,classes:E,ref:t,children:r})})}))},30041:(e,t,n)=>{"use strict";function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")})),r}n.d(t,{Rk:()=>r,SF:()=>o,sk:()=>i});var o=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},i=function(e,t,n){o(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},30237:(e,t,n)=>{"use strict";n(6469)("flatMap")},30301:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(24902).A},30306:function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n(95093))},30421:e=>{"use strict";e.exports={}},30531:(e,t,n)=>{"use strict";var r=n(46518),o=n(69565),i=n(79306),s=n(28551),a=n(1767),l=n(48646),u=n(19462),h=n(9539),c=n(96395),d=n(30684),m=n(84549),p=!c&&!d("flatMap",(function(){})),f=!c&&!p&&m("flatMap",TypeError),g=c||p||f,y=u((function(){for(var e,t,n=this.iterator,r=this.mapper;;){if(t=this.inner)try{if(!(e=s(o(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){h(n,"throw",e)}if(e=s(o(this.next,n)),this.done=!!e.done)return;try{this.inner=l(r(e.value,this.counter++),!1)}catch(e){h(n,"throw",e)}}}));r({target:"Iterator",proto:!0,real:!0,forced:g},{flatMap:function(e){s(this);try{i(e)}catch(e){h(this,"throw",e)}return f?o(f,this,e):new y(a(this),{mapper:e,inner:null})}})},30670:(e,t,n)=>{"use strict";n(30531)},30684:e=>{"use strict";e.exports=function(e,t){var n="function"==typeof Iterator&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch(e){return!0}}},31052:function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,r,o){var i=function(e){var n=Math.floor(e%1e3/100),r=Math.floor(e%100/10),o=e%10,i="";return n>0&&(i+=t[n]+"vatlh"),r>0&&(i+=(""!==i?" ":"")+t[r]+"maH"),o>0&&(i+=(""!==i?" ":"")+t[o]),""===i?"pagh":i}(e);switch(r){case"ss":return i+" lup";case"mm":return i+" tup";case"hh":return i+" rep";case"dd":return i+" jaj";case"MM":return i+" jar";case"yy":return i+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(95093))},31355:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r="$$material"},31524:(e,t,n)=>{"use strict";n.d(t,{sH:()=>K});var r=n(96540),o=n(40961),i=n(84389),s=n(54950),a=n(11080),l=null;function u(){var e;"undefined"!=typeof console&&(e=console).warn.apply(e,arguments)}function h(e){return c(e,"hot-renderer")?(u("Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead."),!0):!!c(e,"hot-editor")&&(u("Providing a component-based editor using `hot-editor`-annotated component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead."),!0)}function c(e,t){return r.Children.toArray(e).some((function(e){return void 0!==e.props[t]}))}function d(e,t){if(!e||!t||"boolean"==typeof t)return null;var n=r.createElement(t,null),i=m({},!1);return i.className="".concat("hot-wrapper-editor-container"," ").concat(i.className),o.createPortal(r.createElement("div",Object.assign({},i),n),e.body)}function m(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{id:e.id||(t?"hot-"+Math.random().toString(36).substring(5):void 0),className:e.className||"",style:e.style||{}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.prevProps,r=void 0===n?{}:n,o=t.isInit,i=void 0!==o&&o,s=t.initOnlySettingKeys,a=void 0===s?[]:s,l=function(t){return!(i||!a.includes(t))&&r[t]===e[t]},u={};for(var h in e)"children"!==h&&!l(h)&&e.hasOwnProperty(h)&&(u[h]=e[h]);return u}}])}(),E=(0,r.createContext)(void 0),M=function(e){var t=e.children,n=(0,r.useRef)([]),i=(0,r.useCallback)((function(e,t){n.current[t]=e}),[]),s=(0,r.useRef)(new Map),a=(0,r.useRef)(new Map),u=(0,r.useCallback)((function(){return a.current.clear()}),[]),h=(0,r.useRef)(new Map),c=(0,r.useCallback)((function(){return h.current.clear()}),[]),d=(0,r.useRef)(new Map),m=(0,r.useCallback)((function(e){return function(t,n,i,s,u,c,m){var p="".concat(i,"-").concat(s),f=t.guid,g="".concat(f,"-").concat(p),y="".concat(p,"-").concat(f);if(a.current.has(p)&&(n.innerHTML=a.current.get(p).innerHTML),n&&!n.getAttribute("ghost-table")){for(var w=h.current.get(y),v=d.current.get(g);n.firstChild;)n.removeChild(n.firstChild);if(w&&v)n.appendChild(v);else{var _=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;t||(t=document),l||(l=t.createDocumentFragment());var i=null!=r?r:t.createElement("DIV");return l.appendChild(i),{portal:o.createPortal(e,i,n),portalContainer:i}}(r.createElement(e,{instance:t,TD:n,row:i,col:s,prop:u,value:c,cellProperties:m}),n.ownerDocument,y,v),b=_.portal,S=_.portalContainer;d.current.set(g,S),n.appendChild(S),h.current.set(y,b)}}return a.current.set("".concat(i,"-").concat(s),n),n}}),[]),f=(0,r.useRef)((function(){})),g=(0,r.useCallback)((function(e){f.current=e}),[]),y=(0,r.useCallback)((function(){var e;f.current(function(e){if(Array.isArray(e))return p(e)}(e=h.current.values())||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),[]),w=(0,r.useMemo)((function(){return{componentRendererColumns:s.current,columnsSettings:n.current,emitColumnSettings:i,getRendererWrapper:m,clearPortalCache:c,clearRenderedCellCache:u,setRenderersPortalManagerRef:g,pushCellPortalsIntoPortalManager:y}}),[i,m,u,g,y]);return r.createElement(E.Provider,{value:w},t)};function T(){return(0,r.useContext)(E)}var R=(0,r.createContext)(void 0),A=function(e){var t=e.columnIndex,n=e.getOwnerDocument,o=e.children,i=(0,r.useMemo)((function(){return{columnIndex:t,getOwnerDocument:n}}),[t,n]);return r.createElement(R.Provider,{value:i},o)},N=["close","focus","open"],L=["getValue","setValue"],x={open:"onOpen",close:"onClose",prepare:"onPrepare",focus:"onFocus"};function O(e,t){return function(n){function r(n){var o,s,a,l;return f(this,r),s=this,l=[n],a=w(a=r),o=function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(s,v()?Reflect.construct(a,l||[],w(s).constructor):a.apply(s,l)),t.current=o,Object.getOwnPropertyNames(i.Ay.editors.BaseEditor.prototype).forEach((function(t){if("constructor"!==t&&!L.includes(t)){var n=i.Ay.editors.BaseEditor.prototype[t];r.prototype[t]=function(){for(var r,o,i,s=arguments.length,a=new Array(s),l=0;l0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=v()?[]:(null===(t=w())||void 0===t||null===(t=t.getSettings())||void 0===t?void 0:t._initOnlySettings)||[],i=C.getSettings(e,{prevProps:r,isInit:n,initOnlySettingKeys:o});return i.columns=y.columnsSettings.length?y.columnsSettings:i.columns,e.renderer?(i.renderer=y.getRendererWrapper(e.renderer),y.componentRendererColumns.set("global",!0)):i.renderer=e.hotRenderer||(0,s.gB)("text"),e.editor?i.editor=O(p,f):i.editor=e.hotEditor||(0,a.M8)("text"),i},E=function(e){var t,n;e&&(null!==(t=e.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||null!==(n=e.getPlugin("autoColumnSize"))&&void 0!==n&&n.enabled)&&y.componentRendererColumns.size>0&&u("Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.")};(0,r.useEffect)((function(){var t,n,o=S(!0);return g.current=e,l.current=new i.Ay.Core(c.current,o),l.current.addHook("beforeViewRender",(function(){y.clearPortalCache(),y.clearRenderedCellCache()})),l.current.addHook("afterViewRender",(function(){y.pushCellPortalsIntoPortalManager()})),l.current.init(),E(l.current),h(e.children)||(t=e.children,n=H,r.Children.toArray(t).some((function(e){return e.type!==n}))&&u("Unexpected children nodes found in HotTable component. Only HotColumn components are allowed.")),function(){var e;_(),null===(e=w())||void 0===e||e.destroy()}}),[]),n=function(){_();var t=w(),n=S(!1,g.current);g.current=e,null==t||t.updateSettings(n,!1),E(t),h(e.children)},o=r.useRef(!1),(0,r.useEffect)((function(){if(o.current)return n();o.current=!0}),undefined),(0,r.useImperativeHandle)(t,(function(){return{get hotElementRef(){return c.current},get hotInstance(){return w()}}}));var M=r.Children.toArray(e.children).filter(D).map((function(e,t){return r.createElement(A,{columnIndex:t,getOwnerDocument:b,key:t},e)})),R=m(e),N=d(b(),e.editor);return r.createElement(r.Fragment,null,r.createElement("div",Object.assign({ref:c},R),M),r.createElement(F,{ref:y.setRenderersPortalManagerRef}),r.createElement(k,{hooksRef:p,hotCustomEditorInstanceRef:f},N))}));G.propTypes={style:z.object,id:z.string,className:z.string};var $=["children"],K=(0,r.forwardRef)((function(e,t){var n,o=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(95093))},31545:function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n(95093))},31601:e=>{"use strict";e.exports=function(e){return e[1]}},31698:(e,t,n)=>{"use strict";var r=n(46518),o=n(44204),i=n(39835);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("union")||!i("union")},{union:o})},31803:(e,t,n)=>{"use strict";n.d(t,{z:()=>l}),n(16280),n(98992),n(81454);var r=n(41895),o=n(77792),i=n(48046),s=n(13317),a=n(83986);class l extends r.n{constructor(){var e,t,n;super(...arguments),e=this,n=[],(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t="orderOfIndexes"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}getValues(){return this.orderOfIndexes.map((e=>this.indexedValues[e]))}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.orderOfIndexes.length;return e0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,t){this.indexedValues=(0,o.N)(this.indexedValues,e,t,this.initValueOrFn),this.orderOfIndexes=(0,s.z)(this.orderOfIndexes,t),super.insert(e,t)}remove(e){this.indexedValues=(0,o.H)(this.indexedValues,e),this.orderOfIndexes=(0,i.H)(this.orderOfIndexes,e),this.orderOfIndexes=(0,s.v)(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map((e=>[e,this.getValueAtIndex(e)]))}}},32124:function(e,t,n){!function(e){"use strict";function t(e,t,n,r){var o={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return r?o[n][0]:o[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){return"D"===t?e+"वेर":e},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n(95093))},32350:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,E:()=>i});var r=n(15870),o=n(53172);class i{static create(){return new i}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function s(){const e=(0,r.A)(i.create).current;return(0,o.A)(e.disposeEffect),e}},32475:(e,t,n)=>{"use strict";var r=n(46518),o=n(28527);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSupersetOf",(function(e){return!e}))},{isSupersetOf:o})},32564:(e,t,n)=>{"use strict";n.d(t,{b7:()=>c,_T:()=>h}),n(16280);var r=n(65615),o=n(32919),i=(n(44114),n(77325));const s={_hooksStorage:Object.create(null),addHook(e,t){return this._hooksStorage[e]||(this._hooksStorage[e]=[]),this.hot.addHook(e,t),this._hooksStorage[e].push(t),this},removeHooksByKey(e){(0,i.z0)(this._hooksStorage[e]||[],(t=>{this.hot.removeHook(e,t)}))},clearHooks(){(0,o.v4)(this._hooksStorage,((e,t)=>this.removeHooksByKey(t))),this._hooksStorage={}}};(0,o.LH)(s,"MIXIN_NAME","hooksRefRegisterer",{writable:!1,enumerable:!1});const a=s;var l=n(20091);function u(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class c{static get EDITOR_TYPE(){return"base"}constructor(e){u(this,"hot",void 0),u(this,"state",h.VIRGIN),u(this,"_opened",!1),u(this,"_fullEditMode",!1),u(this,"_closeCallback",null),u(this,"TD",null),u(this,"row",null),u(this,"col",null),u(this,"prop",null),u(this,"originalValue",null),u(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,t,n,r,o,i){this.TD=r,this.row=e,this.col=t,this.prop=n,this.originalValue=o,this.cellProperties=i,this.state=this.isOpened()?this.state:h.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,t){let n,r,o,i;if(t){const e=this.hot.getSelectedLast();n=Math.max(Math.min(e[0],e[2]),0),r=Math.max(Math.min(e[1],e[3]),0),o=Math.max(e[0],e[2]),i=Math.max(e[1],e[3])}else[n,r,o,i]=[this.row,this.col,null,null];const s=this.hot.runHooks("modifyGetCellCoords",n,r,!1,"meta");Array.isArray(s)&&([n,r]=s),this.hot.populateFromArray(n,r,e,o,i,"edit")}beginEditing(e,t){if(this.state!==h.VIRGIN)return;const n=this.hot,o=n.rowIndexMapper.getRenderableFromVisualIndex(this.row),i=n.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=h.EDITING,this.isInFullEditMode()){const t="string"==typeof e?e:(0,r.As)(this.originalValue);this.setValue(t)}this.open(t),this._opened=!0,this.focus(),n.view.render(),n.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),n.view.scrollViewport(n._createCellCoords(o,i))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,t,n){let r;if(n){const e=this._closeCallback;this._closeCallback=t=>{e&&e(t),n(t),this.hot.view.render()}}if(!this.isWaiting())if(this.state!==h.VIRGIN){if(this.state===h.EDITING){if(e)return this.cancelChanges(),void this.hot.view.render();const n=this.getValue();r=this.cellProperties.trimWhitespace?[["string"==typeof n?String.prototype.trim.call(n||""):n]]:[[n]],this.state=h.WAITING,this.saveValue(r,t),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",(e=>{this.state=h.FINISHED,this.discardEditor(e)})):(this.state=h.FINISHED,this.discardEditor(!0))}}else this.hot._registerTimeout((()=>{this._fireCallbacks(!0)}))}cancelChanges(){this.state=h.FINISHED,this.discardEditor()}discardEditor(e){this.state===h.FINISHED&&(!1===e&&!0!==this.cellProperties.allowInvalid?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=h.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=h.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===h.WAITING}getEditedCellRect(){var e;const t=this.getEditedCell();if(!t)return;const{wtOverlays:n,wtViewport:r}=this.hot.view._wt,o=this.hot.rootWindow,i=(0,l.cY)(t),s=(0,l.Gq)(t),a=(0,l.cY)(this.hot.rootElement),u=(0,l.Gq)(this.hot.rootElement),h=n.topOverlay.holder,c=n.inlineStartOverlay.holder,d=h!==o?h.scrollTop:0,m=c!==o?c.scrollLeft:0,p=o.innerWidth-a.left-u,{wtTable:f}=null!==(e=n.getParentOverlay(t))&&void 0!==e?e:this.hot.view._wt,g=f.name,y=["master","inline_start"].includes(g)?d:0,w=["master","top","bottom"].includes(g)?m:0,v=i.top===a.top?0:1;let _=i.top-a.top-v-y,b=0;b=this.hot.isRtl()?o.innerWidth-i.left-s-p-1+w:i.left-a.left-1-w,["top","top_inline_start_corner"].includes(g)&&(_+=n.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(g)&&(b+=Math.abs(n.inlineStartOverlay.getOverlayOffset()));const S=this.hot.hasColHeaders(),C=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),E=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),M=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(S&&C<=0||C===M)&&(_+=1),E<=0&&(b+=1);const T=r.rowsRenderCalculator.startPosition,R=r.columnsRenderCalculator.startPosition,A=Math.abs(n.inlineStartOverlay.getScrollPosition()),N=n.topOverlay.getScrollPosition(),L=(0,l.XJ)(this.hot.rootDocument);let x=t.offsetTop;if(["inline_start","master"].includes(g)&&(x+=T-N),["bottom","bottom_inline_start_corner"].includes(g)){const{wtViewport:e,wtTable:t}=n.bottomOverlay.clone;x+=e.getWorkspaceHeight()-t.getHeight()-L}let O=t.offsetLeft;this.hot.isRtl()?(O=O>=0?f.getWidth()-t.offsetLeft:Math.abs(O),O+=R-A-s):["top","master","bottom"].includes(g)&&(O+=R-A);const I=o.getComputedStyle(this.TD),k=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",D=parseInt(I[k],10)>0?0:1,P=parseInt(I.borderTopWidth,10)>0?0:1,H=(0,l.Gq)(t)+D,F=(0,l.DK)(t)+P,Y=(0,l.D1)(h)?L:0,V=(0,l.zO)(c)?L:0,U=this.hot.view.maximumVisibleElementWidth(O)-Y+D;return{top:_,start:b,height:F,maxHeight:Math.max(this.hot.view.maximumVisibleElementHeight(x)-V+P,this.hot.view.getDefaultRowHeight()),width:H,maxWidth:U}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let t="";return this.row=e-this.hot.getSettings().fixedRowsBottom?t=this.col{"use strict";var r=n(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},32919:(e,t,n)=>{"use strict";n.d(t,{$3:()=>y,Go:()=>l,Gv:()=>d,IL:()=>i,LH:()=>m,Nl:()=>o,UU:()=>f,X$:()=>s,co:()=>h,mQ:()=>v,nA:()=>w,o8:()=>u,oq:()=>g,v4:()=>p,wU:()=>c,zw:()=>a}),n(16280),n(44114),n(33110),n(98992),n(3949);var r=n(77325);function o(e){let t;return Array.isArray(e)?t=e.length?new Array(e.length).fill(null):[]:(t={},p(e,((e,n)=>{"__children"!==n&&(e&&"object"==typeof e&&!Array.isArray(e)?t[n]=o(e):Array.isArray(e)?e.length&&"object"==typeof e[0]&&!Array.isArray(e[0])?t[n]=[o(e[0])]:t[n]=[]:t[n]=null)}))),t}function i(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function s(e,t,n){const r=Array.isArray(n);return p(t,((t,o)=>{(!1===r||n.includes(o))&&(e[o]=t)})),e}function a(e,t){p(t,((n,r)=>{t[r]&&"object"==typeof t[r]?(e[r]||(Array.isArray(t[r])?e[r]=[]:"[object Date]"===Object.prototype.toString.call(t[r])?e[r]=t[r]:e[r]={}),a(e[r],t[r])):e[r]=t[r]}))}function l(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function u(e){const t={};return p(e,((e,n)=>{t[n]=e})),t}function h(e){e.MIXINS||(e.MIXINS=[]);for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{e.MIXINS.push(t.MIXIN_NAME),p(t,((t,n)=>{if(void 0!==e.prototype[n])throw new Error(`Mixin conflict. Property '${n}' already exist and cannot be overwritten.`);if("function"==typeof t)e.prototype[n]=t;else{const r=function(e,t){const n=`_${e}`;return function(){return void 0===this[n]&&(this[n]=(e=>{let t=e;return(Array.isArray(t)||d(t))&&(t=l(t)),t})(t)),this[n]}},o=function(e){const t=`_${e}`;return function(e){this[t]=e}};Object.defineProperty(e.prototype,n,{get:r(n,t),set:o(n),configurable:!0})}}))})),e}function c(e,t){return JSON.stringify(e)===JSON.stringify(t)}function d(e){return"[object Object]"===Object.prototype.toString.call(e)}function m(e,t,n,r){r.value=n,r.writable=!1!==r.writable,r.enumerable=!1!==r.enumerable,r.configurable=!1!==r.configurable,Object.defineProperty(e,t,r)}function p(e,t){for(const n in e)if((!e.hasOwnProperty||e.hasOwnProperty&&Object.prototype.hasOwnProperty.call(e,n))&&!1===t(e[n],n,e))break;return e}function f(e,t){const n=t.split(".");let r=e;return p(n,(e=>{if(r=r[e],void 0===r)return r=void 0,!1})),r}function g(e,t,n){if("string"!=typeof t)return;const r=t.split(".");let o=e;r.forEach(((e,t)=>{"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(t!==r.length-1?(v(o,e)||(o[e]={}),o=o[e]):o[e]=n)}))}function y(e){if(!d(e))return 0;const t=function(e){let n=0;return d(e)?p(e,((e,r)=>{"__children"!==r&&(n+=t(e))})):n+=1,n};return t(e)}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";const n=`_${t}`,r={_touched:!1,[n]:e,isTouched(){return this._touched}};return Object.defineProperty(r,t,{get(){return this[n]},set(e){this._touched=!0,this[n]=e},enumerable:!0,configurable:!0}),r}function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},32934:function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n(95093))},33044:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t,n){return"function"==typeof e?e(t,n):e}},33110:(e,t,n)=>{"use strict";var r=n(46518),o=n(97751),i=n(18745),s=n(69565),a=n(79504),l=n(79039),u=n(94901),h=n(10757),c=n(67680),d=n(66933),m=n(4495),p=String,f=o("JSON","stringify"),g=a(/./.exec),y=a("".charAt),w=a("".charCodeAt),v=a("".replace),_=a(1.1.toString),b=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,C=/^[\uDC00-\uDFFF]$/,E=!m||l((function(){var e=o("Symbol")("stringify detection");return"[null]"!==f([e])||"{}"!==f({a:e})||"{}"!==f(Object(e))})),M=l((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")})),T=function(e,t){var n=c(arguments),r=d(t);if(u(r)||void 0!==e&&!h(e))return n[1]=function(e,t){if(u(r)&&(t=s(r,this,p(e),t)),!h(t))return t},i(f,null,n)},R=function(e,t,n){var r=y(n,t-1),o=y(n,t+1);return g(S,e)&&!g(C,o)||g(C,e)&&!g(S,r)?"\\u"+_(w(e,0),16):e};f&&r({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(e,t,n){var r=c(arguments),o=i(E?T:f,null,r);return M&&"string"==typeof o?v(o,b,R):o}})},33372:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(93781);function o(e=8,t=(0,r.LX)({spacing:e})){if(e.mui)return e;const n=(...e)=>(0===e.length?[1]:e).map((e=>{const n=t(e);return"number"==typeof n?`${n}px`:n})).join(" ");return n.mui=!0,n}},33392:(e,t,n)=>{"use strict";var r=n(79504),o=0,i=Math.random(),s=r(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++o+i,36)}},33428:(e,t,n)=>{"use strict";n.d(t,{sH:()=>re});var r=n(96540),o=n(40961),i=n(84389);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){return a="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},a(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:document).querySelectorAll('[class^="'.concat(v,'"]')).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments.length>1?arguments[1]:void 0;if(null!==t){var n=e.createElement("DIV"),r=M(t.props,!1),i=r.id,s=r.className,a=r.style;return i&&(n.id=i),n.className=[v,s].join(" "),a&&Object.assign(n.style,a),e.body.appendChild(n),o.createPortal(t,n)}}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w,o=_(e,"hot-editor"),i=b(o);return o?r.cloneElement(o,{emitEditorInstance:function(e,n){t.get(i)||t.set(i,new Map),t.get(i).set(null!=n?n:w,e)},editorColumnScope:n,isEditor:!0}):null}function M(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{id:e.id||(t?"hot-"+Math.random().toString(36).substring(5):void 0),className:e.className||"",style:e.style||{}}}function T(e){var t=r.version.split(".").map((function(e){return parseInt(e)}));t[0]>=16&&t[1]>=3&&(e.UNSAFE_componentWillUpdate=e.componentWillUpdate,e.componentWillUpdate=void 0,e.UNSAFE_componentWillMount=e.componentWillMount,e.componentWillMount=void 0)}var R=function(){function e(){l(this,e)}return h(e,null,[{key:"getSettings",value:function(e){var t={};if(e.settings){var n=e.settings;for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}for(var o in e)"settings"!==o&&"children"!==o&&e.hasOwnProperty(o)&&(t[o]=e[o]);return t}}]),e}(),A=function(e){d(n,e);var t=g(n);function n(e,r){var o;return l(this,n),(o=t.call(this,e,r)).localEditorPortal=null,T(f(o)),o}return h(n,[{key:"getLocalEditorPortal",value:function(){return this.localEditorPortal}},{key:"setLocalEditorPortal",value:function(e){this.localEditorPortal=e}},{key:"getSettingsProps",value:function(){var e=this;return this.internalProps=["__componentRendererColumns","_emitColumnSettings","_columnIndex","_getChildElementByType","_getRendererWrapper","_getEditorClass","_getEditorCache","_getOwnerDocument","hot-renderer","hot-editor","children"],Object.keys(this.props).filter((function(t){return!e.internalProps.includes(t)})).reduce((function(t,n){return t[n]=e.props[n],t}),{})}},{key:"hasProp",value:function(e){return!!this.props[e]}},{key:"getLocalEditorElement",value:function(){return E(this.props.children,this.props._getEditorCache(),this.props._columnIndex)}},{key:"createColumnSettings",value:function(){var e=this.props._getChildElementByType(this.props.children,"hot-renderer"),t=this.getLocalEditorElement();this.columnSettings=R.getSettings(this.getSettingsProps()),null!==e?(this.columnSettings.renderer=this.props._getRendererWrapper(e),this.props._componentRendererColumns.set(this.props._columnIndex,!0)):this.hasProp("renderer")?this.columnSettings.renderer=this.props.renderer:this.columnSettings.renderer=void 0,null!==t?this.columnSettings.editor=this.props._getEditorClass(t,this.props._columnIndex):this.hasProp("editor")?this.columnSettings.editor=this.props.editor:this.columnSettings.editor=void 0}},{key:"createLocalEditorPortal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.children,t=this.props._getEditorCache(),n=E(e,t,this.props._columnIndex);n&&this.setLocalEditorPortal(C(this.props._getOwnerDocument(),n,t))}},{key:"emitColumnSettings",value:function(){this.props._emitColumnSettings(this.columnSettings,this.props._columnIndex)}},{key:"componentWillMount",value:function(){this.createLocalEditorPortal()}},{key:"componentDidMount",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"componentWillUpdate",value:function(e,t,n){this.createLocalEditorPortal(e.children)}},{key:"componentDidUpdate",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"render",value:function(){return r.createElement(r.Fragment,null,this.getLocalEditorPortal())}}]),n}(r.Component),N=function(e){d(n,e);var t=g(n);function n(e){var r;return l(this,n),(r=t.call(this,e)).state={portals:[]},r}return h(n,[{key:"render",value:function(){return r.createElement(r.Fragment,null,this.state.portals)}}]),n}(r.Component);function L(e,t){return e(t={exports:{}},t.exports),t.exports}var x="function"==typeof Symbol&&Symbol.for,O=x?Symbol.for("react.element"):60103,I=x?Symbol.for("react.portal"):60106,k=x?Symbol.for("react.fragment"):60107,D=x?Symbol.for("react.strict_mode"):60108,P=x?Symbol.for("react.profiler"):60114,H=x?Symbol.for("react.provider"):60109,F=x?Symbol.for("react.context"):60110,Y=x?Symbol.for("react.async_mode"):60111,V=x?Symbol.for("react.concurrent_mode"):60111,U=x?Symbol.for("react.forward_ref"):60112,B=x?Symbol.for("react.suspense"):60113,W=x?Symbol.for("react.suspense_list"):60120,j=x?Symbol.for("react.memo"):60115,z=x?Symbol.for("react.lazy"):60116,G=x?Symbol.for("react.block"):60121,$=x?Symbol.for("react.fundamental"):60117,K=x?Symbol.for("react.responder"):60118,X=x?Symbol.for("react.scope"):60119;function q(e){if("object"===a(e)&&null!==e){var t=e.$$typeof;switch(t){case O:switch(e=e.type){case Y:case V:case k:case P:case D:case B:return e;default:switch(e=e&&e.$$typeof){case F:case U:case z:case j:case H:return e;default:return t}}case I:return t}}}function Q(e){return q(e)===V}var J={AsyncMode:Y,ConcurrentMode:V,ContextConsumer:F,ContextProvider:H,Element:O,ForwardRef:U,Fragment:k,Lazy:z,Memo:j,Portal:I,Profiler:P,StrictMode:D,Suspense:B,isAsyncMode:function(e){return Q(e)||q(e)===Y},isConcurrentMode:Q,isContextConsumer:function(e){return q(e)===F},isContextProvider:function(e){return q(e)===H},isElement:function(e){return"object"===a(e)&&null!==e&&e.$$typeof===O},isForwardRef:function(e){return q(e)===U},isFragment:function(e){return q(e)===k},isLazy:function(e){return q(e)===z},isMemo:function(e){return q(e)===j},isPortal:function(e){return q(e)===I},isProfiler:function(e){return q(e)===P},isStrictMode:function(e){return q(e)===D},isSuspense:function(e){return q(e)===B},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===k||e===V||e===P||e===D||e===B||e===W||"object"===a(e)&&null!==e&&(e.$$typeof===z||e.$$typeof===j||e.$$typeof===H||e.$$typeof===F||e.$$typeof===U||e.$$typeof===$||e.$$typeof===K||e.$$typeof===X||e.$$typeof===G)},typeOf:q},Z=L((function(e,t){}));Z.AsyncMode,Z.ConcurrentMode,Z.ContextConsumer,Z.ContextProvider,Z.Element,Z.ForwardRef,Z.Fragment,Z.Lazy,Z.Memo,Z.Portal,Z.Profiler,Z.StrictMode,Z.Suspense,Z.isAsyncMode,Z.isConcurrentMode,Z.isContextConsumer,Z.isContextProvider,Z.isElement,Z.isForwardRef,Z.isFragment,Z.isLazy,Z.isMemo,Z.isPortal,Z.isProfiler,Z.isStrictMode,Z.isSuspense,Z.isValidElementType,Z.typeOf,L((function(e){e.exports=J}));Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}})()&&Object.assign;function ee(){}function te(){}Function.call.bind(Object.prototype.hasOwnProperty),te.resetWarningCache=ee;var ne=L((function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:te,resetWarningCache:ee};return n.PropTypes=n,n}()})),re=function(e){d(n,e);var t=g(n);function n(e,r){var o;return l(this,n),(o=t.call(this,e,r)).id=null,o.__hotInstance=null,o.hotElementRef=null,o.columnSettings=[],o.portalManager=null,o.portalCacheArray=[],o.globalEditorPortal=null,o.renderedCellCache=new Map,o.editorCache=new Map,o.componentRendererColumns=new Map,T(f(o)),o}return h(n,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn("The Handsontable instance bound to this component was destroyed and cannot be used properly."),null)},set:function(e){this.__hotInstance=e}},{key:"getRenderedCellCache",value:function(){return this.renderedCellCache}},{key:"getEditorCache",value:function(){return this.editorCache}},{key:"getGlobalEditorPortal",value:function(){return this.globalEditorPortal}},{key:"setGlobalEditorPortal",value:function(e){this.globalEditorPortal=e}},{key:"clearCache",value:function(){var e=this.getRenderedCellCache();this.setGlobalEditorPortal(null),S(this.getOwnerDocument()),this.getEditorCache().clear(),e.clear(),this.componentRendererColumns.clear()}},{key:"getOwnerDocument",value:function(){return this.hotElementRef?this.hotElementRef.ownerDocument:document}},{key:"setHotElementRef",value:function(e){this.hotElementRef=e}},{key:"getRendererWrapper",value:function(e){var t=this;return function(n,i,a,l,u,h,d){var m=t.getRenderedCellCache();if(m.has("".concat(a,"-").concat(l))&&(i.innerHTML=m.get("".concat(a,"-").concat(l)).innerHTML),i&&!i.getAttribute("ghost-table")){for(var p=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document;i||(i=document),y||(y=i.createDocumentFragment());var a=i.createElement("DIV");y.appendChild(a);var l=r.cloneElement(e,function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:w,r=b(e),o=null===(t=this.getEditorCache().get(r))||void 0===t?void 0:t.get(n);return this.makeEditorClass(o)}},{key:"makeEditorClass",value:function(e){var t=function(t){d(r,t);var n=g(r);function r(t){var o;return l(this,r),o=n.call(this,t),e.hotCustomEditorInstance=f(o),o.editorComponent=e,o}return h(r,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}]),r}(i.Ay.editors.BaseEditor);return Object.getOwnPropertyNames(i.Ay.editors.BaseEditor.prototype).forEach((function(n){"constructor"!==n&&(t.prototype[n]=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:this.props.children,this.getEditorCache())}},{key:"createGlobalEditorPortal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.children,t=this.getGlobalEditorElement(e);t&&this.setGlobalEditorPortal(C(this.getOwnerDocument(),t,this.getEditorCache()))}},{key:"createNewGlobalSettings",value:function(){var e=R.getSettings(this.props),t=this.getGlobalRendererElement(),n=this.getGlobalEditorElement();return e.columns=this.columnSettings.length?this.columnSettings:e.columns,e.editor=n?this.getEditorClass(n,w):this.props.editor||(this.props.settings?this.props.settings.editor:void 0),t?(e.renderer=this.getRendererWrapper(t),this.componentRendererColumns.set("global",!0)):e.renderer=this.props.renderer||(this.props.settings?this.props.settings.renderer:void 0),e}},{key:"displayAutoSizeWarning",value:function(e){var t,n;this.hotInstance&&(null!==(t=this.hotInstance.getPlugin("autoRowSize"))&&void 0!==t&&t.enabled||null!==(n=this.hotInstance.getPlugin("autoColumnSize"))&&void 0!==n&&n.enabled)&&this.componentRendererColumns.size>0&&function(){var e;"undefined"!=typeof console&&(e=console).warn.apply(e,arguments)}("Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.")}},{key:"setHotColumnSettings",value:function(e,t){this.columnSettings[t]=e}},{key:"handsontableBeforeViewRender",value:function(){this.getRenderedCellCache().clear()}},{key:"handsontableAfterViewRender",value:function(){var e=this;this.portalManager.setState((function(){return Object.assign({},{portals:e.portalCacheArray})}),(function(){e.portalCacheArray.length=0}))}},{key:"updateHot",value:function(e){this.hotInstance&&this.hotInstance.updateSettings(e,!1)}},{key:"setPortalManagerRef",value:function(e){this.portalManager=e}},{key:"componentWillMount",value:function(){this.clearCache(),this.createGlobalEditorPortal()}},{key:"componentDidMount",value:function(){var e=this,t=this.createNewGlobalSettings();this.hotInstance=new i.Ay.Core(this.hotElementRef,t),this.hotInstance.addHook("beforeViewRender",(function(t){e.handsontableBeforeViewRender()})),this.hotInstance.addHook("afterViewRender",(function(){e.handsontableAfterViewRender()})),this.hotInstance.init(),this.displayAutoSizeWarning(t)}},{key:"componentWillUpdate",value:function(e,t,n){this.clearCache(),S(this.getOwnerDocument()),this.createGlobalEditorPortal(e.children)}},{key:"componentDidUpdate",value:function(){var e=this.createNewGlobalSettings();this.updateHot(e),this.displayAutoSizeWarning(e)}},{key:"componentWillUnmount",value:function(){this.hotInstance&&this.hotInstance.destroy(),S(this.getOwnerDocument())}},{key:"render",value:function(){var e=this,t=M(this.props),n=t.id,o=t.className,i=t.style,s=r.Children.toArray(this.props.children),a=(s=s.filter((function(e){return function(e){return e.type===A}(e)}))).map((function(t,n){return r.cloneElement(t,{_componentRendererColumns:e.componentRendererColumns,_emitColumnSettings:e.setHotColumnSettings.bind(e),_columnIndex:n,_getChildElementByType:_.bind(e),_getRendererWrapper:e.getRendererWrapper.bind(e),_getEditorClass:e.getEditorClass.bind(e),_getOwnerDocument:e.getOwnerDocument.bind(e),_getEditorCache:e.getEditorCache.bind(e),children:t.props.children})}));return a.push(this.getGlobalEditorPortal()),r.createElement(r.Fragment,null,r.createElement("div",{ref:this.setHotElementRef.bind(this),id:n,className:o,style:i},a),r.createElement(N,{ref:this.setPortalManagerRef.bind(this)}))}}],[{key:"version",get:function(){return"11.0.0"}}]),n}(r.Component);re.propTypes={style:ne.object,id:ne.string,className:ne.string},r.Component},33478:function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n(95093))},33706:(e,t,n)=>{"use strict";var r=n(79504),o=n(94901),i=n(77629),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),e.exports=i.inspectSource},33717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},33853:(e,t,n)=>{"use strict";var r=n(46518),o=n(64449);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isDisjointFrom",(function(e){return!e}))},{isDisjointFrom:o})},33983:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(10644).A},34164:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;to});const o=function(){for(var e,t,n=0,o="",i=arguments.length;n{"use strict";var r=n(22195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},34477:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var r=n(96540),o=n(34164),i=n(49649),s=n(95548),a=n(57514),l=n(14921),u=n(74848),h=n(61626),c=n(28040),d=n(31355);const m=(0,n(96148).A)("MuiBox",["root"]),p=(0,c.A)(),f=function(e={}){const{themeId:t,defaultTheme:n,defaultClassName:h="MuiBox-root",generateClassName:c}=e,d=(0,i.Ay)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.A);return r.forwardRef((function(e,r){const i=(0,l.A)(n),{className:s,component:m="div",...p}=(0,a.A)(e);return(0,u.jsx)(d,{as:m,ref:r,className:(0,o.A)(s,c?c(h):h),theme:t&&i[t]||i,...p})}))}({themeId:d.A,defaultTheme:p,defaultClassName:m.root,generateClassName:h.A.generate}),g=f},34527:(e,t,n)=>{"use strict";var r=n(43724),o=n(34376),i=TypeError,s=Object.getOwnPropertyDescriptor,a=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(o(e)&&!s(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},34578:(e,t,n)=>{"use strict";function r(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(10*t)/1e3}n.d(t,{A:()=>r})},34647:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=new Map;function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"common";r.has(e)||r.set(e,new Map);const t=r.get(e);return{register:function(e,n){t.set(e,n)},getItem:function(e){return t.get(e)},hasItem:function(e){return t.has(e)},getNames:function(){return[...t.keys()]},getValues:function(){return[...t.values()]}}}},34675:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(95239),o=n(92182);const i={CELL_TYPE:"text",editor:r.t,renderer:o.F}},35031:(e,t,n)=>{"use strict";var r=n(97751),o=n(79504),i=n(38480),s=n(33717),a=n(28551),l=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=s.f;return n?l(t,n(e)):t}},35370:(e,t,n)=>{"use strict";var r=n(26198);e.exports=function(e,t,n){for(var o=0,i=arguments.length>2?n:r(t),s=new e(i);i>o;)s[o]=t[o++];return s}},35610:(e,t,n)=>{"use strict";var r=n(91291),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},35917:(e,t,n)=>{"use strict";var r=n(43724),o=n(79039),i=n(4055);e.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},36289:(e,t,n)=>{"use strict";function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:()=>r})},36840:(e,t,n)=>{"use strict";var r=n(94901),o=n(24913),i=n(50283),s=n(39433);e.exports=function(e,t,n,a){a||(a={});var l=a.enumerable,u=void 0!==a.name?a.name:t;if(r(n)&&i(n,u,a),a.global)l?e[t]=n:s(t,n);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},36955:(e,t,n)=>{"use strict";var r=n(92140),o=n(94901),i=n(22195),s=n(78227)("toStringTag"),a=Object,l="Arguments"===i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=a(e),s))?n:l?i(t):"Object"===(r=i(t))&&o(t.callee)?"Arguments":r}},37071:function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,r){return e?/-MMM-/.test(r)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n(95093))},37073:(e,t,n)=>{"use strict";n.d(t,{iz:()=>lt});var r,o,i={};n.r(i),n.d(i,{AbsPlugin:()=>$i,AddressPlugin:()=>zi,ArrayPlugin:()=>Gi,BitShiftPlugin:()=>Ki,BitwiseLogicOperationsPlugin:()=>Ji,BooleanPlugin:()=>Zi,CharPlugin:()=>es,CodePlugin:()=>ts,ComplexPlugin:()=>Tl,ConditionalAggregationPlugin:()=>aa,CountBlankPlugin:()=>ns,CountUniquePlugin:()=>rs,DateTimePlugin:()=>os,DegreesPlugin:()=>us,DeltaPlugin:()=>hs,ExpPlugin:()=>cs,FinancialPlugin:()=>ds,FormulaTextPlugin:()=>ws,HyperlinkPlugin:()=>vs,InformationPlugin:()=>_s,IsEvenPlugin:()=>bs,IsOddPlugin:()=>Ss,LogarithmPlugin:()=>Cs,LookupPlugin:()=>da,MathConstantsPlugin:()=>Ms,MathPlugin:()=>Cl,MatrixPlugin:()=>As,MedianPlugin:()=>Ns,ModuloPlugin:()=>Ls,NumericAggregationPlugin:()=>Is,PowerPlugin:()=>Ps,RadiansPlugin:()=>Hs,RadixConversionPlugin:()=>Ys,RandomPlugin:()=>Gs,RomanPlugin:()=>ma,RoundingPlugin:()=>Xs,SimpleArithmerticPlugin:()=>ga,SqrtPlugin:()=>qs,StatisticalAggregationPlugin:()=>Fl,StatisticalPlugin:()=>Sl,SumprodPlugin:()=>la,TextPlugin:()=>ua,TrigonometryPlugin:()=>ha}),function(e){e.RELATIVE="RELATIVE",e.ABSOLUTE="ABSOLUTE"}(r||(r={}));class s{constructor(e,t,n){this.type=e,this.col=t,this.sheet=n}static absolute(e,t){return new s(r.ABSOLUTE,e,t)}static relative(e,t){return new s(r.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,n)=>t.toSimpleColumnAddress(e).col-n.toSimpleColumnAddress(e).col}isColumnAbsolute(){return this.type===r.ABSOLUTE}isColumnRelative(){return this.type===r.RELATIVE}isAbsolute(){return this.type===r.ABSOLUTE&&void 0!==this.sheet}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new s(this.type,this.col+t,r)}shiftedByColumns(e){return new s(this.type,this.col+e,this.sheet)}toSimpleColumnAddress(e){const t=In(this,e);let n=this.col;return this.isColumnRelative()&&(n=e.col+this.col),Tn(t,n)}shiftRelativeDimensions(e,t){const n=this.isColumnRelative()?this.col+e:this.col;return new s(this.type,n,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isColumnAbsolute()?this.col+e:this.col;return new s(this.type,n,this.sheet)}withSheet(e){return new s(this.type,this.col,e)}isInvalid(e){return this.toSimpleColumnAddress(e).col<0}hash(e){const t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case r.RELATIVE:return`${t}#COLR${this.col}`;case r.ABSOLUTE:return`${t}#COLA${this.col}`}}unparse(e){const t=this.toSimpleColumnAddress(e);if(Rn(t))return;const n=I(t.col);return`${this.type===r.ABSOLUTE?"$":""}${n}`}exceedsSheetSizeLimits(e){return this.col>=e}}class a{constructor(e,t,n){this.type=e,this.row=t,this.sheet=n}static absolute(e,t){return new a(r.ABSOLUTE,e,t)}static relative(e,t){return new a(r.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,n)=>t.toSimpleRowAddress(e).row-n.toSimpleRowAddress(e).row}isRowAbsolute(){return this.type===r.ABSOLUTE}isRowRelative(){return this.type===r.RELATIVE}isAbsolute(){return this.type===r.ABSOLUTE&&void 0!==this.sheet}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new a(this.type,this.row+n,r)}shiftedByRows(e){return new a(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){const t=In(this,e);let n=this.row;return this.isRowRelative()&&(n=e.row+this.row),En(t,n)}shiftRelativeDimensions(e,t){const n=this.isRowRelative()?this.row+t:this.row;return new a(this.type,n,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isRowAbsolute()?this.row+t:this.row;return new a(this.type,n,this.sheet)}withSheet(e){return new a(this.type,this.row,e)}isInvalid(e){return this.toSimpleRowAddress(e).row<0}hash(e){const t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case r.RELATIVE:return`${t}#ROWR${this.row}`;case r.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){const t=this.toSimpleRowAddress(e);if(!Mn(t))return`${this.type===r.ABSOLUTE?"$":""}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}!function(e){e.CELL_REFERENCE_RELATIVE="CELL_REFERENCE",e.CELL_REFERENCE_ABSOLUTE="CELL_REFERENCE_ABSOLUTE",e.CELL_REFERENCE_ABSOLUTE_COL="CELL_REFERENCE_ABSOLUTE_COL",e.CELL_REFERENCE_ABSOLUTE_ROW="CELL_REFERENCE_ABSOLUTE_ROW"}(o||(o={}));class l{constructor(e,t,n,r){this.col=e,this.row=t,this.type=n,this.sheet=r}static fromColAndRow(e,t,n){return(e.isColumnAbsolute()&&t.isRowAbsolute()?l.absolute.bind(this):e.isColumnAbsolute()?l.absoluteCol.bind(this):t.isRowAbsolute()?l.absoluteRow.bind(this):l.relative.bind(this))(e.col,t.row,n)}static relative(e,t,n){return new l(e,t,o.CELL_REFERENCE_RELATIVE,n)}static absolute(e,t,n){return new l(e,t,o.CELL_REFERENCE_ABSOLUTE,n)}static absoluteCol(e,t,n){return new l(e,t,o.CELL_REFERENCE_ABSOLUTE_COL,n)}static absoluteRow(e,t,n){return new l(e,t,o.CELL_REFERENCE_ABSOLUTE_ROW,n)}toSimpleCellAddress(e){const t=In(this,e);return this.type===o.CELL_REFERENCE_ABSOLUTE?An(t,this.col,this.row):this.type===o.CELL_REFERENCE_ABSOLUTE_ROW?An(t,e.col+this.col,this.row):this.type===o.CELL_REFERENCE_ABSOLUTE_COL?An(t,this.col,e.row+this.row):An(t,e.col+this.col,e.row+this.row)}toColumnAddress(){const e=this.isColumnRelative()?r.RELATIVE:r.ABSOLUTE;return new s(e,this.col,this.sheet)}toRowAddress(){const e=this.isRowRelative()?r.RELATIVE:r.ABSOLUTE;return new a(e,this.row,this.sheet)}toSimpleColumnAddress(e){const t=In(this,e);let n=this.col;return this.isColumnRelative()&&(n+=e.col),Tn(t,n)}toSimpleRowAddress(e){const t=In(this,e);let n=this.row;return this.isRowRelative()&&(n+=e.row),En(t,n)}isRowAbsolute(){return this.type===o.CELL_REFERENCE_ABSOLUTE||this.type===o.CELL_REFERENCE_ABSOLUTE_ROW}isColumnAbsolute(){return this.type===o.CELL_REFERENCE_ABSOLUTE||this.type===o.CELL_REFERENCE_ABSOLUTE_COL}isColumnRelative(){return this.type===o.CELL_REFERENCE_RELATIVE||this.type===o.CELL_REFERENCE_ABSOLUTE_ROW}isRowRelative(){return this.type===o.CELL_REFERENCE_RELATIVE||this.type===o.CELL_REFERENCE_ABSOLUTE_COL}isAbsolute(){return this.type===o.CELL_REFERENCE_ABSOLUTE&&void 0!==this.sheet}shiftedByRows(e){return new l(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new l(this.col+e,this.row,this.type,this.sheet)}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new l(this.col+t,this.row+n,this.type,r)}withSheet(e){return new l(this.col,this.row,this.type,e)}isInvalid(e){return Nn(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){const n=this.isColumnAbsolute()?this.col:this.col+e,r=this.isRowAbsolute()?this.row:this.row+t;return new l(n,r,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isColumnRelative()?this.col:this.col+e,r=this.isRowRelative()?this.row:this.row+t;return new l(n,r,this.type,this.sheet)}hash(e){const t=e&&void 0!==this.sheet?`#${this.sheet}`:"";switch(this.type){case o.CELL_REFERENCE_RELATIVE:return`${t}#${this.row}R${this.col}`;case o.CELL_REFERENCE_ABSOLUTE:return`${t}#${this.row}A${this.col}`;case o.CELL_REFERENCE_ABSOLUTE_COL:return`${t}#${this.row}AC${this.col}`;case o.CELL_REFERENCE_ABSOLUTE_ROW:return`${t}#${this.row}AR${this.col}`}}unparse(e){const t=this.toSimpleCellAddress(e);if(Nn(t))return;const n=I(t.col),r=this.type===o.CELL_REFERENCE_ABSOLUTE||this.type===o.CELL_REFERENCE_ABSOLUTE_ROW?"$":"";return`${this.type===o.CELL_REFERENCE_ABSOLUTE||this.type===o.CELL_REFERENCE_ABSOLUTE_COL?"$":""}${n}${r}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}const u=":",h="$",c="A-Za-zÀ-ʯ",d=`${c}0-9_.`,m=`[${c}0-9_]+`,p=`(${m}|'(((?!').|'')*)')!`,f=`(${p})?\\${h}?[A-Za-z]+\\${h}?[0-9]+`,g=`(${p})?\\${h}?[A-Za-z]+`,y=`(${p})?\\${h}?[0-9]+`,w="[rR][0-9]*[cC][0-9]*",v=`(${f})[^${d}]`,_=`[${c}_][${d}]*`,b=["0","1","2","3","4","5","6","7","8","9"],S=[...Array.from(Array(26)).map(((e,t)=>t+"A".charCodeAt(0))),...Array.from(Array(26)).map(((e,t)=>t+"a".charCodeAt(0))),...Array.from(Array(496)).map(((e,t)=>t+192))].map((e=>String.fromCharCode(e))),C=new RegExp(`^(${p})?(\\${h}?)([A-Za-z]+)(\\${h}?)([0-9]+)$`),E=new RegExp(`^(${p})?(\\${h}?)([A-Za-z]+)$`),M=new RegExp(`^(${p})?(\\${h}?)([0-9]+)$`),T=new RegExp(`^${m}$`),R=(e,t,n)=>{const r=C.exec(t),o=O(r[6]);let i=D(r,e);if(void 0===i)return;null===i&&(i=void 0);const s=Number(r[8])-1;return r[5]===h&&r[7]===h?l.absolute(o,s,i):r[5]===h?l.absoluteCol(o,s-n.row,i):r[7]===h?l.absoluteRow(o-n.col,s,i):l.relative(o-n.col,s-n.row,i)},A=(e,t,n)=>{const r=E.exec(t);let o=D(r,e);if(void 0===o)return;null===o&&(o=void 0);const i=O(r[6]);return r[5]===h?s.absolute(i,o):s.relative(i-n.col,o)},N=(e,t,n)=>{const r=M.exec(t);let o=D(r,e);if(void 0===o)return;null===o&&(o=void 0);const i=Number(r[6])-1;return r[5]===h?a.absolute(i,o):a.relative(i-n.row,o)},L=(e,t,n)=>{const r=C.exec(t);if(!r)return;const o=O(r[6]);let i=D(r,e);if(void 0===i)return;null===i&&(i=n);const s=Number(r[8])-1;return An(i,o,s)},x=(e,t,n)=>{const r=I(t.col),o=k(t.sheet,e);if(void 0!==o)return n!==t.sheet?`${o}!${r}${t.row+1}`:`${r}${t.row+1}`};function O(e){return 1===e.length?e.toUpperCase().charCodeAt(0)-65:e.split("").reduce(((e,t)=>26*e+(t.toUpperCase().charCodeAt(0)-64)),0)-1}function I(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function k(e,t){let n=t(e);if(void 0!==n)return T.test(n)?n:(n=n.replace(/'/g,"''"),`'${n}'`)}function D(e,t){var n;let r=null!==(n=e[3])&&void 0!==n?n:e[2];return r?(r=r.replace(/''/g,"'"),t(r)):null}var P=n(42620);const H=(e,t)=>({type:e,message:t});var F,Y,V;!function(e){e.LexingError="LexingError",e.ParserError="ParsingError",e.StaticOffsetError="StaticOffsetError",e.StaticOffsetOutOfRangeError="StaticOffsetOutOfRangeError",e.RangeOffsetNotAllowed="RangeOffsetNotAllowed",e.InvalidRangeSize="InvalidRangeSize"}(F||(F={})),function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.MINUS_UNARY_OP="MINUS_UNARY_OP",e.PLUS_UNARY_OP="PLUS_UNARY_OP",e.PERCENT_OP="PERCENT_OP",e.CONCATENATE_OP="CONCATENATE_OP",e.EQUALS_OP="EQUALS_OP",e.NOT_EQUAL_OP="NOT_EQUAL_OP",e.GREATER_THAN_OP="GREATER_THAN_OP",e.LESS_THAN_OP="LESS_THAN_OP",e.GREATER_THAN_OR_EQUAL_OP="GREATER_THAN_OR_EQUAL_OP",e.LESS_THAN_OR_EQUAL_OP="LESS_THAN_OR_EQUAL_OP",e.PLUS_OP="PLUS_OP",e.MINUS_OP="MINUS_OP",e.TIMES_OP="TIMES_OP",e.DIV_OP="DIV_OP",e.POWER_OP="POWER_OP",e.FUNCTION_CALL="FUNCTION_CALL",e.NAMED_EXPRESSION="NAMED_EXPRESSION",e.PARENTHESIS="PARENTHESES",e.CELL_REFERENCE="CELL_REFERENCE",e.CELL_RANGE="CELL_RANGE",e.COLUMN_RANGE="COLUMN_RANGE",e.ROW_RANGE="ROW_RANGE",e.ERROR="ERROR",e.ERROR_WITH_RAW_INPUT="ERROR_WITH_RAW_INPUT",e.ARRAY="ARRAY"}(Y||(Y={})),function(e){e[e.RELATIVE=0]="RELATIVE",e[e.START_ABSOLUTE=1]="START_ABSOLUTE",e[e.BOTH_ABSOLUTE=2]="BOTH_ABSOLUTE"}(V||(V={}));const U=(e,t)=>({type:Y.CELL_REFERENCE,reference:e,leadingWhitespace:null==t?void 0:t.image}),B=(e,t,n,r)=>($(e,t,n),{type:Y.CELL_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:r}),W=(e,t,n)=>({type:Y.ARRAY,args:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==n?void 0:n.image}),j=(e,t)=>({type:Y.ERROR,error:e,leadingWhitespace:null==t?void 0:t.image}),z=(e,t,n)=>({type:Y.ERROR_WITH_RAW_INPUT,error:t,rawInput:e,leadingWhitespace:null==n?void 0:n.image}),G=()=>({type:Y.ERROR,error:Cn.parsingError()});function $(e,t,n){if(void 0!==e.sheet&&void 0===t.sheet||void 0===e.sheet&&void 0!==t.sheet)throw new Error("Start address inconsistent with end address");if(void 0===e.sheet&&n!==V.RELATIVE||void 0!==e.sheet&&n===V.RELATIVE)throw new Error("Sheet address inconsistent with sheet reference type")}function K(e,t){return(null!=t?t:"")+e}const X={[Y.PLUS_OP]:"+",[Y.MINUS_OP]:"-",[Y.TIMES_OP]:"*",[Y.DIV_OP]:"/",[Y.CONCATENATE_OP]:"&",[Y.POWER_OP]:"^",[Y.EQUALS_OP]:"=",[Y.NOT_EQUAL_OP]:"<>",[Y.GREATER_THAN_OP]:">",[Y.GREATER_THAN_OR_EQUAL_OP]:">=",[Y.LESS_THAN_OP]:"<",[Y.LESS_THAN_OR_EQUAL_OP]:"<="};class q{constructor(e){this.functionRegistry=e,this.cache=new Map}set(e,t){const n=((e,t,n,r)=>({ast:e,relativeDependencies:t,hasVolatileFunction:n,hasStructuralChangeFunction:r}))(t,Pe(t,this.functionRegistry),Q(t,this.functionRegistry.isFunctionVolatile),Q(t,this.functionRegistry.isFunctionDependentOnSheetStructureChange));return this.cache.set(e,n),n}get(e){return this.cache.get(e)}maybeSetAndThenGet(e,t){const n=this.cache.get(e);return void 0!==n?n.ast:(this.set(e,t),t)}}const Q=(e,t)=>{switch(e.type){case Y.EMPTY:case Y.NUMBER:case Y.STRING:case Y.ERROR:case Y.ERROR_WITH_RAW_INPUT:case Y.CELL_REFERENCE:case Y.CELL_RANGE:case Y.COLUMN_RANGE:case Y.ROW_RANGE:case Y.NAMED_EXPRESSION:return!1;case Y.PERCENT_OP:case Y.PLUS_UNARY_OP:case Y.MINUS_UNARY_OP:return Q(e.value,t);case Y.CONCATENATE_OP:case Y.EQUALS_OP:case Y.NOT_EQUAL_OP:case Y.LESS_THAN_OP:case Y.GREATER_THAN_OP:case Y.LESS_THAN_OR_EQUAL_OP:case Y.GREATER_THAN_OR_EQUAL_OP:case Y.MINUS_OP:case Y.PLUS_OP:case Y.TIMES_OP:case Y.DIV_OP:case Y.POWER_OP:return Q(e.left,t)||Q(e.right,t);case Y.PARENTHESIS:return Q(e.expression,t);case Y.FUNCTION_CALL:return!!t(e.procedureName)||e.args.some((e=>Q(e,t)));case Y.ARRAY:return e.args.some((e=>e.some((e=>Q(e,t)))))}};class J{}J.DistinctSigns="Distinct signs.",J.WrongArgNumber="Wrong number of arguments.",J.EmptyArg="Empty function argument.",J.EmptyArray="Empty array not allowed.",J.ArrayDimensions="Array dimensions are not compatible.",J.NoSpaceForArrayResult="No space for array result.",J.ValueSmall="Value too small.",J.ValueLarge="Value too large.",J.BadCriterion="Incorrect criterion.",J.RangeManySheets="Range spans more than one sheet.",J.CellRangeExpected="Cell range expected.",J.WrongDimension="Wrong range dimension.",J.ScalarExpected="Cell range not allowed.",J.NumberCoercion="Value cannot be coerced to number.",J.NumberExpected="Number argument expected.",J.IntegerExpected="Value needs to be an integer.",J.BadMode="Mode not recognized.",J.DateBounds="Date outside of bounds.",J.OutOfSheet="Resulting reference is out of the sheet.",J.WrongType="Wrong type of argument.",J.NaN="NaN or infinite value encountered.",J.EqualLength="Ranges need to be of equal length.",J.Negative="Value cannot be negative.",J.NotBinary="String does not represent a binary number.",J.NotOctal="String does not represent an octal number.",J.NotHex="String does not represent a hexadecimal number.",J.EndStartPeriod="End period needs to be at least start period.",J.CellRefExpected="Cell reference expected.",J.EmptyRange="Empty range not allowed.",J.BadRef="Address is not correct.",J.NumberRange="Number-only range expected.",J.ValueNotFound="Value not found.",J.ValueBaseLarge="Value in base too large.",J.ValueBaseSmall="Value in base too small.",J.ValueBaseLong="Value in base too long.",J.NegativeLength="Length cannot be negative.",J.PatternNotFound="Pattern not found.",J.OneValue="Needs at least one value.",J.TwoValues="Range needs to contain at least two elements.",J.ThreeValues="Range needs to contain at least three elements.",J.IndexBounds="Index out of bounds.",J.IndexLarge="Index too large.",J.Formula="Expected formula.",J.NegativeCount="Count cannot be negative.",J.ParseError="Parsing error.",J.SheetRef="Sheet does not exist.",J.PeriodLong="Period number cannot exceed life length.",J.InvalidDate="Invalid date.",J.BitshiftLong="Result of bitshift is too long.",J.EmptyString="Empty-string argument not allowed.",J.LengthBounds="Length out of bounds.",J.NegativeTime="Time cannot be negative.",J.NoDefault="No default option.",J.NoConditionMet="None of the conditions were met.",J.Selector="Selector cannot exceed the number of arguments.",J.StartEndDate="Start date needs to be earlier than end date.",J.IncorrectDateTime="String does not represent correct DateTime.",J.CharacterCodeBounds="Character code out of bounds.",J.NonZero="Argument cannot be 0.",J.LessThanOne="Argument cannot be less than 1.",J.WeekendString="Incorrect weekend bitmask string.",J.InvalidRoman="Invalid roman numeral.",J.WrongOrder="Wrong order of values.",J.ComplexNumberExpected="Complex number expected.",J.ShouldBeIorJ="Should be 'i' or 'j'.",J.SizeMismatch="Array dimensions mismatched.",J.FunctionName=e=>`Function name ${e} not recognized.`,J.NamedExpressionName=e=>`Named expression ${e} not recognized.`,J.LicenseKey=e=>`License key is ${e}.`;const Z=(0,P.createToken)({name:"AdditionOp",pattern:P.Lexer.NA}),ee=(0,P.createToken)({name:"PlusOp",pattern:/\+/,categories:Z}),te=(0,P.createToken)({name:"MinusOp",pattern:/-/,categories:Z}),ne=(0,P.createToken)({name:"MultiplicationOp",pattern:P.Lexer.NA}),re=(0,P.createToken)({name:"TimesOp",pattern:/\*/,categories:ne}),oe=(0,P.createToken)({name:"DivOp",pattern:/\//,categories:ne}),ie=(0,P.createToken)({name:"PowerOp",pattern:/\^/}),se=(0,P.createToken)({name:"PercentOp",pattern:/%/}),ae=(0,P.createToken)({name:"BooleanOp",pattern:P.Lexer.NA}),le=(0,P.createToken)({name:"EqualsOp",pattern:/=/,categories:ae}),ue=(0,P.createToken)({name:"NotEqualOp",pattern:/<>/,categories:ae}),he=(0,P.createToken)({name:"GreaterThanOp",pattern:/>/,categories:ae}),ce=(0,P.createToken)({name:"LessThanOp",pattern:/=/,categories:ae}),me=(0,P.createToken)({name:"LessThanOrEqualOp",pattern:/<=/,categories:ae}),pe=(0,P.createToken)({name:"ConcatenateOp",pattern:/&/}),fe=(0,P.createToken)({name:"LParen",pattern:/\(/}),ge=(0,P.createToken)({name:"RParen",pattern:/\)/}),ye=(0,P.createToken)({name:"ArrayLParen",pattern:/{/}),we=(0,P.createToken)({name:"ArrayRParen",pattern:/}/}),ve=(0,P.createToken)({name:"StringLiteral",pattern:/"([^"\\]*(\\.[^"\\]*)*)"/}),_e=(0,P.createToken)({name:"ErrorLiteral",pattern:/#[A-Za-z0-9\/]+[?!]?/}),be=(0,P.createToken)({name:"RangeSeparator",pattern:new RegExp(u)}),Se=(0,P.createToken)({name:"ColumnRange",pattern:new RegExp(`${g}${u}${g}`)}),Ce=(0,P.createToken)({name:"RowRange",pattern:new RegExp(`${y}${u}${y}`)}),Ee=(0,P.createToken)({name:"ProcedureName",pattern:new RegExp(`([${c}][${d}]*)\\(`)}),Me=new class{constructor(){this.POSSIBLE_START_CHARACTERS=[...S,...b,h,"'","_"],this.cellReferenceRegexp=new RegExp(v,"y")}match(e,t){this.cellReferenceRegexp.lastIndex=t;const n=this.cellReferenceRegexp.exec(e+"@");return null==n||null==n[1]?null:(n[0]=n[1],n)}},Te=(0,P.createToken)({name:"CellReference",pattern:Me.match.bind(Me),start_chars_hint:Me.POSSIBLE_START_CHARACTERS,line_breaks:!1}),Re=new class{constructor(){this.POSSIBLE_START_CHARACTERS=[...S,"_"],this.namedExpressionRegexp=new RegExp(_,"y"),this.r1c1CellRefRegexp=new RegExp(`^${w}$`)}match(e,t){this.namedExpressionRegexp.lastIndex=t;const n=this.namedExpressionRegexp.exec(e);return null==n||null==n[0]||this.r1c1CellRefRegexp.test(n[0])?null:n}},Ae=(0,P.createToken)({name:"NamedExpression",pattern:Re.match.bind(Re),start_chars_hint:Re.POSSIBLE_START_CHARACTERS,line_breaks:!1}),Ne=e=>{const t=e.translationPackage.getFunctionTranslation("OFFSET"),n=e.errorMapping,r=e.translationPackage.buildFunctionMapping(),o=new RegExp("standard"===e.ignoreWhiteSpace?"[ \\t\\n\\r]+":"\\s+"),i=(0,P.createToken)({name:"WhiteSpace",pattern:o}),s=(0,P.createToken)({name:"ArrayRowSep",pattern:e.arrayRowSeparator}),a=(0,P.createToken)({name:"ArrayColSep",pattern:e.arrayColumnSeparator}),l=(0,P.createToken)({name:"NumberLiteral",pattern:new RegExp(`(([${e.decimalSeparator}]\\d+)|(\\d+([${e.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)}),u=(0,P.createToken)({name:"OffsetProcedureName",pattern:new RegExp(t,"i")});let h,c;return e.functionArgSeparator===e.arrayColumnSeparator?(h=a,c=[]):e.functionArgSeparator===e.arrayRowSeparator?(h=s,c=[]):(h=(0,P.createToken)({name:"ArgSeparator",pattern:e.functionArgSeparator}),c=[h]),{ArgSeparator:h,NumberLiteral:l,OffsetProcedureName:u,ArrayRowSeparator:s,ArrayColSeparator:a,WhiteSpace:i,allTokens:[i,ee,te,re,oe,ie,le,ue,se,de,me,he,ce,fe,ge,ye,we,u,Ee,be,...c,Se,Ce,l,ve,_e,pe,ae,Z,ne,Te,Ae,s,a],errorMapping:n,functionMapping:r,decimalSeparator:e.decimalSeparator,maxColumns:e.maxColumns,maxRows:e.maxRows}};class Le extends P.EmbeddedActionsParser{constructor(e,t){super(e.allTokens,{outputCst:!1,maxLookahead:7}),this.booleanExpressionOrEmpty=this.RULE("booleanExpressionOrEmpty",(()=>this.OR([{ALT:()=>this.SUBRULE(this.booleanExpression)},{ALT:(0,P.EMPTY_ALT)({type:Y.EMPTY,leadingWhitespace:void 0})}]))),this.procedureExpression=this.RULE("procedureExpression",(()=>{var e;const t=this.CONSUME(Ee),n=t.image.toUpperCase().slice(0,-1),r=null!==(e=this.lexerConfig.functionMapping[n])&&void 0!==e?e:n,o=[];let i=this.SUBRULE(this.booleanExpressionOrEmpty);this.MANY((()=>{var e;const t=this.CONSUME(this.lexerConfig.ArgSeparator);i.type===Y.EMPTY&&(i.leadingWhitespace=null===(e=t.leadingWhitespace)||void 0===e?void 0:e.image),o.push(i),i=this.SUBRULE2(this.booleanExpressionOrEmpty)})),o.push(i),1===o.length&&o[0].type===Y.EMPTY&&(o.length=0);const s=this.CONSUME(ge);return((e,t,n,r)=>({type:Y.FUNCTION_CALL,procedureName:e,args:t,leadingWhitespace:null==n?void 0:n.image,internalWhitespace:null==r?void 0:r.image,hyperlink:void 0}))(r,o,t.leadingWhitespace,s.leadingWhitespace)})),this.namedExpressionExpression=this.RULE("namedExpressionExpression",(()=>{const e=this.CONSUME(Ae);return t=e.image,n=e.leadingWhitespace,{type:Y.NAMED_EXPRESSION,expressionName:t,leadingWhitespace:null==n?void 0:n.image};var t,n})),this.offsetProcedureExpression=this.RULE("offsetProcedureExpression",(()=>{const e=[];return this.CONSUME(this.lexerConfig.OffsetProcedureName),this.CONSUME(fe),this.MANY_SEP({SEP:this.lexerConfig.ArgSeparator,DEF:()=>{e.push(this.SUBRULE(this.booleanExpression))}}),this.CONSUME(ge),this.handleOffsetHeuristic(e)})),this.columnRangeExpression=this.RULE("columnRangeExpression",(()=>{const e=this.CONSUME(Se),[t,n]=e.image.split(":"),r=this.ACTION((()=>A(this.sheetMapping,t,this.formulaAddress))),o=this.ACTION((()=>A(this.sheetMapping,n,this.formulaAddress)));if(void 0===r||void 0===o)return j(new Cn(sn.REF));if(r.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns))return z(e.image,new Cn(sn.NAME),e.leadingWhitespace);if(void 0===r.sheet&&void 0!==o.sheet)return this.parsingError(F.ParserError,"Malformed range expression");const{firstEnd:i,secondEnd:s,sheetRefType:a}=Le.fixSheetIdsForRangeEnds(r,o);return l=i,u=s,h=a,c=e.leadingWhitespace,$(l,u,h),{type:Y.COLUMN_RANGE,start:l,end:u,sheetReferenceType:h,leadingWhitespace:null==c?void 0:c.image};var l,u,h,c})),this.rowRangeExpression=this.RULE("rowRangeExpression",(()=>{const e=this.CONSUME(Ce),[t,n]=e.image.split(":"),r=this.ACTION((()=>N(this.sheetMapping,t,this.formulaAddress))),o=this.ACTION((()=>N(this.sheetMapping,n,this.formulaAddress)));if(void 0===r||void 0===o)return j(new Cn(sn.REF));if(r.exceedsSheetSizeLimits(this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxRows))return z(e.image,new Cn(sn.NAME),e.leadingWhitespace);if(void 0===r.sheet&&void 0!==o.sheet)return this.parsingError(F.ParserError,"Malformed range expression");const{firstEnd:i,secondEnd:s,sheetRefType:a}=Le.fixSheetIdsForRangeEnds(r,o);return l=i,u=s,h=a,c=e.leadingWhitespace,$(l,u,h),{type:Y.ROW_RANGE,start:l,end:u,sheetReferenceType:h,leadingWhitespace:null==c?void 0:c.image};var l,u,h,c})),this.cellReference=this.RULE("cellReference",(()=>{const e=this.CONSUME(Te),t=this.ACTION((()=>R(this.sheetMapping,e.image,this.formulaAddress)));return void 0===t?z(e.image,new Cn(sn.REF),e.leadingWhitespace):t.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?z(e.image,new Cn(sn.NAME),e.leadingWhitespace):U(t,e.leadingWhitespace)})),this.endRangeReference=this.RULE("endRangeReference",(e=>{var t;const n=this.CONSUME(Te),r=this.ACTION((()=>R(this.sheetMapping,e.image,this.formulaAddress))),o=this.ACTION((()=>R(this.sheetMapping,n.image,this.formulaAddress)));return void 0===r||void 0===o?this.ACTION((()=>z(`${e.image}:${n.image}`,new Cn(sn.REF),e.leadingWhitespace))):r.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)||o.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?this.ACTION((()=>z(`${e.image}:${n.image}`,new Cn(sn.NAME),e.leadingWhitespace))):this.buildCellRange(r,o,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image)})),this.endOfRangeExpression=this.RULE("endOfRangeExpression",(e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeReference,{ARGS:[e]})},{ALT:()=>{var t;const n=this.SUBRULE(this.offsetProcedureExpression),r=this.ACTION((()=>R(this.sheetMapping,e.image,this.formulaAddress)));return void 0===r?j(new Cn(sn.REF)):n.type===Y.CELL_REFERENCE?this.buildCellRange(r,n.reference,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image):this.parsingError(F.RangeOffsetNotAllowed,"Range offset not allowed here")}}]))),this.cellRangeExpression=this.RULE("cellRangeExpression",(()=>{const e=this.CONSUME(Te);return this.CONSUME2(be),this.SUBRULE(this.endOfRangeExpression,{ARGS:[e]})})),this.endRangeWithOffsetStartReference=this.RULE("endRangeWithOffsetStartReference",(e=>{const t=this.CONSUME(Te),n=this.ACTION((()=>R(this.sheetMapping,t.image,this.formulaAddress)));return void 0===n?this.ACTION((()=>j(new Cn(sn.REF)))):this.buildCellRange(e.reference,n,e.leadingWhitespace)})),this.endOfRangeWithOffsetStartExpression=this.RULE("endOfRangeWithOffsetStartExpression",(e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeWithOffsetStartReference,{ARGS:[e]})},{ALT:()=>{const t=this.SUBRULE(this.offsetProcedureExpression);return t.type===Y.CELL_REFERENCE?this.buildCellRange(e.reference,t.reference,e.leadingWhitespace):this.parsingError(F.RangeOffsetNotAllowed,"Range offset not allowed here")}}]))),this.offsetExpression=this.RULE("offsetExpression",(()=>{const e=this.SUBRULE(this.offsetProcedureExpression);let t;return this.OPTION((()=>{this.CONSUME(be),t=e.type===Y.CELL_RANGE?this.parsingError(F.RangeOffsetNotAllowed,"Range offset not allowed here"):this.SUBRULE(this.endOfRangeWithOffsetStartExpression,{ARGS:[e]})})),void 0!==t?t:e})),this.insideArrayExpression=this.RULE("insideArrayExpression",(()=>{const e=[[]];return e[e.length-1].push(this.SUBRULE(this.booleanExpression)),this.MANY((()=>{this.OR([{ALT:()=>{this.CONSUME(this.lexerConfig.ArrayColSeparator),e[e.length-1].push(this.SUBRULE2(this.booleanExpression))}},{ALT:()=>{this.CONSUME(this.lexerConfig.ArrayRowSeparator),e.push([]),e[e.length-1].push(this.SUBRULE3(this.booleanExpression))}}])})),W(e)})),this.parenthesisExpression=this.RULE("parenthesisExpression",(()=>{const e=this.CONSUME(fe),t=this.SUBRULE(this.booleanExpression),n=this.CONSUME(ge);return((e,t,n)=>({type:Y.PARENTHESIS,expression:e,leadingWhitespace:null==t?void 0:t.image,internalWhitespace:null==n?void 0:n.image}))(t,e.leadingWhitespace,n.leadingWhitespace)})),this.arrayExpression=this.RULE("arrayExpression",(()=>this.OR([{ALT:()=>{const e=this.CONSUME(ye),t=this.SUBRULE(this.insideArrayExpression),n=this.CONSUME(we);return W(t.args,e.leadingWhitespace,n.leadingWhitespace)}},{ALT:()=>this.SUBRULE(this.parenthesisExpression)}]))),this.numericStringToNumber=e=>{const t=e.replace(this.lexerConfig.decimalSeparator,".");return Number(t)},this.positiveAtomicExpression=this.RULE("positiveAtomicExpression",(()=>{var e;return this.OR(null!==(e=this.atomicExpCache)&&void 0!==e?e:this.atomicExpCache=[{ALT:()=>this.SUBRULE(this.arrayExpression)},{ALT:()=>this.SUBRULE(this.cellRangeExpression)},{ALT:()=>this.SUBRULE(this.columnRangeExpression)},{ALT:()=>this.SUBRULE(this.rowRangeExpression)},{ALT:()=>this.SUBRULE(this.offsetExpression)},{ALT:()=>this.SUBRULE(this.cellReference)},{ALT:()=>this.SUBRULE(this.procedureExpression)},{ALT:()=>this.SUBRULE(this.namedExpressionExpression)},{ALT:()=>{const e=this.CONSUME(this.lexerConfig.NumberLiteral);return t=this.numericStringToNumber(e.image),n=e.leadingWhitespace,{type:Y.NUMBER,value:t,leadingWhitespace:null==n?void 0:n.image};var t,n}},{ALT:()=>(e=>{var t;return{type:Y.STRING,value:e.image.slice(1,-1),leadingWhitespace:null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image}})(this.CONSUME(ve))},{ALT:()=>{const e=this.CONSUME(_e),t=e.image.toUpperCase(),n=this.lexerConfig.errorMapping[t];return n?j(new Cn(n),e.leadingWhitespace):this.parsingError(F.ParserError,"Unknown error literal")}}])})),this.rightUnaryOpAtomicExpression=this.RULE("rightUnaryOpAtomicExpression",(()=>{const e=this.SUBRULE(this.positiveAtomicExpression),t=this.OPTION((()=>this.CONSUME(se)));return t?(n=e,r=t.leadingWhitespace,{type:Y.PERCENT_OP,value:n,leadingWhitespace:null==r?void 0:r.image}):e;var n,r})),this.atomicExpression=this.RULE("atomicExpression",(()=>this.OR([{ALT:()=>{const e=this.CONSUME(Z),t=this.SUBRULE(this.atomicExpression);return(0,P.tokenMatcher)(e,ee)?((e,t)=>({type:Y.PLUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}))(t,e.leadingWhitespace):(0,P.tokenMatcher)(e,te)?((e,t)=>({type:Y.MINUS_UNARY_OP,value:e,leadingWhitespace:null==t?void 0:t.image}))(t,e.leadingWhitespace):(this.customParsingError=H(F.ParserError,"Mismatched token type"),this.customParsingError)}},{ALT:()=>this.SUBRULE2(this.rightUnaryOpAtomicExpression)}]))),this.powerExpression=this.RULE("powerExpression",(()=>{let e=this.SUBRULE(this.atomicExpression);return this.MANY((()=>{const t=this.CONSUME(ie),n=this.SUBRULE2(this.atomicExpression);var r,o,i;(0,P.tokenMatcher)(t,ie)?(r=e,o=n,i=t.leadingWhitespace,e={type:Y.POWER_OP,left:r,right:o,leadingWhitespace:null==i?void 0:i.image}):this.ACTION((()=>{throw Error("Operator not supported")}))})),e})),this.multiplicationExpression=this.RULE("multiplicationExpression",(()=>{let e=this.SUBRULE(this.powerExpression);return this.MANY((()=>{const t=this.CONSUME(ne),n=this.SUBRULE2(this.powerExpression);var r,o,i;(0,P.tokenMatcher)(t,re)?(r=e,o=n,i=t.leadingWhitespace,e={type:Y.TIMES_OP,left:r,right:o,leadingWhitespace:null==i?void 0:i.image}):(0,P.tokenMatcher)(t,oe)?e=((e,t,n)=>({type:Y.DIV_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):this.ACTION((()=>{throw Error("Operator not supported")}))})),e})),this.additionExpression=this.RULE("additionExpression",(()=>{let e=this.SUBRULE(this.multiplicationExpression);return this.MANY((()=>{const t=this.CONSUME(Z),n=this.SUBRULE2(this.multiplicationExpression);var r,o,i;(0,P.tokenMatcher)(t,ee)?(r=e,o=n,i=t.leadingWhitespace,e={type:Y.PLUS_OP,left:r,right:o,leadingWhitespace:null==i?void 0:i.image}):(0,P.tokenMatcher)(t,te)?e=((e,t,n)=>({type:Y.MINUS_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):this.ACTION((()=>{throw Error("Operator not supported")}))})),e})),this.concatenateExpression=this.RULE("concatenateExpression",(()=>{let e=this.SUBRULE(this.additionExpression);return this.MANY((()=>{const t=this.CONSUME(pe),n=this.SUBRULE2(this.additionExpression);var r,o,i;r=e,o=n,i=t.leadingWhitespace,e={type:Y.CONCATENATE_OP,left:r,right:o,leadingWhitespace:null==i?void 0:i.image}})),e})),this.booleanExpression=this.RULE("booleanExpression",(()=>{let e=this.SUBRULE(this.concatenateExpression);return this.MANY((()=>{const t=this.CONSUME(ae),n=this.SUBRULE2(this.concatenateExpression);var r,o,i;(0,P.tokenMatcher)(t,le)?(r=e,o=n,i=t.leadingWhitespace,e={type:Y.EQUALS_OP,left:r,right:o,leadingWhitespace:null==i?void 0:i.image}):(0,P.tokenMatcher)(t,ue)?e=((e,t,n)=>({type:Y.NOT_EQUAL_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):(0,P.tokenMatcher)(t,he)?e=((e,t,n)=>({type:Y.GREATER_THAN_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):(0,P.tokenMatcher)(t,ce)?e=((e,t,n)=>({type:Y.LESS_THAN_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):(0,P.tokenMatcher)(t,de)?e=((e,t,n)=>({type:Y.GREATER_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):(0,P.tokenMatcher)(t,me)?e=((e,t,n)=>({type:Y.LESS_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null==n?void 0:n.image}))(e,n,t.leadingWhitespace):this.ACTION((()=>{throw Error("Operator not supported")}))})),e})),this.formula=this.RULE("formula",(()=>(this.CONSUME(le),this.SUBRULE(this.booleanExpression)))),this.lexerConfig=e,this.sheetMapping=t,this.formulaAddress=An(0,0,0),this.performSelfAnalysis()}parseFromTokens(e,t){this.input=e;let n=this.formulaWithContext(t),r=[];return this.customParsingError&&r.push(this.customParsingError),r=r.concat(this.errors.map((e=>({type:F.ParserError,message:e.message})))),r.length>0&&(n=G()),{ast:n,errors:r}}reset(){super.reset(),this.customParsingError=void 0}formulaWithContext(e){return this.formulaAddress=e,this.formula()}buildCellRange(e,t,n){if(void 0===e.sheet&&void 0!==t.sheet)return this.parsingError(F.ParserError,"Malformed range expression");const{firstEnd:r,secondEnd:o,sheetRefType:i}=Le.fixSheetIdsForRangeEnds(e,t);return B(r,o,i,n)}static fixSheetIdsForRangeEnds(e,t){const n=Le.rangeSheetReferenceType(e.sheet,t.sheet);return{firstEnd:e,secondEnd:void 0!==e.sheet&&void 0===t.sheet?t.withSheet(e.sheet):t,sheetRefType:n}}handleOffsetHeuristic(e){const t=e[0];if(t.type!==Y.CELL_REFERENCE)return this.parsingError(F.StaticOffsetError,"First argument to OFFSET is not a reference");const n=e[1];let r;if(n.type===Y.NUMBER&&Number.isInteger(n.value))r=n.value;else if(n.type===Y.PLUS_UNARY_OP&&n.value.type===Y.NUMBER&&Number.isInteger(n.value.value))r=n.value.value;else{if(n.type!==Y.MINUS_UNARY_OP||n.value.type!==Y.NUMBER||!Number.isInteger(n.value.value))return this.parsingError(F.StaticOffsetError,"Second argument to OFFSET is not a static number");r=-n.value.value}const i=e[2];let s;if(i.type===Y.NUMBER&&Number.isInteger(i.value))s=i.value;else if(i.type===Y.PLUS_UNARY_OP&&i.value.type===Y.NUMBER&&Number.isInteger(i.value.value))s=i.value.value;else{if(i.type!==Y.MINUS_UNARY_OP||i.value.type!==Y.NUMBER||!Number.isInteger(i.value.value))return this.parsingError(F.StaticOffsetError,"Third argument to OFFSET is not a static number");s=-i.value.value}const a=e[3];let u;if(void 0===a)u=1;else{if(a.type!==Y.NUMBER)return this.parsingError(F.StaticOffsetError,"Fourth argument to OFFSET is not a static number");if(u=a.value,u<1)return this.parsingError(F.StaticOffsetError,"Fourth argument to OFFSET is too small number");if(!Number.isInteger(u))return this.parsingError(F.StaticOffsetError,"Fourth argument to OFFSET is not integer")}const h=e[4];let c;if(void 0===h)c=1;else{if(h.type!==Y.NUMBER)return this.parsingError(F.StaticOffsetError,"Fifth argument to OFFSET is not a static number");if(c=h.value,c<1)return this.parsingError(F.StaticOffsetError,"Fifth argument to OFFSET is too small number");if(!Number.isInteger(c))return this.parsingError(F.StaticOffsetError,"Fifth argument to OFFSET is not integer")}const d=new l(t.reference.col+s,t.reference.row+r,t.reference.type);let m=d.col,p=d.row;if(t.reference.type!==o.CELL_REFERENCE_RELATIVE&&t.reference.type!==o.CELL_REFERENCE_ABSOLUTE_COL||(p+=this.formulaAddress.row),t.reference.type!==o.CELL_REFERENCE_RELATIVE&&t.reference.type!==o.CELL_REFERENCE_ABSOLUTE_ROW||(m+=this.formulaAddress.col),m<0||p<0)return j(new Cn(sn.REF,J.OutOfSheet));if(1===c&&1===u)return U(d);{const e=new l(d.col+c-1,d.row+u-1,d.type);return B(d,e,V.RELATIVE)}}parsingError(e,t){return this.customParsingError=H(e,t),G()}static rangeSheetReferenceType(e,t){return void 0===e?V.RELATIVE:void 0===t?V.START_ABSOLUTE:V.BOTH_ABSOLUTE}}class xe{constructor(e){this.lexerConfig=e,this.lexer=new P.Lexer(e.allTokens,{ensureOptimizations:!0})}tokenizeFormula(e){const t=this.lexer.tokenize(e);let n=t.tokens;return n=this.trimTrailingWhitespaces(n),n=this.skipWhitespacesInsideRanges(n),n=this.skipWhitespacesBeforeArgSeparators(n),t.tokens=n,t}skipWhitespacesInsideRanges(e){return xe.filterTokensByNeighbors(e,((e,t,n)=>((0,P.tokenMatcher)(e,Te)||(0,P.tokenMatcher)(e,be))&&(0,P.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&((0,P.tokenMatcher)(n,Te)||(0,P.tokenMatcher)(n,be))))}skipWhitespacesBeforeArgSeparators(e){return xe.filterTokensByNeighbors(e,((e,t,n)=>!(0,P.tokenMatcher)(e,this.lexerConfig.ArgSeparator)&&(0,P.tokenMatcher)(t,this.lexerConfig.WhiteSpace)&&(0,P.tokenMatcher)(n,this.lexerConfig.ArgSeparator)))}static filterTokensByNeighbors(e,t){if(e.length<3)return e;let n=0;const r=[e[n++]];for(;n0&&(0,P.tokenMatcher)(e[e.length-1],this.lexerConfig.WhiteSpace)&&e.pop(),e}}class Oe{constructor(e,t,n,r){this.config=e,this.lexerConfig=t,this.sheetMappingFn=n,this.namedExpressions=r}unparse(e,t){return"="+this.unparseAst(e,t)}unparseAst(e,t){var n,r;switch(e.type){case Y.EMPTY:return K("",e.leadingWhitespace);case Y.NUMBER:return K(Ie(e.value,this.config.decimalSeparator),e.leadingWhitespace);case Y.STRING:return K('"'+e.value+'"',e.leadingWhitespace);case Y.FUNCTION_CALL:{const n=e.args.map((e=>void 0!==e?this.unparseAst(e,t):"")).join(this.config.functionArgSeparator),r=(this.config.translationPackage.isFunctionTranslated(e.procedureName)?this.config.translationPackage.getFunctionTranslation(e.procedureName):e.procedureName)+"("+n+K(")",e.internalWhitespace);return K(r,e.leadingWhitespace)}case Y.NAMED_EXPRESSION:return K((null===(n=this.namedExpressions.nearestNamedExpression(e.expressionName,t.sheet))||void 0===n?void 0:n.displayName)||e.expressionName,e.leadingWhitespace);case Y.CELL_REFERENCE:{let n;return n=void 0!==e.reference.sheet?this.unparseSheetName(e.reference.sheet)+"!":"",n+=null!==(r=e.reference.unparse(t))&&void 0!==r?r:this.config.translationPackage.getErrorTranslation(sn.REF),K(n,e.leadingWhitespace)}case Y.COLUMN_RANGE:case Y.ROW_RANGE:case Y.CELL_RANGE:return K(this.formatRange(e,t),e.leadingWhitespace);case Y.PLUS_UNARY_OP:{const n=this.unparseAst(e.value,t);return K("+",e.leadingWhitespace)+n}case Y.MINUS_UNARY_OP:{const n=this.unparseAst(e.value,t);return K("-",e.leadingWhitespace)+n}case Y.PERCENT_OP:return this.unparseAst(e.value,t)+K("%",e.leadingWhitespace);case Y.ERROR:return K(this.config.translationPackage.getErrorTranslation(e.error?e.error.type:sn.ERROR),e.leadingWhitespace);case Y.ERROR_WITH_RAW_INPUT:return K(e.rawInput,e.leadingWhitespace);case Y.PARENTHESIS:{const n="("+this.unparseAst(e.expression,t)+K(")",e.internalWhitespace);return K(n,e.leadingWhitespace)}case Y.ARRAY:{const n="{"+e.args.map((e=>e.map((e=>this.unparseAst(e,t))).join(this.config.arrayColumnSeparator))).join(this.config.arrayRowSeparator)+K("}",e.internalWhitespace);return K(n,e.leadingWhitespace)}default:{const n=this.unparseAst(e.left,t),r=this.unparseAst(e.right,t);return n+K(X[e.type],e.leadingWhitespace)+r}}}unparseSheetName(e){const t=k(e,this.sheetMappingFn);if(void 0===t)throw new lt(e);return t}formatRange(e,t){let n="",r="";void 0!==e.start.sheet&&e.sheetReferenceType!==V.RELATIVE&&(n=this.unparseSheetName(e.start.sheet)+"!"),void 0!==e.end.sheet&&e.sheetReferenceType===V.BOTH_ABSOLUTE&&(r=this.unparseSheetName(e.end.sheet)+"!");const o=e.start.unparse(t),i=e.end.unparse(t);return void 0===o||void 0===i?this.config.translationPackage.getErrorTranslation(sn.REF):`${n}${o}:${r}${i}`}}function Ie(e,t){return e.toString().replace(".",t)}class ke{constructor(e,t,n){this.config=e,this.functionRegistry=t,this.sheetMapping=n,this.statsCacheUsed=0,this.lexerConfig=Ne(e),this.lexer=new xe(this.lexerConfig),this.formulaParser=new Le(this.lexerConfig,this.sheetMapping),this.cache=new q(this.functionRegistry)}parse(e,t){this.formulaAddress=t;const n=this.tokenizeFormula(e);if(n.errors.length>0){const e=n.errors.map((e=>({type:F.LexingError,message:e.message})));return{ast:G(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}const r=this.computeHashFromTokens(n.tokens,t);let o=this.cache.get(r);if(void 0!==o)++this.statsCacheUsed;else{const e=this.bindWhitespacesToTokens(n.tokens),i=this.formulaParser.parseFromTokens(e,t);if(i.errors.length>0)return Object.assign(Object.assign({},i),{hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]});o=this.cache.set(r,i.ast)}const{ast:i,hasVolatileFunction:s,hasStructuralChangeFunction:a}=o,l=this.convertReversedRangesToRegularRanges(i);return{ast:l,errors:[],hasVolatileFunction:s,hasStructuralChangeFunction:a,dependencies:Pe(l,this.functionRegistry)}}convertReversedRangesToRegularRanges(e){switch(e.type){case Y.EMPTY:case Y.NUMBER:case Y.STRING:case Y.ERROR:case Y.ERROR_WITH_RAW_INPUT:case Y.CELL_REFERENCE:case Y.NAMED_EXPRESSION:return e;case Y.CELL_RANGE:{const{start:t,end:n}=e,r=this.orderCellRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case Y.COLUMN_RANGE:{const{start:t,end:n}=e,r=this.orderColumnRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case Y.ROW_RANGE:{const{start:t,end:n}=e,r=this.orderRowRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case Y.PERCENT_OP:case Y.PLUS_UNARY_OP:case Y.MINUS_UNARY_OP:{const t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case Y.CONCATENATE_OP:case Y.EQUALS_OP:case Y.NOT_EQUAL_OP:case Y.LESS_THAN_OP:case Y.GREATER_THAN_OP:case Y.LESS_THAN_OR_EQUAL_OP:case Y.GREATER_THAN_OR_EQUAL_OP:case Y.MINUS_OP:case Y.PLUS_OP:case Y.TIMES_OP:case Y.DIV_OP:case Y.POWER_OP:{const t=this.convertReversedRangesToRegularRanges(e.left),n=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:n})}case Y.PARENTHESIS:{const t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case Y.FUNCTION_CALL:{const t=e.args.map((e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}case Y.ARRAY:{const t=e.args.map((e=>e.map((e=>this.convertReversedRangesToRegularRanges(e)))));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){const n=[e,t],[r,o]=n.map((e=>e.toColumnAddress())).sort(s.compareByAbsoluteAddress(this.formulaAddress)),[i,u]=n.map((e=>e.toRowAddress())).sort(a.compareByAbsoluteAddress(this.formulaAddress)),[h,c]=n.map((e=>e.sheet)).sort(ke.compareSheetIds.bind(this));return{start:l.fromColAndRow(r,i,h),end:l.fromColAndRow(o,u,c)}}orderColumnRangeEnds(e,t){const n=[e,t],[r,o]=n.sort(s.compareByAbsoluteAddress(this.formulaAddress)),[i,a]=n.map((e=>e.sheet)).sort(ke.compareSheetIds.bind(this));return{start:new s(r.type,r.col,i),end:new s(o.type,o.col,a)}}orderRowRangeEnds(e,t){const n=[e,t],[r,o]=n.sort(a.compareByAbsoluteAddress(this.formulaAddress)),[i,s]=n.map((e=>e.sheet)).sort(ke.compareSheetIds.bind(this));return{start:new a(r.type,r.row,i),end:new a(o.type,o.row,s)}}static compareSheetIds(e,t){return(e=null!=e?e:1/0)-(null!=t?t:1/0)}fetchCachedResultForAst(e){const t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){const t=this.cache.get(e);if(void 0===t)throw new Error("There is no AST with such key in the cache");{const{ast:e,hasVolatileFunction:n,hasStructuralChangeFunction:r,relativeDependencies:o}=t;return{ast:e,errors:[],hasVolatileFunction:n,hasStructuralChangeFunction:r,dependencies:o}}}computeHashFromTokens(e,t){var n;let r="",o=0;for(;othis.computeHashOfAstNode(e))).join(this.config.functionArgSeparator),n=e.procedureName+"("+t+K(")",e.internalWhitespace);return K(n,e.leadingWhitespace)}case Y.CELL_REFERENCE:return K(e.reference.hash(!0),e.leadingWhitespace);case Y.COLUMN_RANGE:case Y.ROW_RANGE:case Y.CELL_RANGE:return K(e.start.hash(e.sheetReferenceType!==V.RELATIVE)+":"+e.end.hash(e.sheetReferenceType===V.BOTH_ABSOLUTE),e.leadingWhitespace);case Y.MINUS_UNARY_OP:return K("-"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case Y.PLUS_UNARY_OP:return K("+"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case Y.PERCENT_OP:return this.computeHashOfAstNode(e.value)+K("%",e.leadingWhitespace);case Y.ERROR:return K(this.config.translationPackage.getErrorTranslation(e.error?e.error.type:sn.ERROR),e.leadingWhitespace);case Y.ERROR_WITH_RAW_INPUT:return K(e.rawInput,e.leadingWhitespace);case Y.ARRAY:return K("{"+e.args.map((e=>e.map((e=>this.computeHashOfAstNode(e))).join(","))).join(";")+K("}",e.internalWhitespace),e.leadingWhitespace);case Y.PARENTHESIS:{const t="("+this.computeHashOfAstNode(e.expression)+K(")",e.internalWhitespace);return K(t,e.leadingWhitespace)}default:return this.computeHashOfAstNode(e.left)+K(X[e.type],e.leadingWhitespace)+this.computeHashOfAstNode(e.right)}}bindWhitespacesToTokens(e){const t=[],n=e[0];(0,P.tokenMatcher)(n,this.lexerConfig.WhiteSpace)||t.push(n);for(let n=1;n{switch(e.type){case Y.EMPTY:case Y.NUMBER:case Y.STRING:case Y.ERROR:return;case Y.NAMED_EXPRESSION:return void(r&&n.push(new Ue(e.expressionName)));case Y.CELL_REFERENCE:return void(r&&n.push(new He(e.reference)));case Y.CELL_RANGE:return void(r&&e.start.sheet===e.end.sheet&&n.push(new Fe(e.start,e.end)));case Y.COLUMN_RANGE:return void(r&&e.start.sheet===e.end.sheet&&n.push(new Ye(e.start,e.end)));case Y.ROW_RANGE:return void(r&&e.start.sheet===e.end.sheet&&n.push(new Ve(e.start,e.end)));case Y.PERCENT_OP:case Y.PLUS_UNARY_OP:case Y.MINUS_UNARY_OP:return void De(e.value,t,n,!0);case Y.CONCATENATE_OP:case Y.EQUALS_OP:case Y.NOT_EQUAL_OP:case Y.LESS_THAN_OP:case Y.GREATER_THAN_OP:case Y.LESS_THAN_OR_EQUAL_OP:case Y.GREATER_THAN_OR_EQUAL_OP:case Y.MINUS_OP:case Y.PLUS_OP:case Y.TIMES_OP:case Y.DIV_OP:case Y.POWER_OP:return De(e.left,t,n,!0),void De(e.right,t,n,!0);case Y.PARENTHESIS:return void De(e.expression,t,n,r);case Y.FUNCTION_CALL:{const r=!t.doesFunctionNeedArgumentToBeComputed(e.procedureName);return void e.args.forEach((e=>De(e,t,n,r)))}}},Pe=(e,t)=>{const n=new Array;return De(e,t,n,!0),n};class He{constructor(e){this.dependency=e}absolutize(e){return this.dependency.toSimpleCellAddress(e)}}class Fe{constructor(e,t){this.start=e,this.end=t}absolutize(e){return new Hn(this.start.toSimpleCellAddress(e),this.end.toSimpleCellAddress(e))}}class Ye{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleColumnAddress(e),n=this.end.toSimpleColumnAddress(e);return new Fn(t.sheet,t.col,n.col)}}class Ve{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleRowAddress(e),n=this.end.toSimpleRowAddress(e);return new Yn(t.sheet,t.row,n.row)}}class Ue{constructor(e){this.name=e}absolutize(e){return this}}const Be=(e,t)=>e.map((e=>e.absolutize(t))),We=Symbol("Empty value");function je(e){return e instanceof ze?e.val:e}class ze{constructor(e,t){this.val=e,this.format=t}fromNumber(e){return new this.constructor(e)}}function Ge(e,t){if("number"==typeof e)return t;{const n=e.fromNumber(t);return n.format=e.format,n}}class $e extends ze{getDetailedType(){return Ze.NUMBER_DATE}}class Ke extends ze{getDetailedType(){return Ze.NUMBER_CURRENCY}}class Xe extends ze{getDetailedType(){return Ze.NUMBER_TIME}}class qe extends ze{getDetailedType(){return Ze.NUMBER_DATETIME}}class Qe extends ze{getDetailedType(){return Ze.NUMBER_PERCENT}}function Je(e){return"number"==typeof e||e instanceof ze}var Ze,et;function tt(e){return e instanceof ze?{type:e.getDetailedType(),format:e.format}:{type:Ze.NUMBER_RAW}}!function(e){e.NUMBER_RAW="NUMBER_RAW",e.NUMBER_DATE="NUMBER_DATE",e.NUMBER_TIME="NUMBER_TIME",e.NUMBER_DATETIME="NUMBER_DATETIME",e.NUMBER_CURRENCY="NUMBER_CURRENCY",e.NUMBER_PERCENT="NUMBER_PERCENT"}(Ze||(Ze={}));class nt{constructor(e,t,n,r){this._data=e,this.range=t,this.dependencyGraph=n,this._hasOnlyNumbers=r,this.size=void 0===e?new ur(t.effectiveWidth(n),t.effectiveHeight(n)):new ur(e[0].length,e.length)}get data(){return this.ensureThatComputed(),this._data}static fromRange(e,t,n){return new nt(e,t,n,!0)}static onlyNumbers(e){return new nt(e,void 0,void 0,!0)}static onlyValues(e){return new nt(e,void 0,void 0,void 0)}static onlyRange(e,t){return new nt(void 0,e,t,void 0)}static fromScalar(e){return new nt([[e]],void 0,void 0,void 0)}isAdHoc(){return void 0===this.range}width(){return this.size.width}height(){return this.size.height}valuesFromTopLeftCorner(){this.ensureThatComputed();const e=[];for(let t=0;t{const t=this.dependencyGraph.getCellValue(e);return t instanceof nt?(this._hasOnlyNumbers=!1,new Cn(sn.VALUE,J.ScalarExpected)):(Je(t)||(this._hasOnlyNumbers=!1),t)})))}}class rt{constructor(){this.changes=new Map}static empty(){return new rt}addAll(e){for(const t of e.changes.values())this.add(t.address,t);return this}addChange(e,t,n){this.addInterpreterValue(e,t,n)}exportChanges(e){let t=[];return this.changes.forEach((n=>{const r=e.exportChange(n);Array.isArray(r)?t=t.concat(r):t.push(r)})),t}getChanges(){return Array.from(this.changes.values())}isEmpty(){return 0===this.changes.size}add(e,t){const n=t.value;if(n instanceof nt)for(const t of n.effectiveAddressesFromData(e))this.changes.delete(xn(t));this.changes.set(xn(e),t)}addInterpreterValue(e,t,n){this.add(t,{address:t,value:e,oldValue:n})}}class ot{constructor(e,t,n){if(this.sheet=e,this.rowStart=t,this.rowEnd=n,t<0)throw Error("Starting row cant be less than 0");if(nn?null:new ot(this.sheet,t,n)}firstRow(){return new ot(this.sheet,this.rowStart,this.rowStart)}}class it{constructor(e,t,n){if(this.sheet=e,this.columnStart=t,this.columnEnd=n,t<0)throw Error("Starting column cant be less than 0");if(nn?null:new it(this.sheet,t,n)}firstColumn(){return new it(this.sheet,this.columnStart,this.columnStart)}}!function(e){e.BUILD_ENGINE_TOTAL="BUILD_ENGINE_TOTAL",e.PARSER="PARSER",e.GRAPH_BUILD="GRAPH_BUILD",e.COLLECT_DEPENDENCIES="COLLECT_DEPENDENCIES",e.PROCESS_DEPENDENCIES="PROCESS_DEPENDENCIES",e.TOP_SORT="TOP_SORT",e.BUILD_COLUMN_INDEX="BUILD_COLUMN_INDEX",e.EVALUATION="EVALUATION",e.VLOOKUP="VLOOKUP",e.TRANSFORM_ASTS="TRANSFORM_ASTS",e.TRANSFORM_ASTS_POSTPONED="TRANSFORM_ASTS_POSTPONED",e.ADJUSTING_ADDRESS_MAPPING="ADJUSTING_ADDRESS_MAPPING",e.ADJUSTING_ARRAY_MAPPING="ADJUSTING_ARRAY_MAPPING",e.ADJUSTING_RANGES="ADJUSTING_RANGES",e.ADJUSTING_GRAPH="ADJUSTING_GRAPH",e.CRITERION_FUNCTION_FULL_CACHE_USED="CRITERION_FUNCTION_FULL_CACHE_USED",e.CRITERION_FUNCTION_PARTIAL_CACHE_USED="CRITERION_FUNCTION_PARTIAL_CACHE_USED"}(et||(et={}));class st{constructor(){this.stats=new Map([[et.CRITERION_FUNCTION_FULL_CACHE_USED,0],[et.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0]]),this.startTimes=new Map}incrementCriterionFunctionFullCacheUsed(){var e;const t=(null!==(e=this.stats.get(et.CRITERION_FUNCTION_FULL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(et.CRITERION_FUNCTION_FULL_CACHE_USED,t)}incrementCriterionFunctionPartialCacheUsed(){var e;const t=(null!==(e=this.stats.get(et.CRITERION_FUNCTION_PARTIAL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(et.CRITERION_FUNCTION_PARTIAL_CACHE_USED,t)}reset(){this.stats.clear(),this.startTimes.clear(),this.stats.set(et.CRITERION_FUNCTION_FULL_CACHE_USED,0),this.stats.set(et.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0)}start(e){if(this.startTimes.get(e))throw Error(`Statistics ${e} already started`);this.startTimes.set(e,Date.now())}end(e){var t;const n=Date.now(),r=this.startTimes.get(e);if(!r)throw Error(`Statistics ${e} not started`);{let o=null!==(t=this.stats.get(e))&&void 0!==t?t:0;o+=n-r,this.stats.set(e,o),this.startTimes.delete(e)}}measure(e,t){this.start(e);const n=t();return this.end(e),n}snapshot(){return new Map(this.stats)}}class at extends st{incrementCriterionFunctionFullCacheUsed(){}incrementCriterionFunctionPartialCacheUsed(){}start(e){}end(e){}}class lt extends Error{constructor(e){super(`There's no sheet with id = ${e}`)}}class ut extends Error{constructor(e){super(`There's no sheet with name '${e}'`)}}class ht extends Error{constructor(e){super(`Sheet with name ${e} already exists`)}}class ct extends Error{constructor(){super("Sheet size limit exceeded")}}class dt extends Error{constructor(){super("This is not a formula")}}class mt extends Error{constructor(e){super(`Address (row = ${e.row}, col = ${e.col}) is invalid`)}}class pt extends Error{constructor(e){super(`Invalid arguments, expected ${e}`)}}class ft extends Error{constructor(e,t){super(`Sheets ${e} and ${t} are not equal.`)}}class gt extends Error{constructor(e){super(`Name of Named Expression '${e}' is already present`)}}class yt extends Error{constructor(e){super(`Name of Named Expression '${e}' is invalid`)}}class wt extends Error{constructor(e){super(`Named Expression '${e}' does not exist`)}}class vt extends Error{constructor(){super("There is no operation to undo")}}class _t extends Error{constructor(){super("There is no operation to redo")}}class bt extends Error{constructor(){super("There is nothing to paste")}}function St(e,t){switch(typeof t){case"function":case"symbol":return t.toString();case"bigint":return"BigInt("+t.toString()+")";default:return t instanceof RegExp?"RegExp("+t.toString()+")":t}}class Ct extends Error{constructor(e){super(`Unable to parse value: ${JSON.stringify(e,St,4)}`)}}class Et extends Error{constructor(e,t){super(`Expected value of type: ${e} for config parameter: ${t}`)}}class Mt extends Error{constructor(e){super(`Config parameter ${e} cannot be empty.`)}}class Tt extends Error{constructor(e,t){super(`Config parameter ${e} should be at least ${t}`)}}class Rt extends Error{constructor(e,t){super(`Config parameter ${e} should be at most ${t}`)}}class At extends Error{constructor(e,t){super(`Expected one of ${e} for config parameter: ${t}`)}}class Nt extends Error{constructor(){super("Computations are suspended")}}class Lt extends Error{constructor(e){super(`Translation for ${e} is missing in the translation package you're using.`)}}class xt extends Error{constructor(e){super(`Cannot register translation for function with id: ${e}`)}}class Ot extends Error{constructor(){super("Language not registered.")}}class It extends Error{constructor(){super("Language already registered.")}}class kt extends Error{static functionNotDeclaredInPlugin(e,t){return new kt(`Function with id ${e} not declared in plugin ${t}`)}static functionMethodNotFound(e,t){return new kt(`Function method ${e} not found in plugin ${t}`)}}class Dt extends Error{static cannotRegisterFunctionWithId(e){return new Dt(`Cannot register function with id ${e}`)}static cannotUnregisterFunctionWithId(e){return new Dt(`Cannot unregister function with id ${e}`)}static cannotUnregisterProtectedPlugin(){return new Dt("Cannot unregister protected plugin")}}class Pt extends Error{constructor(){super("Cannot perform this operation, source location has an array inside.")}}class Ht extends Error{constructor(){super("Cannot perform this operation, target location has an array inside.")}}class Ft extends Error{constructor(){super("Relative addresses not allowed in named expressions.")}}class Yt extends Error{constructor(e,t){super(`Alias id ${e} in plugin ${t} already defined as a function or alias.`)}}class Vt{constructor(e){this.policy=e,this.mapping=new Map}getCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new lt(e.sheet);return t.getCell(e)}fetchCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new lt(e.sheet);const n=t.getCell(e);if(!n)throw Error("Vertex for address missing in AddressMapping");return n}strategyFor(e){const t=this.mapping.get(e);if(void 0===t)throw new lt(e);return t}addSheet(e,t){if(this.mapping.has(e))throw Error("Sheet already added");this.mapping.set(e,t)}autoAddSheet(e,t){const{height:n,width:r,fill:o}=t,i=this.policy.call(o);this.addSheet(e,new i(r,n))}getCellValue(e){const t=this.getCell(e);return void 0===t?We:t instanceof Gt?t.getArrayCellValue(e):t.getCellValue()}getRawValue(e){const t=this.getCell(e);return t instanceof fn?t.getValues().rawValue:t instanceof Gt?t.getArrayCellRawValue(e):null}setCell(e,t){const n=this.mapping.get(e.sheet);if(!n)throw Error("Sheet not initialized");n.setCell(e,t)}moveCell(e,t){const n=this.mapping.get(e.sheet);if(!n)throw Error("Sheet not initialized.");if(e.sheet!==t.sheet)throw Error("Cannot move cells between sheets.");if(n.has(t))throw new Error("Cannot move cell. Destination already occupied.");const r=n.getCell(e);if(void 0===r)throw new Error("Cannot move cell. No cell with such address.");this.setCell(t,r),this.removeCell(e)}removeCell(e){const t=this.mapping.get(e.sheet);if(!t)throw Error("Sheet not initialized");t.removeCell(e)}has(e){const t=this.mapping.get(e.sheet);return void 0!==t&&t.has(e)}getHeight(e){const t=this.mapping.get(e);if(void 0===t)throw new lt(e);return t.getHeight()}getWidth(e){const t=this.mapping.get(e);if(!t)throw new lt(e);return t.getWidth()}addRows(e,t,n){const r=this.mapping.get(e);if(void 0===r)throw new lt(e);r.addRows(t,n)}removeRows(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new lt(e.sheet);t.removeRows(e)}removeSheet(e){this.mapping.delete(e)}addColumns(e,t,n){const r=this.mapping.get(e);if(void 0===r)throw new lt(e);r.addColumns(t,n)}removeColumns(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new lt(e.sheet);t.removeColumns(e)}*verticesFromRowsSpan(e){yield*this.mapping.get(e.sheet).verticesFromRowsSpan(e)}*verticesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).verticesFromColumnsSpan(e)}*entriesFromRowsSpan(e){yield*this.mapping.get(e.sheet).entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).entriesFromColumnsSpan(e)}*entries(){for(const[e,t]of this.mapping.entries())yield*t.getEntries(e)}*sheetEntries(e){const t=this.mapping.get(e);if(void 0===t)throw new lt(e);yield*t.getEntries(e)}}class Ut{constructor(){this.arrayMapping=new Map}getArray(e){const t=this.getArrayByCorner(e.start);if(null==t?void 0:t.getRange().sameAs(e))return t}getArrayByCorner(e){return this.arrayMapping.get(xn(e))}setArray(e,t){this.arrayMapping.set(xn(e.start),t)}removeArray(e){"string"==typeof e?this.arrayMapping.delete(e):this.arrayMapping.delete(xn(e.start))}count(){return this.arrayMapping.size}*arraysInRows(e){for(const[t,n]of this.arrayMapping.entries())n.spansThroughSheetRows(e.sheet,e.rowStart,e.rowEnd)&&(yield[t,n])}*arraysInCols(e){for(const[t,n]of this.arrayMapping.entries())n.spansThroughSheetColumn(e.sheet,e.columnStart,e.columnEnd)&&(yield[t,n])}isFormulaArrayInRow(e,t){for(const n of this.arrayMapping.values())if(n.spansThroughSheetRows(e,t))return!0;return!1}isFormulaArrayInAllRows(e){let t=!0;for(const n of e.rows())this.isFormulaArrayInRow(e.sheet,n)||(t=!1);return t}isFormulaArrayInColumn(e,t){for(const n of this.arrayMapping.values())if(n.spansThroughSheetColumn(e,t))return!0;return!1}isFormulaArrayInAllColumns(e){let t=!0;for(const n of e.columns())this.isFormulaArrayInColumn(e.sheet,n)||(t=!1);return t}isFormulaArrayInRange(e){for(const t of this.arrayMapping.values())if(t.getRange().doesOverlap(e))return!0;return!1}isFormulaArrayAtAddress(e){for(const t of this.arrayMapping.values())if(t.getRange().addressInRange(e))return!0;return!1}moveArrayVerticesAfterRowByRows(e,t,n){this.updateArrayVerticesInSheet(e,((e,r)=>{const o=r.getRange();return t<=o.start.row?[o.shifted(0,n),r]:void 0}))}moveArrayVerticesAfterColumnByColumns(e,t,n){this.updateArrayVerticesInSheet(e,((e,r)=>{const o=r.getRange();return t<=o.start.col?[o.shifted(n,0),r]:void 0}))}updateArrayVerticesInSheet(e,t){const n=Array();for(const[r,o]of this.arrayMapping.entries()){if(o.sheet!==e)continue;const i=t(r,o);void 0!==i&&(this.removeArray(r),n.push(i))}n.forEach((([e,t])=>{this.setArray(e,t)}))}}class Bt{constructor(e){this.size=e}width(){return this.size.width}height(){return this.size.height}get(e,t){throw Error("Array not computed yet.")}simpleRangeValue(){throw Error("Array not computed yet.")}}class Wt{constructor(e){if(this.size=new ur(e.length>0?e[0].length:0,e.length),this.array=e,this.size.width<=0||this.size.height<=0)throw Error("Incorrect array size")}static fromInterpreterValue(e){return new Wt(e instanceof nt?e.data:[[e]])}simpleRangeValue(){return nt.onlyValues(this.array)}addRows(e,t){this.array.splice(e,0,...this.nullArrays(t,this.width())),this.size.height+=t}addColumns(e,t){for(let n=0;ne.height)throw Error("Resizing to smaller array");if(this.width()e.width)throw Error("Resizing to smaller array")}outOfBound(e,t){return e<0||t<0||t>this.size.height-1||e>this.size.width-1}}class jt{constructor(e,t){this.error=e,this.size=t}get(e,t){return this.error}width(){return this.size.width}height(){return this.size.height}simpleRangeValue(){return this.error}}class zt{constructor(e,t,n){this.formula=e,this.cellAddress=t,this.version=n}get width(){return 1}get height(){return 1}static fromAst(e,t,n,r){return n.isScalar()?new $t(e,t,r):new Gt(e,t,n,r)}getFormula(e){return this.ensureRecentData(e),this.formula}ensureRecentData(e){if(this.version!=e.version()){const[t,n,r]=e.applyTransformations(this.formula,this.cellAddress,this.version);this.formula=t,this.cellAddress=n,this.version=r}}getAddress(e){return this.ensureRecentData(e),this.cellAddress}}class Gt extends zt{constructor(e,t,n,r=0){super(e,t,r),n.isRef?this.array=new jt(new Cn(sn.REF,J.NoSpaceForArrayResult),ur.error()):this.array=new Bt(n)}get width(){return this.array.width()}get height(){return this.array.height()}get sheet(){return this.cellAddress.sheet}get leftCorner(){return this.cellAddress}setCellValue(e){if(e instanceof Cn)return this.setErrorValue(e),e;const t=Wt.fromInterpreterValue(e);return t.resize(this.array.size),this.array=t,e}getCellValue(){if(this.array instanceof Bt)throw Error("Array not computed yet.");return this.array.simpleRangeValue()}valueOrUndef(){if(!(this.array instanceof Bt))return this.array.simpleRangeValue()}getArrayCellValue(e){const t=e.col-this.cellAddress.col,n=e.row-this.cellAddress.row;try{return this.array.get(t,n)}catch(e){return new Cn(sn.REF)}}getArrayCellRawValue(e){const t=this.getArrayCellValue(e);return t instanceof Cn||t===We?void 0:je(t)}setArrayCellValue(e,t){const n=e.col-this.cellAddress.col,r=e.row-this.cellAddress.row;this.array instanceof Wt&&this.array.set(n,r,t)}setNoSpace(){return this.array=new jt(new Cn(sn.SPILL,J.NoSpaceForArrayResult),ur.error()),this.getCellValue()}getRange(){return Hn.spanFrom(this.cellAddress,this.width,this.height)}getRangeOrUndef(){return Hn.spanFromOrUndef(this.cellAddress,this.width,this.height)}setAddress(e){this.cellAddress=e}setFormula(e){this.formula=e}spansThroughSheetRows(e,t,n=t){return this.cellAddress.sheet===e&&this.cellAddress.row<=n&&te.criterionFunctionCache.clear())),this.dependentCacheRanges.clear()}getStart(){return this.start}getEnd(){return this.end}}const Xt=(e,t,n,r,o)=>{if(t instanceof Kt){const e=t.range.intersectionWith(n);return void 0!==e?Array.from(e.addresses(o)):[]}let i,s;return t instanceof zt?(i=t.getFormula(r),s=t.getAddress(r),Pe(i,e).filter((e=>e instanceof He)).map((e=>e.dependency.toSimpleCellAddress(s))).filter((e=>n.addressInRange(e)))):[]};var qt;!function(e){e[e.ON_STACK=0]="ON_STACK",e[e.PROCESSED=1]="PROCESSED",e[e.POPPED=2]="POPPED"}(qt||(qt={}));class Qt{constructor(e=[],t=[]){this.nodesSparseArray=e,this.edgesSparseArray=t,this.entranceTime=[],this.low=[],this.parent=[],this.inSCC=[],this.nodeStatus=[],this.order=[],this.sccNonSingletons=[],this.timeCounter=0}getTopSortedWithSccSubgraphFrom(e,t,n){const r=e.reverse();return r.forEach((e=>this.runDFS(e))),this.postprocess(r,n,t)}getAdjacentNodeIds(e){return this.edgesSparseArray[e].filter((e=>void 0!==e&&this.nodesSparseArray[e]))}runDFS(e){if(void 0!==this.nodeStatus[e])return;this.nodeStatus[e]=qt.ON_STACK;const t=[e],n=[];for(;t.length>0;){const e=t[t.length-1];switch(this.nodeStatus[e]){case qt.ON_STACK:this.handleOnStack(e,n,t);break;case qt.PROCESSED:this.handleProcessed(e,n,t);break;case qt.POPPED:t.pop()}}}handleOnStack(e,t,n){this.entranceTime[e]=this.timeCounter,this.low[e]=this.timeCounter,this.timeCounter++,t.push(e),this.getAdjacentNodeIds(e).forEach((t=>{void 0===this.entranceTime[t]&&(n.push(t),this.parent[t]=e,this.nodeStatus[t]=qt.ON_STACK)})),this.nodeStatus[e]=qt.PROCESSED}handleProcessed(e,t,n){let r=this.entranceTime[e];if(this.getAdjacentNodeIds(e).forEach((t=>{this.inSCC[t]||(r=this.parent[t]===e?Math.min(r,this.low[t]):Math.min(r,this.entranceTime[t]))})),this.low[e]=r,r===this.entranceTime[e]){const n=[];do{n.push(t[t.length-1]),t.pop()}while(n[n.length-1]!==e);n.forEach((e=>{this.inSCC[e]=!0})),this.order.push(...n),n.length>1&&n.forEach((e=>{this.sccNonSingletons[e]=!0}))}n.pop(),this.nodeStatus[e]=qt.POPPED}postprocess(e,t,n){const r=[];e.forEach((e=>{r[e]=!0}));const o=[],i=[];return this.order.reverse(),this.order.forEach((e=>{const s=this.getAdjacentNodeIds(e);this.sccNonSingletons[e]||s.includes(e)?(i.push(this.nodesSparseArray[e]),t(this.nodesSparseArray[e]),s.forEach((e=>r[e]=!0))):(o.push(this.nodesSparseArray[e]),r[e]&&n(this.nodesSparseArray[e])&&s.forEach((e=>r[e]=!0)))})),{sorted:o,cycled:i}}}class Jt{constructor(e,t){this.rawValue=e,this.processFn=t,this.processedValue=null}getProcessedValue(){return null===this.processedValue&&(this.processedValue=this.processFn(this.rawValue)),this.processedValue}markAsModified(){this.processedValue=null}}class Zt{constructor(e){this.dependencyQuery=e,this.nodesSparseArray=[],this.edgesSparseArray=[],this.nodesIds=new Map,this.dirtyAndVolatileNodeIds=new Jt({dirty:[],volatile:[]},(e=>this.processDirtyAndVolatileNodeIds(e))),this.infiniteRangeIds=new Set,this.changingWithStructureNodeIds=[],this.nextId=0}getNodes(){return this.nodesSparseArray.filter((e=>void 0!==e))}hasNode(e){return this.nodesIds.has(e)}existsEdge(e,t){const n=this.getNodeId(e),r=this.getNodeId(t);return void 0!==n&&void 0!==r&&this.edgesSparseArray[n].includes(r)}adjacentNodes(e){const t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);return new Set(this.edgesSparseArray[t].filter((e=>void 0!==e)).map((e=>this.nodesSparseArray[e])))}adjacentNodesCount(e){const t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);return this.fixEdgesArrayForNode(t).length}addNodeAndReturnId(e){const t=this.nodesIds.get(e);if(void 0!==t)return t;const n=this.nextId;return this.nextId++,this.nodesSparseArray[n]=e,this.edgesSparseArray[n]=[],this.nodesIds.set(e,n),n}addEdge(e,t){const n=this.getNodeIdIfNotNumber(e),r=this.getNodeIdIfNotNumber(t);if(void 0===n)throw this.missingNodeError(e);if(void 0===r)throw this.missingNodeError(t);this.edgesSparseArray[n].includes(r)||this.edgesSparseArray[n].push(r)}removeNode(e){const t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);this.edgesSparseArray[t].length>0&&(this.edgesSparseArray[t].forEach((e=>this.dirtyAndVolatileNodeIds.rawValue.dirty.push(e))),this.dirtyAndVolatileNodeIds.markAsModified());const n=this.removeDependencies(e);return delete this.nodesSparseArray[t],delete this.edgesSparseArray[t],this.infiniteRangeIds.delete(t),this.nodesIds.delete(e),n}removeEdge(e,t){const n=this.getNodeIdIfNotNumber(e),r=this.getNodeIdIfNotNumber(t);if(void 0===n)throw this.missingNodeError(e);if(void 0===r)throw this.missingNodeError(t);const o=this.edgesSparseArray[n].indexOf(r);if(-1===o)throw new Error("Edge does not exist");delete this.edgesSparseArray[n][o]}removeEdgeIfExists(e,t){const n=this.getNodeId(e),r=this.getNodeId(t);if(void 0===n)return;if(void 0===r)return;const o=this.edgesSparseArray[n].indexOf(r);-1!==o&&delete this.edgesSparseArray[n][o]}topSortWithScc(){return this.getTopSortedWithSccSubgraphFrom(this.getNodes(),(()=>!0),(()=>{}))}getTopSortedWithSccSubgraphFrom(e,t,n){const r=new Qt(this.nodesSparseArray,this.edgesSparseArray),o=e.map((e=>this.getNodeId(e))).filter((e=>void 0!==e));return r.getTopSortedWithSccSubgraphFrom(o,t,n)}markNodeAsVolatile(e){const t=this.getNodeId(e);void 0!==t&&(this.dirtyAndVolatileNodeIds.rawValue.volatile.push(t),this.dirtyAndVolatileNodeIds.markAsModified())}markNodeAsDirty(e){const t=this.getNodeId(e);void 0!==t&&(this.dirtyAndVolatileNodeIds.rawValue.dirty.push(t),this.dirtyAndVolatileNodeIds.markAsModified())}getDirtyAndVolatileNodes(){return this.dirtyAndVolatileNodeIds.getProcessedValue()}clearDirtyNodes(){this.dirtyAndVolatileNodeIds.rawValue.dirty=[],this.dirtyAndVolatileNodeIds.markAsModified()}markNodeAsChangingWithStructure(e){const t=this.getNodeId(e);void 0!==t&&this.changingWithStructureNodeIds.push(t)}markChangingWithStructureNodesAsDirty(){this.changingWithStructureNodeIds.length<=0||(this.dirtyAndVolatileNodeIds.rawValue.dirty=[...this.dirtyAndVolatileNodeIds.rawValue.dirty,...this.changingWithStructureNodeIds],this.dirtyAndVolatileNodeIds.markAsModified())}markNodeAsInfiniteRange(e){const t=this.getNodeIdIfNotNumber(e);void 0!==t&&this.infiniteRangeIds.add(t)}getInfiniteRanges(){return[...this.infiniteRangeIds].map((e=>({node:this.nodesSparseArray[e],id:e})))}getNodeId(e){return this.nodesIds.get(e)}getNodeIdIfNotNumber(e){return"number"==typeof e?e:this.nodesIds.get(e)}fixEdgesArrayForNode(e){const t=this.edgesSparseArray[e];return this.edgesSparseArray[e]=t.filter((e=>void 0!==e&&this.nodesSparseArray[e])),this.edgesSparseArray[e]}removeDependencies(e){const t=this.dependencyQuery(e);return t.forEach((([t,n])=>{this.removeEdgeIfExists(n,e)})),t}processDirtyAndVolatileNodeIds({dirty:e,volatile:t}){return[...new Set([...e,...t])].map((e=>this.nodesSparseArray[e])).filter((e=>void 0!==e))}missingNodeError(e){return new Error(`Unknown node ${e}`)}}class en{constructor(){this.rangeMapping=new Map}getMappingSize(e){var t,n;return null!==(n=null===(t=this.rangeMapping.get(e))||void 0===t?void 0:t.size)&&void 0!==n?n:0}setRange(e){let t=this.rangeMapping.get(e.getStart().sheet);void 0===t&&(t=new Map,this.rangeMapping.set(e.getStart().sheet,t));const n=tn(e.getStart(),e.getEnd());t.set(n,e)}removeRange(e){const t=e.getStart().sheet,n=this.rangeMapping.get(t);if(void 0===n)return;const r=tn(e.getStart(),e.getEnd());n.delete(r),0===n.size&&this.rangeMapping.delete(t)}getRange(e,t){const n=this.rangeMapping.get(e.sheet),r=tn(e,t);return null==n?void 0:n.get(r)}fetchRange(e,t){const n=this.getRange(e,t);if(!n)throw Error("Range does not exist");return n}truncateRanges(e,t){const n=Array(),r=Array(),o=Array(),i=e.sheet;for(const[s,a]of this.entriesFromSheet(e.sheet)){const l=a.range;e.start<=t(a.range.end)&&(l.removeSpan(e),l.shouldBeRemoved()?(this.removeByKey(i,s),n.push(a)):r.push([s,a]),o.push(a))}const s=[];r.sort(((e,n)=>nn(e[1],n[1],t)));for(const[e,t]of r){const n=tn((a=t.range).start,a.end);if(n===e)continue;const r=this.getByKey(i,n);this.removeByKey(i,e),void 0!==r&&t!=r?s.push([r,t]):this.setRange(t)}var a;return{verticesToRemove:n,verticesToMerge:s,verticesWithChangedSize:o}}moveAllRangesInSheetAfterRowByRows(e,t,n){return this.updateVerticesFromSheet(e,((e,r)=>t<=r.start.row?(r.range.shiftByRows(n),{changedSize:!1,vertex:r}):t>r.start.row&&t<=r.end.row?(r.range.expandByRows(n),{changedSize:!0,vertex:r}):void 0))}moveAllRangesInSheetAfterColumnByColumns(e,t,n){return this.updateVerticesFromSheet(e,((e,r)=>t<=r.start.col?(r.range.shiftByColumns(n),{changedSize:!1,vertex:r}):t>r.start.col&&t<=r.end.col?(r.range.expandByColumns(n),{changedSize:!0,vertex:r}):void 0))}moveRangesInsideSourceRange(e,t,n,r){this.updateVerticesFromSheet(e.sheet,((o,i)=>e.containsRange(i.range)?(i.range.shiftByColumns(t),i.range.shiftByRows(n),i.range.moveToSheet(r),{changedSize:!1,vertex:i}):void 0))}removeRangesInSheet(e){if(this.rangeMapping.has(e)){const t=this.rangeMapping.get(e).values();return this.rangeMapping.delete(e),t}return[][Symbol.iterator]()}*rangesInSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.values())}*rangeVerticesContainedInRange(e){for(const t of this.rangesInSheet(e.sheet))e.containsRange(t.range)&&(yield t)}findSmallerRange(e){if(e.height()>1&&Number.isFinite(e.height())){const t=An(e.end.sheet,e.end.col,e.end.row-1),n=this.getRange(e.start,t);if(void 0!==n)return{smallerRangeVertex:n,restRange:Hn.fromSimpleCellAddresses(An(e.start.sheet,e.start.col,e.end.row),e.end)}}return{restRange:e}}*entriesFromSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.entries())}removeByKey(e,t){this.rangeMapping.get(e).delete(t)}getByKey(e,t){var n;return null===(n=this.rangeMapping.get(e))||void 0===n?void 0:n.get(t)}updateVerticesFromSheet(e,t){const n=Array();for(const[r,o]of this.entriesFromSheet(e)){const i=t(r,o);void 0!==i&&(this.removeByKey(e,r),n.push(i))}return n.forEach((e=>{this.setRange(e.vertex)})),{verticesWithChangedSize:n.filter((e=>e.changedSize)).map((e=>e.vertex))}}}function tn(e,t){return`${e.col},${e.row},${t.col},${t.row}`}const nn=(e,t,n)=>{const r=n(e.range.start),o=n(e.range.start);return r===o?n(e.range.end)-n(t.range.end):r-o};class rn{constructor(e,t,n){this.functions=e,this.errors=t,this.ui=n,this._protectedTranslations={VERSION:"VERSION"},this.checkUI(),this.checkErrors(),this.checkFunctionTranslations(this.functions),Object.assign(this.functions,this._protectedTranslations)}extendFunctions(e){this.checkFunctionTranslations(e),Object.assign(this.functions,e)}buildFunctionMapping(){return Object.keys(this.functions).reduce(((e,t)=>(e[this.functions[t]]=t,e)),{})}buildErrorMapping(){return Object.keys(this.errors).reduce(((e,t)=>(e[this.errors[t]]=t,e)),{})}isFunctionTranslated(e){return void 0!==this.functions[e]}getFunctionTranslations(e){const t=[];for(const n of e)this.isFunctionTranslated(n)&&t.push(this.functions[n]);return t}getFunctionTranslation(e){const t=this.functions[e];if(void 0===t)throw new Lt(`functions.${e}`);return t}getMaybeFunctionTranslation(e){return this.functions[e]}getErrorTranslation(e){if(e===sn.LIC)return`#${sn.LIC}!`;const t=this.errors[e];if(void 0===t)throw new Lt(`errors.${e}`);return t}getUITranslation(e){const t=this.ui[e];if(void 0===t)throw new Lt(`ui.${e}`);return t}checkUI(){for(const e of Object.values(on))if(!(e in this.ui))throw new Lt(`ui.${e}`)}checkErrors(){for(const e of Object.values(sn))if(!(e in this.errors)&&e!==sn.LIC)throw new Lt(`errors.${e}`)}checkFunctionTranslations(e){const t=new Set(Object.getOwnPropertyNames(e));for(const e of Object.getOwnPropertyNames(this._protectedTranslations))if(t.has(e))throw new xt(e)}}var on,sn,an,ln,un;function hn(e){return e.toLowerCase()}!function(e){e.NEW_SHEET_PREFIX="NEW_SHEET_PREFIX"}(on||(on={}));class cn{constructor(e,t){this.id=e,this.displayName=t}get canonicalName(){return hn(this.displayName)}}class dn{constructor(e){this.languages=e,this.mappingFromCanonicalName=new Map,this.mappingFromId=new Map,this.lastSheetId=-1,this.fetch=e=>{const t=this.mappingFromCanonicalName.get(hn(e));if(void 0===t)throw new ut(e);return t.id},this.get=e=>{var t;return null===(t=this.mappingFromCanonicalName.get(hn(e)))||void 0===t?void 0:t.id},this.fetchDisplayName=e=>this.fetchSheetById(e).displayName,this.sheetNamePrefix=e.getUITranslation(on.NEW_SHEET_PREFIX)}addSheet(e=`${this.sheetNamePrefix}${this.lastSheetId+2}`){const t=hn(e);if(this.mappingFromCanonicalName.has(t))throw new ht(e);this.lastSheetId++;const n=new cn(this.lastSheetId,e);return this.store(n),n.id}removeSheet(e){const t=this.fetchSheetById(e);e==this.lastSheetId&&--this.lastSheetId,this.mappingFromCanonicalName.delete(t.canonicalName),this.mappingFromId.delete(t.id)}getDisplayName(e){var t;return null===(t=this.mappingFromId.get(e))||void 0===t?void 0:t.displayName}*displayNames(){for(const e of this.mappingFromCanonicalName.values())yield e.displayName}numberOfSheets(){return this.mappingFromCanonicalName.size}hasSheetWithId(e){return this.mappingFromId.has(e)}hasSheetWithName(e){return this.mappingFromCanonicalName.has(hn(e))}renameSheet(e,t){const n=this.fetchSheetById(e),r=n.displayName;if(r===t)return;const o=this.mappingFromCanonicalName.get(hn(t));if(void 0!==o&&o.id!==n.id)throw new ht(t);const i=n.canonicalName;return this.mappingFromCanonicalName.delete(i),n.displayName=t,this.store(n),r}sheetNames(){return Array.from(this.mappingFromId.values()).map((e=>e.displayName))}store(e){this.mappingFromId.set(e.id,e),this.mappingFromCanonicalName.set(e.canonicalName,e)}fetchSheetById(e){const t=this.mappingFromId.get(e);if(void 0===t)throw new lt(e);return t}}class mn{constructor(e,t,n,r,o,i,s,a){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=n,this.arrayMapping=r,this.stats=o,this.lazilyTransformingAstService=i,this.functionRegistry=s,this.namedExpressions=a,this.changes=rt.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof Kt)return this.rangeDependencyQuery(e).map((([e,t])=>e));{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,n]=t;return n.map((t=>t instanceof Ue?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:On(t)?t:Pn(t.start,t.end)))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof Kt)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,n]=t;return n.map((t=>{if(t instanceof Hn)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof Ue){const n=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[n.address,this.addressMapping.fetchCell(n.address)]}return[t,this.addressMapping.fetchCell(t)]}))}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:n,restRange:r}=this.rangeMapping.findSmallerRange(e.range);let o;void 0!==n&&this.graph.adjacentNodes(n).has(e)?(o=r,t.push([new Hn(n.start,n.end),n])):o=e.range;for(const e of o.addresses(this)){const n=this.addressMapping.getCell(e);void 0!==n&&t.push([e,n])}return t},this.formulaDependencyQuery=e=>{let t,n;if(!(e instanceof zt))return;n=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const r=Pe(t,this.functionRegistry);return[n,Be(r,n)]},this.graph=new Zt(this.dependencyQueryVertices)}static buildEmpty(e,t,n,r,o){return new mn(new Vt(t.chooseAddressMappingPolicy),new en,new dn(t.translationPackage),new Ut,o,e,n,r)}setFormulaToCell(e,t,n,r,o,i){const s=zt.fromAst(t,e,r,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(s),this.processCellDependencies(n,s),this.graph.markNodeAsDirty(s),o&&this.markAsVolatile(s),i&&this.markAsDependentOnStructureChange(s),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const n=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(n,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const n=this.shrinkPossibleArrayAndGetCell(e);if(n instanceof Gt&&this.arrayMapping.removeArray(n.getRange()),n instanceof fn)n.getValues().rawValue!==t.rawValue&&(n.setValues(t),this.graph.markNodeAsDirty(n));else{const r=new fn(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(n,r),this.addressMapping.setCell(e,r),this.graph.markNodeAsDirty(r)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){const t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return rt.empty();if(this.graph.adjacentNodes(t).size>0){const n=new pn;this.exchangeGraphNode(t,n),0===this.graph.adjacentNodesCount(n)?(this.removeVertex(n),this.addressMapping.removeCell(e)):(this.graph.markNodeAsDirty(n),this.addressMapping.setCell(e,n))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}clearDirtyVertices(){this.graph.clearDirtyNodes()}verticesToRecompute(){return this.graph.getDirtyAndVolatileNodes()}processCellDependencies(e,t){const n=this.graph.getNodeId(t);e.forEach((e=>{if(e instanceof Hn){const t=e;let r=this.getRange(t.start,t.end);void 0===r&&(r=new Kt(t),this.rangeMapping.setRange(r)),this.graph.addNodeAndReturnId(r);const o=this.graph.getNodeId(r);t.isFinite()||this.graph.markNodeAsInfiniteRange(o);const{smallerRangeVertex:i,restRange:s}=this.rangeMapping.findSmallerRange(t);if(void 0!==i){if(this.graph.addEdge(i,o),r.bruteForce){r.bruteForce=!1;for(const e of t.addresses(this))this.graph.removeEdge(this.fetchCell(e),o)}}else r.bruteForce=!0;const a=this.arrayMapping.getArray(s);if(void 0!==a)this.graph.addEdge(a,o);else for(const e of s.addresses(this)){const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=n?n:t,o)}this.graph.addEdge(o,n),t.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(r)}else if(e instanceof Ue){const r=t.getAddress(this.lazilyTransformingAstService).sheet,{vertex:o,id:i}=this.fetchNamedExpressionVertex(e.name,r);this.graph.addEdge(null!=i?i:o,n)}else{const{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:t,n)}}))}fetchNamedExpressionVertex(e,t){const n=this.namedExpressions.namedExpressionOrPlaceholder(e,t);return this.fetchCellOrCreateEmpty(n.address)}exchangeNode(e,t){const n=this.fetchCellOrCreateEmpty(e).vertex,r=this.fetchCellOrCreateEmpty(t).vertex;this.addressMapping.removeCell(e),this.exchangeGraphNode(n,r)}fetchCellOrCreateEmpty(e){const t=this.addressMapping.getCell(e);if(void 0!==t)return{vertex:t,id:void 0};const n=new pn,r=this.graph.addNodeAndReturnId(n);return this.addressMapping.setCell(e,n),{vertex:n,id:r}}removeRows(e){this.stats.measure(et.ADJUSTING_GRAPH,(()=>{for(const[t,n]of this.addressMapping.entriesFromRowsSpan(e)){for(const e of this.graph.adjacentNodes(n))this.graph.markNodeAsDirty(e);if(n instanceof Gt){if(!n.isLeftCorner(t))continue;this.shrinkArrayToCorner(n),this.arrayMapping.removeArray(n.getRange())}this.removeVertex(n)}})),this.stats.measure(et.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeRows(e)}));const t=this.stats.measure(et.ADJUSTING_RANGES,(()=>{const t=this.truncateRanges(e,(e=>e.row));return this.getArrayVerticesRelatedToRanges(t)}));return this.stats.measure(et.ADJUSTING_ARRAY_MAPPING,(()=>{this.fixArraysAfterRemovingRows(e.sheet,e.rowStart,e.numberOfRows)})),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}removeSheet(e){this.clearSheet(e);for(const[t,n]of this.addressMapping.sheetEntries(e)){for(const e of this.graph.adjacentNodes(n))this.graph.markNodeAsDirty(e);this.removeVertex(n),this.addressMapping.removeCell(t)}this.stats.measure(et.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.removeRangesInSheet(e);for(const e of t)this.removeVertex(e);this.stats.measure(et.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeSheet(e)}))}))}clearSheet(e){const t=new Set;for(const[n,r]of this.addressMapping.sheetEntries(e))r instanceof Gt?t.add(r):this.setCellEmpty(n);for(const e of t.values())this.setArrayEmpty(e);this.addStructuralNodesToChangeSet()}removeColumns(e){this.stats.measure(et.ADJUSTING_GRAPH,(()=>{for(const[t,n]of this.addressMapping.entriesFromColumnsSpan(e)){for(const e of this.graph.adjacentNodes(n))this.graph.markNodeAsDirty(e);if(n instanceof Gt){if(!n.isLeftCorner(t))continue;this.shrinkArrayToCorner(n),this.arrayMapping.removeArray(n.getRange())}this.removeVertex(n)}})),this.stats.measure(et.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.removeColumns(e)}));const t=this.stats.measure(et.ADJUSTING_RANGES,(()=>{const t=this.truncateRanges(e,(e=>e.col));return this.getArrayVerticesRelatedToRanges(t)}));return this.stats.measure(et.ADJUSTING_ARRAY_MAPPING,(()=>this.fixArraysAfterRemovingColumns(e.sheet,e.columnStart,e.numberOfColumns))),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addRows(e){this.stats.measure(et.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.addRows(e.sheet,e.rowStart,e.numberOfRows)}));const t=this.stats.measure(et.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterRowByRows(e.sheet,e.rowStart,e.numberOfRows);return this.fixRangesWhenAddingRows(e.sheet,e.rowStart,e.numberOfRows),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)}));this.stats.measure(et.ADJUSTING_ARRAY_MAPPING,(()=>{this.fixArraysAfterAddingRow(e.sheet,e.rowStart,e.numberOfRows)}));for(const t of this.addressMapping.verticesFromRowsSpan(e))this.graph.markNodeAsDirty(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t}}addColumns(e){this.stats.measure(et.ADJUSTING_ADDRESS_MAPPING,(()=>{this.addressMapping.addColumns(e.sheet,e.columnStart,e.numberOfColumns)}));const t=this.stats.measure(et.ADJUSTING_RANGES,(()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterColumnByColumns(e.sheet,e.columnStart,e.numberOfColumns);return this.fixRangesWhenAddingColumns(e.sheet,e.columnStart,e.numberOfColumns),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)}));this.stats.measure(et.ADJUSTING_ARRAY_MAPPING,(()=>this.fixArraysAfterAddingColumn(e.sheet,e.columnStart,e.numberOfColumns)));for(const t of this.addressMapping.verticesFromColumnsSpan(e))this.graph.markNodeAsDirty(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}isThereSpaceForArray(e){const t=e.getRangeOrUndef();if(void 0===t)return!1;for(const n of t.addresses(this)){const t=this.addressMapping.getCell(n);if(void 0!==t&&!(t instanceof pn)&&t!==e)return!1}return!0}moveCells(e,t,n,r){for(const o of e.addressesWithDirection(t,n,this)){const i=An(r,o.col+t,o.row+n);let s=this.addressMapping.getCell(o);const a=this.addressMapping.getCell(i);if(this.addressMapping.removeCell(o),void 0!==s){let t;this.graph.markNodeAsDirty(s),this.addressMapping.setCell(i,s);for(const n of this.graph.adjacentNodes(s))n instanceof Kt&&!e.containsRange(n.range)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(o).vertex,this.graph.addEdge(t,n),this.graph.removeEdge(s,n));t&&(this.graph.markNodeAsDirty(t),this.addressMapping.setCell(o,t))}if(void 0!==a){void 0===s&&this.addressMapping.removeCell(i);for(const e of this.graph.adjacentNodes(a))s=null!=s?s:this.fetchCellOrCreateEmpty(i).vertex,this.graph.addEdge(s,e),this.graph.markNodeAsDirty(s);this.removeVertex(a)}}for(const t of this.rangeMapping.rangeVerticesContainedInRange(e))for(const n of this.graph.adjacentNodes(t))if(n instanceof Kt&&!e.containsRange(n.range)){this.graph.removeEdge(t,n);for(const e of t.range.addresses(this)){const{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:t,n),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t)}}this.rangeMapping.moveRangesInsideSourceRange(e,t,n,r)}setArrayEmpty(e){const t=Hn.spanFrom(e.getAddress(this.lazilyTransformingAstService),e.width,e.height),n=this.graph.adjacentNodes(e);for(const e of t.addresses(this))this.addressMapping.removeCell(e);for(const t of n.values()){const n=Xt(this.functionRegistry,t,e.getRange(),this.lazilyTransformingAstService,this);for(const e of n){const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:n,t)}n.length>0&&this.graph.markNodeAsDirty(t)}this.removeVertex(e),this.arrayMapping.removeArray(e.getRange())}addVertex(e,t){this.graph.addNodeAndReturnId(t),this.addressMapping.setCell(e,t)}addArrayVertex(e,t){this.graph.addNodeAndReturnId(t),this.setAddressMappingForArrayVertex(t,e)}*arrayFormulaNodes(){for(const e of this.graph.getNodes())e instanceof Gt&&(yield e)}*entriesFromRowsSpan(e){yield*this.addressMapping.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.addressMapping.entriesFromColumnsSpan(e)}fetchCell(e){return this.addressMapping.fetchCell(e)}getCell(e){return this.addressMapping.getCell(e)}getCellValue(e){return this.addressMapping.getCellValue(e)}getRawValue(e){return this.addressMapping.getRawValue(e)}getScalarValue(e){const t=this.addressMapping.getCellValue(e);return t instanceof nt?new Cn(sn.VALUE,J.ScalarExpected):t}existsEdge(e,t){return this.graph.existsEdge(e,t)}getSheetId(e){return this.sheetMapping.fetch(e)}getSheetHeight(e){return this.addressMapping.getHeight(e)}getSheetWidth(e){return this.addressMapping.getWidth(e)}getArray(e){return this.arrayMapping.getArray(e)}getRange(e,t){return this.rangeMapping.getRange(e,t)}topSortWithScc(){return this.graph.topSortWithScc()}markAsVolatile(e){this.graph.markNodeAsVolatile(e)}markAsDependentOnStructureChange(e){this.graph.markNodeAsChangingWithStructure(e)}forceApplyPostponedTransformations(){for(const e of this.graph.getNodes())e instanceof $t&&e.ensureRecentData(this.lazilyTransformingAstService)}*rawValuesFromRange(e){for(const t of e.addresses(this)){const e=this.getScalarValue(t);e!==We&&(yield[je(e),t])}}computeListOfValuesInRange(e){const t=[];for(const n of e.addresses(this)){const e=this.getScalarValue(n);t.push(e)}return t}shrinkArrayToCorner(e){this.cleanAddressMappingUnderArray(e);for(const t of this.adjacentArrayVertices(e)){let n;n=t instanceof zt?this.formulaDirectDependenciesToArray(t,e):this.rangeDirectDependenciesToArray(t,e);let r=!1;for(const[o,i]of n)e.isLeftCorner(o)&&(r=!0),this.graph.addEdge(i,t),this.graph.markNodeAsDirty(i);r||this.graph.removeEdge(e,t)}this.graph.markNodeAsDirty(e)}isArrayInternalCell(e){const t=this.getCell(e);return t instanceof Gt&&!t.isLeftCorner(e)}getAndClearContentChanges(){const e=this.changes;return this.changes=rt.empty(),e}getAdjacentNodesAddresses(e){const t=this.graph.adjacentNodes(e),n=[];return t.forEach((e=>{const t=e;t instanceof Kt?n.push(Pn(t.start,t.end)):n.push(t.getAddress(this.lazilyTransformingAstService))})),n}exchangeGraphNode(e,t){this.graph.addNodeAndReturnId(t);const n=this.graph.adjacentNodes(e);this.removeVertex(e),n.forEach((e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)}))}setArray(e,t){this.arrayMapping.setArray(e,t)}correctInfiniteRangesDependency(e){const t=this.graph.getInfiniteRanges().filter((({node:t})=>t.range.addressInRange(e)));if(t.length<=0)return;const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(e),o=null!=r?r:this.graph.getNodeId(n);t.forEach((({id:e})=>{this.graph.addEdge(o,e)}))}exchangeOrAddGraphNode(e,t){e?this.exchangeGraphNode(e,t):this.graph.addNodeAndReturnId(t)}getArrayVerticesRelatedToRanges(e){const t=new Set;return e.forEach((e=>{this.graph.hasNode(e)&&this.graph.adjacentNodes(e).forEach((e=>{e instanceof Gt&&t.add(e)}))})),t}correctInfiniteRangesDependenciesByRangeVertex(e){this.graph.getInfiniteRanges().forEach((({id:t,node:n})=>{const r=e.range.intersectionWith(n.range);void 0!==r&&r.addresses(this).forEach((e=>{const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:n,t)}))}))}cleanAddressMappingUnderArray(e){const t=e.getRange();for(const n of t.addresses(this)){const t=e.getArrayCellValue(n);this.getCell(n)===e?e.isLeftCorner(n)?this.changes.addChange(new Cn(sn.REF),n,t):(this.addressMapping.removeCell(n),this.changes.addChange(We,n,t)):this.changes.addChange(We,n,t)}}*formulaDirectDependenciesToArray(e,t){var n;const[,r]=null!==(n=this.formulaDependencyQuery(e))&&void 0!==n?n:[];if(void 0!==r)for(const e of r)if(!(e instanceof Ue||e instanceof Hn)&&t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e).vertex;yield[e,t]}}*rangeDirectDependenciesToArray(e,t){const{restRange:n}=this.rangeMapping.findSmallerRange(e.range);for(const e of n.addresses(this))if(t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e).vertex;yield[e,t]}}*adjacentArrayVertices(e){const t=this.graph.adjacentNodes(e);for(const e of t)(e instanceof zt||e instanceof Kt)&&(yield e)}addStructuralNodesToChangeSet(){this.graph.markChangingWithStructureNodesAsDirty()}fixRangesWhenAddingRows(e,t,n){const r=Array.from(this.rangeMapping.rangesInSheet(e));for(const e of r)if(e.range.includesRow(t+n))if(e.bruteForce){const r=e.range.rangeWithSameWidth(t,n);for(const t of r.addresses(this)){const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(t);this.graph.addEdge(null!=r?r:n,e)}}else{let t=e,n=this.rangeMapping.findSmallerRange(t.range);if(void 0!==n.smallerRangeVertex)continue;for(;void 0===n.smallerRangeVertex;){const e=new Kt(Hn.spanFrom(t.range.start,t.range.width(),t.range.height()-1));this.rangeMapping.setRange(e),this.graph.addNodeAndReturnId(e);const r=new Hn(An(t.range.start.sheet,t.range.start.col,t.range.end.row),t.range.end);this.addAllFromRange(r,t),this.graph.addEdge(e,t),t=e,n=this.rangeMapping.findSmallerRange(t.range)}this.graph.addEdge(n.smallerRangeVertex,t),this.addAllFromRange(n.restRange,t),this.graph.removeEdge(n.smallerRangeVertex,e)}}addAllFromRange(e,t){for(const n of e.addresses(this)){const{vertex:e,id:r}=this.fetchCellOrCreateEmpty(n);this.graph.addEdge(null!=r?r:e,t)}}fixRangesWhenAddingColumns(e,t,n){for(const r of this.rangeMapping.rangesInSheet(e))if(r.range.includesColumn(t+n)){let o;o=r.bruteForce?r.range.rangeWithSameHeight(t,n):Hn.spanFrom(An(e,t,r.range.end.row),n,1);for(const e of o.addresses(this)){const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=n?n:t,r)}}}exchangeOrAddFormulaVertex(e){const t=e.getAddress(this.lazilyTransformingAstService),n=Hn.spanFrom(t,e.width,e.height),r=this.shrinkPossibleArrayAndGetCell(t);if(e instanceof Gt&&this.setArray(n,e),this.exchangeOrAddGraphNode(r,e),this.addressMapping.setCell(t,e),e instanceof Gt){if(!this.isThereSpaceForArray(e))return;for(const t of n.addresses(this)){if(e.isLeftCorner(t))continue;const n=this.getCell(t);this.exchangeOrAddGraphNode(n,e)}}for(const t of n.addresses(this))this.addressMapping.setCell(t,e)}setAddressMappingForArrayVertex(e,t){if(this.addressMapping.setCell(t,e),!(e instanceof Gt))return;const n=Hn.spanFromOrUndef(t,e.width,e.height);if(void 0!==n&&(this.setArray(n,e),this.isThereSpaceForArray(e)))for(const t of n.addresses(this))this.addressMapping.setCell(t,e)}truncateRanges(e,t){const{verticesToRemove:n,verticesToMerge:r,verticesWithChangedSize:o}=this.rangeMapping.truncateRanges(e,t);for(const[e,t]of r)this.mergeRangeVertices(e,t);for(const e of n)this.removeVertexAndCleanupDependencies(e);return o}fixArraysAfterAddingRow(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,n),!(t<=0))for(const[,r]of this.arrayMapping.arraysInRows(ot.fromRowStartAndEnd(e,t-1,t-1))){const o=r.getRange();for(let i=o.start.col;i<=o.end.col;++i)for(let s=t;s<=o.end.row;++s){const t=An(e,i,s),o=An(e,i,s+n),a=r.getArrayCellValue(t);this.addressMapping.moveCell(o,t),this.changes.addChange(We,o,a)}}}fixArraysAfterRemovingRows(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,-n),!(t<=0))for(const[,n]of this.arrayMapping.arraysInRows(ot.fromRowStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(n))for(const e of n.getRange().addresses(this))this.addressMapping.setCell(e,n);else this.setNoSpaceIfArray(n)}fixArraysAfterAddingColumn(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,n),!(t<=0))for(const[,r]of this.arrayMapping.arraysInCols(it.fromColumnStartAndEnd(e,t-1,t-1))){const o=r.getRange();for(let i=o.start.row;i<=o.end.row;++i)for(let s=t;s<=o.end.col;++s){const t=An(e,s,i),o=An(e,s+n,i),a=r.getArrayCellValue(t);this.addressMapping.moveCell(o,t),this.changes.addChange(We,o,a)}}}fixArraysAfterRemovingColumns(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,-n),!(t<=0))for(const[,n]of this.arrayMapping.arraysInCols(it.fromColumnStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(n))for(const e of n.getRange().addresses(this))this.addressMapping.setCell(e,n);else this.setNoSpaceIfArray(n)}shrinkPossibleArrayAndGetCell(e){const t=this.getCell(e);return t instanceof Gt?(this.setNoSpaceIfArray(t),this.getCell(e)):t}setNoSpaceIfArray(e){e instanceof Gt&&(this.shrinkArrayToCorner(e),e.setNoSpace())}removeVertex(e){this.removeVertexAndCleanupDependencies(e),e instanceof Kt&&this.rangeMapping.removeRange(e)}mergeRangeVertices(e,t){const n=this.graph.adjacentNodes(t);this.removeVertexAndCleanupDependencies(t),this.graph.removeEdgeIfExists(e,t),n.forEach((t=>{this.graph.hasNode(t)&&this.graph.addEdge(e,t)}))}removeVertexAndCleanupDependencies(e){const t=new Set(this.graph.removeNode(e));for(;t.size>0;){const e=t.values().next().value;t.delete(e);const[n,r]=e;this.graph.hasNode(r)&&0===this.graph.adjacentNodesCount(r)&&((r instanceof Kt||r instanceof pn)&&this.graph.removeNode(r).forEach((e=>t.add(e))),r instanceof Kt?this.rangeMapping.removeRange(r):r instanceof pn&&this.addressMapping.removeCell(n))}}}class pn{constructor(){}getCellValue(){return We}}class fn{constructor(e,t){this.parsedValue=e,this.rawValue=t}getValues(){return{parsedValue:this.parsedValue,rawValue:this.rawValue}}setValues(e){this.parsedValue=e.parsedValue,this.rawValue=e.rawValue}getCellValue(){return this.parsedValue}}class gn{constructor(e,t){this.errors=e,this.rawInput=t}getCellValue(){const e=this.errors.map((e=>e.message)).find((e=>e));return Cn.parsingError(e)}getFormula(){return this.rawInput}}class yn{constructor(e,t){this.width=e,this.height=t,this.mapping=new Map}getCell(e){var t;return null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1);let n=this.mapping.get(e.col);n||(n=new Map,this.mapping.set(e.col,n)),n.set(e.row,t)}has(e){var t;return!!(null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row))}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){var t;null===(t=this.mapping.get(e.col))||void 0===t||t.delete(e.row)}addRows(e,t){this.mapping.forEach((n=>{const r=new Map;n.forEach(((o,i)=>{i>=e&&(r.set(i+t,o),n.delete(i))})),r.forEach(((e,t)=>{n.set(t,e)}))})),this.height+=t}addColumns(e,t){const n=new Map;this.mapping.forEach(((r,o)=>{o>=e&&(n.set(o+t,r),this.mapping.delete(o))})),n.forEach(((e,t)=>{this.mapping.set(t,e)})),this.width+=t}removeRows(e){this.mapping.forEach((t=>{const n=new Map;t.forEach(((r,o)=>{o>=e.rowStart&&(t.delete(o),o>e.rowEnd&&n.set(o-e.numberOfRows,r))})),n.forEach(((e,n)=>{t.set(n,e)}))}));const t=Math.min(this.height-1,e.rowEnd),n=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-n)}removeColumns(e){const t=new Map;this.mapping.forEach(((n,r)=>{r>=e.columnStart&&(this.mapping.delete(r),r>e.columnEnd&&t.set(r-e.numberOfColumns,n))})),t.forEach(((e,t)=>{this.mapping.set(t,e)}));const n=Math.min(this.width-1,e.columnEnd),r=Math.max(0,n-e.columnStart+1);this.width=Math.max(0,this.width-r)}*getEntries(e){for(const[t,n]of this.mapping)for(const[r,o]of n)yield[An(e,t,r),o]}*verticesFromColumn(e){const t=this.mapping.get(e);if(void 0!==t)for(const[e,n]of t)yield n}*verticesFromRow(e){for(const t of this.mapping.values()){const n=t.get(e);void 0!==n&&(yield n)}}*verticesFromColumnsSpan(e){for(const t of e.columns()){const e=this.mapping.get(t);if(void 0!==e)for(const[t,n]of e)yield n}}*verticesFromRowsSpan(e){for(const t of this.mapping.values())for(const n of e.rows()){const e=t.get(n);void 0!==e&&(yield e)}}*entriesFromRowsSpan(e){for(const[t,n]of this.mapping.entries())for(const r of e.rows()){const o=n.get(r);void 0!==o&&(yield[An(e.sheet,t,r),o])}}*entriesFromColumnsSpan(e){for(const t of e.columns()){const n=this.mapping.get(t);if(void 0!==n)for(const[r,o]of n.entries())yield[An(e.sheet,t,r),o]}}*vertices(){for(const[e,t]of this.mapping)for(const[e,n]of t)void 0!==n&&(yield n)}}class wn{constructor(e,t){this.width=e,this.height=t,this.mapping=new Array(t);for(let n=0;n{switch(e){case vn.EMPTY:return 0;case vn.NUMBER:return 1;case vn.STRING:return 2;case vn.BOOLEAN:return 3;case vn.ERROR:return 4}throw new Error("Cell value not computed")},Sn=e=>{if(e===We)return vn.EMPTY;if(e instanceof Cn||e instanceof nt)return vn.ERROR;if("string"==typeof e)return vn.STRING;if(Je(e))return vn.NUMBER;if("boolean"==typeof e)return vn.BOOLEAN;throw new Error("Cell value not computed")};class Cn{constructor(e,t,n){this.type=e,this.message=t,this.root=n}static parsingError(e){return new Cn(sn.ERROR,`${J.ParseError}${e?" "+e:""}`)}attachRootVertex(e){return void 0===this.root?new Cn(this.type,this.message,e):this}}const En=(e,t)=>({sheet:e,row:t}),Mn=e=>e.row<0,Tn=(e,t)=>({sheet:e,col:t}),Rn=e=>e.col<0,An=(e,t,n)=>({sheet:e,col:t,row:n}),Nn=e=>e.col<0||e.row<0,Ln=(e,t,n,r)=>An(t,e.col+n,e.row+r),xn=e=>`${e.sheet},${e.row},${e.col}`;function On(e){var t,n,r;return e&&("object"==typeof e||"function"==typeof e)&&"number"==typeof(null===(t=e)||void 0===t?void 0:t.sheet)&&"number"==typeof(null===(n=e)||void 0===n?void 0:n.col)&&"number"==typeof(null===(r=e)||void 0===r?void 0:r.row)}const In=(e,t)=>{var n;return null!==(n=e.sheet)&&void 0!==n?n:t.sheet},kn=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row;function Dn(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"start"in e&&On(e.start)&&"end"in e&&On(e.end)}const Pn=(e,t)=>({start:e,end:t});class Hn{constructor(e,t){if(e.sheet!==t.sheet)throw new ft(e.sheet,t.sheet);this.start=An(e.sheet,e.col,e.row),this.end=An(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new ft(e.sheet,t.sheet);const n=t.col-e.col,r=t.row-e.row;return Number.isFinite(r)&&Number.isFinite(n)?new Hn(e,t):Number.isFinite(r)?new Yn(e.sheet,e.row,t.row):new Fn(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===Y.CELL_RANGE?Hn.fromCellRange(e,t):e.type===Y.COLUMN_RANGE?Fn.fromColumnRange(e,t):Yn.fromRowRangeAst(e,t)}static fromAstOrUndef(e,t){try{return Hn.fromAst(e,t)}catch(e){return}}static fromCellRange(e,t){return new Hn(e.start.toSimpleCellAddress(t),e.end.toSimpleCellAddress(t))}static spanFrom(e,t,n){const r=Hn.spanFromOrUndef(e,t,n);if(void 0===r)throw new Error("AbsoluteCellRange: Wrong range size");return r}static spanFromOrUndef(e,t,n){if(!Number.isFinite(t)&&Number.isFinite(n)){if(0!==e.col)return;return new Yn(e.sheet,e.row,e.row+n-1)}if(!Number.isFinite(n)&&Number.isFinite(t)){if(0!==e.row)return;return new Fn(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(n)&&Number.isFinite(t))return new Hn(e,An(e.sheet,e.col+t-1,e.row+n-1))}static fromCoordinates(e,t,n,r,o){return new Hn(An(e,t,n),An(e,r,o))}isFinite(){return Number.isFinite(this.size())}doesOverlap(e){return!(this.start.sheet!=e.start.sheet||this.end.rowe.end.row||this.end.cole.end.col)}addressInRange(e){return this.sheet===e.sheet&&this.start.row<=e.row&&this.end.row>=e.row&&this.start.col<=e.col&&this.end.col>=e.col}columnInRange(e){return this.sheet===e.sheet&&this.start.col<=e.col&&this.end.col>=e.col}rowInRange(e){return this.sheet===e.sheet&&this.start.row<=e.row&&this.end.row>=e.row}containsRange(e){return this.addressInRange(e.start)&&this.addressInRange(e.end)}intersectionWith(e){if(this.sheet!==e.start.sheet)return;const t=Math.max(this.start.row,e.start.row),n=Math.min(this.end.row,e.end.row),r=Math.max(this.start.col,e.start.col),o=Math.min(this.end.col,e.end.col);return t>n||r>o?void 0:new Hn(An(this.sheet,r,t),An(this.sheet,o,n))}includesRow(e){return this.start.row=e}includesColumn(e){return this.start.col=e}shiftByRows(e){this.start.row+=e,this.end.row+=e}expandByRows(e){this.end.row+=e}shiftByColumns(e){this.start.col+=e,this.end.col+=e}shifted(e,t){return Hn.spanFrom(An(this.sheet,this.start.col+e,this.start.row+t),this.width(),this.height())}expandByColumns(e){this.end.col+=e}moveToSheet(e){this.start.sheet=e,this.end.sheet=e}removeSpan(e){e instanceof ot?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}shouldBeRemoved(){return this.width()<=0||this.height()<=0}rangeWithSameWidth(e,t){return Hn.spanFrom(An(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return Hn.spanFrom(An(this.sheet,e,this.start.row),t,this.height())}toString(){return`${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`}width(){return this.end.col-this.start.col+1}height(){return this.end.row-this.start.row+1}size(){return this.height()*this.width()}arrayOfAddressesInRange(){const e=[];for(let t=0;t0)if(t>0){let e=this.effectiveEndRow(n);for(;e>=this.start.row;){let t=this.effectiveEndColumn(n);for(;t>=this.start.col;)yield An(this.start.sheet,t,e),t-=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(n);){let t=this.effectiveEndColumn(n);for(;t>=this.start.col;)yield An(this.start.sheet,t,e),t-=1;e+=1}}else if(t>0){let e=this.effectiveEndRow(n);for(;e>=this.start.row;){let t=this.start.col;for(;t<=this.effectiveEndColumn(n);)yield An(this.start.sheet,t,e),t+=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(n);){let t=this.start.col;for(;t<=this.effectiveEndColumn(n);)yield An(this.start.sheet,t,e),t+=1;e+=1}}}getAddress(e,t){if(e<0||t<0||t>this.height()-1||e>this.width()-1)throw Error("Index out of bound");return An(this.start.sheet,this.start.col+e,this.start.row+t)}exceedsSheetSizeLimits(e,t){return this.end.col>=e||this.end.row>=t}effectiveEndColumn(e){return this.end.col}effectiveEndRow(e){return this.end.row}effectiveWidth(e){return this.width()}effectiveHeight(e){return this.height()}removeRows(e,t){if(!(e>this.end.row)){if(tthis.end.col)){if(t=e}effectiveEndRow(e){return this.effectiveHeight(e)-1}effectiveHeight(e){return e.getSheetHeight(this.sheet)}removeRows(e,t){}}class Yn extends Hn{constructor(e,t,n){super(An(e,0,t),An(e,Number.POSITIVE_INFINITY,n))}static fromRowRangeAst(e,t){const n=e.start.toSimpleRowAddress(t),r=e.end.toSimpleRowAddress(t);if(n.sheet!==r.sheet)throw new ft(n.sheet,r.sheet);return new Yn(n.sheet,n.row,r.row)}shouldBeRemoved(){return this.height()<=0}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new Yn(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new Yn(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.row>=t}effectiveEndColumn(e){return this.effectiveWidth(e)-1}effectiveWidth(e){return e.getSheetWidth(this.sheet)}removeColumns(e,t){}}class Vn{constructor(e,t,n){this.formulaAddress=e,this.arraysFlag=t,this.formulaVertex=n}}const Un=/^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;class Bn{constructor(e,t,n){this.config=e,this.dateTimeHelper=t,this.numberLiteralsHelper=n,this.lt=(e,t)=>this.compare(e,t)<0,this.leq=(e,t)=>this.compare(e,t)<=0,this.gt=(e,t)=>this.compare(e,t)>0,this.geq=(e,t)=>this.compare(e,t)>=0,this.eq=(e,t)=>0===this.compare(e,t),this.neq=(e,t)=>0!==this.compare(e,t),this.pow=(e,t)=>Math.pow(je(e),je(t)),this.addWithEpsilonRaw=(e,t)=>{const n=e+t;return Math.abs(n){const n=nr(e,t);return this.ExtendedNumberFactory(this.addWithEpsilonRaw(je(e),je(t)),n)},this.unaryMinus=e=>Ge(e,-je(e)),this.unaryPlus=e=>e,this.unaryPercent=e=>new Qe(je(e)/100),this.concat=(e,t)=>e.concat(t),this.nonstrictadd=(e,t)=>e instanceof Cn?e:t instanceof Cn?t:"number"==typeof e?"number"==typeof t?this.addWithEpsilonRaw(e,t):e:"number"==typeof t?t:0,this.subtract=(e,t)=>{const n=nr(e,t),r=je(e);let o=r-je(t);return Math.abs(o){const n=je(e),r=je(t);if(0===r)return new Cn(sn.DIV_BY_ZERO);{const o=rr(e,t);return this.ExtendedNumberFactory(n/r,o)}},this.multiply=(e,t)=>{const n=rr(e,t);return this.ExtendedNumberFactory(je(e)*je(t),n)},this.manyToExactComplex=e=>{const t=[];for(const n of e){if(n instanceof Cn)return n;if(Je(n)||"string"==typeof n){const e=this.coerceScalarToComplex(n);e instanceof Cn||t.push(e)}}return t},this.coerceNumbersExactRanges=e=>this.manyToNumbers(e,this.manyToExactNumbers),this.coerceNumbersCoerceRangesDropNulls=e=>this.manyToNumbers(e,this.manyToCoercedNumbersDropNulls),this.manyToExactNumbers=e=>{const t=[];for(const n of e){if(n instanceof Cn)return n;Je(n)&&t.push(je(n))}return t},this.manyToOnlyNumbersDropNulls=e=>{const t=[];for(const n of e){if(n instanceof Cn)return n;if(Je(n))t.push(je(n));else if(n!==We)return new Cn(sn.VALUE,J.NumberExpected)}return t},this.manyToCoercedNumbersDropNulls=e=>{const t=[];for(const n of e){if(n instanceof Cn)return n;if(n===We)continue;const e=this.coerceScalarToNumberOrError(n);Je(e)&&t.push(je(e))}return t},this.collator=function(e){const t=e.caseSensitive?e.accentSensitive?"variant":"case":e.accentSensitive?"accent":"base",n=e.caseFirst,r=e.ignorePunctuation;return new Intl.Collator(e.localeLang,{sensitivity:t,caseFirst:n,ignorePunctuation:r})}(e),this.actualEps=e.smartRounding?e.precisionEpsilon:0}eqMatcherFunction(e){const t=this.buildRegex(e);return e=>"string"==typeof e&&t.test(this.normalizeString(e))}neqMatcherFunction(e){const t=this.buildRegex(e);return e=>!("string"==typeof e&&t.test(this.normalizeString(e)))}searchString(e,t){var n;const r=this.buildRegex(e,!1).exec(t);return null!==(n=null==r?void 0:r.index)&&void 0!==n?n:-1}requiresRegex(e){if(!this.config.useRegularExpressions&&!this.config.useWildcards)return!this.config.matchWholeCell;for(let t=0;t=0&&n*o>=r&&n<=r*o||r<=0&&n*o<=r&&n>=r*o?0:n>r?1:-1}coerceScalarToNumberOrError(e){var t;return e instanceof Cn?e:null!==(t=this.coerceToMaybeNumber(e))&&void 0!==t?t:new Cn(sn.VALUE,J.NumberCoercion)}coerceToMaybeNumber(e){var t;return null!==(t=this.coerceNonDateScalarToMaybeNumber(e))&&void 0!==t?t:"string"==typeof e?this.dateTimeHelper.dateStringToDateNumber(e):void 0}coerceNonDateScalarToMaybeNumber(e){if(e===We)return 0;if("string"==typeof e){if(""===e)return 0;const t=this.coerceStringToMaybePercentNumber(e);if(void 0!==t)return t;const n=this.coerceStringToMaybeCurrencyNumber(e);return void 0!==n?n:this.numberLiteralsHelper.numericStringToMaybeNumber(e.trim())}return Je(e)?e:"boolean"==typeof e?Number(e):void 0}coerceStringToMaybePercentNumber(e){const t=e.trim();if(t.endsWith("%")){const e=t.slice(0,t.length-1).trim(),n=this.numberLiteralsHelper.numericStringToMaybeNumber(e);if(void 0!==n)return new Qe(n/100)}}coerceStringToMaybeCurrencyNumber(e){const t=this.currencyMatcher(e.trim());if(void 0!==t){const[e,n]=t,r=this.numberLiteralsHelper.numericStringToMaybeNumber(n);if(void 0!==r)return new Ke(r,e)}}currencyMatcher(e){for(const t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length).trim()];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length).trim()]}}coerceComplexExactRanges(e){const t=[];for(const n of e)if(n instanceof nt)t.push(n);else if(n!==We){const e=this.coerceScalarToComplex(n);if(e instanceof Cn)return e;t.push(e)}const n=[];for(const e of t)if(e instanceof nt){const t=this.manyToExactComplex(e.valuesFromTopLeftCorner());if(t instanceof Cn)return t;n.push(...t)}else n.push(e);return n}coerceScalarToComplex(e){return e instanceof Cn?e:e===We?[0,0]:Je(e)?[je(e),0]:"string"==typeof e?this.coerceStringToComplex(e):new Cn(sn.NUM,J.ComplexNumberExpected)}ExtendedNumberFactory(e,t){const{type:n,format:r}=t;switch(n){case Ze.NUMBER_RAW:return e;case Ze.NUMBER_CURRENCY:return new Ke(e,null!=r?r:this.config.currencySymbol[0]);case Ze.NUMBER_DATE:return new $e(e,r);case Ze.NUMBER_DATETIME:return new qe(e,r);case Ze.NUMBER_TIME:return new Xe(e,r);case Ze.NUMBER_PERCENT:return new Qe(e,r)}}buildRegex(e,t=!0){let n;e=this.normalizeString(e);let r=this.config.useWildcards,o=this.config.useRegularExpressions;if(o)try{RegExp(e)}catch(e){o=!1,r=!1}return n=o?function(e,t){let n="";for(let r=0;rr?1:n","=",".","+","-",",","\\","$","^","!"];function tr(e){return er.includes(e)}function nr(e,t){const{type:n,format:r}=tt(e),{type:o,format:i}=tt(t);if(n===Ze.NUMBER_RAW)return{type:o,format:i};if(o===Ze.NUMBER_RAW)return{type:n,format:r};if(!(n!==Ze.NUMBER_DATETIME&&n!==Ze.NUMBER_DATE||o!==Ze.NUMBER_DATETIME&&o!==Ze.NUMBER_DATE))return{type:Ze.NUMBER_RAW};if(n===Ze.NUMBER_TIME){if(o===Ze.NUMBER_DATE)return{type:Ze.NUMBER_DATETIME,format:`${i} ${r}`};if(o===Ze.NUMBER_DATETIME)return{type:Ze.NUMBER_DATETIME,format:i}}if(o===Ze.NUMBER_TIME){if(n===Ze.NUMBER_DATE)return{type:Ze.NUMBER_DATETIME,format:`${r} ${i}`};if(n===Ze.NUMBER_DATETIME)return{type:Ze.NUMBER_DATETIME,format:r}}return{type:n,format:r}}function rr(e,t){let{type:n,format:r}=tt(e),{type:o,format:i}=tt(t);return n===Ze.NUMBER_PERCENT&&(n=Ze.NUMBER_RAW,r=void 0),o===Ze.NUMBER_PERCENT&&(o=Ze.NUMBER_RAW,i=void 0),n===Ze.NUMBER_RAW?{type:o,format:i}:o===Ze.NUMBER_RAW?{type:n,format:r}:{type:Ze.NUMBER_RAW}}function or(e){return sr(e.toLowerCase(),"nfd").replace(/[\u0300-\u036f]/g,"")}function ir(e,t){var n;if(e.isAdHoc())return null===(n=e.data[0])||void 0===n?void 0:n[0];const r=e.range;if(t.formulaAddress.sheet===r.sheet)if(1===r.width()){const n=t.formulaAddress.row-r.start.row;if(n>=0&&n=0&&nthis.arithmeticHelper.coerceScalarToNumberOrError(e),this.runFunction=(e,t,n,r)=>{const o=this.evaluateArguments(e,t,n),i=o.map((([e,t])=>e)),s=o.map((([e,t])=>t)),a=this.buildMetadataForEachArgumentValue(i.length,n),l=t.arraysFlag&&!n.vectorizationForbidden;if(!this.isNumberOfArgumentValuesValid(a,i.length))return new Cn(sn.NA,J.WrongArgNumber);const[u,h]=l?this.calculateSizeOfVectorizedResultArray(i,a):[1,1];if(1===u&&1===h){const e=this.vectorizeAndBroadcastArgumentsIfNecessary(l,i,a,0,0);return this.calculateSingleCellOfResultArray(t,e,a,s,r,n.returnNumberType)}const c=[...Array(u).keys()].map((e=>[...Array(h).keys()].map((o=>{const u=this.vectorizeAndBroadcastArgumentsIfNecessary(l,i,a,e,o),h=this.calculateSingleCellOfResultArray(t,u,a,s,r,n.returnNumberType);if(h instanceof nt)throw new Error("Function returning array cannot be vectorized.");return h}))));return nt.onlyValues(c)},this.runFunctionWithReferenceArgument=(e,t,n,r,o,i=()=>new Cn(sn.NA,J.CellRefExpected))=>{if(0===e.length)return this.returnNumberWrapper(r(),n.returnNumberType);if(e.length>1)return new Cn(sn.NA,J.WrongArgNumber);let s,a=e[0];for(;a.type===Y.PARENTHESIS;)a=a.expression;if(a.type===Y.CELL_REFERENCE)s=a.reference.toSimpleCellAddress(t.formulaAddress);else if(a.type===Y.CELL_RANGE||a.type===Y.COLUMN_RANGE||a.type===Y.ROW_RANGE)try{s=Hn.fromAst(a,t.formulaAddress).start}catch(e){return new Cn(sn.REF,J.CellRefExpected)}return void 0!==s?this.returnNumberWrapper(o(s),n.returnNumberType):this.runFunction(e,t,n,i)},this.interpreter=e,this.dependencyGraph=e.dependencyGraph,this.columnSearch=e.columnSearch,this.config=e.config,this.serialization=e.serialization,this.arraySizePredictor=e.arraySizePredictor,this.dateTimeHelper=e.dateTimeHelper,this.arithmeticHelper=e.arithmeticHelper}evaluateAst(e,t){return this.interpreter.evaluateAst(e,t)}arraySizeForAst(e,t){return this.arraySizePredictor.checkArraySizeForAst(e,t)}listOfScalarValues(e,t){const n=[];for(const r of e){const e=this.evaluateAst(r,t);if(e instanceof nt)for(const t of e.valuesFromTopLeftCorner())n.push([t,!0]);else n.push([e,!1])}return n}coerceToType(e,t,n){let r;if(e instanceof nt)switch(t.argumentType){case ar.RANGE:case ar.ANY:r=e;break;default:{const t=ir(e,n);if(void 0===t)return;e=t}}if(!(e instanceof nt))switch(t.argumentType){case ar.INTEGER:case ar.NUMBER:const n=this.coerceScalarToNumberOrError(e);if(!Je(n)){r=n;break}const o=je(n);if(void 0!==t.maxValue&&o>t.maxValue)return new Cn(sn.NUM,J.ValueLarge);if(void 0!==t.minValue&&o=t.lessThan)return new Cn(sn.NUM,J.ValueLarge);if(void 0!==t.greaterThan&&o<=t.greaterThan)return new Cn(sn.NUM,J.ValueSmall);if(t.argumentType===ar.INTEGER&&!Number.isInteger(o))return new Cn(sn.NUM,J.IntegerExpected);r=n;break;case ar.STRING:r=Kn(e);break;case ar.BOOLEAN:r=$n(e);break;case ar.SCALAR:case ar.NOERROR:case ar.ANY:r=e;break;case ar.RANGE:if(e instanceof Cn)return e;r=jn(e);break;case ar.COMPLEX:return this.arithmeticHelper.coerceScalarToComplex(je(e))}return t.passSubtype||void 0===r?r:je(r)}calculateSingleCellOfResultArray(e,t,n,r,o,i){const s=this.coerceArgumentsToRequiredTypes(e,t,n,r);if(s instanceof Cn)return s;const a=o(...s);return this.returnNumberWrapper(a,i)}coerceArgumentsToRequiredTypes(e,t,n,r){const o=[];for(let i=0;ie&&this.isRangePassedAsAScalarArgument(t,n[i])?this.vectorizeAndBroadcastRangeArgument(t,r,o):t))}vectorizeAndBroadcastRangeArgument(e,t,n){var r;const o=1===e.height()?0:t,i=1===e.width()?0:n;return null===(r=e.data[o])||void 0===r?void 0:r[i]}evaluateArguments(e,t,n){return n.expandRanges?this.listOfScalarValues(e,t):e.map((e=>[this.evaluateAst(e,t),!1]))}buildMetadataForEachArgumentValue(e,t){const n=t.parameters?[...t.parameters]:[];if(void 0!==t.repeatLastArgs&&Number.isInteger(t.repeatLastArgs)&&t.repeatLastArgs>0)for(;e>n.length;)n.push(...n.slice(n.length-t.repeatLastArgs));return n}isNumberOfArgumentValuesValid(e,t){return!(t>e.length)&&(!(t(null==e?void 0:e.optionalArg)||void 0!==(null==e?void 0:e.defaultValue))))}calculateSizeOfVectorizedResultArray(e,t){const n=e.filter(((e,n)=>this.isRangePassedAsAScalarArgument(e,t[n])));return[Math.max(1,...n.map((e=>e.height()))),Math.max(1,...n.map((e=>e.width())))]}isRangePassedAsAScalarArgument(e,t){return null!=e&&null!=t&&e instanceof nt&&![ar.RANGE,ar.ANY].includes(t.argumentType)}metadata(e){const t=this.constructor.implementedFunctions[e];if(void 0!==t)return t;throw new Error(`No metadata for function ${e}.`)}returnNumberWrapper(e,t,n){return void 0!==t&&Je(e)?this.arithmeticHelper.ExtendedNumberFactory(je(e),{type:t,format:n}):e}}class ur{constructor(e,t,n=!1){this.width=e,this.height=t,this.isRef=n}static error(){return new ur(1,1,!0)}static scalar(){return new ur(1,1,!1)}isScalar(){return 1===this.width&&1===this.height||this.isRef}}class hr{constructor(e,t){this.config=e,this.functionRegistry=t}checkArraySize(e,t){return this.checkArraySizeForAst(e,{formulaAddress:t,arraysFlag:this.config.useArrayArithmetic})}checkArraySizeForAst(e,t){switch(e.type){case Y.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case Y.COLUMN_RANGE:case Y.ROW_RANGE:case Y.CELL_RANGE:{const n=Hn.fromAstOrUndef(e,t.formulaAddress);return void 0===n?ur.error():new ur(n.width(),n.height(),!0)}case Y.ARRAY:{const n=[],r=[];for(const o of e.args){const e=o.map((e=>this.checkArraySizeForAst(e,t))),i=Math.min(...e.map((e=>e.height))),s=e.reduce(((e,t)=>e+t.width),0);n.push(i),r.push(s)}const o=n.reduce(((e,t)=>e+t),0),i=Math.min(...r);return new ur(i,o)}case Y.STRING:case Y.NUMBER:return ur.scalar();case Y.CELL_REFERENCE:return new ur(1,1,!0);case Y.DIV_OP:case Y.CONCATENATE_OP:case Y.EQUALS_OP:case Y.GREATER_THAN_OP:case Y.GREATER_THAN_OR_EQUAL_OP:case Y.LESS_THAN_OP:case Y.LESS_THAN_OR_EQUAL_OP:case Y.MINUS_OP:case Y.NOT_EQUAL_OP:case Y.PLUS_OP:case Y.POWER_OP:case Y.TIMES_OP:{const n=this.checkArraySizeForAst(e.left,t),i=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(n.height>1||n.width>1||i.height>1||i.width>1)?ur.error():(r=n,o=i,new ur(Math.max(r.width,o.width),Math.max(r.height,o.height)))}case Y.MINUS_UNARY_OP:case Y.PLUS_UNARY_OP:case Y.PERCENT_OP:{const r=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(r.height>1||r.width>1)?ur.error():new ur((n=r).width,n.height)}case Y.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case Y.EMPTY:default:return ur.error()}var n,r,o}checkArraySizeForFunction(e,t){const n=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==n)return n(e,t);const r=this.functionRegistry.getMetadata(e.procedureName);if(void 0===r||r.expandRanges||!t.arraysFlag||r.vectorizationForbidden||void 0===r.parameters)return new ur(1,1);const o=e.args.map((e=>{var n;return this.checkArraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(n=null==r?void 0:r.arrayFunction)&&void 0!==n&&n))})),i=[...r.parameters];if(void 0!==r.repeatLastArgs&&i.length`'${e}'`)).join(" "),n)}function mr(e,t,n){if(e{const n=t.get(e.value)||[];n.push(e.name),t.set(e.value,n)}));const n=[];for(const e of t.values())e.length>1&&n.push(e);if(n.length>0){n.forEach((e=>e.sort()));const e=n.map((e=>`[${e}]`)).join("; ");throw new Error(`Config initialization failed. Parameters in conflict: ${e}`)}}function gr(e,t,n){if(typeof e!==t)throw new Et(t,n)}const yr=new RegExp("^ss(\\.(s+|0+))?$"),wr=new RegExp("^[0-9/.\\-: ]+[ap]?m?$"),vr=new RegExp("\\s+"),_r=new RegExp("[ /.-]"),br=Mr((function(e){const t=e.toLowerCase().trim(),n=(t.endsWith("am/pm")?t.substring(0,t.length-5):t.endsWith("a/p")?t.substring(0,e.length-3):t).trim().split(":");return{itemsCount:n.length,hourItem:n.indexOf("hh"),minuteItem:n.indexOf("mm"),secondItem:n.findIndex((e=>yr.test(e)))}})),Sr=Mr((function(e){const t=e.toLowerCase().trim().split(_r);return{itemsCount:t.length,dayItem:t.indexOf("dd"),monthItem:t.indexOf("mm"),shortYearItem:t.indexOf("yy"),longYearItem:t.indexOf("yyyy")}}));function Cr(e,t){var n,r,o;if(void 0===t)return;const{itemsCount:i,hourItem:s,minuteItem:a,secondItem:l}=br(t);let u;if("am"===e[e.length-1]||"a"===e[e.length-1]?(u=!1,e.pop()):"pm"!==e[e.length-1]&&"p"!==e[e.length-1]||(u=!0,e.pop()),e.length!==i)return;const h=Number(null!==(n=e[l])&&void 0!==n?n:"0");if(!Number.isFinite(h))return;const c=Math.round(1e3*h)/1e3,d=Number(null!==(r=e[a])&&void 0!==r?r:"0");if(!Number.isFinite(d)||!Number.isInteger(d))return;const m=Number(null!==(o=e[s])&&void 0!==o?o:"0");return!Number.isFinite(m)||!Number.isInteger(m)||void 0!==u&&(m<0||m>12)?void 0:{hours:void 0!==u?m%12+(u?12:0):m,minutes:d,seconds:c}}function Er(e,t){var n;if(void 0===t)return;const{itemsCount:r,dayItem:o,monthItem:i,shortYearItem:s,longYearItem:a}=Sr(t);if(e.length!==r)return;const l=Number(e[o]);if(!Number.isFinite(l)||!Number.isInteger(l))return;const u=Number(e[i]);if(!Number.isFinite(u)||!Number.isInteger(u))return;if(e[a]&&e[s])return;const h=Number(null!==(n=e[a])&&void 0!==n?n:e[s]);return Number.isFinite(h)&&Number.isInteger(h)&&!(e[a]&&(h<1e3||h>9999)||e[s]&&(h<0||h>99))?{year:h,month:u,day:l}:void 0}function Mr(e){const t={};return n=>{const r=t[n];if(void 0!==r)return r;const o=e(n);return t[n]=o,o}}const Tr=[31,28,31,30,31,30,31,31,30,31,30,31],Rr=[0,31,59,90,120,151,181,212,243,273,304,334];function Ar(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"year"in e&&"number"==typeof e.year&&"month"in e&&"number"==typeof e.month&&"day"in e&&"number"==typeof e.day}function Nr(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"hours"in e&&"number"==typeof e.hours&&"minutes"in e&&"number"==typeof e.minutes&&"seconds"in e&&"number"==typeof e.seconds}const Lr={year:9999,month:12,day:31};class xr{constructor(e){this.config=e,this.minDateAbsoluteValue=this.dateToNumberFromZero(e.nullDate),this.maxDateValue=this.dateToNumber(Lr),this.leapYear1900=e.leapYear1900,!this.leapYear1900&&0<=this.dateToNumber({year:1900,month:2,day:28})?this.epochYearZero=this.numberToSimpleDate(2).year:this.epochYearZero=this.numberToSimpleDate(1).year,this.parseDateTime=e.parseDateTime}getWithinBounds(e){return e<=this.maxDateValue&&e>=0?e:void 0}dateStringToDateNumber(e){const{dateTime:t,dateFormat:n="",timeFormat:r=""}=this.parseDateTimeFromConfigFormats(e);if(void 0!==t)return Nr(t)?Ar(t)?new qe(Dr(t)+this.dateToNumber(t),n+" "+r):new Xe(Dr(t),r):Ar(t)?new $e(this.dateToNumber(t),n):0}parseDateTimeFromConfigFormats(e){return this.parseDateTimeFromFormats(e,this.config.dateFormats,this.config.timeFormats)}getNullYear(){return this.config.nullYear}getEpochYearZero(){return this.epochYearZero}isValidDate(e){return!(isNaN(e.year)||isNaN(e.month)||isNaN(e.day)||e.day!==Math.round(e.day)||e.month!==Math.round(e.month)||e.year!==Math.round(e.year)||e.year<1582||e.month<1||e.month>12||e.day<1||!(this.isLeapYear(e.year)&&2===e.month?e.day<=29:e.day<=Tr[e.month-1]))}dateToNumber(e){return this.dateToNumberFromZero(e)-this.minDateAbsoluteValue}relativeNumberToAbsoluteNumber(e){return e+this.minDateAbsoluteValue-(this.leapYear1900?1:0)}numberToSimpleDate(e){const t=Math.floor(e)+this.minDateAbsoluteValue;let n=Math.floor(t/365.2425);this.dateToNumberFromZero({year:n+1,month:1,day:1})<=t?n++:this.dateToNumberFromZero({year:n-1,month:1,day:1})>t&&n--;const r=t-this.dateToNumberFromZero({year:n,month:1,day:1}),o=function(e){let t=0;return Rr[t+6]<=e&&(t+=6),Rr[t+3]<=e&&(t+=3),Rr[t+2]<=e?t+=2:Rr[t+1]<=e&&(t+=1),t}(r-(this.isLeapYear(n)&&r>=59?1:0));return{year:n,month:o+1,day:r-Rr[o]-(this.isLeapYear(n)&&o>1?1:0)+1}}numberToSimpleDateTime(e){const t=kr(e%1),n=Math.floor(t.hours/24);t.hours=t.hours%24;const r=this.numberToSimpleDate(Math.floor(e)+n);return Object.assign(Object.assign({},r),t)}leapYearsCount(e){return Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)+(this.config.leapYear1900&&e>=1900?1:0)}daysInMonth(e,t){return this.isLeapYear(e)&&2===t?29:Tr[t-1]}endOfMonth(e){return{year:e.year,month:e.month,day:this.daysInMonth(e.year,e.month)}}toBasisUS(e,t){return 31===e.day&&(e.day=30),30===e.day&&31===t.day&&(t.day=30),2===e.month&&e.day===this.daysInMonth(e.year,e.month)&&(e.day=30,2===t.month&&t.day===this.daysInMonth(t.year,t.month)&&(t.day=30)),[e,t]}yearLengthForBasis(e,t){return e.year!==t.year?e.year+1!==t.year||e.month=0&&r.year<100&&(r.year2||2===e.month&&e.day>=29?this.leapYearsCount(e.year):this.leapYearsCount(e.year-1)}dateToNumberFromZero(e){return 365*e.year+Rr[e.month-1]+e.day-1+(e.month<=2?this.leapYearsCount(e.year-1):this.leapYearsCount(e.year))}isLeapYear(e){return!(e%4)&&(!!(e%100)||!(e%400)||1900===e&&this.config.leapYear1900)}}function Or(e,t){const n=12*e.year+e.month-1+t;return{year:Math.floor(n/12),month:n%12+1,day:e.day}}function Ir(e){return Math.round(3600*e*24)/86400}function kr(e){const t=24*e*60*60,n=function(e,t=1){return Math.round(e*t)/t}(t%60,1e5)%60,r=(t-n)/60,o=Math.round(r%60)%60,i=(r-o)/60;return{hours:Math.round(i),minutes:o,seconds:n}}function Dr(e){return((e.seconds/60+e.minutes)/60+e.hours)/24}function Pr(e){return{year:e.year,month:e.month,day:Math.min(30,e.day)}}const Hr=/(\\.|dd|DD|d|D|mm|MM|m|M|YYYY|YY|yyyy|yy|HH|hh|H|h|ss(\.(0+|s+))?|s|AM\/PM|am\/pm|A\/P|a\/p|\[mm]|\[MM]|\[hh]|\[HH])/g,Fr=/(\\.|[#0]+(\.[#0]*)?)/g;var Yr,Vr;function Ur(e,t){return{type:e,value:t}}function Br(e,t){const n=[];let r=0;for(let o=0;ojr(e)))?void 0:{type:Vr.DATE,tokens:Br(t,e)}}function jr(e){return e[0].startsWith("\\")}function zr(e,t,n,r){const o=n.stringifyDateTime(r.numberToSimpleDateTime(e),t);if(void 0!==o)return o;const i=n.stringifyDuration(kr(e),t);if(void 0!==i)return i;const s=function(e){const t=function(e){Fr.lastIndex=0;const t=Fr.exec(e);return null!==t?[t]:[]}(e);return t.every((e=>jr(e)))?void 0:{type:Vr.NUMBER,tokens:Br(t,e)}}(t);return void 0!==s?function(e,t){let n="";for(let r=0;rh.length&&(h=Gr(h,Kr(s.substr(0,s.length-h.length),"0")+h.length)),c=$r(c,Kr(a.substr(c.length,a.length-c.length),"0")+c.length),n+=h+l+c}return n}(s.tokens,e):t}function Gr(e,t){let n=`${e}`;for(;n.lengthparseInt(e,16),Qr=e=>parseInt(e,10),Jr=e=>(e+"").replace(/\-/g,""),Zr=(e,t,n)=>e.substr(t,n),eo=e=>e.codePointAt(0)-65,to={invalid:()=>"The license key for HyperFormula is invalid.",expired:({keyValidityDate:e})=>`The license key for HyperFormula expired on ${e}, and is not valid for the installed version.`,missing:()=>"The license key for HyperFormula is missing."};let no=!1;function ro(e){const t={template:"missing",vars:{}};if("gpl-v3"===e||"internal-use-in-handsontable"===e)t.template="valid";else if("string"==typeof e&&function(e){if((e=(e+"").replace(/\-/g,""))[Xr]!==eo("Z"))return!1;let t=0;return[[0,eo("G")+1],[eo("H"),eo("H")-1],[eo("G")+eo("H"),eo("G")]].reduce(((n,[r,o],i)=>(n|=(Qr(`${Qr(qr(Zr(e,t+r-(0===i?0:2),o+(i?2:0)))+(qr(Zr(e,t+r+o,2))+[]).padStart(2,"0"))}`)%97||2)>>1,t+=2,n)),eo("A"))===[]+1>>1}(e)){const[o,i,s]="14/01/2025".split("/"),a=Math.floor(new Date(`${i}/${o}/${s}`).getTime()/864e5),l=25===Jr(r=e)[Xr]?qr(Zr(Jr(r),qr("12"),eo("F")))/(qr(Zr(Jr(r),eo("C"),eo("Y")>>4))||1+(![][Xr]<<3)):0;t.vars.keyValidityDate=`${["January","February","March","April","May","June","July","August","September","October","November","December"][(n=new Date(864e5*(l+1))).getMonth()]} ${n.getDate()}, ${n.getFullYear()}`,t.template=a>l?"expired":"valid"}else""!==e&&(t.template="invalid");var n,r;return no||"valid"===t.template||(console.warn(to[t.template](t.vars)),no=!0),t.template}var oo,io,so;!function(e){e.Number=class{constructor(e){this.value=e,this.value=Ge(this.value,Jn(je(this.value)))}},e.String=class{constructor(e){this.value=e}},e.Boolean=class{constructor(e){this.value=e}};class t{static getSingletonInstance(){return t.instance||(t.instance=new t),t.instance}}e.Empty=t,e.Formula=class{constructor(e){this.formula=e}},e.Error=class{constructor(e,t){this.value=new Cn(e,t)}}}(oo||(oo={}));class ao{constructor(e,t,n){this.config=e,this.dateHelper=t,this.numberLiteralsHelper=n}parse(e){if(null==e)return oo.Empty.getSingletonInstance();if("number"==typeof e)return Qn(e)?new oo.Error(sn.NUM,J.ValueLarge):new oo.Number(e);if("boolean"==typeof e)return new oo.Boolean(e);if(e instanceof Date){const t=this.dateHelper.dateToNumber({day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()})+Dr({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()+e.getMilliseconds()/1e3});return t<0?new oo.Error(sn.NUM,J.DateBounds):t%1==0?new oo.Number(new $e(t,"Date()")):t<1?new oo.Number(new Xe(t,"Date()")):new oo.Number(new qe(t,"Date()"))}if("string"==typeof e){if(function(e){const t=e.toLowerCase();return"true"===t||"false"===t}(e))return new oo.Boolean("true"===e.toLowerCase());if(e.startsWith("="))return new oo.Formula(e);if(function(e,t){const n=e.toUpperCase();return/#[A-Za-z0-9\/]+[?!]?/.test(n)&&Object.prototype.hasOwnProperty.call(t,n)}(e,this.config.errorMapping))return new oo.Error(this.config.errorMapping[e.toUpperCase()]);{let t,n=e.trim(),r=0;if(n.endsWith("%"))r=1,n=n.slice(0,n.length-1);else{const e=this.currencyMatcher(n);void 0!==e&&(r=2,[t,n]=e)}const o=this.numberLiteralsHelper.numericStringToMaybeNumber(n);if(void 0!==o){let e;return e=1===r?new Qe(o/100):2===r?new Ke(o,t):o,new oo.Number(e)}const i=this.dateHelper.dateStringToDateNumber(n);return void 0!==i?new oo.Number(i):new oo.String(e.startsWith("'")?e.slice(1):e)}}throw new Ct(e)}currencyMatcher(e){for(const t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length)];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length)]}}}!function(e){e[e.COPY=0]="COPY",e[e.CUT=1]="CUT"}(io||(io={})),function(e){e[e.VALUE=0]="VALUE",e[e.EMPTY=1]="EMPTY",e[e.FORMULA=2]="FORMULA",e[e.PARSING_ERROR=3]="PARSING_ERROR"}(so||(so={}));class lo{constructor(e,t,n,r,o){this.sourceLeftCorner=e,this.width=t,this.height=n,this.type=r,this.content=o}*getContent(e){if(void 0!==this.content)for(let t=0;te.added))}normalizeExpressionName(e){return e.toLowerCase()}}class mo{constructor(){this.mapping=new Map}add(e){this.mapping.set(this.normalizeExpressionName(e.displayName),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}has(e){return this.mapping.has(this.normalizeExpressionName(e))}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter((e=>e.added))}isNameAvailable(e){const t=this.normalizeExpressionName(e);return!this.mapping.has(t)}remove(e){const t=this.normalizeExpressionName(e);this.mapping.get(t)&&this.mapping.delete(t)}normalizeExpressionName(e){return e.toLowerCase()}}class po{constructor(){this.nextNamedExpressionRow=0,this.workbookStore=new co,this.worksheetStores=new Map,this.addressCache=new Map}isNameAvailable(e,t){var n,r;return void 0===t?this.workbookStore.isNameAvailable(e):null===(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.isNameAvailable(e))||void 0===r||r}namedExpressionInAddress(e){const t=this.addressCache.get(e);return t&&t.added?t:void 0}namedExpressionForScope(e,t){var n;return void 0===t?this.workbookStore.getExisting(e):null===(n=this.worksheetStore(t))||void 0===n?void 0:n.get(e)}nearestNamedExpression(e,t){var n,r;return null!==(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.get(e))&&void 0!==r?r:this.workbookStore.getExisting(e)}isExpressionInScope(e,t){var n,r;return null!==(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.has(e))&&void 0!==r&&r}isNameValid(e){const t=new RegExp(`^${f}$`),n=new RegExp(`^${w}$`),r=new RegExp(`^${_}$`);return!t.test(e)&&!n.test(e)&&r.test(e)}addNamedExpression(e,t,n){const r=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);let o=r.get(e);return void 0!==o?(o.added=!0,o.displayName=e,o.options=n):(o=new ho(e,this.nextAddress(),!0,n),r.add(o)),this.addressCache.set(o.address.row,o),o}restoreNamedExpression(e,t){const n=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);return e.added=!0,n.add(e),this.addressCache.set(e.address.row,e),e}namedExpressionOrPlaceholder(e,t){var n;return null!==(n=this.worksheetStoreOrCreate(t).get(e))&&void 0!==n?n:this.workbookNamedExpressionOrPlaceholder(e)}workbookNamedExpressionOrPlaceholder(e){let t=this.workbookStore.get(e);return void 0===t&&(t=new ho(e,this.nextAddress(),!1),this.workbookStore.add(t)),t}remove(e,t){let n;n=void 0===t?this.workbookStore:this.worksheetStore(t);const r=null==n?void 0:n.get(e);if(void 0===n||void 0===r||!r.added)throw Error("Named expression does not exist");n.remove(e),n instanceof mo&&0===n.mapping.size&&this.worksheetStores.delete(t),this.addressCache.delete(r.address.row)}getAllNamedExpressionsNamesInScope(e){return this.getAllNamedExpressions().filter((({scope:t})=>t===e)).map((e=>e.expression.displayName))}getAllNamedExpressionsNames(){return this.getAllNamedExpressions().map((e=>e.expression.displayName))}getAllNamedExpressions(){const e=[];return this.workbookStore.getAllNamedExpressions().forEach((t=>{e.push({expression:t,scope:void 0})})),this.worksheetStores.forEach(((t,n)=>{t.getAllNamedExpressions().forEach((t=>{e.push({expression:t,scope:n})}))})),e}getAllNamedExpressionsForScope(e){var t,n;return void 0===e?this.workbookStore.getAllNamedExpressions():null!==(n=null===(t=this.worksheetStores.get(e))||void 0===t?void 0:t.getAllNamedExpressions())&&void 0!==n?n:[]}worksheetStoreOrCreate(e){let t=this.worksheetStores.get(e);return t||(t=new mo,this.worksheetStores.set(e,t)),t}worksheetStore(e){return this.worksheetStores.get(e)}nextAddress(){return An(po.SHEET_FOR_WORKBOOK_EXPRESSIONS,0,this.nextNamedExpressionRow++)}}po.SHEET_FOR_WORKBOOK_EXPRESSIONS=-1;const fo=e=>{switch(e.type){case Y.EMPTY:case Y.NUMBER:case Y.STRING:case Y.ERROR:case Y.ERROR_WITH_RAW_INPUT:return!1;case Y.CELL_REFERENCE:return!e.reference.isAbsolute();case Y.CELL_RANGE:case Y.COLUMN_RANGE:case Y.ROW_RANGE:return!e.start.isAbsolute();case Y.NAMED_EXPRESSION:return!1;case Y.PERCENT_OP:case Y.PLUS_UNARY_OP:case Y.MINUS_UNARY_OP:return fo(e.value);case Y.CONCATENATE_OP:case Y.EQUALS_OP:case Y.NOT_EQUAL_OP:case Y.LESS_THAN_OP:case Y.GREATER_THAN_OP:case Y.LESS_THAN_OR_EQUAL_OP:case Y.GREATER_THAN_OR_EQUAL_OP:case Y.MINUS_OP:case Y.PLUS_OP:case Y.TIMES_OP:case Y.DIV_OP:case Y.POWER_OP:return fo(e.left)||fo(e.right);case Y.PARENTHESIS:return fo(e.expression);case Y.FUNCTION_CALL:return e.args.some((e=>fo(e)));case Y.ARRAY:return e.args.some((e=>e.some((e=>fo(e)))))}};class go{performEagerTransformations(e,t){for(const n of e.arrayFormulaNodes()){const[r,o]=this.transformSingleAst(n.getFormula(e.lazilyTransformingAstService),n.getAddress(e.lazilyTransformingAstService)),i=t.rememberNewAst(r);n.setFormula(i),n.setAddress(o)}}transformSingleAst(e,t){return[this.transformAst(e,t),this.fixNodeAddress(t)]}transformAst(e,t){switch(e.type){case Y.CELL_REFERENCE:return this.transformCellReferenceAst(e,t);case Y.CELL_RANGE:return this.transformCellRangeAst(e,t);case Y.COLUMN_RANGE:return this.transformColumnRangeAst(e,t);case Y.ROW_RANGE:return this.transformRowRangeAst(e,t);case Y.EMPTY:case Y.ERROR:case Y.NUMBER:case Y.NAMED_EXPRESSION:case Y.ERROR_WITH_RAW_INPUT:case Y.STRING:return e;case Y.PERCENT_OP:case Y.MINUS_UNARY_OP:case Y.PLUS_UNARY_OP:return Object.assign(Object.assign({},e),{value:this.transformAst(e.value,t)});case Y.FUNCTION_CALL:return Object.assign(Object.assign({},e),{procedureName:e.procedureName,args:e.args.map((e=>this.transformAst(e,t)))});case Y.PARENTHESIS:return Object.assign(Object.assign({},e),{expression:this.transformAst(e.expression,t)});case Y.ARRAY:return Object.assign(Object.assign({},e),{args:e.args.map((e=>e.map((e=>this.transformAst(e,t)))))});default:return Object.assign(Object.assign({},e),{left:this.transformAst(e.left,t),right:this.transformAst(e.right,t)})}}transformCellReferenceAst(e,t){const n=this.transformCellAddress(e.reference,t);return n instanceof l?Object.assign(Object.assign({},e),{reference:n}):n===sn.REF?j(new Cn(sn.REF)):e}transformCellRangeAst(e,t){const n=this.transformCellRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===sn.REF?j(new Cn(sn.REF)):e}transformColumnRangeAst(e,t){const n=this.transformColumnRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===sn.REF?j(new Cn(sn.REF)):e}transformRowRangeAst(e,t){const n=this.transformRowRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===sn.REF?j(new Cn(sn.REF)):e}}class yo extends go{constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!1}transformRowRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){throw Error("Not implemented")}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformCellAddress(e,t){const n=In(e,t);if(n!==this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return!1;const r=e.toSimpleColumnAddress(t);return n===this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet?this.columnsSpan.columnStart<=r.col&&e.shiftedByColumns(this.columnsSpan.numberOfColumns):t.sheet===this.columnsSpan.sheet&&n!==this.columnsSpan.sheet?!e.isColumnAbsolute()&&!(t.colthis.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet!==n){if(e.isColumnAbsolute())return!1;if(t.colthis.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet===n)if(e.isColumnAbsolute()){if(e.colthis.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}else{const n=e.toSimpleColumnAddress(t);if(n.colthis.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}else if(n.col>this.columnsSpan.columnEnd){if(t.colthis.columnsSpan.columnEnd)return!1}}return sn.REF}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col-this.columnsSpan.numberOfColumns}):e}transformRange(e,t,n){const r=In(e,n);let o=e,i=t;if(this.columnsSpan.sheet===r){const r=e.toSimpleColumnAddress(n),s=t.toSimpleColumnAddress(n);if(this.columnsSpan.columnStart<=r.col&&this.columnsSpan.columnEnd>=s.col)return sn.REF;r.col>=this.columnsSpan.columnStart&&r.col<=this.columnsSpan.columnEnd&&(o=e.shiftedByColumns(this.columnsSpan.columnEnd-r.col+1)),s.col>=this.columnsSpan.columnStart&&s.col<=this.columnsSpan.columnEnd&&(i=t.shiftedByColumns(-(s.col-this.columnsSpan.columnStart+1)))}const s=this.transformCellAddress(o,n),a=this.transformCellAddress(i,n);if(!1===s&&!1===a)return[o,i];if(s===sn.REF||a===sn.REF)throw Error("Cannot happen");return[s||o,a||i]}}class Co extends go{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!0}transformColumnRangeAst(e,t){return e}transformCellAddress(e,t){const n=In(e,t);if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet!==n)return!1;if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet===n){const n=e.toSimpleRowAddress(t);if(n.rowthis.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet!==n){if(e.isRowAbsolute())return!1;if(t.rowthis.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet===n)if(e.isRowAbsolute()){if(e.rowthis.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}else{const n=e.toSimpleRowAddress(t);if(n.rowthis.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}else if(n.row>this.rowsSpan.rowEnd){if(t.rowthis.rowsSpan.rowEnd)return!1}}return sn.REF}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){throw Error("Not implemented")}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row-this.rowsSpan.numberOfRows}):e}transformRange(e,t,n){const r=In(e,n);let o=e,i=t;if(this.rowsSpan.sheet===r){const r=e.toSimpleRowAddress(n),s=t.toSimpleRowAddress(n);if(this.rowsSpan.rowStart<=r.row&&this.rowsSpan.rowEnd>=s.row)return sn.REF;r.row>=this.rowsSpan.rowStart&&r.row<=this.rowsSpan.rowEnd&&(o=e.shiftedByRows(this.rowsSpan.rowEnd-r.row+1)),s.row>=this.rowsSpan.rowStart&&s.row<=this.rowsSpan.rowEnd&&(i=t.shiftedByRows(-(s.row-this.rowsSpan.rowStart+1)))}const s=this.transformCellAddress(o,n),a=this.transformCellAddress(i,n);return!1===s&&!1===a?[o,i]:s===sn.REF||a===sn.REF?sn.REF:[s||o,a||i]}}class Eo extends go{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}performEagerTransformations(e,t){for(const t of e.arrayFormulaNodes()){const[n]=this.transformSingleAst(t.getFormula(e.lazilyTransformingAstService),t.getAddress(e.lazilyTransformingAstService));t.setFormula(n)}}fixNodeAddress(e){return e}transformCellAddress(e,t){return this.transformAddress(e)}transformCellRange(e,t,n){return this.transformAddress(e)}transformColumnRange(e,t,n){return this.transformAddress(e)}transformRowRange(e,t,n){return this.transformAddress(e)}transformAddress(e){return e.sheet===this.sheet&&sn.REF}}function Mo(e){if(!Array.isArray(e))throw new pt("an array of arrays.");for(let t=0;t0&&(n=o+1)}const o=t*n;return{height:n,width:t,fill:0===o?0:r/o}}class Ro{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Oo(this.indexes)}rowsSpans(){return this.normalizedIndexes().map((e=>ot.fromNumberOfRows(this.sheet,e[0],e[1])))}}class Ao{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Io(this.indexes)}rowsSpans(){return this.normalizedIndexes().map((e=>ot.fromNumberOfRows(this.sheet,e[0],e[1])))}}class No{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Io(this.indexes)}columnsSpans(){return this.normalizedIndexes().map((e=>it.fromNumberOfColumns(this.sheet,e[0],e[1])))}}class Lo{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Oo(this.indexes)}columnsSpans(){return this.normalizedIndexes().map((e=>it.fromNumberOfColumns(this.sheet,e[0],e[1])))}}class xo{constructor(e,t,n,r,o,i,s,a,l){this.dependencyGraph=t,this.columnSearch=n,this.cellContentParser=r,this.parser=o,this.stats=i,this.lazilyTransformingAstService=s,this.namedExpressions=a,this.arraySizePredictor=l,this.changes=rt.empty(),this.allocateNamedExpressionAddressSpace(),this.maxColumns=e.maxColumns,this.maxRows=e.maxRows}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}removeRows(e){const t=[];for(const n of e.rowsSpans()){const e=this.doRemoveRows(n);e&&t.push(e)}return t}addRows(e){for(const t of e.rowsSpans())this.doAddRows(t)}addColumns(e){for(const t of e.columnsSpans())this.doAddColumns(t)}removeColumns(e){const t=[];for(const n of e.columnsSpans()){const e=this.doRemoveColumns(n);e&&t.push(e)}return t}removeSheet(e){this.dependencyGraph.removeSheet(e);let t=0;this.stats.measure(et.TRANSFORM_ASTS,(()=>{const n=new Eo(e);n.performEagerTransformations(this.dependencyGraph,this.parser),t=this.lazilyTransformingAstService.addTransformation(n)})),this.sheetMapping.removeSheet(e),this.columnSearch.removeSheet(e);const n=this.namedExpressions.getAllNamedExpressionsForScope(e).map((t=>this.removeNamedExpression(t.normalizeExpressionName(),e)));return{version:t,scopedNamedExpressions:n}}removeSheetByName(e){const t=this.sheetMapping.fetch(e);return this.removeSheet(t)}clearSheet(e){this.dependencyGraph.clearSheet(e),this.columnSearch.removeSheet(e)}addSheet(e){const t=this.sheetMapping.addSheet(e);return this.dependencyGraph.addressMapping.autoAddSheet(t,To([])),this.sheetMapping.fetchDisplayName(t)}renameSheet(e,t){return this.sheetMapping.renameSheet(e,t)}moveRows(e,t,n,r){const o=ot.fromNumberOfRows(e,r,n);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddRows(o),r{const e=new _o(o,s,a,l);e.performEagerTransformations(this.dependencyGraph,this.parser),d=this.lazilyTransformingAstService.addTransformation(e)})),this.dependencyGraph.moveCells(o,s,a,l);const m=this.updateNamedExpressionsForMovedCells(e,t,n,r);return{version:d,overwrittenCellsData:u,addedGlobalNamedExpressions:m}}setRowOrder(e,t){const n=[];let r=[];for(const[o,i]of t)if(o!==i){const t=Hn.spanFrom({sheet:e,col:0,row:o},1/0,1),s=this.getRangeClipboardCells(t);r=r.concat(s),n.push(s.map((([{sheet:e,col:t},n])=>[{sheet:e,col:t,row:i},n])))}return n.forEach((t=>this.restoreClipboardCells(e,t.values()))),r}setColumnOrder(e,t){const n=[];let r=[];for(const[o,i]of t)if(o!==i){const t=Hn.spanFrom({sheet:e,col:o,row:0},1,1/0),s=this.getRangeClipboardCells(t);r=r.concat(s),n.push(s.map((([{sheet:e,col:t,row:n},r])=>[{sheet:e,col:i,row:n},r])))}return n.forEach((t=>this.restoreClipboardCells(e,t.values()))),r}addNamedExpression(e,t,n,r){const o=this.namedExpressions.addNamedExpression(e,n,r);this.storeNamedExpressionInCell(o.address,t),this.adjustNamedExpressionEdges(o,e,n)}restoreNamedExpression(e,t,n){const r=e.displayName;this.restoreCell(e.address,t);const o=this.namedExpressions.restoreNamedExpression(e,n);this.adjustNamedExpressionEdges(o,r,n)}changeNamedExpressionExpression(e,t,n,r){const o=this.namedExpressions.namedExpressionForScope(e,n);if(!o)throw new wt(e);const i=o.copy();o.options=r;const s=this.getClipboardCell(o.address);return this.storeNamedExpressionInCell(o.address,t),[i,s]}removeNamedExpression(e,t){const n=this.namedExpressions.namedExpressionForScope(e,t);if(!n)throw new wt(e);this.namedExpressions.remove(n.displayName,t);const r=this.getClipboardCell(n.address);if(void 0!==t){const t=this.namedExpressions.workbookNamedExpressionOrPlaceholder(e);this.dependencyGraph.exchangeNode(n.address,t.address)}else this.dependencyGraph.setCellEmpty(n.address);return[n,r]}ensureItIsPossibleToMoveCells(e,t,n,r){if(Nn(e)||!(ko(t)&&ko(n)||function(e,t,n){return 0===e.row&&ko(t)&&n===Number.POSITIVE_INFINITY||0===e.col&&ko(n)&&t===Number.POSITIVE_INFINITY}(e,t,n))||Nn(r)||!this.sheetMapping.hasSheetWithId(e.sheet)||!this.sheetMapping.hasSheetWithId(r.sheet))throw new pt("a valid range of cells to move.");const o=Hn.spanFrom(e,t,n),i=Hn.spanFrom(r,t,n);if(i.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new ct;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(o))throw new Pt;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(i))throw new Ht}restoreClipboardCells(e,t){const n=[];for(const[r,o]of t)if(this.restoreCell(r,o),o.type===so.FORMULA){const{dependencies:t}=this.parser.fetchCachedResult(o.hash);n.push(...this.updateNamedExpressionsForTargetAddress(e,r,t))}return n}restoreCell(e,t){switch(t.type){case so.VALUE:this.setValueToCell(t,e);break;case so.FORMULA:this.setFormulaToCellFromCache(t.hash,e);break;case so.EMPTY:this.setCellEmpty(e);break;case so.PARSING_ERROR:this.setParsingErrorToCell(t.rawInput,t.errors,e)}}getOldContent(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof pn)return[e,{type:so.EMPTY}];if(t instanceof fn)return[e,Object.assign({type:so.VALUE},t.getValues())];if(t instanceof zt)return[t.getAddress(this.lazilyTransformingAstService),{type:so.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))}];if(t instanceof gn)return[e,{type:so.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors}];throw Error("Trying to copy unsupported type")}getClipboardCell(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof pn)return{type:so.EMPTY};if(t instanceof fn)return Object.assign({type:so.VALUE},t.getValues());if(t instanceof Gt){const n=t.getArrayCellValue(e);return n===We?{type:so.EMPTY}:{type:so.VALUE,parsedValue:n,rawValue:t.getArrayCellRawValue(e)}}if(t instanceof $t)return{type:so.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))};if(t instanceof gn)return{type:so.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors};throw Error("Trying to copy unsupported type")}getSheetClipboardCells(e){const t=this.dependencyGraph.getSheetHeight(e),n=this.dependencyGraph.getSheetWidth(e),r=new Array(t);for(let o=0;o0)this.setParsingErrorToCell(n.formula,o,e);else try{const n=this.arraySizePredictor.checkArraySize(r,e);if(n.width<=0||n.height<=0)throw Error("Incorrect array size");this.setFormulaToCell(e,n,t)}catch(t){if(!t.message)throw t;const r={type:F.InvalidRangeSize,message:"Invalid range size."};this.setParsingErrorToCell(n.formula,[r],e)}}else n instanceof oo.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:n.value,rawValue:t},e);return r}setSheetContent(e,t){this.clearSheet(e);for(let n=0;n!kn(e.address,t)))),this.changes.addAll(r),this.changes.addChange(e.parsedValue,t)}setCellEmpty(e){if(this.dependencyGraph.isArrayInternalCell(e))return;const t=this.dependencyGraph.getCellValue(e),n=this.dependencyGraph.setCellEmpty(e);this.columnSearch.remove(je(t),e),this.columnSearch.applyChanges(n.getChanges()),this.changes.addAll(n),this.changes.addChange(We,e)}setFormulaToCellFromCache(e,t){const{ast:n,hasVolatileFunction:r,hasStructuralChangeFunction:o,dependencies:i}=this.parser.fetchCachedResult(e),s=Be(i,t),[a]=new vo(t.sheet).transformSingleAst(n,t);this.parser.rememberNewAst(a);const l=s.filter((e=>e instanceof Ue||(e instanceof Hn?!(Nn(e.start)||Nn(e.end)):!Nn(e)))),u=this.arraySizePredictor.checkArraySize(n,t);this.dependencyGraph.setFormulaToCell(t,a,l,u,r,o)}rowEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getHeight(t)}getAndClearContentChanges(){const e=this.changes;return this.changes=rt.empty(),e}forceApplyPostponedTransformations(){this.dependencyGraph.forceApplyPostponedTransformations()}doRemoveRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const t=[];for(const[n]of this.dependencyGraph.entriesFromRowsSpan(e))t.push({address:n,cellType:this.getClipboardCell(n)});const{affectedArrays:n,contentChanges:r}=this.dependencyGraph.removeRows(e);this.columnSearch.applyChanges(r.getChanges());let o=0;return this.stats.measure(et.TRANSFORM_ASTS,(()=>{const t=new Co(e);t.performEagerTransformations(this.dependencyGraph,this.parser),o=this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(n),{version:o,removedCells:t,rowFrom:e.rowStart,rowCount:e.numberOfRows}}doRemoveColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const t=[];for(const[n]of this.dependencyGraph.entriesFromColumnsSpan(e))t.push({address:n,cellType:this.getClipboardCell(n)});const{affectedArrays:n,contentChanges:r}=this.dependencyGraph.removeColumns(e);this.columnSearch.applyChanges(r.getChanges()),this.columnSearch.removeColumns(e);let o=0;return this.stats.measure(et.TRANSFORM_ASTS,(()=>{const t=new So(e);t.performEagerTransformations(this.dependencyGraph,this.parser),o=this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(n),{version:o,removedCells:t,columnFrom:e.columnStart,columnCount:e.numberOfColumns}}doAddRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const{affectedArrays:t}=this.dependencyGraph.addRows(e);this.stats.measure(et.TRANSFORM_ASTS,(()=>{const t=new wo(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(t)}rewriteAffectedArrays(e){for(const t of e.values()){if(t.array.size.isRef)continue;const e=t.getFormula(this.lazilyTransformingAstService),n=t.getAddress(this.lazilyTransformingAstService),r=this.parser.computeHashFromAst(e);this.setFormulaToCellFromCache(r,n)}}doAddColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const{affectedArrays:t,contentChanges:n}=this.dependencyGraph.addColumns(e);this.columnSearch.addColumns(e),this.columnSearch.applyChanges(n.getChanges()),this.stats.measure(et.TRANSFORM_ASTS,(()=>{const t=new yo(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)})),this.rewriteAffectedArrays(t)}columnEffectivelyNotInSheet(e,t){return e>=this.dependencyGraph.addressMapping.getWidth(t)}adjustNamedExpressionEdges(e,t,n){if(void 0===n)return;const{vertex:r,id:o}=this.dependencyGraph.fetchCellOrCreateEmpty(e.address),i=null!=o?o:this.dependencyGraph.graph.getNodeId(r),s=this.namedExpressions.workbookNamedExpressionOrPlaceholder(t),{vertex:a,id:l}=this.dependencyGraph.fetchCellOrCreateEmpty(s.address),u=null!=l?l:this.dependencyGraph.graph.getNodeId(a);for(const t of this.dependencyGraph.graph.adjacentNodes(a))if(t instanceof $t&&t.getAddress(this.lazilyTransformingAstService).sheet===n){const n=t.getFormula(this.lazilyTransformingAstService),r=t.getAddress(this.lazilyTransformingAstService),{dependencies:o}=this.parser.fetchCachedResultForAst(n);for(const n of Be(o,r))n instanceof Ue&&n.name.toLowerCase()===e.displayName.toLowerCase()&&(this.dependencyGraph.graph.removeEdge(u,t),this.dependencyGraph.graph.addEdge(i,t))}}storeNamedExpressionInCell(e,t){const n=this.cellContentParser.parse(t);if(n instanceof oo.Formula){const t=this.parser.parse(n.formula,An(-1,0,0));if(fo(t.ast))throw new Ft;const{ast:r,hasVolatileFunction:o,hasStructuralChangeFunction:i,dependencies:s}=t;this.dependencyGraph.setFormulaToCell(e,r,Be(s,e),ur.scalar(),o,i)}else n instanceof oo.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:n.value,rawValue:t},e)}updateNamedExpressionsForMovedCells(e,t,n,r){if(e.sheet===r.sheet)return[];const o=[],i=Hn.spanFrom(r,t,n);for(const t of i.addresses(this.dependencyGraph)){const n=this.addressMapping.fetchCell(t);if(n instanceof $t&&t.sheet!==e.sheet){const r=n.getFormula(this.lazilyTransformingAstService),{dependencies:i}=this.parser.fetchCachedResultForAst(r);o.push(...this.updateNamedExpressionsForTargetAddress(e.sheet,t,i))}}return o}updateNamedExpressionsForTargetAddress(e,t,n){if(e===t.sheet)return[];const r=[],o=this.addressMapping.fetchCell(t);for(const i of Be(n,t)){if(!(i instanceof Ue))continue;const n=i.name,s=this.dependencyGraph.fetchNamedExpressionVertex(n,e).vertex,a=this.namedExpressions.isExpressionInScope(n,t.sheet)?this.dependencyGraph.fetchNamedExpressionVertex(n,t.sheet).vertex:this.copyOrFetchGlobalNamedExpressionVertex(n,s,r);a!==s&&(this.dependencyGraph.graph.removeEdgeIfExists(s,o),this.dependencyGraph.graph.addEdge(a,o))}return r}allocateNamedExpressionAddressSpace(){this.dependencyGraph.addressMapping.addSheet(po.SHEET_FOR_WORKBOOK_EXPRESSIONS,new yn(0,0))}copyOrFetchGlobalNamedExpressionVertex(e,t,n){let r=this.namedExpressions.namedExpressionForScope(e);if(void 0===r)if(r=this.namedExpressions.addNamedExpression(e),n.push(r.normalizeExpressionName()),t instanceof $t){const e=this.parser.fetchCachedResultForAst(t.getFormula(this.lazilyTransformingAstService)),{ast:n,hasVolatileFunction:o,hasStructuralChangeFunction:i,dependencies:s}=e;this.dependencyGraph.setFormulaToCell(r.address,n,Be(s,r.address),ur.scalar(),o,i)}else t instanceof pn?this.setCellEmpty(r.address):t instanceof fn&&this.setValueToCell(t.getValues(),r.address);return this.dependencyGraph.fetchCellOrCreateEmpty(r.address).vertex}}function Oo(e){if(e.length<=1)return e;const t=[...e].sort((([e],[t])=>e-t)),n=t.reduce(((e,[t,n])=>{const r=e[e.length-1],o=r[0]+r[1];return t<=o?r[1]+=Math.max(0,n-(o-t)):e.push([t,n]),e}),[t[0]]);let r=0;for(let e=0;ee-t)),n=t.reduce(((e,[t,n])=>{const r=e[e.length-1];return t===r[0]?r[1]=Math.max(r[1],n):e.push([t,n]),e}),[t[0]]);let r=0;for(let e=0;e0}class Do{}class Po extends Do{constructor(e,t){super(),this.command=e,this.rowsRemovals=t}doUndo(e){e.undoRemoveRows(this)}doRedo(e){e.redoRemoveRows(this)}}class Ho extends Do{constructor(e,t,n,r,o,i,s){super(),this.sourceLeftCorner=e,this.width=t,this.height=n,this.destinationLeftCorner=r,this.overwrittenCellsData=o,this.addedGlobalNamedExpressions=i,this.version=s}doUndo(e){e.undoMoveCells(this)}doRedo(e){e.redoMoveCells(this)}}class Fo extends Do{constructor(e){super(),this.command=e}doUndo(e){e.undoAddRows(this)}doRedo(e){e.redoAddRows(this)}}class Yo extends Do{constructor(e,t,n){super(),this.sheetId=e,this.rowMapping=t,this.oldContent=n}doUndo(e){e.undoSetRowOrder(this)}doRedo(e){e.redoSetRowOrder(this)}}class Vo extends Do{constructor(e,t,n){super(),this.sheetId=e,this.columnMapping=t,this.oldContent=n}doUndo(e){e.undoSetColumnOrder(this)}doRedo(e){e.redoSetColumnOrder(this)}}class Uo extends Do{constructor(e,t,n){super(),this.sheetId=e,this.oldSheetContent=t,this.newSheetContent=n}doUndo(e){e.undoSetSheetContent(this)}doRedo(e){e.redoSetSheetContent(this)}}class Bo extends Do{constructor(e,t,n,r,o){super(),this.sheet=e,this.startRow=t,this.numberOfRows=n,this.targetRow=r,this.version=o,this.undoStart=this.startRowthis.targetRow?this.startRow+this.numberOfRows:this.startRow}doUndo(e){e.undoMoveRows(this)}doRedo(e){e.redoMoveRows(this)}}class Wo extends Do{constructor(e,t,n,r,o){super(),this.sheet=e,this.startColumn=t,this.numberOfColumns=n,this.targetColumn=r,this.version=o,this.undoStart=this.startColumnthis.targetColumn?this.startColumn+this.numberOfColumns:this.startColumn}doUndo(e){e.undoMoveColumns(this)}doRedo(e){e.redoMoveColumns(this)}}class jo extends Do{constructor(e){super(),this.command=e}doUndo(e){e.undoAddColumns(this)}doRedo(e){e.redoAddColumns(this)}}class zo extends Do{constructor(e,t){super(),this.command=e,this.columnsRemovals=t}doUndo(e){e.undoRemoveColumns(this)}doRedo(e){e.redoRemoveColumns(this)}}class Go extends Do{constructor(e){super(),this.sheetName=e}doUndo(e){e.undoAddSheet(this)}doRedo(e){e.redoAddSheet(this)}}class $o extends Do{constructor(e,t,n,r,o){super(),this.sheetName=e,this.sheetId=t,this.oldSheetContent=n,this.scopedNamedExpressions=r,this.version=o}doUndo(e){e.undoRemoveSheet(this)}doRedo(e){e.redoRemoveSheet(this)}}class Ko extends Do{constructor(e,t,n){super(),this.sheetId=e,this.oldName=t,this.newName=n}doUndo(e){e.undoRenameSheet(this)}doRedo(e){e.redoRenameSheet(this)}}class Xo extends Do{constructor(e,t){super(),this.sheetId=e,this.oldSheetContent=t}doUndo(e){e.undoClearSheet(this)}doRedo(e){e.redoClearSheet(this)}}class qo extends Do{constructor(e){super(),this.cellContents=e}doUndo(e){e.undoSetCellContents(this)}doRedo(e){e.redoSetCellContents(this)}}class Qo extends Do{constructor(e,t,n,r){super(),this.targetLeftCorner=e,this.oldContent=t,this.newContent=n,this.addedGlobalNamedExpressions=r}doUndo(e){e.undoPaste(this)}doRedo(e){e.redoPaste(this)}}class Jo extends Do{constructor(e,t,n,r){super(),this.name=e,this.newContent=t,this.scope=n,this.options=r}doUndo(e){e.undoAddNamedExpression(this)}doRedo(e){e.redoAddNamedExpression(this)}}class Zo extends Do{constructor(e,t,n){super(),this.namedExpression=e,this.content=t,this.scope=n}doUndo(e){e.undoRemoveNamedExpression(this)}doRedo(e){e.redoRemoveNamedExpression(this)}}class ei extends Do{constructor(e,t,n,r,o){super(),this.namedExpression=e,this.newContent=t,this.oldContent=n,this.scope=r,this.options=o}doUndo(e){e.undoChangeNamedExpression(this)}doRedo(e){e.redoChangeNamedExpression(this)}}class ti extends Do{constructor(){super(...arguments),this.operations=[]}add(e){this.operations.push(e)}*reversedOperations(){for(let e=this.operations.length-1;e>=0;e--)yield this.operations[e]}doUndo(e){e.undoBatch(this)}doRedo(e){e.redoBatch(this)}}class ni{constructor(e,t){this.operations=t,this.oldData=new Map,this.undoStack=[],this.redoStack=[],this.undoLimit=e.undoLimit}saveOperation(e){void 0!==this.batchUndoEntry?this.batchUndoEntry.add(e):this.addUndoEntry(e)}beginBatchMode(){this.batchUndoEntry=new ti}commitBatchMode(){if(void 0===this.batchUndoEntry)throw Error("Batch mode wasn't started");this.addUndoEntry(this.batchUndoEntry),this.batchUndoEntry=void 0}storeDataForVersion(e,t,n){this.oldData.has(e)||this.oldData.set(e,[]),this.oldData.get(e).push([t,n])}clearRedoStack(){this.redoStack=[]}clearUndoStack(){this.undoStack=[]}isUndoStackEmpty(){return 0===this.undoStack.length}isRedoStackEmpty(){return 0===this.redoStack.length}undo(){const e=this.undoStack.pop();if(!e)throw Error("Attempted to undo without operation on stack");this.undoEntry(e),this.redoStack.push(e)}undoBatch(e){for(const t of e.reversedOperations())this.undoEntry(t)}undoRemoveRows(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},rowsRemovals:n}=e;for(let e=n.length-1;e>=0;--e){const r=n[e];this.operations.addRows(new Ao(t,[[r.rowFrom,r.rowCount]]));for(const{address:e,cellType:t}of r.removedCells)this.operations.restoreCell(e,t);this.restoreOldDataFromVersion(r.version-1)}}undoRemoveColumns(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},columnsRemovals:n}=e;for(let e=n.length-1;e>=0;--e){const r=n[e];this.operations.addColumns(new No(t,[[r.columnFrom,r.columnCount]]));for(const{address:e,cellType:t}of r.removedCells)this.operations.restoreCell(e,t);this.restoreOldDataFromVersion(r.version-1)}}undoAddRows(e){const t=e.command.rowsSpans();for(let n=t.length-1;n>=0;--n){const r=t[n];this.operations.removeRows(new Ro(e.command.sheet,[[r.rowStart,r.numberOfRows]]))}}undoAddColumns(e){const t=e.command.columnsSpans();for(let n=t.length-1;n>=0;--n){const r=t[n];this.operations.removeColumns(new Lo(e.command.sheet,[[r.columnStart,r.numberOfColumns]]))}}undoSetCellContents(e){for(const t of e.cellContents){const e=t.address,[n,r]=t.oldContent;kn(e,n)||this.operations.setCellEmpty(e),this.operations.restoreCell(n,r)}}undoPaste(e){this.restoreOperationOldContent(e.oldContent);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoMoveRows(e){const{sheet:t}=e;this.operations.moveRows(t,e.undoStart,e.numberOfRows,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveColumns(e){const{sheet:t}=e;this.operations.moveColumns(t,e.undoStart,e.numberOfColumns,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveCells(e){this.operations.forceApplyPostponedTransformations(),this.operations.moveCells(e.destinationLeftCorner,e.width,e.height,e.sourceLeftCorner),this.restoreOperationOldContent(e.overwrittenCellsData),this.restoreOldDataFromVersion(e.version-1);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoAddSheet(e){const{sheetName:t}=e;this.operations.removeSheetByName(t)}undoRemoveSheet(e){this.operations.forceApplyPostponedTransformations();const{oldSheetContent:t,sheetId:n}=e;this.operations.addSheet(e.sheetName);for(let e=0;ee[1])).reduce(((e,t)=>e+t),0)>this.maxRows)throw new ct;for(const[e,n]of t)if(!ii(e)||!oi(n))throw new pt("row number to be nonnegative and number of rows to add to be positive.")}ensureItIsPossibleToRemoveRows(e,...t){for(const[n,r]of t){const t=n+r-1;if(!ii(n)||!ii(t))throw new pt("starting and ending row to be nonnegative.");if(te[1])).reduce(((e,t)=>e+t),0)>this.maxColumns)throw new ct;for(const[e,n]of t)if(!ii(e)||!oi(n))throw new pt("column number to be nonnegative and number of columns to add to be positive.")}ensureItIsPossibleToRemoveColumns(e,...t){for(const[n,r]of t){const t=n+r-1;if(!ii(n)||!ii(t))throw new pt("starting and ending column to be nonnegative.");if(t=t)throw new pt("a valid range of rows to move.");const s=this.dependencyGraph.getSheetWidth(e),a=Hn.spanFrom(o,s,n);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new Pt;if(r>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllRows(ot.fromNumberOfRows(e,r-1,2)))throw new Ht}ensureItIsPossibleToMoveColumns(e,t,n,r){this.ensureItIsPossibleToAddColumns(e,[r,n]);const o=An(e,t,0),i=An(e,r,0);if(!this.sheetMapping.hasSheetWithId(e)||Nn(o)||Nn(i)||!oi(n)||r<=t+n&&r>=t)throw new pt("a valid range of columns to move.");const s=this.dependencyGraph.getSheetHeight(e),a=Hn.spanFrom(o,n,s);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new Pt;if(r>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllColumns(it.fromNumberOfColumns(e,r-1,2)))throw new Ht}ensureItIsPossibleToAddSheet(e){if(this.sheetMapping.hasSheetWithName(e))throw new ht(e)}ensureItIsPossibleToRenameSheet(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new lt(e);const n=this.sheetMapping.get(t);if(void 0!==n&&n!==e)throw new ht(t)}ensureItIsPossibleToChangeContent(e){if(Nn(e))throw new mt(e);if(!this.sheetMapping.hasSheetWithId(e.sheet))throw new lt(e.sheet)}ensureItIsPossibleToChangeCellContents(e,t){const n=To(t),r=Hn.spanFrom(e,n.width,n.height);this.ensureRangeInSizeLimits(r);for(const e of r.addresses(this.dependencyGraph))this.ensureItIsPossibleToChangeContent(e)}ensureItIsPossibleToChangeSheetContents(e,t){const n=To(t),r=Hn.spanFrom(An(e,0,0),n.width,n.height);this.ensureRangeInSizeLimits(r)}ensureRangeInSizeLimits(e){if(e.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new ct}isThereSomethingToUndo(){return!this.undoRedo.isUndoStackEmpty()}isThereSomethingToRedo(){return!this.undoRedo.isRedoStackEmpty()}getAndClearContentChanges(){return this.operations.getAndClearContentChanges()}ensureScopeIdIsValid(e){if(void 0!==e&&!this.sheetMapping.hasSheetWithId(e))throw new lt(e)}validateRowOrColumnMapping(e,t,n){const r="row"===n?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e),o=t.map((([e,t])=>e)).sort(((e,t)=>e-t)),i=t.map((([e,t])=>t)).sort(((e,t)=>e-t));for(let e=0;e=r)throw new pt(`${n} numbers to be nonnegative integers and less than sheet ${"row"===n?"height":"width"}.`);if(o[e]===o[e+1])throw new pt(`source ${n} numbers to be unique.`);if(o[e]!==i[e])throw new pt(`target ${n} numbers to be permutation of source ${n} numbers.`)}}ensureNamedExpressionNameIsValid(e,t){if(!this.namedExpressions.isNameValid(e))throw new yt(e);if(!this.namedExpressions.isNameAvailable(e,t))throw new gt(e)}ensureNamedExpressionIsValid(e){const t=this.cellContentParser.parse(e);if(t instanceof oo.Formula){const e=this.parser.parse(t.formula,An(-1,0,0));if(fo(e.ast))throw new Ft}}}function oi(e){return Number.isInteger(e)&&e>0}function ii(e){return Number.isInteger(e)&&e>=0}class si{constructor(e,t,n,r,o,i){this.config=e,this.stats=t,this.interpreter=n,this.lazilyTransformingAstService=r,this.dependencyGraph=o,this.columnSearch=i}run(){this.stats.start(et.TOP_SORT);const{sorted:e,cycled:t}=this.dependencyGraph.topSortWithScc();this.stats.end(et.TOP_SORT),this.stats.measure(et.EVALUATION,(()=>{this.recomputeFormulas(t,e)}))}partialRun(e){const t=rt.empty();return this.stats.measure(et.EVALUATION,(()=>{this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(e,(e=>{if(e instanceof zt){const n=e.isComputed()?e.getCellValue():void 0,r=this.recomputeFormulaVertexValue(e);if(r!==n){const o=e.getAddress(this.lazilyTransformingAstService);return t.addChange(r,o),this.columnSearch.change(je(n),je(r),o),!0}return!1}return!(e instanceof Kt&&(e.clearCache(),0))}),(e=>{if(e instanceof Kt)e.clearCache();else if(e instanceof zt){const n=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.remove(je(e.valueOrUndef()),n);const r=new Cn(sn.CYCLE,void 0,e);e.setCellValue(r),t.addChange(r,n)}}))})),t}runAndForget(e,t,n){const r=[];for(const e of Be(n,t))if(e instanceof Hn){const t=e;if(void 0===this.dependencyGraph.getRange(t.start,t.end)){const e=new Kt(t);this.dependencyGraph.rangeMapping.setRange(e),r.push(e)}}const o=this.evaluateAstToCellValue(e,new Vn(t,this.config.useArrayArithmetic));return r.forEach((e=>{this.dependencyGraph.rangeMapping.removeRange(e)})),o}recomputeFormulas(e,t){e.forEach((e=>{e instanceof zt&&e.setCellValue(new Cn(sn.CYCLE,void 0,e))})),t.forEach((e=>{if(e instanceof zt){const t=this.recomputeFormulaVertexValue(e),n=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.add(je(t),n)}else e instanceof Kt&&e.clearCache()}))}recomputeFormulaVertexValue(e){const t=e.getAddress(this.lazilyTransformingAstService);if(e instanceof Gt&&(e.array.size.isRef||!this.dependencyGraph.isThereSpaceForArray(e)))return e.setNoSpace();{const n=e.getFormula(this.lazilyTransformingAstService),r=this.evaluateAstToCellValue(n,new Vn(t,this.config.useArrayArithmetic,e));return e.setCellValue(r)}}evaluateAstToCellValue(e,t){const n=this.interpreter.evaluateAst(e,t);return n instanceof nt?n:n===We&&this.config.evaluateNullToZero?0:n}}class ai{constructor(e,t){this.address=e,this.newValue=t}get col(){return this.address.col}get row(){return this.address.row}get sheet(){return this.address.sheet}get value(){return this.newValue}}class li{constructor(e,t){this.name=e,this.newValue=t}}class ui{constructor(e,t,n,r){this.config=e,this.namedExpressions=t,this.sheetIndexMapping=n,this.lazilyTransformingService=r}exportChange(e){const t=e.value,n=e.address;if(n.sheet===po.SHEET_FOR_WORKBOOK_EXPRESSIONS){const e=this.namedExpressions.namedExpressionInAddress(n.row);if(!e)throw new Error("Missing named expression");return new li(e.displayName,this.exportScalarOrRange(t))}if(t instanceof nt){const e=[];for(const[r,o]of t.entriesFromTopLeftCorner(n))e.push(new ai(o,this.exportValue(r)));return e}return new ai(n,this.exportValue(t))}exportValue(e){return e instanceof nt?this.detailedError(new Cn(sn.VALUE,J.ScalarExpected)):this.config.smartRounding&&Je(e)?this.cellValueRounding(je(e)):e instanceof Cn?this.detailedError(e):e===We?null:je(e)}exportScalarOrRange(e){return e instanceof nt?e.rawData().map((e=>e.map((e=>this.exportValue(e))))):this.exportValue(e)}detailedError(e){var t,n;let r;const o=null===(t=e.root)||void 0===t?void 0:t.getAddress(this.lazilyTransformingService);return void 0!==o&&(r=o.sheet===po.SHEET_FOR_WORKBOOK_EXPRESSIONS?null===(n=this.namedExpressions.namedExpressionInAddress(o.row))||void 0===n?void 0:n.displayName:x(this.sheetIndexMapping,o,-1)),new cr(e,this.config.translationPackage.getErrorTranslation(e.type),r)}cellValueRounding(e){if(0===e)return e;const t=Math.floor(Math.log10(Math.abs(e))),n=Math.pow(10,this.config.precisionRounding-t);return e<0?-Math.round(-e*n)/n:Math.round(e*n)/n}}class hi{constructor(e,t,n,r,o,i){this.dependencyGraph=e,this.columnSearch=t,this.parser=n,this.cellContentParser=r,this.stats=o,this.arraySizePredictor=i,this.buildStrategy=new ci(e,t,n,o,r,i)}buildGraph(e,t){const n=t.measure(et.COLLECT_DEPENDENCIES,(()=>this.buildStrategy.run(e)));this.dependencyGraph.getAndClearContentChanges(),t.measure(et.PROCESS_DEPENDENCIES,(()=>this.processDependencies(n)))}processDependencies(e){e.forEach(((e,t)=>{this.dependencyGraph.processCellDependencies(e,t)}))}}class ci{constructor(e,t,n,r,o,i){this.dependencyGraph=e,this.columnIndex=t,this.parser=n,this.stats=r,this.cellContentParser=o,this.arraySizePredictor=i}run(e){const t=new Map;for(const n in e){const r=this.dependencyGraph.getSheetId(n),o=e[n];for(let e=0;ethis.parser.parse(a.formula,s)));if(e.errors.length>0){this.shrinkArrayIfNeeded(s);const t=new gn(e.errors,a.formula);this.dependencyGraph.addVertex(s,t)}else{this.shrinkArrayIfNeeded(s);const n=this.arraySizePredictor.checkArraySize(e.ast,s);if(n.isScalar()){const n=new $t(e.ast,s,0);t.set(n,Be(e.dependencies,s)),this.dependencyGraph.addVertex(s,n),e.hasVolatileFunction&&this.dependencyGraph.markAsVolatile(n),e.hasStructuralChangeFunction&&this.dependencyGraph.markAsDependentOnStructureChange(n)}else{const r=new Gt(e.ast,s,new ur(n.width,n.height));t.set(r,Be(e.dependencies,s)),this.dependencyGraph.addArrayVertex(s,r)}}}else if(a instanceof oo.Empty);else{this.shrinkArrayIfNeeded(s);const e=new fn(a.value,i);this.columnIndex.add(je(a.value),s),this.dependencyGraph.addVertex(s,e)}}}}return t}shrinkArrayIfNeeded(e){const t=this.dependencyGraph.getCell(e);t instanceof Gt&&this.dependencyGraph.shrinkArrayToCorner(t)}}const di=new Map([["gpl-v3",1],["missing",2],["invalid",3],["expired",4]]);class mi extends lr{version(e,t){return this.runFunction(e.args,t,this.metadata("VERSION"),(()=>{const{licenseKeyValidityState:e,licenseKey:t}=this.config;let n;return di.has(t)?n=di.get(t):di.has(e)?n=di.get(e):"valid"===e&&(n=t.slice(-5)),`HyperFormula v${Yi.version}, ${n}`}))}}function pi(e,t){var n;let r=t.implementedFunctions[e];const o=null===(n=t.aliases)||void 0===n?void 0:n[e];if(void 0!==o){if(void 0!==r)throw new Yt(e,t.name);r=t.implementedFunctions[o]}if(void 0===r)throw kt.functionNotDeclaredInPlugin(e,t.name);return r}mi.implementedFunctions={VERSION:{method:"version",parameters:[]}};class fi{constructor(e){if(this.config=e,this.functions=new Map,this.arraySizeFunctions=new Map,this.volatileFunctions=new Set,this.arrayFunctions=new Set,this.structuralChangeFunctions=new Set,this.functionsWhichDoesNotNeedArgumentsToBeComputed=new Set,this.functionsMetadata=new Map,this.doesFunctionNeedArgumentToBeComputed=e=>this.functionsWhichDoesNotNeedArgumentsToBeComputed.has(e),this.isFunctionVolatile=e=>this.volatileFunctions.has(e),this.isArrayFunction=e=>this.arrayFunctions.has(e),this.isFunctionDependentOnSheetStructureChange=e=>this.structuralChangeFunctions.has(e),e.functionPlugins.length>0){this.instancePlugins=new Map;for(const t of e.functionPlugins)fi.loadPluginFunctions(t,this.instancePlugins)}else this.instancePlugins=new Map(fi.plugins);for(const[e,t]of fi.protectedFunctions())fi.loadFunctionUnprotected(t,e,this.instancePlugins);for(const[e,t]of this.instancePlugins.entries())this.categorizeFunction(e,pi(e,t))}static registerFunctionPlugin(e,t){this.loadPluginFunctions(e,this.plugins),void 0!==t&&this.loadTranslations(t)}static registerFunction(e,t,n){this.loadPluginFunction(t,e,this.plugins),void 0!==n&&this.loadTranslations(n)}static unregisterFunction(e){if(this.functionIsProtected(e))throw Dt.cannotUnregisterFunctionWithId(e);this.plugins.delete(e)}static unregisterFunctionPlugin(e){for(const t of this.protectedPlugins())if(t===e)throw Dt.cannotUnregisterProtectedPlugin();for(const[t,n]of this.plugins.entries())n===e&&this.plugins.delete(t)}static unregisterAll(){this.plugins.clear()}static getRegisteredFunctionIds(){return[...Array.from(this.plugins.keys()),...Array.from(this._protectedPlugins.keys())]}static getPlugins(){return Array.from(new Set(this.plugins.values()).values())}static getFunctionPlugin(e){return this.functionIsProtected(e)?void 0:this.plugins.get(e)}static functionIsProtected(e){return this._protectedPlugins.has(e)}static loadTranslations(e){const t=new Set(Yi.getRegisteredLanguagesCodes());Object.keys(e).forEach((n=>{t.has(n)&&Yi.getLanguage(n).extendFunctions(e[n])}))}static loadPluginFunctions(e,t){Object.keys(e.implementedFunctions).forEach((n=>{this.loadPluginFunction(e,n,t)})),void 0!==e.aliases&&Object.keys(e.aliases).forEach((n=>{this.loadPluginFunction(e,n,t)}))}static loadPluginFunction(e,t,n){if(this.functionIsProtected(t))throw Dt.cannotRegisterFunctionWithId(t);this.loadFunctionUnprotected(e,t,n)}static loadFunctionUnprotected(e,t,n){const r=pi(t,e).method;if(!Object.prototype.hasOwnProperty.call(e.prototype,r))throw kt.functionMethodNotFound(r,e.name);n.set(t,e)}static*protectedFunctions(){for(const[e,t]of this._protectedPlugins)void 0!==t&&(yield[e,t])}static*protectedPlugins(){for(const[,e]of this._protectedPlugins)void 0!==e&&(yield e)}initializePlugins(e){const t=[];for(const[n,r]of this.instancePlugins.entries()){let o=t.find((e=>e instanceof r));void 0===o&&(o=new r(e),t.push(o));const i=pi(n,r),s=i.method;this.functions.set(n,[s,o]);const a=i.arraySizeMethod;void 0!==a&&this.arraySizeFunctions.set(n,[a,o])}}getFunctionPlugin(e){if(!fi.functionIsProtected(e))return this.instancePlugins.get(e)}getFunction(e){const t=this.functions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,n]=t;return(t,r)=>n[e](t,r)}}getArraySizeFunction(e){const t=this.arraySizeFunctions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,n]=t;return(t,r)=>n[e](t,r)}}getMetadata(e){return this.functionsMetadata.get(e)}getPlugins(){const e=new Set;for(const[t,n]of this.instancePlugins)fi.functionIsProtected(t)||e.add(n);return Array.from(e)}getRegisteredFunctionIds(){return Array.from(this.functions.keys())}categorizeFunction(e,t){t.isVolatile&&this.volatileFunctions.add(e),t.arrayFunction&&this.arrayFunctions.add(e),t.doesNotNeedArgumentsToBeComputed&&this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(e),t.isDependentOnSheetStructureChange&&this.structuralChangeFunctions.add(e),this.functionsMetadata.set(e,t)}}var gi;fi.plugins=new Map,fi._protectedPlugins=new Map([["VERSION",mi],["OFFSET",void 0]]),function(e){e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUAL="GREATER_THAN_OR_EQUAL",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUAL="LESS_THAN_OR_EQUAL",e.NOT_EQUAL="NOT_EQUAL",e.EQUAL="EQUAL"}(gi||(gi={}));const yi=(e,t)=>({operator:e,value:t});class wi{constructor(e){var t,n,r,o;this.trueString=null!==(n=null===(t=e.translationPackage.getMaybeFunctionTranslation("TRUE"))||void 0===t?void 0:t.toLowerCase())&&void 0!==n?n:"true",this.falseString=null!==(o=null===(r=e.translationPackage.getMaybeFunctionTranslation("FALSE"))||void 0===r?void 0:r.toLowerCase())&&void 0!==o?o:"false"}fromCellValue(e,t){if("string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e)return;const n=this.parseCriterion(e,t);return void 0!==n?{raw:e,lambda:_i(n,t)}:void 0}parseCriterion(e,t){if("number"==typeof e||"boolean"==typeof e)return yi(gi.EQUAL,e);if("string"==typeof e){const n=vi.exec(e);let r,o;n?(o=function(e){switch(e){case">":return gi.GREATER_THAN;case">=":return gi.GREATER_THAN_OR_EQUAL;case"<":return gi.LESS_THAN;case"<=":return gi.LESS_THAN_OR_EQUAL;case"<>":return gi.NOT_EQUAL;case"=":return gi.EQUAL;default:return}}(n[1]),r=n[2]):(o=gi.EQUAL,r=e);const i=t.coerceToMaybeNumber(r),s=r.toLowerCase()===this.trueString||r.toLowerCase()!==this.falseString&&void 0;if(void 0===o)return;if(""===r)return yi(o,null);if(void 0!==i)return yi(o,je(i));if(o===gi.EQUAL||o===gi.NOT_EQUAL)return yi(o,null!=s?s:r)}}}const vi=/([<>=]+)(.*)/,_i=(e,t)=>{switch(e.operator){case gi.GREATER_THAN:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)>0:e=>!1;case gi.GREATER_THAN_OR_EQUAL:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)>=0:e=>!1;case gi.LESS_THAN:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)<0:e=>!1;case gi.LESS_THAN_OR_EQUAL:return"number"==typeof e.value?n=>"number"==typeof n&&t.floatCmp(n,e.value)<=0:e=>!1;case gi.EQUAL:return"number"==typeof e.value?n=>{if("number"==typeof n)return 0===t.floatCmp(n,e.value);if("string"==typeof n){if(""===n)return!1;const r=t.coerceToMaybeNumber(n);return void 0!==r&&0===t.floatCmp(r,e.value)}return!1}:"string"==typeof e.value?t.eqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"==typeof t&&t===e.value:e=>e===We;case gi.NOT_EQUAL:return"number"==typeof e.value?n=>{if("number"==typeof n)return 0!==t.floatCmp(n,e.value);if("string"==typeof n){if(""===n)return!0;const r=t.coerceToMaybeNumber(n);return void 0===r||0!==t.floatCmp(r,e.value)}return!0}:"string"==typeof e.value?t.neqMatcherFunction(e.value):"boolean"==typeof e.value?t=>"boolean"!=typeof t||t!==e.value:e=>e!==We}};class bi{constructor(e,t,n,r,o,i,s,a,l,u){this.config=e,this.dependencyGraph=t,this.columnSearch=n,this.stats=r,this.arithmeticHelper=o,this.functionRegistry=i,this.namedExpressions=s,this.serialization=a,this.arraySizePredictor=l,this.dateTimeHelper=u,this.equalOp=(e,t)=>Ci(this.arithmeticHelper.eq,e,t),this.notEqualOp=(e,t)=>Ci(this.arithmeticHelper.neq,e,t),this.greaterThanOp=(e,t)=>Ci(this.arithmeticHelper.gt,e,t),this.lessThanOp=(e,t)=>Ci(this.arithmeticHelper.lt,e,t),this.greaterThanOrEqualOp=(e,t)=>Ci(this.arithmeticHelper.geq,e,t),this.lessThanOrEqualOp=(e,t)=>Ci(this.arithmeticHelper.leq,e,t),this.concatOp=(e,t)=>Ci(this.arithmeticHelper.concat,Kn(e),Kn(t)),this.plusOp=(e,t)=>Ci(this.arithmeticHelper.addWithEpsilon,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.minusOp=(e,t)=>Ci(this.arithmeticHelper.subtract,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.timesOp=(e,t)=>Ci(this.arithmeticHelper.multiply,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.powerOp=(e,t)=>Ci(this.arithmeticHelper.pow,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.divOp=(e,t)=>Ci(this.arithmeticHelper.divide,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.unaryMinusOp=e=>Si(this.arithmeticHelper.unaryMinus,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.percentOp=e=>Si(this.arithmeticHelper.unaryPercent,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.unaryPlusOp=e=>this.arithmeticHelper.unaryPlus(e),this.functionRegistry.initializePlugins(this),this.criterionBuilder=new wi(e)}evaluateAst(e,t){let n=this.evaluateAstWithoutPostprocessing(e,t);if(Je(n)){if(Qn(je(n)))return new Cn(sn.NUM,J.NaN);n=Ge(n,Jn(je(n)))}return n instanceof nt&&1===n.height()&&1===n.width()&&([[n]]=n.data),function(e,t){return e instanceof Cn&&void 0!==t?e.attachRootVertex(t):e}(n,t.formulaVertex)}evaluateAstWithoutPostprocessing(e,t){switch(e.type){case Y.EMPTY:return We;case Y.CELL_REFERENCE:{const n=e.reference.toSimpleCellAddress(t.formulaAddress);return Nn(n)?new Cn(sn.REF,J.BadRef):this.dependencyGraph.getCellValue(n)}case Y.NUMBER:case Y.STRING:return e.value;case Y.CONCATENATE_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.concatOp,n,r,t)}case Y.EQUALS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.equalOp,n,r,t)}case Y.NOT_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.notEqualOp,n,r,t)}case Y.GREATER_THAN_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOp,n,r,t)}case Y.LESS_THAN_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOp,n,r,t)}case Y.GREATER_THAN_OR_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOrEqualOp,n,r,t)}case Y.LESS_THAN_OR_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOrEqualOp,n,r,t)}case Y.PLUS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.plusOp,n,r,t)}case Y.MINUS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.minusOp,n,r,t)}case Y.TIMES_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.timesOp,n,r,t)}case Y.POWER_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.powerOp,n,r,t)}case Y.DIV_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.divOp,n,r,t)}case Y.PLUS_UNARY_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryPlusOp,n,t)}case Y.MINUS_UNARY_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryMinusOp,n,t)}case Y.PERCENT_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.percentOp,n,t)}case Y.FUNCTION_CALL:{if("valid"!==this.config.licenseKeyValidityState&&!fi.functionIsProtected(e.procedureName))return new Cn(sn.LIC,J.LicenseKey(this.config.licenseKeyValidityState));const n=this.functionRegistry.getFunction(e.procedureName);return void 0!==n?n(e,new Vn(t.formulaAddress,t.arraysFlag||this.functionRegistry.isArrayFunction(e.procedureName),t.formulaVertex)):new Cn(sn.NAME,J.FunctionName(e.procedureName))}case Y.NAMED_EXPRESSION:{const n=this.namedExpressions.nearestNamedExpression(e.expressionName,t.formulaAddress.sheet);return n?this.dependencyGraph.getCellValue(n.address):new Cn(sn.NAME,J.NamedExpressionName(e.expressionName))}case Y.CELL_RANGE:{if(!this.rangeSpansOneSheet(e))return new Cn(sn.REF,J.RangeManySheets);const n=Hn.fromCellRange(e,t.formulaAddress),r=this.dependencyGraph.getArray(n);if(r){const e=r.array;if(e instanceof Bt)throw new Error("Array should be already computed");if(e instanceof Cn)return e;if(e instanceof Wt)return nt.fromRange(e.raw(),n,this.dependencyGraph);throw new Error("Unknown array")}return nt.onlyRange(n,this.dependencyGraph)}case Y.COLUMN_RANGE:{if(!this.rangeSpansOneSheet(e))return new Cn(sn.REF,J.RangeManySheets);const n=Fn.fromColumnRange(e,t.formulaAddress);return nt.onlyRange(n,this.dependencyGraph)}case Y.ROW_RANGE:{if(!this.rangeSpansOneSheet(e))return new Cn(sn.REF,J.RangeManySheets);const n=Yn.fromRowRangeAst(e,t.formulaAddress);return nt.onlyRange(n,this.dependencyGraph)}case Y.PARENTHESIS:return this.evaluateAst(e.expression,t);case Y.ARRAY:{let n;const r=[];for(const o of e.args){let e;const i=[];for(const n of o){const r=jn(this.evaluateAst(n,t)),o=r.height();if(void 0===e)e=o,i.push(...r.data);else{if(e!==o)return new Cn(sn.REF,J.SizeMismatch);for(let e=0;et.map(e)));return nt.onlyValues(n)}return e(t)}binaryRangeWrapper(e,t,n,r){var o,i;if(t instanceof nt&&!r.arraysFlag&&(t=null!==(o=ir(t,r))&&void 0!==o?o:new Cn(sn.VALUE,J.ScalarExpected)),t instanceof Cn)return t;if(n instanceof nt&&!r.arraysFlag&&(n=null!==(i=ir(n,r))&&void 0!==i?i:new Cn(sn.VALUE,J.ScalarExpected)),n instanceof Cn)return n;if(t instanceof nt||n instanceof nt){if(!(t instanceof nt)){if(n.isAdHoc()){const r=n.data;for(let n=0;nn.performEagerTransformations(e,t)))}transformSingleAst(e,t){let[n,r]=[e,t];return this.transformations.forEach((e=>{[n,r]=e.transformSingleAst(n,r)})),[n,r]}isIrreversible(){return!0}}class Mi{constructor(e){this.stats=e,this.transformations=[]}version(){return this.transformations.length}addTransformation(e){return void 0!==this.combinedTransformer?this.combinedTransformer.add(e):this.transformations.push(e),this.version()}beginCombinedMode(e){this.combinedTransformer=new Ei(e)}commitCombinedMode(){if(void 0===this.combinedTransformer)throw Error("Combined mode wasn't started");return this.transformations.push(this.combinedTransformer),this.combinedTransformer=void 0,this.version()}applyTransformations(e,t,n){this.stats.start(et.TRANSFORM_ASTS_POSTPONED);for(let r=n;rt?1:0:e===We?-1:t===We?1:t instanceof Cn||"number"==typeof e&&"string"==typeof t||"number"==typeof e&&"boolean"==typeof t?-1:"string"==typeof e&&"number"==typeof t?1:"string"==typeof e&&"boolean"==typeof t?-1:1}class Ai{constructor(e){this.dependencyGraph=e}advancedFind(e,t,{returnOccurrence:n}={returnOccurrence:"first"}){const r=t.range,o=void 0===r?t.valuesFromTopLeftCorner():this.dependencyGraph.computeListOfValuesInRange(r),i="first"===n?e=>ee>=0,s="first"===n?e=>e+1:e=>e-1;for(let t="first"===n?0:o.length-1;i(t);t=s(t))if(e(je(o[t])))return t;return-1}basicFind(e,t,n,{ordering:r,ifNoMatch:o,returnOccurrence:i}){const s="string"==typeof e?or(e):e,a=t.range;return void 0===a?this.findNormalizedValue(s,t.valuesFromTopLeftCorner(),o,i):"none"===r?this.findNormalizedValue(s,this.dependencyGraph.computeListOfValuesInRange(a),o,i):function(e,t,{searchCoordinate:n,orderingDirection:r,ifNoMatch:o},i){const s=t.start[n],a="col"===n?t.effectiveEndColumn(i):t.effectiveEndRow(i),l="col"===n?e=>je(i.getCellValue(An(t.sheet,e,t.start.row))):e=>je(i.getCellValue(An(t.sheet,t.start.col,e))),u="asc"===r?(e,t)=>Ri(e,t):(e,t)=>-Ri(e,t),h=function(e,t,n){let r=t,o=n;for(;ru(e,l(t))>=0),s,a),c=l(h);if(c===e)return h-s;if("returnLowerBound"===o){if(h===Ti)return"asc"===r?Ti:0;if(typeof c!=typeof e)return Ti;if("asc"===r)return h-s;const t=h+1;return t<=a?t-s:Ti}if("returnUpperBound"===o){if(h===Ti)return"asc"===r?0:Ti;if(typeof c!=typeof e)return Ti;if("desc"===r)return h-s;const t=h+1;return t<=a?t-s:Ti}return Ti}(s,a,{searchCoordinate:n,orderingDirection:r,ifNoMatch:o},this.dependencyGraph)}findNormalizedValue(e,t,n="returnNotFound",r="first"){const o=t.map(je).map((e=>"string"==typeof e?or(e):e));if("returnNotFound"===n)return"first"===r?o.indexOf(e):o.lastIndexOf(e);const i="returnLowerBound"===n?(e,t)=>Ri(e,t):(e,t)=>-Ri(e,t);let s="returnLowerBound"===n?-1/0:1/0,a=-1;const l="first"===r?e=>ee>=0,u="first"===r?e=>e+1:e=>e-1;for(let t="first"===r?0:o.length-1;l(t);t=u(t)){const n=o[t];if(n===e)return t;i(n,e)>0||i(s,n)<0&&(s=n,a=t)}return a}}class Ni extends Ai{constructor(e){super(e),this.dependencyGraph=e}add(e,t){}remove(e,t){}change(e,t,n){}applyChanges(e){}addColumns(e){}removeColumns(e){}removeSheet(e){}moveValues(e,t,n,r){}removeValues(e){}find(e,t,n){return this.basicFind(e,t,"row",n)}}class Li{constructor(e,t,n){this.dependencyGraph=e,this.config=t,this.stats=n,this.index=new Map,this.transformingService=this.dependencyGraph.lazilyTransformingAstService,this.binarySearchStrategy=new Ni(e)}add(e,t){if(!(e===We||e instanceof Cn))if(e instanceof nt)for(const[n,r]of e.entriesFromTopLeftCorner(t))this.addSingleCellValue(je(n),r);else this.addSingleCellValue(e,t)}remove(e,t){if(void 0!==e)if(e instanceof nt)for(const[n,r]of e.entriesFromTopLeftCorner(t))this.removeSingleValue(je(n),r);else this.removeSingleValue(e,t)}change(e,t,n){e!==t&&(this.remove(e,n),this.add(t,n))}applyChanges(e){for(const t of e)void 0!==t.oldValue&&this.change(je(t.oldValue),je(t.value),t.address)}moveValues(e,t,n,r){for(const[o,i]of e){const e=Ln(i,r,t,n);this.remove(o,i),this.add(o,e)}}removeValues(e){for(const[t,n]of e)this.remove(t,n)}find(e,t,{ordering:n,ifNoMatch:r,returnOccurrence:o}){null==o&&(o="none"===n?"first":"last");const i=this.findUsingColumnIndex(e,t,o);return void 0!==i?i:this.binarySearchStrategy.find(e,t,{ordering:n,ifNoMatch:r,returnOccurrence:o})}findUsingColumnIndex(e,t,n){const r=t.range;if(void 0===r)return;this.ensureRecentData(r.sheet,r.start.col,e);const o=this.getColumnMap(r.sheet,r.start.col);if(!o)return-1;const i="string"==typeof e?or(e):e,s=o.get(i);if(!s||!s.index||0===s.index.length)return;const a=Li.findRowBelongingToRange(s,r,n);return void 0!==a?a-r.start.row:void 0}static findRowBelongingToRange(e,t,n){const r=t.start.row,o=t.end.row,i="first"===n?xi(r,e.index,"upperBound"):xi(o,e.index,"lowerBound");if(-1===i)return;const s=e.index[i];return s>=r&&s<=o?s:void 0}advancedFind(e,t,n={returnOccurrence:"first"}){return this.binarySearchStrategy.advancedFind(e,t,n)}addColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,0,...Array(e.numberOfColumns))}removeColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,e.numberOfColumns)}removeSheet(e){this.index.delete(e)}getColumnMap(e,t){this.index.has(e)||this.index.set(e,[]);const n=this.index.get(e);let r=n[t];return r||(r=new Map,n[t]=r),r}getValueIndex(e,t,n){const r=this.getColumnMap(e,t);let o=this.getColumnMap(e,t).get(n);return o||(o={version:this.transformingService.version(),index:[]},r.set(n,o)),o}ensureRecentData(e,t,n){const r=this.getValueIndex(e,t,n),o=this.transformingService.version();if(r.version===o)return;const i=this.transformingService.getTransformationsFrom(r.version,(t=>t.sheet===e&&(t instanceof wo||t instanceof Co)));for(const e of i)e instanceof wo?this.addRows(t,e.rowsSpan,n):e instanceof Co&&this.removeRows(t,e.rowsSpan,n);r.version=o}addSingleCellValue(e,t){this.stats.measure(et.BUILD_COLUMN_INDEX,(()=>{this.ensureRecentData(t.sheet,t.col,e),"string"==typeof e&&(e=or(e));const n=this.getValueIndex(t.sheet,t.col,e);Li.addValue(n,t.row)}))}removeSingleValue(e,t){this.stats.measure(et.BUILD_COLUMN_INDEX,(()=>{this.ensureRecentData(t.sheet,t.col,e);const n=this.getColumnMap(t.sheet,t.col);"string"==typeof e&&(e=or(e));const r=n.get(e);if(!r)return;const o=xi(t.row,r.index);o>-1&&r.index.splice(o,1),0===r.index.length&&n.delete(e),0===n.size&&delete this.index.get(t.sheet)[t.col]}))}addRows(e,t,n){const r=this.getValueIndex(t.sheet,e,n);Li.shiftRows(r,t.rowStart,t.numberOfRows)}removeRows(e,t,n){const r=this.getValueIndex(t.sheet,e,n);Li.removeRowsFromValues(r,t),Li.shiftRows(r,t.rowEnd+1,-t.numberOfRows)}static addValue(e,t){const n=xi(t,e.index,"lowerBound");e.index[n]===t||e.index.splice(n+1,0,t)}static removeRowsFromValues(e,t){const n=xi(t.rowStart,e.index,"upperBound"),r=xi(t.rowEnd,e.index,"lowerBound");n>-1&&r>-1&&n<=r&&e.index[n]<=t.rowEnd&&e.index.splice(n,r-n+1)}static shiftRows(e,t,n){const r=xi(t,e.index,"upperBound");if(-1!==r)for(let t=r;tt[n])r=n+1;else{if(!(e=0&&i<=t.length?i:-1}class Oi{constructor(e){this.config=e;const t="."===this.config.thousandSeparator?`\\${this.config.thousandSeparator}`:this.config.thousandSeparator,n="."===this.config.decimalSeparator?`\\${this.config.decimalSeparator}`:this.config.decimalSeparator;this.numberPattern=new RegExp(`^([+-]?((${n}\\d+)|(\\d+(${t}\\d{3,})*(${n}\\d*)?)))(e[+-]?\\d+)?$`),this.allThousandSeparatorsRegex=new RegExp(`${t}`,"g")}numericStringToMaybeNumber(e){if(this.numberPattern.test(e)){const t=this.numericStringToNumber(e);if(isNaN(t))return;return t}}numericStringToNumber(e){const t=e.replace(this.allThousandSeparatorsRegex,"").replace(this.config.decimalSeparator,".");return Number(t)}}class Ii{constructor(e,t,n){this.dependencyGraph=e,this.unparser=t,this.exporter=n}getCellHyperlink(e){const t=this.dependencyGraph.getCell(e);if(t instanceof $t){const e=t.getFormula(this.dependencyGraph.lazilyTransformingAstService);if("HYPERLINK"===e.procedureName)return e.hyperlink}}getCellFormula(e,t){const n=this.dependencyGraph.getCell(e);if(n instanceof $t){const r=n.getFormula(this.dependencyGraph.lazilyTransformingAstService);return t=null!=t?t:e,this.unparser.unparse(r,t)}if(n instanceof Gt){const r=n.getAddress(this.dependencyGraph.lazilyTransformingAstService);if(r.row!==e.row||r.col!==e.col||r.sheet!==e.sheet)return;t=null!=t?t:e;const o=n.getFormula(this.dependencyGraph.lazilyTransformingAstService);if(void 0!==o)return this.unparser.unparse(o,t)}else if(n instanceof gn)return n.getFormula()}getCellSerialized(e,t){var n;return null!==(n=this.getCellFormula(e,t))&&void 0!==n?n:this.getRawValue(e)}getCellValue(e){return this.exporter.exportValue(this.dependencyGraph.getScalarValue(e))}getRawValue(e){return this.dependencyGraph.getRawValue(e)}getSheetValues(e){return this.genericSheetGetter(e,(e=>this.getCellValue(e)))}getSheetFormulas(e){return this.genericSheetGetter(e,(e=>this.getCellFormula(e)))}genericSheetGetter(e,t){const n=this.dependencyGraph.getSheetHeight(e),r=this.dependencyGraph.getSheetWidth(e),o=new Array(n);for(let i=0;i=0&&(null===o[i][e]||void 0===o[i][e]);e--)o[i].pop()}for(let e=n-1;e>=0&&0===o[e].length;e--)o.pop();return o}genericAllSheetsGetter(e){const t={};for(const n of this.dependencyGraph.sheetMapping.displayNames()){const r=this.dependencyGraph.sheetMapping.fetch(n);t[n]=e(r)}return t}getSheetSerialized(e){return this.genericSheetGetter(e,(e=>this.getCellSerialized(e)))}getAllSheetsValues(){return this.genericAllSheetsGetter((e=>this.getSheetValues(e)))}getAllSheetsFormulas(){return this.genericAllSheetsGetter((e=>this.getSheetFormulas(e)))}getAllSheetsSerialized(){return this.genericAllSheetsGetter((e=>this.getSheetSerialized(e)))}getAllNamedExpressionsSerialized(){const e=[];let t=0;for(const n of this.dependencyGraph.sheetMapping.displayNames()){const r=this.dependencyGraph.sheetMapping.fetch(n);e[r]=t,t++}return this.dependencyGraph.namedExpressions.getAllNamedExpressions().map((t=>({name:t.expression.displayName,expression:this.getCellSerialized(t.expression.address),scope:void 0!==t.scope?e[t.scope]:void 0,options:t.expression.options})))}withNewConfig(e,t){const n=new Oe(e,Ne(e),this.dependencyGraph.sheetMapping.fetchDisplayName,t);return new Ii(this.dependencyGraph,n,this.exporter)}}class ki{static buildFromSheets(e,t={},n=[]){const r=new Ui(t);return this.buildEngine(r,e,n)}static buildFromSheet(e,t={},n=[]){const r=new Ui(t),o=r.translationPackage.getUITranslation(on.NEW_SHEET_PREFIX)+"1";return this.buildEngine(r,{[o]:e},n)}static buildEmpty(e={},t=[]){return this.buildEngine(new Ui(e),{},t)}static rebuildWithConfig(e,t,n,r){return this.buildEngine(e,t,n,r)}static buildEngine(e,t={},n=[],r=(e.useStats?new st:new at)){r.start(et.BUILD_ENGINE_TOTAL);const o=new po,i=new fi(e),s=new Mi(r),a=mn.buildEmpty(s,e,i,o,r),l=function(e,t,n){return t.useColumnIndex?new Li(e,t,n):new Ni(e)}(a,e,r),u=a.sheetMapping,h=a.addressMapping;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n];Mo(r);const o=To(r);if(o.height>e.maxRows||o.width>e.maxColumns)throw new ct;const i=u.addSheet(n);h.autoAddSheet(i,o)}const c=new ke(e,i,u.get);s.parser=c;const d=new Oe(e,Ne(e),u.fetchDisplayName,o),m=new xr(e),p=new Oi(e),f=new Bn(e,m,p),g=new ao(e,m,p),y=new hr(e,i),w=new xo(e,a,l,g,c,r,s,o,y),v=new ni(e,w);s.undoRedo=v;const _=new uo(e,a,w),b=new ri(e,w,v,_,a,l,c,g,s,o);n.forEach((e=>{b.ensureItIsPossibleToAddNamedExpression(e.name,e.expression,e.scope),b.operations.addNamedExpression(e.name,e.expression,e.scope,e.options)}));const S=new ui(e,o,u.fetchDisplayName,s),C=new Ii(a,d,S),E=new bi(e,a,l,r,f,i,o,C,y,m);r.measure(et.GRAPH_BUILD,(()=>{new hi(a,l,c,g,r,y).buildGraph(t,r)}));const M=new si(e,r,E,s,a,l);return M.run(),r.end(et.BUILD_ENGINE_TOTAL),{config:e,stats:r,dependencyGraph:a,columnSearch:l,parser:c,unparser:d,cellContentParser:g,evaluator:M,lazilyTransformingAstService:s,crudOperations:b,exporter:S,namedExpressions:o,serialization:C,functionRegistry:i}}}function Di(e){return()=>{throw new Error(`The "${e}" method cannot be called because this HyperFormula instance has been destroyed`)}}var Pi,Hi=n(51504);!function(e){e.SheetAdded="sheetAdded",e.SheetRemoved="sheetRemoved",e.SheetRenamed="sheetRenamed",e.NamedExpressionAdded="namedExpressionAdded",e.NamedExpressionRemoved="namedExpressionRemoved",e.ValuesUpdated="valuesUpdated",e.EvaluationSuspended="evaluationSuspended",e.EvaluationResumed="evaluationResumed"}(Pi||(Pi={}));class Fi extends Hi.TinyEmitter{emit(e,...t){return super.emit(e,...t),this}}class Yi{constructor(e,t,n,r,o,i,s,a,l,u,h,c,d,m){this._config=e,this._stats=t,this._dependencyGraph=n,this._columnSearch=r,this._parser=o,this._unparser=i,this._cellContentParser=s,this._evaluator=a,this._lazilyTransformingAstService=l,this._crudOperations=u,this._exporter=h,this._namedExpressions=c,this._serialization=d,this._functionRegistry=m,this._emitter=new Fi,this._evaluationSuspended=!1}static get defaultConfig(){return Bi({})}get graph(){return this.dependencyGraph.graph}get rangeMapping(){return this.dependencyGraph.rangeMapping}get arrayMapping(){return this.dependencyGraph.arrayMapping}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}get dependencyGraph(){return this._dependencyGraph}get evaluator(){return this._evaluator}get columnSearch(){return this._columnSearch}get lazilyTransformingAstService(){return this._lazilyTransformingAstService}get licenseKeyValidityState(){return this._config.licenseKeyValidityState}static buildFromArray(e,t={},n=[]){return this.buildFromEngineState(ki.buildFromSheet(e,t,n))}static buildFromSheets(e,t={},n=[]){return this.buildFromEngineState(ki.buildFromSheets(e,t,n))}static buildEmpty(e={},t=[]){return this.buildFromEngineState(ki.buildEmpty(e,t))}static getLanguage(e){gr(e,"string","languageCode");const t=this.registeredLanguages.get(e);if(void 0===t)throw new Ot;return t}static registerLanguage(e,t){if(gr(e,"string","languageCode"),this.registeredLanguages.has(e))throw new It;var n;this.registeredLanguages.set(e,(n=t,new rn(Object.assign({},n.functions),Object.assign({},n.errors),Object.assign({},n.ui))))}static unregisterLanguage(e){if(gr(e,"string","languageCode"),!this.registeredLanguages.has(e))throw new Ot;this.registeredLanguages.delete(e)}static getRegisteredLanguagesCodes(){return Array.from(this.registeredLanguages.keys())}static registerFunctionPlugin(e,t){fi.registerFunctionPlugin(e,t)}static unregisterFunctionPlugin(e){fi.unregisterFunctionPlugin(e)}static registerFunction(e,t,n){gr(e,"string","functionId"),fi.registerFunction(e,t,n)}static unregisterFunction(e){gr(e,"string","functionId"),fi.unregisterFunction(e)}static unregisterAllFunctions(){fi.unregisterAll()}static getRegisteredFunctionNames(e){gr(e,"string","code");const t=fi.getRegisteredFunctionIds();return this.getLanguage(e).getFunctionTranslations(t)}static getFunctionPlugin(e){return gr(e,"string","functionId"),fi.getFunctionPlugin(e)}static getAllFunctionPlugins(){return fi.getPlugins()}static buildFromEngineState(e){return new Yi(e.config,e.stats,e.dependencyGraph,e.columnSearch,e.parser,e.unparser,e.cellContentParser,e.evaluator,e.lazilyTransformingAstService,e.crudOperations,e.exporter,e.namedExpressions,e.serialization,e.functionRegistry)}getCellValue(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellValue(e)}getCellFormula(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return this._serialization.getCellFormula(e)}getCellHyperlink(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellHyperlink(e)}getCellSerialized(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellSerialized(e)}getSheetValues(e){return gr(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetValues(e)}getSheetFormulas(e){return gr(e,"number","sheetId"),this._serialization.getSheetFormulas(e)}getSheetSerialized(e){return gr(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetSerialized(e)}getAllSheetsDimensions(){return this._serialization.genericAllSheetsGetter((e=>this.getSheetDimensions(e)))}getSheetDimensions(e){return gr(e,"number","sheetId"),{width:this.dependencyGraph.getSheetWidth(e),height:this.dependencyGraph.getSheetHeight(e)}}getAllSheetsValues(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsValues()}getAllSheetsFormulas(){return this._serialization.getAllSheetsFormulas()}getAllSheetsSerialized(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsSerialized()}updateConfig(e){Object.entries(e).every((([e,t])=>this._config[e]===t))||this.rebuildWithConfig(e)}getConfig(){return this._config.getConfig()}rebuildAndRecalculate(){this.rebuildWithConfig({})}getStats(){return this._stats.snapshot()}undo(){return this._crudOperations.undo(),this.recomputeIfDependencyGraphNeedsIt()}redo(){return this._crudOperations.redo(),this.recomputeIfDependencyGraphNeedsIt()}isThereSomethingToUndo(){return this._crudOperations.isThereSomethingToUndo()}isThereSomethingToRedo(){return this._crudOperations.isThereSomethingToRedo()}isItPossibleToSetCellContents(e){let t;if(On(e))t=new Hn(e,e);else{if(!Dn(e))throw new Et("SimpleCellAddress | SimpleCellRange","address");t=new Hn(e.start,e.end)}try{this._crudOperations.ensureRangeInSizeLimits(t);for(const e of t.addresses(this._dependencyGraph))this._crudOperations.ensureItIsPossibleToChangeContent(e)}catch(e){return!1}return!0}setCellContents(e,t){return this._crudOperations.setCellContents(e,t),this.recomputeIfDependencyGraphNeedsIt()}swapRowIndexes(e,t){return gr(e,"number","sheetId"),this._crudOperations.setRowOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapRowIndexes(e,t){gr(e,"number","sheetId");try{return this._crudOperations.validateSwapRowIndexes(e,t),this._crudOperations.testRowOrderForArrays(e,t),!0}catch(e){return!1}}setRowOrder(e,t){gr(e,"number","sheetId");const n=this._crudOperations.mappingFromOrder(e,t,"row");return this.swapRowIndexes(e,n)}isItPossibleToSetRowOrder(e,t){gr(e,"number","sheetId");try{const n=this._crudOperations.mappingFromOrder(e,t,"row");return this._crudOperations.validateSwapRowIndexes(e,n),this._crudOperations.testRowOrderForArrays(e,n),!0}catch(e){return!1}}swapColumnIndexes(e,t){return gr(e,"number","sheetId"),this._crudOperations.setColumnOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapColumnIndexes(e,t){gr(e,"number","sheetId");try{return this._crudOperations.validateSwapColumnIndexes(e,t),this._crudOperations.testColumnOrderForArrays(e,t),!0}catch(e){return!1}}setColumnOrder(e,t){gr(e,"number","sheetId");const n=this._crudOperations.mappingFromOrder(e,t,"column");return this.swapColumnIndexes(e,n)}isItPossibleToSetColumnOrder(e,t){gr(e,"number","sheetId");try{const n=this._crudOperations.mappingFromOrder(e,t,"column");return this._crudOperations.validateSwapColumnIndexes(e,n),this._crudOperations.testColumnOrderForArrays(e,n),!0}catch(e){return!1}}isItPossibleToAddRows(e,...t){gr(e,"number","sheetId");const n=Io(t);try{return this._crudOperations.ensureItIsPossibleToAddRows(e,...n),!0}catch(e){return!1}}addRows(e,...t){return gr(e,"number","sheetId"),this._crudOperations.addRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveRows(e,...t){gr(e,"number","sheetId");const n=Oo(t);try{return this._crudOperations.ensureItIsPossibleToRemoveRows(e,...n),!0}catch(e){return!1}}removeRows(e,...t){return gr(e,"number","sheetId"),this._crudOperations.removeRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToAddColumns(e,...t){gr(e,"number","sheetId");const n=Io(t);try{return this._crudOperations.ensureItIsPossibleToAddColumns(e,...n),!0}catch(e){return!1}}addColumns(e,...t){return gr(e,"number","sheetId"),this._crudOperations.addColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveColumns(e,...t){gr(e,"number","sheetId");const n=Oo(t);try{return this._crudOperations.ensureItIsPossibleToRemoveColumns(e,...n),!0}catch(e){return!1}}removeColumns(e,...t){return gr(e,"number","sheetId"),this._crudOperations.removeColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveCells(e,t){if(!On(t))throw new Et("SimpleCellAddress","destinationLeftCorner");if(!Dn(e))throw new Et("SimpleCellRange","source");try{const n=new Hn(e.start,e.end);return this._crudOperations.operations.ensureItIsPossibleToMoveCells(n.start,n.width(),n.height(),t),!0}catch(e){return!1}}moveCells(e,t){if(!On(t))throw new Et("SimpleCellAddress","destinationLeftCorner");if(!Dn(e))throw new Et("SimpleCellRange","source");const n=new Hn(e.start,e.end);return this._crudOperations.moveCells(n.start,n.width(),n.height(),t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveRows(e,t,n,r){gr(e,"number","sheetId"),gr(t,"number","startRow"),gr(n,"number","numberOfRows"),gr(r,"number","targetRow");try{return this._crudOperations.ensureItIsPossibleToMoveRows(e,t,n,r),!0}catch(e){return!1}}moveRows(e,t,n,r){return gr(e,"number","sheetId"),gr(t,"number","startRow"),gr(n,"number","numberOfRows"),gr(r,"number","targetRow"),this._crudOperations.moveRows(e,t,n,r),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveColumns(e,t,n,r){gr(e,"number","sheetId"),gr(t,"number","startColumn"),gr(n,"number","numberOfColumns"),gr(r,"number","targetColumn");try{return this._crudOperations.ensureItIsPossibleToMoveColumns(e,t,n,r),!0}catch(e){return!1}}moveColumns(e,t,n,r){return gr(e,"number","sheetId"),gr(t,"number","startColumn"),gr(n,"number","numberOfColumns"),gr(r,"number","targetColumn"),this._crudOperations.moveColumns(e,t,n,r),this.recomputeIfDependencyGraphNeedsIt()}copy(e){if(!Dn(e))throw new Et("SimpleCellRange","source");const t=new Hn(e.start,e.end);return this._crudOperations.copy(t.start,t.width(),t.height()),this.getRangeValues(e)}cut(e){if(!Dn(e))throw new Et("SimpleCellRange","source");const t=new Hn(e.start,e.end);return this._crudOperations.cut(t.start,t.width(),t.height()),this.getRangeValues(e)}paste(e){if(!On(e))throw new Et("SimpleCellAddress","targetLeftCorner");return this.ensureEvaluationIsNotSuspended(),this._crudOperations.paste(e),this.recomputeIfDependencyGraphNeedsIt()}isClipboardEmpty(){return this._crudOperations.isClipboardEmpty()}clearClipboard(){this._crudOperations.clearClipboard()}clearRedoStack(){this._crudOperations.undoRedo.clearRedoStack()}clearUndoStack(){this._crudOperations.undoRedo.clearUndoStack()}getRangeValues(e){if(!Dn(e))throw new Et("SimpleCellRange","source");return new Hn(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellValue(e)))))}getRangeFormulas(e){if(!Dn(e))throw new Et("SimpleCellRange","source");return new Hn(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellFormula(e)))))}getRangeSerialized(e){if(!Dn(e))throw new Et("SimpleCellRange","source");return new Hn(e.start,e.end).arrayOfAddressesInRange().map((e=>e.map((e=>this.getCellSerialized(e)))))}getFillRangeData(e,t,n=!1){if(!Dn(e))throw new Et("SimpleCellRange","source");if(!Dn(t))throw new Et("SimpleCellRange","target");const r=new Hn(e.start,e.end),o=new Hn(t.start,t.end);return this.ensureEvaluationIsNotSuspended(),o.arrayOfAddressesInRange().map((o=>o.map((o=>{const i=((o.row-(n?t:e).start.row)%r.height()+r.height())%r.height()+e.start.row,s=((o.col-(n?t:e).start.col)%r.width()+r.width())%r.width()+e.start.col;return this._serialization.getCellSerialized({row:i,col:s,sheet:r.sheet},o)}))))}isItPossibleToAddSheet(e){gr(e,"string","sheetName");try{return this._crudOperations.ensureItIsPossibleToAddSheet(e),!0}catch(e){return!1}}addSheet(e){void 0!==e&&gr(e,"string","sheetName");const t=this._crudOperations.addSheet(e);return this._emitter.emit(Pi.SheetAdded,t),t}isItPossibleToRemoveSheet(e){gr(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(e){return!1}}removeSheet(e){gr(e,"number","sheetId");const t=this.sheetMapping.getDisplayName(e);this._crudOperations.removeSheet(e);const n=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(Pi.SheetRemoved,t,n),n}isItPossibleToClearSheet(e){gr(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(e){return!1}}clearSheet(e){return gr(e,"number","sheetId"),this._crudOperations.clearSheet(e),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToReplaceSheetContent(e,t){gr(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),this._crudOperations.ensureItIsPossibleToChangeSheetContents(e,t),!0}catch(e){return!1}}setSheetContent(e,t){return gr(e,"number","sheetId"),this._crudOperations.setSheetContent(e,t),this.recomputeIfDependencyGraphNeedsIt()}simpleCellAddressFromString(e,t){return gr(e,"string","cellAddress"),gr(t,"number","sheetId"),L(this.sheetMapping.get,e,t)}simpleCellRangeFromString(e,t){return gr(e,"string","cellRange"),gr(t,"number","sheetId"),((e,t,n)=>{const r=t.split(u);if(2!==r.length)return;const[o,i]=r,s=L(e,o,n);if(void 0===s)return;const a=L(e,i,s.sheet);return void 0!==a&&s.sheet===a.sheet?Pn(s,a):void 0})(this.sheetMapping.get,e,t)}simpleCellAddressToString(e,t={}){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");const n="number"==typeof t?t:t.includeSheetName?e.sheet+1:e.sheet;return x(this.sheetMapping.fetchDisplayName,e,n)}simpleCellRangeToString(e,t={}){if(!Dn(e))throw new Et("SimpleCellRange","cellRange");const n="number"==typeof t?t:t.includeSheetName?e.start.sheet+e.end.sheet+1:e.start.sheet;return((e,t,n)=>{const r=x(e,t.start,n),o=x(e,t.end,t.start.sheet);return void 0===r||void 0===o?void 0:`${r}${u}${o}`})(this.sheetMapping.fetchDisplayName,e,n)}getCellDependents(e){let t;if(On(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!Dn(e))throw new Et("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.getAdjacentNodesAddresses(t)}getCellPrecedents(e){let t;if(On(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!Dn(e))throw new Et("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.dependencyQueryAddresses(t)}getSheetName(e){return gr(e,"number","sheetId"),this.sheetMapping.getDisplayName(e)}getSheetNames(){return this.sheetMapping.sheetNames()}getSheetId(e){return gr(e,"string","sheetName"),this.sheetMapping.get(e)}doesSheetExist(e){return gr(e,"string","sheetName"),this.sheetMapping.hasSheetWithName(e)}getCellType(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return t=this.dependencyGraph.getCell(e),n=e,t instanceof Gt?t.isLeftCorner(n)?an.ARRAYFORMULA:an.ARRAY:t instanceof $t||t instanceof gn?an.FORMULA:t instanceof fn?an.VALUE:an.EMPTY;var t,n}doesCellHaveSimpleValue(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return this.getCellType(e)===an.VALUE}doesCellHaveFormula(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===an.FORMULA||t===an.ARRAYFORMULA}isCellEmpty(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");return this.getCellType(e)===an.EMPTY}isCellPartOfArray(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===an.ARRAY||t===an.ARRAYFORMULA}getCellValueType(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return Sn(t)}getCellValueDetailedType(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return Je(n=t)?(r=n)instanceof ze?r.getDetailedType():Ze.NUMBER_RAW:Sn(n);var n,r}getCellValueFormat(e){if(!On(e))throw new Et("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return Je(n=t)&&(r=n)instanceof ze?r.format:void 0;var n,r}countSheets(){return this.sheetMapping.numberOfSheets()}isItPossibleToRenameSheet(e,t){gr(e,"number","sheetId"),gr(t,"string","newName");try{return this._crudOperations.ensureItIsPossibleToRenameSheet(e,t),!0}catch(e){return!1}}renameSheet(e,t){gr(e,"number","sheetId"),gr(t,"string","newName");const n=this._crudOperations.renameSheet(e,t);void 0!==n&&this._emitter.emit(Pi.SheetRenamed,n,t)}batch(e){this.suspendEvaluation(),this._crudOperations.beginUndoRedoBatchMode();try{e()}catch(e){throw this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation(),e}return this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation()}suspendEvaluation(){this._evaluationSuspended=!0,this._emitter.emit(Pi.EvaluationSuspended)}resumeEvaluation(){this._evaluationSuspended=!1;const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(Pi.EvaluationResumed,e),e}isEvaluationSuspended(){return this._evaluationSuspended}isItPossibleToAddNamedExpression(e,t,n){gr(e,"string","expressionName"),void 0!==n&&gr(n,"number","scope");try{return this._crudOperations.ensureItIsPossibleToAddNamedExpression(e,t,n),!0}catch(e){return!1}}addNamedExpression(e,t,n,r){gr(e,"string","expressionName"),void 0!==n&&gr(n,"number","scope"),this._crudOperations.addNamedExpression(e,t,n,r);const o=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(Pi.NamedExpressionAdded,e,o),o}getNamedExpressionValue(e,t){gr(e,"string","expressionName"),void 0!==t&&gr(t,"number","scope"),this.ensureEvaluationIsNotSuspended(),this._crudOperations.ensureScopeIdIsValid(t);const n=this._namedExpressions.namedExpressionForScope(e,t);return n?this._serialization.getCellValue(n.address):void 0}getNamedExpressionFormula(e,t){gr(e,"string","expressionName"),void 0!==t&&gr(t,"number","scope"),this._crudOperations.ensureScopeIdIsValid(t);const n=this._namedExpressions.namedExpressionForScope(e,t);return void 0===n?void 0:this._serialization.getCellFormula(n.address)}getNamedExpression(e,t){gr(e,"string","expressionName"),void 0!==t&&gr(t,"number","scope");const n=this._namedExpressions.namedExpressionForScope(e,t);if(void 0!==n)return{name:e,scope:t,expression:this._serialization.getCellFormula(n.address),options:n.options}}isItPossibleToChangeNamedExpression(e,t,n){gr(e,"string","expressionName"),void 0!==n&&gr(n,"number","scope");try{return this._crudOperations.ensureItIsPossibleToChangeNamedExpression(e,t,n),!0}catch(e){return!1}}changeNamedExpression(e,t,n,r){return gr(e,"string","expressionName"),void 0!==n&&gr(n,"number","scope"),this._crudOperations.changeNamedExpressionExpression(e,n,t,r),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveNamedExpression(e,t){gr(e,"string","expressionName"),void 0!==t&&gr(t,"number","scope");try{return this._crudOperations.isItPossibleToRemoveNamedExpression(e,t),!0}catch(e){return!1}}removeNamedExpression(e,t){gr(e,"string","expressionName"),void 0!==t&&gr(t,"number","scope");const n=this._crudOperations.removeNamedExpression(e,t);if(n){const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(Pi.NamedExpressionRemoved,n.displayName,e),e}return[]}listNamedExpressions(e){return void 0!==e&&gr(e,"number","scope"),this._crudOperations.ensureScopeIdIsValid(e),this._namedExpressions.getAllNamedExpressionsNamesInScope(e)}getAllNamedExpressionsSerialized(){return this._serialization.getAllNamedExpressionsSerialized()}normalizeFormula(e){gr(e,"string","formulaString");const{ast:t,address:n}=this.extractTemporaryFormula(e);if(void 0===t)throw new dt;return this._unparser.unparse(t,n)}calculateFormula(e,t){gr(e,"string","formulaString"),gr(t,"number","sheetId"),this._crudOperations.ensureScopeIdIsValid(t);const{ast:n,address:r,dependencies:o}=this.extractTemporaryFormula(e,t);if(void 0===n)throw new dt;const i=this.evaluator.runAndForget(n,r,o);return this._exporter.exportScalarOrRange(i)}getNamedExpressionsFromFormula(e){gr(e,"string","formulaString");const{ast:t,dependencies:n}=this.extractTemporaryFormula(e);if(void 0===t)throw new dt;const r=n.filter((e=>e instanceof Ue)).map((e=>e.name));return[...new Set(r)]}validateFormula(e){gr(e,"string","formulaString");const{ast:t}=this.extractTemporaryFormula(e);return void 0!==t}getRegisteredFunctionNames(){return Yi.getLanguage(this._config.language).getFunctionTranslations(this._functionRegistry.getRegisteredFunctionIds())}getFunctionPlugin(e){return gr(e,"string","functionId"),this._functionRegistry.getFunctionPlugin(e)}getAllFunctionPlugins(){return this._functionRegistry.getPlugins()}numberToDateTime(e){return gr(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDateTime(e)}numberToDate(e){return gr(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDate(e)}numberToTime(e){return gr(e,"number","val"),kr(e)}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}destroy(){!function(e){for(const[t,n]of Object.entries(e))n instanceof Function?e[t]=Di(n):delete e[t]}(this)}ensureEvaluationIsNotSuspended(){if(this._evaluationSuspended)throw new Nt}extractTemporaryFormula(e,t=1){const n=this._cellContentParser.parse(e),r={sheet:t,col:0,row:0};if(!(n instanceof oo.Formula))return{address:r,dependencies:[]};const{ast:o,errors:i,dependencies:s}=this._parser.parse(n.formula,r);return i.length>0?{address:r,dependencies:[]}:{ast:o,address:r,dependencies:s}}rebuildWithConfig(e){const t=this._config.mergeConfig(e),n=this._config.mergeConfig({language:e.language}),r=this._serialization.withNewConfig(n,this._namedExpressions).getAllSheetsSerialized(),o=this._serialization.getAllNamedExpressionsSerialized(),i=ki.rebuildWithConfig(t,r,o,this._stats);this._config=i.config,this._stats=i.stats,this._dependencyGraph=i.dependencyGraph,this._columnSearch=i.columnSearch,this._parser=i.parser,this._unparser=i.unparser,this._cellContentParser=i.cellContentParser,this._evaluator=i.evaluator,this._lazilyTransformingAstService=i.lazilyTransformingAstService,this._crudOperations=i.crudOperations,this._exporter=i.exporter,this._namedExpressions=i.namedExpressions,this._serialization=i.serialization,this._functionRegistry=i.functionRegistry}recomputeIfDependencyGraphNeedsIt(){if(this._evaluationSuspended)return[];{const e=this._crudOperations.getAndClearContentChanges(),t=this.dependencyGraph.verticesToRecompute();this.dependencyGraph.clearDirtyVertices(),t.length>0&&e.addAll(this.evaluator.partialRun(t));const n=e.exportChanges(this._exporter);return e.isEmpty()||this._emitter.emit(Pi.ValuesUpdated,n),n}}}Yi.version="3.0.0",Yi.buildDate="14/01/2025 11:44:17",Yi.releaseDate="14/01/2025",Yi.languages={},Yi.registeredLanguages=new Map;const Vi=new WeakMap;class Ui{constructor(e={},t=!0){const{accentSensitive:n,caseSensitive:r,caseFirst:o,chooseAddressMappingPolicy:i,context:s,currencySymbol:a,dateFormats:l,decimalSeparator:u,evaluateNullToZero:h,functionArgSeparator:c,functionPlugins:d,ignorePunctuation:m,leapYear1900:p,localeLang:f,language:g,ignoreWhiteSpace:y,licenseKey:w,matchWholeCell:v,arrayColumnSeparator:_,arrayRowSeparator:b,maxRows:S,maxColumns:C,nullYear:E,nullDate:M,parseDateTime:T,precisionEpsilon:R,precisionRounding:A,stringifyDateTime:N,stringifyDuration:L,smartRounding:x,timeFormats:O,thousandSeparator:I,useArrayArithmetic:k,useStats:D,undoLimit:P,useColumnIndex:H,useRegularExpressions:F,useWildcards:Y}=e;t&&Ui.warnDeprecatedOptions(e),this.useArrayArithmetic=dr(k,"boolean","useArrayArithmetic"),this.accentSensitive=dr(n,"boolean","accentSensitive"),this.caseSensitive=dr(r,"boolean","caseSensitive"),this.caseFirst=dr(o,["upper","lower","false"],"caseFirst"),this.ignorePunctuation=dr(m,"boolean","ignorePunctuation"),this.chooseAddressMappingPolicy=null!=i?i:Ui.defaultConfig.chooseAddressMappingPolicy,this.dateFormats=[...pr(l,Array.isArray,"array","dateFormats")],this.timeFormats=[...pr(O,Array.isArray,"array","timeFormats")],this.functionArgSeparator=dr(c,"string","functionArgSeparator"),this.decimalSeparator=dr(u,[".",","],"decimalSeparator"),this.language=dr(g,"string","language"),this.ignoreWhiteSpace=dr(y,["standard","any"],"ignoreWhiteSpace"),this.licenseKey=dr(w,"string","licenseKey"),this.thousandSeparator=dr(I,["",","," ","."],"thousandSeparator"),this.arrayColumnSeparator=dr(_,[",",";"],"arrayColumnSeparator"),this.arrayRowSeparator=dr(b,[";","|"],"arrayRowSeparator"),this.localeLang=dr(f,"string","localeLang"),this.functionPlugins=[...null!=d?d:Ui.defaultConfig.functionPlugins],this.smartRounding=dr(x,"boolean","smartRounding"),this.evaluateNullToZero=dr(h,"boolean","evaluateNullToZero"),this.nullYear=dr(E,"number","nullYear"),mr(this.nullYear,"nullYear",0),function(e){if(e>100)throw new Rt("nullYear",100)}(this.nullYear),this.precisionRounding=dr(A,"number","precisionRounding"),mr(this.precisionRounding,"precisionRounding",0),this.precisionEpsilon=dr(R,"number","precisionEpsilon"),mr(this.precisionEpsilon,"precisionEpsilon",0),this.useColumnIndex=dr(H,"boolean","useColumnIndex"),this.useStats=dr(D,"boolean","useStats"),this.parseDateTime=dr(T,"function","parseDateTime"),this.stringifyDateTime=dr(N,"function","stringifyDateTime"),this.stringifyDuration=dr(L,"function","stringifyDuration"),this.translationPackage=Yi.getLanguage(this.language),this.errorMapping=this.translationPackage.buildErrorMapping(),this.nullDate=pr(M,Ar,"IDate","nullDate"),this.leapYear1900=dr(p,"boolean","leapYear1900"),this.undoLimit=dr(P,"number","undoLimit"),this.useRegularExpressions=dr(F,"boolean","useRegularExpressions"),this.useWildcards=dr(Y,"boolean","useWildcards"),this.matchWholeCell=dr(v,"boolean","matchWholeCell"),mr(this.undoLimit,"undoLimit",0),this.maxRows=dr(S,"number","maxRows"),mr(this.maxRows,"maxRows",1),this.maxColumns=dr(C,"number","maxColumns"),this.currencySymbol=this.setupCurrencySymbol(a),mr(this.maxColumns,"maxColumns",1),this.context=s,Vi.set(this,{licenseKeyValidityState:ro(this.licenseKey)}),fr({value:this.decimalSeparator,name:"decimalSeparator"},{value:this.functionArgSeparator,name:"functionArgSeparator"},{value:this.thousandSeparator,name:"thousandSeparator"}),fr({value:this.arrayRowSeparator,name:"arrayRowSeparator"},{value:this.arrayColumnSeparator,name:"arrayColumnSeparator"})}setupCurrencySymbol(e){const t=[...pr(e,Array.isArray,"array","currencySymbol")];return t.forEach((e=>{if("string"!=typeof e)throw new Et("string[]","currencySymbol");if(""===e)throw new Mt("currencySymbol")})),t}get licenseKeyValidityState(){return Vi.get(this).licenseKeyValidityState}getConfig(){return Bi(this)}mergeConfig(e){const t=Object.assign({},this.getConfig(),e);return Ui.warnDeprecatedOptions(e),new Ui(t,!1)}static warnDeprecatedOptions(e){}static warnDeprecatedIfUsed(e,t,n,r){void 0!==e&&(void 0===r?console.warn(`${t} option is deprecated since ${n}`):console.warn(`${t} option is deprecated since ${n}, please use ${r}`))}}function Bi(e){var t;const n={};for(const r in Ui.defaultConfig){const o=null!==(t=e[r])&&void 0!==t?t:Ui.defaultConfig[r];Array.isArray(o)?n[r]=[...o]:n[r]=o}return n}Ui.defaultConfig={accentSensitive:!1,currencySymbol:["$"],caseSensitive:!1,caseFirst:"lower",context:void 0,chooseAddressMappingPolicy:new class{call(){return wn}},dateFormats:["DD/MM/YYYY","DD/MM/YY"],decimalSeparator:".",evaluateNullToZero:!1,functionArgSeparator:",",functionPlugins:[],ignorePunctuation:!1,language:"enGB",ignoreWhiteSpace:"standard",licenseKey:"",leapYear1900:!1,localeLang:"en",matchWholeCell:!0,arrayColumnSeparator:",",arrayRowSeparator:";",maxRows:4e4,maxColumns:18278,nullYear:30,nullDate:{year:1899,month:12,day:30},parseDateTime:function(e,t,n){if(void 0===t&&void 0===n)return;let r=e.replace(vr," ").trim().toLowerCase();if(!function(e){return wr.test(e)}(r))return;let o=r.substring(r.length-2);"am"===o||"pm"===o?r=r.substring(0,r.length-2).trim():(o=r.substring(r.length-1),"a"===o||"p"===o?r=r.substring(0,r.length-1).trim():o=void 0);const i=r.split(_r);i.length>=2&&i[i.length-2].includes(":")&&(i[i.length-2]=i[i.length-2]+"."+i[i.length-1],i.pop());const s=i[i.length-1].split(":");if(void 0!==o&&s.push(o),1===i.length)return Cr(s,n);if(1===s.length)return Er(i,t);const a=Er(i.slice(0,i.length-1),t),l=Cr(s,n);return void 0===a||void 0===l?void 0:Object.assign(Object.assign({},a),l)},precisionEpsilon:1e-13,precisionRounding:10,smartRounding:!0,stringifyDateTime:function(e,t){const n=Wr(t);if(void 0===n)return;const r=n.tokens;let o="",i=!1;const s=r.some((e=>e.type===Yr.FORMAT&&("a/p"===e.value||"A/P"===e.value||"am/pm"===e.value||"AM/PM"===e.value)));for(let t=0;t{const i=this.verifyAddressArguments(e,t,n,r);if(void 0!==i)return i;const s=I(t-1);let a="";null!=o&&(a=`${o}!`);const l=0==t?"C":`C[${t}]`,u=0==e?"R":`R[${e}]`;return ji.FullyRelative==n?r?`${a}${s}${e}`:`${a}${u}${l}`:ji.RowRelativeColAbsolute==n?r?`${a}$${s}${e}`:`${a}${u}C${t}`:ji.RowAbsoluteColRelative==n?r?`${a}${s}$${e}`:`${a}R${e}${l}`:r?`${a}$${s}$${e}`:`${a}R${e}C${t}`}))}}zi.implementedFunctions={ADDRESS:{method:"address",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,optionalArg:!0,defaultValue:1,minValue:1,maxValue:4},{argumentType:ar.BOOLEAN,optionalArg:!0,defaultValue:!0},{argumentType:ar.STRING,optionalArg:!0}]}};class Gi extends lr{arrayformula(e,t){return this.runFunction(e.args,t,this.metadata("ARRAYFORMULA"),(e=>e))}arrayformulaArraySize(e,t){if(1!==e.args.length)return ur.error();const n=this.metadata("ARRAYFORMULA");return e.args.map((e=>{var r;return this.arraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}))[0]}arrayconstrain(e,t){return this.runFunction(e.args,t,this.metadata("ARRAY_CONSTRAIN"),((e,t,n)=>{t=Math.min(t,e.height()),n=Math.min(n,e.width());const r=e.data,o=[];for(let e=0;e{var r;return this.arraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}));let{height:o,width:i}=r[0];return e.args[1].type===Y.NUMBER&&(o=Math.min(o,e.args[1].value)),e.args[2].type===Y.NUMBER&&(i=Math.min(i,e.args[2].value)),o<1||i<1||!Number.isInteger(o)||!Number.isInteger(i)?ur.error():new ur(i,o)}filter(e,t){return this.runFunction(e.args,t,this.metadata("FILTER"),((e,...t)=>{for(const n of t)if(e.width()!==n.width()||e.height()!==n.height())return new Cn(sn.NA,J.EqualLength);if(e.width()>1&&e.height()>1)return new Cn(sn.NA,J.WrongDimension);const n=e.data,r=[];for(let o=0;o0&&r.push(i)}return r.length>0?nt.onlyValues(r):new Cn(sn.NA,J.EmptyRange)}))}filterArraySize(e,t){if(e.args.length<=1)return ur.error();const n=this.metadata("FILTER"),r=e.args.map((e=>{var r;return this.arraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))})),o=Math.max(...r.map((e=>e.width))),i=Math.max(...r.map((e=>e.height)));return new ur(o,i)}}Gi.implementedFunctions={ARRAYFORMULA:{method:"arrayformula",arraySizeMethod:"arrayformulaArraySize",arrayFunction:!0,parameters:[{argumentType:ar.ANY}]},ARRAY_CONSTRAIN:{method:"arrayconstrain",arraySizeMethod:"arrayconstrainArraySize",parameters:[{argumentType:ar.RANGE},{argumentType:ar.INTEGER,minValue:1},{argumentType:ar.INTEGER,minValue:1}],vectorizationForbidden:!0},FILTER:{method:"filter",arraySizeMethod:"filterArraySize",arrayFunction:!0,parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}],repeatLastArgs:1}};class $i extends lr{abs(e,t){return this.runFunction(e.args,t,this.metadata("ABS"),Math.abs)}}$i.implementedFunctions={ABS:{method:"abs",parameters:[{argumentType:ar.NUMBER}]}};class Ki extends lr{bitlshift(e,t){return this.runFunction(e.args,t,this.metadata("BITLSHIFT"),Xi)}bitrshift(e,t){return this.runFunction(e.args,t,this.metadata("BITRSHIFT"),qi)}}function Xi(e,t){return t<0?qi(e,-t):Qi(e*Math.pow(2,t))}function qi(e,t){return t<0?Xi(e,-t):Qi(Math.floor(e/Math.pow(2,t)))}function Qi(e){return e>0xffffffffffff?new Cn(sn.NUM,J.BitshiftLong):e}Ki.implementedFunctions={BITLSHIFT:{method:"bitlshift",parameters:[{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:-53,maxValue:53}]},BITRSHIFT:{method:"bitrshift",parameters:[{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:-53,maxValue:53}]}};class Ji extends lr{bitand(e,t){return this.runFunction(e.args,t,this.metadata("BITAND"),((e,t)=>e&t))}bitor(e,t){return this.runFunction(e.args,t,this.metadata("BITOR"),((e,t)=>e|t))}bitxor(e,t){return this.runFunction(e.args,t,this.metadata("BITXOR"),((e,t)=>e^t))}}Ji.implementedFunctions={BITAND:{method:"bitand",parameters:[{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:0}]},BITOR:{method:"bitor",parameters:[{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:0}]},BITXOR:{method:"bitxor",parameters:[{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:0}]}};class Zi extends lr{literalTrue(e,t){return this.runFunction(e.args,t,this.metadata("TRUE"),(()=>!0))}literalFalse(e,t){return this.runFunction(e.args,t,this.metadata("FALSE"),(()=>!1))}conditionalIf(e,t){return this.runFunction(e.args,t,this.metadata("IF"),((e,t,n)=>e?t:n))}ifs(e,t){return this.runFunction(e.args,t,this.metadata("IFS"),((...e)=>{for(let t=0;te.filter((e=>void 0!==e)).every((e=>!!e))))}or(e,t){return this.runFunction(e.args,t,this.metadata("OR"),((...e)=>e.filter((e=>void 0!==e)).some((e=>e))))}not(e,t){return this.runFunction(e.args,t,this.metadata("NOT"),(e=>!e))}xor(e,t){return this.runFunction(e.args,t,this.metadata("XOR"),((...e)=>{let t=0;return e.filter((e=>void 0!==e)).forEach((e=>{e&&t++})),t%2==1}))}switch(e,t){return this.runFunction(e.args,t,this.metadata("SWITCH"),((e,...t)=>{const n=t.length;let r=0;for(;r+1e instanceof Cn?t:e))}ifna(e,t){return this.runFunction(e.args,t,this.metadata("IFNA"),((e,t)=>e instanceof Cn&&e.type===sn.NA?t:e))}choose(e,t){return this.runFunction(e.args,t,this.metadata("CHOOSE"),((e,...t)=>e>t.length?new Cn(sn.NUM,J.Selector):t[e-1]))}}Zi.implementedFunctions={TRUE:{method:"literalTrue",parameters:[]},FALSE:{method:"literalFalse",parameters:[]},IF:{method:"conditionalIf",parameters:[{argumentType:ar.BOOLEAN},{argumentType:ar.SCALAR,passSubtype:!0},{argumentType:ar.SCALAR,defaultValue:!1,passSubtype:!0}]},IFS:{method:"ifs",parameters:[{argumentType:ar.BOOLEAN},{argumentType:ar.SCALAR,passSubtype:!0}],repeatLastArgs:2},AND:{method:"and",parameters:[{argumentType:ar.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},OR:{method:"or",parameters:[{argumentType:ar.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},XOR:{method:"xor",parameters:[{argumentType:ar.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},NOT:{method:"not",parameters:[{argumentType:ar.BOOLEAN}]},SWITCH:{method:"switch",parameters:[{argumentType:ar.NOERROR},{argumentType:ar.SCALAR,passSubtype:!0},{argumentType:ar.SCALAR,passSubtype:!0}],repeatLastArgs:1},IFERROR:{method:"iferror",parameters:[{argumentType:ar.SCALAR,passSubtype:!0},{argumentType:ar.SCALAR,passSubtype:!0}]},IFNA:{method:"ifna",parameters:[{argumentType:ar.SCALAR,passSubtype:!0},{argumentType:ar.SCALAR,passSubtype:!0}]},CHOOSE:{method:"choose",parameters:[{argumentType:ar.INTEGER,minValue:1},{argumentType:ar.SCALAR,passSubtype:!0}],repeatLastArgs:1}};class es extends lr{char(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),(e=>e<1||e>=256?new Cn(sn.VALUE,J.CharacterCodeBounds):String.fromCharCode(Math.trunc(e))))}unichar(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),(e=>e<1||e>=1114112?new Cn(sn.VALUE,J.CharacterCodeBounds):String.fromCodePoint(Math.trunc(e))))}}es.implementedFunctions={CHAR:{method:"char",parameters:[{argumentType:ar.NUMBER}]},UNICHAR:{method:"unichar",parameters:[{argumentType:ar.NUMBER}]}};class ts extends lr{code(e,t){return this.runFunction(e.args,t,this.metadata("CODE"),(e=>0===e.length?new Cn(sn.VALUE,J.EmptyString):e.charCodeAt(0)))}unicode(e,t){return this.runFunction(e.args,t,this.metadata("UNICODE"),(e=>{var t;return null!==(t=e.codePointAt(0))&&void 0!==t?t:new Cn(sn.VALUE,J.EmptyString)}))}}ts.implementedFunctions={CODE:{method:"code",parameters:[{argumentType:ar.STRING}]},UNICODE:{method:"unicode",parameters:[{argumentType:ar.STRING}]}};class ns extends lr{countblank(e,t){return this.runFunction(e.args,t,this.metadata("COUNTBLANK"),((...e)=>{let t=0;return e.forEach((e=>{e===We&&t++})),t}))}}ns.implementedFunctions={COUNTBLANK:{method:"countblank",parameters:[{argumentType:ar.SCALAR}],repeatLastArgs:1,expandRanges:!0}};class rs extends lr{countunique(e,t){return this.runFunction(e.args,t,this.metadata("COUNTUNIQUE"),((...e)=>{const t=new Set,n=new Set;for(const r of e)r instanceof Cn?n.add(r.type):""!==r&&t.add(r);return t.size+n.size}))}}rs.implementedFunctions={COUNTUNIQUE:{method:"countunique",parameters:[{argumentType:ar.SCALAR}],repeatLastArgs:1,expandRanges:!0}};class os extends lr{constructor(){super(...arguments),this.isoweeknumCore=e=>{const t=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),n=this.dateTimeHelper.numberToSimpleDate(e),r=this.dateTimeHelper.dateToNumber({year:n.year,month:1,day:1}),o=this.dateTimeHelper.relativeNumberToAbsoluteNumber(r),i=o+((4-o)%7+7)%7,s=Math.floor((t-1)/7)-Math.floor((i-1)/7)+1;return 0===s?this.isoweeknumCore(e-7)+1:s},this.days360Core=(e,t,n)=>{const r=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);let i,s;return n?(i=Pr(r),s=Pr(o)):[i,s]=this.dateTimeHelper.toBasisUS(r,o),360*(s.year-i.year)+30*(s.month-i.month)+s.day-i.day}}date(e,t){return this.runFunction(e.args,t,this.metadata("DATE"),((e,t,n)=>{const r=Math.trunc(n);let o=Math.trunc(t),i=Math.trunc(e);i{const r=Dr({hours:Math.trunc(e),minutes:Math.trunc(t),seconds:Math.trunc(n)});return r<0?new Cn(sn.NUM,J.NegativeTime):r%1}))}eomonth(e,t){return this.runFunction(e.args,t,this.metadata("EOMONTH"),((e,t)=>{const n=this.dateTimeHelper.numberToSimpleDate(e);let r=this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth(Or(n,t)));return r=this.dateTimeHelper.getWithinBounds(r),void 0===r?new Cn(sn.NUM,J.DateBounds):r}))}day(e,t){return this.runFunction(e.args,t,this.metadata("DAY"),(e=>this.dateTimeHelper.numberToSimpleDate(e).day))}days(e,t){return this.runFunction(e.args,t,this.metadata("DAYS"),((e,t)=>Math.trunc(e)-Math.trunc(t)))}month(e,t){return this.runFunction(e.args,t,this.metadata("MONTH"),(e=>this.dateTimeHelper.numberToSimpleDate(e).month))}year(e,t){return this.runFunction(e.args,t,this.metadata("YEAR"),(e=>this.dateTimeHelper.numberToSimpleDate(e).year))}hour(e,t){return this.runFunction(e.args,t,this.metadata("HOUR"),(e=>kr(Ir(e)%1).hours))}minute(e,t){return this.runFunction(e.args,t,this.metadata("MINUTE"),(e=>kr(Ir(e)%1).minutes))}second(e,t){return this.runFunction(e.args,t,this.metadata("SECOND"),(e=>kr(Ir(e)%1).seconds))}text(e,t){return this.runFunction(e.args,t,this.metadata("TEXT"),((e,t)=>zr(e,t,this.config,this.dateTimeHelper)))}weekday(e,t){return this.runFunction(e.args,t,this.metadata("WEEKDAY"),((e,t)=>{const n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));if(3===t)return(n-1)%7;const r=as.get(t);return void 0===r?new Cn(sn.NUM,J.BadMode):(n-r)%7+1}))}weeknum(e,t){return this.runFunction(e.args,t,this.metadata("WEEKNUM"),((e,t)=>{const n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),r=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.dateToNumber({year:r.year,month:1,day:1}),i=this.dateTimeHelper.relativeNumberToAbsoluteNumber(o);if(21===t)return this.isoweeknumCore(e);const s=as.get(t);return void 0===s?new Cn(sn.NUM,J.BadMode):Math.floor((n-s)/7)-Math.floor((i-s)/7)+1}))}isoweeknum(e,t){return this.runFunction(e.args,t,this.metadata("ISOWEEKNUM"),this.isoweeknumCore)}datevalue(e,t){return this.runFunction(e.args,t,this.metadata("DATEVALUE"),(e=>{const{dateTime:t}=this.dateTimeHelper.parseDateTimeFromConfigFormats(e);return void 0===t?new Cn(sn.VALUE,J.IncorrectDateTime):Ar(t)?(Nr(t)?Math.trunc(Dr(t)):0)+this.dateTimeHelper.dateToNumber(t):0}))}timevalue(e,t){return this.runFunction(e.args,t,this.metadata("TIMEVALUE"),(e=>{const t=this.dateTimeHelper.dateStringToDateNumber(e);return void 0===t?new Cn(sn.VALUE,J.IncorrectDateTime):je(t)%1}))}now(e,t){return this.runFunction(e.args,t,this.metadata("NOW"),(()=>{const e=new Date(Date.now());return Dr({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()})+this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})}))}today(e,t){return this.runFunction(e.args,t,this.metadata("TODAY"),(()=>{const e=new Date(Date.now());return this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})}))}edate(e,t){return this.runFunction(e.args,t,this.metadata("EDATE"),((e,t)=>{const n={year:(r=Or(this.dateTimeHelper.numberToSimpleDate(e),t)).year,month:r.month,day:Math.min(r.day,Tr[r.month-1])};var r;let o=this.dateTimeHelper.dateToNumber(n);return o=this.dateTimeHelper.getWithinBounds(o),void 0===o?new Cn(sn.NUM,J.DateBounds):o}))}datedif(e,t){return this.runFunction(e.args,t,this.metadata("DATEDIF"),((e,t,n)=>{if(e>t)return new Cn(sn.NUM,J.StartEndDate);if("D"===n)return Math.floor(t)-Math.floor(e);const r=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);switch(n){case"M":return 12*(o.year-r.year)+(o.month-r.month)-(o.dayr.month||o.month===r.month&&o.day>=r.day?o.year-r.year:o.year-r.year-1;case"MD":if(o.day>=r.day)return o.day-r.day;{const e=1===o.month?12:o.month-1,t=1===o.month?o.year-1:o.year;return this.dateTimeHelper.daysInMonth(t,e)+o.day-r.day}case"YD":return o.month>r.month||o.month===r.month&&o.day>=r.day?Math.floor(t)-this.dateTimeHelper.dateToNumber({year:o.year,month:r.month,day:r.day}):Math.floor(t)-Math.floor(e)-365*(o.year-r.year-1)-this.dateTimeHelper.leapYearsCount(o.year-1)+this.dateTimeHelper.leapYearsCount(r.year);default:return new Cn(sn.NUM,J.BadMode)}}))}days360(e,t){return this.runFunction(e.args,t,this.metadata("DAYS360"),this.days360Core)}yearfrac(e,t){return this.runFunction(e.args,t,this.metadata("YEARFRAC"),((e,t,n)=>{switch((e=Math.trunc(e))>(t=Math.trunc(t))&&([e,t]=[t,e]),n){case 0:return this.days360Core(e,t,!1)/360;case 1:return(t-e)/this.dateTimeHelper.yearLengthForBasis(this.dateTimeHelper.numberToSimpleDate(e),this.dateTimeHelper.numberToSimpleDate(t));case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return this.days360Core(e,t,!0)/360}throw new Error("Should not be reachable.")}))}interval(e,t){return this.runFunction(e.args,t,this.metadata("INTERVAL"),(e=>{const t=(e=Math.trunc(e))%60,n=(e=Math.trunc(e/60))%60,r=(e=Math.trunc(e/60))%24,o=(e=Math.trunc(e/24))%30,i=(e=Math.trunc(e/30))%12,s=Math.trunc(e/12);return"P"+(s>0?`${s}Y`:"")+(i>0?`${i}M`:"")+(o>0?`${o}D`:"")+"T"+(r>0?`${r}H`:"")+(n>0?`${n}M`:"")+(t>0?`${t}S`:"")}))}networkdays(e,t){return this.runFunction(e.args,t,this.metadata("NETWORKDAYS"),((e,t,n)=>this.networkdayscore(e,t,1,n)))}networkdaysintl(e,t){return this.runFunction(e.args,t,this.metadata("NETWORKDAYS.INTL"),((e,t,n,r)=>this.networkdayscore(e,t,n,r)))}workday(e,t){return this.runFunction(e.args,t,this.metadata("WORKDAY"),((e,t,n)=>this.workdaycore(e,t,1,n)))}workdayintl(e,t){return this.runFunction(e.args,t,this.metadata("WORKDAY.INTL"),((e,t,n,r)=>this.workdaycore(e,t,n,r)))}networkdayscore(e,t,n,r){let o=1;(e=Math.trunc(e))>(t=Math.trunc(t))&&([e,t]=[t,e],o=-1);const i=ss(n);if(i instanceof Cn)return i;const s=this.simpleRangeToFilteredHolidays(i,r);return s instanceof Cn?s:o*this.countWorkdays(e,t,i,s)}workdaycore(e,t,n,r){e=Math.trunc(e),t=Math.trunc(t);const o=ss(n);if(o instanceof Cn)return o;const i=this.simpleRangeToFilteredHolidays(o,r);if(i instanceof Cn)return i;if(t>0){let n=1;for(;this.countWorkdays(e+1,e+n,o,i)e-t)).filter((t=>{const n=(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)-1)%7;return"0"===e.charAt(n)}))}}function is(e,t){if(0===t.length)return 0;if(e<=t[0])return 0;if(t[t.length-1]=e?r=o:n=o}return r}function ss(e){var t;return"number"!=typeof e&&"string"!=typeof e?new Cn(sn.VALUE,J.WrongType):"string"==typeof e?7===e.length&&/^(0|1)*$/.test(e)&&"1111111"!==e?e:new Cn(sn.NUM,J.WeekendString):null!==(t=ls.get(e))&&void 0!==t?t:new Cn(sn.NUM,J.BadMode)}os.implementedFunctions={DATE:{method:"date",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_DATE},TIME:{method:"time",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_TIME},MONTH:{method:"month",parameters:[{argumentType:ar.NUMBER,minValue:0}]},YEAR:{method:"year",parameters:[{argumentType:ar.NUMBER,minValue:0}]},HOUR:{method:"hour",parameters:[{argumentType:ar.NUMBER,minValue:0}]},MINUTE:{method:"minute",parameters:[{argumentType:ar.NUMBER,minValue:0}]},SECOND:{method:"second",parameters:[{argumentType:ar.NUMBER,minValue:0}]},TEXT:{method:"text",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.STRING}]},EOMONTH:{method:"eomonth",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_DATE},DAY:{method:"day",parameters:[{argumentType:ar.NUMBER,minValue:0}]},DAYS:{method:"days",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0}]},WEEKDAY:{method:"weekday",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,defaultValue:1}]},WEEKNUM:{method:"weeknum",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,defaultValue:1}]},ISOWEEKNUM:{method:"isoweeknum",parameters:[{argumentType:ar.NUMBER,minValue:0}]},DATEVALUE:{method:"datevalue",parameters:[{argumentType:ar.STRING}],returnNumberType:Ze.NUMBER_DATE},TIMEVALUE:{method:"timevalue",parameters:[{argumentType:ar.STRING}],returnNumberType:Ze.NUMBER_TIME},NOW:{method:"now",parameters:[],isVolatile:!0,returnNumberType:Ze.NUMBER_DATETIME},TODAY:{method:"today",parameters:[],isVolatile:!0,returnNumberType:Ze.NUMBER_DATE},EDATE:{method:"edate",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_DATE},DAYS360:{method:"days360",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.BOOLEAN,defaultValue:!1}]},DATEDIF:{method:"datedif",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.STRING}]},YEARFRAC:{method:"yearfrac",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.INTEGER,defaultValue:0,minValue:0,maxValue:4}]},INTERVAL:{method:"interval",parameters:[{argumentType:ar.NUMBER,minValue:0}]},NETWORKDAYS:{method:"networkdays",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.RANGE,optionalArg:!0}]},"NETWORKDAYS.INTL":{method:"networkdaysintl",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NOERROR,defaultValue:1},{argumentType:ar.RANGE,optionalArg:!0}]},WORKDAY:{method:"workday",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER},{argumentType:ar.RANGE,optionalArg:!0}]},"WORKDAY.INTL":{method:"workdayintl",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER},{argumentType:ar.NOERROR,defaultValue:1},{argumentType:ar.RANGE,optionalArg:!0}]}};const as=new Map([[1,0],[2,1],[11,1],[12,2],[13,3],[14,4],[15,5],[16,6],[17,0]]),ls=new Map([[1,"0000011"],[2,"1000001"],[3,"1100000"],[4,"0110000"],[5,"0011000"],[6,"0001100"],[7,"0000110"],[11,"0000001"],[12,"1000000"],[13,"0100000"],[14,"0010000"],[15,"0001000"],[16,"0000100"],[17,"0000010"]]);class us extends lr{degrees(e,t){return this.runFunction(e.args,t,this.metadata("DEGREES"),(e=>e*(180/Math.PI)))}}us.implementedFunctions={DEGREES:{method:"degrees",parameters:[{argumentType:ar.NUMBER}]}};class hs extends lr{delta(e,t){return this.runFunction(e.args,t,this.metadata("DELTA"),((e,t)=>e===t?1:0))}}hs.implementedFunctions={DELTA:{method:"delta",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0}]}};class cs extends lr{exp(e,t){return this.runFunction(e.args,t,this.metadata("EXP"),Math.exp)}}cs.implementedFunctions={EXP:{method:"exp",parameters:[{argumentType:ar.NUMBER}]}};class ds extends lr{pmt(e,t){return this.runFunction(e.args,t,this.metadata("PMT"),ms)}ipmt(e,t){return this.runFunction(e.args,t,this.metadata("IPMT"),ps)}ppmt(e,t){return this.runFunction(e.args,t,this.metadata("PPMT"),gs)}fv(e,t){return this.runFunction(e.args,t,this.metadata("FV"),fs)}cumipmt(e,t){return this.runFunction(e.args,t,this.metadata("CUMIPMT"),((e,t,n,r,o,i)=>{if(r>o)return new Cn(sn.NUM,J.EndStartPeriod);let s=0;for(let a=r;a<=o;a++)s+=ps(e,a,t,n,0,i);return s}))}cumprinc(e,t){return this.runFunction(e.args,t,this.metadata("CUMPRINC"),((e,t,n,r,o,i)=>{if(r>o)return new Cn(sn.NUM,J.EndStartPeriod);let s=0;for(let a=r;a<=o;a++)s+=gs(e,a,t,n,0,i);return s}))}db(e,t){return this.runFunction(e.args,t,this.metadata("DB"),((e,t,n,r,o)=>{if(12===o&&r>n||r>n+1)return new Cn(sn.NUM,J.PeriodLong);if(t>=e)return 0;const i=Math.round(1e3*(1-Math.pow(t/e,1/n)))/1e3,s=e*i*o/12;if(1===r)return s;let a=s;for(let t=0;t{if(r>n)return new Cn(sn.NUM);let i,s=o/n;s>=1?(s=1,i=1===r?e:0):i=e*Math.pow(1-s,r-1);const a=e*Math.pow(1-s,r);return Math.max(i-Math.max(t,a),0)}))}dollarde(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARDE"),((e,t)=>{if(t<1)return new Cn(sn.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+10*(e-Math.trunc(e))/t}))}dollarfr(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARFR"),((e,t)=>{if(t<1)return new Cn(sn.DIV_BY_ZERO);for(t=Math.trunc(t);t>10;)t/=10;return Math.trunc(e)+(e-Math.trunc(e))*t/10}))}effect(e,t){return this.runFunction(e.args,t,this.metadata("EFFECT"),((e,t)=>(t=Math.trunc(t),Math.pow(1+e/t,t)-1)))}ispmt(e,t){return this.runFunction(e.args,t,this.metadata("ISPMT"),((e,t,n,r)=>0===n?new Cn(sn.DIV_BY_ZERO):r*e*(t/n-1)))}nominal(e,t){return this.runFunction(e.args,t,this.metadata("NOMINAL"),((e,t)=>(t=Math.trunc(t),(Math.pow(e+1,1/t)-1)*t)))}nper(e,t){return this.runFunction(e.args,t,this.metadata("NPER"),((e,t,n,r,o)=>0===e?0===t?new Cn(sn.DIV_BY_ZERO):(-n-r)/t:(o&&(t*=1+e),Math.log((t-r*e)/(n*e+t))/Math.log(1+e))))}rate(e,t){return this.runFunction(e.args,t,this.metadata("RATE"),((e,t,n,r,o,i)=>{if(i<=-1)return new Cn(sn.VALUE);const s=1e-7;let a=i;o=o?1:0;for(let i=0;i<50;i++){if(a<=-1)return new Cn(sn.NUM);let i,l;if(Math.abs(a)(o=o?1:0,-1===e?new Cn(0===t?sn.NUM:sn.DIV_BY_ZERO):0===e?-n*t-r:((1-Math.pow(1+e,t))*n*(1+e*o)/e-r)/Math.pow(1+e,t))))}rri(e,t){return this.runFunction(e.args,t,this.metadata("RRI"),((e,t,n)=>0===t||n<0&&t>0||n>0&&t<0?new Cn(sn.NUM):Math.pow(n/t,1/e)-1))}sln(e,t){return this.runFunction(e.args,t,this.metadata("SLN"),((e,t,n)=>0===n?new Cn(sn.DIV_BY_ZERO):(e-t)/n))}syd(e,t){return this.runFunction(e.args,t,this.metadata("SYD"),((e,t,n,r)=>r>n?new Cn(sn.NUM):(e-t)*(n-r+1)*2/(n*(n+1))))}tbilleq(e,t){return this.runFunction(e.args,t,this.metadata("TBILLEQ"),((e,t,n)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new Cn(sn.NUM);const r=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);if(o.year>r.year+1||o.year===r.year+1&&(o.month>r.month||o.month===r.month&&o.day>r.day))return new Cn(sn.NUM);const i=360-n*(t-e);return 0===i?0:i<0?new Cn(sn.NUM):365*n/i}))}tbillprice(e,t){return this.runFunction(e.args,t,this.metadata("TBILLPRICE"),((e,t,n)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new Cn(sn.NUM);const r=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);if(o.year>r.year+1||o.year===r.year+1&&(o.month>r.month||o.month===r.month&&o.day>r.day))return new Cn(sn.NUM);const i=360-n*(t-e);return 0===i?0:i<0?new Cn(sn.NUM):100*(1-n*(t-e)/360)}))}tbillyield(e,t){return this.runFunction(e.args,t,this.metadata("TBILLYIELD"),((e,t,n)=>{if((e=Math.round(e))>=(t=Math.round(t)))return new Cn(sn.NUM);const r=this.dateTimeHelper.numberToSimpleDate(e),o=this.dateTimeHelper.numberToSimpleDate(t);return o.year>r.year+1||o.year===r.year+1&&(o.month>r.month||o.month===r.month&&o.day>r.day)?new Cn(sn.NUM):360*(100-n)/(n*(t-e))}))}fvschedule(e,t){return this.runFunction(e.args,t,this.metadata("FVSCHEDULE"),((e,t)=>{const n=t.valuesFromTopLeftCorner();for(const e of n)if(e instanceof Cn)return e;for(const t of n)if(Je(t))e*=1+je(t);else if(t!==We)return new Cn(sn.VALUE,J.NumberExpected);return e}))}npv(e,t){return this.runFunction(e.args,t,this.metadata("NPV"),((e,...t)=>{const n=this.arithmeticHelper.coerceNumbersExactRanges(t);return n instanceof Cn?n:ys(e,n)}))}mirr(e,t){return this.runFunction(e.args,t,this.metadata("MIRR"),((e,t,n)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(r instanceof Cn)return r;let o=!1,i=!1;const s=[],a=[];for(const e of r)e>0?(o=!0,s.push(e),a.push(0)):e<0?(i=!0,a.push(e),s.push(0)):(a.push(0),s.push(0));if(!o||!i)return new Cn(sn.DIV_BY_ZERO);const l=r.length,u=ys(n,s);if(u instanceof Cn)return u;const h=ys(t,a);return h instanceof Cn?h:Math.pow(-u*Math.pow(1+n,l)/h/(1+t),1/(l-1))-1}))}pduration(e,t){return this.runFunction(e.args,t,this.metadata("PDURATION"),((e,t,n)=>(Math.log(n)-Math.log(t))/Math.log(1+e)))}xnpv(e,t){return this.runFunction(e.args,t,this.metadata("XNPV"),((e,t,n)=>{const r=t.valuesFromTopLeftCorner();for(const e of r)if("number"!=typeof e)return new Cn(sn.VALUE,J.NumberExpected);const o=r,i=n.valuesFromTopLeftCorner();for(const e of i)if("number"!=typeof e)return new Cn(sn.VALUE,J.NumberExpected);const s=i;if(s.length!==o.length)return new Cn(sn.NUM,J.EqualLength);const a=s.length;let l=0;if(s[0]<0)return new Cn(sn.NUM,J.ValueSmall);for(let t=0;t=0;r--){if(n+=t[r],-1===e){if(0===n)continue;return new Cn(sn.DIV_BY_ZERO)}n/=1+e}return n}ds.implementedFunctions={PMT:{method:"pmt",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0}],returnNumberType:Ze.NUMBER_CURRENCY},IPMT:{method:"ipmt",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0}],returnNumberType:Ze.NUMBER_CURRENCY},PPMT:{method:"ppmt",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0}],returnNumberType:Ze.NUMBER_CURRENCY},FV:{method:"fv",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0}],returnNumberType:Ze.NUMBER_CURRENCY},CUMIPMT:{method:"cumipmt",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.INTEGER,minValue:1},{argumentType:ar.INTEGER,minValue:1},{argumentType:ar.INTEGER,minValue:0,maxValue:1}],returnNumberType:Ze.NUMBER_CURRENCY},CUMPRINC:{method:"cumprinc",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.INTEGER,minValue:1},{argumentType:ar.INTEGER,minValue:1},{argumentType:ar.INTEGER,minValue:0,maxValue:1}],returnNumberType:Ze.NUMBER_CURRENCY},DB:{method:"db",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.INTEGER,minValue:1,maxValue:12,defaultValue:12}],returnNumberType:Ze.NUMBER_CURRENCY},DDB:{method:"ddb",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.INTEGER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0,defaultValue:2}],returnNumberType:Ze.NUMBER_CURRENCY},DOLLARDE:{method:"dollarde",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:0}]},DOLLARFR:{method:"dollarfr",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:0}]},EFFECT:{method:"effect",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1}],returnNumberType:Ze.NUMBER_PERCENT},ISPMT:{method:"ispmt",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},NOMINAL:{method:"nominal",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1}],returnNumberType:Ze.NUMBER_PERCENT},NPER:{method:"nper",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0}]},PV:{method:"pv",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0}],returnNumberType:Ze.NUMBER_CURRENCY},RATE:{method:"rate",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:.1}],returnNumberType:Ze.NUMBER_PERCENT},RRI:{method:"rri",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_PERCENT},SLN:{method:"sln",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_CURRENCY},SYD:{method:"syd",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0}],returnNumberType:Ze.NUMBER_CURRENCY},TBILLEQ:{method:"tbilleq",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0}],returnNumberType:Ze.NUMBER_PERCENT},TBILLPRICE:{method:"tbillprice",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0}],returnNumberType:Ze.NUMBER_CURRENCY},TBILLYIELD:{method:"tbillyield",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0}],returnNumberType:Ze.NUMBER_PERCENT},FVSCHEDULE:{method:"fvschedule",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.RANGE}],returnNumberType:Ze.NUMBER_CURRENCY},NPV:{method:"npv",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.ANY}],repeatLastArgs:1,returnNumberType:Ze.NUMBER_CURRENCY},MIRR:{method:"mirr",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}],returnNumberType:Ze.NUMBER_PERCENT},PDURATION:{method:"pduration",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0}]},XNPV:{method:"xnpv",parameters:[{argumentType:ar.NUMBER,greaterThan:-1},{argumentType:ar.RANGE},{argumentType:ar.RANGE}]}};class ws extends lr{formulatext(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("FORMULATEXT"),(()=>new Cn(sn.NA,J.WrongArgNumber)),(e=>{var t;return null!==(t=this.serialization.getCellFormula(e))&&void 0!==t?t:new Cn(sn.NA,J.Formula)}))}}ws.implementedFunctions={FORMULATEXT:{method:"formulatext",parameters:[{argumentType:ar.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,isDependentOnSheetStructureChange:!0,vectorizationForbidden:!0}};class vs extends lr{hyperlink(e,t){return this.runFunction(e.args,t,this.metadata("HYPERLINK"),((t,n)=>(e.hyperlink=t,null!=n?n:t)))}}vs.implementedFunctions={HYPERLINK:{method:"hyperlink",parameters:[{argumentType:ar.STRING},{argumentType:ar.STRING,optionalArg:!0}]}};class _s extends lr{isbinary(e,t){return this.runFunction(e.args,t,this.metadata("ISBINARY"),(e=>/^[01]{1,10}$/.test(e)))}iserr(e,t){return this.runFunction(e.args,t,this.metadata("ISERR"),(e=>e instanceof Cn&&e.type!==sn.NA))}iserror(e,t){return this.runFunction(e.args,t,this.metadata("ISERROR"),(e=>e instanceof Cn))}isformula(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ISFORMULA"),(()=>new Cn(sn.NA,J.WrongArgNumber)),(e=>this.dependencyGraph.addressMapping.getCell(e)instanceof zt))}isblank(e,t){return this.runFunction(e.args,t,this.metadata("ISBLANK"),(e=>e===We))}isna(e,t){return this.runFunction(e.args,t,this.metadata("ISNA"),(e=>e instanceof Cn&&e.type==sn.NA))}isnumber(e,t){return this.runFunction(e.args,t,this.metadata("ISNUMBER"),Je)}islogical(e,t){return this.runFunction(e.args,t,this.metadata("ISLOGICAL"),(e=>"boolean"==typeof e))}isref(e,t){return this.runFunction(e.args,t,this.metadata("ISREF"),(e=>e instanceof Cn&&(e.type==sn.REF||e.type==sn.CYCLE)))}istext(e,t){return this.runFunction(e.args,t,this.metadata("ISTEXT"),(e=>"string"==typeof e))}isnontext(e,t){return this.runFunction(e.args,t,this.metadata("ISNONTEXT"),(e=>!("string"==typeof e)))}column(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("COLUMN"),(()=>t.formulaAddress.col+1),(e=>e.col+1))}columns(e,t){if(1!==e.args.length)return new Cn(sn.NA,J.WrongArgNumber);if(e.args.some((e=>e.type===Y.EMPTY)))return new Cn(sn.NUM,J.EmptyArg);let n=e.args[0];for(;n.type===Y.PARENTHESIS;)n=n.expression;if(n.type===Y.CELL_RANGE||n.type===Y.COLUMN_RANGE)return n.end.col-n.start.col+1;if(n.type===Y.CELL_REFERENCE)return 1;if(n.type===Y.ROW_RANGE)return this.config.maxColumns;{const e=this.evaluateAst(n,t);return e instanceof nt?e.width():e instanceof Cn?e:1}}row(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ROW"),(()=>t.formulaAddress.row+1),(e=>e.row+1))}rows(e,t){if(1!==e.args.length)return new Cn(sn.NA,J.WrongArgNumber);if(e.args.some((e=>e.type===Y.EMPTY)))return new Cn(sn.NUM,J.EmptyArg);let n=e.args[0];for(;n.type===Y.PARENTHESIS;)n=n.expression;if(n.type===Y.CELL_RANGE||n.type===Y.ROW_RANGE)return n.end.row-n.start.row+1;if(n.type===Y.CELL_REFERENCE)return 1;if(n.type===Y.COLUMN_RANGE)return this.config.maxRows;{const e=this.evaluateAst(n,t);return e instanceof nt?e.height():e instanceof Cn?e:1}}index(e,t){return this.runFunction(e.args,t,this.metadata("INDEX"),((e,t,n)=>{var r,o,i,s,a,l;return n<1||t<1?new Cn(sn.VALUE,J.LessThanOne):n>e.width()||t>e.height()?new Cn(sn.NUM,J.ValueLarge):null!==(l=null!==(i=null===(o=null===(r=null==e?void 0:e.data)||void 0===r?void 0:r[t-1])||void 0===o?void 0:o[n-1])&&void 0!==i?i:null===(a=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s[0])||void 0===a?void 0:a[0])&&void 0!==l?l:new Cn(sn.VALUE,J.CellRangeExpected)}))}na(e,t){return new Cn(sn.NA)}sheet(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEET"),(()=>t.formulaAddress.sheet+1),(e=>e.sheet+1),(e=>{const t=this.dependencyGraph.sheetMapping.get(e);return void 0!==t?t+1:new Cn(sn.NA,J.SheetRef)}))}sheets(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEETS"),(()=>this.dependencyGraph.sheetMapping.numberOfSheets()),(()=>1),(()=>new Cn(sn.VALUE,J.CellRefExpected)))}}_s.implementedFunctions={COLUMN:{method:"column",parameters:[{argumentType:ar.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},COLUMNS:{method:"columns",parameters:[{argumentType:ar.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISBINARY:{method:"isbinary",parameters:[{argumentType:ar.STRING}]},ISERR:{method:"iserr",parameters:[{argumentType:ar.SCALAR}]},ISFORMULA:{method:"isformula",parameters:[{argumentType:ar.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISNA:{method:"isna",parameters:[{argumentType:ar.SCALAR}]},ISREF:{method:"isref",parameters:[{argumentType:ar.SCALAR}],vectorizationForbidden:!0},ISERROR:{method:"iserror",parameters:[{argumentType:ar.SCALAR}]},ISBLANK:{method:"isblank",parameters:[{argumentType:ar.SCALAR}]},ISNUMBER:{method:"isnumber",parameters:[{argumentType:ar.SCALAR}]},ISLOGICAL:{method:"islogical",parameters:[{argumentType:ar.SCALAR}]},ISTEXT:{method:"istext",parameters:[{argumentType:ar.SCALAR}]},ISNONTEXT:{method:"isnontext",parameters:[{argumentType:ar.SCALAR}]},INDEX:{method:"index",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:1}]},NA:{method:"na",parameters:[]},ROW:{method:"row",parameters:[{argumentType:ar.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ROWS:{method:"rows",parameters:[{argumentType:ar.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEET:{method:"sheet",parameters:[{argumentType:ar.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEETS:{method:"sheets",parameters:[{argumentType:ar.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0}};class bs extends lr{iseven(e,t){return this.runFunction(e.args,t,this.metadata("ISEVEN"),(e=>e%2==0))}}bs.implementedFunctions={ISEVEN:{method:"iseven",parameters:[{argumentType:ar.NUMBER}]}};class Ss extends lr{isodd(e,t){return this.runFunction(e.args,t,this.metadata("ISODD"),(e=>e%2==1))}}Ss.implementedFunctions={ISODD:{method:"isodd",parameters:[{argumentType:ar.NUMBER}]}};class Cs extends lr{log10(e,t){return this.runFunction(e.args,t,this.metadata("LOG10"),Math.log10)}log(e,t){return this.runFunction(e.args,t,this.metadata("LOG"),((e,t)=>Math.log(e)/Math.log(t)))}ln(e,t){return this.runFunction(e.args,t,this.metadata("LN"),Math.log)}}Cs.implementedFunctions={LOG10:{method:"log10",parameters:[{argumentType:ar.NUMBER}]},LOG:{method:"log",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,defaultValue:10,greaterThan:0}]},LN:{method:"ln",parameters:[{argumentType:ar.NUMBER}]}};const Es=parseFloat(Math.PI.toFixed(14));class Ms extends lr{pi(e,t){return this.runFunction(e.args,t,this.metadata("PI"),(()=>Es))}sqrtpi(e,t){return this.runFunction(e.args,t,this.metadata("SQRTPI"),(e=>Math.sqrt(Es*e)))}}function Ts(e,t){return new ur(t.width,e.height)}function Rs(e,t,n){return new ur(1+(e.width-t)/n,1+(e.height-t)/n)}Ms.implementedFunctions={PI:{method:"pi",parameters:[]},SQRTPI:{method:"sqrtpi",parameters:[{argumentType:ar.NUMBER,minValue:0}]}};class As extends lr{mmult(e,t){return this.runFunction(e.args,t,this.metadata("MMULT"),((e,t)=>{if(!e.hasOnlyNumbers()||!t.hasOnlyNumbers())return new Cn(sn.VALUE,J.NumberRange);if(t.height()!==e.width())return new Cn(sn.VALUE,J.ArrayDimensions);const n=Ts(e.size,t.size),r=this.createKernel((function(e,t,n){let r=0;for(let o=0;o{var r;return this.arraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))})),[o,i]=r;return Ts(o,i)}maxpool(e,t){return this.runFunction(e.args,t,this.metadata("MAXPOOL"),((e,t,n=t)=>{if(!e.hasOnlyNumbers())return new Cn(sn.VALUE,J.NumberRange);const r=Rs(e.size,t,n),o=this.createKernel((function(e,t,n){const r=this.thread.x*n,o=this.thread.y*n;let i=e[o][r];for(let n=0;n{if(!e.hasOnlyNumbers())return new Cn(sn.VALUE,J.NumberRange);const r=Rs(e.size,t,n),o=this.createKernel((function(e,t,n){const r=this.thread.x*n,o=this.thread.y*n;let i=e[o][r];for(let n=0;nn&&i++;if(t%2==0){if(i===a/2){h=n;break}i>a/2?l=n:u=n}else{if(i===(a-1)/2){h=n;break}i>(a-1)/2?l=n:u=n}}return h}),r)(e.rawNumbers(),t,n);return nt.onlyNumbers(o)}))}maxpoolArraySize(e,t){if(e.args.length<2||e.args.length>3)return ur.error();const n=this.metadata("MAXPOOL"),r=e.args.map((e=>{var r;return this.arraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}))[0],o=e.args[1];let i;i=o.type===Y.NUMBER?o.value:1;let s=i;if(3===e.args.length){const t=e.args[2];s=t.type===Y.NUMBER?t.value:1}return i>r.width||i>r.height||s>i||(r.width-i)%s!==0||(r.height-i)%s!==0?ur.error():Rs(r,i,s)}medianpoolArraySize(e,t){return this.maxpoolArraySize(e,t)}transpose(e,t){return this.runFunction(e.args,t,this.metadata("TRANSPOSE"),(e=>{const t=e.rawData(),n=e.size,r=[];for(let e=0;e{var r;return this.arraySizeForAst(e,new Vn(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))})),[o]=r;return new ur(o.height,o.width)}createKernel(e,t){return function(...n){const r=[];for(let o=0;o{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof Cn?t:0===t.length?new Cn(sn.NUM,J.OneValue):(t.sort(((e,t)=>e-t)),t.length%2==0?(t[t.length/2-1]+t[t.length/2])/2:t[Math.floor(t.length/2)])}))}large(e,t){return this.runFunction(e.args,t,this.metadata("LARGE"),((e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return n instanceof Cn?n:(n.sort(((e,t)=>e-t)),(t=Math.trunc(t))>n.length?new Cn(sn.NUM,J.ValueLarge):n[n.length-t])}))}small(e,t){return this.runFunction(e.args,t,this.metadata("SMALL"),((e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return n instanceof Cn?n:(n.sort(((e,t)=>e-t)),(t=Math.trunc(t))>n.length?new Cn(sn.NUM,J.ValueLarge):n[t-1])}))}}Ns.implementedFunctions={MEDIAN:{method:"median",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},LARGE:{method:"large",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NUMBER,minValue:1}]},SMALL:{method:"small",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NUMBER,minValue:1}]}};class Ls extends lr{mod(e,t){return this.runFunction(e.args,t,this.metadata("MOD"),((e,t)=>0===t?new Cn(sn.DIV_BY_ZERO):e%t))}}function xs(e){return Je(e)&&!Number.isFinite(je(e))?0:e}Ls.implementedFunctions={MOD:{method:"mod",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]}};class Os{constructor(e,t,n){this.sumsq=e,this.sum=t,this.count=n}static single(e){return new Os(e*e,e,1)}compose(e){return new Os(this.sumsq+e.sumsq,this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}varSValue(){return this.count>1?(this.sumsq-this.sum*this.sum/this.count)/(this.count-1):void 0}varPValue(){return this.count>0?(this.sumsq-this.sum*this.sum/this.count)/this.count:void 0}}Os.empty=new Os(0,0,0);class Is extends lr{constructor(){super(...arguments),this.addWithEpsilonRaw=(e,t)=>this.arithmeticHelper.addWithEpsilonRaw(e,t)}sum(e,t){return this.doSum(e.args,t)}sumsq(e,t){return this.reduce(e.args,t,0,"SUMSQ",this.addWithEpsilonRaw,(e=>Math.pow(je(e),2)),ks)}max(e,t){return this.doMax(e.args,t)}maxa(e,t){return xs(this.reduce(e.args,t,Number.NEGATIVE_INFINITY,"MAXA",((e,t)=>Math.max(e,t)),je,Ds))}min(e,t){return this.doMin(e.args,t)}mina(e,t){return xs(this.reduce(e.args,t,Number.POSITIVE_INFINITY,"MINA",((e,t)=>Math.min(e,t)),je,Ds))}count(e,t){return this.doCount(e.args,t)}counta(e,t){return this.doCounta(e.args,t)}average(e,t){return this.doAverage(e.args,t)}averagea(e,t){var n;const r=this.reduce(e.args,t,Os.empty,"_AGGREGATE_A",((e,t)=>e.compose(t)),(e=>Os.single(je(e))),Ds);return r instanceof Cn?r:null!==(n=r.averageValue())&&void 0!==n?n:new Cn(sn.DIV_BY_ZERO)}vars(e,t){return this.doVarS(e.args,t)}varp(e,t){return this.doVarP(e.args,t)}vara(e,t){var n;const r=this.reduceAggregateA(e.args,t);return r instanceof Cn?r:null!==(n=r.varSValue())&&void 0!==n?n:new Cn(sn.DIV_BY_ZERO)}varpa(e,t){var n;const r=this.reduceAggregateA(e.args,t);return r instanceof Cn?r:null!==(n=r.varPValue())&&void 0!==n?n:new Cn(sn.DIV_BY_ZERO)}stdevs(e,t){return this.doStdevS(e.args,t)}stdevp(e,t){return this.doStdevP(e.args,t)}stdeva(e,t){const n=this.reduceAggregateA(e.args,t);if(n instanceof Cn)return n;{const e=n.varSValue();return void 0===e?new Cn(sn.DIV_BY_ZERO):Math.sqrt(e)}}stdevpa(e,t){const n=this.reduceAggregateA(e.args,t);if(n instanceof Cn)return n;{const e=n.varPValue();return void 0===e?new Cn(sn.DIV_BY_ZERO):Math.sqrt(e)}}product(e,t){return this.doProduct(e.args,t)}subtotal(e,t){if(e.args.length<2)return new Cn(sn.NA,J.WrongArgNumber);const n=this.coerceToType(this.evaluateAst(e.args[0],t),{argumentType:ar.NUMBER},t),r=e.args.slice(1);switch(n){case 1:case 101:return this.doAverage(r,t);case 2:case 102:return this.doCount(r,t);case 3:case 103:return this.doCounta(r,t);case 4:case 104:return this.doMax(r,t);case 5:case 105:return this.doMin(r,t);case 6:case 106:return this.doProduct(r,t);case 7:case 107:return this.doStdevS(r,t);case 8:case 108:return this.doStdevP(r,t);case 9:case 109:return this.doSum(r,t);case 10:case 110:return this.doVarS(r,t);case 11:case 111:return this.doVarP(r,t);default:return new Cn(sn.VALUE,J.BadMode)}}reduceAggregate(e,t){return this.reduce(e,t,Os.empty,"_AGGREGATE",((e,t)=>e.compose(t)),(e=>Os.single(je(e))),ks)}reduceAggregateA(e,t){return this.reduce(e,t,Os.empty,"_AGGREGATE_A",((e,t)=>e.compose(t)),(e=>Os.single(je(e))),Ds)}doAverage(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof Cn?r:null!==(n=r.averageValue())&&void 0!==n?n:new Cn(sn.DIV_BY_ZERO)}doVarS(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof Cn?r:null!==(n=r.varSValue())&&void 0!==n?n:new Cn(sn.DIV_BY_ZERO)}doVarP(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof Cn?r:null!==(n=r.varPValue())&&void 0!==n?n:new Cn(sn.DIV_BY_ZERO)}doStdevS(e,t){const n=this.reduceAggregate(e,t);if(n instanceof Cn)return n;{const e=n.varSValue();return void 0===e?new Cn(sn.DIV_BY_ZERO):Math.sqrt(e)}}doStdevP(e,t){const n=this.reduceAggregate(e,t);if(n instanceof Cn)return n;{const e=n.varPValue();return void 0===e?new Cn(sn.DIV_BY_ZERO):Math.sqrt(e)}}doCount(e,t){return this.reduce(e,t,0,"COUNT",((e,t)=>e+t),je,(e=>Je(e)?1:0))}doCounta(e,t){return this.reduce(e,t,0,"COUNTA",((e,t)=>e+t),je,(e=>e===We?0:1))}doMax(e,t){return xs(this.reduce(e,t,Number.NEGATIVE_INFINITY,"MAX",((e,t)=>Math.max(e,t)),je,ks))}doMin(e,t){return xs(this.reduce(e,t,Number.POSITIVE_INFINITY,"MIN",((e,t)=>Math.min(e,t)),je,ks))}doSum(e,t){return this.reduce(e,t,0,"SUM",this.addWithEpsilonRaw,je,ks)}doProduct(e,t){return this.reduce(e,t,1,"PRODUCT",((e,t)=>e*t),je,ks)}reduce(e,t,n,r,o,i,s){return e.length<1?new Cn(sn.NA,J.WrongArgNumber):e.reduce(((e,a)=>{if(e instanceof Cn)return e;if(a.type===Y.CELL_RANGE||a.type===Y.COLUMN_RANGE||a.type===Y.ROW_RANGE){const l=this.evaluateRange(a,t,n,r,o,i,s);return l instanceof Cn?l:o(l,e)}let l;if(l=this.evaluateAst(a,t),l instanceof nt){const t=Array.from(l.valuesFromTopLeftCorner()).map(s).filter((e=>void 0!==e));return t.map((e=>e instanceof Cn?e:i(e))).reduce(((e,t)=>e instanceof Cn?e:t instanceof Cn?t:o(e,t)),e)}if(a.type===Y.CELL_REFERENCE){if(l=s(l),void 0===l)return e}else if(l=this.coerceScalarToNumberOrError(l),l=s(l),void 0===l)return e;return l instanceof Cn?l:o(e,i(l))}),n)}evaluateRange(e,t,n,r,o,i,s){let a;try{a=Hn.fromAst(e,t.formulaAddress)}catch(e){if(e instanceof ft)return new Cn(sn.REF,J.RangeManySheets);throw e}const l=this.dependencyGraph.getRange(a.start,a.end);if(void 0===l)throw new Error("Range does not exists in graph");let u=l.getFunctionValue(r);return void 0===u&&(u=this.getRangeValues(r,a,l,i,s).reduce(((e,t)=>e instanceof Cn?e:t instanceof Cn?t:o(e,t)),n),l.setFunctionValue(r,u)),u}getRangeValues(e,t,n,r,o){const i=[],{smallerRangeVertex:s,restRange:a}=this.dependencyGraph.rangeMapping.findSmallerRange(t);let l;if(void 0!==s&&this.dependencyGraph.existsEdge(s,n)){const t=s.getFunctionValue(e);if(void 0!==t)i.push(t);else for(const e of s.range.addresses(this.dependencyGraph)){const t=o(this.dependencyGraph.getScalarValue(e));t instanceof Cn?i.push(t):void 0!==t&&i.push(r(t))}l=a}else l=t;for(const e of l.addresses(this.dependencyGraph)){const t=o(this.dependencyGraph.getScalarValue(e));t instanceof Cn?i.push(t):void 0!==t&&i.push(r(t))}return i}}function ks(e){return Je(e)||e instanceof Cn?e:void 0}function Ds(e){return"boolean"==typeof e?zn(e):Je(e)||e instanceof Cn?e:"string"==typeof e?0:void 0}Is.implementedFunctions={SUM:{method:"sum",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},SUMSQ:{method:"sumsq",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},MAX:{method:"max",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},MIN:{method:"min",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},MAXA:{method:"maxa",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},MINA:{method:"mina",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},COUNT:{method:"count",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},COUNTA:{method:"counta",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},AVERAGE:{method:"average",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},AVERAGEA:{method:"averagea",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},PRODUCT:{method:"product",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},"VAR.S":{method:"vars",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},"VAR.P":{method:"varp",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},VARA:{method:"vara",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},VARPA:{method:"varpa",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},"STDEV.S":{method:"stdevs",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},"STDEV.P":{method:"stdevp",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},STDEVA:{method:"stdeva",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},STDEVPA:{method:"stdevpa",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},SUBTOTAL:{method:"subtotal",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.ANY}],repeatLastArgs:1}},Is.aliases={VAR:"VAR.S",VARP:"VAR.P",STDEV:"STDEV.S",STDEVP:"STDEV.P",VARS:"VAR.S",STDEVS:"STDEV.S"};class Ps extends lr{power(e,t){return this.runFunction(e.args,t,this.metadata("POWER"),Math.pow)}}Ps.implementedFunctions={POWER:{method:"power",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]}};class Hs extends lr{radians(e,t){return this.runFunction(e.args,t,this.metadata("RADIANS"),(e=>e*(Math.PI/180)))}}Hs.implementedFunctions={RADIANS:{method:"radians",parameters:[{argumentType:ar.NUMBER}]}};const Fs=10;class Ys extends lr{dec2bin(e,t){return this.runFunction(e.args,t,this.metadata("DEC2BIN"),((e,t)=>Us(e,2,t)))}dec2oct(e,t){return this.runFunction(e.args,t,this.metadata("DEC2OCT"),((e,t)=>Us(e,8,t)))}dec2hex(e,t){return this.runFunction(e.args,t,this.metadata("DEC2HEX"),((e,t)=>Us(e,16,t)))}bin2dec(e,t){return this.runFunction(e.args,t,this.metadata("BIN2DEC"),(e=>{const t=Vs(e,2,Fs);return void 0===t?new Cn(sn.NUM,J.NotBinary):zs(t,2)}))}bin2oct(e,t){return this.runFunction(e.args,t,this.metadata("BIN2OCT"),((e,t)=>{const n=Vs(e,2,Fs);return void 0===n?new Cn(sn.NUM,J.NotBinary):Us(zs(n,2),8,t)}))}bin2hex(e,t){return this.runFunction(e.args,t,this.metadata("BIN2HEX"),((e,t)=>{const n=Vs(e,2,Fs);return void 0===n?new Cn(sn.NUM,J.NotBinary):Us(zs(n,2),16,t)}))}oct2dec(e,t){return this.runFunction(e.args,t,this.metadata("OCT2DEC"),(e=>{const t=Vs(e,8,Fs);return void 0===t?new Cn(sn.NUM,J.NotOctal):zs(t,8)}))}oct2bin(e,t){return this.runFunction(e.args,t,this.metadata("OCT2BIN"),((e,t)=>{const n=Vs(e,8,Fs);return void 0===n?new Cn(sn.NUM,J.NotOctal):Us(zs(n,8),2,t)}))}oct2hex(e,t){return this.runFunction(e.args,t,this.metadata("OCT2HEX"),((e,t)=>{const n=Vs(e,8,Fs);return void 0===n?new Cn(sn.NUM,J.NotOctal):Us(zs(n,8),16,t)}))}hex2dec(e,t){return this.runFunction(e.args,t,this.metadata("HEX2DEC"),(e=>{const t=Vs(e,16,Fs);return void 0===t?new Cn(sn.NUM,J.NotHex):zs(t,16)}))}hex2bin(e,t){return this.runFunction(e.args,t,this.metadata("HEX2BIN"),((e,t)=>{const n=Vs(e,16,Fs);return void 0===n?new Cn(sn.NUM,J.NotHex):Us(zs(n,16),2,t)}))}hex2oct(e,t){return this.runFunction(e.args,t,this.metadata("HEX2OCT"),((e,t)=>{const n=Vs(e,16,Fs);return void 0===n?new Cn(sn.NUM,J.NotHex):Us(zs(n,16),8,t)}))}base(e,t){return this.runFunction(e.args,t,this.metadata("BASE"),Ws)}decimal(e,t){return this.runFunction(e.args,t,this.metadata("DECIMAL"),((e,t)=>{const n=Vs(e,t,255);return void 0===n?new Cn(sn.NUM,J.NotHex):parseInt(n,t)}))}}function Vs(e,t,n){const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".substr(0,t),o=new RegExp(`^[${r}]+$`);if(!(e.length>n)&&o.test(e))return e}function Us(e,t,n){if(e>function(e){return-Bs(e)-1}(t))return new Cn(sn.NUM,J.ValueBaseLarge);if(en?new Cn(sn.NUM,J.ValueBaseLong):Gr(r,n)}function Bs(e){return-Math.pow(e,Fs)/2}function Ws(e,t,n){const r=js(e,t);return void 0!==n&&n>r.length?Gr(r,n):r}function js(e,t){return(e+(e<0?Math.pow(t,Fs):0)).toString(t).toUpperCase()}function zs(e,t){const n=parseInt(e,t),r=Math.pow(t,Fs);return n>=r/2?n-r:n}Ys.implementedFunctions={DEC2BIN:{method:"dec2bin",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2OCT:{method:"dec2oct",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2HEX:{method:"dec2hex",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},BIN2DEC:{method:"bin2dec",parameters:[{argumentType:ar.STRING}]},BIN2OCT:{method:"bin2oct",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:Fs}]},BIN2HEX:{method:"bin2hex",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:Fs}]},OCT2DEC:{method:"oct2dec",parameters:[{argumentType:ar.STRING}]},OCT2BIN:{method:"oct2bin",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:Fs}]},OCT2HEX:{method:"oct2hex",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:Fs}]},HEX2DEC:{method:"hex2dec",parameters:[{argumentType:ar.STRING}]},HEX2BIN:{method:"hex2bin",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:Fs}]},HEX2OCT:{method:"hex2oct",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:Fs}]},DECIMAL:{method:"decimal",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,minValue:2,maxValue:36}]},BASE:{method:"base",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:2,maxValue:36},{argumentType:ar.NUMBER,optionalArg:!0,minValue:0,maxValue:255}]}};class Gs extends lr{rand(e,t){return this.runFunction(e.args,t,this.metadata("RAND"),Math.random)}randbetween(e,t){return this.runFunction(e.args,t,this.metadata("RANDBETWEEN"),((e,t)=>t{const n=Math.pow(10,t);return e<0?-Math.ceil(-e*n)/n:Math.ceil(e*n)/n}))}rounddown(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),((e,t)=>{const n=Math.pow(10,t);return e<0?-Math.floor(-e*n)/n:Math.floor(e*n)/n}))}round(e,t){return this.runFunction(e.args,t,this.metadata("ROUND"),((e,t)=>{const n=Math.pow(10,t);return e<0?-Math.round(-e*n)/n:Math.round(e*n)/n}))}intFunc(e,t){return this.runFunction(e.args,t,this.metadata("INT"),(e=>e<0?-Math.floor(-e):Math.floor(e)))}even(e,t){return this.runFunction(e.args,t,this.metadata("EVEN"),(e=>e<0?-Ks(-e):Ks(e)))}odd(e,t){return this.runFunction(e.args,t,this.metadata("ODD"),(e=>e<0?-$s(-e):$s(e)))}ceilingmath(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.MATH"),((e,t,n)=>0===t||0===e?0:(t=Math.abs(t),1===n&&e<0&&(t=-t),Math.ceil(e/t)*t)))}ceiling(e,t){return this.runFunction(e.args,t,this.metadata("CEILING"),((e,t)=>0===e?0:0===t?new Cn(sn.DIV_BY_ZERO):e>0&&t<0?new Cn(sn.NUM,J.DistinctSigns):Math.ceil(e/t)*t))}ceilingprecise(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.PRECISE"),((e,t)=>0===t||0===e?0:(t=Math.abs(t),Math.ceil(e/t)*t)))}floormath(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.MATH"),((e,t,n)=>0===t||0===e?0:(t=Math.abs(t),1===n&&e<0&&(t*=-1),Math.floor(e/t)*t)))}floor(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR"),((e,t)=>0===e?0:0===t?new Cn(sn.DIV_BY_ZERO):e>0&&t<0?new Cn(sn.NUM,J.DistinctSigns):Math.floor(e/t)*t))}floorprecise(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.PRECISE"),((e,t)=>0===t||0===e?0:(t=Math.abs(t),Math.floor(e/t)*t)))}}Xs.implementedFunctions={ROUNDUP:{method:"roundup",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0}]},ROUNDDOWN:{method:"rounddown",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0}]},ROUND:{method:"round",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:0}]},INT:{method:"intFunc",parameters:[{argumentType:ar.NUMBER}]},EVEN:{method:"even",parameters:[{argumentType:ar.NUMBER}]},ODD:{method:"odd",parameters:[{argumentType:ar.NUMBER}]},"CEILING.MATH":{method:"ceilingmath",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:1},{argumentType:ar.NUMBER,defaultValue:0}]},CEILING:{method:"ceiling",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},"CEILING.PRECISE":{method:"ceilingprecise",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:1}]},"FLOOR.MATH":{method:"floormath",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:1},{argumentType:ar.NUMBER,defaultValue:0}]},FLOOR:{method:"floor",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},"FLOOR.PRECISE":{method:"floorprecise",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,defaultValue:1}]}},Xs.aliases={"ISO.CEILING":"CEILING.PRECISE",TRUNC:"ROUNDDOWN"};class qs extends lr{sqrt(e,t){return this.runFunction(e.args,t,this.metadata("SQRT"),Math.sqrt)}}function*Qs(){}function Js(e){const t=e[Symbol.iterator](),{done:n,value:r}=t.next();return n?{rest:Qs()}:{value:r,rest:t}}qs.implementedFunctions={SQRT:{method:"sqrt",parameters:[{argumentType:ar.NUMBER}]}};class Zs{constructor(e,t,n,r,o){this.interpreter=e,this.cacheKey=t,this.reduceInitialValue=n,this.composeFunction=r,this.mapFunction=o,this.dependencyGraph=this.interpreter.dependencyGraph}compute(e,t){for(const n of t)if(!n.conditionRange.sameDimensionsAs(e))return new Cn(sn.VALUE,J.EqualLength);const n=this.tryToGetRangeVertexForRangeValue(e),r=t.map((e=>this.tryToGetRangeVertexForRangeValue(e.conditionRange)));if(n&&r.every((e=>void 0!==e))){const o=t.map((e=>e.criterionPackage.raw)).join(","),i=this.findAlreadyComputedValueInCache(n,this.cacheKey(t),o);if(void 0!==i)return this.interpreter.stats.incrementCriterionFunctionFullCacheUsed(),i;const s=this.buildNewCriterionCache(this.cacheKey(t),t.map((e=>e.conditionRange.range)),e.range);return s.has(o)||s.set(o,[this.evaluateRangeValue(e,t),t.map((e=>e.criterionPackage.lambda))]),n.setCriterionFunctionValues(this.cacheKey(t),s),r.forEach((e=>{void 0!==e&&e.addDependentCacheRange(n)})),s.get(o)[0]}return this.evaluateRangeValue(e,t)}tryToGetRangeVertexForRangeValue(e){const t=e.range;return void 0===t?void 0:this.dependencyGraph.getRange(t.start,t.end)}reduceFunction(e){let t=this.reduceInitialValue;for(const n of e)t=this.composeFunction(t,n);return t}findAlreadyComputedValueInCache(e,t,n){return e.getCriterionFunctionValue(t,n)}evaluateRangeValue(e,t){const n=t.map((e=>e.criterionPackage.lambda)),r=Array.from(e.valuesFromTopLeftCorner()).map(this.mapFunction)[Symbol.iterator](),o=na(n,t.map((e=>e.conditionRange.iterateValuesFromTopLeftCorner())),r);return this.reduceFunction(o)}buildNewCriterionCache(e,t,n){const r=this.dependencyGraph.getRange(n.start,n.end),{smallerRangeVertex:o,restConditionRanges:i,restValuesRange:s}=((e,t,n)=>{if(n.end.row>n.start.row){const r=An(n.end.sheet,n.end.col,n.end.row-1),o=e.getRange(n.start,r);if(void 0!==o)return{smallerRangeVertex:o,restValuesRange:n.withStart(An(n.start.sheet,n.start.col,n.end.row)),restConditionRanges:t.map((e=>e.withStart(An(e.start.sheet,e.start.col,e.end.row))))}}return{restValuesRange:n,restConditionRanges:t}})(this.dependencyGraph,t,n);let a;a=void 0!==o&&this.dependencyGraph.existsEdge(o,r)?o.getCriterionFunctionValues(e):new Map;const l=new Map;return a.forEach((([e,t],n)=>{const r=na(t,i.map((e=>ta(this.dependencyGraph,e))),Array.from(ta(this.dependencyGraph,s)).map(this.mapFunction)[Symbol.iterator]()),o=this.composeFunction(e,this.reduceFunction(r));this.interpreter.stats.incrementCriterionFunctionPartialCacheUsed(),l.set(n,[o,t])})),l}}class ea{constructor(e,t){this.conditionRange=e,this.criterionPackage=t}}function*ta(e,t){for(const n of t.addresses(e))yield je(e.getScalarValue(n))}function*na(e,t,n){for(const r of n){const n=t.map((e=>Js(e)));if(!n.every((e=>Object.prototype.hasOwnProperty.call(e,"value"))))return;ra(n.map((e=>je(e.value))),e).every((([e,t])=>t(e)))&&(yield r),t=n.map((e=>e.rest))}}function ra(e,t){const n=[];for(let r=0;r0?this.sum/this.count:void 0}}function ia(e){return Je(e)&&!Number.isFinite(je(e))?0:e}function sa(e){return e instanceof Cn?e:Je(e)?je(e):void 0}oa.empty=new oa(0,0);class aa extends lr{sumif(e,t){const n="SUMIF";return this.runFunction(e.args,t,this.metadata(n),((e,t,r)=>this.computeConditionalAggregationFunction(null!=r?r:e,[e,t],n,0,((e,t)=>this.arithmeticHelper.nonstrictadd(e,t)),sa)))}sumifs(e,t){const n="SUMIFS";return this.runFunction(e.args,t,this.metadata(n),((e,...t)=>this.computeConditionalAggregationFunction(e,t,n,0,((e,t)=>this.arithmeticHelper.nonstrictadd(e,t)),sa)))}averageif(e,t){const n="AVERAGEIF";return this.runFunction(e.args,t,this.metadata(n),((e,t,r)=>{const o=this.computeConditionalAggregationFunction(null!=r?r:e,[e,t],n,oa.empty,((e,t)=>e.compose(t)),(e=>Je(e)?oa.single(je(e)):oa.empty));return o instanceof Cn?o:o.averageValue()||new Cn(sn.DIV_BY_ZERO)}))}countif(e,t){const n="COUNTIF";return this.runFunction(e.args,t,this.metadata(n),((e,t)=>this.computeConditionalAggregationFunction(e,[e,t],n,0,((e,t)=>e+t),(()=>1))))}countifs(e,t){const n="COUNTIFS";return this.runFunction(e.args,t,this.metadata(n),((...e)=>this.computeConditionalAggregationFunction(e[0],e,n,0,((e,t)=>e+t),(()=>1))))}minifs(e,t){const n="MINIFS",r=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.min(e,t);return this.runFunction(e.args,t,this.metadata(n),((e,...t)=>ia(this.computeConditionalAggregationFunction(e,t,n,Number.POSITIVE_INFINITY,r,sa))))}maxifs(e,t){const n="MAXIFS",r=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.max(e,t);return this.runFunction(e.args,t,this.metadata(n),((e,...t)=>ia(this.computeConditionalAggregationFunction(e,t,n,Number.NEGATIVE_INFINITY,r,sa))))}computeConditionalAggregationFunction(e,t,n,r,o,i){const s=[];for(let e=0;e{const n=t.map((e=>`${e.conditionRange.range.sheet},${e.conditionRange.range.start.col},${e.conditionRange.range.start.row}`));return[e,...n].join(",")}}(n),r,o,i).compute(e,s)}}aa.implementedFunctions={SUMIF:{method:"sumif",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NOERROR},{argumentType:ar.RANGE,optionalArg:!0}]},COUNTIF:{method:"countif",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NOERROR}]},AVERAGEIF:{method:"averageif",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NOERROR},{argumentType:ar.RANGE,optionalArg:!0}]},SUMIFS:{method:"sumifs",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE},{argumentType:ar.NOERROR}],repeatLastArgs:2},COUNTIFS:{method:"countifs",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NOERROR}],repeatLastArgs:2},MINIFS:{method:"minifs",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE},{argumentType:ar.NOERROR}],repeatLastArgs:2},MAXIFS:{method:"maxifs",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE},{argumentType:ar.NOERROR}],repeatLastArgs:2}};class la extends lr{sumproduct(e,t){return this.runFunction(e.args,t,this.metadata("SUMPRODUCT"),((...e)=>{const t=e[0].width(),n=e[0].height();for(const r of e)if(r.width()!==t||r.height()!==n)return new Cn(sn.VALUE,J.EqualLength);let r=0;const o=e.map((e=>e.iterateValuesFromTopLeftCorner()));for(let e=0;e"".concat(...e)))}split(e,t){return this.runFunction(e.args,t,this.metadata("SPLIT"),((e,t)=>{const n=e.split(" ");return t>=n.length||t<0?new Cn(sn.VALUE,J.IndexBounds):n[t]}))}len(e,t){return this.runFunction(e.args,t,this.metadata("LEN"),(e=>e.length))}lower(e,t){return this.runFunction(e.args,t,this.metadata("LOWER"),(e=>e.toLowerCase()))}trim(e,t){return this.runFunction(e.args,t,this.metadata("TRIM"),(e=>e.replace(/^ +| +$/g,"").replace(/ +/g," ")))}proper(e,t){return this.runFunction(e.args,t,this.metadata("PROPER"),(e=>e.replace(/\p{L}+/gu,(e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))))}clean(e,t){return this.runFunction(e.args,t,this.metadata("CLEAN"),(e=>e.replace(/[\u0000-\u001F]/g,"")))}exact(e,t){return this.runFunction(e.args,t,this.metadata("EXACT"),((e,t)=>e===t))}rept(e,t){return this.runFunction(e.args,t,this.metadata("REPT"),((e,t)=>t<0?new Cn(sn.VALUE,J.NegativeCount):e.repeat(t)))}right(e,t){return this.runFunction(e.args,t,this.metadata("RIGHT"),((e,t)=>t<0?new Cn(sn.VALUE,J.NegativeLength):0===t?"":e.slice(-t)))}left(e,t){return this.runFunction(e.args,t,this.metadata("LEFT"),((e,t)=>t<0?new Cn(sn.VALUE,J.NegativeLength):e.slice(0,t)))}mid(e,t){return this.runFunction(e.args,t,this.metadata("MID"),((e,t,n)=>t<1?new Cn(sn.VALUE,J.LessThanOne):n<0?new Cn(sn.VALUE,J.NegativeLength):e.substring(t-1,t+n-1)))}replace(e,t){return this.runFunction(e.args,t,this.metadata("REPLACE"),((e,t,n,r)=>t<1?new Cn(sn.VALUE,J.LessThanOne):n<0?new Cn(sn.VALUE,J.NegativeLength):e.substring(0,t-1)+r+e.substring(t+n-1)))}search(e,t){return this.runFunction(e.args,t,this.metadata("SEARCH"),((e,t,n)=>{if(n<1||n>t.length)return new Cn(sn.VALUE,J.LengthBounds);const r=e.toLowerCase(),o=t.substring(n-1).toLowerCase(),i=this.arithmeticHelper.requiresRegex(r)?this.arithmeticHelper.searchString(r,o):o.indexOf(r);return i>-1?i+n:new Cn(sn.VALUE,J.PatternNotFound)}))}substitute(e,t){return this.runFunction(e.args,t,this.metadata("SUBSTITUTE"),((e,t,n,r)=>{const o=this.escapeRegExpSpecialCharacters(t),i=new RegExp(o,"g");if(void 0===r)return e.replace(i,n);if(r<1)return new Cn(sn.VALUE,J.LessThanOne);let s,a=0;for(;null!==(s=i.exec(e));)if(r===++a)return e.substring(0,s.index)+n+e.substring(i.lastIndex);return e}))}find(e,t){return this.runFunction(e.args,t,this.metadata("FIND"),((e,t,n)=>{if(n<1||n>t.length)return new Cn(sn.VALUE,J.IndexBounds);const r=t.substring(n-1).indexOf(e)+n;return r>0?r:new Cn(sn.VALUE,J.PatternNotFound)}))}t(e,t){return this.runFunction(e.args,t,this.metadata("T"),(e=>e instanceof Cn||"string"==typeof e?e:""))}upper(e,t){return this.runFunction(e.args,t,this.metadata("UPPER"),(e=>e.toUpperCase()))}escapeRegExpSpecialCharacters(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}ua.implementedFunctions={CONCATENATE:{method:"concatenate",parameters:[{argumentType:ar.STRING}],repeatLastArgs:1,expandRanges:!0},EXACT:{method:"exact",parameters:[{argumentType:ar.STRING},{argumentType:ar.STRING}]},SPLIT:{method:"split",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER}]},LEN:{method:"len",parameters:[{argumentType:ar.STRING}]},LOWER:{method:"lower",parameters:[{argumentType:ar.STRING}]},MID:{method:"mid",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},TRIM:{method:"trim",parameters:[{argumentType:ar.STRING}]},T:{method:"t",parameters:[{argumentType:ar.SCALAR}]},PROPER:{method:"proper",parameters:[{argumentType:ar.STRING}]},CLEAN:{method:"clean",parameters:[{argumentType:ar.STRING}]},REPT:{method:"rept",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER}]},RIGHT:{method:"right",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,defaultValue:1}]},LEFT:{method:"left",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER,defaultValue:1}]},REPLACE:{method:"replace",parameters:[{argumentType:ar.STRING},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.STRING}]},SEARCH:{method:"search",parameters:[{argumentType:ar.STRING},{argumentType:ar.STRING},{argumentType:ar.NUMBER,defaultValue:1}]},SUBSTITUTE:{method:"substitute",parameters:[{argumentType:ar.STRING},{argumentType:ar.STRING},{argumentType:ar.STRING},{argumentType:ar.NUMBER,optionalArg:!0}]},FIND:{method:"find",parameters:[{argumentType:ar.STRING},{argumentType:ar.STRING},{argumentType:ar.NUMBER,defaultValue:1}]},UPPER:{method:"upper",parameters:[{argumentType:ar.STRING}]}};class ha extends lr{acos(e,t){return this.runFunction(e.args,t,this.metadata("ACOS"),Math.acos)}asin(e,t){return this.runFunction(e.args,t,this.metadata("ASIN"),Math.asin)}cos(e,t){return this.runFunction(e.args,t,this.metadata("COS"),Math.cos)}sin(e,t){return this.runFunction(e.args,t,this.metadata("SIN"),Math.sin)}tan(e,t){return this.runFunction(e.args,t,this.metadata("TAN"),Math.tan)}atan(e,t){return this.runFunction(e.args,t,this.metadata("ATAN"),Math.atan)}atan2(e,t){return this.runFunction(e.args,t,this.metadata("ATAN2"),((e,t)=>0===e&&0===t?new Cn(sn.DIV_BY_ZERO):Math.atan2(t,e)))}cot(e,t){return this.runFunction(e.args,t,this.metadata("COT"),(e=>0===e?new Cn(sn.DIV_BY_ZERO):1/Math.tan(e)))}acot(e,t){return this.runFunction(e.args,t,this.metadata("ACOT"),(e=>0===e?Es/2:Math.atan(1/e)))}sec(e,t){return this.runFunction(e.args,t,this.metadata("SEC"),(e=>1/Math.cos(e)))}csc(e,t){return this.runFunction(e.args,t,this.metadata("CSC"),(e=>0===e?new Cn(sn.DIV_BY_ZERO):1/Math.sin(e)))}sinh(e,t){return this.runFunction(e.args,t,this.metadata("SINH"),Math.sinh)}asinh(e,t){return this.runFunction(e.args,t,this.metadata("ASINH"),Math.asinh)}cosh(e,t){return this.runFunction(e.args,t,this.metadata("COSH"),Math.cosh)}acosh(e,t){return this.runFunction(e.args,t,this.metadata("ACOSH"),Math.acosh)}tanh(e,t){return this.runFunction(e.args,t,this.metadata("TANH"),Math.tanh)}atanh(e,t){return this.runFunction(e.args,t,this.metadata("ATANH"),Math.atanh)}coth(e,t){return this.runFunction(e.args,t,this.metadata("COTH"),(e=>0===e?new Cn(sn.DIV_BY_ZERO):1/Math.tanh(e)))}acoth(e,t){return this.runFunction(e.args,t,this.metadata("ACOTH"),(e=>0===e?new Cn(sn.NUM,J.NonZero):Math.atanh(1/e)))}sech(e,t){return this.runFunction(e.args,t,this.metadata("SECH"),(e=>1/Math.cosh(e)))}csch(e,t){return this.runFunction(e.args,t,this.metadata("CSCH"),(e=>0===e?new Cn(sn.DIV_BY_ZERO):1/Math.sinh(e)))}}ha.implementedFunctions={ACOS:{method:"acos",parameters:[{argumentType:ar.NUMBER}]},ASIN:{method:"asin",parameters:[{argumentType:ar.NUMBER}]},COS:{method:"cos",parameters:[{argumentType:ar.NUMBER}]},SIN:{method:"sin",parameters:[{argumentType:ar.NUMBER}]},TAN:{method:"tan",parameters:[{argumentType:ar.NUMBER}]},ATAN:{method:"atan",parameters:[{argumentType:ar.NUMBER}]},ATAN2:{method:"atan2",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},COT:{method:"cot",parameters:[{argumentType:ar.NUMBER}]},SEC:{method:"sec",parameters:[{argumentType:ar.NUMBER}]},CSC:{method:"csc",parameters:[{argumentType:ar.NUMBER}]},SINH:{method:"sinh",parameters:[{argumentType:ar.NUMBER}]},COSH:{method:"cosh",parameters:[{argumentType:ar.NUMBER}]},TANH:{method:"tanh",parameters:[{argumentType:ar.NUMBER}]},COTH:{method:"coth",parameters:[{argumentType:ar.NUMBER}]},SECH:{method:"sech",parameters:[{argumentType:ar.NUMBER}]},CSCH:{method:"csch",parameters:[{argumentType:ar.NUMBER}]},ACOT:{method:"acot",parameters:[{argumentType:ar.NUMBER}]},ASINH:{method:"asinh",parameters:[{argumentType:ar.NUMBER}]},ACOSH:{method:"acosh",parameters:[{argumentType:ar.NUMBER}]},ATANH:{method:"atanh",parameters:[{argumentType:ar.NUMBER}]},ACOTH:{method:"acoth",parameters:[{argumentType:ar.NUMBER}]}};class ca extends Ai{constructor(e){super(e),this.dependencyGraph=e}find(e,t,n){return this.basicFind(e,t,"col",n)}}class da extends lr{constructor(){super(...arguments),this.rowSearch=new ca(this.dependencyGraph)}vlookup(e,t){return this.runFunction(e.args,t,this.metadata("VLOOKUP"),((e,t,n,r)=>{const o=t.range;if(void 0===o)return new Cn(sn.VALUE,J.WrongType);if(n<1)return new Cn(sn.VALUE,J.LessThanOne);if(n>o.width())return new Cn(sn.REF,J.IndexLarge);const i={ordering:r?"asc":"none",ifNoMatch:r?"returnLowerBound":"returnNotFound"};return this.doVlookup(Xn(e),t,n-1,i)}))}hlookup(e,t){return this.runFunction(e.args,t,this.metadata("HLOOKUP"),((e,t,n,r)=>{const o=t.range;if(void 0===o)return new Cn(sn.VALUE,J.WrongType);if(n<1)return new Cn(sn.VALUE,J.LessThanOne);if(n>o.height())return new Cn(sn.REF,J.IndexLarge);const i={ordering:r?"asc":"none",ifNoMatch:r?"returnLowerBound":"returnNotFound"};return this.doHlookup(Xn(e),t,n-1,i)}))}xlookup(e,t){return this.runFunction(e.args,t,this.metadata("XLOOKUP"),((e,t,n,r,o,i)=>{if(![0,-1,1,2].includes(o))return new Cn(sn.VALUE,J.BadMode);if(![1,-1,2,-2].includes(i))return new Cn(sn.VALUE,J.BadMode);const s=t instanceof nt?t:nt.fromScalar(t),a=n instanceof nt?n:nt.fromScalar(n),l=2===o,u={ordering:2===i?"asc":-2===i?"desc":"none",returnOccurrence:-1===i?"last":"first",ifNoMatch:-1===o?"returnLowerBound":1===o?"returnUpperBound":"returnNotFound"};return this.doXlookup(Xn(e),s,a,r,l,u)}))}xlookupArraySize(e){var t,n;const r=null===(t=null==e?void 0:e.args)||void 0===t?void 0:t[1],o=null===(n=null==e?void 0:e.args)||void 0===n?void 0:n[2];if(null==(null==r?void 0:r.start)||null==(null==r?void 0:r.end)||null==(null==o?void 0:o.start)||null==(null==o?void 0:o.end))return ur.error();const i=r.end.row-r.start.row+1,s=r.end.col-r.start.col+1,a=o.end.row-o.start.row+1,l=o.end.col-o.start.col+1,u=1===s&&a===i;return u||1===i&&l===s?u?new ur(l,1):new ur(1,a):ur.error()}match(e,t){return this.runFunction(e.args,t,this.metadata("MATCH"),((e,t,n)=>this.doMatch(Xn(e),t,n)))}searchInRange(e,t,n,r,o){return n&&"string"==typeof e&&this.arithmeticHelper.requiresRegex(e)?o.advancedFind(this.arithmeticHelper.eqMatcherFunction(e),t,{returnOccurrence:r.returnOccurrence}):o.find(e,t,r)}doVlookup(e,t,n,r){this.dependencyGraph.stats.start(et.VLOOKUP);const o=t.range;let i;i=void 0===o?nt.onlyValues(t.data.map((e=>[e[0]]))):nt.onlyRange(Hn.spanFrom(o.start,1,o.height()),this.dependencyGraph);const s=this.searchInRange(e,i,"none"===r.ordering,r,this.columnSearch);if(this.dependencyGraph.stats.end(et.VLOOKUP),-1===s)return new Cn(sn.NA,J.ValueNotFound);let a;if(void 0===o)a=t.data[s][n];else{const e=An(o.sheet,o.start.col+n,o.start.row+s);a=this.dependencyGraph.getCellValue(e)}return a instanceof nt?new Cn(sn.VALUE,J.WrongType):a}doHlookup(e,t,n,r){const o=t.range;let i;i=void 0===o?nt.onlyValues([t.data[0]]):nt.onlyRange(Hn.spanFrom(o.start,o.width(),1),this.dependencyGraph);const s=this.searchInRange(e,i,"none"===r.ordering,r,this.rowSearch);if(-1===s)return new Cn(sn.NA,J.ValueNotFound);let a;if(void 0===o)a=t.data[n][s];else{const e=An(o.sheet,o.start.col+s,o.start.row+n);a=this.dependencyGraph.getCellValue(e)}return a instanceof nt?new Cn(sn.VALUE,J.WrongType):a}doXlookup(e,t,n,r,o,i){const s=1===t.width()&&n.height()===t.height(),a=1===t.height()&&n.width()===t.width();if(!s&&!a)return new Cn(sn.VALUE,J.WrongDimension);const l=s?this.columnSearch:this.rowSearch,u=this.searchInRange(e,t,o,i,l);if(-1===u)return r==sn.NA?new Cn(sn.NA,J.ValueNotFound):r;const h=s?[n.data[u]]:n.data.map((e=>[e[u]]));return nt.onlyValues(h)}doMatch(e,t,n){if(![-1,0,1].includes(n))return new Cn(sn.VALUE,J.BadMode);if(t.width()>1&&t.height()>1)return new Cn(sn.NA);const r=0===n?{ordering:"none",ifNoMatch:"returnNotFound"}:{ordering:-1===n?"desc":"asc",ifNoMatch:-1===n?"returnUpperBound":"returnLowerBound"},o=(1===t.width()?this.columnSearch:this.rowSearch).find(e,t,r);return-1===o?new Cn(sn.NA,J.ValueNotFound):o+1}}da.implementedFunctions={VLOOKUP:{method:"vlookup",parameters:[{argumentType:ar.NOERROR},{argumentType:ar.RANGE},{argumentType:ar.NUMBER},{argumentType:ar.BOOLEAN,defaultValue:!0}]},HLOOKUP:{method:"hlookup",parameters:[{argumentType:ar.NOERROR},{argumentType:ar.RANGE},{argumentType:ar.NUMBER},{argumentType:ar.BOOLEAN,defaultValue:!0}]},XLOOKUP:{method:"xlookup",arraySizeMethod:"xlookupArraySize",parameters:[{argumentType:ar.NOERROR},{argumentType:ar.RANGE},{argumentType:ar.RANGE},{argumentType:ar.SCALAR,optionalArg:!0,defaultValue:sn.NA},{argumentType:ar.NUMBER,optionalArg:!0,defaultValue:0},{argumentType:ar.NUMBER,optionalArg:!0,defaultValue:1}]},MATCH:{method:"match",parameters:[{argumentType:ar.NOERROR},{argumentType:ar.RANGE},{argumentType:ar.NUMBER,defaultValue:1}]}};class ma extends lr{roman(e,t){return this.runFunction(e.args,t,this.metadata("ROMAN"),((e,t)=>(e=Math.trunc(e),!1===t?t=4:!0===t&&(t=0),(t=je(this.coerceScalarToNumberOrError(t)))instanceof Cn?t:(t=Math.trunc(t))<0?new Cn(sn.VALUE,J.ValueSmall):t>4?new Cn(sn.VALUE,J.ValueLarge):function(e,t){const n={val:e%1e3,acc:"M".repeat(Math.floor(e/1e3))};return 4===t&&(fa(n,"IM",999,1e3),fa(n,"ID",499,500)),t>=3&&(fa(n,"VM",995,1e3),fa(n,"VD",495,500)),t>=2&&(fa(n,"XM",990,1e3),fa(n,"XD",490,500)),t>=1&&(fa(n,"LM",950,1e3),fa(n,"LD",450,500)),fa(n,"CM",900,1e3),fa(n,"CD",400,500),fa(n,"D",500,900),n.acc+="C".repeat(Math.floor(n.val/100)),n.val%=100,t>=2&&(fa(n,"IC",99,100),fa(n,"IL",49,50)),t>=1&&(fa(n,"VC",95,100),fa(n,"VL",45,50)),fa(n,"XC",90,100),fa(n,"XL",40,50),fa(n,"L",50,90),n.acc+="X".repeat(Math.floor(n.val/10)),n.val%=10,fa(n,"IX",9,10),fa(n,"IV",4,5),fa(n,"V",5,9),n.acc+="I".repeat(n.val),n.acc}(e,t))))}arabic(e,t){return this.runFunction(e.args,t,this.metadata("ARABIC"),(e=>{let t=!1;if((e=e.trim().toUpperCase()).startsWith("-")&&(t=!0,""===(e=e.slice(1))))return new Cn(sn.VALUE,J.InvalidRoman);const n={input:e,acc:0};return pa(n,{token:"MMM",val:3e3},{token:"MM",val:2e3},{token:"M",val:1e3}),pa(n,{token:"IM",val:999},{token:"VM",val:995},{token:"XM",val:990},{token:"LM",val:950},{token:"CM",val:900}),pa(n,{token:"D",val:500},{token:"ID",val:499},{token:"VD",val:495},{token:"XD",val:490},{token:"LD",val:450},{token:"CD",val:400}),pa(n,{token:"CCC",val:300},{token:"CC",val:200},{token:"C",val:100}),pa(n,{token:"IC",val:99},{token:"VC",val:95},{token:"XC",val:90}),pa(n,{token:"L",val:50},{token:"IL",val:49},{token:"VL",val:45},{token:"XL",val:40}),pa(n,{token:"XXX",val:30},{token:"XX",val:20},{token:"X",val:10}),pa(n,{token:"IX",val:9}),pa(n,{token:"V",val:5},{token:"IV",val:4}),pa(n,{token:"III",val:3},{token:"II",val:2},{token:"I",val:1}),""!==n.input?new Cn(sn.VALUE,J.InvalidRoman):t?-n.acc:n.acc}))}}function pa(e,...t){for(const n of t)if(e.input.startsWith(n.token)){e.input=e.input.slice(n.token.length),e.acc+=n.val;break}}function fa(e,t,n,r){e.val>=n&&e.valn)r=va(t,n,i(t),h(t),-1);else{for(var o=!1,s=0,a=0,l=1,u=0,c=2/t,d=2*ya.floor((n+ya.floor(ya.sqrt(40*n)))/2);d>0;d--)u=d*c*l-s,s=l,l=u,ya.abs(l)>1e10&&(l*=1e-10,s*=1e-10,r*=1e-10,a*=1e-10),o&&(a+=l),o=!o,d==n&&(r=s);r/=a=2*a-l}return r}}(),Da=(ba=.636619772,Sa=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),Ca=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),Ea=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),Ma=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),Ta=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),Ra=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),Aa=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),Na=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse(),_a((function(e){var t=0,n=0,r=0,o=e*e,i=e-.785398164;return e<8?t=(n=wa(Sa,o))/(r=wa(Ca,o))+ba*ka(e,0)*ya.log(e):(n=wa(Ea,o=64/o),r=wa(Ma,o),t=ya.sqrt(ba/e)*(ya.sin(i)*n+ya.cos(i)*r*8/e)),t}),(function(e){var t=0,n=0,r=0,o=e*e,i=e-2.356194491;return e<8?t=(n=e*wa(Ta,o))/(r=wa(Ra,o))+ba*(ka(e,1)*ya.log(e)-1/e):(n=wa(Aa,o=64/o),r=wa(Na,o),t=ya.sqrt(ba/e)*(ya.sin(i)*n+ya.cos(i)*r*8/e)),t}),0,1,-1)),Pa=(La=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),xa=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),Oa=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),Ia=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function e(t,n){if(0===(n=Math.round(n)))return function(e){return e<=3.75?wa(La,e*e/14.0625):ya.exp(ya.abs(e))/ya.sqrt(ya.abs(e))*wa(xa,3.75/ya.abs(e))}(t);if(1===n)return function(e){return e<3.75?e*wa(Oa,e*e/14.0625):(e<0?-1:1)*ya.exp(ya.abs(e))/ya.sqrt(ya.abs(e))*wa(Ia,3.75/ya.abs(e))}(t);if(n<0)return NaN;if(0===ya.abs(t))return 0;if(t==1/0)return 1/0;var r,o=0,i=2/ya.abs(t),s=0,a=1,l=0;for(r=2*ya.round((n+ya.round(ya.sqrt(40*n)))/2);r>0;r--)l=r*i*a+s,s=a,a=l,ya.abs(a)>1e10&&(a*=1e-10,s*=1e-10,o*=1e-10),r==n&&(o=s);return o*=e(t,0)/a,t<0&&n%2?-o:o}),Ha=function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),t=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),n=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),r=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return _a((function(n){return n<=2?-ya.log(n/2)*Pa(n,0)+wa(e,n*n/4):ya.exp(-n)/ya.sqrt(n)*wa(t,2/n)}),(function(e){return e<=2?ya.log(e/2)*Pa(e,1)+1/e*wa(n,e*e/4):ya.exp(-e)/ya.sqrt(e)*wa(r,2/e)}),0,2,1)}();function Fa(e){const t=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18];let n,r,o,i,s=t.length-1,a=!1,l=0,u=0;if(0===e)return 0;for(e<0&&(e=-e,a=!0),n=2/(2+e),r=4*n-2;s>0;s--)o=l,l=r*l-u+t[s],u=o;return i=n*Math.exp(-e*e+.5*(t[0]+r*l)-u),a?i-1:1-i}function Ya(e){return 1-Fa(e)}function Va(e){let t,n,r,o,i=0;if(e>=2)return-100;if(e<=0)return 100;for(o=e<1?e:2-e,r=Math.sqrt(-2*Math.log(o/2)),t=-.70711*((2.30753+.27061*r)/(1+r*(.99229+.04481*r))-r);i<2;i++)n=Ya(t)-o,t+=n/(1.1283791670955126*Math.exp(-t*t)-t*n);return e<1?t:-t}function Ua(e){const t=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],n=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];let r,o,i,s,a=!1,l=0,u=0,h=0,c=e;if(e>171.6243769536076)return 1/0;if(c<=0){if(s=c%1,!s)return 1/0;a=(1&c?-1:1)*Math.PI/Math.sin(Math.PI*s),c=1-c}for(i=c,o=c<1?c++:(c-=l=(0|c)-1)-1,r=0;r<8;++r)h=(h+t[r])*o,u=u*o+n[r];if(s=h/u+1,ic)for(r=0;r=1?e:1/e)+.4*e+17);let d;if(t<0||e<=0)return NaN;if(t=1)return Math.max(100,t+100*Math.sqrt(t));if(e<=0)return 0;for(t>1?(h=Math.log(r),c=Math.exp(r*(h-1)-o),u=e<.5?e:1-e,a=Math.sqrt(-2*Math.log(u)),i=(2.30753+.27061*a)/(1+a*(.99229+.04481*a))-a,e<.5&&(i=-i),i=Math.max(.001,t*Math.pow(1-1/(9*t)-i/(3*Math.sqrt(t)),3))):(a=1-t*(.253+.12*t),i=e1?c*Math.exp(-(i-r)+r*(Math.log(i)-h)):Math.exp(-i+r*Math.log(i)-o),l=s/a,i-=a=l/(1-.5*Math.min(1,l*((t-1)/i-1))),i<=0&&(i=.5*(i+a)),Math.abs(a)<1e-8*i)break}return i}const Ga=function(e,t,n){return Math.exp(-.5*Math.log(2*Math.PI)-Math.log(n)-Math.pow(e-t,2)/(2*n*n))},$a=function(e,t,n){return.5*(1+Fa((e-t)/Math.sqrt(2*n*n)))},Ka=function(e,t,n){return-1.4142135623730951*n*Va(2*e)+t};function Xa(e,t){if(!(e<=0||t<=0))return e+t>170?Math.exp(qa(e,t)):Ua(e)*Ua(t)/Ua(e+t)}function qa(e,t){return Wa(e)+Wa(t)-Wa(e+t)}function Qa(e,t,n){var r,o,i,s,a,l,u,h,c,d,m=t-1,p=n-1,f=0;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(i=e<.5?e:1-e,l=(2.30753+.27061*(s=Math.sqrt(-2*Math.log(i))))/(1+s*(.99229+.04481*s))-s,e<.5&&(l=-l),u=(l*l-3)/6,h=2/(1/(2*t-1)+1/(2*n-1)),c=l*Math.sqrt(u+h)/h-(1/(2*n-1)-1/(2*t-1))*(u+5/6-2/(3*h)),l=t/(t+n*Math.exp(2*c))):(r=Math.log(t/(t+n)),o=Math.log(n/(t+n)),l=e<(s=Math.exp(t*r)/t)/(c=s+(a=Math.exp(n*o)/n))?Math.pow(t*c*e,1/t):1-Math.pow(n*c*(1-e),1/n)),d=-Wa(t)-Wa(n)+Wa(t+n);f<10;f++){if(0===l||1===l)return l;if((l-=s=(a=(Ja(l,t,n)-e)/(s=Math.exp(m*Math.log(l)+p*Math.log(1-l)+d)))/(1-.5*Math.min(1,a*(m/l-p/(1-l)))))<=0&&(l=.5*(l+s)),l>=1&&(l=.5*(l+s+1)),Math.abs(s)<1e-8*l&&f>0)break}return l}function Ja(e,t,n){var r=0===e||1===e?0:Math.exp(Wa(t+n)-Wa(t)-Wa(n)+t*Math.log(e)+n*Math.log(1-e));return!(e<0||e>1)&&(e<(t+1)/(t+n+2)?r*Za(e,t,n)/t:1-r*Za(1-e,n,t)/n)}function Za(e,t,n){var r,o,i,s,a=1e-30,l=1,u=t+n,h=t+1,c=t-1,d=1,m=1-u*e/h;for(Math.abs(m)=t)return 1;if(n<0||n>1||t<=0)return NaN;var i=n,s=(e=Math.floor(e))+1,a=t-e,l=s+a,u=Math.exp(Wa(l)-Wa(a)-Wa(s)+s*Math.log(i)+a*Math.log(1-i));return r=i<(s+1)/(l+2)?u*nl(i,s,a,o):1-u*nl(1-i,a,s,o),Math.round(1/o*(1-r))/(1/o)};function nl(e,t,n,r){for(var o,i=0,s=1,a=1,l=1,u=0,h=0;Math.abs((a-h)/a)>r;)h=a,s=l+(o=-(t+u)*(t+n+u)*e/(t+2*u)/(t+2*u+1))*s,a=(i=a+o*i)+(o=(u+=1)*(n-u)*e/(t+2*u-1)/(t+2*u))*a,i/=l=s+o*l,s/=l,a/=l,l=1;return a/t}function rl(e,t){return e>170||t>170?Math.exp(function(e,t){return ol(e)-ol(t)-ol(e-t)}(e,t)):il(e)/il(t)/il(e-t)}function ol(e){return e<0?NaN:Wa(e+1)}function il(e){return e<0?NaN:Ua(e+1)}const sl=function(e,t){return e<0?0:ja(t/2,e/2)},al=function(e,t){return 2*za(e,.5*t)},ll=function(e,t,n){return e<0?0:Ja(t*e/(t*e+n),t/2,n/2)},ul=function(e,t,n){return n/(t*(1/Qa(e,t/2,n/2)-1))},hl={pdf:function(e,t){return t<0||e%1!=0||e<0?0:Math.pow(t,e)*Math.exp(-t)/il(e)},cdf:function(e,t){var n=0;if(e<0)return 0;for(var r=0;n<=e;n++)r+=hl.pdf(n,t);return r}},cl={pdf:function(e,t,n,r){if(e<0||er||e>n)return 0;if(2*n>t)return 2*r>t?cl.pdf(t-n-r+e,t,t-n,t-r):cl.pdf(r-e,t,t-n,r);if(2*r>t)return cl.pdf(n-e,t,n,t-r);if(n1&&i=o||t>=r)return 1;if(2*r>n)return 2*o>n?e(n-r-o+t,n,n-r,n-o):1-cl.cdf(o-t-1,n,n-r,o);if(2*o>n)return 1-cl.cdf(r-t-1,n,r,n-o);if(r1&&a.5?n:-n},pl={pdf:function(e,t,n){return e===e>>>0&&(e<0?0:rl(e+t-1,t-1)*Math.pow(1-n,e)*Math.pow(n,t))},cdf:function(e,t,n){var r=0,o=0;if(e<0)return 0;for(;o<=e;o++)r+=pl.pdf(o,t,n);return r}};function fl(e){for(var t=0,n=e.length;--n>=0;)t+=e[n];return t}function gl(e){return fl(e)/e.length}function yl(e){for(var t,n=gl(e),r=0,o=e.length;--o>=0;)r+=(t=e[o]-n)*t;return r}function wl(e,t){return yl(e)/(e.length-(t?1:0))}function vl(e,t){return Math.sqrt(wl(e,t))}function _l(e,t){var n,r=gl(e),o=gl(t),i=e.length,s=new Array(i);for(n=0;nvoid 0===t?Fa(e):Fa(t)-Fa(e)))}erfc(e,t){return this.runFunction(e.args,t,this.metadata("ERFC"),Ya)}expondist(e,t){return this.runFunction(e.args,t,this.metadata("EXPON.DIST"),((e,t,n)=>n?((e,t)=>e<0?0:1-Math.exp(-t*e))(e,t):((e,t)=>e<0?0:t*Math.exp(-t*e))(e,t)))}fisher(e,t){return this.runFunction(e.args,t,this.metadata("FISHER"),(e=>Math.log((1+e)/(1-e))/2))}fisherinv(e,t){return this.runFunction(e.args,t,this.metadata("FISHERINV"),(e=>1-2/(Math.exp(2*e)+1)))}gamma(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA"),Ua)}gammadist(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.DIST"),((e,t,n,r)=>{return r?(i=t,s=n,(o=e)<0?0:ja(i,o/s)):function(e,t,n){return e<0?0:0===e&&1===t?1/n:Math.exp((t-1)*Math.log(e)-e/n-Wa(t)-t*Math.log(n))}(e,t,n);var o,i,s}))}gammaln(e,t){return this.runFunction(e.args,t,this.metadata("GAMMALN"),Wa)}gammainv(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.INV"),Ba)}gauss(e,t){return this.runFunction(e.args,t,this.metadata("GAUSS"),(e=>$a(e,0,1)-.5))}betadist(e,t){return this.runFunction(e.args,t,this.metadata("BETA.DIST"),((e,t,n,r,o,i)=>e<=o?new Cn(sn.NUM,J.ValueSmall):e>=i?new Cn(sn.NUM,J.ValueLarge):(e=(e-o)/(i-o),r?function(e,t,n){return e>1||e<0?+(e>1):Ja(e,t,n)}(e,t,n):function(e,t,n){return e>1||e<0?0:1==t&&1==n?1:t<512&&n<512?Math.pow(e,t-1)*Math.pow(1-e,n-1)/Xa(t,n):Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-qa(t,n))}(e,t,n))))}betainv(e,t){return this.runFunction(e.args,t,this.metadata("BETA.INV"),((e,t,n,r,o)=>r>=o?new Cn(sn.NUM,J.WrongOrder):function(e,t,n){return Qa(e,t,n)}(e,t,n)*(o-r)+r))}binomialdist(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.DIST"),((e,t,n,r)=>e>t?new Cn(sn.NUM,J.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),r?tl(e,t,n):el(e,t,n))))}binomialinv(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.INV"),((e,t,n)=>{let r=-1,o=e=Math.trunc(e);for(;o>r+1;){const i=Math.trunc((r+o)/2);tl(i,e,t)>=n?o=i:r=i}return o}))}besselifn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELI"),((e,t)=>Pa(e,Math.trunc(t))))}besseljfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELJ"),((e,t)=>ka(e,Math.trunc(t))))}besselkfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELK"),((e,t)=>Ha(e,Math.trunc(t))))}besselyfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELY"),((e,t)=>Da(e,Math.trunc(t))))}chisqdist(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST"),((e,t,n)=>(t=Math.trunc(t),n?sl(e,t):function(e,t){return e<0?0:0===e&&2===t?.5:Math.exp((t/2-1)*Math.log(e)-e/2-t/2*Math.log(2)-Wa(t/2))}(e,t))))}chisqdistrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST.RT"),((e,t)=>1-sl(e,Math.trunc(t))))}chisqinv(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV"),((e,t)=>al(e,Math.trunc(t))))}chisqinvrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV.RT"),((e,t)=>al(1-e,Math.trunc(t))))}fdist(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST"),((e,t,n,r)=>(t=Math.trunc(t),n=Math.trunc(n),r?ll(e,t,n):function(e,t,n){return e<0?0:t<=2?0===e&&t<2?1/0:0===e&&2===t?1:1/Xa(t/2,n/2)*Math.pow(t/n,t/2)*Math.pow(e,t/2-1)*Math.pow(1+t/n*e,-(t+n)/2):t*(n/(n+e*t))/2*el((t-2)/2,(t+n-2)/2,t*e/(n+e*t))}(e,t,n))))}fdistrt(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST.RT"),((e,t,n)=>1-ll(e,Math.trunc(t),Math.trunc(n))))}finv(e,t){return this.runFunction(e.args,t,this.metadata("F.INV"),((e,t,n)=>ul(e,Math.trunc(t),Math.trunc(n))))}finvrt(e,t){return this.runFunction(e.args,t,this.metadata("F.INV.RT"),((e,t,n)=>ul(1-e,Math.trunc(t),Math.trunc(n))))}weibulldist(e,t){return this.runFunction(e.args,t,this.metadata("WEIBULL.DIST"),((e,t,n,r)=>r?function(e,t,n){return e<0?0:1-Math.exp(-Math.pow(e/t,n))}(e,n,t):function(e,t,n){return e<0||t<0||n<0?0:n/t*Math.pow(e/t,n-1)*Math.exp(-Math.pow(e/t,n))}(e,n,t)))}poissondist(e,t){return this.runFunction(e.args,t,this.metadata("POISSON.DIST"),((e,t,n)=>(e=Math.trunc(e),n?hl.cdf(e,t):hl.pdf(e,t))))}hypgeomdist(e,t){return this.runFunction(e.args,t,this.metadata("HYPGEOM.DIST"),((e,t,n,r,o)=>e>t||e>n||t>r||n>r||e+r(t=Math.trunc(t),n?dl(e,t):function(e,t){return t=t>1e100?1e100:t,1/(Math.sqrt(t)*Xa(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)}(e,t))))}tdist2t(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.2T"),((e,t)=>2*(1-dl(e,Math.trunc(t)))))}tdistrt(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.RT"),((e,t)=>1-dl(e,Math.trunc(t))))}tdistold(e,t){return this.runFunction(e.args,t,this.metadata("TDIST"),((e,t,n)=>n*(1-dl(e,Math.trunc(t)))))}tinv(e,t){return this.runFunction(e.args,t,this.metadata("T.INV"),((e,t)=>ml(e,Math.trunc(t))))}tinv2t(e,t){return this.runFunction(e.args,t,this.metadata("T.INV.2T"),((e,t)=>ml(1-e/2,Math.trunc(t))))}lognormdist(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.DIST"),((e,t,n,r)=>r?function(e,t,n){return e<0?0:.5+.5*Fa((Math.log(e)-t)/Math.sqrt(2*n*n))}(e,t,n):function(e,t,n){return e<=0?0:Math.exp(-Math.log(e)-.5*Math.log(2*Math.PI)-Math.log(n)-Math.pow(Math.log(e)-t,2)/(2*n*n))}(e,t,n)))}lognorminv(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.INV"),((e,t,n)=>function(e,t,n){return Math.exp(-1.4142135623730951*n*Va(2*e)+t)}(e,t,n)))}normdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.DIST"),((e,t,n,r)=>r?$a(e,t,n):Ga(e,t,n)))}norminv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.INV"),((e,t,n)=>Ka(e,t,n)))}normsdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.DIST"),((e,t)=>t?$a(e,0,1):Ga(e,0,1)))}normsinv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.INV"),(e=>Ka(e,0,1)))}phi(e,t){return this.runFunction(e.args,t,this.metadata("PHI"),(e=>Ga(e,0,1)))}negbinomdist(e,t){return this.runFunction(e.args,t,this.metadata("NEGBINOM.DIST"),((e,t,n,r)=>(e=Math.trunc(e),t=Math.trunc(t),r?pl.cdf(e,t,n):pl.pdf(e,t,n))))}confidencenorm(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.NORM"),((e,t,n)=>function(){var e,t=[].slice.call(arguments),n=new Array(2);return e=4===t.length?Math.abs(Ka(t[1]/2,0,1)*t[2]/Math.sqrt(t[3])):Math.abs(Ka(t[1]/2,0,1)*vl(t[2])/Math.sqrt(t[2].length)),n[0]=t[0]-e,n[1]=t[0]+e,n}(1,e,t,Math.trunc(n))[1]-1))}confidencet(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.T"),((e,t,n)=>1===(n=Math.trunc(n))?new Cn(sn.DIV_BY_ZERO):function(){var e,t=[].slice.call(arguments),n=new Array(2);return e=4===t.length?Math.abs(ml(t[1]/2,t[3]-1)*t[2]/Math.sqrt(t[3])):Math.abs(ml(t[1]/2,t[2].length-1)*vl(t[2],!0)/Math.sqrt(t[2].length)),n[0]=t[0]-e,n[1]=t[0]+e,n}(1,e,t,n)[1]-1))}standardize(e,t){return this.runFunction(e.args,t,this.metadata("STANDARDIZE"),((e,t,n)=>(e-t)/n))}}Sl.implementedFunctions={ERF:{method:"erf",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,optionalArg:!0}]},ERFC:{method:"erfc",parameters:[{argumentType:ar.NUMBER}]},"EXPON.DIST":{method:"expondist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN}]},FISHER:{method:"fisher",parameters:[{argumentType:ar.NUMBER,greaterThan:-1,lessThan:1}]},FISHERINV:{method:"fisherinv",parameters:[{argumentType:ar.NUMBER}]},GAMMA:{method:"gamma",parameters:[{argumentType:ar.NUMBER}]},"GAMMA.DIST":{method:"gammadist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN}]},GAMMALN:{method:"gammaln",parameters:[{argumentType:ar.NUMBER,greaterThan:0}]},"GAMMA.INV":{method:"gammainv",parameters:[{argumentType:ar.NUMBER,minValue:0,lessThan:1},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0}]},GAUSS:{method:"gauss",parameters:[{argumentType:ar.NUMBER}]},"BETA.DIST":{method:"betadist",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:1}]},"BETA.INV":{method:"betainv",parameters:[{argumentType:ar.NUMBER,greaterThan:0,maxValue:1},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,defaultValue:0},{argumentType:ar.NUMBER,defaultValue:1}]},"BINOM.DIST":{method:"binomialdist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.BOOLEAN}]},"BINOM.INV":{method:"binomialinv",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.NUMBER,greaterThan:0,lessThan:1}]},BESSELI:{method:"besselifn",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:0}]},BESSELJ:{method:"besseljfn",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:0}]},BESSELK:{method:"besselkfn",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:0}]},BESSELY:{method:"besselyfn",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:0}]},"CHISQ.DIST":{method:"chisqdist",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:1,maxValue:1e10},{argumentType:ar.BOOLEAN}]},"CHISQ.DIST.RT":{method:"chisqdistrt",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV":{method:"chisqinv",parameters:[{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV.RT":{method:"chisqinvrt",parameters:[{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.NUMBER,minValue:1}]},"F.DIST":{method:"fdist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.BOOLEAN}]},"F.DIST.RT":{method:"fdistrt",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.NUMBER,minValue:1}]},"F.INV":{method:"finv",parameters:[{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.NUMBER,minValue:1}]},"F.INV.RT":{method:"finvrt",parameters:[{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.NUMBER,minValue:1}]},"WEIBULL.DIST":{method:"weibulldist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN}]},"POISSON.DIST":{method:"poissondist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.BOOLEAN}]},"HYPGEOM.DIST":{method:"hypgeomdist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN}]},"T.DIST":{method:"tdist",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.BOOLEAN}]},"T.DIST.2T":{method:"tdist2t",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1}]},"T.DIST.RT":{method:"tdistrt",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,minValue:1}]},TDIST:{method:"tdistold",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.INTEGER,minValue:1,maxValue:2}]},"T.INV":{method:"tinv",parameters:[{argumentType:ar.NUMBER,greaterThan:0,lessThan:1},{argumentType:ar.NUMBER,minValue:1}]},"T.INV.2T":{method:"tinv2t",parameters:[{argumentType:ar.NUMBER,greaterThan:0,maxValue:1},{argumentType:ar.NUMBER,minValue:1}]},"LOGNORM.DIST":{method:"lognormdist",parameters:[{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN}]},"LOGNORM.INV":{method:"lognorminv",parameters:[{argumentType:ar.NUMBER,greaterThan:0,lessThan:1},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0}]},"NORM.DIST":{method:"normdist",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.BOOLEAN}]},"NORM.INV":{method:"norminv",parameters:[{argumentType:ar.NUMBER,greaterThan:0,lessThan:1},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0}]},"NORM.S.DIST":{method:"normsdist",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.BOOLEAN}]},"NORM.S.INV":{method:"normsinv",parameters:[{argumentType:ar.NUMBER,greaterThan:0,lessThan:1}]},PHI:{method:"phi",parameters:[{argumentType:ar.NUMBER}]},"NEGBINOM.DIST":{method:"negbinomdist",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:1},{argumentType:ar.NUMBER,minValue:0,maxValue:1},{argumentType:ar.BOOLEAN}]},"CONFIDENCE.NORM":{method:"confidencenorm",parameters:[{argumentType:ar.NUMBER,greaterThan:0,lessThan:1},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,minValue:1}]},"CONFIDENCE.T":{method:"confidencet",parameters:[{argumentType:ar.NUMBER,greaterThan:0,lessThan:1},{argumentType:ar.NUMBER,greaterThan:0},{argumentType:ar.NUMBER,minValue:1}]},STANDARDIZE:{method:"standardize",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,greaterThan:0}]}},Sl.aliases={NEGBINOMDIST:"NEGBINOM.DIST",EXPONDIST:"EXPON.DIST",BETADIST:"BETA.DIST",NORMDIST:"NORM.DIST",NORMINV:"NORM.INV",NORMSDIST:"NORM.S.DIST",NORMSINV:"NORM.S.INV",LOGNORMDIST:"LOGNORM.DIST",LOGINV:"LOGNORM.INV",TINV:"T.INV.2T",HYPGEOMDIST:"HYPGEOM.DIST",POISSON:"POISSON.DIST",WEIBULL:"WEIBULL.DIST",FINV:"F.INV.RT",FDIST:"F.DIST.RT",CHIDIST:"CHISQ.DIST.RT",CHIINV:"CHISQ.INV.RT",GAMMADIST:"GAMMA.DIST","GAMMALN.PRECISE":"GAMMALN",GAMMAINV:"GAMMA.INV",BETAINV:"BETA.INV",BINOMDIST:"BINOM.DIST",CONFIDENCE:"CONFIDENCE.NORM",CRITBINOM:"BINOM.INV",WEIBULLDIST:"WEIBULL.DIST",TINV2T:"T.INV.2T",TDISTRT:"T.DIST.RT",TDIST2T:"T.DIST.2T",FINVRT:"F.INV.RT",FDISTRT:"F.DIST.RT",CHIDISTRT:"CHISQ.DIST.RT",CHIINVRT:"CHISQ.INV.RT",LOGNORMINV:"LOGNORM.INV",POISSONDIST:"POISSON.DIST"};class Cl extends lr{fact(e,t){return this.runFunction(e.args,t,this.metadata("FACT"),(e=>{e=Math.trunc(e);let t=1;for(let n=1;n<=e;n++)t*=n;return t}))}factdouble(e,t){return this.runFunction(e.args,t,this.metadata("FACTDOUBLE"),(e=>{let t=1;for(let n=e=Math.trunc(e);n>=1;n-=2)t*=n;return t}))}combin(e,t){return this.runFunction(e.args,t,this.metadata("COMBIN"),((e,t)=>t>e?new Cn(sn.NUM,J.WrongOrder):El(e=Math.trunc(e),t=Math.trunc(t))))}combina(e,t){return this.runFunction(e.args,t,this.metadata("COMBINA"),((e,t)=>(e=Math.trunc(e))+(t=Math.trunc(t))-1>=1030?new Cn(sn.NUM,J.ValueLarge):0===e&&0===t?1:El(e+t-1,t)))}gcd(e,t){return this.runFunction(e.args,t,this.metadata("GCD"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof Cn)return t;let n=0;for(const e of t){if(e<0)return new Cn(sn.NUM,J.ValueSmall);n=Ml(n,Math.trunc(e))}return n>Number.MAX_SAFE_INTEGER?new Cn(sn.NUM,J.ValueLarge):n}))}lcm(e,t){return this.runFunction(e.args,t,this.metadata("LCM"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof Cn)return t;let n=1;for(const e of t){if(e<0)return new Cn(sn.NUM,J.ValueSmall);r=n,o=Math.trunc(e),n=0===r||0===o?0:r*(o/Ml(r,o))}var r,o;return n>Number.MAX_SAFE_INTEGER?new Cn(sn.NUM,J.ValueLarge):n}))}mround(e,t){return this.runFunction(e.args,t,this.metadata("MROUND"),((e,t)=>0===t?0:e>0&&t<0||e<0&&t>0?new Cn(sn.NUM,J.DistinctSigns):Math.round(e/t)*t))}multinomial(e,t){return this.runFunction(e.args,t,this.metadata("MULTINOMIAL"),((...e)=>{let t=0,n=1;for(let r of e){if(r<0)return new Cn(sn.NUM,J.ValueSmall);r=Math.trunc(r);for(let e=1;e<=r;e++)n*=(t+e)/e;t+=r}return Math.round(n)}))}quotient(e,t){return this.runFunction(e.args,t,this.metadata("QUOTIENT"),((e,t)=>0===t?new Cn(sn.DIV_BY_ZERO):Math.trunc(e/t)))}seriessum(e,t){return this.runFunction(e.args,t,this.metadata("SERIESSUM"),((e,t,n,r)=>{const o=this.arithmeticHelper.manyToOnlyNumbersDropNulls(r.valuesFromTopLeftCorner());if(o instanceof Cn)return o;let i=0;o.reverse();for(const t of o)i*=Math.pow(e,n),i+=t;return i*Math.pow(e,t)}))}sign(e,t){return this.runFunction(e.args,t,this.metadata("SIGN"),(e=>e>0?1:e<0?-1:0))}sumx2my2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2MY2"),((e,t)=>{const n=e.valuesFromTopLeftCorner(),r=t.valuesFromTopLeftCorner();if(n.length!==r.length)return new Cn(sn.NA,J.EqualLength);const o=n.length;let i=0;for(let e=0;e{const n=e.valuesFromTopLeftCorner(),r=t.valuesFromTopLeftCorner();if(n.length!==r.length)return new Cn(sn.NA,J.EqualLength);const o=n.length;let i=0;for(let e=0;e{const n=e.valuesFromTopLeftCorner(),r=t.valuesFromTopLeftCorner();if(n.length!==r.length)return new Cn(sn.NA,J.EqualLength);const o=n.length;let i=0;for(let e=0;ee&&(t=e-t);let n=1;for(let r=1;r<=t;r++)n*=(e-t+r)/r;return Math.round(n)}function Ml(e,t){for(e0;)[e,t]=[t,e%t];return e}Cl.implementedFunctions={FACT:{method:"fact",parameters:[{argumentType:ar.NUMBER,minValue:0,maxValue:170}]},FACTDOUBLE:{method:"factdouble",parameters:[{argumentType:ar.NUMBER,minValue:0,maxValue:288}]},COMBIN:{method:"combin",parameters:[{argumentType:ar.NUMBER,minValue:0,lessThan:1030},{argumentType:ar.NUMBER,minValue:0}]},COMBINA:{method:"combina",parameters:[{argumentType:ar.NUMBER,minValue:0},{argumentType:ar.NUMBER,minValue:0}]},GCD:{method:"gcd",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},LCM:{method:"lcm",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},MROUND:{method:"mround",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},MULTINOMIAL:{method:"multinomial",parameters:[{argumentType:ar.NUMBER}],repeatLastArgs:1,expandRanges:!0},QUOTIENT:{method:"quotient",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER}]},SERIESSUM:{method:"seriessum",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.RANGE}]},SIGN:{method:"sign",parameters:[{argumentType:ar.NUMBER}]},SUMX2MY2:{method:"sumx2my2",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},SUMX2PY2:{method:"sumx2py2",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},SUMXMY2:{method:"sumxmy2",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]}};class Tl extends lr{complex(e,t){return this.runFunction(e.args,t,this.metadata("COMPLEX"),((e,t,n)=>"i"!==n&&"j"!==n?new Cn(sn.VALUE,J.ShouldBeIorJ):Wn([e,t],n)))}imabs(e,t){return this.runFunction(e.args,t,this.metadata("IMABS"),Dl)}imaginary(e,t){return this.runFunction(e.args,t,this.metadata("IMAGINARY"),(([e,t])=>t))}imreal(e,t){return this.runFunction(e.args,t,this.metadata("IMREAL"),(([e,t])=>e))}imargument(e,t){return this.runFunction(e.args,t,this.metadata("IMARGUMENT"),(([e,t])=>0===e&&0===t?new Cn(sn.DIV_BY_ZERO):Math.atan2(t,e)))}imconjugate(e,t){return this.runFunction(e.args,t,this.metadata("IMCONJUGATE"),(([e,t])=>Wn([e,-t])))}imcos(e,t){return this.runFunction(e.args,t,this.metadata("IMCOS"),(e=>Wn(Ll(e))))}imcosh(e,t){return this.runFunction(e.args,t,this.metadata("IMCOSH"),(e=>Wn(xl(e))))}imcot(e,t){return this.runFunction(e.args,t,this.metadata("IMCOT"),(e=>Wn(Nl(Ll(e),Ol(e)))))}imcsc(e,t){return this.runFunction(e.args,t,this.metadata("IMCSC"),(e=>Wn(Nl([1,0],Ol(e)))))}imcsch(e,t){return this.runFunction(e.args,t,this.metadata("IMCSCH"),(e=>Wn(Nl([1,0],Il(e)))))}imsec(e,t){return this.runFunction(e.args,t,this.metadata("IMSEC"),(e=>Wn(Nl([1,0],Ll(e)))))}imsech(e,t){return this.runFunction(e.args,t,this.metadata("IMSECH"),(e=>Wn(Nl([1,0],xl(e)))))}imsin(e,t){return this.runFunction(e.args,t,this.metadata("IMSIN"),(e=>Wn(Ol(e))))}imsinh(e,t){return this.runFunction(e.args,t,this.metadata("IMSINH"),(e=>Wn(Il(e))))}imtan(e,t){return this.runFunction(e.args,t,this.metadata("IMTAN"),(e=>Wn(Nl(Ol(e),Ll(e)))))}imdiv(e,t){return this.runFunction(e.args,t,this.metadata("IMDIV"),((e,t)=>Wn(Nl(e,t))))}improduct(e,t){return this.runFunction(e.args,t,this.metadata("IMPRODUCT"),((...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof Cn)return t;let n=[1,0];for(const e of t)n=Al(n,e);return Wn(n)}))}imsum(e,t){return this.runFunction(e.args,t,this.metadata("IMSUM"),((...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof Cn)return t;let n=[0,0];for(const e of t)n=Rl(n,e);return Wn(n)}))}imsub(e,t){return this.runFunction(e.args,t,this.metadata("IMSUB"),((e,t)=>Wn(function([e,t],[n,r]){return[e-n,t-r]}(e,t))))}imexp(e,t){return this.runFunction(e.args,t,this.metadata("IMEXP"),(e=>Wn(kl(e))))}imln(e,t){return this.runFunction(e.args,t,this.metadata("IMLN"),(e=>Wn(Pl(e))))}imlog10(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG10"),(e=>{const[t,n]=Pl(e),r=Math.log(10);return Wn([t/r,n/r])}))}imlog2(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG2"),(e=>{const[t,n]=Pl(e),r=Math.log(2);return Wn([t/r,n/r])}))}impower(e,t){return this.runFunction(e.args,t,this.metadata("IMPOWER"),((e,t)=>Wn(Hl(e,t))))}imsqrt(e,t){return this.runFunction(e.args,t,this.metadata("IMSQRT"),(e=>Wn(Hl(e,.5))))}}function Rl([e,t],[n,r]){return[e+n,t+r]}function Al([e,t],[n,r]){return[e*n-t*r,e*r+n*t]}function Nl([e,t],[n,r]){const o=Math.pow(n,2)+Math.pow(r,2),[i,s]=Al([e,t],[n,-r]);return[i/o,s/o]}function Ll([e,t]){return[Math.cos(e)*Math.cosh(t),-Math.sin(e)*Math.sinh(t)]}function xl([e,t]){return[Math.cosh(e)*Math.cos(t),Math.sinh(e)*Math.sin(t)]}function Ol([e,t]){return[Math.sin(e)*Math.cosh(t),Math.cos(e)*Math.sinh(t)]}function Il([e,t]){return[Math.sinh(e)*Math.cos(t),Math.cosh(e)*Math.sin(t)]}function kl([e,t]){return[Math.exp(e)*Math.cos(t),Math.exp(e)*Math.sin(t)]}function Dl([e,t]){return Math.sqrt(e*e+t*t)}function Pl([e,t]){return[Math.log(Dl([e,t])),Math.atan2(t,e)]}function Hl(e,t){const[n,r]=Pl(e);return kl([t*n,t*r])}Tl.implementedFunctions={COMPLEX:{method:"complex",parameters:[{argumentType:ar.NUMBER},{argumentType:ar.NUMBER},{argumentType:ar.STRING,defaultValue:"i"}]},IMABS:{method:"imabs",parameters:[{argumentType:ar.COMPLEX}]},IMAGINARY:{method:"imaginary",parameters:[{argumentType:ar.COMPLEX}]},IMREAL:{method:"imreal",parameters:[{argumentType:ar.COMPLEX}]},IMARGUMENT:{method:"imargument",parameters:[{argumentType:ar.COMPLEX}]},IMCONJUGATE:{method:"imconjugate",parameters:[{argumentType:ar.COMPLEX}]},IMCOS:{method:"imcos",parameters:[{argumentType:ar.COMPLEX}]},IMCOSH:{method:"imcosh",parameters:[{argumentType:ar.COMPLEX}]},IMCOT:{method:"imcot",parameters:[{argumentType:ar.COMPLEX}]},IMCSC:{method:"imcsc",parameters:[{argumentType:ar.COMPLEX}]},IMCSCH:{method:"imcsch",parameters:[{argumentType:ar.COMPLEX}]},IMSEC:{method:"imsec",parameters:[{argumentType:ar.COMPLEX}]},IMSECH:{method:"imsech",parameters:[{argumentType:ar.COMPLEX}]},IMSIN:{method:"imsin",parameters:[{argumentType:ar.COMPLEX}]},IMSINH:{method:"imsinh",parameters:[{argumentType:ar.COMPLEX}]},IMTAN:{method:"imtan",parameters:[{argumentType:ar.COMPLEX}]},IMDIV:{method:"imdiv",parameters:[{argumentType:ar.COMPLEX},{argumentType:ar.COMPLEX}]},IMPRODUCT:{method:"improduct",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},IMSUM:{method:"imsum",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},IMSUB:{method:"imsub",parameters:[{argumentType:ar.COMPLEX},{argumentType:ar.COMPLEX}]},IMEXP:{method:"imexp",parameters:[{argumentType:ar.COMPLEX}]},IMLN:{method:"imln",parameters:[{argumentType:ar.COMPLEX}]},IMLOG10:{method:"imlog10",parameters:[{argumentType:ar.COMPLEX}]},IMLOG2:{method:"imlog2",parameters:[{argumentType:ar.COMPLEX}]},IMPOWER:{method:"impower",parameters:[{argumentType:ar.COMPLEX},{argumentType:ar.NUMBER}]},IMSQRT:{method:"imsqrt",parameters:[{argumentType:ar.COMPLEX}]}};class Fl extends lr{avedev(e,t){return this.runFunction(e.args,t,this.metadata("AVEDEV"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof Cn)return t;if(0===t.length)return new Cn(sn.DIV_BY_ZERO);const n=gl(t);return t.reduce(((e,t)=>e+Math.abs(t-n)),0)/t.length}))}devsq(e,t){return this.runFunction(e.args,t,this.metadata("DEVSQ"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof Cn?t:0===t.length?0:yl(t)}))}geomean(e,t){return this.runFunction(e.args,t,this.metadata("GEOMEAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof Cn)return t;if(0===t.length)return new Cn(sn.NUM,J.OneValue);for(const e of t)if(e<=0)return new Cn(sn.NUM,J.ValueSmall);return n=t,Math.pow(function(e){for(var t=1,n=e.length;--n>=0;)t*=e[n];return t}(n),1/n.length);var n}))}harmean(e,t){return this.runFunction(e.args,t,this.metadata("HARMEAN"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof Cn)return t;if(0===t.length)return new Cn(sn.NUM,J.OneValue);for(const e of t)if(e<=0)return new Cn(sn.NUM,J.ValueSmall);return t.length/t.reduce(((e,t)=>e+1/t),0)}))}correl(e,t){return this.runFunction(e.args,t,this.metadata("CORREL"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new Cn(sn.NA,J.EqualLength);const n=Yl(e,t);return n instanceof Cn?n:n[0].length<=1?new Cn(sn.DIV_BY_ZERO,J.TwoValues):bl(n[0],n[1])}))}rsq(e,t){return this.runFunction(e.args,t,this.metadata("RSQ"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new Cn(sn.NA,J.EqualLength);const n=Yl(e,t);return n instanceof Cn?n:n[0].length<=1?new Cn(sn.DIV_BY_ZERO,J.TwoValues):Math.pow(bl(n[0],n[1]),2)}))}covariancep(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.P"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new Cn(sn.NA,J.EqualLength);const n=Yl(e,t);if(n instanceof Cn)return n;const r=n[0].length;return r<1?new Cn(sn.DIV_BY_ZERO,J.OneValue):1===r?0:_l(n[0],n[1])*(r-1)/r}))}covariances(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.S"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new Cn(sn.NA,J.EqualLength);const n=Yl(e,t);return n instanceof Cn?n:n[0].length<=1?new Cn(sn.DIV_BY_ZERO,J.TwoValues):_l(n[0],n[1])}))}ztest(e,t){return this.runFunction(e.args,t,this.metadata("Z.TEST"),((e,t,n)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(r instanceof Cn)return r;const o=r.length;if(void 0===n){if(o<2)return new Cn(sn.DIV_BY_ZERO,J.TwoValues);n=vl(r,!0)}return o<1?new Cn(sn.NA,J.OneValue):0===n?new Cn(sn.DIV_BY_ZERO):1-$a((gl(r)-t)/(n/Math.sqrt(o)),0,1)}))}ftest(e,t){return this.runFunction(e.args,t,this.metadata("F.TEST"),((e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),r=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(n instanceof Cn)return n;if(r instanceof Cn)return r;if(n.length<=1||r.length<=1)return new Cn(sn.DIV_BY_ZERO);const o=wl(n,!0),i=wl(r,!0);if(0===o||0===i)return new Cn(sn.DIV_BY_ZERO);const s=ll(o/i,n.length-1,r.length-1);return 2*Math.min(s,1-s)}))}steyx(e,t){return this.runFunction(e.args,t,this.metadata("STEYX"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new Cn(sn.NA,J.EqualLength);const n=Yl(e,t);if(n instanceof Cn)return n;const r=n[0].length;return r<=2?new Cn(sn.DIV_BY_ZERO,J.ThreeValues):Math.sqrt((yl(n[0])-Math.pow(_l(n[0],n[1])*(r-1),2)/yl(n[1]))/(r-2))}))}slope(e,t){return this.runFunction(e.args,t,this.metadata("SLOPE"),((e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new Cn(sn.NA,J.EqualLength);const n=Yl(e,t);if(n instanceof Cn)return n;const r=n[0].length;return r<=1?new Cn(sn.DIV_BY_ZERO,J.TwoValues):_l(n[0],n[1])*(r-1)/yl(n[1])}))}chisqtest(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.TEST"),((e,t)=>{const n=e.height(),r=e.width();if(t.height()!==n||t.width()!==r)return new Cn(sn.NA,J.EqualLength);const o=Yl(e,t);if(o instanceof Cn)return o;if(o[0].length<=1)return new Cn(sn.DIV_BY_ZERO,J.TwoValues);let i=0;for(let e=0;e1&&r>1?(n-1)*(r-1):n*r-1)}))}ttest(e,t){return this.runFunction(e.args,t,this.metadata("T.TEST"),((e,t,n,r)=>{const o=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),i=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(o instanceof Cn)return o;if(i instanceof Cn)return i;const s=o.length,a=i.length;if(1===r){if(a!==s)return new Cn(sn.NA,J.EqualLength);if(s<=1)return new Cn(sn.DIV_BY_ZERO,J.TwoValues);const e=Array(s);for(let t=0;t{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof Cn)return t;const n=t.length;if(n<3)return new Cn(sn.DIV_BY_ZERO,J.ThreeValues);const r=gl(t),o=vl(t,!0);return 0===o?new Cn(sn.DIV_BY_ZERO):t.reduce(((e,t)=>e+Math.pow((t-r)/o,3)),0)*n/(n-1)/(n-2)}))}skewp(e,t){return this.runFunction(e.args,t,this.metadata("SKEW.P"),((...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof Cn)return t;const n=t.length;if(n<3)return new Cn(sn.DIV_BY_ZERO,J.ThreeValues);const r=gl(t),o=vl(t,!1);return 0===o?new Cn(sn.DIV_BY_ZERO):t.reduce(((e,t)=>e+Math.pow((t-r)/o,3)),0)/n}))}}function Yl(e,t){const n=e.iterateValuesFromTopLeftCorner(),r=t.iterateValuesFromTopLeftCorner();let o,i;const s=[],a=[];for(;o=n.next(),i=r.next(),!o.done&&!i.done;){const e=o.value,t=i.value;if(e instanceof Cn)return e;if(t instanceof Cn)return t;Je(e)&&Je(t)&&(s.push(je(e)),a.push(je(t)))}return[s,a]}Fl.implementedFunctions={AVEDEV:{method:"avedev",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},DEVSQ:{method:"devsq",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},GEOMEAN:{method:"geomean",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},HARMEAN:{method:"harmean",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},CORREL:{method:"correl",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},RSQ:{method:"rsq",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},"COVARIANCE.P":{method:"covariancep",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},"COVARIANCE.S":{method:"covariances",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},"Z.TEST":{method:"ztest",parameters:[{argumentType:ar.RANGE},{argumentType:ar.NUMBER},{argumentType:ar.NUMBER,optionalArg:!0}]},"F.TEST":{method:"ftest",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},STEYX:{method:"steyx",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},SLOPE:{method:"slope",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},"CHISQ.TEST":{method:"chisqtest",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE}]},"T.TEST":{method:"ttest",parameters:[{argumentType:ar.RANGE},{argumentType:ar.RANGE},{argumentType:ar.INTEGER,minValue:1,maxValue:2},{argumentType:ar.INTEGER,minValue:1,maxValue:3}]},SKEW:{method:"skew",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1},"SKEW.P":{method:"skewp",parameters:[{argumentType:ar.ANY}],repeatLastArgs:1}},Fl.aliases={COVAR:"COVARIANCE.P",FTEST:"F.TEST",PEARSON:"CORREL",ZTEST:"Z.TEST",CHITEST:"CHISQ.TEST",TTEST:"T.TEST",COVARIANCEP:"COVARIANCE.P",COVARIANCES:"COVARIANCE.S",SKEWP:"SKEW.P"};class Vl extends Yi{}Vl.HyperFormula=Yi,Vl.ErrorType=sn,Vl.CellError=Cn,Vl.CellType=an,Vl.CellValueType=vn,Vl.CellValueDetailedType=_n,Vl.DetailedCellError=cr,Vl.ExportedCellChange=ai,Vl.ExportedNamedExpressionChange=li,Vl.ConfigValueTooBigError=Rt,Vl.ConfigValueTooSmallError=Tt,Vl.EvaluationSuspendedError=Nt,Vl.ExpectedOneOfValuesError=At,Vl.ExpectedValueOfTypeError=Et,Vl.ArraySize=ur,Vl.SimpleRangeValue=nt,Vl.EmptyValue=We,Vl.FunctionPlugin=lr,Vl.FunctionArgumentType=ar,Vl.FunctionPluginValidationError=kt,Vl.InvalidAddressError=mt,Vl.InvalidArgumentsError=pt,Vl.LanguageNotRegisteredError=Ot,Vl.LanguageAlreadyRegisteredError=It,Vl.MissingTranslationError=Lt,Vl.NamedExpressionDoesNotExistError=wt,Vl.NamedExpressionNameIsAlreadyTakenError=gt,Vl.NamedExpressionNameIsInvalidError=yt,Vl.NoOperationToRedoError=_t,Vl.NoOperationToUndoError=vt,Vl.NoRelativeAddressesAllowedError=Ft,Vl.NoSheetWithIdError=lt,Vl.NoSheetWithNameError=ut,Vl.NotAFormulaError=dt,Vl.NothingToPasteError=bt,Vl.ProtectedFunctionTranslationError=xt,Vl.SheetNameAlreadyTakenError=ht,Vl.SheetSizeLimitExceededError=ct,Vl.SourceLocationHasArrayError=Pt,Vl.TargetLocationHasArrayError=Ht,Vl.UnableToParseError=Ct;const Ul=Ui.defaultConfig.language;Yi.registerLanguage(Ul,Wi),Yi.languages[Wi.langCode]=Wi;for(const e of Object.getOwnPropertyNames(i))e.startsWith("_")||Yi.registerFunctionPlugin(i[e])},37237:(e,t,n)=>{"use strict";n.d(t,{um:()=>rS}),n(16280),n(44114),n(98992),n(54520),n(72577),n(8872);var r=n(95239),o=n(20091),i=n(25155),s=n(32919),a=n(79720);const l="handsontableEditor";class u extends r.t{static get EDITOR_TYPE(){return"handsontable"}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),"none"===e.display&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),(0,o.vZ)(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,t,n,r,o,i){super.prepare(e,t,n,r,o,i);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(e,t){const n=this.getSourceData(t.row,t.col);void 0!==n&&a.setValue(n),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&(0,s.X$)(l,i.handsontable),this.htOptions=l}beginEditing(e,t){const n=this.hot.getSettings().onBeginEditing;n&&!1===n()||super.beginEditing(e,t)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,t,n){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const e=this.htEditor.getValue();void 0!==e&&this.setValue(e)}super.finishEditing(e,t,n)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",(()=>{var e;null===(e=this.htEditor)||void 0===e||e.destroy()})),this.hot.addHook("afterSetTheme",((e,t)=>{var n;t||null===(n=this.htEditor)||void 0===n||n.useTheme(e)}))}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const t={group:l,relativeToGroup:a.b,position:"before"},n=(e,t)=>{const n=this.htEditor;if(void 0!==e&&(e<0||n.flipped&&e>n.countRows()-1?n.deselectCell():n.selectCell(e,0),n.getData().length))return t.preventDefault(),(0,i.CA)(t),this.hot.listen(),this.TEXTAREA.focus(),!1};e.addShortcuts([{keys:[["ArrowUp"]],callback:e=>{const t=this.htEditor;let r,o;return!t.getSelectedLast()&&t.flipped?r=t.countRows()-1:t.getSelectedLast()&&(t.flipped?(o=t.getSelectedLast()[0],r=Math.max(0,o-1)):(o=t.getSelectedLast()[0],r=o-1)),n(r,e)},preventDefault:!1},{keys:[["ArrowDown"]],callback:e=>{const t=this.htEditor;let r,o;if(t.getSelectedLast()||t.flipped){if(t.getSelectedLast())if(t.flipped)r=t.getSelectedLast()[0]+1;else if(!t.flipped){const e=t.countRows()-1;o=t.getSelectedLast()[0],r=Math.min(e,o+1)}}else r=0;return n(r,e)},preventDefault:!1}],t)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(l)}}var h=n(77325),c=n(65615),d=n(24360),m=n(38419),p=n(92182),f=n(66422),g=n(83986);function y(e,t,n){w(e,t),t.set(e,n)}function w(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){return e.get(b(e,t))}function b(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var S=new WeakMap,C=new WeakMap,E=new WeakSet;class M extends u{constructor(){var e;super(...arguments),w(this,e=E),e.add(this),v(this,"query",null),v(this,"strippedChoices",[]),v(this,"rawChoices",[]),y(this,S,this.hot.guid.slice(0,9)),y(this,C,(0,g.sg)((()=>{this.focus()}),100)),v(this,"sortByRelevance",(function(e,t,n){const r=[],o=[],i=e.length;let s,a,l,u,h=t.length;if(0===i){for(l=0;l{if(-1===t.index)return-1;if(-1===e.index)return 1;if(e.indext.charsLeft)return 1}return 0})),l=0,h=r.length;lthis.stripValueIfNeeded(e)===this.TEXTAREA.value));return(0,c.O9)(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),(0,o.iQ)(this.htContainer,"autocompleteEditor"),(0,o.iQ)(this.htContainer,-1===this.hot.rootWindow.navigator.platform.indexOf("Mac")?"":"htMacScroll"),this.hot.getSettings().ariaTags&&(0,o.Bq)(this.TEXTAREA,[(0,f.ZW)(),(0,f.B6)(),(0,f.wP)("listbox"),(0,f.gq)()])}prepare(e,t,n,r,i,s){super.prepare(e,t,n,r,i,s),this.hot.getSettings().ariaTags&&(0,o.Bq)(this.TEXTAREA,[(0,f.dV)("false"),(0,f.Ku)(`${_(S,this)}-listbox-${e}-${t}`)])}open(){super.open();const e=void 0===this.cellProperties.trimDropdown||this.cellProperties.trimDropdown,t=this.hot.getSettings().ariaTags,n=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,r=null==n?void 0:n.length,{row:i,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",(e=>this.onBeforeKeyDown(e))),this.htEditor.addHook("afterScroll",_(C,this)),this.htEditor.updateSettings({colWidths:e?[(0,o.Gq)(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(e,i,s,a,l,u,h)=>{(0,p.F)(e,i,s,a,l,u,h);const{filteringCaseSensitive:d,allowHtml:m,locale:g}=this.cellProperties,y=this.query;let w,v,_=(0,c.As)(u);_&&!m&&(w=!0===d?_.indexOf(y):_.toLocaleLowerCase(g).indexOf(y.toLocaleLowerCase(g)),-1!==w&&(v=_.substr(w,y.length),_=_.replace(v,`${v}`))),t&&(0,o.Bq)(i,[(0,f.n)(),...n?[(0,f.DY)(r)]:[],...n?[(0,f.Vy)(n.indexOf(u)+1)]:[],["id",`${this.htEditor.rootElement.id}_${s}-${a}`]]),i.innerHTML=_},afterSelectionEnd:(e,n)=>{if(t){const t=e=>{(0,o.Bq)(e,[(0,f.H0)()]),(0,o.Bq)(this.TEXTAREA,...(0,f.VN)(e.id))},r=this.htEditor.getCell(e,n,!0);null!==r?t(r):this.htEditor.addHookOnce("afterScrollVertically",(()=>{const r=this.htEditor.getCell(e,n,!0);t(r)}))}}}),t&&((0,o.Bq)(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...(0,f.gg)()),(0,o.Bq)(this.htEditor.rootElement,[(0,f.$o)(),(0,f.S2)("polite"),(0,f.rE)("text"),["id",`${_(S,this)}-listbox-${i}-${s}`]]),(0,o.Bq)(this.TEXTAREA,...(0,f.dV)("true"))),this.hot._registerTimeout((()=>{this.queryChoices(this.TEXTAREA.value)}))}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&(0,o.Bq)(this.TEXTAREA,[(0,f.dV)("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const t=this.cellProperties.source;this.query=e,"function"==typeof t?t.call(this.cellProperties,e,(e=>{this.rawChoices=e,this.updateChoicesList(this.stripValuesIfNeeded(e))})):Array.isArray(t)?(this.rawChoices=t,this.updateChoicesList(this.stripValuesIfNeeded(t))):this.updateChoicesList([])}updateChoicesList(e){const t=(0,o.JC)(this.TEXTAREA),n=(0,o.Xu)(this.TEXTAREA),r=this.cellProperties.sortByRelevance,i=this.cellProperties.filter;let s=null,a=null,l=e;r&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(!1===i)u&&(a=s[0]);else{const e=[];for(let t=0,n=l.length;t0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),!0===this.cellProperties.strict&&this.highlightBestMatchingChoice(a)),this.hot.listen(),(0,o.vZ)(this.TEXTAREA,t,t===n?void 0:n)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),t=e.height;let n=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const e=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;n=Math.max(n+e,0)}const r=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-n-t,i=r>o&&n>o+t;return i?this.flipDropdown(r):this.unflipDropdown(),this.limitDropdownIfNeeded(i?n:o,r),i}limitDropdownIfNeeded(e,t){if(t>e){let n=0,r=0,o=0,i=null;do{o=this.htEditor.getRowHeight(r)||this.htEditor.view.getDefaultRowHeight(),n+=o,r+=1}while(nt)).reduce(((e,t)=>e+(this.htEditor.getRowHeight(t)||this.htEditor.view.getDefaultRowHeight())),0)+t+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),t=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+t}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:t}=this.cellProperties,n=(0,h.YD)(e,(e=>(0,c.As)(e)));return(0,h.YD)(n,(e=>t?e:(0,d.Kq)(e)))}allowKeyEventPropagation(e){const t=this.htEditor.getSelectedRangeLast(),n=t?t.from.row:-1;let r=!1;return e===m.Lb.ARROW_DOWN&&n>0&&n-1&&(r=!0),r}onBeforeKeyDown(e){if((0,m.aE)(e.keyCode)||e.keyCode===m.Lb.BACKSPACE||e.keyCode===m.Lb.DELETE||e.keyCode===m.Lb.INSERT){let t=10;if(e.keyCode===m.Lb.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(t+=10),this.htEditor&&this.hot._registerTimeout((()=>{this.queryChoices(this.TEXTAREA.value)}),t)}}}function T(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+(0,o.XJ)(this.hot.rootDocument)})}var R=n(32564);class A extends R.b7{static get EDITOR_TYPE(){return"checkbox"}beginEditing(e,t){if(t&&"mouseup"===t.type&&"TD"===t.target.nodeName){const e=this.TD.querySelector('input[type="checkbox"]');(0,o.nB)(e,"htBadValue")||e.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}var N=n(95093);const L=()=>window,x=()=>window.document,O=(e,t)=>window.setTimeout(e,t),I=function(e,t,n,r){e.addEventListener(t,n,!!r)},k=function(e,t,n,r){e.removeEventListener(t,n,!!r)},D=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},P=function(e,t){D(e,t)||(e.className=""===e.className?t:e.className+" "+t)},H=function(e,t){var n;e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,"")},F=function(e){return/Array/.test(Object.prototype.toString.call(e))},Y=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},V=function(e){let t=e.getDay();return 0===t||6===t},U=function(e){return e%4==0&&e%100!=0||e%400==0},B=function(e,t){return[31,U(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},W=function(e){Y(e)&&e.setHours(0,0,0,0)},j=function(e,t){return e.getTime()===t.getTime()},z=function(e,t,n){let r,o;for(r in t)o=void 0!==e[r],o&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?Y(t[r])?n&&(e[r]=new Date(t[r].getTime())):F(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=z({},t[r],n):!n&&o||(e[r]=t[r]);return e},G=function(e,t,n){let r=x().createEvent("HTMLEvents");r.initEvent(t,!0,!1),r=z(r,n),e.dispatchEvent(r)},$=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},K={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},X=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},q=function(e){let t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},Q=function(e,t,n,r,o){let i=new Date(r,n,t),s=e.hasMoment?e.moment(i).isoWeek():function(e,t){e.setHours(0,0,0,0);let n=e.getDate(),r=e.getDay(),o=t,i=o-1,s=function(e){return(e+7-1)%7};e.setDate(n+i-s(r));let a=new Date(e.getFullYear(),0,o),l=(e.getTime()-a.getTime())/864e5;return 1+Math.round((l-i+s(a.getDay()))/7)}(i,o);return''+s+""},J=function(e,t,n,r){return''+(t?e.reverse():e).join("")+""},Z=function(e,t,n,r,o,i){let s,a,l,u,h,c=e._o,d=n===c.minYear,m=n===c.maxYear,p='
',f=!0,g=!0;for(l=[],s=0;s<12;s++)l.push('");for(u='
'+c.i18n.months[r]+'
",F(c.yearRange)?(s=c.yearRange[0],a=c.yearRange[1]+1):(s=n-c.yearRange,a=1+n+c.yearRange),l=[];s=c.minYear&&l.push('");return h='
'+n+c.yearSuffix+'
",c.showMonthAfterYear?p+=h+u:p+=u+h,d&&(0===r||c.minMonth>=r)&&(f=!1),m&&(11===r||c.maxMonth<=r)&&(g=!1),0===t&&(p+='"),t===e._o.numberOfMonths-1&&(p+='"),p+"
"};function ee(e){let t=this,n=t.config(e);t._onMouseDown=function(e){if(!t._v)return;let r=(e=e||L().event).target||e.srcElement;if(r)if(D(r,"is-disabled")||(!D(r,"pika-button")||D(r,"is-empty")||D(r.parentNode,"is-disabled")?D(r,"pika-prev")?t.prevMonth():D(r,"pika-next")&&t.nextMonth():(t.setDate(new Date(r.getAttribute("data-pika-year"),r.getAttribute("data-pika-month"),r.getAttribute("data-pika-day"))),n.bound&&O((function(){t.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()}),100))),D(r,"pika-select"))t._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}},t._onChange=function(e){let n=(e=e||L().event).target||e.srcElement;n&&(D(n,"pika-select-month")?t.gotoMonth(n.value):D(n,"pika-select-year")&&t.gotoYear(n.value))},t._onKeyChange=function(e){if(e=e||L().event,t.isVisible())switch(e.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:t.adjustDate("subtract",1);break;case 38:t.adjustDate("subtract",7);break;case 39:t.adjustDate("add",1);break;case 40:t.adjustDate("add",7);break;case 8:case 46:t.setDate(null)}},t._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let e=this.moment(n.field.value,n.format,n.formatStrict);return e&&e.isValid()?e.toDate():null}return new Date(Date.parse(n.field.value))},t._onInputChange=function(e){let n;e.firedBy!==t&&(n=t._parseFieldValue(),Y(n)&&t.setDate(n),t._v||t.show())},t._onInputFocus=function(){t.show()},t._onInputClick=function(){t.show()},t._onInputBlur=function(){let e=x().activeElement;do{if(D(e,"pika-single"))return}while(e=e.parentNode);t._c||(t._b=O((function(){t.hide()}),50)),t._c=!1},t._onClick=function(e){let r=(e=e||L().event).target||e.srcElement,o=r;if(r){!hasEventListeners&&D(r,"pika-select")&&(r.onchange||(r.setAttribute("onchange","return;"),I(r,"change",t._onChange)));do{if(D(o,"pika-single")||o===n.trigger)return}while(o=o.parentNode);t._v&&r!==n.trigger&&o!==n.trigger&&t.hide()}},t.el=x().createElement("div"),t.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),I(t.el,"mousedown",t._onMouseDown,!0),I(t.el,"touchend",t._onMouseDown,!0),I(t.el,"change",t._onChange),n.keyboardInput&&I(x(),"keydown",t._onKeyChange),n.field&&(n.container?n.container.appendChild(t.el):n.bound?x().body.appendChild(t.el):n.field.parentNode.insertBefore(t.el,n.field.nextSibling),I(n.field,"change",t._onInputChange),n.defaultDate||(n.defaultDate=t._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;Y(r)?n.setDefaultDate?t.setDate(r,!0):t.gotoDate(r):t.gotoDate(new Date),n.bound?(this.hide(),t.el.className+=" is-bound",I(n.trigger,"click",t._onInputClick),I(n.trigger,"focus",t._onInputFocus),I(n.trigger,"blur",t._onInputBlur)):this.show()}ee.prototype={config:function(e){this._o||(this._o=z({},K,!0));let t=z(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;let n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,Y(t.minDate)||(t.minDate=!1),Y(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(e){return e=e||this._o.format,Y(this._d)?this._o.toString?this._o.toString(this._d,e):this.hasMoment?this.moment(this._d).format(e):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(e,t){this.hasMoment&&this.moment.isMoment(e)&&this.setDate(e.toDate(),t)},useMoment:function(e){this.hasMoment=!0,this.moment=e},getDate:function(){return Y(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",G(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),!Y(e))return;let n=this._o.minDate,r=this._o.maxDate;Y(n)&&er&&(e=r),this._d=new Date(e.getTime()),W(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),G(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(e){let t=!0;if(Y(e)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=o=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s));for(let e=0;e";this.el.innerHTML=a,n.bound&&"hidden"!==n.field.type&&O((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label",n.ariaLabel)},adjustPosition:function(){let e,t,n,r,o,i,s,a,l,u,h;this._o.container||(this.el.style.position="absolute",e=this._o.trigger,t=this.el.offsetWidth,n=this.el.offsetHeight,r=L().innerWidth||x().documentElement.clientWidth,o=L().innerHeight||x().documentElement.clientHeight,i=x().body.scrollTop||x().documentElement.scrollTop,u=!0,h=!0,l=e.getBoundingClientRect(),s=l.left+L().pageXOffset,a=l.bottom+L().pageYOffset,(this._o.reposition&&s+t>r||this._o.position.indexOf("right")>-1&&s-t+e.offsetWidth>0)&&(s=s-t+e.offsetWidth,u=!1),(this._o.reposition&&a+n>o+i||this._o.position.indexOf("top")>-1&&a-n-e.offsetHeight>0)&&(a=a-n-e.offsetHeight,h=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",P(this.el,u?"left-aligned":"right-aligned"),P(this.el,h?"bottom-aligned":"top-aligned"),H(this.el,u?"right-aligned":"left-aligned"),H(this.el,h?"top-aligned":"bottom-aligned"))},render:function(e,t,n){let r=this._o,o=new Date,i=B(e,t),s=new Date(e,t,1).getDay(),a=[],l=[];W(o),r.firstDay>0&&(s-=r.firstDay,s<0&&(s+=7));let u=0===t?11:t-1,h=11===t?0:t+1,c=0===t?e-1:e,d=11===t?e+1:e,m=B(c,u),p=i+s,f=p;for(;f>7;)f-=7;p+=7-f;let g=!1;for(let n=0,f=0;n=i+s,b=n-s+1,S=t,C=e,E=r.startRange&&j(r.startRange,p),M=r.endRange&&j(r.endRange,p),T=r.startRange&&r.endRange&&r.startRanger.maxDate||r.disableWeekends&&V(p)||r.disableDayFn&&r.disableDayFn(p),isEmpty:_,isStartRange:E,isEndRange:M,isInRange:T,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&y&&(g=!0),l.push(q(R)),7===++f&&(r.showWeekNumber&&l.unshift(Q(this,n-s,t,e,r.firstWeekOfYearMinDays)),a.push(J(l,r.isRTL,r.pickWholeWeek,g)),l=[],f=0,g=!1)}return function(e,t,n){return''+function(e){let t,n=[];for(e.showWeekNumber&&n.push(""),t=0;t<7;t++)n.push('");return""+(e.isRTL?n.reverse():n).join("")+""}(e)+""+t.join("")+"
'+X(e,t,!0)+"
"}(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),H(this.el,"is-hidden"),this._o.bound&&(I(x(),"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){let e=this._v;!1!==e&&(this._o.bound&&k(x(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),P(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){let e=this._o;this.hide(),k(this.el,"mousedown",this._onMouseDown,!0),k(this.el,"touchend",this._onMouseDown,!0),k(this.el,"change",this._onChange),e.keyboardInput&&k(x(),"keydown",this._onKeyChange),e.field&&(k(e.field,"change",this._onInputChange),e.bound&&(k(e.trigger,"click",this._onInputClick),k(e.trigger,"focus",this._onInputFocus),k(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};var te=n(58002);function ne(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const oe="date",ie="dateEditor";var se=new WeakSet;class ae extends r.t{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=se),t.add(e),ne(this,"parentDestroyed",!1),ne(this,"$datePicker",null)}static get EDITOR_TYPE(){return oe}init(){if("function"!=typeof N)throw new Error("You need to include moment.js to your project.");super.init(),this.hot.addHook("afterDestroy",(()=>{this.parentDestroyed=!0,this.destroyElements()})),this.hot.addHook("afterSetTheme",((e,t)=>{t||((0,o.vy)(this.datePicker,/ht-theme-.*/g),(0,o.iQ)(this.datePicker,e))}))}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),(0,o.iQ)(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();(0,o.vy)(this.datePicker,/ht-theme-.*/g),(0,o.iQ)(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",(e=>{(0,o.nB)(e.target,"pika-day")&&this.hideDatepicker(),e.stopPropagation()}))}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,t,n,r,o,i){super.prepare(e,t,n,r,o,i)}open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),t.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:ie})}close(){var e;this._opened=!1,null!==(e=this.$datePicker)&&void 0!==e&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout((()=>{const e=this.hot._getEditorManager();e.closeEditor(),this.hot.view.render(),e.prepareEditor()})),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(ie),super.close()}finishEditing(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.finishEditing(e,t)}showDatepicker(e){const t=re(se,this,le).call(this),n=this.hot.view.isMouseDown(),r=!!e&&(0,m.Yf)(e.keyCode);let o;this.datePicker.style.display="block",this.$datePicker=new ee(this.getDatePickerConfig()),"function"==typeof this.$datePicker.useMoment&&this.$datePicker.useMoment(N),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,N(o,t,!0).isValid()&&this.$datePicker.setMoment(N(o,t),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),r||n||this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,N(o,t,!0).isValid()&&this.$datePicker.setMoment(N(o,t),!0),r||n||this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const t=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&(0,s.zw)(n,this.cellProperties.datePickerConfig);const r=n.onSelect,o=n.onClose;return n.field=t,n.trigger=t,n.container=this.datePicker,n.bound=!1,n.keyboardInput=!1,n.format=null!==(e=n.format)&&void 0!==e?e:re(se,this,le).call(this),n.reposition=n.reposition||!1,n.isRTL=!1,n.onSelect=e=>{let t=e;isNaN(t.getTime())||(t=N(t).format(re(se,this,le).call(this))),this.setValue(t),r&&r(),(0,te.rr)()&&this.hideDatepicker()},n.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},n}refreshDimensions(e){var t;if(super.refreshDimensions(e),this.state!==R._T.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD)return void this.hideDatepicker();const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{wtOverlays:i}=this.hot.view._wt,{wtTable:s}=null!==(t=i.getParentOverlay(this.TD))&&void 0!==t?t:this.hot.view._wt,a=n.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=n.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),h=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=h){const e=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+e.top+(0,o.DK)(this.TD)}px`;let t=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?t+=e.right-(0,o.Gq)(this.datePicker):t+=e.left,this.datePickerStyle.left=`${t}px`}else this.hideDatepicker()}}function le(){var e;return null!==(e=this.cellProperties.dateFormat)&&void 0!==e?e:"DD/MM/YYYY"}class ue extends M{static get EDITOR_TYPE(){return"dropdown"}prepare(e,t,n,r,o,i){i.filter=!1,i.strict=!0,super.prepare(e,t,n,r,o,i)}}class he extends r.t{static get EDITOR_TYPE(){return"numeric"}}var ce=n(83023);class de extends r.t{constructor(){var e,t,n;super(...arguments),e=this,t="autoResize",n=(0,ce.j)(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}),(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}static get EDITOR_TYPE(){return"password"}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,(0,o.Ie)(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const me="ht_editor_visible",pe="selectEditor";class fe extends R.b7{static get EDITOR_TYPE(){return"select"}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),t=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",t&&e.setAttribute(...(0,f.MG)()),e.appendChild(this.hot.rootDocument.createTextNode(String.fromCharCode(9660))),(0,o.iQ)(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",(0,o.nB)(this.selectWrapper,me)&&(0,o.vy)(this.selectWrapper,me),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",(()=>this.refreshDimensions())),this.addHook("afterScrollVertically",(()=>this.refreshDimensions())),this.addHook("afterColumnResize",(()=>this.refreshDimensions())),this.addHook("afterRowResize",(()=>this.refreshDimensions()))}prepare(e,t,n,r,i,a){super.prepare(e,t,n,r,i,a);const l=this.cellProperties.selectOptions;let u;u="function"==typeof l?this.prepareOptions(l(this.row,this.col,this.prop)):this.prepareOptions(l),(0,o.Ie)(this.select),(0,s.v4)(u,((e,t)=>{const n=this.hot.rootDocument.createElement("OPTION");n.value=t,(0,o.Mv)(n,e),this.select.appendChild(n)}))}prepareOptions(e){let t={};if(Array.isArray(e))for(let n=0,r=e.length;n{const e=this.select.selectedIndex-1;e>=0&&(this.select[e].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const e=this.select.selectedIndex+1;e<=this.select.length-1&&(this.select[e].selected=!0)}}],t)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(pe)}}class ge extends r.t{static get EDITOR_TYPE(){return"time"}prepare(e,t,n,r,o,i){super.prepare(e,t,n,r,o,i),this.TEXTAREA.dir="ltr"}}var ye=n(11080),we=n(69478);function ve(e,t,n,r,i,s,a){we.j.apply(this,[e,t,n,r,i,s,a]),(0,o.Mv)(t,null==s?"":s,!1)}ve.RENDERER_TYPE="html";var _e=n(28061);function be(e,t,n,r,i,s,a){const{rootDocument:l}=e,u=a.allowHtml?ve:p.F,h=l.createElement("DIV"),c=e.getSettings().ariaTags;if(h.className="htAutocompleteArrow",c&&h.setAttribute(...(0,f.MG)()),h.appendChild(l.createTextNode(String.fromCharCode(9660))),u.apply(this,[e,t,n,r,i,s,a]),t.firstChild||t.appendChild(l.createTextNode(String.fromCharCode(160))),t.insertBefore(h,t.firstChild),(0,o.iQ)(t,"htAutocomplete"),!e.acArrowListener){const i=new _e.A(e);e.acArrowListener=function(i){(0,o.nB)(i.target,"htAutocompleteArrow")&&e.view._wt.getSetting("onCellDblClick",null,e._createCellCoords(n,r),t)},i.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",(()=>{i.destroy()}))}}function Se(e,t,n,r,o,i,s){be.apply(this,[e,t,n,r,o,i,s])}be.RENDERER_TYPE="autocomplete",Se.RENDERER_TYPE="dropdown",n(23215),n(81454);var Ce=n(63487),Ee=n(49138);const Me=new WeakMap,Te=new WeakMap,Re="htBadValue",Ae="data-row",Ne="data-col",Le="checkboxRenderer",xe="checkbox";function Oe(e,t,n,r,i,s,l){const{rootDocument:u}=e,h=e.getSettings().ariaTags;we.j.apply(this,[e,t,n,r,i,s,l]),function(e){let t=Te.get(e);if(!t){const{rootElement:n}=e;t=new _e.A(e),t.addEventListener(n,"click",(t=>function(e,t){const{target:n}=e;if(!Ie(n))return;if(!n.hasAttribute(Ae)||!n.hasAttribute(Ne))return;const r=parseInt(n.getAttribute(Ae),10),o=parseInt(n.getAttribute(Ne),10);t.getCellMeta(r,o).readOnly&&e.preventDefault()}(t,e))),t.addEventListener(n,"mouseup",(t=>function(e,t){const{target:n}=e;Ie(n)&&n.hasAttribute(Ae)&&n.hasAttribute(Ne)&&setTimeout(t.listen,10)}(t,e))),t.addEventListener(n,"change",(t=>function(e,t){const{target:n}=e;if(!Ie(n))return;if(!n.hasAttribute(Ae)||!n.hasAttribute(Ne))return;const r=parseInt(n.getAttribute(Ae),10),o=parseInt(n.getAttribute(Ne),10),i=t.getCellMeta(r,o);if(!i.readOnly){let n=null;n=e.target.checked?void 0===i.uncheckedTemplate||i.checkedTemplate:void 0!==i.uncheckedTemplate&&i.uncheckedTemplate,t.setDataAtCell(r,o,n)}}(t,e))),Te.set(e,t)}}(e);let d=function(e){const t=e.createElement("input");return t.className="htCheckboxRendererInput",t.type="checkbox",t.setAttribute("tabindex","-1"),t.cloneNode(!1)}(u);const m=l.label;let p=!1;if(void 0===l.checkedTemplate&&(l.checkedTemplate=!0),void 0===l.uncheckedTemplate&&(l.uncheckedTemplate=!1),(0,o.Ie)(t),s===l.checkedTemplate||(0,c.As)(s).toLocaleLowerCase(l.locale)===(0,c.As)(l.checkedTemplate).toLocaleLowerCase(l.locale)?d.checked=!0:s===l.uncheckedTemplate||(0,c.As)(s).toLocaleLowerCase(l.locale)===(0,c.As)(l.uncheckedTemplate).toLocaleLowerCase(l.locale)?d.checked=!1:(0,c.Im)(s)?(0,o.iQ)(d,"noValue"):(d.style.display="none",(0,o.iQ)(d,Re),p=!0),(0,o.Bq)(d,[[Ae,n],[Ne,r]]),h&&(0,o.Bq)(d,[(0,f.SM)(d.checked?e.getTranslatedPhrase(Ee.CHECKBOX_CHECKED):e.getTranslatedPhrase(Ee.CHECKBOX_UNCHECKED)),(0,f.Xq)(d.checked),(0,f.Pk)()]),!p&&m){let o="";if(m.value)o="function"==typeof m.value?m.value.call(this,n,r,i,s):m.value;else if(m.property){const t=e.getDataAtRowProp(n,m.property);o=null!==t?t:""}const a=function(e,t,n){const r=e.createElement("label");r.className="htCheckboxRendererLabel "+(n?"fullWidth":"");const o=e.createTextNode(t);if(n){const t=e.createElement("span");t.appendChild(o),r.appendChild(t)}else r.appendChild(o);return r.cloneNode(!0)}(u,o,!0!==m.separated);"before"===m.position?m.separated?(t.appendChild(a),t.appendChild(d)):(a.appendChild(d),d=a):m.position&&"after"!==m.position||(m.separated?(t.appendChild(d),t.appendChild(a)):(a.insertBefore(d,a.firstChild),d=a))}function g(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const n=e.getSelectedRange(),r=[],o=new Map;let i=[],s=0;if(n){for(let a=0;a{let[,,t]=e;return t===i[0][2]}))?i.map((e=>{let[t,n,r]=e;return[t,n,r]})):i.map((e=>{let[t,n,,r]=e;return[t,n,r.checkedTemplate]})),i.length>0&&r.forEach(((t,n)=>{let r=i.splice(0,t);o.size&&o.has(n)&&(r=[...r,...o.get(n)]),e.setDataAtCell(r)}))}}function y(){const t=e.getSelectedRange();if(t){for(let n=0;n0)return!0}}return!1}}(!m||m&&!m.separated)&&t.appendChild(d),p&&t.appendChild(u.createTextNode("#bad-value#")),Me.has(e)||(Me.set(e,!0),function(){const t=e.getShortcutManager().getContext("grid"),n={group:Le,relativeToGroup:a.b,position:"before"};t.addShortcuts([{keys:[["space"]],callback:()=>(g(),!y()),runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isCell()}},{keys:[["enter"]],callback:()=>(g(),!y()),runOnlyIf:()=>{const t=e.getSelectedRangeLast();return e.getSettings().enterBeginsEditing&&(null==t?void 0:t.highlight.isCell())&&!e.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(g(!0),!y()),runOnlyIf:()=>{var t;return null===(t=e.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isCell()}}],n)}())}function Ie(e){return"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}function ke(e,t,n,r,o,i,s){be.apply(this,[e,t,n,r,o,i,s])}Ce.R.getSingleton().add("modifyAutoColumnSizeSeed",(function(e,t,n){const{label:r,type:o,row:i,column:s,prop:a}=t;if(o===xe){if(r){const{value:t,property:o}=r;let l=n;if(t)l="function"==typeof t?t(i,s,a,n):t;else if(o){const e=this.getDataAtRowProp(i,o);l=null!==e?e:n}e=l}return e}})),Oe.RENDERER_TYPE=xe,ke.RENDERER_TYPE="handsontable";var De,Pe,He,Fe,Ye,Ve,Ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function We(){return Pe||(Pe=1,De={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),De}function je(){if(Fe)return He;Fe=1;const e=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,o,i,s,a,l,u){if(!isNaN(+r))return+r;let h="",c=r.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(c!==r)return-1*n(c,o,i,s,a,l);for(let t=0;t{p[l[e]]=e}));let f=Object.keys(p).sort().reverse(),g=f.length;for(let e=0;e"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},r={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function o(t){return void 0!==e.unformat(t)}function i(e,t,r,o=!1){let s=Object.keys(e).map((o=>{if(!t[o])return console.error(`${r} Invalid key: ${o}`),!1;let s=e[o],a=t[o];if("string"==typeof a&&(a={type:a}),"format"===a.type){if(!i(s,n,`[Validate ${o}]`,!0))return!1}else if(typeof s!==a.type)return console.error(`${r} ${o} type mismatched: "${a.type}" expected, "${typeof s}" provided`),!1;if(a.restrictions&&a.restrictions.length){let t=a.restrictions.length;for(let n=0;n{let o=t[n];if("string"==typeof o&&(o={type:o}),o.mandatory){let t=o.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[n])return console.error(`${r} Missing mandatory key "${n}"`),!1}return!0}))),s.reduce(((e,t)=>e&&t),!0)}function s(e){return i(e,n,"[Validate format]")}return Ye={validate:function(e,t){let n=o(e),r=s(t);return n&&r},validateFormat:s,validateInput:o,validateLanguage:function(e){return i(e,r,"[Validate language]")}},Ye}var Ge,$e,Ke={parseFormat:function(e,t={}){return"string"!=typeof e?e:(e=function(e,t){let n=e.match(/^{([^}]*)}/);return n?(t.prefix=n[1],e.slice(n[0].length)):e}(e,t),e=function(e,t){let n=e.match(/{([^}]*)}$/);return n?(t.postfix=n[1],e.slice(0,-n[0].length)):e}(e,t),function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",void(t.base="general")):-1!==e.indexOf("b")?(t.output="byte",void(t.base="binary")):-1!==e.indexOf("d")?(t.output="byte",void(t.base="decimal")):void(-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time");t.output="percent"}else t.output="currency"}(e,t),function(e,t){let n=e.match(/[1-9]+[0-9]*/);n&&(t.totalLength=+n[0])}(e,t),function(e,t){let n=e.split(".")[0].match(/0+/);n&&(t.characteristic=n[0].length)}(e,t),function(e,t){if(-1!==e.indexOf(".")){let n=e.split(".")[0];t.optionalCharacteristic=-1===n.indexOf("0")}}(e,t),function(e,t){-1!==e.indexOf("a")&&(t.average=!0)}(e,t),function(e,t){-1!==e.indexOf("K")?t.forceAverage="thousand":-1!==e.indexOf("M")?t.forceAverage="million":-1!==e.indexOf("B")?t.forceAverage="billion":-1!==e.indexOf("T")&&(t.forceAverage="trillion")}(e,t),function(e,t){let n=e.split(".")[1];if(n){let e=n.match(/0+/);e&&(t.mantissa=e[0].length)}}(e,t),function(e,t){e.match(/\[\.]/)?t.optionalMantissa=!0:e.match(/\./)&&(t.optionalMantissa=!1)}(e,t),function(e,t){const n=e.split(".")[1];n&&(t.trimMantissa=-1!==n.indexOf("["))}(e,t),function(e,t){-1!==e.indexOf(",")&&(t.thousandSeparated=!0)}(e,t),function(e,t){-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0))}(e,t),function(e,t){e.match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),e.match(/^\+?-/)&&(t.negative="sign")}(e,t),function(e,t){e.match(/^\+/)&&(t.forceSign=!0)}(e,t),t)}};function Xe(){if($e)return Ge;$e=1;const e=We(),t=ze(),n=Ke;let r,o={},i={},s=null,a={};function l(e){r=e}function u(){return i[r]}return o.languages=()=>Object.assign({},i),o.currentLanguage=()=>r,o.currentBytes=()=>u().bytes||{},o.currentCurrency=()=>u().currency,o.currentAbbreviations=()=>u().abbreviations,o.currentDelimiters=()=>u().delimiters,o.currentOrdinal=()=>u().ordinal,o.currentDefaults=()=>Object.assign({},u().defaults,a),o.currentOrdinalDefaultFormat=()=>Object.assign({},o.currentDefaults(),u().ordinalFormat),o.currentByteDefaultFormat=()=>Object.assign({},o.currentDefaults(),u().byteFormat),o.currentPercentageDefaultFormat=()=>Object.assign({},o.currentDefaults(),u().percentageFormat),o.currentCurrencyDefaultFormat=()=>Object.assign({},o.currentDefaults(),u().currencyFormat),o.currentTimeDefaultFormat=()=>Object.assign({},o.currentDefaults(),u().timeFormat),o.setDefaults=e=>{e=n.parseFormat(e),t.validateFormat(e)&&(a=e)},o.getZeroFormat=()=>s,o.setZeroFormat=e=>s="string"==typeof e?e:null,o.hasZeroFormat=()=>null!==s,o.languageData=e=>{if(e){if(i[e])return i[e];throw new Error(`Unknown tag "${e}"`)}return u()},o.registerLanguage=(e,n=!1)=>{if(!t.validateLanguage(e))throw new Error("Invalid language data");i[e.languageTag]=e,n&&l(e.languageTag)},o.setLanguage=(t,n=e.languageTag)=>{if(!i[t]){let e=t.split("-")[0],r=Object.keys(i).find((t=>t.split("-")[0]===e));return i[r]?void l(r):void l(n)}l(t)},o.registerLanguage(e),r=e.languageTag,Ge=o}var qe,Qe={exports:{}};qe=Qe,function(e){var t,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,o=Math.floor,i="[BigNumber Error] ",s=i+"Number primitive has more than 15 significant digits: ",a=1e14,l=14,u=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],c=1e7,d=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function p(e){for(var t,n,r=1,o=e.length,i=e[0]+"";ru^n?1:-1;for(a=(l=o.length)<(u=i.length)?l:u,s=0;si[s]^n?1:-1;return l==u?0:l>u^n?1:-1}function g(e,t,n,r){if(en||e!==o(e))throw Error(i+(r||"Argument")+("number"==typeof e?en?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function y(e){var t=e.c.length-1;return m(e.e/l)==t&&e.c[t]%2!=0}function w(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(++t>(r=e.length)){for(o=n,t-=r;--t;o+=n);e+=o}else tH?f.c=f.e=null:e.e=10;c/=10,h++);return void(h>H?f.c=f.e=null:(f.e=h,f.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return S(f,p,d);f.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(h=p.indexOf("."))>-1&&(p=p.replace(".","")),(c=p.search(/e/i))>0?(h<0&&(h=c),h+=+p.slice(c+1),p=p.substring(0,c)):h<0&&(h=p.length)}else{if(g(t,2,B.length,"Base"),10==t&&W)return K(f=new j(e),O+f.e+1,I);if(p=String(e),d="number"==typeof e){if(0*e!=0)return S(f,p,d,t);if(f.s=1/e<0?(p=p.slice(1),-1):1,j.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(s+e)}else f.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=B.slice(0,t),h=c=0,m=p.length;ch){h=m;continue}}else if(!a&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){a=!0,c=-1,h=0;continue}return S(f,String(e),d,t)}d=!1,(h=(p=b(p,t,10,f.s)).indexOf("."))>-1?p=p.replace(".",""):h=p.length}for(c=0;48===p.charCodeAt(c);c++);for(m=p.length;48===p.charCodeAt(--m););if(p=p.slice(c,++m)){if(m-=c,d&&j.DEBUG&&m>15&&(e>u||e!==o(e)))throw Error(s+f.s*e);if((h=h-c-1)>H)f.c=f.e=null;else if(h=D)?w(l,s):v(l,s,"0");else if(i=(e=K(new j(e),t,n)).e,a=(l=p(e.c)).length,1==r||2==r&&(t<=i||i<=k)){for(;aa){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=i-a)>0)for(i+1==a&&(l+=".");t--;l+="0");return e.s<0&&o?"-"+l:l}function G(e,t){for(var n,r,o=1,i=new j(e[0]);o=10;o/=10,r++);return(n=r+n*l-1)>H?e.c=e.e=null:n=10;d/=10,s++);if((u=t-s)<0)u+=l,c=t,m=g[p=0],f=o(m/y[s-c-1]%10);else if((p=r((u+1)/l))>=g.length){if(!i)break e;for(;g.length<=p;g.push(0));m=f=0,s=1,c=(u%=l)-l+1}else{for(m=d=g[p],s=1;d>=10;d/=10,s++);f=(c=(u%=l)-l+s)<0?0:o(m/y[s-c-1]%10)}if(i=i||t<0||null!=g[p+1]||(c<0?m:m%y[s-c-1]),i=n<4?(f||i)&&(0==n||n==(e.s<0?3:2)):f>5||5==f&&(4==n||i||6==n&&(u>0?c>0?m/y[s-c]:0:g[p-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,i?(t-=e.e+1,g[0]=y[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(0==u?(g.length=p,d=1,p--):(g.length=p+1,d=y[l-u],g[p]=c>0?o(m/y[s-c]%y[c])*d:0),i)for(;;){if(0==p){for(u=1,c=g[0];c>=10;c/=10,u++);for(c=g[0]+=d,d=1;c>=10;c/=10,d++);u!=d&&(e.e++,g[0]==a&&(g[0]=1));break}if(g[p]+=d,g[p]!=a)break;g[p--]=0,d=1}for(u=g.length;0===g[--u];g.pop());}e.e>H?e.c=e.e=null:e.e=D?w(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return j.clone=e,j.ROUND_UP=0,j.ROUND_DOWN=1,j.ROUND_CEIL=2,j.ROUND_FLOOR=3,j.ROUND_HALF_UP=4,j.ROUND_HALF_DOWN=5,j.ROUND_HALF_EVEN=6,j.ROUND_HALF_CEIL=7,j.ROUND_HALF_FLOOR=8,j.EUCLID=9,j.config=j.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(i+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(n=e[t],0,d,t),O=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(n=e[t],0,8,t),I=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(g(n[0],-d,0,t),g(n[1],0,d,t),k=n[0],D=n[1]):(g(n,-d,d,t),k=-(D=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)g(n[0],-d,-1,t),g(n[1],1,d,t),P=n[0],H=n[1];else{if(g(n,-d,d,t),!n)throw Error(i+t+" cannot be zero: "+n);P=-(H=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(i+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!n,Error(i+"crypto unavailable");F=n}else F=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(n=e[t],0,9,t),Y=n),e.hasOwnProperty(t="POW_PRECISION")&&(g(n=e[t],0,d,t),V=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(i+t+" not an object: "+n);U=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(i+t+" invalid: "+n);W="0123456789"==n.slice(0,10),B=n}}return{DECIMAL_PLACES:O,ROUNDING_MODE:I,EXPONENTIAL_AT:[k,D],RANGE:[P,H],CRYPTO:F,MODULO_MODE:Y,POW_PRECISION:V,FORMAT:U,ALPHABET:B}},j.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!j.DEBUG)return!0;var t,n,r=e.c,s=e.e,u=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===u||-1===u)&&s>=-d&&s<=d&&s===o(s)){if(0===r[0]){if(0===s&&1===r.length)return!0;break e}if((t=(s+1)%l)<1&&(t+=l),String(r[0]).length==t){for(t=0;t=a||n!==o(n))break e;if(0!==n)return!0}}}else if(null===r&&null===s&&(null===u||1===u||-1===u))return!0;throw Error(i+"Invalid BigNumber: "+e)},j.maximum=j.max=function(){return G(arguments,-1)},j.minimum=j.min=function(){return G(arguments,1)},j.random=(C=9007199254740992,E=Math.random()*C&2097151?function(){return o(Math.random()*C)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,s,a,u,c=0,m=[],p=new j(x);if(null==e?e=O:g(e,0,d),a=r(e/l),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));c>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(m.push(u%1e14),c+=2);c=a/2}else{if(!crypto.randomBytes)throw F=!1,Error(i+"crypto unavailable");for(t=crypto.randomBytes(a*=7);c=9e15?crypto.randomBytes(7).copy(t,c):(m.push(u%1e14),c+=7);c=a/7}if(!F)for(;c=10;u/=10,c++);cn-1&&(null==s[o+1]&&(s[o+1]=0),s[o+1]+=s[o]/n|0,s[o]%=n)}return s.reverse()}return function(n,r,o,i,s){var a,l,u,h,c,d,m,f,g=n.indexOf("."),y=O,w=I;for(g>=0&&(h=V,V=0,n=n.replace(".",""),d=(f=new j(r)).pow(n.length-g),V=h,f.c=t(v(p(d.c),d.e,"0"),10,o,e),f.e=f.c.length),u=h=(m=t(n,r,o,s?(a=B,e):(a=e,B))).length;0==m[--h];m.pop());if(!m[0])return a.charAt(0);if(g<0?--u:(d.c=m,d.e=u,d.s=i,m=(d=_(d,f,y,w,o)).c,c=d.r,u=d.e),g=m[l=u+y+1],h=o/2,c=c||l<0||null!=m[l+1],c=w<4?(null!=g||c)&&(0==w||w==(d.s<0?3:2)):g>h||g==h&&(4==w||c||6==w&&1&m[l-1]||w==(d.s<0?8:7)),l<1||!m[0])n=c?v(a.charAt(1),-y,a.charAt(0)):a.charAt(0);else{if(m.length=l,c)for(--o;++m[--l]>o;)m[l]=0,l||(++u,m=[1].concat(m));for(h=m.length;!m[--h];);for(g=0,n="";g<=h;n+=a.charAt(m[g++]));n=v(n,u,a.charAt(0))}return n}}(),_=function(){function e(e,t,n){var r,o,i,s,a=0,l=e.length,u=t%c,h=t/c|0;for(e=e.slice();l--;)a=((o=u*(i=e[l]%c)+(r=h*i+(s=e[l]/c|0)*u)%c*c+a)/n|0)+(r/c|0)+h*s,e[l]=o%n;return a&&(e=[a].concat(e)),e}function t(e,t,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;ot[o]?1:-1;break}return i}function n(e,t,n,r){for(var o=0;n--;)e[n]-=o,o=e[n]1;e.splice(0,1));}return function(r,i,s,u,h){var c,d,p,f,g,y,w,v,_,b,S,C,E,M,T,R,A,N=r.s==i.s?1:-1,L=r.c,x=i.c;if(!(L&&L[0]&&x&&x[0]))return new j(r.s&&i.s&&(L?!x||L[0]!=x[0]:x)?L&&0==L[0]||!x?0*N:N/0:NaN);for(_=(v=new j(N)).c=[],N=s+(d=r.e-i.e)+1,h||(h=a,d=m(r.e/l)-m(i.e/l),N=N/l|0),p=0;x[p]==(L[p]||0);p++);if(x[p]>(L[p]||0)&&d--,N<0)_.push(1),f=!0;else{for(M=L.length,R=x.length,p=0,N+=2,(g=o(h/(x[0]+1)))>1&&(x=e(x,g,h),L=e(L,g,h),R=x.length,M=L.length),E=R,S=(b=L.slice(0,R)).length;S=h/2&&T++;do{if(g=0,(c=t(x,b,R,S))<0){if(C=b[0],R!=S&&(C=C*h+(b[1]||0)),(g=o(C/T))>1)for(g>=h&&(g=h-1),w=(y=e(x,g,h)).length,S=b.length;1==t(y,b,w,S);)g--,n(y,R=10;N/=10,p++);K(v,s+(v.e=p+d*l-1)+1,u,f)}else v.e=d,v.r=+f;return v}}(),M=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,R=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g,S=function(e,t,n,r){var o,s=n?t:t.replace(N,"");if(A.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(M,(function(e,t,n){return o="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=o?e:t})),r&&(o=r,s=s.replace(T,"$1").replace(R,"0.$1")),t!=s))return new j(s,o);if(j.DEBUG)throw Error(i+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},L.absoluteValue=L.abs=function(){var e=new j(this);return e.s<0&&(e.s=1),e},L.comparedTo=function(e,t){return f(this,new j(e,t))},L.decimalPlaces=L.dp=function(e,t){var n,r,o,i=this;if(null!=e)return g(e,0,d),null==t?t=I:g(t,0,8),K(new j(i),e+i.e+1,t);if(!(n=i.c))return null;if(r=((o=n.length-1)-m(this.e/l))*l,o=n[o])for(;o%10==0;o/=10,r--);return r<0&&(r=0),r},L.dividedBy=L.div=function(e,t){return _(this,new j(e,t),O,I)},L.dividedToIntegerBy=L.idiv=function(e,t){return _(this,new j(e,t),0,1)},L.exponentiatedBy=L.pow=function(e,t){var n,s,a,u,h,c,d,m,p=this;if((e=new j(e)).c&&!e.isInteger())throw Error(i+"Exponent not an integer: "+X(e));if(null!=t&&(t=new j(t)),h=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return m=new j(Math.pow(+X(p),h?e.s*(2-y(e)):+X(e))),t?m.mod(t):m;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new j(NaN);(s=!c&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||h&&p.c[1]>=24e7:p.c[0]<8e13||h&&p.c[0]<=9999975e7)))return u=p.s<0&&y(e)?-0:0,p.e>-1&&(u=1/u),new j(c?1/u:u);V&&(u=r(V/l+2))}for(h?(n=new j(.5),c&&(e.s=1),d=y(e)):d=(a=Math.abs(+X(e)))%2,m=new j(x);;){if(d){if(!(m=m.times(p)).c)break;u?m.c.length>u&&(m.c.length=u):s&&(m=m.mod(t))}if(a){if(0===(a=o(a/2)))break;d=a%2}else if(K(e=e.times(n),e.e+1,1),e.e>14)d=y(e);else{if(0===(a=+X(e)))break;d=a%2}p=p.times(p),u?p.c&&p.c.length>u&&(p.c.length=u):s&&(p=p.mod(t))}return s?m:(c&&(m=x.div(m)),t?m.mod(t):u?K(m,V,I,void 0):m)},L.integerValue=function(e){var t=new j(this);return null==e?e=I:g(e,0,8),K(t,t.e+1,e)},L.isEqualTo=L.eq=function(e,t){return 0===f(this,new j(e,t))},L.isFinite=function(){return!!this.c},L.isGreaterThan=L.gt=function(e,t){return f(this,new j(e,t))>0},L.isGreaterThanOrEqualTo=L.gte=function(e,t){return 1===(t=f(this,new j(e,t)))||0===t},L.isInteger=function(){return!!this.c&&m(this.e/l)>this.c.length-2},L.isLessThan=L.lt=function(e,t){return f(this,new j(e,t))<0},L.isLessThanOrEqualTo=L.lte=function(e,t){return-1===(t=f(this,new j(e,t)))||0===t},L.isNaN=function(){return!this.s},L.isNegative=function(){return this.s<0},L.isPositive=function(){return this.s>0},L.isZero=function(){return!!this.c&&0==this.c[0]},L.minus=function(e,t){var n,r,o,i,s=this,u=s.s;if(t=(e=new j(e,t)).s,!u||!t)return new j(NaN);if(u!=t)return e.s=-t,s.plus(e);var h=s.e/l,c=e.e/l,d=s.c,p=e.c;if(!h||!c){if(!d||!p)return d?(e.s=-t,e):new j(p?s:NaN);if(!d[0]||!p[0])return p[0]?(e.s=-t,e):new j(d[0]?s:3==I?-0:0)}if(h=m(h),c=m(c),d=d.slice(),u=h-c){for((i=u<0)?(u=-u,o=d):(c=h,o=p),o.reverse(),t=u;t--;o.push(0));o.reverse()}else for(r=(i=(u=d.length)<(t=p.length))?u:t,u=t=0;t0)for(;t--;d[n++]=0);for(t=a-1;r>u;){if(d[--r]=0;){for(n=0,g=C[o]%_,y=C[o]/_|0,i=o+(s=h);i>o;)n=((d=g*(d=S[--s]%_)+(u=y*d+(p=S[s]/_|0)*g)%_*_+w[i]+n)/v|0)+(u/_|0)+y*p,w[i--]=d%v;w[i]=n}return n?++r:w.splice(0,1),$(e,w,r)},L.negated=function(){var e=new j(this);return e.s=-e.s||null,e},L.plus=function(e,t){var n,r=this,o=r.s;if(t=(e=new j(e,t)).s,!o||!t)return new j(NaN);if(o!=t)return e.s=-t,r.minus(e);var i=r.e/l,s=e.e/l,u=r.c,h=e.c;if(!i||!s){if(!u||!h)return new j(o/0);if(!u[0]||!h[0])return h[0]?e:new j(u[0]?r:0*o)}if(i=m(i),s=m(s),u=u.slice(),o=i-s){for(o>0?(s=i,n=h):(o=-o,n=u),n.reverse();o--;n.push(0));n.reverse()}for((o=u.length)-(t=h.length)<0&&(n=h,h=u,u=n,t=o),o=0;t;)o=(u[--t]=u[t]+h[t]+o)/a|0,u[t]=a===u[t]?0:u[t]%a;return o&&(u=[o].concat(u),++s),$(e,u,s)},L.precision=L.sd=function(e,t){var n,r,o,i=this;if(null!=e&&e!==!!e)return g(e,1,d),null==t?t=I:g(t,0,8),K(new j(i),e,t);if(!(n=i.c))return null;if(r=(o=n.length-1)*l+1,o=n[o]){for(;o%10==0;o/=10,r--);for(o=n[0];o>=10;o/=10,r++);}return e&&i.e+1>r&&(r=i.e+1),r},L.shiftedBy=function(e){return g(e,-9007199254740991,u),this.times("1e"+e)},L.squareRoot=L.sqrt=function(){var e,t,n,r,o,i=this,s=i.c,a=i.s,l=i.e,u=O+4,h=new j("0.5");if(1!==a||!s||!s[0])return new j(!a||a<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(a=Math.sqrt(+X(i)))||a==1/0?(((t=p(s)).length+l)%2==0&&(t+="0"),a=Math.sqrt(+t),l=m((l+1)/2)-(l<0||l%2),n=new j(t=a==1/0?"5e"+l:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new j(a+""),n.c[0])for((a=(l=n.e)+u)<3&&(a=0);;)if(o=n,n=h.times(o.plus(_(i,o,u,1))),p(o.c).slice(0,a)===(t=p(n.c)).slice(0,a)){if(n.e0&&f>0){for(s=f%l||l,c=p.substr(0,s);s0&&(c+=h+p.slice(s)),m&&(c="-"+c)}r=d?c+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):c}return(n.prefix||"")+r+(n.suffix||"")},L.toFraction=function(e){var t,n,r,o,s,a,u,c,d,m,f,g,y=this,w=y.c;if(null!=e&&(!(u=new j(e)).isInteger()&&(u.c||1!==u.s)||u.lt(x)))throw Error(i+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+X(u));if(!w)return new j(y);for(t=new j(x),d=n=new j(x),r=c=new j(x),g=p(w),s=t.e=g.length-y.e-1,t.c[0]=h[(a=s%l)<0?l+a:a],e=!e||u.comparedTo(t)>0?s>0?t:d:u,a=H,H=1/0,u=new j(g),c.c[0]=0;m=_(u,t,0,1),1!=(o=n.plus(m.times(r))).comparedTo(e);)n=r,r=o,d=c.plus(m.times(o=d)),c=o,t=u.minus(m.times(o=t)),u=o;return o=_(e.minus(n),r,0,1),c=c.plus(o.times(d)),n=n.plus(o.times(r)),c.s=d.s=y.s,f=_(d,r,s*=2,I).minus(y).abs().comparedTo(_(c,n,s,I).minus(y).abs())<1?[d,r]:[c,n],H=a,f},L.toNumber=function(){return+X(this)},L.toPrecision=function(e,t){return null!=e&&g(e,1,d),z(this,e,t,2)},L.toString=function(e){var t,n=this,r=n.s,o=n.e;return null===o?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=o<=k||o>=D?w(p(n.c),o):v(p(n.c),o,"0"):10===e&&W?t=v(p((n=K(new j(n),O+o+1,I)).c),n.e,"0"):(g(e,2,B.length,"Base"),t=b(v(p(n.c),o,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},L.valueOf=L.toJSON=function(){return X(this)},L._isBigNumber=!0,null!=t&&j.set(t),j}(),t.default=t.BigNumber=t,qe.exports?qe.exports=t:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=t)}(Ue);var Je=Qe.exports;const Ze=Xe(),et=ze(),tt=Ke,nt=Je,rt={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},ot={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:it,decimalSuffixes:st}=Ze.currentBytes(),at={general:{scale:1024,suffixes:st,marker:"bd"},binary:{scale:1024,suffixes:it,marker:"b"},decimal:{scale:1e3,suffixes:st,marker:"d"}};function lt(e,t,n){let r=t[0],o=Math.abs(e);if(o>=n){for(let i=1;i=s&&o=rt.trillion||n&&1===s(l/rt.trillion)?(a=r.trillion,e/=rt.trillion):l=rt.billion||n&&1===s(l/rt.billion)?(a=r.billion,e/=rt.billion):l=rt.million||n&&1===s(l/rt.million)?(a=r.million,e/=rt.million):(l=rt.thousand||n&&1===s(l/rt.thousand))&&(a=r.thousand,e/=rt.thousand),a&&(a=(o?" ":"")+a),i){let t=e<0,n=e.toString().split(".")[0],r=t?n.length-1:n.length;u=Math.max(i-r,0)}return{value:e,abbreviation:a,mantissaPrecision:u}}({value:i,forceAverage:h,lowPrecision:c,abbreviations:n.currentAbbreviations(),spaceSeparated:y,roundingFunction:b,totalLength:a});i=e.value,S+=e.abbreviation,a&&(m=e.mantissaPrecision)}if(_){let e=function({value:e,characteristicPrecision:t}){let[n,r]=e.toExponential().split("e"),o=+n;return t?(1=0?`+${r}`:r),{value:o,abbreviation:`e${r}`}):{value:o,abbreviation:`e${r}`}}({value:i,characteristicPrecision:l});i=e.value,S=e.abbreviation+S}let C=function(e,t,n,r,o,i){if(-1===r)return e;let s=function(e,t,n=Math.round){return-1!==e.toString().indexOf("e")?function(e,t){let n=e.toString(),[r,o]=n.split("e"),[i,s=""]=r.split(".");if(+o>0)n=i+s+ut(o-s.length);else{let e=".";e=+i<0?`-0${e}`:`0${e}`;let r=(ut(-o-1)+Math.abs(i)+s).substr(0,t);r.length0&&t>0&&(n+=`.${ut(t)}`),n}(e,t):new nt(n(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}(t,r,i),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(n||o))return a;let u=l.match(/0+$/);return o&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}(i.toString(),i,p,m,f,b);return C=function(e,t,n,r){let o=e,[i,s]=o.toString().split(".");if(i.match(/^-?0$/)&&n)return s?`${i.replace("0","")}.${s}`:i.replace("0","");const a=t<0&&0===i.indexOf("-");if(a&&(i=i.slice(1),o=o.slice(1)),i.length0;o--)r===t&&(n.unshift(o),r=0),r++;return n}(u.length,a);e.forEach(((e,t)=>{u=u.slice(0,e+t)+s+u.slice(e+t)})),c&&(u=`-${u}`)}return l=h?u+o+h:u,l}(C,i,g,n,r),(d||_)&&(C=function(e,t){return e+t}(C,S)),(v||i<0)&&(C=function(e,t,n){return 0===t?e:0===+e?e.replace("-",""):t>0?`+${e}`:"sign"===n?e:`(${e.replace("-","")})`}(C,i,w)),C}function ct(e,t){if(!e)return t;let n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}const dt=Je;function mt(e,t,n){let r=new dt(e._value),o=t;return n.isNumbro(t)&&(o=t._value),o=new dt(o),e._value=r.minus(o).toNumber(),e}const pt=Xe(),ft=ze(),gt=(e=>({loadLanguagesInNode:t=>function(e,t){e.forEach((e=>{let n;try{n=function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}n&&t.registerLanguage(n)}))}(t,e)}))(Ct),yt=je();let wt=(e=>({format:(...t)=>function(e,t={},n){if("string"==typeof t&&(t=tt.parseFormat(t)),!et.validateFormat(t))return"ERROR: invalid format";let r=t.prefix||"",o=t.postfix||"",i=function(e,t,n){switch(t.output){case"currency":return function(e,t,n){const r=n.currentCurrency();let o,i=Object.assign({},t),s=Object.assign({},ot,i),a="",l=!!s.totalLength||!!s.forceAverage||s.average,u=i.currencyPosition||r.position,h=i.currencySymbol||r.symbol;const c=void 0!==s.spaceSeparatedCurrency?s.spaceSeparatedCurrency:s.spaceSeparated;void 0===i.lowPrecision&&(i.lowPrecision=!1),c&&(a=" "),"infix"===u&&(o=a+h+a);let d=ht({instance:e,providedFormat:i,state:n,decimalSeparator:o});return"prefix"===u&&(d=e._value<0&&"sign"===s.negative?`-${a}${h}${d.slice(1)}`:e._value>0&&s.forceSign?`+${a}${h}${d.slice(1)}`:h+a+d),u&&"postfix"!==u||(a=!s.spaceSeparatedAbbreviation&&l?"":a,d=d+a+h),d}(e,t=ct(t,Ze.currentCurrencyDefaultFormat()),Ze);case"percent":return function(e,t,n,r){let o=t.prefixSymbol,i=ht({instance:r(100*e._value),providedFormat:t,state:n}),s=Object.assign({},ot,t);return o?`%${s.spaceSeparated?" ":""}${i}`:`${i}${s.spaceSeparated?" ":""}%`}(e,t=ct(t,Ze.currentPercentageDefaultFormat()),Ze,n);case"byte":return function(e,t,n,r){let o=t.base||"binary",i=Object.assign({},ot,t);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let l={general:{scale:1024,suffixes:a||st,marker:"bd"},binary:{scale:1024,suffixes:s||it,marker:"b"},decimal:{scale:1e3,suffixes:a||st,marker:"d"}}[o],{value:u,suffix:h}=lt(e._value,l.suffixes,l.scale);return`${ht({instance:r(u),providedFormat:t,state:n,defaults:n.currentByteDefaultFormat()})}${i.spaceSeparated?" ":""}${h}`}(e,t=ct(t,Ze.currentByteDefaultFormat()),Ze,n);case"time":return t=ct(t,Ze.currentTimeDefaultFormat()),function(e){let t=Math.floor(e._value/60/60),n=Math.floor((e._value-60*t*60)/60),r=Math.round(e._value-60*t*60-60*n);return`${t}:${n<10?"0":""}${n}:${r<10?"0":""}${r}`}(e);case"ordinal":return function(e,t,n){let r=n.currentOrdinal(),o=Object.assign({},ot,t),i=ht({instance:e,providedFormat:t,state:n}),s=r(e._value);return`${i}${o.spaceSeparated?" ":""}${s}`}(e,t=ct(t,Ze.currentOrdinalDefaultFormat()),Ze);default:return ht({instance:e,providedFormat:t,numbro:n})}}(e,t,n);return i=function(e,t){return t+e}(i,r),i=function(e,t){return e+t}(i,o),i}(...t,e),getByteUnit:(...t)=>function(e){let t=at.general;return lt(e._value,t.suffixes,t.scale).suffix}(...t,e),getBinaryByteUnit:(...t)=>function(e){let t=at.binary;return lt(e._value,t.suffixes,t.scale).suffix}(...t,e),getDecimalByteUnit:(...t)=>function(e){let t=at.decimal;return lt(e._value,t.suffixes,t.scale).suffix}(...t,e),formatOrDefault:ct}))(Ct),vt=(e=>({add:(t,n)=>function(e,t,n){let r=new dt(e._value),o=t;return n.isNumbro(t)&&(o=t._value),o=new dt(o),e._value=r.plus(o).toNumber(),e}(t,n,e),subtract:(t,n)=>mt(t,n,e),multiply:(t,n)=>function(e,t,n){let r=new dt(e._value),o=t;return n.isNumbro(t)&&(o=t._value),o=new dt(o),e._value=r.times(o).toNumber(),e}(t,n,e),divide:(t,n)=>function(e,t,n){let r=new dt(e._value),o=t;return n.isNumbro(t)&&(o=t._value),o=new dt(o),e._value=r.dividedBy(o).toNumber(),e}(t,n,e),set:(t,n)=>function(e,t,n){let r=t;return n.isNumbro(t)&&(r=t._value),e._value=r,e}(t,n,e),difference:(t,n)=>function(e,t,n){let r=n(e._value);return mt(r,t,n),Math.abs(r._value)}(t,n,e),BigNumber:dt}))(Ct);const _t=Ke;class bt{constructor(e){this._value=e}clone(){return Ct(this._value)}format(e={}){return wt.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=_t.parseFormat(e)),(e=wt.formatOrDefault(e,pt.currentCurrencyDefaultFormat())).output="currency",wt.format(this,e)}formatTime(e={}){return e.output="time",wt.format(this,e)}binaryByteUnits(){return wt.getBinaryByteUnit(this)}decimalByteUnits(){return wt.getDecimalByteUnit(this)}byteUnits(){return wt.getByteUnit(this)}difference(e){return vt.difference(this,e)}add(e){return vt.add(this,e)}subtract(e){return vt.subtract(this,e)}multiply(e){return vt.multiply(this,e)}divide(e){return vt.divide(this,e)}set(e){return vt.set(this,St(e))}value(){return this._value}valueOf(){return this._value}}function St(e){let t=e;return Ct.isNumbro(e)?t=e._value:"string"==typeof e?t=Ct.unformat(e):isNaN(e)&&(t=NaN),t}function Ct(e){return new bt(St(e))}Ct.version="2.5.0",Ct.isNumbro=function(e){return e instanceof bt},Ct.language=pt.currentLanguage,Ct.registerLanguage=pt.registerLanguage,Ct.setLanguage=pt.setLanguage,Ct.languages=pt.languages,Ct.languageData=pt.languageData,Ct.zeroFormat=pt.setZeroFormat,Ct.defaultFormat=pt.currentDefaults,Ct.setDefaults=pt.setDefaults,Ct.defaultCurrencyFormat=pt.currentCurrencyDefaultFormat,Ct.validate=ft.validate,Ct.loadLanguagesInNode=gt.loadLanguagesInNode,Ct.unformat=yt.unformat,Ct.BigNumber=vt.BigNumber;var Et=Be(Ct),Mt=n(71409);function Tt(e,t){if((0,Mt.kf)(e)){const n=t.numericFormat,r=n&&n.culture||"-",o=n&&n.pattern;if(void 0!==r&&!Et.languages()[r]){const e=r.replace("-",""),t=Et.allLanguages?Et.allLanguages[r]:Et[e];t&&Et.registerLanguage(t)}Et.setLanguage(r),e=Et(e).format(o||"0")}return e}function Rt(e,t,n,r,o,i,s){let a=i;if((0,Mt.kf)(a)){let e=[];if(Array.isArray(s.className))e=s.className;else{var l;const t=null!==(l=s.className)&&void 0!==l?l:"";t.length&&(e=t.split(" "))}a=Tt(a,s),e.indexOf("htLeft")<0&&e.indexOf("htCenter")<0&&e.indexOf("htRight")<0&&e.indexOf("htJustify")<0&&e.push("htRight"),e.indexOf("htNumeric")<0&&e.push("htNumeric"),s.className=e.join(" "),t.dir="ltr"}(0,p.F)(e,t,n,r,o,a,s)}function At(e,t,n,r,i,s,a){p.F.apply(this,[e,t,n,r,i,s,a]);const l=a.hashLength||t.innerHTML.length,u=a.hashSymbol||"*";let h="";(0,Mt.Ti)(l-1,(()=>{h+=u})),(0,o.Mv)(t,h)}function Nt(e,t,n,r,o,i,s){p.F.apply(this,[e,t,n,r,o,i,s])}function Lt(e,t,n,r,o,i,s){p.F.apply(this,[e,t,n,r,o,i,s]),t.dir="ltr"}Rt.RENDERER_TYPE="numeric",At.RENDERER_TYPE="password",Nt.RENDERER_TYPE="select",Lt.RENDERER_TYPE="time";var xt=n(54950);function Ot(e,t){let n=e;null==n&&(n=""),this.allowEmpty&&""===n?t(!0):this.strict&&this.source?"function"==typeof this.source?this.source(n,It(n,t)):It(n,t)(this.source):t(!0)}function It(e,t){const n=e;return function(e){let r=!1;for(let t=0,o=e.length;t-1;let i;return i=n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||o?n:r,i.format(t)}(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,e,"dateValidator"),o=!0}else o=!1;t(o)}function Dt(e,t){Ot.apply(this,[e,t])}function Pt(e,t){let n=e;null==n&&(n=""),this.allowEmpty&&""===n?t(!0):t(""!==n&&(0,Mt.kf)(e))}Ot.VALIDATOR_TYPE="autocomplete",kt.VALIDATOR_TYPE="date",Dt.VALIDATOR_TYPE="dropdown",Pt.VALIDATOR_TYPE="numeric";const Ht=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"];function Ft(e,t){const n=this.timeFormat||"h:mm:ss a";let r=!0,o=e;null===o&&(o=""),o=/^\d{3,}$/.test(o)?parseInt(o,10):o;const i=/^\d{1,2}$/.test(o);i&&(o+=":00");const s=N(o,Ht,!0).isValid()?N(o):N(o,n);let a=s.isValid(),l=N(o,n,!0).isValid()&&!i;if(this.allowEmpty&&""===o&&(a=!0,l=!0),a||(r=!1),!a&&l&&(r=!0),a&&!l)if(!0===this.correctFormat){const e=s.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,e,"timeValidator"),r=!0}else r=!1;t(r)}Ft.VALIDATOR_TYPE="time";var Yt=n(82993);const Vt={CELL_TYPE:"autocomplete",editor:M,renderer:be,validator:Ot},Ut={CELL_TYPE:"checkbox",editor:A,renderer:Oe};function Bt(e,t,n,r,o,i,s){be.apply(this,[e,t,n,r,o,i,s])}Bt.RENDERER_TYPE="date";const Wt={CELL_TYPE:"date",editor:ae,renderer:Bt,validator:kt},jt={CELL_TYPE:"dropdown",editor:ue,renderer:Se,validator:Dt,filter:!1,strict:!0},zt={CELL_TYPE:"handsontable",editor:u,renderer:ke},Gt={CELL_TYPE:"numeric",editor:he,renderer:Rt,validator:Pt,dataType:"number"},$t={CELL_TYPE:"password",editor:de,renderer:At,copyable:!1},Kt={CELL_TYPE:"select",editor:fe,renderer:Nt};var Xt=n(34675);const qt={CELL_TYPE:"time",editor:ge,renderer:Lt,validator:Ft};var Qt=n(87979);n(3949);var Jt=n(6833);function Zt(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function en(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tn(e,t){return e.get(nn(e,t))}function nn(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const rn=new Map([["plugin",Jt.Mt],["cell-type",Qt.L4],["editor",ye.aZ],["renderer",xt.sl],["validator",Yt.tR]]),on=Symbol("mainSetting"),sn=[];let an=null;var ln=new WeakMap,un=new WeakSet;class hn{static get PLUGIN_KEY(){return"base"}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){var t;Zt(this,t=un),t.add(this),en(this,"eventManager",new _e.A(this)),en(this,"pluginName",null),en(this,"pluginsInitializedCallbacks",[]),en(this,"isPluginsReady",!1),en(this,"enabled",!1),en(this,"initialized",!1),function(e,t){Zt(e,t),t.set(e,{})}(this,ln),(0,s.LH)(this,"hot",e,{writable:!1}),an=null,this.hot.addHook("afterPluginsInitialized",(()=>this.onAfterPluginsInitialized())),this.hot.addHook("afterUpdateSettings",(e=>this.onUpdateSettings(e))),this.hot.addHook("beforeInit",(()=>this.init()))}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,t=Array.isArray(e)?e:[];if(t.length>0){const e=[];if(t.forEach((t=>{const[n,r]=t.split(":");if(!rn.has(n))throw new Error(`Unknown plugin dependency type "${n}" was found.`);rn.get(n)(r)||e.push(` - ${r} (${n})`)})),e.length>0){const t=[`The ${this.pluginName} plugin requires the following modules:\n`,`${e.join("\n")}\n`].join("");sn.push(t)}}if(an||(an=(0,Jt.f4)()),an.indexOf(this.pluginName)>=0&&an.splice(an.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",(()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()})),0===an.length){if(sn.length>0){const e=[`${sn.join("\n")}\n`,"You have to import and register them manually."].join("");throw sn.length=0,new Error(e)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;null===(e=this.eventManager)||void 0===e||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const t=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(void 0===e)return t;const n=this.constructor.DEFAULT_SETTINGS;var r,o;return(Array.isArray(t)||(0,s.Gv)(t))&&n[on]===e?Array.isArray(t)?t:null!==(r=t[e])&&void 0!==r?r:n[e]:(0,s.Gv)(t)&&null!==(o=t[e])&&void 0!==o?o:n[e]}addHook(e,t,n){tn(ln,this)[e]=tn(ln,this)[e]||[];const r=tn(ln,this)[e];this.hot.addHook(e,t,n),r.push(t),tn(ln,this)[e]=r}removeHooks(e){(0,h.z0)(tn(ln,this)[e]||[],(t=>{this.hot.removeHook(e,t)}))}clearHooks(){const e=tn(ln,this);(0,s.v4)(e,((e,t)=>this.removeHooks(t))),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){(0,h.z0)(this.pluginsInitializedCallbacks,(e=>e())),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const t=nn(un,this,cn).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&t&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;null===(e=this.eventManager)||void 0===e||e.destroy(),this.clearHooks(),(0,s.v4)(this,((e,t)=>{"hot"!==t&&(this[t]=null)})),delete this.t,delete this.hot}}function cn(e){if(!e)return!1;const t=this.constructor.SETTING_KEYS;if("boolean"==typeof t)return t;for(let n=0;n{const{height:n}=t.table.getBoundingClientRect();e(t.row,Math.ceil(n))}))}getWidths(e){this.injected||this.injectTable(),(0,h.z0)(this.columns,(t=>{const{width:n}=t.table.getBoundingClientRect();e(t.col,Math.ceil(n))}))}setSettings(e){this.settings=e}setSetting(e,t){this.settings||(this.settings={}),this.settings[e]=t}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const t=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&t.appendChild(this.createColElement(-1,-1)),this.samples.forEach((n=>{(0,h.z0)(n.strings,(n=>{t.appendChild(this.createColElement(n.col,e))}))})),t}createRow(e){const{rootDocument:t}=this.hot,n=t.createDocumentFragment(),r=t.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,r),n.appendChild(r)),this.samples.forEach((r=>{(0,h.z0)(r.strings,(r=>{const o=r.col,i=this.hot.getCellMeta(e,o),s=this.hot.getCellRenderer(i),a=t.createElement("td");a.setAttribute("ghost-table",1),s(this.hot,a,e,o,this.hot.colToProp(o),r.value,i),n.appendChild(a)}))})),n}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,t=e.createDocumentFragment(),n=[];if(this.hot.hasRowHeaders()){const r=e.createElement("th");n.push([-1,r]),t.appendChild(r)}this.samples.forEach((r=>{(0,h.z0)(r.strings,(r=>{const o=r.col,i=e.createElement("th");n.push([o,i]),t.appendChild(i)}))})),this.table.tHead.appendChild(t),(0,h.z0)(n,(e=>{const[t,n]=e;this.hot.view.appendColHeader(t,n)}))}createCol(e){const{rootDocument:t}=this.hot,n=t.createDocumentFragment();return this.samples.forEach((r=>{(0,h.z0)(r.strings,(r=>{const o=r.row,i=this.hot.getCellMeta(o,e),s=this.hot.getCellRenderer(i),a=t.createElement("td"),l=t.createElement("tr");a.setAttribute("ghost-table",1),s(this.hot,a,o,e,this.hot.colToProp(e),r.value,i),l.appendChild(a),n.appendChild(l)}))})),n}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,t){const n=this.hot.rootDocument.createElement("col");let r=0;t>=0&&e>=0&&(r=this.hot.getCellMeta(t,e).colspan);let o=this.hot.getColWidth(e);if(r>1)for(let t=e+1;t0&&void 0!==arguments[0]?arguments[0]:"";const{rootDocument:t}=this.hot,n=t.createDocumentFragment(),r=t.createElement("table"),i=t.createElement("thead"),s=t.createElement("tbody"),a=t.createElement("colgroup"),l=t.createElement("tr"),u=t.createElement("th");return this.isVertical()&&r.appendChild(a),this.isHorizontal()&&(l.appendChild(u),i.appendChild(l),r.style.tableLayout="auto",r.style.width="auto"),r.appendChild(i),this.isVertical()&&s.appendChild(l),r.appendChild(s),(0,o.iQ)(r,e),n.appendChild(r),{fragment:n,table:r,tHead:i,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{rootDocument:t}=this.hot,n=t.createDocumentFragment(),r=t.createElement("div"),i=`htGhostTable htAutoSize ${e.trim()}`;return(0,o.iQ)(r,i),n.appendChild(r),{fragment:n,container:r}}isVertical(){return!(!this.rows.length||this.columns.length)}isHorizontal(){return!(!this.columns.length||this.rows.length)}};function fn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class gn{static get SAMPLE_COUNT(){return 3}constructor(e){fn(this,"samples",null),fn(this,"dataFactory",null),fn(this,"customSampleCount",null),fn(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:gn.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,t){return this.generateSamples("row",t,e)}generateColumnSamples(e,t){return this.generateSamples("col",t,e)}generateSamples(e,t,n){const r=new Map,{from:o,to:i}="number"==typeof n?{from:n,to:n}:n;return(0,Mt.Ti)(o,i,(n=>{const o=this.generateSample(e,t,n);r.set(n,o)})),r}generateSample(e,t,n){if("row"!==e&&"col"!==e)throw new Error("Unsupported sample type");const r=new Map,o="row"===e?"col":"row",i=[];return(0,Mt.Ti)(t.from,t.to,(t=>{const a="row"===e?this.dataFactory(n,t):this.dataFactory(t,n);if(!1===a)return;const{value:l,bundleSeed:u}=a,h="string"==typeof u&&u.length>0;let d;d=h?u:(0,s.Gv)(l)?`${Object.keys(l).length}`:Array.isArray(l)?`${l.length}`:`${(0,c.As)(l).length}`,r.has(d)||r.set(d,{needed:this.getSampleCount(),strings:[]});const m=r.get(d);m.needed&&(!(i.indexOf(l)>-1)||this.allowDuplicates||h)&&(m.strings.push({value:l,[o]:t}),i.push(l),m.needed-=1)})),r}}const yn=gn;var wn=n(94726),vn=n(48386);function _n(e,t,n){bn(e,t),t.set(e,n)}function bn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(e,t){return e.get(Mn(e,t))}function En(e,t,n){return e.set(Mn(e,t),n),n}function Mn(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("modifyAutoColumnSizeSeed");const Tn="autoColumnSize";var Rn=new WeakMap,An=new WeakMap,Nn=new WeakMap,Ln=new WeakSet;class xn extends hn{static get PLUGIN_KEY(){return Tn}static get PLUGIN_PRIORITY(){return 10}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){var t;super(e),bn(this,t=Ln),t.add(this),Sn(this,"ghostTable",new pn(this.hot)),Sn(this,"samplesGenerator",new yn(((e,t)=>{const n=this.hot.toPhysicalRow(e),r=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(n)||this.hot.columnIndexMapper.isHidden(r))return!1;const o=this.hot.getCellMeta(e,t);let i="";o.spanned||(i=this.hot.getDataAtCell(e,t));let s="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(s=this.hot.runHooks("modifyAutoColumnSizeSeed",s,o,i)),{value:i,bundleSeed:s}}))),Sn(this,"inProgress",!1),Sn(this,"measuredColumns",0),Sn(this,"columnWidthsMap",new vn._),_n(this,Rn,!1),_n(this,An,[]),_n(this,Nn,[]),this.hot.columnIndexMapper.registerMap("autoColumnSize",this.columnWidthsMap),this.addHook("beforeColumnResize",((e,t,n)=>Mn(Ln,this,Fn).call(this,e,t,n)))}isEnabled(){return!1!==this.hot.getSettings()[Tn]&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const t=this.getSetting("samplingRatio");t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rMn(Ln,this,Dn).call(this))),this.addHook("modifyColWidth",((e,t)=>this.getColumnWidth(t,e))),this.addHook("init",(()=>Mn(Ln,this,Yn).call(this))),super.enablePlugin()}updatePlugin(){En(Nn,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",((e,t,n)=>Mn(Ln,this,Fn).call(this,e,t,n)))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),t=this.getLastVisibleColumn();if(-1===e||-1===t)return;const n=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:t},void 0,n)}calculateColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="number"==typeof e?{from:e,to:e}:e,o="number"==typeof t?{from:t,to:t}:t;(0,Mt.Ti)(r.from,r.to,(e=>{let t=this.hot.toPhysicalColumn(e);null===t&&(t=e),(n||null===this.columnWidthsMap.getValueAtIndex(t)&&!this.hot._getColWidthFromSettings(t))&&Mn(Ln,this,In).call(this,e,o)})),this.ghostTable.columns.length&&(Mn(Ln,this,kn).call(this),this.measuredColumns=r.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0;const r=this.hot.countCols()-1;let o=null;this.inProgress=!0;const i=()=>{if(!this.hot)return(0,dn.uU)(o),void(this.inProgress=!1);this.calculateColumnsWidth({from:n,to:Math.min(n+xn.CALCULATION_STEP,r)},e,t),n=n+xn.CALCULATION_STEP+1,n=0&&(this.calculateColumnsWidth({from:0,to:s},e,t),n=s+1),n>=0),Math.min(t,n)}getColumnWidth(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t;return void 0===r&&(r=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),n&&"number"==typeof r&&(r=Math.max(r,wn.j))),r}getFirstVisibleColumn(){var e;return null!==(e=this.hot.getFirstRenderedVisibleColumn())&&void 0!==e?e:-1}getLastVisibleColumn(){var e;return null!==(e=this.hot.getLastRenderedVisibleColumn())&&void 0!==e?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce(((e,t,n)=>{const r=Cn(An,this).length;return(r-1{e.forEach((e=>{this.columnWidthsMap.setValueAtIndex(e,null)}))}),!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter((e=>null===e)).length}destroy(){this.ghostTable.clean(),super.destroy()}}function On(e){const t={from:0,to:this.hot.countRows()-1};e.forEach((e=>{const n=this.hot.toPhysicalColumn(e);null!==n&&(this.hot._getColWidthFromSettings(n)||Mn(Ln,this,In).call(this,e,t))})),this.ghostTable.columns.length&&(Mn(Ln,this,kn).call(this),this.ghostTable.clean())}function In(e,t){this.samplesGenerator.generateColumnSamples(e,t).forEach(((e,t)=>this.ghostTable.addColumn(t,e)))}function kn(){this.hot.batchExecution((()=>{this.ghostTable.getWidths(((e,t)=>{const n=this.hot.toPhysicalColumn(e);this.columnWidthsMap.setValueAtIndex(n,t)}))}),!0)}function Dn(){this.calculateVisibleColumnsWidth(),this.inProgress||(Mn(Ln,this,On).call(this,Cn(Nn,this)),En(Nn,this,[]))}function Pn(e,t){t||this.recalculateAllColumnsWidth()}function Hn(e){const t=e.reduce(((e,t)=>{let[,n]=t;const r=this.hot.propToCol(n);return Number.isInteger(r)&&-1===e.indexOf(r)&&e.push(r),e}),[]);Cn(Nn,this).push(...t)}function Fn(e,t,n){let r=e;return n&&(this.calculateColumnsWidth(t,void 0,!0),r=this.getColumnWidth(t,void 0,!1)),r}function Yn(){En(An,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),En(Rn,this,!0)}function Vn(e){if(!Cn(Rn,this))return;const t=e.reduce(((e,t)=>{var n;const r=null===(n=t.address)||void 0===n?void 0:n.col;if(Number.isInteger(r)){const t=this.hot.toVisualColumn(r);-1===e.indexOf(t)&&e.push(t)}return e}),[]);Cn(Nn,this).push(...t)}const Un={horizontal:"horizontal",vertical:"vertical"};function Bn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("modifyAutofillRange"),Ce.R.getSingleton().register("beforeAutofill"),Ce.R.getSingleton().register("afterAutofill");const jn="autofill",zn=["fillHandle"];var Gn=new WeakSet;class $n extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=Gn),t.add(e),Bn(this,"addingStarted",!1),Bn(this,"mouseDownOnCellCorner",!1),Bn(this,"mouseDragOutside",!1),Bn(this,"handleDraggedCells",0),Bn(this,"directions",[]),Bn(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return jn}static get PLUGIN_PRIORITY(){return 20}static get SETTING_KEYS(){return[jn,...zn]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",(e=>Wn(Gn,this,Xn).call(this,e))),this.addHook("afterOnCellCornerDblClick",(e=>Wn(Gn,this,Kn).call(this,e))),this.addHook("beforeOnCellMouseOver",((e,t)=>Wn(Gn,this,qn).call(this,t))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:t,col:n}=e.getTopStartCorner(),{row:r,col:o}=e.getBottomEndCorner(),i=this.hot.runHooks("modifyCopyableRange",[{startRow:t,startCol:n,endRow:r,endCol:o}]),s=[],a=[],l=[];return(0,h.z0)(i,(e=>{for(let t=e.startRow;t<=e.endRow;t+=1)-1===s.indexOf(t)&&s.push(t);for(let t=e.startCol;t<=e.endCol;t+=1)-1===a.indexOf(t)&&a.push(t)})),(0,h.z0)(s,(e=>{const t=[];(0,h.z0)(a,(n=>{t.push(this.hot.getCopyableData(e,n))})),l.push(t)})),l}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,t,n,r]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),i=o.getTopStartCorner(),s=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const a=[i.row,i.col,s.row,s.col],l=this.hot.runHooks("modifyAutofillRange",[Math.min(i.row,e),Math.min(i.col,t),Math.max(s.row,n),Math.max(s.col,r)],a),{directionOfDrag:u,startOfDragCoords:h,endOfDragCoords:c}=function(e,t,n){let r,o,i;return t[0]===e[0]&&t[1]e[3]?(i="right",r=n(t[0],e[3]+1),o=n(t[2],t[3])):t[0]e[2]&&t[1]===e[1]&&(i="down",r=n(e[2]+1,t[1]),o=n(t[2],t[3])),r&&r.normalize(),o&&o.normalize(),{directionOfDrag:i,startOfDragCoords:r,endOfDragCoords:o}}(a,l,((e,t)=>this.hot._createCellCoords(e,t)));if(h&&h.row>-1&&h.col>-1){const e=this.getSelectionData(),t=o.clone(),n=this.hot._createCellRange(h,h,c),r=this.hot.runHooks("beforeAutofill",e,t,n,u);if(!1===r)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let i=r;const s=r;if(["up","left"].indexOf(u)>-1&&(1!==s.length||0!==s[0].length))if(i=[],"up"===u){const e=c.row-h.row+1,t=e%s.length;for(let n=0;n=e.col)&&(r=this.hot._createCellCoords(n.row,e.col)),(n.rowe.row)&&(r=this.hot._createCellCoords(e.row,n.col))}else if(this.directions.includes(Un.vertical))r=this.hot._createCellCoords(e.row,n.col);else{if(!this.directions.includes(Un.horizontal))return;r=this.hot._createCellCoords(n.row,e.col)}return this.reduceSelectionAreaIfNeeded(r)}showBorder(e){const t=this.getCoordsOfDragAndDropBorders(e);t&&this.redrawBorders(t)}addRow(){this.hot._registerTimeout((()=>{this.hot.alter("insert_row_below",void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1}),200)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&!1===this.addingStarted&&this.autoInsertRow){const e=this.hot.getSelectedLast(),t=this.hot.selection.highlight.getFill().getVisualCorners(),n=this.hot.countRows();e[2]Math.max(e,0))),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),t=this.getIndexOfLastAdjacentFilledInRow(e);return-1!==t&&void 0!==t&&(this.addSelectionFromStartAreaToSpecificRowIndex(e,t),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:t}=this.hot.rootDocument,n=(0,o.cY)(this.hot.table).top-(this.hot.rootWindow.pageYOffset||t.scrollTop)+(0,o.DK)(this.hot.table),r=(0,o.cY)(this.hot.table).left-(this.hot.rootWindow.pageXOffset||t.scrollLeft)+(0,o.Gq)(this.hot.table);return e.clientY>n&&e.clientX<=r}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",(()=>Wn(Gn,this,Qn).call(this))),this.eventManager.addEventListener(e,"mousemove",(e=>Wn(Gn,this,Jn).call(this,e)))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=function(e){const t={};return!0===e?(t.directions=Object.keys(Un),t.autoInsertRow=!0):(0,s.Gv)(e)?((0,c.O9)(e.autoInsertRow)?e.direction===Un.horizontal?t.autoInsertRow=!1:t.autoInsertRow=e.autoInsertRow:t.autoInsertRow=!1,(0,c.O9)(e.direction)?t.directions=[e.direction]:t.directions=Object.keys(Un)):"string"==typeof e?(t.directions=[e],t.autoInsertRow=!0):(t.directions=[],t.autoInsertRow=!1),t}(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function Kn(){this.selectAdjacent()&&this.fillIn()}function Xn(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function qn(e){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(e),this.addNewRowIfNeeded())}function Qn(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function Jn(e){const t=this.getIfMouseWasDraggedOutside(e);!1===this.addingStarted&&this.handleDraggedCells>0&&t?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function Zn(e,t,n){er(e,t),t.set(e,n)}function er(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e,t,n){return e.set(or(e,t),n),n}function rr(e,t){return e.get(or(e,t))}function or(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const ir="autoRowSize";var sr=new WeakMap,ar=new WeakMap,lr=new WeakSet;class ur extends hn{static get PLUGIN_KEY(){return ir}static get PLUGIN_PRIORITY(){return 40}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){var t;super(e),er(this,t=lr),t.add(this),tr(this,"headerHeight",null),tr(this,"ghostTable",new pn(this.hot)),tr(this,"samplesGenerator",new yn(((e,t)=>{const n=this.hot.toPhysicalRow(e),r=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(n)||this.hot.columnIndexMapper.isHidden(r))return!1;if(e>=0&&t>=0&&this.hot.getCellMeta(e,t).hidden)return!1;let o;return e>=0?o=this.hot.getDataAtCell(e,t):-1===e&&(o=this.hot.getColHeader(t)),{value:o}}))),tr(this,"inProgress",!1),tr(this,"measuredRows",0),tr(this,"rowHeightsMap",new vn._),Zn(this,sr,[]),Zn(this,ar,!1),this.hot.rowIndexMapper.registerMap("autoRowSize",this.rowHeightsMap),this.addHook("beforeRowResize",((e,t,n)=>or(lr,this,dr).call(this,e,t,n)))}isEnabled(){const e=this.hot.getSettings()[ir];return!0===e||(0,s.Gv)(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const t=this.getSetting("samplingRatio");t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.recalculateAllRowsHeight())),this.addHook("afterFormulasValuesUpdate",(function(){for(var t=arguments.length,n=new Array(t),r=0;ror(lr,this,cr).call(this))),this.addHook("modifyRowHeight",((e,t)=>this.getRowHeight(t,e))),this.addHook("init",(()=>or(lr,this,fr).call(this))),this.addHook("modifyColumnHeaderHeight",(()=>this.getColumnHeaderHeight())),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",((e,t,n)=>or(lr,this,dr).call(this,e,t,n)))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),t=this.getLastVisibleRow();if(-1===e||-1===t)return;const n=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:t},void 0,n)}calculateRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="number"==typeof e?{from:e,to:e}:e,o="number"==typeof t?{from:t,to:t}:t;if(null!==this.hot.getColHeader(0)){const e=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(e.get(-1))}(0,Mt.Ti)(r.from,r.to,(e=>{let t=this.hot.toPhysicalRow(e);null===t&&(t=e),(n||null===this.rowHeightsMap.getValueAtIndex(t))&&this.samplesGenerator.generateRowSamples(e,o).forEach(((e,t)=>this.ghostTable.addRow(t,e)))})),this.ghostTable.rows.length&&(this.hot.batchExecution((()=>{this.ghostTable.getHeights(((e,t)=>{e<0?this.headerHeight=t:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(e),t)}))}),!0),this.measuredRows=r.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0;const r=this.hot.countRows()-1;let o=null;this.inProgress=!0;const i=()=>{if(!this.hot)return(0,dn.uU)(o),void(this.inProgress=!1);this.calculateRowsHeight({from:n,to:Math.min(n+ur.CALCULATION_STEP,r)},e,t),n=n+ur.CALCULATION_STEP+1,n=0&&(this.calculateRowsHeight({from:0,to:s},e,t),n=s+1),n>=0),Math.min(t,n)}getRowHeight(e,t){const n=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let r=t;return null!==n&&n>(t||0)&&(r=n),r}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return null!==(e=this.hot.getFirstRenderedVisibleRow())&&void 0!==e?e:-1}getLastVisibleRow(){var e;return null!==(e=this.hot.getLastRenderedVisibleRow())&&void 0!==e?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution((()=>{e.forEach((e=>{this.rowHeightsMap.setValueAtIndex(e,null)}))}),!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:t,to:n}="number"==typeof e?{from:e,to:e}:e;this.hot.batchExecution((()=>{(0,Mt.Ti)(Math.min(t,n),Math.max(t,n),(e=>{this.rowHeightsMap.setValueAtIndex(e,null)}))}),!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter((e=>null===e)).length}destroy(){this.ghostTable.clean(),super.destroy()}}function hr(e){const t={from:0,to:this.hot.countCols()-1};e.forEach((e=>{this.samplesGenerator.generateRowSamples(e,t).forEach(((e,t)=>this.ghostTable.addRow(t,e)))})),this.ghostTable.rows.length&&(this.hot.batchExecution((()=>{this.ghostTable.getHeights(((e,t)=>{const n=this.hot.toPhysicalRow(e);this.rowHeightsMap.setValueAtIndex(n,t)}))}),!0),this.ghostTable.clean())}function cr(){this.calculateVisibleRowsHeight(),this.inProgress||(or(lr,this,hr).call(this,rr(sr,this)),nr(sr,this,[]))}function dr(e,t,n){let r=e;return n&&(this.calculateRowsHeight(t,void 0,!0),r=this.getRowHeight(t)),r}function mr(e,t){t||this.recalculateAllRowsHeight()}function pr(e){const t=e.reduce(((e,t)=>{let[n]=t;return-1===e.indexOf(n)&&e.push(n),e}),[]);rr(sr,this).push(...t)}function fr(){this.recalculateAllRowsHeight(),nr(ar,this,!0)}function gr(e){if(!rr(ar,this))return;const t=e.reduce(((e,t)=>{var n;const r=null===(n=t.address)||void 0===n?void 0:n.row;if(Number.isInteger(r)){const t=this.hot.toVisualRow(r);-1===e.indexOf(t)&&e.push(t)}return e}),[]);rr(sr,this).push(...t)}var yr=n(48046),wr=n(77792);const vr=new Map([["indexesSequence",{getListWithInsertedItems:yr.N,getListWithRemovedItems:yr.H}],["physicallyIndexed",{getListWithInsertedItems:wr.N,getListWithRemovedItems:wr.H}]]),_r=e=>{if(!1===vr.has(e))throw new Error(`Alter strategy with ID '${e}' does not exist.`);return vr.get(e)};var br=n(41895),Sr=n(13317);const{getListWithInsertedItems:Cr,getListWithRemovedItems:Er}=_r("physicallyIndexed");class Mr extends br.n{constructor(){super((e=>e))}insert(e,t){const n=(0,Sr.z)(this.indexedValues,t);this.indexedValues=Cr(n,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){const t=Er(this.indexedValues,e);this.indexedValues=(0,Sr.v)(t,e),super.remove(e)}}const Tr=Mr,{getListWithInsertedItems:Rr,getListWithRemovedItems:Ar}=_r("physicallyIndexed");class Nr extends br.n{constructor(){super((e=>e))}insert(e,t){this.indexedValues=Rr(this.indexedValues,e,t,((e,t)=>this.getNextValue(t))),super.insert(e,t)}remove(e){this.indexedValues=Ar(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}const Lr="bindRowsWithHeaders",xr=new Map([["loose",Tr],["strict",Nr]]);var Or=new WeakSet;class Ir extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=Or),t.add(e),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"headerIndexes",null)}static get PLUGIN_KEY(){return Lr}static get PLUGIN_PRIORITY(){return 210}isEnabled(){return!!this.hot.getSettings()[Lr]}enablePlugin(){var e;if(this.enabled)return;const t=null!==(e=xr.get(this.getSetting()))&&void 0!==e?e:xr.get("loose");this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new t),this.addHook("modifyRowHeader",(e=>function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(Or,this,kr).call(this,e))),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function kr(e){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(e))}var Dr=n(82617);function Pr(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fr(e,t){return e.get(Vr(e,t))}function Yr(e,t,n){return e.set(Vr(e,t),n),n}function Vr(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Ur="collapsibleColumns",Br=["nestedHeaders"],Wr="collapsibleIndicator",jr=Ur,zr=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Gr=new WeakMap,$r=new WeakSet;class Kr extends hn{constructor(){var e;super(...arguments),Pr(this,e=$r),e.add(this),Hr(this,"nestedHeadersPlugin",null),Hr(this,"headerStateManager",null),function(e,t){Pr(e,t),t.set(e,null)}(this,Gr)}static get PLUGIN_KEY(){return Ur}static get PLUGIN_PRIORITY(){return 290}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Ur,...Br]}isEnabled(){return!!this.hot.getSettings()[Ur]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();t||(0,Dr.R8)("You need to configure the Nested Headers plugin in order to use collapsible headers."),Yr(Gr,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",(()=>Vr($r,this,Qr).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rVr($r,this,qr).call(this,e,t,n))),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();"boolean"==typeof e?this.headerStateManager.mapState((e=>({collapsible:e.origColspan>1}))):Array.isArray(e)&&(this.headerStateManager.mapState((()=>({collapsible:!1}))),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Yr(Gr,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:t,col:n}=this.hot.getSelectedRangeLast().highlight,{collapsible:r,isCollapsed:o,columnIndex:i}=null!==(e=this.headerStateManager.getHeaderTreeNodeData(t,n))&&void 0!==e?e:{};if(r)return o?this.expandSection({row:t,col:i}):this.collapseSection({row:t,col:i}),!1},runOnlyIf:()=>{var e,t;return(null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.isSingle())&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isHeader())},group:jr,relativeToGroup:a.b,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(jr)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,t=this.hot.view._wt.wtTable.THEAD,n=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(e){e&&e.parentNode.removeChild(e)};(0,Mt.Ti)(0,e-1,(e=>{const i=t.childNodes[e],s=n.childNodes[e],a=r?r.childNodes[e]:null;(0,Mt.Ti)(0,i.childNodes.length-1,(e=>{let t=i.childNodes[e].querySelector(`.${Wr}`);o(t),s&&s.childNodes[e]&&(t=s.childNodes[e].querySelector(`.${Wr}`),o(t)),r&&a&&a.childNodes[e]&&(t=a.childNodes[e].querySelector(`.${Wr}`),o(t))}))}),!0)}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const t=this.headerStateManager.mapNodes((t=>{const{collapsible:n,origColspan:r,headerLevel:o,columnIndex:i,isCollapsed:s}=t;if(!0===n&&r>1&&(s&&"expand"===e||!s&&"collapse"===e))return{row:this.headerStateManager.levelToRowCoords(o),col:i}}));this.toggleCollapsibleSection(t,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,t){if(!zr.has(t))throw new Error(`Unsupported action is passed (${t}).`);if(!Array.isArray(e))return;const n=(0,h.y0)(e,(e=>{let{row:t}=e;return t<0}));let r=n.length>0;(0,h.z0)(n,(e=>{var n;let{row:o,col:i}=e;const{collapsible:s,isCollapsed:a}=null!==(n=this.headerStateManager.getHeaderSettings(o,i))&&void 0!==n?n:{};if(!s||a&&"collapse"===t||!a&&"expand"===t)return r=!1,!1}));const o=[],i=[];r&&(0,h.z0)(n,(e=>{let{row:n,col:r}=e;const{colspanCompensation:s,affectedColumns:a,rollbackModification:l}=this.headerStateManager.triggerNodeModification(t,n,r);s>0&&(i.push(...a),o.push(l))}));const s=this.getCollapsedColumns();let a=[];"collapse"===t?a=(0,h.jF)([...s,...i]):"expand"===t&&(a=(0,h.y0)(s,(e=>!i.includes(e))));const l=zr.get(t);if(!1===this.hot.runHooks(l.beforeHook,s,a,r))return void(0,h.z0)(o,(e=>{e()}));this.hot.batchExecution((()=>{(0,h.z0)(i,(e=>{Fr(Gr,this).setValueAtIndex(this.hot.toPhysicalColumn(e),l.hideColumn)}))}),!0);const u=this.getCollapsedColumns().length!==s.length,c=this.hot.getSelectedRangeLast();if("collapse"===t&&u&&c){const{row:e,col:t}=c.highlight;if((this.hot.rowIndexMapper.isHidden(e)||this.hot.columnIndexMapper.isHidden(t))&&i.includes(t)){const n=e>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(e,1,!0):e,r=t>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(t,1,!0):t;null!==n&&null!==r&&this.hot.selectCell(n,r)}}this.hot.runHooks(l.afterHook,s,a,r,u),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return Fr(Gr,this).getHiddenIndexes()}destroy(){Yr(Gr,this,null),super.destroy()}}function Xr(e,t,n){var r;const{collapsible:i,origColspan:s,isCollapsed:a}=null!==(r=this.headerStateManager.getHeaderSettings(n,e))&&void 0!==r?r:{},l=i&&s>1&&e>=this.hot.getSettings().fixedColumnsStart,u=this.hot.getSettings().ariaTags;let h=t.querySelector(`.${Wr}`);var c;(0,o.De)(t,[(0,f.dV)("")[0]]),l?(h||(h=this.hot.rootDocument.createElement("div"),(0,o.iQ)(h,Wr),t.querySelector("div:first-child").appendChild(h)),(0,o.vy)(h,["collapsed","expanded"]),a?((0,o.iQ)(h,"collapsed"),(0,o.c6)(h,"+"),u&&(0,o.Bq)(t,...(0,f.dV)(!1))):((0,o.iQ)(h,"expanded"),(0,o.c6)(h,"-"),u&&(0,o.Bq)(t,...(0,f.dV)(!0))),u&&(0,o.Bq)(h,...(0,f.MG)())):null===(c=h)||void 0===c||c.remove()}function qr(e,t){(0,o.nB)(e.target,Wr)&&((0,o.nB)(e.target,"expanded")?(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"collapse")):(0,o.nB)(e.target,"collapsed")&&(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"expand")),(0,i.CA)(e))}function Qr(){this.updatePlugin()}function Jr(e,t){t||this.updatePlugin()}var Zr=n(85408),eo=n(31803);function to(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const no=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"];class ro{constructor(e,t){to(this,"hot",void 0),to(this,"sortingStates",new eo.z),to(this,"sortEmptyCells",!1),to(this,"indicator",!0),to(this,"headerAction",!0),to(this,"compareFunctionFactory",void 0),to(this,"mapName",void 0),this.hot=e,this.mapName=t,this.hot.columnIndexMapper.registerMap(t,this.sortingStates)}updateAllColumnsProperties(e){(0,s.Gv)(e)&&(0,s.v4)(e,((e,t)=>{no.includes(t)&&(this[t]=e)}))}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return"function"==typeof this.compareFunctionFactory&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var t;return null===(t=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))||void 0===t?void 0:t.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex((t=>{let[n]=t;return n===e}))}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return 0===this.getNumberOfSortedColumns()}isColumnSorted(e){return(0,s.Gv)(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return null===this.sortingStates?[]:this.sortingStates.getEntries().map((e=>{let[t,n]=e;return{column:this.hot.toVisualColumn(t),...n}}))}getColumnSortState(e){const t=this.getSortOrderOfColumn(e);if((0,c.O9)(t))return{column:e,sortOrder:t}}setSortStates(e){this.sortingStates.clear();for(let t=0;to?"asc"===e?go:fo:po)}}n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(37550);const io="default";var so=n(34647);const{register:ao,getItem:lo,hasItem:uo}=(0,so.A)("sorting.compareFunctionFactory"),{register:ho,getItem:co}=(0,so.A)("sorting.mainSortComparator");function mo(e){return uo(e)?lo(e):lo(io)}ao("checkbox",(function(e,t,n){const r=t.checkedTemplate,o=t.uncheckedTemplate,{sortEmptyCells:i}=n;return function(s,a){const l=(0,c.Im)(s),u=(0,c.Im)(a),h=l?o:s,d=u?o:a,m=h===o||h===r,p=d===o||d===r;if(!1===i){if(l&&!1===u)return go;if(!1===l&&u)return fo}return!1===m&&p?"asc"===e?fo:go:m&&!1===p?"asc"===e?go:fo:!1===m&&!1===p?oo(e,t,n)(s,a):h===o&&d===r?"asc"===e?fo:go:h===r&&d===o?"asc"===e?go:fo:po}})),ao("date",(function(e,t,n){return Mo(e,t.dateFormat,n)})),ao(io,oo),ao("numeric",(function(e,t,n){return function(t,r){const o=parseFloat(t),i=parseFloat(r),{sortEmptyCells:s}=n;if(o===i||isNaN(o)&&isNaN(i))return po;if(s){if((0,c.Im)(t))return"asc"===e?fo:go;if((0,c.Im)(r))return"asc"===e?go:fo}return isNaN(o)?go:isNaN(i)?fo:oi?"asc"===e?go:fo:po}})),ao("time",(function(e,t,n){return Mo(e,t.timeFormat,n)}));const po=0,fo=-1,go=1;var yo=n(85975);const wo="asc",vo="desc",_o="colHeader";function bo(e){if(e!==vo)return e===wo?vo:wo}function So(e){return e.querySelector(`.${_o}`)}function Co(e,t){if(e<0||!t.parentNode)return!1;const n=t.parentNode.parentNode.childNodes;return-1===Array.from(n).indexOf(t.parentNode)-n.length}function Eo(e,t,n){return-1===e&&t>=0&&!1===(0,i.nO)(n)}function Mo(e,t,n){return function(r,o){const{sortEmptyCells:i}=n;if(r===o)return po;if((0,c.Im)(r))return(0,c.Im)(o)?po:i&&"asc"===e?fo:go;if((0,c.Im)(o))return i&&"asc"===e?go:fo;const s=N(r,t),a=N(o,t);return s.isValid()?a.isValid()?a.isAfter(s)?"asc"===e?fo:go:a.isBefore(s)?"asc"===e?go:fo:po:fo:go}}const To="indicatorDisabled",Ro="columnSorting",Ao="sortAction",No=new Map([[wo,"ascending"],[vo,"descending"]]);function Lo(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xo(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Oo="columnSorting",Io="append",ko=Oo;ho(Oo,(function(e,t){return function(n,r){const[,...o]=n,[,...i]=r;return function(){const n=e[0],r=t[0],s=o[0],a=i[0],l=r.columnSorting;return(l.compareFunctionFactory?l.compareFunctionFactory:mo(r.type))(n,r,l)(s,a)}()}})),Ce.R.getSingleton().register("beforeColumnSort"),Ce.R.getSingleton().register("afterColumnSort");const Do=new WeakMap;var Po=new WeakSet;class Ho extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=Po),t.add(e),Lo(this,"columnStatesManager",null),Lo(this,"columnMetaCache",null),Lo(this,"pluginKey",Oo),Lo(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Oo}static get PLUGIN_PRIORITY(){return 50}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e,t,n=this;if(Do.has(this.hot)&&Do.get(this.hot)!==this.pluginKey)return this.hot.updateSettings({[this.pluginKey]:!1}),e=Do.get(this.hot),t=this.pluginKey,void(0,Dr.R8)(yo.O`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20 Only \`${e}\` will work. The \`${t}\` plugin will remain disabled.`);this.enabled||(Do.set(this.hot,this.pluginKey),this.columnStatesManager=new ro(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new vn._((e=>{let t=this.hot.toVisualColumn(e);return null===t&&(t=e),this.getMergedPluginSettings(t)})),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",((e,t)=>xo(Po,this,Yo).call(this,e,t))),this.addHook("beforeOnCellMouseDown",(function(){for(var e=arguments.length,t=new Array(e),r=0;rthis.onAfterOnCellMouseDown(e,t))),this.addHook("afterInit",(()=>xo(Po,this,Fo).call(this))),this.addHook("afterLoadData",(function(){for(var e=arguments.length,t=new Array(e),r=0;r{const n=So(t);!1!==Co(e,t)&&null!==n&&this.updateHeaderClasses(n)};Do.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",(()=>{this.hot.removeHook("afterGetColHeader",e)})),this.hot.batchExecution((()=>{null!==this.indexesSequenceCache&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)}),!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,t;const n=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return n&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(n)&&-1===n.row&&n.col>=0},relativeToGroup:a.b,position:"before",group:ko})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ko)}sort(e){const t=this.getSortConfig(),n=this.getNormalizedSortConfigs(e),r=this.areValidSortConfigs(n);!1!==this.hot.runHooks("beforeColumnSort",t,n,r)&&(0===t.length&&null===this.indexesSequenceCache&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new Zr.K),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),r&&(this.columnStatesManager.setSortStates(n),this.sortByPresetSortStates(n),this.saveAllSortSettings(n)),this.hot.runHooks("afterColumnSort",t,r?n:t,r),r&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return(0,c.O9)(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const t=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(t)&&this.columnStatesManager.setSortStates(t)}getNormalizedSortConfigs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const t=this.hot.countCols();return function(e){if(e.some((e=>!1===function(e){if(!1===(0,s.Gv)(e))return!1;const{column:t,sortOrder:n}=e;return Number.isInteger(t)&&[wo,vo].includes(n)}(e))))return!1;const t=e.map((e=>{let{column:t}=e;return t}));return new Set(t).size===t.length}(e)&&e.every((e=>{let{column:n}=e;return n<=t&&n>=0}))}saveAllSortSettings(e){const t=this.columnStatesManager.getAllColumnsProperties();t.initialConfig=(0,h.YD)(e,(e=>{let{column:t,...n}=e;return{column:this.hot.toPhysicalColumn(t),...n}})),this.hot.runHooks("persistentStateSave","columnSorting",t)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const t=e.value;return(0,c.O9)(t)&&Array.isArray(t.initialConfig)&&(t.initialConfig=(0,h.YD)(t.initialConfig,(e=>{let{column:t,...n}=e;return{column:this.hot.toVisualColumn(t),...n}}))),t}getColumnNextConfig(e){const t=this.columnStatesManager.getSortOrderOfColumn(e);if((0,c.O9)(t)){const n=bo(t);return(0,c.O9)(n)?{column:e,sortOrder:n}:void 0}const n=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e1&&void 0!==arguments[1]?arguments[1]:Io;const n=this.columnStatesManager.getIndexOfColumnInSortQueue(e),r=-1!==n,o=this.getSortConfig(),i=this.getColumnNextConfig(e);if(r){if((0,c.b0)(i))return[...o.slice(0,n),...o.slice(n+1)];if(t===Io)return[...o.slice(0,n),...o.slice(n+1),i];if("replace"===t)return[...o.slice(0,n),i,...o.slice(n+1)]}return(0,c.O9)(i)?o.concat(i):o}getPluginColumnConfig(e){if((0,s.Gv)(e)){const t=e[this.pluginKey];if((0,s.Gv)(t))return t}return{}}getMergedPluginSettings(e){const t=this.hot.getSettings()[this.pluginKey],n=this.columnStatesManager.getAllColumnsProperties(),r=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(r);return Array.isArray(o.columns)?Object.assign(n,t,this.getPluginColumnConfig(o.columns[e])):(0,g.Tn)(o.columns)?Object.assign(n,t,this.getPluginColumnConfig(o.columns(e))):Object.assign(n,t)}getFirstCellSettings(e){const t=this.hot.getCellMeta(0,e),n=Object.create(t);return n[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),n}getNumberOfRowsToSort(e){const t=this.hot.getSettings();return t.maxRows<=e?t.maxRows:e-t.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),0===e.length)return;const t=[],n=this.hot.countRows(),r=t=>(0,h.YD)(e,(e=>this.hot.getDataAtCell(t,e.column)));for(let e=0;ee[0]));!function(e,t){const n=co(t);for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;ie.sortOrder)),(0,h.YD)(e,(e=>this.getFirstCellSettings(e.column))));for(let e=t.length;ee[0])),s=new Map((0,h.YD)(o,((e,t)=>[e,i[t]]))),a=(0,h.YD)(this.hot.rowIndexMapper.getIndexesSequence(),(e=>s.has(e)?s.get(e):e));this.hot.rowIndexMapper.setIndexesSequence(a)}sortBySettings(e){if((0,s.Gv)(e)){this.columnStatesManager.updateAllColumnsProperties(e);const t=e.initialConfig;(Array.isArray(t)||(0,s.Gv)(t))&&this.sort(t)}else this.hot.render()}updateHeaderClasses(e){if((0,o.vy)(e,Array.from(No.values()).concat(Ao,To,Ro)),!1!==this.enabled){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{this.sort(n)})):this.sort(n)}}destroy(){var e;null===(e=this.columnStatesManager)||void 0===e||e.destroy(),super.destroy()}}function Fo(){const e=this.getAllSavedSortSettings();if((0,s.Gv)(e))this.sortBySettings(e);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function Yo(e,t){const n=So(t);if(!1===Co(e,t)||null===n)return;const r=this.getFirstCellSettings(e)[this.pluginKey],i=r.indicator,s=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,e,i,s),this.hot.getSettings().ariaTags){const n=this.columnStatesManager.getSortOrderOfColumn(e);(0,o.Bq)(t,...(0,f._h)(n?`${n}ending`:"none"))}}function Vo(e){!0===e&&this.hot.view&&xo(Po,this,Fo).call(this)}function Uo(e,t,n,r){!1!==Eo(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Bo(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wo=class{constructor(e,t){Bo(this,"plugin",void 0),Bo(this,"hot",void 0),Bo(this,"endpoints",[]),Bo(this,"settings",void 0),Bo(this,"settingsType","array"),Bo(this,"currentEndpoint",null),Bo(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=t}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const t=[];let n=e;if(n||"function"!=typeof this.settings)return n||(n=this.settings),(0,h.z0)(n,(e=>{const n={};this.assignSetting(e,n,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(e,n,"reversedRowCoords",!1),this.assignSetting(e,n,"destinationRow",new Error("\n You must provide a destination row for the Column Summary plugin in order to work properly!\n ")),this.assignSetting(e,n,"destinationColumn",new Error("\n You must provide a destination column for the Column Summary plugin in order to work properly!\n ")),this.assignSetting(e,n,"sourceColumn",e.destinationColumn),this.assignSetting(e,n,"type","sum"),this.assignSetting(e,n,"forceNumeric",!1),this.assignSetting(e,n,"suppressDataTypeErrors",!0),this.assignSetting(e,n,"customFunction",null),this.assignSetting(e,n,"readOnly",!0),this.assignSetting(e,n,"roundFloat",!1),t.push(n)})),t;this.settingsType="function"}assignSetting(e,t,n,r){if("ranges"!==n||void 0!==e[n]){if("ranges"!==n||0!==e[n].length)if(void 0===e[n]){if(r instanceof Error)throw r;t[n]=r}else"destinationRow"===n&&t.reversedRowCoords?t[n]=this.hot.countRows()-e[n]-1:t[n]=e[n]}else t[n]=r}resetSetupBeforeStructureAlteration(e,t,n){if("function"!==this.settingsType)return;const r=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();(0,h.z0)(o,(o=>{"row"===r&&o.destinationRow>=t&&("insert_row"===e?o.alterRowOffset=n:"remove_row"===e&&(o.alterRowOffset=-1*n)),"col"===r&&o.destinationColumn>=t&&("insert_col"===e?o.alterColumnOffset=n:"remove_col"===e&&(o.alterColumnOffset=-1*n))})),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,t,n,r,o){let i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if("function"===this.settingsType){const e=()=>(this.hot.removeHook("beforeViewRender",e),this.refreshAllEndpoints());return void this.hot.addHookOnce("beforeViewRender",e)}const s=e.indexOf("row")>-1?"row":"col",a=e.indexOf("remove")>-1?-1:1,l=this.getAllEndpoints(),u=0===e.indexOf("move_row"),c=t;(0,h.z0)(l,(e=>{"row"===s&&e.destinationRow>=c&&(e.alterRowOffset=a*n),"col"===s&&e.destinationColumn>=c&&(e.alterColumnOffset=a*n)})),this.resetAllEndpoints(l,!u),u?(0,h.z0)(l,(e=>{this.extendEndpointRanges(e,c,r[0],r.length),this.recreatePhysicalRanges(e),this.clearOffsetInformation(e)})):(0,h.z0)(l,(e=>{this.shiftEndpointCoordinates(e,c)})),i&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,t,n,r){(0,h.z0)(e.ranges,(e=>{e[1]&&(t>=e[0]&&t<=e[1]?n>e[1]?e[1]+=r:n=e[0]&&n<=e[1]&&(e[1]-=r,t<=e[0]&&(e[0]+=1,e[1]+=1)))}))}recreatePhysicalRanges(e){const t=e.ranges,n=[],r=[];(0,h.z0)(t,(e=>{const t=[];if(e[1])for(let n=e[0];n<=e[1];n++)t.push(this.hot.toPhysicalRow(n));else t.push(this.hot.toPhysicalRow(e[0]));r.push(t)})),(0,h.z0)(r,(e=>{let t=[];(0,h.z0)(e,((r,o)=>{0===o?t.push(r):e[o]!==e[o-1]+1&&(t.push(e[o-1]),n.push(t),t=[],t.push(r)),o===e.length-1&&(t.push(r),n.push(t))}))})),e.ranges=n}shiftEndpointCoordinates(e,t){e.alterRowOffset&&0!==e.alterRowOffset?(e.destinationRow+=e.alterRowOffset||0,(0,h.z0)(e.ranges,(n=>{(0,h.z0)(n,((r,o)=>{r>=t&&(n[o]+=e.alterRowOffset||0)}))}))):e.alterColumnOffset&&0!==e.alterColumnOffset&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAllEndpoints(),t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.some((e=>{const t=e.alterRowOffset||0,n=e.alterColumnOffset||0;return e.destinationRow+t>=this.hot.countRows()||e.destinationColumn+n>=this.hot.countCols()}))||(this.cellsToSetCache=[],(0,h.z0)(e,(e=>{this.resetEndpointValue(e,t)})),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],(0,h.z0)(this.getAllEndpoints(),(e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")})),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const t=[];this.cellsToSetCache=[],(0,h.z0)(e,((e,n,r)=>{`${e[2]||""}`!=`${e[3]}`&&(0,h.z0)(this.getAllEndpoints(),((e,o)=>{this.hot.propToCol(r[n][1])===e.sourceColumn&&-1===t.indexOf(o)&&t.push(o)}))})),(0,h.z0)(t,(e=>{this.refreshEndpoint(this.getEndpoint(e))})),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach((e=>{const t=this.hot.toVisualRow(e.destinationRow);if(null!==t){const n=this.hot.getCellMeta(t,e.destinationColumn);n.readOnly=e.readOnly,n.className="columnSummaryResult"}}))}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e.alterRowOffset||0,r=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(t?n:0)),this.hot.toVisualColumn(e.destinationColumn+(t?r:0)),""])}setEndpointValue(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols())return void this.throwOutOfBoundsWarning();const o=this.hot.toVisualRow(e.destinationRow);if(null!==o){const n=this.hot.getCellMeta(o,e.destinationColumn);"init"!==t&&n.readOnly===e.readOnly||(n.readOnly=e.readOnly,n.className="columnSummaryResult")}if((!0===e.roundFloat||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const t=e.roundFloat;let n=0;Number.isInteger(t)&&(n=Math.min(Math.max(0,t),100)),e.result=e.result.toFixed(n)}n?this.hot.setDataAtCell(r,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([r,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){(0,Dr.R8)("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}};function jo(e){return null==e||isNaN(e)}function zo(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Go="columnSummary";var $o=new WeakSet;class Ko extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=$o),t.add(e),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"endpoints",null)}static get PLUGIN_KEY(){return Go}static get PLUGIN_PRIORITY(){return 220}isEnabled(){return!!this.hot.getSettings()[Go]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[Go],this.endpoints=new Wo(this,this.settings),this.addHook("afterInit",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.endpoints.resetSetupBeforeStructureAlteration("insert_row",e,t,null,n))),this.addHook("beforeCreateCol",((e,t,n)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",e,t,null,n))),this.addHook("beforeRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.endpoints.resetSetupAfterStructureAlteration("insert_row",e,t,null,n))),this.addHook("afterCreateCol",((e,t,n)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",e,t,null,n))),this.addHook("afterRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{t+=this.getPartialSum(n,e.sourceColumn)})),t}getPartialSum(e,t){let n=0,r=e[1]||e[0],o=null,i=0;do{if(o=this.getCellValue(r,t),o=jo(o)?null:o,null!==o){const e=(`${o}`.split(".")[1]||[]).length||1;e>i&&(i=e)}n+=o||0,r-=1}while(r>=e[0]);return Math.round(n*10**i)/10**i}calculateMinMax(e,t){let n=null;return(0,s.v4)(e.ranges,(r=>{const o=this.getPartialMinMax(r,e.sourceColumn,t);if(null===n&&null!==o&&(n=o),null!==o)switch(t){case"min":n=Math.min(n,o);break;case"max":n=Math.max(n,o)}})),null===n?"Not enough data":n}getPartialMinMax(e,t,n){let r,o=null,i=e[1]||e[0];do{if(r=this.getCellValue(i,t),r=jo(r)?null:r,null===o)o=r;else if(null!==r)switch(n){case"min":o=Math.min(o,r);break;case"max":o=Math.max(o,r)}i-=1}while(i>=e[0]);return o}countEmpty(e,t){let n,r=0,o=e[1]||e[0];do{n=this.getCellValue(o,t),n=jo(n)?null:n,null===n&&(r+=1),o-=1}while(o>=e[0]);return r}countEntries(e){let t=0;const n=e.ranges;return(0,s.v4)(n,(n=>{const r=void 0===n[1]?1:n[1]-n[0]+1,o=this.countEmpty(n,e.sourceColumn);t+=r,t-=o})),t}calculateAverage(e){return this.calculateSum(e)/this.countEntries(e)}getCellValue(e,t){const n=this.hot.toVisualRow(e),r=this.hot.toVisualColumn(t);let o=this.hot.getSourceDataAtCell(e,t),i="";if(null!==n&&null!==r&&(i=this.hot.getCellMeta(n,r).className||""),i.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&("string"==typeof o&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(yo.O`ColumnSummary plugin: cell at (${e}, ${t}) is not in a\x20 numeric format. Cannot do the calculation.`);return o}}function Xo(){this.endpoints.initEndpoints()}function qo(e){void 0!==e.columns&&this.endpoints.refreshCellMetas()}function Qo(e,t){e&&"ColumnSummary.reset"!==t&&"ColumnSummary.set"!==t&&"loadData"!==t&&this.endpoints.refreshChangedEndpoints(e)}function Jo(e,t){this.endpoints.resetSetupBeforeStructureAlteration("move_row",e[0],e.length,e,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",t,e.length,e,this.pluginName)}var Zo=n(77710);function ei(e,t,n){ti(e,t),t.set(e,n)}function ti(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ni(e,t){return e.get(oi(e,t))}function ri(e,t,n){return e.set(oi(e,t),n),n}function oi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var ii=new WeakMap,si=new WeakMap,ai=new WeakMap,li=new WeakSet;class ui{constructor(){var e;ti(this,e=li),e.add(this),ei(this,ii,!0),ei(this,si,null),ei(this,ai,new ResizeObserver((e=>oi(li,this,hi).call(this,e))))}setObservedElement(e){ri(si,this,e)}unobserve(){ni(ai,this).unobserve(ni(si,this))}observe(){ri(ii,this,!0),ni(ai,this).observe(ni(si,this))}destroy(){ni(ai,this).disconnect()}}function hi(e){!ni(ii,this)&&Array.isArray(e)&&e.length?e.forEach((e=>{let{borderBoxSize:t}=e;const{inlineSize:n,blockSize:r}=t[0];this.runLocalHooks("resize",n,r)})):ri(ii,this,!1)}function ci(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function di(e,t){return e.get(pi(e,t))}function mi(e,t,n){return e.set(pi(e,t),n),n}function pi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(0,s.co)(ui,Zo.A);var fi=new WeakMap,gi=new WeakMap,yi=new WeakMap,wi=new WeakMap,vi=new WeakMap,_i=new WeakMap,bi=new WeakMap;class Si{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,t){var n=this;ci(this,fi,void 0),ci(this,gi,!1),ci(this,yi,null),ci(this,wi,void 0),ci(this,vi,void 0),ci(this,_i,!0),ci(this,bi,new ui),mi(fi,this,e),mi(gi,this,t),mi(wi,this,this.createEditor()),mi(vi,this,di(wi,this).style),di(bi,this).setObservedElement(this.getInputElement()),di(bi,this).addLocalHook("resize",(function(){for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:"")||"";this.getInputElement().value=e}getValue(){return this.getInputElement().value}isFocused(){return di(fi,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=di(fi,this).createElement("div"),t=di(fi,this).createElement("textarea");return e.style.display="none",mi(yi,this,di(fi,this).createElement("div")),di(yi,this).setAttribute("dir",di(gi,this)?"rtl":"ltr"),(0,o.iQ)(di(yi,this),Si.CLASS_EDITOR_CONTAINER),di(fi,this).body.appendChild(di(yi,this)),(0,o.iQ)(e,Si.CLASS_EDITOR),(0,o.iQ)(t,Si.CLASS_INPUT),t.setAttribute("data-hot-input",!0),e.appendChild(t),di(yi,this).appendChild(e),e}getInputElement(){return di(wi,this).querySelector(`.${Si.CLASS_INPUT}`)}getEditorElement(){return di(wi,this)}destroy(){const e=di(yi,this)?di(yi,this).parentNode:null;di(wi,this).parentNode.removeChild(di(wi,this)),mi(wi,this,null),mi(vi,this,null),di(bi,this).destroy(),e&&e.removeChild(di(yi,this))}}(0,s.co)(Si,Zo.A);const Ci=Si;function Ei(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Mi{constructor(e){Ei(this,"wasLastActionShow",!0),Ei(this,"showDebounced",null),Ei(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout((()=>{!1===this.wasLastActionShow&&this.runLocalHooks("hide")}),250)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250;this.showDebounced=(0,g.sg)((e=>{this.wasLastActionShow&&this.runLocalHooks("show",e.from.row,e.from.col)}),e)}destroy(){this.clearLocalHooks()}}(0,s.co)(Mi,Zo.A);const Ti=Mi,Ri="---------";function Ai(e,t){const n={};return(0,h.z0)(e,(e=>{e.forAll(((e,r)=>{e>=0&&r>=0&&(n[e]||(n[e]=[]),n[e][r]=t(e,r))}))})),n}function Ni(e,t,n,r,o){(0,h.z0)(e,(e=>{e.forAll(((e,i)=>{e>=0&&i>=0&&function(e,t,n,r,o,i){const s=o(e,t);let a=r;s.className&&(a="vertical"===n?function(e,t){return-1!==e.indexOf(t)?e:`${e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${t}`}(s.className,r):function(e,t){return-1!==e.indexOf(t)?e:`${e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${t}`}(s.className,r)),i(e,t,"className",a)}(e,i,t,n,r,o)}))}))}function Li(e){return`${String.fromCharCode(10003)}${e}`}function xi(e,t){let n=!1;return Array.isArray(e)&&(0,h.z0)(e,(e=>(e.forAll(((e,r)=>{if(e>=0&&r>=0&&t(e,r))return n=!0,!1})),n))),n}function Oi(e,t){const n={top:0,left:0};if(t!==e.ownerDocument){const{frameElement:e}=t.defaultView,{top:r,left:o}=e.getBoundingClientRect();n.top=r,n.left=o}return n}function Ii(e,t,n){ki(e,t),t.set(e,n)}function ki(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Di(e,t,n){return e.set(Hi(e,t),n),n}function Pi(e,t){return e.get(Hi(e,t))}function Hi(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Fi="comments",Yi="comment",Vi="value",Ui="style",Bi="readOnly",Wi=Fi,ji=`plugin:${Fi}`;var zi=new WeakMap,Gi=new WeakMap,$i=new WeakMap,Ki=new WeakMap,Xi=new WeakMap,qi=new WeakMap,Qi=new WeakSet;class Ji extends hn{constructor(){var e;super(...arguments),ki(this,e=Qi),e.add(this),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"range",{}),Ii(this,zi,null),Ii(this,Gi,null),Ii(this,$i,!1),Ii(this,Ki,!1),Ii(this,Xi,null),Ii(this,qi,"")}static get PLUGIN_KEY(){return Fi}static get PLUGIN_PRIORITY(){return 60}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[Fi]}enablePlugin(){var e=this;this.enabled||(Pi(zi,this)||(Di(zi,this,new Ci(this.hot.rootDocument,this.hot.isRtl())),Pi(zi,this).addLocalHook("resize",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.addToContextMenu(e))),this.addHook("afterRenderer",((e,t,n,r,o,i)=>Hi(Qi,this,rs).call(this,e,i))),this.addHook("afterScroll",(()=>Hi(Qi,this,ls).call(this))),this.addHook("afterBeginEditing",(()=>this.hide())),this.addHook("afterDocumentKeyDown",(e=>Hi(Qi,this,as).call(this,e))),this.addHook("beforeCompositionStart",(e=>Hi(Qi,this,as).call(this,e))),this.addHook("afterSetTheme",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.hide())),Pi(Gi,this).addLocalHook("show",((e,t)=>this.showAtCell(e,t))),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Pi(Gi,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("grid"),n=e.addContext(ji);t.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const t=this.hot.getSelectedRangeLast();Di(Ki,this,!0),this.hot.scrollToFocusedCell((()=>{this.setRange(t),this.show(),this.focusEditor(),e.setActiveContextName(ji),this.hot._registerTimeout((()=>{Di(Ki,this,!1)}))}))},stopPropagation:!0,runOnlyIf:()=>{var e;return null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight.isCell()},group:Wi}),n.addShortcut({keys:[["Escape"]],callback:()=>{Pi(zi,this).setValue(Pi(qi,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Pi(zi,this).isVisible()&&Pi(zi,this).isFocused(),group:Wi}),n.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Pi(zi,this).isVisible()&&Pi(zi,this).isFocused(),group:Wi}),n.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Pi(zi,this).setValue(Pi(zi,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Wi})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Wi)}registerListeners(){const{rootDocument:e}=this.hot,t=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",(e=>Hi(Qi,this,ts).call(this,e))),this.eventManager.addEventListener(e,"mousedown",(e=>Hi(Qi,this,Zi).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>Hi(Qi,this,ns).call(this))),this.eventManager.addEventListener(t,"focus",(()=>Hi(Qi,this,is).call(this))),this.eventManager.addEventListener(t,"blur",(()=>Hi(Qi,this,os).call(this))),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",(e=>Hi(Qi,this,es).call(this,e)))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const t=(0,o.kp)(e.target,"TD","TBODY");return!!(t&&(0,o.nB)(t,"htCommentCell")&&(0,o.kp)(t,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const t=Pi(zi,this).getValue();let n="";null!=e?n=e:null!=t&&(n=t);const r=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(r,o,{[Vi]:n}),this.hot.render()}setCommentAtCell(e,t,n){this.setRange({from:this.hot._createCellCoords(e,t)}),this.setComment(n)}removeComment(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,Yi),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.setRange({from:this.hot._createCellCoords(e,t)}),this.removeComment(n)}getComment(){const e=this.range.from.row,t=this.range.from.col;return this.getCommentMeta(e,t,Vi)}getCommentAtCell(e,t){return this.getCommentMeta(e,t,Vi)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:t,col:n}}=this.range;if(t<0||t>this.hot.countSourceRows()-1||n<0||n>this.hot.countSourceCols()-1)return!1;const r=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return Pi(Gi,this).cancelHiding(),Pi(zi,this).setValue(null!==(e=r[Yi]?r[Yi][Vi]:null)&&void 0!==e?e:""),Pi(zi,this).show(),this.refreshEditor(!0),!0}showAtCell(e,t){return this.setRange({from:this.hot._createCellCoords(e,t)}),this.show()}hide(){Pi(zi,this).hide()}refreshEditor(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this.range.from&&Pi(zi,this).isVisible()))return;const{rowIndexMapper:e,columnIndexMapper:t}=this.hot,{row:n,col:r}=this.range.from;let i=e.getRenderableFromVisualIndex(n),s=t.getRenderableFromVisualIndex(r);const a=null===i;Pi(zi,this).setPosition(0,0),null===i&&(i=e.getRenderableFromVisualIndex(e.getNearestNotHiddenIndex(n,-1))),null===s&&(s=t.getRenderableFromVisualIndex(t.getNearestNotHiddenIndex(r,-1)));const l=null===i,u=null===s;i=null!=i?i:0,s=null!=s?s:0;const{rootWindow:h,view:{_wt:c}}=this.hot,{wtTable:d}=c,m=c.getCell({row:i,col:s},!0),p=this.getCommentMeta(n,r,Ui);p?Pi(zi,this).setSize(p.width,p.height):Pi(zi,this).resetSize();const f=u?0:d.getColumnWidth(s),g=a&&!l?(0,o.DK)(m):0,{left:y,top:w,width:v,height:_}=m.getBoundingClientRect(),{width:b,height:S}=Pi(zi,this).getSize(),{innerWidth:C,innerHeight:E}=this.hot.rootWindow,M=this.hot.rootDocument.documentElement,T=(0,o.XJ)(this.hot.rootDocument),R=(0,o.D1)(this.hot.rootWindow)?T:0,A=(0,o.zO)(this.hot.rootWindow)?T:0;let N=y+h.scrollX+f,L=w+h.scrollY+g;this.hot.isRtl()&&(N-=b+f),this.hot.isLtr()&&y+v+b>C-R?N=y+h.scrollX-b-1:this.hot.isRtl()&&N<-(M.scrollWidth-M.clientWidth)&&(N=y+h.scrollX+f+1),w+S>E-A&&(L-=S-_+1),Pi(zi,this).setPosition(N,L),Pi(zi,this).setReadOnlyState(this.getCommentMeta(n,r,Bi)),Pi(zi,this).observeSize()}focusEditor(){Pi(zi,this).focus()}updateCommentMeta(e,t,n){const r=this.hot.getCellMeta(e,t)[Yi];let o;r?(o=(0,s.Go)(r),(0,s.zw)(o,n)):o=n,this.hot.setCellMeta(e,t,Yi,o)}getCommentMeta(e,t,n){const r=this.hot.getCellMeta(e,t);if(r[Yi])return r[Yi][n]}addToContextMenu(e){var t;e.items.push({name:Ri},(t=this,{key:"commentsAddEdit",name(){var e;const n=null===(e=this.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return null!=n&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_EDIT_COMMENT):this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ADD_COMMENT)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}),function(e){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_REMOVE_COMMENT)},callback(){this.getSelectedRangeLast().forAll(((t,n)=>{t>=0&&n>=0&&e.removeCommentAtCell(t,n,!1)})),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}}(this),function(e){return{key:"commentsReadOnly",name(){const t=this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT);return xi(this.getSelectedRange(),((t,n)=>e.getCommentMeta(t,n,Bi)))?Li(t):t},callback(){this.getSelectedRangeLast().forAll(((t,n)=>{if(t>=0&&n>=0){const r=!!e.getCommentMeta(t,n,Bi);e.updateCommentMeta(t,n,{[Bi]:!r})}}))},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.highlight.isHeader()||!e.getCommentAtCell(t.highlight.row,t.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}}(this))}getEditorInputElement(){return Pi(zi,this).getInputElement()}destroy(){var e,t;null===(e=Pi(zi,this))||void 0===e||e.destroy(),null===(t=Pi(Gi,this))||void 0===t||t.destroy(),super.destroy()}}function Zi(e){if(this.hot.view&&this.hot.view._wt&&!Pi($i,this)&&!this.targetIsCommentTextArea(e)){const t=(0,o.kp)(e.target,"TD","TBODY");let n=null;t&&(n=this.hot.getCoords(t)),(!t||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function es(e){e.stopPropagation()}function ts(e){const{rootDocument:t}=this.hot;if(!(Pi($i,this)||Pi(zi,this).isFocused()||(0,o.nB)(e.target,"wtBorder")||Pi(Xi,this)===e.target)&&Pi(zi,this))if(Di(Xi,this,t.elementFromPoint(e.clientX,e.clientY)),this.targetIsCellWithComment(e)){const t=this.hot._createCellRange(this.hot.getCoords(e.target));Pi(Gi,this).show(t)}else(0,o.aO)(e.target,t)&&!this.targetIsCommentTextArea(e)&&Pi(Gi,this).hide()}function ns(){Di($i,this,!1)}function rs(e,t){t[Yi]&&t[Yi][Vi]&&(0,o.iQ)(e,t.commentedCellClassName)}function os(){Di(qi,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function is(){Di(qi,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(ji)}function ss(e,t){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[Ui]:{width:e,height:t}})}function as(e){Pi(zi,this).isFocused()&&(0,i.CA)(e)}function ls(){Pi(Ki,this)||this.hide()}function us(){const e=Pi(zi,this).getEditorElement();(0,o.vy)(e,/ht-theme-.*/g),(0,o.iQ)(e,this.hot.getCurrentThemeName())}function hs(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n(13609);class cs{constructor(e){hs(this,"hot",void 0),hs(this,"commands",{}),hs(this,"commonCallback",null),this.hot=e}registerCommand(e,t){this.commands[e]=t}setCommonCallback(e){this.commonCallback=e}execute(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.key?t.key.split(":"):null;if(Array.isArray(r)&&r[1]===e)return n=t,!1})),n}(a,l.submenu.items)),!0===l.disabled)return;if("function"==typeof l.disabled&&!0===l.disabled.call(this.hot))return;if((0,s.mQ)(l,"submenu"))return;const u=[];"function"==typeof l.callback&&u.push(l.callback),"function"==typeof this.commonCallback&&u.push(this.commonCallback),n.unshift(o.join(":")),(0,h.z0)(u,(e=>e.apply(this.hot,n)))}}const ds="alignment",ms="clear_column",ps="col_left",fs="col_right",gs="make_read_only",ys="redo";var ws=n(76396);const vs="remove_col",_s="remove_row",bs="row_above",Ss="row_below",Cs="no_items",Es="undo",Ms=[bs,Ss,ps,fs,ms,_s,vs,Es,ys,gs,ds,Ri,Cs],Ts={[Ri]:function(){return{name:Ri}},[Cs]:function(){return{key:Cs,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_NO_ITEMS)},disabled:!0,isCommand:!1}},[bs]:function(){return{key:bs,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ROW_ABOVE)},callback(){const e=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",e.row,1,"ContextMenu.rowAbove")},disabled(){const e=this.getSelectedRangeLast();return!!(!e||this.selection.isSelectedByColumnHeader()||e.isSingleHeader()&&e.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)||!!this.selection.isSelectedByCorner()&&0===this.countRows()},hidden(){return!this.getSettings().allowInsertRow}}},[Ss]:function(){return{key:Ss,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ROW_BELOW)},callback(){const e=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",e.row,1,"ContextMenu.rowBelow")},disabled(){const e=this.getSelectedRangeLast();return!!(!e||this.selection.isSelectedByColumnHeader()||e.isSingleHeader()&&e.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}},[ps]:function(){return{key:ps,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_INSERT_LEFT)},callback(){const e=this.getSelectedRangeLast().getTopLeftCorner(),t=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(t,e.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();return!!(!e||this.selection.isSelectedByRowHeader()||e.isSingleHeader()&&e.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)||!!this.selection.isSelectedByCorner()&&0===this.countCols()},hidden(){return!this.getSettings().allowInsertColumn}}},[fs]:function(){return{key:fs,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_INSERT_RIGHT)},callback(){const e=this.getSelectedRangeLast().getTopRightCorner(),t=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(t,e.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();return!!(!e||this.selection.isSelectedByRowHeader()||e.isSingleHeader()&&e.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}},[ms]:function(){return{key:ms,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_CLEAR_COLUMN)},callback(e,t){const n=t[0].start.col,r=t[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t[0].start.row,t[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader()&&e.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let t=!1;return e.forAll(((e,n)=>{if(e<0||n<0)return!0;const{readOnly:r}=this.getCellMeta(e,n);return!!r||(t=!0,!1)})),!t}}},[_s]:function(){return{key:_s,name(){const e=this.getSelected();let t=0;if(e)if(e.length>1)t=1;else{const[n,,r]=e[0];n-r!==0&&(t=1)}return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_REMOVE_ROW,t)},callback(){this.alter("remove_row",(0,ws.f7)(this),1,"ContextMenu.removeRow")},disabled(){const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.row<0)return!0;const t=this.countRows();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByColumnHeader()||0===t},hidden(){return!this.getSettings().allowRemoveRow}}},[vs]:function(){return{key:vs,name(){const e=this.getSelected();let t=0;if(e)if(e.length>1)t=1;else{const[,n,,r]=e[0];n-r!==0&&(t=1)}return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_REMOVE_COLUMN,t)},callback(){this.alter("remove_col",(0,ws.NB)(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.col<0)return!0;const t=this.countCols();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByRowHeader()||0===t},hidden(){return!this.getSettings().allowRemoveColumn}}},[Es]:function(){return{key:Es,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_UNDO)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}},[ys]:function(){return{key:ys,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_REDO)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}},[gs]:function(){return{key:gs,checkable:!0,ariaChecked(){return xi(this.getSelectedRange(),((e,t)=>this.getCellMeta(e,t).readOnly))},ariaLabel(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_READ_ONLY)},name(){let e=this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_READ_ONLY);return xi(this.getSelectedRange(),((e,t)=>this.getCellMeta(e,t).readOnly))&&(e=Li(e)),e},callback(){const e=this.getSelectedRange(),t=xi(e,((e,t)=>this.getCellMeta(e,t).readOnly));(0,h.z0)(e,(e=>{e.forAll(((e,n)=>{e>=0&&n>=0&&this.setCellMeta(e,n,"readOnly",!t)}))})),this.render()},disabled(){const e=this.getSelectedRangeLast();return!(e&&!e.isSingleHeader()&&!this.selection.isSelectedByCorner()&&0!==this.countRows()&&0!==this.countCols()&&this.getSelectedRange()&&0!==this.getSelectedRange().length)}}},[ds]:function(){return{key:ds,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT)},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();return!e||!!e.isSingleHeader()||!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${ds}:left`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1},{key:`${ds}:center`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1},{key:`${ds}:right`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1},{key:`${ds}:justify`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1},{name:Ri},{key:`${ds}:top`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_TOP)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1},{key:`${ds}:middle`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1},{key:`${ds}:bottom`,name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM)},callback(){const e=this.getSelectedRange(),t=Ai(e,((e,t)=>this.getCellMeta(e,t).className)),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",t,e,n,r),Ni(e,n,r,((e,t)=>this.getCellMeta(e,t)),((e,t,n,r)=>this.setCellMeta(e,t,n,r))),this.render()},disabled:!1}]}}}};function Rs(){const e={};return(0,s.v4)(Ts,((t,n)=>{e[n]=t()})),e}function As(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ns{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;As(this,"hot",void 0),As(this,"predefinedItems",Rs()),As(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=t}setPredefinedItems(e){const t={};this.defaultOrderPattern.length=0,(0,s.v4)(e,((e,n)=>{let r="";e.name===Ri?(t[Ri]=e,r=Ri):isNaN(parseInt(n,10))?(e.key=void 0===e.key?n:e.key,t[n]=e,r=e.key):(t[e.key]=e,r=e.key),this.defaultOrderPattern.push(r)})),this.predefinedItems=t}getItems(){return function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=[];let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return r&&r.items?r=r.items:Array.isArray(r)||(r=e),(0,s.Gv)(r)?(0,s.v4)(r,((e,r)=>{let o=t["string"==typeof e?e:r];o||(o=e),(0,s.Gv)(e)?(0,s.X$)(o,e):"string"==typeof o&&(o={name:o}),void 0===o.key&&(o.key=r),n.push(o)})):(0,h.z0)(r,((e,r)=>{let o=t[e];!o&&Ms.indexOf(e)>=0||(o||(o={name:e,key:`${r}`}),(0,s.Gv)(e)&&(0,s.X$)(o,e),void 0===o.key&&(o.key=r),n.push(o))})),n}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,this.defaultOrderPattern,this.predefinedItems)}}function Ls(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class xs{constructor(e,t){Ls(this,"top",void 0),Ls(this,"topRelative",void 0),Ls(this,"left",void 0),Ls(this,"leftRelative",void 0),Ls(this,"scrollTop",void 0),Ls(this,"scrollLeft",void 0),Ls(this,"cellHeight",void 0),Ls(this,"cellWidth",void 0);const n=t.scrollY,r=t.scrollX;let o,i,s,a,l,u;this.rootWindow=t,this.type=this.getSourceType(e),"literal"===this.type?(o=parseInt(e.top,10),s=parseInt(e.left,10),l=e.height||0,u=e.width||0,i=o,a=s,o+=n,s+=r):"event"===this.type&&(o=parseInt(e.pageY,10),s=parseInt(e.pageX,10),l=e.target.clientHeight,u=e.target.clientWidth,i=o-n,a=s-r),this.top=o,this.topRelative=i,this.left=s,this.leftRelative=a,this.scrollTop=n,this.scrollLeft=r,this.cellHeight=l,this.cellWidth=u}getSourceType(e){let t="literal";return e instanceof Event&&(t="event"),t}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=t}fitsOnRight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function Os(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function Is(e,t){return e.get(Ds(e,t))}function ks(e,t,n){return e.set(Ds(e,t),n),n}function Ds(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Ps=new WeakMap,Hs=new WeakMap,Fs=new WeakMap,Ys=new WeakMap,Vs=new WeakMap;class Us{constructor(e){Os(this,Ps,void 0),Os(this,Hs,void 0),Os(this,Fs,void 0),Os(this,Ys,!1),Os(this,Vs,{above:0,below:0,left:0,right:0}),ks(Ys,this,e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Is(Vs,this)[e]=t,this}setElement(e){return ks(Ps,this,e),this}setParentElement(e){return ks(Hs,this,e),this}updatePosition(e){ks(Fs,this,new xs(e,Is(Ps,this).ownerDocument.defaultView)),Is(Ys,this)?(Is(Fs,this).fitsBelow(Is(Ps,this))?this.setPositionBelowCursor():Is(Fs,this).fitsAbove(Is(Ps,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){"rtl"===Is(Ps,this).dir?Is(Fs,this).fitsOnLeft(Is(Ps,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Is(Fs,this).fitsOnRight(Is(Ps,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Is(Vs,this).above+Is(Fs,this).top-Is(Ps,this).offsetHeight;if(Is(Hs,this)){const t=Is(Hs,this).ownerDocument.defaultView.getComputedStyle(Is(Hs,this).querySelector(".ht_master")),n=Number.parseInt(t.paddingTop,10),r=Number.parseInt(t.borderTop,10);e=Is(Fs,this).top+Is(Fs,this).cellHeight-Is(Ps,this).scrollHeight+n+r}Is(Ps,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Is(Vs,this).below+Is(Fs,this).top+1;if(Is(Hs,this)){const t=Is(Hs,this).ownerDocument.defaultView.getComputedStyle(Is(Hs,this).querySelector(".ht_master")),n=Number.parseInt(t.paddingTop,10),r=Number.parseInt(t.borderTop,10);e=Is(Fs,this).top-n-r-1}Is(Ps,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Is(Fs,this).left;if(Is(Hs,this)){const t=Is(Hs,this).ownerDocument.defaultView,n=Number.parseInt(t.getComputedStyle(Is(Hs,this).querySelector(".htCore")).borderRightWidth,10);e+=Is(Fs,this).cellWidth+n}else e+=Is(Vs,this).right;Is(Ps,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Is(Vs,this).left+Is(Fs,this).left-Is(Ps,this).offsetWidth;if(Is(Hs,this)){const t=Is(Hs,this).ownerDocument.defaultView;e-=Number.parseInt(t.getComputedStyle(Is(Hs,this).querySelector(".htCore")).borderLeftWidth,10)}Is(Ps,this).style.left=`${e}px`}}function Bs(e){let{initialPage:t=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:o=()=>{}}=e;const i=new Set;let s=(0,Mt.qE)(t,-1,l()-1);function a(e,t){const n=l()-1;return e<0&&(e=n),e>n&&(e=0),i.has(e)?-1:(i.add(e),!1===r(e,!1)&&(e=a(1===t?++e:--e,t)),e)}function l(){return Math.max(n(),0)}return{setCurrentPage:function(e){e>-1&&e0&&(i.clear(),s=a(0,1))},toLastItem:function(){l()>0&&(i.clear(),s=a(l()-1,-1))},toNextItem:function(){l()>0&&(i.clear(),s=a(++s,1))},toPreviousItem:function(){l()>0&&(i.clear(),s=a(--s,-1))},getSize:l,clear:function(){i.clear(),s=t,o()}}}function Ws(e){return(0,s.mQ)(e,"submenu")}function js(e){return new RegExp(Ri,"i").test(e.name)}function zs(e,t){return!0===e.disabled||"function"==typeof e.disabled&&!0===e.disabled.call(t)}function Gs(e){return(0,s.mQ)(e,"disableSelection")}function $s(e,t){const n=e.slice(0);for(let e=0;e{var n;t||null===(n=this.hotMenu)||void 0===n||n.useTheme(e)}))}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",(e=>this.onDocumentMouseDown(e))),this.eventManager.addEventListener(e.document,"touchstart",(e=>this.onDocumentMouseDown(e))),this.eventManager.addEventListener(e.document,"contextmenu",(e=>this.onDocumentContextMenu(e))),e=(0,o.Ly)(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Zs(ta,this)}getKeyboardShortcutsCtrl(){return Zs(na,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return null!==this.parentMenu}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=(0,g.sg)((e=>this.openSubMenu(e)),300),t=this.options.minWidth||215;let n=!1,r=(0,h.y0)(this.menuItems,(e=>(e.key===Cs&&(n=!0),function(e,t){return!e.hidden||!("function"==typeof e.hidden&&e.hidden.call(t))}(e,this.hot))));if(r.length<1&&!n)r.push(Rs()[Cs]);else if(0===r.length)return;r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ri,n=e.slice(0);return n=$s(n,t),n=function(e,t){let n=e.slice(0);return n.reverse(),n=$s(n,t),n.reverse(),n}(n,t),n=function(e){const t=[];return(0,h.z0)(e,((e,n)=>{n>0?t[t.length-1].name!==e.name&&t.push(e):t.push(e)})),t}(n),n}(r,Ri);let s=!1;const a={data:r,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth:e=>(0,c.O9)(e)&&e{const a=e.getSourceDataAtRow(n),u=l.rootDocument.createElement("div"),h="function"==typeof s?s.call(l):s,c="function"==typeof a.ariaLabel?a.ariaLabel.call(l):a.ariaLabel,d="function"==typeof a.ariaChecked?a.ariaChecked.call(l):a.ariaChecked;if((0,o.Ie)(t),(0,o.iQ)(u,"htItemWrapper"),l.getSettings().ariaTags){const e=!zs(a,l)&&!Gs(a)&&!js(a);(0,o.Bq)(t,[...(m=a,!0===m.checkable?[(0,f.pt)(),(0,f.SM)(c),(0,f.Xq)(d)]:[(0,f.ZA)(),(0,f.SM)(h)]),...e?[(0,f.vC)(-1)]:[],...zs(a,l)?[(0,f._R)()]:[],...Ws(a)?[(0,f.dV)(!1)]:[]])}var m;t.className="",t.appendChild(u),js(a)?(0,o.iQ)(t,"htSeparator"):"function"==typeof a.renderer?((0,o.iQ)(t,"htCustomMenuRenderer"),t.appendChild(a.renderer(e,u,n,r,i,h))):(0,o.Mv)(u,h),zs(a,l)?(0,o.iQ)(t,"htDisabled"):Gs(a)?(0,o.iQ)(t,"htSelectionDisabled"):Ws(a)&&(0,o.iQ)(t,"htSubmenu")})}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(e,t)=>{Zs(ta,this).setCurrentPage(t.row)},afterOnCellMouseOver:(t,n)=>{this.isAllSubMenusClosed()?e(n.row):this.openSubMenu(n.row)},afterOnCellContextMenu:e=>{e.preventDefault(),(0,te.Yh)()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(e,t,n,r,o)=>{this.hotMenu.view.isMouseDown()&&(o.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:e=>{this.hasSelectedItem()&&(s=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(e))},afterOnCellMouseUp:e=>{(0,te.Yh)()&&(0,i.nO)(e)||!s||!this.hasSelectedItem()||((0,te.rr)()||(0,te.zG)()?this.hot._registerTimeout((()=>this.close(!0)),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};var l,u;this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,a),this.hotMenu.addHook("afterInit",(()=>this.onAfterInit())),this.hotMenu.init(),Js(ta,this,(u=this.hotMenu,Bs({size:()=>u.countRows(),onItemSelect(e,t){const n=u.getCell(e,0);if(!n||function(e){return(0,o.nB)(e,"htSeparator")}(n)||function(e){return(0,o.nB)(e,"htDisabled")}(n)||function(e){return(0,o.nB)(e,"htSelectionDisabled")}(n))return!1;u.selectCell(e,0,...t?[e,0,!1,!1]:[])},onClear(){u.deselectCell()}}))),Js(na,this,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[];function r(e,t){s(t).addShortcuts(e,{group:Ks})}function o(e,t){const o=s(t);e.forEach((e=>{let{keys:t}=e;t.forEach((e=>o.removeShortcutsByKeys(e)))})),n.push({shortcuts:e,contextName:t}),r(e,t)}function i(e){return e?`${Xs}:${e}`:Xs}function s(t){var n;const r=e.hotMenu.getShortcutManager(),o=i(t);return null!==(n=r.getContext(o))&&void 0!==n?n:r.addContext(o)}return r(function(e){const{hot:t,hotMenu:n}=e;return[{keys:[["Control/Meta","A"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:()=>e.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(n,r)=>{const o=t.getSettings(),i="function"==typeof o.tabMoves?o.tabMoves(n):o.tabMoves;r.includes("shift")?t.selection.transformStart(-i.row,-i.col):t.selection.transformStart(i.row,i.col),e.close(!0)}},{keys:[["Escape"]],callback:()=>e.close()},{keys:[["ArrowDown"]],callback:()=>e.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>e.getNavigator().toPreviousItem()},{keys:[[t.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const t=n.getSelectedLast();if(t){const n=e.openSubMenu(t[0]);n&&n.getNavigator().toFirstItem()}}},{keys:[[t.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedLast()&&e.isSubMenu()&&(e.close(),e.isSubMenu()&&e.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>e.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>e.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:t=>{const r=n.getSelectedLast();r&&(n.getSourceDataAtRow(r[0]).submenu?e.openSubMenu(r[0]).getNavigator().toFirstItem():(e.executeCommand(t),e.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):e.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):e.getNavigator().toLastItem()}}]}(e)),t.forEach((e=>{let{shortcuts:t,contextName:n}=e;o(t,n)})),{addCustomShortcuts:o,getCustomShortcuts:function(){return[...n]},getContext:s,listen:function(t){e.hotMenu.getShortcutManager().setActiveContextName(i(t))}}}(this)),Zs(na,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",(()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this))),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isOpened())if(e&&this.isSubMenu())this.parentMenu.close();else if(Zs(ta,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const e=this.parentMenu.hotMenu.getSelectedLast();if(e){const t=this.parentMenu.hotMenu.getCell(e[0],0);(0,o.Bq)(t,[(0,f.dV)(!1)])}}this.parentMenu.hotMenu.listen()}}openSubMenu(e){if(!this.hotMenu)return!1;const t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!function(e){return(0,o.nB)(e,"htSubmenu")}(t))return!1;const n=this.hotMenu.getSourceDataAtRow(e),r=new oa(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return r.setMenuItems(n.submenu.items),r.open(),r.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=r,this.hot.getSettings().ariaTags&&(0,o.Bq)(t,[(0,f.dV)(!0)]),r}closeSubMenu(e){const t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];if(n){n.destroy(),delete this.hotSubMenus[t.key];const r=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&(0,o.Bq)(r,[(0,f.dV)(!1)])}}closeAllSubMenus(){(0,h.z0)(this.hotMenu.getData(),((e,t)=>this.closeSubMenu(t)))}isAllSubMenusClosed(){return 0===Object.keys(this.hotSubMenus).length}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return null!==this.hotMenu}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const t=this.getSelectedItem();if(this.runLocalHooks("select",t,e),this.isCommandPassive(t))return;const n=this.hot.getSelectedRange(),r=n?function(e){return(0,h.YD)(e,(e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()})))}(n):[];this.runLocalHooks("executeCommand",t.key,r,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,r,e)}isCommandPassive(e){return!1===e.isCommand||js(e)||zs(e,this.hot)||Ws(e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.positioner.setOffset(e,t)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:t}=this.hotMenu.view._wt,n=this.hotMenu.getSettings().data,r=t.hider.style,i=t.holder.style,s=parseInt(r.width,10),a=(0,h.mu)(n,((e,t,n)=>{const r=this.hotMenu.getCell(n,0)?(0,o.DK)(this.hotMenu.getCell(n,0)):0;return e+(t.name===Ri?1:r)}),0);e.isClassicTheme()?(i.width=`${s+3}px`,i.height=`${a+3}px`):(i.width=`${s}px`,i.height=`${a}px`),r.height=i.height}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.options.container.ownerDocument;let n,r=e;return r&&((0,g.Tn)(r)&&(r=r.call(this.hot),r=null===r||(0,c.b0)(r)?"":r.toString()),r=r.replace(/[^A-Za-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,n=t.querySelector(`.${this.options.className}.${r}`)),n||(n=t.createElement("div"),(0,o.iQ)(n,`htMenu handsontable ${this.options.className}`),r&&(0,o.iQ)(n,r),this.options.container.appendChild(n)),n}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&(0,o.Bq)(this.hotMenu.rootElement,[(0,f.nF)(),(0,f.vC)(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!(0,o.aO)(e.target,this.hotMenu.rootElement)?this.close(!0):!this.isAllSubMenusClosed()&&!this.isSubMenu()||(0,o.aO)(e.target,".htMenu")||this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&(0,o.nB)(e.target,"htCore")&&(0,o.aO)(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}function ia(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sa(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(0,s.co)(oa,Zo.A);const aa="contextMenu",la=aa;Ce.R.getSingleton().register("afterContextMenuDefaultOptions"),Ce.R.getSingleton().register("beforeContextMenuShow"),Ce.R.getSingleton().register("afterContextMenuShow"),Ce.R.getSingleton().register("afterContextMenuHide"),Ce.R.getSingleton().register("afterContextMenuExecute");var ua=new WeakSet;class ha extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=ua),t.add(e),ia(this,"commandExecutor",new cs(this.hot)),ia(this,"itemsFactory",null),ia(this,"menu",null)}static get PLUGIN_KEY(){return aa}static get PLUGIN_PRIORITY(){return 70}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[bs,Ss,Ri,ps,fs,Ri,_s,vs,Ri,Es,ys,Ri,gs,Ri,ds]}isEnabled(){return!!this.hot.getSettings()[aa]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[aa];"function"==typeof t.callback&&this.commandExecutor.setCommonCallback(t.callback),this.menu=new oa(this.hot,{className:"htContextMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",(()=>sa(ua,this,da).call(this))),this.menu.addLocalHook("afterOpen",(()=>sa(ua,this,ma).call(this))),this.menu.addLocalHook("afterClose",(()=>sa(ua,this,pa).call(this))),this.menu.addLocalHook("executeCommand",(function(){for(var t=arguments.length,n=new Array(t),r=0;rsa(ua,this,ca).call(this,e))),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const t=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),n=Oi(this.menu.container,this.hot.rootDocument);this.open({left:t.left+n.left,top:t.top+n.top-1+t.height},{left:t.width,above:-t.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&!this.menu.isOpened()},group:la})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(la)}open(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};if(null!==(t=this.menu)&&void 0!==t&&t.isOpened())return;this.prepareMenuItems(),this.menu.open();const r=this.menu.tableBorderWidth>0;(0,s.v4)(n,((e,t)=>{const n=["below","right"].includes(t)?e+1:e-1;this.menu.setOffset(t,r?e:n)})),this.menu.setPosition(e)}close(){var e;null===(e=this.menu)||void 0===e||e.close(),this.itemsFactory=null}executeCommand(e){null===this.itemsFactory&&this.prepareMenuItems();for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rthis.commandExecutor.registerCommand(e.key,e)))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function ca(e){const t=this.hot.getSettings(),n=t.rowHeaders,r=t.colHeaders,i=e.target;if(this.close(),(0,o.nB)(i,"handsontableInput"))return;if(e.preventDefault(),e.stopPropagation(),!n&&!r&&!(function(e){return"TD"===e.nodeName||"TD"===e.parentNode.nodeName}(i)||(0,o.nB)(i,"current")&&(0,o.nB)(i,"wtBorder")))return;const s=Oi(this.menu.container,this.hot.rootDocument);this.open({top:e.clientY+s.top,left:e.clientX+s.left})}function da(){this.hot.runHooks("beforeContextMenuShow",this)}function ma(){this.hot.runHooks("afterContextMenuShow",this)}function pa(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}ha.SEPARATOR={name:Ri};var fa=n(13431);class ga{constructor(){this.data={}}setData(e,t){this.data[e]=t}getData(e){return this.data[e]||void 0}}class ya{constructor(){this.clipboardData=new ga}preventDefault(){}composedPath(){return[]}}function wa(e,t,n){va(e,t),t.set(e,n)}function va(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _a(e,t){return e.get(Sa(e,t))}function ba(e,t,n){return e.set(Sa(e,t),n),n}function Sa(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Ca=new WeakMap,Ea=new WeakMap,Ma=new WeakMap,Ta=new WeakMap,Ra=new WeakMap,Aa=new WeakMap,Na=new WeakSet;class La{constructor(e){let{countRows:t,countColumns:n,rowsLimit:r,columnsLimit:o,countColumnHeaders:i}=e;var s;va(this,s=Na),s.add(this),wa(this,Ca,void 0),wa(this,Ea,void 0),wa(this,Ma,void 0),wa(this,Ta,void 0),wa(this,Ra,void 0),wa(this,Aa,void 0),ba(Ea,this,t),ba(Ma,this,n),ba(Ta,this,r),ba(Ra,this,o),ba(Aa,this,i)}setSelectedRange(e){ba(Ca,this,e)}getCellsRange(){if(0===_a(Ea,this).call(this)||0===_a(Ma,this).call(this))return null;const{row:e,col:t}=_a(Ca,this).getTopStartCorner(),{row:n,col:r}=_a(Ca,this).getBottomEndCorner(),o=Sa(Na,this,Oa).call(this,e,n),i=Sa(Na,this,xa).call(this,t,r);return{isRangeTrimmed:n!==o||r!==i,startRow:e,startCol:t,endRow:o,endCol:i}}getMostBottomColumnHeadersRange(){if(0===_a(Ma,this).call(this)||0===_a(Aa,this).call(this))return null;const{col:e}=_a(Ca,this).getTopStartCorner(),{col:t}=_a(Ca,this).getBottomEndCorner(),n=Sa(Na,this,xa).call(this,e,t);return{isRangeTrimmed:t!==n,startRow:-1,startCol:e,endRow:-1,endCol:n}}getAllColumnHeadersRange(){if(0===_a(Ma,this).call(this)||0===_a(Aa,this).call(this))return null;const{col:e}=_a(Ca,this).getTopStartCorner(),{col:t}=_a(Ca,this).getBottomEndCorner(),n=Sa(Na,this,xa).call(this,e,t);return{isRangeTrimmed:t!==n,startRow:-_a(Aa,this).call(this),startCol:e,endRow:-1,endCol:n}}}function xa(e,t){return Math.min(t,Math.max(e+_a(Ra,this).call(this)-1,e))}function Oa(e,t){return Math.min(t,Math.max(e+_a(Ta,this).call(this)-1,e))}function Ia(e){const t=[],n=[];return(0,h.z0)(e,(e=>{const r=Math.min(e.startRow,e.endRow),o=Math.max(e.startRow,e.endRow);(0,Mt.Ti)(r,o,(e=>{-1===t.indexOf(e)&&t.push(e)}));const i=Math.min(e.startCol,e.endCol),s=Math.max(e.startCol,e.endCol);(0,Mt.Ti)(i,s,(e=>{-1===n.indexOf(e)&&n.push(e)}))})),{rows:t,columns:n}}var ka=n(22257);function Da(e,t,n){Pa(e,t),t.set(e,n)}function Pa(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ha(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fa(e,t){return e.get(Va(e,t))}function Ya(e,t,n){return e.set(Va(e,t),n),n}function Va(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("afterCopyLimit"),Ce.R.getSingleton().register("modifyCopyableRange"),Ce.R.getSingleton().register("beforeCut"),Ce.R.getSingleton().register("afterCut"),Ce.R.getSingleton().register("beforePaste"),Ce.R.getSingleton().register("afterPaste"),Ce.R.getSingleton().register("beforeCopy"),Ce.R.getSingleton().register("afterCopy");const Ua="copyPaste",Ba=["fragmentSelection"],Wa=['',''].join("");var ja=new WeakMap,za=new WeakMap,Ga=new WeakMap,$a=new WeakMap,Ka=new WeakMap,Xa=new WeakMap,qa=new WeakMap,Qa=new WeakMap,Ja=new WeakSet;class Za extends hn{constructor(){var e;super(...arguments),Pa(this,e=Ja),e.add(this),Ha(this,"columnsLimit",1/0),Ha(this,"rowsLimit",1/0),Ha(this,"pasteMode","overwrite"),Ha(this,"uiContainer",this.hot.rootDocument.body),Da(this,ja,!1),Da(this,za,!1),Da(this,Ga,!1),Da(this,$a,"cells-only"),Da(this,Ka,!1),Da(this,Xa,!1),Da(this,qa,new La({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Da(this,Qa,!1),Ha(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Ua}static get SETTING_KEYS(){return[Ua,...Ba]}static get PLUGIN_PRIORITY(){return 80}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[Ua]}enablePlugin(){var e,t,n=this;this.enabled||(this.pasteMode=null!==(e=this.getSetting("pasteMode"))&&void 0!==e?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),Ya(ja,this,this.getSetting("copyColumnHeaders")),Ya(za,this,this.getSetting("copyColumnGroupHeaders")),Ya(Ga,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=null!==(t=this.getSetting("uiContainer"))&&void 0!==t?t:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",(e=>Va(Ja,this,ol).call(this,e))),this.addHook("afterSelection",(function(){for(var e=arguments.length,t=new Array(e),r=0;rVa(Ja,this,sl).call(this))),this.eventManager.addEventListener(this.hot.rootDocument,"copy",(function(){return n.onCopy(...arguments)})),this.eventManager.addEventListener(this.hot.rootDocument,"cut",(function(){return n.onCut(...arguments)})),this.eventManager.addEventListener(this.hot.rootDocument,"paste",(function(){return n.onPaste(...arguments)})),(0,te.nr)()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",(function(){for(var e=arguments.length,t=new Array(e),r=0;rVa(Ja,this,ul).call(this)))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){Ya($a,this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cells-only"),Ya(Ka,this,!0),Va(Ja,this,el).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){Ya(Xa,this,!0),Va(Ja,this,el).call(this,"cut")}getRangedCopyableData(e){return(0,fa.A)(this.getRangedData(e))}getRangedData(e){const t=[],{rows:n,columns:r}=Ia(e);return(0,h.z0)(n,(e=>{const n=[];(0,h.z0)(r,(t=>{e<0?n.push(this.hot.getColHeader(t,e)):n.push(this.hot.getCopyableData(e,t))})),t.push(n)})),t}paste(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(!e&&!t)return;const n=new ya;e&&n.clipboardData.setData("text/plain",e),t&&n.clipboardData.setData("text/html",t),this.onPaste(n)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader())return void(this.copyableRanges=[]);Fa(qa,this).setSelectedRange(e);const t=new Map([["headers",null],["cells",null]]);"column-headers-only"===Fa($a,this)?t.set("headers",Fa(qa,this).getMostBottomColumnHeadersRange()):("with-column-headers"===Fa($a,this)?t.set("headers",Fa(qa,this).getMostBottomColumnHeadersRange()):"with-column-group-headers"===Fa($a,this)&&t.set("headers",Fa(qa,this).getAllColumnHeadersRange()),t.set("cells",Fa(qa,this).getCellsRange())),this.copyableRanges=Array.from(t.values()).filter((e=>null!==e)).map((e=>{let{startRow:t,startCol:n,endRow:r,endCol:o}=e;return{startRow:t,startCol:n,endRow:r,endCol:o}})),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const n=t.get("cells");if(null!==n&&n.isRangeTrimmed){const{startRow:e,startCol:t,endRow:r,endCol:o}=n;this.hot.runHooks("afterCopyLimit",r-e+1,o-t+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return null===(e=this.hot.getActiveEditor())||void 0===e?void 0:e.isOpened()}populateValues(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const n=e.length,r=e[0].length,o=[],{row:i,col:s}=t.getTopStartCorner(),{row:a,col:l}=t.getBottomEndCorner();let u=i,h=s,c=i,d=s;for(;o.length{this.hot.rootDocument.execCommand(e)}))}}else this.hot.rootDocument.execCommand(e)}function tl(e){const{rows:t}=Ia(e);let n=0;for(let e=0;e=0);e++)n+=1;return{columnHeadersCount:n}}function nl(){if(this.hot.isListening()){const e=this.hot.getSelectedRangeLast();if(e){const{row:t,col:n}=e.highlight,r=this.hot.getCell(t,n,!0);r&&(0,o.aM)(r)}}}function rl(){if(this.hot.isListening()){const e=this.hot.getSelectedRangeLast();if(e){const{row:t,col:n}=e.highlight,r=this.hot.getCell(t,n,!0);null!=r&&r.hasAttribute("contenteditable")&&(0,o.gj)(r)}}}function ol(e){var t;e.items.push({name:"---------"},(t=this,{key:"copy",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_COPY)},callback(){t.copyCellsOnly()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1})),Fa(ja,this)&&e.items.push(function(e){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),t=e?(0,Mt.qE)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS,t)},callback(){e.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}(this)),Fa(za,this)&&e.items.push(function(e){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),t=e?(0,Mt.qE)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS,t)},callback(){e.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}(this)),Fa(Ga,this)&&e.items.push(function(e){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),t=e?(0,Mt.qE)(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY,t)},callback(){e.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}(this)),e.items.push(function(e){return{key:"cut",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_CUT)},callback(){e.cut()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}(this))}function il(e,t,n,r,o){Fa(Qa,this)&&(o.value=!0),Ya(Qa,this,!1)}function sl(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function al(){Va(Ja,this,rl).call(this)}function ll(){Va(Ja,this,nl).call(this)}function ul(){Va(Ja,this,rl).call(this)}function hl(e,t){return`border_row${e}col${t}`}function cl(e){var t,n;return((0,c.O9)(e.start)||(0,c.O9)(e.left))&&(e.start=null!==(t=e.start)&&void 0!==t?t:e.left),((0,c.O9)(e.end)||(0,c.O9)(e.right))&&(e.end=null!==(n=e.end)&&void 0!==n?n:e.right),delete e.left,delete e.right,e}function dl(e){return(0,c.O9)(e.start)&&(e.left=e.start),(0,c.O9)(e.end)&&(e.right=e.end),e}function ml(e,t){return{id:hl(e,t),border:{width:1,color:"#000",cornerVisible:!1},row:e,col:t,top:{hide:!0},bottom:{hide:!0},start:{hide:!0},end:{hide:!0}}}function pl(e,t){let n=!1;return(0,h.z0)(e.getSelectedRange(),(r=>{r.forAll(((r,o)=>{if(r<0||o<0)return;const i=e.getCellMeta(r,o).borders;if(i){if(!t)return n=!0,!1;if(!(0,s.mQ)(i[t],"hide")||!1===i[t].hide)return n=!0,!1}}))})),n}function fl(e){return`${String.fromCharCode(10003)}${e}`}const gl=new Map([["left","start"],["right","end"]]);function yl(e){const t=e.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let e=this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_BORDERS_RIGHT);return pl(this,t)&&(e=fl(e)),e},callback(n,r){const o=pl(this,t);e.prepareBorder(r,t,o)}}}function wl(e){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_BORDERS_BOTTOM);return pl(this,"bottom")&&(e=fl(e)),e},callback(t,n){const r=pl(this,"bottom");e.prepareBorder(n,"bottom",r)}}}function vl(e){const t=e.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let e=this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_BORDERS_LEFT);return pl(this,t)&&(e=fl(e)),e},callback(n,r){const o=pl(this,t);e.prepareBorder(r,t,o)}}}function _l(e){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_REMOVE_BORDERS)},callback(t,n){e.prepareBorder(n,"noBorders")},disabled(){return!pl(this)}}}function bl(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Sl="customBorders";var Cl=new WeakSet;class El extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=Cl),t.add(e),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"savedBorders",[])}static get PLUGIN_KEY(){return Sl}static get PLUGIN_PRIORITY(){return 90}isEnabled(){return!!this.hot.getSettings()[Sl]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",(e=>bl(Cl,this,Ml).call(this,e))),this.addHook("init",(()=>bl(Cl,this,Tl).call(this))),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,t){let n=["top","bottom","start","end"],r=null;t&&(this.checkSettingsCohesion([t]),n=Object.keys(t),r=cl(t));const o=(0,ws.ML)(e),i=(0,ws._e)(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});(0,h.z0)(e,(e=>{i(e).forAll(((e,t)=>{(0,h.z0)(n,(n=>{var o,i;this.prepareBorderFromCustomAdded(e,t,r,(o=n,null!==(i=gl.get(o))&&void 0!==i?i:o))}))}))})),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const t=(0,ws.ML)(e),n=(0,ws._e)(t,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),r=[];return(0,h.z0)(e,(e=>{n(e).forAll(((e,t)=>{(0,h.z0)(this.savedBorders,(n=>{n.row===e&&n.col===t&&r.push(dl(n))}))}))})),r}clearBorders(e){e?this.setBorders(e):((0,h.z0)(this.savedBorders,(e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange(),this.hot.removeCellMeta(e.row,e.col,"borders")})),this.savedBorders.length=0)}insertBorderIntoSettings(e,t){this.checkSavedBorders(e)||this.savedBorders.push(e);const n=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,n,t)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:n})}prepareBorderFromCustomAdded(e,t,n,r){const o=this.hot.countRows(),i=this.hot.countCols();if(e>=o||t>=i)return;let a=ml(e,t);var l,u;n&&(l=a,u=n,(0,s.mQ)(u,"border")&&u.border&&(l.border=u.border),(0,s.mQ)(u,"top")&&(0,c.O9)(u.top)&&(u.top?((0,s.Gv)(u.top)||(u.top={width:1,color:"#000"}),l.top=u.top):(u.top={hide:!0},l.top=u.top)),(0,s.mQ)(u,"bottom")&&(0,c.O9)(u.bottom)&&(u.bottom?((0,s.Gv)(u.bottom)||(u.bottom={width:1,color:"#000"}),l.bottom=u.bottom):(u.bottom={hide:!0},l.bottom=u.bottom)),(0,s.mQ)(u,"start")&&(0,c.O9)(u.start)&&(u.start?((0,s.Gv)(u.start)||(u.start={width:1,color:"#000"}),l.start=u.start):(u.start={hide:!0},l.start=u.start)),(0,s.mQ)(u,"end")&&(0,c.O9)(u.end)&&(u.end?((0,s.Gv)(u.end)||(u.end={width:1,color:"#000"}),l.end=u.end):(u.end={hide:!0},l.end=u.end)),a=l,(0,h.z0)(this.hot.selection.highlight.customSelections,(e=>{if(a.id===e.settings.id)return Object.assign(e.settings,n),a.id=e.settings.id,a.top=e.settings.top,a.bottom=e.settings.bottom,a.start=e.settings.start,a.end=e.settings.end,!1}))),this.hot.setCellMeta(e,t,"borders",dl(a)),this.insertBorderIntoSettings(a,r)}prepareBorderFromCustomAddedRange(e,t){const n=Math.min(e.to.row,this.hot.countRows()-1),r=Math.min(e.to.col,this.hot.countCols()-1);(0,Mt.Ti)(e.from.row,n,(n=>{(0,Mt.Ti)(e.from.col,r,(r=>{const o=ml(n,r);let i=0;n===e.from.row&&(0,s.mQ)(t,"top")&&(i+=1,o.top=t.top),n===e.to.row&&(0,s.mQ)(t,"bottom")&&(i+=1,o.bottom=t.bottom),r===e.from.col&&(0,s.mQ)(t,"start")&&(i+=1,o.start=t.start),r===e.to.col&&(0,s.mQ)(t,"end")&&(i+=1,o.end=t.end),i>0&&(this.hot.setCellMeta(n,r,"borders",dl(o)),this.insertBorderIntoSettings(o))}))}))}removeAllBorders(e,t){const n=hl(e,t);this.spliceBorder(n),this.clearBordersFromSelectionSettings(n),this.clearNullCellRange(),this.hot.removeCellMeta(e,t,"borders")}setBorder(e,t,n,r){let o=this.hot.getCellMeta(e,t).borders;o=o&&void 0!==o.border?cl(o):ml(e,t),r?(o[n]={hide:!0},4===this.countHide(o)?this.removeAllBorders(e,t):(this.checkCustomSelectionsFromContextMenu(o,n,r)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,t,"borders",dl(o)))):(o[n]={width:1,color:"#000"},this.checkCustomSelectionsFromContextMenu(o,n,r)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,t,"borders",dl(o)))}prepareBorder(e,t,n){(0,h.z0)(e,(e=>{let{start:r,end:o}=e;if(r.row===o.row&&r.col===o.col)"noBorders"===t?this.removeAllBorders(r.row,r.col):this.setBorder(r.row,r.col,t,n);else switch(t){case"noBorders":(0,Mt.Ti)(r.col,o.col,(e=>{(0,Mt.Ti)(r.row,o.row,(t=>{this.removeAllBorders(t,e)}))}));break;case"top":(0,Mt.Ti)(r.col,o.col,(e=>{this.setBorder(r.row,e,t,n)}));break;case"bottom":(0,Mt.Ti)(r.col,o.col,(e=>{this.setBorder(o.row,e,t,n)}));break;case"start":(0,Mt.Ti)(r.row,o.row,(e=>{this.setBorder(e,r.col,t,n)}));break;case"end":(0,Mt.Ti)(r.row,o.row,(e=>{this.setBorder(e,o.col,t,n)}))}}))}createCustomBorders(e){(0,h.z0)(e,(e=>{const t=cl(e);e.range?this.prepareBorderFromCustomAddedRange(e.range,t):this.prepareBorderFromCustomAdded(e.row,e.col,t)}))}countHide(e){const{top:t,bottom:n,start:r,end:o}=e,i=[t,n,r,o];return(0,h.mu)(i,((e,t)=>{let n=e;return t&&t.hide&&(n+=1),n}),0)}clearBordersFromSelectionSettings(e){const t=(0,h.YD)(this.hot.selection.highlight.customSelections,(e=>e.settings.id)).indexOf(e);t>-1&&this.hot.selection.highlight.customSelections[t].clear()}clearNullCellRange(){(0,h.z0)(this.hot.selection.highlight.customSelections,((e,t)=>{if(null===e.cellRange)return this.hot.selection.highlight.customSelections[t].destroy(),this.hot.selection.highlight.customSelections.splice(t,1),!1}))}hideBorders(){(0,h.z0)(this.savedBorders,(e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()}))}spliceBorder(e){const t=(0,h.YD)(this.savedBorders,(e=>e.id)).indexOf(e);t>-1&&this.savedBorders.splice(t,1)}checkSavedBorders(e){let t=!1;return 4===this.countHide(e)?(this.spliceBorder(e.id),t=!0):(0,h.z0)(this.savedBorders,((n,r)=>{if(e.id===n.id)return this.savedBorders[r]=e,t=!0,!1})),t}checkCustomSelectionsFromContextMenu(e,t,n){let r=!1;return(0,h.z0)(this.hot.selection.highlight.customSelections,(o=>{if(e.id===o.settings.id){const e=this.hot.view._wt.selectionManager.getBorderInstances(o);return(0,h.z0)(e,(e=>{e.toggleHiddenClass(t,n)})),r=!0,!1}})),r}checkCustomSelections(e,t,n){const r=this.countHide(e);let o=!1;return 4===r?(this.removeAllBorders(e.row,e.col),o=!0):(0,h.z0)(this.hot.selection.highlight.customSelections,(r=>{if(e.id===r.settings.id){if(r.visualCellRange=t,r.commit(),n){const t=this.hot.view._wt.selectionManager.getBorderInstances(r);(0,h.z0)(t,(t=>{t.changeBorderStyle(n,e)}))}return o=!0,!1}})),o}changeBorderSettings(){const e=this.hot.getSettings()[Sl];if(Array.isArray(e)){const t=(0,s.Go)(e);this.checkSettingsCohesion(t),t.length||(this.savedBorders=t),this.createCustomBorders(t)}else void 0!==e&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const t=e.some((e=>(0,c.O9)(e.left)||(0,c.O9)(e.right))),n=e.some((e=>(0,c.O9)(e.start)||(0,c.O9)(e.end)));if(t&&n)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&t)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function Ml(e){var t;this.hot.getSettings()[Sl]&&e.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_BORDERS)},disabled(){const e=this.getSelectedRangeLast();return!e||!!e.isSingleHeader()||this.selection.isSelectedByCorner()},submenu:{items:[(t=this,{key:"borders:top",name(){let e=this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_BORDERS_TOP);return pl(this,"top")&&(e=fl(e)),e},callback(e,n){const r=pl(this,"top");t.prepareBorder(n,"top",r)}}),yl(this),wl(this),vl(this),_l(this)]}})}function Tl(){this.changeBorderSettings()}function Rl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Al(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Nl="dragToScroll";var Ll=new WeakSet;class xl extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=Ll),t.add(e),Rl(this,"boundaries",null),Rl(this,"callback",null),Rl(this,"listening",!1)}static get PLUGIN_KEY(){return Nl}static get PLUGIN_PRIORITY(){return 100}isEnabled(){return!!this.hot.getSettings()[Nl]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",(e=>Al(Ll,this,Ol).call(this,e))),this.addHook("afterOnCellCornerMouseDown",(e=>Al(Ll,this,Ol).call(this,e))),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,t){let n=0,r=0;tthis.boundaries.bottom&&(r=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,r)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let t=e;for(;t;)this.eventManager.addEventListener(t.document,"contextmenu",(()=>this.unlisten())),this.eventManager.addEventListener(t.document,"mouseup",(()=>this.unlisten())),this.eventManager.addEventListener(t.document,"mousemove",(e=>this.onMouseMove(e))),t=(0,o.Ly)(t)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function Ol(e){if((0,i.nO)(e))return;const t=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(t!==this.hot.rootWindow?t.getBoundingClientRect():void 0),this.setCallback(((e,n)=>{var r,o;const i=null!==(r=t.scrollLeft)&&void 0!==r?r:t.scrollX,s=null!==(o=t.scrollTop)&&void 0!==o?o:t.scrollY;t.scroll(i+50*Math.sign(e),s+20*Math.sign(n))})),this.listen()}function Il(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dl(e,t,n){return e.set(Pl(e,t),n),n}function Pl(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("afterDropdownMenuDefaultOptions"),Ce.R.getSingleton().register("beforeDropdownMenuShow"),Ce.R.getSingleton().register("afterDropdownMenuShow"),Ce.R.getSingleton().register("afterDropdownMenuHide"),Ce.R.getSingleton().register("afterDropdownMenuExecute");const Hl="dropdownMenu",Fl="changeType",Yl=Hl;var Vl=new WeakMap,Ul=new WeakSet;class Bl extends hn{static get PLUGIN_KEY(){return Hl}static get PLUGIN_PRIORITY(){return 230}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[ps,fs,Ri,vs,Ri,ms,Ri,gs,Ri,ds]}constructor(e){var t;super(e),Il(this,t=Ul),t.add(this),kl(this,"commandExecutor",new cs(this.hot)),kl(this,"itemsFactory",null),kl(this,"menu",null),function(e,t){Il(e,t),t.set(e,!1)}(this,Vl),this.hot.addHook("afterGetColHeader",((e,t)=>Pl(Ul,this,zl).call(this,e,t)))}isEnabled(){return this.hot.getSettings()[Hl]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new Ns(this.hot,Bl.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{this.hot.runHooks("afterDropdownMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(t);this.menu&&this.menu.destroy(),this.menu=new oa(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",r),this.menu.setMenuItems(r),this.menu.addLocalHook("beforeOpen",(()=>Pl(Ul,this,Gl).call(this))),this.menu.addLocalHook("afterOpen",(()=>Pl(Ul,this,$l).call(this))),this.menu.addLocalHook("afterSubmenuOpen",(e=>Pl(Ul,this,Kl).call(this,e))),this.menu.addLocalHook("afterClose",(()=>Pl(Ul,this,Xl).call(this))),this.menu.addLocalHook("executeCommand",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.commandExecutor.registerCommand(e.key,e)))}))}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=()=>{const{highlight:e}=this.hot.getSelectedRangeLast();if((e.isHeader()&&-1===e.row||e.isCell())&&e.col>=0){this.hot.selectColumns(e.col,e.col,-1);const{from:t}=this.hot.getSelectedRangeLast(),n=Oi(this.menu.container,this.hot.rootDocument),r=this.hot.getCell(-1,t.col,!0).querySelector(`.${Fl}`),o=r.getBoundingClientRect();this.open({left:o.left+n.left,top:o.top+r.offsetHeight+n.top},{left:o.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};this.hot.getShortcutManager().getContext("grid").addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:e,runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:Yl},{keys:[["Shift","Alt","ArrowDown"]],callback:e,runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isCell()&&!this.menu.isOpened()},group:Yl}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Yl)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",(e=>Pl(Ul,this,jl).call(this,e)))}open(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};null!==(t=this.menu)&&void 0!==t&&t.isOpened()||(this.menu.open(),(0,s.v4)(n,((e,t)=>{this.menu.setOffset(t,e)})),this.menu.setPosition(e))}close(){var e;null===(e=this.menu)||void 0===e||e.close()}executeCommand(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0])||arguments[0];this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function Wl(e){e.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function jl(e){if((0,o.nB)(e.target,Fl)){const t=Oi(this.menu.container,this.hot.rootDocument),n=e.target.getBoundingClientRect();e.stopPropagation(),Dl(Vl,this,!1),this.open({left:n.left+t.left,top:n.top+e.target.offsetHeight+t.top},{left:n.width,right:0,above:0,below:3})}}function zl(e,t){const n=t.parentNode;if(!n)return;const r=n.parentNode.childNodes,i=Array.prototype.indexOf.call(r,n);if(e<0||i!==r.length-1)return;const s=t.querySelector(`.${Fl}`);if(this.enabled&&s)return;if(!this.enabled)return void(s&&s.parentNode.removeChild(s));const a=this.hot.rootDocument.createElement("button");a.className=Fl,a.type="button",a.tabIndex=-1,this.hot.getSettings().ariaTags&&((0,o.Bq)(a,[(0,f.MG)(),(0,f.SM)(" ")]),(0,o.Bq)(t,[(0,f.wP)("menu")])),a.onclick=function(){return!1},t.firstChild.insertBefore(a,t.firstChild.firstChild)}function Gl(){this.hot.runHooks("beforeDropdownMenuShow",this)}function $l(){this.hot.runHooks("afterDropdownMenuShow",this),Pl(Ul,this,Wl).call(this,this.menu)}function Kl(e){Pl(Ul,this,Wl).call(this,e)}function Xl(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function ql(e){return(t=Vl).get(Pl(t,this))?null:e;var t}function Ql(e){(0,o.nB)(e.target,Fl)&&Dl(Vl,this,!0)}function Jl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Bl.SEPARATOR={name:Ri};const Zl=class{constructor(e){Jl(this,"hot",void 0),Jl(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:t,endRow:n,endCol:r}=this._getDataRange(),o=this.options,i=[];return(0,Mt.Ti)(e,n,(e=>{const n=[];!o.exportHiddenRows&&this._isHiddenRow(e)||((0,Mt.Ti)(t,r,(t=>{!o.exportHiddenColumns&&this._isHiddenColumn(t)||n.push(this.hot.getDataAtCell(e,t))})),i.push(n))})),i}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:t,endRow:n}=this._getDataRange(),r=this.hot.getRowHeader();(0,Mt.Ti)(t,n,(t=>{!this.options.exportHiddenRows&&this._isHiddenRow(t)||e.push(r[t])}))}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:t,endCol:n}=this._getDataRange(),r=this.hot.getColHeader();(0,Mt.Ti)(t,n,(t=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(t)||e.push(r[t])}))}return e}_getDataRange(){const e=this.hot.countCols()-1,t=this.hot.countRows()-1;let[n=0,r=0,o=t,i=e]=this.options.range;return n=Math.max(n,0),r=Math.max(r,0),o=Math.min(o,t),i=Math.min(i,e),{startRow:n,startCol:r,endRow:o,endCol:i}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}};function eu(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class tu{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,t){eu(this,"dataProvider",void 0),eu(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(t),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let t=(0,s.o8)(this.constructor.DEFAULT_OPTIONS);const n=new Date;return t=(0,s.X$)((0,s.o8)(tu.DEFAULT_OPTIONS),t),t=(0,s.X$)(t,e),t.filename=(0,d.V2)(t.filename,{YYYY:n.getFullYear(),MM:`${n.getMonth()+1}`.padStart(2,"0"),DD:`${n.getDate()}`.padStart(2,"0")}),t}}const nu=tu;function ru(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const ou=String.fromCharCode(13),iu=String.fromCharCode(34),su=String.fromCharCode(10),au=String.fromCharCode(61),lu=String.fromCharCode(43),uu=String.fromCharCode(45),hu=String.fromCharCode(64),cu=String.fromCharCode(9);var du=new WeakSet;function mu(e){return e.startsWith(au)||e.startsWith(lu)||e.startsWith(uu)||e.startsWith(hu)||e.startsWith(cu)||e.startsWith(ou)?`'${e}`:e}function pu(e,t){return t.test(e)?`'${e}`:e}const fu="csv",gu={[fu]:class extends nu{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=du),t.add(e)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:"\r\n",sanitizeValues:!1}}export(){const e=this.options,t=this.dataProvider.getData();let n=this.dataProvider.getColumnHeaders();const r=n.length>0,o=this.dataProvider.getRowHeaders(),i=o.length>0;let s=e.bom?String.fromCharCode(65279):"";return r&&(n=(0,h.YD)(n,(t=>this._escapeCell(t,{force:!0,sanitizeValue:e.sanitizeValues}))),i&&(s+=e.columnDelimiter),s+=n.join(e.columnDelimiter),s+=e.rowDelimiter),(0,h.z0)(t,((t,n)=>{n>0&&(s+=e.rowDelimiter),i&&(s+=this._escapeCell(o[n],{sanitizeValue:e.sanitizeValues}),s+=e.columnDelimiter);const r=t.map((t=>this._escapeCell(t,{sanitizeValue:e.sanitizeValues}))).join(e.columnDelimiter);s+=r})),s}_escapeCell(e){let{force:t=!1,sanitizeValue:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,c.As)(e);return""===r||(n&&(t=!0),n instanceof RegExp?r=ru(du,this,pu).call(this,r,n):"function"==typeof n?r=n(r):n&&(r=ru(du,this,mu).call(this,r)),(t||r.indexOf(ou)>=0||r.indexOf(iu)>=0||r.indexOf(su)>=0||r.indexOf(this.options.columnDelimiter)>=0)&&(r=r.replace(new RegExp('"',"g"),'""'),r=`"${r}"`)),r}}};class yu extends hn{static get PLUGIN_KEY(){return"exportFile"}static get PLUGIN_PRIORITY(){return 240}isEnabled(){return!0}exportAsString(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createTypeFormatter(e,t).export()}exportAsBlob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,t))}downloadFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{rootDocument:n,rootWindow:r}=this.hot,o=this._createTypeFormatter(e,t),i=this._createBlob(o),s=r.URL||r.webkitURL,a=n.createElement("a"),l=`${o.options.filename}.${o.options.fileExtension}`;if(void 0!==a.download){const e=s.createObjectURL(i);a.style.display="none",a.setAttribute("href",e),a.setAttribute("download",l),n.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),n.body.removeChild(a),setTimeout((()=>{s.revokeObjectURL(e)}),100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(i,l)}_createTypeFormatter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!gu[e])throw new Error(`Export format type "${e}" is not supported.`);return function(e,t,n){return"function"==typeof gu[e]?new gu[e](t,n):null}(e,new Zl(this.hot),t)}_createBlob(e){let t=null;return"undefined"!=typeof Blob&&(t=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),t}}function wu(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n(93514);class vu{constructor(e,t){let{id:n,stateless:r=!0}=t;wu(this,"hot",void 0),wu(this,"id",void 0),wu(this,"elements",[]),wu(this,"hidden",!1),wu(this,"stateId",""),wu(this,"state",void 0),this.hot=e,this.id=n,this.stateId=`Filters.component.${this.id}`,this.state=r?null:this.hot.columnIndexMapper.registerMap(this.stateId,new eo.z)}getElements(){return this.elements}reset(){(0,h.z0)(this.elements,(e=>e.reset()))}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return null===this.hot||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),(0,h.z0)(this.elements,(e=>e.destroy())),this.state=null,this.elements=null,this.hot=null}}(0,s.co)(vu,Zo.A);const _u={};function bu(e,t){if(!_u[e])throw Error(`Filter condition "${e}" does not exist.`);const{condition:n,descriptor:r}=_u[e];let o=t;return r.inputValuesDecorator&&(o=r.inputValuesDecorator(o)),function(e){return n.apply(e.meta.instance,[].concat([e],[o]))}}function Su(e){if(!_u[e])throw Error(`Filter condition "${e}" does not exist.`);return _u[e].descriptor}function Cu(e,t,n){n.key=e,_u[e]={condition:t,descriptor:n}}const Eu="none";Cu(Eu,(function(){return!0}),{name:Ee.FILTERS_CONDITIONS_NONE,inputsCount:0,showOperators:!1});const Mu="empty";Cu(Mu,(function(e){return(0,c.Im)(e.value)}),{name:Ee.FILTERS_CONDITIONS_EMPTY,inputsCount:0,showOperators:!0});const Tu="not_empty";Cu(Tu,(function(e,t){return!bu(Mu,t)(e)}),{name:Ee.FILTERS_CONDITIONS_NOT_EMPTY,inputsCount:0,showOperators:!0});const Ru="eq";Cu(Ru,(function(e,t){let[n]=t;return(0,c.As)(e.value).toLocaleLowerCase(e.meta.locale)===(0,c.As)(n)}),{name:Ee.FILTERS_CONDITIONS_EQUAL,inputsCount:1,showOperators:!0});const Au="neq";Cu(Au,(function(e,t){return!bu(Ru,t)(e)}),{name:Ee.FILTERS_CONDITIONS_NOT_EQUAL,inputsCount:1,showOperators:!0}),Cu("gt",(function(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value>r}),{name:Ee.FILTERS_CONDITIONS_GREATER_THAN,inputsCount:1,showOperators:!0}),Cu("gte",(function(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value>=r}),{name:Ee.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL,inputsCount:1,showOperators:!0}),Cu("lt",(function(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value=0}),{name:Ee.FILTERS_CONDITIONS_AFTER,inputsCount:1,showOperators:!0});const Lu="date_before";Cu(Lu,(function(e,t){let[n]=t;const r=N(e.value,e.meta.dateFormat),o=N(n,e.meta.dateFormat);return!(!r.isValid()||!o.isValid())&&r.diff(o)<=0}),{name:Ee.FILTERS_CONDITIONS_BEFORE,inputsCount:1,showOperators:!0});const xu="between";Cu(xu,(function(e,t){let[n,r]=t,o=n,i=r;if("numeric"===e.meta.type){const e=parseFloat(o,10),t=parseFloat(i,10);o=Math.min(e,t),i=Math.max(e,t)}else if("date"===e.meta.type){const t=bu(Lu,[i]),n=bu(Nu,[o]);return t(e)&&n(e)}return e.value>=o&&e.value<=i}),{name:Ee.FILTERS_CONDITIONS_BETWEEN,inputsCount:2,showOperators:!0});const Ou="not_between";Cu(Ou,(function(e,t){return!bu(xu,t)(e)}),{name:Ee.FILTERS_CONDITIONS_NOT_BETWEEN,inputsCount:2,showOperators:!0});const Iu="begins_with";Cu(Iu,(function(e,t){let[n]=t;return(0,c.As)(e.value).toLocaleLowerCase(e.meta.locale).startsWith((0,c.As)(n))}),{name:Ee.FILTERS_CONDITIONS_BEGINS_WITH,inputsCount:1,showOperators:!0});const ku="ends_with";Cu(ku,(function(e,t){let[n]=t;return(0,c.As)(e.value).toLocaleLowerCase(e.meta.locale).endsWith((0,c.As)(n))}),{name:Ee.FILTERS_CONDITIONS_ENDS_WITH,inputsCount:1,showOperators:!0});const Du="contains";Cu(Du,(function(e,t){let[n]=t;return(0,c.As)(e.value).toLocaleLowerCase(e.meta.locale).indexOf((0,c.As)(n))>=0}),{name:Ee.FILTERS_CONDITIONS_CONTAINS,inputsCount:1,showOperators:!0});const Pu="not_contains";Cu(Pu,(function(e,t){return!bu(Du,t)(e)}),{name:Ee.FILTERS_CONDITIONS_NOT_CONTAIN,inputsCount:1,showOperators:!0});const Hu="date_tomorrow";Cu(Hu,(function(e){const t=N(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(N().subtract(-1,"days").startOf("day"),"d")}),{name:Ee.FILTERS_CONDITIONS_TOMORROW,inputsCount:0});const Fu="date_today";Cu(Fu,(function(e){const t=N(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(N().startOf("day"),"d")}),{name:Ee.FILTERS_CONDITIONS_TODAY,inputsCount:0});const Yu="date_yesterday";Cu(Yu,(function(e){const t=N(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(N().subtract(1,"days").startOf("day"),"d")}),{name:Ee.FILTERS_CONDITIONS_YESTERDAY,inputsCount:0});const Vu="numeric",Uu="text",Bu="date",Wu={[Vu]:[Eu,Ri,Mu,Tu,Ri,Ru,Au,Ri,"gt","gte","lt","lte",xu,Ou],[Uu]:[Eu,Ri,Mu,Tu,Ri,Ru,Au,Ri,Iu,ku,Ri,Du,Pu],[Bu]:[Eu,Ri,Mu,Tu,Ri,Ru,Au,Ri,Lu,Nu,xu,Ri,Hu,Fu,Yu]};function ju(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zu="built",Gu="building",$u=["click","input","keydown","keypress","keyup","focus","blur","change"];class Ku{static get DEFAULTS(){return(0,s.o8)({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,t){ju(this,"hot",void 0),ju(this,"eventManager",new _e.A(this)),ju(this,"options",void 0),ju(this,"_element",void 0),ju(this,"buildState",void 0),this.hot=e,this.options=(0,s.X$)(Ku.DEFAULTS,t),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===Gu?this._element:this.buildState===zu?(this.update(),this._element):(this.buildState=Gu,this.build(),this.buildState=zu,this._element)}isBuilt(){return this.buildState===zu}translateIfPossible(e){return"string"==typeof e&&e.startsWith(Ee.FILTERS_NAMESPACE)?this.hot.getTranslatedPhrase(e):e}build(){const e=(e,t)=>{this.eventManager.addEventListener(e,t,(e=>this.runLocalHooks(t,e,this)))};if(this.buildState||(this.buildState=Gu),this._element.setAttribute("data-hot-input",!0),void 0!==this.options.tabIndex&&this._element.setAttribute("tabindex",this.options.tabIndex),void 0!==this.options.role&&this._element.setAttribute("role",this.options.role),this.options.className&&(0,o.iQ)(this._element,this.options.className),this.options.children.length)(0,h.z0)(this.options.children,(e=>this._element.appendChild(e.element)));else if(this.options.wrapIt){const t=this.hot.rootDocument.createElement(this.options.tagName);t.setAttribute("data-hot-input",!0),(0,s.v4)(this.options,((e,n)=>{void 0!==t[n]&&"className"!==n&&"tagName"!==n&&"children"!==n&&(t[n]=this.translateIfPossible(e))})),this._element.appendChild(t),(0,h.z0)($u,(n=>e(t,n)))}else(0,h.z0)($u,(t=>e(this._element,t)))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}}function Xu(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qu(e,t){return e.get(Qu(e,t))}function Qu(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(0,s.co)(Ku,Zo.A);var Ju=new WeakMap,Zu=new WeakSet;class eh extends Ku{static get DEFAULTS(){return(0,s.o8)({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,t){var n;super(e,(0,s.X$)(eh.DEFAULTS,t)),Xu(this,n=Zu),n.add(this),function(e,t){Xu(e,t),t.set(e,void 0)}(this,Ju),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",(e=>Qu(Zu,this,th).call(this,e)))}build(){super.build();const e=this.hot.rootDocument.createElement("div");var t,n;t=Ju,n=this._element.firstChild,t.set(Qu(t,this),n),(0,o.iQ)(this._element,"htUIInput"),(0,o.iQ)(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(qu(Ju,this).type=this.options.type,qu(Ju,this).placeholder=this.translateIfPossible(this.options.placeholder),qu(Ju,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&qu(Ju,this).focus()}}function th(e){this.options.value=e.target.value}function nh(e,t,n){rh(e,t),t.set(e,n)}function rh(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oh(e,t,n){return e.set(sh(e,t),n),n}function ih(e,t){return e.get(sh(e,t))}function sh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var ah=new WeakMap,lh=new WeakMap,uh=new WeakMap,hh=new WeakMap,ch=new WeakMap,dh=new WeakSet;class mh extends Ku{static get DEFAULTS(){return(0,s.o8)({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,t){var n;super(e,(0,s.X$)(mh.DEFAULTS,t)),rh(this,n=dh),n.add(this),nh(this,ah,null),nh(this,lh,[]),nh(this,uh,void 0),nh(this,hh,void 0),nh(this,ch,void 0),this.registerHooks()}getMenu(){return ih(ah,this)}registerHooks(){this.addLocalHook("click",(()=>sh(dh,this,gh).call(this)))}setItems(e){oh(lh,this,this.translateNames(e)),ih(ah,this)&&ih(ah,this).setMenuItems(ih(lh,this))}translateNames(e){return(0,h.z0)(e,(e=>{e.name=this.translateIfPossible(e.name)})),e}build(){super.build(),oh(ah,this,new oa(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),ih(ah,this).setMenuItems(ih(lh,this));const e=new Ku(this.hot,{className:"htUISelectCaption"}),t=new Ku(this.hot,{className:"htUISelectDropdown"});oh(uh,this,e),oh(hh,this,e.element),oh(ch,this,t),this.hot.getSettings().ariaTags&&((0,o.Bq)(t.element,[(0,f.MG)()]),(0,o.Bq)(this._element,[(0,f.$o)()])),(0,h.z0)([e,t],(e=>this._element.appendChild(e.element))),ih(ah,this).addLocalHook("select",(e=>sh(dh,this,ph).call(this,e))),ih(ah,this).addLocalHook("afterClose",(()=>sh(dh,this,fh).call(this))),this.update()}update(){if(!this.isBuilt())return;let e;e=this.options.value?this.options.value.name:ih(ah,this).hot.getTranslatedPhrase(Ee.FILTERS_CONDITIONS_NONE),ih(hh,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();ih(ah,this)&&(ih(ah,this).open(),ih(ah,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),ih(ah,this).getNavigator().toFirstItem(),ih(ah,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{this.closeOptions(),this.runLocalHooks("tabKeydown",e)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){ih(ah,this)&&ih(ah,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){ih(ah,this)&&(ih(ah,this).destroy(),oh(ah,this,null)),ih(uh,this)&&ih(uh,this).destroy(),ih(ch,this)&&ih(ch,this).destroy(),super.destroy()}}function ph(e){e.name!==Ri&&(this.options.value=e,this.update(),this.runLocalHooks("select",this.options.value))}function fh(){this.runLocalHooks("afterClose")}function gh(){this.openOptions()}function yh(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var vh=new WeakSet;class _h extends vu{constructor(e,t){var n,r;super(e,{id:t.id,stateless:!1}),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,r=vh),r.add(n),yh(this,"name",""),yh(this,"addSeparator",!1),this.name=t.name,this.addSeparator=t.addSeparator,this.elements.push(new mh(this.hot,{menuContainer:t.menuContainer})),this.elements.push(new eh(this.hot,{placeholder:Ee.FILTERS_BUTTONS_PLACEHOLDER_VALUE})),this.elements.push(new eh(this.hot,{placeholder:Ee.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",(e=>wh(vh,this,bh).call(this,e))).addLocalHook("afterClose",(()=>this.runLocalHooks("afterClose"))).addLocalHook("tabKeydown",(e=>this.runLocalHooks("selectTabKeydown",e))),(0,h.z0)(this.getInputElements(),(e=>{e.addLocalHook("keydown",(e=>wh(vh,this,Sh).call(this,e)))}))}setState(e){if(this.reset(),!e)return;const t=(0,s.o8)(e.command);t.name.startsWith(Ee.FILTERS_CONDITIONS_NAMESPACE)&&(t.name=this.hot.getTranslatedPhrase(t.name)),this.getSelectElement().setValue(t),(0,h.z0)(e.args,((e,n)=>{if(n>t.inputsCount-1)return!1;const r=this.getInputElement(n);r.setValue(e),r[t.inputsCount>n?"show":"hide"](),n||this.hot._registerTimeout((()=>r.focus()),10)}))}getState(){const e=this.getSelectElement().getValue()||Su(Eu),t=[];return(0,h.z0)(this.getInputElements(),((n,r)=>{e.inputsCount>r&&t.push(n.getValue())})),{command:e,args:t}}updateState(e,t){const n=Su(e?e.name:Eu);this.state.setValueAtIndex(t,{command:n,args:e?e.args:[]}),e||(0,h.z0)(this.getInputElements(),(e=>e.setValue(null)))}getSelectElement(){return this.elements.filter((e=>e instanceof mh))[0]}getInputElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter((e=>e instanceof eh))}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,n,r,i,s)=>{(0,o.iQ)(t.parentNode,"htFiltersMenuCondition"),this.addSeparator&&(0,o.iQ)(t.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return(0,o.iQ)(a,"htFiltersMenuLabel"),a.textContent=s,t.appendChild(a),t.parentElement.hasAttribute("ghost-table")||(0,h.z0)(this.elements,(e=>t.appendChild(e.element))),t}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let t=[Su(Eu)];if(null!==e){const{visualIndex:n}=e;t=function(e){const t=[];let n=e;return Wu[n]||(n=Uu),(0,h.z0)(Wu[n],(e=>{let n;n=e===Ri?{name:Ri}:(0,s.o8)(Su(e)),t.push(n)})),t}(this.hot.getDataType(0,n,this.hot.countRows(),n))}(0,h.z0)(this.getInputElements(),(e=>e.hide())),this.getSelectElement().setItems(t),super.reset(),this.getSelectElement().setValue(t[0])}}function bh(e){(0,h.z0)(this.getInputElements(),((t,n)=>{t[e.inputsCount>n?"show":"hide"](),0===n&&this.hot._registerTimeout((()=>t.focus()),10)})),this.runLocalHooks("change",e)}function Sh(e){(0,m.m0)(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),(0,i.CA)(e))}const Ch={};function Eh(e,t,n){Ch[e]={name:t,func:n}}const Mh="conjunction",Th=Ee.FILTERS_LABELS_CONJUNCTION;Eh(Mh,Th,(function(e,t){return e.every((e=>e.func(t)))}));const Rh="disjunction",Ah=Ee.FILTERS_LABELS_DISJUNCTION;Eh(Rh,Ah,(function(e,t){return e.some((e=>e.func(t)))}));const Nh="disjunctionWithExtraCondition",Lh=Ee.FILTERS_LABELS_DISJUNCTION;function xh(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function Oh(e,t){return e.get(kh(e,t))}function Ih(e,t,n){return e.set(kh(e,t),n),n}function kh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Eh(Nh,Lh,(function(e,t){if(e.length<3)throw Error("Operation doesn't work on less then three conditions.");return e.slice(0,e.length-1).some((e=>e.func(t)))&&e[e.length-1].func(t)}));var Dh=new WeakMap,Ph=new WeakMap;class Hh extends Ku{static get DEFAULTS(){return(0,s.o8)({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,t){super(e,(0,s.X$)(Hh.DEFAULTS,t)),xh(this,Dh,void 0),xh(this,Ph,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),Ih(Ph,this,e),Ih(Dh,this,this._element.firstChild),Oh(Dh,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Oh(Ph,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return!!this.isBuilt()&&Oh(Dh,this).checked}setChecked(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isBuilt()&&(Oh(Dh,this).checked=e)}focus(){this.isBuilt()&&Oh(Dh,this).focus()}}var Fh=new WeakSet;class Yh extends vu{constructor(e,t){var n,r;super(e,{id:t.id,stateless:!1}),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,r=Fh),r.add(n),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"name",""),this.name=t.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>((0,o.iQ)(t.parentNode,"htFiltersMenuOperators"),(0,h.z0)(this.elements,(e=>t.appendChild(e.element))),t)}}buildOperatorsElement(){const e=[Mh,Rh];(0,h.z0)(e,(t=>{const n=new Hh(this.hot,{name:"operator",label:{htmlFor:t,textContent:(r=t,Ch[r].name)},value:t,checked:t===e[0],id:t});var r;n.addLocalHook("change",(e=>function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(Fh,this,Vh).call(this,e))),this.elements.push(n)}))}setChecked(e){if(this.elements.length{t.setChecked(n===e)}))}getActiveOperationId(){const e=this.elements.find((e=>e instanceof Hh&&e.isChecked()));return e?e.getValue():Mh}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&(0,h.z0)(this.elements,(t=>{t.setChecked(t.getValue()===e)}))}updateState(){let e=arguments.length>1?arguments[1]:void 0,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mh;t===Nh&&(t=Rh),this.state.setValueAtIndex(e,t)}reset(){this.setChecked(0)}}function Vh(e){this.setState(e.target.value)}function Uh(e,t){let n=e;return""===n&&(n=`(${t})`),n}function Bh(e){const t=new Set(e);return function(e){return t.has(e)}}function Wh(e){return null==e?"":e}function jh(e){return Array.from(new Set(e)).map((e=>Wh(e))).sort(((e,t)=>"number"==typeof e&&"number"==typeof t?e-t:e===t?0:e>t?1:-1))}function zh(e,t,n,r){const o=[],i=e===t;let s;return i||(s=Bh(t)),e.forEach((e=>{let t=!1;(i||s(e))&&(t=!0);const a={checked:t,value:e,visualValue:Uh(e,n)};r&&r(a),o.push(a)})),o}(0,dn.II)();var Gh=n(85874);function $h(e,t){return e.get(Kh(e,t))}function Kh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Xh=new WeakMap;class qh extends Ku{static get DEFAULTS(){return(0,s.o8)({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,t){var n,r,o;super(e,(0,s.X$)(qh.DEFAULTS,t)),o=void 0,function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,r=Xh),r.set(n,o)}build(){var e,t;super.build(),e=Xh,t=this._element.firstChild,e.set(Kh(e,this),t)}update(){this.isBuilt()&&($h(Xh,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&$h(Xh,this).focus()}activate(){$h(Xh,this).click()}}function Qh(e,t,n){Jh(e,t),t.set(e,n)}function Jh(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zh(e,t){return e.get(tc(e,t))}function ec(e,t,n){return e.set(tc(e,t),n),n}function tc(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const nc="multipleSelect.itemBox";var rc=new WeakMap,oc=new WeakMap,ic=new WeakMap,sc=new WeakMap,ac=new WeakMap,lc=new WeakMap,uc=new WeakSet;class hc extends Ku{static get DEFAULTS(){return(0,s.o8)({className:"htUIMultipleSelect",value:[]})}constructor(e,t){var n;super(e,(0,s.X$)(hc.DEFAULTS,t)),Jh(this,n=uc),n.add(this),Qh(this,rc,[]),Qh(this,oc,void 0),Qh(this,ic,void 0),Qh(this,sc,void 0),Qh(this,ac,void 0),Qh(this,lc,void 0),ec(sc,this,new eh(this.hot,{placeholder:Ee.FILTERS_BUTTONS_PLACEHOLDER_SEARCH,className:"htUIMultipleSelectSearch"})),ec(ac,this,new qh(this.hot,{textContent:Ee.FILTERS_BUTTONS_SELECT_ALL,className:"htUISelectAll"})),ec(lc,this,new qh(this.hot,{textContent:Ee.FILTERS_BUTTONS_CLEAR,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Zh(oc,this)}registerHooks(){Zh(sc,this).addLocalHook("keydown",(e=>tc(uc,this,dc).call(this,e))),Zh(sc,this).addLocalHook("input",(e=>tc(uc,this,cc).call(this,e))),Zh(ac,this).addLocalHook("click",(e=>tc(uc,this,mc).call(this,e))),Zh(lc,this).addLocalHook("click",(e=>tc(uc,this,pc).call(this,e)))}setItems(e){var t;ec(rc,this,e),null===(t=Zh(oc,this))||void 0===t||t.loadData(Zh(rc,this))}setLocale(e){ec(ic,this,e)}getLocale(){return Zh(ic,this)}getItems(){return[...Zh(rc,this)]}getValue(){return function(e){const t=[];return e.forEach((e=>{e.checked&&t.push(e.value)})),t}(Zh(rc,this))}getSearchInputElement(){return Zh(sc,this)}getSelectAllElement(){return Zh(ac,this)}getClearAllElement(){return Zh(lc,this)}isSelectedAllValues(){return Zh(rc,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,t=e.createElement("div"),n=new Ku(this.hot,{className:"htUISelectionControls",children:[Zh(ac,this),Zh(lc,this)]});this._element.appendChild(Zh(sc,this).element),this._element.appendChild(n.element),this._element.appendChild(t);const r=t=>{var n;if(!this._element)return;null===(n=Zh(oc,this))||void 0===n||n.destroy(),(0,o.iQ)(t,"htUIMultipleSelectHot"),ec(oc,this,new this.hot.constructor(t,{data:Zh(rc,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(e,t,n,r,o,i)=>{e.title=i.instance.getDataAtRowProp(t,i.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Zh(oc,this).listen()},modifyColWidth:t=>{const n=Zh(oc,this).container.scrollWidth-(0,o.XJ)(e);return void 0!==t&&t{t||Zh(oc,this).useTheme(e)}));const r=Zh(oc,this).getShortcutManager().getContext("grid");r.removeShortcutsByKeys(["Tab"]),r.removeShortcutsByKeys(["Shift","Tab"]),r.addShortcut({keys:[["Escape"]],callback:e=>{this.runLocalHooks("keydown",e,this)},group:nc}),r.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:e=>{Zh(oc,this).deselectCell(),this.runLocalHooks("keydown",e,this),this.runLocalHooks("listTabKeydown",e,this)},group:nc})};r(t),this.hot._registerTimeout((()=>r(t)),100)}focus(){this.isBuilt()&&Zh(oc,this).listen()}reset(){Zh(sc,this).reset(),Zh(ac,this).reset(),Zh(lc,this).reset()}update(){this.isBuilt()&&(Zh(oc,this).loadData(function(e,t){const n=Bh(t);return e.map((e=>(e.checked=n(e.value),e)))}(Zh(rc,this),this.options.value)),super.update())}destroy(){var e;null===(e=Zh(oc,this))||void 0===e||e.destroy(),Zh(sc,this).destroy(),Zh(lc,this).destroy(),Zh(ac,this).destroy(),ec(sc,this,null),ec(lc,this,null),ec(ac,this,null),ec(oc,this,null),ec(rc,this,null),super.destroy()}}function cc(e){const t=e.target.value.toLocaleLowerCase(this.getLocale());let n;n=""===t?[...Zh(rc,this)]:Zh(rc,this).filter((e=>`${e.value}`.toLocaleLowerCase(this.getLocale()).indexOf(t)>=0)),Zh(oc,this).loadData(n)}function dc(e){this.runLocalHooks("keydown",e,this),(0,g.OH)(m.m0,e.keyCode)("ARROW_DOWN")&&(e.preventDefault(),(0,i.CA)(e),Zh(oc,this).listen(),Zh(oc,this).selectCell(0,0))}function mc(e){const t=[];e.preventDefault(),Zh(oc,this).getSourceData().forEach(((e,n)=>{e.checked=!0,t.push((0,Gh.Wm)(e,n)[0])})),Zh(oc,this).setSourceDataAtCell(t)}function pc(e){const t=[];e.preventDefault(),Zh(oc,this).getSourceData().forEach(((e,n)=>{e.checked=!1,t.push((0,Gh.Wm)(e,n)[0])})),Zh(oc,this).setSourceDataAtCell(t)}const fc="by_value";function gc(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Cu(fc,(function(e,t){let[n]=t;return n(e.value)}),{name:"By value",inputsCount:0,inputValuesDecorator(e){let[t]=e;return[Bh(t)]},showOperators:!1});var yc,wc=new WeakSet;class vc extends vu{constructor(e,t){var n,r;super(e,{id:t.id,stateless:!1}),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,r=wc),r.add(n),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"name",""),this.name=t.name,this.elements.push(new hc(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",(e=>gc(wc,this,_c).call(this,e))).addLocalHook("listTabKeydown",(e=>this.runLocalHooks("listTabKeydown",e))),this.hot.addHook("modifyFiltersMultiSelectValue",((e,t)=>gc(wc,this,Sc).call(this,e,t)))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===fc){const t=this.getMultipleSelectElement();t.setItems(e.itemsSnapshot),t.setValue(e.args[0]),t.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),t=e.getItems();return{command:{key:e.isSelectedAllValues()||!t.length?Eu:fc},args:[e.getValue()],itemsSnapshot:t}}updateState(e){const t=(t,n,r,o,i)=>{const[s]=(0,h.y0)(n,(e=>e.name===fc)),a={},l=this.hot.getTranslatedPhrase(Ee.FILTERS_VALUES_BLANK_CELLS);if(s){const n=o(t,i),u=(0,h.YD)(n,(e=>e.value)),c=new Map(n.map((e=>[e.value,this.hot.getCellMeta(e.meta.visualRow,e.meta.visualCol)]))),d=jh(u);r&&(s.args[0]=r);const m=[],p=zh(d,s.args[0],l,(e=>{e.checked&&m.push(e.value),gc(wc,this,bc).call(this,e,c)})),f=e.editedConditionStack.column;a.locale=this.hot.getCellMeta(0,f).locale,a.args=[m],a.command=Su(fc),a.itemsSnapshot=p}else a.args=[],a.command=Su(Eu);this.state.setValueAtIndex(t,a)};t(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&t(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter((e=>e instanceof hc))[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,n,r,i,s)=>{(0,o.iQ)(t.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return(0,o.iQ)(a,"htFiltersMenuLabel"),a.textContent=s,t.appendChild(a),t.parentElement.hasAttribute("ghost-table")||(0,h.z0)(this.elements,(e=>t.appendChild(e.element))),t}}}reset(){const e=this.hot.getTranslatedPhrase(Ee.FILTERS_VALUES_BLANK_CELLS),t=this._getColumnVisibleValues(),n=t.map((e=>e.value)),r=new Map(t.map((e=>[e.value,e.meta]))),o=jh(n),i=zh(o,o,e,(e=>{gc(wc,this,bc).call(this,e,r)}));this.getMultipleSelectElement().setItems(i),super.reset(),this.getMultipleSelectElement().setValue(o);const s=this.hot.getPlugin("filters").getSelectedColumn();null!==s&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,s.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return null===e?[]:(0,h.YD)(this.hot.getDataAtCol(e.visualIndex),((t,n)=>({value:Wh(t),meta:this.hot.getCellMeta(n,e.visualIndex)})))}}function _c(e){(0,m.m0)(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),(0,i.CA)(e))}function bc(e,t){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(e.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",e.visualValue,t.get(e.value)))}function Sc(e,t){return"numeric"===t.type?Tt(e,t):e}var Cc=new WeakSet;class Ec extends vu{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,t){var n,r;super(e,{id:t.id,stateless:!0}),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,r=Cc),r.add(n),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"name",""),this.name=t.name,this.elements.push(new eh(this.hot,{type:"button",value:Ee.FILTERS_BUTTONS_OK,className:"htUIButton htUIButtonOK",identifier:Ec.BUTTON_OK})),this.elements.push(new eh(this.hot,{type:"button",value:Ee.FILTERS_BUTTONS_CANCEL,className:"htUIButton htUIButtonCancel",identifier:Ec.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){(0,h.z0)(this.elements,(e=>{e.addLocalHook("click",((e,t)=>function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(Cc,this,Mc).call(this,e,t)))}))}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>((0,o.iQ)(t.parentNode,"htFiltersMenuActionBar"),(0,h.z0)(this.elements,(e=>t.appendChild(e.element))),t)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}function Mc(e,t){t.options.identifier===yc.BUTTON_OK?this.accept():this.cancel()}function Tc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}yc=Ec;const Rc="ConditionCollection.filteringStates";class Ac{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Tc(this,"hot",void 0),Tc(this,"isMapRegistrable",void 0),Tc(this,"filteringStates",new eo.z),this.hot=e,this.isMapRegistrable=t,!0===this.isMapRegistrable?this.hot.columnIndexMapper.registerMap(Rc,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return 0===this.getFilteredColumns().length}isMatch(e,t){var n;const r=this.filteringStates.getValueAtIndex(t),o=null!==(n=null==r?void 0:r.conditions)&&void 0!==n?n:[],i=null==r?void 0:r.operation;return this.isMatchInConditions(o,e,i)}isMatchInConditions(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh;return!e.length||function(e){if(!Ch[e])throw Error(`Operation with id "${e}" does not exist.`);const t=Ch[e].func;return function(e,n){return t(e,n)}}(n)(e,t)}addCondition(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh,r=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,i=t.args.map((e=>"string"==typeof e?e.toLocaleLowerCase(o):e)),s=t.name||t.command.key;this.runLocalHooks("beforeAdd",e);const a=this.getOperation(e);if(a){if(a!==n)throw Error(yo.O`The column of index ${e} has been already applied with a \`${a}\`\x20 filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20 Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20 use it consequently for a particular column).`)}else if((0,c.b0)(Ch[n]))throw new Error(yo.O`Unexpected operation named \`${n}\`. Possible ones are\x20 \`disjunction\` and \`conjunction\`.`);const l=this.getConditions(e);0===l.length?this.filteringStates.setValueAtIndex(e,{operation:n,conditions:[{name:s,args:i,func:bu(s,i)}]},r):l.push({name:s,args:i,func:bu(s,i)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var t,n;return null!==(t=null===(n=this.filteringStates.getValueAtIndex(e))||void 0===n?void 0:n.conditions)&&void 0!==t?t:[]}getOperation(e){var t;return null===(t=this.filteringStates.getValueAtIndex(e))||void 0===t?void 0:t.operation}getFilteredColumns(){return this.filteringStates.getEntries().map((e=>{let[t]=e;return t}))}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce(((e,t)=>{let[n,{operation:r,conditions:o}]=t;return e.push({column:n,operation:r,conditions:o.map((e=>{let{name:t,args:n}=e;return{name:t,args:[...n]}}))}),e}),[])}importAllConditions(e){this.clean(),e.forEach((e=>{e.conditions.forEach((t=>this.addCondition(e.column,t)))}))}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,t){const n=this.getConditions(e);return t?n.some((e=>e.name===t)):n.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(Rc),this.filteringStates=null,this.clearLocalHooks()}}(0,s.co)(Ac,Zo.A);const Nc=Ac;function Lc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xc=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>[];Lc(this,"conditionCollection",void 0),Lc(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=t}filter(){let e=[];return(0,h.z0)(this.conditionCollection.getFilteredColumns(),((t,n)=>{let r=this.columnDataFactory(t);n&&(r=this._getIntersectData(r,e)),e=this.filterByColumn(t,r)})),e}filterByColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[];return(0,h.z0)(t,(t=>{void 0!==t&&this.conditionCollection.isMatch(t,e)&&n.push(t)})),n}_getIntersectData(e,t){const n=[];return(0,h.z0)(t,(t=>{const r=t.meta.visualRow;void 0!==e[r]&&(n[r]=e[r])})),n}};function Oc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ic(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var kc=new WeakSet;class Dc{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[];var r,o;(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(r=this,o=kc),o.add(r),Oc(this,"hot",void 0),Oc(this,"conditionCollection",void 0),Oc(this,"columnDataFactory",void 0),Oc(this,"changes",[]),Oc(this,"grouping",!1),Oc(this,"latestEditedColumnPosition",-1),Oc(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=t,this.columnDataFactory=n,this.conditionCollection.addLocalHook("beforeRemove",(e=>Ic(kc,this,Pc).call(this,e))),this.conditionCollection.addLocalHook("afterRemove",(e=>this.updateStatesAtColumn(e))),this.conditionCollection.addLocalHook("afterAdd",(e=>this.updateStatesAtColumn(e))),this.conditionCollection.addLocalHook("beforeClean",(()=>Ic(kc,this,Hc).call(this))),this.conditionCollection.addLocalHook("afterClean",(()=>Ic(kc,this,Fc).call(this)))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,(0,h.z0)(this.changes,(e=>{this.updateStatesAtColumn(e)})),this.changes.length=0}updateStatesAtColumn(e,t){var n=this;if(this.grouping)return void(-1===this.changes.indexOf(e)&&this.changes.push(e));const r=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);-1===o&&(o=this.latestEditedColumnPosition);const i=r.slice(0,o),s=r.slice(o);s.length&&s[0].column===e&&s.shift();const a=(0,g.cF)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=new Nc(n.hot,!1),i=[].concat(e,r);o.importAllConditions(i);const s=n.columnDataFactory(t);let a;a=o.isEmpty()?s:new xc(o,(e=>n.columnDataFactory(e))).filter(),a=(0,h.YD)(a,(e=>e.meta.visualRow));const l=Bh(a);return o.destroy(),(0,h.y0)(s,(e=>l(e.meta.visualRow)))}))(i),l=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:l},dependentConditionStacks:s,filteredRowsFactory:a,conditionArgsChange:t})}destroy(){this.clearLocalHooks(),(0,s.v4)(this,((e,t)=>{this[t]=null}))}}function Pc(e){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(e)}function Hc(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Fc(){(0,h.z0)(this.latestOrderStack,(e=>{this.updateStatesAtColumn(e)}))}(0,s.co)(Dc,Zo.A);const Yc=Dc,Vc="filters";var Uc=n(41496);function Bc(e,t,n){Wc(e,t),t.set(e,n)}function Wc(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zc(e,t,n){return e.set($c(e,t),n),n}function Gc(e,t){return e.get($c(e,t))}function $c(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Kc="filters",Xc=Kc;var qc=new WeakMap,Qc=new WeakMap,Jc=new WeakMap,Zc=new WeakSet;class ed extends hn{static get PLUGIN_KEY(){return Kc}static get PLUGIN_PRIORITY(){return 250}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var t,n;super(e),t=this,Wc(this,n=Zc),n.add(this),jc(this,"dropdownMenuPlugin",null),jc(this,"conditionCollection",null),jc(this,"conditionUpdateObserver",null),jc(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),jc(this,"filtersRowsMap",null),Bc(this,qc,void 0),Bc(this,Qc,new WeakSet),Bc(this,Jc,[]),this.hot.addHook("afterGetColHeader",(function(){for(var e=arguments.length,n=new Array(e),r=0;r(e.addLocalHook("accept",(()=>$c(Zc,this,sd).call(this,"accept"))),e.addLocalHook("cancel",(()=>$c(Zc,this,sd).call(this,"cancel"))),e.addLocalHook("change",(t=>$c(Zc,this,ad).call(this,e,t))),e),i=()=>`${this.hot.getTranslatedPhrase(Ee.FILTERS_DIVS_FILTER_BY_CONDITION)}:`;if(!this.components.get("filter_by_condition")){const e=new _h(this.hot,{id:"filter_by_condition",name:i,addSeparator:!1,menuContainer:n});e.addLocalHook("afterClose",(()=>$c(Zc,this,ld).call(this))),this.components.set("filter_by_condition",r(e))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Yh(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const e=new _h(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:n});e.addLocalHook("afterClose",(()=>$c(Zc,this,ld).call(this))),this.components.set("filter_by_condition2",r(e))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",r(new vc(this.hot,{id:"filter_by_value",name:()=>`${this.hot.getTranslatedPhrase(Ee.FILTERS_DIVS_FILTER_BY_VALUE)}:`}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",r(new Ec(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new Nc(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new Yc(this.hot,this.conditionCollection,(e=>this.getDataMapAtColumn(e))),this.conditionUpdateObserver.addLocalHook("update",(e=>$c(Zc,this,hd).call(this,e)))),this.components.forEach((e=>e.show())),this.addHook("afterDropdownMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;r$c(Zc,this,od).call(this))),this.addHook("afterDropdownMenuShow",(()=>$c(Zc,this,nd).call(this))),this.addHook("afterDropdownMenuHide",(()=>$c(Zc,this,rd).call(this))),this.addHook("afterChange",(e=>$c(Zc,this,td).call(this,e))),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Gc(qc,this)&&this.dropdownMenuPlugin.enabled){const e=[{focus:()=>{const e=Gc(qc,this).getMenu(),t=e.getNavigator(),n=Gc(qc,this).getLastMenuPage();e.focus(),n>0?t.setCurrentPage(n):t.toFirstItem()}},...Array.from(this.components).map((e=>{let[,t]=e;return t.getElements()})).flat()];zc(qc,this,function(e,t){let n,r=-1;const i=(s=t,Bs({initialPage:0,size:()=>s.length,onItemSelect:(e,t)=>{const n=s[e];return n instanceof hc?t:!(n.element&&!(0,o.zN)(n.element))&&void n.focus()}}));var s;const a=e=>()=>{n.isOpened()&&n.getKeyboardShortcutsCtrl().listen(Vc),i.setCurrentPage(t.indexOf(e))};function l(e){const o=n.getKeyboardShortcutsCtrl(),s=e.getKeyboardShortcutsCtrl();i.clear(),s.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:o.getContext(Vc),callback:()=>{e.isSubMenu()&&e.close(),o.listen(Vc)}}]),e.isSubMenu()||o.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{const t=n.getNavigator();t.getCurrentPage()>-1&&(r=t.getCurrentPage()),t.clear(),e.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{n.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:e=>{const n=t[i.getCurrentPage()];n instanceof mh&&(n.openOptions(),e.preventDefault()),n instanceof qh&&(n.activate(),e.preventDefault()),n instanceof Ku||e.preventDefault()}}],Vc)}function u(e){e.addLocalHook("afterSelectionChange",(e=>{e.key.startsWith("filter_")||i.clear()})),e.addLocalHook("afterSubmenuOpen",l),e.addLocalHook("afterOpen",l),n=e}return t.forEach((e=>{e instanceof Ku&&(e.addLocalHook("click",a(e)),e.addLocalHook("focus",a(e)),e.addLocalHook("afterClose",a(e)))})),u(e),{...i,listen:function(){n.focus(),n.getKeyboardShortcutsCtrl().listen(Vc)},setMenu:u,getMenu:function(){return n},getLastMenuPage:function(){return r}}}(this.dropdownMenuPlugin.menu,e));const t=e=>{Gc(qc,this).listen(),e.preventDefault(),(0,m.m0)(e.keyCode,"TAB")&&(e.shiftKey?Gc(qc,this).toPreviousItem():Gc(qc,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",t),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",t)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){var e;this.enabled&&(null!==(e=this.dropdownMenuPlugin)&&void 0!==e&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach(((e,t)=>{e.destroy(),this.components.set(t,null)})),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:Xc})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Xc)}addCondition(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mh;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:t},args:n},r)}removeConditions(e){const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}clearConditions(e){if(void 0===e)this.conditionCollection.clean();else{const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),t=this._createDataFilter(),n=!this.conditionCollection.isEmpty();let r=[];const o=this.exportConditions(),i=this.hot.runHooks("beforeFilter",o,Gc(Jc,this));if(!1!==i&&n){const n=[];this.hot.batchExecution((()=>{this.filtersRowsMap.clear(),r=(0,h.YD)(t.filter(),(e=>e.meta.visualRow));const e=Bh(r);(0,Mt.Ti)(this.hot.countSourceRows()-1,(t=>{e(t)||n.push(t)})),(0,h.z0)(n,(e=>{this.filtersRowsMap.setValueAtIndex(e,!0)}))}),!0),e||r.length||this.hot.deselectCell(),zc(Jc,this,this.exportConditions())}else!1===i||n?this.importConditions(Gc(Jc,this)):(zc(Jc,this,this.exportConditions()),this.filtersRowsMap.clear());this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),!1!==i&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t?{visualIndex:t.col,physicalIndex:this.hot.toPhysicalColumn(t.col)}:null}getDataMapAtColumn(e){const t=this.hot.toVisualColumn(e),n=[];return(0,h.z0)(this.hot.getSourceDataAtCol(t),((e,r)=>{var o;const{row:i,col:s,visualCol:a,visualRow:l,type:u,instance:h,dateFormat:c,locale:d}=this.hot.getCellMeta(r,t),m=null!==(o=this.hot.getDataAtCell(this.hot.toVisualRow(r),t))&&void 0!==o?o:e;n.push({meta:{row:i,col:s,visualCol:a,visualRow:l,type:u,instance:h,dateFormat:c,locale:d},value:Wh(m)})})),n}updateValueComponentCondition(e){const t=jh(this.hot.getDataAtCol(e));this.conditionUpdateObserver.updateStatesAtColumn(e,t)}restoreComponents(e){var t;const n=null===(t=this.getSelectedColumn())||void 0===t?void 0:t.physicalIndex;e.forEach((e=>{e.isHidden()||e.restoreState(n)})),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,t,n,r){let o=e;return o===Rh&&t.command.key!==Eu&&n.command.key!==Eu&&r.command.key!==Eu?o=Nh:r.command.key!==Eu&&(t.command.key!==Eu&&n.command.key!==Eu||(o=Mh)),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:t}=e.getState(),n=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];t.showOperators?this.showComponents(...n):this.hideComponents(...n)}_createDataFilter(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.conditionCollection;return new xc(e,(e=>this.getDataMapAtColumn(e)))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const t=this.dropdownMenuPlugin.menu;for(var n=arguments.length,r=new Array(n),o=0;o{(0,h.z0)(t.menuItems,((t,r)=>{t.key===n.getMenuItemDescriptor().key&&e.push(r)}))})),e}changeComponentsVisibility(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.dropdownMenuPlugin)return;const t=this.dropdownMenuPlugin.menu.hotMenu,n=t.getPlugin("hiddenRows");for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i{null!==e&&(e.destroy(),this.components.set(t,null))})),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function td(e){e&&(0,h.z0)(e,(e=>{const[,t]=e,n=this.hot.propToCol(t);this.conditionCollection.hasConditions(n)&&this.updateValueComponentCondition(n)}))}function nd(){const e=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),e.updateMenuDimensions()}function rd(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function od(){const e=this.dropdownMenuPlugin.menu;Gc(Qc,this).has(e)||Gc(qc,this).setMenu(e),Gc(Qc,this).add(e)}function id(e){e.items.push({name:Ri}),this.components.forEach((t=>{e.items.push(t.getMenuItemDescriptor())}))}function sd(e){var t;if("accept"===e){const e=this.getSelectedColumn();var n;if(null===e)return void(null===(n=this.dropdownMenuPlugin)||void 0===n||n.close());const{physicalIndex:t}=e,r=this.components.get("filter_by_condition").getState(),o=this.components.get("filter_by_condition2").getState(),i=this.components.get("filter_by_value").getState(),s=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),r,o,i);this.conditionUpdateObserver.groupChanges();let a=this.conditionCollection.getColumnStackPosition(t);-1===a&&(a=void 0),this.conditionCollection.removeConditions(t),r.command.key!==Eu&&(this.conditionCollection.addCondition(t,r,s,a),o.command.key!==Eu&&this.conditionCollection.addCondition(t,o,s,a)),i.command.key!==Eu&&this.conditionCollection.addCondition(t,i,s,a),this.conditionUpdateObserver.flush(),this.components.forEach((e=>e.saveState(t))),this.filter()}null===(t=this.dropdownMenuPlugin)||void 0===t||t.close()}function ad(e,t){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),e.constructor!==_h||t.inputsCount||this.setListeningDropdownMenu(),n.updateMenuDimensions()}function ld(){this.setListeningDropdownMenu()}function ud(e,t,n){const r=this.hot.toPhysicalColumn(e);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?(0,o.iQ)(t,"htFiltersActive"):(0,o.vy)(t,"htFiltersActive")}function hd(e){var t;if(null===(t=this.dropdownMenuPlugin)||void 0===t||!t.enabled)return;const{editedConditionStack:{conditions:n,column:r},conditionArgsChange:o}=e;Array.isArray(o)&&zc(Jc,this,Gc(Jc,this).map((e=>(e.column===r&&n.length>0&&e.conditions.forEach((e=>{"by_value"===e.name&&(e.args=[[...o]])})),e))));const i=n.filter((e=>e.name===fc)),s=n.filter((e=>e.name!==fc));if(i.length>=2||s.length>=3)(0,Dr.R8)(yo.O`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20 The overall amount of conditions exceed the capability of the dropdown menu.\x20 For more details see the documentation.`);else{const t=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(s[0],r),this.components.get("filter_by_condition2").updateState(s[1],r),this.components.get("filter_operators").updateState(t,r),this.components.get("filter_by_value").updateState(e)}}n(33110);const cd="internal-use-in-handsontable",dd={licenseKey:cd,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function md(e){var t;return{maxColumns:e.maxColumns,maxRows:e.maxRows,language:null===(t=e[tm])||void 0===t||null===(t=t.language)||void 0===t?void 0:t.langCode}}function pd(e){return Object.keys(e).reduce(((t,n)=>("hyperformula"!==n&&(t[n]=e[n]),t)),{})}function fd(){const e="engine_relationship",t=(0,so.A)(tm);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function gd(){const e="shared_engine_usage",t=(0,so.A)(tm);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function yd(e){var t;const n=fd(),r=0===n.size?[]:Array.from(null!==(t=n.get(e))&&void 0!==t?t:[]);return new Map(r.map((e=>[e.getPlugin("formulas").sheetId,e])))}function wd(e,t){if(e){const n=fd(),r=n.get(e),o=gd(),i=o.get(e);r&&r.includes(t)&&(r.splice(r.indexOf(t),1),0===r.length&&n.delete(e)),i&&i.includes(t.guid)&&(i.splice(i.indexOf(t.guid),1),0===i.length&&(o.delete(e),e.destroy()))}}const vd="DD/MM/YYYY";function _d(e,t){return"string"==typeof e&&"date"===t}function bd(e,t){return N(e,t,!0).isValid()}function Sd(e,t){return N(e,t,!0).format(vd)}function Cd(e,t){const n=new Date(Date.UTC(0,0,e+-1));return N(n).format(t)}function Ed(e,t,n){const r=function(e,t){const n=[];return e.forEach((e=>{const r={from:e,to:t};n.forEach((e=>{const t=e.from>e.to,n=e.to<=r.from;e.from>r.from&&n&&t&&(r.from+=1)})),r.from>=t&&(t+=1),n.push(r)})),n}(e,function(e,t,n){const r=Array.from(Array(n).keys()).filter((t=>!1===e.includes(t)));var o;return 0===t?null!==(o=r[t])&&void 0!==o?o:0:r[t-1]+1}(e,t,n));return function(e){return e.forEach(((t,n)=>{e.slice(n+1).forEach((e=>{const n=e.fromt.from&&n&&(e.from-=1)}))})),e}(r)}function Md(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function Td(e,t){return e.get(Ad(e,t))}function Rd(e,t,n){return e.set(Ad(e,t),n),n}function Ad(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Nd=new WeakMap,Ld=new WeakMap,xd=new WeakMap,Od=new WeakMap,Id=new WeakMap,kd=new WeakMap,Dd=new WeakMap;const Pd=class{constructor(e,t,n){Md(this,Nd,void 0),Md(this,Ld,void 0),Md(this,xd,void 0),Md(this,Od,[]),Md(this,Id,[]),Md(this,kd,void 0),Md(this,Dd,[]),Rd(Nd,this,e),Rd(Ld,this,t),Rd(xd,this,n)}setRemovedHfIndexes(e){return Rd(Dd,this,e.map((e=>{const t=Td(Ld,this).getVisualFromPhysicalIndex(e);return this.getHfIndexFromVisualIndex(t)}))),Td(Dd,this)}getRemovedHfIndexes(){return Td(Dd,this)}getHfIndexFromVisualIndex(e){const t=Td(Ld,this).getIndexesSequence(),n=Td(Ld,this).getNotTrimmedIndexes();return t.indexOf(n[e],e)}syncMoves(e){const t=`move${(0,d.Ob)(Td(Nd,this))}s`;Td(xd,this).getEngine().batch((()=>{e.forEach((e=>{const n=e.from!==e.to,r=e.from+1!==e.to;n&&r&&Td(xd,this).getEngine()[t](Td(xd,this).getSheetId(),e.from,1,e.to)}))}))}storeMovesInformation(e,t,n){!1!==n&&(Rd(Id,this,e.map((e=>this.getHfIndexFromVisualIndex(e)))),Rd(kd,this,this.getHfIndexFromVisualIndex(t)))}calculateAndSyncMoves(e,t){if(Td(xd,this).isPerformingUndoRedo())return;if(!1===e||!1===t)return;const n=Ed(Td(Id,this),Td(kd,this),Td(Ld,this).getNumberOfIndexes());null===Td(xd,this).getSheetId()?Td(xd,this).getPostponeAction((()=>this.syncMoves(n))):this.syncMoves(n)}getIndexesChangeSyncMethod(){const e=`set${(0,d.Ob)(Td(Nd,this))}Order`;return t=>{if(Td(xd,this).isPerformingUndoRedo())return;const n=Td(Ld,this).getIndexesSequence();if("update"===t&&n.length>0){const t=Td(Od,this).map((e=>n.indexOf(e))),r=Td(xd,this).getEngine().getSheetDimensions(Td(xd,this).getSheetId());let o;o="row"===Td(Nd,this)?r.height:r.width;for(let e=t.length;e"UndoRedo.undo"===e||"UndoRedo.redo"===e||"auto"===e;var om=new WeakMap,im=new WeakMap,sm=new WeakMap,am=new WeakSet;class lm extends hn{constructor(){var e,t;super(...arguments),e=this,Qd(this,t=am),t.add(this),qd(this,om,!1),qd(this,im,!1),qd(this,sm,[["valuesUpdated",function(){for(var t=arguments.length,n=new Array(t),r=0;r{const{name:n,plugin:r,translations:o}=t;try{e.registerFunction(n,r,o)}catch(e){(0,Dr.R8)(e.message)}}))})(e,r.functions),function(e,t){if(t){const{langCode:n}=t;try{e.registerLanguage(n,t)}catch(e){(0,Dr.R8)(e.message)}}}(e,r.language);const a=e.buildEmpty(o);return i.set(a,[n]),s.set(a,[n.guid]),function(e,t){t&&(e.suspendEvaluation(),t.forEach((t=>{const{name:n,expression:r,scope:o,options:i}=t;try{e.addNamedExpression(n,r,o,i)}catch(e){(0,Dr.R8)(e.message)}})),e.resumeEvaluation())}(a,r.namedExpressions),a.on("sheetAdded",(()=>{a.rebuildAndRecalculate()})),a.on("sheetRemoved",(()=>{a.rebuildAndRecalculate()})),a}(null!==(o=r.hyperformula)&&void 0!==o?o:r,t,e);if("object"==typeof r&&(0,c.b0)(r.hyperformula)){const t=fd(),n=gd().get(r);return t.has(r)||t.set(r,[]),t.get(r).push(e),n&&n.push(e.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:cd}),r.getConfig().leapYear1900===dd.leapYear1900&&!1!==(0,s.wU)(r.getConfig().nullDate,dd.nullDate)||(0,Dr.R8)(yo.O`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\` settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}(this.hot))&&void 0!==e?e:this.engine,this.engine){if(null!==this.sheetName&&!this.engine.doesSheetExist(this.sheetName)){const e=this.addSheet(this.sheetName,this.hot.getSourceDataArray());!1!==e&&em(am,this,um).call(this,e)}this.addHook("beforeLoadData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r{this.hot.addHookOnce("init",(()=>{e()}))})),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",((e,t,n,r)=>{this.rowAxisSyncer.storeMovesInformation(e,t,r)})),this.hot.addHook("beforeColumnMove",((e,t,n,r)=>{this.columnAxisSyncer.storeMovesInformation(e,t,r)})),this.hot.addHook("afterRowMove",((e,t,n,r,o)=>{this.rowAxisSyncer.calculateAndSyncMoves(r,o)})),this.hot.addHook("afterColumnMove",((e,t,n,r,o)=>{this.columnAxisSyncer.calculateAndSyncMoves(r,o)})),this.hot.addHook("beforeColumnFreeze",((e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart,t)})),this.hot.addHook("afterColumnFreeze",((e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)})),this.hot.addHook("beforeColumnUnfreeze",((e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart-1,t)})),this.hot.addHook("afterColumnUnfreeze",((e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)})),this.addHook("afterCellMetaReset",(function(){for(var e=arguments.length,n=new Array(e),r=0;r{this.indexSyncer.setPerformUndo(!0),this.engine.undo()})),this.addHook("beforeRedo",(()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()})),this.addHook("afterUndo",(()=>{this.indexSyncer.setPerformUndo(!1)})),this.addHook("afterUndo",(()=>{this.indexSyncer.setPerformRedo(!1)})),this.addHook("afterDetachChild",(function(){for(var e=arguments.length,n=new Array(e),r=0;r{let[t,n]=e;return this.engine.on(t,n)})),super.enablePlugin()}else(0,Dr.R8)("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.")}disablePlugin(){Zd(sm,this).forEach((e=>{let[t,n]=e;return this.engine.off(t,n)})),wd(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const t=function(e){var t;const n=e[tm];return{...pd(null!=n&&null!==(t=n.engine)&&void 0!==t&&t.hyperformula?n.engine:{}),...md(e)}}(this.hot.getSettings());(function(e,t){return Object.keys(t).some((n=>void 0!==t[n]&&t[n]!==e[n]))})(this.engine.getConfig(),t)&&this.engine.updateConfig(t);const n=this.hot.getSettings()[tm];if((0,c.O9)(n)&&(0,c.O9)(n.sheetName)&&n.sheetName!==this.sheetName&&this.switchSheet(n.sheetName),!e.data&&null===this.sheetName){const e=this.hot.getSettings()[tm].sheetName;if(e&&this.engine.doesSheetExist(e))this.switchSheet(this.sheetName);else{const t=this.addSheet(null!=e?e:void 0,this.hot.getSourceDataArray());em(am,this,um).call(this,t)}}super.updatePlugin(e)}destroy(){Zd(sm,this).forEach((e=>{var t;let[n,r]=e;return null===(t=this.engine)||void 0===t?void 0:t.off(n,r)})),Jd(sm,this,null),wd(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,t){if((0,c.O9)(t)&&!(0,Gh.ZI)(t))return(0,Dr.R8)("The provided data should be an array of arrays."),!1;if(null!=e&&this.engine.doesSheetExist(e))return(0,Dr.R8)("Sheet with the provided name already exists."),!1;try{const n=this.engine.addSheet(null!=e?e:void 0);return t&&this.engine.setSheetContent(this.engine.getSheetId(n),t),n}catch(e){return(0,Dr.R8)(e.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e))return void(0,Dr.z3)(`The sheet named \`${e}\` does not exist, switch aborted.`);em(am,this,um).call(this,e);const t=this.engine.getSheetSerialized(this.sheetId);t.length>0&&this.hot.loadData(t,`${(0,d.Ob)(tm)}.switchSheet`)}getCellType(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;const r=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(t);return null!==r&&null!==o?this.engine.getCellType({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)}):"EMPTY"}isFormulaCellType(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)})}renderDependentSheets(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=new Set;e.forEach((e=>{var t;const r=null==e||null===(t=e.address)||void 0===t?void 0:t.sheet;void 0!==r&&(n.has(r)||n.add(r))})),yd(this.engine).forEach(((e,r)=>{var o;(t||r!==this.sheetId)&&n.has(r)&&(e.render(),null===(o=e.view)||void 0===o||o.adjustElementsSize())}))}validateDependentCells(e){const t=e=>{var t;const{row:n,col:r,sheet:o}=null!==(t=null==e?void 0:e.address)&&void 0!==t?t:{};return(0,c.O9)(o)?`${o}:${n}x${r}`:""},n=new Set((arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map((e=>t(e))));e.forEach((e=>{var r,o;const{row:i,col:s}=null!==(r=e.address)&&void 0!==r?r:{};if(!1===(0,c.O9)(i)||!1===(0,c.O9)(s)||i>=this.hot.countRows()||s>=this.hot.countCols())return;const a=null==e||null===(o=e.address)||void 0===o?void 0:o.sheet,l=t(e);if(void 0!==a&&!n.has(l)){const e=yd(this.engine).get(a);if(!e)return;e.validateCell(e.getDataAtCell(i,s),e.getCellMeta(i,s),(()=>{}))}}))}syncChangeWithEngine(e,t,n){const r={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(r))return void(0,Dr.R8)(`Not possible to set cell data at ${JSON.stringify(r)}`);const o=this.hot.getCellMeta(e,t);var i;return _d(n,o.type)&&(bd(n,o.dateFormat)?n=Sd(n,o.dateFormat):!1===("string"==typeof(i=n)&&i.startsWith("="))&&(n=`'${n}`)),this.engine.setCellContents(r,n)}}function um(e){this.sheetName=e,this.sheetId=this.engine.getSheetId(this.sheetName)}function hm(e,t,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(t,r)){const e={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},n=this.hot.getCellMeta(t,r);let o=this.engine.getCellValue(e);return"date"===n.type&&(0,Mt.kf)(o)&&(o=Cd(o,n.dateFormat)),"object"==typeof o&&null!==o?o.value:o}return e}function cm(e,t,n){const{row:r,col:o}=t.getTopStartCorner(),{row:i,col:s}=t.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:u,col:h}=n.getBottomEndCorner(),c={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(h),sheet:this.sheetId}};if(!1===this.engine.isItPossibleToSetCellContents(d))return!1;const m=this.engine.getFillRangeData(c,d),{row:p,col:f}=c.start,{row:g,col:y}=c.end,w=g-p+1,v=y-f+1;for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:"").includes((0,d.Ob)(tm))||Jd(im,this,(0,c.b0)(this.hot.getSettings().data))}function mm(){if(Zd(im,this))return void this.switchSheet(this.sheetName);const e=this.hot.getSourceDataArray();e.forEach(((t,n)=>{t.forEach(((t,r)=>{const o=this.hot.getCellMeta(n,r,{skipMetaExtension:!0}),i=o.dateFormat;_d(t,o.type)&&(bd(t,i)?e[n][r]=Sd(t,i):t.startsWith("=")||(e[n][r]=`'${t}`))}))})),Jd(om,this,!0);const t=this.engine.setSheetContent(this.sheetId,e);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(t),Jd(om,this,!1)}function pm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n.includes((0,d.Ob)(tm)))return;const r=function(e,t){return!(0,c.b0)(t)&&e.doesSheetExist(t)||(t=e.addSheet(t)),t}(this.engine,this.hot.getSettings()[tm].sheetName);if(em(am,this,um).call(this,r),"updateSettings"!==n)if(Zd(im,this))this.switchSheet(this.sheetName);else{const e=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,e)){Jd(om,this,!0);const t=this.engine.setSheetContent(this.sheetId,e);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(t),Jd(om,this,!1)}}}function fm(e,t,n,r){if("get"!==r||Zd(om,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;const o=this.hot.toVisualRow(e);if(null===o||null===t)return;const i=this.getCellType(o,t);if("VALUE"===i||"EMPTY"===i)return void(n.value=(s=n.value,function(e){return"string"==typeof e&&"'"===e.charAt(0)&&"="===e.charAt(1)}(s)?s.substr(1):s));var s;const a={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};let l=this.engine.getCellValue(a);const u=this.hot.getCellMeta(o,t,{skipMetaExtension:!0});"date"===u.type&&(0,Mt.kf)(l)&&(l=Cd(l,u.dateFormat)),n.value="object"==typeof l&&null!==l?l.value:l}function gm(e,t,n,r){if("get"!==r||Zd(om,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;const o=this.hot.toVisualRow(e),i=this.hot.propToCol(t);if(null===o||null===i)return;const s=this.getCellType(o,i);if("VALUE"===s||"EMPTY"===s)return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(0===a.width&&0===a.height)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function ym(e,t){if(rm(t))return;const n=[],r=[],o=this.engine.batch((()=>{e.forEach((e=>{let[t,o,,i]=e;const s=this.hot.propToCol(o),a=this.hot.toPhysicalRow(t),l=this.hot.toPhysicalColumn(s),u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};null!==a&&null!==l?this.syncChangeWithEngine(t,s,i):n.push([t,s,i]),r.push({address:u})}))}));n.length&&this.hot.addHookOnce("afterChange",(()=>{const e=this.engine.batch((()=>{n.forEach((e=>{let[t,n,r]=e;this.syncChangeWithEngine(t,n,r)}))}));this.renderDependentSheets(e,!0)})),this.renderDependentSheets(o),this.validateDependentCells(o,r)}function wm(e,t){if(rm(t))return;const n=[],r=[];e.forEach((e=>{let[t,o,,i]=e;const s=this.hot.propToCol(o);if(!(0,Mt.kf)(s))return;const a={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};this.engine.isItPossibleToSetCellContents(a)?(r.push({address:a}),n.push(...this.engine.setCellContents(a,i))):(0,Dr.R8)(`Not possible to set source cell data at ${JSON.stringify(a)}`)})),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function vm(e,t){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countRows()&&(n=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,t]))return!1}function _m(e,t){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countCols()&&(n=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,t]))return!1}function bm(e,t,n){return!1!==this.rowAxisSyncer.setRemovedHfIndexes(n).every((e=>this.engine.isItPossibleToRemoveRows(this.sheetId,[e,1])))&&void 0}function Sm(e,t,n){return!1!==this.columnAxisSyncer.setRemovedHfIndexes(n).every((e=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[e,1])))&&void 0}function Cm(e,t,n){if(rm(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(r)}function Em(e,t,n){if(rm(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(r)}function Mm(e,t,n,r){if(rm(r))return;const o=this.rowAxisSyncer.getRemovedHfIndexes().sort(((e,t)=>t-e)),i=this.engine.batch((()=>{o.forEach((e=>{this.engine.removeRows(this.sheetId,[e,1])}))}));this.renderDependentSheets(i)}function Tm(e,t,n,r){if(rm(r))return;const o=this.columnAxisSyncer.getRemovedHfIndexes().sort(((e,t)=>t-e)),i=this.engine.batch((()=>{o.forEach((e=>{this.engine.removeColumns(this.sheetId,[e,1])}))}));this.renderDependentSheets(i)}function Rm(e,t,n){var r;Jd(om,this,!0);const o=this.hot.getSourceDataArray(n,0,n+((null===(r=t.__children)||void 0===r?void 0:r.length)||0),this.hot.countSourceCols());Jd(om,this,!1),o.forEach(((e,t)=>{e.forEach(((e,r)=>{this.engine.setCellContents({col:r,row:n+t,sheet:this.sheetId},[[e]])}))}))}function Am(e){this.hot.runHooks("afterFormulasValuesUpdate",e)}function Nm(e,t){this.hot.runHooks("afterNamedExpressionAdded",e,t)}function Lm(e,t){this.hot.runHooks("afterNamedExpressionRemoved",e,t)}function xm(e){this.hot.runHooks("afterSheetAdded",e)}function Om(e,t){em(am,this,um).call(this,t),this.hot.runHooks("afterSheetRenamed",e,t)}function Im(e,t){this.hot.runHooks("afterSheetRemoved",e,t)}var km=n(52246);function Dm(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pm(e,t){return e.get(Fm(e,t))}function Hm(e,t,n){return e.set(Fm(e,t),n),n}function Fm(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("beforeHideColumns"),Ce.R.getSingleton().register("afterHideColumns"),Ce.R.getSingleton().register("beforeUnhideColumns"),Ce.R.getSingleton().register("afterUnhideColumns");const Ym="hiddenColumns";var Vm=new WeakMap,Um=new WeakSet;class Bm extends hn{constructor(){var e;super(...arguments),Dm(this,e=Um),e.add(this),function(e,t){Dm(e,t),t.set(e,null)}(this,Vm)}static get PLUGIN_KEY(){return Ym}static get PLUGIN_PRIORITY(){return 310}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[Ym]}enablePlugin(){var e=this;this.enabled||(Hm(Vm,this,new km.o),Pm(Vm,this).addLocalHook("init",(()=>Fm(Um,this,Km).call(this))),this.hot.columnIndexMapper.registerMap(this.pluginName,Pm(Vm,this)),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;rFm(Um,this,jm).call(this,e,t,n))),this.addHook("modifyColWidth",((e,t)=>Fm(Um,this,Wm).call(this,e,t)),2),this.addHook("afterGetColHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;rFm(Um,this,zm).call(this,e))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const t=this.getHiddenColumns(),n=this.isValidConfig(e);let r=t;const o=Pm(Vm,this).getValues().slice(),i=e.length>0;if(n&&i){const t=e.map((e=>this.hot.toPhysicalColumn(e)));(0,h.z0)(t,(e=>{o[e]=!1})),r=(0,h.mu)(o,((e,t,n)=>(t&&e.push(this.hot.toVisualColumn(n)),e)),[])}!1!==this.hot.runHooks("beforeUnhideColumns",t,r,n&&i)&&(n&&i&&Pm(Vm,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",t,r,n&&i,n&&r.length{(0,h.z0)(e,(e=>{Pm(Vm,this).setValueAtIndex(this.hot.toPhysicalColumn(e),!0)}))}),!0),this.hot.runHooks("afterHideColumns",t,r,n,n&&r.length>t.length))}hideColumn(){for(var e=arguments.length,t=new Array(e),n=0;nthis.hot.toVisualColumn(e)))}isHidden(e){return Pm(Vm,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const t=this.hot.countCols();return!!(Array.isArray(e)&&e.length>0)&&e.every((e=>Number.isInteger(e)&&e>=0&&e{e.skipColumnOnPaste=!1}))}destroy(){Hm(Vm,this,null),super.destroy()}}function Wm(e,t){return this.isHidden(t)?0:this.getSetting("indicators")&&(this.isHidden(t+1)||this.isHidden(t-1))&&"number"==typeof e&&this.hot.hasColHeaders()?e+15:void 0}function jm(e,t,n){if(!1===this.getSetting("copyPasteEnabled")&&this.isHidden(t)&&(n.skipColumnOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",-1===n.className.indexOf("afterHiddenColumn")&&(n.className+=" afterHiddenColumn");else if(n.className){const e=n.className.split(" ");if(e.length>0){const t=e.indexOf("afterHiddenColumn");t>-1&&e.splice(t,1),n.className=e.join(" ")}}}function zm(e){if(this.getSetting("copyPasteEnabled"))return e;const t=[],n=(e,n,r,o)=>{t.push({startRow:e,endRow:n,startCol:r,endCol:o})};return(0,h.z0)(e,(e=>{let t=!0,r=0;(0,Mt.Ti)(e.startCol,e.endCol,(o=>{this.isHidden(o)?(t||n(e.startRow,e.endRow,r,o-1),t=!0):(t&&(r=o),o===e.endCol&&n(e.startRow,e.endRow,r,o),t=!1)}))})),t}function Gm(e,t){if(!this.getSetting("indicators")||e<0)return;const n=[];e>=1&&this.isHidden(e-1)&&n.push("afterHiddenColumn"),e=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}),function(e){const t=[];return{key:"hidden_columns_show",name(){const e=t.length>1?1:0;return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_SHOW_COLUMN,e)},callback(){var n,r;if(0===t.length)return;let o=t[0],i=t[t.length-1];o=null!==(n=this.columnIndexMapper.getNearestNotHiddenIndex(o-1,-1))&&void 0!==n?n:0,i=null!==(r=this.columnIndexMapper.getNearestNotHiddenIndex(i+1,1))&&void 0!==r?r:this.countCols()-1,e.showColumns(t),this.render(),this.view.adjustElementsSize(),i-o+1===this.countCols()||this.selectColumns(o,i)},disabled:!1,hidden(){const n=(0,h.YD)(e.getHiddenColumns(),(e=>this.toPhysicalColumn(e)));if(!this.selection.isSelectedByColumnHeader()&&!this.selection.isSelectedByCorner()||n.length<1)return!0;t.length=0;const r=this.getSelectedRangeLast(),o=r.getTopStartCorner().col,i=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(o),l=s.getRenderableFromVisualIndex(i),u=s.getNotTrimmedIndexes(),c=[];if(o!==i){if(i-o+1>l-a+1){const e=u.slice(o,i+1);c.push(...e.filter((e=>n.includes(e))))}}else if(0===a&&ai&&c.push(...u.slice(i+1))}return(0,h.z0)(c,(e=>{t.push(this.toVisualColumn(e))})),0===t.length}}}(this))}function Km(){const e=this.getSetting("columns");Array.isArray(e)&&this.hideColumns(e)}function Xm(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qm(e,t){return e.get(Jm(e,t))}function Qm(e,t,n){return e.set(Jm(e,t),n),n}function Jm(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("beforeHideRows"),Ce.R.getSingleton().register("afterHideRows"),Ce.R.getSingleton().register("beforeUnhideRows"),Ce.R.getSingleton().register("afterUnhideRows");const Zm="hiddenRows";var ep=new WeakMap,tp=new WeakSet;class np extends hn{constructor(){var e;super(...arguments),Xm(this,e=tp),e.add(this),function(e,t){Xm(e,t),t.set(e,null)}(this,ep)}static get PLUGIN_KEY(){return Zm}static get PLUGIN_PRIORITY(){return 320}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[Zm]}enablePlugin(){var e=this;this.enabled||(Qm(ep,this,new km.o),qm(ep,this).addLocalHook("init",(()=>Jm(tp,this,lp).call(this))),this.hot.rowIndexMapper.registerMap(this.pluginName,qm(ep,this)),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;rJm(tp,this,op).call(this,e,t,n))),this.addHook("modifyRowHeight",((e,t)=>Jm(tp,this,rp).call(this,e,t))),this.addHook("afterGetRowHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;rJm(tp,this,ip).call(this,e))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const t=this.getHiddenRows(),n=this.isValidConfig(e);let r=t;const o=qm(ep,this).getValues().slice(),i=e.length>0;if(n&&i){const t=e.map((e=>this.hot.toPhysicalRow(e)));(0,h.z0)(t,(e=>{o[e]=!1})),r=(0,h.mu)(o,((e,t,n)=>(t&&e.push(this.hot.toVisualRow(n)),e)),[])}!1!==this.hot.runHooks("beforeUnhideRows",t,r,n&&i)&&(n&&i&&qm(ep,this).setValues(o),this.hot.runHooks("afterUnhideRows",t,r,n&&i,n&&r.length{(0,h.z0)(e,(e=>{qm(ep,this).setValueAtIndex(this.hot.toPhysicalRow(e),!0)}))}),!0),this.hot.runHooks("afterHideRows",t,r,n,n&&r.length>t.length))}hideRow(){for(var e=arguments.length,t=new Array(e),n=0;nthis.hot.toVisualRow(e)))}isHidden(e){return qm(ep,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const t=this.hot.countRows();return!!(Array.isArray(e)&&e.length>0)&&e.every((e=>Number.isInteger(e)&&e>=0&&e{e.skipRowOnPaste=!1}))}destroy(){Qm(ep,this,null),super.destroy()}}function rp(e,t){return this.isHidden(t)?0:e}function op(e,t,n){if(!1===this.getSetting("copyPasteEnabled")&&this.isHidden(e)&&(n.skipRowOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",-1===n.className.indexOf("afterHiddenRow")&&(n.className+=" afterHiddenRow");else if(n.className){const e=n.className.split(" ");if(e.length>0){const t=e.indexOf("afterHiddenRow");t>-1&&e.splice(t,1),n.className=e.join(" ")}}}function ip(e){if(this.getSetting("copyPasteEnabled"))return e;const t=[],n=(e,n,r,o)=>{t.push({startRow:e,endRow:n,startCol:r,endCol:o})};return(0,h.z0)(e,(e=>{let t=!0,r=0;(0,Mt.Ti)(e.startRow,e.endRow,(o=>{this.isHidden(o)?(t||n(r,o-1,e.startCol,e.endCol),t=!0):(t&&(r=o),o===e.endRow&&n(r,o,e.startCol,e.endCol),t=!1)}))})),t}function sp(e,t){if(!this.getSetting("indicators")||e<0)return;const n=[];e>=1&&this.isHidden(e-1)&&n.push("afterHiddenRow"),e=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}),function(e){const t=[];return{key:"hidden_rows_show",name(){const e=t.length>1?1:0;return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_SHOW_ROW,e)},callback(){var n,r;if(0===t.length)return;let o=t[0],i=t[t.length-1];o=null!==(n=this.rowIndexMapper.getNearestNotHiddenIndex(o-1,-1))&&void 0!==n?n:0,i=null!==(r=this.rowIndexMapper.getNearestNotHiddenIndex(i+1,1))&&void 0!==r?r:this.countRows()-1,e.showRows(t),this.render(),this.view.adjustElementsSize(),i-o+1===this.countRows()||this.selectRows(o,i)},disabled:!1,hidden(){const n=(0,h.YD)(e.getHiddenRows(),(e=>this.toPhysicalRow(e)));if(!this.selection.isSelectedByRowHeader()&&!this.selection.isSelectedByCorner()||n.length<1)return!0;t.length=0;const r=this.getSelectedRangeLast(),o=r.getTopStartCorner().row,i=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(o),l=s.getRenderableFromVisualIndex(i),u=s.getNotTrimmedIndexes(),c=[];if(o!==i){if(i-o+1>l-a+1){const e=u.slice(o,i+1);c.push(...e.filter((e=>n.includes(e))))}}else if(0===a&&ai&&c.push(...u.slice(i+1))}return(0,h.z0)(c,(e=>{t.push(this.toVisualRow(e))})),0===t.length}}}(this))}function lp(){const e=this.getSetting("rows");Array.isArray(e)&&this.hideRows(e)}function up(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hp(e,t){return e.get(dp(e,t))}function cp(e,t,n){return e.set(dp(e,t),n),n}function dp(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("beforeColumnFreeze"),Ce.R.getSingleton().register("afterColumnFreeze"),Ce.R.getSingleton().register("beforeColumnUnfreeze"),Ce.R.getSingleton().register("afterColumnUnfreeze");const mp="manualColumnFreeze";var pp=new WeakMap,fp=new WeakSet;class gp extends hn{constructor(){var e;super(...arguments),up(this,e=fp),e.add(this),function(e,t){up(e,t),t.set(e,!1)}(this,pp)}static get PLUGIN_KEY(){return mp}static get PLUGIN_PRIORITY(){return 110}isEnabled(){return!!this.hot.getSettings()[mp]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",(e=>dp(fp,this,yp).call(this,e))),this.addHook("beforeColumnMove",((e,t)=>dp(fp,this,wp).call(this,e,t))),super.enablePlugin())}disablePlugin(){cp(pp,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const t=this.hot.getSettings(),n=t.fixedColumnsStartt.fixedColumnsStart-1;hp(pp,this)||cp(pp,this,!0),!1!==this.hot.runHooks("beforeColumnFreeze",e,n)&&(n&&(this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart),t._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,n))}unfreezeColumn(e){const t=this.hot.getSettings(),n=t.fixedColumnsStart>0&&e<=t.fixedColumnsStart-1;hp(pp,this)||cp(pp,this,!0),!1!==this.hot.runHooks("beforeColumnUnfreeze",e,n)&&(n&&(t._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,n))}}function yp(e){var t;e.items.push({name:"---------"},(t=this,{key:"freeze_column",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_FREEZE_COLUMN)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let t=!1;return(void 0===e||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(t=!0),t}}),function(e){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN)},callback(t,n){const[{start:{col:r}}]=n;e.unfreezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let t=!1;return(void 0===e||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(t=!0),t}}}(this))}function wp(e,t){if(hp(pp,this)){const n=this.hot.getSettings().fixedColumnsStart;if(te=1}setPosition(e,t){(0,Mt.kf)(e)&&(this._element.style.top=e+_p),(0,Mt.kf)(t)&&(this._element.style[this.inlineProperty]=t+_p)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,t){(0,Mt.kf)(e)&&(this._element.style.width=e+_p),(0,Mt.kf)(t)&&(this._element.style.height=t+_p)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,t){(0,Mt.kf)(e)&&(this._element.style.marginTop=e+_p),(0,Mt.kf)(t)&&(this._element.style[`margin${(0,d.Ob)(this.inlineProperty)}`]=t+_p)}getOffset(){const e=this._element.style,t=`margin${(0,d.Ob)(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[t]?parseInt(e[t],10):0}}},Sp=class extends bp{build(){super.build(),(0,o.iQ)(this._element,"ht__manualColumnMove--backlight")}},Cp=class extends bp{build(){super.build(),(0,o.iQ)(this._element,"ht__manualColumnMove--guideline")}};function Ep(e,t,n){Mp(e,t),t.set(e,n)}function Mp(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tp(e,t,n){return e.set(Ap(e,t),n),n}function Rp(e,t){return e.get(Ap(e,t))}function Ap(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("beforeColumnMove"),Ce.R.getSingleton().register("afterColumnMove");const Np="manualColumnMove",Lp="ht__manualColumnMove",xp="show-ui",Op="on-moving--columns",Ip="after-selection--columns";var kp=new WeakMap,Dp=new WeakMap,Pp=new WeakMap,Hp=new WeakMap,Fp=new WeakMap,Yp=new WeakMap,Vp=new WeakMap,Up=new WeakMap,Bp=new WeakMap,Wp=new WeakMap,jp=new WeakMap,zp=new WeakSet;class Gp extends hn{constructor(){var e;super(...arguments),Mp(this,e=zp),e.add(this),Ep(this,kp,new Sp(this.hot)),Ep(this,Dp,new Cp(this.hot)),Ep(this,Pp,[]),Ep(this,Hp,0),Ep(this,Fp,!1),Ep(this,Yp,{}),Ep(this,Vp,void 0),Ep(this,Up,void 0),Ep(this,Bp,void 0),Ep(this,Wp,void 0),Ep(this,jp,void 0)}static get PLUGIN_KEY(){return Np}static get PLUGIN_PRIORITY(){return 120}isEnabled(){return!!this.hot.getSettings()[Np]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;rAp(zp,this,Qp).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rn,o=t<0,i=e.some((e=>e<0)),s=e.some((e=>e>=n));return!(r||o||i||s)}isColumnOrderChanged(e,t){return e.some(((e,n)=>e-n!==t))}countFinalIndex(e,t){const n=(0,h.mu)(e,((e,n)=>(n{n.push(e)})),n}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(Rp(Up,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const t=this.hot.view._wt.wtTable,n=this.hot.view._wt.wtOverlays.scrollableElement,r="number"==typeof n.scrollX?n.scrollX:n.scrollLeft;let i=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,Rp(Up,this)-1);const s=t.hider.offsetWidth,a=t.TBODY.offsetLeft,l=Rp(kp,this).getOffset().start,u=Rp(kp,this).getSize().width;let h=0,c=0;if(this.hot.isRtl()){const e=this.hot.rootWindow,t=(0,o.Gq)(this.hot.rootElement),i=e.innerWidth-Rp(Bp,this)-t;c=e.innerWidth-Rp(Yp,this).eventPageX-i-(void 0===n.scrollX?r:0)}else c=Rp(Yp,this).eventPageX-(Rp(Bp,this)-(void 0===n.scrollX?r:0));if(Rp(Wp,this)&&(h=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(Rp(Up,this))&&(i+=r),i+=h,Rp(Up,this)<0)Rp(jp,this)>0?Rp(Yp,this).col=0:Rp(Yp,this).col=e>0?e-1:e;else if(Rp(Yp,this).TD.offsetWidth/2+i<=c){const e=Rp(Up,this)>=Rp(Hp,this)?Rp(Hp,this)-1:Rp(Up,this);Rp(Yp,this).col=e+1,i+=Rp(Yp,this).TD.offsetWidth}else Rp(Yp,this).col=Rp(Up,this);let d=c,m=i;c+u+l>=s?d=s-u-l:c+l=s-1?m=s-1:0===m?m=1:void 0!==n.scrollX&&Rp(Up,this)Ap(zp,this,Kp).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>Ap(zp,this,qp).call(this)))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Rp(kp,this).build(),Rp(Dp,this).build()}destroy(){Rp(kp,this).destroy(),Rp(Dp,this).destroy(),super.destroy()}}function $p(e,t,n,r){const s=this.hot.view._wt.wtTable,a=this.hot.selection.isSelectedByColumnHeader(),l=this.hot.getSelectedRangeLast(),u=(0,o.nB)(e.target,"sortAction");if(!l||!a||Rp(Fp,this)||0!==e.button||u)return Tp(Fp,this,!1),Rp(Pp,this).length=0,void(0,o.vy)(this.hot.rootElement,[Op,xp]);const h=Rp(Dp,this).isBuilt()&&!Rp(Dp,this).isAppended(),c=Rp(kp,this).isBuilt()&&!Rp(kp,this).isAppended();h&&c&&(Rp(Dp,this).appendTo(s.hider),Rp(kp,this).appendTo(s.hider));const{from:d,to:m}=l,p=Math.min(d.col,m.col),f=Math.max(d.col,m.col);if(t.row<0&&t.col>=p&&t.col<=f){r.column=!0,Tp(Fp,this,!0);const a=n.firstChild?(0,i.zg)(e,n.firstChild).x:e.offsetX;Rp(Yp,this).eventPageX=e.pageX,Tp(Up,this,t.col),Rp(Yp,this).TD=n,Rp(Yp,this).col=t.col,Tp(Pp,this,this.prepareColumnsToMoving(p,f)),Tp(Wp,this,!!this.hot.getSettings().rowHeaders),Tp(Hp,this,this.hot.countCols()),Tp(jp,this,this.hot.getSettings().fixedColumnsStart),Tp(Bp,this,(0,o.cY)(this.hot.rootElement).left);const l=Rp(Wp,this)?-1:0,u=s.holder.scrollTop+s.getColumnHeaderHeight(0)+1,h=t.col-1?(0,o.vy)(this.hot.rootElement,xp):(0,o.iQ)(this.hot.rootElement,xp),r.row=!0,r.column=!0,r.cell=!0,Tp(Up,this,t.col),Rp(Yp,this).TD=n)}function qp(){const e=Rp(Yp,this).col,t=Rp(Pp,this).length;if(Tp(Up,this,void 0),Tp(Fp,this,!1),(0,o.vy)(this.hot.rootElement,[Op,xp,Ip]),this.hot.selection.isSelectedByColumnHeader()&&(0,o.iQ)(this.hot.rootElement,Ip),t<1||void 0===e)return;const n=Rp(Pp,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(Rp(Pp,this),e);if(Rp(Pp,this).length=0,!0===i){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const e=this.hot.toVisualColumn(r),n=e+t-1;this.hot.selectColumns(e,n)}}function Qp(){const e=this.hot.view._wt.wtTable,t=e.getColumnHeaderHeight(0)+1+e.holder.scrollTop;Rp(kp,this).setPosition(t),Rp(kp,this).setSize(null,e.hider.offsetHeight-t)}function Jp(){this.moveBySettingsOrLoad()}function Zp(e,t,n){ef(e,t),t.set(e,n)}function ef(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tf(e,t,n){return e.set(rf(e,t),n),n}function nf(e,t){return e.get(rf(e,t))}function rf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const of="manualColumnResize",sf="manualColumnWidths";var af=new WeakMap,lf=new WeakMap,uf=new WeakMap,hf=new WeakMap,cf=new WeakMap,df=new WeakMap,mf=new WeakMap,pf=new WeakMap,ff=new WeakMap,gf=new WeakMap,yf=new WeakMap,wf=new WeakMap,vf=new WeakMap,_f=new WeakMap,bf=new WeakMap,Sf=new WeakMap,Cf=new WeakSet;class Ef extends hn{static get PLUGIN_KEY(){return of}static get PLUGIN_PRIORITY(){return 130}constructor(e){var t;super(e),ef(this,t=Cf),t.add(this),Zp(this,af,null),Zp(this,lf,null),Zp(this,uf,[]),Zp(this,hf,null),Zp(this,cf,null),Zp(this,df,null),Zp(this,mf,null),Zp(this,pf,null),Zp(this,ff,this.hot.rootDocument.createElement("DIV")),Zp(this,gf,this.hot.rootDocument.createElement("DIV")),Zp(this,yf,null),Zp(this,wf,!1),Zp(this,vf,0),Zp(this,_f,null),Zp(this,bf,void 0),Zp(this,Sf,void 0),(0,o.iQ)(nf(ff,this),"manualColumnResizer"),(0,o.iQ)(nf(gf,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[of]}enablePlugin(){var e=this;this.enabled||(tf(bf,this,new vn._),nf(bf,this).addLocalHook("init",(()=>rf(Cf,this,Mf).call(this))),this.hot.columnIndexMapper.registerMap(this.pluginName,nf(bf,this)),this.addHook("modifyColWidth",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{const t=e.getTopStartCorner().col,n=e.getBottomEndCorner().col;(0,Mt.Ti)(t,n,(e=>{nf(uf,this).includes(e)||nf(uf,this).push(e)}))}))}nf(uf,this).includes(nf(lf,this))||tf(uf,this,[nf(lf,this)]),tf(pf,this,a.start-6),tf(mf,this,parseInt(s.width,10)),nf(ff,this).style.top=`${a.top}px`,nf(ff,this).style[this.inlineDir]=`${nf(pf,this)+nf(mf,this)}px`,nf(ff,this).style.height=`${i}px`,this.hot.rootElement.appendChild(nf(ff,this))}refreshHandlePosition(){nf(ff,this).style[this.inlineDir]=`${nf(pf,this)+nf(hf,this)}px`}setupGuidePosition(){const e=parseInt((0,o.DK)(nf(ff,this)),10),t=parseInt(nf(ff,this).style.top,10)+e,n=this.hot.view.getTableHeight();(0,o.iQ)(nf(ff,this),"active"),(0,o.iQ)(nf(gf,this),"active"),nf(gf,this).style.top=`${t}px`,this.refreshGuidePosition(),nf(gf,this).style.height=n-e+"px",this.hot.rootElement.appendChild(nf(gf,this))}refreshGuidePosition(){nf(gf,this).style[this.inlineDir]=nf(ff,this).style[this.inlineDir]}hideHandleAndGuide(){(0,o.vy)(nf(ff,this),"active"),(0,o.vy)(nf(gf,this),"active")}checkIfColumnHeader(e){const t=(0,o.kp)(e,["THEAD"],this.hot.rootElement),{topOverlay:n,topInlineStartCornerOverlay:r}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.THEAD,r.clone.wtTable.THEAD].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},t=(t,n)=>{const r=this.hot.runHooks("beforeColumnResize",nf(cf,this),t,!0);void 0!==r&&tf(cf,this,r),this.setManualSize(t,nf(cf,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",nf(cf,this),t,!0),n&&e()};nf(vf,this)>=2&&(nf(uf,this).length>1?((0,h.z0)(nf(uf,this),(e=>{t(e)})),e()):(0,h.z0)(nf(uf,this),(e=>{t(e,!0)}))),tf(vf,this,0),tf(_f,this,null)}bindEvents(){const{rootWindow:e,rootElement:t}=this.hot;this.eventManager.addEventListener(t,"mouseover",(e=>rf(Cf,this,Tf).call(this,e))),this.eventManager.addEventListener(t,"mousedown",(e=>rf(Cf,this,Rf).call(this,e))),this.eventManager.addEventListener(e,"mousemove",(e=>rf(Cf,this,Af).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>rf(Cf,this,Nf).call(this))),this.eventManager.addEventListener(nf(ff,this),"contextmenu",(()=>rf(Cf,this,Lf).call(this)))}destroy(){super.destroy()}}function Mf(){const e=this.hot.getSettings()[of],t=this.loadManualColumnWidths();void 0!==t?this.hot.batchExecution((()=>{t.forEach(((e,t)=>{nf(bf,this).setValueAtIndex(t,e)}))}),!0):Array.isArray(e)?(this.hot.batchExecution((()=>{e.forEach(((e,t)=>{nf(bf,this).setValueAtIndex(t,e)}))}),!0),tf(Sf,this,e)):!0===e&&Array.isArray(nf(Sf,this))&&this.hot.batchExecution((()=>{nf(Sf,this).forEach(((e,t)=>{nf(bf,this).setValueAtIndex(t,e)}))}),!0)}function Tf(e){if(!(0,o.$w)(e.target)&&!0!==nf(wf,this)&&this.checkIfColumnHeader(e.target)){const t=this.getClosestTHParent(e.target);if(!t)return;const n=t.getAttribute("colspan");!t||null!==n&&"1"!==n||nf(yf,this)||this.setupHandlePosition(t)}}function Rf(e){e.target.parentNode===this.hot.rootElement&&(0,o.nB)(e.target,"manualColumnResizer")&&(this.setupHandlePosition(nf(af,this)),this.setupGuidePosition(),tf(yf,this,!0),null===nf(_f,this)&&(tf(_f,this,setTimeout((()=>this.afterMouseDownTimeout()),500)),this.hot._registerTimeout(nf(_f,this))),tf(vf,this,nf(vf,this)+1),this.startX=e.pageX,tf(cf,this,nf(mf,this)))}function Af(e){if(nf(yf,this)){const t=(e.pageX-this.startX)*this.hot.getDirectionFactor();tf(hf,this,nf(mf,this)+t),(0,h.z0)(nf(uf,this),(e=>{tf(cf,this,this.setManualSize(e,nf(hf,this)))})),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Nf(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},t=(t,n)=>{this.hot.runHooks("beforeColumnResize",nf(cf,this),t,!1),n&&e(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",nf(cf,this),t,!1)};nf(yf,this)&&(this.hideHandleAndGuide(),tf(yf,this,!1),nf(cf,this)!==nf(mf,this)&&(nf(uf,this).length>1?((0,h.z0)(nf(uf,this),(e=>{t(e)})),e()):(0,h.z0)(nf(uf,this),(e=>{t(e,!0)}))),this.setupHandlePosition(nf(af,this)))}function Lf(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(nf(ff,this)),this.hot.rootElement.removeChild(nf(gf,this)),tf(yf,this,!1),tf(wf,this,!0),this.hot._registerImmediate((()=>{tf(wf,this,!1)}))}function xf(e,t){let n=e;if(this.enabled){const e=this.hot.toPhysicalColumn(t),r=nf(bf,this).getValueAtIndex(e);this.hot.getSettings()[of]&&r&&(n=r)}return n}function Of(e,t){const n=nf(bf,this).getValueAtIndex(this.hot.toPhysicalColumn(t));return"number"==typeof n?n:e}function If(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function kf(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Df="px",Pf=class{constructor(e){kf(this,"hot",void 0),kf(this,"_element",null),kf(this,"state",0),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=2}build(){0===this.state&&(this._element=this.hot.rootDocument.createElement("div"),this.state=1)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=0}isAppended(){return 2===this.state}isBuilt(){return this.state>=1}setPosition(e,t){void 0!==e&&(this._element.style.top=e+Df),void 0!==t&&(this._element.style.left=t+Df)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,t){e&&(this._element.style.width=e+Df),t&&(this._element.style.height=t+Df)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,t){e&&(this._element.style.marginTop=e+Df),t&&(this._element.style.marginLeft=t+Df)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}},Hf=class extends Pf{build(){super.build(),(0,o.iQ)(this._element,"ht__manualRowMove--backlight")}},Ff=class extends Pf{build(){super.build(),(0,o.iQ)(this._element,"ht__manualRowMove--guideline")}};function Yf(e,t,n){Vf(e,t),t.set(e,n)}function Vf(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uf(e,t,n){return e.set(Wf(e,t),n),n}function Bf(e,t){return e.get(Wf(e,t))}function Wf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ce.R.getSingleton().register("beforeRowMove"),Ce.R.getSingleton().register("afterRowMove");const jf="manualRowMove",zf="ht__manualRowMove",Gf="show-ui",$f="on-moving--rows",Kf="after-selection--rows";var Xf=new WeakMap,qf=new WeakMap,Qf=new WeakMap,Jf=new WeakMap,Zf=new WeakMap,eg=new WeakMap,tg=new WeakSet;class ng extends hn{constructor(){var e;super(...arguments),Vf(this,e=tg),e.add(this),Yf(this,Xf,new Hf(this.hot)),Yf(this,qf,new Ff(this.hot)),Yf(this,Qf,[]),Yf(this,Jf,void 0),Yf(this,Zf,{}),Yf(this,eg,void 0)}static get PLUGIN_KEY(){return jf}static get PLUGIN_PRIORITY(){return 140}isEnabled(){return!!this.hot.getSettings()[jf]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;rWf(tg,this,ag).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rn,o=t<0,i=e.some((e=>e<0)),s=e.some((e=>e>=n));return!(r||o||i||s)}isRowOrderChanged(e,t){return e.some(((e,n)=>e-n!==t))}countFinalIndex(e,t){const n=(0,h.mu)(e,((e,n)=>(nthis.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),t=[];if(!e)return t;const{from:n,to:r}=e,o=Math.min(n.row,r.row),i=Math.max(n.row,r.row);return(0,Mt.Ti)(o,i,(e=>{t.push(e)})),t}refreshPositions(){const e=Bf(Zf,this).coords,t=this.hot.getFirstFullyVisibleRow(),n=this.hot.getLastFullyVisibleRow(),r=this.hot.countRows();this.isFixedRowTop(e.row)&&t>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(t-1,-1)),this.isFixedRowBottom(e.row)&&n=_+w;this.isFixedRowTop(e.row)&&(_+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Bf(Zf,this).row=t>0?t-1:t:b?(Bf(Zf,this).row=e.row+1,_+=0===e.row?v-1:v):Bf(Zf,this).row=e.row;let S=m,C=_;m+y+g>=p?S=p-y-g:m+g=p-1&&(C=p-1),Bf(Xf,this).setPosition(S),Bf(qf,this).setPosition(C)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",(e=>Wf(tg,this,og).call(this,e))),this.eventManager.addEventListener(e,"mouseup",(()=>Wf(tg,this,sg).call(this)))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Bf(Xf,this).build(),Bf(qf,this).build()}destroy(){Bf(Xf,this).destroy(),Bf(qf,this).destroy(),super.destroy()}}function rg(e,t,n,r){const{wtTable:i,wtViewport:s}=this.hot.view._wt,a=this.hot.selection.isSelectedByRowHeader(),l=this.hot.getSelectedRangeLast();if(!l||!a||Bf(Jf,this)||0!==e.button)return Uf(Jf,this,!1),Bf(Qf,this).length=0,void(0,o.vy)(this.hot.rootElement,[$f,Gf]);const u=Bf(qf,this).isBuilt()&&!Bf(qf,this).isAppended(),h=Bf(Xf,this).isBuilt()&&!Bf(Xf,this).isAppended();u&&h&&(Bf(qf,this).appendTo(i.hider),Bf(Xf,this).appendTo(i.hider));const{from:c,to:d}=l,m=Math.min(c.row,d.row),p=Math.max(c.row,d.row);if(t.col<0&&t.row>=m&&t.row<=p){r.row=!0,Uf(Jf,this,!0),Bf(Zf,this).eventPageY=e.pageY,Bf(Zf,this).coords=t,Bf(Zf,this).TD=n,Uf(Qf,this,this.prepareRowsToMoving());const a=i.holder.scrollLeft+s.getRowHeaderWidth(),l=this.getRowsHeight(m,t.row-1)+(e.clientY-n.getBoundingClientRect().top);Bf(Xf,this).setPosition(null,a),Bf(Xf,this).setSize(i.hider.offsetWidth-a,this.getRowsHeight(m,p)),Bf(Xf,this).setOffset(-l,null),(0,o.iQ)(this.hot.rootElement,$f),this.refreshPositions()}else(0,o.vy)(this.hot.rootElement,Kf),Uf(Jf,this,!1),Bf(Qf,this).length=0}function og(e){Bf(Jf,this)&&(Bf(Zf,this).eventPageY=e.pageY,this.refreshPositions())}function ig(e,t,n,r){this.hot.getSelectedRangeLast()&&Bf(Jf,this)&&(Bf(Qf,this).indexOf(t.row)>-1?(0,o.vy)(this.hot.rootElement,Gf):(0,o.iQ)(this.hot.rootElement,Gf),r.row=!0,r.column=!0,r.cell=!0,Bf(Zf,this).coords=t,Bf(Zf,this).TD=n)}function sg(){const e=Bf(Zf,this).row,t=Bf(Qf,this).length;if(Uf(Jf,this,!1),(0,o.vy)(this.hot.rootElement,[$f,Gf,Kf]),this.hot.selection.isSelectedByRowHeader()&&(0,o.iQ)(this.hot.rootElement,Kf),t<1||void 0===e)return;const n=Bf(Qf,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Bf(Qf,this),e);if(Bf(Qf,this).length=0,!0===i){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const e=this.hot.toVisualRow(r),n=e+t-1;this.hot.selectRows(e,n)}}function ag(){const e=this.hot.view._wt.wtTable,t=this.hot.view._wt.wtViewport.getRowHeaderWidth()+e.holder.scrollLeft;Bf(Xf,this).setPosition(null,t),Bf(Xf,this).setSize(e.hider.offsetWidth-t)}function lg(){this.moveBySettingsOrLoad()}function ug(e,t,n){hg(e,t),t.set(e,n)}function hg(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cg(e,t,n){return e.set(mg(e,t),n),n}function dg(e,t){return e.get(mg(e,t))}function mg(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const pg="manualRowResize",fg="manualRowHeights";var gg=new WeakMap,yg=new WeakMap,wg=new WeakMap,vg=new WeakMap,_g=new WeakMap,bg=new WeakMap,Sg=new WeakMap,Cg=new WeakMap,Eg=new WeakMap,Mg=new WeakMap,Tg=new WeakMap,Rg=new WeakMap,Ag=new WeakMap,Ng=new WeakMap,Lg=new WeakMap,xg=new WeakMap,Og=new WeakSet;class Ig extends hn{static get PLUGIN_KEY(){return pg}static get PLUGIN_PRIORITY(){return 30}constructor(e){var t;super(e),hg(this,t=Og),t.add(this),ug(this,gg,null),ug(this,yg,null),ug(this,wg,[]),ug(this,vg,null),ug(this,_g,null),ug(this,bg,null),ug(this,Sg,null),ug(this,Cg,null),ug(this,Eg,this.hot.rootDocument.createElement("DIV")),ug(this,Mg,this.hot.rootDocument.createElement("DIV")),ug(this,Tg,!1),ug(this,Rg,!1),ug(this,Ag,0),ug(this,Ng,null),ug(this,Lg,void 0),ug(this,xg,void 0),(0,o.iQ)(dg(Eg,this),"manualRowResizer"),(0,o.iQ)(dg(Mg,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[pg]}enablePlugin(){this.enabled||(cg(Lg,this,new vn._),dg(Lg,this).addLocalHook("init",(()=>mg(Og,this,Vg).call(this))),this.hot.rowIndexMapper.registerMap(this.pluginName,dg(Lg,this)),this.addHook("modifyRowHeight",((e,t)=>mg(Og,this,Yg).call(this,e,t))),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){cg(xg,this,dg(Lg,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",fg,dg(Lg,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",fg,e),e.value}setManualSize(e,t){const n=this.hot.toPhysicalRow(e),r=Math.max(t,this.hot.view.getDefaultRowHeight());return dg(Lg,this).setValueAtIndex(n,r),r}getLastDesiredRowHeight(){return dg(vg,this)}setupHandlePosition(e){cg(gg,this,e);const{view:t}=this.hot,{_wt:n}=t,r=n.wtTable.getCoords(dg(gg,this)),i=r.row;if(i<0)return;const s=(0,o.Gq)(dg(gg,this)),a=dg(gg,this).getBoundingClientRect(),l=i=t.countNotHiddenRowIndexes(0,1)-n.getSetting("fixedRowsBottom");let c;l?c=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(dg(gg,this),r.row,r.col):u&&(c=n.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(dg(gg,this),r.row,r.col)),c||(c=n.wtOverlays.inlineStartOverlay.getRelativeCellPosition(dg(gg,this),r.row,r.col)),cg(yg,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(i)),cg(wg,this,[]);const d=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&d){const e=this.hot.getSelectedRange();(0,h.z0)(e,(e=>{const t=e.getTopStartCorner().row,n=e.getBottomStartCorner().row;(0,Mt.Ti)(t,n,(e=>{dg(wg,this).includes(e)||dg(wg,this).push(e)}))}))}dg(wg,this).includes(dg(yg,this))||cg(wg,this,[dg(yg,this)]),cg(Cg,this,c.top-6),cg(Sg,this,parseInt(a.height,10)),dg(Eg,this).style.top=`${dg(Cg,this)+dg(Sg,this)}px`,dg(Eg,this).style[this.inlineDir]=`${c.start}px`,dg(Eg,this).style.width=`${s}px`,this.hot.rootElement.appendChild(dg(Eg,this))}refreshHandlePosition(){dg(Eg,this).style.top=`${dg(Cg,this)+dg(vg,this)}px`}setupGuidePosition(){const e=parseInt((0,o.Gq)(dg(Eg,this)),10),t=parseInt(dg(Eg,this).style[this.inlineDir],10)+e,n=this.hot.view.getTableWidth();(0,o.iQ)(dg(Eg,this),"active"),(0,o.iQ)(dg(Mg,this),"active"),dg(Mg,this).style.top=dg(Eg,this).style.top,dg(Mg,this).style[this.inlineDir]=`${t}px`,dg(Mg,this).style.width=n-e+"px",this.hot.rootElement.appendChild(dg(Mg,this))}refreshGuidePosition(){dg(Mg,this).style.top=dg(Eg,this).style.top}hideHandleAndGuide(){(0,o.vy)(dg(Eg,this),"active"),(0,o.vy)(dg(Mg,this),"active")}checkIfRowHeader(e){const t=(0,o.kp)(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.TBODY,r.clone.wtTable.TBODY,i.clone.wtTable.TBODY].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const t=this.hot.view._wt.wtTable.getRowHeight(e);return void 0!==t&&dg(_g,this){this.hot.render(),this.hot.view.adjustElementsSize()},t=(t,n)=>{const r=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!0);void 0!==r&&cg(_g,this,r),this.setManualSize(t,dg(_g,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!0),n&&e()};dg(Ag,this)>=2&&(dg(wg,this).length>1?((0,h.z0)(dg(wg,this),(e=>{t(e)})),e()):(0,h.z0)(dg(wg,this),(e=>{t(e,!0)}))),cg(Ag,this,0),cg(Ng,this,null)}bindEvents(){const{rootElement:e,rootWindow:t}=this.hot;this.eventManager.addEventListener(e,"mouseover",(e=>mg(Og,this,kg).call(this,e))),this.eventManager.addEventListener(e,"mousedown",(e=>mg(Og,this,Dg).call(this,e))),this.eventManager.addEventListener(t,"mousemove",(e=>mg(Og,this,Pg).call(this,e))),this.eventManager.addEventListener(t,"mouseup",(()=>mg(Og,this,Hg).call(this))),this.eventManager.addEventListener(dg(Eg,this),"contextmenu",(()=>mg(Og,this,Fg).call(this)))}destroy(){super.destroy()}}function kg(e){if(!(0,o.$w)(e.target)&&!0!==dg(Rg,this)&&this.checkIfRowHeader(e.target)){const t=this.getClosestTHParent(e.target);t&&(dg(Tg,this)||this.setupHandlePosition(t))}}function Dg(e){(0,o.nB)(e.target,"manualRowResizer")&&(this.setupHandlePosition(dg(gg,this)),this.setupGuidePosition(),cg(Tg,this,!0),null===dg(Ng,this)&&(cg(Ng,this,setTimeout((()=>this.afterMouseDownTimeout()),500)),this.hot._registerTimeout(dg(Ng,this))),cg(Ag,this,dg(Ag,this)+1),cg(bg,this,e.pageY),cg(_g,this,dg(Sg,this)))}function Pg(e){dg(Tg,this)&&(cg(vg,this,dg(Sg,this)+(e.pageY-dg(bg,this))),(0,h.z0)(dg(wg,this),(e=>{cg(_g,this,this.setManualSize(e,dg(vg,this)))})),this.refreshHandlePosition(),this.refreshGuidePosition())}function Hg(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},t=(t,n)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!1),n&&e(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!1)};dg(Tg,this)&&(this.hideHandleAndGuide(),cg(Tg,this,!1),dg(_g,this)!==dg(Sg,this)&&(dg(wg,this).length>1?((0,h.z0)(dg(wg,this),(e=>{t(e)})),e()):(0,h.z0)(dg(wg,this),(e=>{t(e,!0)}))),this.setupHandlePosition(dg(gg,this)))}function Fg(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(dg(Eg,this)),this.hot.rootElement.removeChild(dg(Mg,this)),cg(Tg,this,!1),cg(Rg,this,!0),this.hot._registerImmediate((()=>{cg(Rg,this,!1)}))}function Yg(e,t){let n=e;if(this.enabled){const e=this.hot.toPhysicalRow(t),r=dg(Lg,this).getValueAtIndex(e);this.hot.getSettings()[pg]&&r&&(n=r)}return n}function Vg(){const e=this.hot.getSettings()[pg],t=this.loadManualRowHeights();this.hot.batchExecution((()=>{void 0!==t?t.forEach(((e,t)=>{dg(Lg,this).setValueAtIndex(t,e)})):Array.isArray(e)?(e.forEach(((e,t)=>{dg(Lg,this).setValueAtIndex(t,e)})),cg(xg,this,e)):!0===e&&Array.isArray(dg(xg,this))&&dg(xg,this).forEach(((e,t)=>{dg(Lg,this).setValueAtIndex(t,e)}))}),!0)}function Ug(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bg(e,t){return e.get(jg(e,t))}function Wg(e,t,n){return e.set(jg(e,t),n),n}function jg(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n(30237),n(30670);var zg=new WeakMap;const Gg=class{constructor(e,t,n,r,o,i){var s,a,l;Ug(this,"row",void 0),Ug(this,"col",void 0),Ug(this,"rowspan",void 0),Ug(this,"colspan",void 0),Ug(this,"removed",!1),Ug(this,"cellCoordsFactory",void 0),Ug(this,"cellRangeFactory",void 0),l=null,function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(s=this,a=zg),a.set(s,l),this.row=e,this.col=t,this.rowspan=n,this.colspan=r,this.cellCoordsFactory=o,this.cellRangeFactory=i}static NEGATIVE_VALUES_WARNING(e){let{row:t,col:n,rowspan:r,colspan:o}=e;return yo.O`The merged cell declared with {row: ${t}, col: ${n},\x20 rowspan: ${r}, colspan: ${o}} contains negative values, which is\x20 not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:t,col:n}=e;return yo.O`The merged cell declared at [${t}, ${n}] is positioned\x20 (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:t,col:n}=e;return yo.O`The merged cell declared at [${t}, ${n}] has both "rowspan"\x20 and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:t,col:n}=e;return yo.O`The merged cell declared at [${t}, ${n}] has "rowspan"\x20 or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:t,col:n,rowspan:r,colspan:o}=e;return t<0||n<0||r<0||o<0}static isSingleCell(e){let{rowspan:t,colspan:n}=e;return 1===n&&1===t}static containsZeroSpan(e){let{rowspan:t,colspan:n}=e;return 0===n||0===t}static isOutOfBounds(e,t,n){return e.row<0||e.col<0||e.row>=t||e.row+e.rowspan-1>=t||e.col>=n||e.col+e.colspan-1>=n}normalize(e){const t=e.countRows(),n=e.countCols();this.row<0?this.row=0:this.row>t-1&&(this.row=t-1),this.col<0?this.col=0:this.col>n-1&&(this.col=n-1),this.row+this.rowspan>t-1&&(this.rowspan=t-this.row),this.col+this.colspan>n-1&&(this.colspan=n-this.col),Wg(zg,this,null)}includes(e,t){return this.row<=e&&this.col<=t&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=t}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,t){const n=e[0]||e[1],r=t+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",i=e[0]?"col":"row",s=Math.min(t,r),a=Math.max(t,r),l=this[i],u=this[i]+this[o]-1;if(l>=t&&(this[i]+=n),n>0)t<=u&&t>l&&(this[o]+=n);else if(n<0){if(s<=l&&a>=u)return this.removed=!0,Wg(zg,this,null),!1;if(l>=s&&l<=a){const e=a-l+1,t=Math.abs(n)-e;this[i]-=t+n,this[o]-=e}else if(l<=s&&u>=a)this[o]+=n;else if(l<=s&&u>=s&&uthis.row:"right"===t?e.col+e.colspan-1this.col:null)}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return Bg(zg,this)||Wg(zg,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),Bg(zg,this)}};function $g(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kg(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Xg=new WeakSet;class qg{constructor(e){var t,n;(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t=this,n=Xg),n.add(t),$g(this,"plugin",void 0),$g(this,"mergedCells",[]),$g(this,"mergedCellsMatrix",new Map),$g(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:t,col:n}=e;return yo.O`The merged cell declared at [${t}, ${n}], overlaps\x20 with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20 fix your setup.`}get(e,t){var n;return!!this.mergedCellsMatrix.has(e)&&null!==(n=this.mergedCellsMatrix.get(e).get(t))&&void 0!==n&&n}getByRange(e){const{row:t,col:n}=e.getTopStartCorner(),{row:r,col:o}=e.getBottomEndCorner(),i=this.mergedCells.length;let s=!1;for(let e=0;e=t&&a+u-1<=r&&l>=n&&l+h-1<=o){s=i;break}}return s}filterOverlappingMergeCells(e){const t=new Set;return this.mergedCells.forEach((e=>{const{row:n,col:r,colspan:o,rowspan:i}=e;for(let e=n;e{const{row:n,col:r,colspan:o,rowspan:i}=e,s=new Set;let a=!1;for(let l=n;l1&&void 0!==arguments[1]&&arguments[1];const{row:n,col:r}=e.getTopStartCorner(),{row:o,col:i}=e.getBottomEndCorner(),s=[];for(let e=n;e<=o;e++)for(let n=r;n<=i;n++){const r=this.get(e,n);r&&(t||!t&&r.row===e&&r.col===n)&&s.push(r)}return s}add(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.row,r=e.col,o=e.rowspan,i=e.colspan,s=new Gg(n,r,o,i,this.hot._createCellCoords,this.hot._createCellRange),a=this.get(n,r),l=!t&&this.isOverlapping(s);return a||l?(l&&(0,Dr.R8)(qg.IS_OVERLAPPING_WARNING(s)),!1):(this.hot&&s.normalize(this.hot),this.mergedCells.push(s),Kg(Xg,this,Jg).call(this,s),s)}remove(e,t){const n=this.get(e,t),r=n?this.mergedCells.indexOf(n):-1;return!(!n||-1===r)&&(this.mergedCells.splice(r,1),Kg(Xg,this,Zg).call(this,n),n)}clear(){(0,h.z0)(this.mergedCells,(e=>{let{row:t,col:n,rowspan:r,colspan:o}=e;(0,Mt.Ti)(t,t+r,(e=>{(0,Mt.Ti)(n,n+o,(t=>{const n=this.hot.getCell(e,t);n&&(n.removeAttribute("rowspan"),n.removeAttribute("colspan"),n.style.display="")}))}))})),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const t=e.getRange();for(let e=0;e=t){r=n[e];break}return r}getTopMostRowIndex(e,t){const n=Kg(Xg,this,Qg).call(this,e,"row",-1);let r=t;for(let e=0;e=t){r=n[e];break}return r}shiftCollections(e,t,n){const r=[0,0];switch(e){case"right":r[0]+=n;break;case"left":r[0]-=n;break;case"down":r[1]+=n;break;case"up":r[1]-=n}const o=[];this.mergedCells.forEach((e=>{e.shift(r,t),e.removed&&o.push(e)})),o.forEach((e=>{this.mergedCells.splice(this.mergedCells.indexOf(e),1)})),this.mergedCellsMatrix.clear(),this.mergedCells.forEach((e=>{Kg(Xg,this,Jg).call(this,e)}))}}function Qg(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r=new Map,o=1===n?e.getTopStartCorner():e.getBottomEndCorner(),i=1===n?e.getBottomEndCorner():e.getTopStartCorner();for(let e=o.row;1===n?e<=i.row:e>=i.row;e+=n)for(let s=o.col;1===n?s<=i.col:s>=i.col;s+=n){const o="row"===t?e:s,i=this.get(e,s);let a=o;i&&(a=1===n?i[t]+i[`${t}span`]-1:i[t]),r.has(o)||r.set(o,new Set),r.get(o).add(a)}return Array.from(new Set(Array.from(r.entries()).filter((e=>{let[,t]=e;return 1===t.size})).flatMap((e=>{let[,t]=e;return Array.from(t)}))))}function Jg(e){for(let t=e.row;t-1?l-s+1:u-a+1,c=i-Math.floor(i/h)*h,d=this.getFarthestCollection(e,t,n,r);if(d)if("down"===n){const e=d.row+d.rowspan-s-c;o[2]+e>=this.plugin.hot.countRows()?o[2]-=c:o[2]+=c?e:0}else if("right"===n){const e=d.col+d.colspan-a-c;o[3]+e>=this.plugin.hot.countCols()?o[3]-=c:o[3]+=c?e:0}else if("up"===n){const e=l-c-d.row+1;o[0]+e<0?o[0]+=c:o[0]-=c?e:0}else if("left"===n){const e=u-c-d.col+1;o[1]+e<0?o[1]+=c:o[1]-=c?e:0}return this.updateCurrentFillCache({baseArea:e,dragDirection:n,foundMergedCells:r,fillSize:i,dragArea:o,cycleLength:h}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),(0,s.X$)(this.currentFillData,e)}getAutofillSize(e,t,n){const[r,o,i,s]=e,[a,l,u,h]=t;switch(n){case"up":return r-a;case"down":return u-i;case"left":return o-l;case"right":return h-s;default:return null}}getDragArea(e,t,n){const[r,o,i,s]=e,[a,l,u,h]=t;switch(n){case"up":return[a,l,r-1,s];case"down":{const e=this.mergedCellsCollection.get(u,s);return[i+1,o,u+(e?e.rowspan-1:0),s]}case"left":return[a,l,i,o-1];case"right":{const e=this.mergedCellsCollection.get(u,s);return[r,s+(e?e.colspan-1:0),u,h]}default:return null}}getFarthestCollection(e,t,n,r){const[o,i,s,a]=e,l=["up","down"].indexOf(n)>-1,u=l?s:a,c=l?o:i,d=this.getAutofillSize(e,t,n),m=l?s-o+1:a-i+1,p=d-Math.floor(d/m)*m;let f=null,g=null,y=null;switch(n){case"up":f="includesVertically",y=u-p+1;break;case"left":f="includesHorizontally",y=u-p+1;break;case"down":f="includesVertically",y=c+p-1;break;case"right":f="includesHorizontally",y=c+p-1}return(0,h.z0)(r,(e=>{e[f](y)&&e.isFarther(g,n)&&(g=e)})),g}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const t=this.getRangeFromChanges(e),n=this.currentFillData.foundMergedCells,r=this.currentFillData.dragDirection,o=(e,n)=>{switch(r){case"up":return e.row-n>=t.from.row;case"down":return e.row+e.rowspan-1+n<=t.to.row;case"left":return e.col-n>=t.from.column;case"right":return e.col+e.colspan-1+n<=t.to.column;default:return null}};let i=0,s=null,a=1;do{for(let e=0;e0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const t={min:null,max:null},n={min:null,max:null};return(0,h.z0)(e,(e=>{const r=e[0],o=this.plugin.hot.propToCol(e[1]);(null===t.min||rt.max)&&(t.max=r),(null===n.min||on.max)&&(n.max=o)})),{from:{row:t.min,column:n.min},to:{row:t.max,column:n.max}}}dragAreaOverlapsCollections(e,t,n){const r=this.getDragArea(e,t,n),[o,i,s,a]=r,l=this.plugin.hot._createCellCoords(o,i),u=this.plugin.hot._createCellCoords(s,a),h=this.plugin.hot._createCellRange(l,l,u);if(0===this.mergedCellsCollection.getWithinRange(h,!0).length)return!1;const c=this.mergedCellsCollection.getWithinRange(h,!1);return 0===c.length||("up"===n||"down"===n?!c.every((e=>{let{colspan:t}=e;return t===h.getWidth()})):!c.every((e=>{let{rowspan:t}=e;return t===h.getHeight()})))}};function ry(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const oy=class{constructor(e){ry(this,"plugin",void 0),ry(this,"hot",void 0),ry(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,t,n,r){const o=Math.min(n[0],n[2]),i=Math.min(n[1],n[3]),s=Math.max(n[0],n[2]),a=Math.max(n[1],n[3]);if(void 0===r)return;if(!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,t))return;const l=this.plugin.mergedCellsCollection.get(e,t);if(!l)return;const u=l.getLastRow(),h=l.getLastColumn();return o<=l.row&&i<=l.col&&s>=u&&a>=h?`${this.fullySelectedMergedCellClassName}-${r}`:this.isMergeCellFullySelected(l,this.plugin.hot.getSelectedRange())?`${this.fullySelectedMergedCellClassName}-multiple`:void 0}isMergeCellFullySelected(e,t){const n=[];if(!t||!e)return!1;for(let t=0;t{const{rowStart:r,rowEnd:o,colStart:i,colEnd:s}=n.data;if(e>=r&&e<=o&&t>=i&&t<=s)return cy(fy,this,n),!1})),hy(py,this).inorder((n=>{const{rowStart:r,rowEnd:o,colStart:i,colEnd:s}=n.data;if(e>=r&&e<=o&&t>=i&&t<=s)return cy(gy,this,n),!1})),this}}function Sy(e,t,n,r,o){const i=e.getTopStartCorner(),s=e.getBottomEndCorner(),a=e.highlight.clone().normalize(),l=hy(yy,this).call(this,r,o);if(l&&n.has(l))return null;const u={colStart:o,colEnd:o,rowStart:r,rowEnd:r};if(l){if(n.add(l),l.rows.row||l.cols.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const h=t.push(u);return r===a.row&&o===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?h:null}function Cy(e,t,n){const{view:r,rowIndexMapper:o}=e,i=r.getStylesHandler(),s=r.getDefaultRowHeight();let a=0;for(let r=t;rthis.mergedCellsCollection.get(e,t),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),Ey(this,Dy,function(e){const{hot:t}=e,{rowIndexMapper:n,columnIndexMapper:r}=t,o=new Map;return{before:function(){},after:function(i,a,l){const u=e.mergedCellsCollection.get(a,l);if(!(0,s.Gv)(u))return i.removeAttribute("rowspan"),i.removeAttribute("colspan"),(0,te.nr)()&&o.has(a)&&!t.getSettings().rowHeaders&&(i.style.height=`${o.get(a)}px`,o.delete(a)),void(i.style.display="");const{row:h,col:c,colspan:d,rowspan:m}=u,[p,f]=e.translateMergedCellToRenderable(h,m,c,d),g=e.getSetting("virtualized");if((0,te.nr)()&&0===c&&!t.getSettings().rowHeaders){const e=Cy(t,h,m);o.set(a,e/m)}const y=p-n.getRenderableFromVisualIndex(a)+1,w=f-r.getRenderableFromVisualIndex(l)+1;let v=n.getNearestNotHiddenIndex(h,1),_=r.getNearestNotHiddenIndex(c,1);if(g){const e=t.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(e)||(v=Math.max(v,t.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(e)||(_=Math.max(_,t.getFirstRenderedVisibleColumn()))}const b=Math.min(m,y),S=Math.min(d,w);v===a&&_===l?(i.setAttribute("rowspan",b),i.setAttribute("colspan",S)):(i.removeAttribute("rowspan"),i.removeAttribute("colspan"),i.style.display="none")}}}(this))}static get PLUGIN_KEY(){return Ly}static get PLUGIN_PRIORITY(){return 150}static get DEFAULT_SETTINGS(){return{[on]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[Ly]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new ey(this),this.autofillCalculations=new ny(this),this.selectionCalculations=new oy(this),this.addHook("afterInit",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{if("MergeCells"===t)return!1})),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!(0,te.H8)())return;const e=[];let t=[];this.mergedCellsCollection.mergedCells.forEach((e=>{const{row:n,rowspan:r}=e;for(let e=n+1;e{const n=this.hot.rowIndexMapper.getRenderableFromVisualIndex(t);this.hot.view._wt.wtOverlays.getOverlays(!0).map((e=>"master"===(null==e?void 0:e.name)?e:e.clone.wtTable)).forEach((t=>{const r=t.getRow(n);r&&(r.style.background=(0,o.gd)(r,"backgroundColor").replace(")",", 0.99)"),e.push(r))}))})),this.hot._registerTimeout((()=>{e.forEach((e=>{var t;e.style.background=null===(t=(0,o.gd)(e,"backgroundColor"))||void 0===t?void 0:t.replace(", 0.99)",")")}))}),1)}validateSetting(e){return!(!e||(Gg.containsNegativeValues(e)?((0,Dr.R8)(Gg.NEGATIVE_VALUES_WARNING(e)),1):Gg.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?((0,Dr.R8)(Gg.IS_OUT_OF_BOUNDS_WARNING(e)),1):Gg.isSingleCell(e)?((0,Dr.R8)(Gg.IS_SINGLE_CELL(e)),1):Gg.containsZeroSpan(e)&&((0,Dr.R8)(Gg.ZERO_SPAN_WARNING(e)),1)))}generateFromSettings(){const e=this.getSetting("cells").filter((e=>this.validateSetting(e))),t=this.mergedCellsCollection.filterOverlappingMergeCells(e),n=[];t.forEach((e=>{const{row:t,col:r,rowspan:o,colspan:i}=e,s=this.hot._createCellCoords(t,r),a=this.hot._createCellCoords(t+o-1,r+i-1),l=this.hot._createCellRange(s,s,a);this.mergeRange(l,!0,!0);for(let e=t;e1&&void 0!==arguments[1]&&arguments[1])||this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:t,to:n}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(t.row,t.col,n.row,n.col,!1)}unmergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:t,to:n}=e;this.unmergeRange(e,!0),this.hot.selectCell(t.row,t.col,n.row,n.col,!1)}mergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.getTopStartCorner(),o=e.getBottomEndCorner(),i={row:r.row,col:r.col,rowspan:o.row-r.row+1,colspan:o.col-r.col+1},s=[];let a=null;return!!this.canMergeRange(i,t)&&(this.hot.runHooks("beforeMergeCells",e,t),(0,Mt.Ti)(0,i.rowspan-1,(e=>{(0,Mt.Ti)(0,i.colspan-1,(t=>{let n=null;s[e]||(s[e]=[]),0===e&&0===t?n=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(i.row),this.hot.toPhysicalColumn(i.col)):this.hot.setCellMeta(i.row+e,i.col+t,"hidden",!0),s[e][t]=n}))})),this.hot.setCellMeta(i.row,i.col,"spanned",!0),!this.mergedCellsCollection.add(i,t)||(n?a=[i.row,i.col,s]:this.hot.populateFromArray(i.row,i.col,s,void 0,void 0,this.pluginName),t||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,i,t),a))}unmergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.mergedCellsCollection.getWithinRange(e);0!==n.length&&(this.hot.runHooks("beforeUnmergeCells",e,t),(0,h.z0)(n,(e=>{this.mergedCellsCollection.remove(e.row,e.col),(0,Mt.Ti)(0,e.rowspan-1,(t=>{(0,Mt.Ti)(0,e.colspan-1,(n=>{this.hot.removeCellMeta(e.row+t,e.col+n,"hidden"),this.hot.removeCellMeta(e.row+t,e.col+n,"copyable")}))})),this.hot.removeCellMeta(e.row,e.col,"spanned")})),this.hot.runHooks("afterUnmergeCells",e,t),this.hot.render())}toggleMerge(e){const{from:t,to:n}=e.clone().normalize(),r=this.mergedCellsCollection.get(t.row,t.col);r.row===t.row&&r.col===t.col&&r.row+r.rowspan-1===n.row&&r.col+r.colspan-1===n.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,t,n,r){const o=this.hot._createCellCoords(e,t),i=this.hot._createCellCoords(n,r);this.mergeRange(this.hot._createCellRange(o,o,i))}unmerge(e,t,n,r){const o=this.hot._createCellCoords(e,t),i=this.hot._createCellCoords(n,r);this.unmergeRange(this.hot._createCellRange(o,o,i))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const e=this.hot.getSelectedRangeLast();e&&!e.isSingleHeader()&&(this.toggleMerge(e),this.hot.render())},runOnlyIf:e=>!e.altKey,group:xy})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(xy)}modifyViewportRowStart(e,t){const n=this.hot.rowIndexMapper,r=n.getVisualFromRenderableIndex(e.startRow);for(let o=0;oe.endRow)return e.endRow=o,void this.modifyViewportRowEnd(e,t)}}}modifyViewportColumnStart(e,t){const n=this.hot.columnIndexMapper,r=n.getVisualFromRenderableIndex(e.startColumn);for(let o=0;oe.endColumn)return e.endColumn=o,void this.modifyViewportColumnEnd(e,t)}}}translateMergedCellToRenderable(e,t,n,r){const{rowIndexMapper:o,columnIndexMapper:i}=this.hot;let s,a;return s=0===t?o.getNearestNotHiddenIndex(e,1):o.getNearestNotHiddenIndex(e+t-1,-1),a=0===r?i.getNearestNotHiddenIndex(n,1):i.getNearestNotHiddenIndex(n+r-1,-1),[e>=0?o.getRenderableFromVisualIndex(s):e,n>=0?i.getRenderableFromVisualIndex(a):n]}}function Fy(){this.generateFromSettings(),this.hot.render()}function Yy(e){if(e){const e=this.mergedCellsCollection.mergedCells,t=this.hot.getSelectedRangeLast(),n=t.getTopStartCorner(),r=t.getBottomEndCorner();for(let t=0;t=s&&n.col<=a?s-1:a,o=r.getNearestNotHiddenIndex(t,-1);e.col=null===o?-this.hot.view.countRenderableColumnsInRange(0,n.col):-Math.max(this.hot.view.countRenderableColumnsInRange(o,n.col)-1,1)}else if(e.col>0){const t=n.col>=s&&n.col<=a?a+1:s,o=r.getNearestNotHiddenIndex(t,1);e.col=null===o?this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):Math.max(this.hot.view.countRenderableColumnsInRange(n.col,o)-1,1)}const l=i.row,u=i.row+i.rowspan-1;if(e.row<0){const t=n.row>=l&&n.row<=u?l-1:u,r=o.getNearestNotHiddenIndex(t,-1);e.row=null===r?-this.hot.view.countRenderableRowsInRange(0,n.row):-Math.max(this.hot.view.countRenderableRowsInRange(r,n.row)-1,1)}else if(e.row>0){const t=n.row>=l&&n.row<=u?u+1:l,r=o.getNearestNotHiddenIndex(t,1);e.row=null===r?this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):Math.max(this.hot.view.countRenderableRowsInRange(n.row,r)-1,1)}}function By(e){const t=this.hot.getSelectedRangeLast(),n=t.clone(),{to:r}=t,{columnIndexMapper:o,rowIndexMapper:i}=this.hot,s=(e,t)=>{n.expand(this.hot._createCellCoords(e,t));for(let e=0;e0){let i=this.mergedCellsCollection.getEndMostColumnIndex(t,r.col)+e.col;s(r.row,i),"W-E"===t.getHorizontalDirection()&&"W-E"===n.getHorizontalDirection()&&(i=n.getBottomEndCorner().col);const a=o.getNearestNotHiddenIndex(i,-1);null!==a&&(e.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,a)-1,1))}if(e.row<0){let o=this.mergedCellsCollection.getTopMostRowIndex(t,r.row)+e.row;s(o,r.col),"S-N"===t.getVerticalDirection()&&"S-N"===n.getVerticalDirection()&&(o=n.getTopStartCorner().row);const a=i.getNearestNotHiddenIndex(o,1);null!==a&&(e.row=-Math.max(this.hot.view.countRenderableRowsInRange(a,r.row)-1,1))}else if(e.row>0){let o=this.mergedCellsCollection.getBottomMostRowIndex(t,r.row)+e.row;s(o,r.col),"N-S"===t.getVerticalDirection()&&"N-S"===n.getVerticalDirection()&&(o=n.getBottomStartCorner().row);const a=i.getNearestNotHiddenIndex(o,-1);null!==a&&(e.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,a)-1,1))}}function Wy(){const e=this.hot.getSelectedRangeLast(),{highlight:t}=e;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader())return void Ry(Oy,this,t.clone());for(let t=0;t0||Ay(Iy,this).col>0?Ay(ky,this).setPrevNodeAsActive():("E-W"===n&&Ay(Iy,this).col<0||"S-N"===t&&Ay(Iy,this).row<0)&&Ay(ky,this).setNextNodeAsActive()}function Ky(e,t){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:o}=this.hot;let i=null,s=null;if(Ay(Iy,this).col<0){const{rowEnd:e,colEnd:t}=Ay(ky,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(t,-1),i=o.getNearestNotHiddenIndex(e,-1)}else if(Ay(Iy,this).col>0){const{rowStart:e,colStart:t}=Ay(ky,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(t,1),i=o.getNearestNotHiddenIndex(e,1)}else if(Ay(Iy,this).row<0){const{rowEnd:e,colEnd:t}=Ay(ky,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(t,-1),i=o.getNearestNotHiddenIndex(e,-1)}else if(Ay(Iy,this).row>0){const{rowStart:e,colStart:t}=Ay(ky,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(t,1),i=o.getNearestNotHiddenIndex(e,1)}if(null!==i||null!==s){const r=this.hot._createCellCoords(i,s),o=this.mergedCellsCollection.get(r.row,r.col),a=this.hot.selection.highlight.getFocus();e=r.row,t=r.col,o?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(o.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(o.col,1)}):n.highlight.assign(r),a.clear(),a.add(r).commit()}Ay(ky,this).setActiveNode(e,t),Ry(Iy,this,{row:0,col:0})}function Xy(){this.hot.getSelectedRangeLast().isHeader()||Ay(ky,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function qy(e,t,n){const r=this.mergedCellsCollection.get(e,t);r&&(r.row!==e||r.col!==t?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function Qy(e){if(this.getSetting("virtualized"))return;const t=this.hot.countCols();this.modifyViewportRowStart(e,t),this.modifyViewportRowEnd(e,t)}function Jy(e){if(this.getSetting("virtualized"))return;const t=this.hot.countRows();this.modifyViewportColumnStart(e,t),this.modifyViewportColumnEnd(e,t)}function Zy(e,t){const n=this.autofillCalculations.getDirection(t,e);if(this.autofillCalculations.dragAreaOverlapsCollections(t,e,n))return t;const r=this.hot._createCellCoords(t[0],t[1]),o=this.hot._createCellCoords(t[2],t[3]),i=this.hot._createCellRange(r,r,o),s=this.mergedCellsCollection.getWithinRange(i);return 0===s.length?e:this.autofillCalculations.snapDragArea(t,e,n,s)}function ew(e,t){this.mergedCellsCollection.shiftCollections("right",e,t)}function tw(e,t){this.mergedCellsCollection.shiftCollections("left",e,t)}function nw(e,t,n){"auto"!==n&&this.mergedCellsCollection.shiftCollections("down",e,t)}function rw(e,t){this.mergedCellsCollection.shiftCollections("up",e,t)}function ow(e,t){"Autofill.fill"===t&&this.autofillCalculations.recreateAfterDataPopulation(e)}function iw(e,t){if(t&&"area"===t){const t=this.hot.getSelectedRangeLast(),n=this.mergedCellsCollection.getWithinRange(t);(0,h.z0)(n,(n=>{t.getBottomEndCorner().row===n.getLastRow()&&t.getBottomEndCorner().col===n.getLastColumn()&&(e[2]=n.row,e[3]=n.col)}))}}function sw(e,t,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(e,t,n,r)}function aw(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function lw(e,t,n,r){if(!(r instanceof MouseEvent))return;const o=this.hot.getSelectedRangeLast(),i=this.mergedCellsCollection.getByRange(o);if(!i)return;const s=this.hot._createCellCoords(i.row,i.col),a=this.hot._createCellCoords(i.row+i.rowspan-1,i.col+i.colspan-1);return 0===this.hot.selection.getLayerLevel()&&o.isEqual(this.hot._createCellRange(s,s,a))}function uw(e,t,n){if(this.hot.getSettings().rowHeaders||"bottom"===n||"bottom_inline_start_corner"===n)return e;let r,o;if("master"===n)r=this.hot.getFirstRenderedVisibleColumn(),o=this.hot.getLastRenderedVisibleColumn();else{const e=this.hot.view.getOverlayByName(n);r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e.clone.wtTable.getFirstRenderedColumn()),o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(t,r))return e;const i=this.hot._createCellCoords(t,r),s=this.hot._createCellCoords(t,o),a=this.hot._createCellRange(i,i,s),l=this.mergedCellsCollection.getWithinRange(a,!0),u=l.reduce(((e,t)=>{let{rowspan:n}=t;return Math.max(e,n)}),1);let h=0;return l.length>1&&l[0].rowspan{let{rowspan:o}=r,i=0;i="top"===n||"top_inline_start_corner"===n?Math.min(u,this.hot.view.countNotHiddenFixedRowsTop()-t):o-h,e=Math.max(null!=e?e:0,Cy(this.hot,t,i))})),e}const hw="sort";const cw="multiColumnSorting",dw=cw;ho(cw,(function(e,t){return function(n,r){const[,...o]=n,[,...i]=r;return function n(r){const s=e[r],a=t[r],l=o[r],u=i[r],h=a.multiColumnSorting,c=(h.compareFunctionFactory?h.compareFunctionFactory:mo(a.type))(s,a,h)(l,u);if(c===po){const e=r+1;if(void 0!==t[e])return n(e)}return c}(0)}}));class mw extends Ho{constructor(){var e,t,n;super(...arguments),e=this,n=cw,(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t="pluginKey"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}static get PLUGIN_KEY(){return cw}static get PLUGIN_PRIORITY(){return 170}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return-1===e.row&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,Io)),!1},runOnlyIf:()=>{var e,t;const n=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return n&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(n)&&n.isHeader()},relativeToGroup:a.b,position:"before",group:dw})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(dw)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rn.test(e)))}(e)),!1!==this.enabled&&(0,o.iQ)(e,function(e,t,n){const r=[];return!1===n||e.isColumnSorted(t)&&e.getNumberOfSortedColumns()>1&&r.push(`${hw}-${e.getIndexOfColumnInSortQueue(t)+1}`),r}(...n))}onAfterOnCellMouseDown(e,t){!1!==Eo(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(t.col),this.sort(this.getNextSortConfig(t.col,Io))):this.sort(this.getColumnNextConfig(t.col)))}}function pw(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class fw extends hn{constructor(){super(...arguments),pw(this,"dragged",[]),pw(this,"lastSetCell",null)}static get PLUGIN_KEY(){return"multipleSelectionHandles"}static get PLUGIN_PRIORITY(){return 160}isEnabled(){return(0,te.rr)()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:t}=this.hot;function n(t){if(1===e.dragged.length)return e.dragged.splice(0,e.dragged.length),!0;const n=e.dragged.indexOf(t);if(-1===n)return!1;0===n?e.dragged=e.dragged.slice(0,1):1===n&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(t,"touchstart",(t=>{let n;return(0,o.nB)(t.target,"topSelectionHandle-HitArea")?(n=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},t.preventDefault(),!1):(0,o.nB)(t.target,"bottomSelectionHandle-HitArea")?(n=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},t.preventDefault(),!1):void 0})),this.eventManager.addEventListener(t,"touchend",(t=>(0,o.nB)(t.target,"topSelectionHandle-HitArea")?(n.call(e,"top"),e.touchStartRange=void 0,t.preventDefault(),!1):(0,o.nB)(t.target,"bottomSelectionHandle-HitArea")?(n.call(e,"bottom"),e.touchStartRange=void 0,t.preventDefault(),!1):void 0)),this.eventManager.addEventListener(t,"touchmove",(t=>{const{rootDocument:n}=this.hot;let r,o,i,s,a,l;if(0===e.dragged.length)return;const u=n.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY);u&&u!==e.lastSetCell&&("TD"!==u.nodeName&&"TH"!==u.nodeName||(r=e.hot.getCoords(u),-1===r.col&&(r.col=0),o=e.hot.getSelectedRangeLast(),i=o.getWidth(),s=o.getHeight(),a=o.getDirection(),1===i&&1===s&&e.hot.selection.setRangeEnd(r),l=e.getCurrentRangeCoords(o,r,e.touchStartRange.direction,a,e.dragged[0]),null!==l.start&&e.hot.selection.setRangeStart(l.start),e.hot.selection.setRangeEnd(l.end),e.lastSetCell=u),t.preventDefault())}))}getCurrentRangeCoords(e,t,n,r,o){const i=e.getTopStartCorner(),s=e.getBottomEndCorner(),a=e.getBottomStartCorner(),l=e.getTopEndCorner();let u={start:null,end:null};switch(n){case"NE-SW":switch(r){case"NE-SW":case"NW-SE":u="top"===o?{start:this.hot._createCellCoords(t.row,e.highlight.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,i.col)};break;case"SE-NW":"bottom"===o&&(u={start:this.hot._createCellCoords(s.row,t.col),end:this.hot._createCellCoords(t.row,i.col)})}break;case"NW-SE":switch(r){case"NE-SW":"top"===o?u={start:t,end:a}:u.end=t;break;case"NW-SE":"top"===o?u={start:t,end:s}:u.end=t;break;case"SE-NW":"top"===o?u={start:t,end:i}:u.end=t;break;case"SW-NE":"top"===o?u={start:t,end:l}:u.end=t}break;case"SW-NE":switch(r){case"NW-SE":u="bottom"===o?{start:this.hot._createCellCoords(t.row,i.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(i.row,t.col),end:this.hot._createCellCoords(t.row,s.col)};break;case"SW-NE":u="top"===o?{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,s.col)}:{start:this.hot._createCellCoords(t.row,i.col),end:this.hot._createCellCoords(i.row,t.col)};break;case"SE-NW":"bottom"===o?u={start:this.hot._createCellCoords(t.row,l.col),end:this.hot._createCellCoords(i.row,t.col)}:"top"===o&&(u={start:a,end:t})}break;case"SE-NW":switch(r){case"NW-SE":case"NE-SW":case"SW-NE":"top"===o&&(u.end=t);break;case"SE-NW":"top"===o?u.end=t:u={start:t,end:i}}}return u}isDragged(){return this.dragged.length>0}}var gw=n(50192);function yw(){let{label:e="",colspan:t=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:o=[],isCollapsed:i=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{label:e,colspan:t,origColspan:n,collapsible:r,isCollapsed:i,crossHiddenColumns:o,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function ww(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function vw(e,t){return e.get(bw(e,t))}function _w(e,t,n){return e.set(bw(e,t),n),n}function bw(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Sw=["label","collapsible"];var Cw=new WeakMap,Ew=new WeakMap,Mw=new WeakMap;class Tw{constructor(){ww(this,Cw,[]),ww(this,Ew,0),ww(this,Mw,1/0)}setColumnsLimit(e){_w(Mw,this,e)}setData(){_w(Cw,this,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;const n=[];if(0===t)return n;(0,h.z0)(e,(e=>{const r=[];let o=0;n.push(r),(0,h.z0)(e,(e=>{const n=yw();if((0,s.Gv)(e)){const{label:t,colspan:r,headerClassName:o}=e;n.label=(0,c.As)(t),"number"==typeof r&&r>1&&(n.colspan=r,n.origColspan=r),"string"==typeof o&&(n.headerClassNames=[...o.split(" ")])}else n.label=(0,c.As)(e);o+=n.origColspan;let i=!1;if(o>=t&&(n.colspan=n.origColspan-(o-t),n.origColspan=n.colspan,i=!0),r.push(n),n.colspan>1)for(let e=0;ee.length)));return(0,h.z0)(n,(e=>{if(e.lengthyw()));e.splice(e.length,0,...t)}})),n}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],vw(Mw,this))),_w(Ew,this,vw(Cw,this).length)}getData(){return vw(Cw,this)}mergeWith(e){(0,h.z0)(e,(e=>{let{row:t,col:n,...r}=e;const o=this.getHeaderSettings(t,n);null!==o&&(0,s.X$)(o,r,Sw)}))}map(e){(0,h.z0)(vw(Cw,this),(t=>{(0,h.z0)(t,(t=>{const n=e({...t});(0,s.Gv)(n)&&(0,s.X$)(t,n,Sw)}))}))}getHeaderSettings(e,t){var n;if(e>=vw(Ew,this)||e<0)return null;const r=vw(Cw,this)[e];return!1===Array.isArray(r)||t>=r.length?null:null!==(n=r[t])&&void 0!==n?n:null}getHeadersSettings(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r=[];if(e>=vw(Ew,this)||e<0)return r;const o=vw(Cw,this)[e];let i=0;for(let e=t;e1&&(e+=t.colspan-1),i===n)break;if(i>n)throw new Error("The last column settings cannot overlap the other header layers")}return r}getLayersCount(){return vw(Ew,this)}getColumnsCount(){return vw(Ew,this)>0?vw(Cw,this)[0].length:0}clear(){_w(Cw,this,[]),_w(Ew,this,0)}}function Rw(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Aw="DF-pre-order",Nw=new Map([[Aw,function e(t,n){let r=t.call(n,this);for(let o=0;o0&&void 0!==arguments[0]?arguments[0]:this;const t=new Lw({...e.data});for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:"BF";if(!Nw.has(t))throw new Error(`Traversal strategy "${t}" does not exist`);Nw.get(t).call(this,e,this)}walkUp(e){const t=this,n=r=>{!1!==e.call(t,r)&&null!==r.parent&&n(r.parent)};n(this)}}function xw(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function Ow(e,t){return e.get(Iw(e,t))}function Iw(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var kw=new WeakMap,Dw=new WeakMap,Pw=new WeakMap;class Hw{constructor(e){var t,n;xw(this,kw,new Map),xw(this,Dw,new Map),xw(this,Pw,null),n=e,(t=Pw).set(Iw(t,this),n)}getRoots(){return Array.from(Ow(kw,this).values())}getRootByColumn(e){let t;return Ow(Dw,this).has(e)&&(t=Ow(kw,this).get(Ow(Dw,this).get(e))),t}getNode(e,t){const n=this.getRootByColumn(t);if(!n)return;const r=t-Ow(Dw,this).get(t);let o,i=0;return n.walkDown((n=>{const{data:{origColspan:s,headerLevel:a}}=n;if(e===a){if(r>=i&&r<=i+s-1)return o=n,o.data.isRoot=t===o.data.columnIndex,!1;i+=s}})),o}rebuildTreeIndex(){let e=0;Ow(Dw,this).clear(),(0,h.z0)(Ow(kw,this),(t=>{let[,{data:{colspan:n}}]=t;for(let t=e;t3&&void 0!==arguments[3]?arguments[3]:1;const o=Ow(Pw,this).getHeadersSettings(n,t,r);n+=1,(0,h.z0)(o,(r=>{const o={...r,headerLevel:n-1,columnIndex:t};let i;1===n?(e.data=o,i=e):(i=new Lw(o),e.addChild(i)),n{let{data:n,childs:r}=e;if(!n.isHidden&&(t(n.columnIndex),0===r.length))for(let e=1;e{},affectedColumns:[],colspanCompensation:0};if(Vw(e))return Uw(n[0]);t.isCollapsed=!1;const r=n.slice(1),o=new Set;let i=0;if(r.length>0)(0,h.z0)(r,(e=>{e.replaceTreeWith(e.data.clonedTree),e.data.clonedTree=null;const t=e.data;i+=t.colspan,Fw(e,(e=>{o.add(e)}))}));else{const{colspan:e,origColspan:n,columnIndex:r}=t;i=n-e;for(let e=1;e{const{data:t}=e;t.colspan+=i,t.colspan>=t.origColspan?(t.colspan=t.origColspan,t.isCollapsed=!1):Vw(e)&&(t.isCollapsed=Yw(e,"isCollapsed"))})),{rollbackModification:()=>Bw(e),affectedColumns:Array.from(o),colspanCompensation:i}}function Bw(e){var t;const{data:n,childs:r}=e;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Vw(e))return Bw(r[0]);n.isCollapsed=!0;const o=r.slice(1),i=new Set;if(o.length>0)(0,h.z0)(o,(e=>{Fw(e,(e=>{i.add(e)})),e.data.clonedTree=e.cloneTree(),e.walkDown((e=>{let{data:t}=e;t.isHidden=!0}))}));else{const{origColspan:e,columnIndex:t}=n;for(let n=1;n{const{data:t}=e;t.colspan-=s,t.colspan<=1?(t.colspan=1,t.isCollapsed=!0):Vw(e)&&(t.isCollapsed=Yw(e,"isCollapsed"))})),{rollbackModification:()=>Uw(e),affectedColumns:Array.from(i),colspanCompensation:s}}const Ww=new Map([["collapse",Bw],["expand",Uw],["hide-column",function(e,t){if(!Number.isInteger(t))throw new Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw new Error(yo.O`The passed node is not the last node on the tree. Only for\x20 the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=e.data;if(n.includes(t))return;let r=!1;e.walkUp((e=>{const{data:{collapsible:t}}=e;if(t)return r=!0,!1})),r||e.walkUp((e=>{const{data:n}=e;n.crossHiddenColumns.push(t),n.colspan>1?n.colspan-=1:n.isHidden=!0}))}],["show-column",function(e,t){if(!Number.isInteger(t))throw new Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw new Error(yo.O`The passed node is not the last node on the tree. Only for\x20 the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=e.data;if(!n.includes(t))return;let r=!1;e.walkUp((e=>{const{data:{collapsible:t}}=e;if(t)return r=!0,!1})),r||e.walkUp((e=>{const{data:n}=e;n.crossHiddenColumns.splice(n.crossHiddenColumns.indexOf(t),1),!n.isHidden&&n.colspan{e.walkDown((e=>{const n=e.data,{origColspan:r,columnIndex:o,headerLevel:i,crossHiddenColumns:s}=n,a=function(e,t){let n;return Array.isArray(e[t])?n=e[t]:(n=[],e[t]=n),n}(t,i);let l=!1;for(let e=o;e{let{row:t,...n}=e;return{row:t<0?this.rowCoordsToLevel(t):t,...n}}));Kw(qw,this).mergeWith(t),Kw(Qw,this).buildTree(),$w(Jw,this,jw(Kw(Qw,this).getRoots()))}mapState(e){Kw(qw,this).map(e),Kw(Qw,this).buildTree(),$w(Jw,this,jw(Kw(Qw,this).getRoots()))}mapNodes(e){return(0,h.mu)(Kw(Qw,this).getRoots(),((t,n)=>(n.walkDown((n=>{const r=e(n.data);void 0!==r&&t.push(r)})),t)),[])}triggerNodeModification(e,t,n){t<0&&(t=this.rowCoordsToLevel(t));const r=Kw(Qw,this).getNode(t,n);let o;return r&&(o=function(e,t,n){if(!Ww.has(e))throw new Error(`The node modifier action ("${e}") does not exist.`);return Ww.get(e)(t,n)}(e,r,n),$w(Jw,this,jw(Kw(Qw,this).getRoots()))),o}triggerColumnModification(e,t){return this.triggerNodeModification(e,-1,t)}rowCoordsToLevel(e){if(e>=0)return null;const t=e+Math.max(this.getLayersCount(),1);return t<0?null:t}levelToRowCoords(e){if(e<0)return null;const t=e-Math.max(this.getLayersCount(),1);return t>=0?null:t}getHeaderSettings(e,t){var n,r;return e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount()?null:null!==(n=null===(r=Kw(Jw,this)[e])||void 0===r?void 0:r[t])&&void 0!==n?n:null}getHeaderTreeNodeData(e,t){const n=this.getHeaderTreeNode(e,t);return n?{...n.data}:null}getHeaderTreeNode(e,t){if(e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount())return null;return Kw(Qw,this).getNode(e,t)||null}findTopMostEntireHeaderLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=t-e+1;let r=!1,o=null;for(let i=e;i<=t;i++){const s=Kw(Qw,this).getRootByColumn(i);if(!s)break;r=!0,s.walkDown((r=>{const{columnIndex:i,headerLevel:s,origColspan:a,isHidden:l}=r.data;l||a<=n&&i>=e&&i+a-1<=t&&(null===o||s=0;){var i;const{isRoot:t}=null!==(i=this.getHeaderSettings(e,o))&&void 0!==i?i:{isRoot:!0};if(t)break;o-=1}return o}findRightMostColumnIndex(e,t){var n;const{isRoot:r,origColspan:o}=null!==(n=this.getHeaderSettings(e,t))&&void 0!==n?n:{isRoot:!0,origColspan:1};if(r)return t+o-1;let i=t+1;for(;i'),(0,o.Mv)(l,e),l.colSpan=u.colspan,r.appendChild(l)}}i.appendChild(r)}r.appendChild(i),e.appendChild(r)}clear(){this.widthsMap.clear(),this.container=null}};function nv(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rv(e,t,n){ov(e,t),t.set(e,n)}function ov(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function iv(e,t,n){return e.set(av(e,t),n),n}function sv(e,t){return e.get(av(e,t))}function av(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const lv="nestedHeaders";var uv=new WeakMap,hv=new WeakMap,cv=new WeakMap,dv=new WeakMap,mv=new WeakMap,pv=new WeakSet;class fv extends hn{constructor(){var e;super(...arguments),ov(this,e=pv),e.add(this),rv(this,uv,new Zw),rv(this,hv,null),rv(this,cv,null),rv(this,dv,!1),rv(this,mv,null),nv(this,"ghostTable",new tv(this.hot,((e,t)=>this.getHeaderSettings(e,t)))),nv(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return lv}static get PLUGIN_PRIORITY(){return 280}isEnabled(){return!!this.hot.getSettings()[lv]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();Array.isArray(t)&&Array.isArray(t[0])||(0,Dr.R8)(yo.O`Your Nested Headers plugin configuration is invalid. The settings has to be\x20 passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",(()=>av(pv,this,Ov).call(this))),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rav(pv,this,gv).call(this))),this.addHook("afterSelectionFocusSet",(()=>av(pv,this,gv).call(this))),this.addHook("beforeViewportScrollHorizontally",(function(){for(var t=arguments.length,n=new Array(t),r=0;rav(pv,this,Rv).call(this,e))),this.addHook("modifyColWidth",(function(){for(var t=arguments.length,n=new Array(t),r=0;rav(pv,this,gv).call(this))),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",(()=>av(pv,this,gv).call(this))),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();sv(uv,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=sv(uv,this).setState(e)),this.detectedOverlappedHeaders&&(0,Dr.R8)(yo.O`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20 is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach(((e,t)=>{const n=!0===e?"hide-column":"show-column";sv(uv,this).triggerColumnModification(n,t)})),!sv(hv,this)&&this.enabled&&iv(hv,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe((e=>{e.forEach((e=>{let{op:t,index:n,newValue:r}=e;if("replace"===t){const e=!0===r?"hide-column":"show-column";sv(uv,this).triggerColumnModification(e,n)}})),this.ghostTable.buildWidthsMap()}))),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),sv(uv,this).clear(),sv(hv,this).unsubscribe(),iv(hv,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return sv(uv,this)}getLayersCount(){return sv(uv,this).getLayersCount()}getHeaderSettings(e,t){return sv(uv,this).getHeaderSettings(e,t)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,t=e.getSetting("columnHeaders").length,n=e.wtTable.THEAD,r=e.wtOverlays.topOverlay.clone.wtTable.THEAD,i=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let e=0;e{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(r);null===u&&(u=r),i.removeAttribute("colspan"),(0,o.vy)(i,"hiddenHeader"),(0,o.vy)(i,"hiddenHeaderText");const{colspan:h,isHidden:c,isPlaceholder:d,headerClassNames:m}=null!==(s=sv(uv,this).getHeaderSettings(e,u))&&void 0!==s?s:{label:""};if(d||c)(0,o.iQ)(i,"hiddenHeader");else if(h>1){var p,f,g;const{wtOverlays:e}=l._wt,t=null===(p=e.topInlineStartCornerOverlay)||void 0===p?void 0:p.clone.wtTable.THEAD.contains(i),s=null===(f=e.inlineStartOverlay)||void 0===f?void 0:f.clone.wtTable.THEAD.contains(i);(null===(g=e.topOverlay)||void 0===g?void 0:g.clone.wtTable.THEAD.contains(i))&&u1&&i.setAttribute("colspan",a)}if(this.hot.view.appendColHeader(u,i,(function(){return t.getColumnHeaderValue(...arguments)}),e),!d&&!c){const e=i.querySelector("div.relative");e&&m&&m.length>0&&((0,o.vy)(e,this.hot.getColumnMeta(u).headerClassName),(0,o.iQ)(e,m))}}}getColumnHeaderValue(e,t){var n;const{isHidden:r,isPlaceholder:o}=null!==(n=sv(uv,this).getHeaderSettings(t,e))&&void 0!==n?n:{};return o||r?"":this.hot.getColHeader(e,t)}destroy(){iv(uv,this,null),null!==sv(hv,this)&&(sv(hv,this).unsubscribe(),iv(hv,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return sv(uv,this).getHeaderTreeNodeData(e.row,e.col)}}function gv(){var e;const t=null===(e=this.hot)||void 0===e?void 0:e.getSelectedRangeLast();if(!t)return;const{highlight:n}=t;if(n.isHeader()&&n.col>=0){const e=sv(uv,this).findLeftMostColumnIndex(n.row,n.col),t=this.hot.selection.highlight.getFocus();t.visualCellRange.highlight.col=e,t.visualCellRange.from.col=e,t.visualCellRange.to.col=e,t.commit()}}function yv(e,t){var n;const r=this.hot.getSelectedRangeLast();if(!r)return e;const{highlight:o}=r,{navigableHeaders:i}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=i?o.row:null===(n=sv(mv,this))||void 0===n?void 0:n.row,l=s?e:o.col,u=a<0&&l>=0;if(iv(mv,this,null),!u)return e;const h=this.hot.getFirstFullyVisibleColumn(),c=this.hot.getLastFullyVisibleColumn(),d=c-h+1,m=sv(uv,this).findLeftMostColumnIndex(a,l),p=sv(uv,this).findRightMostColumnIndex(a,l),f=p-m+1;if(mc)return m;if(s){let e=null;return m>=h&&p>c?f>d?(t.value="start",e=m):(t.value="end",e=p):md?(t.value="end",e=p):(t.value="start",e=m)),e}return m<=h?m:p}function wv(e,t,n){const r=sv(uv,this).getHeaderTreeNodeData(t,e);if(!r)return e;const{columnCursor:o,selectionType:i,selectionWidth:s}=n,{isRoot:a,colspan:l}=sv(uv,this).getHeaderSettings(t,e);if(i===gw.PP){if(!a)return r.columnIndex}else if(i===gw.E6&&(l>s-o||!a))return null;return e}function vv(e,t,n){let{columnHeadersCount:r}=n;if(0!==r)for(let n=0;n=0||1==i-a+1)break;for(let t=i;t<=a;t++)for(let n=r;n<=s;n++){var o;const r=l+n,s=t-i;0!==s&&(!1===(null===(o=sv(uv,this).getHeaderTreeNodeData(n,t))||void 0===o?void 0:o.isRoot)&&(e[r][s]=""))}}}function _v(e,t,n,r){this._getHeaderTreeNodeDataByCoords(t)&&(r.column=!0)}function bv(e,t){const n=this._getHeaderTreeNodeDataByCoords(t);if(!n)return;iv(cv,this,t.clone()),iv(dv,this,!0);const{selection:r}=this.hot,o=r.isSelected()?r.getSelectedRange().current():null,s=[],{columnIndex:a,origColspan:l}=n,u=!r.inInSelection(t);e.shiftKey&&o?t.colo.from.col?s.push(o.getTopStartCorner().col,a+l-1,t.row):s.push(a,a+l-1,t.row):((0,i.Ml)(e)||(0,i.nO)(e)&&u||(0,i.kH)(e))&&s.push(a,a+l-1,t.row),r.selectColumns(...s)}function Sv(e,t,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const o=this._getHeaderTreeNodeDataByCoords(t);if(!o)return;const{columnIndex:i,origColspan:s}=o,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:h}=a;r.column=!0,r.cell=!0;const c=[],d=(0,Mt.qE)(t.row,-1/0,-1);t.colh.col?c.push(l.col,i+s-1,d):c.push(i,i+s-1,d),this.hot.selection.selectColumns(...c)}function Cv(){iv(dv,this,!1)}function Ev(){const{navigableHeaders:e}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!sv(dv,this)||!e)return;const t=this.hot.getSelectedRangeLast(),n=t.getTopStartCorner().col,r=t.getBottomEndCorner().col,{columnIndex:o,origColspan:i}=sv(uv,this).getHeaderTreeNodeData(sv(cv,this).row,sv(cv,this).col);if(t.setHighlight(sv(cv,this)),i>t.getWidth()||or){const e=sv(uv,this).findTopMostEntireHeaderLevel((0,Mt.qE)(n,o,o+i-1),(0,Mt.qE)(r,o,o+i-1));t.highlight.row=e,t.highlight.col=t.from.col}}function Mv(e){const{highlight:t}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(t.row+e.row,t.col+e.col);if(!(n.isHeader()&&n.col>=0))return;const r=sv(uv,this).findLeftMostColumnIndex(n.row,n.col),o=sv(uv,this).findRightMostColumnIndex(n.row,n.col);if(e.col<0){const n=t.col>=r&&t.col<=o?r-1:o,i=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n,-1);e.col=null===i?-this.hot.view.countRenderableColumnsInRange(0,t.col):-Math.max(this.hot.view.countRenderableColumnsInRange(i,t.col)-1,1)}else if(e.col>0){const n=t.col>=r&&t.col<=o?o+1:r,i=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n,1);e.col=null===i?this.hot.view.countRenderableColumnsInRange(t.col,this.hot.countCols()):Math.max(this.hot.view.countRenderableColumnsInRange(t.col,i)-1,1)}}function Tv(e,t,n){const r=e.row,o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col}),i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col});iv(mv,this,n.clone()),t.col=e.col&&(o&&(e.col=o.columnIndex),i&&(t.col=i.columnIndex+i.origColspan-1))}function Rv(e){if(sv(uv,this).getLayersCount()>0){e.length=0;for(let t=0;t=0&&(r=!1),(0,Mt.kf)(i)&&in?e:n}function Lv(e,t,n){var r;const{label:o}=null!==(r=sv(uv,this).getHeaderTreeNodeData(n,t))&&void 0!==r?r:{label:""};return o}function xv(e,t){if(e<0)return this.hot.getCell(e,sv(uv,this).findLeftMostColumnIndex(e,t),!0)}function Ov(){this.updatePlugin()}function Iv(e,t){t||this.updatePlugin()}function kv(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dv=class{constructor(e,t){kv(this,"hot",void 0),kv(this,"data",null),kv(this,"plugin",void 0),kv(this,"parentReference",new WeakMap),kv(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=t,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},(0,Mt.Ti)(0,this.data.length-1,(e=>{this.cacheNode(this.data[e],0,null)}))}cacheNode(e,t,n){this.cache.levels[t]||(this.cache.levels[t]=[],this.cache.levelCount+=1),this.cache.levels[t].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:n,row:this.cache.rows.length-1,level:t}),this.hasChildren(e)&&(0,h.z0)(e.__children,(n=>{this.cacheNode(n,t+1,e)}))}getDataObject(e){return null==e?null:this.cache.rows[e]}readTreeNodes(e,t,n,r){let o=!1,i=t;if(isNaN(i)&&i.end)return i;let s=e;return s||(s={__children:this.data},o=!0,i-=1),null!=n&&i===n?{result:s,end:!0}:null!=r&&s===r?{result:i,end:!0}:(i+=1,s.__children&&(0,h.z0)(s.__children,(e=>{if(this.parentReference.set(e,o?null:s),i=this.readTreeNodes(e,i,n,r),isNaN(i)&&i.end)return!1})),i)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return(0,s.v4)(this.data[0],((t,n)=>{e[n]=null})),e}getRowIndex(e){return null==e?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let t=null;t=isNaN(e)?e:this.getDataObject(e);const n=this.getRowParent(e);return null==n?this.data.indexOf(t):n.__children.indexOf(t)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let t=0,n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&n.__children?((0,h.z0)(n.__children,(e=>{t+=1,e.__children&&(t+=this.countChildren(e))})),t):0}getRowParent(e){let t;return t=isNaN(e)?e:this.getDataObject(e),this.getRowObjectParent(t)}getRowObjectParent(e){return e&&"object"==typeof e?this.cache.nodeInfo.get(e).parent:null}getRowLevel(e){let t=null;return t=isNaN(e)?e:this.getDataObject(e),t?this.getRowObjectLevel(t):null}getRowObjectLevel(e){return null==e?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let t=e;return isNaN(t)||(t=this.getDataObject(t)),!(!t.__children||!t.__children.length)}isChild(e){return null!==this.getRowParent(e)}getChild(e,t){var n;return(null===(n=e.__children)||void 0===n?void 0:n[t])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var t;let n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&!!n.__children&&0!==(null===(t=n.__children)||void 0===t?void 0:t.length)}addChild(e,t){let n=t;this.hot.runHooks("beforeAddChild",e,n);let r=null;e&&(r=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",r+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),n||(n=this.mockNode()),o.__children.push(n),this.rewriteCache();const i=this.getRowIndex(n);this.hot.rowIndexMapper.insertIndexes(i,1),this.hot.runHooks("afterCreateRow",i,1),this.hot.runHooks("afterAddChild",e,n)}addChildAtIndex(e,t,n){let r,o=n;if(o||(o=this.mockNode()),this.hot.runHooks("beforeAddChild",e,o,t),e){const n=this.getRowIndex(e)+t+1;this.hot.runHooks("beforeCreateRow",n,1),e.__children.splice(t,null,o),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(n,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",n,1),r=n}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",t,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),r=this.getRowIndex(this.data[t]);o=this.getDataObject(r),this.hot.runHooks("afterAddChild",e,o,t)}addSibling(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"below";const n=this.translateTrimmedRow(e),r=this.getRowParent(n),o=this.getRowIndexWithinParent(n);switch(t){case"below":this.addChildAtIndex(r,o+1,null);break;case"above":this.addChildAtIndex(r,o,null)}}detachFromParent(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=null;const r=[];Array.isArray(e)?((0,Mt.Ti)(e[0],e[2],(e=>{const t=this.translateTrimmedRow(e);r.push(this.getDataObject(t))})),(0,Mt.Ti)(0,r.length-2,(e=>{this.detachFromParent(r[e],!1)})),n=r[r.length-1]):n=e;const o=this.getRowIndex(n),i=this.countChildren(n),s=this.getRowIndexWithinParent(n),a=this.getRowParent(n),l=this.getRowParent(a),u=this.getRowIndex(l);let h=null;if(this.hot.runHooks("beforeDetachChild",a,n),null!=s){const e=Array.from(new Array(o+i+1).keys()).splice(-1*(i+1));if(this.hot.runHooks("beforeRemoveRow",o,i+1,e,this.plugin.pluginName),a.__children.splice(s,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,i+1,e,this.plugin.pluginName),l){h=u+this.countChildren(l);const e=this.getChild(l,this.countChildren(l)-1),t=this.getRowIndex(e);this.hot.runHooks("beforeCreateRow",t+1,i+1,this.plugin.pluginName),l.__children.push(n)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,i+1,this.plugin.pluginName),this.data.push(n)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,i+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",a,n,this.getRowIndex(n)),t&&this.hot.render()}filterData(e,t,n){const r=[];(0,h.z0)(n,(e=>{r.push(this.getDataObject(e))})),(0,h.z0)(r,(e=>{const t=this.getRowIndexWithinParent(e),n=this.getRowParent(e);null===n?this.data.splice(t,1):n.__children.splice(t,1)})),this.rewriteCache()}spliceData(e,t,n){const r=this.getDataObject(e-1);let o=null,i=e;r&&r.__children&&0===r.__children.length?(o=r,i=0):et;let u=o?this.getRowParent(t-1):this.getRowParent(t);null==u&&(u=this.getRowParent(t-1)),null==u&&(u=this.getDataObject(t-1)),u?u.__children||(u.__children=[]):(u=this.getDataObject(t),u.__children=[]);const h=o||n||r?u.__children.length:this.getRowIndexWithinParent(t),c=i===u;u.__children.splice(h,0,a[0]),i.__children.splice(s+(l&&c?1:0),1),this.syncRowWithRawSource(i),c||this.syncRowWithRawSource(u)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}};function Pv(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hv=class{constructor(e,t){Pv(this,"hot",void 0),Pv(this,"plugin",void 0),this.hot=t,this.plugin=e}};class Fv extends Hv{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,t){super(e,t),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,t){const n=this.hot.toPhysicalRow(e),r=this.dataManager.getRowLevel(n),i=this.dataManager.getDataObject(n),s=t.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if((0,h.z0)(l,(e=>{e&&s.removeChild(e)})),(0,o.iQ)(t,Fv.CSS_CLASSES.indicatorContainer),r){const{rootDocument:e}=this.hot,t=a.cloneNode(!0);s.innerHTML="",(0,Mt.Ti)(0,r-1,(()=>{const t=e.createElement("SPAN");(0,o.iQ)(t,Fv.CSS_CLASSES.emptyIndicator),s.appendChild(t)})),s.appendChild(t)}if(this.dataManager.hasChildren(i)){const e=this.hot.rootDocument.createElement("DIV");u&&(0,o.Bq)(e,[(0,f.MG)()]),(0,o.iQ)(t,Fv.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(n)?((0,o.iQ)(e,`${Fv.CSS_CLASSES.button} ${Fv.CSS_CLASSES.expandButton}`),u&&(0,o.Bq)(t,[(0,f.dV)(!1)])):((0,o.iQ)(e,`${Fv.CSS_CLASSES.button} ${Fv.CSS_CLASSES.collapseButton}`),u&&(0,o.Bq)(t,[(0,f.dV)(!0)])),s.appendChild(e)}}updateRowHeaderWidth(e){let t=e;t||(t=this.dataManager.cache.levelCount);const n=this.hot.view.getStylesHandler();let r=11;n.isClassicTheme()||(r=2*n.getCSSVariableValue("cell-horizontal-padding")),this.rowHeaderWidthCache=Math.max(50,r+10*t+25),this.hot.render()}}const Yv=Fv,Vv=class extends Hv{constructor(e,t){var n;super(e,t),n=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.lastCollapsedRows=n.collapsedRows.slice(0),n.expandMultipleChildren(n.lastCollapsedRows,e)},shiftStash:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;null==t&&(t=1/0),(0,h.z0)(n.lastCollapsedRows,((o,i)=>{o>=e&&o0&&void 0!==arguments[0])||arguments[0];n.collapseMultipleChildren(n.lastCollapsedRows,e),n.lastCollapsedRows=void 0},trimStash:(e,t)=>{(0,Mt.Ti)(e,e+t-1,(e=>{const t=this.lastCollapsedRows.indexOf(e);t>-1&&this.lastCollapsedRows.splice(t,1)}))}}}collapseChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];let o=null,i=null,s=null;return isNaN(e)?(o=e,i=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),i=e),this.dataManager.hasChildren(o)&&(0,h.z0)(o.__children,(e=>{r.push(this.dataManager.getRowIndex(e))})),s=this.collapseRows(r,!0,!1),n&&this.trimRows(s),t&&this.renderAndAdjust(),-1===this.collapsedRows.indexOf(i)&&this.collapsedRows.push(i),s}collapseMultipleChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];(0,h.z0)(e,(e=>{r.push(...this.collapseChildren(e,!1,!1))})),n&&this.trimRows(r),t&&this.renderAndAdjust()}collapseRow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.collapseRows([e],t)}collapseRows(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];return(0,h.z0)(e,(e=>{r.push(e),t&&this.collapseChildRows(e,r)})),n&&this.trimRows(r),r}collapseChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){const n=this.dataManager.getDataObject(e);(0,h.z0)(n.__children,(e=>{const n=this.dataManager.getRowIndex(e);t.push(n),this.collapseChildRows(n,t)}))}n&&this.trimRows(t)}expandRow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.expandRows([e],t)}expandRows(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];return(0,h.z0)(e,(e=>{r.push(e),t&&this.expandChildRows(e,r)})),n&&this.untrimRows(r),r}expandChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){const n=this.dataManager.getDataObject(e);(0,h.z0)(n.__children,(e=>{if(!this.isAnyParentCollapsed(e)){const n=this.dataManager.getRowIndex(e);t.push(n),this.expandChildRows(n,t)}}))}n&&this.untrimRows(t)}expandChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];let o=null,i=null,s=null;return isNaN(e)?(o=e,i=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),i=e),this.collapsedRows.splice(this.collapsedRows.indexOf(i),1),this.dataManager.hasChildren(o)&&(0,h.z0)(o.__children,(e=>{const t=this.dataManager.getRowIndex(e);r.push(t)})),s=this.expandRows(r,!0,!1),n&&this.untrimRows(s),t&&this.renderAndAdjust(),s}expandMultipleChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];(0,h.z0)(e,(e=>{r.push(...this.expandChildren(e,!1,!1))})),n&&this.untrimRows(r),t&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),t=[];(0,h.z0)(e,(e=>{this.dataManager.hasChildren(e)&&t.push(e)})),this.collapseMultipleChildren(t),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),t=[];(0,h.z0)(e,(e=>{this.dataManager.hasChildren(e)&&t.push(e)})),this.expandMultipleChildren(t),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution((()=>{(0,h.z0)(e,(e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!0)}))}),!0)}untrimRows(e){this.hot.batchExecution((()=>{(0,h.z0)(e,(e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!1)}))}),!0)}areChildrenCollapsed(e){let t=isNaN(e)?e:this.dataManager.getDataObject(e),n=!0;return null===t&&(t={__children:this.dataManager.data}),this.dataManager.hasChildren(t)&&(0,h.z0)(t.__children,(e=>{const t=this.dataManager.getRowIndex(e);if(!this.plugin.collapsedRowsMap.getValueAtIndex(t))return n=!1,!1})),n}isAnyParentCollapsed(e){let t=e;for(;null!==t;){t=this.dataManager.getRowParent(t);const e=this.dataManager.getRowIndex(t);if(this.collapsedRows.indexOf(e)>-1)return!0}return!1}toggleState(e,t){if(t.col>=0)return;const n=this.translateTrimmedRow(t.row);(0,o.nB)(e.target,Yv.CSS_CLASSES.button)&&(this.areChildrenCollapsed(n)?this.expandChildren(n):this.collapseChildren(n),(0,i.CA)(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}};var Uv=new WeakMap;const Bv=class extends Hv{constructor(){var e,t,n;super(...arguments),e=this,t="dataManager",n=this.plugin.dataManager,(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,function(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}(this,Uv,{row_above:(e,t)=>{const n=t[t.length-1];this.dataManager.addSibling(n.start.row,"above")},row_below:(e,t)=>{const n=t[t.length-1];this.dataManager.addSibling(n.start.row,"below")}})}appendOptions(e){const t=[{key:"add_child",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD)},callback:()=>{const e=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),t=this.dataManager.getDataObject(e);this.dataManager.addChild(t)},disabled:()=>{const e=this.hot.getSelectedLast();return!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(Ee.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const e=this.hot.getSelectedLast(),t=this.dataManager.translateTrimmedRow(e[0]);return!this.dataManager.getRowParent(t)||!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return(0,Mt.Ti)(0,e.items.length-1,(n=>{if(0===n)return(0,h.z0)(t,((t,r)=>{e.items.splice(n+r,0,t)})),!1})),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return(0,Mt.Ti)(0,e.items.length-1,(t=>{const n=(r=Uv,o=this,r.get(function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(r,o)))[e.items[t].key];var r,o;null!=n&&(e.items[t].callback=n)})),e}};function Wv(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class jv{constructor(e){Wv(this,"plugin",void 0),Wv(this,"hot",void 0),Wv(this,"dataManager",void 0),Wv(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,t,n,r){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:t,dropIndex:n,movePossible:r}))return!1;this.movedToCollapsed=!1;const o=n===this.hot.countRows(),i=o?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(n);let s=!0;const a=e.map((e=>{if(!s)return!1;const t=this.dataManager.translateTrimmedRow(e);return s=this.shouldAllowMoving(t,i),t})),l=-1===a.indexOf(i);if(!s||!l)return!1;const u=this.getBaseParent(a),h=this.getTargetParent(o,i),c=u===h;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(h),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(a,i,c),this.moveRows(a,i,h),this.dataManager.rewriteCache(),this.moveCellsMeta(a,i),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,t,n,r,r&&this.isRowOrderChanged(e,t)),this.hot.render(),this.selectCells(e,n),!1}displayAPICompatibilityWarning(e){const{rows:t,finalIndex:n,dropIndex:r,movePossible:o}=e;let i=!1;return(0,c.b0)(r)&&((0,Dr.R8)(yo.O`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20 when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",t,n,r,o,!1),i=!0),i}shouldAllowMoving(e,t){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===t||0===t)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,t){let n=this.dataManager.getRowParent(e?t-1:t);return null==n&&(n=this.dataManager.getRowParent(t-1)),n}shiftCollapsibleParentsLocations(e,t,n){n||(Math.max(...e)<=t?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],t,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(t,e[0],e.length))}moveRows(e,t,n){const r=t===this.dataManager.getRowIndex(n)+this.dataManager.countChildren(n)+1;this.hot.batchRender((()=>{e.forEach((e=>{this.dataManager.moveRow(e,t,this.movedToCollapsed,r)}))}))}moveCellsMeta(e,t){const n=[],r=Math.max(...e){n.push(this.hot.getCellMetaAtRow(e))})),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(t-(r?n.length:0),0,...n)}selectCells(e,t){const n=e.length;let r=0,o=0;if(this.movedToCollapsed){let i=null;i=e[n-1]e-n!==t))}}function zv(e,t,n){Gv(e,t),t.set(e,n)}function Gv(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $v(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kv(e,t){return e.get(qv(e,t))}function Xv(e,t,n){return e.set(qv(e,t),n),n}function qv(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Qv="nestedRows",Jv=Qv;var Zv=new WeakMap,e_=new WeakMap,t_=new WeakSet;class n_ extends hn{constructor(){var e;super(...arguments),Gv(this,e=t_),e.add(this),$v(this,"dataManager",null),$v(this,"headersUI",null),$v(this,"collapsedRowsMap",null),zv(this,Zv,!1),zv(this,e_,!1)}static get PLUGIN_KEY(){return Qv}static get PLUGIN_PRIORITY(){return 300}isEnabled(){return!!this.hot.getSettings()[Qv]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Uc.q),this.dataManager=new Dv(this,this.hot),this.collapsingUI=new Vv(this,this.hot),this.headersUI=new Yv(this,this.hot),this.contextMenuUI=new Bv(this,this.hot),this.rowMoveController=new jv(this),this.addHook("afterInit",(function(){for(var t=arguments.length,n=new Array(t),r=0;rqv(t_,this,w_).call(this,e))),this.addHook("beforeUpdateData",(e=>qv(t_,this,w_).call(this,e))),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),t=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(t)?this.collapsingUI.expandChildren(t):this.collapsingUI.collapseChildren(t),!1},runOnlyIf:()=>{var e,t;const n=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return n&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(n)&&-1===n.col&&n.row>=0},group:Jv,relativeToGroup:a.b,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Jv)}disableCoreAPIModifiers(){Xv(e_,this,!0)}enableCoreAPIModifiers(){Xv(e_,this,!1)}onModifyRowData(e){if(!Kv(e_,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Kv(e_,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,t,n){return!(!Kv(e_,this)&&!this.dataManager.isRowHighestLevel(e)&&(this.dataManager.spliceData(e,t,n),1))}destroy(){super.destroy()}}function r_(e,t,n,r){return this.rowMoveController.onBeforeRowMove(e,t,n,r)}function o_(e,t,n){this.collapsingUI.toggleState(e,t,n)}function i_(e,t,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],t),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*t),this.dataManager.filterData(e,t,n),Xv(Zv,this,!0),this.dataManager.getData().slice()}function s_(e){return this.contextMenuUI.appendOptions(e)}function a_(e,t){this.headersUI.appendLevelIndicators(e,t)}function l_(e){return Math.max(this.headersUI.rowHeaderWidthCache,e)}function u_(e,t,n,r){r!==this.pluginName&&this.hot._registerTimeout((()=>{Xv(Zv,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()}))}function h_(e,t,n){const r=Array.from(n.reduce(((e,t)=>{if(this.dataManager.isParent(t)){const n=this.dataManager.getDataObject(t).__children;return e.add(t),Array.isArray(n)&&n.forEach((t=>e.add(this.dataManager.getRowIndex(t)))),e}return e.add(t)}),new Set));n.length=0,n.push(...r)}function c_(){this.collapsingUI.collapsedRowsStash.stash()}function d_(e,t){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(t)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function m_(){this.collapsingUI.collapsedRowsStash.stash()}function p_(e,t,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function f_(){this.dataManager.rewriteCache()}function g_(){this.headersUI.updateRowHeaderWidth()}function y_(e,t){Kv(Zv,this)&&(t.skipRender=!0)}function w_(e){if(!(0,Gh.DJ)(e))return(0,Dr.z3)("The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled."),this.hot.getSettings()[Qv]=!1,void this.disablePlugin();this.dataManager.setData(e),this.dataManager.rewriteCache()}function v_(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const __=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;v_(this,"rootWindow",void 0),v_(this,"prefix",void 0),v_(this,"savedKeys",[]),this.rootWindow=t,this.prefix=e,this.loadSavedKeys()}saveValue(e,t){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(t)),-1===this.savedKeys.indexOf(e)&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,t){const n=void 0===e?t:e,r=this.rootWindow.localStorage.getItem(`${this.prefix}_${n}`);return null===r?void 0:JSON.parse(r)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){(0,h.z0)(this.savedKeys,((e,t)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[t]}`)})),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),t="string"==typeof e?JSON.parse(e):void 0;this.savedKeys=t||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}};Ce.R.getSingleton().register("persistentStateSave"),Ce.R.getSingleton().register("persistentStateLoad"),Ce.R.getSingleton().register("persistentStateReset");const b_="persistentState";class S_ extends hn{constructor(){var e,t,n;super(...arguments),e=this,n=void 0,(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t="storage"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}static get PLUGIN_KEY(){return b_}static get PLUGIN_PRIORITY(){return 0}isEnabled(){return!!this.hot.getSettings()[b_]}enablePlugin(){this.enabled||(this.storage||(this.storage=new __(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",((e,t)=>this.saveValue(e,t))),this.addHook("persistentStateLoad",((e,t)=>this.loadValue(e,t))),this.addHook("persistentStateReset",(()=>this.resetValue())),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,t){t.value=this.storage.loadValue(e)}saveValue(e,t){this.storage.saveValue(e,t)}resetValue(e){void 0===e?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function C_(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E_(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const M_="search",T_=function(e,t,n,r,o){e.getCellMeta(t,n).isSearchResult=o},R_=function(e,t,n){return!((0,c.b0)(e)||null===e||!e.toLocaleLowerCase||0===e.length||(0,c.b0)(t)||null===t||-1===t.toString().toLocaleLowerCase(n.locale).indexOf(e.toLocaleLowerCase(n.locale)))};var A_=new WeakSet;class N_ extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=A_),t.add(e),C_(this,"callback",T_),C_(this,"queryMethod",R_),C_(this,"searchResultClass","htSearchResult")}static get PLUGIN_KEY(){return M_}static get PLUGIN_PRIORITY(){return 190}isEnabled(){return this.hot.getSettings()[M_]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[M_];this.updatePluginSettings(t),this.addHook("beforeRenderer",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{this.hot.removeHook("beforeRenderer",t)})),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getCallback(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getQueryMethod();const r=this.hot.countRows(),o=this.hot.countCols(),i=[],s=this.hot;return(0,Mt.Ti)(0,r-1,(r=>{(0,Mt.Ti)(0,o-1,(o=>{const a=this.hot.getDataAtCell(r,o),l=this.hot.getCellMeta(r,o),u=l.search.callback||t,h=(l.search.queryMethod||n)(e,a,l);if(h){const e={row:r,col:o,data:a};i.push(e)}u&&u(s,r,o,a,h)}))})),i}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){(0,s.Gv)(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function L_(e,t,n,r,o,i){const s=i.className||[];let a=[];"string"==typeof s?a=s.split(" "):a.push(...s),this.isEnabled()&&i.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),i.className=a.join(" ")}function x_(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class O_{constructor(e){x_(this,"viewportWidth",void 0),x_(this,"overwriteColumnWidthFn",void 0),x_(this,"baseWidths",new Map),x_(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:t}=e;this.viewportWidth=t,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,t){this.baseWidths.set(e,t)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class I_ extends O_{calculate(){const e=Array.from(this.baseWidths).reduce(((e,t)=>{let[,n]=t;return e+n}),0);if(this.viewportWidth-e<0)return void this.stretchedWidths.clear();const t=this.viewportWidth/e,n=[],r=[];let o=this.viewportWidth,i=0;if(this.baseWidths.forEach(((e,s)=>{const a=Math.round(e*t),l=this.overwriteColumnWidthFn(a,s);a===l&&a>=wn.j?(n.push([s,l]),i+=l):a!==l&&(n.push([s,l]),r.push(s),o-=l)})),o<=wn.j)return void this.stretchedWidths.clear();const s=o/i;let a=-1,l=0;n.forEach(((e,t)=>{let[o,i]=e,u=i;r.includes(o)||(u=Math.round(i*s)),this.stretchedWidths.set(o,u),a=o,t1&&this.stretchedWidths.set(a,Math.round(this.viewportWidth-l))}}function k_(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function D_(e,t){return e.get(H_(e,t))}function P_(e,t,n){return e.set(H_(e,t),n),n}function H_(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var F_=new WeakMap,Y_=new WeakMap;class V_ extends O_{constructor(){super(...arguments),k_(this,F_,0),k_(this,Y_,-1)}prepare(e){super.prepare(e),P_(F_,this,0),P_(Y_,this,-1)}setColumnBaseWidth(e,t){super.setColumnBaseWidth(e,t),P_(Y_,this,e),P_(F_,this,t)}calculate(){if(-1===D_(Y_,this))return;const e=Array.from(this.baseWidths).reduce(((e,t)=>{let[,n]=t;return e+n}),0),t=Math.max(this.viewportWidth-e+D_(F_,this),0);this.stretchedWidths.set(D_(Y_,this),t)}}function U_(e,t,n){B_(e,t),t.set(e,n)}function B_(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function W_(e,t){return e.get(z_(e,t))}function j_(e,t,n){return e.set(z_(e,t),n),n}function z_(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var G_=new WeakMap,$_=new WeakMap,K_=new WeakMap,X_=new WeakMap,q_=new WeakSet;class Q_{constructor(e){var t;B_(this,t=q_),t.add(this),U_(this,G_,void 0),U_(this,$_,void 0),U_(this,K_,new Map([["all",new I_(z_(q_,this,eb).bind(this))],["last",new V_(z_(q_,this,eb).bind(this))]])),U_(this,X_,"none"),j_(G_,this,e),j_($_,this,W_(G_,this).columnIndexMapper.createAndRegisterIndexMap("stretchColumns","physicalIndexToValue"))}useStrategy(e){j_(X_,this,W_(K_,this).has(e)?e:"none")}refreshStretching(){"none"!==W_(X_,this)?W_(G_,this).batchExecution((()=>{W_($_,this).clear();const e=W_(K_,this).get(W_(X_,this));let t=W_(G_,this).view.getViewportWidth();z_(q_,this,J_).call(this)&&(t-=(0,o.XJ)(W_(G_,this).rootDocument)),e.prepare({viewportWidth:t});for(let t=0;t{let[t,n]=e;W_($_,this).setValueAtIndex(W_(G_,this).toPhysicalColumn(t),n)}))}),!0):W_($_,this).clear()}getStretchedWidth(e){return W_($_,this).getValueAtIndex(W_(G_,this).toPhysicalColumn(e))}}function J_(){const{view:e}=W_(G_,this);if(e.isVerticallyScrollableByWindow())return!1;const t=e.getViewportHeight(),n=W_(G_,this).countRows(),r=e.getStylesHandler().getDefaultRowHeight();let o=0,i=!1;for(let e=0;et){i=!0;break}}return i}function Z_(e){var t;return null!==(t=W_(G_,this).getColWidth(e,"StretchColumns"))&&void 0!==t?t:wn.j}function eb(e,t){return W_(G_,this).runHooks("beforeStretchingColumnWidth",e,t)}function tb(e,t,n){nb(e,t),t.set(e,n)}function nb(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rb(e,t,n){return e.set(ib(e,t),n),n}function ob(e,t){return e.get(ib(e,t))}function ib(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var sb=new WeakMap,ab=new WeakMap,lb=new WeakMap,ub=new WeakSet;class hb extends hn{constructor(){var e;super(...arguments),nb(this,e=ub),e.add(this),tb(this,sb,new Q_(this.hot)),tb(this,ab,null),tb(this,lb,new ResizeObserver((e=>{requestAnimationFrame((()=>{var t;null!==(t=this.hot)&&void 0!==t&&t.view.isHorizontallyScrollableByWindow()&&e.forEach((e=>{let{contentRect:t}=e;null!==ob(ab,this)&&ob(ab,this)!==t.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),rb(ab,this,t.width)}))}))})))}static get PLUGIN_KEY(){return"stretchColumns"}static get PLUGIN_PRIORITY(){return 155}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(ob(sb,this).useStrategy(this.hot.getSettings().stretchH),ob(lb,this).observe(this.hot.rootElement),this.addHook("beforeRender",(function(){for(var t=arguments.length,n=new Array(t),r=0;rpb(fb,this,yb).call(this))),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",(()=>pb(fb,this,wb).call(this))),this.addHook("afterMomentumScroll",(()=>pb(fb,this,vb).call(this)))}}function yb(){if(this.lockedCollection)return;const{topOverlay:e,bottomOverlay:t,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(e),t.clone&&this.scrollbars.push(t),this.scrollbars.push(n),r&&this.scrollbars.push(r),o&&o.clone&&this.scrollbars.push(o),this.clones=[],e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),o&&o.clone&&this.clones.push(o.clone.wtTable.holder.parentNode)}function wb(){this.freezeOverlays=!0,(0,h.z0)(this.clones,(e=>{(0,o.iQ)(e,"hide-tween")}))}function vb(){this.freezeOverlays=!1,(0,h.z0)(this.clones,(e=>{(0,o.vy)(e,"hide-tween"),(0,o.iQ)(e,"show-tween")})),this.hot._registerTimeout((()=>{(0,h.z0)(this.clones,(e=>{(0,o.vy)(e,"show-tween")}))}),400),(0,h.z0)(this.scrollbars,(e=>{e.refresh(),e.resetFixedPosition()})),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}const _b="trimRows";var bb=new WeakSet;class Sb extends hn{constructor(){var e,t;super(...arguments),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e=this,t=bb),t.add(e),function(e,t,n){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return _b}static get PLUGIN_PRIORITY(){return 330}isEnabled(){return!!this.hot.getSettings()[_b]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Uc.q),this.trimmedRowsMap.addLocalHook("init",(()=>function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(bb,this,Cb).call(this))),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[_b];Array.isArray(e)&&this.hot.batchExecution((()=>{this.trimmedRowsMap.clear(),(0,h.z0)(e,(e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)}))}),!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const t=this.getTrimmedRows(),n=this.isValidConfig(e);let r=t;n&&(r=Array.from(new Set(t.concat(e)))),!1!==this.hot.runHooks("beforeTrimRow",t,r,n)&&(n&&this.hot.batchExecution((()=>{(0,h.z0)(e,(e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)}))}),!0),this.hot.runHooks("afterTrimRow",t,r,n,n&&r.length>t.length))}trimRow(){for(var e=arguments.length,t=new Array(e),n=0;n0;n&&i&&((0,h.z0)(e,(e=>{o[e]=!1})),r=(0,h.mu)(o,((e,t,n)=>(t&&e.push(n),e)),[])),!1!==this.hot.runHooks("beforeUntrimRow",t,r,n&&i)&&(n&&i&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",t,r,n&&i,n&&r.lengthNumber.isInteger(e)&&e>=0&&e{(0,h.z0)(e,(e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)}))}),!0)}class Eb{constructor(e){var t,n,r;t=this,r="",(n=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(n="actionType"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function Mb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Tb extends Eb{constructor(e){let{stateBefore:t,range:n,type:r,alignment:o}=e;super("cell_alignment"),Mb(this,"stateBefore",void 0),Mb(this,"range",void 0),Mb(this,"type",void 0),Mb(this,"alignment",void 0),this.stateBefore=t,this.range=n,this.type=r,this.alignment=o}static startRegisteringEvents(e,t){e.addHook("beforeCellAlignment",((e,n,r,o)=>{t.done((()=>new Tb({stateBefore:e,range:n,type:r,alignment:o})))}))}undo(e,t){(0,h.z0)(this.range,(t=>{t.forAll(((t,n)=>{t>=0&&n>=0&&e.setCellMeta(t,n,"className",this.stateBefore[t][n]||" htLeft")}))})),e.addHookOnce("afterViewRender",t),e.render()}redo(e,t){Ni(this.range,this.type,this.alignment,((t,n)=>e.getCellMeta(t,n)),((t,n,r,o)=>e.setCellMeta(t,n,r,o))),e.addHookOnce("afterViewRender",t),e.render()}}function Rb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ab extends Eb{constructor(e){let{columns:t,finalIndex:n}=e;super("col_move"),Rb(this,"columns",void 0),Rb(this,"finalColumnIndex",void 0),this.columns=t.slice(),this.finalColumnIndex=n}static startRegisteringEvents(e,t){e.addHook("beforeColumnMove",((e,n)=>{!1!==e&&t.done((()=>new Ab({columns:e,finalIndex:n})))}))}undo(e,t){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t),Ed(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach((e=>{let{from:t,to:r}=e;t{r&&t.done((()=>new Lb({currentSortState:e,newSortState:n})))}))}undo(e,t){const n=e.getPlugin("columnSorting"),r=e.getPlugin("multiColumnSorting"),o=r.isEnabled()?r:n;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),t()}redo(e,t){const n=e.getPlugin("columnSorting"),r=e.getPlugin("multiColumnSorting");(r.isEnabled()?r:n).sort(this.nextSortState),t()}}function xb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ob extends Eb{constructor(e){let{index:t,amount:n}=e;super("insert_col"),xb(this,"index",void 0),xb(this,"amount",void 0),this.index=t,this.amount=n}static startRegisteringEvents(e,t){e.addHook("afterCreateCol",((e,n,r)=>{t.done((()=>new Ob({index:e,amount:n})),r)}))}undo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterCreateCol",t),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function Ib(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class kb extends Eb{constructor(e){let{index:t,amount:n}=e;super("insert_row"),Ib(this,"index",void 0),Ib(this,"amount",void 0),this.index=t,this.amount=n}static startRegisteringEvents(e,t){e.addHook("afterCreateRow",((e,n,r)=>{t.done((()=>new kb({index:e,amount:n})),r)}))}undo(e,t){const n=e.countRows(),r=e.getSettings().minSpareRows;this.index>=n&&this.index-r{const[,,t,n]=e;return t!==n}))&&t.done((()=>{const t=n.reduce(((e,t)=>(e.push([...t]),e)),[]);t.forEach((t=>{t[1]=e.propToCol(t[1])}));const r=o>1?this.getSelected():[[t[0][0],t[0][1]]];return new Pb({changes:t,selected:r,countCols:e.countCols(),countRows:e.countRows()})}),r)}))}undo(e,t){const n=(0,s.Go)(this.changes);for(let e=0,t=n.length;e0&&e.alter("remove_row",null,r,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,t){const n=(0,s.Go)(this.changes);for(let e=0,t=n.length;e{t.done((()=>new Fb({conditionsStack:e,previousConditionsStack:n})))}))}undo(e,t){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),n.importConditions(this.previousConditionsStack),n.filter()}redo(e,t){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),n.importConditions(this.conditionsStack),n.filter()}}class Yb extends Eb{constructor(e){let{data:t,cellRange:n}=e;var r,o,i;super("merge_cells"),r=this,i=void 0,(o=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(o="cellRange"))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,this.cellRange=n,this.data=t}static startRegisteringEvents(e,t){e.addHook("beforeMergeCells",((n,r)=>{if(r)return;const o=n.getTopStartCorner(),i=n.getBottomEndCorner(),s=e.getData(o.row,o.col,i.row,i.col);t.done((()=>new Yb({data:s,cellRange:n})))}))}undo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.unmergeRange(this.cellRange,!0);const r=this.cellRange.getTopStartCorner();e.populateFromArray(r.row,r.col,this.data,void 0,void 0,"MergeCells")}redo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.mergeRange(this.cellRange)}}function Vb(e,t,n,r,o){const i=["visualRow","visualCol","row","col","prop"],s=i.length,a=[];return(0,Mt.Ti)(r,o,(r=>{(0,Mt.Ti)(t,n,(t=>{const n=e.getCellMeta(t,r);if(Object.keys(n).length!==s){const e=Object.fromEntries(Object.entries(n).filter((e=>{let[t]=e;return!1===i.includes(t)})));a.push([n.visualRow,n.visualCol,e])}}))})),a}function Ub(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n(53921);class Bb extends Eb{constructor(e){let{index:t,indexes:n,data:r,amount:o,headers:i,columnPositions:s,rowPositions:a,fixedColumnsStart:l,removedCellMetas:u}=e;super("remove_col"),Ub(this,"index",void 0),Ub(this,"indexes",void 0),Ub(this,"data",void 0),Ub(this,"amount",void 0),Ub(this,"headers",void 0),Ub(this,"columnPositions",void 0),Ub(this,"rowPositions",void 0),Ub(this,"fixedColumnsStart",void 0),Ub(this,"removedCellMetas",void 0),this.index=t,this.indexes=n,this.data=r,this.amount=o,this.headers=i,this.columnPositions=s.slice(0),this.rowPositions=a.slice(0),this.fixedColumnsStart=l,this.removedCellMetas=u}static startRegisteringEvents(e,t){e.addHook("beforeRemoveCol",((n,r,o,i)=>{t.done((()=>{const t=e.getSourceDataArray(),o=(e.countCols()+n)%e.countCols(),i=o+r-1,s=[],a=[],l=[];return(0,Mt.Ti)(t.length-1,(n=>{const r=[],a=t[n];(0,Mt.Ti)(o,i,(t=>{r.push(a[e.toPhysicalColumn(t)])})),s.push(r)})),(0,Mt.Ti)(r-1,(t=>{l.push(e.toPhysicalColumn(o+t))})),Array.isArray(e.getSettings().colHeaders)&&(0,Mt.Ti)(r-1,(t=>{a.push(e.getSettings().colHeaders[e.toPhysicalColumn(o+t)]||null)})),new Bb({index:o,indexes:l,data:s,amount:r,headers:a,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:Vb(e,0,e.countRows(),o,i)})}),i)}))}undo(e,t){e.getSettings().fixedColumnsStart=this.fixedColumnsStart;const n=this.indexes.slice(0).sort(),r=(e,t,r)=>r[this.indexes.indexOf(n[t])],o=this.data.length,i=[];for(let e=0;e{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)}),!0),(0,h.z0)(e.getSourceDataArray(),((e,t)=>{(0,h.z0)(n,((n,r)=>{e[n]=i[t][r],a.push([t,n,e[n]])}))})),void 0!==this.headers&&(0,h.z0)(s,((t,r)=>{e.getSettings().colHeaders[n[r]]=t})),this.removedCellMetas.forEach((t=>{let[n,r,o]=t;e.setCellMetaObject(n,r,o)})),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(a,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function Wb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class jb extends Eb{constructor(e){let{index:t,data:n,fixedRowsBottom:r,fixedRowsTop:o,rowIndexesSequence:i,removedCellMetas:s}=e;super("remove_row"),Wb(this,"index",void 0),Wb(this,"data",void 0),Wb(this,"fixedRowsBottom",void 0),Wb(this,"fixedRowsTop",void 0),Wb(this,"rowIndexesSequence",void 0),Wb(this,"removedCellMetas",void 0),this.index=t,this.data=n,this.fixedRowsBottom=r,this.fixedRowsTop=o,this.rowIndexesSequence=i,this.removedCellMetas=s}static startRegisteringEvents(e,t){e.addHook("beforeRemoveRow",((n,r,o,i)=>{t.done((()=>{const t=e.toPhysicalRow(n),o=t+r-1,i=(0,s.Go)(e.getSourceData(t,0,t+r-1,e.countSourceCols()-1));return new jb({index:t,data:i,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:Vb(e,t,o,0,e.countCols()-1)})}),i)}))}undo(e,t){const n=e.getSettings(),r=[];n.fixedRowsBottom=this.fixedRowsBottom,n.fixedRowsTop=this.fixedRowsTop,this.data.forEach(((e,t)=>{Object.keys(e).forEach((n=>{const o=parseInt(n,10);r.push([this.index+t,isNaN(o)?n:o,e[n]])}))})),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach((t=>{let[n,r,o]=t;e.setCellMetaObject(n,r,o)})),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(r,null,null,"UndoRedo.undo")}redo(e,t){e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function zb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Gb extends Eb{constructor(e){let{rows:t,finalIndex:n}=e;super("row_move"),zb(this,"rows",void 0),zb(this,"finalRowIndex",void 0),this.rows=t.slice(),this.finalRowIndex=n}static startRegisteringEvents(e,t){e.addHook("beforeRowMove",((e,n)=>{!1!==e&&t.done((()=>new Gb({rows:e,finalIndex:n})))}))}undo(e,t){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t),Ed(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach((e=>{let{from:t,to:r}=e;t{n||t.done((()=>new $b({cellRange:e})))}))}undo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.mergeRange(this.cellRange,!0)}redo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.unmergeRange(this.cellRange,!0),e.render()}}function Kb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xb(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const qb="undoRedo";Ce.R.getSingleton().register("beforeUndo"),Ce.R.getSingleton().register("afterUndo"),Ce.R.getSingleton().register("beforeRedo"),Ce.R.getSingleton().register("afterRedo");const Qb=new Set;var Jb=new WeakSet;class Zb extends hn{static get PLUGIN_KEY(){return"undoRedo"}static get PLUGIN_PRIORITY(){return 1e3}static get SETTING_KEYS(){return!0}constructor(e){var t,n,r,o;super(e),function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(r=this,o=Jb),o.add(r),Kb(this,"doneActions",[]),Kb(this,"undoneActions",[]),Kb(this,"ignoreNewActions",!1),t=e,n=this,[Tb,Ab,Lb,Ob,kb,Pb,Fb,Yb,Bb,jb,Gb,$b].forEach((e=>e.startRegisteringEvents(t,n)))}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",(function(){for(var t=arguments.length,n=new Array(t),r=0;r!e.altKey,group:qb};e.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],t)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(qb)}done(e,t){if(this.ignoreNewActions)return;if("UndoRedo.undo"===t||"UndoRedo.redo"===t||"auto"===t)return;const n=this.doneActions.slice();if(!1===this.hot.runHooks("beforeUndoStackChange",n,t))return;const r=e(),o=this.undoneActions.slice();this.doneActions.push(r),this.hot.runHooks("afterUndoStackChange",n,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",o),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const t=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const n=(0,s.Go)(t);if(!1===this.hot.runHooks("beforeUndo",n))return;this.ignoreNewActions=!0;const r=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",r),t.undo(this.hot,(()=>{this.ignoreNewActions=!1,this.undoneActions.push(t)})),this.hot.runHooks("afterRedoStackChange",r,this.undoneActions.slice()),this.hot.runHooks("afterUndo",n)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const t=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const n=(0,s.Go)(t);if(!1===this.hot.runHooks("beforeRedo",n))return;this.ignoreNewActions=!0;const r=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",r),t.redo(this.hot,(()=>{this.ignoreNewActions=!1,this.doneActions.push(t)})),this.hot.runHooks("afterUndoStackChange",r,this.doneActions.slice()),this.hot.runHooks("afterRedo",n)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function eS(e,t){"loadData"===t&&this.clear()}function tS(){const e=e=>{Qb.has(e)||((0,Dr.R8)(yo.O`The "${e}" method is deprecated and it will be removed\x20 from the Core API in the future. Please use the method from the UndoRedo plugin\x20 (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),Qb.add(e))};this.hot.undo=()=>{e("undo"),this.undo()},this.hot.redo=()=>{e("redo"),this.redo()},this.hot.isUndoAvailable=()=>(e("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(e("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{e("clear"),this.clear()},this.hot.undoRedo=this}function nS(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function rS(){(0,ye.VA)(R.b7),(0,ye.VA)(M),(0,ye.VA)(A),(0,ye.VA)(ae),(0,ye.VA)(ue),(0,ye.VA)(u),(0,ye.VA)(he),(0,ye.VA)(de),(0,ye.VA)(fe),(0,ye.VA)(r.t),(0,ye.VA)(ge),(0,xt.TS)(be),(0,xt.TS)(we.j),(0,xt.TS)(Oe),(0,xt.TS)(Se),(0,xt.TS)(ke),(0,xt.TS)(ve),(0,xt.TS)(Rt),(0,xt.TS)(At),(0,xt.TS)(Nt),(0,xt.TS)(p.F),(0,xt.TS)(Lt),(0,Yt.qV)(Ot),(0,Yt.qV)(Dt),(0,Yt.qV)(kt),(0,Yt.qV)(Pt),(0,Yt.qV)(Ft),(0,Qt.Gk)(Vt),(0,Qt.Gk)(Ut),(0,Qt.Gk)(Wt),(0,Qt.Gk)(jt),(0,Qt.Gk)(zt),(0,Qt.Gk)(Gt),(0,Qt.Gk)($t),(0,Qt.Gk)(Kt),(0,Qt.Gk)(Xt.Y),(0,Qt.Gk)(qt),(0,Jt.F3)(xn),(0,Jt.F3)($n),(0,Jt.F3)(ur),(0,Jt.F3)(Ir),(0,Jt.F3)(Kr),(0,Jt.F3)(Ho),(0,Jt.F3)(Ko),(0,Jt.F3)(Ji),(0,Jt.F3)(ha),(0,Jt.F3)(Za),(0,Jt.F3)(El),(0,Jt.F3)(xl),(0,Jt.F3)(Bl),(0,Jt.F3)(yu),(0,Jt.F3)(ed),(0,Jt.F3)(lm),(0,Jt.F3)(Bm),(0,Jt.F3)(np),(0,Jt.F3)(gp),(0,Jt.F3)(Gp),(0,Jt.F3)(Ef),(0,Jt.F3)(ng),(0,Jt.F3)(Ig),(0,Jt.F3)(Hy),(0,Jt.F3)(mw),(0,Jt.F3)(fw),(0,Jt.F3)(fv),(0,Jt.F3)(n_),(0,Jt.F3)(S_),(0,Jt.F3)(N_),(0,Jt.F3)(hb),(0,Jt.F3)(gb),(0,Jt.F3)(Sb),(0,Jt.F3)(Zb)}},37313:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(3576).A},37353:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>f});var r=n(98587),o=n(77387),i=n(96540),s=n(40961);var a=n(17241),l="unmounted",u="exited",h="entering",c="entered",d="exiting",m=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=u,r.appearStatus=h):o=c:o=t.unmountOnExit||t.mountOnEnter?l:u,r.state={status:o},r.nextCallback=null,r}(0,o.A)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===l?{status:u}: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!==h&&n!==c&&(t=h):n!==h&&n!==c||(t=d)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===h){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:s.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===u&&this.setState({status:l})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[s.findDOMNode(this),r],i=o[0],a=o[1],l=this.getTimeouts(),u=r?l.appear:l.enter;e||n?(this.props.onEnter(i,a),this.safeSetState({status:h},(function(){t.props.onEntering(i,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:c},(function(){t.props.onEntered(i,a)}))}))}))):this.safeSetState({status:c},(function(){t.props.onEntered(i)}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:s.findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:d},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:u},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:u},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(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(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:s.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===l)return null;var t=this.props,n=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,r.A)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(a.A.Provider,{value:null},"function"==typeof n?n(e,o):i.cloneElement(i.Children.only(n),o))},t}(i.Component);function p(){}m.contextType=a.A,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},m.UNMOUNTED=l,m.EXITED=u,m.ENTERING=h,m.ENTERED=c,m.EXITING=d;const f=m},37550:(e,t,n)=>{"use strict";n(13579)},37892:function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n(95093))},38329:(e,t,n)=>{"use strict";n.d(t,{A:()=>V});var r=n(96540),o=n(34164),i=n(21362),s=n(49450),a=n(26739),l=n(20439),u=n(30301),h=n(54403),c=n(15870);class d{static create(){return new d}static use(){const e=(0,c.A)(d.create).current,[t,n]=r.useState(!1);return e.shouldMount=t,e.setShouldMount=n,r.useEffect(e.mountEffect,[t]),e}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then((()=>this.ref.current?.start(...e)))}stop(...e){this.mount().then((()=>this.ref.current?.stop(...e)))}pulsate(...e){this.mount().then((()=>this.ref.current?.pulsate(...e)))}}var m=n(98587),p=n(58168),f=n(9417),g=n(77387),y=n(17241);function w(e,t){var n=Object.create(null);return e&&r.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&(0,r.isValidElement)(e)?t(e):e}(e)})),n}function v(e,t,n){return null!=n[t]?n[t]:e.props[t]}function _(e,t,n){var o=w(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),i=[];for(var s in e)s in t?i.length&&(o[s]=i,i=[]):i.push(s);var a={};for(var l in t){if(o[l])for(r=0;r{if(!u&&null!=h){const e=setTimeout(h,c);return()=>{clearTimeout(e)}}}),[h,u,c]),(0,T.jsx)("span",{className:p,style:f,children:(0,T.jsx)("span",{className:g})})}),{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; &.${A.rippleVisible} { opacity: 0.3; transform: scale(1); animation-name: ${N}; animation-duration: ${550}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } &.${A.ripplePulsate} { animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; } & .${A.child} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${A.childLeaving} { opacity: 0; animation-name: ${L}; animation-duration: ${550}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } & .${A.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${x}; animation-duration: 2500ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; animation-iteration-count: infinite; animation-delay: 200ms; } `,k=r.forwardRef((function(e,t){const n=(0,l.b)({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:s={},className:a,...u}=n,[h,c]=r.useState([]),d=r.useRef(0),m=r.useRef(null);r.useEffect((()=>{m.current&&(m.current(),m.current=null)}),[h]);const p=r.useRef(!1),f=(0,E.A)(),g=r.useRef(null),y=r.useRef(null),w=r.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:i,cb:a}=e;c((e=>[...e,(0,T.jsx)(I,{classes:{ripple:(0,o.A)(s.ripple,A.ripple),rippleVisible:(0,o.A)(s.rippleVisible,A.rippleVisible),ripplePulsate:(0,o.A)(s.ripplePulsate,A.ripplePulsate),child:(0,o.A)(s.child,A.child),childLeaving:(0,o.A)(s.childLeaving,A.childLeaving),childPulsate:(0,o.A)(s.childPulsate,A.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i},d.current)])),d.current+=1,m.current=a}),[s]),v=r.useCallback(((e={},t={},n=()=>{})=>{const{pulsate:r=!1,center:o=i||t.pulsate,fakeElement:s=!1}=t;if("mousedown"===e?.type&&p.current)return void(p.current=!1);"touchstart"===e?.type&&(p.current=!0);const a=s?null:y.current,l=a?a.getBoundingClientRect():{width:0,height:0,left:0,top:0};let u,h,c;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(l.width/2),h=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;u=Math.round(t-l.left),h=Math.round(n-l.top)}if(o)c=Math.sqrt((2*l.width**2+l.height**2)/3),c%2==0&&(c+=1);else{const e=2*Math.max(Math.abs((a?a.clientWidth:0)-u),u)+2,t=2*Math.max(Math.abs((a?a.clientHeight:0)-h),h)+2;c=Math.sqrt(e**2+t**2)}e?.touches?null===g.current&&(g.current=()=>{w({pulsate:r,rippleX:u,rippleY:h,rippleSize:c,cb:n})},f.start(80,(()=>{g.current&&(g.current(),g.current=null)}))):w({pulsate:r,rippleX:u,rippleY:h,rippleSize:c,cb:n})}),[i,w,f]),_=r.useCallback((()=>{v({},{pulsate:!0})}),[v]),b=r.useCallback(((e,t)=>{if(f.clear(),"touchend"===e?.type&&g.current)return g.current(),g.current=null,void f.start(0,(()=>{b(e,t)}));g.current=null,c((e=>e.length>0?e.slice(1):e)),m.current=t}),[f]);return r.useImperativeHandle(t,(()=>({pulsate:_,start:v,stop:b})),[_,v,b]),(0,T.jsx)(O,{className:(0,o.A)(A.root,s.root,a),ref:y,...u,children:(0,T.jsx)(C,{component:null,exit:!0,children:h})})}));var D=n(1908);function P(e){return(0,D.Ay)("MuiButtonBase",e)}const H=(0,R.A)("MuiButtonBase",["root","disabled","focusVisible"]),F=(0,a.Ay)("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${H.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}});function Y(e,t,n,r=!1){return(0,h.A)((o=>(n&&n(o),r||e[t](o),!0)))}const V=r.forwardRef((function(e,t){const n=(0,l.b)({props:e,name:"MuiButtonBase"}),{action:a,centerRipple:c=!1,children:m,className:p,component:f="button",disabled:g=!1,disableRipple:y=!1,disableTouchRipple:w=!1,focusRipple:v=!1,focusVisibleClassName:_,LinkComponent:b="a",onBlur:S,onClick:C,onContextMenu:E,onDragLeave:M,onFocus:R,onFocusVisible:A,onKeyDown:N,onKeyUp:L,onMouseDown:x,onMouseLeave:O,onMouseUp:I,onTouchEnd:D,onTouchMove:H,onTouchStart:V,tabIndex:U=0,TouchRippleProps:B,touchRippleRef:W,type:j,...z}=n,G=r.useRef(null),$=d.use(),K=(0,u.A)($.ref,W),[X,q]=r.useState(!1);g&&X&&q(!1),r.useImperativeHandle(a,(()=>({focusVisible:()=>{q(!0),G.current.focus()}})),[]);const Q=$.shouldMount&&!y&&!g;r.useEffect((()=>{X&&v&&!y&&$.pulsate()}),[y,v,X,$]);const J=Y($,"start",x,w),Z=Y($,"stop",E,w),ee=Y($,"stop",M,w),te=Y($,"stop",I,w),ne=Y($,"stop",(e=>{X&&e.preventDefault(),O&&O(e)}),w),re=Y($,"start",V,w),oe=Y($,"stop",D,w),ie=Y($,"stop",H,w),se=Y($,"stop",(e=>{(0,s.A)(e.target)||q(!1),S&&S(e)}),!1),ae=(0,h.A)((e=>{G.current||(G.current=e.currentTarget),(0,s.A)(e.target)&&(q(!0),A&&A(e)),R&&R(e)})),le=()=>{const e=G.current;return f&&"button"!==f&&!("A"===e.tagName&&e.href)},ue=(0,h.A)((e=>{v&&!e.repeat&&X&&" "===e.key&&$.stop(e,(()=>{$.start(e)})),e.target===e.currentTarget&&le()&&" "===e.key&&e.preventDefault(),N&&N(e),e.target===e.currentTarget&&le()&&"Enter"===e.key&&!g&&(e.preventDefault(),C&&C(e))})),he=(0,h.A)((e=>{v&&" "===e.key&&X&&!e.defaultPrevented&&$.stop(e,(()=>{$.pulsate(e)})),L&&L(e),C&&e.target===e.currentTarget&&le()&&" "===e.key&&!e.defaultPrevented&&C(e)}));let ce=f;"button"===ce&&(z.href||z.to)&&(ce=b);const de={};"button"===ce?(de.type=void 0===j?"button":j,de.disabled=g):(z.href||z.to||(de.role="button"),g&&(de["aria-disabled"]=g));const me=(0,u.A)(t,G),pe={...n,centerRipple:c,component:f,disabled:g,disableRipple:y,disableTouchRipple:w,focusRipple:v,tabIndex:U,focusVisible:X},fe=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s={root:["root",t&&"disabled",n&&"focusVisible"]},a=(0,i.A)(s,P,o);return n&&r&&(a.root+=` ${r}`),a})(pe);return(0,T.jsxs)(F,{as:ce,className:(0,o.A)(fe.root,p),ownerState:pe,onBlur:se,onClick:C,onContextMenu:Z,onFocus:ae,onKeyDown:ue,onKeyUp:he,onMouseDown:J,onMouseLeave:ne,onMouseUp:te,onDragLeave:ee,onTouchEnd:oe,onTouchMove:ie,onTouchStart:re,ref:me,tabIndex:g?-1:U,type:j,...de,...z,children:[m,Q?(0,T.jsx)(k,{ref:K,center:c,...B}):null]})}))},38419:(e,t,n)=>{"use strict";n.d(t,{Lb:()=>i,SI:()=>u,Yf:()=>l,aE:()=>a,m0:()=>h}),n(44114);var r=n(77325),o=n(58002);const i={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:(0,o.gm)()?182:174,AUDIO_MUTE:(0,o.gm)()?181:173,AUDIO_UP:(0,o.gm)()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},s=[i.ALT,i.ARROW_DOWN,i.ARROW_LEFT,i.ARROW_RIGHT,i.ARROW_UP,i.AUDIO_DOWN,i.AUDIO_MUTE,i.AUDIO_UP,i.BACKSPACE,i.CAPS_LOCK,i.DELETE,i.END,i.ENTER,i.ESCAPE,i.F1,i.F2,i.F3,i.F4,i.F5,i.F6,i.F7,i.F8,i.F9,i.F10,i.F11,i.F12,i.F13,i.F14,i.F15,i.F16,i.F17,i.F18,i.F19,i.HOME,i.INSERT,i.MEDIA_NEXT,i.MEDIA_PLAY_PAUSE,i.MEDIA_PREV,i.MEDIA_STOP,i.NULL,i.NUM_LOCK,i.PAGE_DOWN,i.PAGE_UP,i.PAUSE,i.SCROLL_LOCK,i.SHIFT,i.TAB];function a(e){return 32===e||e>=48&&e<=57||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||e>=226||e>=65&&e<=90}function l(e){return s.includes(e)}function u(e){return[i.CONTROL,i.COMMAND_LEFT,i.COMMAND_RIGHT,i.COMMAND_FIREFOX].includes(e)}function h(e,t){const n=t.split("|");let o=!1;return(0,r.z0)(n,(t=>{if(e===i[t])return o=!0,!1})),o}},38469:(e,t,n)=>{"use strict";var r=n(79504),o=n(40507),i=n(94402),s=i.Set,a=i.proto,l=r(a.forEach),u=r(a.keys),h=u(new s).next;e.exports=function(e,t,n){return n?o({iterator:u(e),next:h},t):l(e,t)}},38480:(e,t,n)=>{"use strict";var r=n(61828),o=n(88727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},38572:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(96540),o=n(32350),i=n(17726),s=n(37353),a=n(53356),l=n(24337),u=n(30301),h=n(74848);function c(e){return`scale(${e}, ${e**2})`}const d={entering:{opacity:1,transform:c(1)},entered:{opacity:1,transform:"none"}},m="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),p=r.forwardRef((function(e,t){const{addEndListener:n,appear:p=!0,children:f,easing:g,in:y,onEnter:w,onEntered:v,onEntering:_,onExit:b,onExited:S,onExiting:C,style:E,timeout:M="auto",TransitionComponent:T=s.Ay,...R}=e,A=(0,o.A)(),N=r.useRef(),L=(0,a.A)(),x=r.useRef(null),O=(0,u.A)(x,(0,i.A)(f),t),I=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},k=I(_),D=I(((e,t)=>{(0,l.q)(e);const{duration:n,delay:r,easing:o}=(0,l.c)({style:E,timeout:M,easing:g},{mode:"enter"});let i;"auto"===M?(i=L.transitions.getAutoHeightDuration(e.clientHeight),N.current=i):i=n,e.style.transition=[L.transitions.create("opacity",{duration:i,delay:r}),L.transitions.create("transform",{duration:m?i:.666*i,delay:r,easing:o})].join(","),w&&w(e,t)})),P=I(v),H=I(C),F=I((e=>{const{duration:t,delay:n,easing:r}=(0,l.c)({style:E,timeout:M,easing:g},{mode:"exit"});let o;"auto"===M?(o=L.transitions.getAutoHeightDuration(e.clientHeight),N.current=o):o=t,e.style.transition=[L.transitions.create("opacity",{duration:o,delay:n}),L.transitions.create("transform",{duration:m?o:.666*o,delay:m?n:n||.333*o,easing:r})].join(","),e.style.opacity=0,e.style.transform=c(.75),b&&b(e)})),Y=I(S);return(0,h.jsx)(T,{appear:p,in:y,nodeRef:x,onEnter:D,onEntered:P,onEntering:k,onExit:F,onExited:Y,onExiting:H,addEndListener:e=>{"auto"===M&&A.start(N.current||0,e),n&&n(x.current,e)},timeout:"auto"===M?null:M,...R,children:(e,{ownerState:t,...n})=>r.cloneElement(f,{style:{opacity:0,transform:c(.75),visibility:"exited"!==e||y?void 0:"hidden",...d[e],...E,...f.props.style},ref:O,...n})})}));p&&(p.muiSupportAuto=!0);const f=p},38574:(e,t,n)=>{"use strict";var r=n(84215);e.exports="NODE"===r},39241:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(18139);const o={theme:void 0},i=function(e){let t,n;return function(i){let s=t;return void 0!==s&&i.theme===n||(o.theme=i.theme,s=(0,r.A)(e(o)),t=s,n=i.theme),s}}},39297:(e,t,n)=>{"use strict";var r=n(79504),o=n(48981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},39407:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(97102).A},39433:(e,t,n)=>{"use strict";var r=n(44576),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},39519:(e,t,n)=>{"use strict";var r,o,i=n(44576),s=n(82839),a=i.process,l=i.Deno,u=a&&a.versions||l&&l.version,h=u&&u.v8;h&&(o=(r=h.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},39612:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>a,BO:()=>s,Yn:()=>i});var r=n(97102),o=n(7196);function i(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=n)return n}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function s(e,t,n,r=n){let o;return o="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:i(e,n)||r,t&&(o=t(o,r,e)),o}const a=function(e){const{prop:t,cssProperty:n=e.prop,themeKey:a,transform:l}=e,u=e=>{if(null==e[t])return null;const u=e[t],h=i(e.theme,a)||{};return(0,o.NI)(e,u,(e=>{let o=s(h,l,e);return e===o&&"string"==typeof e&&(o=s(h,l,`${t}${"default"===e?"":(0,r.A)(e)}`,e)),!1===n?o:{[n]:o}}))};return u.propTypes={},u.filterProps=[t],u}},39835:e=>{"use strict";e.exports=function(e){try{var t=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},r=t[e](n);return 1!==r.size||4!==r.values().next().value}catch(e){return!1}}},40507:(e,t,n)=>{"use strict";var r=n(69565);e.exports=function(e,t,n){for(var o,i,s=n?e:e.iterator,a=e.next;!(o=r(a,s)).done;)if(void 0!==(i=t(o.value)))return i}},40583:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(96540).createContext({})},40616:(e,t,n)=>{"use strict";var r=n(79039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},40748:function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n(95093))},41011:function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n(95093))},41113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},41488:function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(r,o,i,s){var a=t(r),l=n[e][t(r)];return 2===a&&(l=l[o?0:1]),l.replace(/%d/i,r)}},o=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:o,monthsShort:o,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n(95093))},41496:(e,t,n)=>{"use strict";n.d(t,{q:()=>i}),n(44114);var r=n(48386),o=n(77325);class i extends r._{constructor(){super(arguments.length>0&&void 0!==arguments[0]&&arguments[0])}getTrimmedIndexes(){return(0,o.mu)(this.getValues(),((e,t,n)=>(t&&e.push(n),e)),[])}}},41538:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=n(88612).A},41558:(e,t,n)=>{"use strict";n.d(t,{A:()=>O});var r=n(96540),o=n(34164),i=n(21362),s=n(75337),a=n(94034),l=n(26739),u=n(39241),h=n(20439),c=n(30016),d=n(10644),m=n(24902),p=n(78854);function f(...e){return e.reduce(((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)}),(()=>{}))}var g=n(52658),y=n(88612),w=n(244);function v(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function _(e){return parseInt((0,y.A)(e).getComputedStyle(e).paddingRight,10)||0}function b(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,(e=>{const t=!i.includes(e),n=!function(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&v(e,o)}))}function S(e,t){let n=-1;return e.some(((e,r)=>!!t(e)&&(n=r,!0))),n}const C=()=>{},E=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&v(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);b(t,e.mount,e.modalRef,r,!0);const o=S(this.containers,(e=>e.container===t));return-1!==o?(this.containers[o].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=S(this.containers,(t=>t.modals.includes(e))),r=this.containers[n];r.restore||(r.restore=function(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=(0,d.A)(e);return t.body===e?(0,y.A)(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=(0,w.A)((0,y.A)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${_(r)+e}px`;const t=(0,d.A)(r).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${_(t)+e}px`}))}let e;if(r.parentNode instanceof DocumentFragment)e=(0,d.A)(r).body;else{const t=r.parentElement,n=(0,y.A)(r);e="HTML"===t?.nodeName&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach((({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)}))}}(r,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const r=S(this.containers,(t=>t.modals.includes(e))),o=this.containers[r];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(n,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&v(e.modalRef,t),b(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=o.modals[o.modals.length-1];e.modalRef&&v(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};var M=n(96148),T=n(1908);function R(e){return(0,T.Ay)("MuiModal",e)}(0,M.A)("MuiModal",["root","hidden","backdrop"]);var A=n(85078),N=n(74848);const L=(0,l.Ay)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((0,u.A)((({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]})))),x=(0,l.Ay)(c.A,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),O=r.forwardRef((function(e,t){const n=(0,h.b)({name:"MuiModal",props:e}),{BackdropComponent:l=x,BackdropProps:u,classes:c,className:y,closeAfterTransition:w=!1,children:_,container:b,component:S,components:M={},componentsProps:T={},disableAutoFocus:O=!1,disableEnforceFocus:I=!1,disableEscapeKeyDown:k=!1,disablePortal:D=!1,disableRestoreFocus:P=!1,disableScrollLock:H=!1,hideBackdrop:F=!1,keepMounted:Y=!1,onClose:V,onTransitionEnter:U,onTransitionExited:B,open:W,slotProps:j={},slots:z={},theme:G,...$}=n,K={...n,closeAfterTransition:w,disableAutoFocus:O,disableEnforceFocus:I,disableEscapeKeyDown:k,disablePortal:D,disableRestoreFocus:P,disableScrollLock:H,hideBackdrop:F,keepMounted:Y},{getRootProps:X,getBackdropProps:q,getTransitionProps:Q,portalRef:J,isTopModal:Z,exited:ee,hasTransition:te}=function(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:u,open:h,rootRef:c}=e,y=r.useRef({}),w=r.useRef(null),_=r.useRef(null),b=(0,m.A)(_,c),[S,M]=r.useState(!h),T=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let R=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(R=!1);const A=()=>(y.current.modalRef=_.current,y.current.mount=w.current,y.current),N=()=>{E.mount(A(),{disableScrollLock:o}),_.current&&(_.current.scrollTop=0)},L=(0,p.A)((()=>{const e=function(e){return"function"==typeof e?e():e}(t)||(0,d.A)(w.current).body;E.add(A(),e),_.current&&N()})),x=()=>E.isTopModal(A()),O=(0,p.A)((e=>{w.current=e,e&&(h&&x()?N():_.current&&v(_.current,R))})),I=r.useCallback((()=>{E.remove(A(),R)}),[R]);r.useEffect((()=>()=>{I()}),[I]),r.useEffect((()=>{h?L():T&&i||I()}),[h,I,T,i,L]);const k=e=>t=>{e.onKeyDown?.(t),"Escape"===t.key&&229!==t.which&&x()&&(n||(t.stopPropagation(),u&&u(t,"escapeKeyDown")))},D=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&u&&u(t,"backdropClick")};return{getRootProps:(t={})=>{const n=(0,g.A)(e);delete n.onTransitionEnter,delete n.onTransitionExited;const r={...n,...t};return{role:"presentation",...r,onKeyDown:k(r),ref:b}},getBackdropProps:(e={})=>{const t=e;return{"aria-hidden":!0,...t,onClick:D(t),open:h}},getTransitionProps:()=>({onEnter:f((()=>{M(!1),s&&s()}),l?.props.onEnter??C),onExited:f((()=>{M(!0),a&&a(),i&&I()}),l?.props.onExited??C)}),rootRef:b,portalRef:O,isTopModal:x,exited:S,hasTransition:T}}({...K,rootRef:t}),ne={...K,exited:ee},re=(e=>{const{open:t,exited:n,classes:r}=e,o={root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]};return(0,i.A)(o,R,r)})(ne),oe={};if(void 0===_.props.tabIndex&&(oe.tabIndex="-1"),te){const{onEnter:e,onExited:t}=Q();oe.onEnter=e,oe.onExited=t}const ie={slots:{root:M.Root,backdrop:M.Backdrop,...z},slotProps:{...T,...j}},[se,ae]=(0,A.A)("root",{ref:t,elementType:L,externalForwardedProps:{...ie,...$,component:S},getSlotProps:X,ownerState:ne,className:(0,o.A)(y,re?.root,!ne.open&&ne.exited&&re?.hidden)}),[le,ue]=(0,A.A)("backdrop",{ref:u?.ref,elementType:l,externalForwardedProps:ie,shouldForwardComponentProp:!0,additionalProps:u,getSlotProps:e=>q({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:(0,o.A)(u?.className,re?.backdrop),ownerState:ne});return Y||W||te&&!ee?(0,N.jsx)(a.A,{ref:J,container:b,disablePortal:D,children:(0,N.jsxs)(se,{...ae,children:[!F&&l?(0,N.jsx)(le,{...ue}):null,(0,N.jsx)(s.A,{disableEnforceFocus:I,disableAutoFocus:O,disableRestoreFocus:P,isEnabled:Z,open:W,children:r.cloneElement(_,oe)})]})}):null}))},41734:function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n(95093))},41794:function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n(95093))},41811:(e,t,n)=>{"use strict";n.d(t,{A:()=>i}),n(96540);var r=n(9792),o=n(74848);const i=(0,r.A)((0,o.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown")},41848:function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n(95093))},41895:(e,t,n)=>{"use strict";n.d(t,{n:()=>l}),n(16280),n(44114);var r=n(71409),o=n(32919),i=n(83986),s=n(77710);function a(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class l{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a(this,"indexedValues",[]),a(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const t=this.indexedValues;if(e0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,(0,i.Tn)(this.initValueOrFn)?(0,r.Ti)(e-1,(e=>this.indexedValues.push(this.initValueOrFn(e)))):(0,r.Ti)(e-1,(()=>this.indexedValues.push(this.initValueOrFn))),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}(0,o.co)(l,s.A)},42353:function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(t,o,i,s){var a=n(t),l=r[e][n(t)];return 2===a&&(l=l[o?0:1]),l.replace(/%d/i,t)}},i=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:i,monthsShort:i,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n(95093))},42620:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Alternation:()=>pt,CstParser:()=>Tr,EMPTY_ALT:()=>Cr,EOF:()=>tt,EarlyExitException:()=>Vn,EmbeddedActionsParser:()=>Rr,Flat:()=>lt,GAstVisitor:()=>_t,Lexer:()=>Ue,LexerDefinitionErrorType:()=>Fe,MismatchedTokenException:()=>Hn,NoViableAltException:()=>Fn,NonTerminal:()=>st,NotAllInputParsedException:()=>Yn,Option:()=>ut,Parser:()=>Mr,ParserDefinitionErrorType:()=>_r,Repetition:()=>dt,RepetitionMandatory:()=>ht,RepetitionMandatoryWithSeparator:()=>ct,RepetitionWithSeparator:()=>mt,Rule:()=>at,Terminal:()=>ft,VERSION:()=>r,assignOccurrenceIndices:()=>Ln,clearCache:()=>Fr,createSyntaxDiagramsCode:()=>Ar,createToken:()=>et,createTokenInstance:()=>nt,defaultGrammarResolverErrorProvider:()=>En,defaultGrammarValidatorErrorProvider:()=>Mn,defaultLexerErrorProvider:()=>Ye,defaultParserErrorProvider:()=>Cn,generateParserFactory:()=>Pr,generateParserModule:()=>Hr,isRecognitionException:()=>Pn,resolveGrammar:()=>An,serializeGrammar:()=>gt,serializeProduction:()=>yt,tokenLabel:()=>Be,tokenMatcher:()=>rt,tokenName:()=>We,validateGrammar:()=>Nn});var r="6.5.0";function o(e){return e&&0===e.length}function i(e){return null==e?[]:Object.keys(e)}function s(e){for(var t=[],n=Object.keys(e),r=0;r\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var r="";t&&(r="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),U(ee+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+$.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+r)}}return[]}function ne(e,t,n){switch(e.type){case"Disjunction":for(var r=0;r=Te)for(var i=r.from>=Te?r.from:Te,s=r.to,a=Re(i),l=Re(s),u=a;u<=l;u++)t[u]=u}}}));break;case"Group":ne(a.value,t,n);break;default:throw Error("Non Exhaustive Match")}var l=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===ie(a)||"Group"!==a.type&&!1===l)break}break;default:throw Error("non exhaustive match!")}return s(t)}function re(e,t,n){var r=Re(e);t[r]=r,!0===n&&function(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n)t[o=Re(r.charCodeAt(0))]=o;else{var o,i=n.toLowerCase();i!==n&&(t[o=Re(i.charCodeAt(0))]=o)}}(e,t)}function oe(e,t){return E(e.value,(function(e){if("number"==typeof e)return b(t,e);var n=e;return void 0!==E(t,(function(e){return n.from<=e&&e<=n.to}))}))}function ie(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&(A(e.value)?x(e.value,ie):ie(e.value))}var se=function(e){function t(t){var n=e.call(this)||this;return n.targetCharCodes=t,n.found=!1,n}return J(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){b(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===oe(e,this.targetCharCodes)&&(this.found=!0):void 0!==oe(e,this.targetCharCodes)&&(this.found=!0)},t}($.BaseRegExpVisitor);function ae(e,t){if(t instanceof RegExp){var n=q(t),r=new se(e);return r.visit(n),r.found}return void 0!==E(t,(function(t){return b(e,t.charCodeAt(0))}))}var le=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue="PATTERN",he="defaultMode",ce="modes",de="boolean"==typeof new RegExp("(?:)").sticky;function me(e,t){var n,r=(t=P(t,{useSticky:de,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;r("initCharCodeToOptimizedIndexMap",(function(){!function(){if(o(Ae)){Ae=new Array(65536);for(var e=0;e<65536;e++)Ae[e]=e>255?255+~~(e/255):e}}()})),r("Reject Lexer.NA",(function(){n=w(e,(function(e){return e[ue]===Ue.NA}))}));var i,s,l,u,h,f,g,y,v,S,C,E=!1;r("Transform Patterns",(function(){E=!1,i=a(n,(function(e){var n=e[ue];if(N(n)){var r=n.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||b(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?t.useSticky?we(n):ye(n):r[1]}if(p(n))return E=!0,{exec:n};if(_(n,"exec"))return E=!0,n;if("string"==typeof n){if(1===n.length)return n;var o=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),i=new RegExp(o);return t.useSticky?we(i):ye(i)}throw Error("non exhaustive match")}))})),r("misc mapping",(function(){s=a(n,(function(e){return e.tokenTypeIdx})),l=a(n,(function(e){var t=e.GROUP;if(t!==Ue.SKIPPED){if(d(t))return t;if(m(t))return!1;throw Error("non exhaustive match")}})),u=a(n,(function(e){var t=e.LONGER_ALT;if(t)return function(e,t){for(var n=0;n pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var a=te(n.PATTERN,t.ensureOptimizations);o(a)&&(T=!1),c(a,(function(t){Me(e,t,C[r])}))}else t.ensureOptimizations&&U(ee+"\tTokenType: <"+n.name+"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),T=!1;return e}),[])})),r("ArrayPacking",(function(){R=function(e){for(var t=[],n=0;n"+e.name+"<- missing static 'PATTERN' property",type:Fe.MISSING_PATTERN,tokenTypes:[e]}})),valid:O(e,t)}}(e);n=n.concat(r.errors);var o=function(e){var t=y(e,(function(e){var t=e[ue];return!(N(t)||p(t)||_(t,"exec")||d(t))}));return{errors:a(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Fe.INVALID_PATTERN,tokenTypes:[e]}})),valid:O(e,t)}}(r.valid),i=o.valid;return n=(n=n.concat(o.errors)).concat(function(e){var t=[],n=y(e,(function(e){return N(e[ue])}));return t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return le(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}($.BaseRegExpVisitor);return a(y(e,(function(e){var n=e[ue];try{var r=q(n),o=new t;return o.visit(r),o.found}catch(e){return fe.test(n.source)}})),(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Fe.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}(n)),t=t.concat(function(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return le(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}($.BaseRegExpVisitor);return a(y(e,(function(e){var n=e[ue];try{var r=q(n),o=new t;return o.visit(r),o.found}catch(e){return ge.test(n.source)}})),(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:Fe.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}(n)),t=t.concat(function(e){return a(y(e,(function(e){var t=e[ue];return t instanceof RegExp&&(t.multiline||t.global)})),(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Fe.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}(n)),t=t.concat(function(e){var t=[],n=a(e,(function(n){return M(e,(function(e,r){return n.PATTERN.source!==r.PATTERN.source||b(t,r)||r.PATTERN===Ue.NA||(t.push(r),e.push(r)),e}),[])}));return a(y(n=T(n),(function(e){return e.length>1})),(function(e){var t=a(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+u(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:Fe.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}(n)),t=t.concat(function(e){return a(y(e,(function(e){return e[ue].test("")})),(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:Fe.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}(n)),t}(i)),n=n.concat(function(e){return a(y(e,(function(e){if(!_(e,"GROUP"))return!1;var t=e.GROUP;return t!==Ue.SKIPPED&&t!==Ue.NA&&!d(t)})),(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Fe.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}(i)),n=n.concat(function(e,t){return a(y(e,(function(e){return void 0!==e.PUSH_MODE&&!b(t,e.PUSH_MODE)})),(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist",type:Fe.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}(i,t)),n=n.concat(function(e){var t=[],n=M(e,(function(e,t,n){var r,o=t.PATTERN;return o===Ue.NA||(d(o)?e.push({str:o,idx:n,tokenType:t}):N(o)&&(r=o,void 0===E([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(function(e){return-1!==r.source.indexOf(e)})))&&e.push({str:o.source,idx:n,tokenType:t})),e}),[]);return c(e,(function(e,r){c(n,(function(n){var o=n.str,i=n.idx,s=n.tokenType;if(r"+e.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:a,type:Fe.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}(i)),n}var fe=/[^\\][\$]/,ge=/[^\\[][\^]|^\^/;function ye(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function we(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function ve(e,t,n){var r=[],o=!1,s=w(T(l(function(e,t){for(var n=[],r=i(e),o=0;o Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===Fe.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}(e,t),i={message:n,type:t.issue,tokenType:e};r.push(i)}else _(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(o=!0):ae(a,e.PATTERN)&&(o=!0)})),t&&!o&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:Fe.NO_LINE_BREAKS_FLAGS}),r}function _e(e){var t=e.PATTERN;if(N(t))return!1;if(p(t))return!0;if(_(t,"exec"))return!0;if(d(t))return!1;throw Error("non exhaustive match")}function be(e){return!(!d(e)||1!==e.length)&&e.charCodeAt(0)}var Se={test:function(e){for(var t=e.length,n=this.lastIndex;n0?e.charCodeAt(0):e}))}function Me(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var Te=256;function Re(e){return e0}))}function ke(e,t){c(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),c(t.CATEGORIES,(function(n){var r=e.concat(t);b(r,n)||ke(r,n)}))}function De(e){return _(e,"tokenTypeIdx")}function Pe(e){return _(e,"CATEGORIES")}function He(e){return _(e,"tokenTypeIdx")}var Fe,Ye={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+n+" characters."}};!function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(Fe||(Fe={}));var Ve={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ye,traceInitPerf:!1,skipValidations:!1};Object.freeze(Ve);var Ue=function(){function e(e,t){var n=this;if(void 0===t&&(t=Ve),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=F(Ve,t);var r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var r,s=!0;n.TRACE_INIT("Lexer Config handling",(function(){if(n.config.lineTerminatorsPattern===Ve.lineTerminatorsPattern)n.config.lineTerminatorsPattern=Se;else if(n.config.lineTerminatorCharacters===Ve.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),A(e)?((r={modes:{}}).modes[he]=S(e),r[he]=he):(s=!1,r=C(e))})),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(function(e){var t=[];return _(e,he)||t.push({message:"A MultiMode Lexer cannot be initialized without a <"+he+"> property in its definition\n",type:Fe.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),_(e,ce)||t.push({message:"A MultiMode Lexer cannot be initialized without a property in its definition\n",type:Fe.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),_(e,ce)&&_(e,he)&&!_(e.modes,e.defaultMode)&&t.push({message:"A MultiMode Lexer cannot be initialized with a "+he+": <"+e.defaultMode+">which does not exist\n",type:Fe.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),_(e,ce)&&c(e.modes,(function(e,n){c(e,(function(e,r){m(e)&&t.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+n+"> at index: <"+r+">\n",type:Fe.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),t}(r,n.trackStartLines,n.config.lineTerminatorCharacters))})),n.TRACE_INIT("performWarningRuntimeChecks",(function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(ve(r,n.trackStartLines,n.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},c(r.modes,(function(e,t){r.modes[t]=w(e,(function(e){return m(e)}))}));var l=i(r.modes);if(c(r.modes,(function(e,r){n.TRACE_INIT("Mode: <"+r+"> processing",(function(){var i;n.modes.push(r),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(pe(e,l))})),o(n.lexerDefinitionErrors)&&(Ie(e),n.TRACE_INIT("analyzeTokenTypes",(function(){i=me(e,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:n.TRACE_INIT.bind(n)})})),n.patternIdxToConfig[r]=i.patternIdxToConfig,n.charCodeToPatternIdxToConfig[r]=i.charCodeToPatternIdxToConfig,n.emptyGroups=F(n.emptyGroups,i.emptyGroups),n.hasCustom=i.hasCustom||n.hasCustom,n.canModeBeOptimized[r]=i.canBeOptimized)}))})),n.defaultMode=r.defaultMode,!o(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var u=a(n.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+u)}c(n.lexerDefinitionWarning,(function(e){B(e.message)})),n.TRACE_INIT("Choosing sub-methods implementations",(function(){if(de?(n.chopInput=V,n.match=n.matchWithTest):(n.updateLastIndex=Y,n.match=n.matchWithExec),s&&(n.handleModes=Y),!1===n.trackStartLines&&(n.computeNewColumn=V),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=Y),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else{if(!/onlyOffset/i.test(n.config.positionTracking))throw Error('Invalid config option: "'+n.config.positionTracking+'"');n.createTokenInstance=n.createOffsetOnlyToken}n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)})),n.TRACE_INIT("Failed Optimization Warnings",(function(){var e=M(n.canModeBeOptimized,(function(e,t,n){return!1===t&&e.push(n),e}),[]);if(t.ensureOptimizations&&!o(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),n.TRACE_INIT("clearRegExpParserCache",(function(){K={}})),n.TRACE_INIT("toFastProperties",(function(){j(n)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!o(this.lexerDefinitionErrors)){var n=a(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var n,r,o,s,a,l,u,d,m,p,f,g,y,w,v,_,b=this,S=e,C=S.length,E=0,M=0,T=this.hasCustom?0:Math.floor(e.length/10),R=new Array(T),N=[],L=this.trackStartLines?1:void 0,x=this.trackStartLines?1:void 0,O=(v=this.emptyGroups,_={},c(i(v),(function(e){if(!A(v[e]))throw Error("non exhaustive match");_[e]=[]})),_),I=this.trackStartLines,k=this.config.lineTerminatorsPattern,D=0,P=[],H=[],F=[],Y=[];Object.freeze(Y);var V=void 0;function U(){return P}function B(e){var t=Re(e),n=H[t];return void 0===n?Y:n}var W,j=function(e){if(1===F.length&&void 0===e.tokenType.PUSH_MODE){var t=b.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);N.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{F.pop();var n=h(F);P=b.patternIdxToConfig[n],H=b.charCodeToPatternIdxToConfig[n],D=P.length;var r=b.canModeBeOptimized[n]&&!1===b.config.safeMode;V=H&&r?B:U}};function z(e){F.push(e),H=this.charCodeToPatternIdxToConfig[e],P=this.patternIdxToConfig[e],D=P.length,D=P.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;V=H&&t?B:U}for(z.call(this,t);Ea.length&&(a=o,l=u,W=q)}break}}if(null!==a){if(d=a.length,void 0!==(m=W.group)&&(p=W.tokenTypeIdx,f=this.createTokenInstance(a,E,p,W.tokenType,L,x,d),this.handlePayload(f,l),!1===m?M=this.addToken(R,M,f):O[m].push(f)),e=this.chopInput(e,d),E+=d,x=this.computeNewColumn(x,d),!0===I&&!0===W.canLineTerminator){var J=0,Z=void 0,ee=void 0;k.lastIndex=0;do{!0===(Z=k.test(a))&&(ee=k.lastIndex-1,J++)}while(!0===Z);0!==J&&(L+=J,x=d-ee,this.updateTokenEndLineColumnLocation(f,m,ee,J,L,x,d))}this.handleModes(W,j,z,f)}else{for(var te=E,ne=L,re=x,oe=!1;!oe&&E");var r=G(t),o=r.time,i=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,i}return t()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function Be(e){return je(e)?e.LABEL:e.name}function We(e){return e.name}function je(e){return d(e.LABEL)&&""!==e.LABEL}var ze="parent",Ge="categories",$e="label",Ke="group",Xe="push_mode",qe="pop_mode",Qe="longer_alt",Je="line_breaks",Ze="start_chars_hint";function et(e){return function(e){var t=e.pattern,n={};if(n.name=e.name,m(t)||(n.PATTERN=t),_(e,ze))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";return _(e,Ge)&&(n.CATEGORIES=e[Ge]),Ie([n]),_(e,$e)&&(n.LABEL=e[$e]),_(e,Ke)&&(n.GROUP=e[Ke]),_(e,qe)&&(n.POP_MODE=e[qe]),_(e,Xe)&&(n.PUSH_MODE=e[Xe]),_(e,Qe)&&(n.LONGER_ALT=e[Qe]),_(e,Je)&&(n.LINE_BREAKS=e[Je]),_(e,Ze)&&(n.START_CHARS_HINT=e[Ze]),n}(e)}var tt=et({name:"EOF",pattern:Ue.NA});function nt(e,t,n,r,o,i,s,a){return{image:t,startOffset:n,endOffset:r,startLine:o,endLine:i,startColumn:s,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function rt(e,t){return Ne(e,t)}Ie([tt]);var ot=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),c(this.definition,(function(t){t.accept(e)}))},e}(),st=function(e){function t(t){var n=e.call(this,[])||this;return n.idx=1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!0,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(it),at=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.orgText="",k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),lt=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.ignoreAmbiguities=!1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),ut=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),ht=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),ct=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),dt=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),mt=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),pt=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,k(n,v(t,(function(e){return void 0!==e}))),n}return ot(t,e),t}(it),ft=function(){function e(e){this.idx=1,k(this,v(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function gt(e){return a(e,yt)}function yt(e){function t(e){return a(e,yt)}if(e instanceof st)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof lt)return{type:"Flat",definition:t(e.definition)};if(e instanceof ut)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof ht)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof ct)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:yt(new ft({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof mt)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:yt(new ft({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof dt)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof pt)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof ft){var n={type:"Terminal",name:e.terminalType.name,label:Be(e.terminalType),idx:e.idx},r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=N(r)?r.source:r),n}if(e instanceof at)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}var wt=function(){function e(){}return e.prototype.walk=function(e,t){var n=this;void 0===t&&(t=[]),c(e.definition,(function(r,o){var i=f(e.definition,o+1);if(r instanceof st)n.walkProdRef(r,i,t);else if(r instanceof ft)n.walkTerminal(r,i,t);else if(r instanceof lt)n.walkFlat(r,i,t);else if(r instanceof ut)n.walkOption(r,i,t);else if(r instanceof ht)n.walkAtLeastOne(r,i,t);else if(r instanceof ct)n.walkAtLeastOneSep(r,i,t);else if(r instanceof mt)n.walkManySep(r,i,t);else if(r instanceof dt)n.walkMany(r,i,t);else{if(!(r instanceof pt))throw Error("non exhaustive match");n.walkOr(r,i,t)}}))},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,n){var r=[new ut({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkAtLeastOneSep=function(e,t,n){var r=vt(e,t,n);this.walk(e,r)},e.prototype.walkMany=function(e,t,n){var r=[new ut({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkManySep=function(e,t,n){var r=vt(e,t,n);this.walk(e,r)},e.prototype.walkOr=function(e,t,n){var r=this,o=t.concat(n);c(e.definition,(function(e){var t=new lt({definition:[e]});r.walk(t,o)}))},e}();function vt(e,t,n){return[new ut({definition:[new ft({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}var _t=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case st:return this.visitNonTerminal(t);case lt:return this.visitFlat(t);case ut:return this.visitOption(t);case ht:return this.visitRepetitionMandatory(t);case ct:return this.visitRepetitionMandatoryWithSeparator(t);case mt:return this.visitRepetitionWithSeparator(t);case dt:return this.visitRepetition(t);case pt:return this.visitAlternation(t);case ft:return this.visitTerminal(t);case at:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitFlat=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}(),bt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function St(e,t){return void 0===t&&(t=[]),!!(e instanceof ut||e instanceof dt||e instanceof mt)||(e instanceof pt?I(e.definition,(function(e){return St(e,t)})):!(e instanceof st&&b(t,e))&&e instanceof it&&(e instanceof st&&t.push(e),x(e.definition,(function(e){return St(e,t)}))))}function Ct(e){if(e instanceof st)return"SUBRULE";if(e instanceof ut)return"OPTION";if(e instanceof pt)return"OR";if(e instanceof ht)return"AT_LEAST_ONE";if(e instanceof ct)return"AT_LEAST_ONE_SEP";if(e instanceof mt)return"MANY_SEP";if(e instanceof dt)return"MANY";if(e instanceof ft)return"CONSUME";throw Error("non exhaustive match")}var Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return bt(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";_(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";_(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(_t),Mt=new Et;function Tt(e){if(e instanceof st)return Tt(e.referencedRule);if(e instanceof ft)return[e.terminalType];if(function(e){return e instanceof lt||e instanceof ut||e instanceof dt||e instanceof ht||e instanceof ct||e instanceof mt||e instanceof ft||e instanceof at}(e))return function(e){for(var t,n=[],r=e.definition,o=0,i=r.length>o,s=!0;i&&s;)s=St(t=r[o]),n=n.concat(Tt(t)),o+=1,i=r.length>o;return R(n)}(e);if(function(e){return e instanceof pt}(e))return function(e){return R(l(a(e.definition,(function(e){return Tt(e)}))))}(e);throw Error("non exhaustive match")}var Rt="_~IN~_",At=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nt=function(e){function t(t){var n=e.call(this)||this;return n.topProd=t,n.follows={},n}return At(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,n){},t.prototype.walkProdRef=function(e,t,n){var r,o,i=(r=e.referencedRule,o=e.idx,r.name+o+Rt+this.topProd.name),s=t.concat(n),a=Tt(new lt({definition:s}));this.follows[i]=a},t}(wt),Lt=256,xt=512,Ot=768,It=1024,kt=1280,Dt=1536;function Pt(e,t,n){return n|t|e}function Ht(e,t,n,r){var o=r+1<<24;return Pt(e,t,n)|o}var Ft=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Yt(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset1;c(e.definition,(function(r,o){if(!m(r.name)){var i=r.definition;i=n?[new ut({definition:r.definition})]:r.definition;var s=Ht(t.ruleIdx,Lt,e.idx,o);t.result.push({def:i,key:s,name:r.name,orgProd:r})}}))},t}(_t),Wt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.path=n,r.nextTerminalName="",r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return Wt(t,e),t.prototype.walkTerminal=function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),o=new lt({definition:r});this.possibleTokTypes=Tt(o),this.found=!0}},t}(function(e){function t(t,n){var r=e.call(this)||this;return r.topProd=t,r.path=n,r.possibleTokTypes=[],r.nextProductionName="",r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return Wt(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=S(this.path.ruleStack).reverse(),this.occurrenceStack=S(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,n){void 0===n&&(n=[]),this.found||e.prototype.walk.call(this,t,n)},t.prototype.walkProdRef=function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}},t.prototype.updateExpectedNext=function(){o(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(wt)),zt=function(e){function t(t,n){var r=e.call(this)||this;return r.topRule=t,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return Wt(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(wt),Gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wt(t,e),t.prototype.walkMany=function(t,n,r){if(t.idx===this.occurrence){var o=u(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ft&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkMany.call(this,t,n,r)},t}(zt),$t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wt(t,e),t.prototype.walkManySep=function(t,n,r){if(t.idx===this.occurrence){var o=u(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ft&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkManySep.call(this,t,n,r)},t}(zt),Kt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wt(t,e),t.prototype.walkAtLeastOne=function(t,n,r){if(t.idx===this.occurrence){var o=u(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ft&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOne.call(this,t,n,r)},t}(zt),Xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wt(t,e),t.prototype.walkAtLeastOneSep=function(t,n,r){if(t.idx===this.occurrence){var o=u(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof ft&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,n,r)},t}(zt);function qt(e,t,n){void 0===n&&(n=[]),n=S(n);var r=[],o=0;function i(i){var s=qt(i.concat(f(e,o+1)),t,n);return r.concat(s)}for(;n.length=0;O--){var I={idx:w,def:b.definition[O].definition.concat(f(y)),ruleStack:v,occurrenceStack:_};m.push(I),m.push(a)}else if(b instanceof lt)m.push({idx:w,def:b.definition.concat(f(y)),ruleStack:v,occurrenceStack:_});else{if(!(b instanceof at))throw Error("non exhaustive match");m.push(Jt(b,w,v,_))}}}else l&&h(m).idx<=c&&m.pop()}return d}function Jt(e,t,n,r){var o=S(n);o.push(e.name);var i=S(r);return i.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:i}}var Zt,en=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"}(Zt||(Zt={}));var tn=function(e){function t(t,n,r){var o=e.call(this)||this;return o.topProd=t,o.targetOccurrence=n,o.targetProdType=r,o}return en(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)},t.prototype.walkOption=function(t,n,r){this.checkIsTarget(t,Zt.OPTION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOne=function(t,n,r){this.checkIsTarget(t,Zt.REPETITION_MANDATORY,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOneSep=function(t,n,r){this.checkIsTarget(t,Zt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkMany=function(t,n,r){this.checkIsTarget(t,Zt.REPETITION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkManySep=function(t,n,r){this.checkIsTarget(t,Zt.REPETITION_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t}(wt),nn=function(e){function t(t,n,r){var o=e.call(this)||this;return o.targetOccurrence=t,o.targetProdType=n,o.targetRef=r,o.result=[],o}return en(t,e),t.prototype.checkIsTarget=function(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,Zt.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,Zt.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,Zt.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,Zt.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,Zt.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,Zt.ALTERNATION)},t}(_t);function rn(e){for(var t=new Array(e),n=0;n1}))),(function(n){var r=u(n),o=t.buildDuplicateFoundError(e,n),i=Ct(r),s={message:o,type:_r.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:i,occurrence:r.idx},a=fn(r);return a&&(s.parameter=a),s}))}(e,i)})),m=a(e,(function(e){return vn(e,e,i)})),p=[],f=[],y=[];x(m,o)&&(p=a(e,(function(e){return function(e,t){var n=new bn;return e.accept(n),M(n.alternations,(function(n,r){var i=a(g(r.definition),(function(n,i){return o(Qt([n],[],null,1))?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:i}),type:_r.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:i+1}:null}));return n.concat(T(i))}),[])}(e,i)})),f=a(e,(function(e){return function(e,t,n,r){var o=new bn;e.accept(o);var i=o.alternations,s=n[e.name];s&&(i=w(i,(function(e){return s[Ct(e)+(0===e.idx?"":e.idx)]})));var l=M(i=w(i,(function(e){return!0===e.ignoreAmbiguities})),(function(n,o){var i=o.idx,s=o.maxLookahead||t,l=ln(i,e,s,o),u=function(e,t,n,r){var o=[],i=M(e,(function(n,r,i){return!0===t.definition[i].ignoreAmbiguities||c(r,(function(r){var s=[i];c(e,(function(e,n){i!==n&&hn(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&s.push(n)})),s.length>1&&!hn(o,r)&&(o.push(r),n.push({alts:s,path:r}))})),n}),[]);return a(i,(function(e){var o=a(e.alts,(function(e){return e+1}));return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:o,prefixPath:e.path}),type:_r.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:[e.alts]}}))}(l,o,e,r),h=function(e,t,n,r){var o=[],i=M(e,(function(e,t,n){var r=a(t,(function(e){return{idx:n,path:e}}));return e.concat(r)}),[]);return c(i,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var s=e.idx,l=e.path,u=a(function(e,t){for(var n=[],r=0;r1}))),(function(r){var o=a(r,(function(e){return e.orgProd})),i=t.buildDuplicateNestedRuleNameError(e,o);n.push({message:i,type:_r.DUPLICATE_NESTED_NAME,ruleName:e.name})}))})),n}(e,i),R=a(e,(function(e){return function(e,t){var n=new bn;return e.accept(n),M(n.alternations,(function(n,r){return r.definition.length>255&&n.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:_r.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}),n}),[])}(e,i)})),A=a(e,(function(e){return function(e,t){var n=[],r=e.name;return r.match(yn)||n.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:yn}),type:_r.INVALID_RULE_NAME,ruleName:r}),n}(e,i)})),N=a(e,(function(t){return function(e,t,n,r){var o=[],i=M(t,(function(t,n){return n.name===e.name?t+1:t}),0);if(i>1){var s=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});o.push({message:s,type:_r.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}(t,e,h,i)}));return l(d.concat(S,C,E,y,m,p,f,_,R,A,N))}function pn(e){return Ct(e)+"_#_"+e.idx+"_#_"+fn(e)}function fn(e){return e instanceof ft?e.terminalType.name:e instanceof st?e.nonTerminalName:""}var gn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return dn(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(_t),yn=/^[a-zA-Z_]\w*$/,wn=new RegExp(yn.source.replace("^","^\\$"));function vn(e,t,n,r){void 0===r&&(r=[]);var i=[],s=_n(t.definition);if(o(s))return[];var u=e.name;b(s,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:_r.LEFT_RECURSION,ruleName:u});var h=a(O(s,r.concat([e])),(function(t){var o=S(r);return o.push(t),vn(e,t,n,o)}));return i.concat(l(h))}function _n(e){var t=[];if(o(e))return t;var n=u(e);if(n instanceof st)t.push(n.referencedRule);else if(n instanceof lt||n instanceof ut||n instanceof ht||n instanceof ct||n instanceof mt||n instanceof dt)t=t.concat(_n(n.definition));else if(n instanceof pt)t=l(a(n.definition,(function(e){return _n(e.definition)})));else if(!(n instanceof ft))throw Error("non exhaustive match");var r=St(n),i=e.length>1;if(r&&i){var s=f(e);return t.concat(_n(s))}return t}var bn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return dn(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(_t),Sn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return dn(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(_t),Cn={buildMismatchTokenMessage:function(e){var t=e.expected,n=e.actual;return e.previous,e.ruleName,"Expecting "+(je(t)?"--\x3e "+Be(t)+" <--":"token of type --\x3e "+t.name+" <--")+" but found --\x3e '"+n.image+"' <--"},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;return e.ruleName,"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,n=e.actual,r=(e.previous,e.customUserDescription),o=(e.ruleName,"Expecting: "),i="\nbut found: '"+u(n).image+"'";if(r)return o+r+i;var s=a(M(t,(function(e,t){return e.concat(t)}),[]),(function(e){return"["+a(e,(function(e){return Be(e)})).join(", ")+"]"}));return o+"one of these possible Token sequences:\n"+a(s,(function(e,t){return" "+(t+1)+". "+e})).join("\n")+i},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,n=e.actual,r=e.customUserDescription,o=(e.ruleName,"Expecting: "),i="\nbut found: '"+u(n).image+"'";return r?o+r+i:o+"expecting at least one iteration which starts with one of these possible Token sequences::\n <"+a(t,(function(e){return"["+a(e,(function(e){return Be(e)})).join(",")+"]"})).join(" ,")+">"+i}};Object.freeze(Cn);var En={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},Mn={buildDuplicateFoundError:function(e,t){var n,r=e.name,o=u(t),i=o.idx,s=Ct(o),a=(n=o)instanceof ft?n.terminalType.name:n instanceof st?n.nonTerminalName:"",l="->"+s+(i>0?i:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+r+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return(l=l.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(e,t){return"Invalid nested rule name: ->"+t.name+"<- inside rule: ->"+e.name+"<-\nit must match the pattern: ->"+wn.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(e,t){return"Duplicate nested rule name: ->"+u(t).name+"<- inside rule: ->"+e.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=a(e.prefixPath,(function(e){return Be(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=a(e.prefixPath,(function(e){return Be(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\n"+"See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=Ct(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(e){return"Invalid Grammar Token name: ->"+e.tokenType.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+"> in inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n inside <"+e.topLevelRule.name+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(e){var t=e.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+t+" --\x3e "+a(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e ")+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(e){return"Invalid grammar rule name: ->"+e.topLevelRule.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(e){return"Duplicate definition, rule: ->"+(e.topLevelRule instanceof at?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}},Tn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rn=function(e){function t(t,n){var r=e.call(this)||this;return r.nameToTopRule=t,r.errMsgProvider=n,r.errors=[],r}return Tn(t,e),t.prototype.resolveRefs=function(){var e=this;c(s(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:_r.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(_t);function An(e){e=P(e,{errMsgProvider:En});var t,n,r,o={};return c(e.rules,(function(e){o[e.name]=e})),t=o,n=e.errMsgProvider,(r=new Rn(t,n)).resolveRefs(),r.errors}function Nn(e){return mn((e=P(e,{errMsgProvider:Mn,ignoredIssues:{}})).rules,e.maxLookahead,e.tokenTypes,e.ignoredIssues,e.errMsgProvider,e.grammarName)}function Ln(e){c(e.rules,(function(e){var t=new Et;e.accept(t),c(t.dslMethods,(function(e){c(e,(function(e,t){e.idx=t+1}))}))}))}var xn="MismatchedTokenException",On="NoViableAltException",In="EarlyExitException",kn="NotAllInputParsedException",Dn=[xn,On,In,kn];function Pn(e){return b(Dn,e.name)}function Hn(e,t,n){this.name=xn,this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function Fn(e,t,n){this.name=On,this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function Yn(e,t){this.name=kn,this.message=e,this.token=t,this.resyncedTokens=[]}function Vn(e,t,n){this.name=In,this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}Object.freeze(Dn),Hn.prototype=Error.prototype,Fn.prototype=Error.prototype,Yn.prototype=Error.prototype,Vn.prototype=Error.prototype;var Un={},Bn="InRuleRecoveryException";function Wn(e){this.name=Bn,this.message=e}Wn.prototype=Error.prototype;var jn=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=_(e,"recoveryEnabled")?e.recoveryEnabled:br.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=zn)},e.prototype.getTokenToInsert=function(e){var t=nt(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,n,r){for(var o=this,i=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],l=!1,u=this.LA(1),h=this.LA(1),c=function(){var e=o.LA(0),t=new Hn(o.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:u,previous:e,ruleName:o.getCurrRuleFullName()}),u,o.LA(0));t.resyncedTokens=g(a),o.SAVE_ERROR(t)};!l;){if(this.tokenMatcher(h,r))return void c();if(n.call(this))return c(),void e.apply(this,t);this.tokenMatcher(h,i)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,a))}this.importLexerState(s)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,n){return!1!==n&&void 0!==e&&void 0!==t&&!this.tokenMatcher(this.LA(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Wn("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(o(t))return!1;var r=this.LA(1);return void 0!==E(t,(function(e){return n.tokenMatcher(r,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey();return b(this.getFollowSetFromFollowKey(t),e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),n=2;;){var r=t.tokenType;if(b(e,r))return r;t=this.LA(n),n++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return Un;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return o(this.LAST_EXPLICIT_RULE_STACK)||(t=a(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_STACK[t]})),n=a(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_OCCURRENCE_STACK[t]}))),a(t,(function(r,o){return 0===o?Un:{ruleName:e.shortRuleNameToFullName(r),idxInCallingRule:n[o],inRule:e.shortRuleNameToFullName(t[o-1])}}))},e.prototype.flattenFollowSet=function(){var e=this;return l(a(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)})))},e.prototype.getFollowSetFromFollowKey=function(e){if(e===Un)return[tt];var t=e.ruleName+e.idxInCallingRule+Rt+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,tt)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],n=this.LA(1);!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return g(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,n,r,o,i,s){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:S(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return o(this.LAST_EXPLICIT_RULE_STACK)?a(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)})):a(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])}))},e}();function zn(e,t,n,r,o,i,s){var a=this.getKeyForAutomaticLookahead(r,o),l=this.firstAfterRepMap[a];if(void 0===l){var u=this.getCurrRuleFullName();l=new i(this.getGAstProductions()[u],o).startWalking(),this.firstAfterRepMap[a]=l}var h=l.token,c=l.occurrence,d=l.isEndOfRule;1===this.RULE_STACK.length&&d&&void 0===h&&(h=tt,c=1),this.shouldInRepetitionRecoveryBeTried(h,c,s)&&this.tryInRepetitionRecovery(e,t,n,h)}var Gn,$n=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=_(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:br.dynamicTokensEnabled,this.maxLookahead=_(e,"maxLookahead")?e.maxLookahead:br.maxLookahead,this.lookAheadFuncsCache=W()?new Map:[],W()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;c(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var n=function(e){Mt.reset(),e.accept(Mt);var t=Mt.dslMethods;return Mt.reset(),t}(e),r=n.alternation,o=n.repetition,i=n.option,s=n.repetitionMandatory,a=n.repetitionMandatoryWithSeparator,l=n.repetitionWithSeparator;c(r,(function(n){var r=0===n.idx?"":n.idx;t.TRACE_INIT(""+Ct(n)+r,(function(){var r,o,i,s,a,l,u=(r=n.idx,o=e,i=n.maxLookahead||t.maxLookahead,s=n.hasPredicates,a=t.dynamicTokensEnabled,(0,t.lookAheadBuilderForAlternatives)(l=ln(r,o,i),s,cn(l)?Le:Ne,a)),h=Pt(t.fullRuleNameToShort[e.name],Lt,n.idx);t.setLaFuncCache(h,u)}))})),c(o,(function(n){t.computeLookaheadFunc(e,n.idx,Ot,Zt.REPETITION,n.maxLookahead,Ct(n))})),c(i,(function(n){t.computeLookaheadFunc(e,n.idx,xt,Zt.OPTION,n.maxLookahead,Ct(n))})),c(s,(function(n){t.computeLookaheadFunc(e,n.idx,It,Zt.REPETITION_MANDATORY,n.maxLookahead,Ct(n))})),c(a,(function(n){t.computeLookaheadFunc(e,n.idx,Dt,Zt.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,Ct(n))})),c(l,(function(n){t.computeLookaheadFunc(e,n.idx,kt,Zt.REPETITION_WITH_SEPARATOR,n.maxLookahead,Ct(n))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,n,r,o,i){var s=this;this.TRACE_INIT(""+i+(0===t?"":t),(function(){var i=function(e,t,n,r,o,i){var s=un(e,t,o,n),a=cn(s)?Le:Ne;return i(s[0],a,r)}(t,e,o||s.maxLookahead,s.dynamicTokensEnabled,r,s.lookAheadBuilderForOptional),a=Pt(s.fullRuleNameToShort[e.name],n,t);s.setLaFuncCache(a,i)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,n){return function(e,t,n){var r=x(e,(function(e){return 1===e.length})),i=e.length;if(r&&!n){var s=l(e);if(1===s.length&&o(s[0].categoryMatches)){var a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}var u=M(s,(function(e,t,n){return e[t.tokenTypeIdx]=!0,c(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===u[e.tokenTypeIdx]}}return function(){e:for(var n=0;n config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=Y,this.setNodeLocationFromNode=Y,this.cstPostRule=Y,this.setInitialNodeLocation=Y}else this.cstInvocationStateUpdate=Y,this.cstFinallyStateUpdate=Y,this.cstPostTerminal=Y,this.cstPostNonTerminal=Y,this.cstPostRule=Y,this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstNestedInvocationStateUpdate=function(e,t){var n={name:e,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstInvocationStateUpdate=function(e,t){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},e.prototype.cstNestedFinallyStateUpdate=function(){var e=this.CST_STACK.pop();this.cstPostRule(e)},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var n,r,o,i=this.CST_STACK[this.CST_STACK.length-1];r=t,o=e,void 0===(n=i).children[o]?n.children[o]=[r]:n.children[o].push(r),this.setNodeLocationFromToken(i.location,t)},e.prototype.cstPostNonTerminal=function(e,t){if(!0!==this.isBackTracking()){var n=this.CST_STACK[this.CST_STACK.length-1];Ut(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if(m(this.baseCstVisitorConstructor)){var e=function(e,t){var n=function(){};Qn(n,e+"BaseSemantics");var r={visit:function(e,t){if(A(e)&&(e=e[0]),!m(e))return void 0!==e.fullName?this[e.fullName](e.children,t):this[e.name](e.children,t)},validateVisitor:function(){var e=function(e,t){var n=function(e,t){return T(a(t,(function(t){if(!p(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+qn(e.constructor)+" CST Visitor.",type:Gn.MISSING_METHOD,methodName:t}})))}(e,t),r=function(e,t){var n=[];for(var r in e)yn.test(r)&&p(e[r])&&!b(Zn,r)&&!b(t,r)&&n.push({msg:"Redundant visitor method: <"+r+"> on "+qn(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+yn.source+"/.",type:Gn.REDUNDANT_METHOD,methodName:r});return n}(e,t);return n.concat(r)}(this,t);if(!o(e)){var n=a(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+qn(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}};return(n.prototype=r).constructor=n,n._RULE_NAMES=t,n}(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(m(this.baseCstVisitorWithDefaultsConstructor)){var e=function(e,t,n){var r=function(){};Qn(r,e+"BaseSemanticsWithDefaults");var o=Object.create(n.prototype);return c(t,(function(e){o[e]=Jn})),(r.prototype=o).constructor=r,r}(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.nestedRuleBeforeClause=function(e,t){var n;return void 0!==e.NAME?(n=e.NAME,this.nestedRuleInvocationStateUpdate(n,t),n):void 0},e.prototype.nestedAltBeforeClause=function(e,t,n,r){var o,i=Ht(this.getLastExplicitRuleShortName(),n,t,r);return void 0!==e.NAME?(o=e.NAME,this.nestedRuleInvocationStateUpdate(o,i),{shortName:i,nestedName:o}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var n=this.CST_STACK,r=n[n.length-1];this.nestedRuleFinallyStateUpdate();var o=n[n.length-1];Ut(o,t,r),this.setNodeLocationFromNode(o.location,r.location)},e.prototype.getLastExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[e]},e.prototype.getLastExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[e]},e.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[e]},e.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e.prototype.nestedRuleInvocationStateUpdate=function(e,t){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(t),this.cstNestedInvocationStateUpdate(e,t)},e.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},e}(),tr=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!0,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):vr},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?vr:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}(),nr=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,n){return this.consumeInternal(t,e,n)},e.prototype.subrule=function(e,t,n){return this.subruleInternal(t,e,n)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,n){if(void 0===n&&(n=Sr),b(this.definedRulesNames,e)){var r={message:Mn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:_r.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(r)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,n);return this[e]=o,o},e.prototype.OVERRIDE_RULE=function(e,t,n){void 0===n&&(n=Sr);var r,o,i,s,a,l=[];l=l.concat((r=e,o=this.definedRulesNames,i=this.className,a=[],b(o,r)||(s="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+i+"<-as it is not defined in any of the super grammars ",a.push({message:s,type:_r.INVALID_RULE_OVERRIDE,ruleName:r})),a)),this.definitionErrors.push.apply(this.definitionErrors,l);var u=this.defineRule(e,t,n);return this[e]=u,u},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(Pn(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return gt(s(this.gastProductionsCache))},e}(),rr=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=qn(this.constructor),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Le,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},_(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(A(e)){if(o(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(A(e))this.tokensMap=M(e,(function(e,t){return e[t.name]=t,e}),{});else if(_(e,"modes")&&x(l(s(e.modes)),He)){var n=R(l(s(e.modes)));this.tokensMap=M(n,(function(e,t){return e[t.name]=t,e}),{})}else{if(!L(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=C(e)}this.tokensMap.EOF=tt;var r=x(s(e),(function(e){return o(e.categoryMatches)}));this.tokenMatcher=r?Le:Ne,Ie(s(this.tokensMap))},e.prototype.defineRule=function(e,t,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var r,o=_(n,"resyncEnabled")?n.resyncEnabled:Sr.resyncEnabled,i=_(n,"recoveryValueFunc")?n.recoveryValueFunc:Sr.recoveryValueFunc,s=this.ruleShortNameIdx<<12;function a(e){try{if(!0===this.outputCst){t.apply(this,e);var n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}return t.apply(this,e)}catch(e){return this.invokeRuleCatch(e,o,i)}finally{this.ruleFinallyStateUpdate()}}return this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s,(r=function(t,n){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(s,e,t),a.call(this,n)}).ruleName=e,r.originalGrammarAction=t,r},e.prototype.invokeRuleCatch=function(e,t,n){var r=1===this.RULE_STACK.length,o=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Pn(e)){var i=e;if(o){var s,a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))return i.resyncedTokens=this.reSyncTo(a),this.outputCst?((s=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,s):n();throw this.outputCst&&((s=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,i.partialCstResult=s),i}if(r)return this.moveToTerminatedState(),n();throw i}throw e},e.prototype.optionInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(xt,t),r=this.nestedRuleBeforeClause(e,n);try{return this.optionInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.optionInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(xt,t);return this.optionInternalLogic(e,t,n)},e.prototype.optionInternalLogic=function(e,t,n){var r,o,i=this,s=this.getLaFuncFromCache(n);if(void 0!==e.DEF){if(r=e.DEF,void 0!==(o=e.GATE)){var a=s;s=function(){return o.call(i)&&a.call(i)}}}else r=e;if(!0===s.call(this))return r.call(this)},e.prototype.atLeastOneInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(It,e),r=this.nestedRuleBeforeClause(t,n);try{return this.atLeastOneInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.atLeastOneInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(It,e);this.atLeastOneInternalLogic(e,t,n)},e.prototype.atLeastOneInternalLogic=function(e,t,n){var r,o,i=this,s=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(o=t.GATE)){var a=s;s=function(){return o.call(i)&&a.call(i)}}}else r=t;if(!0!==s.call(this))throw this.raiseEarlyExitException(e,Zt.REPETITION_MANDATORY,t.ERR_MSG);for(var l=this.doSingleRepetition(r);!0===s.call(this)&&!0===l;)l=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,It,e,Kt)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Dt,e),r=this.nestedRuleBeforeClause(t,n);try{this.atLeastOneSepFirstInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.atLeastOneSepFirstInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(Dt,e);this.atLeastOneSepFirstInternalLogic(e,t,n)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,n){var r=this,o=t.DEF,i=t.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(e,Zt.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);o.call(this);for(var s=function(){return r.tokenMatcher(r.LA(1),i)};!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,s,o,Xt],s,Dt,e,Xt)},e.prototype.manyInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Ot,e),r=this.nestedRuleBeforeClause(t,n);try{return this.manyInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.manyInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(Ot,e);return this.manyInternalLogic(e,t,n)},e.prototype.manyInternalLogic=function(e,t,n){var r,o,i=this,s=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(o=t.GATE)){var a=s;s=function(){return o.call(i)&&a.call(i)}}}else r=t;for(var l=!0;!0===s.call(this)&&!0===l;)l=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],s,Ot,e,Gt,l)},e.prototype.manySepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(kt,e),r=this.nestedRuleBeforeClause(t,n);try{this.manySepFirstInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.manySepFirstInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(kt,e);this.manySepFirstInternalLogic(e,t,n)},e.prototype.manySepFirstInternalLogic=function(e,t,n){var r=this,o=t.DEF,i=t.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){o.call(this);for(var s=function(){return r.tokenMatcher(r.LA(1),i)};!0===this.tokenMatcher(this.LA(1),i);)this.CONSUME(i),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,s,o,$t],s,kt,e,$t)}},e.prototype.repetitionSepSecondInternal=function(e,t,n,r,o){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,o],n,Dt,e,o)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternalNoCst=function(e,t){var n=A(e)?e:e.DEF,r=this.getKeyForAutomaticLookahead(Lt,t),o=this.getLaFuncFromCache(r).call(this,n);if(void 0!==o)return n[o].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Lt,t),r=this.nestedRuleBeforeClause(e,n);try{var o=A(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,o);if(void 0!==i){var s=o[i],a=this.nestedAltBeforeClause(s,t,Lt,i);try{return s.ALT.call(this)}finally{void 0!==a&&this.nestedRuleFinallyClause(a.shortName,a.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Yn(t,e))}},e.prototype.subruleInternal=function(e,t,n){var r;try{var o=void 0!==n?n.ARGS:void 0;return r=e.call(this,t,o),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(t){this.subruleInternalError(t,n,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,n){throw Pn(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,n){var r;try{var o=this.LA(1);!0===this.tokenMatcher(o,e)?(this.consumeToken(),r=o):this.consumeInternalError(e,o,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r},e.prototype.consumeInternalError=function(e,t,n){var r,o=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Hn(r,t,o))},e.prototype.consumeInternalRecovery=function(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===Bn?n:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=S(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),tt)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}(),or=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=P(e.errorMessageProvider,br.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if(Pn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:S(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return S(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,n){for(var r=this.getCurrRuleFullName(),o=un(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],i=[],s=1;s<=this.maxLookahead;s++)i.push(this.LA(s));var a=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:i,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Vn(a,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var n=this.getCurrRuleFullName(),r=ln(e,this.getGAstProductions()[n],this.maxLookahead),o=[],i=1;i<=this.maxLookahead;i++)o.push(this.LA(i));var s=this.LA(0),a=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:o,previous:s,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Fn(a,this.LA(1),s))},e}(),ir=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var n=this.gastProductionsCache[e];if(m(n))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return Qt([n],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=u(e.ruleStack),n=this.getGAstProductions()[t];return new jt(n,e).startWalking()},e}(),sr={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(sr);var ar=!0,lr=Math.pow(2,8)-1,ur=et({name:"RECORDING_PHASE_TOKEN",pattern:Ue.NA});Ie([ur]);var hr=nt(ur,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(hr);var cr={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},dr=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var n=t>0?t:"";e["CONSUME"+n]=function(e,n){return this.consumeInternalRecord(e,t,n)},e["SUBRULE"+n]=function(e,n){return this.subruleInternalRecord(e,t,n)},e["OPTION"+n]=function(e){return this.optionInternalRecord(e,t)},e["OR"+n]=function(e){return this.orInternalRecord(e,t)},e["MANY"+n]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+n]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+n]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+n]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=0;t<10;t++){var n=t>0?t:"";delete e["CONSUME"+n],delete e["SUBRULE"+n],delete e["OPTION"+n],delete e["OR"+n],delete e["MANY"+n],delete e["MANY_SEP"+n],delete e["AT_LEAST_ONE"+n],delete e["AT_LEAST_ONE_SEP"+n]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return vr},e.prototype.topLevelRuleRecord=function(e,t){try{var n=new at({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return mr.call(this,ut,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){mr.call(this,ht,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){mr.call(this,ct,t,e,ar)},e.prototype.manyInternalRecord=function(e,t){mr.call(this,dt,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){mr.call(this,mt,t,e,ar)},e.prototype.orInternalRecord=function(e,t){return pr.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,n){if(gr(t),!e||!1===_(e,"ruleName")){var r=new Error(" argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=z(this.recordingProdStack),i=e.ruleName,s=new st({idx:t,nonTerminalName:i,referencedRule:void 0});return o.definition.push(s),this.outputCst?cr:sr},e.prototype.consumeInternalRecord=function(e,t,n){if(gr(t),!De(e)){var r=new Error(" argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=z(this.recordingProdStack),i=new ft({idx:t,terminalType:e});return o.definition.push(i),hr},e}();function mr(e,t,n,r){void 0===r&&(r=!1),gr(n);var o=z(this.recordingProdStack),i=p(t)?t:t.DEF,s=new e({definition:[],idx:n});return _(t,"NAME")&&(s.name=t.NAME),r&&(s.separator=t.SEP),_(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),i.call(this),o.definition.push(s),this.recordingProdStack.pop(),sr}function pr(e,t){var n=this;gr(t);var r=z(this.recordingProdStack),o=!1===A(e),i=!1===o?e:e.DEF,s=new pt({definition:[],idx:t,ignoreAmbiguities:o&&!0===e.IGNORE_AMBIGUITIES});_(e,"NAME")&&(s.name=e.NAME),_(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD);var a=I(i,(function(e){return p(e.GATE)}));return s.hasPredicates=a,r.definition.push(s),c(i,(function(e){var t=new lt({definition:[]});s.definition.push(t),_(e,"NAME")&&(t.name=e.NAME),_(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:_(e,"GATE")&&(t.ignoreAmbiguities=!0),n.recordingProdStack.push(t),e.ALT.call(n),n.recordingProdStack.pop()})),sr}function fr(e){return 0===e?"":""+e}function gr(e){if(e<0||e>lr){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(lr+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}var yr=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if(_(e,"traceInitPerf")){var t=e.traceInitPerf,n="number"==typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=br.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent");var r=G(t),o=r.time,i=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,i}return t()},e}(),wr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vr=nt(tt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(vr);var _r,br=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Cn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Sr=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function Cr(e){return void 0===e&&(e=void 0),function(){return e}}!function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.INVALID_NESTED_RULE_NAME=10]="INVALID_NESTED_RULE_NAME",e[e.DUPLICATE_NESTED_NAME=11]="DUPLICATE_NESTED_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=12]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=13]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=14]="TOO_MANY_ALTS"}(_r||(_r={}));var Er,Mr=function(){function e(e,t){void 0===t&&(t=br),this.ignoredIssues=br.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),_(t,"ignoredIssues")&&t.ignoredIssues!==br.ignoredIssues&&B("The IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the flag on the relevant DSL method instead."),this.ignoredIssues=_(t,"ignoredIssues")?t.ignoredIssues:br.ignoredIssues,this.skipValidations=_(t,"skipValidations")?t.skipValidations:br.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var n;t.selfAnalysisDone=!0;var r=t.className;t.TRACE_INIT("toFastProps",(function(){j(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),c(t.definedRulesNames,(function(e){var n=t[e].originalGrammarAction,r=void 0;t.TRACE_INIT(e+" Rule",(function(){r=t.topLevelRuleRecord(e,n)})),t.gastProductionsCache[e]=r}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=An({rules:s(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,i)})),t.TRACE_INIT("Grammar Validations",(function(){if(o(i)&&!1===t.skipValidations){var e=Nn({rules:s(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:s(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:Mn,grammarName:r});t.definitionErrors.push.apply(t.definitionErrors,e)}})),o(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e,n,r=(e=s(t.gastProductionsCache),n={},c(e,(function(e){var t=new Nt(e).startWalking();k(n,t)})),n);t.resyncFollows=r})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions(s(t.gastProductionsCache))}))),t.TRACE_INIT("expandAllNestedRuleNames",(function(){var e,n,r,o=(e=s(t.gastProductionsCache),n=t.fullRuleNameToShort,r={allRuleNames:[]},c(e,(function(e){var t=n[e.name];r.allRuleNames.push(e.name);var o=new Bt(t);e.accept(o),c(o.result,(function(t){t.def,t.key;var n=t.name;r.allRuleNames.push(e.name+n)}))})),r);t.allRuleNames=o.allRuleNames})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!o(t.definitionErrors))throw n=a(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+n.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();Er=Mr,[jn,$n,er,tr,rr,nr,or,ir,dr,yr].forEach((function(e){var t=e.prototype;Object.getOwnPropertyNames(t).forEach((function(n){if("constructor"!==n){var r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(Er.prototype,n,r):Er.prototype[n]=e.prototype[n]}}))}));var Tr=function(e){function t(t,n){void 0===n&&(n=br);var r=C(n);return r.outputCst=!0,e.call(this,t,r)||this}return wr(t,e),t}(Mr),Rr=function(e){function t(t,n){void 0===n&&(n=br);var r=C(n);return r.outputCst=!1,e.call(this,t,r)||this}return wr(t,e),t}(Mr);function Ar(e,t){var n=void 0===t?{}:t,o=n.resourceBase,i=void 0===o?"https://unpkg.com/chevrotain@"+r+"/diagrams/":o,s=n.css;return"\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n\n\n\n