diff --git a/static/assets/Contoso-ff70ad88.svg b/static/assets/Contoso-ff70ad88.svg new file mode 100644 index 0000000000..b72cf30b8f --- /dev/null +++ b/static/assets/Contoso-ff70ad88.svg @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/static/assets/index-b392843b.js b/static/assets/index-274bb812.js similarity index 99% rename from static/assets/index-b392843b.js rename to static/assets/index-274bb812.js index b2a62d1300..9b99229d11 100644 --- a/static/assets/index-b392843b.js +++ b/static/assets/index-274bb812.js @@ -3629,10 +3629,10 @@ void main() { `))):Z=re.stylize("[Circular]","special")),w(ie)){if(J&&te.match(/^\d+$/))return Z;ie=JSON.stringify(""+te),ie.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ie=ie.slice(1,-1),ie=re.stylize(ie,"name")):(ie=ie.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ie=re.stylize(ie,"string"))}return ie+": "+Z}function m(re,ae,oe){var de=re.reduce(function(te,J){return J.indexOf(` `)>=0,te+J.replace(/\u001b\[\d\d?m/g,"").length+1},0);return de>60?oe[0]+(ae===""?"":ae+` `)+" "+re.join(`, - `)+" "+oe[1]:oe[0]+ae+" "+re.join(", ")+" "+oe[1]}D.types=r(41088);function C(re){return Array.isArray(re)}D.isArray=C;function g(re){return typeof re=="boolean"}D.isBoolean=g;function f(re){return re===null}D.isNull=f;function x(re){return re==null}D.isNullOrUndefined=x;function M(re){return typeof re=="number"}D.isNumber=M;function R(re){return typeof re=="string"}D.isString=R;function N(re){return typeof re=="symbol"}D.isSymbol=N;function w(re){return re===void 0}D.isUndefined=w;function P(re){return I(re)&&z(re)==="[object RegExp]"}D.isRegExp=P,D.types.isRegExp=P;function I(re){return typeof re=="object"&&re!==null}D.isObject=I;function d(re){return I(re)&&z(re)==="[object Date]"}D.isDate=d,D.types.isDate=d;function L(re){return I(re)&&(z(re)==="[object Error]"||re instanceof Error)}D.isError=L,D.types.isNativeError=L;function E(re){return typeof re=="function"}D.isFunction=E;function B(re){return re===null||typeof re=="boolean"||typeof re=="number"||typeof re=="string"||typeof re=="symbol"||typeof re>"u"}D.isPrimitive=B,D.isBuffer=r(75272);function z(re){return Object.prototype.toString.call(re)}function Y(re){return re<10?"0"+re.toString(10):re.toString(10)}var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function G(){var re=new Date,ae=[Y(re.getHours()),Y(re.getMinutes()),Y(re.getSeconds())].join(":");return[re.getDate(),H[re.getMonth()],ae].join(" ")}D.log=function(){console.log("%s - %s",G(),D.format.apply(D,arguments))},D.inherits=r(6768),D._extend=function(re,ae){if(!ae||!I(ae))return re;for(var oe=Object.keys(ae),de=oe.length;de--;)re[oe[de]]=ae[oe[de]];return re};function W(re,ae){return Object.prototype.hasOwnProperty.call(re,ae)}var V=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;D.promisify=function(ae){if(typeof ae!="function")throw new TypeError('The "original" argument must be of type Function');if(V&&ae[V]){var oe=ae[V];if(typeof oe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(oe,V,{value:oe,enumerable:!1,writable:!1,configurable:!0}),oe}function oe(){for(var de,te,J=new Promise(function(ue,fe){de=ue,te=fe}),ie=[],Z=0;Z"u"?r.g:globalThis,n=A(),l=_("String.prototype.slice"),s=Object.getPrototypeOf,h=_("Array.prototype.indexOf",!0)||function(C,g){for(var f=0;f-1?g:g!=="Object"?!1:b(C)}return T?u(C):null}},67020:function(k,D,r){var c=r(38700),A=r(50896),o=c.instance();function _(v){this.local=this.regionalOptions[v||""]||this.regionalOptions[""]}_.prototype=new c.baseCalendar,A(_.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(v,u){if(typeof v=="string"){var b=v.match(p);return b?b[0]:""}var m=this._validateYear(v),C=v.month(),g=""+this.toChineseMonth(m,C);return u&&g.length<2&&(g="0"+g),this.isIntercalaryMonth(m,C)&&(g+="i"),g},monthNames:function(v){if(typeof v=="string"){var u=v.match(y);return u?u[0]:""}var b=this._validateYear(v),m=v.month(),C=this.toChineseMonth(b,m),g=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][C-1];return this.isIntercalaryMonth(b,m)&&(g="闰"+g),g},monthNamesShort:function(v){if(typeof v=="string"){var u=v.match(a);return u?u[0]:""}var b=this._validateYear(v),m=v.month(),C=this.toChineseMonth(b,m),g=["一","二","三","四","五","六","七","八","九","十","十一","十二"][C-1];return this.isIntercalaryMonth(b,m)&&(g="闰"+g),g},parseMonth:function(v,u){v=this._validateYear(v);var b=parseInt(u),m;if(isNaN(b))u[0]==="闰"&&(m=!0,u=u.substring(1)),u[u.length-1]==="月"&&(u=u.substring(0,u.length-1)),b=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(u);else{var C=u[u.length-1];m=C==="i"||C==="I"}var g=this.toMonthIndex(v,b,m);return g},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(v,u){if(v.year&&(v=v.year()),typeof v!="number"||v<1888||v>2111)throw u.replace(/\{0\}/,this.local.name);return v},toMonthIndex:function(v,u,b){var m=this.intercalaryMonth(v),C=b&&u!==m;if(C||u<1||u>12)throw c.local.invalidMonth.replace(/\{0\}/,this.local.name);var g;return m?!b&&u<=m?g=u-1:g=u:g=u-1,g},toChineseMonth:function(v,u){v.year&&(v=v.year(),u=v.month());var b=this.intercalaryMonth(v),m=b?12:11;if(u<0||u>m)throw c.local.invalidMonth.replace(/\{0\}/,this.local.name);var C;return b?u>13;return b},isIntercalaryMonth:function(v,u){v.year&&(v=v.year(),u=v.month());var b=this.intercalaryMonth(v);return!!b&&b===u},leapYear:function(v){return this.intercalaryMonth(v)!==0},weekOfYear:function(v,u,b){var m=this._validateYear(v,c.local.invalidyear),C=l[m-l[0]],g=C>>9&4095,f=C>>5&15,x=C&31,M;M=o.newDate(g,f,x),M.add(4-(M.dayOfWeek()||7),"d");var R=this.toJD(v,u,b)-M.toJD();return 1+Math.floor(R/7)},monthsInYear:function(v){return this.leapYear(v)?13:12},daysInMonth:function(v,u){v.year&&(u=v.month(),v=v.year()),v=this._validateYear(v);var b=n[v-n[0]],m=b>>13,C=m?12:11;if(u>C)throw c.local.invalidMonth.replace(/\{0\}/,this.local.name);var g=b&1<<12-u?30:29;return g},weekDay:function(v,u,b){return(this.dayOfWeek(v,u,b)||7)<6},toJD:function(v,u,b){var m=this._validate(v,g,b,c.local.invalidDate);v=this._validateYear(m.year()),u=m.month(),b=m.day();var C=this.isIntercalaryMonth(v,u),g=this.toChineseMonth(v,u),f=h(v,g,b,C);return o.toJD(f.year,f.month,f.day)},fromJD:function(v){var u=o.fromJD(v),b=s(u.year(),u.month(),u.day()),m=this.toMonthIndex(b.year,b.month,b.isIntercalary);return this.newDate(b.year,m,b.day)},fromString:function(v){var u=v.match(T),b=this._validateYear(+u[1]),m=+u[2],C=!!u[3],g=this.toMonthIndex(b,m,C),f=+u[4];return this.newDate(b,g,f)},add:function(v,u,b){var m=v.year(),C=v.month(),g=this.isIntercalaryMonth(m,C),f=this.toChineseMonth(m,C),x=Object.getPrototypeOf(_.prototype).add.call(this,v,u,b);if(b==="y"){var M=x.year(),R=x.month(),N=this.isIntercalaryMonth(M,f),w=g&&N?this.toMonthIndex(M,f,!0):this.toMonthIndex(M,f,!1);w!==R&&x.month(w)}return x}});var T=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,p=/^\d?\d[iI]?/m,y=/^闰?十?[一二三四五六七八九]?月/m,a=/^闰?十?[一二三四五六七八九]?/m;c.calendars.chinese=_;var n=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function s(v,u,b,m){var C,g;if(typeof v=="object")C=v,g=u||{};else{var f=typeof v=="number"&&v>=1888&&v<=2111;if(!f)throw new Error("Solar year outside range 1888-2111");var x=typeof u=="number"&&u>=1&&u<=12;if(!x)throw new Error("Solar month outside range 1 - 12");var M=typeof b=="number"&&b>=1&&b<=31;if(!M)throw new Error("Solar day outside range 1 - 31");C={year:v,month:u,day:b},g=m||{}}var R=l[C.year-l[0]],N=C.year<<9|C.month<<5|C.day;g.year=N>=R?C.year:C.year-1,R=l[g.year-l[0]];var w=R>>9&4095,P=R>>5&15,I=R&31,d,L=new Date(w,P-1,I),E=new Date(C.year,C.month-1,C.day);d=Math.round((E-L)/864e5);var B=n[g.year-n[0]],z;for(z=0;z<13;z++){var Y=B&1<<12-z?30:29;if(d>13;return!H||z=1888&&v<=2111;if(!x)throw new Error("Lunar year outside range 1888-2111");var M=typeof u=="number"&&u>=1&&u<=12;if(!M)throw new Error("Lunar month outside range 1 - 12");var R=typeof b=="number"&&b>=1&&b<=30;if(!R)throw new Error("Lunar day outside range 1 - 30");var N;typeof m=="object"?(N=!1,g=m):(N=!!m,g=C||{}),f={year:v,month:u,day:b,isIntercalary:N}}var w;w=f.day-1;var P=n[f.year-n[0]],I=P>>13,d;I&&(f.month>I||f.isIntercalary)?d=f.month:d=f.month-1;for(var L=0;L>9&4095,Y=B>>5&15,H=B&31,G=new Date(z,Y-1,H+w);return g.year=G.getFullYear(),g.month=1+G.getMonth(),g.day=G.getDate(),g}},89792:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(p){var T=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),p=T.year()+(T.year()<0?1:0);return p%4===3||p%4===-1},monthsInYear:function(_){return this._validate(_,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),13},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===13&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return(this.dayOfWeek(_,T,p)||7)<6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),_<0&&_++,y.day()+(y.month()-1)*30+(_-1)*365+Math.floor(_/4)+this.jdEpoch-1},fromJD:function(_){var T=Math.floor(_)+.5-this.jdEpoch,p=Math.floor((T-Math.floor((T+366)/1461))/365)+1;p<=0&&p--,T=Math.floor(_)+.5-this.newDate(p,1,1).toJD();var y=Math.floor(T/30)+1,a=T-(y-1)*30+1;return this.newDate(p,y,a)}}),c.calendars.coptic=o},55668:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),!1},monthsInYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),13},daysInYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),400},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/8)+1},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return(a.day()+1)%8},weekDay:function(T,p,y){var a=this.dayOfWeek(T,p,y);return a>=2&&a<=6},extraInfo:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return{century:_[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return T=a.year()+(a.year()<0?1:0),p=a.month(),y=a.day(),y+(p>1?16:0)+(p>2?(p-2)*32:0)+(T-1)*400+this.jdEpoch-1},fromJD:function(T){T=Math.floor(T+.5)-Math.floor(this.jdEpoch)-1;var p=Math.floor(T/400)+1;T-=(p-1)*400,T+=T>15?16:0;var y=Math.floor(T/32)+1,a=T-(y-1)*32+1;return this.newDate(p<=0?p-1:p,y,a)}});var _={20:"Fruitbat",21:"Anchovy"};c.calendars.discworld=o},65168:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(p){var T=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),p=T.year()+(T.year()<0?1:0);return p%4===3||p%4===-1},monthsInYear:function(_){return this._validate(_,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),13},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===13&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return(this.dayOfWeek(_,T,p)||7)<6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),_<0&&_++,y.day()+(y.month()-1)*30+(_-1)*365+Math.floor(_/4)+this.jdEpoch-1},fromJD:function(_){var T=Math.floor(_)+.5-this.jdEpoch,p=Math.floor((T-Math.floor((T+366)/1461))/365)+1;p<=0&&p--,T=Math.floor(_)+.5-this.newDate(p,1,1).toJD();var y=Math.floor(T/30)+1,a=T-(y-1)*30+1;return this.newDate(p,y,a)}}),c.calendars.ethiopian=o},2084:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return this._leapYear(p.year())},_leapYear:function(T){return T=T<0?T+1:T,_(T*7+1,19)<7},monthsInYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),this._leapYear(T.year?T.year():T)?13:12},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return T=p.year(),this.toJD(T===-1?1:T+1,7,1)-this.toJD(T,7,1)},daysInMonth:function(T,p){return T.year&&(p=T.month(),T=T.year()),this._validate(T,p,this.minDay,c.local.invalidMonth),p===12&&this.leapYear(T)||p===8&&_(this.daysInYear(T),10)===5?30:p===9&&_(this.daysInYear(T),10)===3?29:this.daysPerMonth[p-1]},weekDay:function(T,p,y){return this.dayOfWeek(T,p,y)!==6},extraInfo:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);T=a.year(),p=a.month(),y=a.day();var n=T<=0?T+1:T,l=this.jdEpoch+this._delay1(n)+this._delay2(n)+y+1;if(p<7){for(var s=7;s<=this.monthsInYear(T);s++)l+=this.daysInMonth(T,s);for(var s=1;s=this.toJD(p===-1?1:p+1,7,1);)p++;for(var y=Tthis.toJD(p,y,this.daysInMonth(p,y));)y++;var a=T-this.toJD(p,y,1)+1;return this.newDate(p,y,a)}});function _(T,p){return T-p*Math.floor(T/p)}c.calendars.hebrew=o},26368:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(_){var T=this._validate(_,this.minMonth,this.minDay,c.local.invalidYear);return(T.year()*11+14)%30<11},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInYear:function(_){return this.leapYear(_)?355:354},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===12&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return this.dayOfWeek(_,T,p)!==5},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),T=y.month(),p=y.day(),_=_<=0?_+1:_,p+Math.ceil(29.5*(T-1))+(_-1)*354+Math.floor((3+11*_)/30)+this.jdEpoch-1},fromJD:function(_){_=Math.floor(_)+.5;var T=Math.floor((30*(_-this.jdEpoch)+10646)/10631);T=T<=0?T-1:T;var p=Math.min(12,Math.ceil((_-29-this.toJD(T,1,1))/29.5)+1),y=_-this.toJD(T,p,1)+1;return this.newDate(T,p,y)}}),c.calendars.islamic=o},24747:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(p){var T=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),p=T.year()<0?T.year()+1:T.year();return p%4===0},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(4-(y.dayOfWeek()||7),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===2&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return(this.dayOfWeek(_,T,p)||7)<6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),T=y.month(),p=y.day(),_<0&&_++,T<=2&&(_--,T+=12),Math.floor(365.25*(_+4716))+Math.floor(30.6001*(T+1))+p-1524.5},fromJD:function(_){var T=Math.floor(_+.5),p=T+1524,y=Math.floor((p-122.1)/365.25),a=Math.floor(365.25*y),n=Math.floor((p-a)/30.6001),l=n-Math.floor(n<14?1:13),s=y-Math.floor(l>2?4716:4715),h=p-a-Math.floor(30.6001*n);return s<=0&&s--,this.newDate(s,l,h)}}),c.calendars.julian=o},65616:function(k,D,r){var c=r(38700),A=r(50896);function o(p){this.local=this.regionalOptions[p||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(p){return this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),!1},formatYear:function(p){var y=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear);p=y.year();var a=Math.floor(p/400);p=p%400,p+=p<0?400:0;var n=Math.floor(p/20);return a+"."+n+"."+p%20},forYear:function(p){if(p=p.split("."),p.length<3)throw"Invalid Mayan year";for(var y=0,a=0;a19||a>0&&n<0)throw"Invalid Mayan year";y=y*20+n}return y},monthsInYear:function(p){return this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),18},weekOfYear:function(p,y,a){return this._validate(p,y,a,c.local.invalidDate),0},daysInYear:function(p){return this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),360},daysInMonth:function(p,y){return this._validate(p,y,this.minDay,c.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(p,y,a){var n=this._validate(p,y,a,c.local.invalidDate);return n.day()},weekDay:function(p,y,a){return this._validate(p,y,a,c.local.invalidDate),!0},extraInfo:function(p,y,a){var n=this._validate(p,y,a,c.local.invalidDate),l=n.toJD(),s=this._toHaab(l),h=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[s[0]-1],haabMonth:s[0],haabDay:s[1],tzolkinDayName:this.local.tzolkinMonths[h[0]-1],tzolkinDay:h[0],tzolkinTrecena:h[1]}},_toHaab:function(p){p-=this.jdEpoch;var y=_(p+8+(18-1)*20,365);return[Math.floor(y/20)+1,_(y,20)]},_toTzolkin:function(p){return p-=this.jdEpoch,[T(p+20,20),T(p+4,13)]},toJD:function(p,y,a){var n=this._validate(p,y,a,c.local.invalidDate);return n.day()+n.month()*20+n.year()*360+this.jdEpoch},fromJD:function(p){p=Math.floor(p)+.5-this.jdEpoch;var y=Math.floor(p/360);p=p%360,p+=p<0?360:0;var a=Math.floor(p/20),n=p%20;return this.newDate(y,a,n)}});function _(p,y){return p-y*Math.floor(p/y)}function T(p,y){return _(p-1,y)+1}c.calendars.mayan=o},30632:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar;var _=c.instance("gregorian");A(o.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return _.leapYear(p.year()+(p.year()<1?1:0)+1469)},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(1-(a.dayOfWeek()||7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===12&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return(this.dayOfWeek(T,p,y)||7)<6},toJD:function(n,p,y){var a=this._validate(n,p,y,c.local.invalidMonth),n=a.year();n<0&&n++;for(var l=a.day(),s=1;s=this.toJD(p+1,1,1);)p++;for(var y=T-Math.floor(this.toJD(p,1,1)+.5)+1,a=1;y>this.daysInMonth(p,a);)y-=this.daysInMonth(p,a),a++;return this.newDate(p,a,y)}}),c.calendars.nanakshahi=o},73040:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(_){return this.daysInYear(_)!==this.daysPerYear},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInYear:function(_){var T=this._validate(_,this.minMonth,this.minDay,c.local.invalidYear);if(_=T.year(),typeof this.NEPALI_CALENDAR_DATA[_]>"u")return this.daysPerYear;for(var p=0,y=this.minMonth;y<=12;y++)p+=this.NEPALI_CALENDAR_DATA[_][y];return p},daysInMonth:function(_,T){return _.year&&(T=_.month(),_=_.year()),this._validate(_,T,this.minDay,c.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[_]>"u"?this.daysPerMonth[T-1]:this.NEPALI_CALENDAR_DATA[_][T]},weekDay:function(_,T,p){return this.dayOfWeek(_,T,p)!==6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);_=y.year(),T=y.month(),p=y.day();var a=c.instance(),n=0,l=T,s=_;this._createMissingCalendarData(_);var h=_-(l>9||l===9&&p>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(T!==9&&(n=p,l--);l!==9;)l<=0&&(l=12,s--),n+=this.NEPALI_CALENDAR_DATA[s][l],l--;return T===9?(n+=p-this.NEPALI_CALENDAR_DATA[s][0],n<0&&(n+=a.daysInYear(h))):n+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],a.newDate(h,1,1).add(n,"d").toJD()},fromJD:function(_){var T=c.instance(),p=T.fromJD(_),y=p.year(),a=p.dayOfYear(),n=y+56;this._createMissingCalendarData(n);for(var l=9,s=this.NEPALI_CALENDAR_DATA[n][0],h=this.NEPALI_CALENDAR_DATA[n][l]-s+1;a>h;)l++,l>12&&(l=1,n++),h+=this.NEPALI_CALENDAR_DATA[n][l];var v=this.NEPALI_CALENDAR_DATA[n][l]-(h-a);return this.newDate(n,l,v)},_createMissingCalendarData:function(_){var T=this.daysPerMonth.slice(0);T.unshift(17);for(var p=_-1;p<_+2;p++)typeof this.NEPALI_CALENDAR_DATA[p]>"u"&&(this.NEPALI_CALENDAR_DATA[p]=T)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),c.calendars.nepali=o},1104:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return((p.year()-(p.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-((a.dayOfWeek()+1)%7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===12&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return this.dayOfWeek(T,p,y)!==5},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);T=a.year(),p=a.month(),y=a.day();var n=T-(T>=0?474:473),l=474+_(n,2820);return y+(p<=7?(p-1)*31:(p-1)*30+6)+Math.floor((l*682-110)/2816)+(l-1)*365+Math.floor(n/2820)*1029983+this.jdEpoch-1},fromJD:function(T){T=Math.floor(T)+.5;var p=T-this.toJD(475,1,1),y=Math.floor(p/1029983),a=_(p,1029983),n=2820;if(a!==1029982){var l=Math.floor(a/366),s=_(a,366);n=Math.floor((2134*l+2816*s+2815)/1028522)+l+1}var h=n+2820*y+474;h=h<=0?h-1:h;var v=T-this.toJD(h,1,1)+1,u=v<=186?Math.ceil(v/31):Math.ceil((v-6)/30),b=T-this.toJD(h,u,1)+1;return this.newDate(h,u,b)}});function _(T,p){return T-p*Math.floor(T/p)}c.calendars.persian=o,c.calendars.jalali=o},51456:function(k,D,r){var c=r(38700),A=r(50896),o=c.instance();function _(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}_.prototype=new c.baseCalendar,A(_.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(y){var p=this._validate(y,this.minMonth,this.minDay,c.local.invalidYear),y=this._t2gYear(p.year());return o.leapYear(y)},weekOfYear:function(n,p,y){var a=this._validate(n,this.minMonth,this.minDay,c.local.invalidYear),n=this._t2gYear(a.year());return o.weekOfYear(n,a.month(),a.day())},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===2&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return(this.dayOfWeek(T,p,y)||7)<6},toJD:function(n,p,y){var a=this._validate(n,p,y,c.local.invalidDate),n=this._t2gYear(a.year());return o.toJD(n,a.month(),a.day())},fromJD:function(T){var p=o.fromJD(T),y=this._g2tYear(p.year());return this.newDate(y,p.month(),p.day())},_t2gYear:function(T){return T+this.yearsOffset+(T>=-this.yearsOffset&&T<=-1?1:0)},_g2tYear:function(T){return T-this.yearsOffset-(T>=1&&T<=this.yearsOffset?1:0)}}),c.calendars.taiwan=_},4592:function(k,D,r){var c=r(38700),A=r(50896),o=c.instance();function _(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}_.prototype=new c.baseCalendar,A(_.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(y){var p=this._validate(y,this.minMonth,this.minDay,c.local.invalidYear),y=this._t2gYear(p.year());return o.leapYear(y)},weekOfYear:function(n,p,y){var a=this._validate(n,this.minMonth,this.minDay,c.local.invalidYear),n=this._t2gYear(a.year());return o.weekOfYear(n,a.month(),a.day())},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===2&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return(this.dayOfWeek(T,p,y)||7)<6},toJD:function(n,p,y){var a=this._validate(n,p,y,c.local.invalidDate),n=this._t2gYear(a.year());return o.toJD(n,a.month(),a.day())},fromJD:function(T){var p=o.fromJD(T),y=this._g2tYear(p.year());return this.newDate(y,p.month(),p.day())},_t2gYear:function(T){return T-this.yearsOffset-(T>=1&&T<=this.yearsOffset?1:0)},_g2tYear:function(T){return T+this.yearsOffset+(T>=-this.yearsOffset&&T<=-1?1:0)}}),c.calendars.thai=_},45348:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return this.daysInYear(p.year())===355},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(T){for(var p=0,y=1;y<=12;y++)p+=this.daysInMonth(T,y);return p},daysInMonth:function(T,p){for(var y=this._validate(T,p,this.minDay,c.local.invalidMonth),a=y.toJD()-24e5+.5,n=0,l=0;l<_.length;l++){if(_[l]>a)return _[n]-_[n-1];n++}return 30},weekDay:function(T,p,y){return this.dayOfWeek(T,p,y)!==5},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate),n=12*(a.year()-1)+a.month()-15292,l=a.day()+_[n-1]-1;return l+24e5-.5},fromJD:function(T){for(var p=T-24e5+.5,y=0,a=0;a<_.length&&!(_[a]>p);a++)y++;var n=y+15292,l=Math.floor((n-1)/12),s=l+1,h=n-12*l,v=p-_[y-1]+1;return this.newDate(s,h,v)},isValid:function(T,p,y){var a=c.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(T=T.year!=null?T.year:T,a=T>=1276&&T<=1500),a},_validate:function(T,p,y,a){var n=c.baseCalendar.prototype._validate.apply(this,arguments);if(n.year<1276||n.year>1500)throw a.replace(/\{0\}/,this.local.name);return n}}),c.calendars.ummalqura=o;var _=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},38700:function(k,D,r){var c=r(50896);function A(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}c(A.prototype,{instance:function(a,n){a=(a||"gregorian").toLowerCase(),n=n||"";var l=this._localCals[a+"-"+n];if(!l&&this.calendars[a]&&(l=new this.calendars[a](n),this._localCals[a+"-"+n]=l),!l)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,a);return l},newDate:function(a,n,l,s,h){return s=(a!=null&&a.year?a.calendar():typeof s=="string"?this.instance(s,h):s)||this.instance(),s.newDate(a,n,l)},substituteDigits:function(a){return function(n){return(n+"").replace(/[0-9]/g,function(l){return a[l]})}},substituteChineseDigits:function(a,n){return function(l){for(var s="",h=0;l>0;){var v=l%10;s=(v===0?"":a[v]+n[h])+s,h++,l=Math.floor(l/10)}return s.indexOf(a[1]+n[1])===0&&(s=s.substr(1)),s||a[0]}}});function o(a,n,l,s){if(this._calendar=a,this._year=n,this._month=l,this._day=s,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(y.local.invalidDate||y.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function _(a,n){return a=""+a,"000000".substring(0,n-a.length)+a}c(o.prototype,{newDate:function(a,n,l){return this._calendar.newDate(a??this,n,l)},year:function(a){return arguments.length===0?this._year:this.set(a,"y")},month:function(a){return arguments.length===0?this._month:this.set(a,"m")},day:function(a){return arguments.length===0?this._day:this.set(a,"d")},date:function(a,n,l){if(!this._calendar.isValid(a,n,l))throw(y.local.invalidDate||y.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=a,this._month=n,this._day=l,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(a,n){return this._calendar.add(this,a,n)},set:function(a,n){return this._calendar.set(this,a,n)},compareTo:function(a){if(this._calendar.name!==a._calendar.name)throw(y.local.differentCalendars||y.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,a._calendar.local.name);var n=this._year!==a._year?this._year-a._year:this._month!==a._month?this.monthOfYear()-a.monthOfYear():this._day-a._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(a){return this._calendar.fromJD(a)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(a){return this._calendar.fromJSDate(a)},toString:function(){return(this.year()<0?"-":"")+_(Math.abs(this.year()),4)+"-"+_(this.month(),2)+"-"+_(this.day(),2)}});function T(){this.shortYearCutoff="+10"}c(T.prototype,{_validateLevel:0,newDate:function(a,n,l){return a==null?this.today():(a.year&&(this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate),l=a.day(),n=a.month(),a=a.year()),new o(this,a,n,l))},today:function(){return this.fromJSDate(new Date)},epoch:function(a){var n=this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(a){var n=this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+_(Math.abs(n.year()),4)},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear),12},monthOfYear:function(a,n){var l=this._validate(a,n,this.minDay,y.local.invalidMonth||y.regionalOptions[""].invalidMonth);return(l.month()+this.monthsInYear(l)-this.firstMonth)%this.monthsInYear(l)+this.minMonth},fromMonthOfYear:function(a,n){var l=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(a)+this.minMonth;return this._validate(a,l,this.minDay,y.local.invalidMonth||y.regionalOptions[""].invalidMonth),l},daysInYear:function(a){var n=this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(a,n,l){var s=this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate);return s.toJD()-this.newDate(s.year(),this.fromMonthOfYear(s.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(a,n,l){var s=this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(s))+2)%this.daysInWeek()},extraInfo:function(a,n,l){return this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate),{}},add:function(a,n,l){return this._validate(a,this.minMonth,this.minDay,y.local.invalidDate||y.regionalOptions[""].invalidDate),this._correctAdd(a,this._add(a,n,l),n,l)},_add:function(a,n,l){if(this._validateLevel++,l==="d"||l==="w"){var s=a.toJD()+n*(l==="w"?this.daysInWeek():1),h=a.calendar().fromJD(s);return this._validateLevel--,[h.year(),h.month(),h.day()]}try{var v=a.year()+(l==="y"?n:0),u=a.monthOfYear()+(l==="m"?n:0),h=a.day(),b=function(g){for(;uf-1+g.minMonth;)v++,u-=f,f=g.monthsInYear(v)};l==="y"?(a.month()!==this.fromMonthOfYear(v,u)&&(u=this.newDate(v,a.month(),this.minDay).monthOfYear()),u=Math.min(u,this.monthsInYear(v)),h=Math.min(h,this.daysInMonth(v,this.fromMonthOfYear(v,u)))):l==="m"&&(b(this),h=Math.min(h,this.daysInMonth(v,this.fromMonthOfYear(v,u))));var m=[v,this.fromMonthOfYear(v,u),h];return this._validateLevel--,m}catch(C){throw this._validateLevel--,C}},_correctAdd:function(a,n,l,s){if(!this.hasYearZero&&(s==="y"||s==="m")&&(n[0]===0||a.year()>0!=n[0]>0)){var h={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[s],v=l<0?-1:1;n=this._add(a,l*h[0]+v*h[1],h[2])}return a.date(n[0],n[1],n[2])},set:function(a,n,l){this._validate(a,this.minMonth,this.minDay,y.local.invalidDate||y.regionalOptions[""].invalidDate);var s=l==="y"?n:a.year(),h=l==="m"?n:a.month(),v=l==="d"?n:a.day();return(l==="y"||l==="m")&&(v=Math.min(v,this.daysInMonth(s,h))),a.date(s,h,v)},isValid:function(a,n,l){this._validateLevel++;var s=this.hasYearZero||a!==0;if(s){var h=this.newDate(a,n,this.minDay);s=n>=this.minMonth&&n-this.minMonth=this.minDay&&l-this.minDay13.5?13:1),C=h-(m>2.5?4716:4715);return C<=0&&C--,this.newDate(C,m,b)},toJSDate:function(a,n,l){var s=this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate),h=new Date(s.year(),s.month()-1,s.day());return h.setHours(0),h.setMinutes(0),h.setSeconds(0),h.setMilliseconds(0),h.setHours(h.getHours()>12?h.getHours()+2:0),h},fromJSDate:function(a){return this.newDate(a.getFullYear(),a.getMonth()+1,a.getDate())}});var y=k.exports=new A;y.cdate=o,y.baseCalendar=T,y.calendars.gregorian=p},15168:function(k,D,r){var c=r(50896),A=r(38700);c(A.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),A.local=A.regionalOptions[""],c(A.cdate.prototype,{formatDate:function(o,_){return typeof o!="string"&&(_=o,o=""),this._calendar.formatDate(o||"",this,_)}}),c(A.baseCalendar.prototype,{UNIX_EPOCH:A.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:A.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(o,_,T){if(typeof o!="string"&&(T=_,_=o,o=""),!_)return"";if(_.calendar()!==this)throw A.local.invalidFormat||A.regionalOptions[""].invalidFormat;o=o||this.local.dateFormat,T=T||{};var p=T.dayNamesShort||this.local.dayNamesShort,y=T.dayNames||this.local.dayNames,a=T.monthNumbers||this.local.monthNumbers,n=T.monthNamesShort||this.local.monthNamesShort,l=T.monthNames||this.local.monthNames;T.calculateWeek||this.local.calculateWeek;for(var s=function(R,N){for(var w=1;M+w1},h=function(R,N,w,P){var I=""+N;if(s(R,P))for(;I.length1},M=function(z,Y){var H=x(z,Y),G=[2,3,H?4:2,H?4:2,10,11,20]["oyYJ@!".indexOf(z)+1],W=new RegExp("^-?\\d{1,"+G+"}"),V=_.substring(d).match(W);if(!V)throw(A.local.missingNumberAt||A.regionalOptions[""].missingNumberAt).replace(/\{0\}/,d);return d+=V[0].length,parseInt(V[0],10)},R=this,N=function(){if(typeof l=="function"){x("m");var z=l.call(R,_.substring(d));return d+=z.length,z}return M("m")},w=function(z,Y,H,G){for(var W=x(z,G)?H:Y,V=0;V-1){b=1,m=C;for(var B=this.daysInMonth(u,b);m>B;B=this.daysInMonth(u,b))b++,m-=B}return v>-1?this.fromJD(v):this.newDate(u,b,m)},determineDate:function(o,_,T,p,y){T&&typeof T!="object"&&(y=p,p=T,T=null),typeof p!="string"&&(y=p,p="");var a=this,n=function(l){try{return a.parseDate(p,l,y)}catch{}l=l.toLowerCase();for(var s=(l.match(/^c/)&&T?T.newDate():null)||a.today(),h=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,v=h.exec(l);v;)s.add(parseInt(v[1],10),v[2]||"d"),v=h.exec(l);return s};return _=_?_.newDate():null,o=o==null?_:typeof o=="string"?n(o):typeof o=="number"?isNaN(o)||o===1/0||o===-1/0?_:a.today().add(o,"d"):a.newDate(o),o}})},21576:function(){},19768:function(){},63436:function(k,D,r){var c=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],A=typeof globalThis>"u"?r.g:globalThis;k.exports=function(){for(var _=[],T=0;T>8&15|Ie>>4&240,Ie>>4&15|Ie&240,(Ie&15)<<4|Ie&15,1):Ge===8?N(Ie>>24&255,Ie>>16&255,Ie>>8&255,(Ie&255)/255):Ge===4?N(Ie>>12&15|Ie>>8&240,Ie>>8&15|Ie>>4&240,Ie>>4&15|Ie&240,((Ie&15)<<4|Ie&15)/255):null):(Ie=l.exec(Ee))?new I(Ie[1],Ie[2],Ie[3],1):(Ie=s.exec(Ee))?new I(Ie[1]*255/100,Ie[2]*255/100,Ie[3]*255/100,1):(Ie=h.exec(Ee))?N(Ie[1],Ie[2],Ie[3],Ie[4]):(Ie=v.exec(Ee))?N(Ie[1]*255/100,Ie[2]*255/100,Ie[3]*255/100,Ie[4]):(Ie=u.exec(Ee))?H(Ie[1],Ie[2]/100,Ie[3]/100,1):(Ie=b.exec(Ee))?H(Ie[1],Ie[2]/100,Ie[3]/100,Ie[4]):m.hasOwnProperty(Ee)?R(m[Ee]):Ee==="transparent"?new I(NaN,NaN,NaN,0):null}function R(Ee){return new I(Ee>>16&255,Ee>>8&255,Ee&255,1)}function N(Ee,Ie,Ge,We){return We<=0&&(Ee=Ie=Ge=NaN),new I(Ee,Ie,Ge,We)}function w(Ee){return Ee instanceof o||(Ee=M(Ee)),Ee?(Ee=Ee.rgb(),new I(Ee.r,Ee.g,Ee.b,Ee.opacity)):new I}function P(Ee,Ie,Ge,We){return arguments.length===1?w(Ee):new I(Ee,Ie,Ge,We??1)}function I(Ee,Ie,Ge,We){this.r=+Ee,this.g=+Ie,this.b=+Ge,this.opacity=+We}c(I,P,A(o,{brighter:function(Ie){return Ie=Ie==null?T:Math.pow(T,Ie),new I(this.r*Ie,this.g*Ie,this.b*Ie,this.opacity)},darker:function(Ie){return Ie=Ie==null?_:Math.pow(_,Ie),new I(this.r*Ie,this.g*Ie,this.b*Ie,this.opacity)},rgb:function(){return this},clamp:function(){return new I(z(this.r),z(this.g),z(this.b),B(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:d,formatHex:d,formatHex8:L,formatRgb:E,toString:E}));function d(){return"#".concat(Y(this.r)).concat(Y(this.g)).concat(Y(this.b))}function L(){return"#".concat(Y(this.r)).concat(Y(this.g)).concat(Y(this.b)).concat(Y((isNaN(this.opacity)?1:this.opacity)*255))}function E(){var Ee=B(this.opacity);return"".concat(Ee===1?"rgb(":"rgba(").concat(z(this.r),", ").concat(z(this.g),", ").concat(z(this.b)).concat(Ee===1?")":", ".concat(Ee,")"))}function B(Ee){return isNaN(Ee)?1:Math.max(0,Math.min(1,Ee))}function z(Ee){return Math.max(0,Math.min(255,Math.round(Ee)||0))}function Y(Ee){return Ee=z(Ee),(Ee<16?"0":"")+Ee.toString(16)}function H(Ee,Ie,Ge,We){return We<=0?Ee=Ie=Ge=NaN:Ge<=0||Ge>=1?Ee=Ie=NaN:Ie<=0&&(Ee=NaN),new V(Ee,Ie,Ge,We)}function G(Ee){if(Ee instanceof V)return new V(Ee.h,Ee.s,Ee.l,Ee.opacity);if(Ee instanceof o||(Ee=M(Ee)),!Ee)return new V;if(Ee instanceof V)return Ee;Ee=Ee.rgb();var Ie=Ee.r/255,Ge=Ee.g/255,We=Ee.b/255,Be=Math.min(Ie,Ge,We),Ve=Math.max(Ie,Ge,We),lt=NaN,pt=Ve-Be,ct=(Ve+Be)/2;return pt?(Ie===Ve?lt=(Ge-We)/pt+(Ge0&&ct<1?0:lt,new V(lt,pt,ct,Ee.opacity)}function W(Ee,Ie,Ge,We){return arguments.length===1?G(Ee):new V(Ee,Ie,Ge,We??1)}function V(Ee,Ie,Ge,We){this.h=+Ee,this.s=+Ie,this.l=+Ge,this.opacity=+We}c(V,W,A(o,{brighter:function(Ie){return Ie=Ie==null?T:Math.pow(T,Ie),new V(this.h,this.s,this.l*Ie,this.opacity)},darker:function(Ie){return Ie=Ie==null?_:Math.pow(_,Ie),new V(this.h,this.s,this.l*Ie,this.opacity)},rgb:function(){var Ie=this.h%360+(this.h<0)*360,Ge=isNaN(Ie)||isNaN(this.s)?0:this.s,We=this.l,Be=We+(We<.5?We:1-We)*Ge,Ve=2*We-Be;return new I(re(Ie>=240?Ie-240:Ie+120,Ve,Be),re(Ie,Ve,Be),re(Ie<120?Ie+240:Ie-120,Ve,Be),this.opacity)},clamp:function(){return new V(j(this.h),$(this.s),$(this.l),B(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var Ie=B(this.opacity);return"".concat(Ie===1?"hsl(":"hsla(").concat(j(this.h),", ").concat($(this.s)*100,"%, ").concat($(this.l)*100,"%").concat(Ie===1?")":", ".concat(Ie,")"))}}));function j(Ee){return Ee=(Ee||0)%360,Ee<0?Ee+360:Ee}function $(Ee){return Math.max(0,Math.min(1,Ee||0))}function re(Ee,Ie,Ge){return(Ee<60?Ie+(Ge-Ie)*Ee/60:Ee<180?Ge:Ee<240?Ie+(Ge-Ie)*(240-Ee)/60:Ie)*255}var ae=function(Ee){return function(){return Ee}};function oe(Ee,Ie){return function(Ge){return Ee+Ge*Ie}}function de(Ee,Ie,Ge){return Ee=Math.pow(Ee,Ge),Ie=Math.pow(Ie,Ge)-Ee,Ge=1/Ge,function(We){return Math.pow(Ee+We*Ie,Ge)}}function te(Ee){return(Ee=+Ee)==1?J:function(Ie,Ge){return Ge-Ie?de(Ie,Ge,Ee):ae(isNaN(Ie)?Ge:Ie)}}function J(Ee,Ie){var Ge=Ie-Ee;return Ge?oe(Ee,Ge):ae(isNaN(Ee)?Ie:Ee)}var ie=function Ee(Ie){var Ge=te(Ie);function We(Be,Ve){var lt=Ge((Be=P(Be)).r,(Ve=P(Ve)).r),pt=Ge(Be.g,Ve.g),ct=Ge(Be.b,Ve.b),nt=J(Be.opacity,Ve.opacity);return function(vt){return Be.r=lt(vt),Be.g=pt(vt),Be.b=ct(vt),Be.opacity=nt(vt),Be+""}}return We.gamma=Ee,We}(1);function Z(Ee,Ie){var Ge=Ie?Ie.length:0,We=Ee?Math.min(Ge,Ee.length):0,Be=new Array(We),Ve=new Array(Ge),lt;for(lt=0;ltGe&&(Ve=Ie.slice(Ge,Ve),pt[lt]?pt[lt]+=Ve:pt[++lt]=Ve),(We=We[0])===(Be=Be[0])?pt[lt]?pt[lt]+=Be:pt[++lt]=Be:(pt[++lt]=null,ct.push({i:lt,x:fe(We,Be)})),Ge=se.lastIndex;return Ge{switch(t.type){case"TOGGLE_CHAT_HISTORY":return{...e,isChatHistoryOpen:!e.isChatHistoryOpen};case"UPDATE_CURRENT_CHAT":return{...e,currentChat:t.payload};case"UPDATE_CHAT_HISTORY_LOADING_STATE":return{...e,chatHistoryLoadingState:t.payload};case"UPDATE_CHAT_HISTORY":if(!e.chatHistory||!e.currentChat)return e;const i=e.chatHistory.findIndex(k=>k.id===t.payload.id);if(i!==-1){const k=[...e.chatHistory];return k[i]=e.currentChat,{...e,chatHistory:k}}else return{...e,chatHistory:[...e.chatHistory,t.payload]};case"UPDATE_CHAT_TITLE":if(!e.chatHistory)return{...e,chatHistory:[]};const S=e.chatHistory.map(k=>{var D;return k.id===t.payload.id?(((D=e.currentChat)==null?void 0:D.id)===t.payload.id&&(e.currentChat.title=t.payload.title),{...k,title:t.payload.title}):k});return{...e,chatHistory:S};case"DELETE_CHAT_ENTRY":if(!e.chatHistory)return{...e,chatHistory:[]};const U=e.chatHistory.filter(k=>k.id!==t.payload);return e.currentChat=null,{...e,chatHistory:U};case"DELETE_CHAT_HISTORY":return{...e,chatHistory:[],filteredChatHistory:[],currentChat:null};case"DELETE_CURRENT_CHAT_MESSAGES":if(!e.currentChat||!e.chatHistory)return e;const K={...e.currentChat,messages:[]};return{...e,currentChat:K};case"FETCH_CHAT_HISTORY":return{...e,chatHistory:t.payload};case"SET_COSMOSDB_STATUS":return{...e,isCosmosDBAvailable:t.payload};case"FETCH_FRONTEND_SETTINGS":return{...e,frontendSettings:t.payload};case"SET_FEEDBACK_STATE":return{...e,feedbackState:{...e.feedbackState,[t.payload.answerId]:t.payload.feedback}};default:return e}},UTe={isChatHistoryOpen:!1,chatHistoryLoadingState:jc.Loading,chatHistory:null,filteredChatHistory:null,currentChat:null,isCosmosDBAvailable:{cosmosDB:!1,status:vc.NotConfigured},frontendSettings:null,feedbackState:{}},m1=$t.createContext(void 0),HTe=({children:e})=>{const[t,i]=$t.useReducer(zTe,UTe);return $t.useEffect(()=>{const S=async(K=0)=>await Oj(K).then(D=>(i(D?{type:"FETCH_CHAT_HISTORY",payload:D}:{type:"FETCH_CHAT_HISTORY",payload:null}),D)).catch(D=>(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"FETCH_CHAT_HISTORY",payload:null}),console.error("There was an issue fetching your data."),null));(async()=>{i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Loading}),NTe().then(K=>{K!=null&&K.cosmosDB?S().then(k=>{k?(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Success}),i({type:"SET_COSMOSDB_STATUS",payload:K})):(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:{cosmosDB:!1,status:vc.NotWorking}}))}).catch(k=>{i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:{cosmosDB:!1,status:vc.NotWorking}})}):(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:K}))}).catch(K=>{i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:{cosmosDB:!1,status:vc.NotConfigured}})})})()},[]),$t.useEffect(()=>{(async()=>{PTe().then(U=>{i({type:"FETCH_FRONTEND_SETTINGS",payload:U})}).catch(U=>{console.error("There was an issue fetching your data.")})})()},[]),Wn(m1.Provider,{value:{state:t,dispatch:i},children:e})},GTe=e=>{const t=new Map;for(const i of e){const{filepath:S}=i;let U=1;t.has(S)&&(U=t.get(S)+1),t.set(S,U),i.part_index=U}return e};function VTe(e){let t=e.answer;const i=t.match(/\[(doc\d\d?\d?)]/g),S=4;let U=[],K=0;return i==null||i.forEach(k=>{const D=k.slice(S,k.length-1),r=zp.cloneDeep(e.citations[Number(D)-1]);!U.find(c=>c.id===D)&&r&&(t=t.replaceAll(k,` ^${++K}^ `),r.id=D,r.reindex_id=K.toString(),U.push(r))}),U=GTe(U),{citations:U,markdownFormatText:t,plotly_data:e.plotly_data}}const WTe="_answerContainer_1qm4u_1",YTe="_answerText_1qm4u_14",jTe="_answerHeader_1qm4u_31",KTe="_answerFooter_1qm4u_35",XTe="_answerDisclaimerContainer_1qm4u_44",$Te="_answerDisclaimer_1qm4u_44",ZTe="_citationWrapper_1qm4u_64",JTe="_citationContainer_1qm4u_72",QTe="_citation_1qm4u_64",qTe="_accordionIcon_1qm4u_122",eEe="_accordionTitle_1qm4u_137",tEe="_clickableSup_1qm4u_153",Uf={answerContainer:WTe,answerText:YTe,answerHeader:jTe,answerFooter:KTe,answerDisclaimerContainer:XTe,answerDisclaimer:$Te,citationWrapper:ZTe,citationContainer:JTe,citation:QTe,accordionIcon:qTe,accordionTitle:eEe,clickableSup:tEe},aU=({answer:e,onCitationClicked:t,onExectResultClicked:i})=>{var N,w,P,I;const S=d=>{if(d.message_id!=null&&d.feedback!=null)return d.feedback.split(",").length>1?To.Negative:Object.values(To).includes(d.feedback)?d.feedback:To.Neutral},[U,{toggle:K}]=z2(!1),k=50,D=$t.useMemo(()=>VTe(e),[e]),[r,c]=$t.useState(U),[A,o]=$t.useState(S(e)),[_,T]=$t.useState(!1),[p,y]=$t.useState(!1),[a,n]=$t.useState([]),l=$t.useContext(m1),s=((N=l==null?void 0:l.state.frontendSettings)==null?void 0:N.feedback_enabled)&&((w=l==null?void 0:l.state.isCosmosDBAvailable)==null?void 0:w.cosmosDB),h=(P=l==null?void 0:l.state.frontendSettings)==null?void 0:P.sanitize_answer,v=()=>{c(!r),K()};$t.useEffect(()=>{c(U)},[U]),$t.useEffect(()=>{if(e.message_id==null)return;let d;l!=null&&l.state.feedbackState&&(l!=null&&l.state.feedbackState[e.message_id])?d=l==null?void 0:l.state.feedbackState[e.message_id]:d=S(e),o(d)},[l==null?void 0:l.state.feedbackState,A,e.message_id]);const u=(d,L,E=!1)=>{let B="";if(d.filepath){const z=d.part_index??(d.chunk_id?parseInt(d.chunk_id)+1:"");if(E&&d.filepath.length>k){const Y=d.filepath.length;B=`${d.filepath.substring(0,20)}...${d.filepath.substring(Y-20)} - Part ${z}`}else B=`${d.filepath} - Part ${z}`}else d.filepath&&d.reindex_id?B=`${d.filepath} - Part ${d.reindex_id}`:B=`Citation ${L}`;return B},b=async()=>{if(e.message_id==null)return;let d=A;A==To.Positive?d=To.Neutral:d=To.Positive,l==null||l.dispatch({type:"SET_FEEDBACK_STATE",payload:{answerId:e.message_id,feedback:d}}),o(d),await q6(e.message_id,d)},m=async()=>{if(e.message_id==null)return;let d=A;A===void 0||A===To.Neutral||A===To.Positive?(d=To.Negative,o(d),T(!0)):(d=To.Neutral,o(d),await q6(e.message_id,To.Neutral)),l==null||l.dispatch({type:"SET_FEEDBACK_STATE",payload:{answerId:e.message_id,feedback:d}})},C=(d,L)=>{var z;if(e.message_id==null)return;const E=(z=d==null?void 0:d.target)==null?void 0:z.id;let B=a.slice();L?B.push(E):B=B.filter(Y=>Y!==E),n(B)},g=async()=>{e.message_id!=null&&(await q6(e.message_id,a.join(",")),f())},f=()=>{T(!1),y(!1),n([])},x=()=>Ei(Nd,{children:[Wn("div",{children:"Why wasn't this response helpful?"}),Ei(wi,{tokens:{childrenGap:4},children:[Wn(Vv,{label:"Citations are missing",id:To.MissingCitation,defaultChecked:a.includes(To.MissingCitation),onChange:C}),Wn(Vv,{label:"Citations are wrong",id:To.WrongCitation,defaultChecked:a.includes(To.WrongCitation),onChange:C}),Wn(Vv,{label:"The response is not from my data",id:To.OutOfScope,defaultChecked:a.includes(To.OutOfScope),onChange:C}),Wn(Vv,{label:"Inaccurate or irrelevant",id:To.InaccurateOrIrrelevant,defaultChecked:a.includes(To.InaccurateOrIrrelevant),onChange:C}),Wn(Vv,{label:"Other",id:To.OtherUnhelpful,defaultChecked:a.includes(To.OtherUnhelpful),onChange:C})]}),Wn("div",{onClick:()=>y(!0),style:{color:"#115EA3",cursor:"pointer"},children:"Report inappropriate content"})]}),M=()=>Ei(Nd,{children:[Ei("div",{children:["The content is ",Wn("span",{style:{color:"red"},children:"*"})]}),Ei(wi,{tokens:{childrenGap:4},children:[Wn(Vv,{label:"Hate speech, stereotyping, demeaning",id:To.HateSpeech,defaultChecked:a.includes(To.HateSpeech),onChange:C}),Wn(Vv,{label:"Violent: glorification of violence, self-harm",id:To.Violent,defaultChecked:a.includes(To.Violent),onChange:C}),Wn(Vv,{label:"Sexual: explicit content, grooming",id:To.Sexual,defaultChecked:a.includes(To.Sexual),onChange:C}),Wn(Vv,{label:"Manipulative: devious, emotional, pushy, bullying",defaultChecked:a.includes(To.Manipulative),id:To.Manipulative,onChange:C}),Wn(Vv,{label:"Other",id:To.OtherHarmful,defaultChecked:a.includes(To.OtherHarmful),onChange:C})]})]}),R={code({node:d,...L}){let E;if(L.className){const z=L.className.match(/language-(\w+)/);E=z?z[1]:void 0}const B=d.children[0].value??"";return Wn(L9,{style:k9,language:E,PreTag:"div",...L,children:B})}};return Ei(Nd,{children:[Ei(wi,{className:Uf.answerContainer,tabIndex:0,children:[Wn(wi.Item,{children:Ei(wi,{horizontal:!0,grow:!0,children:[Wn(wi.Item,{grow:!0,children:Wn($w,{linkTarget:"_blank",remarkPlugins:[vY,OTe],children:h?QY.sanitize(D.markdownFormatText,{ALLOWED_TAGS:Pj}):D.markdownFormatText,className:Uf.answerText,components:R})}),Wn(wi.Item,{className:Uf.answerHeader,children:s&&e.message_id!==void 0&&Ei(wi,{horizontal:!0,horizontalAlign:"space-between",children:[Wn(Vae,{"aria-hidden":"false","aria-label":"Like this response",onClick:()=>b(),style:A===To.Positive||(l==null?void 0:l.state.feedbackState[e.message_id])===To.Positive?{color:"darkgreen",cursor:"pointer"}:{color:"slategray",cursor:"pointer"}}),Wn(Hae,{"aria-hidden":"false","aria-label":"Dislike this response",onClick:()=>m(),style:A!==To.Positive&&A!==To.Neutral&&A!==void 0?{color:"darkred",cursor:"pointer"}:{color:"slategray",cursor:"pointer"}})]})})]})}),D.plotly_data!==null&&Wn(wi,{className:Uf.answerContainer,children:Wn(wi.Item,{grow:!0,children:Wn(BTe,{data:D.plotly_data.data,layout:D.plotly_data.layout})})}),Ei(wi,{horizontal:!0,className:Uf.answerFooter,children:[!!D.citations.length&&Wn(wi.Item,{onKeyDown:d=>d.key==="Enter"||d.key===" "?K():null,children:Wn(wi,{style:{width:"100%"},children:Ei(wi,{horizontal:!0,horizontalAlign:"start",verticalAlign:"center",children:[Wn(Vp,{className:Uf.accordionTitle,onClick:K,"aria-label":"Open references",tabIndex:0,role:"button",children:Wn("span",{children:D.citations.length>1?D.citations.length+" references":"1 reference"})}),Wn(T2,{className:Uf.accordionIcon,onClick:v,iconName:r?"ChevronDown":"ChevronRight"})]})})}),Wn(wi.Item,{className:Uf.answerDisclaimerContainer,children:Wn("span",{className:Uf.answerDisclaimer,children:"AI-generated content may be incorrect"})}),!!((I=e.exec_results)!=null&&I.length)&&Wn(wi.Item,{onKeyDown:d=>d.key==="Enter"||d.key===" "?K():null,children:Wn(wi,{style:{width:"100%"},children:Ei(wi,{horizontal:!0,horizontalAlign:"start",verticalAlign:"center",children:[Wn(Vp,{className:Uf.accordionTitle,onClick:()=>i(),"aria-label":"Open Intents",tabIndex:0,role:"button",children:Wn("span",{children:"Show Intents"})}),Wn(T2,{className:Uf.accordionIcon,onClick:v,iconName:"ChevronRight"})]})})})]}),r&&Wn("div",{className:Uf.citationWrapper,children:D.citations.map((d,L)=>Ei("span",{title:u(d,++L),tabIndex:0,role:"link",onClick:()=>t(d),onKeyDown:E=>E.key==="Enter"||E.key===" "?t(d):null,className:Uf.citationContainer,"aria-label":u(d,L),children:[Wn("div",{className:Uf.citation,children:L}),u(d,L,!0)]},L))})]}),Wn(cy,{onDismiss:()=>{f(),o(To.Neutral)},hidden:!_,styles:{main:[{selectors:{["@media (min-width: 480px)"]:{maxWidth:"600px",background:"#FFFFFF",boxShadow:"0px 14px 28.8px rgba(0, 0, 0, 0.24), 0px 0px 8px rgba(0, 0, 0, 0.2)",borderRadius:"8px",maxHeight:"600px",minHeight:"100px"}}}]},dialogContentProps:{title:"Submit Feedback",showCloseButton:!0},children:Ei(wi,{tokens:{childrenGap:4},children:[Wn("div",{children:"Your feedback will improve this experience."}),p?Wn(M,{}):Wn(x,{}),Wn("div",{children:"By pressing submit, your feedback will be visible to the application owner."}),Wn(H2,{disabled:a.length<1,onClick:g,children:"Submit"})]})})]})},rEe="/assets/Send-d0601aaa.svg",nEe="_questionInputContainer_185lc_1",aEe="_questionInputTextArea_185lc_15",iEe="_questionInputSendButtonContainer_185lc_24",oEe="_questionInputSendButton_185lc_24",sEe="_questionInputSendButtonDisabled_185lc_35",lEe="_questionInputBottomBorder_185lc_43",uEe="_questionInputOptionsButton_185lc_54",um={questionInputContainer:nEe,questionInputTextArea:aEe,questionInputSendButtonContainer:iEe,questionInputSendButton:oEe,questionInputSendButtonDisabled:sEe,questionInputBottomBorder:lEe,questionInputOptionsButton:uEe},cEe=({onSend:e,disabled:t,placeholder:i,clearOnSend:S,conversationId:U})=>{const[K,k]=$t.useState(""),D=()=>{t||!K.trim()||(U?e(K,U):e(K),S&&k(""))},r=o=>{var _;o.key==="Enter"&&!o.shiftKey&&((_=o.nativeEvent)==null?void 0:_.isComposing)!==!0&&(o.preventDefault(),D())},c=(o,_)=>{k(_||"")},A=t||!K.trim();return Ei(wi,{horizontal:!0,className:um.questionInputContainer,children:[Wn(JR,{className:um.questionInputTextArea,placeholder:i,multiline:!0,resizable:!1,borderless:!0,value:K,onChange:c,onKeyDown:r}),Wn("div",{className:um.questionInputSendButtonContainer,role:"button",tabIndex:0,"aria-label":"Ask question button",onClick:D,onKeyDown:o=>o.key==="Enter"||o.key===" "?D():null,children:A?Wn(Pae,{className:um.questionInputSendButtonDisabled}):Wn("img",{src:rEe,className:um.questionInputSendButton,alt:"Send Button"})}),Wn("div",{className:um.questionInputBottomBorder})]})},fEe="_container_1epg5_1",dEe="_listContainer_1epg5_6",hEe="_itemCell_1epg5_11",vEe="_itemButton_1epg5_28",pEe="_chatGroup_1epg5_45",gEe="_spinnerContainer_1epg5_50",mEe="_chatList_1epg5_57",yEe="_chatMonth_1epg5_61",xEe="_chatTitle_1epg5_68",mh={container:fEe,listContainer:dEe,itemCell:hEe,itemButton:vEe,chatGroup:pEe,spinnerContainer:gEe,chatList:mEe,chatMonth:yEe,chatTitle:xEe},bEe=e=>{const i=new Date().getFullYear(),[S,U]=e.split(" ");return parseInt(U)===i?S:e},TEe=({item:e,onSelect:t})=>{var N,w,P;const[i,S]=$t.useState(!1),[U,K]=$t.useState(!1),[k,D]=$t.useState(""),[r,{toggle:c}]=z2(!0),[A,o]=$t.useState(!1),[_,T]=$t.useState(!1),[p,y]=$t.useState(void 0),[a,n]=$t.useState(!1),l=$t.useRef(null),s=$t.useContext(m1),h=(e==null?void 0:e.id)===((N=s==null?void 0:s.state.currentChat)==null?void 0:N.id),v={type:rp.close,title:"Are you sure you want to delete this item?",closeButtonAriaLabel:"Close",subText:"The history of this chat session will permanently removed."},u={titleAriaId:"labelId",subtitleAriaId:"subTextId",isBlocking:!0,styles:{main:{maxWidth:450}}};if(!e)return null;$t.useEffect(()=>{a&&l.current&&(l.current.focus(),n(!1))},[a]),$t.useEffect(()=>{var I;((I=s==null?void 0:s.state.currentChat)==null?void 0:I.id)!==(e==null?void 0:e.id)&&(K(!1),D(""))},[(w=s==null?void 0:s.state.currentChat)==null?void 0:w.id,e==null?void 0:e.id]);const b=async()=>{(await ITe(e.id)).ok?s==null||s.dispatch({type:"DELETE_CHAT_ENTRY",payload:e.id}):(o(!0),setTimeout(()=>{o(!1)},5e3)),c()},m=()=>{K(!0),n(!0),D(e==null?void 0:e.title)},C=()=>{t(e),s==null||s.dispatch({type:"UPDATE_CURRENT_CHAT",payload:e})},g=((P=e==null?void 0:e.title)==null?void 0:P.length)>28?`${e.title.substring(0,28)} ...`:e.title,f=async I=>{if(I.preventDefault(),p||_)return;if(k==e.title){y("Error: Enter a new title to proceed."),setTimeout(()=>{y(void 0),n(!0),l.current&&l.current.focus()},5e3);return}T(!0),(await DTe(e.id,k)).ok?(T(!1),K(!1),s==null||s.dispatch({type:"UPDATE_CHAT_TITLE",payload:{...e,title:k}}),D("")):(y("Error: could not rename item"),setTimeout(()=>{n(!0),y(void 0),l.current&&l.current.focus()},5e3))},x=I=>{D(I.target.value)},M=()=>{K(!1),D("")},R=I=>{if(I.key==="Enter")return f(I);if(I.key==="Escape"){M();return}};return Ei(wi,{tabIndex:0,"aria-label":"chat history item",className:mh.itemCell,onClick:()=>C(),onKeyDown:I=>I.key==="Enter"||I.key===" "?C():null,verticalAlign:"center",onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),styles:{root:{backgroundColor:h?"#e6e6e6":"transparent"}},children:[U?Wn(Nd,{children:Wn(wi.Item,{style:{width:"100%"},children:Ei("form",{"aria-label":"edit title form",onSubmit:I=>f(I),style:{padding:"5px 0px"},children:[Ei(wi,{horizontal:!0,verticalAlign:"start",children:[Wn(wi.Item,{children:Wn(JR,{componentRef:l,autoFocus:a,value:k,placeholder:e.title,onChange:x,onKeyDown:R,disabled:!!p})}),k&&Wn(wi.Item,{children:Ei(wi,{"aria-label":"action button group",horizontal:!0,verticalAlign:"center",children:[Wn($0,{role:"button",disabled:p!==void 0,onKeyDown:I=>I.key===" "||I.key==="Enter"?f(I):null,onClick:I=>f(I),"aria-label":"confirm new title",iconProps:{iconName:"CheckMark"},styles:{root:{color:"green",marginLeft:"5px"}}}),Wn($0,{role:"button",disabled:p!==void 0,onKeyDown:I=>I.key===" "||I.key==="Enter"?M():null,onClick:()=>M(),"aria-label":"cancel edit title",iconProps:{iconName:"Cancel"},styles:{root:{color:"red",marginLeft:"5px"}}})]})})]}),p&&Wn(Vp,{role:"alert","aria-label":p,style:{fontSize:12,fontWeight:400,color:"rgb(164,38,44)"},children:p})]})})}):Wn(Nd,{children:Ei(wi,{horizontal:!0,verticalAlign:"center",style:{width:"100%"},children:[Wn("div",{className:mh.chatTitle,children:g}),(h||i)&&Ei(wi,{horizontal:!0,horizontalAlign:"end",children:[Wn($0,{className:mh.itemButton,iconProps:{iconName:"Delete"},title:"Delete",onClick:c,onKeyDown:I=>I.key===" "?c():null}),Wn($0,{className:mh.itemButton,iconProps:{iconName:"Edit"},title:"Edit",onClick:m,onKeyDown:I=>I.key===" "?m():null})]})]})}),A&&Wn(Vp,{styles:{root:{color:"red",marginTop:5,fontSize:14}},children:"Error: could not delete item"}),Wn(cy,{hidden:r,onDismiss:c,dialogContentProps:v,modalProps:u,children:Ei(QR,{children:[Wn(YV,{onClick:b,text:"Delete"}),Wn(H2,{onClick:c,text:"Cancel"})]})})]},e.id)},EEe=({groupedChatHistory:e})=>{const t=$t.useContext(m1),i=$t.useRef(null),[,S]=$t.useState(null),[U,K]=$t.useState(25),[k,D]=$t.useState(0),[r,c]=$t.useState(!1),A=$t.useRef(!0),o=p=>{p&&S(p)},_=p=>Wn(TEe,{item:p,onSelect:()=>o(p)});$t.useEffect(()=>{if(A.current){A.current=!1;return}T(),K(p=>p+=25)},[k]);const T=async()=>{const p=t==null?void 0:t.state.chatHistory;c(!0),await Oj(U).then(y=>{const a=p&&y&&p.concat(...y);return y?t==null||t.dispatch({type:"FETCH_CHAT_HISTORY",payload:a||y}):t==null||t.dispatch({type:"FETCH_CHAT_HISTORY",payload:null}),c(!1),y})};return $t.useEffect(()=>{const p=new IntersectionObserver(y=>{y[0].isIntersecting&&D(a=>a+=1)},{threshold:1});return i.current&&p.observe(i.current),()=>{i.current&&p.unobserve(i.current)}},[i]),Ei("div",{className:mh.listContainer,"data-is-scrollable":!0,children:[e.map(p=>p.entries.length>0&&Ei(wi,{horizontalAlign:"start",verticalAlign:"center",className:mh.chatGroup,"aria-label":`chat history group: ${p.month}`,children:[Wn(wi,{"aria-label":p.month,className:mh.chatMonth,children:bEe(p.month)}),Wn(Ore,{"aria-label":"chat history list",items:p.entries,onRenderCell:_,className:mh.chatList}),Wn("div",{ref:i}),Wn(QV,{styles:{root:{width:"100%",position:"relative","::before":{backgroundColor:"#d6d6d6"}}}})]},p.month)),r&&Wn("div",{className:mh.spinnerContainer,children:Wn(XV,{size:cv.small,"aria-label":"loading more chat history",className:mh.spinner})})]})},wEe=e=>{const t=[{month:"Recent",entries:[]}],i=new Date;return e.forEach(S=>{const U=new Date(S.date),K=(i.getTime()-U.getTime())/(1e3*60*60*24),k=U.toLocaleString("default",{month:"long",year:"numeric"}),D=t.find(r=>r.month===k);K<=7?t[0].entries.push(S):D?D.entries.push(S):t.push({month:k,entries:[S]})}),t.sort((S,U)=>{if(S.entries.length===0&&U.entries.length===0)return 0;if(S.entries.length===0)return 1;if(U.entries.length===0)return-1;const K=new Date(S.entries[0].date);return new Date(U.entries[0].date).getTime()-K.getTime()}),t.forEach(S=>{S.entries.sort((U,K)=>{const k=new Date(U.date);return new Date(K.date).getTime()-k.getTime()})}),t},AEe=()=>{const e=$t.useContext(m1),t=e==null?void 0:e.state.chatHistory;el.useEffect(()=>{},[e==null?void 0:e.state.chatHistory]);let i;if(t&&t.length>0)i=wEe(t);else return Wn(wi,{horizontal:!0,horizontalAlign:"center",verticalAlign:"center",style:{width:"100%",marginTop:10},children:Wn(Y0,{children:Wn(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:14},children:Wn("span",{children:"No chat history."})})})});return Wn(EEe,{groupedChatHistory:i})},iU={root:{padding:"0",display:"flex",justifyContent:"center",backgroundColor:"transparent"}},SEe={root:{height:"50px"}};function CEe(e){var l,s,h;const t=$t.useContext(m1),[i,S]=el.useState(!1),[U,{toggle:K}]=z2(!0),[k,D]=el.useState(!1),[r,c]=el.useState(!1),A={type:rp.close,title:r?"Error deleting all of chat history":"Are you sure you want to clear all chat history?",closeButtonAriaLabel:"Close",subText:r?"Please try again. If the problem persists, please contact the site administrator.":"All chat history will be permanently removed."},o={titleAriaId:"labelId",subtitleAriaId:"subTextId",isBlocking:!0,styles:{main:{maxWidth:450}}},_=[{key:"clearAll",text:"Clear all chat history",iconProps:{iconName:"Delete"}}],T=()=>{t==null||t.dispatch({type:"TOGGLE_CHAT_HISTORY"})},p=el.useCallback(v=>{v.preventDefault(),S(!0)},[]),y=el.useCallback(()=>S(!1),[]),a=async()=>{D(!0),(await LTe()).ok?(t==null||t.dispatch({type:"DELETE_CHAT_HISTORY"}),K()):c(!0),D(!1)},n=()=>{K(),setTimeout(()=>{c(!1)},2e3)};return el.useEffect(()=>{},[t==null?void 0:t.state.chatHistory,r]),Ei("section",{className:mh.container,"data-is-scrollable":!0,"aria-label":"chat history panel",children:[Ei(wi,{horizontal:!0,horizontalAlign:"space-between",verticalAlign:"center",wrap:!0,"aria-label":"chat history header",children:[Wn(Y0,{children:Wn(Vp,{role:"heading","aria-level":2,style:{alignSelf:"center",fontWeight:"600",fontSize:"18px",marginRight:"auto",paddingLeft:"20px"},children:"Chat history"})}),Wn(wi,{verticalAlign:"start",children:Ei(wi,{horizontal:!0,styles:SEe,children:[Wn(S2,{iconProps:{iconName:"More"},title:"Clear all chat history",onClick:p,"aria-label":"clear all chat history",styles:iU,role:"button",id:"moreButton"}),Wn(ow,{items:_,hidden:!i,target:"#moreButton",onItemClick:K,onDismiss:y}),Wn(S2,{iconProps:{iconName:"Cancel"},title:"Hide",onClick:T,"aria-label":"hide button",styles:iU,role:"button"})]})})]}),Wn(wi,{"aria-label":"chat history panel content",styles:{root:{display:"flex",flexGrow:1,flexDirection:"column",paddingTop:"2.5px",maxWidth:"100%"}},style:{display:"flex",flexGrow:1,flexDirection:"column",flexWrap:"wrap",padding:"1px"},children:Ei(wi,{className:mh.chatHistoryListContainer,children:[(t==null?void 0:t.state.chatHistoryLoadingState)===jc.Success&&(t==null?void 0:t.state.isCosmosDBAvailable.cosmosDB)&&Wn(AEe,{}),(t==null?void 0:t.state.chatHistoryLoadingState)===jc.Fail&&(t==null?void 0:t.state.isCosmosDBAvailable)&&Wn(Nd,{children:Wn(wi,{children:Ei(wi,{horizontalAlign:"center",verticalAlign:"center",style:{width:"100%",marginTop:10},children:[Wn(Y0,{children:Ei(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:16},children:[((l=t==null?void 0:t.state.isCosmosDBAvailable)==null?void 0:l.status)&&Wn("span",{children:(s=t==null?void 0:t.state.isCosmosDBAvailable)==null?void 0:s.status}),!((h=t==null?void 0:t.state.isCosmosDBAvailable)!=null&&h.status)&&Wn("span",{children:"Error loading chat history"})]})}),Wn(Y0,{children:Wn(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:14},children:Wn("span",{children:"Chat history can't be saved at this time"})})})]})})}),(t==null?void 0:t.state.chatHistoryLoadingState)===jc.Loading&&Wn(Nd,{children:Wn(wi,{children:Ei(wi,{horizontal:!0,horizontalAlign:"center",verticalAlign:"center",style:{width:"100%",marginTop:10},children:[Wn(Y0,{style:{justifyContent:"center",alignItems:"center"},children:Wn(XV,{style:{alignSelf:"flex-start",height:"100%",marginRight:"5px"},size:cv.medium})}),Wn(Y0,{children:Wn(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:14},children:Wn("span",{style:{whiteSpace:"pre-wrap"},children:"Loading chat history"})})})]})})})]})}),Wn(cy,{hidden:U,onDismiss:k?()=>{}:n,dialogContentProps:A,modalProps:o,children:Ei(QR,{children:[!r&&Wn(YV,{onClick:a,disabled:k,text:"Clear All"}),Wn(H2,{onClick:n,disabled:k,text:r?"Close":"Cancel"})]})})]})}const _Ee=()=>{var Z,ue,fe,Q,q,ce,se,pe;const e=$t.useContext(m1),t=(Z=e==null?void 0:e.state.frontendSettings)==null?void 0:Z.ui,i=(ue=e==null?void 0:e.state.frontendSettings)==null?void 0:ue.auth_enabled,S=$t.useRef(null),[U,K]=$t.useState(!1),[k,D]=$t.useState(!1),[r,c]=$t.useState(),[A,o]=$t.useState(!1),[_,T]=$t.useState(!1),p=$t.useRef([]),[y,a]=$t.useState(),[n,l]=$t.useState([]),[s,h]=$t.useState([]),[v,u]=$t.useState("Not Running"),[b,m]=$t.useState(!1),[C,{toggle:g}]=z2(!0),[f,x]=$t.useState(),M={type:rp.close,title:f==null?void 0:f.title,closeButtonAriaLabel:"Close",subText:f==null?void 0:f.subtitle},R={titleAriaId:"labelId",subtitleAriaId:"subTextId",isBlocking:!0,styles:{main:{maxWidth:450}}},[N,w,P]=["assistant","tool","error"],I="No content in messages object.";$t.useEffect(()=>{var Te,we;if(((Te=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:Te.status)!==vc.Working&&((we=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:we.status)!==vc.NotConfigured&&(e==null?void 0:e.state.chatHistoryLoadingState)===jc.Fail&&C){let Ae=`${e.state.isCosmosDBAvailable.status}. Please contact the site administrator.`;x({title:"Chat history is not enabled",subtitle:Ae}),g()}},[e==null?void 0:e.state.isCosmosDBAvailable]);const d=()=>{g(),setTimeout(()=>{x(null)},500)};$t.useEffect(()=>{K((e==null?void 0:e.state.chatHistoryLoadingState)===jc.Loading)},[e==null?void 0:e.state.chatHistoryLoadingState]);const L=async()=>{if(!i){a(!1);return}(await _Te()).length===0&&window.location.hostname!=="127.0.0.1"?a(!0):a(!1)};let E={},B={},z="";const Y=(Te,we,Ae)=>{if(console.log("resultMessage :",Te),Te.content.includes("all_exec_results")){const ke=JSON.parse(Te.content);console.log("parsedExecResults :",ke),h(ke.all_exec_results)}Te.role===N&&(z+=Te.content,E=Te,E.content=z,Te.context&&(B={id:kp(),role:w,content:Te.context,date:new Date().toISOString()})),Te.role===w&&(B=Te),Ae?zp.isEmpty(B)?l([...n,E]):l([...n,B,E]):zp.isEmpty(B)?l([...n,we,E]):l([...n,we,B,E])},H=async(Te,we)=>{var Ge,We;K(!0),D(!0);const Ae=new AbortController;p.current.unshift(Ae);const ke={id:kp(),role:"user",content:Te,date:new Date().toISOString()};let Se;if(!we)Se={id:we??kp(),title:Te,messages:[ke],date:new Date().toISOString()};else if(Se=(Ge=e==null?void 0:e.state)==null?void 0:Ge.currentChat,Se)Se.messages.push(ke);else{console.error("Conversation not found."),K(!1),D(!1),p.current=p.current.filter(Be=>Be!==Ae);return}e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:Se}),l(Se.messages);const _e={messages:[...Se.messages.filter(Be=>Be.role!==P)]};let Ee={};try{const Be=await CTe(_e,Ae.signal);if(Be!=null&&Be.body){const Ve=Be.body.getReader();let lt="";for(;;){u("Processing");const{done:pt,value:ct}=await Ve.read();if(pt)break;var Ie=new TextDecoder("utf-8").decode(ct);Ie.split(` + `)+" "+oe[1]:oe[0]+ae+" "+re.join(", ")+" "+oe[1]}D.types=r(41088);function C(re){return Array.isArray(re)}D.isArray=C;function g(re){return typeof re=="boolean"}D.isBoolean=g;function f(re){return re===null}D.isNull=f;function x(re){return re==null}D.isNullOrUndefined=x;function M(re){return typeof re=="number"}D.isNumber=M;function R(re){return typeof re=="string"}D.isString=R;function N(re){return typeof re=="symbol"}D.isSymbol=N;function w(re){return re===void 0}D.isUndefined=w;function P(re){return I(re)&&z(re)==="[object RegExp]"}D.isRegExp=P,D.types.isRegExp=P;function I(re){return typeof re=="object"&&re!==null}D.isObject=I;function d(re){return I(re)&&z(re)==="[object Date]"}D.isDate=d,D.types.isDate=d;function L(re){return I(re)&&(z(re)==="[object Error]"||re instanceof Error)}D.isError=L,D.types.isNativeError=L;function E(re){return typeof re=="function"}D.isFunction=E;function B(re){return re===null||typeof re=="boolean"||typeof re=="number"||typeof re=="string"||typeof re=="symbol"||typeof re>"u"}D.isPrimitive=B,D.isBuffer=r(75272);function z(re){return Object.prototype.toString.call(re)}function Y(re){return re<10?"0"+re.toString(10):re.toString(10)}var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function G(){var re=new Date,ae=[Y(re.getHours()),Y(re.getMinutes()),Y(re.getSeconds())].join(":");return[re.getDate(),H[re.getMonth()],ae].join(" ")}D.log=function(){console.log("%s - %s",G(),D.format.apply(D,arguments))},D.inherits=r(6768),D._extend=function(re,ae){if(!ae||!I(ae))return re;for(var oe=Object.keys(ae),de=oe.length;de--;)re[oe[de]]=ae[oe[de]];return re};function W(re,ae){return Object.prototype.hasOwnProperty.call(re,ae)}var V=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;D.promisify=function(ae){if(typeof ae!="function")throw new TypeError('The "original" argument must be of type Function');if(V&&ae[V]){var oe=ae[V];if(typeof oe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(oe,V,{value:oe,enumerable:!1,writable:!1,configurable:!0}),oe}function oe(){for(var de,te,J=new Promise(function(ue,fe){de=ue,te=fe}),ie=[],Z=0;Z"u"?r.g:globalThis,n=A(),l=_("String.prototype.slice"),s=Object.getPrototypeOf,h=_("Array.prototype.indexOf",!0)||function(C,g){for(var f=0;f-1?g:g!=="Object"?!1:b(C)}return T?u(C):null}},67020:function(k,D,r){var c=r(38700),A=r(50896),o=c.instance();function _(v){this.local=this.regionalOptions[v||""]||this.regionalOptions[""]}_.prototype=new c.baseCalendar,A(_.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(v,u){if(typeof v=="string"){var b=v.match(p);return b?b[0]:""}var m=this._validateYear(v),C=v.month(),g=""+this.toChineseMonth(m,C);return u&&g.length<2&&(g="0"+g),this.isIntercalaryMonth(m,C)&&(g+="i"),g},monthNames:function(v){if(typeof v=="string"){var u=v.match(y);return u?u[0]:""}var b=this._validateYear(v),m=v.month(),C=this.toChineseMonth(b,m),g=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][C-1];return this.isIntercalaryMonth(b,m)&&(g="闰"+g),g},monthNamesShort:function(v){if(typeof v=="string"){var u=v.match(a);return u?u[0]:""}var b=this._validateYear(v),m=v.month(),C=this.toChineseMonth(b,m),g=["一","二","三","四","五","六","七","八","九","十","十一","十二"][C-1];return this.isIntercalaryMonth(b,m)&&(g="闰"+g),g},parseMonth:function(v,u){v=this._validateYear(v);var b=parseInt(u),m;if(isNaN(b))u[0]==="闰"&&(m=!0,u=u.substring(1)),u[u.length-1]==="月"&&(u=u.substring(0,u.length-1)),b=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(u);else{var C=u[u.length-1];m=C==="i"||C==="I"}var g=this.toMonthIndex(v,b,m);return g},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(v,u){if(v.year&&(v=v.year()),typeof v!="number"||v<1888||v>2111)throw u.replace(/\{0\}/,this.local.name);return v},toMonthIndex:function(v,u,b){var m=this.intercalaryMonth(v),C=b&&u!==m;if(C||u<1||u>12)throw c.local.invalidMonth.replace(/\{0\}/,this.local.name);var g;return m?!b&&u<=m?g=u-1:g=u:g=u-1,g},toChineseMonth:function(v,u){v.year&&(v=v.year(),u=v.month());var b=this.intercalaryMonth(v),m=b?12:11;if(u<0||u>m)throw c.local.invalidMonth.replace(/\{0\}/,this.local.name);var C;return b?u>13;return b},isIntercalaryMonth:function(v,u){v.year&&(v=v.year(),u=v.month());var b=this.intercalaryMonth(v);return!!b&&b===u},leapYear:function(v){return this.intercalaryMonth(v)!==0},weekOfYear:function(v,u,b){var m=this._validateYear(v,c.local.invalidyear),C=l[m-l[0]],g=C>>9&4095,f=C>>5&15,x=C&31,M;M=o.newDate(g,f,x),M.add(4-(M.dayOfWeek()||7),"d");var R=this.toJD(v,u,b)-M.toJD();return 1+Math.floor(R/7)},monthsInYear:function(v){return this.leapYear(v)?13:12},daysInMonth:function(v,u){v.year&&(u=v.month(),v=v.year()),v=this._validateYear(v);var b=n[v-n[0]],m=b>>13,C=m?12:11;if(u>C)throw c.local.invalidMonth.replace(/\{0\}/,this.local.name);var g=b&1<<12-u?30:29;return g},weekDay:function(v,u,b){return(this.dayOfWeek(v,u,b)||7)<6},toJD:function(v,u,b){var m=this._validate(v,g,b,c.local.invalidDate);v=this._validateYear(m.year()),u=m.month(),b=m.day();var C=this.isIntercalaryMonth(v,u),g=this.toChineseMonth(v,u),f=h(v,g,b,C);return o.toJD(f.year,f.month,f.day)},fromJD:function(v){var u=o.fromJD(v),b=s(u.year(),u.month(),u.day()),m=this.toMonthIndex(b.year,b.month,b.isIntercalary);return this.newDate(b.year,m,b.day)},fromString:function(v){var u=v.match(T),b=this._validateYear(+u[1]),m=+u[2],C=!!u[3],g=this.toMonthIndex(b,m,C),f=+u[4];return this.newDate(b,g,f)},add:function(v,u,b){var m=v.year(),C=v.month(),g=this.isIntercalaryMonth(m,C),f=this.toChineseMonth(m,C),x=Object.getPrototypeOf(_.prototype).add.call(this,v,u,b);if(b==="y"){var M=x.year(),R=x.month(),N=this.isIntercalaryMonth(M,f),w=g&&N?this.toMonthIndex(M,f,!0):this.toMonthIndex(M,f,!1);w!==R&&x.month(w)}return x}});var T=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,p=/^\d?\d[iI]?/m,y=/^闰?十?[一二三四五六七八九]?月/m,a=/^闰?十?[一二三四五六七八九]?/m;c.calendars.chinese=_;var n=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function s(v,u,b,m){var C,g;if(typeof v=="object")C=v,g=u||{};else{var f=typeof v=="number"&&v>=1888&&v<=2111;if(!f)throw new Error("Solar year outside range 1888-2111");var x=typeof u=="number"&&u>=1&&u<=12;if(!x)throw new Error("Solar month outside range 1 - 12");var M=typeof b=="number"&&b>=1&&b<=31;if(!M)throw new Error("Solar day outside range 1 - 31");C={year:v,month:u,day:b},g=m||{}}var R=l[C.year-l[0]],N=C.year<<9|C.month<<5|C.day;g.year=N>=R?C.year:C.year-1,R=l[g.year-l[0]];var w=R>>9&4095,P=R>>5&15,I=R&31,d,L=new Date(w,P-1,I),E=new Date(C.year,C.month-1,C.day);d=Math.round((E-L)/864e5);var B=n[g.year-n[0]],z;for(z=0;z<13;z++){var Y=B&1<<12-z?30:29;if(d>13;return!H||z=1888&&v<=2111;if(!x)throw new Error("Lunar year outside range 1888-2111");var M=typeof u=="number"&&u>=1&&u<=12;if(!M)throw new Error("Lunar month outside range 1 - 12");var R=typeof b=="number"&&b>=1&&b<=30;if(!R)throw new Error("Lunar day outside range 1 - 30");var N;typeof m=="object"?(N=!1,g=m):(N=!!m,g=C||{}),f={year:v,month:u,day:b,isIntercalary:N}}var w;w=f.day-1;var P=n[f.year-n[0]],I=P>>13,d;I&&(f.month>I||f.isIntercalary)?d=f.month:d=f.month-1;for(var L=0;L>9&4095,Y=B>>5&15,H=B&31,G=new Date(z,Y-1,H+w);return g.year=G.getFullYear(),g.month=1+G.getMonth(),g.day=G.getDate(),g}},89792:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(p){var T=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),p=T.year()+(T.year()<0?1:0);return p%4===3||p%4===-1},monthsInYear:function(_){return this._validate(_,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),13},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===13&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return(this.dayOfWeek(_,T,p)||7)<6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),_<0&&_++,y.day()+(y.month()-1)*30+(_-1)*365+Math.floor(_/4)+this.jdEpoch-1},fromJD:function(_){var T=Math.floor(_)+.5-this.jdEpoch,p=Math.floor((T-Math.floor((T+366)/1461))/365)+1;p<=0&&p--,T=Math.floor(_)+.5-this.newDate(p,1,1).toJD();var y=Math.floor(T/30)+1,a=T-(y-1)*30+1;return this.newDate(p,y,a)}}),c.calendars.coptic=o},55668:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),!1},monthsInYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),13},daysInYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),400},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/8)+1},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return(a.day()+1)%8},weekDay:function(T,p,y){var a=this.dayOfWeek(T,p,y);return a>=2&&a<=6},extraInfo:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return{century:_[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return T=a.year()+(a.year()<0?1:0),p=a.month(),y=a.day(),y+(p>1?16:0)+(p>2?(p-2)*32:0)+(T-1)*400+this.jdEpoch-1},fromJD:function(T){T=Math.floor(T+.5)-Math.floor(this.jdEpoch)-1;var p=Math.floor(T/400)+1;T-=(p-1)*400,T+=T>15?16:0;var y=Math.floor(T/32)+1,a=T-(y-1)*32+1;return this.newDate(p<=0?p-1:p,y,a)}});var _={20:"Fruitbat",21:"Anchovy"};c.calendars.discworld=o},65168:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(p){var T=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),p=T.year()+(T.year()<0?1:0);return p%4===3||p%4===-1},monthsInYear:function(_){return this._validate(_,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),13},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===13&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return(this.dayOfWeek(_,T,p)||7)<6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),_<0&&_++,y.day()+(y.month()-1)*30+(_-1)*365+Math.floor(_/4)+this.jdEpoch-1},fromJD:function(_){var T=Math.floor(_)+.5-this.jdEpoch,p=Math.floor((T-Math.floor((T+366)/1461))/365)+1;p<=0&&p--,T=Math.floor(_)+.5-this.newDate(p,1,1).toJD();var y=Math.floor(T/30)+1,a=T-(y-1)*30+1;return this.newDate(p,y,a)}}),c.calendars.ethiopian=o},2084:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return this._leapYear(p.year())},_leapYear:function(T){return T=T<0?T+1:T,_(T*7+1,19)<7},monthsInYear:function(T){return this._validate(T,this.minMonth,this.minDay,c.local.invalidYear),this._leapYear(T.year?T.year():T)?13:12},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return T=p.year(),this.toJD(T===-1?1:T+1,7,1)-this.toJD(T,7,1)},daysInMonth:function(T,p){return T.year&&(p=T.month(),T=T.year()),this._validate(T,p,this.minDay,c.local.invalidMonth),p===12&&this.leapYear(T)||p===8&&_(this.daysInYear(T),10)===5?30:p===9&&_(this.daysInYear(T),10)===3?29:this.daysPerMonth[p-1]},weekDay:function(T,p,y){return this.dayOfWeek(T,p,y)!==6},extraInfo:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);T=a.year(),p=a.month(),y=a.day();var n=T<=0?T+1:T,l=this.jdEpoch+this._delay1(n)+this._delay2(n)+y+1;if(p<7){for(var s=7;s<=this.monthsInYear(T);s++)l+=this.daysInMonth(T,s);for(var s=1;s=this.toJD(p===-1?1:p+1,7,1);)p++;for(var y=Tthis.toJD(p,y,this.daysInMonth(p,y));)y++;var a=T-this.toJD(p,y,1)+1;return this.newDate(p,y,a)}});function _(T,p){return T-p*Math.floor(T/p)}c.calendars.hebrew=o},26368:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(_){var T=this._validate(_,this.minMonth,this.minDay,c.local.invalidYear);return(T.year()*11+14)%30<11},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInYear:function(_){return this.leapYear(_)?355:354},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===12&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return this.dayOfWeek(_,T,p)!==5},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),T=y.month(),p=y.day(),_=_<=0?_+1:_,p+Math.ceil(29.5*(T-1))+(_-1)*354+Math.floor((3+11*_)/30)+this.jdEpoch-1},fromJD:function(_){_=Math.floor(_)+.5;var T=Math.floor((30*(_-this.jdEpoch)+10646)/10631);T=T<=0?T-1:T;var p=Math.min(12,Math.ceil((_-29-this.toJD(T,1,1))/29.5)+1),y=_-this.toJD(T,p,1)+1;return this.newDate(T,p,y)}}),c.calendars.islamic=o},24747:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(p){var T=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),p=T.year()<0?T.year()+1:T.year();return p%4===0},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(4-(y.dayOfWeek()||7),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInMonth:function(_,T){var p=this._validate(_,T,this.minDay,c.local.invalidMonth);return this.daysPerMonth[p.month()-1]+(p.month()===2&&this.leapYear(p.year())?1:0)},weekDay:function(_,T,p){return(this.dayOfWeek(_,T,p)||7)<6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);return _=y.year(),T=y.month(),p=y.day(),_<0&&_++,T<=2&&(_--,T+=12),Math.floor(365.25*(_+4716))+Math.floor(30.6001*(T+1))+p-1524.5},fromJD:function(_){var T=Math.floor(_+.5),p=T+1524,y=Math.floor((p-122.1)/365.25),a=Math.floor(365.25*y),n=Math.floor((p-a)/30.6001),l=n-Math.floor(n<14?1:13),s=y-Math.floor(l>2?4716:4715),h=p-a-Math.floor(30.6001*n);return s<=0&&s--,this.newDate(s,l,h)}}),c.calendars.julian=o},65616:function(k,D,r){var c=r(38700),A=r(50896);function o(p){this.local=this.regionalOptions[p||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(p){return this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),!1},formatYear:function(p){var y=this._validate(p,this.minMonth,this.minDay,c.local.invalidYear);p=y.year();var a=Math.floor(p/400);p=p%400,p+=p<0?400:0;var n=Math.floor(p/20);return a+"."+n+"."+p%20},forYear:function(p){if(p=p.split("."),p.length<3)throw"Invalid Mayan year";for(var y=0,a=0;a19||a>0&&n<0)throw"Invalid Mayan year";y=y*20+n}return y},monthsInYear:function(p){return this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),18},weekOfYear:function(p,y,a){return this._validate(p,y,a,c.local.invalidDate),0},daysInYear:function(p){return this._validate(p,this.minMonth,this.minDay,c.local.invalidYear),360},daysInMonth:function(p,y){return this._validate(p,y,this.minDay,c.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(p,y,a){var n=this._validate(p,y,a,c.local.invalidDate);return n.day()},weekDay:function(p,y,a){return this._validate(p,y,a,c.local.invalidDate),!0},extraInfo:function(p,y,a){var n=this._validate(p,y,a,c.local.invalidDate),l=n.toJD(),s=this._toHaab(l),h=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[s[0]-1],haabMonth:s[0],haabDay:s[1],tzolkinDayName:this.local.tzolkinMonths[h[0]-1],tzolkinDay:h[0],tzolkinTrecena:h[1]}},_toHaab:function(p){p-=this.jdEpoch;var y=_(p+8+(18-1)*20,365);return[Math.floor(y/20)+1,_(y,20)]},_toTzolkin:function(p){return p-=this.jdEpoch,[T(p+20,20),T(p+4,13)]},toJD:function(p,y,a){var n=this._validate(p,y,a,c.local.invalidDate);return n.day()+n.month()*20+n.year()*360+this.jdEpoch},fromJD:function(p){p=Math.floor(p)+.5-this.jdEpoch;var y=Math.floor(p/360);p=p%360,p+=p<0?360:0;var a=Math.floor(p/20),n=p%20;return this.newDate(y,a,n)}});function _(p,y){return p-y*Math.floor(p/y)}function T(p,y){return _(p-1,y)+1}c.calendars.mayan=o},30632:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar;var _=c.instance("gregorian");A(o.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return _.leapYear(p.year()+(p.year()<1?1:0)+1469)},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(1-(a.dayOfWeek()||7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===12&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return(this.dayOfWeek(T,p,y)||7)<6},toJD:function(n,p,y){var a=this._validate(n,p,y,c.local.invalidMonth),n=a.year();n<0&&n++;for(var l=a.day(),s=1;s=this.toJD(p+1,1,1);)p++;for(var y=T-Math.floor(this.toJD(p,1,1)+.5)+1,a=1;y>this.daysInMonth(p,a);)y-=this.daysInMonth(p,a),a++;return this.newDate(p,a,y)}}),c.calendars.nanakshahi=o},73040:function(k,D,r){var c=r(38700),A=r(50896);function o(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(_){return this.daysInYear(_)!==this.daysPerYear},weekOfYear:function(_,T,p){var y=this.newDate(_,T,p);return y.add(-y.dayOfWeek(),"d"),Math.floor((y.dayOfYear()-1)/7)+1},daysInYear:function(_){var T=this._validate(_,this.minMonth,this.minDay,c.local.invalidYear);if(_=T.year(),typeof this.NEPALI_CALENDAR_DATA[_]>"u")return this.daysPerYear;for(var p=0,y=this.minMonth;y<=12;y++)p+=this.NEPALI_CALENDAR_DATA[_][y];return p},daysInMonth:function(_,T){return _.year&&(T=_.month(),_=_.year()),this._validate(_,T,this.minDay,c.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[_]>"u"?this.daysPerMonth[T-1]:this.NEPALI_CALENDAR_DATA[_][T]},weekDay:function(_,T,p){return this.dayOfWeek(_,T,p)!==6},toJD:function(_,T,p){var y=this._validate(_,T,p,c.local.invalidDate);_=y.year(),T=y.month(),p=y.day();var a=c.instance(),n=0,l=T,s=_;this._createMissingCalendarData(_);var h=_-(l>9||l===9&&p>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(T!==9&&(n=p,l--);l!==9;)l<=0&&(l=12,s--),n+=this.NEPALI_CALENDAR_DATA[s][l],l--;return T===9?(n+=p-this.NEPALI_CALENDAR_DATA[s][0],n<0&&(n+=a.daysInYear(h))):n+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],a.newDate(h,1,1).add(n,"d").toJD()},fromJD:function(_){var T=c.instance(),p=T.fromJD(_),y=p.year(),a=p.dayOfYear(),n=y+56;this._createMissingCalendarData(n);for(var l=9,s=this.NEPALI_CALENDAR_DATA[n][0],h=this.NEPALI_CALENDAR_DATA[n][l]-s+1;a>h;)l++,l>12&&(l=1,n++),h+=this.NEPALI_CALENDAR_DATA[n][l];var v=this.NEPALI_CALENDAR_DATA[n][l]-(h-a);return this.newDate(n,l,v)},_createMissingCalendarData:function(_){var T=this.daysPerMonth.slice(0);T.unshift(17);for(var p=_-1;p<_+2;p++)typeof this.NEPALI_CALENDAR_DATA[p]>"u"&&(this.NEPALI_CALENDAR_DATA[p]=T)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),c.calendars.nepali=o},1104:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return((p.year()-(p.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-((a.dayOfWeek()+1)%7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===12&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return this.dayOfWeek(T,p,y)!==5},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate);T=a.year(),p=a.month(),y=a.day();var n=T-(T>=0?474:473),l=474+_(n,2820);return y+(p<=7?(p-1)*31:(p-1)*30+6)+Math.floor((l*682-110)/2816)+(l-1)*365+Math.floor(n/2820)*1029983+this.jdEpoch-1},fromJD:function(T){T=Math.floor(T)+.5;var p=T-this.toJD(475,1,1),y=Math.floor(p/1029983),a=_(p,1029983),n=2820;if(a!==1029982){var l=Math.floor(a/366),s=_(a,366);n=Math.floor((2134*l+2816*s+2815)/1028522)+l+1}var h=n+2820*y+474;h=h<=0?h-1:h;var v=T-this.toJD(h,1,1)+1,u=v<=186?Math.ceil(v/31):Math.ceil((v-6)/30),b=T-this.toJD(h,u,1)+1;return this.newDate(h,u,b)}});function _(T,p){return T-p*Math.floor(T/p)}c.calendars.persian=o,c.calendars.jalali=o},51456:function(k,D,r){var c=r(38700),A=r(50896),o=c.instance();function _(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}_.prototype=new c.baseCalendar,A(_.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(y){var p=this._validate(y,this.minMonth,this.minDay,c.local.invalidYear),y=this._t2gYear(p.year());return o.leapYear(y)},weekOfYear:function(n,p,y){var a=this._validate(n,this.minMonth,this.minDay,c.local.invalidYear),n=this._t2gYear(a.year());return o.weekOfYear(n,a.month(),a.day())},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===2&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return(this.dayOfWeek(T,p,y)||7)<6},toJD:function(n,p,y){var a=this._validate(n,p,y,c.local.invalidDate),n=this._t2gYear(a.year());return o.toJD(n,a.month(),a.day())},fromJD:function(T){var p=o.fromJD(T),y=this._g2tYear(p.year());return this.newDate(y,p.month(),p.day())},_t2gYear:function(T){return T+this.yearsOffset+(T>=-this.yearsOffset&&T<=-1?1:0)},_g2tYear:function(T){return T-this.yearsOffset-(T>=1&&T<=this.yearsOffset?1:0)}}),c.calendars.taiwan=_},4592:function(k,D,r){var c=r(38700),A=r(50896),o=c.instance();function _(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}_.prototype=new c.baseCalendar,A(_.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(y){var p=this._validate(y,this.minMonth,this.minDay,c.local.invalidYear),y=this._t2gYear(p.year());return o.leapYear(y)},weekOfYear:function(n,p,y){var a=this._validate(n,this.minMonth,this.minDay,c.local.invalidYear),n=this._t2gYear(a.year());return o.weekOfYear(n,a.month(),a.day())},daysInMonth:function(T,p){var y=this._validate(T,p,this.minDay,c.local.invalidMonth);return this.daysPerMonth[y.month()-1]+(y.month()===2&&this.leapYear(y.year())?1:0)},weekDay:function(T,p,y){return(this.dayOfWeek(T,p,y)||7)<6},toJD:function(n,p,y){var a=this._validate(n,p,y,c.local.invalidDate),n=this._t2gYear(a.year());return o.toJD(n,a.month(),a.day())},fromJD:function(T){var p=o.fromJD(T),y=this._g2tYear(p.year());return this.newDate(y,p.month(),p.day())},_t2gYear:function(T){return T-this.yearsOffset-(T>=1&&T<=this.yearsOffset?1:0)},_g2tYear:function(T){return T+this.yearsOffset+(T>=-this.yearsOffset&&T<=-1?1:0)}}),c.calendars.thai=_},45348:function(k,D,r){var c=r(38700),A=r(50896);function o(T){this.local=this.regionalOptions[T||""]||this.regionalOptions[""]}o.prototype=new c.baseCalendar,A(o.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(T){var p=this._validate(T,this.minMonth,this.minDay,c.local.invalidYear);return this.daysInYear(p.year())===355},weekOfYear:function(T,p,y){var a=this.newDate(T,p,y);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(T){for(var p=0,y=1;y<=12;y++)p+=this.daysInMonth(T,y);return p},daysInMonth:function(T,p){for(var y=this._validate(T,p,this.minDay,c.local.invalidMonth),a=y.toJD()-24e5+.5,n=0,l=0;l<_.length;l++){if(_[l]>a)return _[n]-_[n-1];n++}return 30},weekDay:function(T,p,y){return this.dayOfWeek(T,p,y)!==5},toJD:function(T,p,y){var a=this._validate(T,p,y,c.local.invalidDate),n=12*(a.year()-1)+a.month()-15292,l=a.day()+_[n-1]-1;return l+24e5-.5},fromJD:function(T){for(var p=T-24e5+.5,y=0,a=0;a<_.length&&!(_[a]>p);a++)y++;var n=y+15292,l=Math.floor((n-1)/12),s=l+1,h=n-12*l,v=p-_[y-1]+1;return this.newDate(s,h,v)},isValid:function(T,p,y){var a=c.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(T=T.year!=null?T.year:T,a=T>=1276&&T<=1500),a},_validate:function(T,p,y,a){var n=c.baseCalendar.prototype._validate.apply(this,arguments);if(n.year<1276||n.year>1500)throw a.replace(/\{0\}/,this.local.name);return n}}),c.calendars.ummalqura=o;var _=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},38700:function(k,D,r){var c=r(50896);function A(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}c(A.prototype,{instance:function(a,n){a=(a||"gregorian").toLowerCase(),n=n||"";var l=this._localCals[a+"-"+n];if(!l&&this.calendars[a]&&(l=new this.calendars[a](n),this._localCals[a+"-"+n]=l),!l)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,a);return l},newDate:function(a,n,l,s,h){return s=(a!=null&&a.year?a.calendar():typeof s=="string"?this.instance(s,h):s)||this.instance(),s.newDate(a,n,l)},substituteDigits:function(a){return function(n){return(n+"").replace(/[0-9]/g,function(l){return a[l]})}},substituteChineseDigits:function(a,n){return function(l){for(var s="",h=0;l>0;){var v=l%10;s=(v===0?"":a[v]+n[h])+s,h++,l=Math.floor(l/10)}return s.indexOf(a[1]+n[1])===0&&(s=s.substr(1)),s||a[0]}}});function o(a,n,l,s){if(this._calendar=a,this._year=n,this._month=l,this._day=s,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(y.local.invalidDate||y.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function _(a,n){return a=""+a,"000000".substring(0,n-a.length)+a}c(o.prototype,{newDate:function(a,n,l){return this._calendar.newDate(a??this,n,l)},year:function(a){return arguments.length===0?this._year:this.set(a,"y")},month:function(a){return arguments.length===0?this._month:this.set(a,"m")},day:function(a){return arguments.length===0?this._day:this.set(a,"d")},date:function(a,n,l){if(!this._calendar.isValid(a,n,l))throw(y.local.invalidDate||y.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=a,this._month=n,this._day=l,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(a,n){return this._calendar.add(this,a,n)},set:function(a,n){return this._calendar.set(this,a,n)},compareTo:function(a){if(this._calendar.name!==a._calendar.name)throw(y.local.differentCalendars||y.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,a._calendar.local.name);var n=this._year!==a._year?this._year-a._year:this._month!==a._month?this.monthOfYear()-a.monthOfYear():this._day-a._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(a){return this._calendar.fromJD(a)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(a){return this._calendar.fromJSDate(a)},toString:function(){return(this.year()<0?"-":"")+_(Math.abs(this.year()),4)+"-"+_(this.month(),2)+"-"+_(this.day(),2)}});function T(){this.shortYearCutoff="+10"}c(T.prototype,{_validateLevel:0,newDate:function(a,n,l){return a==null?this.today():(a.year&&(this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate),l=a.day(),n=a.month(),a=a.year()),new o(this,a,n,l))},today:function(){return this.fromJSDate(new Date)},epoch:function(a){var n=this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(a){var n=this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+_(Math.abs(n.year()),4)},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear),12},monthOfYear:function(a,n){var l=this._validate(a,n,this.minDay,y.local.invalidMonth||y.regionalOptions[""].invalidMonth);return(l.month()+this.monthsInYear(l)-this.firstMonth)%this.monthsInYear(l)+this.minMonth},fromMonthOfYear:function(a,n){var l=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(a)+this.minMonth;return this._validate(a,l,this.minDay,y.local.invalidMonth||y.regionalOptions[""].invalidMonth),l},daysInYear:function(a){var n=this._validate(a,this.minMonth,this.minDay,y.local.invalidYear||y.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(a,n,l){var s=this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate);return s.toJD()-this.newDate(s.year(),this.fromMonthOfYear(s.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(a,n,l){var s=this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(s))+2)%this.daysInWeek()},extraInfo:function(a,n,l){return this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate),{}},add:function(a,n,l){return this._validate(a,this.minMonth,this.minDay,y.local.invalidDate||y.regionalOptions[""].invalidDate),this._correctAdd(a,this._add(a,n,l),n,l)},_add:function(a,n,l){if(this._validateLevel++,l==="d"||l==="w"){var s=a.toJD()+n*(l==="w"?this.daysInWeek():1),h=a.calendar().fromJD(s);return this._validateLevel--,[h.year(),h.month(),h.day()]}try{var v=a.year()+(l==="y"?n:0),u=a.monthOfYear()+(l==="m"?n:0),h=a.day(),b=function(g){for(;uf-1+g.minMonth;)v++,u-=f,f=g.monthsInYear(v)};l==="y"?(a.month()!==this.fromMonthOfYear(v,u)&&(u=this.newDate(v,a.month(),this.minDay).monthOfYear()),u=Math.min(u,this.monthsInYear(v)),h=Math.min(h,this.daysInMonth(v,this.fromMonthOfYear(v,u)))):l==="m"&&(b(this),h=Math.min(h,this.daysInMonth(v,this.fromMonthOfYear(v,u))));var m=[v,this.fromMonthOfYear(v,u),h];return this._validateLevel--,m}catch(C){throw this._validateLevel--,C}},_correctAdd:function(a,n,l,s){if(!this.hasYearZero&&(s==="y"||s==="m")&&(n[0]===0||a.year()>0!=n[0]>0)){var h={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[s],v=l<0?-1:1;n=this._add(a,l*h[0]+v*h[1],h[2])}return a.date(n[0],n[1],n[2])},set:function(a,n,l){this._validate(a,this.minMonth,this.minDay,y.local.invalidDate||y.regionalOptions[""].invalidDate);var s=l==="y"?n:a.year(),h=l==="m"?n:a.month(),v=l==="d"?n:a.day();return(l==="y"||l==="m")&&(v=Math.min(v,this.daysInMonth(s,h))),a.date(s,h,v)},isValid:function(a,n,l){this._validateLevel++;var s=this.hasYearZero||a!==0;if(s){var h=this.newDate(a,n,this.minDay);s=n>=this.minMonth&&n-this.minMonth=this.minDay&&l-this.minDay13.5?13:1),C=h-(m>2.5?4716:4715);return C<=0&&C--,this.newDate(C,m,b)},toJSDate:function(a,n,l){var s=this._validate(a,n,l,y.local.invalidDate||y.regionalOptions[""].invalidDate),h=new Date(s.year(),s.month()-1,s.day());return h.setHours(0),h.setMinutes(0),h.setSeconds(0),h.setMilliseconds(0),h.setHours(h.getHours()>12?h.getHours()+2:0),h},fromJSDate:function(a){return this.newDate(a.getFullYear(),a.getMonth()+1,a.getDate())}});var y=k.exports=new A;y.cdate=o,y.baseCalendar=T,y.calendars.gregorian=p},15168:function(k,D,r){var c=r(50896),A=r(38700);c(A.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),A.local=A.regionalOptions[""],c(A.cdate.prototype,{formatDate:function(o,_){return typeof o!="string"&&(_=o,o=""),this._calendar.formatDate(o||"",this,_)}}),c(A.baseCalendar.prototype,{UNIX_EPOCH:A.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:A.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(o,_,T){if(typeof o!="string"&&(T=_,_=o,o=""),!_)return"";if(_.calendar()!==this)throw A.local.invalidFormat||A.regionalOptions[""].invalidFormat;o=o||this.local.dateFormat,T=T||{};var p=T.dayNamesShort||this.local.dayNamesShort,y=T.dayNames||this.local.dayNames,a=T.monthNumbers||this.local.monthNumbers,n=T.monthNamesShort||this.local.monthNamesShort,l=T.monthNames||this.local.monthNames;T.calculateWeek||this.local.calculateWeek;for(var s=function(R,N){for(var w=1;M+w1},h=function(R,N,w,P){var I=""+N;if(s(R,P))for(;I.length1},M=function(z,Y){var H=x(z,Y),G=[2,3,H?4:2,H?4:2,10,11,20]["oyYJ@!".indexOf(z)+1],W=new RegExp("^-?\\d{1,"+G+"}"),V=_.substring(d).match(W);if(!V)throw(A.local.missingNumberAt||A.regionalOptions[""].missingNumberAt).replace(/\{0\}/,d);return d+=V[0].length,parseInt(V[0],10)},R=this,N=function(){if(typeof l=="function"){x("m");var z=l.call(R,_.substring(d));return d+=z.length,z}return M("m")},w=function(z,Y,H,G){for(var W=x(z,G)?H:Y,V=0;V-1){b=1,m=C;for(var B=this.daysInMonth(u,b);m>B;B=this.daysInMonth(u,b))b++,m-=B}return v>-1?this.fromJD(v):this.newDate(u,b,m)},determineDate:function(o,_,T,p,y){T&&typeof T!="object"&&(y=p,p=T,T=null),typeof p!="string"&&(y=p,p="");var a=this,n=function(l){try{return a.parseDate(p,l,y)}catch{}l=l.toLowerCase();for(var s=(l.match(/^c/)&&T?T.newDate():null)||a.today(),h=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,v=h.exec(l);v;)s.add(parseInt(v[1],10),v[2]||"d"),v=h.exec(l);return s};return _=_?_.newDate():null,o=o==null?_:typeof o=="string"?n(o):typeof o=="number"?isNaN(o)||o===1/0||o===-1/0?_:a.today().add(o,"d"):a.newDate(o),o}})},21576:function(){},19768:function(){},63436:function(k,D,r){var c=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],A=typeof globalThis>"u"?r.g:globalThis;k.exports=function(){for(var _=[],T=0;T>8&15|Ie>>4&240,Ie>>4&15|Ie&240,(Ie&15)<<4|Ie&15,1):Ge===8?N(Ie>>24&255,Ie>>16&255,Ie>>8&255,(Ie&255)/255):Ge===4?N(Ie>>12&15|Ie>>8&240,Ie>>8&15|Ie>>4&240,Ie>>4&15|Ie&240,((Ie&15)<<4|Ie&15)/255):null):(Ie=l.exec(Ee))?new I(Ie[1],Ie[2],Ie[3],1):(Ie=s.exec(Ee))?new I(Ie[1]*255/100,Ie[2]*255/100,Ie[3]*255/100,1):(Ie=h.exec(Ee))?N(Ie[1],Ie[2],Ie[3],Ie[4]):(Ie=v.exec(Ee))?N(Ie[1]*255/100,Ie[2]*255/100,Ie[3]*255/100,Ie[4]):(Ie=u.exec(Ee))?H(Ie[1],Ie[2]/100,Ie[3]/100,1):(Ie=b.exec(Ee))?H(Ie[1],Ie[2]/100,Ie[3]/100,Ie[4]):m.hasOwnProperty(Ee)?R(m[Ee]):Ee==="transparent"?new I(NaN,NaN,NaN,0):null}function R(Ee){return new I(Ee>>16&255,Ee>>8&255,Ee&255,1)}function N(Ee,Ie,Ge,We){return We<=0&&(Ee=Ie=Ge=NaN),new I(Ee,Ie,Ge,We)}function w(Ee){return Ee instanceof o||(Ee=M(Ee)),Ee?(Ee=Ee.rgb(),new I(Ee.r,Ee.g,Ee.b,Ee.opacity)):new I}function P(Ee,Ie,Ge,We){return arguments.length===1?w(Ee):new I(Ee,Ie,Ge,We??1)}function I(Ee,Ie,Ge,We){this.r=+Ee,this.g=+Ie,this.b=+Ge,this.opacity=+We}c(I,P,A(o,{brighter:function(Ie){return Ie=Ie==null?T:Math.pow(T,Ie),new I(this.r*Ie,this.g*Ie,this.b*Ie,this.opacity)},darker:function(Ie){return Ie=Ie==null?_:Math.pow(_,Ie),new I(this.r*Ie,this.g*Ie,this.b*Ie,this.opacity)},rgb:function(){return this},clamp:function(){return new I(z(this.r),z(this.g),z(this.b),B(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:d,formatHex:d,formatHex8:L,formatRgb:E,toString:E}));function d(){return"#".concat(Y(this.r)).concat(Y(this.g)).concat(Y(this.b))}function L(){return"#".concat(Y(this.r)).concat(Y(this.g)).concat(Y(this.b)).concat(Y((isNaN(this.opacity)?1:this.opacity)*255))}function E(){var Ee=B(this.opacity);return"".concat(Ee===1?"rgb(":"rgba(").concat(z(this.r),", ").concat(z(this.g),", ").concat(z(this.b)).concat(Ee===1?")":", ".concat(Ee,")"))}function B(Ee){return isNaN(Ee)?1:Math.max(0,Math.min(1,Ee))}function z(Ee){return Math.max(0,Math.min(255,Math.round(Ee)||0))}function Y(Ee){return Ee=z(Ee),(Ee<16?"0":"")+Ee.toString(16)}function H(Ee,Ie,Ge,We){return We<=0?Ee=Ie=Ge=NaN:Ge<=0||Ge>=1?Ee=Ie=NaN:Ie<=0&&(Ee=NaN),new V(Ee,Ie,Ge,We)}function G(Ee){if(Ee instanceof V)return new V(Ee.h,Ee.s,Ee.l,Ee.opacity);if(Ee instanceof o||(Ee=M(Ee)),!Ee)return new V;if(Ee instanceof V)return Ee;Ee=Ee.rgb();var Ie=Ee.r/255,Ge=Ee.g/255,We=Ee.b/255,Be=Math.min(Ie,Ge,We),Ve=Math.max(Ie,Ge,We),lt=NaN,pt=Ve-Be,ct=(Ve+Be)/2;return pt?(Ie===Ve?lt=(Ge-We)/pt+(Ge0&&ct<1?0:lt,new V(lt,pt,ct,Ee.opacity)}function W(Ee,Ie,Ge,We){return arguments.length===1?G(Ee):new V(Ee,Ie,Ge,We??1)}function V(Ee,Ie,Ge,We){this.h=+Ee,this.s=+Ie,this.l=+Ge,this.opacity=+We}c(V,W,A(o,{brighter:function(Ie){return Ie=Ie==null?T:Math.pow(T,Ie),new V(this.h,this.s,this.l*Ie,this.opacity)},darker:function(Ie){return Ie=Ie==null?_:Math.pow(_,Ie),new V(this.h,this.s,this.l*Ie,this.opacity)},rgb:function(){var Ie=this.h%360+(this.h<0)*360,Ge=isNaN(Ie)||isNaN(this.s)?0:this.s,We=this.l,Be=We+(We<.5?We:1-We)*Ge,Ve=2*We-Be;return new I(re(Ie>=240?Ie-240:Ie+120,Ve,Be),re(Ie,Ve,Be),re(Ie<120?Ie+240:Ie-120,Ve,Be),this.opacity)},clamp:function(){return new V(j(this.h),$(this.s),$(this.l),B(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var Ie=B(this.opacity);return"".concat(Ie===1?"hsl(":"hsla(").concat(j(this.h),", ").concat($(this.s)*100,"%, ").concat($(this.l)*100,"%").concat(Ie===1?")":", ".concat(Ie,")"))}}));function j(Ee){return Ee=(Ee||0)%360,Ee<0?Ee+360:Ee}function $(Ee){return Math.max(0,Math.min(1,Ee||0))}function re(Ee,Ie,Ge){return(Ee<60?Ie+(Ge-Ie)*Ee/60:Ee<180?Ge:Ee<240?Ie+(Ge-Ie)*(240-Ee)/60:Ie)*255}var ae=function(Ee){return function(){return Ee}};function oe(Ee,Ie){return function(Ge){return Ee+Ge*Ie}}function de(Ee,Ie,Ge){return Ee=Math.pow(Ee,Ge),Ie=Math.pow(Ie,Ge)-Ee,Ge=1/Ge,function(We){return Math.pow(Ee+We*Ie,Ge)}}function te(Ee){return(Ee=+Ee)==1?J:function(Ie,Ge){return Ge-Ie?de(Ie,Ge,Ee):ae(isNaN(Ie)?Ge:Ie)}}function J(Ee,Ie){var Ge=Ie-Ee;return Ge?oe(Ee,Ge):ae(isNaN(Ee)?Ie:Ee)}var ie=function Ee(Ie){var Ge=te(Ie);function We(Be,Ve){var lt=Ge((Be=P(Be)).r,(Ve=P(Ve)).r),pt=Ge(Be.g,Ve.g),ct=Ge(Be.b,Ve.b),nt=J(Be.opacity,Ve.opacity);return function(vt){return Be.r=lt(vt),Be.g=pt(vt),Be.b=ct(vt),Be.opacity=nt(vt),Be+""}}return We.gamma=Ee,We}(1);function Z(Ee,Ie){var Ge=Ie?Ie.length:0,We=Ee?Math.min(Ge,Ee.length):0,Be=new Array(We),Ve=new Array(Ge),lt;for(lt=0;ltGe&&(Ve=Ie.slice(Ge,Ve),pt[lt]?pt[lt]+=Ve:pt[++lt]=Ve),(We=We[0])===(Be=Be[0])?pt[lt]?pt[lt]+=Be:pt[++lt]=Be:(pt[++lt]=null,ct.push({i:lt,x:fe(We,Be)})),Ge=se.lastIndex;return Ge{switch(t.type){case"TOGGLE_CHAT_HISTORY":return{...e,isChatHistoryOpen:!e.isChatHistoryOpen};case"UPDATE_CURRENT_CHAT":return{...e,currentChat:t.payload};case"UPDATE_CHAT_HISTORY_LOADING_STATE":return{...e,chatHistoryLoadingState:t.payload};case"UPDATE_CHAT_HISTORY":if(!e.chatHistory||!e.currentChat)return e;const i=e.chatHistory.findIndex(k=>k.id===t.payload.id);if(i!==-1){const k=[...e.chatHistory];return k[i]=e.currentChat,{...e,chatHistory:k}}else return{...e,chatHistory:[...e.chatHistory,t.payload]};case"UPDATE_CHAT_TITLE":if(!e.chatHistory)return{...e,chatHistory:[]};const S=e.chatHistory.map(k=>{var D;return k.id===t.payload.id?(((D=e.currentChat)==null?void 0:D.id)===t.payload.id&&(e.currentChat.title=t.payload.title),{...k,title:t.payload.title}):k});return{...e,chatHistory:S};case"DELETE_CHAT_ENTRY":if(!e.chatHistory)return{...e,chatHistory:[]};const U=e.chatHistory.filter(k=>k.id!==t.payload);return e.currentChat=null,{...e,chatHistory:U};case"DELETE_CHAT_HISTORY":return{...e,chatHistory:[],filteredChatHistory:[],currentChat:null};case"DELETE_CURRENT_CHAT_MESSAGES":if(!e.currentChat||!e.chatHistory)return e;const K={...e.currentChat,messages:[]};return{...e,currentChat:K};case"FETCH_CHAT_HISTORY":return{...e,chatHistory:t.payload};case"SET_COSMOSDB_STATUS":return{...e,isCosmosDBAvailable:t.payload};case"FETCH_FRONTEND_SETTINGS":return{...e,frontendSettings:t.payload};case"SET_FEEDBACK_STATE":return{...e,feedbackState:{...e.feedbackState,[t.payload.answerId]:t.payload.feedback}};default:return e}},UTe={isChatHistoryOpen:!1,chatHistoryLoadingState:jc.Loading,chatHistory:null,filteredChatHistory:null,currentChat:null,isCosmosDBAvailable:{cosmosDB:!1,status:vc.NotConfigured},frontendSettings:null,feedbackState:{}},m1=$t.createContext(void 0),HTe=({children:e})=>{const[t,i]=$t.useReducer(zTe,UTe);return $t.useEffect(()=>{const S=async(K=0)=>await Oj(K).then(D=>(i(D?{type:"FETCH_CHAT_HISTORY",payload:D}:{type:"FETCH_CHAT_HISTORY",payload:null}),D)).catch(D=>(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"FETCH_CHAT_HISTORY",payload:null}),console.error("There was an issue fetching your data."),null));(async()=>{i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Loading}),NTe().then(K=>{K!=null&&K.cosmosDB?S().then(k=>{k?(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Success}),i({type:"SET_COSMOSDB_STATUS",payload:K})):(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:{cosmosDB:!1,status:vc.NotWorking}}))}).catch(k=>{i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:{cosmosDB:!1,status:vc.NotWorking}})}):(i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:K}))}).catch(K=>{i({type:"UPDATE_CHAT_HISTORY_LOADING_STATE",payload:jc.Fail}),i({type:"SET_COSMOSDB_STATUS",payload:{cosmosDB:!1,status:vc.NotConfigured}})})})()},[]),$t.useEffect(()=>{(async()=>{PTe().then(U=>{i({type:"FETCH_FRONTEND_SETTINGS",payload:U})}).catch(U=>{console.error("There was an issue fetching your data.")})})()},[]),Wn(m1.Provider,{value:{state:t,dispatch:i},children:e})},GTe=e=>{const t=new Map;for(const i of e){const{filepath:S}=i;let U=1;t.has(S)&&(U=t.get(S)+1),t.set(S,U),i.part_index=U}return e};function VTe(e){let t=e.answer;const i=t.match(/\[(doc\d\d?\d?)]/g),S=4;let U=[],K=0;return i==null||i.forEach(k=>{const D=k.slice(S,k.length-1),r=zp.cloneDeep(e.citations[Number(D)-1]);!U.find(c=>c.id===D)&&r&&(t=t.replaceAll(k,` ^${++K}^ `),r.id=D,r.reindex_id=K.toString(),U.push(r))}),U=GTe(U),{citations:U,markdownFormatText:t,plotly_data:e.plotly_data}}const WTe="_answerContainer_1qm4u_1",YTe="_answerText_1qm4u_14",jTe="_answerHeader_1qm4u_31",KTe="_answerFooter_1qm4u_35",XTe="_answerDisclaimerContainer_1qm4u_44",$Te="_answerDisclaimer_1qm4u_44",ZTe="_citationWrapper_1qm4u_64",JTe="_citationContainer_1qm4u_72",QTe="_citation_1qm4u_64",qTe="_accordionIcon_1qm4u_122",eEe="_accordionTitle_1qm4u_137",tEe="_clickableSup_1qm4u_153",Uf={answerContainer:WTe,answerText:YTe,answerHeader:jTe,answerFooter:KTe,answerDisclaimerContainer:XTe,answerDisclaimer:$Te,citationWrapper:ZTe,citationContainer:JTe,citation:QTe,accordionIcon:qTe,accordionTitle:eEe,clickableSup:tEe},aU=({answer:e,onCitationClicked:t,onExectResultClicked:i})=>{var N,w,P,I;const S=d=>{if(d.message_id!=null&&d.feedback!=null)return d.feedback.split(",").length>1?To.Negative:Object.values(To).includes(d.feedback)?d.feedback:To.Neutral},[U,{toggle:K}]=z2(!1),k=50,D=$t.useMemo(()=>VTe(e),[e]),[r,c]=$t.useState(U),[A,o]=$t.useState(S(e)),[_,T]=$t.useState(!1),[p,y]=$t.useState(!1),[a,n]=$t.useState([]),l=$t.useContext(m1),s=((N=l==null?void 0:l.state.frontendSettings)==null?void 0:N.feedback_enabled)&&((w=l==null?void 0:l.state.isCosmosDBAvailable)==null?void 0:w.cosmosDB),h=(P=l==null?void 0:l.state.frontendSettings)==null?void 0:P.sanitize_answer,v=()=>{c(!r),K()};$t.useEffect(()=>{c(U)},[U]),$t.useEffect(()=>{if(e.message_id==null)return;let d;l!=null&&l.state.feedbackState&&(l!=null&&l.state.feedbackState[e.message_id])?d=l==null?void 0:l.state.feedbackState[e.message_id]:d=S(e),o(d)},[l==null?void 0:l.state.feedbackState,A,e.message_id]);const u=(d,L,E=!1)=>{let B="";if(d.filepath){const z=d.part_index??(d.chunk_id?parseInt(d.chunk_id)+1:"");if(E&&d.filepath.length>k){const Y=d.filepath.length;B=`${d.filepath.substring(0,20)}...${d.filepath.substring(Y-20)} - Part ${z}`}else B=`${d.filepath} - Part ${z}`}else d.filepath&&d.reindex_id?B=`${d.filepath} - Part ${d.reindex_id}`:B=`Citation ${L}`;return B},b=async()=>{if(e.message_id==null)return;let d=A;A==To.Positive?d=To.Neutral:d=To.Positive,l==null||l.dispatch({type:"SET_FEEDBACK_STATE",payload:{answerId:e.message_id,feedback:d}}),o(d),await q6(e.message_id,d)},m=async()=>{if(e.message_id==null)return;let d=A;A===void 0||A===To.Neutral||A===To.Positive?(d=To.Negative,o(d),T(!0)):(d=To.Neutral,o(d),await q6(e.message_id,To.Neutral)),l==null||l.dispatch({type:"SET_FEEDBACK_STATE",payload:{answerId:e.message_id,feedback:d}})},C=(d,L)=>{var z;if(e.message_id==null)return;const E=(z=d==null?void 0:d.target)==null?void 0:z.id;let B=a.slice();L?B.push(E):B=B.filter(Y=>Y!==E),n(B)},g=async()=>{e.message_id!=null&&(await q6(e.message_id,a.join(",")),f())},f=()=>{T(!1),y(!1),n([])},x=()=>Ei(Nd,{children:[Wn("div",{children:"Why wasn't this response helpful?"}),Ei(wi,{tokens:{childrenGap:4},children:[Wn(Vv,{label:"Citations are missing",id:To.MissingCitation,defaultChecked:a.includes(To.MissingCitation),onChange:C}),Wn(Vv,{label:"Citations are wrong",id:To.WrongCitation,defaultChecked:a.includes(To.WrongCitation),onChange:C}),Wn(Vv,{label:"The response is not from my data",id:To.OutOfScope,defaultChecked:a.includes(To.OutOfScope),onChange:C}),Wn(Vv,{label:"Inaccurate or irrelevant",id:To.InaccurateOrIrrelevant,defaultChecked:a.includes(To.InaccurateOrIrrelevant),onChange:C}),Wn(Vv,{label:"Other",id:To.OtherUnhelpful,defaultChecked:a.includes(To.OtherUnhelpful),onChange:C})]}),Wn("div",{onClick:()=>y(!0),style:{color:"#115EA3",cursor:"pointer"},children:"Report inappropriate content"})]}),M=()=>Ei(Nd,{children:[Ei("div",{children:["The content is ",Wn("span",{style:{color:"red"},children:"*"})]}),Ei(wi,{tokens:{childrenGap:4},children:[Wn(Vv,{label:"Hate speech, stereotyping, demeaning",id:To.HateSpeech,defaultChecked:a.includes(To.HateSpeech),onChange:C}),Wn(Vv,{label:"Violent: glorification of violence, self-harm",id:To.Violent,defaultChecked:a.includes(To.Violent),onChange:C}),Wn(Vv,{label:"Sexual: explicit content, grooming",id:To.Sexual,defaultChecked:a.includes(To.Sexual),onChange:C}),Wn(Vv,{label:"Manipulative: devious, emotional, pushy, bullying",defaultChecked:a.includes(To.Manipulative),id:To.Manipulative,onChange:C}),Wn(Vv,{label:"Other",id:To.OtherHarmful,defaultChecked:a.includes(To.OtherHarmful),onChange:C})]})]}),R={code({node:d,...L}){let E;if(L.className){const z=L.className.match(/language-(\w+)/);E=z?z[1]:void 0}const B=d.children[0].value??"";return Wn(L9,{style:k9,language:E,PreTag:"div",...L,children:B})}};return Ei(Nd,{children:[Ei(wi,{className:Uf.answerContainer,tabIndex:0,children:[Wn(wi.Item,{children:Ei(wi,{horizontal:!0,grow:!0,children:[Wn(wi.Item,{grow:!0,children:Wn($w,{linkTarget:"_blank",remarkPlugins:[vY,OTe],children:h?QY.sanitize(D.markdownFormatText,{ALLOWED_TAGS:Pj}):D.markdownFormatText,className:Uf.answerText,components:R})}),Wn(wi.Item,{className:Uf.answerHeader,children:s&&e.message_id!==void 0&&Ei(wi,{horizontal:!0,horizontalAlign:"space-between",children:[Wn(Vae,{"aria-hidden":"false","aria-label":"Like this response",onClick:()=>b(),style:A===To.Positive||(l==null?void 0:l.state.feedbackState[e.message_id])===To.Positive?{color:"darkgreen",cursor:"pointer"}:{color:"slategray",cursor:"pointer"}}),Wn(Hae,{"aria-hidden":"false","aria-label":"Dislike this response",onClick:()=>m(),style:A!==To.Positive&&A!==To.Neutral&&A!==void 0?{color:"darkred",cursor:"pointer"}:{color:"slategray",cursor:"pointer"}})]})})]})}),D.plotly_data!==null&&Wn(wi,{className:Uf.answerContainer,children:Wn(wi.Item,{grow:!0,children:Wn(BTe,{data:D.plotly_data.data,layout:D.plotly_data.layout})})}),Ei(wi,{horizontal:!0,className:Uf.answerFooter,children:[!!D.citations.length&&Wn(wi.Item,{onKeyDown:d=>d.key==="Enter"||d.key===" "?K():null,children:Wn(wi,{style:{width:"100%"},children:Ei(wi,{horizontal:!0,horizontalAlign:"start",verticalAlign:"center",children:[Wn(Vp,{className:Uf.accordionTitle,onClick:K,"aria-label":"Open references",tabIndex:0,role:"button",children:Wn("span",{children:D.citations.length>1?D.citations.length+" references":"1 reference"})}),Wn(T2,{className:Uf.accordionIcon,onClick:v,iconName:r?"ChevronDown":"ChevronRight"})]})})}),Wn(wi.Item,{className:Uf.answerDisclaimerContainer,children:Wn("span",{className:Uf.answerDisclaimer,children:"AI-generated content may be incorrect"})}),!!((I=e.exec_results)!=null&&I.length)&&Wn(wi.Item,{onKeyDown:d=>d.key==="Enter"||d.key===" "?K():null,children:Wn(wi,{style:{width:"100%"},children:Ei(wi,{horizontal:!0,horizontalAlign:"start",verticalAlign:"center",children:[Wn(Vp,{className:Uf.accordionTitle,onClick:()=>i(),"aria-label":"Open Intents",tabIndex:0,role:"button",children:Wn("span",{children:"Show Intents"})}),Wn(T2,{className:Uf.accordionIcon,onClick:v,iconName:"ChevronRight"})]})})})]}),r&&Wn("div",{className:Uf.citationWrapper,children:D.citations.map((d,L)=>Ei("span",{title:u(d,++L),tabIndex:0,role:"link",onClick:()=>t(d),onKeyDown:E=>E.key==="Enter"||E.key===" "?t(d):null,className:Uf.citationContainer,"aria-label":u(d,L),children:[Wn("div",{className:Uf.citation,children:L}),u(d,L,!0)]},L))})]}),Wn(cy,{onDismiss:()=>{f(),o(To.Neutral)},hidden:!_,styles:{main:[{selectors:{["@media (min-width: 480px)"]:{maxWidth:"600px",background:"#FFFFFF",boxShadow:"0px 14px 28.8px rgba(0, 0, 0, 0.24), 0px 0px 8px rgba(0, 0, 0, 0.2)",borderRadius:"8px",maxHeight:"600px",minHeight:"100px"}}}]},dialogContentProps:{title:"Submit Feedback",showCloseButton:!0},children:Ei(wi,{tokens:{childrenGap:4},children:[Wn("div",{children:"Your feedback will improve this experience."}),p?Wn(M,{}):Wn(x,{}),Wn("div",{children:"By pressing submit, your feedback will be visible to the application owner."}),Wn(H2,{disabled:a.length<1,onClick:g,children:"Submit"})]})})]})},rEe="/assets/Send-d0601aaa.svg",nEe="_questionInputContainer_185lc_1",aEe="_questionInputTextArea_185lc_15",iEe="_questionInputSendButtonContainer_185lc_24",oEe="_questionInputSendButton_185lc_24",sEe="_questionInputSendButtonDisabled_185lc_35",lEe="_questionInputBottomBorder_185lc_43",uEe="_questionInputOptionsButton_185lc_54",um={questionInputContainer:nEe,questionInputTextArea:aEe,questionInputSendButtonContainer:iEe,questionInputSendButton:oEe,questionInputSendButtonDisabled:sEe,questionInputBottomBorder:lEe,questionInputOptionsButton:uEe},cEe=({onSend:e,disabled:t,placeholder:i,clearOnSend:S,conversationId:U})=>{const[K,k]=$t.useState(""),D=()=>{t||!K.trim()||(U?e(K,U):e(K),S&&k(""))},r=o=>{var _;o.key==="Enter"&&!o.shiftKey&&((_=o.nativeEvent)==null?void 0:_.isComposing)!==!0&&(o.preventDefault(),D())},c=(o,_)=>{k(_||"")},A=t||!K.trim();return Ei(wi,{horizontal:!0,className:um.questionInputContainer,children:[Wn(JR,{className:um.questionInputTextArea,placeholder:i,multiline:!0,resizable:!1,borderless:!0,value:K,onChange:c,onKeyDown:r}),Wn("div",{className:um.questionInputSendButtonContainer,role:"button",tabIndex:0,"aria-label":"Ask question button",onClick:D,onKeyDown:o=>o.key==="Enter"||o.key===" "?D():null,children:A?Wn(Pae,{className:um.questionInputSendButtonDisabled}):Wn("img",{src:rEe,className:um.questionInputSendButton,alt:"Send Button"})}),Wn("div",{className:um.questionInputBottomBorder})]})},fEe="_container_1epg5_1",dEe="_listContainer_1epg5_6",hEe="_itemCell_1epg5_11",vEe="_itemButton_1epg5_28",pEe="_chatGroup_1epg5_45",gEe="_spinnerContainer_1epg5_50",mEe="_chatList_1epg5_57",yEe="_chatMonth_1epg5_61",xEe="_chatTitle_1epg5_68",mh={container:fEe,listContainer:dEe,itemCell:hEe,itemButton:vEe,chatGroup:pEe,spinnerContainer:gEe,chatList:mEe,chatMonth:yEe,chatTitle:xEe},bEe=e=>{const i=new Date().getFullYear(),[S,U]=e.split(" ");return parseInt(U)===i?S:e},TEe=({item:e,onSelect:t})=>{var N,w,P;const[i,S]=$t.useState(!1),[U,K]=$t.useState(!1),[k,D]=$t.useState(""),[r,{toggle:c}]=z2(!0),[A,o]=$t.useState(!1),[_,T]=$t.useState(!1),[p,y]=$t.useState(void 0),[a,n]=$t.useState(!1),l=$t.useRef(null),s=$t.useContext(m1),h=(e==null?void 0:e.id)===((N=s==null?void 0:s.state.currentChat)==null?void 0:N.id),v={type:rp.close,title:"Are you sure you want to delete this item?",closeButtonAriaLabel:"Close",subText:"The history of this chat session will permanently removed."},u={titleAriaId:"labelId",subtitleAriaId:"subTextId",isBlocking:!0,styles:{main:{maxWidth:450}}};if(!e)return null;$t.useEffect(()=>{a&&l.current&&(l.current.focus(),n(!1))},[a]),$t.useEffect(()=>{var I;((I=s==null?void 0:s.state.currentChat)==null?void 0:I.id)!==(e==null?void 0:e.id)&&(K(!1),D(""))},[(w=s==null?void 0:s.state.currentChat)==null?void 0:w.id,e==null?void 0:e.id]);const b=async()=>{(await ITe(e.id)).ok?s==null||s.dispatch({type:"DELETE_CHAT_ENTRY",payload:e.id}):(o(!0),setTimeout(()=>{o(!1)},5e3)),c()},m=()=>{K(!0),n(!0),D(e==null?void 0:e.title)},C=()=>{t(e),s==null||s.dispatch({type:"UPDATE_CURRENT_CHAT",payload:e})},g=((P=e==null?void 0:e.title)==null?void 0:P.length)>28?`${e.title.substring(0,28)} ...`:e.title,f=async I=>{if(I.preventDefault(),p||_)return;if(k==e.title){y("Error: Enter a new title to proceed."),setTimeout(()=>{y(void 0),n(!0),l.current&&l.current.focus()},5e3);return}T(!0),(await DTe(e.id,k)).ok?(T(!1),K(!1),s==null||s.dispatch({type:"UPDATE_CHAT_TITLE",payload:{...e,title:k}}),D("")):(y("Error: could not rename item"),setTimeout(()=>{n(!0),y(void 0),l.current&&l.current.focus()},5e3))},x=I=>{D(I.target.value)},M=()=>{K(!1),D("")},R=I=>{if(I.key==="Enter")return f(I);if(I.key==="Escape"){M();return}};return Ei(wi,{tabIndex:0,"aria-label":"chat history item",className:mh.itemCell,onClick:()=>C(),onKeyDown:I=>I.key==="Enter"||I.key===" "?C():null,verticalAlign:"center",onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),styles:{root:{backgroundColor:h?"#e6e6e6":"transparent"}},children:[U?Wn(Nd,{children:Wn(wi.Item,{style:{width:"100%"},children:Ei("form",{"aria-label":"edit title form",onSubmit:I=>f(I),style:{padding:"5px 0px"},children:[Ei(wi,{horizontal:!0,verticalAlign:"start",children:[Wn(wi.Item,{children:Wn(JR,{componentRef:l,autoFocus:a,value:k,placeholder:e.title,onChange:x,onKeyDown:R,disabled:!!p})}),k&&Wn(wi.Item,{children:Ei(wi,{"aria-label":"action button group",horizontal:!0,verticalAlign:"center",children:[Wn($0,{role:"button",disabled:p!==void 0,onKeyDown:I=>I.key===" "||I.key==="Enter"?f(I):null,onClick:I=>f(I),"aria-label":"confirm new title",iconProps:{iconName:"CheckMark"},styles:{root:{color:"green",marginLeft:"5px"}}}),Wn($0,{role:"button",disabled:p!==void 0,onKeyDown:I=>I.key===" "||I.key==="Enter"?M():null,onClick:()=>M(),"aria-label":"cancel edit title",iconProps:{iconName:"Cancel"},styles:{root:{color:"red",marginLeft:"5px"}}})]})})]}),p&&Wn(Vp,{role:"alert","aria-label":p,style:{fontSize:12,fontWeight:400,color:"rgb(164,38,44)"},children:p})]})})}):Wn(Nd,{children:Ei(wi,{horizontal:!0,verticalAlign:"center",style:{width:"100%"},children:[Wn("div",{className:mh.chatTitle,children:g}),(h||i)&&Ei(wi,{horizontal:!0,horizontalAlign:"end",children:[Wn($0,{className:mh.itemButton,iconProps:{iconName:"Delete"},title:"Delete",onClick:c,onKeyDown:I=>I.key===" "?c():null}),Wn($0,{className:mh.itemButton,iconProps:{iconName:"Edit"},title:"Edit",onClick:m,onKeyDown:I=>I.key===" "?m():null})]})]})}),A&&Wn(Vp,{styles:{root:{color:"red",marginTop:5,fontSize:14}},children:"Error: could not delete item"}),Wn(cy,{hidden:r,onDismiss:c,dialogContentProps:v,modalProps:u,children:Ei(QR,{children:[Wn(YV,{onClick:b,text:"Delete"}),Wn(H2,{onClick:c,text:"Cancel"})]})})]},e.id)},EEe=({groupedChatHistory:e})=>{const t=$t.useContext(m1),i=$t.useRef(null),[,S]=$t.useState(null),[U,K]=$t.useState(25),[k,D]=$t.useState(0),[r,c]=$t.useState(!1),A=$t.useRef(!0),o=p=>{p&&S(p)},_=p=>Wn(TEe,{item:p,onSelect:()=>o(p)});$t.useEffect(()=>{if(A.current){A.current=!1;return}T(),K(p=>p+=25)},[k]);const T=async()=>{const p=t==null?void 0:t.state.chatHistory;c(!0),await Oj(U).then(y=>{const a=p&&y&&p.concat(...y);return y?t==null||t.dispatch({type:"FETCH_CHAT_HISTORY",payload:a||y}):t==null||t.dispatch({type:"FETCH_CHAT_HISTORY",payload:null}),c(!1),y})};return $t.useEffect(()=>{const p=new IntersectionObserver(y=>{y[0].isIntersecting&&D(a=>a+=1)},{threshold:1});return i.current&&p.observe(i.current),()=>{i.current&&p.unobserve(i.current)}},[i]),Ei("div",{className:mh.listContainer,"data-is-scrollable":!0,children:[e.map(p=>p.entries.length>0&&Ei(wi,{horizontalAlign:"start",verticalAlign:"center",className:mh.chatGroup,"aria-label":`chat history group: ${p.month}`,children:[Wn(wi,{"aria-label":p.month,className:mh.chatMonth,children:bEe(p.month)}),Wn(Ore,{"aria-label":"chat history list",items:p.entries,onRenderCell:_,className:mh.chatList}),Wn("div",{ref:i}),Wn(QV,{styles:{root:{width:"100%",position:"relative","::before":{backgroundColor:"#d6d6d6"}}}})]},p.month)),r&&Wn("div",{className:mh.spinnerContainer,children:Wn(XV,{size:cv.small,"aria-label":"loading more chat history",className:mh.spinner})})]})},wEe=e=>{const t=[{month:"Recent",entries:[]}],i=new Date;return e.forEach(S=>{const U=new Date(S.date),K=(i.getTime()-U.getTime())/(1e3*60*60*24),k=U.toLocaleString("default",{month:"long",year:"numeric"}),D=t.find(r=>r.month===k);K<=7?t[0].entries.push(S):D?D.entries.push(S):t.push({month:k,entries:[S]})}),t.sort((S,U)=>{if(S.entries.length===0&&U.entries.length===0)return 0;if(S.entries.length===0)return 1;if(U.entries.length===0)return-1;const K=new Date(S.entries[0].date);return new Date(U.entries[0].date).getTime()-K.getTime()}),t.forEach(S=>{S.entries.sort((U,K)=>{const k=new Date(U.date);return new Date(K.date).getTime()-k.getTime()})}),t},AEe=()=>{const e=$t.useContext(m1),t=e==null?void 0:e.state.chatHistory;el.useEffect(()=>{},[e==null?void 0:e.state.chatHistory]);let i;if(t&&t.length>0)i=wEe(t);else return Wn(wi,{horizontal:!0,horizontalAlign:"center",verticalAlign:"center",style:{width:"100%",marginTop:10},children:Wn(Y0,{children:Wn(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:14},children:Wn("span",{children:"No chat history."})})})});return Wn(EEe,{groupedChatHistory:i})},iU={root:{padding:"0",display:"flex",justifyContent:"center",backgroundColor:"transparent"}},SEe={root:{height:"50px"}};function CEe(e){var l,s,h;const t=$t.useContext(m1),[i,S]=el.useState(!1),[U,{toggle:K}]=z2(!0),[k,D]=el.useState(!1),[r,c]=el.useState(!1),A={type:rp.close,title:r?"Error deleting all of chat history":"Are you sure you want to clear all chat history?",closeButtonAriaLabel:"Close",subText:r?"Please try again. If the problem persists, please contact the site administrator.":"All chat history will be permanently removed."},o={titleAriaId:"labelId",subtitleAriaId:"subTextId",isBlocking:!0,styles:{main:{maxWidth:450}}},_=[{key:"clearAll",text:"Clear all chat history",iconProps:{iconName:"Delete"}}],T=()=>{t==null||t.dispatch({type:"TOGGLE_CHAT_HISTORY"})},p=el.useCallback(v=>{v.preventDefault(),S(!0)},[]),y=el.useCallback(()=>S(!1),[]),a=async()=>{D(!0),(await LTe()).ok?(t==null||t.dispatch({type:"DELETE_CHAT_HISTORY"}),K()):c(!0),D(!1)},n=()=>{K(),setTimeout(()=>{c(!1)},2e3)};return el.useEffect(()=>{},[t==null?void 0:t.state.chatHistory,r]),Ei("section",{className:mh.container,"data-is-scrollable":!0,"aria-label":"chat history panel",children:[Ei(wi,{horizontal:!0,horizontalAlign:"space-between",verticalAlign:"center",wrap:!0,"aria-label":"chat history header",children:[Wn(Y0,{children:Wn(Vp,{role:"heading","aria-level":2,style:{alignSelf:"center",fontWeight:"600",fontSize:"18px",marginRight:"auto",paddingLeft:"20px"},children:"Chat history"})}),Wn(wi,{verticalAlign:"start",children:Ei(wi,{horizontal:!0,styles:SEe,children:[Wn(S2,{iconProps:{iconName:"More"},title:"Clear all chat history",onClick:p,"aria-label":"clear all chat history",styles:iU,role:"button",id:"moreButton"}),Wn(ow,{items:_,hidden:!i,target:"#moreButton",onItemClick:K,onDismiss:y}),Wn(S2,{iconProps:{iconName:"Cancel"},title:"Hide",onClick:T,"aria-label":"hide button",styles:iU,role:"button"})]})})]}),Wn(wi,{"aria-label":"chat history panel content",styles:{root:{display:"flex",flexGrow:1,flexDirection:"column",paddingTop:"2.5px",maxWidth:"100%"}},style:{display:"flex",flexGrow:1,flexDirection:"column",flexWrap:"wrap",padding:"1px"},children:Ei(wi,{className:mh.chatHistoryListContainer,children:[(t==null?void 0:t.state.chatHistoryLoadingState)===jc.Success&&(t==null?void 0:t.state.isCosmosDBAvailable.cosmosDB)&&Wn(AEe,{}),(t==null?void 0:t.state.chatHistoryLoadingState)===jc.Fail&&(t==null?void 0:t.state.isCosmosDBAvailable)&&Wn(Nd,{children:Wn(wi,{children:Ei(wi,{horizontalAlign:"center",verticalAlign:"center",style:{width:"100%",marginTop:10},children:[Wn(Y0,{children:Ei(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:16},children:[((l=t==null?void 0:t.state.isCosmosDBAvailable)==null?void 0:l.status)&&Wn("span",{children:(s=t==null?void 0:t.state.isCosmosDBAvailable)==null?void 0:s.status}),!((h=t==null?void 0:t.state.isCosmosDBAvailable)!=null&&h.status)&&Wn("span",{children:"Error loading chat history"})]})}),Wn(Y0,{children:Wn(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:14},children:Wn("span",{children:"Chat history can't be saved at this time"})})})]})})}),(t==null?void 0:t.state.chatHistoryLoadingState)===jc.Loading&&Wn(Nd,{children:Wn(wi,{children:Ei(wi,{horizontal:!0,horizontalAlign:"center",verticalAlign:"center",style:{width:"100%",marginTop:10},children:[Wn(Y0,{style:{justifyContent:"center",alignItems:"center"},children:Wn(XV,{style:{alignSelf:"flex-start",height:"100%",marginRight:"5px"},size:cv.medium})}),Wn(Y0,{children:Wn(Vp,{style:{alignSelf:"center",fontWeight:"400",fontSize:14},children:Wn("span",{style:{whiteSpace:"pre-wrap"},children:"Loading chat history"})})})]})})})]})}),Wn(cy,{hidden:U,onDismiss:k?()=>{}:n,dialogContentProps:A,modalProps:o,children:Ei(QR,{children:[!r&&Wn(YV,{onClick:a,disabled:k,text:"Clear All"}),Wn(H2,{onClick:n,disabled:k,text:r?"Close":"Cancel"})]})})]})}const _Ee=()=>{var Z,ue,fe,Q,q,ce,se,pe;const e=$t.useContext(m1),t=(Z=e==null?void 0:e.state.frontendSettings)==null?void 0:Z.ui,i=(ue=e==null?void 0:e.state.frontendSettings)==null?void 0:ue.auth_enabled,S=$t.useRef(null),[U,K]=$t.useState(!1),[k,D]=$t.useState(!1),[r,c]=$t.useState(),[A,o]=$t.useState(!1),[_,T]=$t.useState(!1),p=$t.useRef([]),[y,a]=$t.useState(),[n,l]=$t.useState([]),[s,h]=$t.useState([]),[v,u]=$t.useState("Not Running"),[b,m]=$t.useState(!1),[C,{toggle:g}]=z2(!0),[f,x]=$t.useState(),M={type:rp.close,title:f==null?void 0:f.title,closeButtonAriaLabel:"Close",subText:f==null?void 0:f.subtitle},R={titleAriaId:"labelId",subtitleAriaId:"subTextId",isBlocking:!0,styles:{main:{maxWidth:450}}},[N,w,P]=["assistant","tool","error"],I="No content in messages object.";$t.useEffect(()=>{var Te,we;if(((Te=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:Te.status)!==vc.Working&&((we=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:we.status)!==vc.NotConfigured&&(e==null?void 0:e.state.chatHistoryLoadingState)===jc.Fail&&C){let Ae=`${e.state.isCosmosDBAvailable.status}. Please contact the site administrator.`;x({title:"Chat history is not enabled",subtitle:Ae}),g()}},[e==null?void 0:e.state.isCosmosDBAvailable]);const d=()=>{g(),setTimeout(()=>{x(null)},500)};$t.useEffect(()=>{K((e==null?void 0:e.state.chatHistoryLoadingState)===jc.Loading)},[e==null?void 0:e.state.chatHistoryLoadingState]);const L=async()=>{if(!i){a(!1);return}(await _Te()).length===0&&window.location.hostname!=="127.0.0.1"?a(!0):a(!1)};let E={},B={},z="";const Y=(Te,we,Ae)=>{if(Te.content.includes("all_exec_results")){const ke=JSON.parse(Te.content);h(ke.all_exec_results)}Te.role===N&&(z+=Te.content,E=Te,E.content=z,Te.context&&(B={id:kp(),role:w,content:Te.context,date:new Date().toISOString()})),Te.role===w&&(B=Te),Ae?zp.isEmpty(B)?l([...n,E]):l([...n,B,E]):zp.isEmpty(B)?l([...n,we,E]):l([...n,we,B,E])},H=async(Te,we)=>{var Ge,We;K(!0),D(!0);const Ae=new AbortController;p.current.unshift(Ae);const ke={id:kp(),role:"user",content:Te,date:new Date().toISOString()};let Se;if(!we)Se={id:we??kp(),title:Te,messages:[ke],date:new Date().toISOString()};else if(Se=(Ge=e==null?void 0:e.state)==null?void 0:Ge.currentChat,Se)Se.messages.push(ke);else{console.error("Conversation not found."),K(!1),D(!1),p.current=p.current.filter(Be=>Be!==Ae);return}e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:Se}),l(Se.messages);const _e={messages:[...Se.messages.filter(Be=>Be.role!==P)]};let Ee={};try{const Be=await CTe(_e,Ae.signal);if(Be!=null&&Be.body){const Ve=Be.body.getReader();let lt="";for(;;){u("Processing");const{done:pt,value:ct}=await Ve.read();if(pt)break;var Ie=new TextDecoder("utf-8").decode(ct);Ie.split(` `).forEach(vt=>{var mt,xt;try{if(vt!==""&&vt!=="{}"){if(lt+=vt,Ee=JSON.parse(lt),((mt=Ee.choices)==null?void 0:mt.length)>0)Ee.choices[0].messages.forEach(Tt=>{Tt.id=Ee.id,Tt.date=new Date().toISOString()}),(xt=Ee.choices[0].messages)!=null&&xt.some(Tt=>Tt.role===N)&&D(!1),Ee.choices[0].messages.forEach(Tt=>{Y(Tt,ke,we)});else if(Ee.error)throw Error(Ee.error);lt=""}}catch(Tt){if(Tt instanceof SyntaxError)console.log("Incomplete message. Continuing...");else throw console.error(Tt),Tt}})}Se.messages.push(B,E),e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:Se}),l([...n,B,E])}}catch{if(Ae.signal.aborted)l([...n,ke]);else{let Ve="An error occurred. Please try again. If the problem persists, please contact the site administrator.";(We=Ee.error)!=null&&We.message?Ve=Ee.error.message:typeof Ee.error=="string"&&(Ve=Ee.error),Ve=j(Ve);let lt={id:kp(),role:P,content:Ve,date:new Date().toISOString()};Se.messages.push(lt),e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:Se}),l([...n,lt])}}finally{K(!1),D(!1),p.current=p.current.filter(Be=>Be!==Ae),u("Done")}return Ae.abort()},G=async(Te,we)=>{var We,Be,Ve,lt,pt,ct,nt,vt,mt;K(!0),D(!0);const Ae=new AbortController;p.current.unshift(Ae);const ke={id:kp(),role:"user",content:Te,date:new Date().toISOString()};let Se,_e;if(we)if(_e=(Be=(We=e==null?void 0:e.state)==null?void 0:We.chatHistory)==null?void 0:Be.find(xt=>xt.id===we),_e)_e.messages.push(ke),Se={messages:[..._e.messages.filter(xt=>xt.role!==P)]};else{console.error("Conversation not found."),K(!1),D(!1),p.current=p.current.filter(xt=>xt!==Ae);return}else Se={messages:[ke].filter(xt=>xt.role!==P)},l(Se.messages);let Ee={};var Ie="Please try again. If the problem persists, please contact the site administrator.";try{const xt=we?await nU(Se,Ae.signal,we):await nU(Se,Ae.signal);if(!(xt!=null&&xt.ok)){const Tt=await xt.json();Ie=Tt.error===void 0?Ie:j(Tt.error);let Mt={id:kp(),role:P,content:`There was an error generating a response. Chat history can't be saved at this time. ${Ie}`,date:new Date().toISOString()},at;if(we){if(at=(lt=(Ve=e==null?void 0:e.state)==null?void 0:Ve.chatHistory)==null?void 0:lt.find(Oe=>Oe.id===we),!at){console.error("Conversation not found."),K(!1),D(!1),p.current=p.current.filter(Oe=>Oe!==Ae);return}at.messages.push(Mt)}else{l([...n,ke,Mt]),K(!1),D(!1),p.current=p.current.filter(Oe=>Oe!==Ae);return}e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:at}),l([...at.messages]);return}if(xt!=null&&xt.body){const Tt=xt.body.getReader();let Mt="";for(;;){u("Processing");const{done:Oe,value:Ye}=await Tt.read();if(Oe)break;var Ge=new TextDecoder("utf-8").decode(Ye);Ge.split(` `).forEach(Ke=>{var Fe,Ne,$e,Pe,me;try{if(Ke!==""&&Ke!=="{}"){if(Mt+=Ke,Ee=JSON.parse(Mt),!(($e=(Ne=(Fe=Ee.choices)==null?void 0:Fe[0])==null?void 0:Ne.messages)!=null&&$e[0].content))throw Ie=I,Error();((Pe=Ee.choices)==null?void 0:Pe.length)>0&&(Ee.choices[0].messages.forEach(Ce=>{Ce.id=Ee.id,Ce.date=new Date().toISOString()}),(me=Ee.choices[0].messages)!=null&&me.some(Ce=>Ce.role===N)&&D(!1),Ee.choices[0].messages.forEach(Ce=>{Y(Ce,ke,we)})),Mt=""}else if(Ee.error)throw Error(Ee.error)}catch(Ce){if(Ce instanceof SyntaxError)console.log("Incomplete message. Continuing...");else throw console.error(Ce),Ce}})}let at;if(we){if(at=(ct=(pt=e==null?void 0:e.state)==null?void 0:pt.chatHistory)==null?void 0:ct.find(Oe=>Oe.id===we),!at){console.error("Conversation not found."),K(!1),D(!1),p.current=p.current.filter(Oe=>Oe!==Ae);return}zp.isEmpty(B)?at.messages.push(E):at.messages.push(B,E)}else at={id:Ee.history_metadata.conversation_id,title:Ee.history_metadata.title,messages:[ke],date:Ee.history_metadata.date},zp.isEmpty(B)?at.messages.push(E):at.messages.push(B,E);if(!at){K(!1),D(!1),p.current=p.current.filter(Oe=>Oe!==Ae);return}e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:at}),zp.isEmpty(B)?l([...n,E]):l([...n,B,E])}}catch{if(Ae.signal.aborted)l([...n,ke]);else{let Tt=`An error occurred. ${Ie}`;(nt=Ee.error)!=null&&nt.message?Tt=Ee.error.message:typeof Ee.error=="string"&&(Tt=Ee.error),Tt=j(Tt);let Mt={id:kp(),role:P,content:Tt,date:new Date().toISOString()},at;if(we){if(at=(mt=(vt=e==null?void 0:e.state)==null?void 0:vt.chatHistory)==null?void 0:mt.find(Oe=>Oe.id===we),!at){console.error("Conversation not found."),K(!1),D(!1),p.current=p.current.filter(Oe=>Oe!==Ae);return}at.messages.push(Mt)}else{if(!Ee.history_metadata){console.error("Error retrieving data.",Ee);let Oe={id:kp(),role:P,content:Tt,date:new Date().toISOString()};l([...n,ke,Oe]),K(!1),D(!1),p.current=p.current.filter(Ye=>Ye!==Ae);return}at={id:Ee.history_metadata.conversation_id,title:Ee.history_metadata.title,messages:[ke],date:Ee.history_metadata.date},at.messages.push(Mt)}if(!at){K(!1),D(!1),p.current=p.current.filter(Oe=>Oe!==Ae);return}e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:at}),l([...n,Mt])}}finally{K(!1),D(!1),p.current=p.current.filter(xt=>xt!==Ae),u("Done")}return Ae.abort()},W=async()=>{var Te;m(!0),(Te=e==null?void 0:e.state.currentChat)!=null&&Te.id&&(e!=null&&e.state.isCosmosDBAvailable.cosmosDB)&&((await kTe(e==null?void 0:e.state.currentChat.id)).ok?(e==null||e.dispatch({type:"DELETE_CURRENT_CHAT_MESSAGES",payload:e==null?void 0:e.state.currentChat.id}),e==null||e.dispatch({type:"UPDATE_CHAT_HISTORY",payload:e==null?void 0:e.state.currentChat}),c(void 0),o(!1),T(!1),l([])):(x({title:"Error clearing current chat",subtitle:"Please try again. If the problem persists, please contact the site administrator."}),g())),m(!1)},V=Te=>{try{const we=Te.match(/'innererror': ({.*})\}\}/);if(we){const Ae=we[1].replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false"),ke=JSON.parse(Ae);let Se="";if(ke.content_filter_result.jailbreak.filtered===!0&&(Se="Jailbreak"),Se!=="")return`The prompt was filtered due to triggering Azure OpenAI’s content filtering system. Reason: This prompt contains content flagged as `+Se+` Please modify your prompt and retry. Learn more: https://go.microsoft.com/fwlink/?linkid=2198766`}}catch(we){console.error("Failed to parse the error:",we)}return Te},j=Te=>{let we=Te.substring(0,Te.indexOf("-")+1);const Ae="{\\'error\\': {\\'message\\': ";if(Te.includes(Ae))try{let ke=Te.substring(Te.indexOf(Ae));ke.endsWith("'}}")&&(ke=ke.substring(0,ke.length-3)),ke=ke.replaceAll("\\'","'"),Te=we+" "+ke}catch(ke){console.error("Error parsing inner error message: ",ke)}return V(Te)},$=()=>{u("Processing"),l([]),o(!1),T(!1),c(void 0),e==null||e.dispatch({type:"UPDATE_CURRENT_CHAT",payload:null}),u("Done")},re=()=>{p.current.forEach(Te=>Te.abort()),D(!1),K(!1)};$t.useEffect(()=>{e!=null&&e.state.currentChat?l(e.state.currentChat.messages):l([])},[e==null?void 0:e.state.currentChat]),$t.useLayoutEffect(()=>{var we;const Te=async(Ae,ke)=>await RTe(Ae,ke);if(e&&e.state.currentChat&&v==="Done"){if(e.state.isCosmosDBAvailable.cosmosDB){if(!((we=e==null?void 0:e.state.currentChat)!=null&&we.messages)){console.error("Failure fetching current chat state.");return}const Ae=e.state.currentChat.messages.find(ke=>ke.role===P);Ae!=null&&Ae.content.includes(I)||Te(e.state.currentChat.messages,e.state.currentChat.id).then(ke=>{var Se,_e;if(!ke.ok){let Ee="An error occurred. Answers can't be saved at this time. If the problem persists, please contact the site administrator.",Ie={id:kp(),role:P,content:Ee,date:new Date().toISOString()};if(!((Se=e==null?void 0:e.state.currentChat)!=null&&Se.messages))throw{...new Error,message:"Failure fetching current chat state."};l([...(_e=e==null?void 0:e.state.currentChat)==null?void 0:_e.messages,Ie])}return ke}).catch(ke=>(console.error("Error: ",ke),{...new Response,ok:!1,status:500}))}e==null||e.dispatch({type:"UPDATE_CHAT_HISTORY",payload:e.state.currentChat}),l(e.state.currentChat.messages),u("Not Running")}},[v]),$t.useEffect(()=>{i!==void 0&&L()},[i]),$t.useLayoutEffect(()=>{var Te;(Te=S.current)==null||Te.scrollIntoView({behavior:"smooth"})},[k,v]);const ae=Te=>{c(Te),o(!0)},oe=()=>{T(!0)},de=Te=>{Te.url&&!Te.url.includes("blob.core")&&window.open(Te.url,"_blank")},te=Te=>{if(Te!=null&&Te.role&&(Te==null?void 0:Te.role)==="tool")try{return JSON.parse(Te.content).citations}catch{return[]}return[]},J=Te=>{var we;if(Te!=null&&Te.role&&(Te==null?void 0:Te.role)==="tool")try{const ke=(we=JSON.parse(Te.content).all_exec_results.at(-1))==null?void 0:we.code_exec_result;return ke===void 0?null:ke}catch{return null}return null},ie=()=>U||n&&n.length===0||b||(e==null?void 0:e.state.chatHistoryLoadingState)===jc.Loading;return Wn("div",{className:po.container,role:"main",children:y?Ei(wi,{className:po.chatEmptyState,children:[Wn(Fae,{className:po.chatIcon,style:{color:"darkorange",height:"200px",width:"200px"}}),Wn("h1",{className:po.chatEmptyStateTitle,children:"Authentication Not Configured"}),Ei("h2",{className:po.chatEmptyStateSubtitle,children:["This app does not have authentication configured. Please add an identity provider by finding your app in the"," ",Wn("a",{href:"https://portal.azure.com/",target:"_blank",children:"Azure Portal"}),"and following"," ",Wn("a",{href:"https://learn.microsoft.com/en-us/azure/app-service/scenario-secure-app-authentication-app-service#3-configure-authentication-and-authorization",target:"_blank",children:"these instructions"}),"."]}),Wn("h2",{className:po.chatEmptyStateSubtitle,style:{fontSize:"20px"},children:Wn("strong",{children:"Authentication configuration takes a few minutes to apply. "})}),Wn("h2",{className:po.chatEmptyStateSubtitle,style:{fontSize:"20px"},children:Wn("strong",{children:"If you deployed in the last 10 minutes, please wait and reload the page after 10 minutes."})})]}):Ei(wi,{horizontal:!0,className:po.chatRoot,children:[Ei("div",{className:po.chatContainer,children:[!n||n.length<1?Ei(wi,{className:po.chatEmptyState,children:[Wn("img",{src:t!=null&&t.chat_logo?t.chat_logo:Nj,className:po.chatIcon,"aria-hidden":"true"}),Wn("h1",{className:po.chatEmptyStateTitle,children:t==null?void 0:t.chat_title}),Wn("h2",{className:po.chatEmptyStateSubtitle,children:t==null?void 0:t.chat_description})]}):Ei("div",{className:po.chatMessageStream,style:{marginBottom:U?"40px":"0px"},role:"log",children:[n.map((Te,we)=>Wn(Nd,{children:Te.role==="user"?Wn("div",{className:po.chatMessageUser,tabIndex:0,children:Wn("div",{className:po.chatMessageUserMessage,children:Te.content})}):Te.role==="assistant"?Wn("div",{className:po.chatMessageGpt,children:Wn(aU,{answer:{answer:Te.content,citations:te(n[we-1]),plotly_data:J(n[we-1]),message_id:Te.id,feedback:Te.feedback,exec_results:s},onCitationClicked:Ae=>ae(Ae),onExectResultClicked:()=>oe()})}):Te.role===P?Ei("div",{className:po.chatMessageError,children:[Ei(wi,{horizontal:!0,className:po.chatMessageErrorContent,children:[Wn(Dae,{className:po.errorIcon,style:{color:"rgba(182, 52, 67, 1)"}}),Wn("span",{children:"Error"})]}),Wn("span",{className:po.chatMessageErrorContent,children:Te.content})]}):null})),k&&Wn(Nd,{children:Wn("div",{className:po.chatMessageGpt,children:Wn(aU,{answer:{answer:"Generating answer...",citations:[],plotly_data:null},onCitationClicked:()=>null,onExectResultClicked:()=>null})})}),Wn("div",{ref:S})]}),Ei(wi,{horizontal:!0,className:po.chatInput,children:[U&&Ei(wi,{horizontal:!0,className:po.stopGeneratingContainer,role:"button","aria-label":"Stop generating",tabIndex:0,onClick:re,onKeyDown:Te=>Te.key==="Enter"||Te.key===" "?re():null,children:[Wn(zae,{className:po.stopGeneratingIcon,"aria-hidden":"true"}),Wn("span",{className:po.stopGeneratingText,"aria-hidden":"true",children:"Stop generating"})]}),Ei(wi,{children:[((fe=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:fe.status)!==vc.NotConfigured&&Wn(S2,{role:"button",styles:{icon:{color:"#FFFFFF"},iconDisabled:{color:"#BDBDBD !important"},root:{color:"#FFFFFF",background:"radial-gradient(109.81% 107.82% at 100.1% 90.19%, #0F6CBD 33.63%, #2D87C3 70.31%, #8DDDD8 100%)"},rootDisabled:{background:"#F0F0F0"}},className:po.newChatIcon,iconProps:{iconName:"Add"},onClick:$,disabled:ie(),"aria-label":"start a new chat button"}),Wn(S2,{role:"button",styles:{icon:{color:"#FFFFFF"},iconDisabled:{color:"#BDBDBD !important"},root:{color:"#FFFFFF",background:"radial-gradient(109.81% 107.82% at 100.1% 90.19%, #0F6CBD 33.63%, #2D87C3 70.31%, #8DDDD8 100%)"},rootDisabled:{background:"#F0F0F0"}},className:((Q=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:Q.status)!==vc.NotConfigured?po.clearChatBroom:po.clearChatBroomNoCosmos,iconProps:{iconName:"Broom"},onClick:((q=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:q.status)!==vc.NotConfigured?W:$,disabled:ie(),"aria-label":"clear chat button"}),Wn(cy,{hidden:C,onDismiss:d,dialogContentProps:M,modalProps:R})]}),Wn(cEe,{clearOnSend:!0,placeholder:"Type a new question...",disabled:U,onSend:(Te,we)=>{var Ae;(Ae=e==null?void 0:e.state.isCosmosDBAvailable)!=null&&Ae.cosmosDB?G(Te,we):H(Te,we)},conversationId:(ce=e==null?void 0:e.state.currentChat)!=null&&ce.id?(se=e==null?void 0:e.state.currentChat)==null?void 0:se.id:void 0})]})]}),n&&n.length>0&&A&&r&&Ei(wi.Item,{className:po.citationPanel,tabIndex:0,role:"tabpanel","aria-label":"Citations Panel",children:[Ei(wi,{"aria-label":"Citations Panel Header Container",horizontal:!0,className:po.citationPanelHeaderContainer,horizontalAlign:"space-between",verticalAlign:"center",children:[Wn("span",{"aria-label":"Citations",className:po.citationPanelHeader,children:"Citations"}),Wn($0,{iconProps:{iconName:"Cancel"},"aria-label":"Close citations panel",onClick:()=>o(!1)})]}),Wn("h5",{className:po.citationPanelTitle,tabIndex:0,title:r.url&&!r.url.includes("blob.core")?r.url:r.title??"",onClick:()=>de(r),children:r.title}),Wn("div",{tabIndex:0,children:Wn($w,{linkTarget:"_blank",className:po.citationPanelContent,children:QY.sanitize(r.content,{ALLOWED_TAGS:Pj}),remarkPlugins:[vY],rehypePlugins:[ave]})})]}),n&&n.length>0&&_&&Ei(wi.Item,{className:po.citationPanel,tabIndex:0,role:"tabpanel","aria-label":"Intents Panel",children:[Ei(wi,{"aria-label":"Intents Panel Header Container",horizontal:!0,className:po.citationPanelHeaderContainer,horizontalAlign:"space-between",verticalAlign:"center",children:[Wn("span",{"aria-label":"Intents",className:po.citationPanelHeader,children:"Intents"}),Wn($0,{iconProps:{iconName:"Cancel"},"aria-label":"Close intents panel",onClick:()=>T(!1)})]}),Wn(wi,{horizontalAlign:"space-between",children:s.map(Te=>Ei(wi,{className:po.exectResultList,verticalAlign:"space-between",children:[Ei(Nd,{children:[Wn("span",{children:"Intent:"})," ",Wn("p",{children:Te.intent})]}),Te.search_query&&Ei(Nd,{children:[Wn("span",{children:"Search Query:"}),Wn(L9,{style:k9,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:"sql",PreTag:"p",children:Te.search_query})]}),Te.search_result&&Ei(Nd,{children:[Wn("span",{children:"Search Result:"})," ",Wn("p",{children:Te.search_result})]}),Te.code_generated&&Ei(Nd,{children:[Wn("span",{children:"Code Generated:"}),Wn(L9,{style:k9,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:"python",PreTag:"p",children:Te.code_generated})]})]}))})]}),(e==null?void 0:e.state.isChatHistoryOpen)&&((pe=e==null?void 0:e.state.isCosmosDBAvailable)==null?void 0:pe.status)!==vc.NotConfigured&&Wn(CEe,{})]})})},MEe="_shareButtonRoot_1ep5g_1",REe="_historyButtonRoot_1ep5g_25",zj={shareButtonRoot:MEe,historyButtonRoot:REe},IEe=({onClick:e,text:t})=>Wn(S2,{className:zj.shareButtonRoot,iconProps:{iconName:"Share"},onClick:e,text:t}),LEe=({onClick:e,text:t})=>Wn(H2,{className:zj.historyButtonRoot,text:t,iconProps:{iconName:"History"},onClick:e}),kEe="_layout_1e0ns_1",DEe="_header_1e0ns_7",NEe="_headerContainer_1e0ns_11",PEe="_headerTitleContainer_1e0ns_17",OEe="_headerTitle_1e0ns_17",FEe="_headerIcon_1e0ns_34",BEe="_shareButtonContainer_1e0ns_40",zEe="_shareButton_1e0ns_40",UEe="_shareButtonText_1e0ns_51",HEe="_urlTextBox_1e0ns_61",GEe="_copyButtonContainer_1e0ns_71",VEe="_copyButton_1e0ns_71",WEe="_copyButtonText_1e0ns_93",Yv={layout:kEe,header:DEe,headerContainer:NEe,headerTitleContainer:PEe,headerTitle:OEe,headerIcon:FEe,shareButtonContainer:BEe,shareButton:zEe,shareButtonText:UEe,urlTextBox:HEe,copyButtonContainer:GEe,copyButton:VEe,copyButtonText:WEe},YEe=()=>{var l,s,h;const[e,t]=$t.useState(!1),[i,S]=$t.useState(!1),[U,K]=$t.useState("Copy URL"),[k,D]=$t.useState("Share"),[r,c]=$t.useState("Hide chat history"),[A,o]=$t.useState("Show chat history"),_=$t.useContext(m1),T=(l=_==null?void 0:_.state.frontendSettings)==null?void 0:l.ui,p=()=>{t(!0)},y=()=>{t(!1),S(!1),K("Copy URL")},a=()=>{navigator.clipboard.writeText(window.location.href),S(!0)},n=()=>{_==null||_.dispatch({type:"TOGGLE_CHAT_HISTORY"})};return $t.useEffect(()=>{i&&K("Copied URL")},[i]),$t.useEffect(()=>{},[_==null?void 0:_.state.isCosmosDBAvailable.status]),$t.useEffect(()=>{const v=()=>{window.innerWidth<480?(D(void 0),c("Hide history"),o("Show history")):(D("Share"),c("Hide chat history"),o("Show chat history"))};return window.addEventListener("resize",v),v(),()=>window.removeEventListener("resize",v)},[]),Ei("div",{className:Yv.layout,children:[Wn("header",{className:Yv.header,role:"banner",children:Ei(wi,{horizontal:!0,verticalAlign:"center",horizontalAlign:"space-between",children:[Ei(wi,{horizontal:!0,verticalAlign:"center",children:[Wn("img",{src:T!=null&&T.logo?T.logo:Nj,className:Yv.headerIcon,"aria-hidden":"true",alt:""}),Wn(AZ,{to:"/",className:Yv.headerTitleContainer,children:Wn("h1",{className:Yv.headerTitle,children:T==null?void 0:T.title})})]}),Ei(wi,{horizontal:!0,tokens:{childrenGap:4},className:Yv.shareButtonContainer,children:[((s=_==null?void 0:_.state.isCosmosDBAvailable)==null?void 0:s.status)!==vc.NotConfigured&&Wn(LEe,{onClick:n,text:(h=_==null?void 0:_.state)!=null&&h.isChatHistoryOpen?r:A}),(T==null?void 0:T.show_share_button)&&Wn(IEe,{onClick:p,text:k})]})]})}),Wn(pZ,{}),Wn(cy,{onDismiss:y,hidden:!e,styles:{main:[{selectors:{["@media (min-width: 480px)"]:{maxWidth:"600px",background:"#FFFFFF",boxShadow:"0px 14px 28.8px rgba(0, 0, 0, 0.24), 0px 0px 8px rgba(0, 0, 0, 0.2)",borderRadius:"8px",maxHeight:"200px",minHeight:"100px"}}}]},dialogContentProps:{title:"Share the web app",showCloseButton:!0},children:Ei(wi,{horizontal:!0,verticalAlign:"center",style:{gap:"8px"},children:[Wn(JR,{className:Yv.urlTextBox,defaultValue:window.location.href,readOnly:!0}),Ei("div",{className:Yv.copyButtonContainer,role:"button",tabIndex:0,"aria-label":"Copy",onClick:a,onKeyDown:v=>v.key==="Enter"||v.key===" "?a():null,children:[Wn(Lae,{className:Yv.copyButton}),Wn("span",{className:Yv.copyButtonText,children:U})]})]})})]})},jEe=()=>Wn("h1",{children:"404"});Une();function KEe(){return Wn(HTe,{children:Wn(EZ,{children:Wn(mZ,{children:Ei(uE,{path:"/",element:Wn(YEe,{}),children:[Wn(uE,{index:!0,element:Wn(_Ee,{})}),Wn(uE,{path:"*",element:Wn(jEe,{})})]})})})})}e8.createRoot(document.getElementById("root")).render(Wn(el.StrictMode,{children:Wn(KEe,{})})); -//# sourceMappingURL=index-b392843b.js.map +//# sourceMappingURL=index-274bb812.js.map diff --git a/static/assets/index-b392843b.js.map b/static/assets/index-274bb812.js.map similarity index 83% rename from static/assets/index-b392843b.js.map rename to static/assets/index-274bb812.js.map index 8f1a4f0581..9bb739f550 100644 --- a/static/assets/index-b392843b.js.map +++ b/static/assets/index-274bb812.js.map @@ -1 +1 @@ -{"version":3,"file":"index-b392843b.js","sources":["../../frontend/node_modules/react/cjs/react.production.min.js","../../frontend/node_modules/react/index.js","../../frontend/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../frontend/node_modules/react/jsx-runtime.js","../../frontend/node_modules/scheduler/cjs/scheduler.production.min.js","../../frontend/node_modules/scheduler/index.js","../../frontend/node_modules/react-dom/cjs/react-dom.production.min.js","../../frontend/node_modules/react-dom/index.js","../../frontend/node_modules/react-dom/client.js","../../frontend/node_modules/@remix-run/router/dist/router.js","../../frontend/node_modules/react-router/dist/index.js","../../frontend/node_modules/react-router-dom/dist/index.js","../../frontend/node_modules/@fluentui/set-version/lib/setVersion.js","../../frontend/node_modules/@fluentui/set-version/lib/index.js","../../frontend/node_modules/tslib/tslib.es6.mjs","../../frontend/node_modules/@fluentui/merge-styles/lib/Stylesheet.js","../../frontend/node_modules/@fluentui/merge-styles/lib/extractStyleParts.js","../../frontend/node_modules/@fluentui/merge-styles/lib/StyleOptionsState.js","../../frontend/node_modules/@fluentui/merge-styles/lib/transforms/kebabRules.js","../../frontend/node_modules/@fluentui/merge-styles/lib/getVendorSettings.js","../../frontend/node_modules/@fluentui/merge-styles/lib/transforms/prefixRules.js","../../frontend/node_modules/@fluentui/merge-styles/lib/transforms/provideUnits.js","../../frontend/node_modules/@fluentui/merge-styles/lib/transforms/rtlifyRules.js","../../frontend/node_modules/@fluentui/merge-styles/lib/tokenizeWithParentheses.js","../../frontend/node_modules/@fluentui/merge-styles/lib/styleToClassName.js","../../frontend/node_modules/@fluentui/merge-styles/lib/mergeStyles.js","../../frontend/node_modules/@fluentui/merge-styles/lib/concatStyleSets.js","../../frontend/node_modules/@fluentui/merge-styles/lib/mergeStyleSets.js","../../frontend/node_modules/@fluentui/merge-styles/lib/concatStyleSetsWithProps.js","../../frontend/node_modules/@fluentui/merge-styles/lib/fontFace.js","../../frontend/node_modules/@fluentui/merge-styles/lib/keyframes.js","../../frontend/node_modules/@fluentui/style-utilities/lib/utilities/buildClassMap.js","../../frontend/node_modules/@fluentui/utilities/lib/dom/canUseDOM.js","../../frontend/node_modules/@fluentui/utilities/lib/dom/getWindow.js","../../frontend/node_modules/@fluentui/utilities/lib/Async.js","../../frontend/node_modules/@fluentui/utilities/lib/object.js","../../frontend/node_modules/@fluentui/utilities/lib/EventGroup.js","../../frontend/node_modules/@fluentui/utilities/lib/dom/getDocument.js","../../frontend/node_modules/@fluentui/utilities/lib/scroll.js","../../frontend/node_modules/@fluentui/utilities/lib/warn/warn.js","../../frontend/node_modules/@fluentui/utilities/lib/warn/warnConditionallyRequiredProps.js","../../frontend/node_modules/@fluentui/utilities/lib/BaseComponent.js","../../frontend/node_modules/@fluentui/utilities/lib/DelayedRender.js","../../frontend/node_modules/@fluentui/utilities/lib/GlobalSettings.js","../../frontend/node_modules/@fluentui/utilities/lib/KeyCodes.js","../../frontend/node_modules/@fluentui/utilities/lib/Rectangle.js","../../frontend/node_modules/@fluentui/utilities/lib/appendFunction.js","../../frontend/node_modules/@fluentui/utilities/lib/aria.js","../../frontend/node_modules/@fluentui/utilities/lib/array.js","../../frontend/node_modules/@fluentui/utilities/lib/sessionStorage.js","../../frontend/node_modules/@fluentui/utilities/lib/rtl.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/isVirtualElement.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/getVirtualParent.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/getParent.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/elementContains.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/findElementRecursive.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/elementContainsAttribute.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/setPortalAttribute.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/portalContainsElement.js","../../frontend/node_modules/@fluentui/dom-utilities/lib/setVirtualParent.js","../../frontend/node_modules/@fluentui/utilities/lib/focus.js","../../frontend/node_modules/@fluentui/utilities/lib/dom/on.js","../../frontend/node_modules/@fluentui/utilities/lib/classNamesFunction.js","../../frontend/node_modules/@fluentui/utilities/lib/memoize.js","../../frontend/node_modules/@fluentui/utilities/lib/componentAs/composeComponentAs.js","../../frontend/node_modules/@fluentui/utilities/lib/controlled.js","../../frontend/node_modules/@fluentui/utilities/lib/css.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/Customizations.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/CustomizerContext.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/mergeSettings.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/mergeCustomizations.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/Customizer.js","../../frontend/node_modules/@fluentui/utilities/lib/hoistStatics.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/customizable.js","../../frontend/node_modules/@fluentui/utilities/lib/customizations/useCustomizationSettings.js","../../frontend/node_modules/@fluentui/utilities/lib/extendComponent.js","../../frontend/node_modules/@fluentui/utilities/lib/getId.js","../../frontend/node_modules/@fluentui/utilities/lib/properties.js","../../frontend/node_modules/@fluentui/utilities/lib/hoist.js","../../frontend/node_modules/@fluentui/utilities/lib/initializeComponentRef.js","../../frontend/node_modules/@fluentui/utilities/lib/keyboard.js","../../frontend/node_modules/@fluentui/utilities/lib/setFocusVisibility.js","../../frontend/node_modules/@fluentui/utilities/lib/useFocusRects.js","../../frontend/node_modules/@fluentui/utilities/lib/FocusRectsProvider.js","../../frontend/node_modules/@fluentui/utilities/lib/localStorage.js","../../frontend/node_modules/@fluentui/utilities/lib/language.js","../../frontend/node_modules/@fluentui/utilities/lib/merge.js","../../frontend/node_modules/@fluentui/utilities/lib/mobileDetector.js","../../frontend/node_modules/@fluentui/utilities/lib/modalize.js","../../frontend/node_modules/@fluentui/utilities/lib/osDetector.js","../../frontend/node_modules/@fluentui/utilities/lib/renderFunction/composeRenderFunction.js","../../frontend/node_modules/@fluentui/utilities/lib/styled.js","../../frontend/node_modules/@fluentui/utilities/lib/ie11Detector.js","../../frontend/node_modules/@fluentui/utilities/lib/getPropsWithDefaults.js","../../frontend/node_modules/@fluentui/utilities/lib/createMergedRef.js","../../frontend/node_modules/@fluentui/utilities/lib/useIsomorphicLayoutEffect.js","../../frontend/node_modules/@fluentui/style-utilities/lib/utilities/icons.js","../../frontend/node_modules/@fluentui/theme/lib/utilities/makeSemanticColors.js","../../frontend/node_modules/@fluentui/theme/lib/mergeThemes.js","../../frontend/node_modules/@fluentui/theme/lib/colors/DefaultPalette.js","../../frontend/node_modules/@fluentui/theme/lib/effects/FluentDepths.js","../../frontend/node_modules/@fluentui/theme/lib/effects/DefaultEffects.js","../../frontend/node_modules/@fluentui/theme/lib/spacing/DefaultSpacing.js","../../frontend/node_modules/@fluentui/theme/lib/motion/AnimationStyles.js","../../frontend/node_modules/@fluentui/theme/lib/fonts/FluentFonts.js","../../frontend/node_modules/@fluentui/theme/lib/fonts/createFontStyles.js","../../frontend/node_modules/@fluentui/theme/lib/fonts/DefaultFontStyles.js","../../frontend/node_modules/@fluentui/theme/lib/createTheme.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/CommonStyles.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/zIndexes.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/getFocusStyle.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/hiddenContentStyle.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/getGlobalClassNames.js","../../frontend/node_modules/@microsoft/load-themed-styles/lib-es6/index.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/theme.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/GeneralStyles.js","../../frontend/node_modules/@fluentui/style-utilities/lib/styles/getPlaceholderStyles.js","../../frontend/node_modules/@fluentui/style-utilities/lib/classNames/AnimationClassNames.js","../../frontend/node_modules/@fluentui/style-utilities/lib/version.js","../../frontend/node_modules/@fluentui/style-utilities/lib/index.js","../../frontend/node_modules/@fluentui/react/lib/common/DirectionalHint.js","../../frontend/node_modules/@fluentui/react/lib/utilities/positioning/positioning.types.js","../../frontend/node_modules/@fluentui/react/lib/utilities/positioning/positioning.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useAsync.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useConst.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useBoolean.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useControllableValue.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useEventCallback.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useId.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useMergedRefs.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useOnEvent.js","../../frontend/node_modules/@fluentui/react-hooks/lib/usePrevious.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useSetTimeout.js","../../frontend/node_modules/@fluentui/react-window-provider/lib/WindowProvider.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useTarget.js","../../frontend/node_modules/@fluentui/react-hooks/lib/useUnmount.js","../../frontend/node_modules/@fluentui/react/lib/components/Popup/Popup.js","../../frontend/node_modules/@fluentui/react/lib/components/Callout/CalloutContent.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Callout/CalloutContent.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Callout/CalloutContent.js","../../frontend/node_modules/@fluentui/react-portal-compat-context/lib/PortalCompatContext.js","../../frontend/node_modules/@fluentui/react/lib/components/Fabric/Fabric.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Fabric/Fabric.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Fabric/Fabric.js","../../frontend/node_modules/@fluentui/react/lib/components/Layer/Layer.notification.js","../../frontend/node_modules/@fluentui/react/lib/components/Layer/Layer.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Layer/Layer.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Layer/Layer.js","../../frontend/node_modules/@fluentui/react/lib/components/Callout/Callout.js","../../frontend/node_modules/@fluentui/react/lib/components/FocusTrapZone/FocusTrapZone.js","../../frontend/node_modules/@fluentui/react/lib/components/Icon/Icon.types.js","../../frontend/node_modules/@fluentui/react/lib/components/Image/Image.types.js","../../frontend/node_modules/@fluentui/react/lib/components/Image/Image.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Image/Image.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Image/Image.js","../../frontend/node_modules/@fluentui/react/lib/components/Icon/Icon.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Icon/FontIcon.js","../../frontend/node_modules/@fluentui/react/lib/components/Icon/Icon.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Icon/Icon.js","../../frontend/node_modules/@fluentui/react/lib/components/Icon/ImageIcon.js","../../frontend/node_modules/@fluentui/react-focus/lib/components/FocusZone/FocusZone.types.js","../../frontend/node_modules/@fluentui/react-focus/lib/components/FocusZone/FocusZone.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.types.js","../../frontend/node_modules/@fluentui/react/lib/utilities/contextualMenu/contextualMenuUtility.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItem.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Divider/VerticalDivider.classNames.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.cnstyles.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.classNames.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItem.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuItemWrapper.js","../../frontend/node_modules/@fluentui/react/lib/utilities/keytips/KeytipConstants.js","../../frontend/node_modules/@fluentui/react/lib/utilities/keytips/KeytipManager.js","../../frontend/node_modules/@fluentui/react/lib/utilities/keytips/KeytipUtils.js","../../frontend/node_modules/@fluentui/react/lib/components/KeytipData/useKeytipData.js","../../frontend/node_modules/@fluentui/react/lib/components/KeytipData/KeytipData.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuAnchor.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuButton.js","../../frontend/node_modules/@fluentui/react/lib/components/Divider/VerticalDivider.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Divider/VerticalDivider.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Divider/VerticalDivider.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenuItemWrapper/ContextualMenuSplitButton.js","../../frontend/node_modules/@fluentui/react/lib/utilities/decorators/BaseDecorator.js","../../frontend/node_modules/@fluentui/react/lib/utilities/decorators/withResponsiveMode.js","../../frontend/node_modules/@fluentui/react/lib/utilities/hooks/useResponsiveMode.js","../../frontend/node_modules/@fluentui/react/lib/utilities/MenuContext/MenuContext.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.base.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/BaseButton.classNames.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/SplitButton/SplitButton.classNames.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/BaseButton.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/BaseButton.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/SplitButton/SplitButton.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/ButtonThemes.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/DefaultButton/DefaultButton.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/DefaultButton/DefaultButton.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/IconButton/IconButton.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/IconButton/IconButton.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/PrimaryButton/PrimaryButton.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/CommandBarButton/CommandBarButton.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Button/CommandBarButton/CommandBarButton.js","../../frontend/node_modules/@fluentui/react/lib/components/Checkbox/Checkbox.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Checkbox/Checkbox.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Checkbox/Checkbox.js","../../frontend/node_modules/@fluentui/react/lib/components/Label/Label.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Label/Label.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Label/Label.js","../../frontend/node_modules/@fluentui/react/lib/components/TextField/TextField.base.js","../../frontend/node_modules/@fluentui/react/lib/components/TextField/TextField.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/TextField/TextField.js","../../frontend/node_modules/@fluentui/react/lib/components/List/List.types.js","../../frontend/node_modules/@fluentui/react/lib/components/List/utils/scroll.js","../../frontend/node_modules/@fluentui/react/lib/components/List/List.js","../../frontend/node_modules/@fluentui/react/lib/components/Spinner/Spinner.types.js","../../frontend/node_modules/@fluentui/react/lib/components/Spinner/Spinner.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Spinner/Spinner.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Spinner/Spinner.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogContent.types.js","../../frontend/node_modules/@fluentui/react/lib/components/Modal/Modal.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Overlay/Overlay.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Overlay/Overlay.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Overlay/Overlay.js","../../frontend/node_modules/@fluentui/react/lib/utilities/DraggableZone/DraggableZone.styles.js","../../frontend/node_modules/@fluentui/react/lib/utilities/DraggableZone/DraggableZone.js","../../frontend/node_modules/@fluentui/react/lib/components/Modal/Modal.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Modal/Modal.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogFooter.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogFooter.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogFooter.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogContent.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogContent.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/DialogContent.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/Dialog.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/Dialog.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Dialog/Dialog.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-0.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-1.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-2.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-3.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-4.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-5.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-6.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-7.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-8.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-9.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-10.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-11.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-12.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-13.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-14.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-15.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-16.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/fabric-icons-17.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/iconAliases.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/version.js","../../frontend/node_modules/@fluentui/font-icons-mdl2/lib/index.js","../../frontend/node_modules/@fluentui/react/lib/components/Separator/Separator.base.js","../../frontend/node_modules/@fluentui/react/lib/components/Separator/Separator.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Separator/Separator.js","../../frontend/node_modules/@fluentui/foundation-legacy/lib/utilities.js","../../frontend/node_modules/@fluentui/foundation-legacy/lib/slots.js","../../frontend/node_modules/@fluentui/foundation-legacy/lib/createComponent.js","../../frontend/node_modules/@fluentui/react/lib/components/Stack/StackItem/StackItem.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Stack/StackItem/StackItem.js","../../frontend/node_modules/@fluentui/react/lib/components/Stack/StackUtils.js","../../frontend/node_modules/@fluentui/react/lib/components/Stack/Stack.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Stack/Stack.js","../../frontend/node_modules/@fluentui/react/lib/components/Text/Text.view.js","../../frontend/node_modules/@fluentui/react/lib/components/Text/Text.styles.js","../../frontend/node_modules/@fluentui/react/lib/components/Text/Text.js","../../frontend/node_modules/@griffel/core/constants.esm.js","../../frontend/node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../frontend/node_modules/@griffel/core/runtime/utils/hashSequence.esm.js","../../frontend/node_modules/@griffel/core/runtime/reduceToClassNameForSlots.esm.js","../../frontend/node_modules/@griffel/core/mergeClasses.esm.js","../../frontend/node_modules/@griffel/core/runtime/utils/normalizeCSSBucketEntry.esm.js","../../frontend/node_modules/@griffel/core/renderer/createIsomorphicStyleSheet.esm.js","../../frontend/node_modules/@griffel/core/renderer/getStyleSheetForBucket.esm.js","../../frontend/node_modules/@griffel/core/renderer/createDOMRenderer.esm.js","../../frontend/node_modules/@griffel/core/__styles.esm.js","../../frontend/node_modules/@griffel/react/RendererContext.esm.js","../../frontend/node_modules/@griffel/react/TextDirectionContext.esm.js","../../frontend/node_modules/@griffel/react/__styles.esm.js","../../frontend/node_modules/@fluentui/react-icons/lib/utils/useIconState.js","../../frontend/node_modules/@fluentui/react-icons/lib/utils/wrapIcon.js","../../frontend/node_modules/@fluentui/react-icons/lib/icons/chunk-2.js","../../frontend/node_modules/@fluentui/react-icons/lib/icons/chunk-3.js","../../frontend/node_modules/@fluentui/react-icons/lib/icons/chunk-6.js","../../frontend/node_modules/@fluentui/react-icons/lib/sizedIcons/chunk-24.js","../../frontend/node_modules/react-markdown/lib/uri-transformer.js","../../frontend/node_modules/is-buffer/index.js","../../frontend/node_modules/unist-util-stringify-position/lib/index.js","../../frontend/node_modules/vfile-message/lib/index.js","../../frontend/node_modules/vfile/lib/minpath.browser.js","../../frontend/node_modules/vfile/lib/minproc.browser.js","../../frontend/node_modules/vfile/lib/minurl.shared.js","../../frontend/node_modules/vfile/lib/minurl.browser.js","../../frontend/node_modules/vfile/lib/index.js","../../frontend/node_modules/bail/index.js","../../frontend/node_modules/extend/index.js","../../frontend/node_modules/is-plain-obj/index.js","../../frontend/node_modules/trough/index.js","../../frontend/node_modules/unified/lib/index.js","../../frontend/node_modules/mdast-util-to-string/lib/index.js","../../frontend/node_modules/micromark-util-chunked/index.js","../../frontend/node_modules/micromark-util-combine-extensions/index.js","../../frontend/node_modules/micromark-util-character/lib/unicode-punctuation-regex.js","../../frontend/node_modules/micromark-util-character/index.js","../../frontend/node_modules/micromark-factory-space/index.js","../../frontend/node_modules/micromark/lib/initialize/content.js","../../frontend/node_modules/micromark/lib/initialize/document.js","../../frontend/node_modules/micromark-util-classify-character/index.js","../../frontend/node_modules/micromark-util-resolve-all/index.js","../../frontend/node_modules/micromark-core-commonmark/lib/attention.js","../../frontend/node_modules/micromark-core-commonmark/lib/autolink.js","../../frontend/node_modules/micromark-core-commonmark/lib/blank-line.js","../../frontend/node_modules/micromark-core-commonmark/lib/block-quote.js","../../frontend/node_modules/micromark-core-commonmark/lib/character-escape.js","../../frontend/node_modules/decode-named-character-reference/index.dom.js","../../frontend/node_modules/micromark-core-commonmark/lib/character-reference.js","../../frontend/node_modules/micromark-core-commonmark/lib/code-fenced.js","../../frontend/node_modules/micromark-core-commonmark/lib/code-indented.js","../../frontend/node_modules/micromark-core-commonmark/lib/code-text.js","../../frontend/node_modules/micromark-util-subtokenize/index.js","../../frontend/node_modules/micromark-core-commonmark/lib/content.js","../../frontend/node_modules/micromark-factory-destination/index.js","../../frontend/node_modules/micromark-factory-label/index.js","../../frontend/node_modules/micromark-factory-title/index.js","../../frontend/node_modules/micromark-factory-whitespace/index.js","../../frontend/node_modules/micromark-util-normalize-identifier/index.js","../../frontend/node_modules/micromark-core-commonmark/lib/definition.js","../../frontend/node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../frontend/node_modules/micromark-core-commonmark/lib/heading-atx.js","../../frontend/node_modules/micromark-util-html-tag-name/index.js","../../frontend/node_modules/micromark-core-commonmark/lib/html-flow.js","../../frontend/node_modules/micromark-core-commonmark/lib/html-text.js","../../frontend/node_modules/micromark-core-commonmark/lib/label-end.js","../../frontend/node_modules/micromark-core-commonmark/lib/label-start-image.js","../../frontend/node_modules/micromark-core-commonmark/lib/label-start-link.js","../../frontend/node_modules/micromark-core-commonmark/lib/line-ending.js","../../frontend/node_modules/micromark-core-commonmark/lib/thematic-break.js","../../frontend/node_modules/micromark-core-commonmark/lib/list.js","../../frontend/node_modules/micromark-core-commonmark/lib/setext-underline.js","../../frontend/node_modules/micromark/lib/initialize/flow.js","../../frontend/node_modules/micromark/lib/initialize/text.js","../../frontend/node_modules/micromark/lib/create-tokenizer.js","../../frontend/node_modules/micromark/lib/constructs.js","../../frontend/node_modules/micromark/lib/parse.js","../../frontend/node_modules/micromark/lib/preprocess.js","../../frontend/node_modules/micromark/lib/postprocess.js","../../frontend/node_modules/micromark-util-decode-numeric-character-reference/index.js","../../frontend/node_modules/micromark-util-decode-string/index.js","../../frontend/node_modules/mdast-util-from-markdown/lib/index.js","../../frontend/node_modules/remark-parse/lib/index.js","../../frontend/node_modules/unist-builder/lib/index.js","../../frontend/node_modules/mdast-util-to-hast/lib/traverse.js","../../frontend/node_modules/unist-util-is/lib/index.js","../../frontend/node_modules/unist-util-visit-parents/lib/index.js","../../frontend/node_modules/unist-util-visit/lib/index.js","../../frontend/node_modules/unist-util-position/lib/index.js","../../frontend/node_modules/unist-util-generated/lib/index.js","../../frontend/node_modules/mdast-util-definitions/lib/index.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../../frontend/node_modules/mdast-util-to-hast/lib/wrap.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/list.js","../../frontend/node_modules/mdast-util-to-hast/lib/footer.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/break.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/code.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/delete.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/footnote.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/heading.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/html.js","../../frontend/node_modules/mdurl/encode.js","../../frontend/node_modules/mdast-util-to-hast/lib/revert.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/image.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/link.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/root.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/strong.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/table.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/text.js","../../frontend/node_modules/mdast-util-to-hast/lib/handlers/index.js","../../frontend/node_modules/mdast-util-to-hast/lib/index.js","../../frontend/node_modules/remark-rehype/index.js","../../frontend/node_modules/prop-types/lib/ReactPropTypesSecret.js","../../frontend/node_modules/prop-types/factoryWithThrowingShims.js","../../frontend/node_modules/prop-types/index.js","../../frontend/node_modules/property-information/lib/util/schema.js","../../frontend/node_modules/property-information/lib/util/merge.js","../../frontend/node_modules/property-information/lib/normalize.js","../../frontend/node_modules/property-information/lib/util/info.js","../../frontend/node_modules/property-information/lib/util/types.js","../../frontend/node_modules/property-information/lib/util/defined-info.js","../../frontend/node_modules/property-information/lib/util/create.js","../../frontend/node_modules/property-information/lib/xlink.js","../../frontend/node_modules/property-information/lib/xml.js","../../frontend/node_modules/property-information/lib/util/case-sensitive-transform.js","../../frontend/node_modules/property-information/lib/util/case-insensitive-transform.js","../../frontend/node_modules/property-information/lib/xmlns.js","../../frontend/node_modules/property-information/lib/aria.js","../../frontend/node_modules/property-information/lib/html.js","../../frontend/node_modules/property-information/lib/svg.js","../../frontend/node_modules/property-information/lib/find.js","../../frontend/node_modules/property-information/lib/hast-to-react.js","../../frontend/node_modules/property-information/index.js","../../frontend/node_modules/react-markdown/lib/rehype-filter.js","../../frontend/node_modules/react-is/cjs/react-is.production.min.js","../../frontend/node_modules/react-is/index.js","../../frontend/node_modules/hast-util-whitespace/index.js","../../frontend/node_modules/space-separated-tokens/index.js","../../frontend/node_modules/comma-separated-tokens/index.js","../../frontend/node_modules/inline-style-parser/index.js","../../frontend/node_modules/style-to-object/index.js","../../frontend/node_modules/react-markdown/lib/ast-to-react.js","../../frontend/node_modules/react-markdown/lib/react-markdown.js","../../frontend/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../../frontend/node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../../frontend/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../../frontend/node_modules/micromark-extension-gfm-table/lib/edit-map.js","../../frontend/node_modules/micromark-extension-gfm-table/lib/infer.js","../../frontend/node_modules/micromark-extension-gfm-table/lib/syntax.js","../../frontend/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../../frontend/node_modules/micromark-extension-gfm/index.js","../../frontend/node_modules/ccount/index.js","../../frontend/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js","../../frontend/node_modules/mdast-util-find-and-replace/lib/index.js","../../frontend/node_modules/mdast-util-gfm-autolink-literal/lib/index.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/association.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/container-flow.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/safe.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/track.js","../../frontend/node_modules/mdast-util-gfm-footnote/lib/index.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js","../../frontend/node_modules/mdast-util-gfm-strikethrough/lib/index.js","../../frontend/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js","../../frontend/node_modules/markdown-table/index.js","../../frontend/node_modules/mdast-util-gfm-table/lib/index.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js","../../frontend/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js","../../frontend/node_modules/mdast-util-to-markdown/lib/handle/list-item.js","../../frontend/node_modules/mdast-util-gfm-task-list-item/lib/index.js","../../frontend/node_modules/mdast-util-gfm/lib/index.js","../../frontend/node_modules/remark-gfm/index.js","../../frontend/node_modules/parse5/lib/common/unicode.js","../../frontend/node_modules/parse5/lib/common/error-codes.js","../../frontend/node_modules/parse5/lib/tokenizer/preprocessor.js","../../frontend/node_modules/parse5/lib/tokenizer/named-entity-data.js","../../frontend/node_modules/parse5/lib/tokenizer/index.js","../../frontend/node_modules/parse5/lib/common/html.js","../../frontend/node_modules/parse5/lib/parser/open-element-stack.js","../../frontend/node_modules/parse5/lib/parser/formatting-element-list.js","../../frontend/node_modules/parse5/lib/utils/mixin.js","../../frontend/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js","../../frontend/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js","../../frontend/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js","../../frontend/node_modules/parse5/lib/extensions/location-info/parser-mixin.js","../../frontend/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js","../../frontend/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js","../../frontend/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js","../../frontend/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js","../../frontend/node_modules/parse5/lib/tree-adapters/default.js","../../frontend/node_modules/parse5/lib/utils/merge-options.js","../../frontend/node_modules/parse5/lib/common/doctype.js","../../frontend/node_modules/parse5/lib/common/foreign-content.js","../../frontend/node_modules/parse5/lib/parser/index.js","../../frontend/node_modules/hast-util-parse-selector/lib/index.js","../../frontend/node_modules/hastscript/lib/core.js","../../frontend/node_modules/hastscript/lib/html.js","../../frontend/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js","../../frontend/node_modules/hastscript/lib/svg.js","../../frontend/node_modules/vfile-location/lib/index.js","../../frontend/node_modules/web-namespaces/index.js","../../frontend/node_modules/hast-util-from-parse5/lib/index.js","../../frontend/node_modules/zwitch/index.js","../../frontend/node_modules/hast-util-to-parse5/lib/index.js","../../frontend/node_modules/html-void-elements/index.js","../../frontend/node_modules/hast-util-raw/lib/index.js","../../frontend/node_modules/rehype-raw/index.js","../../frontend/node_modules/react-uuid/uuid.js","../../frontend/node_modules/lodash/lodash.js","../../frontend/node_modules/dompurify/dist/purify.es.mjs","../../frontend/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../frontend/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../frontend/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../frontend/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../frontend/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../frontend/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../frontend/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../frontend/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../frontend/node_modules/@babel/runtime/helpers/esm/typeof.js","../../frontend/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../frontend/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../frontend/node_modules/@babel/runtime/helpers/esm/extends.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/create-element.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/checkForListedLanguage.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/highlight.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/languages/prism/supported-languages.js","../../frontend/node_modules/xtend/immutable.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/schema.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/merge.js","../../frontend/node_modules/refractor/node_modules/property-information/normalize.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/info.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/types.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/defined-info.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/create.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/xlink.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/xml.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/case-sensitive-transform.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/util/case-insensitive-transform.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/xmlns.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/aria.js","../../frontend/node_modules/refractor/node_modules/property-information/lib/html.js","../../frontend/node_modules/refractor/node_modules/property-information/html.js","../../frontend/node_modules/refractor/node_modules/property-information/find.js","../../frontend/node_modules/refractor/node_modules/hast-util-parse-selector/index.js","../../frontend/node_modules/refractor/node_modules/space-separated-tokens/index.js","../../frontend/node_modules/refractor/node_modules/comma-separated-tokens/index.js","../../frontend/node_modules/refractor/node_modules/hastscript/factory.js","../../frontend/node_modules/refractor/node_modules/hastscript/html.js","../../frontend/node_modules/refractor/node_modules/hastscript/index.js","../../frontend/node_modules/is-decimal/index.js","../../frontend/node_modules/is-hexadecimal/index.js","../../frontend/node_modules/is-alphabetical/index.js","../../frontend/node_modules/is-alphanumerical/index.js","../../frontend/node_modules/parse-entities/decode-entity.browser.js","../../frontend/node_modules/parse-entities/index.js","../../frontend/node_modules/refractor/node_modules/prismjs/components/prism-core.js","../../frontend/node_modules/refractor/lang/markup.js","../../frontend/node_modules/refractor/lang/css.js","../../frontend/node_modules/refractor/lang/clike.js","../../frontend/node_modules/refractor/lang/javascript.js","../../frontend/node_modules/refractor/core.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/styles/prism/prism.js","../../frontend/node_modules/refractor/lang/abap.js","../../frontend/node_modules/refractor/lang/abnf.js","../../frontend/node_modules/refractor/lang/actionscript.js","../../frontend/node_modules/refractor/lang/ada.js","../../frontend/node_modules/refractor/lang/agda.js","../../frontend/node_modules/refractor/lang/al.js","../../frontend/node_modules/refractor/lang/antlr4.js","../../frontend/node_modules/refractor/lang/apacheconf.js","../../frontend/node_modules/refractor/lang/sql.js","../../frontend/node_modules/refractor/lang/apex.js","../../frontend/node_modules/refractor/lang/apl.js","../../frontend/node_modules/refractor/lang/applescript.js","../../frontend/node_modules/refractor/lang/aql.js","../../frontend/node_modules/refractor/lang/c.js","../../frontend/node_modules/refractor/lang/cpp.js","../../frontend/node_modules/refractor/lang/arduino.js","../../frontend/node_modules/refractor/lang/arff.js","../../frontend/node_modules/refractor/lang/asciidoc.js","../../frontend/node_modules/refractor/lang/asm6502.js","../../frontend/node_modules/refractor/lang/asmatmel.js","../../frontend/node_modules/refractor/lang/csharp.js","../../frontend/node_modules/refractor/lang/aspnet.js","../../frontend/node_modules/refractor/lang/autohotkey.js","../../frontend/node_modules/refractor/lang/autoit.js","../../frontend/node_modules/refractor/lang/avisynth.js","../../frontend/node_modules/refractor/lang/avro-idl.js","../../frontend/node_modules/refractor/lang/bash.js","../../frontend/node_modules/refractor/lang/basic.js","../../frontend/node_modules/refractor/lang/batch.js","../../frontend/node_modules/refractor/lang/bbcode.js","../../frontend/node_modules/refractor/lang/bicep.js","../../frontend/node_modules/refractor/lang/birb.js","../../frontend/node_modules/refractor/lang/bison.js","../../frontend/node_modules/refractor/lang/bnf.js","../../frontend/node_modules/refractor/lang/brainfuck.js","../../frontend/node_modules/refractor/lang/brightscript.js","../../frontend/node_modules/refractor/lang/bro.js","../../frontend/node_modules/refractor/lang/bsl.js","../../frontend/node_modules/refractor/lang/cfscript.js","../../frontend/node_modules/refractor/lang/chaiscript.js","../../frontend/node_modules/refractor/lang/cil.js","../../frontend/node_modules/refractor/lang/clojure.js","../../frontend/node_modules/refractor/lang/cmake.js","../../frontend/node_modules/refractor/lang/cobol.js","../../frontend/node_modules/refractor/lang/coffeescript.js","../../frontend/node_modules/refractor/lang/concurnas.js","../../frontend/node_modules/refractor/lang/coq.js","../../frontend/node_modules/refractor/lang/ruby.js","../../frontend/node_modules/refractor/lang/crystal.js","../../frontend/node_modules/refractor/lang/cshtml.js","../../frontend/node_modules/refractor/lang/csp.js","../../frontend/node_modules/refractor/lang/css-extras.js","../../frontend/node_modules/refractor/lang/csv.js","../../frontend/node_modules/refractor/lang/cypher.js","../../frontend/node_modules/refractor/lang/d.js","../../frontend/node_modules/refractor/lang/dart.js","../../frontend/node_modules/refractor/lang/dataweave.js","../../frontend/node_modules/refractor/lang/dax.js","../../frontend/node_modules/refractor/lang/dhall.js","../../frontend/node_modules/refractor/lang/diff.js","../../frontend/node_modules/refractor/lang/markup-templating.js","../../frontend/node_modules/refractor/lang/django.js","../../frontend/node_modules/refractor/lang/dns-zone-file.js","../../frontend/node_modules/refractor/lang/docker.js","../../frontend/node_modules/refractor/lang/dot.js","../../frontend/node_modules/refractor/lang/ebnf.js","../../frontend/node_modules/refractor/lang/editorconfig.js","../../frontend/node_modules/refractor/lang/eiffel.js","../../frontend/node_modules/refractor/lang/ejs.js","../../frontend/node_modules/refractor/lang/elixir.js","../../frontend/node_modules/refractor/lang/elm.js","../../frontend/node_modules/refractor/lang/erb.js","../../frontend/node_modules/refractor/lang/erlang.js","../../frontend/node_modules/refractor/lang/lua.js","../../frontend/node_modules/refractor/lang/etlua.js","../../frontend/node_modules/refractor/lang/excel-formula.js","../../frontend/node_modules/refractor/lang/factor.js","../../frontend/node_modules/refractor/lang/false.js","../../frontend/node_modules/refractor/lang/firestore-security-rules.js","../../frontend/node_modules/refractor/lang/flow.js","../../frontend/node_modules/refractor/lang/fortran.js","../../frontend/node_modules/refractor/lang/fsharp.js","../../frontend/node_modules/refractor/lang/ftl.js","../../frontend/node_modules/refractor/lang/gap.js","../../frontend/node_modules/refractor/lang/gcode.js","../../frontend/node_modules/refractor/lang/gdscript.js","../../frontend/node_modules/refractor/lang/gedcom.js","../../frontend/node_modules/refractor/lang/gherkin.js","../../frontend/node_modules/refractor/lang/git.js","../../frontend/node_modules/refractor/lang/glsl.js","../../frontend/node_modules/refractor/lang/gml.js","../../frontend/node_modules/refractor/lang/gn.js","../../frontend/node_modules/refractor/lang/go-module.js","../../frontend/node_modules/refractor/lang/go.js","../../frontend/node_modules/refractor/lang/graphql.js","../../frontend/node_modules/refractor/lang/groovy.js","../../frontend/node_modules/refractor/lang/haml.js","../../frontend/node_modules/refractor/lang/handlebars.js","../../frontend/node_modules/refractor/lang/haskell.js","../../frontend/node_modules/refractor/lang/haxe.js","../../frontend/node_modules/refractor/lang/hcl.js","../../frontend/node_modules/refractor/lang/hlsl.js","../../frontend/node_modules/refractor/lang/hoon.js","../../frontend/node_modules/refractor/lang/hpkp.js","../../frontend/node_modules/refractor/lang/hsts.js","../../frontend/node_modules/refractor/lang/http.js","../../frontend/node_modules/refractor/lang/ichigojam.js","../../frontend/node_modules/refractor/lang/icon.js","../../frontend/node_modules/refractor/lang/icu-message-format.js","../../frontend/node_modules/refractor/lang/idris.js","../../frontend/node_modules/refractor/lang/iecst.js","../../frontend/node_modules/refractor/lang/ignore.js","../../frontend/node_modules/refractor/lang/inform7.js","../../frontend/node_modules/refractor/lang/ini.js","../../frontend/node_modules/refractor/lang/io.js","../../frontend/node_modules/refractor/lang/j.js","../../frontend/node_modules/refractor/lang/java.js","../../frontend/node_modules/refractor/lang/javadoclike.js","../../frontend/node_modules/refractor/lang/javadoc.js","../../frontend/node_modules/refractor/lang/javastacktrace.js","../../frontend/node_modules/refractor/lang/jexl.js","../../frontend/node_modules/refractor/lang/jolie.js","../../frontend/node_modules/refractor/lang/jq.js","../../frontend/node_modules/refractor/lang/js-extras.js","../../frontend/node_modules/refractor/lang/js-templates.js","../../frontend/node_modules/refractor/lang/typescript.js","../../frontend/node_modules/refractor/lang/jsdoc.js","../../frontend/node_modules/refractor/lang/json.js","../../frontend/node_modules/refractor/lang/json5.js","../../frontend/node_modules/refractor/lang/jsonp.js","../../frontend/node_modules/refractor/lang/jsstacktrace.js","../../frontend/node_modules/refractor/lang/jsx.js","../../frontend/node_modules/refractor/lang/julia.js","../../frontend/node_modules/refractor/lang/keepalived.js","../../frontend/node_modules/refractor/lang/keyman.js","../../frontend/node_modules/refractor/lang/kotlin.js","../../frontend/node_modules/refractor/lang/kumir.js","../../frontend/node_modules/refractor/lang/kusto.js","../../frontend/node_modules/refractor/lang/latex.js","../../frontend/node_modules/refractor/lang/php.js","../../frontend/node_modules/refractor/lang/latte.js","../../frontend/node_modules/refractor/lang/less.js","../../frontend/node_modules/refractor/lang/scheme.js","../../frontend/node_modules/refractor/lang/lilypond.js","../../frontend/node_modules/refractor/lang/liquid.js","../../frontend/node_modules/refractor/lang/lisp.js","../../frontend/node_modules/refractor/lang/livescript.js","../../frontend/node_modules/refractor/lang/llvm.js","../../frontend/node_modules/refractor/lang/log.js","../../frontend/node_modules/refractor/lang/lolcode.js","../../frontend/node_modules/refractor/lang/magma.js","../../frontend/node_modules/refractor/lang/makefile.js","../../frontend/node_modules/refractor/lang/markdown.js","../../frontend/node_modules/refractor/lang/matlab.js","../../frontend/node_modules/refractor/lang/maxscript.js","../../frontend/node_modules/refractor/lang/mel.js","../../frontend/node_modules/refractor/lang/mermaid.js","../../frontend/node_modules/refractor/lang/mizar.js","../../frontend/node_modules/refractor/lang/mongodb.js","../../frontend/node_modules/refractor/lang/monkey.js","../../frontend/node_modules/refractor/lang/moonscript.js","../../frontend/node_modules/refractor/lang/n1ql.js","../../frontend/node_modules/refractor/lang/n4js.js","../../frontend/node_modules/refractor/lang/nand2tetris-hdl.js","../../frontend/node_modules/refractor/lang/naniscript.js","../../frontend/node_modules/refractor/lang/nasm.js","../../frontend/node_modules/refractor/lang/neon.js","../../frontend/node_modules/refractor/lang/nevod.js","../../frontend/node_modules/refractor/lang/nginx.js","../../frontend/node_modules/refractor/lang/nim.js","../../frontend/node_modules/refractor/lang/nix.js","../../frontend/node_modules/refractor/lang/nsis.js","../../frontend/node_modules/refractor/lang/objectivec.js","../../frontend/node_modules/refractor/lang/ocaml.js","../../frontend/node_modules/refractor/lang/opencl.js","../../frontend/node_modules/refractor/lang/openqasm.js","../../frontend/node_modules/refractor/lang/oz.js","../../frontend/node_modules/refractor/lang/parigp.js","../../frontend/node_modules/refractor/lang/parser.js","../../frontend/node_modules/refractor/lang/pascal.js","../../frontend/node_modules/refractor/lang/pascaligo.js","../../frontend/node_modules/refractor/lang/pcaxis.js","../../frontend/node_modules/refractor/lang/peoplecode.js","../../frontend/node_modules/refractor/lang/perl.js","../../frontend/node_modules/refractor/lang/php-extras.js","../../frontend/node_modules/refractor/lang/phpdoc.js","../../frontend/node_modules/refractor/lang/plsql.js","../../frontend/node_modules/refractor/lang/powerquery.js","../../frontend/node_modules/refractor/lang/powershell.js","../../frontend/node_modules/refractor/lang/processing.js","../../frontend/node_modules/refractor/lang/prolog.js","../../frontend/node_modules/refractor/lang/promql.js","../../frontend/node_modules/refractor/lang/properties.js","../../frontend/node_modules/refractor/lang/protobuf.js","../../frontend/node_modules/refractor/lang/psl.js","../../frontend/node_modules/refractor/lang/pug.js","../../frontend/node_modules/refractor/lang/puppet.js","../../frontend/node_modules/refractor/lang/pure.js","../../frontend/node_modules/refractor/lang/purebasic.js","../../frontend/node_modules/refractor/lang/purescript.js","../../frontend/node_modules/refractor/lang/python.js","../../frontend/node_modules/refractor/lang/q.js","../../frontend/node_modules/refractor/lang/qml.js","../../frontend/node_modules/refractor/lang/qore.js","../../frontend/node_modules/refractor/lang/qsharp.js","../../frontend/node_modules/refractor/lang/r.js","../../frontend/node_modules/refractor/lang/racket.js","../../frontend/node_modules/refractor/lang/reason.js","../../frontend/node_modules/refractor/lang/regex.js","../../frontend/node_modules/refractor/lang/rego.js","../../frontend/node_modules/refractor/lang/renpy.js","../../frontend/node_modules/refractor/lang/rest.js","../../frontend/node_modules/refractor/lang/rip.js","../../frontend/node_modules/refractor/lang/roboconf.js","../../frontend/node_modules/refractor/lang/robotframework.js","../../frontend/node_modules/refractor/lang/rust.js","../../frontend/node_modules/refractor/lang/sas.js","../../frontend/node_modules/refractor/lang/sass.js","../../frontend/node_modules/refractor/lang/scala.js","../../frontend/node_modules/refractor/lang/scss.js","../../frontend/node_modules/refractor/lang/shell-session.js","../../frontend/node_modules/refractor/lang/smali.js","../../frontend/node_modules/refractor/lang/smalltalk.js","../../frontend/node_modules/refractor/lang/smarty.js","../../frontend/node_modules/refractor/lang/sml.js","../../frontend/node_modules/refractor/lang/solidity.js","../../frontend/node_modules/refractor/lang/solution-file.js","../../frontend/node_modules/refractor/lang/soy.js","../../frontend/node_modules/refractor/lang/turtle.js","../../frontend/node_modules/refractor/lang/sparql.js","../../frontend/node_modules/refractor/lang/splunk-spl.js","../../frontend/node_modules/refractor/lang/sqf.js","../../frontend/node_modules/refractor/lang/squirrel.js","../../frontend/node_modules/refractor/lang/stan.js","../../frontend/node_modules/refractor/lang/stylus.js","../../frontend/node_modules/refractor/lang/swift.js","../../frontend/node_modules/refractor/lang/systemd.js","../../frontend/node_modules/refractor/lang/t4-templating.js","../../frontend/node_modules/refractor/lang/t4-cs.js","../../frontend/node_modules/refractor/lang/vbnet.js","../../frontend/node_modules/refractor/lang/t4-vb.js","../../frontend/node_modules/refractor/lang/yaml.js","../../frontend/node_modules/refractor/lang/tap.js","../../frontend/node_modules/refractor/lang/tcl.js","../../frontend/node_modules/refractor/lang/textile.js","../../frontend/node_modules/refractor/lang/toml.js","../../frontend/node_modules/refractor/lang/tremor.js","../../frontend/node_modules/refractor/lang/tsx.js","../../frontend/node_modules/refractor/lang/tt2.js","../../frontend/node_modules/refractor/lang/twig.js","../../frontend/node_modules/refractor/lang/typoscript.js","../../frontend/node_modules/refractor/lang/unrealscript.js","../../frontend/node_modules/refractor/lang/uorazor.js","../../frontend/node_modules/refractor/lang/uri.js","../../frontend/node_modules/refractor/lang/v.js","../../frontend/node_modules/refractor/lang/vala.js","../../frontend/node_modules/refractor/lang/velocity.js","../../frontend/node_modules/refractor/lang/verilog.js","../../frontend/node_modules/refractor/lang/vhdl.js","../../frontend/node_modules/refractor/lang/vim.js","../../frontend/node_modules/refractor/lang/visual-basic.js","../../frontend/node_modules/refractor/lang/warpscript.js","../../frontend/node_modules/refractor/lang/wasm.js","../../frontend/node_modules/refractor/lang/web-idl.js","../../frontend/node_modules/refractor/lang/wiki.js","../../frontend/node_modules/refractor/lang/wolfram.js","../../frontend/node_modules/refractor/lang/wren.js","../../frontend/node_modules/refractor/lang/xeora.js","../../frontend/node_modules/refractor/lang/xml-doc.js","../../frontend/node_modules/refractor/lang/xojo.js","../../frontend/node_modules/refractor/lang/xquery.js","../../frontend/node_modules/refractor/lang/yang.js","../../frontend/node_modules/refractor/lang/zig.js","../../frontend/node_modules/refractor/index.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/prism.js","../../frontend/node_modules/react-syntax-highlighter/dist/esm/styles/prism/nord.js","../../frontend/src/assets/Contoso.svg","../../frontend/src/constants/xssAllowTags.ts","../../frontend/src/api/models.ts","../../frontend/src/api/api.ts","../../frontend/node_modules/remark-supersub/lib/index.js","../../frontend/node_modules/react-plotly.js/factory.js","../../frontend/node_modules/plotly.js/dist/plotly.js","../../frontend/node_modules/react-plotly.js/react-plotly.js","../../frontend/src/state/AppReducer.tsx","../../frontend/src/state/AppProvider.tsx","../../frontend/src/components/Answer/AnswerParser.tsx","../../frontend/src/components/Answer/Answer.tsx","../../frontend/src/assets/Send.svg","../../frontend/src/components/QuestionInput/QuestionInput.tsx","../../frontend/src/components/ChatHistory/ChatHistoryListItem.tsx","../../frontend/src/components/ChatHistory/ChatHistoryList.tsx","../../frontend/src/components/ChatHistory/ChatHistoryPanel.tsx","../../frontend/src/pages/chat/Chat.tsx","../../frontend/src/components/common/Button.tsx","../../frontend/src/pages/layout/Layout.tsx","../../frontend/src/pages/NoPage.tsx","../../frontend/src/index.tsx"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 createMemoryLocation(entry, typeof entry === \"string\" ? null : entry.state, index === 0 ? \"default\" : undefined));\n let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);\n let action = Action.Pop;\n let listener = null;\n\n function clampIndex(n) {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n\n function getCurrentLocation() {\n return entries[index];\n }\n\n function createMemoryLocation(to, state, key) {\n if (state === void 0) {\n state = null;\n }\n\n let location = createLocation(entries ? getCurrentLocation().pathname : \"/\", to, state, key);\n warning$1(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in memory history: \" + JSON.stringify(to));\n return location;\n }\n\n function createHref(to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n let history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return getCurrentLocation();\n },\n\n createHref,\n\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n\n encodeLocation(to) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\"\n };\n },\n\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation,\n delta: 1\n });\n }\n },\n\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation,\n delta: 0\n });\n }\n },\n\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n\n if (listener) {\n listener({\n action,\n location: nextLocation,\n delta\n });\n }\n },\n\n listen(fn) {\n listener = fn;\n return () => {\n listener = null;\n };\n }\n\n };\n return history;\n}\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n function createBrowserLocation(window, globalHistory) {\n let {\n pathname,\n search,\n hash\n } = window.location;\n return createLocation(\"\", {\n pathname,\n search,\n hash\n }, // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n\n function createBrowserHref(window, to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n\n return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);\n}\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n function createHashLocation(window, globalHistory) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = parsePath(window.location.hash.substr(1));\n return createLocation(\"\", {\n pathname,\n search,\n hash\n }, // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n\n function createHashHref(window, to) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n\n function validateHashLocation(location, to) {\n warning$1(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\");\n }\n\n return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);\n}\nfunction invariant(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\n\nfunction warning$1(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\n * For browser-based histories, we combine the state and key into an object\n */\n\n\nfunction getHistoryState(location, index) {\n return {\n usr: location.state,\n key: location.key,\n idx: index\n };\n}\n/**\n * Creates a Location object with a unique key from the given Path\n */\n\n\nfunction createLocation(current, to, state, key) {\n if (state === void 0) {\n state = null;\n }\n\n let location = _extends({\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\"\n }, typeof to === \"string\" ? parsePath(to) : to, {\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: to && to.key || key || createKey()\n });\n\n return location;\n}\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\n\nfunction createPath(_ref) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = _ref;\n if (search && search !== \"?\") pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\") pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\n\nfunction parsePath(path) {\n let parsedPath = {};\n\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n let searchIndex = path.indexOf(\"?\");\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nfunction getUrlBasedHistory(getLocation, createHref, validateLocation, options) {\n if (options === void 0) {\n options = {};\n }\n\n let {\n window = document.defaultView,\n v5Compat = false\n } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener = null;\n let index = getIndex(); // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), \"\");\n }\n\n function getIndex() {\n let state = globalHistory.state || {\n idx: null\n };\n return state.idx;\n }\n\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n\n if (listener) {\n listener({\n action,\n location: history.location,\n delta\n });\n }\n }\n\n function push(to, state) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/\n\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location,\n delta: 1\n });\n }\n }\n\n function replace(to, state) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location,\n delta: 0\n });\n }\n }\n\n function createURL(to) {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base = window.location.origin !== \"null\" ? window.location.origin : window.location.href;\n let href = typeof to === \"string\" ? to : createPath(to);\n invariant(base, \"No window.location.(origin|href) available to create URL for href: \" + href);\n return new URL(href, base);\n }\n\n let history = {\n get action() {\n return action;\n },\n\n get location() {\n return getLocation(window, globalHistory);\n },\n\n listen(fn) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n\n createHref(to) {\n return createHref(window, to);\n },\n\n createURL,\n\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash\n };\n },\n\n push,\n replace,\n\n go(n) {\n return globalHistory.go(n);\n }\n\n };\n return history;\n} //#endregion\n\nvar ResultType;\n\n(function (ResultType) {\n ResultType[\"data\"] = \"data\";\n ResultType[\"deferred\"] = \"deferred\";\n ResultType[\"redirect\"] = \"redirect\";\n ResultType[\"error\"] = \"error\";\n})(ResultType || (ResultType = {}));\n\nfunction isIndexRoute(route) {\n return route.index === true;\n} // Walk the route tree generating unique IDs where necessary so we are working\n// solely with AgnosticDataRouteObject's within the Router\n\n\nfunction convertRoutesToDataRoutes(routes, parentPath, allIds) {\n if (parentPath === void 0) {\n parentPath = [];\n }\n\n if (allIds === void 0) {\n allIds = new Set();\n }\n\n return routes.map((route, index) => {\n let treePath = [...parentPath, index];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(route.index !== true || !route.children, \"Cannot specify children on an index route\");\n invariant(!allIds.has(id), \"Found a route id collision on id \\\"\" + id + \"\\\". Route \" + \"id's must be globally unique within Data Router usages\");\n allIds.add(id);\n\n if (isIndexRoute(route)) {\n let indexRoute = _extends({}, route, {\n id\n });\n\n return indexRoute;\n } else {\n let pathOrLayoutRoute = _extends({}, route, {\n id,\n children: route.children ? convertRoutesToDataRoutes(route.children, treePath, allIds) : undefined\n });\n\n return pathOrLayoutRoute;\n }\n });\n}\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/utils/match-routes\n */\n\nfunction matchRoutes(routes, locationArg, basename) {\n if (basename === void 0) {\n basename = \"/\";\n }\n\n let location = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n let matches = null;\n\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(branches[i], // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n safelyDecodeURI(pathname));\n }\n\n return matches;\n}\n\nfunction flattenRoutes(routes, branches, parentsMeta, parentPath) {\n if (branches === void 0) {\n branches = [];\n }\n\n if (parentsMeta === void 0) {\n parentsMeta = [];\n }\n\n if (parentPath === void 0) {\n parentPath = \"\";\n }\n\n let flattenRoute = (route, index, relativePath) => {\n let meta = {\n relativePath: relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(meta.relativePath.startsWith(parentPath), \"Absolute route path \\\"\" + meta.relativePath + \"\\\" nested under path \" + (\"\\\"\" + parentPath + \"\\\" is not valid. An absolute child route path \") + \"must start with the combined path of all its parent routes.\");\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n\n if (route.children && route.children.length > 0) {\n invariant( // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true, \"Index routes must not have child routes. Please remove \" + (\"all child routes from route path \\\"\" + path + \"\\\".\"));\n flattenRoutes(route.children, branches, routesMeta, path);\n } // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n\n\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta\n });\n };\n\n routes.forEach((route, index) => {\n var _route$path;\n\n // coarse-grain check for optional params\n if (route.path === \"\" || !((_route$path = route.path) != null && _route$path.includes(\"?\"))) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n return branches;\n}\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\n\n\nfunction explodeOptionalSegments(path) {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n let [first, ...rest] = segments; // Optional path segments are denoted by a trailing `?`\n\n let isOptional = first.endsWith(\"?\"); // Compute the corresponding required segment: `foo?` -> `foo`\n\n let required = first.replace(/\\?$/, \"\");\n\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n let result = []; // All child paths with the prefix. Do this for all children before the\n // optional version for all children so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explodes _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n\n result.push(...restExploded.map(subpath => subpath === \"\" ? required : [required, subpath].join(\"/\"))); // Then if this is an optional value, add all child versions without\n\n if (isOptional) {\n result.push(...restExploded);\n } // for absolute paths, ensure `/` instead of empty segment\n\n\n return result.map(exploded => path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded);\n}\n\nfunction rankRouteBranches(branches) {\n branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first\n : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\n\nconst isSplat = s => s === \"*\";\n\nfunction computeScore(path, index) {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === \"\" ? emptySegmentValue : staticSegmentValue), initialScore);\n}\n\nfunction compareIndexes(a, b) {\n let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n return siblings ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch(branch, pathname) {\n let {\n routesMeta\n } = branch;\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches = [];\n\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname = matchedPathname === \"/\" ? pathname : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath({\n path: meta.relativePath,\n caseSensitive: meta.caseSensitive,\n end\n }, remainingPathname);\n if (!match) return null;\n Object.assign(matchedParams, match.params);\n let route = meta.route;\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),\n route\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/utils/generate-path\n */\n\n\nfunction generatePath(originalPath, params) {\n if (params === void 0) {\n params = {};\n }\n\n let path = originalPath;\n\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(false, \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n path = path.replace(/\\*$/, \"/*\");\n }\n\n return path.replace(/^:(\\w+)(\\??)/g, (_, key, optional) => {\n let param = params[key];\n\n if (optional === \"?\") {\n return param == null ? \"\" : param;\n }\n\n if (param == null) {\n invariant(false, \"Missing \\\":\" + key + \"\\\" param\");\n }\n\n return param;\n }).replace(/\\/:(\\w+)(\\??)/g, (_, key, optional) => {\n let param = params[key];\n\n if (optional === \"?\") {\n return param == null ? \"\" : \"/\" + param;\n }\n\n if (param == null) {\n invariant(false, \"Missing \\\":\" + key + \"\\\" param\");\n }\n\n return \"/\" + param;\n }) // Remove any optional markers from optional static segments\n .replace(/\\?/g, \"\").replace(/(\\/?)\\*/, (_, prefix, __, str) => {\n const star = \"*\";\n\n if (params[star] == null) {\n // If no splat was provided, trim the trailing slash _unless_ it's\n // the entire path\n return str === \"/*\" ? \"/\" : \"\";\n } // Apply the splat\n\n\n return \"\" + prefix + params[star];\n });\n}\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/utils/match-path\n */\n\nfunction matchPath(pattern, pathname) {\n if (typeof pattern === \"string\") {\n pattern = {\n path: pattern,\n caseSensitive: false,\n end: true\n };\n }\n\n let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);\n let match = pathname.match(matcher);\n if (!match) return null;\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params = paramNames.reduce((memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || \"\", paramName);\n return memo;\n }, {});\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern\n };\n}\n\nfunction compilePath(path, caseSensitive, end) {\n if (caseSensitive === void 0) {\n caseSensitive = false;\n }\n\n if (end === void 0) {\n end = true;\n }\n\n warning(path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"), \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n let paramNames = [];\n let regexpSource = \"^\" + path.replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:(\\w+)/g, (_, paramName) => {\n paramNames.push(paramName);\n return \"/([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource += path === \"*\" || path === \"/*\" ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else ;\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURI(value) {\n try {\n return decodeURI(value);\n } catch (error) {\n warning(false, \"The URL path \\\"\" + value + \"\\\" could not be decoded because it is is a \" + \"malformed URL segment. This is probably due to a bad percent \" + (\"encoding (\" + error + \").\"));\n return value;\n }\n}\n\nfunction safelyDecodeURIComponent(value, paramName) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(false, \"The value for the URL param \\\"\" + paramName + \"\\\" will not be decoded because\" + (\" the string \\\"\" + value + \"\\\" is a malformed URL segment. This is probably\") + (\" due to a bad percent encoding (\" + error + \").\"));\n return value;\n }\n}\n/**\n * @private\n */\n\n\nfunction stripBasename(pathname, basename) {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n } // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n\n\n let startIndex = basename.endsWith(\"/\") ? basename.length - 1 : basename.length;\n let nextChar = pathname.charAt(startIndex);\n\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(startIndex) || \"/\";\n}\n/**\n * @private\n */\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging @remix-run/router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/utils/resolve-path\n */\n\nfunction resolvePath(to, fromPathname) {\n if (fromPathname === void 0) {\n fromPathname = \"/\";\n }\n\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\"\n } = typeof to === \"string\" ? parsePath(to) : to;\n let pathname = toPathname ? toPathname.startsWith(\"/\") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash)\n };\n}\n\nfunction resolvePathname(relativePath, fromPathname) {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n relativeSegments.forEach(segment => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nfunction getInvalidPathError(char, field, dest, path) {\n return \"Cannot include a '\" + char + \"' character in a manually specified \" + (\"`to.\" + field + \"` field [\" + JSON.stringify(path) + \"]. Please separate it out to the \") + (\"`to.\" + dest + \"` field. Alternatively you may provide the full path as \") + \"a string in and the router will parse it for you.\";\n}\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * \n * \n * \n *\n * \n * \n * }> // <-- Does not contribute\n * // <-- Does not contribute\n * \n * \n */\n\n\nfunction getPathContributingMatches(matches) {\n return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);\n}\n/**\n * @private\n */\n\nfunction resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {\n if (isPathRelative === void 0) {\n isPathRelative = false;\n }\n\n let to;\n\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = _extends({}, toArg);\n invariant(!to.pathname || !to.pathname.includes(\"?\"), getInvalidPathError(\"?\", \"pathname\", \"search\", to));\n invariant(!to.pathname || !to.pathname.includes(\"#\"), getInvalidPathError(\"#\", \"pathname\", \"hash\", to));\n invariant(!to.search || !to.search.includes(\"#\"), getInvalidPathError(\"#\", \"search\", \"hash\", to));\n }\n\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n let from; // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n\n if (isPathRelative || toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\"); // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n } // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n\n\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original \"to\" had one\n\n let hasExplicitTrailingSlash = toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\"); // Or if this was a link to the current path which has a trailing slash\n\n let hasCurrentTrailingSlash = (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n\n if (!path.pathname.endsWith(\"/\") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n/**\n * @private\n */\n\nfunction getToPathname(to) {\n // Empty strings should be treated the same as / paths\n return to === \"\" || to.pathname === \"\" ? \"/\" : typeof to === \"string\" ? parsePath(to).pathname : to.pathname;\n}\n/**\n * @private\n */\n\nconst joinPaths = paths => paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n/**\n * @private\n */\n\nconst normalizePathname = pathname => pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n/**\n * @private\n */\n\nconst normalizeSearch = search => !search || search === \"?\" ? \"\" : search.startsWith(\"?\") ? search : \"?\" + search;\n/**\n * @private\n */\n\nconst normalizeHash = hash => !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n */\n\nconst json = function json(data, init) {\n if (init === void 0) {\n init = {};\n }\n\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n let headers = new Headers(responseInit.headers);\n\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n\n return new Response(JSON.stringify(data), _extends({}, responseInit, {\n headers\n }));\n};\nclass AbortedDeferredError extends Error {}\nclass DeferredData {\n constructor(data, responseInit) {\n this.pendingKeysSet = new Set();\n this.subscribers = new Set();\n this.deferredKeys = [];\n invariant(data && typeof data === \"object\" && !Array.isArray(data), \"defer() only accepts plain objects\"); // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n\n let reject;\n this.abortPromise = new Promise((_, r) => reject = r);\n this.controller = new AbortController();\n\n let onAbort = () => reject(new AbortedDeferredError(\"Deferred data aborted\"));\n\n this.unlistenAbortSignal = () => this.controller.signal.removeEventListener(\"abort\", onAbort);\n\n this.controller.signal.addEventListener(\"abort\", onAbort);\n this.data = Object.entries(data).reduce((acc, _ref) => {\n let [key, value] = _ref;\n return Object.assign(acc, {\n [key]: this.trackPromise(key, value)\n });\n }, {});\n\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n\n this.init = responseInit;\n }\n\n trackPromise(key, value) {\n if (!(value instanceof Promise)) {\n return value;\n }\n\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key); // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n\n let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, null, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n\n promise.catch(() => {});\n Object.defineProperty(promise, \"_tracked\", {\n get: () => true\n });\n return promise;\n }\n\n onSettle(promise, key, error, data) {\n if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n return Promise.reject(error);\n }\n\n this.pendingKeysSet.delete(key);\n\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n\n if (error) {\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n this.emit(false, key);\n return Promise.reject(error);\n }\n\n Object.defineProperty(promise, \"_data\", {\n get: () => data\n });\n this.emit(false, key);\n return data;\n }\n\n emit(aborted, settledKey) {\n this.subscribers.forEach(subscriber => subscriber(aborted, settledKey));\n }\n\n subscribe(fn) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n\n async resolveData(signal) {\n let aborted = false;\n\n if (!this.done) {\n let onAbort = () => this.cancel();\n\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise(resolve => {\n this.subscribe(aborted => {\n signal.removeEventListener(\"abort\", onAbort);\n\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n\n return aborted;\n }\n\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n\n get unwrappedData() {\n invariant(this.data !== null && this.done, \"Can only unwrap data on initialized and settled deferreds\");\n return Object.entries(this.data).reduce((acc, _ref2) => {\n let [key, value] = _ref2;\n return Object.assign(acc, {\n [key]: unwrapTrackedPromise(value)\n });\n }, {});\n }\n\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n\n}\n\nfunction isTrackedPromise(value) {\n return value instanceof Promise && value._tracked === true;\n}\n\nfunction unwrapTrackedPromise(value) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n\n if (value._error) {\n throw value._error;\n }\n\n return value._data;\n}\n\nconst defer = function defer(data, init) {\n if (init === void 0) {\n init = {};\n }\n\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n return new DeferredData(data, responseInit);\n};\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\n\nconst redirect = function redirect(url, init) {\n if (init === void 0) {\n init = 302;\n }\n\n let responseInit = init;\n\n if (typeof responseInit === \"number\") {\n responseInit = {\n status: responseInit\n };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n return new Response(null, _extends({}, responseInit, {\n headers\n }));\n};\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n */\n\nclass ErrorResponse {\n constructor(status, statusText, data, internal) {\n if (internal === void 0) {\n internal = false;\n }\n\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n\n}\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\n\nfunction isRouteErrorResponse(error) {\n return error != null && typeof error.status === \"number\" && typeof error.statusText === \"string\" && typeof error.internal === \"boolean\" && \"data\" in error;\n}\n\nconst validMutationMethodsArr = [\"post\", \"put\", \"patch\", \"delete\"];\nconst validMutationMethods = new Set(validMutationMethodsArr);\nconst validRequestMethodsArr = [\"get\", ...validMutationMethodsArr];\nconst validRequestMethods = new Set(validRequestMethodsArr);\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\nconst IDLE_NAVIGATION = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n};\nconst IDLE_FETCHER = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n};\nconst IDLE_BLOCKER = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined\n};\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\nconst isServer = !isBrowser; //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a router and listen to history POP navigations\n */\n\nfunction createRouter(init) {\n invariant(init.routes.length > 0, \"You must provide a non-empty routes array to createRouter\");\n let dataRoutes = convertRoutesToDataRoutes(init.routes); // Cleanup function for history\n\n let unlistenHistory = null; // Externally-provided functions to call on all state changes\n\n let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing\n\n let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys\n\n let getScrollRestorationKey = null; // Externally-provided function to get current scroll position\n\n let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n\n let initialScrollRestored = init.hydrationData != null;\n let initialMatches = matchRoutes(dataRoutes, init.history.location, init.basename);\n let initialErrors = null;\n\n if (initialMatches == null) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname\n });\n let {\n matches,\n route\n } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = {\n [route.id]: error\n };\n }\n\n let initialized = !initialMatches.some(m => m.route.loader) || init.hydrationData != null;\n let router;\n let state = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: init.hydrationData && init.hydrationData.loaderData || {},\n actionData: init.hydrationData && init.hydrationData.actionData || null,\n errors: init.hydrationData && init.hydrationData.errors || initialErrors,\n fetchers: new Map(),\n blockers: new Map()\n }; // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n\n let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n\n let pendingPreventScrollReset = false; // AbortController for the active navigation\n\n let pendingNavigationController; // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n\n let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidate()\n // - X-Remix-Revalidate (from redirect)\n\n let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n\n let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n\n let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers\n\n let fetchControllers = new Map(); // Track loads based on the order in which they started\n\n let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n\n let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions\n\n let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations from their actions\n\n let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers\n\n let fetchLoadMatches = new Map(); // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n\n let activeDeferreds = new Map(); // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n\n let blockerFunctions = new Map(); // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n\n let ignoreNextHistoryUpdate = false; // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(_ref => {\n let {\n action: historyAction,\n location,\n delta\n } = _ref;\n\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (ignoreNextHistoryUpdate) {\n ignoreNextHistoryUpdate = false;\n return;\n }\n\n warning(blockerFunctions.size === 0 || delta != null, \"You are trying to use a blocker on a POP navigation to a location \" + \"that was not created by @remix-run/router. This will fail silently in \" + \"production. This can happen if you are navigating outside the router \" + \"via `window.history.pushState`/`window.location.hash` instead of using \" + \"router navigation APIs. This can also happen if you are using \" + \"createHashRouter and the user manually changes the URL.\");\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction\n });\n\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n ignoreNextHistoryUpdate = true;\n init.history.go(delta * -1); // Put the blocker into a blocked state\n\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location\n }); // Re-do the same POP navigation we just blocked\n\n init.history.go(delta);\n },\n\n reset() {\n deleteBlocker(blockerKey);\n updateState({\n blockers: new Map(router.state.blockers)\n });\n }\n\n });\n return;\n }\n\n return startNavigation(historyAction, location);\n }); // Kick off initial data load if needed. Use Pop to avoid modifying history\n\n if (!state.initialized) {\n startNavigation(Action.Pop, state.location);\n }\n\n return router;\n } // Clean up a router and it's side effects\n\n\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n } // Subscribe to state updates for the router\n\n\n function subscribe(fn) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n } // Update our state and notify the calling context of the change\n\n\n function updateState(newState) {\n state = _extends({}, state, newState);\n subscribers.forEach(subscriber => subscriber(state));\n } // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n\n\n function completeNavigation(location, newState) {\n var _location$state, _location$state2;\n\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === \"loading\" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;\n let actionData;\n\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n } // Always preserve any existing loaderData from re-used routes\n\n\n let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData; // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n\n for (let [key] of blockerFunctions) {\n deleteBlocker(key);\n } // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n\n\n let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true;\n updateState(_extends({}, newState, {\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches),\n preventScrollReset,\n blockers: new Map(state.blockers)\n }));\n\n if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === Action.Replace) {\n init.history.replace(location, location.state);\n } // Reset stateful navigation vars\n\n\n pendingAction = Action.Pop;\n pendingPreventScrollReset = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n cancelledFetcherLoads = [];\n } // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n\n\n async function navigate(to, opts) {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n\n let {\n path,\n submission,\n error\n } = normalizeNavigateOptions(to, opts);\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state); // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n\n nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation));\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n let historyAction = Action.Push;\n\n if (userReplace === true) {\n historyAction = Action.Replace;\n } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = Action.Replace;\n }\n\n let preventScrollReset = opts && \"preventScrollReset\" in opts ? opts.preventScrollReset === true : undefined;\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction\n });\n\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation\n }); // Send the same navigation through\n\n navigate(to, opts);\n },\n\n reset() {\n deleteBlocker(blockerKey);\n updateState({\n blockers: new Map(state.blockers)\n });\n }\n\n });\n return;\n }\n\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace\n });\n } // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n\n\n function revalidate() {\n interruptActiveLoads();\n updateState({\n revalidation: \"loading\"\n }); // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n\n if (state.navigation.state === \"submitting\") {\n return;\n } // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n\n\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true\n });\n return;\n } // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n\n\n startNavigation(pendingAction || state.historyAction, state.navigation.location, {\n overrideNavigation: state.navigation\n });\n } // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n\n\n async function startNavigation(historyAction, location, opts) {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = matchRoutes(dataRoutes, location, init.basename); // Short circuit with a 404 on the root error boundary if we match nothing\n\n if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(dataRoutes); // Cancel all pending deferred on 404s since we don't keep any routes\n\n cancelActiveDeferreds();\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n });\n return;\n } // Short circuit if it's only a hash change and not a mutation submission\n // For example, on /page#hash and submit a
which will\n // default to a navigation to /page\n\n\n if (isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {\n completeNavigation(location, {\n matches\n });\n return;\n } // Create a controller/Request for this navigation\n\n\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);\n let pendingActionData;\n let pendingError;\n\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingError = {\n [findNearestBoundary(matches).route.id]: opts.pendingError\n };\n } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {\n // Call action if we received an action submission\n let actionOutput = await handleAction(request, location, opts.submission, matches, {\n replace: opts.replace\n });\n\n if (actionOutput.shortCircuited) {\n return;\n }\n\n pendingActionData = actionOutput.pendingActionData;\n pendingError = actionOutput.pendingActionError;\n\n let navigation = _extends({\n state: \"loading\",\n location\n }, opts.submission);\n\n loadingNavigation = navigation; // Create a GET request for the loaders\n\n request = new Request(request.url, {\n signal: request.signal\n });\n } // Call loaders\n\n\n let {\n shortCircuited,\n loaderData,\n errors\n } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.replace, pendingActionData, pendingError);\n\n if (shortCircuited) {\n return;\n } // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n\n\n pendingNavigationController = null;\n completeNavigation(location, _extends({\n matches\n }, pendingActionData ? {\n actionData: pendingActionData\n } : {}, {\n loaderData,\n errors\n }));\n } // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n\n\n async function handleAction(request, location, submission, matches, opts) {\n interruptActiveLoads(); // Put us in a submitting state\n\n let navigation = _extends({\n state: \"submitting\",\n location\n }, submission);\n\n updateState({\n navigation\n }); // Call our action and get the result\n\n let result;\n let actionMatch = getTargetMatch(matches, location);\n\n if (!actionMatch.route.action) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id\n })\n };\n } else {\n result = await callLoaderOrAction(\"action\", request, actionMatch, matches, router.basename);\n\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n }\n }\n\n if (isRedirectResult(result)) {\n let replace;\n\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n replace = result.location === state.location.pathname + state.location.search;\n }\n\n await startRedirectNavigation(state, result, {\n submission,\n replace\n });\n return {\n shortCircuited: true\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the\n // action threw an error that'll be rendered in an errorElement, we fall\n // back to PUSH so that the user can use the back button to get back to\n // the pre-submission form location to try again\n\n if ((opts && opts.replace) !== true) {\n pendingAction = Action.Push;\n }\n\n return {\n // Send back an empty object we can use to clear out any prior actionData\n pendingActionData: {},\n pendingActionError: {\n [boundaryMatch.route.id]: result.error\n }\n };\n }\n\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, {\n type: \"defer-action\"\n });\n }\n\n return {\n pendingActionData: {\n [actionMatch.route.id]: result.data\n }\n };\n } // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n\n\n async function handleLoaders(request, location, matches, overrideNavigation, submission, replace, pendingActionData, pendingError) {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation = overrideNavigation;\n\n if (!loadingNavigation) {\n let navigation = _extends({\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n }, submission);\n\n loadingNavigation = navigation;\n } // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n\n\n let activeSubmission = submission ? submission : loadingNavigation.formMethod && loadingNavigation.formAction && loadingNavigation.formData && loadingNavigation.formEncType ? {\n formMethod: loadingNavigation.formMethod,\n formAction: loadingNavigation.formAction,\n formData: loadingNavigation.formData,\n formEncType: loadingNavigation.formEncType\n } : undefined;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches); // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n\n cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); // Short circuit if we have no loaders to run\n\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n completeNavigation(location, _extends({\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingError || null\n }, pendingActionData ? {\n actionData: pendingActionData\n } : {}));\n return {\n shortCircuited: true\n };\n } // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n\n\n if (!isUninterruptedRevalidation) {\n revalidatingFetchers.forEach(rf => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher = {\n state: \"loading\",\n data: fetcher && fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n let actionData = pendingActionData || state.actionData;\n updateState(_extends({\n navigation: loadingNavigation\n }, actionData ? Object.keys(actionData).length === 0 ? {\n actionData: null\n } : {\n actionData\n } : {}, revalidatingFetchers.length > 0 ? {\n fetchers: new Map(state.fetchers)\n } : {}));\n }\n\n pendingNavigationLoadId = ++incrementingLoadId;\n revalidatingFetchers.forEach(rf => fetchControllers.set(rf.key, pendingNavigationController));\n let {\n results,\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request);\n\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n } // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n\n\n revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key)); // If any loaders returned a redirect Response, start a new REPLACE navigation\n\n let redirect = findRedirect(results);\n\n if (redirect) {\n await startRedirectNavigation(state, redirect, {\n replace\n });\n return {\n shortCircuited: true\n };\n } // Process and commit output from loaders\n\n\n let {\n loaderData,\n errors\n } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle\n\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe(aborted => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n return _extends({\n loaderData,\n errors\n }, didAbortFetchLoads || revalidatingFetchers.length > 0 ? {\n fetchers: new Map(state.fetchers)\n } : {});\n }\n\n function getFetcher(key) {\n return state.fetchers.get(key) || IDLE_FETCHER;\n } // Trigger a fetcher load/submit for the given fetcher key\n\n\n function fetch(key, routeId, href, opts) {\n if (isServer) {\n throw new Error(\"router.fetch() was called during the server render, but it shouldn't be. \" + \"You are likely calling a useFetcher() method in the body of your component. \" + \"Try moving it to a useEffect or a callback.\");\n }\n\n if (fetchControllers.has(key)) abortFetcher(key);\n let matches = matchRoutes(dataRoutes, href, init.basename);\n\n if (!matches) {\n setFetcherError(key, routeId, getInternalRouterError(404, {\n pathname: href\n }));\n return;\n }\n\n let {\n path,\n submission\n } = normalizeNavigateOptions(href, opts, true);\n let match = getTargetMatch(matches, path);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, submission);\n return;\n } // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n\n\n fetchLoadMatches.set(key, {\n routeId,\n path,\n match,\n matches\n });\n handleFetcherLoader(key, routeId, path, match, matches, submission);\n } // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n\n\n async function handleFetcherAction(key, routeId, path, match, requestMatches, submission) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n\n if (!match.route.action) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId\n });\n setFetcherError(key, routeId, error);\n return;\n } // Put this fetcher into it's submitting state\n\n\n let existingFetcher = state.fetchers.get(key);\n\n let fetcher = _extends({\n state: \"submitting\"\n }, submission, {\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, fetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }); // Call the action for the fetcher\n\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);\n fetchControllers.set(key, abortController);\n let actionResult = await callLoaderOrAction(\"action\", fetchRequest, match, requestMatches, router.basename);\n\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n return;\n }\n\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n fetchRedirectIds.add(key);\n\n let loadingFetcher = _extends({\n state: \"loading\"\n }, submission, {\n data: undefined,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadingFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n });\n return startRedirectNavigation(state, actionResult, {\n isFetchActionRedirect: true\n });\n } // Process any non-redirect errors thrown\n\n\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, {\n type: \"defer-action\"\n });\n } // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n\n\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);\n let matches = state.navigation.state !== \"idle\" ? matchRoutes(dataRoutes, state.navigation.location, init.basename) : state.matches;\n invariant(matches, \"Didn't find any matches after fetcher action\");\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n\n let loadFetcher = _extends({\n state: \"loading\",\n data: actionResult.data\n }, submission, {\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadFetcher);\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, {\n [match.route.id]: actionResult.data\n }, undefined, // No need to send through errors since we short circuit above\n fetchLoadMatches); // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n\n revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher = {\n state: \"loading\",\n data: existingFetcher && existingFetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(staleKey, revalidatingFetcher);\n fetchControllers.set(staleKey, abortController);\n });\n updateState({\n fetchers: new Map(state.fetchers)\n });\n let {\n results,\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);\n\n if (abortController.signal.aborted) {\n return;\n }\n\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach(r => fetchControllers.delete(r.key));\n let redirect = findRedirect(results);\n\n if (redirect) {\n return startRedirectNavigation(state, redirect);\n } // Process and commit output from loaders\n\n\n let {\n loaderData,\n errors\n } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);\n let doneFetcher = {\n state: \"idle\",\n data: actionResult.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n let didAbortFetchLoads = abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n\n if (state.navigation.state === \"loading\" && loadId > pendingNavigationLoadId) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers)\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState(_extends({\n errors,\n loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors)\n }, didAbortFetchLoads ? {\n fetchers: new Map(state.fetchers)\n } : {}));\n isRevalidationRequired = false;\n }\n } // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n\n\n async function handleFetcherLoader(key, routeId, path, match, matches, submission) {\n let existingFetcher = state.fetchers.get(key); // Put this fetcher into it's loading state\n\n let loadingFetcher = _extends({\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined\n }, submission, {\n data: existingFetcher && existingFetcher.data,\n \" _hasFetcherDoneAnything \": true\n });\n\n state.fetchers.set(key, loadingFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }); // Call the loader for this fetcher route match\n\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);\n fetchControllers.set(key, abortController);\n let result = await callLoaderOrAction(\"loader\", fetchRequest, match, matches, router.basename); // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n\n if (isDeferredResult(result)) {\n result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;\n } // We can delete this so long as we weren't aborted by ou our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n\n\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n\n if (fetchRequest.signal.aborted) {\n return;\n } // If the loader threw a redirect Response, start a new REPLACE navigation\n\n\n if (isRedirectResult(result)) {\n await startRedirectNavigation(state, result);\n return;\n } // Process any non-redirect errors thrown\n\n\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n state.fetchers.delete(key); // TODO: In remix, this would reset to IDLE_NAVIGATION if it was a catch -\n // do we need to behave any differently with our non-redirect errors?\n // What if it was a non-redirect Response?\n\n updateState({\n fetchers: new Map(state.fetchers),\n errors: {\n [boundaryMatch.route.id]: result.error\n }\n });\n return;\n }\n\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\"); // Put the fetcher back into an idle state\n\n let doneFetcher = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n });\n }\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n\n\n async function startRedirectNavigation(state, redirect, _temp) {\n var _window;\n\n let {\n submission,\n replace,\n isFetchActionRedirect\n } = _temp === void 0 ? {} : _temp;\n\n if (redirect.revalidate) {\n isRevalidationRequired = true;\n }\n\n let redirectLocation = createLocation(state.location, redirect.location, // TODO: This can be removed once we get rid of useTransition in Remix v2\n _extends({\n _isRedirect: true\n }, isFetchActionRedirect ? {\n _isFetchActionRedirect: true\n } : {}));\n invariant(redirectLocation, \"Expected a location on the redirect navigation\"); // Check if this an absolute external redirect that goes to a new origin\n\n if (ABSOLUTE_URL_REGEX.test(redirect.location) && isBrowser && typeof ((_window = window) == null ? void 0 : _window.location) !== \"undefined\") {\n let newOrigin = init.history.createURL(redirect.location).origin;\n\n if (window.location.origin !== newOrigin) {\n if (replace) {\n window.location.replace(redirect.location);\n } else {\n window.location.assign(redirect.location);\n }\n\n return;\n }\n } // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n\n\n pendingNavigationController = null;\n let redirectHistoryAction = replace === true ? Action.Replace : Action.Push; // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n\n let {\n formMethod,\n formAction,\n formEncType,\n formData\n } = state.navigation;\n\n if (!submission && formMethod && formAction && formData && formEncType) {\n submission = {\n formMethod,\n formAction,\n formEncType,\n formData\n };\n } // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n\n\n if (redirectPreserveMethodStatusCodes.has(redirect.status) && submission && isMutationMethod(submission.formMethod)) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: _extends({}, submission, {\n formAction: redirect.location\n }),\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset\n });\n } else {\n // Otherwise, we kick off a new loading navigation, preserving the\n // submission info for the duration of this navigation\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation: {\n state: \"loading\",\n location: redirectLocation,\n formMethod: submission ? submission.formMethod : undefined,\n formAction: submission ? submission.formAction : undefined,\n formEncType: submission ? submission.formEncType : undefined,\n formData: submission ? submission.formData : undefined\n },\n // Preserve this flag across redirects\n preventScrollReset: pendingPreventScrollReset\n });\n }\n }\n\n async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) {\n // Call all navigation loaders and revalidating fetcher loaders in parallel,\n // then slice off the results into separate arrays so we can handle them\n // accordingly\n let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction(\"loader\", request, match, matches, router.basename)), ...fetchersToLoad.map(f => callLoaderOrAction(\"loader\", createClientSideRequest(init.history, f.path, request.signal), f.match, f.matches, router.basename))]);\n let loaderResults = results.slice(0, matchesToLoad.length);\n let fetcherResults = results.slice(matchesToLoad.length);\n await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, request.signal, false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(f => f.match), fetcherResults, request.signal, true)]);\n return {\n results,\n loaderResults,\n fetcherResults\n };\n }\n\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n\n cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads\n\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.push(key);\n abortFetcher(key);\n }\n });\n }\n\n function setFetcherError(key, routeId, error) {\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error\n },\n fetchers: new Map(state.fetchers)\n });\n }\n\n function deleteFetcher(key) {\n if (fetchControllers.has(key)) abortFetcher(key);\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n state.fetchers.delete(key);\n }\n\n function abortFetcher(key) {\n let controller = fetchControllers.get(key);\n invariant(controller, \"Expected fetch controller: \" + key);\n controller.abort();\n fetchControllers.delete(key);\n }\n\n function markFetchersDone(keys) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = {\n state: \"idle\",\n data: fetcher.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n function markFetchRedirectsDone() {\n let doneKeys = [];\n\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n }\n }\n\n markFetchersDone(doneKeys);\n }\n\n function abortStaleFetchLoads(landedId) {\n let yeetedKeys = [];\n\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n\n function getBlocker(key, fn) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n\n return blocker;\n }\n\n function deleteBlocker(key) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n } // Utility function to update blockers, ensuring valid state transitions\n\n\n function updateBlocker(key, newBlocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER; // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n\n invariant(blocker.state === \"unblocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"proceeding\" || blocker.state === \"blocked\" && newBlocker.state === \"unblocked\" || blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\", \"Invalid blocker state transition: \" + blocker.state + \" -> \" + newBlocker.state);\n state.blockers.set(key, newBlocker);\n updateState({\n blockers: new Map(state.blockers)\n });\n }\n\n function shouldBlockNavigation(_ref2) {\n let {\n currentLocation,\n nextLocation,\n historyAction\n } = _ref2;\n\n if (blockerFunctions.size === 0) {\n return;\n } // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n\n\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n } // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n\n\n if (blockerFunction({\n currentLocation,\n nextLocation,\n historyAction\n })) {\n return blockerKey;\n }\n }\n\n function cancelActiveDeferreds(predicate) {\n let cancelledRouteIds = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n } // Opt in to capturing and reporting scroll positions during navigations,\n // used by the component\n\n\n function enableScrollRestoration(positions, getPosition, getKey) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n\n getScrollRestorationKey = getKey || (location => location.key); // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered \n // and therefore have no savedScrollPositions available\n\n\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n\n if (y != null) {\n updateState({\n restoreScrollPosition: y\n });\n }\n }\n\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n\n function saveScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n\n function getSavedScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollRestorationKey && getScrollPosition) {\n let userMatches = matches.map(m => createUseMatchesMatch(m, state.loaderData));\n let key = getScrollRestorationKey(location, userMatches) || location.key;\n let y = savedScrollPositions[key];\n\n if (typeof y === \"number\") {\n return y;\n }\n }\n\n return null;\n }\n\n router = {\n get basename() {\n return init.basename;\n },\n\n get state() {\n return state;\n },\n\n get routes() {\n return dataRoutes;\n },\n\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: to => init.history.createHref(to),\n encodeLocation: to => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher,\n dispose,\n getBlocker,\n deleteBlocker,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds\n };\n return router;\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\n\nconst UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\nfunction createStaticHandler(routes, opts) {\n invariant(routes.length > 0, \"You must provide a non-empty routes array to createStaticHandler\");\n let dataRoutes = convertRoutesToDataRoutes(routes);\n let basename = (opts ? opts.basename : null) || \"/\";\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n */\n\n async function query(request, _temp2) {\n let {\n requestContext\n } = _temp2 === void 0 ? {} : _temp2;\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't\n\n if (!isValidMethod(method) && method !== \"head\") {\n let error = getInternalRouterError(405, {\n method\n });\n let {\n matches: methodNotAllowedMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n }\n\n let result = await queryImpl(request, location, matches, requestContext);\n\n if (isResponse(result)) {\n return result;\n } // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n\n\n return _extends({\n location,\n basename\n }, result);\n }\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n */\n\n\n async function queryRoute(request, _temp3) {\n let {\n routeId,\n requestContext\n } = _temp3 === void 0 ? {} : _temp3;\n let url = new URL(request.url);\n let method = request.method.toLowerCase();\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't\n\n if (!isValidMethod(method) && method !== \"head\" && method !== \"options\") {\n throw getInternalRouterError(405, {\n method\n });\n } else if (!matches) {\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n\n let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location);\n\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n\n let result = await queryImpl(request, location, matches, requestContext, match);\n\n if (isResponse(result)) {\n return result;\n }\n\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n } // Pick off the right state value to return\n\n\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n\n if (result.loaderData) {\n var _result$activeDeferre;\n\n let data = Object.values(result.loaderData)[0];\n\n if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n\n return data;\n }\n\n return undefined;\n }\n\n async function queryImpl(request, location, matches, requestContext, routeMatch) {\n invariant(request.signal, \"query()/queryRoute() requests must contain an AbortController signal\");\n\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, routeMatch != null);\n return result;\n }\n\n let result = await loadRouteData(request, matches, requestContext, routeMatch);\n return isResponse(result) ? result : _extends({}, result, {\n actionData: null,\n actionHeaders: {}\n });\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction, we throw\n // it to bail out and then return or throw here based on whether the user\n // returned or threw\n if (isQueryRouteResponse(e)) {\n if (e.type === ResultType.error && !isRedirectResponse(e.response)) {\n throw e.response;\n }\n\n return e.response;\n } // Redirects are always returned since they don't propagate to catch\n // boundaries\n\n\n if (isRedirectResponse(e)) {\n return e;\n }\n\n throw e;\n }\n }\n\n async function submit(request, matches, actionMatch, requestContext, isRouteRequest) {\n let result;\n\n if (!actionMatch.route.action) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id\n });\n\n if (isRouteRequest) {\n throw error;\n }\n\n result = {\n type: ResultType.error,\n error\n };\n } else {\n result = await callLoaderOrAction(\"action\", request, actionMatch, matches, basename, true, isRouteRequest, requestContext);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted\");\n }\n }\n\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.status,\n headers: {\n Location: result.location\n }\n });\n }\n\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, {\n type: \"defer-action\"\n });\n\n if (isRouteRequest) {\n throw error;\n }\n\n result = {\n type: ResultType.error,\n error\n };\n }\n\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: {\n [actionMatch.route.id]: result.data\n },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n }\n\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(request, matches, requestContext, undefined, {\n [boundaryMatch.route.id]: result.error\n }); // action status codes take precedence over loader status codes\n\n return _extends({}, context, {\n statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500,\n actionData: null,\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n } // Create a GET request for the loaders\n\n\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal\n });\n let context = await loadRouteData(loaderRequest, matches, requestContext);\n return _extends({}, context, result.statusCode ? {\n statusCode: result.statusCode\n } : {}, {\n actionData: {\n [actionMatch.route.id]: result.data\n },\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n }\n\n async function loadRouteData(request, matches, requestContext, routeMatch, pendingActionError) {\n let isRouteRequest = routeMatch != null; // Short circuit if we have no loaders to run (queryRoute())\n\n if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader)) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch == null ? void 0 : routeMatch.route.id\n });\n }\n\n let requestMatches = routeMatch ? [routeMatch] : getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]);\n let matchesToLoad = requestMatches.filter(m => m.route.loader); // Short circuit if we have no loaders to run (query())\n\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce((acc, m) => Object.assign(acc, {\n [m.route.id]: null\n }), {}),\n errors: pendingActionError || null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null\n };\n }\n\n let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction(\"loader\", request, match, matches, basename, true, isRouteRequest, requestContext))]);\n\n if (request.signal.aborted) {\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted\");\n } // Process and commit output from loaders\n\n\n let activeDeferreds = new Map();\n let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError, activeDeferreds); // Add a null for any non-loader matches for proper revalidation on the client\n\n let executedLoaders = new Set(matchesToLoad.map(match => match.route.id));\n matches.forEach(match => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n return _extends({}, context, {\n matches,\n activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null\n });\n }\n\n return {\n dataRoutes,\n query,\n queryRoute\n };\n} //#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\n\nfunction getStaticContextFromError(routes, context, error) {\n let newContext = _extends({}, context, {\n statusCode: 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error\n }\n });\n\n return newContext;\n}\n\nfunction isSubmissionNavigation(opts) {\n return opts != null && \"formData\" in opts;\n} // Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\n\n\nfunction normalizeNavigateOptions(to, opts, isFetcher) {\n if (isFetcher === void 0) {\n isFetcher = false;\n }\n\n let path = typeof to === \"string\" ? to : createPath(to); // Return location verbatim on non-submission navigations\n\n if (!opts || !isSubmissionNavigation(opts)) {\n return {\n path\n };\n }\n\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, {\n method: opts.formMethod\n })\n };\n } // Create a Submission on non-GET navigations\n\n\n let submission;\n\n if (opts.formData) {\n submission = {\n formMethod: opts.formMethod || \"get\",\n formAction: stripHashFromPath(path),\n formEncType: opts && opts.formEncType || \"application/x-www-form-urlencoded\",\n formData: opts.formData\n };\n\n if (isMutationMethod(submission.formMethod)) {\n return {\n path,\n submission\n };\n }\n } // Flatten submission onto URLSearchParams for GET submissions\n\n\n let parsedPath = parsePath(path);\n let searchParams = convertFormDataToSearchParams(opts.formData); // Since fetcher GET submissions only run a single loader (as opposed to\n // navigation GET submissions which run all loaders), we need to preserve\n // any incoming ?index params\n\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n\n parsedPath.search = \"?\" + searchParams;\n return {\n path: createPath(parsedPath),\n submission\n };\n} // Filter out all routes below any caught error as they aren't going to\n// render so we don't need to load them\n\n\nfunction getLoaderMatchesUntilBoundary(matches, boundaryId) {\n let boundaryMatches = matches;\n\n if (boundaryId) {\n let index = matches.findIndex(m => m.route.id === boundaryId);\n\n if (index >= 0) {\n boundaryMatches = matches.slice(0, index);\n }\n }\n\n return boundaryMatches;\n}\n\nfunction getMatchesToLoad(history, state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, pendingActionData, pendingError, fetchLoadMatches) {\n let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : undefined;\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n let defaultShouldRevalidate = // Forced revalidation due to submission, useRevalidate, or X-Remix-Revalidate\n isRevalidationRequired || // Clicked the same link, resubmitted a GET form\n currentUrl.toString() === nextUrl.toString() || // Search params affect all loaders\n currentUrl.search !== nextUrl.search; // Pick navigation matches that are net-new or qualify for revalidation\n\n let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined;\n let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);\n let navigationMatches = boundaryMatches.filter((match, index) => {\n if (match.route.loader == null) {\n return false;\n } // Always call the loader on new route instances and pending defer cancellations\n\n\n if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) {\n return true;\n } // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n\n\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n return shouldRevalidateLoader(match, _extends({\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params\n }, submission, {\n actionResult,\n defaultShouldRevalidate: defaultShouldRevalidate || isNewRouteInstance(currentRouteMatch, nextRouteMatch)\n }));\n }); // Pick fetcher.loads that need to be revalidated\n\n let revalidatingFetchers = [];\n fetchLoadMatches && fetchLoadMatches.forEach((f, key) => {\n if (!matches.some(m => m.route.id === f.routeId)) {\n // This fetcher is not going to be present in the subsequent render so\n // there's no need to revalidate it\n return;\n } else if (cancelledFetcherLoads.includes(key)) {\n // This fetcher was cancelled from a prior action submission - force reload\n revalidatingFetchers.push(_extends({\n key\n }, f));\n } else {\n // Revalidating fetchers are decoupled from the route matches since they\n // hit a static href, so they _always_ check shouldRevalidate and the\n // default is strictly if a revalidation is explicitly required (action\n // submissions, useRevalidator, X-Remix-Revalidate).\n let shouldRevalidate = shouldRevalidateLoader(f.match, _extends({\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params\n }, submission, {\n actionResult,\n defaultShouldRevalidate\n }));\n\n if (shouldRevalidate) {\n revalidatingFetchers.push(_extends({\n key\n }, f));\n }\n }\n });\n return [navigationMatches, revalidatingFetchers];\n}\n\nfunction isNewLoader(currentLoaderData, currentMatch, match) {\n let isNew = // [a] -> [a, b]\n !currentMatch || // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n\n let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data\n\n return isNew || isMissingData;\n}\n\nfunction isNewRouteInstance(currentMatch, match) {\n let currentPath = currentMatch.route.path;\n return (// param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n currentPath != null && currentPath.endsWith(\"*\") && currentMatch.params[\"*\"] !== match.params[\"*\"]\n );\n}\n\nfunction shouldRevalidateLoader(loaderMatch, arg) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n\n return arg.defaultShouldRevalidate;\n}\n\nasync function callLoaderOrAction(type, request, match, matches, basename, isStaticRequest, isRouteRequest, requestContext) {\n if (basename === void 0) {\n basename = \"/\";\n }\n\n if (isStaticRequest === void 0) {\n isStaticRequest = false;\n }\n\n if (isRouteRequest === void 0) {\n isRouteRequest = false;\n }\n\n let resultType;\n let result; // Setup a promise we can race against so that abort signals short circuit\n\n let reject;\n let abortPromise = new Promise((_, r) => reject = r);\n\n let onReject = () => reject();\n\n request.signal.addEventListener(\"abort\", onReject);\n\n try {\n let handler = match.route[type];\n invariant(handler, \"Could not find the \" + type + \" to run on the \\\"\" + match.route.id + \"\\\" route\");\n result = await Promise.race([handler({\n request,\n params: match.params,\n context: requestContext\n }), abortPromise]);\n invariant(result !== undefined, \"You defined \" + (type === \"action\" ? \"an action\" : \"a loader\") + \" for route \" + (\"\\\"\" + match.route.id + \"\\\" but didn't return anything from your `\" + type + \"` \") + \"function. Please return a value or `null`.\");\n } catch (e) {\n resultType = ResultType.error;\n result = e;\n } finally {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n\n if (isResponse(result)) {\n let status = result.status; // Process redirects\n\n if (redirectStatusCodes.has(status)) {\n let location = result.headers.get(\"Location\");\n invariant(location, \"Redirects returned/thrown from loaders/actions must have a Location header\"); // Support relative routing in internal redirects\n\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n let activeMatches = matches.slice(0, matches.indexOf(match) + 1);\n let routePathnames = getPathContributingMatches(activeMatches).map(match => match.pathnameBase);\n let resolvedLocation = resolveTo(location, routePathnames, new URL(request.url).pathname);\n invariant(createPath(resolvedLocation), \"Unable to resolve redirect location: \" + location); // Prepend the basename to the redirect location if we have one\n\n if (basename) {\n let path = resolvedLocation.pathname;\n resolvedLocation.pathname = path === \"/\" ? basename : joinPaths([basename, path]);\n }\n\n location = createPath(resolvedLocation);\n } else if (!isStaticRequest) {\n // Strip off the protocol+origin for same-origin absolute redirects.\n // If this is a static reques, we can let it go back to the browser\n // as-is\n let currentUrl = new URL(request.url);\n let url = location.startsWith(\"//\") ? new URL(currentUrl.protocol + location) : new URL(location);\n\n if (url.origin === currentUrl.origin) {\n location = url.pathname + url.search + url.hash;\n }\n } // Don't process redirects in the router during static requests requests.\n // Instead, throw the Response and let the server handle it with an HTTP\n // redirect. We also update the Location header in place in this flow so\n // basename and relative routing is taken into account\n\n\n if (isStaticRequest) {\n result.headers.set(\"Location\", location);\n throw result;\n }\n\n return {\n type: ResultType.redirect,\n status,\n location,\n revalidate: result.headers.get(\"X-Remix-Revalidate\") !== null\n };\n } // For SSR single-route requests, we want to hand Responses back directly\n // without unwrapping. We do this with the QueryRouteResponse wrapper\n // interface so we can know whether it was returned or thrown\n\n\n if (isRouteRequest) {\n // eslint-disable-next-line no-throw-literal\n throw {\n type: resultType || ResultType.data,\n response: result\n };\n }\n\n let data;\n let contentType = result.headers.get(\"Content-Type\"); // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n data = await result.json();\n } else {\n data = await result.text();\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: new ErrorResponse(status, result.statusText, data),\n headers: result.headers\n };\n }\n\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers\n };\n }\n\n if (resultType === ResultType.error) {\n return {\n type: resultType,\n error: result\n };\n }\n\n if (result instanceof DeferredData) {\n return {\n type: ResultType.deferred,\n deferredData: result\n };\n }\n\n return {\n type: ResultType.data,\n data: result\n };\n} // Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\n\n\nfunction createClientSideRequest(history, location, signal, submission) {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init = {\n signal\n };\n\n if (submission && isMutationMethod(submission.formMethod)) {\n let {\n formMethod,\n formEncType,\n formData\n } = submission;\n init.method = formMethod.toUpperCase();\n init.body = formEncType === \"application/x-www-form-urlencoded\" ? convertFormDataToSearchParams(formData) : formData;\n } // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n\n\n return new Request(url, init);\n}\n\nfunction convertFormDataToSearchParams(formData) {\n let searchParams = new URLSearchParams();\n\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, value instanceof File ? value.name : value);\n }\n\n return searchParams;\n}\n\nfunction processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) {\n // Fill in loaderData/errors from our loaders\n let loaderData = {};\n let errors = null;\n let statusCode;\n let foundError = false;\n let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors\n\n results.forEach((result, index) => {\n let id = matchesToLoad[index].route.id;\n invariant(!isRedirectResult(result), \"Cannot handle redirect results in processLoaderData\");\n\n if (isErrorResult(result)) {\n // Look upwards from the matched route for the closest ancestor\n // error boundary, defaulting to the root match\n let boundaryMatch = findNearestBoundary(matches, id);\n let error = result.error; // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n\n if (pendingError) {\n error = Object.values(pendingError)[0];\n pendingError = undefined;\n }\n\n errors = errors || {}; // Prefer higher error values if lower errors bubble to the same boundary\n\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n } // Clear our any prior loaderData for the throwing route\n\n\n loaderData[id] = undefined; // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;\n }\n\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n } else {\n loaderData[id] = result.data;\n } // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n\n\n if (result.statusCode != null && result.statusCode !== 200 && !foundError) {\n statusCode = result.statusCode;\n }\n\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n }); // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n\n if (pendingError) {\n errors = pendingError;\n loaderData[Object.keys(pendingError)[0]] = undefined;\n }\n\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders\n };\n}\n\nfunction processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) {\n let {\n loaderData,\n errors\n } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers\n\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let {\n key,\n match\n } = revalidatingFetchers[index];\n invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, \"Did not find corresponding fetcher result\");\n let result = fetcherResults[index]; // Process fetcher non-redirect errors\n\n if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match.route.id);\n\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = _extends({}, errors, {\n [boundaryMatch.route.id]: result.error\n });\n }\n\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher = {\n state: \"idle\",\n data: result.data,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n \" _hasFetcherDoneAnything \": true\n };\n state.fetchers.set(key, doneFetcher);\n }\n }\n\n return {\n loaderData,\n errors\n };\n}\n\nfunction mergeLoaderData(loaderData, newLoaderData, matches, errors) {\n let mergedLoaderData = _extends({}, newLoaderData);\n\n for (let match of matches) {\n let id = match.route.id;\n\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n }\n } else if (loaderData[id] !== undefined) {\n mergedLoaderData[id] = loaderData[id];\n }\n\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n\n return mergedLoaderData;\n} // Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\n\n\nfunction findNearestBoundary(matches, routeId) {\n let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];\n return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];\n}\n\nfunction getShortCircuitMatches(routes) {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.find(r => r.index || !r.path || r.path === \"/\") || {\n id: \"__shim-error-route__\"\n };\n return {\n matches: [{\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route\n }],\n route\n };\n}\n\nfunction getInternalRouterError(status, _temp4) {\n let {\n pathname,\n routeId,\n method,\n type\n } = _temp4 === void 0 ? {} : _temp4;\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n\n if (status === 400) {\n statusText = \"Bad Request\";\n\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide a `loader` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = \"Route \\\"\" + routeId + \"\\\" does not match URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = \"No route matches URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method.toUpperCase() + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide an `action` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (method) {\n errorMessage = \"Invalid request method \\\"\" + method.toUpperCase() + \"\\\"\";\n }\n }\n\n return new ErrorResponse(status || 500, statusText, new Error(errorMessage), true);\n} // Find any returned redirect errors, starting from the lowest match\n\n\nfunction findRedirect(results) {\n for (let i = results.length - 1; i >= 0; i--) {\n let result = results[i];\n\n if (isRedirectResult(result)) {\n return result;\n }\n }\n}\n\nfunction stripHashFromPath(path) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath(_extends({}, parsedPath, {\n hash: \"\"\n }));\n}\n\nfunction isHashChangeOnly(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash !== b.hash;\n}\n\nfunction isDeferredResult(result) {\n return result.type === ResultType.deferred;\n}\n\nfunction isErrorResult(result) {\n return result.type === ResultType.error;\n}\n\nfunction isRedirectResult(result) {\n return (result && result.type) === ResultType.redirect;\n}\n\nfunction isResponse(value) {\n return value != null && typeof value.status === \"number\" && typeof value.statusText === \"string\" && typeof value.headers === \"object\" && typeof value.body !== \"undefined\";\n}\n\nfunction isRedirectResponse(result) {\n if (!isResponse(result)) {\n return false;\n }\n\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\n\nfunction isQueryRouteResponse(obj) {\n return obj && isResponse(obj.response) && (obj.type === ResultType.data || ResultType.error);\n}\n\nfunction isValidMethod(method) {\n return validRequestMethods.has(method);\n}\n\nfunction isMutationMethod(method) {\n return validMutationMethods.has(method);\n}\n\nasync function resolveDeferredResults(currentMatches, matchesToLoad, results, signal, isFetcher, currentLoaderData) {\n for (let index = 0; index < results.length; index++) {\n let result = results[index];\n let match = matchesToLoad[index];\n let currentMatch = currentMatches.find(m => m.route.id === match.route.id);\n let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n\n if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n await resolveDeferredData(result, signal, isFetcher).then(result => {\n if (result) {\n results[index] = result || results[index];\n }\n });\n }\n }\n}\n\nasync function resolveDeferredData(result, signal, unwrap) {\n if (unwrap === void 0) {\n unwrap = false;\n }\n\n let aborted = await result.deferredData.resolveData(signal);\n\n if (aborted) {\n return;\n }\n\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e\n };\n }\n }\n\n return {\n type: ResultType.data,\n data: result.deferredData.data\n };\n}\n\nfunction hasNakedIndexQuery(search) {\n return new URLSearchParams(search).getAll(\"index\").some(v => v === \"\");\n} // Note: This should match the format exported by useMatches, so if you change\n// this please also change that :) Eventually we'll DRY this up\n\n\nfunction createUseMatchesMatch(match, loaderData) {\n let {\n route,\n pathname,\n params\n } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id],\n handle: route.handle\n };\n}\n\nfunction getTargetMatch(matches, location) {\n let search = typeof location === \"string\" ? parsePath(location).search : location.search;\n\n if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || \"\")) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n } // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n\n\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n} //#endregion\n\nexport { AbortedDeferredError, Action, ErrorResponse, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, DeferredData as UNSAFE_DeferredData, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, getPathContributingMatches as UNSAFE_getPathContributingMatches, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, defer, generatePath, getStaticContextFromError, getToPathname, invariant, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, resolvePath, resolveTo, stripBasename, warning };\n//# sourceMappingURL=router.js.map\n","/**\n * React Router v6.8.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { invariant, joinPaths, matchPath, UNSAFE_getPathContributingMatches, warning, resolveTo, parsePath, matchRoutes, Action, isRouteErrorResponse, createMemoryHistory, stripBasename, AbortedDeferredError, createRouter } from '@remix-run/router';\nexport { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from '@remix-run/router';\nimport * as React from 'react';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\nfunction isPolyfill(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nconst is = typeof Object.is === \"function\" ? Object.is : isPolyfill; // Intentionally not using named imports because Rollup uses dynamic\n// dispatch for CommonJS interop named imports.\n\nconst {\n useState,\n useEffect,\n useLayoutEffect,\n useDebugValue\n} = React;\nlet didWarnOld18Alpha = false;\nlet didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!didWarnOld18Alpha) {\n if (\"startTransition\" in React) {\n didWarnOld18Alpha = true;\n console.error(\"You are using an outdated, pre-release alpha of React 18 that \" + \"does not support useSyncExternalStore. The \" + \"use-sync-external-store shim will not work correctly. Upgrade \" + \"to a newer pre-release.\");\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n const value = getSnapshot();\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!didWarnUncachedGetSnapshot) {\n const cachedValue = getSnapshot();\n\n if (!is(value, cachedValue)) {\n console.error(\"The result of getSnapshot should be cached to avoid an infinite loop\");\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n const [{\n inst\n }, forceUpdate] = useState({\n inst: {\n value,\n getSnapshot\n }\n }); // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n useLayoutEffect(() => {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [subscribe, value, getSnapshot]);\n useEffect(() => {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n }\n\n const handleStoreChange = () => {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange); // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n const latestGetSnapshot = inst.getSnapshot;\n const prevValue = inst.value;\n\n try {\n const nextValue = latestGetSnapshot();\n return !is(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\n/**\n * Inlined into the react-router repo since use-sync-external-store does not\n * provide a UMD-compatible package, so we need this to be able to distribute\n * UMD react-router bundles\n */\nconst canUseDOM = !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nconst isServerEnvironment = !canUseDOM;\nconst shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;\nconst useSyncExternalStore = \"useSyncExternalStore\" in React ? (module => module.useSyncExternalStore)(React) : shim;\n\nconst DataRouterContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterContext.displayName = \"DataRouter\";\n}\n\nconst DataRouterStateContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\n\nconst AwaitContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n AwaitContext.displayName = \"Await\";\n}\n\nconst NavigationContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n NavigationContext.displayName = \"Navigation\";\n}\n\nconst LocationContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n LocationContext.displayName = \"Location\";\n}\n\nconst RouteContext = /*#__PURE__*/React.createContext({\n outlet: null,\n matches: []\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n RouteContext.displayName = \"Route\";\n}\n\nconst RouteErrorContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n RouteErrorContext.displayName = \"RouteError\";\n}\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/hooks/use-href\n */\n\nfunction useHref(to, _temp) {\n let {\n relative\n } = _temp === void 0 ? {} : _temp;\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useHref() may be used only in the context of a component.\") : invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n hash,\n pathname,\n search\n } = useResolvedPath(to, {\n relative\n });\n let joinedPathname = pathname; // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n\n if (basename !== \"/\") {\n joinedPathname = pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({\n pathname: joinedPathname,\n search,\n hash\n });\n}\n/**\n * Returns true if this component is a descendant of a .\n *\n * @see https://reactrouter.com/hooks/use-in-router-context\n */\n\nfunction useInRouterContext() {\n return React.useContext(LocationContext) != null;\n}\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/hooks/use-location\n */\n\nfunction useLocation() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useLocation() may be used only in the context of a component.\") : invariant(false) : void 0;\n return React.useContext(LocationContext).location;\n}\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/hooks/use-navigation-type\n */\n\nfunction useNavigationType() {\n return React.useContext(LocationContext).navigationType;\n}\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * .\n *\n * @see https://reactrouter.com/hooks/use-match\n */\n\nfunction useMatch(pattern) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useMatch() may be used only in the context of a component.\") : invariant(false) : void 0;\n let {\n pathname\n } = useLocation();\n return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);\n}\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\n\n/**\n * Returns an imperative method for changing the location. Used by s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/hooks/use-navigate\n */\nfunction useNavigate() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useNavigate() may be used only in the context of a component.\") : invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));\n let activeRef = React.useRef(false);\n React.useEffect(() => {\n activeRef.current = true;\n });\n let navigate = React.useCallback(function (to, options) {\n if (options === void 0) {\n options = {};\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(activeRef.current, \"You should call navigate() in a React.useEffect(), not when \" + \"your component is first rendered.\") : void 0;\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === \"path\"); // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history. If this is a root navigation, then we\n // navigate to the raw basename which allows the basename to have full\n // control over the presence of a trailing slash on root links\n\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);\n }, [basename, navigator, routePathnamesJson, locationPathname]);\n return navigate;\n}\nconst OutletContext = /*#__PURE__*/React.createContext(null);\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/hooks/use-outlet-context\n */\n\nfunction useOutletContext() {\n return React.useContext(OutletContext);\n}\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by to render child routes.\n *\n * @see https://reactrouter.com/hooks/use-outlet\n */\n\nfunction useOutlet(context) {\n let outlet = React.useContext(RouteContext).outlet;\n\n if (outlet) {\n return /*#__PURE__*/React.createElement(OutletContext.Provider, {\n value: context\n }, outlet);\n }\n\n return outlet;\n}\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/hooks/use-params\n */\n\nfunction useParams() {\n let {\n matches\n } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? routeMatch.params : {};\n}\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/hooks/use-resolved-path\n */\n\nfunction useResolvedPath(to, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));\n return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === \"path\"), [to, routePathnamesJson, locationPathname, relative]);\n}\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an to render their child route's\n * element.\n *\n * @see https://reactrouter.com/hooks/use-routes\n */\n\nfunction useRoutes(routes, locationArg) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useRoutes() may be used only in the context of a component.\") : invariant(false) : void 0;\n let {\n navigator\n } = React.useContext(NavigationContext);\n let dataRouterStateContext = React.useContext(DataRouterStateContext);\n let {\n matches: parentMatches\n } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (process.env.NODE_ENV !== \"production\") {\n // You won't get a warning about 2 different under a \n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // \n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // } />\n // } />\n // \n //\n // function Blog() {\n // return (\n // \n // } />\n // \n // );\n // }\n let parentPath = parentRoute && parentRoute.path || \"\";\n warningOnce(parentPathname, !parentRoute || parentPath.endsWith(\"*\"), \"You rendered descendant (or called `useRoutes()`) at \" + (\"\\\"\" + parentPathname + \"\\\" (under ) but the \") + \"parent route path has no trailing \\\"*\\\". This means if you navigate \" + \"deeper, the parent won't match anymore and therefore the child \" + \"routes will never render.\\n\\n\" + (\"Please change the parent to .\"));\n }\n\n let locationFromContext = useLocation();\n let location;\n\n if (locationArg) {\n var _parsedLocationArg$pa;\n\n let parsedLocationArg = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n !(parentPathnameBase === \"/\" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"When overriding the location using `` or `useRoutes(routes, location)`, \" + \"the location pathname must begin with the portion of the URL pathname that was \" + (\"matched by all parent routes. The current pathname base is \\\"\" + parentPathnameBase + \"\\\" \") + (\"but pathname \\\"\" + parsedLocationArg.pathname + \"\\\" was given in the `location` prop.\")) : invariant(false) : void 0;\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname = parentPathnameBase === \"/\" ? pathname : pathname.slice(parentPathnameBase.length) || \"/\";\n let matches = matchRoutes(routes, {\n pathname: remainingPathname\n });\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? warning(parentRoute || matches != null, \"No routes matched location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(matches == null || matches[matches.length - 1].route.element !== undefined, \"Matched leaf route at location \\\"\" + location.pathname + location.search + location.hash + \"\\\" does not have an element. \" + \"This means it will render an with a null value by default resulting in an \\\"empty\\\" page.\") : void 0;\n }\n\n let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]),\n pathnameBase: match.pathnameBase === \"/\" ? parentPathnameBase : joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])\n })), parentMatches, dataRouterStateContext || undefined); // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n\n\n if (locationArg && renderedMatches) {\n return /*#__PURE__*/React.createElement(LocationContext.Provider, {\n value: {\n location: _extends({\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n state: null,\n key: \"default\"\n }, location),\n navigationType: Action.Pop\n }\n }, renderedMatches);\n }\n\n return renderedMatches;\n}\n\nfunction DefaultErrorElement() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error) ? error.status + \" \" + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = {\n padding: \"0.5rem\",\n backgroundColor: lightgrey\n };\n let codeStyles = {\n padding: \"2px 4px\",\n backgroundColor: lightgrey\n };\n let devInfo = null;\n\n if (process.env.NODE_ENV !== \"production\") {\n devInfo = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", null, \"\\uD83D\\uDCBF Hey developer \\uD83D\\uDC4B\"), /*#__PURE__*/React.createElement(\"p\", null, \"You can provide a way better UX than this when your app throws errors by providing your own\\xA0\", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"errorElement\"), \" props on\\xA0\", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"\")));\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"h2\", null, \"Unexpected Application Error!\"), /*#__PURE__*/React.createElement(\"h3\", {\n style: {\n fontStyle: \"italic\"\n }\n }, message), stack ? /*#__PURE__*/React.createElement(\"pre\", {\n style: preStyles\n }, stack) : null, devInfo);\n}\n\nclass RenderErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n location: props.location,\n error: props.error\n };\n }\n\n static getDerivedStateFromError(error) {\n return {\n error: error\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (state.location !== props.location) {\n return {\n error: props.error,\n location: props.location\n };\n } // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n\n\n return {\n error: props.error || state.error,\n location: state.location\n };\n }\n\n componentDidCatch(error, errorInfo) {\n console.error(\"React Router caught the following error during render\", error, errorInfo);\n }\n\n render() {\n return this.state.error ? /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: this.props.routeContext\n }, /*#__PURE__*/React.createElement(RouteErrorContext.Provider, {\n value: this.state.error,\n children: this.props.component\n })) : this.props.children;\n }\n\n}\n\nfunction RenderedRoute(_ref) {\n let {\n routeContext,\n match,\n children\n } = _ref;\n let dataRouterContext = React.useContext(DataRouterContext); // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n\n if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && match.route.errorElement) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n\n return /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: routeContext\n }, children);\n}\n\nfunction _renderMatches(matches, parentMatches, dataRouterState) {\n if (parentMatches === void 0) {\n parentMatches = [];\n }\n\n if (matches == null) {\n if (dataRouterState != null && dataRouterState.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches;\n } else {\n return null;\n }\n }\n\n let renderedMatches = matches; // If we have data errors, trim matches to the highest error boundary\n\n let errors = dataRouterState == null ? void 0 : dataRouterState.errors;\n\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));\n !(errorIndex >= 0) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find a matching route for the current errors: \" + errors) : invariant(false) : void 0;\n renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));\n }\n\n return renderedMatches.reduceRight((outlet, match, index) => {\n let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null; // Only data routers handle errors\n\n let errorElement = dataRouterState ? match.route.errorElement || /*#__PURE__*/React.createElement(DefaultErrorElement, null) : null;\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n\n let getChildren = () => /*#__PURE__*/React.createElement(RenderedRoute, {\n match: match,\n routeContext: {\n outlet,\n matches\n }\n }, error ? errorElement : match.route.element !== undefined ? match.route.element : outlet); // Only wrap in an error boundary within data router usages when we have an\n // errorElement on this route. Otherwise let it bubble up to an ancestor\n // errorElement\n\n\n return dataRouterState && (match.route.errorElement || index === 0) ? /*#__PURE__*/React.createElement(RenderErrorBoundary, {\n location: dataRouterState.location,\n component: errorElement,\n error: error,\n children: getChildren(),\n routeContext: {\n outlet: null,\n matches\n }\n }) : getChildren();\n }, null);\n}\nvar DataRouterHook;\n\n(function (DataRouterHook) {\n DataRouterHook[\"UseBlocker\"] = \"useBlocker\";\n DataRouterHook[\"UseRevalidator\"] = \"useRevalidator\";\n})(DataRouterHook || (DataRouterHook = {}));\n\nvar DataRouterStateHook;\n\n(function (DataRouterStateHook) {\n DataRouterStateHook[\"UseLoaderData\"] = \"useLoaderData\";\n DataRouterStateHook[\"UseActionData\"] = \"useActionData\";\n DataRouterStateHook[\"UseRouteError\"] = \"useRouteError\";\n DataRouterStateHook[\"UseNavigation\"] = \"useNavigation\";\n DataRouterStateHook[\"UseRouteLoaderData\"] = \"useRouteLoaderData\";\n DataRouterStateHook[\"UseMatches\"] = \"useMatches\";\n DataRouterStateHook[\"UseRevalidator\"] = \"useRevalidator\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/routers/picking-a-router.\";\n}\n\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return ctx;\n}\n\nfunction useDataRouterState(hookName) {\n let state = React.useContext(DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return state;\n}\n\nfunction useRouteContext(hookName) {\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;\n return route;\n}\n\nfunction useCurrentRouteId(hookName) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n !thisRoute.route.id ? process.env.NODE_ENV !== \"production\" ? invariant(false, hookName + \" can only be used on routes that contain a unique \\\"id\\\"\") : invariant(false) : void 0;\n return thisRoute.route.id;\n}\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\n\n\nfunction useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\n\nfunction useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return {\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation\n };\n}\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\n\nfunction useMatches() {\n let {\n matches,\n loaderData\n } = useDataRouterState(DataRouterStateHook.UseMatches);\n return React.useMemo(() => matches.map(match => {\n let {\n pathname,\n params\n } = match; // Note: This structure matches that created by createUseMatchesMatch\n // in the @remix-run/router , so if you change this please also change\n // that :) Eventually we'll DRY this up\n\n return {\n id: match.route.id,\n pathname,\n params,\n data: loaderData[match.route.id],\n handle: match.route.handle\n };\n }), [matches, loaderData]);\n}\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\n\nfunction useLoaderData() {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n\n if (state.errors && state.errors[routeId] != null) {\n console.error(\"You cannot `useLoaderData` in an errorElement (routeId: \" + routeId + \")\");\n return undefined;\n }\n\n return state.loaderData[routeId];\n}\n/**\n * Returns the loaderData for the given routeId\n */\n\nfunction useRouteLoaderData(routeId) {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n/**\n * Returns the action data for the nearest ancestor Route action\n */\n\nfunction useActionData() {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"useActionData must be used inside a RouteContext\") : invariant(false) : void 0;\n return Object.values((state == null ? void 0 : state.actionData) || {})[0];\n}\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * errorElement to display a proper error message.\n */\n\nfunction useRouteError() {\n var _state$errors;\n\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError); // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n\n if (error) {\n return error;\n } // Otherwise look for errors from our data router state\n\n\n return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];\n}\n/**\n * Returns the happy-path data from the nearest ancestor value\n */\n\nfunction useAsyncValue() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._data;\n}\n/**\n * Returns the error from the nearest ancestor value\n */\n\nfunction useAsyncError() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._error;\n}\nlet blockerId = 0;\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation. Mostly used to avoid\n * using half-filled form data. This does not handle hard-reloads or\n * cross-origin navigations.\n */\n\nfunction useBlocker(shouldBlock) {\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseBlocker);\n let [blockerKey] = React.useState(() => String(++blockerId));\n let blockerFunction = React.useCallback(args => {\n return typeof shouldBlock === \"function\" ? !!shouldBlock(args) : !!shouldBlock;\n }, [shouldBlock]);\n let blocker = router.getBlocker(blockerKey, blockerFunction); // Cleanup on unmount\n\n React.useEffect(() => () => router.deleteBlocker(blockerKey), [router, blockerKey]);\n return blocker;\n}\nconst alreadyWarned = {};\n\nfunction warningOnce(key, cond, message) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n process.env.NODE_ENV !== \"production\" ? warning(false, message) : void 0;\n }\n}\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n let {\n fallbackElement,\n router\n } = _ref;\n // Sync router state to our component state to force re-renders\n let state = useSyncExternalStore(router.subscribe, () => router.state, // We have to provide this so React@18 doesn't complain during hydration,\n // but we pass our serialized hydration data into the router so state here\n // is already synced with what the server saw\n () => router.state);\n let navigator = React.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: n => router.navigate(n),\n push: (to, state, opts) => router.navigate(to, {\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n }),\n replace: (to, state, opts) => router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\"; // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a +