1mpacto-react-ui 0.2.0-beta.18 → 0.2.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,17 +1,17 @@
1
1
  "use strict";var pI=Object.defineProperty;var mI=(e,t,n)=>t in e?pI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ce=(e,t,n)=>mI(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react/jsx-runtime"),N=require("react"),Mo=require("react-dom");function ux(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ae=ux(N),M0=ux(Mo);function Cr(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function wa(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const cx=6048e5,vI=864e5;let bI={};function _c(){return bI}function Ia(e,t){var s,l,u,c;const n=_c(),r=(t==null?void 0:t.weekStartsOn)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=Cr(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Nu(e){return Ia(e,{weekStartsOn:1})}function dx(e){const t=Cr(e),n=t.getFullYear(),r=wa(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Nu(r),a=wa(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Nu(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function zp(e){const t=Cr(e);return t.setHours(0,0,0,0),t}function Gp(e){const t=Cr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function yI(e,t){const n=zp(e),r=zp(t),i=+n-Gp(n),a=+r-Gp(r);return Math.round((i-a)/vI)}function xI(e){const t=dx(e),n=wa(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Nu(n)}function CI(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function EI(e){if(!CI(e)&&typeof e!="number")return!1;const t=Cr(e);return!isNaN(Number(t))}function SI(e){const t=Cr(e),n=wa(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const wI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},II=(e,t,n)=>{let r;const i=wI[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ir(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _I={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},DI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},TI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},AI={date:ir({formats:_I,defaultWidth:"full"}),time:ir({formats:DI,defaultWidth:"full"}),dateTime:ir({formats:TI,defaultWidth:"full"})},RI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BI=(e,t,n,r)=>RI[e];function At(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const kI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},PI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$I={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},FI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},NI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},MI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},OI=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},LI={ordinalNumber:OI,era:At({values:kI,defaultWidth:"wide"}),quarter:At({values:PI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:At({values:$I,defaultWidth:"wide"}),day:At({values:FI,defaultWidth:"wide"}),dayPeriod:At({values:NI,defaultWidth:"wide",formattingValues:MI,defaultFormattingWidth:"wide"})};function Rt(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?HI(s,p=>p.test(o)):VI(s,p=>p.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function VI(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function HI(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Dc(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const jI=/^(\d+)(th|st|nd|rd)?/i,zI=/\d+/i,GI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},WI={any:[/^b/i,/^(a|c)/i]},UI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},XI={any:[/1/i,/2/i,/3/i,/4/i]},YI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},KI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ZI={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},JI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},QI={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},e5={ordinalNumber:Dc({matchPattern:jI,parsePattern:zI,valueCallback:e=>parseInt(e,10)}),era:Rt({matchPatterns:GI,defaultMatchWidth:"wide",parsePatterns:WI,defaultParseWidth:"any"}),quarter:Rt({matchPatterns:UI,defaultMatchWidth:"wide",parsePatterns:XI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rt({matchPatterns:YI,defaultMatchWidth:"wide",parsePatterns:KI,defaultParseWidth:"any"}),day:Rt({matchPatterns:ZI,defaultMatchWidth:"wide",parsePatterns:JI,defaultParseWidth:"any"}),dayPeriod:Rt({matchPatterns:qI,defaultMatchWidth:"any",parsePatterns:QI,defaultParseWidth:"any"})},O0={code:"en-US",formatDistance:II,formatLong:AI,formatRelative:BI,localize:LI,match:e5,options:{weekStartsOn:0,firstWeekContainsDate:1}};function t5(e){const t=Cr(e);return yI(t,SI(t))+1}function n5(e){const t=Cr(e),n=+Nu(t)-+xI(t);return Math.round(n/cx)+1}function fx(e,t){var c,p,h,d;const n=Cr(e),r=n.getFullYear(),i=_c(),a=(t==null?void 0:t.firstWeekContainsDate)??((p=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(h=i.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??1,o=wa(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const s=Ia(o,t),l=wa(e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const u=Ia(l,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function r5(e,t){var s,l,u,c;const n=_c(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=fx(e,t),a=wa(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Ia(a,t)}function i5(e,t){const n=Cr(e),r=+Ia(n,t)-+r5(n,t);return Math.round(r/cx)+1}function nt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const wi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return nt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):nt(n+1,2)},d(e,t){return nt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return nt(e.getHours()%12||12,t.length)},H(e,t){return nt(e.getHours(),t.length)},m(e,t){return nt(e.getMinutes(),t.length)},s(e,t){return nt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return nt(i,t.length)}},Ua={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wp={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return wi.y(e,t)},Y:function(e,t,n,r){const i=fx(e,r),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return nt(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):nt(a,t.length)},R:function(e,t){const n=dx(e);return nt(n,t.length)},u:function(e,t){const n=e.getFullYear();return nt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return nt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return nt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return wi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return nt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=i5(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):nt(i,t.length)},I:function(e,t,n){const r=n5(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):nt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):wi.d(e,t)},D:function(e,t,n){const r=t5(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):nt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return nt(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return nt(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return nt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Ua.noon:r===0?i=Ua.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Ua.evening:r>=12?i=Ua.afternoon:r>=4?i=Ua.morning:i=Ua.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return wi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):wi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):nt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):nt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):wi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):wi.s(e,t)},S:function(e,t){return wi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Xp(r);case"XXXX":case"XX":return ua(r);case"XXXXX":case"XXX":default:return ua(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Xp(r);case"xxxx":case"xx":return ua(r);case"xxxxx":case"xxx":default:return ua(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Up(r,":");case"OOOO":default:return"GMT"+ua(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Up(r,":");case"zzzz":default:return"GMT"+ua(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return nt(r,t.length)},T:function(e,t,n){const r=e.getTime();return nt(r,t.length)}};function Up(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+nt(a,2)}function Xp(e,t){return e%60===0?(e>0?"-":"+")+nt(Math.abs(e)/60,2):ua(e,t)}function ua(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=nt(Math.trunc(r/60),2),a=nt(r%60,2);return n+i+t+a}const Yp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},a5=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Yp(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Yp(r,t)).replace("{{time}}",hx(i,t))},o5={p:hx,P:a5},s5=/^D+$/,l5=/^Y+$/,u5=["D","DD","YY","YYYY"];function c5(e){return s5.test(e)}function d5(e){return l5.test(e)}function f5(e,t,n){const r=h5(e,t,n);if(console.warn(r),u5.includes(e))throw new RangeError(r)}function h5(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const g5=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,p5=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m5=/^'([^]*?)'?$/,v5=/''/g,b5=/[a-zA-Z]/;function Ss(e,t,n){var c,p,h,d,v,m,b,f;const r=_c(),i=(n==null?void 0:n.locale)??r.locale??O0,a=(n==null?void 0:n.firstWeekContainsDate)??((p=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(h=r.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((m=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((f=(b=r.locale)==null?void 0:b.options)==null?void 0:f.weekStartsOn)??0,s=Cr(e);if(!EI(s))throw new RangeError("Invalid time value");let l=t.match(p5).map(y=>{const C=y[0];if(C==="p"||C==="P"){const S=o5[C];return S(y,i.formatLong)}return y}).join("").match(g5).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const C=y[0];if(C==="'")return{isToken:!1,value:y5(y)};if(Wp[C])return{isToken:!0,value:y};if(C.match(b5))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:y}});i.localize.preprocessor&&(l=i.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return l.map(y=>{if(!y.isToken)return y.value;const C=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&d5(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&c5(C))&&f5(C,t,String(e));const S=Wp[C[0]];return S(s,C,i.localize,u)}).join("")}function y5(e){const t=e.match(m5);return t?t[1].replace(v5,"'"):e}function x5(e,t,n){const r=Ia(e,n),i=Ia(t,n);return+r==+i}const C5={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},E5=(e,t,n)=>{let r;const i=C5[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+r:r+" yang lalu":r},S5={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},w5={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},I5={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_5={date:ir({formats:S5,defaultWidth:"full"}),time:ir({formats:w5,defaultWidth:"full"}),dateTime:ir({formats:I5,defaultWidth:"full"})},D5={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},T5=(e,t,n,r)=>D5[e],A5={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},R5={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},B5={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},k5={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},P5={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},$5={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},F5=(e,t)=>"ke-"+Number(e),N5={ordinalNumber:F5,era:At({values:A5,defaultWidth:"wide"}),quarter:At({values:R5,defaultWidth:"wide",argumentCallback:e=>e-1}),month:At({values:B5,defaultWidth:"wide"}),day:At({values:k5,defaultWidth:"wide"}),dayPeriod:At({values:P5,defaultWidth:"wide",formattingValues:$5,defaultFormattingWidth:"wide"})},M5=/^ke-(\d+)?/i,O5=/\d+/i,L5={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},V5={any:[/^s/i,/^(m|e)/i]},H5={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},j5={any:[/1/i,/2/i,/3/i,/4/i]},z5={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},G5={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},W5={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},U5={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},X5={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Y5={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},K5={ordinalNumber:Dc({matchPattern:M5,parsePattern:O5,valueCallback:e=>parseInt(e,10)}),era:Rt({matchPatterns:L5,defaultMatchWidth:"wide",parsePatterns:V5,defaultParseWidth:"any"}),quarter:Rt({matchPatterns:H5,defaultMatchWidth:"wide",parsePatterns:j5,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rt({matchPatterns:z5,defaultMatchWidth:"wide",parsePatterns:G5,defaultParseWidth:"any"}),day:Rt({matchPatterns:W5,defaultMatchWidth:"wide",parsePatterns:U5,defaultParseWidth:"any"}),dayPeriod:Rt({matchPatterns:X5,defaultMatchWidth:"any",parsePatterns:Y5,defaultParseWidth:"any"})},Mu={code:"id",formatDistance:E5,formatLong:_5,formatRelative:T5,localize:N5,match:K5,options:{weekStartsOn:1,firstWeekContainsDate:1}},Z5={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},J5=(e,t,n)=>{let r;const i=Z5[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"over "+r:r+" geleden":r},q5={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},Q5={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},e_={full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},t_={date:ir({formats:q5,defaultWidth:"full"}),time:ir({formats:Q5,defaultWidth:"full"}),dateTime:ir({formats:e_,defaultWidth:"full"})},n_={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},r_=(e,t,n,r)=>n_[e],i_={narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},a_={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},o_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},s_={narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},l_={narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},u_=(e,t)=>Number(e)+"e",c_={ordinalNumber:u_,era:At({values:i_,defaultWidth:"wide"}),quarter:At({values:a_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:At({values:o_,defaultWidth:"wide"}),day:At({values:s_,defaultWidth:"wide"}),dayPeriod:At({values:l_,defaultWidth:"wide"})},d_=/^(\d+)e?/i,f_=/\d+/i,h_={narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},g_={any:[/^v/,/^n/]},p_={narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},m_={any:[/1/i,/2/i,/3/i,/4/i]},v_={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},b_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},y_={narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},x_={narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},C_={any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},E_={any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},S_={ordinalNumber:Dc({matchPattern:d_,parsePattern:f_,valueCallback:e=>parseInt(e,10)}),era:Rt({matchPatterns:h_,defaultMatchWidth:"wide",parsePatterns:g_,defaultParseWidth:"any"}),quarter:Rt({matchPatterns:p_,defaultMatchWidth:"wide",parsePatterns:m_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rt({matchPatterns:v_,defaultMatchWidth:"wide",parsePatterns:b_,defaultParseWidth:"any"}),day:Rt({matchPatterns:y_,defaultMatchWidth:"wide",parsePatterns:x_,defaultParseWidth:"any"}),dayPeriod:Rt({matchPatterns:C_,defaultMatchWidth:"any",parsePatterns:E_,defaultParseWidth:"any"})},gx={code:"nl",formatDistance:J5,formatLong:t_,formatRelative:r_,localize:c_,match:S_,options:{weekStartsOn:1,firstWeekContainsDate:4}},w_={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},I_=(e,t,n)=>{let r;const i=w_[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},__={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},D_={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},T_={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},A_={date:ir({formats:__,defaultWidth:"full"}),time:ir({formats:D_,defaultWidth:"full"}),dateTime:ir({formats:T_,defaultWidth:"full"})};function Kp(e,t,n){const r="eeee p";return x5(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const R_={lastWeek:Kp,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Kp,other:"PP p"},B_=(e,t,n,r)=>{const i=R_[e];return typeof i=="function"?i(t,n,r):i},k_={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},P_={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},$_={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},F_={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},N_={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},M_={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},O_=(e,t)=>{const n=Number(e);switch(t==null?void 0:t.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},L_={ordinalNumber:O_,era:At({values:k_,defaultWidth:"wide"}),quarter:At({values:P_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:At({values:$_,defaultWidth:"wide"}),day:At({values:F_,defaultWidth:"wide"}),dayPeriod:At({values:N_,defaultWidth:"wide",formattingValues:M_,defaultFormattingWidth:"wide"})},V_=/^(第\s*)?\d+(日|时|分|秒)?/i,H_=/\d+/i,j_={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},z_={any:[/^(前)/i,/^(公元)/i]},G_={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},W_={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},U_={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},X_={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Y_={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},K_={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Z_={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},J_={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},q_={ordinalNumber:Dc({matchPattern:V_,parsePattern:H_,valueCallback:e=>parseInt(e,10)}),era:Rt({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:z_,defaultParseWidth:"any"}),quarter:Rt({matchPatterns:G_,defaultMatchWidth:"wide",parsePatterns:W_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rt({matchPatterns:U_,defaultMatchWidth:"wide",parsePatterns:X_,defaultParseWidth:"any"}),day:Rt({matchPatterns:Y_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any"}),dayPeriod:Rt({matchPatterns:Z_,defaultMatchWidth:"any",parsePatterns:J_,defaultParseWidth:"any"})},px={code:"zh-CN",formatDistance:I_,formatLong:A_,formatRelative:B_,localize:L_,match:q_,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Q_=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,bd=Math.ceil,Zn=Math.floor,Dn="[BigNumber Error] ",Zp=Dn+"Number primitive has more than 15 significant digits: ",cr=1e14,Pe=14,yd=9007199254740991,xd=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ii=1e7,tn=1e9;function mx(e){var t,n,r,i=y.prototype={constructor:y,toString:null,valueOf:null},a=new y(1),o=20,s=4,l=-7,u=21,c=-1e7,p=1e7,h=!1,d=1,v=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",f=!0;function y(g,I){var A,_,T,$,B,P,k,O,M=this;if(!(M instanceof y))return new y(g,I);if(I==null){if(g&&g._isBigNumber===!0){M.s=g.s,!g.c||g.e>p?M.c=M.e=null:g.e<c?M.c=[M.e=0]:(M.e=g.e,M.c=g.c.slice());return}if((P=typeof g=="number")&&g*0==0){if(M.s=1/g<0?(g=-g,-1):1,g===~~g){for($=0,B=g;B>=10;B/=10,$++);$>p?M.c=M.e=null:(M.e=$,M.c=[g]);return}O=String(g)}else{if(!Q_.test(O=String(g)))return r(M,O,P);M.s=O.charCodeAt(0)==45?(O=O.slice(1),-1):1}($=O.indexOf("."))>-1&&(O=O.replace(".","")),(B=O.search(/e/i))>0?($<0&&($=B),$+=+O.slice(B+1),O=O.substring(0,B)):$<0&&($=O.length)}else{if(mt(I,2,b.length,"Base"),I==10&&f)return M=new y(g),E(M,o+M.e+1,s);if(O=String(g),P=typeof g=="number"){if(g*0!=0)return r(M,O,P,I);if(M.s=1/g<0?(O=O.slice(1),-1):1,y.DEBUG&&O.replace(/^0\.0*|\./,"").length>15)throw Error(Zp+g)}else M.s=O.charCodeAt(0)===45?(O=O.slice(1),-1):1;for(A=b.slice(0,I),$=B=0,k=O.length;B<k;B++)if(A.indexOf(_=O.charAt(B))<0){if(_=="."){if(B>$){$=k;continue}}else if(!T&&(O==O.toUpperCase()&&(O=O.toLowerCase())||O==O.toLowerCase()&&(O=O.toUpperCase()))){T=!0,B=-1,$=0;continue}return r(M,String(g),P,I)}P=!1,O=n(O,I,10,M.s),($=O.indexOf("."))>-1?O=O.replace(".",""):$=O.length}for(B=0;O.charCodeAt(B)===48;B++);for(k=O.length;O.charCodeAt(--k)===48;);if(O=O.slice(B,++k)){if(k-=B,P&&y.DEBUG&&k>15&&(g>yd||g!==Zn(g)))throw Error(Zp+M.s*g);if(($=$-B-1)>p)M.c=M.e=null;else if($<c)M.c=[M.e=0];else{if(M.e=$,M.c=[],B=($+1)%Pe,$<0&&(B+=Pe),B<k){for(B&&M.c.push(+O.slice(0,B)),k-=Pe;B<k;)M.c.push(+O.slice(B,B+=Pe));B=Pe-(O=O.slice(B)).length}else B-=k;for(;B--;O+="0");M.c.push(+O)}}else M.c=[M.e=0]}y.clone=mx,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(g){var I,A;if(g!=null)if(typeof g=="object"){if(g.hasOwnProperty(I="DECIMAL_PLACES")&&(A=g[I],mt(A,0,tn,I),o=A),g.hasOwnProperty(I="ROUNDING_MODE")&&(A=g[I],mt(A,0,8,I),s=A),g.hasOwnProperty(I="EXPONENTIAL_AT")&&(A=g[I],A&&A.pop?(mt(A[0],-tn,0,I),mt(A[1],0,tn,I),l=A[0],u=A[1]):(mt(A,-tn,tn,I),l=-(u=A<0?-A:A))),g.hasOwnProperty(I="RANGE"))if(A=g[I],A&&A.pop)mt(A[0],-tn,-1,I),mt(A[1],1,tn,I),c=A[0],p=A[1];else if(mt(A,-tn,tn,I),A)c=-(p=A<0?-A:A);else throw Error(Dn+I+" cannot be zero: "+A);if(g.hasOwnProperty(I="CRYPTO"))if(A=g[I],A===!!A)if(A)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))h=A;else throw h=!A,Error(Dn+"crypto unavailable");else h=A;else throw Error(Dn+I+" not true or false: "+A);if(g.hasOwnProperty(I="MODULO_MODE")&&(A=g[I],mt(A,0,9,I),d=A),g.hasOwnProperty(I="POW_PRECISION")&&(A=g[I],mt(A,0,tn,I),v=A),g.hasOwnProperty(I="FORMAT"))if(A=g[I],typeof A=="object")m=A;else throw Error(Dn+I+" not an object: "+A);if(g.hasOwnProperty(I="ALPHABET"))if(A=g[I],typeof A=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(A))f=A.slice(0,10)=="0123456789",b=A;else throw Error(Dn+I+" invalid: "+A)}else throw Error(Dn+"Object expected: "+g);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,u],RANGE:[c,p],CRYPTO:h,MODULO_MODE:d,POW_PRECISION:v,FORMAT:m,ALPHABET:b}},y.isBigNumber=function(g){if(!g||g._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var I,A,_=g.c,T=g.e,$=g.s;e:if({}.toString.call(_)=="[object Array]"){if(($===1||$===-1)&&T>=-tn&&T<=tn&&T===Zn(T)){if(_[0]===0){if(T===0&&_.length===1)return!0;break e}if(I=(T+1)%Pe,I<1&&(I+=Pe),String(_[0]).length==I){for(I=0;I<_.length;I++)if(A=_[I],A<0||A>=cr||A!==Zn(A))break e;if(A!==0)return!0}}}else if(_===null&&T===null&&($===null||$===1||$===-1))return!0;throw Error(Dn+"Invalid BigNumber: "+g)},y.maximum=y.max=function(){return S(arguments,-1)},y.minimum=y.min=function(){return S(arguments,1)},y.random=function(){var g=9007199254740992,I=Math.random()*g&2097151?function(){return Zn(Math.random()*g)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(A){var _,T,$,B,P,k=0,O=[],M=new y(a);if(A==null?A=o:mt(A,0,tn),B=bd(A/Pe),h)if(crypto.getRandomValues){for(_=crypto.getRandomValues(new Uint32Array(B*=2));k<B;)P=_[k]*131072+(_[k+1]>>>11),P>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),_[k]=T[0],_[k+1]=T[1]):(O.push(P%1e14),k+=2);k=B/2}else if(crypto.randomBytes){for(_=crypto.randomBytes(B*=7);k<B;)P=(_[k]&31)*281474976710656+_[k+1]*1099511627776+_[k+2]*4294967296+_[k+3]*16777216+(_[k+4]<<16)+(_[k+5]<<8)+_[k+6],P>=9e15?crypto.randomBytes(7).copy(_,k):(O.push(P%1e14),k+=7);k=B/7}else throw h=!1,Error(Dn+"crypto unavailable");if(!h)for(;k<B;)P=I(),P<9e15&&(O[k++]=P%1e14);for(B=O[--k],A%=Pe,B&&A&&(P=xd[Pe-A],O[k]=Zn(B/P)*P);O[k]===0;O.pop(),k--);if(k<0)O=[$=0];else{for($=-1;O[0]===0;O.splice(0,1),$-=Pe);for(k=1,P=O[0];P>=10;P/=10,k++);k<Pe&&($-=Pe-k)}return M.e=$,M.c=O,M}}(),y.sum=function(){for(var g=1,I=arguments,A=new y(I[0]);g<I.length;)A=A.plus(I[g++]);return A},n=function(){var g="0123456789";function I(A,_,T,$){for(var B,P=[0],k,O=0,M=A.length;O<M;){for(k=P.length;k--;P[k]*=_);for(P[0]+=$.indexOf(A.charAt(O++)),B=0;B<P.length;B++)P[B]>T-1&&(P[B+1]==null&&(P[B+1]=0),P[B+1]+=P[B]/T|0,P[B]%=T)}return P.reverse()}return function(A,_,T,$,B){var P,k,O,M,G,W,U,q,Q=A.indexOf("."),Z=o,ee=s;for(Q>=0&&(M=v,v=0,A=A.replace(".",""),q=new y(_),W=q.pow(A.length-Q),v=M,q.c=I(Zr(Un(W.c),W.e,"0"),10,T,g),q.e=q.c.length),U=I(A,_,T,B?(P=b,g):(P=g,b)),O=M=U.length;U[--M]==0;U.pop());if(!U[0])return P.charAt(0);if(Q<0?--O:(W.c=U,W.e=O,W.s=$,W=t(W,q,Z,ee,T),U=W.c,G=W.r,O=W.e),k=O+Z+1,Q=U[k],M=T/2,G=G||k<0||U[k+1]!=null,G=ee<4?(Q!=null||G)&&(ee==0||ee==(W.s<0?3:2)):Q>M||Q==M&&(ee==4||G||ee==6&&U[k-1]&1||ee==(W.s<0?8:7)),k<1||!U[0])A=G?Zr(P.charAt(1),-Z,P.charAt(0)):P.charAt(0);else{if(U.length=k,G)for(--T;++U[--k]>T;)U[k]=0,k||(++O,U=[1].concat(U));for(M=U.length;!U[--M];);for(Q=0,A="";Q<=M;A+=P.charAt(U[Q++]));A=Zr(A,O,P.charAt(0))}return A}}(),t=function(){function g(_,T,$){var B,P,k,O,M=0,G=_.length,W=T%Ii,U=T/Ii|0;for(_=_.slice();G--;)k=_[G]%Ii,O=_[G]/Ii|0,B=U*k+O*W,P=W*k+B%Ii*Ii+M,M=(P/$|0)+(B/Ii|0)+U*O,_[G]=P%$;return M&&(_=[M].concat(_)),_}function I(_,T,$,B){var P,k;if($!=B)k=$>B?1:-1;else for(P=k=0;P<$;P++)if(_[P]!=T[P]){k=_[P]>T[P]?1:-1;break}return k}function A(_,T,$,B){for(var P=0;$--;)_[$]-=P,P=_[$]<T[$]?1:0,_[$]=P*B+_[$]-T[$];for(;!_[0]&&_.length>1;_.splice(0,1));}return function(_,T,$,B,P){var k,O,M,G,W,U,q,Q,Z,ee,J,le,re,R,H,V,D,L=_.s==T.s?1:-1,K=_.c,X=T.c;if(!K||!K[0]||!X||!X[0])return new y(!_.s||!T.s||(K?X&&K[0]==X[0]:!X)?NaN:K&&K[0]==0||!X?L*0:L/0);for(Q=new y(L),Z=Q.c=[],O=_.e-T.e,L=$+O+1,P||(P=cr,O=Jn(_.e/Pe)-Jn(T.e/Pe),L=L/Pe|0),M=0;X[M]==(K[M]||0);M++);if(X[M]>(K[M]||0)&&O--,L<0)Z.push(1),G=!0;else{for(R=K.length,V=X.length,M=0,L+=2,W=Zn(P/(X[0]+1)),W>1&&(X=g(X,W,P),K=g(K,W,P),V=X.length,R=K.length),re=V,ee=K.slice(0,V),J=ee.length;J<V;ee[J++]=0);D=X.slice(),D=[0].concat(D),H=X[0],X[1]>=P/2&&H++;do{if(W=0,k=I(X,ee,V,J),k<0){if(le=ee[0],V!=J&&(le=le*P+(ee[1]||0)),W=Zn(le/H),W>1)for(W>=P&&(W=P-1),U=g(X,W,P),q=U.length,J=ee.length;I(U,ee,q,J)==1;)W--,A(U,V<q?D:X,q,P),q=U.length,k=1;else W==0&&(k=W=1),U=X.slice(),q=U.length;if(q<J&&(U=[0].concat(U)),A(ee,U,J,P),J=ee.length,k==-1)for(;I(X,ee,V,J)<1;)W++,A(ee,V<J?D:X,J,P),J=ee.length}else k===0&&(W++,ee=[0]);Z[M++]=W,ee[0]?ee[J++]=K[re]||0:(ee=[K[re]],J=1)}while((re++<R||ee[0]!=null)&&L--);G=ee[0]!=null,Z[0]||Z.splice(0,1)}if(P==cr){for(M=1,L=Z[0];L>=10;L/=10,M++);E(Q,$+(Q.e=M+O*Pe-1)+1,B,G)}else Q.e=O,Q.r=+G;return Q}}();function C(g,I,A,_){var T,$,B,P,k;if(A==null?A=s:mt(A,0,8),!g.c)return g.toString();if(T=g.c[0],B=g.e,I==null)k=Un(g.c),k=_==1||_==2&&(B<=l||B>=u)?Dl(k,B):Zr(k,B,"0");else if(g=E(new y(g),I,A),$=g.e,k=Un(g.c),P=k.length,_==1||_==2&&(I<=$||$<=l)){for(;P<I;k+="0",P++);k=Dl(k,$)}else if(I-=B,k=Zr(k,$,"0"),$+1>P){if(--I>0)for(k+=".";I--;k+="0");}else if(I+=$-P,I>0)for($+1==P&&(k+=".");I--;k+="0");return g.s<0&&T?"-"+k:k}function S(g,I){for(var A,_,T=1,$=new y(g[0]);T<g.length;T++)_=new y(g[T]),(!_.s||(A=ta($,_))===I||A===0&&$.s===I)&&($=_);return $}function w(g,I,A){for(var _=1,T=I.length;!I[--T];I.pop());for(T=I[0];T>=10;T/=10,_++);return(A=_+A*Pe-1)>p?g.c=g.e=null:A<c?g.c=[g.e=0]:(g.e=A,g.c=I),g}r=function(){var g=/^(-?)0([xbo])(?=\w[\w.]*$)/i,I=/^([^.]+)\.$/,A=/^\.([^.]+)$/,_=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,B,P,k){var O,M=P?B:B.replace(T,"");if(_.test(M))$.s=isNaN(M)?null:M<0?-1:1;else{if(!P&&(M=M.replace(g,function(G,W,U){return O=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!k||k==O?W:G}),k&&(O=k,M=M.replace(I,"$1").replace(A,"0.$1")),B!=M))return new y(M,O);if(y.DEBUG)throw Error(Dn+"Not a"+(k?" base "+k:"")+" number: "+B);$.s=null}$.c=$.e=null}}();function E(g,I,A,_){var T,$,B,P,k,O,M,G=g.c,W=xd;if(G){e:{for(T=1,P=G[0];P>=10;P/=10,T++);if($=I-T,$<0)$+=Pe,B=I,k=G[O=0],M=Zn(k/W[T-B-1]%10);else if(O=bd(($+1)/Pe),O>=G.length)if(_){for(;G.length<=O;G.push(0));k=M=0,T=1,$%=Pe,B=$-Pe+1}else break e;else{for(k=P=G[O],T=1;P>=10;P/=10,T++);$%=Pe,B=$-Pe+T,M=B<0?0:Zn(k/W[T-B-1]%10)}if(_=_||I<0||G[O+1]!=null||(B<0?k:k%W[T-B-1]),_=A<4?(M||_)&&(A==0||A==(g.s<0?3:2)):M>5||M==5&&(A==4||_||A==6&&($>0?B>0?k/W[T-B]:0:G[O-1])%10&1||A==(g.s<0?8:7)),I<1||!G[0])return G.length=0,_?(I-=g.e+1,G[0]=W[(Pe-I%Pe)%Pe],g.e=-I||0):G[0]=g.e=0,g;if($==0?(G.length=O,P=1,O--):(G.length=O+1,P=W[Pe-$],G[O]=B>0?Zn(k/W[T-B]%W[B])*P:0),_)for(;;)if(O==0){for($=1,B=G[0];B>=10;B/=10,$++);for(B=G[0]+=P,P=1;B>=10;B/=10,P++);$!=P&&(g.e++,G[0]==cr&&(G[0]=1));break}else{if(G[O]+=P,G[O]!=cr)break;G[O--]=0,P=1}for($=G.length;G[--$]===0;G.pop());}g.e>p?g.c=g.e=null:g.e<c&&(g.c=[g.e=0])}return g}function x(g){var I,A=g.e;return A===null?g.toString():(I=Un(g.c),I=A<=l||A>=u?Dl(I,A):Zr(I,A,"0"),g.s<0?"-"+I:I)}return i.absoluteValue=i.abs=function(){var g=new y(this);return g.s<0&&(g.s=1),g},i.comparedTo=function(g,I){return ta(this,new y(g,I))},i.decimalPlaces=i.dp=function(g,I){var A,_,T,$=this;if(g!=null)return mt(g,0,tn),I==null?I=s:mt(I,0,8),E(new y($),g+$.e+1,I);if(!(A=$.c))return null;if(_=((T=A.length-1)-Jn(this.e/Pe))*Pe,T=A[T])for(;T%10==0;T/=10,_--);return _<0&&(_=0),_},i.dividedBy=i.div=function(g,I){return t(this,new y(g,I),o,s)},i.dividedToIntegerBy=i.idiv=function(g,I){return t(this,new y(g,I),0,1)},i.exponentiatedBy=i.pow=function(g,I){var A,_,T,$,B,P,k,O,M,G=this;if(g=new y(g),g.c&&!g.isInteger())throw Error(Dn+"Exponent not an integer: "+x(g));if(I!=null&&(I=new y(I)),P=g.e>14,!G.c||!G.c[0]||G.c[0]==1&&!G.e&&G.c.length==1||!g.c||!g.c[0])return M=new y(Math.pow(+x(G),P?g.s*(2-_l(g)):+x(g))),I?M.mod(I):M;if(k=g.s<0,I){if(I.c?!I.c[0]:!I.s)return new y(NaN);_=!k&&G.isInteger()&&I.isInteger(),_&&(G=G.mod(I))}else{if(g.e>9&&(G.e>0||G.e<-1||(G.e==0?G.c[0]>1||P&&G.c[1]>=24e7:G.c[0]<8e13||P&&G.c[0]<=9999975e7)))return $=G.s<0&&_l(g)?-0:0,G.e>-1&&($=1/$),new y(k?1/$:$);v&&($=bd(v/Pe+2))}for(P?(A=new y(.5),k&&(g.s=1),O=_l(g)):(T=Math.abs(+x(g)),O=T%2),M=new y(a);;){if(O){if(M=M.times(G),!M.c)break;$?M.c.length>$&&(M.c.length=$):_&&(M=M.mod(I))}if(T){if(T=Zn(T/2),T===0)break;O=T%2}else if(g=g.times(A),E(g,g.e+1,1),g.e>14)O=_l(g);else{if(T=+x(g),T===0)break;O=T%2}G=G.times(G),$?G.c&&G.c.length>$&&(G.c.length=$):_&&(G=G.mod(I))}return _?M:(k&&(M=a.div(M)),I?M.mod(I):$?E(M,v,s,B):M)},i.integerValue=function(g){var I=new y(this);return g==null?g=s:mt(g,0,8),E(I,I.e+1,g)},i.isEqualTo=i.eq=function(g,I){return ta(this,new y(g,I))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(g,I){return ta(this,new y(g,I))>0},i.isGreaterThanOrEqualTo=i.gte=function(g,I){return(I=ta(this,new y(g,I)))===1||I===0},i.isInteger=function(){return!!this.c&&Jn(this.e/Pe)>this.c.length-2},i.isLessThan=i.lt=function(g,I){return ta(this,new y(g,I))<0},i.isLessThanOrEqualTo=i.lte=function(g,I){return(I=ta(this,new y(g,I)))===-1||I===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(g,I){var A,_,T,$,B=this,P=B.s;if(g=new y(g,I),I=g.s,!P||!I)return new y(NaN);if(P!=I)return g.s=-I,B.plus(g);var k=B.e/Pe,O=g.e/Pe,M=B.c,G=g.c;if(!k||!O){if(!M||!G)return M?(g.s=-I,g):new y(G?B:NaN);if(!M[0]||!G[0])return G[0]?(g.s=-I,g):new y(M[0]?B:s==3?-0:0)}if(k=Jn(k),O=Jn(O),M=M.slice(),P=k-O){for(($=P<0)?(P=-P,T=M):(O=k,T=G),T.reverse(),I=P;I--;T.push(0));T.reverse()}else for(_=($=(P=M.length)<(I=G.length))?P:I,P=I=0;I<_;I++)if(M[I]!=G[I]){$=M[I]<G[I];break}if($&&(T=M,M=G,G=T,g.s=-g.s),I=(_=G.length)-(A=M.length),I>0)for(;I--;M[A++]=0);for(I=cr-1;_>P;){if(M[--_]<G[_]){for(A=_;A&&!M[--A];M[A]=I);--M[A],M[_]+=cr}M[_]-=G[_]}for(;M[0]==0;M.splice(0,1),--O);return M[0]?w(g,M,O):(g.s=s==3?-1:1,g.c=[g.e=0],g)},i.modulo=i.mod=function(g,I){var A,_,T=this;return g=new y(g,I),!T.c||!g.s||g.c&&!g.c[0]?new y(NaN):!g.c||T.c&&!T.c[0]?new y(T):(d==9?(_=g.s,g.s=1,A=t(T,g,0,3),g.s=_,A.s*=_):A=t(T,g,0,d),g=T.minus(A.times(g)),!g.c[0]&&d==1&&(g.s=T.s),g)},i.multipliedBy=i.times=function(g,I){var A,_,T,$,B,P,k,O,M,G,W,U,q,Q,Z,ee=this,J=ee.c,le=(g=new y(g,I)).c;if(!J||!le||!J[0]||!le[0])return!ee.s||!g.s||J&&!J[0]&&!le||le&&!le[0]&&!J?g.c=g.e=g.s=null:(g.s*=ee.s,!J||!le?g.c=g.e=null:(g.c=[0],g.e=0)),g;for(_=Jn(ee.e/Pe)+Jn(g.e/Pe),g.s*=ee.s,k=J.length,G=le.length,k<G&&(q=J,J=le,le=q,T=k,k=G,G=T),T=k+G,q=[];T--;q.push(0));for(Q=cr,Z=Ii,T=G;--T>=0;){for(A=0,W=le[T]%Z,U=le[T]/Z|0,B=k,$=T+B;$>T;)O=J[--B]%Z,M=J[B]/Z|0,P=U*O+M*W,O=W*O+P%Z*Z+q[$]+A,A=(O/Q|0)+(P/Z|0)+U*M,q[$--]=O%Q;q[$]=A}return A?++_:q.splice(0,1),w(g,q,_)},i.negated=function(){var g=new y(this);return g.s=-g.s||null,g},i.plus=function(g,I){var A,_=this,T=_.s;if(g=new y(g,I),I=g.s,!T||!I)return new y(NaN);if(T!=I)return g.s=-I,_.minus(g);var $=_.e/Pe,B=g.e/Pe,P=_.c,k=g.c;if(!$||!B){if(!P||!k)return new y(T/0);if(!P[0]||!k[0])return k[0]?g:new y(P[0]?_:T*0)}if($=Jn($),B=Jn(B),P=P.slice(),T=$-B){for(T>0?(B=$,A=k):(T=-T,A=P),A.reverse();T--;A.push(0));A.reverse()}for(T=P.length,I=k.length,T-I<0&&(A=k,k=P,P=A,I=T),T=0;I;)T=(P[--I]=P[I]+k[I]+T)/cr|0,P[I]=cr===P[I]?0:P[I]%cr;return T&&(P=[T].concat(P),++B),w(g,P,B)},i.precision=i.sd=function(g,I){var A,_,T,$=this;if(g!=null&&g!==!!g)return mt(g,1,tn),I==null?I=s:mt(I,0,8),E(new y($),g,I);if(!(A=$.c))return null;if(T=A.length-1,_=T*Pe+1,T=A[T]){for(;T%10==0;T/=10,_--);for(T=A[0];T>=10;T/=10,_++);}return g&&$.e+1>_&&(_=$.e+1),_},i.shiftedBy=function(g){return mt(g,-yd,yd),this.times("1e"+g)},i.squareRoot=i.sqrt=function(){var g,I,A,_,T,$=this,B=$.c,P=$.s,k=$.e,O=o+4,M=new y("0.5");if(P!==1||!B||!B[0])return new y(!P||P<0&&(!B||B[0])?NaN:B?$:1/0);if(P=Math.sqrt(+x($)),P==0||P==1/0?(I=Un(B),(I.length+k)%2==0&&(I+="0"),P=Math.sqrt(+I),k=Jn((k+1)/2)-(k<0||k%2),P==1/0?I="5e"+k:(I=P.toExponential(),I=I.slice(0,I.indexOf("e")+1)+k),A=new y(I)):A=new y(P+""),A.c[0]){for(k=A.e,P=k+O,P<3&&(P=0);;)if(T=A,A=M.times(T.plus(t($,T,O,1))),Un(T.c).slice(0,P)===(I=Un(A.c)).slice(0,P))if(A.e<k&&--P,I=I.slice(P-3,P+1),I=="9999"||!_&&I=="4999"){if(!_&&(E(T,T.e+o+2,0),T.times(T).eq($))){A=T;break}O+=4,P+=4,_=1}else{(!+I||!+I.slice(1)&&I.charAt(0)=="5")&&(E(A,A.e+o+2,1),g=!A.times(A).eq($));break}}return E(A,A.e+o+1,s,g)},i.toExponential=function(g,I){return g!=null&&(mt(g,0,tn),g++),C(this,g,I,1)},i.toFixed=function(g,I){return g!=null&&(mt(g,0,tn),g=g+this.e+1),C(this,g,I)},i.toFormat=function(g,I,A){var _,T=this;if(A==null)g!=null&&I&&typeof I=="object"?(A=I,I=null):g&&typeof g=="object"?(A=g,g=I=null):A=m;else if(typeof A!="object")throw Error(Dn+"Argument not an object: "+A);if(_=T.toFixed(g,I),T.c){var $,B=_.split("."),P=+A.groupSize,k=+A.secondaryGroupSize,O=A.groupSeparator||"",M=B[0],G=B[1],W=T.s<0,U=W?M.slice(1):M,q=U.length;if(k&&($=P,P=k,k=$,q-=$),P>0&&q>0){for($=q%P||P,M=U.substr(0,$);$<q;$+=P)M+=O+U.substr($,P);k>0&&(M+=O+U.slice($)),W&&(M="-"+M)}_=G?M+(A.decimalSeparator||"")+((k=+A.fractionGroupSize)?G.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(A.fractionGroupSeparator||"")):G):M}return(A.prefix||"")+_+(A.suffix||"")},i.toFraction=function(g){var I,A,_,T,$,B,P,k,O,M,G,W,U=this,q=U.c;if(g!=null&&(P=new y(g),!P.isInteger()&&(P.c||P.s!==1)||P.lt(a)))throw Error(Dn+"Argument "+(P.isInteger()?"out of range: ":"not an integer: ")+x(P));if(!q)return new y(U);for(I=new y(a),O=A=new y(a),_=k=new y(a),W=Un(q),$=I.e=W.length-U.e-1,I.c[0]=xd[(B=$%Pe)<0?Pe+B:B],g=!g||P.comparedTo(I)>0?$>0?I:O:P,B=p,p=1/0,P=new y(W),k.c[0]=0;M=t(P,I,0,1),T=A.plus(M.times(_)),T.comparedTo(g)!=1;)A=_,_=T,O=k.plus(M.times(T=O)),k=T,I=P.minus(M.times(T=I)),P=T;return T=t(g.minus(A),_,0,1),k=k.plus(T.times(O)),A=A.plus(T.times(_)),k.s=O.s=U.s,$=$*2,G=t(O,_,$,s).minus(U).abs().comparedTo(t(k,A,$,s).minus(U).abs())<1?[O,_]:[k,A],p=B,G},i.toNumber=function(){return+x(this)},i.toPrecision=function(g,I){return g!=null&&mt(g,1,tn),C(this,g,I,2)},i.toString=function(g){var I,A=this,_=A.s,T=A.e;return T===null?_?(I="Infinity",_<0&&(I="-"+I)):I="NaN":(g==null?I=T<=l||T>=u?Dl(Un(A.c),T):Zr(Un(A.c),T,"0"):g===10&&f?(A=E(new y(A),o+T+1,s),I=Zr(Un(A.c),A.e,"0")):(mt(g,2,b.length,"Base"),I=n(Zr(Un(A.c),T,"0"),10,g,_,!0)),_<0&&A.c[0]&&(I="-"+I)),I},i.valueOf=i.toJSON=function(){return x(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&y.set(e),y}function Jn(e){var t=e|0;return e>0||e===t?t:t-1}function Un(e){for(var t,n,r=1,i=e.length,a=e[0]+"";r<i;){for(t=e[r++]+"",n=Pe-t.length;n--;t="0"+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function ta(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!i||!a)return r?0:!i^n?1:-1;if(!r)return l>u^n?1:-1;for(s=(l=i.length)<(u=a.length)?l:u,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return l==u?0:l>u^n?1:-1}function mt(e,t,n,r){if(e<t||e>n||e!==Zn(e))throw Error(Dn+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _l(e){var t=e.c.length-1;return Jn(e.e/Pe)==t&&e.c[t]%2!=0}function Dl(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Zr(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Tc=mx();const vx={ROUNDING_MODE:Tc.ROUND_HALF_UP,EXPONENTIAL_AT:[-1e9,1e9]};let Ih=!1;const eD=(e=vx)=>{Ih||(Tc.config(e),Ih=!0)},bt=(e,t)=>(Ih||eD(),new Tc(e,t));var tD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function rD(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Cd,Jp;function Le(){return Jp||(Jp=1,Cd={options:{usePureJavaScript:!1}}),Cd}var Ed={exports:{}},Sd,qp;function iD(){if(qp)return Sd;qp=1;var e={};Sd=e;var t={};e.encode=function(r,i,a){if(typeof i!="string")throw new TypeError('"alphabet" must be a string.');if(a!==void 0&&typeof a!="number")throw new TypeError('"maxline" must be a number.');var o="";if(!(r instanceof Uint8Array))o=n(r,i);else{var s=0,l=i.length,u=i.charAt(0),c=[0];for(s=0;s<r.length;++s){for(var p=0,h=r[s];p<c.length;++p)h+=c[p]<<8,c[p]=h%l,h=h/l|0;for(;h>0;)c.push(h%l),h=h/l|0}for(s=0;r[s]===0&&s<r.length-1;++s)o+=u;for(s=c.length-1;s>=0;--s)o+=i[c[s]]}if(a){var d=new RegExp(".{1,"+a+"}","g");o=o.match(d).join(`\r
2
- `)}return o},e.decode=function(r,i){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof i!="string")throw new TypeError('"alphabet" must be a string.');var a=t[i];if(!a){a=t[i]=[];for(var o=0;o<i.length;++o)a[i.charCodeAt(o)]=o}r=r.replace(/\s/g,"");for(var s=i.length,l=i.charAt(0),u=[0],o=0;o<r.length;o++){var c=a[r.charCodeAt(o)];if(c===void 0)return;for(var p=0,h=c;p<u.length;++p)h+=u[p]*s,u[p]=h&255,h>>=8;for(;h>0;)u.push(h&255),h>>=8}for(var d=0;r[d]===l&&d<r.length-1;++d)u.push(0);return typeof Buffer<"u"?Buffer.from(u.reverse()):new Uint8Array(u.reverse())};function n(r,i){var a=0,o=i.length,s=i.charAt(0),l=[0];for(a=0;a<r.length();++a){for(var u=0,c=r.at(a);u<l.length;++u)c+=l[u]<<8,l[u]=c%o,c=c/o|0;for(;c>0;)l.push(c%o),c=c/o|0}var p="";for(a=0;r.at(a)===0&&a<r.length()-1;++a)p+=s;for(a=l.length-1;a>=0;--a)p+=i[l[a]];return p}return Sd}var Qp;function Ue(){if(Qp)return Ed.exports;Qp=1;var e=Le(),t=iD(),n=Ed.exports=e.util=e.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){n.nextTick=process.nextTick,typeof setImmediate=="function"?n.setImmediate=setImmediate:n.setImmediate=n.nextTick;return}if(typeof setImmediate=="function"){n.setImmediate=function(){return setImmediate.apply(void 0,arguments)},n.nextTick=function(x){return setImmediate(x)};return}if(n.setImmediate=function(x){setTimeout(x,0)},typeof window<"u"&&typeof window.postMessage=="function"){let x=function(g){if(g.source===window&&g.data===f){g.stopPropagation();var I=y.slice();y.length=0,I.forEach(function(A){A()})}};var f="forge.setImmediate",y=[];n.setImmediate=function(g){y.push(g),y.length===1&&window.postMessage(f,"*")},window.addEventListener("message",x,!0)}if(typeof MutationObserver<"u"){var C=Date.now(),S=!0,w=document.createElement("div"),y=[];new MutationObserver(function(){var g=y.slice();y.length=0,g.forEach(function(I){I()})}).observe(w,{attributes:!0});var E=n.setImmediate;n.setImmediate=function(g){Date.now()-C>15?(C=Date.now(),E(g)):(y.push(g),y.length===1&&w.setAttribute("a",S=!S))}}n.nextTick=n.setImmediate})(),n.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,n.globalScope=function(){return n.isNodejs?tD:typeof self>"u"?window:self}(),n.isArray=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},n.isArrayBuffer=function(f){return typeof ArrayBuffer<"u"&&f instanceof ArrayBuffer},n.isArrayBufferView=function(f){return f&&n.isArrayBuffer(f.buffer)&&f.byteLength!==void 0};function r(f){if(!(f===8||f===16||f===24||f===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+f)}n.ByteBuffer=i;function i(f){if(this.data="",this.read=0,typeof f=="string")this.data=f;else if(n.isArrayBuffer(f)||n.isArrayBufferView(f))if(typeof Buffer<"u"&&f instanceof Buffer)this.data=f.toString("binary");else{var y=new Uint8Array(f);try{this.data=String.fromCharCode.apply(null,y)}catch{for(var C=0;C<y.length;++C)this.putByte(y[C])}}else(f instanceof i||typeof f=="object"&&typeof f.data=="string"&&typeof f.read=="number")&&(this.data=f.data,this.read=f.read);this._constructedStringLength=0}n.ByteStringBuffer=i;var a=4096;n.ByteStringBuffer.prototype._optimizeConstructedString=function(f){this._constructedStringLength+=f,this._constructedStringLength>a&&(this.data.substr(0,1),this._constructedStringLength=0)},n.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},n.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},n.ByteStringBuffer.prototype.putByte=function(f){return this.putBytes(String.fromCharCode(f))},n.ByteStringBuffer.prototype.fillWithByte=function(f,y){f=String.fromCharCode(f);for(var C=this.data;y>0;)y&1&&(C+=f),y>>>=1,y>0&&(f+=f);return this.data=C,this._optimizeConstructedString(y),this},n.ByteStringBuffer.prototype.putBytes=function(f){return this.data+=f,this._optimizeConstructedString(f.length),this},n.ByteStringBuffer.prototype.putString=function(f){return this.putBytes(n.encodeUtf8(f))},n.ByteStringBuffer.prototype.putInt16=function(f){return this.putBytes(String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},n.ByteStringBuffer.prototype.putInt24=function(f){return this.putBytes(String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},n.ByteStringBuffer.prototype.putInt32=function(f){return this.putBytes(String.fromCharCode(f>>24&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},n.ByteStringBuffer.prototype.putInt16Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255))},n.ByteStringBuffer.prototype.putInt24Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f>>16&255))},n.ByteStringBuffer.prototype.putInt32Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>24&255))},n.ByteStringBuffer.prototype.putInt=function(f,y){r(y);var C="";do y-=8,C+=String.fromCharCode(f>>y&255);while(y>0);return this.putBytes(C)},n.ByteStringBuffer.prototype.putSignedInt=function(f,y){return f<0&&(f+=2<<y-1),this.putInt(f,y)},n.ByteStringBuffer.prototype.putBuffer=function(f){return this.putBytes(f.getBytes())},n.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},n.ByteStringBuffer.prototype.getInt16=function(){var f=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,f},n.ByteStringBuffer.prototype.getInt24=function(){var f=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,f},n.ByteStringBuffer.prototype.getInt32=function(){var f=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,f},n.ByteStringBuffer.prototype.getInt16Le=function(){var f=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,f},n.ByteStringBuffer.prototype.getInt24Le=function(){var f=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,f},n.ByteStringBuffer.prototype.getInt32Le=function(){var f=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,f},n.ByteStringBuffer.prototype.getInt=function(f){r(f);var y=0;do y=(y<<8)+this.data.charCodeAt(this.read++),f-=8;while(f>0);return y},n.ByteStringBuffer.prototype.getSignedInt=function(f){var y=this.getInt(f),C=2<<f-2;return y>=C&&(y-=C<<1),y},n.ByteStringBuffer.prototype.getBytes=function(f){var y;return f?(f=Math.min(this.length(),f),y=this.data.slice(this.read,this.read+f),this.read+=f):f===0?y="":(y=this.read===0?this.data:this.data.slice(this.read),this.clear()),y},n.ByteStringBuffer.prototype.bytes=function(f){return typeof f>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+f)},n.ByteStringBuffer.prototype.at=function(f){return this.data.charCodeAt(this.read+f)},n.ByteStringBuffer.prototype.setAt=function(f,y){return this.data=this.data.substr(0,this.read+f)+String.fromCharCode(y)+this.data.substr(this.read+f+1),this},n.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},n.ByteStringBuffer.prototype.copy=function(){var f=n.createBuffer(this.data);return f.read=this.read,f},n.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},n.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},n.ByteStringBuffer.prototype.truncate=function(f){var y=Math.max(0,this.length()-f);return this.data=this.data.substr(this.read,y),this.read=0,this},n.ByteStringBuffer.prototype.toHex=function(){for(var f="",y=this.read;y<this.data.length;++y){var C=this.data.charCodeAt(y);C<16&&(f+="0"),f+=C.toString(16)}return f},n.ByteStringBuffer.prototype.toString=function(){return n.decodeUtf8(this.bytes())};function o(f,y){y=y||{},this.read=y.readOffset||0,this.growSize=y.growSize||1024;var C=n.isArrayBuffer(f),S=n.isArrayBufferView(f);if(C||S){C?this.data=new DataView(f):this.data=new DataView(f.buffer,f.byteOffset,f.byteLength),this.write="writeOffset"in y?y.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,f!=null&&this.putBytes(f),"writeOffset"in y&&(this.write=y.writeOffset)}n.DataBuffer=o,n.DataBuffer.prototype.length=function(){return this.write-this.read},n.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},n.DataBuffer.prototype.accommodate=function(f,y){if(this.length()>=f)return this;y=Math.max(y||this.growSize,f);var C=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),S=new Uint8Array(this.length()+y);return S.set(C),this.data=new DataView(S.buffer),this},n.DataBuffer.prototype.putByte=function(f){return this.accommodate(1),this.data.setUint8(this.write++,f),this},n.DataBuffer.prototype.fillWithByte=function(f,y){this.accommodate(y);for(var C=0;C<y;++C)this.data.setUint8(f);return this},n.DataBuffer.prototype.putBytes=function(f,y){if(n.isArrayBufferView(f)){var C=new Uint8Array(f.buffer,f.byteOffset,f.byteLength),S=C.byteLength-C.byteOffset;this.accommodate(S);var w=new Uint8Array(this.data.buffer,this.write);return w.set(C),this.write+=S,this}if(n.isArrayBuffer(f)){var C=new Uint8Array(f);this.accommodate(C.byteLength);var w=new Uint8Array(this.data.buffer);return w.set(C,this.write),this.write+=C.byteLength,this}if(f instanceof n.DataBuffer||typeof f=="object"&&typeof f.read=="number"&&typeof f.write=="number"&&n.isArrayBufferView(f.data)){var C=new Uint8Array(f.data.byteLength,f.read,f.length());this.accommodate(C.byteLength);var w=new Uint8Array(f.data.byteLength,this.write);return w.set(C),this.write+=C.byteLength,this}if(f instanceof n.ByteStringBuffer&&(f=f.data,y="binary"),y=y||"binary",typeof f=="string"){var E;if(y==="hex")return this.accommodate(Math.ceil(f.length/2)),E=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.hex.decode(f,E,this.write),this;if(y==="base64")return this.accommodate(Math.ceil(f.length/4)*3),E=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.base64.decode(f,E,this.write),this;if(y==="utf8"&&(f=n.encodeUtf8(f),y="binary"),y==="binary"||y==="raw")return this.accommodate(f.length),E=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.raw.decode(E),this;if(y==="utf16")return this.accommodate(f.length*2),E=new Uint16Array(this.data.buffer,this.write),this.write+=n.text.utf16.encode(E),this;throw new Error("Invalid encoding: "+y)}throw Error("Invalid parameter: "+f)},n.DataBuffer.prototype.putBuffer=function(f){return this.putBytes(f),f.clear(),this},n.DataBuffer.prototype.putString=function(f){return this.putBytes(f,"utf16")},n.DataBuffer.prototype.putInt16=function(f){return this.accommodate(2),this.data.setInt16(this.write,f),this.write+=2,this},n.DataBuffer.prototype.putInt24=function(f){return this.accommodate(3),this.data.setInt16(this.write,f>>8&65535),this.data.setInt8(this.write,f>>16&255),this.write+=3,this},n.DataBuffer.prototype.putInt32=function(f){return this.accommodate(4),this.data.setInt32(this.write,f),this.write+=4,this},n.DataBuffer.prototype.putInt16Le=function(f){return this.accommodate(2),this.data.setInt16(this.write,f,!0),this.write+=2,this},n.DataBuffer.prototype.putInt24Le=function(f){return this.accommodate(3),this.data.setInt8(this.write,f>>16&255),this.data.setInt16(this.write,f>>8&65535,!0),this.write+=3,this},n.DataBuffer.prototype.putInt32Le=function(f){return this.accommodate(4),this.data.setInt32(this.write,f,!0),this.write+=4,this},n.DataBuffer.prototype.putInt=function(f,y){r(y),this.accommodate(y/8);do y-=8,this.data.setInt8(this.write++,f>>y&255);while(y>0);return this},n.DataBuffer.prototype.putSignedInt=function(f,y){return r(y),this.accommodate(y/8),f<0&&(f+=2<<y-1),this.putInt(f,y)},n.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},n.DataBuffer.prototype.getInt16=function(){var f=this.data.getInt16(this.read);return this.read+=2,f},n.DataBuffer.prototype.getInt24=function(){var f=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,f},n.DataBuffer.prototype.getInt32=function(){var f=this.data.getInt32(this.read);return this.read+=4,f},n.DataBuffer.prototype.getInt16Le=function(){var f=this.data.getInt16(this.read,!0);return this.read+=2,f},n.DataBuffer.prototype.getInt24Le=function(){var f=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,f},n.DataBuffer.prototype.getInt32Le=function(){var f=this.data.getInt32(this.read,!0);return this.read+=4,f},n.DataBuffer.prototype.getInt=function(f){r(f);var y=0;do y=(y<<8)+this.data.getInt8(this.read++),f-=8;while(f>0);return y},n.DataBuffer.prototype.getSignedInt=function(f){var y=this.getInt(f),C=2<<f-2;return y>=C&&(y-=C<<1),y},n.DataBuffer.prototype.getBytes=function(f){var y;return f?(f=Math.min(this.length(),f),y=this.data.slice(this.read,this.read+f),this.read+=f):f===0?y="":(y=this.read===0?this.data:this.data.slice(this.read),this.clear()),y},n.DataBuffer.prototype.bytes=function(f){return typeof f>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+f)},n.DataBuffer.prototype.at=function(f){return this.data.getUint8(this.read+f)},n.DataBuffer.prototype.setAt=function(f,y){return this.data.setUint8(f,y),this},n.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},n.DataBuffer.prototype.copy=function(){return new n.DataBuffer(this)},n.DataBuffer.prototype.compact=function(){if(this.read>0){var f=new Uint8Array(this.data.buffer,this.read),y=new Uint8Array(f.byteLength);y.set(f),this.data=new DataView(y),this.write-=this.read,this.read=0}return this},n.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},n.DataBuffer.prototype.truncate=function(f){return this.write=Math.max(0,this.length()-f),this.read=Math.min(this.read,this.write),this},n.DataBuffer.prototype.toHex=function(){for(var f="",y=this.read;y<this.data.byteLength;++y){var C=this.data.getUint8(y);C<16&&(f+="0"),f+=C.toString(16)}return f},n.DataBuffer.prototype.toString=function(f){var y=new Uint8Array(this.data,this.read,this.length());if(f=f||"utf8",f==="binary"||f==="raw")return n.binary.raw.encode(y);if(f==="hex")return n.binary.hex.encode(y);if(f==="base64")return n.binary.base64.encode(y);if(f==="utf8")return n.text.utf8.decode(y);if(f==="utf16")return n.text.utf16.decode(y);throw new Error("Invalid encoding: "+f)},n.createBuffer=function(f,y){return y=y||"raw",f!==void 0&&y==="utf8"&&(f=n.encodeUtf8(f)),new n.ByteBuffer(f)},n.fillString=function(f,y){for(var C="";y>0;)y&1&&(C+=f),y>>>=1,y>0&&(f+=f);return C},n.xorBytes=function(f,y,C){for(var S="",w="",E="",x=0,g=0;C>0;--C,++x)w=f.charCodeAt(x)^y.charCodeAt(x),g>=10&&(S+=E,E="",g=0),E+=String.fromCharCode(w),++g;return S+=E,S},n.hexToBytes=function(f){var y="",C=0;for(f.length&!0&&(C=1,y+=String.fromCharCode(parseInt(f[0],16)));C<f.length;C+=2)y+=String.fromCharCode(parseInt(f.substr(C,2),16));return y},n.bytesToHex=function(f){return n.createBuffer(f).toHex()},n.int32ToBytes=function(f){return String.fromCharCode(f>>24&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255)};var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],u="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";n.encode64=function(f,y){for(var C="",S="",w,E,x,g=0;g<f.length;)w=f.charCodeAt(g++),E=f.charCodeAt(g++),x=f.charCodeAt(g++),C+=s.charAt(w>>2),C+=s.charAt((w&3)<<4|E>>4),isNaN(E)?C+="==":(C+=s.charAt((E&15)<<2|x>>6),C+=isNaN(x)?"=":s.charAt(x&63)),y&&C.length>y&&(S+=C.substr(0,y)+`\r
2
+ `)}return o},e.decode=function(r,i){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof i!="string")throw new TypeError('"alphabet" must be a string.');var a=t[i];if(!a){a=t[i]=[];for(var o=0;o<i.length;++o)a[i.charCodeAt(o)]=o}r=r.replace(/\s/g,"");for(var s=i.length,l=i.charAt(0),u=[0],o=0;o<r.length;o++){var c=a[r.charCodeAt(o)];if(c===void 0)return;for(var p=0,h=c;p<u.length;++p)h+=u[p]*s,u[p]=h&255,h>>=8;for(;h>0;)u.push(h&255),h>>=8}for(var d=0;r[d]===l&&d<r.length-1;++d)u.push(0);return typeof Buffer<"u"?Buffer.from(u.reverse()):new Uint8Array(u.reverse())};function n(r,i){var a=0,o=i.length,s=i.charAt(0),l=[0];for(a=0;a<r.length();++a){for(var u=0,c=r.at(a);u<l.length;++u)c+=l[u]<<8,l[u]=c%o,c=c/o|0;for(;c>0;)l.push(c%o),c=c/o|0}var p="";for(a=0;r.at(a)===0&&a<r.length()-1;++a)p+=s;for(a=l.length-1;a>=0;--a)p+=i[l[a]];return p}return Sd}var Qp;function Xe(){if(Qp)return Ed.exports;Qp=1;var e=Le(),t=iD(),n=Ed.exports=e.util=e.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){n.nextTick=process.nextTick,typeof setImmediate=="function"?n.setImmediate=setImmediate:n.setImmediate=n.nextTick;return}if(typeof setImmediate=="function"){n.setImmediate=function(){return setImmediate.apply(void 0,arguments)},n.nextTick=function(x){return setImmediate(x)};return}if(n.setImmediate=function(x){setTimeout(x,0)},typeof window<"u"&&typeof window.postMessage=="function"){let x=function(g){if(g.source===window&&g.data===f){g.stopPropagation();var I=y.slice();y.length=0,I.forEach(function(A){A()})}};var f="forge.setImmediate",y=[];n.setImmediate=function(g){y.push(g),y.length===1&&window.postMessage(f,"*")},window.addEventListener("message",x,!0)}if(typeof MutationObserver<"u"){var C=Date.now(),S=!0,w=document.createElement("div"),y=[];new MutationObserver(function(){var g=y.slice();y.length=0,g.forEach(function(I){I()})}).observe(w,{attributes:!0});var E=n.setImmediate;n.setImmediate=function(g){Date.now()-C>15?(C=Date.now(),E(g)):(y.push(g),y.length===1&&w.setAttribute("a",S=!S))}}n.nextTick=n.setImmediate})(),n.isNodejs=typeof process<"u"&&process.versions&&process.versions.node,n.globalScope=function(){return n.isNodejs?tD:typeof self>"u"?window:self}(),n.isArray=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},n.isArrayBuffer=function(f){return typeof ArrayBuffer<"u"&&f instanceof ArrayBuffer},n.isArrayBufferView=function(f){return f&&n.isArrayBuffer(f.buffer)&&f.byteLength!==void 0};function r(f){if(!(f===8||f===16||f===24||f===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+f)}n.ByteBuffer=i;function i(f){if(this.data="",this.read=0,typeof f=="string")this.data=f;else if(n.isArrayBuffer(f)||n.isArrayBufferView(f))if(typeof Buffer<"u"&&f instanceof Buffer)this.data=f.toString("binary");else{var y=new Uint8Array(f);try{this.data=String.fromCharCode.apply(null,y)}catch{for(var C=0;C<y.length;++C)this.putByte(y[C])}}else(f instanceof i||typeof f=="object"&&typeof f.data=="string"&&typeof f.read=="number")&&(this.data=f.data,this.read=f.read);this._constructedStringLength=0}n.ByteStringBuffer=i;var a=4096;n.ByteStringBuffer.prototype._optimizeConstructedString=function(f){this._constructedStringLength+=f,this._constructedStringLength>a&&(this.data.substr(0,1),this._constructedStringLength=0)},n.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},n.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},n.ByteStringBuffer.prototype.putByte=function(f){return this.putBytes(String.fromCharCode(f))},n.ByteStringBuffer.prototype.fillWithByte=function(f,y){f=String.fromCharCode(f);for(var C=this.data;y>0;)y&1&&(C+=f),y>>>=1,y>0&&(f+=f);return this.data=C,this._optimizeConstructedString(y),this},n.ByteStringBuffer.prototype.putBytes=function(f){return this.data+=f,this._optimizeConstructedString(f.length),this},n.ByteStringBuffer.prototype.putString=function(f){return this.putBytes(n.encodeUtf8(f))},n.ByteStringBuffer.prototype.putInt16=function(f){return this.putBytes(String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},n.ByteStringBuffer.prototype.putInt24=function(f){return this.putBytes(String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},n.ByteStringBuffer.prototype.putInt32=function(f){return this.putBytes(String.fromCharCode(f>>24&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255))},n.ByteStringBuffer.prototype.putInt16Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255))},n.ByteStringBuffer.prototype.putInt24Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f>>16&255))},n.ByteStringBuffer.prototype.putInt32Le=function(f){return this.putBytes(String.fromCharCode(f&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>24&255))},n.ByteStringBuffer.prototype.putInt=function(f,y){r(y);var C="";do y-=8,C+=String.fromCharCode(f>>y&255);while(y>0);return this.putBytes(C)},n.ByteStringBuffer.prototype.putSignedInt=function(f,y){return f<0&&(f+=2<<y-1),this.putInt(f,y)},n.ByteStringBuffer.prototype.putBuffer=function(f){return this.putBytes(f.getBytes())},n.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},n.ByteStringBuffer.prototype.getInt16=function(){var f=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,f},n.ByteStringBuffer.prototype.getInt24=function(){var f=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,f},n.ByteStringBuffer.prototype.getInt32=function(){var f=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,f},n.ByteStringBuffer.prototype.getInt16Le=function(){var f=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,f},n.ByteStringBuffer.prototype.getInt24Le=function(){var f=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,f},n.ByteStringBuffer.prototype.getInt32Le=function(){var f=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,f},n.ByteStringBuffer.prototype.getInt=function(f){r(f);var y=0;do y=(y<<8)+this.data.charCodeAt(this.read++),f-=8;while(f>0);return y},n.ByteStringBuffer.prototype.getSignedInt=function(f){var y=this.getInt(f),C=2<<f-2;return y>=C&&(y-=C<<1),y},n.ByteStringBuffer.prototype.getBytes=function(f){var y;return f?(f=Math.min(this.length(),f),y=this.data.slice(this.read,this.read+f),this.read+=f):f===0?y="":(y=this.read===0?this.data:this.data.slice(this.read),this.clear()),y},n.ByteStringBuffer.prototype.bytes=function(f){return typeof f>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+f)},n.ByteStringBuffer.prototype.at=function(f){return this.data.charCodeAt(this.read+f)},n.ByteStringBuffer.prototype.setAt=function(f,y){return this.data=this.data.substr(0,this.read+f)+String.fromCharCode(y)+this.data.substr(this.read+f+1),this},n.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},n.ByteStringBuffer.prototype.copy=function(){var f=n.createBuffer(this.data);return f.read=this.read,f},n.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},n.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},n.ByteStringBuffer.prototype.truncate=function(f){var y=Math.max(0,this.length()-f);return this.data=this.data.substr(this.read,y),this.read=0,this},n.ByteStringBuffer.prototype.toHex=function(){for(var f="",y=this.read;y<this.data.length;++y){var C=this.data.charCodeAt(y);C<16&&(f+="0"),f+=C.toString(16)}return f},n.ByteStringBuffer.prototype.toString=function(){return n.decodeUtf8(this.bytes())};function o(f,y){y=y||{},this.read=y.readOffset||0,this.growSize=y.growSize||1024;var C=n.isArrayBuffer(f),S=n.isArrayBufferView(f);if(C||S){C?this.data=new DataView(f):this.data=new DataView(f.buffer,f.byteOffset,f.byteLength),this.write="writeOffset"in y?y.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,f!=null&&this.putBytes(f),"writeOffset"in y&&(this.write=y.writeOffset)}n.DataBuffer=o,n.DataBuffer.prototype.length=function(){return this.write-this.read},n.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},n.DataBuffer.prototype.accommodate=function(f,y){if(this.length()>=f)return this;y=Math.max(y||this.growSize,f);var C=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),S=new Uint8Array(this.length()+y);return S.set(C),this.data=new DataView(S.buffer),this},n.DataBuffer.prototype.putByte=function(f){return this.accommodate(1),this.data.setUint8(this.write++,f),this},n.DataBuffer.prototype.fillWithByte=function(f,y){this.accommodate(y);for(var C=0;C<y;++C)this.data.setUint8(f);return this},n.DataBuffer.prototype.putBytes=function(f,y){if(n.isArrayBufferView(f)){var C=new Uint8Array(f.buffer,f.byteOffset,f.byteLength),S=C.byteLength-C.byteOffset;this.accommodate(S);var w=new Uint8Array(this.data.buffer,this.write);return w.set(C),this.write+=S,this}if(n.isArrayBuffer(f)){var C=new Uint8Array(f);this.accommodate(C.byteLength);var w=new Uint8Array(this.data.buffer);return w.set(C,this.write),this.write+=C.byteLength,this}if(f instanceof n.DataBuffer||typeof f=="object"&&typeof f.read=="number"&&typeof f.write=="number"&&n.isArrayBufferView(f.data)){var C=new Uint8Array(f.data.byteLength,f.read,f.length());this.accommodate(C.byteLength);var w=new Uint8Array(f.data.byteLength,this.write);return w.set(C),this.write+=C.byteLength,this}if(f instanceof n.ByteStringBuffer&&(f=f.data,y="binary"),y=y||"binary",typeof f=="string"){var E;if(y==="hex")return this.accommodate(Math.ceil(f.length/2)),E=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.hex.decode(f,E,this.write),this;if(y==="base64")return this.accommodate(Math.ceil(f.length/4)*3),E=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.base64.decode(f,E,this.write),this;if(y==="utf8"&&(f=n.encodeUtf8(f),y="binary"),y==="binary"||y==="raw")return this.accommodate(f.length),E=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.raw.decode(E),this;if(y==="utf16")return this.accommodate(f.length*2),E=new Uint16Array(this.data.buffer,this.write),this.write+=n.text.utf16.encode(E),this;throw new Error("Invalid encoding: "+y)}throw Error("Invalid parameter: "+f)},n.DataBuffer.prototype.putBuffer=function(f){return this.putBytes(f),f.clear(),this},n.DataBuffer.prototype.putString=function(f){return this.putBytes(f,"utf16")},n.DataBuffer.prototype.putInt16=function(f){return this.accommodate(2),this.data.setInt16(this.write,f),this.write+=2,this},n.DataBuffer.prototype.putInt24=function(f){return this.accommodate(3),this.data.setInt16(this.write,f>>8&65535),this.data.setInt8(this.write,f>>16&255),this.write+=3,this},n.DataBuffer.prototype.putInt32=function(f){return this.accommodate(4),this.data.setInt32(this.write,f),this.write+=4,this},n.DataBuffer.prototype.putInt16Le=function(f){return this.accommodate(2),this.data.setInt16(this.write,f,!0),this.write+=2,this},n.DataBuffer.prototype.putInt24Le=function(f){return this.accommodate(3),this.data.setInt8(this.write,f>>16&255),this.data.setInt16(this.write,f>>8&65535,!0),this.write+=3,this},n.DataBuffer.prototype.putInt32Le=function(f){return this.accommodate(4),this.data.setInt32(this.write,f,!0),this.write+=4,this},n.DataBuffer.prototype.putInt=function(f,y){r(y),this.accommodate(y/8);do y-=8,this.data.setInt8(this.write++,f>>y&255);while(y>0);return this},n.DataBuffer.prototype.putSignedInt=function(f,y){return r(y),this.accommodate(y/8),f<0&&(f+=2<<y-1),this.putInt(f,y)},n.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},n.DataBuffer.prototype.getInt16=function(){var f=this.data.getInt16(this.read);return this.read+=2,f},n.DataBuffer.prototype.getInt24=function(){var f=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,f},n.DataBuffer.prototype.getInt32=function(){var f=this.data.getInt32(this.read);return this.read+=4,f},n.DataBuffer.prototype.getInt16Le=function(){var f=this.data.getInt16(this.read,!0);return this.read+=2,f},n.DataBuffer.prototype.getInt24Le=function(){var f=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,f},n.DataBuffer.prototype.getInt32Le=function(){var f=this.data.getInt32(this.read,!0);return this.read+=4,f},n.DataBuffer.prototype.getInt=function(f){r(f);var y=0;do y=(y<<8)+this.data.getInt8(this.read++),f-=8;while(f>0);return y},n.DataBuffer.prototype.getSignedInt=function(f){var y=this.getInt(f),C=2<<f-2;return y>=C&&(y-=C<<1),y},n.DataBuffer.prototype.getBytes=function(f){var y;return f?(f=Math.min(this.length(),f),y=this.data.slice(this.read,this.read+f),this.read+=f):f===0?y="":(y=this.read===0?this.data:this.data.slice(this.read),this.clear()),y},n.DataBuffer.prototype.bytes=function(f){return typeof f>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+f)},n.DataBuffer.prototype.at=function(f){return this.data.getUint8(this.read+f)},n.DataBuffer.prototype.setAt=function(f,y){return this.data.setUint8(f,y),this},n.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},n.DataBuffer.prototype.copy=function(){return new n.DataBuffer(this)},n.DataBuffer.prototype.compact=function(){if(this.read>0){var f=new Uint8Array(this.data.buffer,this.read),y=new Uint8Array(f.byteLength);y.set(f),this.data=new DataView(y),this.write-=this.read,this.read=0}return this},n.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},n.DataBuffer.prototype.truncate=function(f){return this.write=Math.max(0,this.length()-f),this.read=Math.min(this.read,this.write),this},n.DataBuffer.prototype.toHex=function(){for(var f="",y=this.read;y<this.data.byteLength;++y){var C=this.data.getUint8(y);C<16&&(f+="0"),f+=C.toString(16)}return f},n.DataBuffer.prototype.toString=function(f){var y=new Uint8Array(this.data,this.read,this.length());if(f=f||"utf8",f==="binary"||f==="raw")return n.binary.raw.encode(y);if(f==="hex")return n.binary.hex.encode(y);if(f==="base64")return n.binary.base64.encode(y);if(f==="utf8")return n.text.utf8.decode(y);if(f==="utf16")return n.text.utf16.decode(y);throw new Error("Invalid encoding: "+f)},n.createBuffer=function(f,y){return y=y||"raw",f!==void 0&&y==="utf8"&&(f=n.encodeUtf8(f)),new n.ByteBuffer(f)},n.fillString=function(f,y){for(var C="";y>0;)y&1&&(C+=f),y>>>=1,y>0&&(f+=f);return C},n.xorBytes=function(f,y,C){for(var S="",w="",E="",x=0,g=0;C>0;--C,++x)w=f.charCodeAt(x)^y.charCodeAt(x),g>=10&&(S+=E,E="",g=0),E+=String.fromCharCode(w),++g;return S+=E,S},n.hexToBytes=function(f){var y="",C=0;for(f.length&!0&&(C=1,y+=String.fromCharCode(parseInt(f[0],16)));C<f.length;C+=2)y+=String.fromCharCode(parseInt(f.substr(C,2),16));return y},n.bytesToHex=function(f){return n.createBuffer(f).toHex()},n.int32ToBytes=function(f){return String.fromCharCode(f>>24&255)+String.fromCharCode(f>>16&255)+String.fromCharCode(f>>8&255)+String.fromCharCode(f&255)};var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],u="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";n.encode64=function(f,y){for(var C="",S="",w,E,x,g=0;g<f.length;)w=f.charCodeAt(g++),E=f.charCodeAt(g++),x=f.charCodeAt(g++),C+=s.charAt(w>>2),C+=s.charAt((w&3)<<4|E>>4),isNaN(E)?C+="==":(C+=s.charAt((E&15)<<2|x>>6),C+=isNaN(x)?"=":s.charAt(x&63)),y&&C.length>y&&(S+=C.substr(0,y)+`\r
3
3
  `,C=C.substr(y));return S+=C,S},n.decode64=function(f){f=f.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var y="",C,S,w,E,x=0;x<f.length;)C=l[f.charCodeAt(x++)-43],S=l[f.charCodeAt(x++)-43],w=l[f.charCodeAt(x++)-43],E=l[f.charCodeAt(x++)-43],y+=String.fromCharCode(C<<2|S>>4),w!==64&&(y+=String.fromCharCode((S&15)<<4|w>>2),E!==64&&(y+=String.fromCharCode((w&3)<<6|E)));return y},n.encodeUtf8=function(f){return unescape(encodeURIComponent(f))},n.decodeUtf8=function(f){return decodeURIComponent(escape(f))},n.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:t.encode,decode:t.decode}},n.binary.raw.encode=function(f){return String.fromCharCode.apply(null,f)},n.binary.raw.decode=function(f,y,C){var S=y;S||(S=new Uint8Array(f.length)),C=C||0;for(var w=C,E=0;E<f.length;++E)S[w++]=f.charCodeAt(E);return y?w-C:S},n.binary.hex.encode=n.bytesToHex,n.binary.hex.decode=function(f,y,C){var S=y;S||(S=new Uint8Array(Math.ceil(f.length/2))),C=C||0;var w=0,E=C;for(f.length&1&&(w=1,S[E++]=parseInt(f[0],16));w<f.length;w+=2)S[E++]=parseInt(f.substr(w,2),16);return y?E-C:S},n.binary.base64.encode=function(f,y){for(var C="",S="",w,E,x,g=0;g<f.byteLength;)w=f[g++],E=f[g++],x=f[g++],C+=s.charAt(w>>2),C+=s.charAt((w&3)<<4|E>>4),isNaN(E)?C+="==":(C+=s.charAt((E&15)<<2|x>>6),C+=isNaN(x)?"=":s.charAt(x&63)),y&&C.length>y&&(S+=C.substr(0,y)+`\r
4
- `,C=C.substr(y));return S+=C,S},n.binary.base64.decode=function(f,y,C){var S=y;S||(S=new Uint8Array(Math.ceil(f.length/4)*3)),f=f.replace(/[^A-Za-z0-9\+\/\=]/g,""),C=C||0;for(var w,E,x,g,I=0,A=C;I<f.length;)w=l[f.charCodeAt(I++)-43],E=l[f.charCodeAt(I++)-43],x=l[f.charCodeAt(I++)-43],g=l[f.charCodeAt(I++)-43],S[A++]=w<<2|E>>4,x!==64&&(S[A++]=(E&15)<<4|x>>2,g!==64&&(S[A++]=(x&3)<<6|g));return y?A-C:S.subarray(0,A)},n.binary.base58.encode=function(f,y){return n.binary.baseN.encode(f,u,y)},n.binary.base58.decode=function(f,y){return n.binary.baseN.decode(f,u,y)},n.text={utf8:{},utf16:{}},n.text.utf8.encode=function(f,y,C){f=n.encodeUtf8(f);var S=y;S||(S=new Uint8Array(f.length)),C=C||0;for(var w=C,E=0;E<f.length;++E)S[w++]=f.charCodeAt(E);return y?w-C:S},n.text.utf8.decode=function(f){return n.decodeUtf8(String.fromCharCode.apply(null,f))},n.text.utf16.encode=function(f,y,C){var S=y;S||(S=new Uint8Array(f.length*2));var w=new Uint16Array(S.buffer);C=C||0;for(var E=C,x=C,g=0;g<f.length;++g)w[x++]=f.charCodeAt(g),E+=2;return y?E-C:S},n.text.utf16.decode=function(f){return String.fromCharCode.apply(null,new Uint16Array(f.buffer))},n.deflate=function(f,y,C){if(y=n.decode64(f.deflate(n.encode64(y)).rval),C){var S=2,w=y.charCodeAt(1);w&32&&(S=6),y=y.substring(S,y.length-4)}return y},n.inflate=function(f,y,C){var S=f.inflate(n.encode64(y)).rval;return S===null?null:n.decode64(S)};var c=function(f,y,C){if(!f)throw new Error("WebStorage not available.");var S;if(C===null?S=f.removeItem(y):(C=n.encode64(JSON.stringify(C)),S=f.setItem(y,C)),typeof S<"u"&&S.rval!==!0){var w=new Error(S.error.message);throw w.id=S.error.id,w.name=S.error.name,w}},p=function(f,y){if(!f)throw new Error("WebStorage not available.");var C=f.getItem(y);if(f.init)if(C.rval===null){if(C.error){var S=new Error(C.error.message);throw S.id=C.error.id,S.name=C.error.name,S}C=null}else C=C.rval;return C!==null&&(C=JSON.parse(n.decode64(C))),C},h=function(f,y,C,S){var w=p(f,y);w===null&&(w={}),w[C]=S,c(f,y,w)},d=function(f,y,C){var S=p(f,y);return S!==null&&(S=C in S?S[C]:null),S},v=function(f,y,C){var S=p(f,y);if(S!==null&&C in S){delete S[C];var w=!0;for(var E in S){w=!1;break}w&&(S=null),c(f,y,S)}},m=function(f,y){c(f,y,null)},b=function(f,y,C){var S=null;typeof C>"u"&&(C=["web","flash"]);var w,E=!1,x=null;for(var g in C){w=C[g];try{if(w==="flash"||w==="both"){if(y[0]===null)throw new Error("Flash local storage not available.");S=f.apply(this,y),E=w==="flash"}(w==="web"||w==="both")&&(y[0]=localStorage,S=f.apply(this,y),E=!0)}catch(I){x=I}if(E)break}if(!E)throw x;return S};return n.setItem=function(f,y,C,S,w){b(h,arguments,w)},n.getItem=function(f,y,C,S){return b(d,arguments,S)},n.removeItem=function(f,y,C,S){b(v,arguments,S)},n.clearItems=function(f,y,C){b(m,arguments,C)},n.isEmpty=function(f){for(var y in f)if(f.hasOwnProperty(y))return!1;return!0},n.format=function(f){for(var y=/%./g,C,S,w=0,E=[],x=0;C=y.exec(f);){S=f.substring(x,y.lastIndex-2),S.length>0&&E.push(S),x=y.lastIndex;var g=C[0][1];switch(g){case"s":case"o":w<arguments.length?E.push(arguments[w+++1]):E.push("<?>");break;case"%":E.push("%");break;default:E.push("<%"+g+"?>")}}return E.push(f.substring(x)),E.join("")},n.formatNumber=function(f,y,C,S){var w=f,E=isNaN(y=Math.abs(y))?2:y,x=C===void 0?",":C,g=S===void 0?".":S,I=w<0?"-":"",A=parseInt(w=Math.abs(+w||0).toFixed(E),10)+"",_=A.length>3?A.length%3:0;return I+(_?A.substr(0,_)+g:"")+A.substr(_).replace(/(\d{3})(?=\d)/g,"$1"+g)+(E?x+Math.abs(w-A).toFixed(E).slice(2):"")},n.formatSize=function(f){return f>=1073741824?f=n.formatNumber(f/1073741824,2,".","")+" GiB":f>=1048576?f=n.formatNumber(f/1048576,2,".","")+" MiB":f>=1024?f=n.formatNumber(f/1024,0)+" KiB":f=n.formatNumber(f,0)+" bytes",f},n.bytesFromIP=function(f){return f.indexOf(".")!==-1?n.bytesFromIPv4(f):f.indexOf(":")!==-1?n.bytesFromIPv6(f):null},n.bytesFromIPv4=function(f){if(f=f.split("."),f.length!==4)return null;for(var y=n.createBuffer(),C=0;C<f.length;++C){var S=parseInt(f[C],10);if(isNaN(S))return null;y.putByte(S)}return y.getBytes()},n.bytesFromIPv6=function(f){var y=0;f=f.split(":").filter(function(x){return x.length===0&&++y,!0});for(var C=(8-f.length+y)*2,S=n.createBuffer(),w=0;w<8;++w){if(!f[w]||f[w].length===0){S.fillWithByte(0,C),C=0;continue}var E=n.hexToBytes(f[w]);E.length<2&&S.putByte(0),S.putBytes(E)}return S.getBytes()},n.bytesToIP=function(f){return f.length===4?n.bytesToIPv4(f):f.length===16?n.bytesToIPv6(f):null},n.bytesToIPv4=function(f){if(f.length!==4)return null;for(var y=[],C=0;C<f.length;++C)y.push(f.charCodeAt(C));return y.join(".")},n.bytesToIPv6=function(f){if(f.length!==16)return null;for(var y=[],C=[],S=0,w=0;w<f.length;w+=2){for(var E=n.bytesToHex(f[w]+f[w+1]);E[0]==="0"&&E!=="0";)E=E.substr(1);if(E==="0"){var x=C[C.length-1],g=y.length;!x||g!==x.end+1?C.push({start:g,end:g}):(x.end=g,x.end-x.start>C[S].end-C[S].start&&(S=C.length-1))}y.push(E)}if(C.length>0){var I=C[S];I.end-I.start>0&&(y.splice(I.start,I.end-I.start+1,""),I.start===0&&y.unshift(""),I.end===7&&y.push(""))}return y.join(":")},n.estimateCores=function(f,y){if(typeof f=="function"&&(y=f,f={}),f=f||{},"cores"in n&&!f.update)return y(null,n.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return n.cores=navigator.hardwareConcurrency,y(null,n.cores);if(typeof Worker>"u")return n.cores=1,y(null,n.cores);if(typeof Blob>"u")return n.cores=2,y(null,n.cores);var C=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(x){var g=Date.now(),I=g+4;self.postMessage({st:g,et:I})})}).toString(),")()"],{type:"application/javascript"}));S([],5,16);function S(x,g,I){if(g===0){var A=Math.floor(x.reduce(function(_,T){return _+T},0)/x.length);return n.cores=Math.max(1,A),URL.revokeObjectURL(C),y(null,n.cores)}w(I,function(_,T){x.push(E(I,T)),S(x,g-1,I)})}function w(x,g){for(var I=[],A=[],_=0;_<x;++_){var T=new Worker(C);T.addEventListener("message",function($){if(A.push($.data),A.length===x){for(var B=0;B<x;++B)I[B].terminate();g(null,A)}}),I.push(T)}for(var _=0;_<x;++_)I[_].postMessage(_)}function E(x,g){for(var I=[],A=0;A<x;++A)for(var _=g[A],T=I[A]=[],$=0;$<x;++$)if(A!==$){var B=g[$];(_.st>B.st&&_.st<B.et||B.st>_.st&&B.st<_.et)&&T.push($)}return I.reduce(function(P,k){return Math.max(P,k.length)},0)}},Ed.exports}var wd,em;function L0(){if(em)return wd;em=1;var e=Le();Ue(),wd=e.cipher=e.cipher||{},e.cipher.algorithms=e.cipher.algorithms||{},e.cipher.createCipher=function(n,r){var i=n;if(typeof i=="string"&&(i=e.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+n);return new e.cipher.BlockCipher({algorithm:i,key:r,decrypt:!1})},e.cipher.createDecipher=function(n,r){var i=n;if(typeof i=="string"&&(i=e.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+n);return new e.cipher.BlockCipher({algorithm:i,key:r,decrypt:!0})},e.cipher.registerAlgorithm=function(n,r){n=n.toUpperCase(),e.cipher.algorithms[n]=r},e.cipher.getAlgorithm=function(n){return n=n.toUpperCase(),n in e.cipher.algorithms?e.cipher.algorithms[n]:null};var t=e.cipher.BlockCipher=function(n){this.algorithm=n.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=n.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=n.decrypt,this.algorithm.initialize(n)};return t.prototype.start=function(n){n=n||{};var r={};for(var i in n)r[i]=n[i];r.decrypt=this._decrypt,this._finish=!1,this._input=e.util.createBuffer(),this.output=n.output||e.util.createBuffer(),this.mode.start(r)},t.prototype.update=function(n){for(n&&this._input.putBuffer(n);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},t.prototype.finish=function(n){n&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(i){return n(this.blockSize,i,!1)},this.mode.unpad=function(i){return n(this.blockSize,i,!0)});var r={};return r.decrypt=this._decrypt,r.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,r)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,r))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,r))},wd}var Id={exports:{}},tm;function bx(){if(tm)return Id.exports;tm=1;var e=Le();Ue(),e.cipher=e.cipher||{};var t=Id.exports=e.cipher.modes=e.cipher.modes||{};t.ecb=function(a){a=a||{},this.name="ECB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(a){},t.ecb.prototype.encrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._outBlock[l])},t.ecb.prototype.decrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._outBlock[l])},t.ecb.prototype.pad=function(a,o){var s=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();return a.fillWithByte(s,s),!0},t.ecb.prototype.unpad=function(a,o){if(o.overflow>0)return!1;var s=a.length(),l=a.at(s-1);return l>this.blockSize<<2?!1:(a.truncate(l),!0)},t.cbc=function(a){a=a||{},this.name="CBC",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(a){if(a.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=n(a.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},t.cbc.prototype.encrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=this._prev[l]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._outBlock[l]);this._prev=this._outBlock},t.cbc.prototype.decrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._prev[l]^this._outBlock[l]);this._prev=this._inBlock.slice(0)},t.cbc.prototype.pad=function(a,o){var s=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();return a.fillWithByte(s,s),!0},t.cbc.prototype.unpad=function(a,o){if(o.overflow>0)return!1;var s=a.length(),l=a.at(s-1);return l>this.blockSize<<2?!1:(a.truncate(l),!0)},t.cfb=function(a){a=a||{},this.name="CFB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=n(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)this._inBlock[u]=a.getInt32()^this._outBlock[u],o.putInt32(this._inBlock[u]);return}var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialBlock[u]=a.getInt32()^this._outBlock[u],this._partialOutput.putInt32(this._partialBlock[u]);if(c>0)a.read-=this.blockSize;else for(var u=0;u<this._ints;++u)this._inBlock[u]=this._partialBlock[u];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0},t.cfb.prototype.decrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)this._inBlock[u]=a.getInt32(),o.putInt32(this._inBlock[u]^this._outBlock[u]);return}var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialBlock[u]=a.getInt32(),this._partialOutput.putInt32(this._partialBlock[u]^this._outBlock[u]);if(c>0)a.read-=this.blockSize;else for(var u=0;u<this._ints;++u)this._inBlock[u]=this._partialBlock[u];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0},t.ofb=function(a){a=a||{},this.name="OFB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=n(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(a,o,s){var l=a.length();if(a.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)o.putInt32(a.getInt32()^this._outBlock[u]),this._inBlock[u]=this._outBlock[u];return}var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialOutput.putInt32(a.getInt32()^this._outBlock[u]);if(c>0)a.read-=this.blockSize;else for(var u=0;u<this._ints;++u)this._inBlock[u]=this._outBlock[u];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(a){a=a||{},this.name="CTR",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=n(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize)for(var u=0;u<this._ints;++u)o.putInt32(a.getInt32()^this._outBlock[u]);else{var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialOutput.putInt32(a.getInt32()^this._outBlock[u]);if(c>0&&(a.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0}r(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(a){a=a||{},this.name="GCM",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");var o=e.util.createBuffer(a.iv);this._cipherLength=0;var s;if("additionalData"in a?s=e.util.createBuffer(a.additionalData):s=e.util.createBuffer(),"tagLength"in a?this._tagLength=a.tagLength:this._tagLength=128,this._tag=null,a.decrypt&&(this._tag=e.util.createBuffer(a.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var l=o.length();if(l===12)this._j0=[o.getInt32(),o.getInt32(),o.getInt32(),1];else{for(this._j0=[0,0,0,0];o.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[o.getInt32(),o.getInt32(),o.getInt32(),o.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(i(l*8)))}this._inBlock=this._j0.slice(0),r(this._inBlock),this._partialBytes=0,s=e.util.createBuffer(s),this._aDataLength=i(s.length()*8);var u=s.length()%this.blockSize;for(u&&s.fillWithByte(0,this.blockSize-u),this._s=[0,0,0,0];s.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[s.getInt32(),s.getInt32(),s.getInt32(),s.getInt32()])},t.gcm.prototype.encrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)o.putInt32(this._outBlock[u]^=a.getInt32());this._cipherLength+=this.blockSize}else{var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialOutput.putInt32(a.getInt32()^this._outBlock[u]);if(c<=0||s){if(s){var p=l%this.blockSize;this._cipherLength+=p,this._partialOutput.truncate(this.blockSize-p)}else this._cipherLength+=this.blockSize;for(var u=0;u<this._ints;++u)this._outBlock[u]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return a.read-=this.blockSize,o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),r(this._inBlock)},t.gcm.prototype.decrypt=function(a,o,s){var l=a.length();if(l<this.blockSize&&!(s&&l>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),r(this._inBlock),this._hashBlock[0]=a.getInt32(),this._hashBlock[1]=a.getInt32(),this._hashBlock[2]=a.getInt32(),this._hashBlock[3]=a.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var u=0;u<this._ints;++u)o.putInt32(this._outBlock[u]^this._hashBlock[u]);l<this.blockSize?this._cipherLength+=l%this.blockSize:this._cipherLength+=this.blockSize},t.gcm.prototype.afterFinish=function(a,o){var s=!0;o.decrypt&&o.overflow&&a.truncate(this.blockSize-o.overflow),this.tag=e.util.createBuffer();var l=this._aDataLength.concat(i(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,l);var u=[];this.cipher.encrypt(this._j0,u);for(var c=0;c<this._ints;++c)this.tag.putInt32(this._s[c]^u[c]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),o.decrypt&&this.tag.bytes()!==this._tag&&(s=!1),s},t.gcm.prototype.multiply=function(a,o){for(var s=[0,0,0,0],l=o.slice(0),u=0;u<128;++u){var c=a[u/32|0]&1<<31-u%32;c&&(s[0]^=l[0],s[1]^=l[1],s[2]^=l[2],s[3]^=l[3]),this.pow(l,l)}return s},t.gcm.prototype.pow=function(a,o){for(var s=a[3]&1,l=3;l>0;--l)o[l]=a[l]>>>1|(a[l-1]&1)<<31;o[0]=a[0]>>>1,s&&(o[0]^=this._R)},t.gcm.prototype.tableMultiply=function(a){for(var o=[0,0,0,0],s=0;s<32;++s){var l=s/8|0,u=a[l]>>>(7-s%8)*4&15,c=this._m[s][u];o[0]^=c[0],o[1]^=c[1],o[2]^=c[2],o[3]^=c[3]}return o},t.gcm.prototype.ghash=function(a,o,s){return o[0]^=s[0],o[1]^=s[1],o[2]^=s[2],o[3]^=s[3],this.tableMultiply(o)},t.gcm.prototype.generateHashTable=function(a,o){for(var s=8/o,l=4*s,u=16*s,c=new Array(u),p=0;p<u;++p){var h=[0,0,0,0],d=p/l|0,v=(l-1-p%l)*o;h[d]=1<<o-1<<v,c[p]=this.generateSubHashTable(this.multiply(h,a),o)}return c},t.gcm.prototype.generateSubHashTable=function(a,o){var s=1<<o,l=s>>>1,u=new Array(s);u[l]=a.slice(0);for(var c=l>>>1;c>0;)this.pow(u[2*c],u[c]=[]),c>>=1;for(c=2;c<l;){for(var p=1;p<c;++p){var h=u[c],d=u[p];u[c+p]=[h[0]^d[0],h[1]^d[1],h[2]^d[2],h[3]^d[3]]}c*=2}for(u[0]=[0,0,0,0],c=l+1;c<s;++c){var v=u[c^l];u[c]=[a[0]^v[0],a[1]^v[1],a[2]^v[2],a[3]^v[3]]}return u};function n(a,o){if(typeof a=="string"&&(a=e.util.createBuffer(a)),e.util.isArray(a)&&a.length>4){var s=a;a=e.util.createBuffer();for(var l=0;l<s.length;++l)a.putByte(s[l])}if(a.length()<o)throw new Error("Invalid IV length; got "+a.length()+" bytes and expected "+o+" bytes.");if(!e.util.isArray(a)){for(var u=[],c=o/4,l=0;l<c;++l)u.push(a.getInt32());a=u}return a}function r(a){a[a.length-1]=a[a.length-1]+1&4294967295}function i(a){return[a/4294967296|0,a&4294967295]}return Id.exports}var _d,nm;function Ma(){if(nm)return _d;nm=1;var e=Le();L0(),bx(),Ue(),_d=e.aes=e.aes||{},e.aes.startEncrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!1,mode:b});return f.start(v),f},e.aes.createEncryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!1,mode:v})},e.aes.startDecrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!0,mode:b});return f.start(v),f},e.aes.createDecryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!0,mode:v})},e.aes.Algorithm=function(d,v){n||u();var m=this;m.name=d,m.mode=new v({blockSize:16,cipher:{encrypt:function(b,f){return p(m._w,b,f,!1)},decrypt:function(b,f){return p(m._w,b,f,!0)}}}),m._init=!1},e.aes.Algorithm.prototype.initialize=function(d){if(!this._init){var v=d.key,m;if(typeof v=="string"&&(v.length===16||v.length===24||v.length===32))v=e.util.createBuffer(v);else if(e.util.isArray(v)&&(v.length===16||v.length===24||v.length===32)){m=v,v=e.util.createBuffer();for(var b=0;b<m.length;++b)v.putByte(m[b])}if(!e.util.isArray(v)){m=v,v=[];var f=m.length();if(f===16||f===24||f===32){f=f>>>2;for(var b=0;b<f;++b)v.push(m.getInt32())}}if(!e.util.isArray(v)||!(v.length===4||v.length===6||v.length===8))throw new Error("Invalid key parameter.");var y=this.mode.name,C=["CFB","OFB","CTR","GCM"].indexOf(y)!==-1;this._w=c(v,d.decrypt&&!C),this._init=!0}},e.aes._expandKey=function(d,v){return n||u(),c(d,v)},e.aes._updateBlock=p,t("AES-ECB",e.cipher.modes.ecb),t("AES-CBC",e.cipher.modes.cbc),t("AES-CFB",e.cipher.modes.cfb),t("AES-OFB",e.cipher.modes.ofb),t("AES-CTR",e.cipher.modes.ctr),t("AES-GCM",e.cipher.modes.gcm);function t(d,v){var m=function(){return new e.aes.Algorithm(d,v)};e.cipher.registerAlgorithm(d,m)}var n=!1,r=4,i,a,o,s,l;function u(){n=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var d=new Array(256),v=0;v<128;++v)d[v]=v<<1,d[v+128]=v+128<<1^283;i=new Array(256),a=new Array(256),s=new Array(4),l=new Array(4);for(var v=0;v<4;++v)s[v]=new Array(256),l[v]=new Array(256);for(var m=0,b=0,f,y,C,S,w,E,x,v=0;v<256;++v){S=b^b<<1^b<<2^b<<3^b<<4,S=S>>8^S&255^99,i[m]=S,a[S]=m,w=d[S],f=d[m],y=d[f],C=d[y],E=w<<24^S<<16^S<<8^(S^w),x=(f^y^C)<<24^(m^C)<<16^(m^y^C)<<8^(m^f^C);for(var g=0;g<4;++g)s[g][m]=E,l[g][S]=x,E=E<<24|E>>>8,x=x<<24|x>>>8;m===0?m=b=1:(m=f^d[d[d[f^C]]],b^=d[d[b]])}}function c(d,v){for(var m=d.slice(0),b,f=1,y=m.length,C=y+6+1,S=r*C,w=y;w<S;++w)b=m[w-1],w%y===0?(b=i[b>>>16&255]<<24^i[b>>>8&255]<<16^i[b&255]<<8^i[b>>>24]^o[f]<<24,f++):y>6&&w%y===4&&(b=i[b>>>24]<<24^i[b>>>16&255]<<16^i[b>>>8&255]<<8^i[b&255]),m[w]=m[w-y]^b;if(v){var E,x=l[0],g=l[1],I=l[2],A=l[3],_=m.slice(0);S=m.length;for(var w=0,T=S-r;w<S;w+=r,T-=r)if(w===0||w===S-r)_[w]=m[T],_[w+1]=m[T+3],_[w+2]=m[T+2],_[w+3]=m[T+1];else for(var $=0;$<r;++$)E=m[T+$],_[w+(3&-$)]=x[i[E>>>24]]^g[i[E>>>16&255]]^I[i[E>>>8&255]]^A[i[E&255]];m=_}return m}function p(d,v,m,b){var f=d.length/4-1,y,C,S,w,E;b?(y=l[0],C=l[1],S=l[2],w=l[3],E=a):(y=s[0],C=s[1],S=s[2],w=s[3],E=i);var x,g,I,A,_,T,$;x=v[0]^d[0],g=v[b?3:1]^d[1],I=v[2]^d[2],A=v[b?1:3]^d[3];for(var B=3,P=1;P<f;++P)_=y[x>>>24]^C[g>>>16&255]^S[I>>>8&255]^w[A&255]^d[++B],T=y[g>>>24]^C[I>>>16&255]^S[A>>>8&255]^w[x&255]^d[++B],$=y[I>>>24]^C[A>>>16&255]^S[x>>>8&255]^w[g&255]^d[++B],A=y[A>>>24]^C[x>>>16&255]^S[g>>>8&255]^w[I&255]^d[++B],x=_,g=T,I=$;m[0]=E[x>>>24]<<24^E[g>>>16&255]<<16^E[I>>>8&255]<<8^E[A&255]^d[++B],m[b?3:1]=E[g>>>24]<<24^E[I>>>16&255]<<16^E[A>>>8&255]<<8^E[x&255]^d[++B],m[2]=E[I>>>24]<<24^E[A>>>16&255]<<16^E[x>>>8&255]<<8^E[g&255]^d[++B],m[b?1:3]=E[A>>>24]<<24^E[x>>>16&255]<<16^E[g>>>8&255]<<8^E[I&255]^d[++B]}function h(d){d=d||{};var v=(d.mode||"CBC").toUpperCase(),m="AES-"+v,b;d.decrypt?b=e.cipher.createDecipher(m,d.key):b=e.cipher.createCipher(m,d.key);var f=b.start;return b.start=function(y,C){var S=null;C instanceof e.util.ByteBuffer&&(S=C,C={}),C=C||{},C.output=S,C.iv=y,f.call(b,C)},b}return _d}var Dd={exports:{}},Td={exports:{}},Ad={exports:{}},rm;function Oa(){if(rm)return Ad.exports;rm=1;var e=Le();e.pki=e.pki||{};var t=Ad.exports=e.pki.oids=e.oids=e.oids||{};function n(i,a){t[i]=a,t[a]=i}function r(i,a){t[i]=a}return n("1.2.840.113549.1.1.1","rsaEncryption"),n("1.2.840.113549.1.1.4","md5WithRSAEncryption"),n("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),n("1.2.840.113549.1.1.7","RSAES-OAEP"),n("1.2.840.113549.1.1.8","mgf1"),n("1.2.840.113549.1.1.9","pSpecified"),n("1.2.840.113549.1.1.10","RSASSA-PSS"),n("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),n("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),n("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),n("1.3.101.112","EdDSA25519"),n("1.2.840.10040.4.3","dsa-with-sha1"),n("1.3.14.3.2.7","desCBC"),n("1.3.14.3.2.26","sha1"),n("1.3.14.3.2.29","sha1WithRSASignature"),n("2.16.840.1.101.3.4.2.1","sha256"),n("2.16.840.1.101.3.4.2.2","sha384"),n("2.16.840.1.101.3.4.2.3","sha512"),n("2.16.840.1.101.3.4.2.4","sha224"),n("2.16.840.1.101.3.4.2.5","sha512-224"),n("2.16.840.1.101.3.4.2.6","sha512-256"),n("1.2.840.113549.2.2","md2"),n("1.2.840.113549.2.5","md5"),n("1.2.840.113549.1.7.1","data"),n("1.2.840.113549.1.7.2","signedData"),n("1.2.840.113549.1.7.3","envelopedData"),n("1.2.840.113549.1.7.4","signedAndEnvelopedData"),n("1.2.840.113549.1.7.5","digestedData"),n("1.2.840.113549.1.7.6","encryptedData"),n("1.2.840.113549.1.9.1","emailAddress"),n("1.2.840.113549.1.9.2","unstructuredName"),n("1.2.840.113549.1.9.3","contentType"),n("1.2.840.113549.1.9.4","messageDigest"),n("1.2.840.113549.1.9.5","signingTime"),n("1.2.840.113549.1.9.6","counterSignature"),n("1.2.840.113549.1.9.7","challengePassword"),n("1.2.840.113549.1.9.8","unstructuredAddress"),n("1.2.840.113549.1.9.14","extensionRequest"),n("1.2.840.113549.1.9.20","friendlyName"),n("1.2.840.113549.1.9.21","localKeyId"),n("1.2.840.113549.1.9.22.1","x509Certificate"),n("1.2.840.113549.1.12.10.1.1","keyBag"),n("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),n("1.2.840.113549.1.12.10.1.3","certBag"),n("1.2.840.113549.1.12.10.1.4","crlBag"),n("1.2.840.113549.1.12.10.1.5","secretBag"),n("1.2.840.113549.1.12.10.1.6","safeContentsBag"),n("1.2.840.113549.1.5.13","pkcs5PBES2"),n("1.2.840.113549.1.5.12","pkcs5PBKDF2"),n("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),n("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),n("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),n("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),n("1.2.840.113549.2.7","hmacWithSHA1"),n("1.2.840.113549.2.8","hmacWithSHA224"),n("1.2.840.113549.2.9","hmacWithSHA256"),n("1.2.840.113549.2.10","hmacWithSHA384"),n("1.2.840.113549.2.11","hmacWithSHA512"),n("1.2.840.113549.3.7","des-EDE3-CBC"),n("2.16.840.1.101.3.4.1.2","aes128-CBC"),n("2.16.840.1.101.3.4.1.22","aes192-CBC"),n("2.16.840.1.101.3.4.1.42","aes256-CBC"),n("2.5.4.3","commonName"),n("2.5.4.4","surname"),n("2.5.4.5","serialNumber"),n("2.5.4.6","countryName"),n("2.5.4.7","localityName"),n("2.5.4.8","stateOrProvinceName"),n("2.5.4.9","streetAddress"),n("2.5.4.10","organizationName"),n("2.5.4.11","organizationalUnitName"),n("2.5.4.12","title"),n("2.5.4.13","description"),n("2.5.4.15","businessCategory"),n("2.5.4.17","postalCode"),n("2.5.4.42","givenName"),n("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),n("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),n("2.16.840.1.113730.1.1","nsCertType"),n("2.16.840.1.113730.1.13","nsComment"),r("2.5.29.1","authorityKeyIdentifier"),r("2.5.29.2","keyAttributes"),r("2.5.29.3","certificatePolicies"),r("2.5.29.4","keyUsageRestriction"),r("2.5.29.5","policyMapping"),r("2.5.29.6","subtreesConstraint"),r("2.5.29.7","subjectAltName"),r("2.5.29.8","issuerAltName"),r("2.5.29.9","subjectDirectoryAttributes"),r("2.5.29.10","basicConstraints"),r("2.5.29.11","nameConstraints"),r("2.5.29.12","policyConstraints"),r("2.5.29.13","basicConstraints"),n("2.5.29.14","subjectKeyIdentifier"),n("2.5.29.15","keyUsage"),r("2.5.29.16","privateKeyUsagePeriod"),n("2.5.29.17","subjectAltName"),n("2.5.29.18","issuerAltName"),n("2.5.29.19","basicConstraints"),r("2.5.29.20","cRLNumber"),r("2.5.29.21","cRLReason"),r("2.5.29.22","expirationDate"),r("2.5.29.23","instructionCode"),r("2.5.29.24","invalidityDate"),r("2.5.29.25","cRLDistributionPoints"),r("2.5.29.26","issuingDistributionPoint"),r("2.5.29.27","deltaCRLIndicator"),r("2.5.29.28","issuingDistributionPoint"),r("2.5.29.29","certificateIssuer"),r("2.5.29.30","nameConstraints"),n("2.5.29.31","cRLDistributionPoints"),n("2.5.29.32","certificatePolicies"),r("2.5.29.33","policyMappings"),r("2.5.29.34","policyConstraints"),n("2.5.29.35","authorityKeyIdentifier"),r("2.5.29.36","policyConstraints"),n("2.5.29.37","extKeyUsage"),r("2.5.29.46","freshestCRL"),r("2.5.29.54","inhibitAnyPolicy"),n("1.3.6.1.4.1.11129.2.4.2","timestampList"),n("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),n("1.3.6.1.5.5.7.3.1","serverAuth"),n("1.3.6.1.5.5.7.3.2","clientAuth"),n("1.3.6.1.5.5.7.3.3","codeSigning"),n("1.3.6.1.5.5.7.3.4","emailProtection"),n("1.3.6.1.5.5.7.3.8","timeStamping"),Ad.exports}var im;function Wr(){if(im)return Td.exports;im=1;var e=Le();Ue(),Oa();var t=Td.exports=e.asn1=e.asn1||{};t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.create=function(o,s,l,u,c){if(e.util.isArray(u)){for(var p=[],h=0;h<u.length;++h)u[h]!==void 0&&p.push(u[h]);u=p}var d={tagClass:o,type:s,constructed:l,composed:l||e.util.isArray(u),value:u};return c&&"bitStringContents"in c&&(d.bitStringContents=c.bitStringContents,d.original=t.copy(d)),d},t.copy=function(o,s){var l;if(e.util.isArray(o)){l=[];for(var u=0;u<o.length;++u)l.push(t.copy(o[u],s));return l}return typeof o=="string"?o:(l={tagClass:o.tagClass,type:o.type,constructed:o.constructed,composed:o.composed,value:t.copy(o.value,s)},s&&!s.excludeBitStringContents&&(l.bitStringContents=o.bitStringContents),l)},t.equals=function(o,s,l){if(e.util.isArray(o)){if(!e.util.isArray(s)||o.length!==s.length)return!1;for(var u=0;u<o.length;++u)if(!t.equals(o[u],s[u]))return!1;return!0}if(typeof o!=typeof s)return!1;if(typeof o=="string")return o===s;var c=o.tagClass===s.tagClass&&o.type===s.type&&o.constructed===s.constructed&&o.composed===s.composed&&t.equals(o.value,s.value);return l&&l.includeBitStringContents&&(c=c&&o.bitStringContents===s.bitStringContents),c},t.getBerValueLength=function(o){var s=o.getByte();if(s!==128){var l,u=s&128;return u?l=o.getInt((s&127)<<3):l=s,l}};function n(o,s,l){if(l>s){var u=new Error("Too few bytes to parse DER.");throw u.available=o.length(),u.remaining=s,u.requested=l,u}}var r=function(o,s){var l=o.getByte();if(s--,l!==128){var u,c=l&128;if(!c)u=l;else{var p=l&127;n(o,s,p),u=o.getInt(p<<3)}if(u<0)throw new Error("Negative length: "+u);return u}};t.fromDer=function(o,s){s===void 0&&(s={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof s=="boolean"&&(s={strict:s,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in s||(s.strict=!0),"parseAllBytes"in s||(s.parseAllBytes=!0),"decodeBitStrings"in s||(s.decodeBitStrings=!0),typeof o=="string"&&(o=e.util.createBuffer(o));var l=o.length(),u=i(o,o.length(),0,s);if(s.parseAllBytes&&o.length()!==0){var c=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw c.byteCount=l,c.remaining=o.length(),c}return u};function i(o,s,l,u){var c;n(o,s,2);var p=o.getByte();s--;var h=p&192,d=p&31;c=o.length();var v=r(o,s);if(s-=c-o.length(),v!==void 0&&v>s){if(u.strict){var m=new Error("Too few bytes to read ASN.1 value.");throw m.available=o.length(),m.remaining=s,m.requested=v,m}v=s}var b,f,y=(p&32)===32;if(y)if(b=[],v===void 0)for(;;){if(n(o,s,2),o.bytes(2)==="\0\0"){o.getBytes(2),s-=2;break}c=o.length(),b.push(i(o,s,l+1,u)),s-=c-o.length()}else for(;v>0;)c=o.length(),b.push(i(o,v,l+1,u)),s-=c-o.length(),v-=c-o.length();if(b===void 0&&h===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&(f=o.bytes(v)),b===void 0&&u.decodeBitStrings&&h===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&v>1){var C=o.read,S=s,w=0;if(d===t.Type.BITSTRING&&(n(o,s,1),w=o.getByte(),s--),w===0)try{c=o.length();var E={strict:!0,decodeBitStrings:!0},x=i(o,s,l+1,E),g=c-o.length();s-=g,d==t.Type.BITSTRING&&g++;var I=x.tagClass;g===v&&(I===t.Class.UNIVERSAL||I===t.Class.CONTEXT_SPECIFIC)&&(b=[x])}catch{}b===void 0&&(o.read=C,s=S)}if(b===void 0){if(v===void 0){if(u.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");v=s}if(d===t.Type.BMPSTRING)for(b="";v>0;v-=2)n(o,s,2),b+=String.fromCharCode(o.getInt16()),s-=2;else b=o.getBytes(v),s-=v}var A=f===void 0?null:{bitStringContents:f};return t.create(h,d,y,b,A)}t.toDer=function(o){var s=e.util.createBuffer(),l=o.tagClass|o.type,u=e.util.createBuffer(),c=!1;if("bitStringContents"in o&&(c=!0,o.original&&(c=t.equals(o,o.original))),c)u.putBytes(o.bitStringContents);else if(o.composed){o.constructed?l|=32:u.putByte(0);for(var p=0;p<o.value.length;++p)o.value[p]!==void 0&&u.putBuffer(t.toDer(o.value[p]))}else if(o.type===t.Type.BMPSTRING)for(var p=0;p<o.value.length;++p)u.putInt16(o.value.charCodeAt(p));else o.type===t.Type.INTEGER&&o.value.length>1&&(o.value.charCodeAt(0)===0&&(o.value.charCodeAt(1)&128)===0||o.value.charCodeAt(0)===255&&(o.value.charCodeAt(1)&128)===128)?u.putBytes(o.value.substr(1)):u.putBytes(o.value);if(s.putByte(l),u.length()<=127)s.putByte(u.length()&127);else{var h=u.length(),d="";do d+=String.fromCharCode(h&255),h=h>>>8;while(h>0);s.putByte(d.length|128);for(var p=d.length-1;p>=0;--p)s.putByte(d.charCodeAt(p))}return s.putBuffer(u),s},t.oidToDer=function(o){var s=o.split("."),l=e.util.createBuffer();l.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u,c,p,h,d=2;d<s.length;++d){u=!0,c=[],p=parseInt(s[d],10);do h=p&127,p=p>>>7,u||(h|=128),c.push(h),u=!1;while(p>0);for(var v=c.length-1;v>=0;--v)l.putByte(c[v])}return l},t.derToOid=function(o){var s;typeof o=="string"&&(o=e.util.createBuffer(o));var l=o.getByte();s=Math.floor(l/40)+"."+l%40;for(var u=0;o.length()>0;)l=o.getByte(),u=u<<7,l&128?u+=l&127:(s+="."+(u+l),u=0);return s},t.utcTimeToDate=function(o){var s=new Date,l=parseInt(o.substr(0,2),10);l=l>=50?1900+l:2e3+l;var u=parseInt(o.substr(2,2),10)-1,c=parseInt(o.substr(4,2),10),p=parseInt(o.substr(6,2),10),h=parseInt(o.substr(8,2),10),d=0;if(o.length>11){var v=o.charAt(10),m=10;v!=="+"&&v!=="-"&&(d=parseInt(o.substr(10,2),10),m+=2)}if(s.setUTCFullYear(l,u,c),s.setUTCHours(p,h,d,0),m&&(v=o.charAt(m),v==="+"||v==="-")){var b=parseInt(o.substr(m+1,2),10),f=parseInt(o.substr(m+4,2),10),y=b*60+f;y*=6e4,v==="+"?s.setTime(+s-y):s.setTime(+s+y)}return s},t.generalizedTimeToDate=function(o){var s=new Date,l=parseInt(o.substr(0,4),10),u=parseInt(o.substr(4,2),10)-1,c=parseInt(o.substr(6,2),10),p=parseInt(o.substr(8,2),10),h=parseInt(o.substr(10,2),10),d=parseInt(o.substr(12,2),10),v=0,m=0,b=!1;o.charAt(o.length-1)==="Z"&&(b=!0);var f=o.length-5,y=o.charAt(f);if(y==="+"||y==="-"){var C=parseInt(o.substr(f+1,2),10),S=parseInt(o.substr(f+4,2),10);m=C*60+S,m*=6e4,y==="+"&&(m*=-1),b=!0}return o.charAt(14)==="."&&(v=parseFloat(o.substr(14),10)*1e3),b?(s.setUTCFullYear(l,u,c),s.setUTCHours(p,h,d,v),s.setTime(+s+m)):(s.setFullYear(l,u,c),s.setHours(p,h,d,v)),s},t.dateToUtcTime=function(o){if(typeof o=="string")return o;var s="",l=[];l.push((""+o.getUTCFullYear()).substr(2)),l.push(""+(o.getUTCMonth()+1)),l.push(""+o.getUTCDate()),l.push(""+o.getUTCHours()),l.push(""+o.getUTCMinutes()),l.push(""+o.getUTCSeconds());for(var u=0;u<l.length;++u)l[u].length<2&&(s+="0"),s+=l[u];return s+="Z",s},t.dateToGeneralizedTime=function(o){if(typeof o=="string")return o;var s="",l=[];l.push(""+o.getUTCFullYear()),l.push(""+(o.getUTCMonth()+1)),l.push(""+o.getUTCDate()),l.push(""+o.getUTCHours()),l.push(""+o.getUTCMinutes()),l.push(""+o.getUTCSeconds());for(var u=0;u<l.length;++u)l[u].length<2&&(s+="0"),s+=l[u];return s+="Z",s},t.integerToDer=function(o){var s=e.util.createBuffer();if(o>=-128&&o<128)return s.putSignedInt(o,8);if(o>=-32768&&o<32768)return s.putSignedInt(o,16);if(o>=-8388608&&o<8388608)return s.putSignedInt(o,24);if(o>=-2147483648&&o<2147483648)return s.putSignedInt(o,32);var l=new Error("Integer too large; max is 32-bits.");throw l.integer=o,l},t.derToInteger=function(o){typeof o=="string"&&(o=e.util.createBuffer(o));var s=o.length()*8;if(s>32)throw new Error("Integer too large; max is 32-bits.");return o.getSignedInt(s)},t.validate=function(o,s,l,u){var c=!1;if((o.tagClass===s.tagClass||typeof s.tagClass>"u")&&(o.type===s.type||typeof s.type>"u"))if(o.constructed===s.constructed||typeof s.constructed>"u"){if(c=!0,s.value&&e.util.isArray(s.value))for(var p=0,h=0;c&&h<s.value.length;++h)c=s.value[h].optional||!1,o.value[p]&&(c=t.validate(o.value[p],s.value[h],l,u),c?++p:s.value[h].optional&&(c=!0)),!c&&u&&u.push("["+s.name+'] Tag class "'+s.tagClass+'", type "'+s.type+'" expected value length "'+s.value.length+'", got "'+o.value.length+'"');if(c&&l&&(s.capture&&(l[s.capture]=o.value),s.captureAsn1&&(l[s.captureAsn1]=o),s.captureBitStringContents&&"bitStringContents"in o&&(l[s.captureBitStringContents]=o.bitStringContents),s.captureBitStringValue&&"bitStringContents"in o))if(o.bitStringContents.length<2)l[s.captureBitStringValue]="";else{var d=o.bitStringContents.charCodeAt(0);if(d!==0)throw new Error("captureBitStringValue only supported for zero unused bits");l[s.captureBitStringValue]=o.bitStringContents.slice(1)}}else u&&u.push("["+s.name+'] Expected constructed "'+s.constructed+'", got "'+o.constructed+'"');else u&&(o.tagClass!==s.tagClass&&u.push("["+s.name+'] Expected tag class "'+s.tagClass+'", got "'+o.tagClass+'"'),o.type!==s.type&&u.push("["+s.name+'] Expected type "'+s.type+'", got "'+o.type+'"'));return c};var a=/[^\\u0000-\\u00ff]/;return t.prettyPrint=function(o,s,l){var u="";s=s||0,l=l||2,s>0&&(u+=`
4
+ `,C=C.substr(y));return S+=C,S},n.binary.base64.decode=function(f,y,C){var S=y;S||(S=new Uint8Array(Math.ceil(f.length/4)*3)),f=f.replace(/[^A-Za-z0-9\+\/\=]/g,""),C=C||0;for(var w,E,x,g,I=0,A=C;I<f.length;)w=l[f.charCodeAt(I++)-43],E=l[f.charCodeAt(I++)-43],x=l[f.charCodeAt(I++)-43],g=l[f.charCodeAt(I++)-43],S[A++]=w<<2|E>>4,x!==64&&(S[A++]=(E&15)<<4|x>>2,g!==64&&(S[A++]=(x&3)<<6|g));return y?A-C:S.subarray(0,A)},n.binary.base58.encode=function(f,y){return n.binary.baseN.encode(f,u,y)},n.binary.base58.decode=function(f,y){return n.binary.baseN.decode(f,u,y)},n.text={utf8:{},utf16:{}},n.text.utf8.encode=function(f,y,C){f=n.encodeUtf8(f);var S=y;S||(S=new Uint8Array(f.length)),C=C||0;for(var w=C,E=0;E<f.length;++E)S[w++]=f.charCodeAt(E);return y?w-C:S},n.text.utf8.decode=function(f){return n.decodeUtf8(String.fromCharCode.apply(null,f))},n.text.utf16.encode=function(f,y,C){var S=y;S||(S=new Uint8Array(f.length*2));var w=new Uint16Array(S.buffer);C=C||0;for(var E=C,x=C,g=0;g<f.length;++g)w[x++]=f.charCodeAt(g),E+=2;return y?E-C:S},n.text.utf16.decode=function(f){return String.fromCharCode.apply(null,new Uint16Array(f.buffer))},n.deflate=function(f,y,C){if(y=n.decode64(f.deflate(n.encode64(y)).rval),C){var S=2,w=y.charCodeAt(1);w&32&&(S=6),y=y.substring(S,y.length-4)}return y},n.inflate=function(f,y,C){var S=f.inflate(n.encode64(y)).rval;return S===null?null:n.decode64(S)};var c=function(f,y,C){if(!f)throw new Error("WebStorage not available.");var S;if(C===null?S=f.removeItem(y):(C=n.encode64(JSON.stringify(C)),S=f.setItem(y,C)),typeof S<"u"&&S.rval!==!0){var w=new Error(S.error.message);throw w.id=S.error.id,w.name=S.error.name,w}},p=function(f,y){if(!f)throw new Error("WebStorage not available.");var C=f.getItem(y);if(f.init)if(C.rval===null){if(C.error){var S=new Error(C.error.message);throw S.id=C.error.id,S.name=C.error.name,S}C=null}else C=C.rval;return C!==null&&(C=JSON.parse(n.decode64(C))),C},h=function(f,y,C,S){var w=p(f,y);w===null&&(w={}),w[C]=S,c(f,y,w)},d=function(f,y,C){var S=p(f,y);return S!==null&&(S=C in S?S[C]:null),S},v=function(f,y,C){var S=p(f,y);if(S!==null&&C in S){delete S[C];var w=!0;for(var E in S){w=!1;break}w&&(S=null),c(f,y,S)}},m=function(f,y){c(f,y,null)},b=function(f,y,C){var S=null;typeof C>"u"&&(C=["web","flash"]);var w,E=!1,x=null;for(var g in C){w=C[g];try{if(w==="flash"||w==="both"){if(y[0]===null)throw new Error("Flash local storage not available.");S=f.apply(this,y),E=w==="flash"}(w==="web"||w==="both")&&(y[0]=localStorage,S=f.apply(this,y),E=!0)}catch(I){x=I}if(E)break}if(!E)throw x;return S};return n.setItem=function(f,y,C,S,w){b(h,arguments,w)},n.getItem=function(f,y,C,S){return b(d,arguments,S)},n.removeItem=function(f,y,C,S){b(v,arguments,S)},n.clearItems=function(f,y,C){b(m,arguments,C)},n.isEmpty=function(f){for(var y in f)if(f.hasOwnProperty(y))return!1;return!0},n.format=function(f){for(var y=/%./g,C,S,w=0,E=[],x=0;C=y.exec(f);){S=f.substring(x,y.lastIndex-2),S.length>0&&E.push(S),x=y.lastIndex;var g=C[0][1];switch(g){case"s":case"o":w<arguments.length?E.push(arguments[w+++1]):E.push("<?>");break;case"%":E.push("%");break;default:E.push("<%"+g+"?>")}}return E.push(f.substring(x)),E.join("")},n.formatNumber=function(f,y,C,S){var w=f,E=isNaN(y=Math.abs(y))?2:y,x=C===void 0?",":C,g=S===void 0?".":S,I=w<0?"-":"",A=parseInt(w=Math.abs(+w||0).toFixed(E),10)+"",_=A.length>3?A.length%3:0;return I+(_?A.substr(0,_)+g:"")+A.substr(_).replace(/(\d{3})(?=\d)/g,"$1"+g)+(E?x+Math.abs(w-A).toFixed(E).slice(2):"")},n.formatSize=function(f){return f>=1073741824?f=n.formatNumber(f/1073741824,2,".","")+" GiB":f>=1048576?f=n.formatNumber(f/1048576,2,".","")+" MiB":f>=1024?f=n.formatNumber(f/1024,0)+" KiB":f=n.formatNumber(f,0)+" bytes",f},n.bytesFromIP=function(f){return f.indexOf(".")!==-1?n.bytesFromIPv4(f):f.indexOf(":")!==-1?n.bytesFromIPv6(f):null},n.bytesFromIPv4=function(f){if(f=f.split("."),f.length!==4)return null;for(var y=n.createBuffer(),C=0;C<f.length;++C){var S=parseInt(f[C],10);if(isNaN(S))return null;y.putByte(S)}return y.getBytes()},n.bytesFromIPv6=function(f){var y=0;f=f.split(":").filter(function(x){return x.length===0&&++y,!0});for(var C=(8-f.length+y)*2,S=n.createBuffer(),w=0;w<8;++w){if(!f[w]||f[w].length===0){S.fillWithByte(0,C),C=0;continue}var E=n.hexToBytes(f[w]);E.length<2&&S.putByte(0),S.putBytes(E)}return S.getBytes()},n.bytesToIP=function(f){return f.length===4?n.bytesToIPv4(f):f.length===16?n.bytesToIPv6(f):null},n.bytesToIPv4=function(f){if(f.length!==4)return null;for(var y=[],C=0;C<f.length;++C)y.push(f.charCodeAt(C));return y.join(".")},n.bytesToIPv6=function(f){if(f.length!==16)return null;for(var y=[],C=[],S=0,w=0;w<f.length;w+=2){for(var E=n.bytesToHex(f[w]+f[w+1]);E[0]==="0"&&E!=="0";)E=E.substr(1);if(E==="0"){var x=C[C.length-1],g=y.length;!x||g!==x.end+1?C.push({start:g,end:g}):(x.end=g,x.end-x.start>C[S].end-C[S].start&&(S=C.length-1))}y.push(E)}if(C.length>0){var I=C[S];I.end-I.start>0&&(y.splice(I.start,I.end-I.start+1,""),I.start===0&&y.unshift(""),I.end===7&&y.push(""))}return y.join(":")},n.estimateCores=function(f,y){if(typeof f=="function"&&(y=f,f={}),f=f||{},"cores"in n&&!f.update)return y(null,n.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return n.cores=navigator.hardwareConcurrency,y(null,n.cores);if(typeof Worker>"u")return n.cores=1,y(null,n.cores);if(typeof Blob>"u")return n.cores=2,y(null,n.cores);var C=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(x){var g=Date.now(),I=g+4;self.postMessage({st:g,et:I})})}).toString(),")()"],{type:"application/javascript"}));S([],5,16);function S(x,g,I){if(g===0){var A=Math.floor(x.reduce(function(_,T){return _+T},0)/x.length);return n.cores=Math.max(1,A),URL.revokeObjectURL(C),y(null,n.cores)}w(I,function(_,T){x.push(E(I,T)),S(x,g-1,I)})}function w(x,g){for(var I=[],A=[],_=0;_<x;++_){var T=new Worker(C);T.addEventListener("message",function($){if(A.push($.data),A.length===x){for(var B=0;B<x;++B)I[B].terminate();g(null,A)}}),I.push(T)}for(var _=0;_<x;++_)I[_].postMessage(_)}function E(x,g){for(var I=[],A=0;A<x;++A)for(var _=g[A],T=I[A]=[],$=0;$<x;++$)if(A!==$){var B=g[$];(_.st>B.st&&_.st<B.et||B.st>_.st&&B.st<_.et)&&T.push($)}return I.reduce(function(P,k){return Math.max(P,k.length)},0)}},Ed.exports}var wd,em;function L0(){if(em)return wd;em=1;var e=Le();Xe(),wd=e.cipher=e.cipher||{},e.cipher.algorithms=e.cipher.algorithms||{},e.cipher.createCipher=function(n,r){var i=n;if(typeof i=="string"&&(i=e.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+n);return new e.cipher.BlockCipher({algorithm:i,key:r,decrypt:!1})},e.cipher.createDecipher=function(n,r){var i=n;if(typeof i=="string"&&(i=e.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+n);return new e.cipher.BlockCipher({algorithm:i,key:r,decrypt:!0})},e.cipher.registerAlgorithm=function(n,r){n=n.toUpperCase(),e.cipher.algorithms[n]=r},e.cipher.getAlgorithm=function(n){return n=n.toUpperCase(),n in e.cipher.algorithms?e.cipher.algorithms[n]:null};var t=e.cipher.BlockCipher=function(n){this.algorithm=n.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=n.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=n.decrypt,this.algorithm.initialize(n)};return t.prototype.start=function(n){n=n||{};var r={};for(var i in n)r[i]=n[i];r.decrypt=this._decrypt,this._finish=!1,this._input=e.util.createBuffer(),this.output=n.output||e.util.createBuffer(),this.mode.start(r)},t.prototype.update=function(n){for(n&&this._input.putBuffer(n);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},t.prototype.finish=function(n){n&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(i){return n(this.blockSize,i,!1)},this.mode.unpad=function(i){return n(this.blockSize,i,!0)});var r={};return r.decrypt=this._decrypt,r.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,r)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,r))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,r))},wd}var Id={exports:{}},tm;function bx(){if(tm)return Id.exports;tm=1;var e=Le();Xe(),e.cipher=e.cipher||{};var t=Id.exports=e.cipher.modes=e.cipher.modes||{};t.ecb=function(a){a=a||{},this.name="ECB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(a){},t.ecb.prototype.encrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._outBlock[l])},t.ecb.prototype.decrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._outBlock[l])},t.ecb.prototype.pad=function(a,o){var s=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();return a.fillWithByte(s,s),!0},t.ecb.prototype.unpad=function(a,o){if(o.overflow>0)return!1;var s=a.length(),l=a.at(s-1);return l>this.blockSize<<2?!1:(a.truncate(l),!0)},t.cbc=function(a){a=a||{},this.name="CBC",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(a){if(a.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=n(a.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")},t.cbc.prototype.encrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=this._prev[l]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._outBlock[l]);this._prev=this._outBlock},t.cbc.prototype.decrypt=function(a,o,s){if(a.length()<this.blockSize&&!(s&&a.length()>0))return!0;for(var l=0;l<this._ints;++l)this._inBlock[l]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var l=0;l<this._ints;++l)o.putInt32(this._prev[l]^this._outBlock[l]);this._prev=this._inBlock.slice(0)},t.cbc.prototype.pad=function(a,o){var s=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();return a.fillWithByte(s,s),!0},t.cbc.prototype.unpad=function(a,o){if(o.overflow>0)return!1;var s=a.length(),l=a.at(s-1);return l>this.blockSize<<2?!1:(a.truncate(l),!0)},t.cfb=function(a){a=a||{},this.name="CFB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=n(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)this._inBlock[u]=a.getInt32()^this._outBlock[u],o.putInt32(this._inBlock[u]);return}var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialBlock[u]=a.getInt32()^this._outBlock[u],this._partialOutput.putInt32(this._partialBlock[u]);if(c>0)a.read-=this.blockSize;else for(var u=0;u<this._ints;++u)this._inBlock[u]=this._partialBlock[u];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0},t.cfb.prototype.decrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)this._inBlock[u]=a.getInt32(),o.putInt32(this._inBlock[u]^this._outBlock[u]);return}var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialBlock[u]=a.getInt32(),this._partialOutput.putInt32(this._partialBlock[u]^this._outBlock[u]);if(c>0)a.read-=this.blockSize;else for(var u=0;u<this._ints;++u)this._inBlock[u]=this._partialBlock[u];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0},t.ofb=function(a){a=a||{},this.name="OFB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=n(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(a,o,s){var l=a.length();if(a.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)o.putInt32(a.getInt32()^this._outBlock[u]),this._inBlock[u]=this._outBlock[u];return}var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialOutput.putInt32(a.getInt32()^this._outBlock[u]);if(c>0)a.read-=this.blockSize;else for(var u=0;u<this._ints;++u)this._inBlock[u]=this._outBlock[u];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(a){a=a||{},this.name="CTR",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=n(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize)for(var u=0;u<this._ints;++u)o.putInt32(a.getInt32()^this._outBlock[u]);else{var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialOutput.putInt32(a.getInt32()^this._outBlock[u]);if(c>0&&(a.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0}r(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(a){a=a||{},this.name="GCM",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=e.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");var o=e.util.createBuffer(a.iv);this._cipherLength=0;var s;if("additionalData"in a?s=e.util.createBuffer(a.additionalData):s=e.util.createBuffer(),"tagLength"in a?this._tagLength=a.tagLength:this._tagLength=128,this._tag=null,a.decrypt&&(this._tag=e.util.createBuffer(a.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var l=o.length();if(l===12)this._j0=[o.getInt32(),o.getInt32(),o.getInt32(),1];else{for(this._j0=[0,0,0,0];o.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[o.getInt32(),o.getInt32(),o.getInt32(),o.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(i(l*8)))}this._inBlock=this._j0.slice(0),r(this._inBlock),this._partialBytes=0,s=e.util.createBuffer(s),this._aDataLength=i(s.length()*8);var u=s.length()%this.blockSize;for(u&&s.fillWithByte(0,this.blockSize-u),this._s=[0,0,0,0];s.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[s.getInt32(),s.getInt32(),s.getInt32(),s.getInt32()])},t.gcm.prototype.encrypt=function(a,o,s){var l=a.length();if(l===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&l>=this.blockSize){for(var u=0;u<this._ints;++u)o.putInt32(this._outBlock[u]^=a.getInt32());this._cipherLength+=this.blockSize}else{var c=(this.blockSize-l)%this.blockSize;c>0&&(c=this.blockSize-c),this._partialOutput.clear();for(var u=0;u<this._ints;++u)this._partialOutput.putInt32(a.getInt32()^this._outBlock[u]);if(c<=0||s){if(s){var p=l%this.blockSize;this._cipherLength+=p,this._partialOutput.truncate(this.blockSize-p)}else this._cipherLength+=this.blockSize;for(var u=0;u<this._ints;++u)this._outBlock[u]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),c>0&&!s)return a.read-=this.blockSize,o.putBytes(this._partialOutput.getBytes(c-this._partialBytes)),this._partialBytes=c,!0;o.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),r(this._inBlock)},t.gcm.prototype.decrypt=function(a,o,s){var l=a.length();if(l<this.blockSize&&!(s&&l>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),r(this._inBlock),this._hashBlock[0]=a.getInt32(),this._hashBlock[1]=a.getInt32(),this._hashBlock[2]=a.getInt32(),this._hashBlock[3]=a.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var u=0;u<this._ints;++u)o.putInt32(this._outBlock[u]^this._hashBlock[u]);l<this.blockSize?this._cipherLength+=l%this.blockSize:this._cipherLength+=this.blockSize},t.gcm.prototype.afterFinish=function(a,o){var s=!0;o.decrypt&&o.overflow&&a.truncate(this.blockSize-o.overflow),this.tag=e.util.createBuffer();var l=this._aDataLength.concat(i(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,l);var u=[];this.cipher.encrypt(this._j0,u);for(var c=0;c<this._ints;++c)this.tag.putInt32(this._s[c]^u[c]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),o.decrypt&&this.tag.bytes()!==this._tag&&(s=!1),s},t.gcm.prototype.multiply=function(a,o){for(var s=[0,0,0,0],l=o.slice(0),u=0;u<128;++u){var c=a[u/32|0]&1<<31-u%32;c&&(s[0]^=l[0],s[1]^=l[1],s[2]^=l[2],s[3]^=l[3]),this.pow(l,l)}return s},t.gcm.prototype.pow=function(a,o){for(var s=a[3]&1,l=3;l>0;--l)o[l]=a[l]>>>1|(a[l-1]&1)<<31;o[0]=a[0]>>>1,s&&(o[0]^=this._R)},t.gcm.prototype.tableMultiply=function(a){for(var o=[0,0,0,0],s=0;s<32;++s){var l=s/8|0,u=a[l]>>>(7-s%8)*4&15,c=this._m[s][u];o[0]^=c[0],o[1]^=c[1],o[2]^=c[2],o[3]^=c[3]}return o},t.gcm.prototype.ghash=function(a,o,s){return o[0]^=s[0],o[1]^=s[1],o[2]^=s[2],o[3]^=s[3],this.tableMultiply(o)},t.gcm.prototype.generateHashTable=function(a,o){for(var s=8/o,l=4*s,u=16*s,c=new Array(u),p=0;p<u;++p){var h=[0,0,0,0],d=p/l|0,v=(l-1-p%l)*o;h[d]=1<<o-1<<v,c[p]=this.generateSubHashTable(this.multiply(h,a),o)}return c},t.gcm.prototype.generateSubHashTable=function(a,o){var s=1<<o,l=s>>>1,u=new Array(s);u[l]=a.slice(0);for(var c=l>>>1;c>0;)this.pow(u[2*c],u[c]=[]),c>>=1;for(c=2;c<l;){for(var p=1;p<c;++p){var h=u[c],d=u[p];u[c+p]=[h[0]^d[0],h[1]^d[1],h[2]^d[2],h[3]^d[3]]}c*=2}for(u[0]=[0,0,0,0],c=l+1;c<s;++c){var v=u[c^l];u[c]=[a[0]^v[0],a[1]^v[1],a[2]^v[2],a[3]^v[3]]}return u};function n(a,o){if(typeof a=="string"&&(a=e.util.createBuffer(a)),e.util.isArray(a)&&a.length>4){var s=a;a=e.util.createBuffer();for(var l=0;l<s.length;++l)a.putByte(s[l])}if(a.length()<o)throw new Error("Invalid IV length; got "+a.length()+" bytes and expected "+o+" bytes.");if(!e.util.isArray(a)){for(var u=[],c=o/4,l=0;l<c;++l)u.push(a.getInt32());a=u}return a}function r(a){a[a.length-1]=a[a.length-1]+1&4294967295}function i(a){return[a/4294967296|0,a&4294967295]}return Id.exports}var _d,nm;function Ma(){if(nm)return _d;nm=1;var e=Le();L0(),bx(),Xe(),_d=e.aes=e.aes||{},e.aes.startEncrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!1,mode:b});return f.start(v),f},e.aes.createEncryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!1,mode:v})},e.aes.startDecrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!0,mode:b});return f.start(v),f},e.aes.createDecryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!0,mode:v})},e.aes.Algorithm=function(d,v){n||u();var m=this;m.name=d,m.mode=new v({blockSize:16,cipher:{encrypt:function(b,f){return p(m._w,b,f,!1)},decrypt:function(b,f){return p(m._w,b,f,!0)}}}),m._init=!1},e.aes.Algorithm.prototype.initialize=function(d){if(!this._init){var v=d.key,m;if(typeof v=="string"&&(v.length===16||v.length===24||v.length===32))v=e.util.createBuffer(v);else if(e.util.isArray(v)&&(v.length===16||v.length===24||v.length===32)){m=v,v=e.util.createBuffer();for(var b=0;b<m.length;++b)v.putByte(m[b])}if(!e.util.isArray(v)){m=v,v=[];var f=m.length();if(f===16||f===24||f===32){f=f>>>2;for(var b=0;b<f;++b)v.push(m.getInt32())}}if(!e.util.isArray(v)||!(v.length===4||v.length===6||v.length===8))throw new Error("Invalid key parameter.");var y=this.mode.name,C=["CFB","OFB","CTR","GCM"].indexOf(y)!==-1;this._w=c(v,d.decrypt&&!C),this._init=!0}},e.aes._expandKey=function(d,v){return n||u(),c(d,v)},e.aes._updateBlock=p,t("AES-ECB",e.cipher.modes.ecb),t("AES-CBC",e.cipher.modes.cbc),t("AES-CFB",e.cipher.modes.cfb),t("AES-OFB",e.cipher.modes.ofb),t("AES-CTR",e.cipher.modes.ctr),t("AES-GCM",e.cipher.modes.gcm);function t(d,v){var m=function(){return new e.aes.Algorithm(d,v)};e.cipher.registerAlgorithm(d,m)}var n=!1,r=4,i,a,o,s,l;function u(){n=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var d=new Array(256),v=0;v<128;++v)d[v]=v<<1,d[v+128]=v+128<<1^283;i=new Array(256),a=new Array(256),s=new Array(4),l=new Array(4);for(var v=0;v<4;++v)s[v]=new Array(256),l[v]=new Array(256);for(var m=0,b=0,f,y,C,S,w,E,x,v=0;v<256;++v){S=b^b<<1^b<<2^b<<3^b<<4,S=S>>8^S&255^99,i[m]=S,a[S]=m,w=d[S],f=d[m],y=d[f],C=d[y],E=w<<24^S<<16^S<<8^(S^w),x=(f^y^C)<<24^(m^C)<<16^(m^y^C)<<8^(m^f^C);for(var g=0;g<4;++g)s[g][m]=E,l[g][S]=x,E=E<<24|E>>>8,x=x<<24|x>>>8;m===0?m=b=1:(m=f^d[d[d[f^C]]],b^=d[d[b]])}}function c(d,v){for(var m=d.slice(0),b,f=1,y=m.length,C=y+6+1,S=r*C,w=y;w<S;++w)b=m[w-1],w%y===0?(b=i[b>>>16&255]<<24^i[b>>>8&255]<<16^i[b&255]<<8^i[b>>>24]^o[f]<<24,f++):y>6&&w%y===4&&(b=i[b>>>24]<<24^i[b>>>16&255]<<16^i[b>>>8&255]<<8^i[b&255]),m[w]=m[w-y]^b;if(v){var E,x=l[0],g=l[1],I=l[2],A=l[3],_=m.slice(0);S=m.length;for(var w=0,T=S-r;w<S;w+=r,T-=r)if(w===0||w===S-r)_[w]=m[T],_[w+1]=m[T+3],_[w+2]=m[T+2],_[w+3]=m[T+1];else for(var $=0;$<r;++$)E=m[T+$],_[w+(3&-$)]=x[i[E>>>24]]^g[i[E>>>16&255]]^I[i[E>>>8&255]]^A[i[E&255]];m=_}return m}function p(d,v,m,b){var f=d.length/4-1,y,C,S,w,E;b?(y=l[0],C=l[1],S=l[2],w=l[3],E=a):(y=s[0],C=s[1],S=s[2],w=s[3],E=i);var x,g,I,A,_,T,$;x=v[0]^d[0],g=v[b?3:1]^d[1],I=v[2]^d[2],A=v[b?1:3]^d[3];for(var B=3,P=1;P<f;++P)_=y[x>>>24]^C[g>>>16&255]^S[I>>>8&255]^w[A&255]^d[++B],T=y[g>>>24]^C[I>>>16&255]^S[A>>>8&255]^w[x&255]^d[++B],$=y[I>>>24]^C[A>>>16&255]^S[x>>>8&255]^w[g&255]^d[++B],A=y[A>>>24]^C[x>>>16&255]^S[g>>>8&255]^w[I&255]^d[++B],x=_,g=T,I=$;m[0]=E[x>>>24]<<24^E[g>>>16&255]<<16^E[I>>>8&255]<<8^E[A&255]^d[++B],m[b?3:1]=E[g>>>24]<<24^E[I>>>16&255]<<16^E[A>>>8&255]<<8^E[x&255]^d[++B],m[2]=E[I>>>24]<<24^E[A>>>16&255]<<16^E[x>>>8&255]<<8^E[g&255]^d[++B],m[b?1:3]=E[A>>>24]<<24^E[x>>>16&255]<<16^E[g>>>8&255]<<8^E[I&255]^d[++B]}function h(d){d=d||{};var v=(d.mode||"CBC").toUpperCase(),m="AES-"+v,b;d.decrypt?b=e.cipher.createDecipher(m,d.key):b=e.cipher.createCipher(m,d.key);var f=b.start;return b.start=function(y,C){var S=null;C instanceof e.util.ByteBuffer&&(S=C,C={}),C=C||{},C.output=S,C.iv=y,f.call(b,C)},b}return _d}var Dd={exports:{}},Td={exports:{}},Ad={exports:{}},rm;function Oa(){if(rm)return Ad.exports;rm=1;var e=Le();e.pki=e.pki||{};var t=Ad.exports=e.pki.oids=e.oids=e.oids||{};function n(i,a){t[i]=a,t[a]=i}function r(i,a){t[i]=a}return n("1.2.840.113549.1.1.1","rsaEncryption"),n("1.2.840.113549.1.1.4","md5WithRSAEncryption"),n("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),n("1.2.840.113549.1.1.7","RSAES-OAEP"),n("1.2.840.113549.1.1.8","mgf1"),n("1.2.840.113549.1.1.9","pSpecified"),n("1.2.840.113549.1.1.10","RSASSA-PSS"),n("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),n("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),n("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),n("1.3.101.112","EdDSA25519"),n("1.2.840.10040.4.3","dsa-with-sha1"),n("1.3.14.3.2.7","desCBC"),n("1.3.14.3.2.26","sha1"),n("1.3.14.3.2.29","sha1WithRSASignature"),n("2.16.840.1.101.3.4.2.1","sha256"),n("2.16.840.1.101.3.4.2.2","sha384"),n("2.16.840.1.101.3.4.2.3","sha512"),n("2.16.840.1.101.3.4.2.4","sha224"),n("2.16.840.1.101.3.4.2.5","sha512-224"),n("2.16.840.1.101.3.4.2.6","sha512-256"),n("1.2.840.113549.2.2","md2"),n("1.2.840.113549.2.5","md5"),n("1.2.840.113549.1.7.1","data"),n("1.2.840.113549.1.7.2","signedData"),n("1.2.840.113549.1.7.3","envelopedData"),n("1.2.840.113549.1.7.4","signedAndEnvelopedData"),n("1.2.840.113549.1.7.5","digestedData"),n("1.2.840.113549.1.7.6","encryptedData"),n("1.2.840.113549.1.9.1","emailAddress"),n("1.2.840.113549.1.9.2","unstructuredName"),n("1.2.840.113549.1.9.3","contentType"),n("1.2.840.113549.1.9.4","messageDigest"),n("1.2.840.113549.1.9.5","signingTime"),n("1.2.840.113549.1.9.6","counterSignature"),n("1.2.840.113549.1.9.7","challengePassword"),n("1.2.840.113549.1.9.8","unstructuredAddress"),n("1.2.840.113549.1.9.14","extensionRequest"),n("1.2.840.113549.1.9.20","friendlyName"),n("1.2.840.113549.1.9.21","localKeyId"),n("1.2.840.113549.1.9.22.1","x509Certificate"),n("1.2.840.113549.1.12.10.1.1","keyBag"),n("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),n("1.2.840.113549.1.12.10.1.3","certBag"),n("1.2.840.113549.1.12.10.1.4","crlBag"),n("1.2.840.113549.1.12.10.1.5","secretBag"),n("1.2.840.113549.1.12.10.1.6","safeContentsBag"),n("1.2.840.113549.1.5.13","pkcs5PBES2"),n("1.2.840.113549.1.5.12","pkcs5PBKDF2"),n("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),n("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),n("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),n("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),n("1.2.840.113549.2.7","hmacWithSHA1"),n("1.2.840.113549.2.8","hmacWithSHA224"),n("1.2.840.113549.2.9","hmacWithSHA256"),n("1.2.840.113549.2.10","hmacWithSHA384"),n("1.2.840.113549.2.11","hmacWithSHA512"),n("1.2.840.113549.3.7","des-EDE3-CBC"),n("2.16.840.1.101.3.4.1.2","aes128-CBC"),n("2.16.840.1.101.3.4.1.22","aes192-CBC"),n("2.16.840.1.101.3.4.1.42","aes256-CBC"),n("2.5.4.3","commonName"),n("2.5.4.4","surname"),n("2.5.4.5","serialNumber"),n("2.5.4.6","countryName"),n("2.5.4.7","localityName"),n("2.5.4.8","stateOrProvinceName"),n("2.5.4.9","streetAddress"),n("2.5.4.10","organizationName"),n("2.5.4.11","organizationalUnitName"),n("2.5.4.12","title"),n("2.5.4.13","description"),n("2.5.4.15","businessCategory"),n("2.5.4.17","postalCode"),n("2.5.4.42","givenName"),n("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),n("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),n("2.16.840.1.113730.1.1","nsCertType"),n("2.16.840.1.113730.1.13","nsComment"),r("2.5.29.1","authorityKeyIdentifier"),r("2.5.29.2","keyAttributes"),r("2.5.29.3","certificatePolicies"),r("2.5.29.4","keyUsageRestriction"),r("2.5.29.5","policyMapping"),r("2.5.29.6","subtreesConstraint"),r("2.5.29.7","subjectAltName"),r("2.5.29.8","issuerAltName"),r("2.5.29.9","subjectDirectoryAttributes"),r("2.5.29.10","basicConstraints"),r("2.5.29.11","nameConstraints"),r("2.5.29.12","policyConstraints"),r("2.5.29.13","basicConstraints"),n("2.5.29.14","subjectKeyIdentifier"),n("2.5.29.15","keyUsage"),r("2.5.29.16","privateKeyUsagePeriod"),n("2.5.29.17","subjectAltName"),n("2.5.29.18","issuerAltName"),n("2.5.29.19","basicConstraints"),r("2.5.29.20","cRLNumber"),r("2.5.29.21","cRLReason"),r("2.5.29.22","expirationDate"),r("2.5.29.23","instructionCode"),r("2.5.29.24","invalidityDate"),r("2.5.29.25","cRLDistributionPoints"),r("2.5.29.26","issuingDistributionPoint"),r("2.5.29.27","deltaCRLIndicator"),r("2.5.29.28","issuingDistributionPoint"),r("2.5.29.29","certificateIssuer"),r("2.5.29.30","nameConstraints"),n("2.5.29.31","cRLDistributionPoints"),n("2.5.29.32","certificatePolicies"),r("2.5.29.33","policyMappings"),r("2.5.29.34","policyConstraints"),n("2.5.29.35","authorityKeyIdentifier"),r("2.5.29.36","policyConstraints"),n("2.5.29.37","extKeyUsage"),r("2.5.29.46","freshestCRL"),r("2.5.29.54","inhibitAnyPolicy"),n("1.3.6.1.4.1.11129.2.4.2","timestampList"),n("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),n("1.3.6.1.5.5.7.3.1","serverAuth"),n("1.3.6.1.5.5.7.3.2","clientAuth"),n("1.3.6.1.5.5.7.3.3","codeSigning"),n("1.3.6.1.5.5.7.3.4","emailProtection"),n("1.3.6.1.5.5.7.3.8","timeStamping"),Ad.exports}var im;function Wr(){if(im)return Td.exports;im=1;var e=Le();Xe(),Oa();var t=Td.exports=e.asn1=e.asn1||{};t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.create=function(o,s,l,u,c){if(e.util.isArray(u)){for(var p=[],h=0;h<u.length;++h)u[h]!==void 0&&p.push(u[h]);u=p}var d={tagClass:o,type:s,constructed:l,composed:l||e.util.isArray(u),value:u};return c&&"bitStringContents"in c&&(d.bitStringContents=c.bitStringContents,d.original=t.copy(d)),d},t.copy=function(o,s){var l;if(e.util.isArray(o)){l=[];for(var u=0;u<o.length;++u)l.push(t.copy(o[u],s));return l}return typeof o=="string"?o:(l={tagClass:o.tagClass,type:o.type,constructed:o.constructed,composed:o.composed,value:t.copy(o.value,s)},s&&!s.excludeBitStringContents&&(l.bitStringContents=o.bitStringContents),l)},t.equals=function(o,s,l){if(e.util.isArray(o)){if(!e.util.isArray(s)||o.length!==s.length)return!1;for(var u=0;u<o.length;++u)if(!t.equals(o[u],s[u]))return!1;return!0}if(typeof o!=typeof s)return!1;if(typeof o=="string")return o===s;var c=o.tagClass===s.tagClass&&o.type===s.type&&o.constructed===s.constructed&&o.composed===s.composed&&t.equals(o.value,s.value);return l&&l.includeBitStringContents&&(c=c&&o.bitStringContents===s.bitStringContents),c},t.getBerValueLength=function(o){var s=o.getByte();if(s!==128){var l,u=s&128;return u?l=o.getInt((s&127)<<3):l=s,l}};function n(o,s,l){if(l>s){var u=new Error("Too few bytes to parse DER.");throw u.available=o.length(),u.remaining=s,u.requested=l,u}}var r=function(o,s){var l=o.getByte();if(s--,l!==128){var u,c=l&128;if(!c)u=l;else{var p=l&127;n(o,s,p),u=o.getInt(p<<3)}if(u<0)throw new Error("Negative length: "+u);return u}};t.fromDer=function(o,s){s===void 0&&(s={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof s=="boolean"&&(s={strict:s,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in s||(s.strict=!0),"parseAllBytes"in s||(s.parseAllBytes=!0),"decodeBitStrings"in s||(s.decodeBitStrings=!0),typeof o=="string"&&(o=e.util.createBuffer(o));var l=o.length(),u=i(o,o.length(),0,s);if(s.parseAllBytes&&o.length()!==0){var c=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw c.byteCount=l,c.remaining=o.length(),c}return u};function i(o,s,l,u){var c;n(o,s,2);var p=o.getByte();s--;var h=p&192,d=p&31;c=o.length();var v=r(o,s);if(s-=c-o.length(),v!==void 0&&v>s){if(u.strict){var m=new Error("Too few bytes to read ASN.1 value.");throw m.available=o.length(),m.remaining=s,m.requested=v,m}v=s}var b,f,y=(p&32)===32;if(y)if(b=[],v===void 0)for(;;){if(n(o,s,2),o.bytes(2)==="\0\0"){o.getBytes(2),s-=2;break}c=o.length(),b.push(i(o,s,l+1,u)),s-=c-o.length()}else for(;v>0;)c=o.length(),b.push(i(o,v,l+1,u)),s-=c-o.length(),v-=c-o.length();if(b===void 0&&h===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&(f=o.bytes(v)),b===void 0&&u.decodeBitStrings&&h===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&v>1){var C=o.read,S=s,w=0;if(d===t.Type.BITSTRING&&(n(o,s,1),w=o.getByte(),s--),w===0)try{c=o.length();var E={strict:!0,decodeBitStrings:!0},x=i(o,s,l+1,E),g=c-o.length();s-=g,d==t.Type.BITSTRING&&g++;var I=x.tagClass;g===v&&(I===t.Class.UNIVERSAL||I===t.Class.CONTEXT_SPECIFIC)&&(b=[x])}catch{}b===void 0&&(o.read=C,s=S)}if(b===void 0){if(v===void 0){if(u.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");v=s}if(d===t.Type.BMPSTRING)for(b="";v>0;v-=2)n(o,s,2),b+=String.fromCharCode(o.getInt16()),s-=2;else b=o.getBytes(v),s-=v}var A=f===void 0?null:{bitStringContents:f};return t.create(h,d,y,b,A)}t.toDer=function(o){var s=e.util.createBuffer(),l=o.tagClass|o.type,u=e.util.createBuffer(),c=!1;if("bitStringContents"in o&&(c=!0,o.original&&(c=t.equals(o,o.original))),c)u.putBytes(o.bitStringContents);else if(o.composed){o.constructed?l|=32:u.putByte(0);for(var p=0;p<o.value.length;++p)o.value[p]!==void 0&&u.putBuffer(t.toDer(o.value[p]))}else if(o.type===t.Type.BMPSTRING)for(var p=0;p<o.value.length;++p)u.putInt16(o.value.charCodeAt(p));else o.type===t.Type.INTEGER&&o.value.length>1&&(o.value.charCodeAt(0)===0&&(o.value.charCodeAt(1)&128)===0||o.value.charCodeAt(0)===255&&(o.value.charCodeAt(1)&128)===128)?u.putBytes(o.value.substr(1)):u.putBytes(o.value);if(s.putByte(l),u.length()<=127)s.putByte(u.length()&127);else{var h=u.length(),d="";do d+=String.fromCharCode(h&255),h=h>>>8;while(h>0);s.putByte(d.length|128);for(var p=d.length-1;p>=0;--p)s.putByte(d.charCodeAt(p))}return s.putBuffer(u),s},t.oidToDer=function(o){var s=o.split("."),l=e.util.createBuffer();l.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u,c,p,h,d=2;d<s.length;++d){u=!0,c=[],p=parseInt(s[d],10);do h=p&127,p=p>>>7,u||(h|=128),c.push(h),u=!1;while(p>0);for(var v=c.length-1;v>=0;--v)l.putByte(c[v])}return l},t.derToOid=function(o){var s;typeof o=="string"&&(o=e.util.createBuffer(o));var l=o.getByte();s=Math.floor(l/40)+"."+l%40;for(var u=0;o.length()>0;)l=o.getByte(),u=u<<7,l&128?u+=l&127:(s+="."+(u+l),u=0);return s},t.utcTimeToDate=function(o){var s=new Date,l=parseInt(o.substr(0,2),10);l=l>=50?1900+l:2e3+l;var u=parseInt(o.substr(2,2),10)-1,c=parseInt(o.substr(4,2),10),p=parseInt(o.substr(6,2),10),h=parseInt(o.substr(8,2),10),d=0;if(o.length>11){var v=o.charAt(10),m=10;v!=="+"&&v!=="-"&&(d=parseInt(o.substr(10,2),10),m+=2)}if(s.setUTCFullYear(l,u,c),s.setUTCHours(p,h,d,0),m&&(v=o.charAt(m),v==="+"||v==="-")){var b=parseInt(o.substr(m+1,2),10),f=parseInt(o.substr(m+4,2),10),y=b*60+f;y*=6e4,v==="+"?s.setTime(+s-y):s.setTime(+s+y)}return s},t.generalizedTimeToDate=function(o){var s=new Date,l=parseInt(o.substr(0,4),10),u=parseInt(o.substr(4,2),10)-1,c=parseInt(o.substr(6,2),10),p=parseInt(o.substr(8,2),10),h=parseInt(o.substr(10,2),10),d=parseInt(o.substr(12,2),10),v=0,m=0,b=!1;o.charAt(o.length-1)==="Z"&&(b=!0);var f=o.length-5,y=o.charAt(f);if(y==="+"||y==="-"){var C=parseInt(o.substr(f+1,2),10),S=parseInt(o.substr(f+4,2),10);m=C*60+S,m*=6e4,y==="+"&&(m*=-1),b=!0}return o.charAt(14)==="."&&(v=parseFloat(o.substr(14),10)*1e3),b?(s.setUTCFullYear(l,u,c),s.setUTCHours(p,h,d,v),s.setTime(+s+m)):(s.setFullYear(l,u,c),s.setHours(p,h,d,v)),s},t.dateToUtcTime=function(o){if(typeof o=="string")return o;var s="",l=[];l.push((""+o.getUTCFullYear()).substr(2)),l.push(""+(o.getUTCMonth()+1)),l.push(""+o.getUTCDate()),l.push(""+o.getUTCHours()),l.push(""+o.getUTCMinutes()),l.push(""+o.getUTCSeconds());for(var u=0;u<l.length;++u)l[u].length<2&&(s+="0"),s+=l[u];return s+="Z",s},t.dateToGeneralizedTime=function(o){if(typeof o=="string")return o;var s="",l=[];l.push(""+o.getUTCFullYear()),l.push(""+(o.getUTCMonth()+1)),l.push(""+o.getUTCDate()),l.push(""+o.getUTCHours()),l.push(""+o.getUTCMinutes()),l.push(""+o.getUTCSeconds());for(var u=0;u<l.length;++u)l[u].length<2&&(s+="0"),s+=l[u];return s+="Z",s},t.integerToDer=function(o){var s=e.util.createBuffer();if(o>=-128&&o<128)return s.putSignedInt(o,8);if(o>=-32768&&o<32768)return s.putSignedInt(o,16);if(o>=-8388608&&o<8388608)return s.putSignedInt(o,24);if(o>=-2147483648&&o<2147483648)return s.putSignedInt(o,32);var l=new Error("Integer too large; max is 32-bits.");throw l.integer=o,l},t.derToInteger=function(o){typeof o=="string"&&(o=e.util.createBuffer(o));var s=o.length()*8;if(s>32)throw new Error("Integer too large; max is 32-bits.");return o.getSignedInt(s)},t.validate=function(o,s,l,u){var c=!1;if((o.tagClass===s.tagClass||typeof s.tagClass>"u")&&(o.type===s.type||typeof s.type>"u"))if(o.constructed===s.constructed||typeof s.constructed>"u"){if(c=!0,s.value&&e.util.isArray(s.value))for(var p=0,h=0;c&&h<s.value.length;++h)c=s.value[h].optional||!1,o.value[p]&&(c=t.validate(o.value[p],s.value[h],l,u),c?++p:s.value[h].optional&&(c=!0)),!c&&u&&u.push("["+s.name+'] Tag class "'+s.tagClass+'", type "'+s.type+'" expected value length "'+s.value.length+'", got "'+o.value.length+'"');if(c&&l&&(s.capture&&(l[s.capture]=o.value),s.captureAsn1&&(l[s.captureAsn1]=o),s.captureBitStringContents&&"bitStringContents"in o&&(l[s.captureBitStringContents]=o.bitStringContents),s.captureBitStringValue&&"bitStringContents"in o))if(o.bitStringContents.length<2)l[s.captureBitStringValue]="";else{var d=o.bitStringContents.charCodeAt(0);if(d!==0)throw new Error("captureBitStringValue only supported for zero unused bits");l[s.captureBitStringValue]=o.bitStringContents.slice(1)}}else u&&u.push("["+s.name+'] Expected constructed "'+s.constructed+'", got "'+o.constructed+'"');else u&&(o.tagClass!==s.tagClass&&u.push("["+s.name+'] Expected tag class "'+s.tagClass+'", got "'+o.tagClass+'"'),o.type!==s.type&&u.push("["+s.name+'] Expected type "'+s.type+'", got "'+o.type+'"'));return c};var a=/[^\\u0000-\\u00ff]/;return t.prettyPrint=function(o,s,l){var u="";s=s||0,l=l||2,s>0&&(u+=`
5
5
  `);for(var c="",p=0;p<s*l;++p)c+=" ";switch(u+=c+"Tag: ",o.tagClass){case t.Class.UNIVERSAL:u+="Universal:";break;case t.Class.APPLICATION:u+="Application:";break;case t.Class.CONTEXT_SPECIFIC:u+="Context-Specific:";break;case t.Class.PRIVATE:u+="Private:";break}if(o.tagClass===t.Class.UNIVERSAL)switch(u+=o.type,o.type){case t.Type.NONE:u+=" (None)";break;case t.Type.BOOLEAN:u+=" (Boolean)";break;case t.Type.INTEGER:u+=" (Integer)";break;case t.Type.BITSTRING:u+=" (Bit string)";break;case t.Type.OCTETSTRING:u+=" (Octet string)";break;case t.Type.NULL:u+=" (Null)";break;case t.Type.OID:u+=" (Object Identifier)";break;case t.Type.ODESC:u+=" (Object Descriptor)";break;case t.Type.EXTERNAL:u+=" (External or Instance of)";break;case t.Type.REAL:u+=" (Real)";break;case t.Type.ENUMERATED:u+=" (Enumerated)";break;case t.Type.EMBEDDED:u+=" (Embedded PDV)";break;case t.Type.UTF8:u+=" (UTF8)";break;case t.Type.ROID:u+=" (Relative Object Identifier)";break;case t.Type.SEQUENCE:u+=" (Sequence)";break;case t.Type.SET:u+=" (Set)";break;case t.Type.PRINTABLESTRING:u+=" (Printable String)";break;case t.Type.IA5String:u+=" (IA5String (ASCII))";break;case t.Type.UTCTIME:u+=" (UTC time)";break;case t.Type.GENERALIZEDTIME:u+=" (Generalized time)";break;case t.Type.BMPSTRING:u+=" (BMP String)";break}else u+=o.type;if(u+=`
6
6
  `,u+=c+"Constructed: "+o.constructed+`
7
- `,o.composed){for(var h=0,d="",p=0;p<o.value.length;++p)o.value[p]!==void 0&&(h+=1,d+=t.prettyPrint(o.value[p],s+1,l),p+1<o.value.length&&(d+=","));u+=c+"Sub values: "+h+d}else{if(u+=c+"Value: ",o.type===t.Type.OID){var v=t.derToOid(o.value);u+=v,e.pki&&e.pki.oids&&v in e.pki.oids&&(u+=" ("+e.pki.oids[v]+") ")}if(o.type===t.Type.INTEGER)try{u+=t.derToInteger(o.value)}catch{u+="0x"+e.util.bytesToHex(o.value)}else if(o.type===t.Type.BITSTRING){if(o.value.length>1?u+="0x"+e.util.bytesToHex(o.value.slice(1)):u+="(none)",o.value.length>0){var m=o.value.charCodeAt(0);m==1?u+=" (1 unused bit shown)":m>1&&(u+=" ("+m+" unused bits shown)")}}else if(o.type===t.Type.OCTETSTRING)a.test(o.value)||(u+="("+o.value+") "),u+="0x"+e.util.bytesToHex(o.value);else if(o.type===t.Type.UTF8)try{u+=e.util.decodeUtf8(o.value)}catch(b){if(b.message==="URI malformed")u+="0x"+e.util.bytesToHex(o.value)+" (malformed UTF8)";else throw b}else o.type===t.Type.PRINTABLESTRING||o.type===t.Type.IA5String?u+=o.value:a.test(o.value)?u+="0x"+e.util.bytesToHex(o.value):o.value.length===0?u+="[null]":u+=o.value}return u},Td.exports}var Rd={exports:{}},Bd,am;function mi(){if(am)return Bd;am=1;var e=Le();return Bd=e.md=e.md||{},e.md.algorithms=e.md.algorithms||{},Bd}var om;function rl(){if(om)return Rd.exports;om=1;var e=Le();mi(),Ue();var t=Rd.exports=e.hmac=e.hmac||{};return t.create=function(){var n=null,r=null,i=null,a=null,o={};return o.start=function(s,l){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in e.md.algorithms)r=e.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else r=s;if(l===null)l=n;else{if(typeof l=="string")l=e.util.createBuffer(l);else if(e.util.isArray(l)){var u=l;l=e.util.createBuffer();for(var c=0;c<u.length;++c)l.putByte(u[c])}var p=l.length();p>r.blockLength&&(r.start(),r.update(l.bytes()),l=r.digest()),i=e.util.createBuffer(),a=e.util.createBuffer(),p=l.length();for(var c=0;c<p;++c){var u=l.at(c);i.putByte(54^u),a.putByte(92^u)}if(p<r.blockLength)for(var u=r.blockLength-p,c=0;c<u;++c)i.putByte(54),a.putByte(92);n=l,i=i.bytes(),a=a.bytes()}r.start(),r.update(i)},o.update=function(s){r.update(s)},o.getMac=function(){var s=r.digest().bytes();return r.start(),r.update(a),r.update(s),r.digest()},o.digest=o.getMac,o},Rd.exports}var kd={exports:{}},sm;function V0(){if(sm)return kd.exports;sm=1;var e=Le();mi(),Ue();var t=kd.exports=e.md5=e.md5||{};e.md.md5=e.md.algorithms.md5=t,t.create=function(){o||s();var u=null,c=e.util.createBuffer(),p=new Array(16),h={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return h.start=function(){h.messageLength=0,h.fullMessageLength=h.messageLength64=[];for(var d=h.messageLengthSize/4,v=0;v<d;++v)h.fullMessageLength.push(0);return c=e.util.createBuffer(),u={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},h},h.start(),h.update=function(d,v){v==="utf8"&&(d=e.util.encodeUtf8(d));var m=d.length;h.messageLength+=m,m=[m/4294967296>>>0,m>>>0];for(var b=h.fullMessageLength.length-1;b>=0;--b)h.fullMessageLength[b]+=m[1],m[1]=m[0]+(h.fullMessageLength[b]/4294967296>>>0),h.fullMessageLength[b]=h.fullMessageLength[b]>>>0,m[0]=m[1]/4294967296>>>0;return c.putBytes(d),l(u,p,c),(c.read>2048||c.length()===0)&&c.compact(),h},h.digest=function(){var d=e.util.createBuffer();d.putBytes(c.bytes());var v=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize,m=v&h.blockLength-1;d.putBytes(n.substr(0,h.blockLength-m));for(var b,f=0,y=h.fullMessageLength.length-1;y>=0;--y)b=h.fullMessageLength[y]*8+f,f=b/4294967296>>>0,d.putInt32Le(b>>>0);var C={h0:u.h0,h1:u.h1,h2:u.h2,h3:u.h3};l(C,p,d);var S=e.util.createBuffer();return S.putInt32Le(C.h0),S.putInt32Le(C.h1),S.putInt32Le(C.h2),S.putInt32Le(C.h3),S},h};var n=null,r=null,i=null,a=null,o=!1;function s(){n="€",n+=e.util.fillString("\0",64),r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],i=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],a=new Array(64);for(var u=0;u<64;++u)a[u]=Math.floor(Math.abs(Math.sin(u+1))*4294967296);o=!0}function l(u,c,p){for(var h,d,v,m,b,f,y,C,S=p.length();S>=64;){for(d=u.h0,v=u.h1,m=u.h2,b=u.h3,C=0;C<16;++C)c[C]=p.getInt32Le(),f=b^v&(m^b),h=d+f+a[C]+c[C],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;for(;C<32;++C)f=m^b&(v^m),h=d+f+a[C]+c[r[C]],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;for(;C<48;++C)f=v^m^b,h=d+f+a[C]+c[r[C]],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;for(;C<64;++C)f=m^(v|~b),h=d+f+a[C]+c[r[C]],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;u.h0=u.h0+d|0,u.h1=u.h1+v|0,u.h2=u.h2+m|0,u.h3=u.h3+b|0,S-=64}}return kd.exports}var Pd={exports:{}},lm;function Oo(){if(lm)return Pd.exports;lm=1;var e=Le();Ue();var t=Pd.exports=e.pem=e.pem||{};t.encode=function(i,a){a=a||{};var o="-----BEGIN "+i.type+`-----\r
7
+ `,o.composed){for(var h=0,d="",p=0;p<o.value.length;++p)o.value[p]!==void 0&&(h+=1,d+=t.prettyPrint(o.value[p],s+1,l),p+1<o.value.length&&(d+=","));u+=c+"Sub values: "+h+d}else{if(u+=c+"Value: ",o.type===t.Type.OID){var v=t.derToOid(o.value);u+=v,e.pki&&e.pki.oids&&v in e.pki.oids&&(u+=" ("+e.pki.oids[v]+") ")}if(o.type===t.Type.INTEGER)try{u+=t.derToInteger(o.value)}catch{u+="0x"+e.util.bytesToHex(o.value)}else if(o.type===t.Type.BITSTRING){if(o.value.length>1?u+="0x"+e.util.bytesToHex(o.value.slice(1)):u+="(none)",o.value.length>0){var m=o.value.charCodeAt(0);m==1?u+=" (1 unused bit shown)":m>1&&(u+=" ("+m+" unused bits shown)")}}else if(o.type===t.Type.OCTETSTRING)a.test(o.value)||(u+="("+o.value+") "),u+="0x"+e.util.bytesToHex(o.value);else if(o.type===t.Type.UTF8)try{u+=e.util.decodeUtf8(o.value)}catch(b){if(b.message==="URI malformed")u+="0x"+e.util.bytesToHex(o.value)+" (malformed UTF8)";else throw b}else o.type===t.Type.PRINTABLESTRING||o.type===t.Type.IA5String?u+=o.value:a.test(o.value)?u+="0x"+e.util.bytesToHex(o.value):o.value.length===0?u+="[null]":u+=o.value}return u},Td.exports}var Rd={exports:{}},Bd,am;function mi(){if(am)return Bd;am=1;var e=Le();return Bd=e.md=e.md||{},e.md.algorithms=e.md.algorithms||{},Bd}var om;function rl(){if(om)return Rd.exports;om=1;var e=Le();mi(),Xe();var t=Rd.exports=e.hmac=e.hmac||{};return t.create=function(){var n=null,r=null,i=null,a=null,o={};return o.start=function(s,l){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in e.md.algorithms)r=e.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else r=s;if(l===null)l=n;else{if(typeof l=="string")l=e.util.createBuffer(l);else if(e.util.isArray(l)){var u=l;l=e.util.createBuffer();for(var c=0;c<u.length;++c)l.putByte(u[c])}var p=l.length();p>r.blockLength&&(r.start(),r.update(l.bytes()),l=r.digest()),i=e.util.createBuffer(),a=e.util.createBuffer(),p=l.length();for(var c=0;c<p;++c){var u=l.at(c);i.putByte(54^u),a.putByte(92^u)}if(p<r.blockLength)for(var u=r.blockLength-p,c=0;c<u;++c)i.putByte(54),a.putByte(92);n=l,i=i.bytes(),a=a.bytes()}r.start(),r.update(i)},o.update=function(s){r.update(s)},o.getMac=function(){var s=r.digest().bytes();return r.start(),r.update(a),r.update(s),r.digest()},o.digest=o.getMac,o},Rd.exports}var kd={exports:{}},sm;function V0(){if(sm)return kd.exports;sm=1;var e=Le();mi(),Xe();var t=kd.exports=e.md5=e.md5||{};e.md.md5=e.md.algorithms.md5=t,t.create=function(){o||s();var u=null,c=e.util.createBuffer(),p=new Array(16),h={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return h.start=function(){h.messageLength=0,h.fullMessageLength=h.messageLength64=[];for(var d=h.messageLengthSize/4,v=0;v<d;++v)h.fullMessageLength.push(0);return c=e.util.createBuffer(),u={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},h},h.start(),h.update=function(d,v){v==="utf8"&&(d=e.util.encodeUtf8(d));var m=d.length;h.messageLength+=m,m=[m/4294967296>>>0,m>>>0];for(var b=h.fullMessageLength.length-1;b>=0;--b)h.fullMessageLength[b]+=m[1],m[1]=m[0]+(h.fullMessageLength[b]/4294967296>>>0),h.fullMessageLength[b]=h.fullMessageLength[b]>>>0,m[0]=m[1]/4294967296>>>0;return c.putBytes(d),l(u,p,c),(c.read>2048||c.length()===0)&&c.compact(),h},h.digest=function(){var d=e.util.createBuffer();d.putBytes(c.bytes());var v=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize,m=v&h.blockLength-1;d.putBytes(n.substr(0,h.blockLength-m));for(var b,f=0,y=h.fullMessageLength.length-1;y>=0;--y)b=h.fullMessageLength[y]*8+f,f=b/4294967296>>>0,d.putInt32Le(b>>>0);var C={h0:u.h0,h1:u.h1,h2:u.h2,h3:u.h3};l(C,p,d);var S=e.util.createBuffer();return S.putInt32Le(C.h0),S.putInt32Le(C.h1),S.putInt32Le(C.h2),S.putInt32Le(C.h3),S},h};var n=null,r=null,i=null,a=null,o=!1;function s(){n="€",n+=e.util.fillString("\0",64),r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],i=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],a=new Array(64);for(var u=0;u<64;++u)a[u]=Math.floor(Math.abs(Math.sin(u+1))*4294967296);o=!0}function l(u,c,p){for(var h,d,v,m,b,f,y,C,S=p.length();S>=64;){for(d=u.h0,v=u.h1,m=u.h2,b=u.h3,C=0;C<16;++C)c[C]=p.getInt32Le(),f=b^v&(m^b),h=d+f+a[C]+c[C],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;for(;C<32;++C)f=m^b&(v^m),h=d+f+a[C]+c[r[C]],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;for(;C<48;++C)f=v^m^b,h=d+f+a[C]+c[r[C]],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;for(;C<64;++C)f=m^(v|~b),h=d+f+a[C]+c[r[C]],y=i[C],d=b,b=m,m=v,v+=h<<y|h>>>32-y;u.h0=u.h0+d|0,u.h1=u.h1+v|0,u.h2=u.h2+m|0,u.h3=u.h3+b|0,S-=64}}return kd.exports}var Pd={exports:{}},lm;function Oo(){if(lm)return Pd.exports;lm=1;var e=Le();Xe();var t=Pd.exports=e.pem=e.pem||{};t.encode=function(i,a){a=a||{};var o="-----BEGIN "+i.type+`-----\r
8
8
  `,s;if(i.procType&&(s={name:"Proc-Type",values:[String(i.procType.version),i.procType.type]},o+=n(s)),i.contentDomain&&(s={name:"Content-Domain",values:[i.contentDomain]},o+=n(s)),i.dekInfo&&(s={name:"DEK-Info",values:[i.dekInfo.algorithm]},i.dekInfo.parameters&&s.values.push(i.dekInfo.parameters),o+=n(s)),i.headers)for(var l=0;l<i.headers.length;++l)o+=n(i.headers[l]);return i.procType&&(o+=`\r
9
9
  `),o+=e.util.encode64(i.body,a.maxline||64)+`\r
10
10
  `,o+="-----END "+i.type+`-----\r
11
11
  `,o},t.decode=function(i){for(var a=[],o=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,s=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,l=/\r?\n/,u;u=o.exec(i),!!u;){var c=u[1];c==="NEW CERTIFICATE REQUEST"&&(c="CERTIFICATE REQUEST");var p={type:c,procType:null,contentDomain:null,dekInfo:null,headers:[],body:e.util.decode64(u[3])};if(a.push(p),!!u[2]){for(var h=u[2].split(l),d=0;u&&d<h.length;){for(var v=h[d].replace(/\s+$/,""),m=d+1;m<h.length;++m){var b=h[m];if(!/\s/.test(b[0]))break;v+=b,d=m}if(u=v.match(s),u){for(var f={name:u[1],values:[]},y=u[2].split(","),C=0;C<y.length;++C)f.values.push(r(y[C]));if(p.procType)if(!p.contentDomain&&f.name==="Content-Domain")p.contentDomain=y[0]||"";else if(!p.dekInfo&&f.name==="DEK-Info"){if(f.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');p.dekInfo={algorithm:y[0],parameters:y[1]||null}}else p.headers.push(f);else{if(f.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(f.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');p.procType={version:y[0],type:y[1]}}}++d}if(p.procType==="ENCRYPTED"&&!p.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(a.length===0)throw new Error("Invalid PEM formatted message.");return a};function n(i){for(var a=i.name+": ",o=[],s=function(h,d){return" "+d},l=0;l<i.values.length;++l)o.push(i.values[l].replace(/^(\S+\r\n)/,s));a+=o.join(",")+`\r
12
12
  `;for(var u=0,c=-1,l=0;l<a.length;++l,++u)if(u>65&&c!==-1){var p=a[c];p===","?(++c,a=a.substr(0,c)+`\r
13
13
  `+a.substr(c)):a=a.substr(0,c)+`\r
14
- `+p+a.substr(c+1),u=l-c-1,c=-1,++l}else(a[l]===" "||a[l]===" "||a[l]===",")&&(c=l);return a}function r(i){return i.replace(/^\s+/,"")}return Pd.exports}var $d={exports:{}},Fd,um;function Ac(){if(um)return Fd;um=1;var e=Le();L0(),bx(),Ue(),Fd=e.des=e.des||{},e.des.startEncrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!1,mode:b||(v===null?"ECB":"CBC")});return f.start(v),f},e.des.createEncryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!1,mode:v})},e.des.startDecrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!0,mode:b||(v===null?"ECB":"CBC")});return f.start(v),f},e.des.createDecryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!0,mode:v})},e.des.Algorithm=function(d,v){var m=this;m.name=d,m.mode=new v({blockSize:8,cipher:{encrypt:function(b,f){return p(m._keys,b,f,!1)},decrypt:function(b,f){return p(m._keys,b,f,!0)}}}),m._init=!1},e.des.Algorithm.prototype.initialize=function(d){if(!this._init){var v=e.util.createBuffer(d.key);if(this.name.indexOf("3DES")===0&&v.length()!==24)throw new Error("Invalid Triple-DES key size: "+v.length()*8);this._keys=c(v),this._init=!0}},t("DES-ECB",e.cipher.modes.ecb),t("DES-CBC",e.cipher.modes.cbc),t("DES-CFB",e.cipher.modes.cfb),t("DES-OFB",e.cipher.modes.ofb),t("DES-CTR",e.cipher.modes.ctr),t("3DES-ECB",e.cipher.modes.ecb),t("3DES-CBC",e.cipher.modes.cbc),t("3DES-CFB",e.cipher.modes.cfb),t("3DES-OFB",e.cipher.modes.ofb),t("3DES-CTR",e.cipher.modes.ctr);function t(d,v){var m=function(){return new e.des.Algorithm(d,v)};e.cipher.registerAlgorithm(d,m)}var n=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],r=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],i=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],a=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],o=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],s=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],u=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function c(d){for(var v=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],m=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],b=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],f=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],y=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],C=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],S=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],w=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],E=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],x=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],g=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],I=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],A=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],_=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],T=d.length()>8?3:1,$=[],B=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],P=0,k,O=0;O<T;O++){var M=d.getInt32(),G=d.getInt32();k=(M>>>4^G)&252645135,G^=k,M^=k<<4,k=(G>>>-16^M)&65535,M^=k,G^=k<<-16,k=(M>>>2^G)&858993459,G^=k,M^=k<<2,k=(G>>>-16^M)&65535,M^=k,G^=k<<-16,k=(M>>>1^G)&1431655765,G^=k,M^=k<<1,k=(G>>>8^M)&16711935,M^=k,G^=k<<8,k=(M>>>1^G)&1431655765,G^=k,M^=k<<1,k=M<<8|G>>>20&240,M=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=k;for(var W=0;W<B.length;++W){B[W]?(M=M<<2|M>>>26,G=G<<2|G>>>26):(M=M<<1|M>>>27,G=G<<1|G>>>27),M&=-15,G&=-15;var U=v[M>>>28]|m[M>>>24&15]|b[M>>>20&15]|f[M>>>16&15]|y[M>>>12&15]|C[M>>>8&15]|S[M>>>4&15],q=w[G>>>28]|E[G>>>24&15]|x[G>>>20&15]|g[G>>>16&15]|I[G>>>12&15]|A[G>>>8&15]|_[G>>>4&15];k=(q>>>16^U)&65535,$[P++]=U^k,$[P++]=q^k<<16}}return $}function p(d,v,m,b){var f=d.length===32?3:9,y;f===3?y=b?[30,-2,-2]:[0,32,2]:y=b?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var C,S=v[0],w=v[1];C=(S>>>4^w)&252645135,w^=C,S^=C<<4,C=(S>>>16^w)&65535,w^=C,S^=C<<16,C=(w>>>2^S)&858993459,S^=C,w^=C<<2,C=(w>>>8^S)&16711935,S^=C,w^=C<<8,C=(S>>>1^w)&1431655765,w^=C,S^=C<<1,S=S<<1|S>>>31,w=w<<1|w>>>31;for(var E=0;E<f;E+=3){for(var x=y[E+1],g=y[E+2],I=y[E];I!=x;I+=g){var A=w^d[I],_=(w>>>4|w<<28)^d[I+1];C=S,S=w,w=C^(r[A>>>24&63]|a[A>>>16&63]|s[A>>>8&63]|u[A&63]|n[_>>>24&63]|i[_>>>16&63]|o[_>>>8&63]|l[_&63])}C=S,S=w,w=C}S=S>>>1|S<<31,w=w>>>1|w<<31,C=(S>>>1^w)&1431655765,w^=C,S^=C<<1,C=(w>>>8^S)&16711935,S^=C,w^=C<<8,C=(w>>>2^S)&858993459,S^=C,w^=C<<2,C=(S>>>16^w)&65535,w^=C,S^=C<<16,C=(S>>>4^w)&252645135,w^=C,S^=C<<4,m[0]=S,m[1]=w}function h(d){d=d||{};var v=(d.mode||"CBC").toUpperCase(),m="DES-"+v,b;d.decrypt?b=e.cipher.createDecipher(m,d.key):b=e.cipher.createCipher(m,d.key);var f=b.start;return b.start=function(y,C){var S=null;C instanceof e.util.ByteBuffer&&(S=C,C={}),C=C||{},C.output=S,C.iv=y,f.call(b,C)},b}return Fd}const aD={},oD=Object.freeze(Object.defineProperty({__proto__:null,default:aD},Symbol.toStringTag,{value:"Module"})),H0=rD(oD);var Nd,cm;function j0(){if(cm)return Nd;cm=1;var e=Le();rl(),mi(),Ue();var t=e.pkcs5=e.pkcs5||{},n;return e.util.isNodejs&&!e.options.usePureJavaScript&&(n=H0),Nd=e.pbkdf2=t.pbkdf2=function(r,i,a,o,s,l){if(typeof s=="function"&&(l=s,s=null),e.util.isNodejs&&!e.options.usePureJavaScript&&n.pbkdf2&&(s===null||typeof s!="object")&&(n.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),i=Buffer.from(i,"binary"),l?n.pbkdf2Sync.length===4?n.pbkdf2(r,i,a,o,function(E,x){if(E)return l(E);l(null,x.toString("binary"))}):n.pbkdf2(r,i,a,o,s,function(E,x){if(E)return l(E);l(null,x.toString("binary"))}):n.pbkdf2Sync.length===4?n.pbkdf2Sync(r,i,a,o).toString("binary"):n.pbkdf2Sync(r,i,a,o,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in e.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=e.md[s].create()}var u=s.digestLength;if(o>4294967295*u){var c=new Error("Derived key is too long.");if(l)return l(c);throw c}var p=Math.ceil(o/u),h=o-(p-1)*u,d=e.hmac.create();d.start(s,r);var v="",m,b,f;if(!l){for(var y=1;y<=p;++y){d.start(null,null),d.update(i),d.update(e.util.int32ToBytes(y)),m=f=d.digest().getBytes();for(var C=2;C<=a;++C)d.start(null,null),d.update(f),b=d.digest().getBytes(),m=e.util.xorBytes(m,b,u),f=b;v+=y<p?m:m.substr(0,h)}return v}var y=1,C;function S(){if(y>p)return l(null,v);d.start(null,null),d.update(i),d.update(e.util.int32ToBytes(y)),m=f=d.digest().getBytes(),C=2,w()}function w(){if(C<=a)return d.start(null,null),d.update(f),b=d.digest().getBytes(),m=e.util.xorBytes(m,b,u),f=b,++C,e.util.setImmediate(w);v+=y<p?m:m.substr(0,h),++y,S()}S()},Nd}var Tl={exports:{}},Md={exports:{}},dm;function yx(){if(dm)return Md.exports;dm=1;var e=Le();mi(),Ue();var t=Md.exports=e.sha256=e.sha256||{};e.md.sha256=e.md.algorithms.sha256=t,t.create=function(){r||a();var s=null,l=e.util.createBuffer(),u=new Array(64),c={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return c.start=function(){c.messageLength=0,c.fullMessageLength=c.messageLength64=[];for(var p=c.messageLengthSize/4,h=0;h<p;++h)c.fullMessageLength.push(0);return l=e.util.createBuffer(),s={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},c},c.start(),c.update=function(p,h){h==="utf8"&&(p=e.util.encodeUtf8(p));var d=p.length;c.messageLength+=d,d=[d/4294967296>>>0,d>>>0];for(var v=c.fullMessageLength.length-1;v>=0;--v)c.fullMessageLength[v]+=d[1],d[1]=d[0]+(c.fullMessageLength[v]/4294967296>>>0),c.fullMessageLength[v]=c.fullMessageLength[v]>>>0,d[0]=d[1]/4294967296>>>0;return l.putBytes(p),o(s,u,l),(l.read>2048||l.length()===0)&&l.compact(),c},c.digest=function(){var p=e.util.createBuffer();p.putBytes(l.bytes());var h=c.fullMessageLength[c.fullMessageLength.length-1]+c.messageLengthSize,d=h&c.blockLength-1;p.putBytes(n.substr(0,c.blockLength-d));for(var v,m,b=c.fullMessageLength[0]*8,f=0;f<c.fullMessageLength.length-1;++f)v=c.fullMessageLength[f+1]*8,m=v/4294967296>>>0,b+=m,p.putInt32(b>>>0),b=v>>>0;p.putInt32(b);var y={h0:s.h0,h1:s.h1,h2:s.h2,h3:s.h3,h4:s.h4,h5:s.h5,h6:s.h6,h7:s.h7};o(y,u,p);var C=e.util.createBuffer();return C.putInt32(y.h0),C.putInt32(y.h1),C.putInt32(y.h2),C.putInt32(y.h3),C.putInt32(y.h4),C.putInt32(y.h5),C.putInt32(y.h6),C.putInt32(y.h7),C},c};var n=null,r=!1,i=null;function a(){n="€",n+=e.util.fillString("\0",64),i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=!0}function o(s,l,u){for(var c,p,h,d,v,m,b,f,y,C,S,w,E,x,g,I=u.length();I>=64;){for(b=0;b<16;++b)l[b]=u.getInt32();for(;b<64;++b)c=l[b-2],c=(c>>>17|c<<15)^(c>>>19|c<<13)^c>>>10,p=l[b-15],p=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,l[b]=c+l[b-7]+p+l[b-16]|0;for(f=s.h0,y=s.h1,C=s.h2,S=s.h3,w=s.h4,E=s.h5,x=s.h6,g=s.h7,b=0;b<64;++b)d=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),v=x^w&(E^x),h=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),m=f&y|C&(f^y),c=g+d+v+i[b]+l[b],p=h+m,g=x,x=E,E=w,w=S+c>>>0,S=C,C=y,y=f,f=c+p>>>0;s.h0=s.h0+f|0,s.h1=s.h1+y|0,s.h2=s.h2+C|0,s.h3=s.h3+S|0,s.h4=s.h4+w|0,s.h5=s.h5+E|0,s.h6=s.h6+x|0,s.h7=s.h7+g|0,I-=64}}return Md.exports}var Od={exports:{}},fm;function xx(){if(fm)return Od.exports;fm=1;var e=Le();Ue();var t=null;e.util.isNodejs&&!e.options.usePureJavaScript&&!process.versions["node-webkit"]&&(t=H0);var n=Od.exports=e.prng=e.prng||{};return n.create=function(r){for(var i={plugin:r,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=r.md,o=new Array(32),s=0;s<32;++s)o[s]=a.create();i.pools=o,i.pool=0,i.generate=function(h,d){if(!d)return i.generateSync(h);var v=i.plugin.cipher,m=i.plugin.increment,b=i.plugin.formatKey,f=i.plugin.formatSeed,y=e.util.createBuffer();i.key=null,C();function C(S){if(S)return d(S);if(y.length()>=h)return d(null,y.getBytes(h));if(i.generated>1048575&&(i.key=null),i.key===null)return e.util.nextTick(function(){l(C)});var w=v(i.key,i.seed);i.generated+=w.length,y.putBytes(w),i.key=b(v(i.key,m(i.seed))),i.seed=f(v(i.key,i.seed)),e.util.setImmediate(C)}},i.generateSync=function(h){var d=i.plugin.cipher,v=i.plugin.increment,m=i.plugin.formatKey,b=i.plugin.formatSeed;i.key=null;for(var f=e.util.createBuffer();f.length()<h;){i.generated>1048575&&(i.key=null),i.key===null&&u();var y=d(i.key,i.seed);i.generated+=y.length,f.putBytes(y),i.key=m(d(i.key,v(i.seed))),i.seed=b(d(i.key,i.seed))}return f.getBytes(h)};function l(h){if(i.pools[0].messageLength>=32)return c(),h();var d=32-i.pools[0].messageLength<<5;i.seedFile(d,function(v,m){if(v)return h(v);i.collect(m),c(),h()})}function u(){if(i.pools[0].messageLength>=32)return c();var h=32-i.pools[0].messageLength<<5;i.collect(i.seedFileSync(h)),c()}function c(){i.reseeds=i.reseeds===4294967295?0:i.reseeds+1;var h=i.plugin.md.create();h.update(i.keyBytes);for(var d=1,v=0;v<32;++v)i.reseeds%d===0&&(h.update(i.pools[v].digest().getBytes()),i.pools[v].start()),d=d<<1;i.keyBytes=h.digest().getBytes(),h.start(),h.update(i.keyBytes);var m=h.digest().getBytes();i.key=i.plugin.formatKey(i.keyBytes),i.seed=i.plugin.formatSeed(m),i.generated=0}function p(h){var d=null,v=e.util.globalScope,m=v.crypto||v.msCrypto;m&&m.getRandomValues&&(d=function(g){return m.getRandomValues(g)});var b=e.util.createBuffer();if(d)for(;b.length()<h;){var f=Math.max(1,Math.min(h-b.length(),65536)/4),y=new Uint32Array(Math.floor(f));try{d(y);for(var C=0;C<y.length;++C)b.putInt32(y[C])}catch(g){if(!(typeof QuotaExceededError<"u"&&g instanceof QuotaExceededError))throw g}}if(b.length()<h)for(var S,w,E,x=Math.floor(Math.random()*65536);b.length()<h;){w=16807*(x&65535),S=16807*(x>>16),w+=(S&32767)<<16,w+=S>>15,w=(w&2147483647)+(w>>31),x=w&4294967295;for(var C=0;C<3;++C)E=x>>>(C<<3),E^=Math.floor(Math.random()*256),b.putByte(E&255)}return b.getBytes(h)}return t?(i.seedFile=function(h,d){t.randomBytes(h,function(v,m){if(v)return d(v);d(null,m.toString())})},i.seedFileSync=function(h){return t.randomBytes(h).toString()}):(i.seedFile=function(h,d){try{d(null,p(h))}catch(v){d(v)}},i.seedFileSync=p),i.collect=function(h){for(var d=h.length,v=0;v<d;++v)i.pools[i.pool].update(h.substr(v,1)),i.pool=i.pool===31?0:i.pool+1},i.collectInt=function(h,d){for(var v="",m=0;m<d;m+=8)v+=String.fromCharCode(h>>m&255);i.collect(v)},i.registerWorker=function(h){if(h===self)i.seedFile=function(v,m){function b(f){var y=f.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",b),m(y.forge.prng.err,y.forge.prng.bytes))}self.addEventListener("message",b),self.postMessage({forge:{prng:{needed:v}}})};else{var d=function(v){var m=v.data;m.forge&&m.forge.prng&&i.seedFile(m.forge.prng.needed,function(b,f){h.postMessage({forge:{prng:{err:b,bytes:f}}})})};h.addEventListener("message",d)}},i},Od.exports}var hm;function Er(){if(hm)return Tl.exports;hm=1;var e=Le();return Ma(),yx(),xx(),Ue(),function(){if(e.random&&e.random.getBytes){Tl.exports=e.random;return}(function(t){var n={},r=new Array(4),i=e.util.createBuffer();n.formatKey=function(h){var d=e.util.createBuffer(h);return h=new Array(4),h[0]=d.getInt32(),h[1]=d.getInt32(),h[2]=d.getInt32(),h[3]=d.getInt32(),e.aes._expandKey(h,!1)},n.formatSeed=function(h){var d=e.util.createBuffer(h);return h=new Array(4),h[0]=d.getInt32(),h[1]=d.getInt32(),h[2]=d.getInt32(),h[3]=d.getInt32(),h},n.cipher=function(h,d){return e.aes._updateBlock(h,d,r,!1),i.putInt32(r[0]),i.putInt32(r[1]),i.putInt32(r[2]),i.putInt32(r[3]),i.getBytes()},n.increment=function(h){return++h[3],h},n.md=e.md.sha256;function a(){var h=e.prng.create(n);return h.getBytes=function(d,v){return h.generate(d,v)},h.getBytesSync=function(d){return h.generate(d)},h}var o=a(),s=null,l=e.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(s=function(h){return u.getRandomValues(h)}),e.options.usePureJavaScript||!e.util.isNodejs&&!s){if(o.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var p in navigator)try{typeof navigator[p]=="string"&&(c+=navigator[p])}catch{}o.collect(c),c=null}t&&(t().mousemove(function(h){o.collectInt(h.clientX,16),o.collectInt(h.clientY,16)}),t().keypress(function(h){o.collectInt(h.charCode,8)}))}if(!e.random)e.random=o;else for(var p in o)e.random[p]=o[p];e.random.createInstance=a,Tl.exports=e.random})(typeof jQuery<"u"?jQuery:null)}(),Tl.exports}var Ld,gm;function Cx(){if(gm)return Ld;gm=1;var e=Le();Ue();var t=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],n=[1,2,3,5],r=function(o,s){return o<<s&65535|(o&65535)>>16-s},i=function(o,s){return(o&65535)>>s|o<<16-s&65535};Ld=e.rc2=e.rc2||{},e.rc2.expandKey=function(o,s){typeof o=="string"&&(o=e.util.createBuffer(o)),s=s||128;var l=o,u=o.length(),c=s,p=Math.ceil(c/8),h=255>>(c&7),d;for(d=u;d<128;d++)l.putByte(t[l.at(d-1)+l.at(d-u)&255]);for(l.setAt(128-p,t[l.at(128-p)&h]),d=127-p;d>=0;d--)l.setAt(d,t[l.at(d+1)^l.at(d+p)]);return l};var a=function(o,s,l){var u=!1,c=null,p=null,h=null,d,v,m,b,f=[];for(o=e.rc2.expandKey(o,s),m=0;m<64;m++)f.push(o.getInt16Le());l?(d=function(S){for(m=0;m<4;m++)S[m]+=f[b]+(S[(m+3)%4]&S[(m+2)%4])+(~S[(m+3)%4]&S[(m+1)%4]),S[m]=r(S[m],n[m]),b++},v=function(S){for(m=0;m<4;m++)S[m]+=f[S[(m+3)%4]&63]}):(d=function(S){for(m=3;m>=0;m--)S[m]=i(S[m],n[m]),S[m]-=f[b]+(S[(m+3)%4]&S[(m+2)%4])+(~S[(m+3)%4]&S[(m+1)%4]),b--},v=function(S){for(m=3;m>=0;m--)S[m]-=f[S[(m+3)%4]&63]});var y=function(S){var w=[];for(m=0;m<4;m++){var E=c.getInt16Le();h!==null&&(l?E^=h.getInt16Le():h.putInt16Le(E)),w.push(E&65535)}b=l?0:63;for(var x=0;x<S.length;x++)for(var g=0;g<S[x][0];g++)S[x][1](w);for(m=0;m<4;m++)h!==null&&(l?h.putInt16Le(w[m]):w[m]^=h.getInt16Le()),p.putInt16Le(w[m])},C=null;return C={start:function(S,w){S&&typeof S=="string"&&(S=e.util.createBuffer(S)),u=!1,c=e.util.createBuffer(),p=w||new e.util.createBuffer,h=S,C.output=p},update:function(S){for(u||c.putBuffer(S);c.length()>=8;)y([[5,d],[1,v],[6,d],[1,v],[5,d]])},finish:function(S){var w=!0;if(l)if(S)w=S(8,c,!l);else{var E=c.length()===8?8:8-c.length();c.fillWithByte(E,E)}if(w&&(u=!0,C.update()),!l&&(w=c.length()===0,w))if(S)w=S(8,p,!l);else{var x=p.length(),g=p.at(x-1);g>x?w=!1:p.truncate(g)}return w}},C};return e.rc2.startEncrypting=function(o,s,l){var u=e.rc2.createEncryptionCipher(o,128);return u.start(s,l),u},e.rc2.createEncryptionCipher=function(o,s){return a(o,s,!0)},e.rc2.startDecrypting=function(o,s,l){var u=e.rc2.createDecryptionCipher(o,128);return u.start(s,l),u},e.rc2.createDecryptionCipher=function(o,s){return a(o,s,!1)},Ld}var Vd,pm;function Rc(){if(pm)return Vd;pm=1;var e=Le();Vd=e.jsbn=e.jsbn||{};var t;function n(j,z,Y){this.data=[],j!=null&&(typeof j=="number"?this.fromNumber(j,z,Y):z==null&&typeof j!="string"?this.fromString(j,256):this.fromString(j,z))}e.jsbn.BigInteger=n;function r(){return new n(null)}function i(j,z,Y,ne,de,fe){for(;--fe>=0;){var ye=z*this.data[j++]+Y.data[ne]+de;de=Math.floor(ye/67108864),Y.data[ne++]=ye&67108863}return de}function a(j,z,Y,ne,de,fe){for(var ye=z&32767,me=z>>15;--fe>=0;){var ot=this.data[j]&32767,en=this.data[j++]>>15,Wn=me*ot+en*ye;ot=ye*ot+((Wn&32767)<<15)+Y.data[ne]+(de&1073741823),de=(ot>>>30)+(Wn>>>15)+me*en+(de>>>30),Y.data[ne++]=ot&1073741823}return de}function o(j,z,Y,ne,de,fe){for(var ye=z&16383,me=z>>14;--fe>=0;){var ot=this.data[j]&16383,en=this.data[j++]>>14,Wn=me*ot+en*ye;ot=ye*ot+((Wn&16383)<<14)+Y.data[ne]+de,de=(ot>>28)+(Wn>>14)+me*en,Y.data[ne++]=ot&268435455}return de}typeof navigator>"u"?(n.prototype.am=o,t=28):navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=a,t=30):navigator.appName!="Netscape"?(n.prototype.am=i,t=26):(n.prototype.am=o,t=28),n.prototype.DB=t,n.prototype.DM=(1<<t)-1,n.prototype.DV=1<<t;var s=52;n.prototype.FV=Math.pow(2,s),n.prototype.F1=s-t,n.prototype.F2=2*t-s;var l="0123456789abcdefghijklmnopqrstuvwxyz",u=new Array,c,p;for(c=48,p=0;p<=9;++p)u[c++]=p;for(c=97,p=10;p<36;++p)u[c++]=p;for(c=65,p=10;p<36;++p)u[c++]=p;function h(j){return l.charAt(j)}function d(j,z){var Y=u[j.charCodeAt(z)];return Y??-1}function v(j){for(var z=this.t-1;z>=0;--z)j.data[z]=this.data[z];j.t=this.t,j.s=this.s}function m(j){this.t=1,this.s=j<0?-1:0,j>0?this.data[0]=j:j<-1?this.data[0]=j+this.DV:this.t=0}function b(j){var z=r();return z.fromInt(j),z}function f(j,z){var Y;if(z==16)Y=4;else if(z==8)Y=3;else if(z==256)Y=8;else if(z==2)Y=1;else if(z==32)Y=5;else if(z==4)Y=2;else{this.fromRadix(j,z);return}this.t=0,this.s=0;for(var ne=j.length,de=!1,fe=0;--ne>=0;){var ye=Y==8?j[ne]&255:d(j,ne);if(ye<0){j.charAt(ne)=="-"&&(de=!0);continue}de=!1,fe==0?this.data[this.t++]=ye:fe+Y>this.DB?(this.data[this.t-1]|=(ye&(1<<this.DB-fe)-1)<<fe,this.data[this.t++]=ye>>this.DB-fe):this.data[this.t-1]|=ye<<fe,fe+=Y,fe>=this.DB&&(fe-=this.DB)}Y==8&&(j[0]&128)!=0&&(this.s=-1,fe>0&&(this.data[this.t-1]|=(1<<this.DB-fe)-1<<fe)),this.clamp(),de&&n.ZERO.subTo(this,this)}function y(){for(var j=this.s&this.DM;this.t>0&&this.data[this.t-1]==j;)--this.t}function C(j){if(this.s<0)return"-"+this.negate().toString(j);var z;if(j==16)z=4;else if(j==8)z=3;else if(j==2)z=1;else if(j==32)z=5;else if(j==4)z=2;else return this.toRadix(j);var Y=(1<<z)-1,ne,de=!1,fe="",ye=this.t,me=this.DB-ye*this.DB%z;if(ye-- >0)for(me<this.DB&&(ne=this.data[ye]>>me)>0&&(de=!0,fe=h(ne));ye>=0;)me<z?(ne=(this.data[ye]&(1<<me)-1)<<z-me,ne|=this.data[--ye]>>(me+=this.DB-z)):(ne=this.data[ye]>>(me-=z)&Y,me<=0&&(me+=this.DB,--ye)),ne>0&&(de=!0),de&&(fe+=h(ne));return de?fe:"0"}function S(){var j=r();return n.ZERO.subTo(this,j),j}function w(){return this.s<0?this.negate():this}function E(j){var z=this.s-j.s;if(z!=0)return z;var Y=this.t;if(z=Y-j.t,z!=0)return this.s<0?-z:z;for(;--Y>=0;)if((z=this.data[Y]-j.data[Y])!=0)return z;return 0}function x(j){var z=1,Y;return(Y=j>>>16)!=0&&(j=Y,z+=16),(Y=j>>8)!=0&&(j=Y,z+=8),(Y=j>>4)!=0&&(j=Y,z+=4),(Y=j>>2)!=0&&(j=Y,z+=2),(Y=j>>1)!=0&&(j=Y,z+=1),z}function g(){return this.t<=0?0:this.DB*(this.t-1)+x(this.data[this.t-1]^this.s&this.DM)}function I(j,z){var Y;for(Y=this.t-1;Y>=0;--Y)z.data[Y+j]=this.data[Y];for(Y=j-1;Y>=0;--Y)z.data[Y]=0;z.t=this.t+j,z.s=this.s}function A(j,z){for(var Y=j;Y<this.t;++Y)z.data[Y-j]=this.data[Y];z.t=Math.max(this.t-j,0),z.s=this.s}function _(j,z){var Y=j%this.DB,ne=this.DB-Y,de=(1<<ne)-1,fe=Math.floor(j/this.DB),ye=this.s<<Y&this.DM,me;for(me=this.t-1;me>=0;--me)z.data[me+fe+1]=this.data[me]>>ne|ye,ye=(this.data[me]&de)<<Y;for(me=fe-1;me>=0;--me)z.data[me]=0;z.data[fe]=ye,z.t=this.t+fe+1,z.s=this.s,z.clamp()}function T(j,z){z.s=this.s;var Y=Math.floor(j/this.DB);if(Y>=this.t){z.t=0;return}var ne=j%this.DB,de=this.DB-ne,fe=(1<<ne)-1;z.data[0]=this.data[Y]>>ne;for(var ye=Y+1;ye<this.t;++ye)z.data[ye-Y-1]|=(this.data[ye]&fe)<<de,z.data[ye-Y]=this.data[ye]>>ne;ne>0&&(z.data[this.t-Y-1]|=(this.s&fe)<<de),z.t=this.t-Y,z.clamp()}function $(j,z){for(var Y=0,ne=0,de=Math.min(j.t,this.t);Y<de;)ne+=this.data[Y]-j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;if(j.t<this.t){for(ne-=j.s;Y<this.t;)ne+=this.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne+=this.s}else{for(ne+=this.s;Y<j.t;)ne-=j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne-=j.s}z.s=ne<0?-1:0,ne<-1?z.data[Y++]=this.DV+ne:ne>0&&(z.data[Y++]=ne),z.t=Y,z.clamp()}function B(j,z){var Y=this.abs(),ne=j.abs(),de=Y.t;for(z.t=de+ne.t;--de>=0;)z.data[de]=0;for(de=0;de<ne.t;++de)z.data[de+Y.t]=Y.am(0,ne.data[de],z,de,0,Y.t);z.s=0,z.clamp(),this.s!=j.s&&n.ZERO.subTo(z,z)}function P(j){for(var z=this.abs(),Y=j.t=2*z.t;--Y>=0;)j.data[Y]=0;for(Y=0;Y<z.t-1;++Y){var ne=z.am(Y,z.data[Y],j,2*Y,0,1);(j.data[Y+z.t]+=z.am(Y+1,2*z.data[Y],j,2*Y+1,ne,z.t-Y-1))>=z.DV&&(j.data[Y+z.t]-=z.DV,j.data[Y+z.t+1]=1)}j.t>0&&(j.data[j.t-1]+=z.am(Y,z.data[Y],j,2*Y,0,1)),j.s=0,j.clamp()}function k(j,z,Y){var ne=j.abs();if(!(ne.t<=0)){var de=this.abs();if(de.t<ne.t){z!=null&&z.fromInt(0),Y!=null&&this.copyTo(Y);return}Y==null&&(Y=r());var fe=r(),ye=this.s,me=j.s,ot=this.DB-x(ne.data[ne.t-1]);ot>0?(ne.lShiftTo(ot,fe),de.lShiftTo(ot,Y)):(ne.copyTo(fe),de.copyTo(Y));var en=fe.t,Wn=fe.data[en-1];if(Wn!=0){var $n=Wn*(1<<this.F1)+(en>1?fe.data[en-2]>>this.F2:0),Kr=this.FV/$n,wl=(1<<this.F1)/$n,lr=1<<this.F2,ur=Y.t,Il=ur-en,Si=z??r();for(fe.dlShiftTo(Il,Si),Y.compareTo(Si)>=0&&(Y.data[Y.t++]=1,Y.subTo(Si,Y)),n.ONE.dlShiftTo(en,Si),Si.subTo(fe,fe);fe.t<en;)fe.data[fe.t++]=0;for(;--Il>=0;){var vd=Y.data[--ur]==Wn?this.DM:Math.floor(Y.data[ur]*Kr+(Y.data[ur-1]+lr)*wl);if((Y.data[ur]+=fe.am(0,vd,Y,Il,0,en))<vd)for(fe.dlShiftTo(Il,Si),Y.subTo(Si,Y);Y.data[ur]<--vd;)Y.subTo(Si,Y)}z!=null&&(Y.drShiftTo(en,z),ye!=me&&n.ZERO.subTo(z,z)),Y.t=en,Y.clamp(),ot>0&&Y.rShiftTo(ot,Y),ye<0&&n.ZERO.subTo(Y,Y)}}}function O(j){var z=r();return this.abs().divRemTo(j,null,z),this.s<0&&z.compareTo(n.ZERO)>0&&j.subTo(z,z),z}function M(j){this.m=j}function G(j){return j.s<0||j.compareTo(this.m)>=0?j.mod(this.m):j}function W(j){return j}function U(j){j.divRemTo(this.m,null,j)}function q(j,z,Y){j.multiplyTo(z,Y),this.reduce(Y)}function Q(j,z){j.squareTo(z),this.reduce(z)}M.prototype.convert=G,M.prototype.revert=W,M.prototype.reduce=U,M.prototype.mulTo=q,M.prototype.sqrTo=Q;function Z(){if(this.t<1)return 0;var j=this.data[0];if((j&1)==0)return 0;var z=j&3;return z=z*(2-(j&15)*z)&15,z=z*(2-(j&255)*z)&255,z=z*(2-((j&65535)*z&65535))&65535,z=z*(2-j*z%this.DV)%this.DV,z>0?this.DV-z:-z}function ee(j){this.m=j,this.mp=j.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<j.DB-15)-1,this.mt2=2*j.t}function J(j){var z=r();return j.abs().dlShiftTo(this.m.t,z),z.divRemTo(this.m,null,z),j.s<0&&z.compareTo(n.ZERO)>0&&this.m.subTo(z,z),z}function le(j){var z=r();return j.copyTo(z),this.reduce(z),z}function re(j){for(;j.t<=this.mt2;)j.data[j.t++]=0;for(var z=0;z<this.m.t;++z){var Y=j.data[z]&32767,ne=Y*this.mpl+((Y*this.mph+(j.data[z]>>15)*this.mpl&this.um)<<15)&j.DM;for(Y=z+this.m.t,j.data[Y]+=this.m.am(0,ne,j,z,0,this.m.t);j.data[Y]>=j.DV;)j.data[Y]-=j.DV,j.data[++Y]++}j.clamp(),j.drShiftTo(this.m.t,j),j.compareTo(this.m)>=0&&j.subTo(this.m,j)}function R(j,z){j.squareTo(z),this.reduce(z)}function H(j,z,Y){j.multiplyTo(z,Y),this.reduce(Y)}ee.prototype.convert=J,ee.prototype.revert=le,ee.prototype.reduce=re,ee.prototype.mulTo=H,ee.prototype.sqrTo=R;function V(){return(this.t>0?this.data[0]&1:this.s)==0}function D(j,z){if(j>4294967295||j<1)return n.ONE;var Y=r(),ne=r(),de=z.convert(this),fe=x(j)-1;for(de.copyTo(Y);--fe>=0;)if(z.sqrTo(Y,ne),(j&1<<fe)>0)z.mulTo(ne,de,Y);else{var ye=Y;Y=ne,ne=ye}return z.revert(Y)}function L(j,z){var Y;return j<256||z.isEven()?Y=new M(z):Y=new ee(z),this.exp(j,Y)}n.prototype.copyTo=v,n.prototype.fromInt=m,n.prototype.fromString=f,n.prototype.clamp=y,n.prototype.dlShiftTo=I,n.prototype.drShiftTo=A,n.prototype.lShiftTo=_,n.prototype.rShiftTo=T,n.prototype.subTo=$,n.prototype.multiplyTo=B,n.prototype.squareTo=P,n.prototype.divRemTo=k,n.prototype.invDigit=Z,n.prototype.isEven=V,n.prototype.exp=D,n.prototype.toString=C,n.prototype.negate=S,n.prototype.abs=w,n.prototype.compareTo=E,n.prototype.bitLength=g,n.prototype.mod=O,n.prototype.modPowInt=L,n.ZERO=b(0),n.ONE=b(1);function K(){var j=r();return this.copyTo(j),j}function X(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function se(){return this.t==0?this.s:this.data[0]<<24>>24}function ie(){return this.t==0?this.s:this.data[0]<<16>>16}function oe(j){return Math.floor(Math.LN2*this.DB/Math.log(j))}function te(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function ue(j){if(j==null&&(j=10),this.signum()==0||j<2||j>36)return"0";var z=this.chunkSize(j),Y=Math.pow(j,z),ne=b(Y),de=r(),fe=r(),ye="";for(this.divRemTo(ne,de,fe);de.signum()>0;)ye=(Y+fe.intValue()).toString(j).substr(1)+ye,de.divRemTo(ne,de,fe);return fe.intValue().toString(j)+ye}function ve(j,z){this.fromInt(0),z==null&&(z=10);for(var Y=this.chunkSize(z),ne=Math.pow(z,Y),de=!1,fe=0,ye=0,me=0;me<j.length;++me){var ot=d(j,me);if(ot<0){j.charAt(me)=="-"&&this.signum()==0&&(de=!0);continue}ye=z*ye+ot,++fe>=Y&&(this.dMultiply(ne),this.dAddOffset(ye,0),fe=0,ye=0)}fe>0&&(this.dMultiply(Math.pow(z,fe)),this.dAddOffset(ye,0)),de&&n.ZERO.subTo(this,this)}function be(j,z,Y){if(typeof z=="number")if(j<2)this.fromInt(1);else for(this.fromNumber(j,Y),this.testBit(j-1)||this.bitwiseTo(n.ONE.shiftLeft(j-1),xt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(z);)this.dAddOffset(2,0),this.bitLength()>j&&this.subTo(n.ONE.shiftLeft(j-1),this);else{var ne=new Array,de=j&7;ne.length=(j>>3)+1,z.nextBytes(ne),de>0?ne[0]&=(1<<de)-1:ne[0]=0,this.fromString(ne,256)}}function pe(){var j=this.t,z=new Array;z[0]=this.s;var Y=this.DB-j*this.DB%8,ne,de=0;if(j-- >0)for(Y<this.DB&&(ne=this.data[j]>>Y)!=(this.s&this.DM)>>Y&&(z[de++]=ne|this.s<<this.DB-Y);j>=0;)Y<8?(ne=(this.data[j]&(1<<Y)-1)<<8-Y,ne|=this.data[--j]>>(Y+=this.DB-8)):(ne=this.data[j]>>(Y-=8)&255,Y<=0&&(Y+=this.DB,--j)),(ne&128)!=0&&(ne|=-256),de==0&&(this.s&128)!=(ne&128)&&++de,(de>0||ne!=this.s)&&(z[de++]=ne);return z}function Te(j){return this.compareTo(j)==0}function Ne(j){return this.compareTo(j)<0?this:j}function We(j){return this.compareTo(j)>0?this:j}function et(j,z,Y){var ne,de,fe=Math.min(j.t,this.t);for(ne=0;ne<fe;++ne)Y.data[ne]=z(this.data[ne],j.data[ne]);if(j.t<this.t){for(de=j.s&this.DM,ne=fe;ne<this.t;++ne)Y.data[ne]=z(this.data[ne],de);Y.t=this.t}else{for(de=this.s&this.DM,ne=fe;ne<j.t;++ne)Y.data[ne]=z(de,j.data[ne]);Y.t=j.t}Y.s=z(this.s,j.s),Y.clamp()}function lt(j,z){return j&z}function ut(j){var z=r();return this.bitwiseTo(j,lt,z),z}function xt(j,z){return j|z}function Dt(j){var z=r();return this.bitwiseTo(j,xt,z),z}function kt(j,z){return j^z}function mn(j){var z=r();return this.bitwiseTo(j,kt,z),z}function vn(j,z){return j&~z}function Pn(j){var z=r();return this.bitwiseTo(j,vn,z),z}function Gn(){for(var j=r(),z=0;z<this.t;++z)j.data[z]=this.DM&~this.data[z];return j.t=this.t,j.s=~this.s,j}function or(j){var z=r();return j<0?this.rShiftTo(-j,z):this.lShiftTo(j,z),z}function Sr(j){var z=r();return j<0?this.lShiftTo(-j,z):this.rShiftTo(j,z),z}function Yr(j){if(j==0)return-1;var z=0;return(j&65535)==0&&(j>>=16,z+=16),(j&255)==0&&(j>>=8,z+=8),(j&15)==0&&(j>>=4,z+=4),(j&3)==0&&(j>>=2,z+=2),(j&1)==0&&++z,z}function Ei(){for(var j=0;j<this.t;++j)if(this.data[j]!=0)return j*this.DB+Yr(this.data[j]);return this.s<0?this.t*this.DB:-1}function ea(j){for(var z=0;j!=0;)j&=j-1,++z;return z}function Ga(){for(var j=0,z=this.s&this.DM,Y=0;Y<this.t;++Y)j+=ea(this.data[Y]^z);return j}function Uo(j){var z=Math.floor(j/this.DB);return z>=this.t?this.s!=0:(this.data[z]&1<<j%this.DB)!=0}function Sl(j,z){var Y=n.ONE.shiftLeft(j);return this.bitwiseTo(Y,z,Y),Y}function Vt(j){return this.changeBit(j,xt)}function Ht(j){return this.changeBit(j,vn)}function jt(j){return this.changeBit(j,kt)}function zt(j,z){for(var Y=0,ne=0,de=Math.min(j.t,this.t);Y<de;)ne+=this.data[Y]+j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;if(j.t<this.t){for(ne+=j.s;Y<this.t;)ne+=this.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne+=this.s}else{for(ne+=this.s;Y<j.t;)ne+=j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne+=j.s}z.s=ne<0?-1:0,ne>0?z.data[Y++]=ne:ne<-1&&(z.data[Y++]=this.DV+ne),z.t=Y,z.clamp()}function Gt(j){var z=r();return this.addTo(j,z),z}function Wt(j){var z=r();return this.subTo(j,z),z}function Ut(j){var z=r();return this.multiplyTo(j,z),z}function Xt(j){var z=r();return this.divRemTo(j,z,null),z}function Yt(j){var z=r();return this.divRemTo(j,null,z),z}function Kt(j){var z=r(),Y=r();return this.divRemTo(j,z,Y),new Array(z,Y)}function Zt(j){this.data[this.t]=this.am(0,j-1,this,0,0,this.t),++this.t,this.clamp()}function Jt(j,z){if(j!=0){for(;this.t<=z;)this.data[this.t++]=0;for(this.data[z]+=j;this.data[z]>=this.DV;)this.data[z]-=this.DV,++z>=this.t&&(this.data[this.t++]=0),++this.data[z]}}function Ct(){}function Pt(j){return j}function qt(j,z,Y){j.multiplyTo(z,Y)}function Qt(j,z){j.squareTo(z)}Ct.prototype.convert=Pt,Ct.prototype.revert=Pt,Ct.prototype.mulTo=qt,Ct.prototype.sqrTo=Qt;function Qw(j){return this.exp(j,new Ct)}function eI(j,z,Y){var ne=Math.min(this.t+j.t,z);for(Y.s=0,Y.t=ne;ne>0;)Y.data[--ne]=0;var de;for(de=Y.t-this.t;ne<de;++ne)Y.data[ne+this.t]=this.am(0,j.data[ne],Y,ne,0,this.t);for(de=Math.min(j.t,z);ne<de;++ne)this.am(0,j.data[ne],Y,ne,0,z-ne);Y.clamp()}function tI(j,z,Y){--z;var ne=Y.t=this.t+j.t-z;for(Y.s=0;--ne>=0;)Y.data[ne]=0;for(ne=Math.max(z-this.t,0);ne<j.t;++ne)Y.data[this.t+ne-z]=this.am(z-ne,j.data[ne],Y,0,0,this.t+ne-z);Y.clamp(),Y.drShiftTo(1,Y)}function Wa(j){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*j.t,this.r2),this.mu=this.r2.divide(j),this.m=j}function nI(j){if(j.s<0||j.t>2*this.m.t)return j.mod(this.m);if(j.compareTo(this.m)<0)return j;var z=r();return j.copyTo(z),this.reduce(z),z}function rI(j){return j}function iI(j){for(j.drShiftTo(this.m.t-1,this.r2),j.t>this.m.t+1&&(j.t=this.m.t+1,j.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);j.compareTo(this.r2)<0;)j.dAddOffset(1,this.m.t+1);for(j.subTo(this.r2,j);j.compareTo(this.m)>=0;)j.subTo(this.m,j)}function aI(j,z){j.squareTo(z),this.reduce(z)}function oI(j,z,Y){j.multiplyTo(z,Y),this.reduce(Y)}Wa.prototype.convert=nI,Wa.prototype.revert=rI,Wa.prototype.reduce=iI,Wa.prototype.mulTo=oI,Wa.prototype.sqrTo=aI;function sI(j,z){var Y=j.bitLength(),ne,de=b(1),fe;if(Y<=0)return de;Y<18?ne=1:Y<48?ne=3:Y<144?ne=4:Y<768?ne=5:ne=6,Y<8?fe=new M(z):z.isEven()?fe=new Wa(z):fe=new ee(z);var ye=new Array,me=3,ot=ne-1,en=(1<<ne)-1;if(ye[1]=fe.convert(this),ne>1){var Wn=r();for(fe.sqrTo(ye[1],Wn);me<=en;)ye[me]=r(),fe.mulTo(Wn,ye[me-2],ye[me]),me+=2}var $n=j.t-1,Kr,wl=!0,lr=r(),ur;for(Y=x(j.data[$n])-1;$n>=0;){for(Y>=ot?Kr=j.data[$n]>>Y-ot&en:(Kr=(j.data[$n]&(1<<Y+1)-1)<<ot-Y,$n>0&&(Kr|=j.data[$n-1]>>this.DB+Y-ot)),me=ne;(Kr&1)==0;)Kr>>=1,--me;if((Y-=me)<0&&(Y+=this.DB,--$n),wl)ye[Kr].copyTo(de),wl=!1;else{for(;me>1;)fe.sqrTo(de,lr),fe.sqrTo(lr,de),me-=2;me>0?fe.sqrTo(de,lr):(ur=de,de=lr,lr=ur),fe.mulTo(lr,ye[Kr],de)}for(;$n>=0&&(j.data[$n]&1<<Y)==0;)fe.sqrTo(de,lr),ur=de,de=lr,lr=ur,--Y<0&&(Y=this.DB-1,--$n)}return fe.revert(de)}function lI(j){var z=this.s<0?this.negate():this.clone(),Y=j.s<0?j.negate():j.clone();if(z.compareTo(Y)<0){var ne=z;z=Y,Y=ne}var de=z.getLowestSetBit(),fe=Y.getLowestSetBit();if(fe<0)return z;for(de<fe&&(fe=de),fe>0&&(z.rShiftTo(fe,z),Y.rShiftTo(fe,Y));z.signum()>0;)(de=z.getLowestSetBit())>0&&z.rShiftTo(de,z),(de=Y.getLowestSetBit())>0&&Y.rShiftTo(de,Y),z.compareTo(Y)>=0?(z.subTo(Y,z),z.rShiftTo(1,z)):(Y.subTo(z,Y),Y.rShiftTo(1,Y));return fe>0&&Y.lShiftTo(fe,Y),Y}function uI(j){if(j<=0)return 0;var z=this.DV%j,Y=this.s<0?j-1:0;if(this.t>0)if(z==0)Y=this.data[0]%j;else for(var ne=this.t-1;ne>=0;--ne)Y=(z*Y+this.data[ne])%j;return Y}function cI(j){var z=j.isEven();if(this.isEven()&&z||j.signum()==0)return n.ZERO;for(var Y=j.clone(),ne=this.clone(),de=b(1),fe=b(0),ye=b(0),me=b(1);Y.signum()!=0;){for(;Y.isEven();)Y.rShiftTo(1,Y),z?((!de.isEven()||!fe.isEven())&&(de.addTo(this,de),fe.subTo(j,fe)),de.rShiftTo(1,de)):fe.isEven()||fe.subTo(j,fe),fe.rShiftTo(1,fe);for(;ne.isEven();)ne.rShiftTo(1,ne),z?((!ye.isEven()||!me.isEven())&&(ye.addTo(this,ye),me.subTo(j,me)),ye.rShiftTo(1,ye)):me.isEven()||me.subTo(j,me),me.rShiftTo(1,me);Y.compareTo(ne)>=0?(Y.subTo(ne,Y),z&&de.subTo(ye,de),fe.subTo(me,fe)):(ne.subTo(Y,ne),z&&ye.subTo(de,ye),me.subTo(fe,me))}if(ne.compareTo(n.ONE)!=0)return n.ZERO;if(me.compareTo(j)>=0)return me.subtract(j);if(me.signum()<0)me.addTo(j,me);else return me;return me.signum()<0?me.add(j):me}var sr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],dI=(1<<26)/sr[sr.length-1];function fI(j){var z,Y=this.abs();if(Y.t==1&&Y.data[0]<=sr[sr.length-1]){for(z=0;z<sr.length;++z)if(Y.data[0]==sr[z])return!0;return!1}if(Y.isEven())return!1;for(z=1;z<sr.length;){for(var ne=sr[z],de=z+1;de<sr.length&&ne<dI;)ne*=sr[de++];for(ne=Y.modInt(ne);z<de;)if(ne%sr[z++]==0)return!1}return Y.millerRabin(j)}function hI(j){var z=this.subtract(n.ONE),Y=z.getLowestSetBit();if(Y<=0)return!1;for(var ne=z.shiftRight(Y),de=gI(),fe,ye=0;ye<j;++ye){do fe=new n(this.bitLength(),de);while(fe.compareTo(n.ONE)<=0||fe.compareTo(z)>=0);var me=fe.modPow(ne,this);if(me.compareTo(n.ONE)!=0&&me.compareTo(z)!=0){for(var ot=1;ot++<Y&&me.compareTo(z)!=0;)if(me=me.modPowInt(2,this),me.compareTo(n.ONE)==0)return!1;if(me.compareTo(z)!=0)return!1}}return!0}function gI(){return{nextBytes:function(j){for(var z=0;z<j.length;++z)j[z]=Math.floor(Math.random()*256)}}}return n.prototype.chunkSize=oe,n.prototype.toRadix=ue,n.prototype.fromRadix=ve,n.prototype.fromNumber=be,n.prototype.bitwiseTo=et,n.prototype.changeBit=Sl,n.prototype.addTo=zt,n.prototype.dMultiply=Zt,n.prototype.dAddOffset=Jt,n.prototype.multiplyLowerTo=eI,n.prototype.multiplyUpperTo=tI,n.prototype.modInt=uI,n.prototype.millerRabin=hI,n.prototype.clone=K,n.prototype.intValue=X,n.prototype.byteValue=se,n.prototype.shortValue=ie,n.prototype.signum=te,n.prototype.toByteArray=pe,n.prototype.equals=Te,n.prototype.min=Ne,n.prototype.max=We,n.prototype.and=ut,n.prototype.or=Dt,n.prototype.xor=mn,n.prototype.andNot=Pn,n.prototype.not=Gn,n.prototype.shiftLeft=or,n.prototype.shiftRight=Sr,n.prototype.getLowestSetBit=Ei,n.prototype.bitCount=Ga,n.prototype.testBit=Uo,n.prototype.setBit=Vt,n.prototype.clearBit=Ht,n.prototype.flipBit=jt,n.prototype.add=Gt,n.prototype.subtract=Wt,n.prototype.multiply=Ut,n.prototype.divide=Xt,n.prototype.remainder=Yt,n.prototype.divideAndRemainder=Kt,n.prototype.modPow=sI,n.prototype.modInverse=cI,n.prototype.pow=Qw,n.prototype.gcd=lI,n.prototype.isProbablePrime=fI,Vd}var Hd={exports:{}},jd={exports:{}},mm;function il(){if(mm)return jd.exports;mm=1;var e=Le();mi(),Ue();var t=jd.exports=e.sha1=e.sha1||{};e.md.sha1=e.md.algorithms.sha1=t,t.create=function(){r||i();var o=null,s=e.util.createBuffer(),l=new Array(80),u={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return u.start=function(){u.messageLength=0,u.fullMessageLength=u.messageLength64=[];for(var c=u.messageLengthSize/4,p=0;p<c;++p)u.fullMessageLength.push(0);return s=e.util.createBuffer(),o={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},u},u.start(),u.update=function(c,p){p==="utf8"&&(c=e.util.encodeUtf8(c));var h=c.length;u.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var d=u.fullMessageLength.length-1;d>=0;--d)u.fullMessageLength[d]+=h[1],h[1]=h[0]+(u.fullMessageLength[d]/4294967296>>>0),u.fullMessageLength[d]=u.fullMessageLength[d]>>>0,h[0]=h[1]/4294967296>>>0;return s.putBytes(c),a(o,l,s),(s.read>2048||s.length()===0)&&s.compact(),u},u.digest=function(){var c=e.util.createBuffer();c.putBytes(s.bytes());var p=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize,h=p&u.blockLength-1;c.putBytes(n.substr(0,u.blockLength-h));for(var d,v,m=u.fullMessageLength[0]*8,b=0;b<u.fullMessageLength.length-1;++b)d=u.fullMessageLength[b+1]*8,v=d/4294967296>>>0,m+=v,c.putInt32(m>>>0),m=d>>>0;c.putInt32(m);var f={h0:o.h0,h1:o.h1,h2:o.h2,h3:o.h3,h4:o.h4};a(f,l,c);var y=e.util.createBuffer();return y.putInt32(f.h0),y.putInt32(f.h1),y.putInt32(f.h2),y.putInt32(f.h3),y.putInt32(f.h4),y},u};var n=null,r=!1;function i(){n="€",n+=e.util.fillString("\0",64),r=!0}function a(o,s,l){for(var u,c,p,h,d,v,m,b,f=l.length();f>=64;){for(c=o.h0,p=o.h1,h=o.h2,d=o.h3,v=o.h4,b=0;b<16;++b)u=l.getInt32(),s[b]=u,m=d^p&(h^d),u=(c<<5|c>>>27)+m+v+1518500249+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<20;++b)u=s[b-3]^s[b-8]^s[b-14]^s[b-16],u=u<<1|u>>>31,s[b]=u,m=d^p&(h^d),u=(c<<5|c>>>27)+m+v+1518500249+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<32;++b)u=s[b-3]^s[b-8]^s[b-14]^s[b-16],u=u<<1|u>>>31,s[b]=u,m=p^h^d,u=(c<<5|c>>>27)+m+v+1859775393+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<40;++b)u=s[b-6]^s[b-16]^s[b-28]^s[b-32],u=u<<2|u>>>30,s[b]=u,m=p^h^d,u=(c<<5|c>>>27)+m+v+1859775393+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<60;++b)u=s[b-6]^s[b-16]^s[b-28]^s[b-32],u=u<<2|u>>>30,s[b]=u,m=p&h|d&(p^h),u=(c<<5|c>>>27)+m+v+2400959708+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<80;++b)u=s[b-6]^s[b-16]^s[b-28]^s[b-32],u=u<<2|u>>>30,s[b]=u,m=p^h^d,u=(c<<5|c>>>27)+m+v+3395469782+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;o.h0=o.h0+c|0,o.h1=o.h1+p|0,o.h2=o.h2+h|0,o.h3=o.h3+d|0,o.h4=o.h4+v|0,f-=64}}return jd.exports}var vm;function Ex(){if(vm)return Hd.exports;vm=1;var e=Le();Ue(),Er(),il();var t=Hd.exports=e.pkcs1=e.pkcs1||{};t.encode_rsa_oaep=function(r,i,a){var o,s,l,u;typeof a=="string"?(o=a,s=arguments[3]||void 0,l=arguments[4]||void 0):a&&(o=a.label||void 0,s=a.seed||void 0,l=a.md||void 0,a.mgf1&&a.mgf1.md&&(u=a.mgf1.md)),l?l.start():l=e.md.sha1.create(),u||(u=l);var c=Math.ceil(r.n.bitLength()/8),p=c-2*l.digestLength-2;if(i.length>p){var h=new Error("RSAES-OAEP input message length is too long.");throw h.length=i.length,h.maxLength=p,h}o||(o=""),l.update(o,"raw");for(var d=l.digest(),v="",m=p-i.length,b=0;b<m;b++)v+="\0";var f=d.getBytes()+v+""+i;if(!s)s=e.random.getBytes(l.digestLength);else if(s.length!==l.digestLength){var h=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw h.seedLength=s.length,h.digestLength=l.digestLength,h}var y=n(s,c-l.digestLength-1,u),C=e.util.xorBytes(f,y,f.length),S=n(C,l.digestLength,u),w=e.util.xorBytes(s,S,s.length);return"\0"+w+C},t.decode_rsa_oaep=function(r,i,a){var o,s,l;typeof a=="string"?(o=a,s=arguments[3]||void 0):a&&(o=a.label||void 0,s=a.md||void 0,a.mgf1&&a.mgf1.md&&(l=a.mgf1.md));var u=Math.ceil(r.n.bitLength()/8);if(i.length!==u){var C=new Error("RSAES-OAEP encoded message length is invalid.");throw C.length=i.length,C.expectedLength=u,C}if(s===void 0?s=e.md.sha1.create():s.start(),l||(l=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");o||(o=""),s.update(o,"raw");for(var c=s.digest().getBytes(),p=i.charAt(0),h=i.substring(1,s.digestLength+1),d=i.substring(1+s.digestLength),v=n(d,s.digestLength,l),m=e.util.xorBytes(h,v,h.length),b=n(m,u-s.digestLength-1,l),f=e.util.xorBytes(d,b,d.length),y=f.substring(0,s.digestLength),C=p!=="\0",S=0;S<s.digestLength;++S)C|=c.charAt(S)!==y.charAt(S);for(var w=1,E=s.digestLength,x=s.digestLength;x<f.length;x++){var g=f.charCodeAt(x),I=g&1^1,A=w?65534:0;C|=g&A,w=w&I,E+=w}if(C||f.charCodeAt(E)!==1)throw new Error("Invalid RSAES-OAEP padding.");return f.substring(E+1)};function n(r,i,a){a||(a=e.md.sha1.create());for(var o="",s=Math.ceil(i/a.digestLength),l=0;l<s;++l){var u=String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,l&255);a.start(),a.update(r+u),o+=a.digest().getBytes()}return o.substring(0,i)}return Hd.exports}var Al={exports:{}},bm;function Sx(){if(bm)return Al.exports;bm=1;var e=Le();return Ue(),Rc(),Er(),function(){if(e.prime){Al.exports=e.prime;return}var t=Al.exports=e.prime=e.prime||{},n=e.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],i=new n(null);i.fromInt(30);var a=function(h,d){return h|d};t.generateProbablePrime=function(h,d,v){typeof d=="function"&&(v=d,d={}),d=d||{};var m=d.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var b=d.prng||e.random,f={nextBytes:function(y){for(var C=b.getBytesSync(y.length),S=0;S<y.length;++S)y[S]=C.charCodeAt(S)}};if(m.name==="PRIMEINC")return o(h,f,m.options,v);throw new Error("Invalid prime generation algorithm: "+m.name)};function o(h,d,v,m){return"workers"in v?u(h,d,v,m):s(h,d,v,m)}function s(h,d,v,m){var b=c(h,d),f=0,y=p(b.bitLength());"millerRabinTests"in v&&(y=v.millerRabinTests);var C=10;"maxBlockTime"in v&&(C=v.maxBlockTime),l(b,h,d,f,y,C,m)}function l(h,d,v,m,b,f,y){var C=+new Date;do{if(h.bitLength()>d&&(h=c(d,v)),h.isProbablePrime(b))return y(null,h);h.dAddOffset(r[m++%8],0)}while(f<0||+new Date-C<f);e.util.setImmediate(function(){l(h,d,v,m,b,f,y)})}function u(h,d,v,m){if(typeof Worker>"u")return s(h,d,v,m);var b=c(h,d),f=v.workers,y=v.workLoad||100,C=y*30/8,S=v.workerScript||"forge/prime.worker.js";if(f===-1)return e.util.estimateCores(function(E,x){E&&(x=2),f=x-1,w()});w();function w(){f=Math.max(1,f);for(var E=[],x=0;x<f;++x)E[x]=new Worker(S);for(var x=0;x<f;++x)E[x].addEventListener("message",I);var g=!1;function I(A){if(!g){var _=A.data;if(_.found){for(var T=0;T<E.length;++T)E[T].terminate();return g=!0,m(null,new n(_.prime,16))}b.bitLength()>h&&(b=c(h,d));var $=b.toString(16);A.target.postMessage({hex:$,workLoad:y}),b.dAddOffset(C,0)}}}}function c(h,d){var v=new n(h,d),m=h-1;return v.testBit(m)||v.bitwiseTo(n.ONE.shiftLeft(m),a,v),v.dAddOffset(31-v.mod(i).byteValue(),0),v}function p(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}}(),Al.exports}var zd,ym;function Bc(){if(ym)return zd;ym=1;var e=Le();if(Wr(),Rc(),Oa(),Ex(),Sx(),Er(),Ue(),typeof t>"u")var t=e.jsbn.BigInteger;var n=e.util.isNodejs?H0:null,r=e.asn1,i=e.util;e.pki=e.pki||{},zd=e.pki.rsa=e.rsa=e.rsa||{};var a=e.pki,o=[6,4,2,4,2,4,6,2],s={name:"PrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},u={name:"RSAPublicKey",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},c=e.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:r.Class.UNIVERSAL,type:r.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},h=function(x){var g;if(x.algorithm in a.oids)g=a.oids[x.algorithm];else{var I=new Error("Unknown message digest algorithm.");throw I.algorithm=x.algorithm,I}var A=r.oidToDer(g).getBytes(),_=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),T=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);T.value.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,A)),T.value.push(r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,""));var $=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,x.digest().getBytes());return _.value.push(T),_.value.push($),r.toDer(_).getBytes()},d=function(x,g,I){if(I)return x.modPow(g.e,g.n);if(!g.p||!g.q)return x.modPow(g.d,g.n);g.dP||(g.dP=g.d.mod(g.p.subtract(t.ONE))),g.dQ||(g.dQ=g.d.mod(g.q.subtract(t.ONE))),g.qInv||(g.qInv=g.q.modInverse(g.p));var A;do A=new t(e.util.bytesToHex(e.random.getBytes(g.n.bitLength()/8)),16);while(A.compareTo(g.n)>=0||!A.gcd(g.n).equals(t.ONE));x=x.multiply(A.modPow(g.e,g.n)).mod(g.n);for(var _=x.mod(g.p).modPow(g.dP,g.p),T=x.mod(g.q).modPow(g.dQ,g.q);_.compareTo(T)<0;)_=_.add(g.p);var $=_.subtract(T).multiply(g.qInv).mod(g.p).multiply(g.q).add(T);return $=$.multiply(A.modInverse(g.n)).mod(g.n),$};a.rsa.encrypt=function(x,g,I){var A=I,_,T=Math.ceil(g.n.bitLength()/8);I!==!1&&I!==!0?(A=I===2,_=v(x,g,I)):(_=e.util.createBuffer(),_.putBytes(x));for(var $=new t(_.toHex(),16),B=d($,g,A),P=B.toString(16),k=e.util.createBuffer(),O=T-Math.ceil(P.length/2);O>0;)k.putByte(0),--O;return k.putBytes(e.util.hexToBytes(P)),k.getBytes()},a.rsa.decrypt=function(x,g,I,A){var _=Math.ceil(g.n.bitLength()/8);if(x.length!==_){var T=new Error("Encrypted message length is invalid.");throw T.length=x.length,T.expected=_,T}var $=new t(e.util.createBuffer(x).toHex(),16);if($.compareTo(g.n)>=0)throw new Error("Encrypted message is invalid.");for(var B=d($,g,I),P=B.toString(16),k=e.util.createBuffer(),O=_-Math.ceil(P.length/2);O>0;)k.putByte(0),--O;return k.putBytes(e.util.hexToBytes(P)),A!==!1?m(k.getBytes(),g,I):k.getBytes()},a.rsa.createKeyPairGenerationState=function(x,g,I){typeof x=="string"&&(x=parseInt(x,10)),x=x||2048,I=I||{};var A=I.prng||e.random,_={nextBytes:function(B){for(var P=A.getBytesSync(B.length),k=0;k<B.length;++k)B[k]=P.charCodeAt(k)}},T=I.algorithm||"PRIMEINC",$;if(T==="PRIMEINC")$={algorithm:T,state:0,bits:x,rng:_,eInt:g||65537,e:new t(null),p:null,q:null,qBits:x>>1,pBits:x-(x>>1),pqState:0,num:null,keys:null},$.e.fromInt($.eInt);else throw new Error("Invalid key generation algorithm: "+T);return $},a.rsa.stepKeyPairGenerationState=function(x,g){"algorithm"in x||(x.algorithm="PRIMEINC");var I=new t(null);I.fromInt(30);for(var A=0,_=function(M,G){return M|G},T=+new Date,$,B=0;x.keys===null&&(g<=0||B<g);){if(x.state===0){var P=x.p===null?x.pBits:x.qBits,k=P-1;x.pqState===0?(x.num=new t(P,x.rng),x.num.testBit(k)||x.num.bitwiseTo(t.ONE.shiftLeft(k),_,x.num),x.num.dAddOffset(31-x.num.mod(I).byteValue(),0),A=0,++x.pqState):x.pqState===1?x.num.bitLength()>P?x.pqState=0:x.num.isProbablePrime(y(x.num.bitLength()))?++x.pqState:x.num.dAddOffset(o[A++%8],0):x.pqState===2?x.pqState=x.num.subtract(t.ONE).gcd(x.e).compareTo(t.ONE)===0?3:0:x.pqState===3&&(x.pqState=0,x.p===null?x.p=x.num:x.q=x.num,x.p!==null&&x.q!==null&&++x.state,x.num=null)}else if(x.state===1)x.p.compareTo(x.q)<0&&(x.num=x.p,x.p=x.q,x.q=x.num),++x.state;else if(x.state===2)x.p1=x.p.subtract(t.ONE),x.q1=x.q.subtract(t.ONE),x.phi=x.p1.multiply(x.q1),++x.state;else if(x.state===3)x.phi.gcd(x.e).compareTo(t.ONE)===0?++x.state:(x.p=null,x.q=null,x.state=0);else if(x.state===4)x.n=x.p.multiply(x.q),x.n.bitLength()===x.bits?++x.state:(x.q=null,x.state=0);else if(x.state===5){var O=x.e.modInverse(x.phi);x.keys={privateKey:a.rsa.setPrivateKey(x.n,x.e,O,x.p,x.q,O.mod(x.p1),O.mod(x.q1),x.q.modInverse(x.p)),publicKey:a.rsa.setPublicKey(x.n,x.e)}}$=+new Date,B+=$-T,T=$}return x.keys!==null},a.rsa.generateKeyPair=function(x,g,I,A){if(arguments.length===1?typeof x=="object"?(I=x,x=void 0):typeof x=="function"&&(A=x,x=void 0):arguments.length===2?typeof x=="number"?typeof g=="function"?(A=g,g=void 0):typeof g!="number"&&(I=g,g=void 0):(I=x,A=g,x=void 0,g=void 0):arguments.length===3&&(typeof g=="number"?typeof I=="function"&&(A=I,I=void 0):(A=I,I=g,g=void 0)),I=I||{},x===void 0&&(x=I.bits||2048),g===void 0&&(g=I.e||65537),!e.options.usePureJavaScript&&!I.prng&&x>=256&&x<=16384&&(g===65537||g===3)){if(A){if(C("generateKeyPair"))return n.generateKeyPair("rsa",{modulusLength:x,publicExponent:g,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(B,P,k){if(B)return A(B);A(null,{privateKey:a.privateKeyFromPem(k),publicKey:a.publicKeyFromPem(P)})});if(S("generateKey")&&S("exportKey"))return i.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:x,publicExponent:E(g),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(B){return i.globalScope.crypto.subtle.exportKey("pkcs8",B.privateKey)}).then(void 0,function(B){A(B)}).then(function(B){if(B){var P=a.privateKeyFromAsn1(r.fromDer(e.util.createBuffer(B)));A(null,{privateKey:P,publicKey:a.setRsaPublicKey(P.n,P.e)})}});if(w("generateKey")&&w("exportKey")){var _=i.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:x,publicExponent:E(g),hash:{name:"SHA-256"}},!0,["sign","verify"]);_.oncomplete=function(B){var P=B.target.result,k=i.globalScope.msCrypto.subtle.exportKey("pkcs8",P.privateKey);k.oncomplete=function(O){var M=O.target.result,G=a.privateKeyFromAsn1(r.fromDer(e.util.createBuffer(M)));A(null,{privateKey:G,publicKey:a.setRsaPublicKey(G.n,G.e)})},k.onerror=function(O){A(O)}},_.onerror=function(B){A(B)};return}}else if(C("generateKeyPairSync")){var T=n.generateKeyPairSync("rsa",{modulusLength:x,publicExponent:g,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:a.privateKeyFromPem(T.privateKey),publicKey:a.publicKeyFromPem(T.publicKey)}}}var $=a.rsa.createKeyPairGenerationState(x,g,I);if(!A)return a.rsa.stepKeyPairGenerationState($,0),$.keys;b($,I,A)},a.setRsaPublicKey=a.rsa.setPublicKey=function(x,g){var I={n:x,e:g};return I.encrypt=function(A,_,T){if(typeof _=="string"?_=_.toUpperCase():_===void 0&&(_="RSAES-PKCS1-V1_5"),_==="RSAES-PKCS1-V1_5")_={encode:function(B,P,k){return v(B,P,2).getBytes()}};else if(_==="RSA-OAEP"||_==="RSAES-OAEP")_={encode:function(B,P){return e.pkcs1.encode_rsa_oaep(P,B,T)}};else if(["RAW","NONE","NULL",null].indexOf(_)!==-1)_={encode:function(B){return B}};else if(typeof _=="string")throw new Error('Unsupported encryption scheme: "'+_+'".');var $=_.encode(A,I,!0);return a.rsa.encrypt($,I,!0)},I.verify=function(A,_,T,$){typeof T=="string"?T=T.toUpperCase():T===void 0&&(T="RSASSA-PKCS1-V1_5"),$===void 0&&($={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in $||($._parseAllDigestBytes=!0),T==="RSASSA-PKCS1-V1_5"?T={verify:function(P,k){k=m(k,I,!0);var O=r.fromDer(k,{parseAllBytes:$._parseAllDigestBytes}),M={},G=[];if(!r.validate(O,p,M,G)){var W=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw W.errors=G,W}var U=r.derToOid(M.algorithmIdentifier);if(!(U===e.oids.md2||U===e.oids.md5||U===e.oids.sha1||U===e.oids.sha224||U===e.oids.sha256||U===e.oids.sha384||U===e.oids.sha512||U===e.oids["sha512-224"]||U===e.oids["sha512-256"])){var W=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw W.oid=U,W}if((U===e.oids.md2||U===e.oids.md5)&&!("parameters"in M))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return P===M.digest}}:(T==="NONE"||T==="NULL"||T===null)&&(T={verify:function(P,k){return k=m(k,I,!0),P===k}});var B=a.rsa.decrypt(_,I,!0,!1);return T.verify(A,B,I.n.bitLength())},I},a.setRsaPrivateKey=a.rsa.setPrivateKey=function(x,g,I,A,_,T,$,B){var P={n:x,e:g,d:I,p:A,q:_,dP:T,dQ:$,qInv:B};return P.decrypt=function(k,O,M){typeof O=="string"?O=O.toUpperCase():O===void 0&&(O="RSAES-PKCS1-V1_5");var G=a.rsa.decrypt(k,P,!1,!1);if(O==="RSAES-PKCS1-V1_5")O={decode:m};else if(O==="RSA-OAEP"||O==="RSAES-OAEP")O={decode:function(W,U){return e.pkcs1.decode_rsa_oaep(U,W,M)}};else if(["RAW","NONE","NULL",null].indexOf(O)!==-1)O={decode:function(W){return W}};else throw new Error('Unsupported encryption scheme: "'+O+'".');return O.decode(G,P,!1)},P.sign=function(k,O){var M=!1;typeof O=="string"&&(O=O.toUpperCase()),O===void 0||O==="RSASSA-PKCS1-V1_5"?(O={encode:h},M=1):(O==="NONE"||O==="NULL"||O===null)&&(O={encode:function(){return k}},M=1);var G=O.encode(k,P.n.bitLength());return a.rsa.encrypt(G,P,M)},P},a.wrapRsaPrivateKey=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(0).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a.oids.rsaEncryption).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(x).getBytes())])},a.privateKeyFromAsn1=function(x){var g={},I=[];if(r.validate(x,s,g,I)&&(x=r.fromDer(e.util.createBuffer(g.privateKey))),g={},I=[],!r.validate(x,l,g,I)){var A=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw A.errors=I,A}var _,T,$,B,P,k,O,M;return _=e.util.createBuffer(g.privateKeyModulus).toHex(),T=e.util.createBuffer(g.privateKeyPublicExponent).toHex(),$=e.util.createBuffer(g.privateKeyPrivateExponent).toHex(),B=e.util.createBuffer(g.privateKeyPrime1).toHex(),P=e.util.createBuffer(g.privateKeyPrime2).toHex(),k=e.util.createBuffer(g.privateKeyExponent1).toHex(),O=e.util.createBuffer(g.privateKeyExponent2).toHex(),M=e.util.createBuffer(g.privateKeyCoefficient).toHex(),a.setRsaPrivateKey(new t(_,16),new t(T,16),new t($,16),new t(B,16),new t(P,16),new t(k,16),new t(O,16),new t(M,16))},a.privateKeyToAsn1=a.privateKeyToRSAPrivateKey=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(0).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.n)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.e)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.d)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.p)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.q)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.dP)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.dQ)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.qInv))])},a.publicKeyFromAsn1=function(x){var g={},I=[];if(r.validate(x,c,g,I)){var A=r.derToOid(g.publicKeyOid);if(A!==a.oids.rsaEncryption){var _=new Error("Cannot read public key. Unknown OID.");throw _.oid=A,_}x=g.rsaPublicKey}if(I=[],!r.validate(x,u,g,I)){var _=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw _.errors=I,_}var T=e.util.createBuffer(g.publicKeyModulus).toHex(),$=e.util.createBuffer(g.publicKeyExponent).toHex();return a.setRsaPublicKey(new t(T,16),new t($,16))},a.publicKeyToAsn1=a.publicKeyToSubjectPublicKeyInfo=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a.oids.rsaEncryption).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,[a.publicKeyToRSAPublicKey(x)])])},a.publicKeyToRSAPublicKey=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.n)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.e))])};function v(x,g,I){var A=e.util.createBuffer(),_=Math.ceil(g.n.bitLength()/8);if(x.length>_-11){var T=new Error("Message is too long for PKCS#1 v1.5 padding.");throw T.length=x.length,T.max=_-11,T}A.putByte(0),A.putByte(I);var $=_-3-x.length,B;if(I===0||I===1){B=I===0?0:255;for(var P=0;P<$;++P)A.putByte(B)}else for(;$>0;){for(var k=0,O=e.random.getBytes($),P=0;P<$;++P)B=O.charCodeAt(P),B===0?++k:A.putByte(B);$=k}return A.putByte(0),A.putBytes(x),A}function m(x,g,I,A){var _=Math.ceil(g.n.bitLength()/8),T=e.util.createBuffer(x),$=T.getByte(),B=T.getByte();if($!==0||I&&B!==0&&B!==1||!I&&B!=2||I&&B===0&&typeof A>"u")throw new Error("Encryption block is invalid.");var P=0;if(B===0){P=_-3-A;for(var k=0;k<P;++k)if(T.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(B===1)for(P=0;T.length()>1;){if(T.getByte()!==255){--T.read;break}++P}else if(B===2)for(P=0;T.length()>1;){if(T.getByte()===0){--T.read;break}++P}var O=T.getByte();if(O!==0||P!==_-3-T.length())throw new Error("Encryption block is invalid.");return T.getBytes()}function b(x,g,I){typeof g=="function"&&(I=g,g={}),g=g||{};var A={algorithm:{name:g.algorithm||"PRIMEINC",options:{workers:g.workers||2,workLoad:g.workLoad||100,workerScript:g.workerScript}}};"prng"in g&&(A.prng=g.prng),_();function _(){T(x.pBits,function(B,P){if(B)return I(B);if(x.p=P,x.q!==null)return $(B,x.q);T(x.qBits,$)})}function T(B,P){e.prime.generateProbablePrime(B,A,P)}function $(B,P){if(B)return I(B);if(x.q=P,x.p.compareTo(x.q)<0){var k=x.p;x.p=x.q,x.q=k}if(x.p.subtract(t.ONE).gcd(x.e).compareTo(t.ONE)!==0){x.p=null,_();return}if(x.q.subtract(t.ONE).gcd(x.e).compareTo(t.ONE)!==0){x.q=null,T(x.qBits,$);return}if(x.p1=x.p.subtract(t.ONE),x.q1=x.q.subtract(t.ONE),x.phi=x.p1.multiply(x.q1),x.phi.gcd(x.e).compareTo(t.ONE)!==0){x.p=x.q=null,_();return}if(x.n=x.p.multiply(x.q),x.n.bitLength()!==x.bits){x.q=null,T(x.qBits,$);return}var O=x.e.modInverse(x.phi);x.keys={privateKey:a.rsa.setPrivateKey(x.n,x.e,O,x.p,x.q,O.mod(x.p1),O.mod(x.q1),x.q.modInverse(x.p)),publicKey:a.rsa.setPublicKey(x.n,x.e)},I(null,x.keys)}}function f(x){var g=x.toString(16);g[0]>="8"&&(g="00"+g);var I=e.util.hexToBytes(g);return I.length>1&&(I.charCodeAt(0)===0&&(I.charCodeAt(1)&128)===0||I.charCodeAt(0)===255&&(I.charCodeAt(1)&128)===128)?I.substr(1):I}function y(x){return x<=100?27:x<=150?18:x<=200?15:x<=250?12:x<=300?9:x<=350?8:x<=400?7:x<=500?6:x<=600?5:x<=800?4:x<=1250?3:2}function C(x){return e.util.isNodejs&&typeof n[x]=="function"}function S(x){return typeof i.globalScope<"u"&&typeof i.globalScope.crypto=="object"&&typeof i.globalScope.crypto.subtle=="object"&&typeof i.globalScope.crypto.subtle[x]=="function"}function w(x){return typeof i.globalScope<"u"&&typeof i.globalScope.msCrypto=="object"&&typeof i.globalScope.msCrypto.subtle=="object"&&typeof i.globalScope.msCrypto.subtle[x]=="function"}function E(x){for(var g=e.util.hexToBytes(x.toString(16)),I=new Uint8Array(g.length),A=0;A<g.length;++A)I[A]=g.charCodeAt(A);return I}return zd}var Gd,xm;function wx(){if(xm)return Gd;xm=1;var e=Le();if(Ma(),Wr(),Ac(),mi(),Oa(),j0(),Oo(),Er(),Cx(),Bc(),Ue(),typeof t>"u")var t=e.jsbn.BigInteger;var n=e.asn1,r=e.pki=e.pki||{};Gd=r.pbe=e.pbe=e.pbe||{};var i=r.oids,a={name:"EncryptedPrivateKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},o={name:"PBES2Algorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},s={name:"pkcs-12PbeParams",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"iterations"}]};r.encryptPrivateKeyInfo=function(h,d,v){v=v||{},v.saltSize=v.saltSize||8,v.count=v.count||2048,v.algorithm=v.algorithm||"aes128",v.prfAlgorithm=v.prfAlgorithm||"sha1";var m=e.random.getBytesSync(v.saltSize),b=v.count,f=n.integerToDer(b),y,C,S;if(v.algorithm.indexOf("aes")===0||v.algorithm==="des"){var w,E,x;switch(v.algorithm){case"aes128":y=16,w=16,E=i["aes128-CBC"],x=e.aes.createEncryptionCipher;break;case"aes192":y=24,w=16,E=i["aes192-CBC"],x=e.aes.createEncryptionCipher;break;case"aes256":y=32,w=16,E=i["aes256-CBC"],x=e.aes.createEncryptionCipher;break;case"des":y=8,w=8,E=i.desCBC,x=e.des.createEncryptionCipher;break;default:var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=v.algorithm,g}var I="hmacWith"+v.prfAlgorithm.toUpperCase(),A=c(I),_=e.pkcs5.pbkdf2(d,m,b,y,A),T=e.random.getBytesSync(w),$=x(_);$.start(T),$.update(n.toDer(h)),$.finish(),S=$.output.getBytes();var B=p(m,f,y,I);C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.pkcs5PBES2).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.pkcs5PBKDF2).getBytes()),B]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(E).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,T)])])])}else if(v.algorithm==="3des"){y=24;var P=new e.util.ByteBuffer(m),_=r.pbe.generatePkcs12Key(d,P,1,b,y),T=r.pbe.generatePkcs12Key(d,P,2,b,y),$=e.des.createEncryptionCipher(_);$.start(T),$.update(n.toDer(h)),$.finish(),S=$.output.getBytes(),C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,m),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,f.getBytes())])])}else{var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=v.algorithm,g}var k=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[C,n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,S)]);return k},r.decryptPrivateKeyInfo=function(h,d){var v=null,m={},b=[];if(!n.validate(h,a,m,b)){var f=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=b,f}var y=n.derToOid(m.encryptionOid),C=r.pbe.getCipher(y,m.encryptionParams,d),S=e.util.createBuffer(m.encryptedData);return C.update(S),C.finish()&&(v=n.fromDer(C.output)),v},r.encryptedPrivateKeyToPem=function(h,d){var v={type:"ENCRYPTED PRIVATE KEY",body:n.toDer(h).getBytes()};return e.pem.encode(v,{maxline:d})},r.encryptedPrivateKeyFromPem=function(h){var d=e.pem.decode(h)[0];if(d.type!=="ENCRYPTED PRIVATE KEY"){var v=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw v.headerType=d.type,v}if(d.procType&&d.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return n.fromDer(d.body)},r.encryptRsaPrivateKey=function(h,d,v){if(v=v||{},!v.legacy){var m=r.wrapRsaPrivateKey(r.privateKeyToAsn1(h));return m=r.encryptPrivateKeyInfo(m,d,v),r.encryptedPrivateKeyToPem(m)}var b,f,y,C;switch(v.algorithm){case"aes128":b="AES-128-CBC",y=16,f=e.random.getBytesSync(16),C=e.aes.createEncryptionCipher;break;case"aes192":b="AES-192-CBC",y=24,f=e.random.getBytesSync(16),C=e.aes.createEncryptionCipher;break;case"aes256":b="AES-256-CBC",y=32,f=e.random.getBytesSync(16),C=e.aes.createEncryptionCipher;break;case"3des":b="DES-EDE3-CBC",y=24,f=e.random.getBytesSync(8),C=e.des.createEncryptionCipher;break;case"des":b="DES-CBC",y=8,f=e.random.getBytesSync(8),C=e.des.createEncryptionCipher;break;default:var S=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+v.algorithm+'".');throw S.algorithm=v.algorithm,S}var w=e.pbe.opensslDeriveBytes(d,f.substr(0,8),y),E=C(w);E.start(f),E.update(n.toDer(r.privateKeyToAsn1(h))),E.finish();var x={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:b,parameters:e.util.bytesToHex(f).toUpperCase()},body:E.output.getBytes()};return e.pem.encode(x)},r.decryptRsaPrivateKey=function(h,d){var v=null,m=e.pem.decode(h)[0];if(m.type!=="ENCRYPTED PRIVATE KEY"&&m.type!=="PRIVATE KEY"&&m.type!=="RSA PRIVATE KEY"){var b=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw b.headerType=b,b}if(m.procType&&m.procType.type==="ENCRYPTED"){var f,y;switch(m.dekInfo.algorithm){case"DES-CBC":f=8,y=e.des.createDecryptionCipher;break;case"DES-EDE3-CBC":f=24,y=e.des.createDecryptionCipher;break;case"AES-128-CBC":f=16,y=e.aes.createDecryptionCipher;break;case"AES-192-CBC":f=24,y=e.aes.createDecryptionCipher;break;case"AES-256-CBC":f=32,y=e.aes.createDecryptionCipher;break;case"RC2-40-CBC":f=5,y=function(x){return e.rc2.createDecryptionCipher(x,40)};break;case"RC2-64-CBC":f=8,y=function(x){return e.rc2.createDecryptionCipher(x,64)};break;case"RC2-128-CBC":f=16,y=function(x){return e.rc2.createDecryptionCipher(x,128)};break;default:var b=new Error('Could not decrypt private key; unsupported encryption algorithm "'+m.dekInfo.algorithm+'".');throw b.algorithm=m.dekInfo.algorithm,b}var C=e.util.hexToBytes(m.dekInfo.parameters),S=e.pbe.opensslDeriveBytes(d,C.substr(0,8),f),w=y(S);if(w.start(C),w.update(e.util.createBuffer(m.body)),w.finish())v=w.output.getBytes();else return v}else v=m.body;return m.type==="ENCRYPTED PRIVATE KEY"?v=r.decryptPrivateKeyInfo(n.fromDer(v),d):v=n.fromDer(v),v!==null&&(v=r.privateKeyFromAsn1(v)),v},r.pbe.generatePkcs12Key=function(h,d,v,m,b,f){var y,C;if(typeof f>"u"||f===null){if(!("sha1"in e.md))throw new Error('"sha1" hash algorithm unavailable.');f=e.md.sha1.create()}var S=f.digestLength,w=f.blockLength,E=new e.util.ByteBuffer,x=new e.util.ByteBuffer;if(h!=null){for(C=0;C<h.length;C++)x.putInt16(h.charCodeAt(C));x.putInt16(0)}var g=x.length(),I=d.length(),A=new e.util.ByteBuffer;A.fillWithByte(v,w);var _=w*Math.ceil(I/w),T=new e.util.ByteBuffer;for(C=0;C<_;C++)T.putByte(d.at(C%I));var $=w*Math.ceil(g/w),B=new e.util.ByteBuffer;for(C=0;C<$;C++)B.putByte(x.at(C%g));var P=T;P.putBuffer(B);for(var k=Math.ceil(b/S),O=1;O<=k;O++){var M=new e.util.ByteBuffer;M.putBytes(A.bytes()),M.putBytes(P.bytes());for(var G=0;G<m;G++)f.start(),f.update(M.getBytes()),M=f.digest();var W=new e.util.ByteBuffer;for(C=0;C<w;C++)W.putByte(M.at(C%S));var U=Math.ceil(I/w)+Math.ceil(g/w),q=new e.util.ByteBuffer;for(y=0;y<U;y++){var Q=new e.util.ByteBuffer(P.getBytes(w)),Z=511;for(C=W.length()-1;C>=0;C--)Z=Z>>8,Z+=W.at(C)+Q.at(C),Q.setAt(C,Z&255);q.putBuffer(Q)}P=q,E.putBuffer(M)}return E.truncate(E.length()-b),E},r.pbe.getCipher=function(h,d,v){switch(h){case r.oids.pkcs5PBES2:return r.pbe.getCipherForPBES2(h,d,v);case r.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case r.oids["pbewithSHAAnd40BitRC2-CBC"]:return r.pbe.getCipherForPKCS12PBE(h,d,v);default:var m=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw m.oid=h,m.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],m}},r.pbe.getCipherForPBES2=function(h,d,v){var m={},b=[];if(!n.validate(d,o,m,b)){var f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=b,f}if(h=n.derToOid(m.kdfOid),h!==r.oids.pkcs5PBKDF2){var f=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw f.oid=h,f.supportedOids=["pkcs5PBKDF2"],f}if(h=n.derToOid(m.encOid),h!==r.oids["aes128-CBC"]&&h!==r.oids["aes192-CBC"]&&h!==r.oids["aes256-CBC"]&&h!==r.oids["des-EDE3-CBC"]&&h!==r.oids.desCBC){var f=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw f.oid=h,f.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],f}var y=m.kdfSalt,C=e.util.createBuffer(m.kdfIterationCount);C=C.getInt(C.length()<<3);var S,w;switch(r.oids[h]){case"aes128-CBC":S=16,w=e.aes.createDecryptionCipher;break;case"aes192-CBC":S=24,w=e.aes.createDecryptionCipher;break;case"aes256-CBC":S=32,w=e.aes.createDecryptionCipher;break;case"des-EDE3-CBC":S=24,w=e.des.createDecryptionCipher;break;case"desCBC":S=8,w=e.des.createDecryptionCipher;break}var E=u(m.prfOid),x=e.pkcs5.pbkdf2(v,y,C,S,E),g=m.encIv,I=w(x);return I.start(g),I},r.pbe.getCipherForPKCS12PBE=function(h,d,v){var m={},b=[];if(!n.validate(d,s,m,b)){var f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=b,f}var y=e.util.createBuffer(m.salt),C=e.util.createBuffer(m.iterations);C=C.getInt(C.length()<<3);var S,w,E;switch(h){case r.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:S=24,w=8,E=e.des.startDecrypting;break;case r.oids["pbewithSHAAnd40BitRC2-CBC"]:S=5,w=8,E=function(_,T){var $=e.rc2.createDecryptionCipher(_,40);return $.start(T,null),$};break;default:var f=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw f.oid=h,f}var x=u(m.prfOid),g=r.pbe.generatePkcs12Key(v,y,1,C,S,x);x.start();var I=r.pbe.generatePkcs12Key(v,y,2,C,w,x);return E(g,I)},r.pbe.opensslDeriveBytes=function(h,d,v,m){if(typeof m>"u"||m===null){if(!("md5"in e.md))throw new Error('"md5" hash algorithm unavailable.');m=e.md.md5.create()}d===null&&(d="");for(var b=[l(m,h+d)],f=16,y=1;f<v;++y,f+=16)b.push(l(m,b[y-1]+h+d));return b.join("").substr(0,v)};function l(h,d){return h.start().update(d).digest().getBytes()}function u(h){var d;if(!h)d="hmacWithSHA1";else if(d=r.oids[n.derToOid(h)],!d){var v=new Error("Unsupported PRF OID.");throw v.oid=h,v.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],v}return c(d)}function c(h){var d=e.md;switch(h){case"hmacWithSHA224":d=e.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":h=h.substr(8).toLowerCase();break;default:var v=new Error("Unsupported PRF algorithm.");throw v.algorithm=h,v.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],v}if(!d||!(h in d))throw new Error("Unknown hash algorithm: "+h);return d[h].create()}function p(h,d,v,m){var b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,h),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,d.getBytes())]);return m!=="hmacWithSHA1"&&b.value.push(n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,e.util.hexToBytes(v.toString(16))),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(r.oids[m]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])),b}return Gd}var Wd={exports:{}},Ud={exports:{}},Cm;function Ix(){if(Cm)return Ud.exports;Cm=1;var e=Le();Wr(),Ue();var t=e.asn1,n=Ud.exports=e.pkcs7asn1=e.pkcs7asn1||{};e.pkcs7=e.pkcs7||{},e.pkcs7.asn1=n;var r={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};n.contentInfoValidator=r;var i={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};n.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(i)},n.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"}].concat(i)};var a={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};return n.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},r,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[a]}]},n.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]},Ud.exports}var Xd={exports:{}},Yd={exports:{}},Em;function _x(){if(Em)return Yd.exports;Em=1;var e=Le();Ue(),e.mgf=e.mgf||{};var t=Yd.exports=e.mgf.mgf1=e.mgf1=e.mgf1||{};return t.create=function(n){var r={generate:function(i,a){for(var o=new e.util.ByteBuffer,s=Math.ceil(a/n.digestLength),l=0;l<s;l++){var u=new e.util.ByteBuffer;u.putInt32(l),n.start(),n.update(i+u.getBytes()),o.putBuffer(n.digest())}return o.truncate(o.length()-a),o.getBytes()}};return r},Yd.exports}var Kd,Sm;function sD(){if(Sm)return Kd;Sm=1;var e=Le();return _x(),Kd=e.mgf=e.mgf||{},e.mgf.mgf1=e.mgf1,Kd}var Zd={exports:{}},wm;function z0(){if(wm)return Zd.exports;wm=1;var e=Le();Er(),Ue();var t=Zd.exports=e.pss=e.pss||{};return t.create=function(n){arguments.length===3&&(n={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var r=n.md,i=n.mgf,a=r.digestLength,o=n.salt||null;typeof o=="string"&&(o=e.util.createBuffer(o));var s;if("saltLength"in n)s=n.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var l=n.prng||e.random,u={};return u.encode=function(c,p){var h,d=p-1,v=Math.ceil(d/8),m=c.digest().getBytes();if(v<a+s+2)throw new Error("Message is too long to encrypt.");var b;o===null?b=l.getBytesSync(s):b=o.bytes();var f=new e.util.ByteBuffer;f.fillWithByte(0,8),f.putBytes(m),f.putBytes(b),r.start(),r.update(f.getBytes());var y=r.digest().getBytes(),C=new e.util.ByteBuffer;C.fillWithByte(0,v-s-a-2),C.putByte(1),C.putBytes(b);var S=C.getBytes(),w=v-a-1,E=i.generate(y,w),x="";for(h=0;h<w;h++)x+=String.fromCharCode(S.charCodeAt(h)^E.charCodeAt(h));var g=65280>>8*v-d&255;return x=String.fromCharCode(x.charCodeAt(0)&~g)+x.substr(1),x+y+"¼"},u.verify=function(c,p,h){var d,v=h-1,m=Math.ceil(v/8);if(p=p.substr(-m),m<a+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(p.charCodeAt(m-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var b=m-a-1,f=p.substr(0,b),y=p.substr(b,a),C=65280>>8*m-v&255;if((f.charCodeAt(0)&C)!==0)throw new Error("Bits beyond keysize not zero as expected.");var S=i.generate(y,b),w="";for(d=0;d<b;d++)w+=String.fromCharCode(f.charCodeAt(d)^S.charCodeAt(d));w=String.fromCharCode(w.charCodeAt(0)&~C)+w.substr(1);var E=m-a-s-2;for(d=0;d<E;d++)if(w.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(w.charCodeAt(E)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var x=w.substr(-s),g=new e.util.ByteBuffer;g.fillWithByte(0,8),g.putBytes(c),g.putBytes(x),r.start(),r.update(g.getBytes());var I=r.digest().getBytes();return y===I},u},Zd.exports}var Im;function G0(){if(Im)return Xd.exports;Im=1;var e=Le();Ma(),Wr(),Ac(),mi(),sD(),Oa(),Oo(),z0(),Bc(),Ue();var t=e.asn1,n=Xd.exports=e.pki=e.pki||{},r=n.oids,i={};i.CN=r.commonName,i.commonName="CN",i.C=r.countryName,i.countryName="C",i.L=r.localityName,i.localityName="L",i.ST=r.stateOrProvinceName,i.stateOrProvinceName="ST",i.O=r.organizationName,i.organizationName="O",i.OU=r.organizationalUnitName,i.organizationalUnitName="OU",i.E=r.emailAddress,i.emailAddress="E";var a=e.pki.rsa.publicKeyValidator,o={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},a,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},s={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},a,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},u={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};n.RDNAttributesAsArray=function(E,x){for(var g=[],I,A,_,T=0;T<E.value.length;++T){I=E.value[T];for(var $=0;$<I.value.length;++$)_={},A=I.value[$],_.type=t.derToOid(A.value[0].value),_.value=A.value[1].value,_.valueTagClass=A.value[1].type,_.type in r&&(_.name=r[_.type],_.name in i&&(_.shortName=i[_.name])),x&&(x.update(_.type),x.update(_.value)),g.push(_)}return g},n.CRIAttributesAsArray=function(E){for(var x=[],g=0;g<E.length;++g)for(var I=E[g],A=t.derToOid(I.value[0].value),_=I.value[1].value,T=0;T<_.length;++T){var $={};if($.type=A,$.value=_[T].value,$.valueTagClass=_[T].type,$.type in r&&($.name=r[$.type],$.name in i&&($.shortName=i[$.name])),$.type===r.extensionRequest){$.extensions=[];for(var B=0;B<$.value.length;++B)$.extensions.push(n.certificateExtensionFromAsn1($.value[B]))}x.push($)}return x};function c(E,x){typeof x=="string"&&(x={shortName:x});for(var g=null,I,A=0;g===null&&A<E.attributes.length;++A)I=E.attributes[A],(x.type&&x.type===I.type||x.name&&x.name===I.name||x.shortName&&x.shortName===I.shortName)&&(g=I);return g}var p=function(E,x,g){var I={};if(E!==r["RSASSA-PSS"])return I;g&&(I={hash:{algorithmOid:r.sha1},mgf:{algorithmOid:r.mgf1,hash:{algorithmOid:r.sha1}},saltLength:20});var A={},_=[];if(!t.validate(x,s,A,_)){var T=new Error("Cannot read RSASSA-PSS parameter block.");throw T.errors=_,T}return A.hashOid!==void 0&&(I.hash=I.hash||{},I.hash.algorithmOid=t.derToOid(A.hashOid)),A.maskGenOid!==void 0&&(I.mgf=I.mgf||{},I.mgf.algorithmOid=t.derToOid(A.maskGenOid),I.mgf.hash=I.mgf.hash||{},I.mgf.hash.algorithmOid=t.derToOid(A.maskGenHashOid)),A.saltLength!==void 0&&(I.saltLength=A.saltLength.charCodeAt(0)),I},h=function(E){switch(r[E.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return e.md.sha1.create();case"md5WithRSAEncryption":return e.md.md5.create();case"sha256WithRSAEncryption":return e.md.sha256.create();case"sha384WithRSAEncryption":return e.md.sha384.create();case"sha512WithRSAEncryption":return e.md.sha512.create();case"RSASSA-PSS":return e.md.sha256.create();default:var x=new Error("Could not compute "+E.type+" digest. Unknown signature OID.");throw x.signatureOid=E.signatureOid,x}},d=function(E){var x=E.certificate,g;switch(x.signatureOid){case r.sha1WithRSAEncryption:case r.sha1WithRSASignature:break;case r["RSASSA-PSS"]:var I,A;if(I=r[x.signatureParameters.mgf.hash.algorithmOid],I===void 0||e.md[I]===void 0){var _=new Error("Unsupported MGF hash function.");throw _.oid=x.signatureParameters.mgf.hash.algorithmOid,_.name=I,_}if(A=r[x.signatureParameters.mgf.algorithmOid],A===void 0||e.mgf[A]===void 0){var _=new Error("Unsupported MGF function.");throw _.oid=x.signatureParameters.mgf.algorithmOid,_.name=A,_}if(A=e.mgf[A].create(e.md[I].create()),I=r[x.signatureParameters.hash.algorithmOid],I===void 0||e.md[I]===void 0){var _=new Error("Unsupported RSASSA-PSS hash function.");throw _.oid=x.signatureParameters.hash.algorithmOid,_.name=I,_}g=e.pss.create(e.md[I].create(),A,x.signatureParameters.saltLength);break}return x.publicKey.verify(E.md.digest().getBytes(),E.signature,g)};n.certificateFromPem=function(E,x,g){var I=e.pem.decode(E)[0];if(I.type!=="CERTIFICATE"&&I.type!=="X509 CERTIFICATE"&&I.type!=="TRUSTED CERTIFICATE"){var A=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw A.headerType=I.type,A}if(I.procType&&I.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var _=t.fromDer(I.body,g);return n.certificateFromAsn1(_,x)},n.certificateToPem=function(E,x){var g={type:"CERTIFICATE",body:t.toDer(n.certificateToAsn1(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.publicKeyFromPem=function(E){var x=e.pem.decode(E)[0];if(x.type!=="PUBLIC KEY"&&x.type!=="RSA PUBLIC KEY"){var g=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw g.headerType=x.type,g}if(x.procType&&x.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var I=t.fromDer(x.body);return n.publicKeyFromAsn1(I)},n.publicKeyToPem=function(E,x){var g={type:"PUBLIC KEY",body:t.toDer(n.publicKeyToAsn1(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.publicKeyToRSAPublicKeyPem=function(E,x){var g={type:"RSA PUBLIC KEY",body:t.toDer(n.publicKeyToRSAPublicKey(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.getPublicKeyFingerprint=function(E,x){x=x||{};var g=x.md||e.md.sha1.create(),I=x.type||"RSAPublicKey",A;switch(I){case"RSAPublicKey":A=t.toDer(n.publicKeyToRSAPublicKey(E)).getBytes();break;case"SubjectPublicKeyInfo":A=t.toDer(n.publicKeyToAsn1(E)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+x.type+'".')}g.start(),g.update(A);var _=g.digest();if(x.encoding==="hex"){var T=_.toHex();return x.delimiter?T.match(/.{2}/g).join(x.delimiter):T}else{if(x.encoding==="binary")return _.getBytes();if(x.encoding)throw new Error('Unknown encoding "'+x.encoding+'".')}return _},n.certificationRequestFromPem=function(E,x,g){var I=e.pem.decode(E)[0];if(I.type!=="CERTIFICATE REQUEST"){var A=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw A.headerType=I.type,A}if(I.procType&&I.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var _=t.fromDer(I.body,g);return n.certificationRequestFromAsn1(_,x)},n.certificationRequestToPem=function(E,x){var g={type:"CERTIFICATE REQUEST",body:t.toDer(n.certificationRequestToAsn1(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.createCertificate=function(){var E={};return E.version=2,E.serialNumber="00",E.signatureOid=null,E.signature=null,E.siginfo={},E.siginfo.algorithmOid=null,E.validity={},E.validity.notBefore=new Date,E.validity.notAfter=new Date,E.issuer={},E.issuer.getField=function(x){return c(E.issuer,x)},E.issuer.addField=function(x){m([x]),E.issuer.attributes.push(x)},E.issuer.attributes=[],E.issuer.hash=null,E.subject={},E.subject.getField=function(x){return c(E.subject,x)},E.subject.addField=function(x){m([x]),E.subject.attributes.push(x)},E.subject.attributes=[],E.subject.hash=null,E.extensions=[],E.publicKey=null,E.md=null,E.setSubject=function(x,g){m(x),E.subject.attributes=x,delete E.subject.uniqueId,g&&(E.subject.uniqueId=g),E.subject.hash=null},E.setIssuer=function(x,g){m(x),E.issuer.attributes=x,delete E.issuer.uniqueId,g&&(E.issuer.uniqueId=g),E.issuer.hash=null},E.setExtensions=function(x){for(var g=0;g<x.length;++g)b(x[g],{cert:E});E.extensions=x},E.getExtension=function(x){typeof x=="string"&&(x={name:x});for(var g=null,I,A=0;g===null&&A<E.extensions.length;++A)I=E.extensions[A],(x.id&&I.id===x.id||x.name&&I.name===x.name)&&(g=I);return g},E.sign=function(x,g){E.md=g||e.md.sha1.create();var I=r[E.md.algorithm+"WithRSAEncryption"];if(!I){var A=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw A.algorithm=E.md.algorithm,A}E.signatureOid=E.siginfo.algorithmOid=I,E.tbsCertificate=n.getTBSCertificate(E);var _=t.toDer(E.tbsCertificate);E.md.update(_.getBytes()),E.signature=x.sign(E.md)},E.verify=function(x){var g=!1;if(!E.issued(x)){var I=x.issuer,A=E.subject,_=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw _.expectedIssuer=A.attributes,_.actualIssuer=I.attributes,_}var T=x.md;if(T===null){T=h({signatureOid:x.signatureOid,type:"certificate"});var $=x.tbsCertificate||n.getTBSCertificate(x),B=t.toDer($);T.update(B.getBytes())}return T!==null&&(g=d({certificate:E,md:T,signature:x.signature})),g},E.isIssuer=function(x){var g=!1,I=E.issuer,A=x.subject;if(I.hash&&A.hash)g=I.hash===A.hash;else if(I.attributes.length===A.attributes.length){g=!0;for(var _,T,$=0;g&&$<I.attributes.length;++$)_=I.attributes[$],T=A.attributes[$],(_.type!==T.type||_.value!==T.value)&&(g=!1)}return g},E.issued=function(x){return x.isIssuer(E)},E.generateSubjectKeyIdentifier=function(){return n.getPublicKeyFingerprint(E.publicKey,{type:"RSAPublicKey"})},E.verifySubjectKeyIdentifier=function(){for(var x=r.subjectKeyIdentifier,g=0;g<E.extensions.length;++g){var I=E.extensions[g];if(I.id===x){var A=E.generateSubjectKeyIdentifier().getBytes();return e.util.hexToBytes(I.subjectKeyIdentifier)===A}}return!1},E},n.certificateFromAsn1=function(E,x){var g={},I=[];if(!t.validate(E,o,g,I)){var A=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw A.errors=I,A}var _=t.derToOid(g.publicKeyOid);if(_!==n.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var T=n.createCertificate();T.version=g.certVersion?g.certVersion.charCodeAt(0):0;var $=e.util.createBuffer(g.certSerialNumber);T.serialNumber=$.toHex(),T.signatureOid=e.asn1.derToOid(g.certSignatureOid),T.signatureParameters=p(T.signatureOid,g.certSignatureParams,!0),T.siginfo.algorithmOid=e.asn1.derToOid(g.certinfoSignatureOid),T.siginfo.parameters=p(T.siginfo.algorithmOid,g.certinfoSignatureParams,!1),T.signature=g.certSignature;var B=[];if(g.certValidity1UTCTime!==void 0&&B.push(t.utcTimeToDate(g.certValidity1UTCTime)),g.certValidity2GeneralizedTime!==void 0&&B.push(t.generalizedTimeToDate(g.certValidity2GeneralizedTime)),g.certValidity3UTCTime!==void 0&&B.push(t.utcTimeToDate(g.certValidity3UTCTime)),g.certValidity4GeneralizedTime!==void 0&&B.push(t.generalizedTimeToDate(g.certValidity4GeneralizedTime)),B.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(B.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(T.validity.notBefore=B[0],T.validity.notAfter=B[1],T.tbsCertificate=g.tbsCertificate,x){T.md=h({signatureOid:T.signatureOid,type:"certificate"});var P=t.toDer(T.tbsCertificate);T.md.update(P.getBytes())}var k=e.md.sha1.create(),O=t.toDer(g.certIssuer);k.update(O.getBytes()),T.issuer.getField=function(W){return c(T.issuer,W)},T.issuer.addField=function(W){m([W]),T.issuer.attributes.push(W)},T.issuer.attributes=n.RDNAttributesAsArray(g.certIssuer),g.certIssuerUniqueId&&(T.issuer.uniqueId=g.certIssuerUniqueId),T.issuer.hash=k.digest().toHex();var M=e.md.sha1.create(),G=t.toDer(g.certSubject);return M.update(G.getBytes()),T.subject.getField=function(W){return c(T.subject,W)},T.subject.addField=function(W){m([W]),T.subject.attributes.push(W)},T.subject.attributes=n.RDNAttributesAsArray(g.certSubject),g.certSubjectUniqueId&&(T.subject.uniqueId=g.certSubjectUniqueId),T.subject.hash=M.digest().toHex(),g.certExtensions?T.extensions=n.certificateExtensionsFromAsn1(g.certExtensions):T.extensions=[],T.publicKey=n.publicKeyFromAsn1(g.subjectPublicKeyInfo),T},n.certificateExtensionsFromAsn1=function(E){for(var x=[],g=0;g<E.value.length;++g)for(var I=E.value[g],A=0;A<I.value.length;++A)x.push(n.certificateExtensionFromAsn1(I.value[A]));return x},n.certificateExtensionFromAsn1=function(E){var x={};if(x.id=t.derToOid(E.value[0].value),x.critical=!1,E.value[1].type===t.Type.BOOLEAN?(x.critical=E.value[1].value.charCodeAt(0)!==0,x.value=E.value[2].value):x.value=E.value[1].value,x.id in r){if(x.name=r[x.id],x.name==="keyUsage"){var g=t.fromDer(x.value),I=0,A=0;g.value.length>1&&(I=g.value.charCodeAt(1),A=g.value.length>2?g.value.charCodeAt(2):0),x.digitalSignature=(I&128)===128,x.nonRepudiation=(I&64)===64,x.keyEncipherment=(I&32)===32,x.dataEncipherment=(I&16)===16,x.keyAgreement=(I&8)===8,x.keyCertSign=(I&4)===4,x.cRLSign=(I&2)===2,x.encipherOnly=(I&1)===1,x.decipherOnly=(A&128)===128}else if(x.name==="basicConstraints"){var g=t.fromDer(x.value);g.value.length>0&&g.value[0].type===t.Type.BOOLEAN?x.cA=g.value[0].value.charCodeAt(0)!==0:x.cA=!1;var _=null;g.value.length>0&&g.value[0].type===t.Type.INTEGER?_=g.value[0].value:g.value.length>1&&(_=g.value[1].value),_!==null&&(x.pathLenConstraint=t.derToInteger(_))}else if(x.name==="extKeyUsage")for(var g=t.fromDer(x.value),T=0;T<g.value.length;++T){var $=t.derToOid(g.value[T].value);$ in r?x[r[$]]=!0:x[$]=!0}else if(x.name==="nsCertType"){var g=t.fromDer(x.value),I=0;g.value.length>1&&(I=g.value.charCodeAt(1)),x.client=(I&128)===128,x.server=(I&64)===64,x.email=(I&32)===32,x.objsign=(I&16)===16,x.reserved=(I&8)===8,x.sslCA=(I&4)===4,x.emailCA=(I&2)===2,x.objCA=(I&1)===1}else if(x.name==="subjectAltName"||x.name==="issuerAltName"){x.altNames=[];for(var B,g=t.fromDer(x.value),P=0;P<g.value.length;++P){B=g.value[P];var k={type:B.type,value:B.value};switch(x.altNames.push(k),B.type){case 1:case 2:case 6:break;case 7:k.ip=e.util.bytesToIP(B.value);break;case 8:k.oid=t.derToOid(B.value);break}}}else if(x.name==="subjectKeyIdentifier"){var g=t.fromDer(x.value);x.subjectKeyIdentifier=e.util.bytesToHex(g.value)}}return x},n.certificationRequestFromAsn1=function(E,x){var g={},I=[];if(!t.validate(E,u,g,I)){var A=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw A.errors=I,A}var _=t.derToOid(g.publicKeyOid);if(_!==n.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var T=n.createCertificationRequest();if(T.version=g.csrVersion?g.csrVersion.charCodeAt(0):0,T.signatureOid=e.asn1.derToOid(g.csrSignatureOid),T.signatureParameters=p(T.signatureOid,g.csrSignatureParams,!0),T.siginfo.algorithmOid=e.asn1.derToOid(g.csrSignatureOid),T.siginfo.parameters=p(T.siginfo.algorithmOid,g.csrSignatureParams,!1),T.signature=g.csrSignature,T.certificationRequestInfo=g.certificationRequestInfo,x){T.md=h({signatureOid:T.signatureOid,type:"certification request"});var $=t.toDer(T.certificationRequestInfo);T.md.update($.getBytes())}var B=e.md.sha1.create();return T.subject.getField=function(P){return c(T.subject,P)},T.subject.addField=function(P){m([P]),T.subject.attributes.push(P)},T.subject.attributes=n.RDNAttributesAsArray(g.certificationRequestInfoSubject,B),T.subject.hash=B.digest().toHex(),T.publicKey=n.publicKeyFromAsn1(g.subjectPublicKeyInfo),T.getAttribute=function(P){return c(T,P)},T.addAttribute=function(P){m([P]),T.attributes.push(P)},T.attributes=n.CRIAttributesAsArray(g.certificationRequestInfoAttributes||[]),T},n.createCertificationRequest=function(){var E={};return E.version=0,E.signatureOid=null,E.signature=null,E.siginfo={},E.siginfo.algorithmOid=null,E.subject={},E.subject.getField=function(x){return c(E.subject,x)},E.subject.addField=function(x){m([x]),E.subject.attributes.push(x)},E.subject.attributes=[],E.subject.hash=null,E.publicKey=null,E.attributes=[],E.getAttribute=function(x){return c(E,x)},E.addAttribute=function(x){m([x]),E.attributes.push(x)},E.md=null,E.setSubject=function(x){m(x),E.subject.attributes=x,E.subject.hash=null},E.setAttributes=function(x){m(x),E.attributes=x},E.sign=function(x,g){E.md=g||e.md.sha1.create();var I=r[E.md.algorithm+"WithRSAEncryption"];if(!I){var A=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw A.algorithm=E.md.algorithm,A}E.signatureOid=E.siginfo.algorithmOid=I,E.certificationRequestInfo=n.getCertificationRequestInfo(E);var _=t.toDer(E.certificationRequestInfo);E.md.update(_.getBytes()),E.signature=x.sign(E.md)},E.verify=function(){var x=!1,g=E.md;if(g===null){g=h({signatureOid:E.signatureOid,type:"certification request"});var I=E.certificationRequestInfo||n.getCertificationRequestInfo(E),A=t.toDer(I);g.update(A.getBytes())}return g!==null&&(x=d({certificate:E,md:g,signature:E.signature})),x},E};function v(E){for(var x=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),g,I,A=E.attributes,_=0;_<A.length;++_){g=A[_];var T=g.value,$=t.Type.PRINTABLESTRING;"valueTagClass"in g&&($=g.valueTagClass,$===t.Type.UTF8&&(T=e.util.encodeUtf8(T))),I=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(g.type).getBytes()),t.create(t.Class.UNIVERSAL,$,!1,T)])]),x.value.push(I)}return x}function m(E){for(var x,g=0;g<E.length;++g){if(x=E[g],typeof x.name>"u"&&(x.type&&x.type in n.oids?x.name=n.oids[x.type]:x.shortName&&x.shortName in i&&(x.name=n.oids[i[x.shortName]])),typeof x.type>"u")if(x.name&&x.name in n.oids)x.type=n.oids[x.name];else{var I=new Error("Attribute type not specified.");throw I.attribute=x,I}if(typeof x.shortName>"u"&&x.name&&x.name in i&&(x.shortName=i[x.name]),x.type===r.extensionRequest&&(x.valueConstructed=!0,x.valueTagClass=t.Type.SEQUENCE,!x.value&&x.extensions)){x.value=[];for(var A=0;A<x.extensions.length;++A)x.value.push(n.certificateExtensionToAsn1(b(x.extensions[A])))}if(typeof x.value>"u"){var I=new Error("Attribute value not specified.");throw I.attribute=x,I}}}function b(E,x){if(x=x||{},typeof E.name>"u"&&E.id&&E.id in n.oids&&(E.name=n.oids[E.id]),typeof E.id>"u")if(E.name&&E.name in n.oids)E.id=n.oids[E.name];else{var g=new Error("Extension ID not specified.");throw g.extension=E,g}if(typeof E.value<"u")return E;if(E.name==="keyUsage"){var I=0,A=0,_=0;E.digitalSignature&&(A|=128,I=7),E.nonRepudiation&&(A|=64,I=6),E.keyEncipherment&&(A|=32,I=5),E.dataEncipherment&&(A|=16,I=4),E.keyAgreement&&(A|=8,I=3),E.keyCertSign&&(A|=4,I=2),E.cRLSign&&(A|=2,I=1),E.encipherOnly&&(A|=1,I=0),E.decipherOnly&&(_|=128,I=7);var T=String.fromCharCode(I);_!==0?T+=String.fromCharCode(A)+String.fromCharCode(_):A!==0&&(T+=String.fromCharCode(A)),E.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,T)}else if(E.name==="basicConstraints")E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),E.cA&&E.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in E&&E.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.pathLenConstraint).getBytes()));else if(E.name==="extKeyUsage"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var $=E.value.value;for(var B in E)E[B]===!0&&(B in r?$.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r[B]).getBytes())):B.indexOf(".")!==-1&&$.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(B).getBytes())))}else if(E.name==="nsCertType"){var I=0,A=0;E.client&&(A|=128,I=7),E.server&&(A|=64,I=6),E.email&&(A|=32,I=5),E.objsign&&(A|=16,I=4),E.reserved&&(A|=8,I=3),E.sslCA&&(A|=4,I=2),E.emailCA&&(A|=2,I=1),E.objCA&&(A|=1,I=0);var T=String.fromCharCode(I);A!==0&&(T+=String.fromCharCode(A)),E.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,T)}else if(E.name==="subjectAltName"||E.name==="issuerAltName"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var P,k=0;k<E.altNames.length;++k){P=E.altNames[k];var T=P.value;if(P.type===7&&P.ip){if(T=e.util.bytesFromIP(P.ip),T===null){var g=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw g.extension=E,g}}else P.type===8&&(P.oid?T=t.oidToDer(t.oidToDer(P.oid)):T=t.oidToDer(T));E.value.value.push(t.create(t.Class.CONTEXT_SPECIFIC,P.type,!1,T))}}else if(E.name==="nsComment"&&x.cert){if(!/^[\x00-\x7F]*$/.test(E.comment)||E.comment.length<1||E.comment.length>128)throw new Error('Invalid "nsComment" content.');E.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,E.comment)}else if(E.name==="subjectKeyIdentifier"&&x.cert){var O=x.cert.generateSubjectKeyIdentifier();E.subjectKeyIdentifier=O.toHex(),E.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,O.getBytes())}else if(E.name==="authorityKeyIdentifier"&&x.cert){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var $=E.value.value;if(E.keyIdentifier){var M=E.keyIdentifier===!0?x.cert.generateSubjectKeyIdentifier().getBytes():E.keyIdentifier;$.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,M))}if(E.authorityCertIssuer){var G=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[v(E.authorityCertIssuer===!0?x.cert.issuer:E.authorityCertIssuer)])];$.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,G))}if(E.serialNumber){var W=e.util.hexToBytes(E.serialNumber===!0?x.cert.serialNumber:E.serialNumber);$.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,W))}}else if(E.name==="cRLDistributionPoints"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var $=E.value.value,U=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),q=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]),P,k=0;k<E.altNames.length;++k){P=E.altNames[k];var T=P.value;if(P.type===7&&P.ip){if(T=e.util.bytesFromIP(P.ip),T===null){var g=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw g.extension=E,g}}else P.type===8&&(P.oid?T=t.oidToDer(t.oidToDer(P.oid)):T=t.oidToDer(T));q.value.push(t.create(t.Class.CONTEXT_SPECIFIC,P.type,!1,T))}U.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[q])),$.push(U)}if(typeof E.value>"u"){var g=new Error("Extension value not specified.");throw g.extension=E,g}return E}function f(E,x){switch(E){case r["RSASSA-PSS"]:var g=[];return x.hash.algorithmOid!==void 0&&g.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),x.mgf.algorithmOid!==void 0&&g.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])])),x.saltLength!==void 0&&g.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(x.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,g);default:return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}}function y(E){var x=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(E.attributes.length===0)return x;for(var g=E.attributes,I=0;I<g.length;++I){var A=g[I],_=A.value,T=t.Type.UTF8;"valueTagClass"in A&&(T=A.valueTagClass),T===t.Type.UTF8&&(_=e.util.encodeUtf8(_));var $=!1;"valueConstructed"in A&&($=A.valueConstructed);var B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(A.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,T,$,_)])]);x.value.push(B)}return x}var C=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function w(E){return E>=C&&E<S?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(E)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(E))}return n.getTBSCertificate=function(E){var x=w(E.validity.notBefore),g=w(E.validity.notAfter),I=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.version).getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(E.serialNumber)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.siginfo.algorithmOid).getBytes()),f(E.siginfo.algorithmOid,E.siginfo.parameters)]),v(E.issuer),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[x,g]),v(E.subject),n.publicKeyToAsn1(E.publicKey)]);return E.issuer.uniqueId&&I.value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.issuer.uniqueId)])),E.subject.uniqueId&&I.value.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.subject.uniqueId)])),E.extensions.length>0&&I.value.push(n.certificateExtensionsToAsn1(E.extensions)),I},n.getCertificationRequestInfo=function(E){var x=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.version).getBytes()),v(E.subject),n.publicKeyToAsn1(E.publicKey),y(E)]);return x},n.distinguishedNameToAsn1=function(E){return v(E)},n.certificateToAsn1=function(E){var x=E.tbsCertificate||n.getTBSCertificate(E);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[x,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.signatureOid).getBytes()),f(E.signatureOid,E.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.signature)])},n.certificateExtensionsToAsn1=function(E){var x=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),g=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);x.value.push(g);for(var I=0;I<E.length;++I)g.value.push(n.certificateExtensionToAsn1(E[I]));return x},n.certificateExtensionToAsn1=function(E){var x=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);x.value.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.id).getBytes())),E.critical&&x.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,"ÿ"));var g=E.value;return typeof E.value!="string"&&(g=t.toDer(g).getBytes()),x.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,g)),x},n.certificationRequestToAsn1=function(E){var x=E.certificationRequestInfo||n.getCertificationRequestInfo(E);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[x,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.signatureOid).getBytes()),f(E.signatureOid,E.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.signature)])},n.createCaStore=function(E){var x={certs:{}};x.getIssuer=function(T){var $=g(T.issuer);return $},x.addCertificate=function(T){if(typeof T=="string"&&(T=e.pki.certificateFromPem(T)),I(T.subject),!x.hasCertificate(T))if(T.subject.hash in x.certs){var $=x.certs[T.subject.hash];e.util.isArray($)||($=[$]),$.push(T),x.certs[T.subject.hash]=$}else x.certs[T.subject.hash]=T},x.hasCertificate=function(T){typeof T=="string"&&(T=e.pki.certificateFromPem(T));var $=g(T.subject);if(!$)return!1;e.util.isArray($)||($=[$]);for(var B=t.toDer(n.certificateToAsn1(T)).getBytes(),P=0;P<$.length;++P){var k=t.toDer(n.certificateToAsn1($[P])).getBytes();if(B===k)return!0}return!1},x.listAllCertificates=function(){var T=[];for(var $ in x.certs)if(x.certs.hasOwnProperty($)){var B=x.certs[$];if(!e.util.isArray(B))T.push(B);else for(var P=0;P<B.length;++P)T.push(B[P])}return T},x.removeCertificate=function(T){var $;if(typeof T=="string"&&(T=e.pki.certificateFromPem(T)),I(T.subject),!x.hasCertificate(T))return null;var B=g(T.subject);if(!e.util.isArray(B))return $=x.certs[T.subject.hash],delete x.certs[T.subject.hash],$;for(var P=t.toDer(n.certificateToAsn1(T)).getBytes(),k=0;k<B.length;++k){var O=t.toDer(n.certificateToAsn1(B[k])).getBytes();P===O&&($=B[k],B.splice(k,1))}return B.length===0&&delete x.certs[T.subject.hash],$};function g(T){return I(T),x.certs[T.hash]||null}function I(T){if(!T.hash){var $=e.md.sha1.create();T.attributes=n.RDNAttributesAsArray(v(T),$),T.hash=$.digest().toHex()}}if(E)for(var A=0;A<E.length;++A){var _=E[A];x.addCertificate(_)}return x},n.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},n.verifyCertificateChain=function(E,x,g){typeof g=="function"&&(g={verify:g}),g=g||{},x=x.slice(0);var I=x.slice(0),A=g.validityCheckDate;typeof A>"u"&&(A=new Date);var _=!0,T=null,$=0;do{var B=x.shift(),P=null,k=!1;if(A&&(A<B.validity.notBefore||A>B.validity.notAfter)&&(T={message:"Certificate is not valid yet or has expired.",error:n.certificateError.certificate_expired,notBefore:B.validity.notBefore,notAfter:B.validity.notAfter,now:A}),T===null){if(P=x[0]||E.getIssuer(B),P===null&&B.isIssuer(B)&&(k=!0,P=B),P){var O=P;e.util.isArray(O)||(O=[O]);for(var M=!1;!M&&O.length>0;){P=O.shift();try{M=P.verify(B)}catch{}}M||(T={message:"Certificate signature is invalid.",error:n.certificateError.bad_certificate})}T===null&&(!P||k)&&!E.hasCertificate(B)&&(T={message:"Certificate is not trusted.",error:n.certificateError.unknown_ca})}if(T===null&&P&&!B.isIssuer(P)&&(T={message:"Certificate issuer is invalid.",error:n.certificateError.bad_certificate}),T===null)for(var G={keyUsage:!0,basicConstraints:!0},W=0;T===null&&W<B.extensions.length;++W){var U=B.extensions[W];U.critical&&!(U.name in G)&&(T={message:"Certificate has an unsupported critical extension.",error:n.certificateError.unsupported_certificate})}if(T===null&&(!_||x.length===0&&(!P||k))){var q=B.getExtension("basicConstraints"),Q=B.getExtension("keyUsage");if(Q!==null&&(!Q.keyCertSign||q===null)&&(T={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:n.certificateError.bad_certificate}),T===null&&q!==null&&!q.cA&&(T={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:n.certificateError.bad_certificate}),T===null&&Q!==null&&"pathLenConstraint"in q){var Z=$-1;Z>q.pathLenConstraint&&(T={message:"Certificate basicConstraints pathLenConstraint violated.",error:n.certificateError.bad_certificate})}}var ee=T===null?!0:T.error,J=g.verify?g.verify(ee,$,I):ee;if(J===!0)T=null;else throw ee===!0&&(T={message:"The application rejected the certificate.",error:n.certificateError.bad_certificate}),(J||J===0)&&(typeof J=="object"&&!e.util.isArray(J)?(J.message&&(T.message=J.message),J.error&&(T.error=J.error)):typeof J=="string"&&(T.error=J)),T;_=!1,++$}while(x.length>0);return!0},Xd.exports}var _m;function Dx(){if(_m)return Wd.exports;_m=1;var e=Le();Wr(),rl(),Oa(),Ix(),wx(),Er(),Bc(),il(),Ue(),G0();var t=e.asn1,n=e.pki,r=Wd.exports=e.pkcs12=e.pkcs12||{},i={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},a={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},i,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},o={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},s={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},l={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function u(m,b,f,y){for(var C=[],S=0;S<m.length;S++)for(var w=0;w<m[S].safeBags.length;w++){var E=m[S].safeBags[w];if(!(y!==void 0&&E.type!==y)){if(b===null){C.push(E);continue}E.attributes[b]!==void 0&&E.attributes[b].indexOf(f)>=0&&C.push(E)}}return C}r.pkcs12FromAsn1=function(m,b,f){typeof b=="string"?(f=b,b=!0):b===void 0&&(b=!0);var y={},C=[];if(!t.validate(m,a,y,C)){var S=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw S.errors=S,S}var w={version:y.version.charCodeAt(0),safeContents:[],getBags:function(P){var k={},O;return"localKeyId"in P?O=P.localKeyId:"localKeyIdHex"in P&&(O=e.util.hexToBytes(P.localKeyIdHex)),O===void 0&&!("friendlyName"in P)&&"bagType"in P&&(k[P.bagType]=u(w.safeContents,null,null,P.bagType)),O!==void 0&&(k.localKeyId=u(w.safeContents,"localKeyId",O,P.bagType)),"friendlyName"in P&&(k.friendlyName=u(w.safeContents,"friendlyName",P.friendlyName,P.bagType)),k},getBagsByFriendlyName:function(P,k){return u(w.safeContents,"friendlyName",P,k)},getBagsByLocalKeyId:function(P,k){return u(w.safeContents,"localKeyId",P,k)}};if(y.version.charCodeAt(0)!==3){var S=new Error("PKCS#12 PFX of version other than 3 not supported.");throw S.version=y.version.charCodeAt(0),S}if(t.derToOid(y.contentType)!==n.oids.data){var S=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw S.oid=t.derToOid(y.contentType),S}var E=y.content.value[0];if(E.tagClass!==t.Class.UNIVERSAL||E.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(E=c(E),y.mac){var x=null,g=0,I=t.derToOid(y.macAlgorithm);switch(I){case n.oids.sha1:x=e.md.sha1.create(),g=20;break;case n.oids.sha256:x=e.md.sha256.create(),g=32;break;case n.oids.sha384:x=e.md.sha384.create(),g=48;break;case n.oids.sha512:x=e.md.sha512.create(),g=64;break;case n.oids.md5:x=e.md.md5.create(),g=16;break}if(x===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+I);var A=new e.util.ByteBuffer(y.macSalt),_="macIterations"in y?parseInt(e.util.bytesToHex(y.macIterations),16):1,T=r.generateKey(f,A,3,_,g,x),$=e.hmac.create();$.start(x,T),$.update(E.value);var B=$.getMac();if(B.getBytes()!==y.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return p(w,E.value,b,f),w};function c(m){if(m.composed||m.constructed){for(var b=e.util.createBuffer(),f=0;f<m.value.length;++f)b.putBytes(m.value[f].value);m.composed=m.constructed=!1,m.value=b.getBytes()}return m}function p(m,b,f,y){if(b=t.fromDer(b,f),b.tagClass!==t.Class.UNIVERSAL||b.type!==t.Type.SEQUENCE||b.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var C=0;C<b.value.length;C++){var S=b.value[C],w={},E=[];if(!t.validate(S,i,w,E)){var x=new Error("Cannot read ContentInfo.");throw x.errors=E,x}var g={encrypted:!1},I=null,A=w.content.value[0];switch(t.derToOid(w.contentType)){case n.oids.data:if(A.tagClass!==t.Class.UNIVERSAL||A.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");I=c(A).value;break;case n.oids.encryptedData:I=h(A,y),g.encrypted=!0;break;default:var x=new Error("Unsupported PKCS#12 contentType.");throw x.contentType=t.derToOid(w.contentType),x}g.safeBags=d(I,f,y),m.safeContents.push(g)}}function h(m,b){var f={},y=[];if(!t.validate(m,e.pkcs7.asn1.encryptedDataValidator,f,y)){var C=new Error("Cannot read EncryptedContentInfo.");throw C.errors=y,C}var S=t.derToOid(f.contentType);if(S!==n.oids.data){var C=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw C.oid=S,C}S=t.derToOid(f.encAlgorithm);var w=n.pbe.getCipher(S,f.encParameter,b),E=c(f.encryptedContentAsn1),x=e.util.createBuffer(E.value);if(w.update(x),!w.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return w.output.getBytes()}function d(m,b,f){if(!b&&m.length===0)return[];if(m=t.fromDer(m,b),m.tagClass!==t.Class.UNIVERSAL||m.type!==t.Type.SEQUENCE||m.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var y=[],C=0;C<m.value.length;C++){var S=m.value[C],w={},E=[];if(!t.validate(S,o,w,E)){var x=new Error("Cannot read SafeBag.");throw x.errors=E,x}var g={type:t.derToOid(w.bagId),attributes:v(w.bagAttributes)};y.push(g);var I,A,_=w.bagValue.value[0];switch(g.type){case n.oids.pkcs8ShroudedKeyBag:if(_=n.decryptPrivateKeyInfo(_,f),_===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case n.oids.keyBag:try{g.key=n.privateKeyFromAsn1(_)}catch{g.key=null,g.asn1=_}continue;case n.oids.certBag:I=l,A=function(){if(t.derToOid(w.certId)!==n.oids.x509Certificate){var $=new Error("Unsupported certificate type, only X.509 supported.");throw $.oid=t.derToOid(w.certId),$}var B=t.fromDer(w.cert,b);try{g.cert=n.certificateFromAsn1(B,!0)}catch{g.cert=null,g.asn1=B}};break;default:var x=new Error("Unsupported PKCS#12 SafeBag type.");throw x.oid=g.type,x}if(I!==void 0&&!t.validate(_,I,w,E)){var x=new Error("Cannot read PKCS#12 "+I.name);throw x.errors=E,x}A()}return y}function v(m){var b={};if(m!==void 0)for(var f=0;f<m.length;++f){var y={},C=[];if(!t.validate(m[f],s,y,C)){var S=new Error("Cannot read PKCS#12 BagAttribute.");throw S.errors=C,S}var w=t.derToOid(y.oid);if(n.oids[w]!==void 0){b[n.oids[w]]=[];for(var E=0;E<y.values.length;++E)b[n.oids[w]].push(y.values[E].value)}}return b}return r.toPkcs12Asn1=function(m,b,f,y){y=y||{},y.saltSize=y.saltSize||8,y.count=y.count||2048,y.algorithm=y.algorithm||y.encAlgorithm||"aes128","useMac"in y||(y.useMac=!0),"localKeyId"in y||(y.localKeyId=null),"generateLocalKeyId"in y||(y.generateLocalKeyId=!0);var C=y.localKeyId,S;if(C!==null)C=e.util.hexToBytes(C);else if(y.generateLocalKeyId)if(b){var w=e.util.isArray(b)?b[0]:b;typeof w=="string"&&(w=n.certificateFromPem(w));var E=e.md.sha1.create();E.update(t.toDer(n.certificateToAsn1(w)).getBytes()),C=E.digest().getBytes()}else C=e.random.getBytes(20);var x=[];C!==null&&x.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.localKeyId).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,C)])])),"friendlyName"in y&&x.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.friendlyName).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.BMPSTRING,!1,y.friendlyName)])])),x.length>0&&(S=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,x));var g=[],I=[];b!==null&&(e.util.isArray(b)?I=b:I=[b]);for(var A=[],_=0;_<I.length;++_){b=I[_],typeof b=="string"&&(b=n.certificateFromPem(b));var T=_===0?S:void 0,$=n.certificateToAsn1(b),B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.certBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.x509Certificate).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer($).getBytes())])])]),T]);A.push(B)}if(A.length>0){var P=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,A),k=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(P).getBytes())])]);g.push(k)}var O=null;if(m!==null){var M=n.wrapRsaPrivateKey(n.privateKeyToAsn1(m));f===null?O=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[M]),S]):O=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[n.encryptPrivateKeyInfo(M,f,y)]),S]);var G=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[O]),W=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(G).getBytes())])]);g.push(W)}var U=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,g),q;if(y.useMac){var E=e.md.sha1.create(),Q=new e.util.ByteBuffer(e.random.getBytes(y.saltSize)),Z=y.count,m=r.generateKey(f,Q,3,Z,20),ee=e.hmac.create();ee.start(E,m),ee.update(t.toDer(U).getBytes());var J=ee.getMac();q=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,J.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,Q.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(Z).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(U).getBytes())])]),q])},r.generateKey=e.pbe.generatePkcs12Key,Wd.exports}var Dm;function Tx(){if(Dm)return $d.exports;Dm=1;var e=Le();Wr(),Oa(),wx(),Oo(),j0(),Dx(),z0(),Bc(),Ue(),G0();var t=e.asn1,n=$d.exports=e.pki=e.pki||{};return n.pemToDer=function(r){var i=e.pem.decode(r)[0];if(i.procType&&i.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return e.util.createBuffer(i.body)},n.privateKeyFromPem=function(r){var i=e.pem.decode(r)[0];if(i.type!=="PRIVATE KEY"&&i.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=i.type,a}if(i.procType&&i.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=t.fromDer(i.body);return n.privateKeyFromAsn1(o)},n.privateKeyToPem=function(r,i){var a={type:"RSA PRIVATE KEY",body:t.toDer(n.privateKeyToAsn1(r)).getBytes()};return e.pem.encode(a,{maxline:i})},n.privateKeyInfoToPem=function(r,i){var a={type:"PRIVATE KEY",body:t.toDer(r).getBytes()};return e.pem.encode(a,{maxline:i})},$d.exports}var Jd,Tm;function Ax(){if(Tm)return Jd;Tm=1;var e=Le();Wr(),rl(),V0(),Oo(),Tx(),Er(),il(),Ue();var t=function(R,H,V,D){var L=e.util.createBuffer(),K=R.length>>1,X=K+(R.length&1),se=R.substr(0,X),ie=R.substr(K,X),oe=e.util.createBuffer(),te=e.hmac.create();V=H+V;var ue=Math.ceil(D/16),ve=Math.ceil(D/20);te.start("MD5",se);var be=e.util.createBuffer();oe.putBytes(V);for(var pe=0;pe<ue;++pe)te.start(null,null),te.update(oe.getBytes()),oe.putBuffer(te.digest()),te.start(null,null),te.update(oe.bytes()+V),be.putBuffer(te.digest());te.start("SHA1",ie);var Te=e.util.createBuffer();oe.clear(),oe.putBytes(V);for(var pe=0;pe<ve;++pe)te.start(null,null),te.update(oe.getBytes()),oe.putBuffer(te.digest()),te.start(null,null),te.update(oe.bytes()+V),Te.putBuffer(te.digest());return L.putBytes(e.util.xorBytes(be.getBytes(),Te.getBytes(),D)),L},n=function(R,H,V){var D=e.hmac.create();D.start("SHA1",R);var L=e.util.createBuffer();return L.putInt32(H[0]),L.putInt32(H[1]),L.putByte(V.type),L.putByte(V.version.major),L.putByte(V.version.minor),L.putInt16(V.length),L.putBytes(V.fragment.bytes()),D.update(L.getBytes()),D.digest().getBytes()},r=function(R,H,V){var D=!1;try{var L=R.deflate(H.fragment.getBytes());H.fragment=e.util.createBuffer(L),H.length=L.length,D=!0}catch{}return D},i=function(R,H,V){var D=!1;try{var L=R.inflate(H.fragment.getBytes());H.fragment=e.util.createBuffer(L),H.length=L.length,D=!0}catch{}return D},a=function(R,H){var V=0;switch(H){case 1:V=R.getByte();break;case 2:V=R.getInt16();break;case 3:V=R.getInt24();break;case 4:V=R.getInt32();break}return e.util.createBuffer(R.getBytes(V))},o=function(R,H,V){R.putInt(V.length(),H<<3),R.putBuffer(V)},s={};s.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},s.SupportedVersions=[s.Versions.TLS_1_1,s.Versions.TLS_1_0],s.Version=s.SupportedVersions[0],s.MaxFragment=15360,s.ConnectionEnd={server:0,client:1},s.PRFAlgorithm={tls_prf_sha256:0},s.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},s.CipherType={stream:0,block:1,aead:2},s.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},s.CompressionMethod={none:0,deflate:1},s.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},s.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},s.Alert={},s.Alert.Level={warning:1,fatal:2},s.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},s.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},s.CipherSuites={},s.getCipherSuite=function(R){var H=null;for(var V in s.CipherSuites){var D=s.CipherSuites[V];if(D.id[0]===R.charCodeAt(0)&&D.id[1]===R.charCodeAt(1)){H=D;break}}return H},s.handleUnexpected=function(R,H){var V=!R.open&&R.entity===s.ConnectionEnd.client;V||R.error(R,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unexpected_message}})},s.handleHelloRequest=function(R,H,V){!R.handshaking&&R.handshakes>0&&(s.queue(R,s.createAlert(R,{level:s.Alert.Level.warning,description:s.Alert.Description.no_renegotiation})),s.flush(R)),R.process()},s.parseHelloMessage=function(R,H,V){var D=null,L=R.entity===s.ConnectionEnd.client;if(V<38)R.error(R,{message:L?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});else{var K=H.fragment,X=K.length();if(D={version:{major:K.getByte(),minor:K.getByte()},random:e.util.createBuffer(K.getBytes(32)),session_id:a(K,1),extensions:[]},L?(D.cipher_suite=K.getBytes(2),D.compression_method=K.getByte()):(D.cipher_suites=a(K,2),D.compression_methods=a(K,1)),X=V-(X-K.length()),X>0){for(var se=a(K,2);se.length()>0;)D.extensions.push({type:[se.getByte(),se.getByte()],data:a(se,2)});if(!L)for(var ie=0;ie<D.extensions.length;++ie){var oe=D.extensions[ie];if(oe.type[0]===0&&oe.type[1]===0)for(var te=a(oe.data,2);te.length()>0;){var ue=te.getByte();if(ue!==0)break;R.session.extensions.server_name.serverNameList.push(a(te,2).getBytes())}}}if(R.session.version&&(D.version.major!==R.session.version.major||D.version.minor!==R.session.version.minor))return R.error(R,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.protocol_version}});if(L)R.session.cipherSuite=s.getCipherSuite(D.cipher_suite);else for(var ve=e.util.createBuffer(D.cipher_suites.bytes());ve.length()>0&&(R.session.cipherSuite=s.getCipherSuite(ve.getBytes(2)),R.session.cipherSuite===null););if(R.session.cipherSuite===null)return R.error(R,{message:"No cipher suites in common.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.handshake_failure},cipherSuite:e.util.bytesToHex(D.cipher_suite)});L?R.session.compressionMethod=D.compression_method:R.session.compressionMethod=s.CompressionMethod.none}return D},s.createSecurityParameters=function(R,H){var V=R.entity===s.ConnectionEnd.client,D=H.random.bytes(),L=V?R.session.sp.client_random:D,K=V?D:s.createRandom().getBytes();R.session.sp={entity:R.entity,prf_algorithm:s.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:R.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:L,server_random:K}},s.handleServerHello=function(R,H,V){var D=s.parseHelloMessage(R,H,V);if(!R.fail){if(D.version.minor<=R.version.minor)R.version.minor=D.version.minor;else return R.error(R,{message:"Incompatible TLS version.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.protocol_version}});R.session.version=R.version;var L=D.session_id.bytes();L.length>0&&L===R.session.id?(R.expect=d,R.session.resuming=!0,R.session.sp.server_random=D.random.bytes()):(R.expect=u,R.session.resuming=!1,s.createSecurityParameters(R,D)),R.session.id=L,R.process()}},s.handleClientHello=function(R,H,V){var D=s.parseHelloMessage(R,H,V);if(!R.fail){var L=D.session_id.bytes(),K=null;if(R.sessionCache&&(K=R.sessionCache.getSession(L),K===null?L="":(K.version.major!==D.version.major||K.version.minor>D.version.minor)&&(K=null,L="")),L.length===0&&(L=e.random.getBytes(32)),R.session.id=L,R.session.clientHelloVersion=D.version,R.session.sp={},K)R.version=R.session.version=K.version,R.session.sp=K.sp;else{for(var X,se=1;se<s.SupportedVersions.length&&(X=s.SupportedVersions[se],!(X.minor<=D.version.minor));++se);R.version={major:X.major,minor:X.minor},R.session.version=R.version}K!==null?(R.expect=w,R.session.resuming=!0,R.session.sp.client_random=D.random.bytes()):(R.expect=R.verifyClient!==!1?y:C,R.session.resuming=!1,s.createSecurityParameters(R,D)),R.open=!0,s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createServerHello(R)})),R.session.resuming?(s.queue(R,s.createRecord(R,{type:s.ContentType.change_cipher_spec,data:s.createChangeCipherSpec()})),R.state.pending=s.createConnectionState(R),R.state.current.write=R.state.pending.write,s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createFinished(R)}))):(s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createCertificate(R)})),R.fail||(s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createServerKeyExchange(R)})),R.verifyClient!==!1&&s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createCertificateRequest(R)})),s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createServerHelloDone(R)})))),s.flush(R),R.process()}},s.handleCertificate=function(R,H,V){if(V<3)return R.error(R,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var D=H.fragment,L={certificate_list:a(D,3)},K,X,se=[];try{for(;L.certificate_list.length()>0;)K=a(L.certificate_list,3),X=e.asn1.fromDer(K),K=e.pki.certificateFromAsn1(X,!0),se.push(K)}catch(oe){return R.error(R,{message:"Could not parse certificate list.",cause:oe,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.bad_certificate}})}var ie=R.entity===s.ConnectionEnd.client;(ie||R.verifyClient===!0)&&se.length===0?R.error(R,{message:ie?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}}):se.length===0?R.expect=ie?c:C:(ie?R.session.serverCertificate=se[0]:R.session.clientCertificate=se[0],s.verifyCertificateChain(R,se)&&(R.expect=ie?c:C)),R.process()},s.handleServerKeyExchange=function(R,H,V){if(V>0)return R.error(R,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unsupported_certificate}});R.expect=p,R.process()},s.handleClientKeyExchange=function(R,H,V){if(V<48)return R.error(R,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unsupported_certificate}});var D=H.fragment,L={enc_pre_master_secret:a(D,2).getBytes()},K=null;if(R.getPrivateKey)try{K=R.getPrivateKey(R,R.session.serverCertificate),K=e.pki.privateKeyFromPem(K)}catch(ie){R.error(R,{message:"Could not get private key.",cause:ie,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}})}if(K===null)return R.error(R,{message:"No private key set.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}});try{var X=R.session.sp;X.pre_master_secret=K.decrypt(L.enc_pre_master_secret);var se=R.session.clientHelloVersion;if(se.major!==X.pre_master_secret.charCodeAt(0)||se.minor!==X.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{X.pre_master_secret=e.random.getBytes(48)}R.expect=w,R.session.clientCertificate!==null&&(R.expect=S),R.process()},s.handleCertificateRequest=function(R,H,V){if(V<3)return R.error(R,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var D=H.fragment,L={certificate_types:a(D,1),certificate_authorities:a(D,2)};R.session.certificateRequest=L,R.expect=h,R.process()},s.handleCertificateVerify=function(R,H,V){if(V<2)return R.error(R,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var D=H.fragment;D.read-=4;var L=D.bytes();D.read+=4;var K={signature:a(D,2).getBytes()},X=e.util.createBuffer();X.putBuffer(R.session.md5.digest()),X.putBuffer(R.session.sha1.digest()),X=X.getBytes();try{var se=R.session.clientCertificate;if(!se.publicKey.verify(X,K.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");R.session.md5.update(L),R.session.sha1.update(L)}catch{return R.error(R,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.handshake_failure}})}R.expect=w,R.process()},s.handleServerHelloDone=function(R,H,V){if(V>0)return R.error(R,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.record_overflow}});if(R.serverCertificate===null){var D={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.insufficient_security}},L=0,K=R.verify(R,D.alert.description,L,[]);if(K!==!0)return(K||K===0)&&(typeof K=="object"&&!e.util.isArray(K)?(K.message&&(D.message=K.message),K.alert&&(D.alert.description=K.alert)):typeof K=="number"&&(D.alert.description=K)),R.error(R,D)}R.session.certificateRequest!==null&&(H=s.createRecord(R,{type:s.ContentType.handshake,data:s.createCertificate(R)}),s.queue(R,H)),H=s.createRecord(R,{type:s.ContentType.handshake,data:s.createClientKeyExchange(R)}),s.queue(R,H),R.expect=b;var X=function(se,ie){se.session.certificateRequest!==null&&se.session.clientCertificate!==null&&s.queue(se,s.createRecord(se,{type:s.ContentType.handshake,data:s.createCertificateVerify(se,ie)})),s.queue(se,s.createRecord(se,{type:s.ContentType.change_cipher_spec,data:s.createChangeCipherSpec()})),se.state.pending=s.createConnectionState(se),se.state.current.write=se.state.pending.write,s.queue(se,s.createRecord(se,{type:s.ContentType.handshake,data:s.createFinished(se)})),se.expect=d,s.flush(se),se.process()};if(R.session.certificateRequest===null||R.session.clientCertificate===null)return X(R,null);s.getClientSignature(R,X)},s.handleChangeCipherSpec=function(R,H){if(H.fragment.getByte()!==1)return R.error(R,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var V=R.entity===s.ConnectionEnd.client;(R.session.resuming&&V||!R.session.resuming&&!V)&&(R.state.pending=s.createConnectionState(R)),R.state.current.read=R.state.pending.read,(!R.session.resuming&&V||R.session.resuming&&!V)&&(R.state.pending=null),R.expect=V?v:E,R.process()},s.handleFinished=function(R,H,V){var D=H.fragment;D.read-=4;var L=D.bytes();D.read+=4;var K=H.fragment.getBytes();D=e.util.createBuffer(),D.putBuffer(R.session.md5.digest()),D.putBuffer(R.session.sha1.digest());var X=R.entity===s.ConnectionEnd.client,se=X?"server finished":"client finished",ie=R.session.sp,oe=12,te=t;if(D=te(ie.master_secret,se,D.getBytes(),oe),D.getBytes()!==K)return R.error(R,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.decrypt_error}});R.session.md5.update(L),R.session.sha1.update(L),(R.session.resuming&&X||!R.session.resuming&&!X)&&(s.queue(R,s.createRecord(R,{type:s.ContentType.change_cipher_spec,data:s.createChangeCipherSpec()})),R.state.current.write=R.state.pending.write,R.state.pending=null,s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createFinished(R)}))),R.expect=X?m:x,R.handshaking=!1,++R.handshakes,R.peerCertificate=X?R.session.serverCertificate:R.session.clientCertificate,s.flush(R),R.isConnected=!0,R.connected(R),R.process()},s.handleAlert=function(R,H){var V=H.fragment,D={level:V.getByte(),description:V.getByte()},L;switch(D.description){case s.Alert.Description.close_notify:L="Connection closed.";break;case s.Alert.Description.unexpected_message:L="Unexpected message.";break;case s.Alert.Description.bad_record_mac:L="Bad record MAC.";break;case s.Alert.Description.decryption_failed:L="Decryption failed.";break;case s.Alert.Description.record_overflow:L="Record overflow.";break;case s.Alert.Description.decompression_failure:L="Decompression failed.";break;case s.Alert.Description.handshake_failure:L="Handshake failure.";break;case s.Alert.Description.bad_certificate:L="Bad certificate.";break;case s.Alert.Description.unsupported_certificate:L="Unsupported certificate.";break;case s.Alert.Description.certificate_revoked:L="Certificate revoked.";break;case s.Alert.Description.certificate_expired:L="Certificate expired.";break;case s.Alert.Description.certificate_unknown:L="Certificate unknown.";break;case s.Alert.Description.illegal_parameter:L="Illegal parameter.";break;case s.Alert.Description.unknown_ca:L="Unknown certificate authority.";break;case s.Alert.Description.access_denied:L="Access denied.";break;case s.Alert.Description.decode_error:L="Decode error.";break;case s.Alert.Description.decrypt_error:L="Decrypt error.";break;case s.Alert.Description.export_restriction:L="Export restriction.";break;case s.Alert.Description.protocol_version:L="Unsupported protocol version.";break;case s.Alert.Description.insufficient_security:L="Insufficient security.";break;case s.Alert.Description.internal_error:L="Internal error.";break;case s.Alert.Description.user_canceled:L="User canceled.";break;case s.Alert.Description.no_renegotiation:L="Renegotiation not supported.";break;default:L="Unknown error.";break}if(D.description===s.Alert.Description.close_notify)return R.close();R.error(R,{message:L,send:!1,origin:R.entity===s.ConnectionEnd.client?"server":"client",alert:D}),R.process()},s.handleHandshake=function(R,H){var V=H.fragment,D=V.getByte(),L=V.getInt24();if(L>V.length())return R.fragmented=H,H.fragment=e.util.createBuffer(),V.read-=4,R.process();R.fragmented=null,V.read-=4;var K=V.bytes(L+4);V.read+=4,D in q[R.entity][R.expect]?(R.entity===s.ConnectionEnd.server&&!R.open&&!R.fail&&(R.handshaking=!0,R.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:e.md.md5.create(),sha1:e.md.sha1.create()}),D!==s.HandshakeType.hello_request&&D!==s.HandshakeType.certificate_verify&&D!==s.HandshakeType.finished&&(R.session.md5.update(K),R.session.sha1.update(K)),q[R.entity][R.expect][D](R,H,L)):s.handleUnexpected(R,H)},s.handleApplicationData=function(R,H){R.data.putBuffer(H.fragment),R.dataReady(R),R.process()},s.handleHeartbeat=function(R,H){var V=H.fragment,D=V.getByte(),L=V.getInt16(),K=V.getBytes(L);if(D===s.HeartbeatMessageType.heartbeat_request){if(R.handshaking||L>K.length)return R.process();s.queue(R,s.createRecord(R,{type:s.ContentType.heartbeat,data:s.createHeartbeat(s.HeartbeatMessageType.heartbeat_response,K)})),s.flush(R)}else if(D===s.HeartbeatMessageType.heartbeat_response){if(K!==R.expectedHeartbeatPayload)return R.process();R.heartbeatReceived&&R.heartbeatReceived(R,e.util.createBuffer(K))}R.process()};var l=0,u=1,c=2,p=3,h=4,d=5,v=6,m=7,b=8,f=0,y=1,C=2,S=3,w=4,E=5,x=6,g=s.handleUnexpected,I=s.handleChangeCipherSpec,A=s.handleAlert,_=s.handleHandshake,T=s.handleApplicationData,$=s.handleHeartbeat,B=[];B[s.ConnectionEnd.client]=[[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[I,A,g,g,$],[g,A,_,g,$],[g,A,_,T,$],[g,A,_,g,$]],B[s.ConnectionEnd.server]=[[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[I,A,g,g,$],[g,A,_,g,$],[g,A,_,T,$],[g,A,_,g,$]];var P=s.handleHelloRequest,k=s.handleServerHello,O=s.handleCertificate,M=s.handleServerKeyExchange,G=s.handleCertificateRequest,W=s.handleServerHelloDone,U=s.handleFinished,q=[];q[s.ConnectionEnd.client]=[[g,g,k,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,O,M,G,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,M,G,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,G,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,U],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g]];var Q=s.handleClientHello,Z=s.handleClientKeyExchange,ee=s.handleCertificateVerify;q[s.ConnectionEnd.server]=[[g,Q,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,O,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,Z,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,ee,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,U],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g]],s.generateKeys=function(R,H){var V=t,D=H.client_random+H.server_random;R.session.resuming||(H.master_secret=V(H.pre_master_secret,"master secret",D,48).bytes(),H.pre_master_secret=null),D=H.server_random+H.client_random;var L=2*H.mac_key_length+2*H.enc_key_length,K=R.version.major===s.Versions.TLS_1_0.major&&R.version.minor===s.Versions.TLS_1_0.minor;K&&(L+=2*H.fixed_iv_length);var X=V(H.master_secret,"key expansion",D,L),se={client_write_MAC_key:X.getBytes(H.mac_key_length),server_write_MAC_key:X.getBytes(H.mac_key_length),client_write_key:X.getBytes(H.enc_key_length),server_write_key:X.getBytes(H.enc_key_length)};return K&&(se.client_write_IV=X.getBytes(H.fixed_iv_length),se.server_write_IV=X.getBytes(H.fixed_iv_length)),se},s.createConnectionState=function(R){var H=R.entity===s.ConnectionEnd.client,V=function(){var K={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(X){return!0},compressionState:null,compressFunction:function(X){return!0},updateSequenceNumber:function(){K.sequenceNumber[1]===4294967295?(K.sequenceNumber[1]=0,++K.sequenceNumber[0]):++K.sequenceNumber[1]}};return K},D={read:V(),write:V()};if(D.read.update=function(K,X){return D.read.cipherFunction(X,D.read)?D.read.compressFunction(K,X,D.read)||K.error(K,{message:"Could not decompress record.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.decompression_failure}}):K.error(K,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.bad_record_mac}}),!K.fail},D.write.update=function(K,X){return D.write.compressFunction(K,X,D.write)?D.write.cipherFunction(X,D.write)||K.error(K,{message:"Could not encrypt record.",send:!1,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}}):K.error(K,{message:"Could not compress record.",send:!1,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}}),!K.fail},R.session){var L=R.session.sp;switch(R.session.cipherSuite.initSecurityParameters(L),L.keys=s.generateKeys(R,L),D.read.macKey=H?L.keys.server_write_MAC_key:L.keys.client_write_MAC_key,D.write.macKey=H?L.keys.client_write_MAC_key:L.keys.server_write_MAC_key,R.session.cipherSuite.initConnectionState(D,R,L),L.compression_algorithm){case s.CompressionMethod.none:break;case s.CompressionMethod.deflate:D.read.compressFunction=i,D.write.compressFunction=r;break;default:throw new Error("Unsupported compression algorithm.")}}return D},s.createRandom=function(){var R=new Date,H=+R+R.getTimezoneOffset()*6e4,V=e.util.createBuffer();return V.putInt32(H),V.putBytes(e.random.getBytes(28)),V},s.createRecord=function(R,H){if(!H.data)return null;var V={type:H.type,version:{major:R.version.major,minor:R.version.minor},length:H.data.length(),fragment:H.data};return V},s.createAlert=function(R,H){var V=e.util.createBuffer();return V.putByte(H.level),V.putByte(H.description),s.createRecord(R,{type:s.ContentType.alert,data:V})},s.createClientHello=function(R){R.session.clientHelloVersion={major:R.version.major,minor:R.version.minor};for(var H=e.util.createBuffer(),V=0;V<R.cipherSuites.length;++V){var D=R.cipherSuites[V];H.putByte(D.id[0]),H.putByte(D.id[1])}var L=H.length(),K=e.util.createBuffer();K.putByte(s.CompressionMethod.none);var X=K.length(),se=e.util.createBuffer();if(R.virtualHost){var ie=e.util.createBuffer();ie.putByte(0),ie.putByte(0);var oe=e.util.createBuffer();oe.putByte(0),o(oe,2,e.util.createBuffer(R.virtualHost));var te=e.util.createBuffer();o(te,2,oe),o(ie,2,te),se.putBuffer(ie)}var ue=se.length();ue>0&&(ue+=2);var ve=R.session.id,be=ve.length+1+2+4+28+2+L+1+X+ue,pe=e.util.createBuffer();return pe.putByte(s.HandshakeType.client_hello),pe.putInt24(be),pe.putByte(R.version.major),pe.putByte(R.version.minor),pe.putBytes(R.session.sp.client_random),o(pe,1,e.util.createBuffer(ve)),o(pe,2,H),o(pe,1,K),ue>0&&o(pe,2,se),pe},s.createServerHello=function(R){var H=R.session.id,V=H.length+1+2+4+28+2+1,D=e.util.createBuffer();return D.putByte(s.HandshakeType.server_hello),D.putInt24(V),D.putByte(R.version.major),D.putByte(R.version.minor),D.putBytes(R.session.sp.server_random),o(D,1,e.util.createBuffer(H)),D.putByte(R.session.cipherSuite.id[0]),D.putByte(R.session.cipherSuite.id[1]),D.putByte(R.session.compressionMethod),D},s.createCertificate=function(R){var H=R.entity===s.ConnectionEnd.client,V=null;if(R.getCertificate){var D;H?D=R.session.certificateRequest:D=R.session.extensions.server_name.serverNameList,V=R.getCertificate(R,D)}var L=e.util.createBuffer();if(V!==null)try{e.util.isArray(V)||(V=[V]);for(var K=null,X=0;X<V.length;++X){var se=e.pem.decode(V[X])[0];if(se.type!=="CERTIFICATE"&&se.type!=="X509 CERTIFICATE"&&se.type!=="TRUSTED CERTIFICATE"){var ie=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw ie.headerType=se.type,ie}if(se.procType&&se.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var oe=e.util.createBuffer(se.body);K===null&&(K=e.asn1.fromDer(oe.bytes(),!1));var te=e.util.createBuffer();o(te,3,oe),L.putBuffer(te)}V=e.pki.certificateFromAsn1(K),H?R.session.clientCertificate=V:R.session.serverCertificate=V}catch(be){return R.error(R,{message:"Could not send certificate list.",cause:be,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.bad_certificate}})}var ue=3+L.length(),ve=e.util.createBuffer();return ve.putByte(s.HandshakeType.certificate),ve.putInt24(ue),o(ve,3,L),ve},s.createClientKeyExchange=function(R){var H=e.util.createBuffer();H.putByte(R.session.clientHelloVersion.major),H.putByte(R.session.clientHelloVersion.minor),H.putBytes(e.random.getBytes(46));var V=R.session.sp;V.pre_master_secret=H.getBytes();var D=R.session.serverCertificate.publicKey;H=D.encrypt(V.pre_master_secret);var L=H.length+2,K=e.util.createBuffer();return K.putByte(s.HandshakeType.client_key_exchange),K.putInt24(L),K.putInt16(H.length),K.putBytes(H),K},s.createServerKeyExchange=function(R){var H=e.util.createBuffer();return H},s.getClientSignature=function(R,H){var V=e.util.createBuffer();V.putBuffer(R.session.md5.digest()),V.putBuffer(R.session.sha1.digest()),V=V.getBytes(),R.getSignature=R.getSignature||function(D,L,K){var X=null;if(D.getPrivateKey)try{X=D.getPrivateKey(D,D.session.clientCertificate),X=e.pki.privateKeyFromPem(X)}catch(se){D.error(D,{message:"Could not get private key.",cause:se,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}})}X===null?D.error(D,{message:"No private key set.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}}):L=X.sign(L,null),K(D,L)},R.getSignature(R,V,H)},s.createCertificateVerify=function(R,H){var V=H.length+2,D=e.util.createBuffer();return D.putByte(s.HandshakeType.certificate_verify),D.putInt24(V),D.putInt16(H.length),D.putBytes(H),D},s.createCertificateRequest=function(R){var H=e.util.createBuffer();H.putByte(1);var V=e.util.createBuffer();for(var D in R.caStore.certs){var L=R.caStore.certs[D],K=e.pki.distinguishedNameToAsn1(L.subject),X=e.asn1.toDer(K);V.putInt16(X.length()),V.putBuffer(X)}var se=1+H.length()+2+V.length(),ie=e.util.createBuffer();return ie.putByte(s.HandshakeType.certificate_request),ie.putInt24(se),o(ie,1,H),o(ie,2,V),ie},s.createServerHelloDone=function(R){var H=e.util.createBuffer();return H.putByte(s.HandshakeType.server_hello_done),H.putInt24(0),H},s.createChangeCipherSpec=function(){var R=e.util.createBuffer();return R.putByte(1),R},s.createFinished=function(R){var H=e.util.createBuffer();H.putBuffer(R.session.md5.digest()),H.putBuffer(R.session.sha1.digest());var V=R.entity===s.ConnectionEnd.client,D=R.session.sp,L=12,K=t,X=V?"client finished":"server finished";H=K(D.master_secret,X,H.getBytes(),L);var se=e.util.createBuffer();return se.putByte(s.HandshakeType.finished),se.putInt24(H.length()),se.putBuffer(H),se},s.createHeartbeat=function(R,H,V){typeof V>"u"&&(V=H.length);var D=e.util.createBuffer();D.putByte(R),D.putInt16(V),D.putBytes(H);var L=D.length(),K=Math.max(16,L-V-3);return D.putBytes(e.random.getBytes(K)),D},s.queue=function(R,H){if(H&&!(H.fragment.length()===0&&(H.type===s.ContentType.handshake||H.type===s.ContentType.alert||H.type===s.ContentType.change_cipher_spec))){if(H.type===s.ContentType.handshake){var V=H.fragment.bytes();R.session.md5.update(V),R.session.sha1.update(V),V=null}var D;if(H.fragment.length()<=s.MaxFragment)D=[H];else{D=[];for(var L=H.fragment.bytes();L.length>s.MaxFragment;)D.push(s.createRecord(R,{type:H.type,data:e.util.createBuffer(L.slice(0,s.MaxFragment))})),L=L.slice(s.MaxFragment);L.length>0&&D.push(s.createRecord(R,{type:H.type,data:e.util.createBuffer(L)}))}for(var K=0;K<D.length&&!R.fail;++K){var X=D[K],se=R.state.current.write;se.update(R,X)&&R.records.push(X)}}},s.flush=function(R){for(var H=0;H<R.records.length;++H){var V=R.records[H];R.tlsData.putByte(V.type),R.tlsData.putByte(V.version.major),R.tlsData.putByte(V.version.minor),R.tlsData.putInt16(V.fragment.length()),R.tlsData.putBuffer(R.records[H].fragment)}return R.records=[],R.tlsDataReady(R)};var J=function(R){switch(R){case!0:return!0;case e.pki.certificateError.bad_certificate:return s.Alert.Description.bad_certificate;case e.pki.certificateError.unsupported_certificate:return s.Alert.Description.unsupported_certificate;case e.pki.certificateError.certificate_revoked:return s.Alert.Description.certificate_revoked;case e.pki.certificateError.certificate_expired:return s.Alert.Description.certificate_expired;case e.pki.certificateError.certificate_unknown:return s.Alert.Description.certificate_unknown;case e.pki.certificateError.unknown_ca:return s.Alert.Description.unknown_ca;default:return s.Alert.Description.bad_certificate}},le=function(R){switch(R){case!0:return!0;case s.Alert.Description.bad_certificate:return e.pki.certificateError.bad_certificate;case s.Alert.Description.unsupported_certificate:return e.pki.certificateError.unsupported_certificate;case s.Alert.Description.certificate_revoked:return e.pki.certificateError.certificate_revoked;case s.Alert.Description.certificate_expired:return e.pki.certificateError.certificate_expired;case s.Alert.Description.certificate_unknown:return e.pki.certificateError.certificate_unknown;case s.Alert.Description.unknown_ca:return e.pki.certificateError.unknown_ca;default:return e.pki.certificateError.bad_certificate}};s.verifyCertificateChain=function(R,H){try{var V={};for(var D in R.verifyOptions)V[D]=R.verifyOptions[D];V.verify=function(K,X,se){var ie=J(K),oe=R.verify(R,K,X,se);if(oe!==!0){if(typeof oe=="object"&&!e.util.isArray(oe)){var te=new Error("The application rejected the certificate.");throw te.send=!0,te.alert={level:s.Alert.Level.fatal,description:s.Alert.Description.bad_certificate},oe.message&&(te.message=oe.message),oe.alert&&(te.alert.description=oe.alert),te}oe!==K&&(oe=le(oe))}return oe},e.pki.verifyCertificateChain(R.caStore,H,V)}catch(K){var L=K;(typeof L!="object"||e.util.isArray(L))&&(L={send:!0,alert:{level:s.Alert.Level.fatal,description:J(K)}}),"send"in L||(L.send=!0),"alert"in L||(L.alert={level:s.Alert.Level.fatal,description:J(L.error)}),R.error(R,L)}return!R.fail},s.createSessionCache=function(R,H){var V=null;if(R&&R.getSession&&R.setSession&&R.order)V=R;else{V={},V.cache=R||{},V.capacity=Math.max(H||100,1),V.order=[];for(var D in R)V.order.length<=H?V.order.push(D):delete R[D];V.getSession=function(L){var K=null,X=null;if(L?X=e.util.bytesToHex(L):V.order.length>0&&(X=V.order[0]),X!==null&&X in V.cache){K=V.cache[X],delete V.cache[X];for(var se in V.order)if(V.order[se]===X){V.order.splice(se,1);break}}return K},V.setSession=function(L,K){if(V.order.length===V.capacity){var X=V.order.shift();delete V.cache[X]}var X=e.util.bytesToHex(L);V.order.push(X),V.cache[X]=K}}return V},s.createConnection=function(R){var H=null;R.caStore?e.util.isArray(R.caStore)?H=e.pki.createCaStore(R.caStore):H=R.caStore:H=e.pki.createCaStore();var V=R.cipherSuites||null;if(V===null){V=[];for(var D in s.CipherSuites)V.push(s.CipherSuites[D])}var L=R.server?s.ConnectionEnd.server:s.ConnectionEnd.client,K=R.sessionCache?s.createSessionCache(R.sessionCache):null,X={version:{major:s.Version.major,minor:s.Version.minor},entity:L,sessionId:R.sessionId,caStore:H,sessionCache:K,cipherSuites:V,connected:R.connected,virtualHost:R.virtualHost||null,verifyClient:R.verifyClient||!1,verify:R.verify||function(te,ue,ve,be){return ue},verifyOptions:R.verifyOptions||{},getCertificate:R.getCertificate||null,getPrivateKey:R.getPrivateKey||null,getSignature:R.getSignature||null,input:e.util.createBuffer(),tlsData:e.util.createBuffer(),data:e.util.createBuffer(),tlsDataReady:R.tlsDataReady,dataReady:R.dataReady,heartbeatReceived:R.heartbeatReceived,closed:R.closed,error:function(te,ue){ue.origin=ue.origin||(te.entity===s.ConnectionEnd.client?"client":"server"),ue.send&&(s.queue(te,s.createAlert(te,ue.alert)),s.flush(te));var ve=ue.fatal!==!1;ve&&(te.fail=!0),R.error(te,ue),ve&&te.close(!1)},deflate:R.deflate||null,inflate:R.inflate||null};X.reset=function(te){X.version={major:s.Version.major,minor:s.Version.minor},X.record=null,X.session=null,X.peerCertificate=null,X.state={pending:null,current:null},X.expect=X.entity===s.ConnectionEnd.client?l:f,X.fragmented=null,X.records=[],X.open=!1,X.handshakes=0,X.handshaking=!1,X.isConnected=!1,X.fail=!(te||typeof te>"u"),X.input.clear(),X.tlsData.clear(),X.data.clear(),X.state.current=s.createConnectionState(X)},X.reset();var se=function(te,ue){var ve=ue.type-s.ContentType.change_cipher_spec,be=B[te.entity][te.expect];ve in be?be[ve](te,ue):s.handleUnexpected(te,ue)},ie=function(te){var ue=0,ve=te.input,be=ve.length();if(be<5)ue=5-be;else{te.record={type:ve.getByte(),version:{major:ve.getByte(),minor:ve.getByte()},length:ve.getInt16(),fragment:e.util.createBuffer(),ready:!1};var pe=te.record.version.major===te.version.major;pe&&te.session&&te.session.version&&(pe=te.record.version.minor===te.version.minor),pe||te.error(te,{message:"Incompatible TLS version.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.protocol_version}})}return ue},oe=function(te){var ue=0,ve=te.input,be=ve.length();if(be<te.record.length)ue=te.record.length-be;else{te.record.fragment.putBytes(ve.getBytes(te.record.length)),ve.compact();var pe=te.state.current.read;pe.update(te,te.record)&&(te.fragmented!==null&&(te.fragmented.type===te.record.type?(te.fragmented.fragment.putBuffer(te.record.fragment),te.record=te.fragmented):te.error(te,{message:"Invalid fragmented record.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unexpected_message}})),te.record.ready=!0)}return ue};return X.handshake=function(te){if(X.entity!==s.ConnectionEnd.client)X.error(X,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(X.handshaking)X.error(X,{message:"Handshake already in progress.",fatal:!1});else{X.fail&&!X.open&&X.handshakes===0&&(X.fail=!1),X.handshaking=!0,te=te||"";var ue=null;te.length>0&&(X.sessionCache&&(ue=X.sessionCache.getSession(te)),ue===null&&(te="")),te.length===0&&X.sessionCache&&(ue=X.sessionCache.getSession(),ue!==null&&(te=ue.id)),X.session={id:te,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:e.md.md5.create(),sha1:e.md.sha1.create()},ue&&(X.version=ue.version,X.session.sp=ue.sp),X.session.sp.client_random=s.createRandom().getBytes(),X.open=!0,s.queue(X,s.createRecord(X,{type:s.ContentType.handshake,data:s.createClientHello(X)})),s.flush(X)}},X.process=function(te){var ue=0;return te&&X.input.putBytes(te),X.fail||(X.record!==null&&X.record.ready&&X.record.fragment.isEmpty()&&(X.record=null),X.record===null&&(ue=ie(X)),!X.fail&&X.record!==null&&!X.record.ready&&(ue=oe(X)),!X.fail&&X.record!==null&&X.record.ready&&se(X,X.record)),ue},X.prepare=function(te){return s.queue(X,s.createRecord(X,{type:s.ContentType.application_data,data:e.util.createBuffer(te)})),s.flush(X)},X.prepareHeartbeatRequest=function(te,ue){return te instanceof e.util.ByteBuffer&&(te=te.bytes()),typeof ue>"u"&&(ue=te.length),X.expectedHeartbeatPayload=te,s.queue(X,s.createRecord(X,{type:s.ContentType.heartbeat,data:s.createHeartbeat(s.HeartbeatMessageType.heartbeat_request,te,ue)})),s.flush(X)},X.close=function(te){if(!X.fail&&X.sessionCache&&X.session){var ue={id:X.session.id,version:X.session.version,sp:X.session.sp};ue.sp.keys=null,X.sessionCache.setSession(ue.id,ue)}X.open&&(X.open=!1,X.input.clear(),(X.isConnected||X.handshaking)&&(X.isConnected=X.handshaking=!1,s.queue(X,s.createAlert(X,{level:s.Alert.Level.warning,description:s.Alert.Description.close_notify})),s.flush(X)),X.closed(X)),X.reset(te)},X},Jd=e.tls=e.tls||{};for(var re in s)typeof s[re]!="function"&&(e.tls[re]=s[re]);return e.tls.prf_tls1=t,e.tls.hmac_sha1=n,e.tls.createSessionCache=s.createSessionCache,e.tls.createConnection=s.createConnection,Jd}var Am;function lD(){if(Am)return Dd.exports;Am=1;var e=Le();Ma(),Ax();var t=Dd.exports=e.tls;t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(l){l.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,l.cipher_type=t.CipherType.block,l.enc_key_length=16,l.block_length=16,l.fixed_iv_length=16,l.record_iv_length=16,l.mac_algorithm=t.MACAlgorithm.hmac_sha1,l.mac_length=20,l.mac_key_length=20},initConnectionState:n},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(l){l.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,l.cipher_type=t.CipherType.block,l.enc_key_length=32,l.block_length=16,l.fixed_iv_length=16,l.record_iv_length=16,l.mac_algorithm=t.MACAlgorithm.hmac_sha1,l.mac_length=20,l.mac_key_length=20},initConnectionState:n};function n(l,u,c){var p=u.entity===e.tls.ConnectionEnd.client;l.read.cipherState={init:!1,cipher:e.cipher.createDecipher("AES-CBC",p?c.keys.server_write_key:c.keys.client_write_key),iv:p?c.keys.server_write_IV:c.keys.client_write_IV},l.write.cipherState={init:!1,cipher:e.cipher.createCipher("AES-CBC",p?c.keys.client_write_key:c.keys.server_write_key),iv:p?c.keys.client_write_IV:c.keys.server_write_IV},l.read.cipherFunction=o,l.write.cipherFunction=r,l.read.macLength=l.write.macLength=c.mac_length,l.read.macFunction=l.write.macFunction=t.hmac_sha1}function r(l,u){var c=!1,p=u.macFunction(u.macKey,u.sequenceNumber,l);l.fragment.putBytes(p),u.updateSequenceNumber();var h;l.version.minor===t.Versions.TLS_1_0.minor?h=u.cipherState.init?null:u.cipherState.iv:h=e.random.getBytesSync(16),u.cipherState.init=!0;var d=u.cipherState.cipher;return d.start({iv:h}),l.version.minor>=t.Versions.TLS_1_1.minor&&d.output.putBytes(h),d.update(l.fragment),d.finish(i)&&(l.fragment=d.output,l.length=l.fragment.length(),c=!0),c}function i(l,u,c){if(!c){var p=l-u.length()%l;u.fillWithByte(p-1,p)}return!0}function a(l,u,c){var p=!0;if(c){for(var h=u.length(),d=u.last(),v=h-1-d;v<h-1;++v)p=p&&u.at(v)==d;p&&u.truncate(d+1)}return p}function o(l,u){var c=!1,p;l.version.minor===t.Versions.TLS_1_0.minor?p=u.cipherState.init?null:u.cipherState.iv:p=l.fragment.getBytes(16),u.cipherState.init=!0;var h=u.cipherState.cipher;h.start({iv:p}),h.update(l.fragment),c=h.finish(a);var d=u.macLength,v=e.random.getBytesSync(d),m=h.output.length();m>=d?(l.fragment=h.output.getBytes(m-d),v=h.output.getBytes(d)):l.fragment=h.output.getBytes(),l.fragment=e.util.createBuffer(l.fragment),l.length=l.fragment.length();var b=u.macFunction(u.macKey,u.sequenceNumber,l);return u.updateSequenceNumber(),c=s(u.macKey,v,b)&&c,c}function s(l,u,c){var p=e.hmac.create();return p.start("SHA1",l),p.update(u),u=p.digest().getBytes(),p.start(null,null),p.update(c),c=p.digest().getBytes(),u===c}return Dd.exports}var qd={exports:{}},Rm;function Rx(){if(Rm)return qd.exports;Rm=1;var e=Le();mi(),Ue();var t=qd.exports=e.sha512=e.sha512||{};e.md.sha512=e.md.algorithms.sha512=t;var n=e.sha384=e.sha512.sha384=e.sha512.sha384||{};n.create=function(){return t.create("SHA-384")},e.md.sha384=e.md.algorithms.sha384=n,e.sha512.sha256=e.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},e.md["sha512/256"]=e.md.algorithms["sha512/256"]=e.sha512.sha256,e.sha512.sha224=e.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},e.md["sha512/224"]=e.md.algorithms["sha512/224"]=e.sha512.sha224,t.create=function(u){if(i||s(),typeof u>"u"&&(u="SHA-512"),!(u in o))throw new Error("Invalid SHA-512 algorithm: "+u);for(var c=o[u],p=null,h=e.util.createBuffer(),d=new Array(80),v=0;v<80;++v)d[v]=new Array(2);var m=64;switch(u){case"SHA-384":m=48;break;case"SHA-512/256":m=32;break;case"SHA-512/224":m=28;break}var b={algorithm:u.replace("-","").toLowerCase(),blockLength:128,digestLength:m,messageLength:0,fullMessageLength:null,messageLengthSize:16};return b.start=function(){b.messageLength=0,b.fullMessageLength=b.messageLength128=[];for(var f=b.messageLengthSize/4,y=0;y<f;++y)b.fullMessageLength.push(0);h=e.util.createBuffer(),p=new Array(c.length);for(var y=0;y<c.length;++y)p[y]=c[y].slice(0);return b},b.start(),b.update=function(f,y){y==="utf8"&&(f=e.util.encodeUtf8(f));var C=f.length;b.messageLength+=C,C=[C/4294967296>>>0,C>>>0];for(var S=b.fullMessageLength.length-1;S>=0;--S)b.fullMessageLength[S]+=C[1],C[1]=C[0]+(b.fullMessageLength[S]/4294967296>>>0),b.fullMessageLength[S]=b.fullMessageLength[S]>>>0,C[0]=C[1]/4294967296>>>0;return h.putBytes(f),l(p,d,h),(h.read>2048||h.length()===0)&&h.compact(),b},b.digest=function(){var f=e.util.createBuffer();f.putBytes(h.bytes());var y=b.fullMessageLength[b.fullMessageLength.length-1]+b.messageLengthSize,C=y&b.blockLength-1;f.putBytes(r.substr(0,b.blockLength-C));for(var S,w,E=b.fullMessageLength[0]*8,x=0;x<b.fullMessageLength.length-1;++x)S=b.fullMessageLength[x+1]*8,w=S/4294967296>>>0,E+=w,f.putInt32(E>>>0),E=S>>>0;f.putInt32(E);for(var g=new Array(p.length),x=0;x<p.length;++x)g[x]=p[x].slice(0);l(g,d,f);var I=e.util.createBuffer(),A;u==="SHA-512"?A=g.length:u==="SHA-384"?A=g.length-2:A=g.length-4;for(var x=0;x<A;++x)I.putInt32(g[x][0]),(x!==A-1||u!=="SHA-512/224")&&I.putInt32(g[x][1]);return I},b};var r=null,i=!1,a=null,o=null;function s(){r="€",r+=e.util.fillString("\0",128),a=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],o={},o["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],o["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],o["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],o["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],i=!0}function l(u,c,p){for(var h,d,v,m,b,f,y,C,S,w,E,x,g,I,A,_,T,$,B,P,k,O,M,G,W,U,q,Q,Z,ee,J,le,re,R,H,V=p.length();V>=128;){for(Z=0;Z<16;++Z)c[Z][0]=p.getInt32()>>>0,c[Z][1]=p.getInt32()>>>0;for(;Z<80;++Z)le=c[Z-2],ee=le[0],J=le[1],h=((ee>>>19|J<<13)^(J>>>29|ee<<3)^ee>>>6)>>>0,d=((ee<<13|J>>>19)^(J<<3|ee>>>29)^(ee<<26|J>>>6))>>>0,R=c[Z-15],ee=R[0],J=R[1],v=((ee>>>1|J<<31)^(ee>>>8|J<<24)^ee>>>7)>>>0,m=((ee<<31|J>>>1)^(ee<<24|J>>>8)^(ee<<25|J>>>7))>>>0,re=c[Z-7],H=c[Z-16],J=d+re[1]+m+H[1],c[Z][0]=h+re[0]+v+H[0]+(J/4294967296>>>0)>>>0,c[Z][1]=J>>>0;for(g=u[0][0],I=u[0][1],A=u[1][0],_=u[1][1],T=u[2][0],$=u[2][1],B=u[3][0],P=u[3][1],k=u[4][0],O=u[4][1],M=u[5][0],G=u[5][1],W=u[6][0],U=u[6][1],q=u[7][0],Q=u[7][1],Z=0;Z<80;++Z)y=((k>>>14|O<<18)^(k>>>18|O<<14)^(O>>>9|k<<23))>>>0,C=((k<<18|O>>>14)^(k<<14|O>>>18)^(O<<23|k>>>9))>>>0,S=(W^k&(M^W))>>>0,w=(U^O&(G^U))>>>0,b=((g>>>28|I<<4)^(I>>>2|g<<30)^(I>>>7|g<<25))>>>0,f=((g<<4|I>>>28)^(I<<30|g>>>2)^(I<<25|g>>>7))>>>0,E=(g&A|T&(g^A))>>>0,x=(I&_|$&(I^_))>>>0,J=Q+C+w+a[Z][1]+c[Z][1],h=q+y+S+a[Z][0]+c[Z][0]+(J/4294967296>>>0)>>>0,d=J>>>0,J=f+x,v=b+E+(J/4294967296>>>0)>>>0,m=J>>>0,q=W,Q=U,W=M,U=G,M=k,G=O,J=P+d,k=B+h+(J/4294967296>>>0)>>>0,O=J>>>0,B=T,P=$,T=A,$=_,A=g,_=I,J=d+m,g=h+v+(J/4294967296>>>0)>>>0,I=J>>>0;J=u[0][1]+I,u[0][0]=u[0][0]+g+(J/4294967296>>>0)>>>0,u[0][1]=J>>>0,J=u[1][1]+_,u[1][0]=u[1][0]+A+(J/4294967296>>>0)>>>0,u[1][1]=J>>>0,J=u[2][1]+$,u[2][0]=u[2][0]+T+(J/4294967296>>>0)>>>0,u[2][1]=J>>>0,J=u[3][1]+P,u[3][0]=u[3][0]+B+(J/4294967296>>>0)>>>0,u[3][1]=J>>>0,J=u[4][1]+O,u[4][0]=u[4][0]+k+(J/4294967296>>>0)>>>0,u[4][1]=J>>>0,J=u[5][1]+G,u[5][0]=u[5][0]+M+(J/4294967296>>>0)>>>0,u[5][1]=J>>>0,J=u[6][1]+U,u[6][0]=u[6][0]+W+(J/4294967296>>>0)>>>0,u[6][1]=J>>>0,J=u[7][1]+Q,u[7][0]=u[7][0]+q+(J/4294967296>>>0)>>>0,u[7][1]=J>>>0,V-=128}}return qd.exports}var Rl={},Bm;function uD(){if(Bm)return Rl;Bm=1;var e=Le();Wr();var t=e.asn1;return Rl.privateKeyValidator={name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Rl.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]},Rl}var Qd,km;function cD(){if(km)return Qd;km=1;var e=Le();Rc(),Er(),Rx(),Ue();var t=uD(),n=t.publicKeyValidator,r=t.privateKeyValidator;if(typeof i>"u")var i=e.jsbn.BigInteger;var a=e.util.ByteBuffer,o=typeof Buffer>"u"?Uint8Array:Buffer;e.pki=e.pki||{},Qd=e.pki.ed25519=e.ed25519=e.ed25519||{};var s=e.ed25519;s.constants={},s.constants.PUBLIC_KEY_BYTE_LENGTH=32,s.constants.PRIVATE_KEY_BYTE_LENGTH=64,s.constants.SEED_BYTE_LENGTH=32,s.constants.SIGN_BYTE_LENGTH=64,s.constants.HASH_BYTE_LENGTH=64,s.generateKeyPair=function(R){R=R||{};var H=R.seed;if(H===void 0)H=e.random.getBytesSync(s.constants.SEED_BYTE_LENGTH);else if(typeof H=="string"){if(H.length!==s.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+s.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(H instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');H=l({message:H,encoding:"binary"});for(var V=new o(s.constants.PUBLIC_KEY_BYTE_LENGTH),D=new o(s.constants.PRIVATE_KEY_BYTE_LENGTH),L=0;L<32;++L)D[L]=H[L];return y(V,D),{publicKey:V,privateKey:D}},s.privateKeyFromAsn1=function(R){var H={},V=[],D=e.asn1.validate(R,r,H,V);if(!D){var L=new Error("Invalid Key.");throw L.errors=V,L}var K=e.asn1.derToOid(H.privateKeyOid),X=e.oids.EdDSA25519;if(K!==X)throw new Error('Invalid OID "'+K+'"; OID must be "'+X+'".');var se=H.privateKey,ie=l({message:e.asn1.fromDer(se).value,encoding:"binary"});return{privateKeyBytes:ie}},s.publicKeyFromAsn1=function(R){var H={},V=[],D=e.asn1.validate(R,n,H,V);if(!D){var L=new Error("Invalid Key.");throw L.errors=V,L}var K=e.asn1.derToOid(H.publicKeyOid),X=e.oids.EdDSA25519;if(K!==X)throw new Error('Invalid OID "'+K+'"; OID must be "'+X+'".');var se=H.ed25519PublicKey;if(se.length!==s.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return l({message:se,encoding:"binary"})},s.publicKeyFromPrivateKey=function(R){R=R||{};var H=l({message:R.privateKey,encoding:"binary"});if(H.length!==s.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+s.constants.PRIVATE_KEY_BYTE_LENGTH);for(var V=new o(s.constants.PUBLIC_KEY_BYTE_LENGTH),D=0;D<V.length;++D)V[D]=H[32+D];return V},s.sign=function(R){R=R||{};var H=l(R),V=l({message:R.privateKey,encoding:"binary"});if(V.length===s.constants.SEED_BYTE_LENGTH){var D=s.generateKeyPair({seed:V});V=D.privateKey}else if(V.length!==s.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+s.constants.SEED_BYTE_LENGTH+" or "+s.constants.PRIVATE_KEY_BYTE_LENGTH);var L=new o(s.constants.SIGN_BYTE_LENGTH+H.length);C(L,H,H.length,V);for(var K=new o(s.constants.SIGN_BYTE_LENGTH),X=0;X<K.length;++X)K[X]=L[X];return K},s.verify=function(R){R=R||{};var H=l(R);if(R.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var V=l({message:R.signature,encoding:"binary"});if(V.length!==s.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+s.constants.SIGN_BYTE_LENGTH);var D=l({message:R.publicKey,encoding:"binary"});if(D.length!==s.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+s.constants.PUBLIC_KEY_BYTE_LENGTH);var L=new o(s.constants.SIGN_BYTE_LENGTH+H.length),K=new o(s.constants.SIGN_BYTE_LENGTH+H.length),X;for(X=0;X<s.constants.SIGN_BYTE_LENGTH;++X)L[X]=V[X];for(X=0;X<H.length;++X)L[X+s.constants.SIGN_BYTE_LENGTH]=H[X];return S(K,L,L.length,D)>=0};function l(R){var H=R.message;if(H instanceof Uint8Array||H instanceof o)return H;var V=R.encoding;if(H===void 0)if(R.md)H=R.md.digest().getBytes(),V="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof H=="string"&&!V)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof H=="string"){if(typeof Buffer<"u")return Buffer.from(H,V);H=new a(H,V)}else if(!(H instanceof a))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var D=new o(H.length()),L=0;L<D.length;++L)D[L]=H.at(L);return D}var u=Z(),c=Z([1]),p=Z([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=Z([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=Z([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=Z([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=Z([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function f(R,H){var V=e.md.sha512.create(),D=new a(R);V.update(D.getBytes(H),"binary");var L=V.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(L,"binary");for(var K=new o(s.constants.HASH_BYTE_LENGTH),X=0;X<64;++X)K[X]=L.charCodeAt(X);return K}function y(R,H){var V=[Z(),Z(),Z(),Z()],D,L=f(H,32);for(L[0]&=248,L[31]&=127,L[31]|=64,G(V,L),I(R,V),D=0;D<32;++D)H[D+32]=R[D];return 0}function C(R,H,V,D){var L,K,X=new Float64Array(64),se=[Z(),Z(),Z(),Z()],ie=f(D,32);ie[0]&=248,ie[31]&=127,ie[31]|=64;var oe=V+64;for(L=0;L<V;++L)R[64+L]=H[L];for(L=0;L<32;++L)R[32+L]=ie[32+L];var te=f(R.subarray(32),V+32);for(E(te),G(se,te),I(R,se),L=32;L<64;++L)R[L]=D[L];var ue=f(R,V+64);for(E(ue),L=32;L<64;++L)X[L]=0;for(L=0;L<32;++L)X[L]=te[L];for(L=0;L<32;++L)for(K=0;K<32;K++)X[L+K]+=ue[L]*ie[K];return w(R.subarray(32),X),oe}function S(R,H,V,D){var L,K,X=new o(32),se=[Z(),Z(),Z(),Z()],ie=[Z(),Z(),Z(),Z()];if(K=-1,V<64||_(ie,D))return-1;for(L=0;L<V;++L)R[L]=H[L];for(L=0;L<32;++L)R[L+32]=D[L];var oe=f(R,V);if(E(oe),M(se,ie,oe),G(ie,H.subarray(32)),x(se,ie),I(X,se),V-=64,P(H,0,X,0)){for(L=0;L<V;++L)R[L]=0;return-1}for(L=0;L<V;++L)R[L]=H[L+64];return K=V,K}function w(R,H){var V,D,L,K;for(D=63;D>=32;--D){for(V=0,L=D-32,K=D-12;L<K;++L)H[L]+=V-16*H[D]*m[L-(D-32)],V=H[L]+128>>8,H[L]-=V*256;H[L]+=V,H[D]=0}for(V=0,L=0;L<32;++L)H[L]+=V-(H[31]>>4)*m[L],V=H[L]>>8,H[L]&=255;for(L=0;L<32;++L)H[L]-=V*m[L];for(D=0;D<32;++D)H[D+1]+=H[D]>>8,R[D]=H[D]&255}function E(R){for(var H=new Float64Array(64),V=0;V<64;++V)H[V]=R[V],R[V]=0;w(R,H)}function x(R,H){var V=Z(),D=Z(),L=Z(),K=Z(),X=Z(),se=Z(),ie=Z(),oe=Z(),te=Z();J(V,R[1],R[0]),J(te,H[1],H[0]),re(V,V,te),ee(D,R[0],R[1]),ee(te,H[0],H[1]),re(D,D,te),re(L,R[3],H[3]),re(L,L,h),re(K,R[2],H[2]),ee(K,K,K),J(X,D,V),J(se,K,L),ee(ie,K,L),ee(oe,D,V),re(R[0],X,se),re(R[1],oe,ie),re(R[2],ie,se),re(R[3],X,oe)}function g(R,H,V){for(var D=0;D<4;++D)Q(R[D],H[D],V)}function I(R,H){var V=Z(),D=Z(),L=Z();U(L,H[2]),re(V,H[0],L),re(D,H[1],L),A(R,D),R[31]^=O(V)<<7}function A(R,H){var V,D,L,K=Z(),X=Z();for(V=0;V<16;++V)X[V]=H[V];for(q(X),q(X),q(X),D=0;D<2;++D){for(K[0]=X[0]-65517,V=1;V<15;++V)K[V]=X[V]-65535-(K[V-1]>>16&1),K[V-1]&=65535;K[15]=X[15]-32767-(K[14]>>16&1),L=K[15]>>16&1,K[14]&=65535,Q(X,K,1-L)}for(V=0;V<16;V++)R[2*V]=X[V]&255,R[2*V+1]=X[V]>>8}function _(R,H){var V=Z(),D=Z(),L=Z(),K=Z(),X=Z(),se=Z(),ie=Z();return W(R[2],c),T(R[1],H),le(L,R[1]),re(K,L,p),J(L,L,R[2]),ee(K,R[2],K),le(X,K),le(se,X),re(ie,se,X),re(V,ie,L),re(V,V,K),$(V,V),re(V,V,L),re(V,V,K),re(V,V,K),re(R[0],V,K),le(D,R[0]),re(D,D,K),B(D,L)&&re(R[0],R[0],b),le(D,R[0]),re(D,D,K),B(D,L)?-1:(O(R[0])===H[31]>>7&&J(R[0],u,R[0]),re(R[3],R[0],R[1]),0)}function T(R,H){var V;for(V=0;V<16;++V)R[V]=H[2*V]+(H[2*V+1]<<8);R[15]&=32767}function $(R,H){var V=Z(),D;for(D=0;D<16;++D)V[D]=H[D];for(D=250;D>=0;--D)le(V,V),D!==1&&re(V,V,H);for(D=0;D<16;++D)R[D]=V[D]}function B(R,H){var V=new o(32),D=new o(32);return A(V,R),A(D,H),P(V,0,D,0)}function P(R,H,V,D){return k(R,H,V,D,32)}function k(R,H,V,D,L){var K,X=0;for(K=0;K<L;++K)X|=R[H+K]^V[D+K];return(1&X-1>>>8)-1}function O(R){var H=new o(32);return A(H,R),H[0]&1}function M(R,H,V){var D,L;for(W(R[0],u),W(R[1],c),W(R[2],c),W(R[3],u),L=255;L>=0;--L)D=V[L/8|0]>>(L&7)&1,g(R,H,D),x(H,R),x(R,R),g(R,H,D)}function G(R,H){var V=[Z(),Z(),Z(),Z()];W(V[0],d),W(V[1],v),W(V[2],c),re(V[3],d,v),M(R,V,H)}function W(R,H){var V;for(V=0;V<16;V++)R[V]=H[V]|0}function U(R,H){var V=Z(),D;for(D=0;D<16;++D)V[D]=H[D];for(D=253;D>=0;--D)le(V,V),D!==2&&D!==4&&re(V,V,H);for(D=0;D<16;++D)R[D]=V[D]}function q(R){var H,V,D=1;for(H=0;H<16;++H)V=R[H]+D+65535,D=Math.floor(V/65536),R[H]=V-D*65536;R[0]+=D-1+37*(D-1)}function Q(R,H,V){for(var D,L=~(V-1),K=0;K<16;++K)D=L&(R[K]^H[K]),R[K]^=D,H[K]^=D}function Z(R){var H,V=new Float64Array(16);if(R)for(H=0;H<R.length;++H)V[H]=R[H];return V}function ee(R,H,V){for(var D=0;D<16;++D)R[D]=H[D]+V[D]}function J(R,H,V){for(var D=0;D<16;++D)R[D]=H[D]-V[D]}function le(R,H){re(R,H,H)}function re(R,H,V){var D,L,K=0,X=0,se=0,ie=0,oe=0,te=0,ue=0,ve=0,be=0,pe=0,Te=0,Ne=0,We=0,et=0,lt=0,ut=0,xt=0,Dt=0,kt=0,mn=0,vn=0,Pn=0,Gn=0,or=0,Sr=0,Yr=0,Ei=0,ea=0,Ga=0,Uo=0,Sl=0,Vt=V[0],Ht=V[1],jt=V[2],zt=V[3],Gt=V[4],Wt=V[5],Ut=V[6],Xt=V[7],Yt=V[8],Kt=V[9],Zt=V[10],Jt=V[11],Ct=V[12],Pt=V[13],qt=V[14],Qt=V[15];D=H[0],K+=D*Vt,X+=D*Ht,se+=D*jt,ie+=D*zt,oe+=D*Gt,te+=D*Wt,ue+=D*Ut,ve+=D*Xt,be+=D*Yt,pe+=D*Kt,Te+=D*Zt,Ne+=D*Jt,We+=D*Ct,et+=D*Pt,lt+=D*qt,ut+=D*Qt,D=H[1],X+=D*Vt,se+=D*Ht,ie+=D*jt,oe+=D*zt,te+=D*Gt,ue+=D*Wt,ve+=D*Ut,be+=D*Xt,pe+=D*Yt,Te+=D*Kt,Ne+=D*Zt,We+=D*Jt,et+=D*Ct,lt+=D*Pt,ut+=D*qt,xt+=D*Qt,D=H[2],se+=D*Vt,ie+=D*Ht,oe+=D*jt,te+=D*zt,ue+=D*Gt,ve+=D*Wt,be+=D*Ut,pe+=D*Xt,Te+=D*Yt,Ne+=D*Kt,We+=D*Zt,et+=D*Jt,lt+=D*Ct,ut+=D*Pt,xt+=D*qt,Dt+=D*Qt,D=H[3],ie+=D*Vt,oe+=D*Ht,te+=D*jt,ue+=D*zt,ve+=D*Gt,be+=D*Wt,pe+=D*Ut,Te+=D*Xt,Ne+=D*Yt,We+=D*Kt,et+=D*Zt,lt+=D*Jt,ut+=D*Ct,xt+=D*Pt,Dt+=D*qt,kt+=D*Qt,D=H[4],oe+=D*Vt,te+=D*Ht,ue+=D*jt,ve+=D*zt,be+=D*Gt,pe+=D*Wt,Te+=D*Ut,Ne+=D*Xt,We+=D*Yt,et+=D*Kt,lt+=D*Zt,ut+=D*Jt,xt+=D*Ct,Dt+=D*Pt,kt+=D*qt,mn+=D*Qt,D=H[5],te+=D*Vt,ue+=D*Ht,ve+=D*jt,be+=D*zt,pe+=D*Gt,Te+=D*Wt,Ne+=D*Ut,We+=D*Xt,et+=D*Yt,lt+=D*Kt,ut+=D*Zt,xt+=D*Jt,Dt+=D*Ct,kt+=D*Pt,mn+=D*qt,vn+=D*Qt,D=H[6],ue+=D*Vt,ve+=D*Ht,be+=D*jt,pe+=D*zt,Te+=D*Gt,Ne+=D*Wt,We+=D*Ut,et+=D*Xt,lt+=D*Yt,ut+=D*Kt,xt+=D*Zt,Dt+=D*Jt,kt+=D*Ct,mn+=D*Pt,vn+=D*qt,Pn+=D*Qt,D=H[7],ve+=D*Vt,be+=D*Ht,pe+=D*jt,Te+=D*zt,Ne+=D*Gt,We+=D*Wt,et+=D*Ut,lt+=D*Xt,ut+=D*Yt,xt+=D*Kt,Dt+=D*Zt,kt+=D*Jt,mn+=D*Ct,vn+=D*Pt,Pn+=D*qt,Gn+=D*Qt,D=H[8],be+=D*Vt,pe+=D*Ht,Te+=D*jt,Ne+=D*zt,We+=D*Gt,et+=D*Wt,lt+=D*Ut,ut+=D*Xt,xt+=D*Yt,Dt+=D*Kt,kt+=D*Zt,mn+=D*Jt,vn+=D*Ct,Pn+=D*Pt,Gn+=D*qt,or+=D*Qt,D=H[9],pe+=D*Vt,Te+=D*Ht,Ne+=D*jt,We+=D*zt,et+=D*Gt,lt+=D*Wt,ut+=D*Ut,xt+=D*Xt,Dt+=D*Yt,kt+=D*Kt,mn+=D*Zt,vn+=D*Jt,Pn+=D*Ct,Gn+=D*Pt,or+=D*qt,Sr+=D*Qt,D=H[10],Te+=D*Vt,Ne+=D*Ht,We+=D*jt,et+=D*zt,lt+=D*Gt,ut+=D*Wt,xt+=D*Ut,Dt+=D*Xt,kt+=D*Yt,mn+=D*Kt,vn+=D*Zt,Pn+=D*Jt,Gn+=D*Ct,or+=D*Pt,Sr+=D*qt,Yr+=D*Qt,D=H[11],Ne+=D*Vt,We+=D*Ht,et+=D*jt,lt+=D*zt,ut+=D*Gt,xt+=D*Wt,Dt+=D*Ut,kt+=D*Xt,mn+=D*Yt,vn+=D*Kt,Pn+=D*Zt,Gn+=D*Jt,or+=D*Ct,Sr+=D*Pt,Yr+=D*qt,Ei+=D*Qt,D=H[12],We+=D*Vt,et+=D*Ht,lt+=D*jt,ut+=D*zt,xt+=D*Gt,Dt+=D*Wt,kt+=D*Ut,mn+=D*Xt,vn+=D*Yt,Pn+=D*Kt,Gn+=D*Zt,or+=D*Jt,Sr+=D*Ct,Yr+=D*Pt,Ei+=D*qt,ea+=D*Qt,D=H[13],et+=D*Vt,lt+=D*Ht,ut+=D*jt,xt+=D*zt,Dt+=D*Gt,kt+=D*Wt,mn+=D*Ut,vn+=D*Xt,Pn+=D*Yt,Gn+=D*Kt,or+=D*Zt,Sr+=D*Jt,Yr+=D*Ct,Ei+=D*Pt,ea+=D*qt,Ga+=D*Qt,D=H[14],lt+=D*Vt,ut+=D*Ht,xt+=D*jt,Dt+=D*zt,kt+=D*Gt,mn+=D*Wt,vn+=D*Ut,Pn+=D*Xt,Gn+=D*Yt,or+=D*Kt,Sr+=D*Zt,Yr+=D*Jt,Ei+=D*Ct,ea+=D*Pt,Ga+=D*qt,Uo+=D*Qt,D=H[15],ut+=D*Vt,xt+=D*Ht,Dt+=D*jt,kt+=D*zt,mn+=D*Gt,vn+=D*Wt,Pn+=D*Ut,Gn+=D*Xt,or+=D*Yt,Sr+=D*Kt,Yr+=D*Zt,Ei+=D*Jt,ea+=D*Ct,Ga+=D*Pt,Uo+=D*qt,Sl+=D*Qt,K+=38*xt,X+=38*Dt,se+=38*kt,ie+=38*mn,oe+=38*vn,te+=38*Pn,ue+=38*Gn,ve+=38*or,be+=38*Sr,pe+=38*Yr,Te+=38*Ei,Ne+=38*ea,We+=38*Ga,et+=38*Uo,lt+=38*Sl,L=1,D=K+L+65535,L=Math.floor(D/65536),K=D-L*65536,D=X+L+65535,L=Math.floor(D/65536),X=D-L*65536,D=se+L+65535,L=Math.floor(D/65536),se=D-L*65536,D=ie+L+65535,L=Math.floor(D/65536),ie=D-L*65536,D=oe+L+65535,L=Math.floor(D/65536),oe=D-L*65536,D=te+L+65535,L=Math.floor(D/65536),te=D-L*65536,D=ue+L+65535,L=Math.floor(D/65536),ue=D-L*65536,D=ve+L+65535,L=Math.floor(D/65536),ve=D-L*65536,D=be+L+65535,L=Math.floor(D/65536),be=D-L*65536,D=pe+L+65535,L=Math.floor(D/65536),pe=D-L*65536,D=Te+L+65535,L=Math.floor(D/65536),Te=D-L*65536,D=Ne+L+65535,L=Math.floor(D/65536),Ne=D-L*65536,D=We+L+65535,L=Math.floor(D/65536),We=D-L*65536,D=et+L+65535,L=Math.floor(D/65536),et=D-L*65536,D=lt+L+65535,L=Math.floor(D/65536),lt=D-L*65536,D=ut+L+65535,L=Math.floor(D/65536),ut=D-L*65536,K+=L-1+37*(L-1),L=1,D=K+L+65535,L=Math.floor(D/65536),K=D-L*65536,D=X+L+65535,L=Math.floor(D/65536),X=D-L*65536,D=se+L+65535,L=Math.floor(D/65536),se=D-L*65536,D=ie+L+65535,L=Math.floor(D/65536),ie=D-L*65536,D=oe+L+65535,L=Math.floor(D/65536),oe=D-L*65536,D=te+L+65535,L=Math.floor(D/65536),te=D-L*65536,D=ue+L+65535,L=Math.floor(D/65536),ue=D-L*65536,D=ve+L+65535,L=Math.floor(D/65536),ve=D-L*65536,D=be+L+65535,L=Math.floor(D/65536),be=D-L*65536,D=pe+L+65535,L=Math.floor(D/65536),pe=D-L*65536,D=Te+L+65535,L=Math.floor(D/65536),Te=D-L*65536,D=Ne+L+65535,L=Math.floor(D/65536),Ne=D-L*65536,D=We+L+65535,L=Math.floor(D/65536),We=D-L*65536,D=et+L+65535,L=Math.floor(D/65536),et=D-L*65536,D=lt+L+65535,L=Math.floor(D/65536),lt=D-L*65536,D=ut+L+65535,L=Math.floor(D/65536),ut=D-L*65536,K+=L-1+37*(L-1),R[0]=K,R[1]=X,R[2]=se,R[3]=ie,R[4]=oe,R[5]=te,R[6]=ue,R[7]=ve,R[8]=be,R[9]=pe,R[10]=Te,R[11]=Ne,R[12]=We,R[13]=et,R[14]=lt,R[15]=ut}return Qd}var ef,Pm;function dD(){if(Pm)return ef;Pm=1;var e=Le();Ue(),Er(),Rc(),ef=e.kem=e.kem||{};var t=e.jsbn.BigInteger;e.kem.rsa={},e.kem.rsa.create=function(r,i){i=i||{};var a=i.prng||e.random,o={};return o.encrypt=function(s,l){var u=Math.ceil(s.n.bitLength()/8),c;do c=new t(e.util.bytesToHex(a.getBytesSync(u)),16).mod(s.n);while(c.compareTo(t.ONE)<=0);c=e.util.hexToBytes(c.toString(16));var p=u-c.length;p>0&&(c=e.util.fillString("\0",p)+c);var h=s.encrypt(c,"NONE"),d=r.generate(c,l);return{encapsulation:h,key:d}},o.decrypt=function(s,l,u){var c=s.decrypt(l,"NONE");return r.generate(c,u)},o},e.kem.kdf1=function(r,i){n(this,r,0,i||r.digestLength)},e.kem.kdf2=function(r,i){n(this,r,1,i||r.digestLength)};function n(r,i,a,o){r.generate=function(s,l){for(var u=new e.util.ByteBuffer,c=Math.ceil(l/o)+a,p=new e.util.ByteBuffer,h=a;h<c;++h){p.putInt32(h),i.start(),i.update(s+p.getBytes());var d=i.digest();u.putBytes(d.getBytes(o))}return u.truncate(u.length()-l),u.getBytes()}}return ef}var tf,$m;function fD(){if($m)return tf;$m=1;var e=Le();Ue(),tf=e.log=e.log||{},e.log.levels=["none","error","warning","info","debug","verbose","max"];var t={},n=[],r=null;e.log.LEVEL_LOCKED=2,e.log.NO_LEVEL_CHECK=4,e.log.INTERPOLATE=8;for(var i=0;i<e.log.levels.length;++i){var a=e.log.levels[i];t[a]={index:i,name:a.toUpperCase()}}e.log.logMessage=function(h){for(var d=t[h.level].index,v=0;v<n.length;++v){var m=n[v];if(m.flags&e.log.NO_LEVEL_CHECK)m.f(h);else{var b=t[m.level].index;d<=b&&m.f(m,h)}}},e.log.prepareStandard=function(h){"standard"in h||(h.standard=t[h.level].name+" ["+h.category+"] "+h.message)},e.log.prepareFull=function(h){if(!("full"in h)){var d=[h.message];d=d.concat([]),h.full=e.util.format.apply(this,d)}},e.log.prepareStandardFull=function(h){"standardFull"in h||(e.log.prepareStandard(h),h.standardFull=h.standard)};for(var o=["error","warning","info","debug","verbose"],i=0;i<o.length;++i)(function(d){e.log[d]=function(v,m){var b=Array.prototype.slice.call(arguments).slice(2),f={timestamp:new Date,level:d,category:v,message:m,arguments:b};e.log.logMessage(f)}})(o[i]);if(e.log.makeLogger=function(h){var d={flags:0,f:h};return e.log.setLevel(d,"none"),d},e.log.setLevel=function(h,d){var v=!1;if(h&&!(h.flags&e.log.LEVEL_LOCKED))for(var m=0;m<e.log.levels.length;++m){var b=e.log.levels[m];if(d==b){h.level=d,v=!0;break}}return v},e.log.lock=function(h,d){typeof d>"u"||d?h.flags|=e.log.LEVEL_LOCKED:h.flags&=~e.log.LEVEL_LOCKED},e.log.addLogger=function(h){n.push(h)},typeof console<"u"&&"log"in console){var s;if(console.error&&console.warn&&console.info&&console.debug){var l={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},u=function(h,d){e.log.prepareStandard(d);var v=l[d.level],m=[d.standard];m=m.concat(d.arguments.slice()),v.apply(console,m)};s=e.log.makeLogger(u)}else{var u=function(d,v){e.log.prepareStandardFull(v),console.log(v.standardFull)};s=e.log.makeLogger(u)}e.log.setLevel(s,"debug"),e.log.addLogger(s),r=s}else console={log:function(){}};if(r!==null&&typeof window<"u"&&window.location){var c=new URL(window.location.href).searchParams;if(c.has("console.level")&&e.log.setLevel(r,c.get("console.level").slice(-1)[0]),c.has("console.lock")){var p=c.get("console.lock").slice(-1)[0];p=="true"&&e.log.lock(r)}}return e.log.consoleLogger=r,tf}var nf,Fm;function hD(){return Fm||(Fm=1,nf=mi(),V0(),il(),yx(),Rx()),nf}var rf={exports:{}},Nm;function gD(){if(Nm)return rf.exports;Nm=1;var e=Le();Ma(),Wr(),Ac(),Oa(),Oo(),Ix(),Er(),Ue(),G0();var t=e.asn1,n=rf.exports=e.pkcs7=e.pkcs7||{};n.messageFromPem=function(d){var v=e.pem.decode(d)[0];if(v.type!=="PKCS7"){var m=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw m.headerType=v.type,m}if(v.procType&&v.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var b=t.fromDer(v.body);return n.messageFromAsn1(b)},n.messageToPem=function(d,v){var m={type:"PKCS7",body:t.toDer(d.toAsn1()).getBytes()};return e.pem.encode(m,{maxline:v})},n.messageFromAsn1=function(d){var v={},m=[];if(!t.validate(d,n.asn1.contentInfoValidator,v,m)){var b=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw b.errors=m,b}var f=t.derToOid(v.contentType),y;switch(f){case e.pki.oids.envelopedData:y=n.createEnvelopedData();break;case e.pki.oids.encryptedData:y=n.createEncryptedData();break;case e.pki.oids.signedData:y=n.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+f+" is not (yet) supported.")}return y.fromAsn1(v.content.value[0]),y},n.createSignedData=function(){var d=null;return d={type:e.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(b){if(p(d,b,n.asn1.signedDataValidator),d.certificates=[],d.crls=[],d.digestAlgorithmIdentifiers=[],d.contentInfo=null,d.signerInfos=[],d.rawCapture.certificates)for(var f=d.rawCapture.certificates.value,y=0;y<f.length;++y)d.certificates.push(e.pki.certificateFromAsn1(f[y]))},toAsn1:function(){d.contentInfo||d.sign();for(var b=[],f=0;f<d.certificates.length;++f)b.push(e.pki.certificateToAsn1(d.certificates[f]));var y=[],C=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d.digestAlgorithmIdentifiers),d.contentInfo])]);return b.length>0&&C.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,b)),y.length>0&&C.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,y)),C.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),C])},addSigner:function(b){var f=b.issuer,y=b.serialNumber;if(b.certificate){var C=b.certificate;typeof C=="string"&&(C=e.pki.certificateFromPem(C)),f=C.issuer.attributes,y=C.serialNumber}var S=b.key;if(!S)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof S=="string"&&(S=e.pki.privateKeyFromPem(S));var w=b.digestAlgorithm||e.pki.oids.sha1;switch(w){case e.pki.oids.sha1:case e.pki.oids.sha256:case e.pki.oids.sha384:case e.pki.oids.sha512:case e.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+w)}var E=b.authenticatedAttributes||[];if(E.length>0){for(var x=!1,g=!1,I=0;I<E.length;++I){var A=E[I];if(!x&&A.type===e.pki.oids.contentType){if(x=!0,g)break;continue}if(!g&&A.type===e.pki.oids.messageDigest){if(g=!0,x)break;continue}}if(!x||!g)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}d.signers.push({key:S,version:1,issuer:f,serialNumber:y,digestAlgorithm:w,signatureAlgorithm:e.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:E,unauthenticatedAttributes:[]})},sign:function(b){if(b=b||{},(typeof d.content!="object"||d.contentInfo===null)&&(d.contentInfo=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.pki.oids.data).getBytes())]),"content"in d)){var f;d.content instanceof e.util.ByteBuffer?f=d.content.bytes():typeof d.content=="string"&&(f=e.util.encodeUtf8(d.content)),b.detached?d.detachedContent=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,f):d.contentInfo.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,f)]))}if(d.signers.length!==0){var y=v();m(y)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(b){typeof b=="string"&&(b=e.pki.certificateFromPem(b)),d.certificates.push(b)},addCertificateRevokationList:function(b){throw new Error("PKCS#7 CRL support not yet implemented.")}},d;function v(){for(var b={},f=0;f<d.signers.length;++f){var y=d.signers[f],C=y.digestAlgorithm;C in b||(b[C]=e.md[e.pki.oids[C]].create()),y.authenticatedAttributes.length===0?y.md=b[C]:y.md=e.md[e.pki.oids[C]].create()}d.digestAlgorithmIdentifiers=[];for(var C in b)d.digestAlgorithmIdentifiers.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(C).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]));return b}function m(b){var f;if(d.detachedContent?f=d.detachedContent:(f=d.contentInfo.value[1],f=f.value[0]),!f)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var y=t.derToOid(d.contentInfo.value[0].value),C=t.toDer(f);C.getByte(),t.getBerValueLength(C),C=C.getBytes();for(var S in b)b[S].start().update(C);for(var w=new Date,E=0;E<d.signers.length;++E){var x=d.signers[E];if(x.authenticatedAttributes.length===0){if(y!==e.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{x.authenticatedAttributesAsn1=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var g=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[]),I=0;I<x.authenticatedAttributes.length;++I){var A=x.authenticatedAttributes[I];A.type===e.pki.oids.messageDigest?A.value=b[x.digestAlgorithm].digest():A.type===e.pki.oids.signingTime&&(A.value||(A.value=w)),g.value.push(u(A)),x.authenticatedAttributesAsn1.value.push(u(A))}C=t.toDer(g).getBytes(),x.md.start().update(C)}x.signature=x.key.sign(x.md,"RSASSA-PKCS1-V1_5")}d.signerInfos=l(d.signers)}},n.createEncryptedData=function(){var d=null;return d={type:e.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:e.pki.oids["aes256-CBC"]},fromAsn1:function(v){p(d,v,n.asn1.encryptedDataValidator)},decrypt:function(v){v!==void 0&&(d.encryptedContent.key=v),h(d)}},d},n.createEnvelopedData=function(){var d=null;return d={type:e.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:e.pki.oids["aes256-CBC"]},fromAsn1:function(v){var m=p(d,v,n.asn1.envelopedDataValidator);d.recipients=a(m.recipientInfos.value)},toAsn1:function(){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,o(d.recipients)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,c(d.encryptedContent))])])])},findRecipient:function(v){for(var m=v.issuer.attributes,b=0;b<d.recipients.length;++b){var f=d.recipients[b],y=f.issuer;if(f.serialNumber===v.serialNumber&&y.length===m.length){for(var C=!0,S=0;S<m.length;++S)if(y[S].type!==m[S].type||y[S].value!==m[S].value){C=!1;break}if(C)return f}}return null},decrypt:function(v,m){if(d.encryptedContent.key===void 0&&v!==void 0&&m!==void 0)switch(v.encryptedContent.algorithm){case e.pki.oids.rsaEncryption:case e.pki.oids.desCBC:var b=m.decrypt(v.encryptedContent.content);d.encryptedContent.key=e.util.createBuffer(b);break;default:throw new Error("Unsupported asymmetric cipher, OID "+v.encryptedContent.algorithm)}h(d)},addRecipient:function(v){d.recipients.push({version:0,issuer:v.issuer.attributes,serialNumber:v.serialNumber,encryptedContent:{algorithm:e.pki.oids.rsaEncryption,key:v.publicKey}})},encrypt:function(v,m){if(d.encryptedContent.content===void 0){m=m||d.encryptedContent.algorithm,v=v||d.encryptedContent.key;var b,f,y;switch(m){case e.pki.oids["aes128-CBC"]:b=16,f=16,y=e.aes.createEncryptionCipher;break;case e.pki.oids["aes192-CBC"]:b=24,f=16,y=e.aes.createEncryptionCipher;break;case e.pki.oids["aes256-CBC"]:b=32,f=16,y=e.aes.createEncryptionCipher;break;case e.pki.oids["des-EDE3-CBC"]:b=24,f=8,y=e.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+m)}if(v===void 0)v=e.util.createBuffer(e.random.getBytes(b));else if(v.length()!=b)throw new Error("Symmetric key has wrong length; got "+v.length()+" bytes, expected "+b+".");d.encryptedContent.algorithm=m,d.encryptedContent.key=v,d.encryptedContent.parameter=e.util.createBuffer(e.random.getBytes(f));var C=y(v);if(C.start(d.encryptedContent.parameter.copy()),C.update(d.content),!C.finish())throw new Error("Symmetric encryption failed.");d.encryptedContent.content=C.output}for(var S=0;S<d.recipients.length;++S){var w=d.recipients[S];if(w.encryptedContent.content===void 0)switch(w.encryptedContent.algorithm){case e.pki.oids.rsaEncryption:w.encryptedContent.content=w.encryptedContent.key.encrypt(d.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+w.encryptedContent.algorithm)}}}},d};function r(d){var v={},m=[];if(!t.validate(d,n.asn1.recipientInfoValidator,v,m)){var b=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw b.errors=m,b}return{version:v.version.charCodeAt(0),issuer:e.pki.RDNAttributesAsArray(v.issuer),serialNumber:e.util.createBuffer(v.serial).toHex(),encryptedContent:{algorithm:t.derToOid(v.encAlgorithm),parameter:v.encParameter?v.encParameter.value:void 0,content:v.encKey}}}function i(d){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[e.pki.distinguishedNameToAsn1({attributes:d.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(d.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.encryptedContent.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.encryptedContent.content)])}function a(d){for(var v=[],m=0;m<d.length;++m)v.push(r(d[m]));return v}function o(d){for(var v=[],m=0;m<d.length;++m)v.push(i(d[m]));return v}function s(d){var v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[e.pki.distinguishedNameToAsn1({attributes:d.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(d.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.digestAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])]);if(d.authenticatedAttributesAsn1&&v.value.push(d.authenticatedAttributesAsn1),v.value.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.signatureAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])),v.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.signature)),d.unauthenticatedAttributes.length>0){for(var m=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),b=0;b<d.unauthenticatedAttributes.length;++b){var f=d.unauthenticatedAttributes[b];m.values.push(u(f))}v.value.push(m)}return v}function l(d){for(var v=[],m=0;m<d.length;++m)v.push(s(d[m]));return v}function u(d){var v;if(d.type===e.pki.oids.contentType)v=t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.value).getBytes());else if(d.type===e.pki.oids.messageDigest)v=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.value.bytes());else if(d.type===e.pki.oids.signingTime){var m=new Date("1950-01-01T00:00:00Z"),b=new Date("2050-01-01T00:00:00Z"),f=d.value;if(typeof f=="string"){var y=Date.parse(f);isNaN(y)?f.length===13?f=t.utcTimeToDate(f):f=t.generalizedTimeToDate(f):f=new Date(y)}f>=m&&f<b?v=t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(f)):v=t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(f))}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[v])])}function c(d){return[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.pki.oids.data).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.algorithm).getBytes()),d.parameter?t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.parameter.getBytes()):void 0]),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.content.getBytes())])]}function p(d,v,m){var b={},f=[];if(!t.validate(v,m,b,f)){var y=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw y.errors=y,y}var C=t.derToOid(b.contentType);if(C!==e.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(b.encryptedContent){var S="";if(e.util.isArray(b.encryptedContent))for(var w=0;w<b.encryptedContent.length;++w){if(b.encryptedContent[w].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");S+=b.encryptedContent[w].value}else S=b.encryptedContent;d.encryptedContent={algorithm:t.derToOid(b.encAlgorithm),parameter:e.util.createBuffer(b.encParameter.value),content:e.util.createBuffer(S)}}if(b.content){var S="";if(e.util.isArray(b.content))for(var w=0;w<b.content.length;++w){if(b.content[w].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");S+=b.content[w].value}else S=b.content;d.content=e.util.createBuffer(S)}return d.version=b.version.charCodeAt(0),d.rawCapture=b,b}function h(d){if(d.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(d.content===void 0){var v;switch(d.encryptedContent.algorithm){case e.pki.oids["aes128-CBC"]:case e.pki.oids["aes192-CBC"]:case e.pki.oids["aes256-CBC"]:v=e.aes.createDecryptionCipher(d.encryptedContent.key);break;case e.pki.oids.desCBC:case e.pki.oids["des-EDE3-CBC"]:v=e.des.createDecryptionCipher(d.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+d.encryptedContent.algorithm)}if(v.start(d.encryptedContent.parameter),v.update(d.encryptedContent.content),!v.finish())throw new Error("Symmetric decryption failed.");d.content=v.output}}return rf.exports}var af={exports:{}},Mm;function pD(){if(Mm)return af.exports;Mm=1;var e=Le();Ma(),rl(),V0(),il(),Ue();var t=af.exports=e.ssh=e.ssh||{};t.privateKeyToPutty=function(a,o,s){s=s||"",o=o||"";var l="ssh-rsa",u=o===""?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: "+l+`\r
14
+ `+p+a.substr(c+1),u=l-c-1,c=-1,++l}else(a[l]===" "||a[l]===" "||a[l]===",")&&(c=l);return a}function r(i){return i.replace(/^\s+/,"")}return Pd.exports}var $d={exports:{}},Fd,um;function Ac(){if(um)return Fd;um=1;var e=Le();L0(),bx(),Xe(),Fd=e.des=e.des||{},e.des.startEncrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!1,mode:b||(v===null?"ECB":"CBC")});return f.start(v),f},e.des.createEncryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!1,mode:v})},e.des.startDecrypting=function(d,v,m,b){var f=h({key:d,output:m,decrypt:!0,mode:b||(v===null?"ECB":"CBC")});return f.start(v),f},e.des.createDecryptionCipher=function(d,v){return h({key:d,output:null,decrypt:!0,mode:v})},e.des.Algorithm=function(d,v){var m=this;m.name=d,m.mode=new v({blockSize:8,cipher:{encrypt:function(b,f){return p(m._keys,b,f,!1)},decrypt:function(b,f){return p(m._keys,b,f,!0)}}}),m._init=!1},e.des.Algorithm.prototype.initialize=function(d){if(!this._init){var v=e.util.createBuffer(d.key);if(this.name.indexOf("3DES")===0&&v.length()!==24)throw new Error("Invalid Triple-DES key size: "+v.length()*8);this._keys=c(v),this._init=!0}},t("DES-ECB",e.cipher.modes.ecb),t("DES-CBC",e.cipher.modes.cbc),t("DES-CFB",e.cipher.modes.cfb),t("DES-OFB",e.cipher.modes.ofb),t("DES-CTR",e.cipher.modes.ctr),t("3DES-ECB",e.cipher.modes.ecb),t("3DES-CBC",e.cipher.modes.cbc),t("3DES-CFB",e.cipher.modes.cfb),t("3DES-OFB",e.cipher.modes.ofb),t("3DES-CTR",e.cipher.modes.ctr);function t(d,v){var m=function(){return new e.des.Algorithm(d,v)};e.cipher.registerAlgorithm(d,m)}var n=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],r=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],i=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],a=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],o=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],s=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],u=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function c(d){for(var v=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],m=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],b=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],f=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],y=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],C=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],S=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],w=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],E=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],x=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],g=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],I=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],A=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],_=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],T=d.length()>8?3:1,$=[],B=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],P=0,k,O=0;O<T;O++){var M=d.getInt32(),G=d.getInt32();k=(M>>>4^G)&252645135,G^=k,M^=k<<4,k=(G>>>-16^M)&65535,M^=k,G^=k<<-16,k=(M>>>2^G)&858993459,G^=k,M^=k<<2,k=(G>>>-16^M)&65535,M^=k,G^=k<<-16,k=(M>>>1^G)&1431655765,G^=k,M^=k<<1,k=(G>>>8^M)&16711935,M^=k,G^=k<<8,k=(M>>>1^G)&1431655765,G^=k,M^=k<<1,k=M<<8|G>>>20&240,M=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=k;for(var W=0;W<B.length;++W){B[W]?(M=M<<2|M>>>26,G=G<<2|G>>>26):(M=M<<1|M>>>27,G=G<<1|G>>>27),M&=-15,G&=-15;var U=v[M>>>28]|m[M>>>24&15]|b[M>>>20&15]|f[M>>>16&15]|y[M>>>12&15]|C[M>>>8&15]|S[M>>>4&15],q=w[G>>>28]|E[G>>>24&15]|x[G>>>20&15]|g[G>>>16&15]|I[G>>>12&15]|A[G>>>8&15]|_[G>>>4&15];k=(q>>>16^U)&65535,$[P++]=U^k,$[P++]=q^k<<16}}return $}function p(d,v,m,b){var f=d.length===32?3:9,y;f===3?y=b?[30,-2,-2]:[0,32,2]:y=b?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var C,S=v[0],w=v[1];C=(S>>>4^w)&252645135,w^=C,S^=C<<4,C=(S>>>16^w)&65535,w^=C,S^=C<<16,C=(w>>>2^S)&858993459,S^=C,w^=C<<2,C=(w>>>8^S)&16711935,S^=C,w^=C<<8,C=(S>>>1^w)&1431655765,w^=C,S^=C<<1,S=S<<1|S>>>31,w=w<<1|w>>>31;for(var E=0;E<f;E+=3){for(var x=y[E+1],g=y[E+2],I=y[E];I!=x;I+=g){var A=w^d[I],_=(w>>>4|w<<28)^d[I+1];C=S,S=w,w=C^(r[A>>>24&63]|a[A>>>16&63]|s[A>>>8&63]|u[A&63]|n[_>>>24&63]|i[_>>>16&63]|o[_>>>8&63]|l[_&63])}C=S,S=w,w=C}S=S>>>1|S<<31,w=w>>>1|w<<31,C=(S>>>1^w)&1431655765,w^=C,S^=C<<1,C=(w>>>8^S)&16711935,S^=C,w^=C<<8,C=(w>>>2^S)&858993459,S^=C,w^=C<<2,C=(S>>>16^w)&65535,w^=C,S^=C<<16,C=(S>>>4^w)&252645135,w^=C,S^=C<<4,m[0]=S,m[1]=w}function h(d){d=d||{};var v=(d.mode||"CBC").toUpperCase(),m="DES-"+v,b;d.decrypt?b=e.cipher.createDecipher(m,d.key):b=e.cipher.createCipher(m,d.key);var f=b.start;return b.start=function(y,C){var S=null;C instanceof e.util.ByteBuffer&&(S=C,C={}),C=C||{},C.output=S,C.iv=y,f.call(b,C)},b}return Fd}const aD={},oD=Object.freeze(Object.defineProperty({__proto__:null,default:aD},Symbol.toStringTag,{value:"Module"})),H0=rD(oD);var Nd,cm;function j0(){if(cm)return Nd;cm=1;var e=Le();rl(),mi(),Xe();var t=e.pkcs5=e.pkcs5||{},n;return e.util.isNodejs&&!e.options.usePureJavaScript&&(n=H0),Nd=e.pbkdf2=t.pbkdf2=function(r,i,a,o,s,l){if(typeof s=="function"&&(l=s,s=null),e.util.isNodejs&&!e.options.usePureJavaScript&&n.pbkdf2&&(s===null||typeof s!="object")&&(n.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),i=Buffer.from(i,"binary"),l?n.pbkdf2Sync.length===4?n.pbkdf2(r,i,a,o,function(E,x){if(E)return l(E);l(null,x.toString("binary"))}):n.pbkdf2(r,i,a,o,s,function(E,x){if(E)return l(E);l(null,x.toString("binary"))}):n.pbkdf2Sync.length===4?n.pbkdf2Sync(r,i,a,o).toString("binary"):n.pbkdf2Sync(r,i,a,o,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in e.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=e.md[s].create()}var u=s.digestLength;if(o>4294967295*u){var c=new Error("Derived key is too long.");if(l)return l(c);throw c}var p=Math.ceil(o/u),h=o-(p-1)*u,d=e.hmac.create();d.start(s,r);var v="",m,b,f;if(!l){for(var y=1;y<=p;++y){d.start(null,null),d.update(i),d.update(e.util.int32ToBytes(y)),m=f=d.digest().getBytes();for(var C=2;C<=a;++C)d.start(null,null),d.update(f),b=d.digest().getBytes(),m=e.util.xorBytes(m,b,u),f=b;v+=y<p?m:m.substr(0,h)}return v}var y=1,C;function S(){if(y>p)return l(null,v);d.start(null,null),d.update(i),d.update(e.util.int32ToBytes(y)),m=f=d.digest().getBytes(),C=2,w()}function w(){if(C<=a)return d.start(null,null),d.update(f),b=d.digest().getBytes(),m=e.util.xorBytes(m,b,u),f=b,++C,e.util.setImmediate(w);v+=y<p?m:m.substr(0,h),++y,S()}S()},Nd}var Tl={exports:{}},Md={exports:{}},dm;function yx(){if(dm)return Md.exports;dm=1;var e=Le();mi(),Xe();var t=Md.exports=e.sha256=e.sha256||{};e.md.sha256=e.md.algorithms.sha256=t,t.create=function(){r||a();var s=null,l=e.util.createBuffer(),u=new Array(64),c={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return c.start=function(){c.messageLength=0,c.fullMessageLength=c.messageLength64=[];for(var p=c.messageLengthSize/4,h=0;h<p;++h)c.fullMessageLength.push(0);return l=e.util.createBuffer(),s={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},c},c.start(),c.update=function(p,h){h==="utf8"&&(p=e.util.encodeUtf8(p));var d=p.length;c.messageLength+=d,d=[d/4294967296>>>0,d>>>0];for(var v=c.fullMessageLength.length-1;v>=0;--v)c.fullMessageLength[v]+=d[1],d[1]=d[0]+(c.fullMessageLength[v]/4294967296>>>0),c.fullMessageLength[v]=c.fullMessageLength[v]>>>0,d[0]=d[1]/4294967296>>>0;return l.putBytes(p),o(s,u,l),(l.read>2048||l.length()===0)&&l.compact(),c},c.digest=function(){var p=e.util.createBuffer();p.putBytes(l.bytes());var h=c.fullMessageLength[c.fullMessageLength.length-1]+c.messageLengthSize,d=h&c.blockLength-1;p.putBytes(n.substr(0,c.blockLength-d));for(var v,m,b=c.fullMessageLength[0]*8,f=0;f<c.fullMessageLength.length-1;++f)v=c.fullMessageLength[f+1]*8,m=v/4294967296>>>0,b+=m,p.putInt32(b>>>0),b=v>>>0;p.putInt32(b);var y={h0:s.h0,h1:s.h1,h2:s.h2,h3:s.h3,h4:s.h4,h5:s.h5,h6:s.h6,h7:s.h7};o(y,u,p);var C=e.util.createBuffer();return C.putInt32(y.h0),C.putInt32(y.h1),C.putInt32(y.h2),C.putInt32(y.h3),C.putInt32(y.h4),C.putInt32(y.h5),C.putInt32(y.h6),C.putInt32(y.h7),C},c};var n=null,r=!1,i=null;function a(){n="€",n+=e.util.fillString("\0",64),i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=!0}function o(s,l,u){for(var c,p,h,d,v,m,b,f,y,C,S,w,E,x,g,I=u.length();I>=64;){for(b=0;b<16;++b)l[b]=u.getInt32();for(;b<64;++b)c=l[b-2],c=(c>>>17|c<<15)^(c>>>19|c<<13)^c>>>10,p=l[b-15],p=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,l[b]=c+l[b-7]+p+l[b-16]|0;for(f=s.h0,y=s.h1,C=s.h2,S=s.h3,w=s.h4,E=s.h5,x=s.h6,g=s.h7,b=0;b<64;++b)d=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),v=x^w&(E^x),h=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),m=f&y|C&(f^y),c=g+d+v+i[b]+l[b],p=h+m,g=x,x=E,E=w,w=S+c>>>0,S=C,C=y,y=f,f=c+p>>>0;s.h0=s.h0+f|0,s.h1=s.h1+y|0,s.h2=s.h2+C|0,s.h3=s.h3+S|0,s.h4=s.h4+w|0,s.h5=s.h5+E|0,s.h6=s.h6+x|0,s.h7=s.h7+g|0,I-=64}}return Md.exports}var Od={exports:{}},fm;function xx(){if(fm)return Od.exports;fm=1;var e=Le();Xe();var t=null;e.util.isNodejs&&!e.options.usePureJavaScript&&!process.versions["node-webkit"]&&(t=H0);var n=Od.exports=e.prng=e.prng||{};return n.create=function(r){for(var i={plugin:r,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},a=r.md,o=new Array(32),s=0;s<32;++s)o[s]=a.create();i.pools=o,i.pool=0,i.generate=function(h,d){if(!d)return i.generateSync(h);var v=i.plugin.cipher,m=i.plugin.increment,b=i.plugin.formatKey,f=i.plugin.formatSeed,y=e.util.createBuffer();i.key=null,C();function C(S){if(S)return d(S);if(y.length()>=h)return d(null,y.getBytes(h));if(i.generated>1048575&&(i.key=null),i.key===null)return e.util.nextTick(function(){l(C)});var w=v(i.key,i.seed);i.generated+=w.length,y.putBytes(w),i.key=b(v(i.key,m(i.seed))),i.seed=f(v(i.key,i.seed)),e.util.setImmediate(C)}},i.generateSync=function(h){var d=i.plugin.cipher,v=i.plugin.increment,m=i.plugin.formatKey,b=i.plugin.formatSeed;i.key=null;for(var f=e.util.createBuffer();f.length()<h;){i.generated>1048575&&(i.key=null),i.key===null&&u();var y=d(i.key,i.seed);i.generated+=y.length,f.putBytes(y),i.key=m(d(i.key,v(i.seed))),i.seed=b(d(i.key,i.seed))}return f.getBytes(h)};function l(h){if(i.pools[0].messageLength>=32)return c(),h();var d=32-i.pools[0].messageLength<<5;i.seedFile(d,function(v,m){if(v)return h(v);i.collect(m),c(),h()})}function u(){if(i.pools[0].messageLength>=32)return c();var h=32-i.pools[0].messageLength<<5;i.collect(i.seedFileSync(h)),c()}function c(){i.reseeds=i.reseeds===4294967295?0:i.reseeds+1;var h=i.plugin.md.create();h.update(i.keyBytes);for(var d=1,v=0;v<32;++v)i.reseeds%d===0&&(h.update(i.pools[v].digest().getBytes()),i.pools[v].start()),d=d<<1;i.keyBytes=h.digest().getBytes(),h.start(),h.update(i.keyBytes);var m=h.digest().getBytes();i.key=i.plugin.formatKey(i.keyBytes),i.seed=i.plugin.formatSeed(m),i.generated=0}function p(h){var d=null,v=e.util.globalScope,m=v.crypto||v.msCrypto;m&&m.getRandomValues&&(d=function(g){return m.getRandomValues(g)});var b=e.util.createBuffer();if(d)for(;b.length()<h;){var f=Math.max(1,Math.min(h-b.length(),65536)/4),y=new Uint32Array(Math.floor(f));try{d(y);for(var C=0;C<y.length;++C)b.putInt32(y[C])}catch(g){if(!(typeof QuotaExceededError<"u"&&g instanceof QuotaExceededError))throw g}}if(b.length()<h)for(var S,w,E,x=Math.floor(Math.random()*65536);b.length()<h;){w=16807*(x&65535),S=16807*(x>>16),w+=(S&32767)<<16,w+=S>>15,w=(w&2147483647)+(w>>31),x=w&4294967295;for(var C=0;C<3;++C)E=x>>>(C<<3),E^=Math.floor(Math.random()*256),b.putByte(E&255)}return b.getBytes(h)}return t?(i.seedFile=function(h,d){t.randomBytes(h,function(v,m){if(v)return d(v);d(null,m.toString())})},i.seedFileSync=function(h){return t.randomBytes(h).toString()}):(i.seedFile=function(h,d){try{d(null,p(h))}catch(v){d(v)}},i.seedFileSync=p),i.collect=function(h){for(var d=h.length,v=0;v<d;++v)i.pools[i.pool].update(h.substr(v,1)),i.pool=i.pool===31?0:i.pool+1},i.collectInt=function(h,d){for(var v="",m=0;m<d;m+=8)v+=String.fromCharCode(h>>m&255);i.collect(v)},i.registerWorker=function(h){if(h===self)i.seedFile=function(v,m){function b(f){var y=f.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",b),m(y.forge.prng.err,y.forge.prng.bytes))}self.addEventListener("message",b),self.postMessage({forge:{prng:{needed:v}}})};else{var d=function(v){var m=v.data;m.forge&&m.forge.prng&&i.seedFile(m.forge.prng.needed,function(b,f){h.postMessage({forge:{prng:{err:b,bytes:f}}})})};h.addEventListener("message",d)}},i},Od.exports}var hm;function Er(){if(hm)return Tl.exports;hm=1;var e=Le();return Ma(),yx(),xx(),Xe(),function(){if(e.random&&e.random.getBytes){Tl.exports=e.random;return}(function(t){var n={},r=new Array(4),i=e.util.createBuffer();n.formatKey=function(h){var d=e.util.createBuffer(h);return h=new Array(4),h[0]=d.getInt32(),h[1]=d.getInt32(),h[2]=d.getInt32(),h[3]=d.getInt32(),e.aes._expandKey(h,!1)},n.formatSeed=function(h){var d=e.util.createBuffer(h);return h=new Array(4),h[0]=d.getInt32(),h[1]=d.getInt32(),h[2]=d.getInt32(),h[3]=d.getInt32(),h},n.cipher=function(h,d){return e.aes._updateBlock(h,d,r,!1),i.putInt32(r[0]),i.putInt32(r[1]),i.putInt32(r[2]),i.putInt32(r[3]),i.getBytes()},n.increment=function(h){return++h[3],h},n.md=e.md.sha256;function a(){var h=e.prng.create(n);return h.getBytes=function(d,v){return h.generate(d,v)},h.getBytesSync=function(d){return h.generate(d)},h}var o=a(),s=null,l=e.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(s=function(h){return u.getRandomValues(h)}),e.options.usePureJavaScript||!e.util.isNodejs&&!s){if(o.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var p in navigator)try{typeof navigator[p]=="string"&&(c+=navigator[p])}catch{}o.collect(c),c=null}t&&(t().mousemove(function(h){o.collectInt(h.clientX,16),o.collectInt(h.clientY,16)}),t().keypress(function(h){o.collectInt(h.charCode,8)}))}if(!e.random)e.random=o;else for(var p in o)e.random[p]=o[p];e.random.createInstance=a,Tl.exports=e.random})(typeof jQuery<"u"?jQuery:null)}(),Tl.exports}var Ld,gm;function Cx(){if(gm)return Ld;gm=1;var e=Le();Xe();var t=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],n=[1,2,3,5],r=function(o,s){return o<<s&65535|(o&65535)>>16-s},i=function(o,s){return(o&65535)>>s|o<<16-s&65535};Ld=e.rc2=e.rc2||{},e.rc2.expandKey=function(o,s){typeof o=="string"&&(o=e.util.createBuffer(o)),s=s||128;var l=o,u=o.length(),c=s,p=Math.ceil(c/8),h=255>>(c&7),d;for(d=u;d<128;d++)l.putByte(t[l.at(d-1)+l.at(d-u)&255]);for(l.setAt(128-p,t[l.at(128-p)&h]),d=127-p;d>=0;d--)l.setAt(d,t[l.at(d+1)^l.at(d+p)]);return l};var a=function(o,s,l){var u=!1,c=null,p=null,h=null,d,v,m,b,f=[];for(o=e.rc2.expandKey(o,s),m=0;m<64;m++)f.push(o.getInt16Le());l?(d=function(S){for(m=0;m<4;m++)S[m]+=f[b]+(S[(m+3)%4]&S[(m+2)%4])+(~S[(m+3)%4]&S[(m+1)%4]),S[m]=r(S[m],n[m]),b++},v=function(S){for(m=0;m<4;m++)S[m]+=f[S[(m+3)%4]&63]}):(d=function(S){for(m=3;m>=0;m--)S[m]=i(S[m],n[m]),S[m]-=f[b]+(S[(m+3)%4]&S[(m+2)%4])+(~S[(m+3)%4]&S[(m+1)%4]),b--},v=function(S){for(m=3;m>=0;m--)S[m]-=f[S[(m+3)%4]&63]});var y=function(S){var w=[];for(m=0;m<4;m++){var E=c.getInt16Le();h!==null&&(l?E^=h.getInt16Le():h.putInt16Le(E)),w.push(E&65535)}b=l?0:63;for(var x=0;x<S.length;x++)for(var g=0;g<S[x][0];g++)S[x][1](w);for(m=0;m<4;m++)h!==null&&(l?h.putInt16Le(w[m]):w[m]^=h.getInt16Le()),p.putInt16Le(w[m])},C=null;return C={start:function(S,w){S&&typeof S=="string"&&(S=e.util.createBuffer(S)),u=!1,c=e.util.createBuffer(),p=w||new e.util.createBuffer,h=S,C.output=p},update:function(S){for(u||c.putBuffer(S);c.length()>=8;)y([[5,d],[1,v],[6,d],[1,v],[5,d]])},finish:function(S){var w=!0;if(l)if(S)w=S(8,c,!l);else{var E=c.length()===8?8:8-c.length();c.fillWithByte(E,E)}if(w&&(u=!0,C.update()),!l&&(w=c.length()===0,w))if(S)w=S(8,p,!l);else{var x=p.length(),g=p.at(x-1);g>x?w=!1:p.truncate(g)}return w}},C};return e.rc2.startEncrypting=function(o,s,l){var u=e.rc2.createEncryptionCipher(o,128);return u.start(s,l),u},e.rc2.createEncryptionCipher=function(o,s){return a(o,s,!0)},e.rc2.startDecrypting=function(o,s,l){var u=e.rc2.createDecryptionCipher(o,128);return u.start(s,l),u},e.rc2.createDecryptionCipher=function(o,s){return a(o,s,!1)},Ld}var Vd,pm;function Rc(){if(pm)return Vd;pm=1;var e=Le();Vd=e.jsbn=e.jsbn||{};var t;function n(j,z,Y){this.data=[],j!=null&&(typeof j=="number"?this.fromNumber(j,z,Y):z==null&&typeof j!="string"?this.fromString(j,256):this.fromString(j,z))}e.jsbn.BigInteger=n;function r(){return new n(null)}function i(j,z,Y,ne,de,fe){for(;--fe>=0;){var ye=z*this.data[j++]+Y.data[ne]+de;de=Math.floor(ye/67108864),Y.data[ne++]=ye&67108863}return de}function a(j,z,Y,ne,de,fe){for(var ye=z&32767,me=z>>15;--fe>=0;){var ot=this.data[j]&32767,en=this.data[j++]>>15,Wn=me*ot+en*ye;ot=ye*ot+((Wn&32767)<<15)+Y.data[ne]+(de&1073741823),de=(ot>>>30)+(Wn>>>15)+me*en+(de>>>30),Y.data[ne++]=ot&1073741823}return de}function o(j,z,Y,ne,de,fe){for(var ye=z&16383,me=z>>14;--fe>=0;){var ot=this.data[j]&16383,en=this.data[j++]>>14,Wn=me*ot+en*ye;ot=ye*ot+((Wn&16383)<<14)+Y.data[ne]+de,de=(ot>>28)+(Wn>>14)+me*en,Y.data[ne++]=ot&268435455}return de}typeof navigator>"u"?(n.prototype.am=o,t=28):navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=a,t=30):navigator.appName!="Netscape"?(n.prototype.am=i,t=26):(n.prototype.am=o,t=28),n.prototype.DB=t,n.prototype.DM=(1<<t)-1,n.prototype.DV=1<<t;var s=52;n.prototype.FV=Math.pow(2,s),n.prototype.F1=s-t,n.prototype.F2=2*t-s;var l="0123456789abcdefghijklmnopqrstuvwxyz",u=new Array,c,p;for(c=48,p=0;p<=9;++p)u[c++]=p;for(c=97,p=10;p<36;++p)u[c++]=p;for(c=65,p=10;p<36;++p)u[c++]=p;function h(j){return l.charAt(j)}function d(j,z){var Y=u[j.charCodeAt(z)];return Y??-1}function v(j){for(var z=this.t-1;z>=0;--z)j.data[z]=this.data[z];j.t=this.t,j.s=this.s}function m(j){this.t=1,this.s=j<0?-1:0,j>0?this.data[0]=j:j<-1?this.data[0]=j+this.DV:this.t=0}function b(j){var z=r();return z.fromInt(j),z}function f(j,z){var Y;if(z==16)Y=4;else if(z==8)Y=3;else if(z==256)Y=8;else if(z==2)Y=1;else if(z==32)Y=5;else if(z==4)Y=2;else{this.fromRadix(j,z);return}this.t=0,this.s=0;for(var ne=j.length,de=!1,fe=0;--ne>=0;){var ye=Y==8?j[ne]&255:d(j,ne);if(ye<0){j.charAt(ne)=="-"&&(de=!0);continue}de=!1,fe==0?this.data[this.t++]=ye:fe+Y>this.DB?(this.data[this.t-1]|=(ye&(1<<this.DB-fe)-1)<<fe,this.data[this.t++]=ye>>this.DB-fe):this.data[this.t-1]|=ye<<fe,fe+=Y,fe>=this.DB&&(fe-=this.DB)}Y==8&&(j[0]&128)!=0&&(this.s=-1,fe>0&&(this.data[this.t-1]|=(1<<this.DB-fe)-1<<fe)),this.clamp(),de&&n.ZERO.subTo(this,this)}function y(){for(var j=this.s&this.DM;this.t>0&&this.data[this.t-1]==j;)--this.t}function C(j){if(this.s<0)return"-"+this.negate().toString(j);var z;if(j==16)z=4;else if(j==8)z=3;else if(j==2)z=1;else if(j==32)z=5;else if(j==4)z=2;else return this.toRadix(j);var Y=(1<<z)-1,ne,de=!1,fe="",ye=this.t,me=this.DB-ye*this.DB%z;if(ye-- >0)for(me<this.DB&&(ne=this.data[ye]>>me)>0&&(de=!0,fe=h(ne));ye>=0;)me<z?(ne=(this.data[ye]&(1<<me)-1)<<z-me,ne|=this.data[--ye]>>(me+=this.DB-z)):(ne=this.data[ye]>>(me-=z)&Y,me<=0&&(me+=this.DB,--ye)),ne>0&&(de=!0),de&&(fe+=h(ne));return de?fe:"0"}function S(){var j=r();return n.ZERO.subTo(this,j),j}function w(){return this.s<0?this.negate():this}function E(j){var z=this.s-j.s;if(z!=0)return z;var Y=this.t;if(z=Y-j.t,z!=0)return this.s<0?-z:z;for(;--Y>=0;)if((z=this.data[Y]-j.data[Y])!=0)return z;return 0}function x(j){var z=1,Y;return(Y=j>>>16)!=0&&(j=Y,z+=16),(Y=j>>8)!=0&&(j=Y,z+=8),(Y=j>>4)!=0&&(j=Y,z+=4),(Y=j>>2)!=0&&(j=Y,z+=2),(Y=j>>1)!=0&&(j=Y,z+=1),z}function g(){return this.t<=0?0:this.DB*(this.t-1)+x(this.data[this.t-1]^this.s&this.DM)}function I(j,z){var Y;for(Y=this.t-1;Y>=0;--Y)z.data[Y+j]=this.data[Y];for(Y=j-1;Y>=0;--Y)z.data[Y]=0;z.t=this.t+j,z.s=this.s}function A(j,z){for(var Y=j;Y<this.t;++Y)z.data[Y-j]=this.data[Y];z.t=Math.max(this.t-j,0),z.s=this.s}function _(j,z){var Y=j%this.DB,ne=this.DB-Y,de=(1<<ne)-1,fe=Math.floor(j/this.DB),ye=this.s<<Y&this.DM,me;for(me=this.t-1;me>=0;--me)z.data[me+fe+1]=this.data[me]>>ne|ye,ye=(this.data[me]&de)<<Y;for(me=fe-1;me>=0;--me)z.data[me]=0;z.data[fe]=ye,z.t=this.t+fe+1,z.s=this.s,z.clamp()}function T(j,z){z.s=this.s;var Y=Math.floor(j/this.DB);if(Y>=this.t){z.t=0;return}var ne=j%this.DB,de=this.DB-ne,fe=(1<<ne)-1;z.data[0]=this.data[Y]>>ne;for(var ye=Y+1;ye<this.t;++ye)z.data[ye-Y-1]|=(this.data[ye]&fe)<<de,z.data[ye-Y]=this.data[ye]>>ne;ne>0&&(z.data[this.t-Y-1]|=(this.s&fe)<<de),z.t=this.t-Y,z.clamp()}function $(j,z){for(var Y=0,ne=0,de=Math.min(j.t,this.t);Y<de;)ne+=this.data[Y]-j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;if(j.t<this.t){for(ne-=j.s;Y<this.t;)ne+=this.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne+=this.s}else{for(ne+=this.s;Y<j.t;)ne-=j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne-=j.s}z.s=ne<0?-1:0,ne<-1?z.data[Y++]=this.DV+ne:ne>0&&(z.data[Y++]=ne),z.t=Y,z.clamp()}function B(j,z){var Y=this.abs(),ne=j.abs(),de=Y.t;for(z.t=de+ne.t;--de>=0;)z.data[de]=0;for(de=0;de<ne.t;++de)z.data[de+Y.t]=Y.am(0,ne.data[de],z,de,0,Y.t);z.s=0,z.clamp(),this.s!=j.s&&n.ZERO.subTo(z,z)}function P(j){for(var z=this.abs(),Y=j.t=2*z.t;--Y>=0;)j.data[Y]=0;for(Y=0;Y<z.t-1;++Y){var ne=z.am(Y,z.data[Y],j,2*Y,0,1);(j.data[Y+z.t]+=z.am(Y+1,2*z.data[Y],j,2*Y+1,ne,z.t-Y-1))>=z.DV&&(j.data[Y+z.t]-=z.DV,j.data[Y+z.t+1]=1)}j.t>0&&(j.data[j.t-1]+=z.am(Y,z.data[Y],j,2*Y,0,1)),j.s=0,j.clamp()}function k(j,z,Y){var ne=j.abs();if(!(ne.t<=0)){var de=this.abs();if(de.t<ne.t){z!=null&&z.fromInt(0),Y!=null&&this.copyTo(Y);return}Y==null&&(Y=r());var fe=r(),ye=this.s,me=j.s,ot=this.DB-x(ne.data[ne.t-1]);ot>0?(ne.lShiftTo(ot,fe),de.lShiftTo(ot,Y)):(ne.copyTo(fe),de.copyTo(Y));var en=fe.t,Wn=fe.data[en-1];if(Wn!=0){var $n=Wn*(1<<this.F1)+(en>1?fe.data[en-2]>>this.F2:0),Kr=this.FV/$n,wl=(1<<this.F1)/$n,lr=1<<this.F2,ur=Y.t,Il=ur-en,Si=z??r();for(fe.dlShiftTo(Il,Si),Y.compareTo(Si)>=0&&(Y.data[Y.t++]=1,Y.subTo(Si,Y)),n.ONE.dlShiftTo(en,Si),Si.subTo(fe,fe);fe.t<en;)fe.data[fe.t++]=0;for(;--Il>=0;){var vd=Y.data[--ur]==Wn?this.DM:Math.floor(Y.data[ur]*Kr+(Y.data[ur-1]+lr)*wl);if((Y.data[ur]+=fe.am(0,vd,Y,Il,0,en))<vd)for(fe.dlShiftTo(Il,Si),Y.subTo(Si,Y);Y.data[ur]<--vd;)Y.subTo(Si,Y)}z!=null&&(Y.drShiftTo(en,z),ye!=me&&n.ZERO.subTo(z,z)),Y.t=en,Y.clamp(),ot>0&&Y.rShiftTo(ot,Y),ye<0&&n.ZERO.subTo(Y,Y)}}}function O(j){var z=r();return this.abs().divRemTo(j,null,z),this.s<0&&z.compareTo(n.ZERO)>0&&j.subTo(z,z),z}function M(j){this.m=j}function G(j){return j.s<0||j.compareTo(this.m)>=0?j.mod(this.m):j}function W(j){return j}function U(j){j.divRemTo(this.m,null,j)}function q(j,z,Y){j.multiplyTo(z,Y),this.reduce(Y)}function Q(j,z){j.squareTo(z),this.reduce(z)}M.prototype.convert=G,M.prototype.revert=W,M.prototype.reduce=U,M.prototype.mulTo=q,M.prototype.sqrTo=Q;function Z(){if(this.t<1)return 0;var j=this.data[0];if((j&1)==0)return 0;var z=j&3;return z=z*(2-(j&15)*z)&15,z=z*(2-(j&255)*z)&255,z=z*(2-((j&65535)*z&65535))&65535,z=z*(2-j*z%this.DV)%this.DV,z>0?this.DV-z:-z}function ee(j){this.m=j,this.mp=j.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<j.DB-15)-1,this.mt2=2*j.t}function J(j){var z=r();return j.abs().dlShiftTo(this.m.t,z),z.divRemTo(this.m,null,z),j.s<0&&z.compareTo(n.ZERO)>0&&this.m.subTo(z,z),z}function le(j){var z=r();return j.copyTo(z),this.reduce(z),z}function re(j){for(;j.t<=this.mt2;)j.data[j.t++]=0;for(var z=0;z<this.m.t;++z){var Y=j.data[z]&32767,ne=Y*this.mpl+((Y*this.mph+(j.data[z]>>15)*this.mpl&this.um)<<15)&j.DM;for(Y=z+this.m.t,j.data[Y]+=this.m.am(0,ne,j,z,0,this.m.t);j.data[Y]>=j.DV;)j.data[Y]-=j.DV,j.data[++Y]++}j.clamp(),j.drShiftTo(this.m.t,j),j.compareTo(this.m)>=0&&j.subTo(this.m,j)}function R(j,z){j.squareTo(z),this.reduce(z)}function H(j,z,Y){j.multiplyTo(z,Y),this.reduce(Y)}ee.prototype.convert=J,ee.prototype.revert=le,ee.prototype.reduce=re,ee.prototype.mulTo=H,ee.prototype.sqrTo=R;function V(){return(this.t>0?this.data[0]&1:this.s)==0}function D(j,z){if(j>4294967295||j<1)return n.ONE;var Y=r(),ne=r(),de=z.convert(this),fe=x(j)-1;for(de.copyTo(Y);--fe>=0;)if(z.sqrTo(Y,ne),(j&1<<fe)>0)z.mulTo(ne,de,Y);else{var ye=Y;Y=ne,ne=ye}return z.revert(Y)}function L(j,z){var Y;return j<256||z.isEven()?Y=new M(z):Y=new ee(z),this.exp(j,Y)}n.prototype.copyTo=v,n.prototype.fromInt=m,n.prototype.fromString=f,n.prototype.clamp=y,n.prototype.dlShiftTo=I,n.prototype.drShiftTo=A,n.prototype.lShiftTo=_,n.prototype.rShiftTo=T,n.prototype.subTo=$,n.prototype.multiplyTo=B,n.prototype.squareTo=P,n.prototype.divRemTo=k,n.prototype.invDigit=Z,n.prototype.isEven=V,n.prototype.exp=D,n.prototype.toString=C,n.prototype.negate=S,n.prototype.abs=w,n.prototype.compareTo=E,n.prototype.bitLength=g,n.prototype.mod=O,n.prototype.modPowInt=L,n.ZERO=b(0),n.ONE=b(1);function K(){var j=r();return this.copyTo(j),j}function X(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function se(){return this.t==0?this.s:this.data[0]<<24>>24}function ie(){return this.t==0?this.s:this.data[0]<<16>>16}function oe(j){return Math.floor(Math.LN2*this.DB/Math.log(j))}function te(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function ue(j){if(j==null&&(j=10),this.signum()==0||j<2||j>36)return"0";var z=this.chunkSize(j),Y=Math.pow(j,z),ne=b(Y),de=r(),fe=r(),ye="";for(this.divRemTo(ne,de,fe);de.signum()>0;)ye=(Y+fe.intValue()).toString(j).substr(1)+ye,de.divRemTo(ne,de,fe);return fe.intValue().toString(j)+ye}function ve(j,z){this.fromInt(0),z==null&&(z=10);for(var Y=this.chunkSize(z),ne=Math.pow(z,Y),de=!1,fe=0,ye=0,me=0;me<j.length;++me){var ot=d(j,me);if(ot<0){j.charAt(me)=="-"&&this.signum()==0&&(de=!0);continue}ye=z*ye+ot,++fe>=Y&&(this.dMultiply(ne),this.dAddOffset(ye,0),fe=0,ye=0)}fe>0&&(this.dMultiply(Math.pow(z,fe)),this.dAddOffset(ye,0)),de&&n.ZERO.subTo(this,this)}function be(j,z,Y){if(typeof z=="number")if(j<2)this.fromInt(1);else for(this.fromNumber(j,Y),this.testBit(j-1)||this.bitwiseTo(n.ONE.shiftLeft(j-1),xt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(z);)this.dAddOffset(2,0),this.bitLength()>j&&this.subTo(n.ONE.shiftLeft(j-1),this);else{var ne=new Array,de=j&7;ne.length=(j>>3)+1,z.nextBytes(ne),de>0?ne[0]&=(1<<de)-1:ne[0]=0,this.fromString(ne,256)}}function pe(){var j=this.t,z=new Array;z[0]=this.s;var Y=this.DB-j*this.DB%8,ne,de=0;if(j-- >0)for(Y<this.DB&&(ne=this.data[j]>>Y)!=(this.s&this.DM)>>Y&&(z[de++]=ne|this.s<<this.DB-Y);j>=0;)Y<8?(ne=(this.data[j]&(1<<Y)-1)<<8-Y,ne|=this.data[--j]>>(Y+=this.DB-8)):(ne=this.data[j]>>(Y-=8)&255,Y<=0&&(Y+=this.DB,--j)),(ne&128)!=0&&(ne|=-256),de==0&&(this.s&128)!=(ne&128)&&++de,(de>0||ne!=this.s)&&(z[de++]=ne);return z}function Te(j){return this.compareTo(j)==0}function Ne(j){return this.compareTo(j)<0?this:j}function Ue(j){return this.compareTo(j)>0?this:j}function tt(j,z,Y){var ne,de,fe=Math.min(j.t,this.t);for(ne=0;ne<fe;++ne)Y.data[ne]=z(this.data[ne],j.data[ne]);if(j.t<this.t){for(de=j.s&this.DM,ne=fe;ne<this.t;++ne)Y.data[ne]=z(this.data[ne],de);Y.t=this.t}else{for(de=this.s&this.DM,ne=fe;ne<j.t;++ne)Y.data[ne]=z(de,j.data[ne]);Y.t=j.t}Y.s=z(this.s,j.s),Y.clamp()}function lt(j,z){return j&z}function ut(j){var z=r();return this.bitwiseTo(j,lt,z),z}function xt(j,z){return j|z}function Dt(j){var z=r();return this.bitwiseTo(j,xt,z),z}function kt(j,z){return j^z}function vn(j){var z=r();return this.bitwiseTo(j,kt,z),z}function bn(j,z){return j&~z}function Pn(j){var z=r();return this.bitwiseTo(j,bn,z),z}function Gn(){for(var j=r(),z=0;z<this.t;++z)j.data[z]=this.DM&~this.data[z];return j.t=this.t,j.s=~this.s,j}function or(j){var z=r();return j<0?this.rShiftTo(-j,z):this.lShiftTo(j,z),z}function Sr(j){var z=r();return j<0?this.lShiftTo(-j,z):this.rShiftTo(j,z),z}function Yr(j){if(j==0)return-1;var z=0;return(j&65535)==0&&(j>>=16,z+=16),(j&255)==0&&(j>>=8,z+=8),(j&15)==0&&(j>>=4,z+=4),(j&3)==0&&(j>>=2,z+=2),(j&1)==0&&++z,z}function Ei(){for(var j=0;j<this.t;++j)if(this.data[j]!=0)return j*this.DB+Yr(this.data[j]);return this.s<0?this.t*this.DB:-1}function ea(j){for(var z=0;j!=0;)j&=j-1,++z;return z}function Ga(){for(var j=0,z=this.s&this.DM,Y=0;Y<this.t;++Y)j+=ea(this.data[Y]^z);return j}function Uo(j){var z=Math.floor(j/this.DB);return z>=this.t?this.s!=0:(this.data[z]&1<<j%this.DB)!=0}function Sl(j,z){var Y=n.ONE.shiftLeft(j);return this.bitwiseTo(Y,z,Y),Y}function Vt(j){return this.changeBit(j,xt)}function Ht(j){return this.changeBit(j,bn)}function jt(j){return this.changeBit(j,kt)}function zt(j,z){for(var Y=0,ne=0,de=Math.min(j.t,this.t);Y<de;)ne+=this.data[Y]+j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;if(j.t<this.t){for(ne+=j.s;Y<this.t;)ne+=this.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne+=this.s}else{for(ne+=this.s;Y<j.t;)ne+=j.data[Y],z.data[Y++]=ne&this.DM,ne>>=this.DB;ne+=j.s}z.s=ne<0?-1:0,ne>0?z.data[Y++]=ne:ne<-1&&(z.data[Y++]=this.DV+ne),z.t=Y,z.clamp()}function Gt(j){var z=r();return this.addTo(j,z),z}function Wt(j){var z=r();return this.subTo(j,z),z}function Ut(j){var z=r();return this.multiplyTo(j,z),z}function Xt(j){var z=r();return this.divRemTo(j,z,null),z}function Yt(j){var z=r();return this.divRemTo(j,null,z),z}function Kt(j){var z=r(),Y=r();return this.divRemTo(j,z,Y),new Array(z,Y)}function Zt(j){this.data[this.t]=this.am(0,j-1,this,0,0,this.t),++this.t,this.clamp()}function Jt(j,z){if(j!=0){for(;this.t<=z;)this.data[this.t++]=0;for(this.data[z]+=j;this.data[z]>=this.DV;)this.data[z]-=this.DV,++z>=this.t&&(this.data[this.t++]=0),++this.data[z]}}function Ct(){}function Pt(j){return j}function qt(j,z,Y){j.multiplyTo(z,Y)}function Qt(j,z){j.squareTo(z)}Ct.prototype.convert=Pt,Ct.prototype.revert=Pt,Ct.prototype.mulTo=qt,Ct.prototype.sqrTo=Qt;function Qw(j){return this.exp(j,new Ct)}function eI(j,z,Y){var ne=Math.min(this.t+j.t,z);for(Y.s=0,Y.t=ne;ne>0;)Y.data[--ne]=0;var de;for(de=Y.t-this.t;ne<de;++ne)Y.data[ne+this.t]=this.am(0,j.data[ne],Y,ne,0,this.t);for(de=Math.min(j.t,z);ne<de;++ne)this.am(0,j.data[ne],Y,ne,0,z-ne);Y.clamp()}function tI(j,z,Y){--z;var ne=Y.t=this.t+j.t-z;for(Y.s=0;--ne>=0;)Y.data[ne]=0;for(ne=Math.max(z-this.t,0);ne<j.t;++ne)Y.data[this.t+ne-z]=this.am(z-ne,j.data[ne],Y,0,0,this.t+ne-z);Y.clamp(),Y.drShiftTo(1,Y)}function Wa(j){this.r2=r(),this.q3=r(),n.ONE.dlShiftTo(2*j.t,this.r2),this.mu=this.r2.divide(j),this.m=j}function nI(j){if(j.s<0||j.t>2*this.m.t)return j.mod(this.m);if(j.compareTo(this.m)<0)return j;var z=r();return j.copyTo(z),this.reduce(z),z}function rI(j){return j}function iI(j){for(j.drShiftTo(this.m.t-1,this.r2),j.t>this.m.t+1&&(j.t=this.m.t+1,j.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);j.compareTo(this.r2)<0;)j.dAddOffset(1,this.m.t+1);for(j.subTo(this.r2,j);j.compareTo(this.m)>=0;)j.subTo(this.m,j)}function aI(j,z){j.squareTo(z),this.reduce(z)}function oI(j,z,Y){j.multiplyTo(z,Y),this.reduce(Y)}Wa.prototype.convert=nI,Wa.prototype.revert=rI,Wa.prototype.reduce=iI,Wa.prototype.mulTo=oI,Wa.prototype.sqrTo=aI;function sI(j,z){var Y=j.bitLength(),ne,de=b(1),fe;if(Y<=0)return de;Y<18?ne=1:Y<48?ne=3:Y<144?ne=4:Y<768?ne=5:ne=6,Y<8?fe=new M(z):z.isEven()?fe=new Wa(z):fe=new ee(z);var ye=new Array,me=3,ot=ne-1,en=(1<<ne)-1;if(ye[1]=fe.convert(this),ne>1){var Wn=r();for(fe.sqrTo(ye[1],Wn);me<=en;)ye[me]=r(),fe.mulTo(Wn,ye[me-2],ye[me]),me+=2}var $n=j.t-1,Kr,wl=!0,lr=r(),ur;for(Y=x(j.data[$n])-1;$n>=0;){for(Y>=ot?Kr=j.data[$n]>>Y-ot&en:(Kr=(j.data[$n]&(1<<Y+1)-1)<<ot-Y,$n>0&&(Kr|=j.data[$n-1]>>this.DB+Y-ot)),me=ne;(Kr&1)==0;)Kr>>=1,--me;if((Y-=me)<0&&(Y+=this.DB,--$n),wl)ye[Kr].copyTo(de),wl=!1;else{for(;me>1;)fe.sqrTo(de,lr),fe.sqrTo(lr,de),me-=2;me>0?fe.sqrTo(de,lr):(ur=de,de=lr,lr=ur),fe.mulTo(lr,ye[Kr],de)}for(;$n>=0&&(j.data[$n]&1<<Y)==0;)fe.sqrTo(de,lr),ur=de,de=lr,lr=ur,--Y<0&&(Y=this.DB-1,--$n)}return fe.revert(de)}function lI(j){var z=this.s<0?this.negate():this.clone(),Y=j.s<0?j.negate():j.clone();if(z.compareTo(Y)<0){var ne=z;z=Y,Y=ne}var de=z.getLowestSetBit(),fe=Y.getLowestSetBit();if(fe<0)return z;for(de<fe&&(fe=de),fe>0&&(z.rShiftTo(fe,z),Y.rShiftTo(fe,Y));z.signum()>0;)(de=z.getLowestSetBit())>0&&z.rShiftTo(de,z),(de=Y.getLowestSetBit())>0&&Y.rShiftTo(de,Y),z.compareTo(Y)>=0?(z.subTo(Y,z),z.rShiftTo(1,z)):(Y.subTo(z,Y),Y.rShiftTo(1,Y));return fe>0&&Y.lShiftTo(fe,Y),Y}function uI(j){if(j<=0)return 0;var z=this.DV%j,Y=this.s<0?j-1:0;if(this.t>0)if(z==0)Y=this.data[0]%j;else for(var ne=this.t-1;ne>=0;--ne)Y=(z*Y+this.data[ne])%j;return Y}function cI(j){var z=j.isEven();if(this.isEven()&&z||j.signum()==0)return n.ZERO;for(var Y=j.clone(),ne=this.clone(),de=b(1),fe=b(0),ye=b(0),me=b(1);Y.signum()!=0;){for(;Y.isEven();)Y.rShiftTo(1,Y),z?((!de.isEven()||!fe.isEven())&&(de.addTo(this,de),fe.subTo(j,fe)),de.rShiftTo(1,de)):fe.isEven()||fe.subTo(j,fe),fe.rShiftTo(1,fe);for(;ne.isEven();)ne.rShiftTo(1,ne),z?((!ye.isEven()||!me.isEven())&&(ye.addTo(this,ye),me.subTo(j,me)),ye.rShiftTo(1,ye)):me.isEven()||me.subTo(j,me),me.rShiftTo(1,me);Y.compareTo(ne)>=0?(Y.subTo(ne,Y),z&&de.subTo(ye,de),fe.subTo(me,fe)):(ne.subTo(Y,ne),z&&ye.subTo(de,ye),me.subTo(fe,me))}if(ne.compareTo(n.ONE)!=0)return n.ZERO;if(me.compareTo(j)>=0)return me.subtract(j);if(me.signum()<0)me.addTo(j,me);else return me;return me.signum()<0?me.add(j):me}var sr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],dI=(1<<26)/sr[sr.length-1];function fI(j){var z,Y=this.abs();if(Y.t==1&&Y.data[0]<=sr[sr.length-1]){for(z=0;z<sr.length;++z)if(Y.data[0]==sr[z])return!0;return!1}if(Y.isEven())return!1;for(z=1;z<sr.length;){for(var ne=sr[z],de=z+1;de<sr.length&&ne<dI;)ne*=sr[de++];for(ne=Y.modInt(ne);z<de;)if(ne%sr[z++]==0)return!1}return Y.millerRabin(j)}function hI(j){var z=this.subtract(n.ONE),Y=z.getLowestSetBit();if(Y<=0)return!1;for(var ne=z.shiftRight(Y),de=gI(),fe,ye=0;ye<j;++ye){do fe=new n(this.bitLength(),de);while(fe.compareTo(n.ONE)<=0||fe.compareTo(z)>=0);var me=fe.modPow(ne,this);if(me.compareTo(n.ONE)!=0&&me.compareTo(z)!=0){for(var ot=1;ot++<Y&&me.compareTo(z)!=0;)if(me=me.modPowInt(2,this),me.compareTo(n.ONE)==0)return!1;if(me.compareTo(z)!=0)return!1}}return!0}function gI(){return{nextBytes:function(j){for(var z=0;z<j.length;++z)j[z]=Math.floor(Math.random()*256)}}}return n.prototype.chunkSize=oe,n.prototype.toRadix=ue,n.prototype.fromRadix=ve,n.prototype.fromNumber=be,n.prototype.bitwiseTo=tt,n.prototype.changeBit=Sl,n.prototype.addTo=zt,n.prototype.dMultiply=Zt,n.prototype.dAddOffset=Jt,n.prototype.multiplyLowerTo=eI,n.prototype.multiplyUpperTo=tI,n.prototype.modInt=uI,n.prototype.millerRabin=hI,n.prototype.clone=K,n.prototype.intValue=X,n.prototype.byteValue=se,n.prototype.shortValue=ie,n.prototype.signum=te,n.prototype.toByteArray=pe,n.prototype.equals=Te,n.prototype.min=Ne,n.prototype.max=Ue,n.prototype.and=ut,n.prototype.or=Dt,n.prototype.xor=vn,n.prototype.andNot=Pn,n.prototype.not=Gn,n.prototype.shiftLeft=or,n.prototype.shiftRight=Sr,n.prototype.getLowestSetBit=Ei,n.prototype.bitCount=Ga,n.prototype.testBit=Uo,n.prototype.setBit=Vt,n.prototype.clearBit=Ht,n.prototype.flipBit=jt,n.prototype.add=Gt,n.prototype.subtract=Wt,n.prototype.multiply=Ut,n.prototype.divide=Xt,n.prototype.remainder=Yt,n.prototype.divideAndRemainder=Kt,n.prototype.modPow=sI,n.prototype.modInverse=cI,n.prototype.pow=Qw,n.prototype.gcd=lI,n.prototype.isProbablePrime=fI,Vd}var Hd={exports:{}},jd={exports:{}},mm;function il(){if(mm)return jd.exports;mm=1;var e=Le();mi(),Xe();var t=jd.exports=e.sha1=e.sha1||{};e.md.sha1=e.md.algorithms.sha1=t,t.create=function(){r||i();var o=null,s=e.util.createBuffer(),l=new Array(80),u={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return u.start=function(){u.messageLength=0,u.fullMessageLength=u.messageLength64=[];for(var c=u.messageLengthSize/4,p=0;p<c;++p)u.fullMessageLength.push(0);return s=e.util.createBuffer(),o={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},u},u.start(),u.update=function(c,p){p==="utf8"&&(c=e.util.encodeUtf8(c));var h=c.length;u.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var d=u.fullMessageLength.length-1;d>=0;--d)u.fullMessageLength[d]+=h[1],h[1]=h[0]+(u.fullMessageLength[d]/4294967296>>>0),u.fullMessageLength[d]=u.fullMessageLength[d]>>>0,h[0]=h[1]/4294967296>>>0;return s.putBytes(c),a(o,l,s),(s.read>2048||s.length()===0)&&s.compact(),u},u.digest=function(){var c=e.util.createBuffer();c.putBytes(s.bytes());var p=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize,h=p&u.blockLength-1;c.putBytes(n.substr(0,u.blockLength-h));for(var d,v,m=u.fullMessageLength[0]*8,b=0;b<u.fullMessageLength.length-1;++b)d=u.fullMessageLength[b+1]*8,v=d/4294967296>>>0,m+=v,c.putInt32(m>>>0),m=d>>>0;c.putInt32(m);var f={h0:o.h0,h1:o.h1,h2:o.h2,h3:o.h3,h4:o.h4};a(f,l,c);var y=e.util.createBuffer();return y.putInt32(f.h0),y.putInt32(f.h1),y.putInt32(f.h2),y.putInt32(f.h3),y.putInt32(f.h4),y},u};var n=null,r=!1;function i(){n="€",n+=e.util.fillString("\0",64),r=!0}function a(o,s,l){for(var u,c,p,h,d,v,m,b,f=l.length();f>=64;){for(c=o.h0,p=o.h1,h=o.h2,d=o.h3,v=o.h4,b=0;b<16;++b)u=l.getInt32(),s[b]=u,m=d^p&(h^d),u=(c<<5|c>>>27)+m+v+1518500249+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<20;++b)u=s[b-3]^s[b-8]^s[b-14]^s[b-16],u=u<<1|u>>>31,s[b]=u,m=d^p&(h^d),u=(c<<5|c>>>27)+m+v+1518500249+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<32;++b)u=s[b-3]^s[b-8]^s[b-14]^s[b-16],u=u<<1|u>>>31,s[b]=u,m=p^h^d,u=(c<<5|c>>>27)+m+v+1859775393+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<40;++b)u=s[b-6]^s[b-16]^s[b-28]^s[b-32],u=u<<2|u>>>30,s[b]=u,m=p^h^d,u=(c<<5|c>>>27)+m+v+1859775393+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<60;++b)u=s[b-6]^s[b-16]^s[b-28]^s[b-32],u=u<<2|u>>>30,s[b]=u,m=p&h|d&(p^h),u=(c<<5|c>>>27)+m+v+2400959708+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;for(;b<80;++b)u=s[b-6]^s[b-16]^s[b-28]^s[b-32],u=u<<2|u>>>30,s[b]=u,m=p^h^d,u=(c<<5|c>>>27)+m+v+3395469782+u,v=d,d=h,h=(p<<30|p>>>2)>>>0,p=c,c=u;o.h0=o.h0+c|0,o.h1=o.h1+p|0,o.h2=o.h2+h|0,o.h3=o.h3+d|0,o.h4=o.h4+v|0,f-=64}}return jd.exports}var vm;function Ex(){if(vm)return Hd.exports;vm=1;var e=Le();Xe(),Er(),il();var t=Hd.exports=e.pkcs1=e.pkcs1||{};t.encode_rsa_oaep=function(r,i,a){var o,s,l,u;typeof a=="string"?(o=a,s=arguments[3]||void 0,l=arguments[4]||void 0):a&&(o=a.label||void 0,s=a.seed||void 0,l=a.md||void 0,a.mgf1&&a.mgf1.md&&(u=a.mgf1.md)),l?l.start():l=e.md.sha1.create(),u||(u=l);var c=Math.ceil(r.n.bitLength()/8),p=c-2*l.digestLength-2;if(i.length>p){var h=new Error("RSAES-OAEP input message length is too long.");throw h.length=i.length,h.maxLength=p,h}o||(o=""),l.update(o,"raw");for(var d=l.digest(),v="",m=p-i.length,b=0;b<m;b++)v+="\0";var f=d.getBytes()+v+""+i;if(!s)s=e.random.getBytes(l.digestLength);else if(s.length!==l.digestLength){var h=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw h.seedLength=s.length,h.digestLength=l.digestLength,h}var y=n(s,c-l.digestLength-1,u),C=e.util.xorBytes(f,y,f.length),S=n(C,l.digestLength,u),w=e.util.xorBytes(s,S,s.length);return"\0"+w+C},t.decode_rsa_oaep=function(r,i,a){var o,s,l;typeof a=="string"?(o=a,s=arguments[3]||void 0):a&&(o=a.label||void 0,s=a.md||void 0,a.mgf1&&a.mgf1.md&&(l=a.mgf1.md));var u=Math.ceil(r.n.bitLength()/8);if(i.length!==u){var C=new Error("RSAES-OAEP encoded message length is invalid.");throw C.length=i.length,C.expectedLength=u,C}if(s===void 0?s=e.md.sha1.create():s.start(),l||(l=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");o||(o=""),s.update(o,"raw");for(var c=s.digest().getBytes(),p=i.charAt(0),h=i.substring(1,s.digestLength+1),d=i.substring(1+s.digestLength),v=n(d,s.digestLength,l),m=e.util.xorBytes(h,v,h.length),b=n(m,u-s.digestLength-1,l),f=e.util.xorBytes(d,b,d.length),y=f.substring(0,s.digestLength),C=p!=="\0",S=0;S<s.digestLength;++S)C|=c.charAt(S)!==y.charAt(S);for(var w=1,E=s.digestLength,x=s.digestLength;x<f.length;x++){var g=f.charCodeAt(x),I=g&1^1,A=w?65534:0;C|=g&A,w=w&I,E+=w}if(C||f.charCodeAt(E)!==1)throw new Error("Invalid RSAES-OAEP padding.");return f.substring(E+1)};function n(r,i,a){a||(a=e.md.sha1.create());for(var o="",s=Math.ceil(i/a.digestLength),l=0;l<s;++l){var u=String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,l&255);a.start(),a.update(r+u),o+=a.digest().getBytes()}return o.substring(0,i)}return Hd.exports}var Al={exports:{}},bm;function Sx(){if(bm)return Al.exports;bm=1;var e=Le();return Xe(),Rc(),Er(),function(){if(e.prime){Al.exports=e.prime;return}var t=Al.exports=e.prime=e.prime||{},n=e.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],i=new n(null);i.fromInt(30);var a=function(h,d){return h|d};t.generateProbablePrime=function(h,d,v){typeof d=="function"&&(v=d,d={}),d=d||{};var m=d.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var b=d.prng||e.random,f={nextBytes:function(y){for(var C=b.getBytesSync(y.length),S=0;S<y.length;++S)y[S]=C.charCodeAt(S)}};if(m.name==="PRIMEINC")return o(h,f,m.options,v);throw new Error("Invalid prime generation algorithm: "+m.name)};function o(h,d,v,m){return"workers"in v?u(h,d,v,m):s(h,d,v,m)}function s(h,d,v,m){var b=c(h,d),f=0,y=p(b.bitLength());"millerRabinTests"in v&&(y=v.millerRabinTests);var C=10;"maxBlockTime"in v&&(C=v.maxBlockTime),l(b,h,d,f,y,C,m)}function l(h,d,v,m,b,f,y){var C=+new Date;do{if(h.bitLength()>d&&(h=c(d,v)),h.isProbablePrime(b))return y(null,h);h.dAddOffset(r[m++%8],0)}while(f<0||+new Date-C<f);e.util.setImmediate(function(){l(h,d,v,m,b,f,y)})}function u(h,d,v,m){if(typeof Worker>"u")return s(h,d,v,m);var b=c(h,d),f=v.workers,y=v.workLoad||100,C=y*30/8,S=v.workerScript||"forge/prime.worker.js";if(f===-1)return e.util.estimateCores(function(E,x){E&&(x=2),f=x-1,w()});w();function w(){f=Math.max(1,f);for(var E=[],x=0;x<f;++x)E[x]=new Worker(S);for(var x=0;x<f;++x)E[x].addEventListener("message",I);var g=!1;function I(A){if(!g){var _=A.data;if(_.found){for(var T=0;T<E.length;++T)E[T].terminate();return g=!0,m(null,new n(_.prime,16))}b.bitLength()>h&&(b=c(h,d));var $=b.toString(16);A.target.postMessage({hex:$,workLoad:y}),b.dAddOffset(C,0)}}}}function c(h,d){var v=new n(h,d),m=h-1;return v.testBit(m)||v.bitwiseTo(n.ONE.shiftLeft(m),a,v),v.dAddOffset(31-v.mod(i).byteValue(),0),v}function p(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}}(),Al.exports}var zd,ym;function Bc(){if(ym)return zd;ym=1;var e=Le();if(Wr(),Rc(),Oa(),Ex(),Sx(),Er(),Xe(),typeof t>"u")var t=e.jsbn.BigInteger;var n=e.util.isNodejs?H0:null,r=e.asn1,i=e.util;e.pki=e.pki||{},zd=e.pki.rsa=e.rsa=e.rsa||{};var a=e.pki,o=[6,4,2,4,2,4,6,2],s={name:"PrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},u={name:"RSAPublicKey",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:r.Class.UNIVERSAL,type:r.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},c=e.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:r.Class.UNIVERSAL,type:r.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:r.Class.UNIVERSAL,type:r.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:r.Class.UNIVERSAL,type:r.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:r.Class.UNIVERSAL,type:r.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:r.Class.UNIVERSAL,type:r.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},h=function(x){var g;if(x.algorithm in a.oids)g=a.oids[x.algorithm];else{var I=new Error("Unknown message digest algorithm.");throw I.algorithm=x.algorithm,I}var A=r.oidToDer(g).getBytes(),_=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]),T=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[]);T.value.push(r.create(r.Class.UNIVERSAL,r.Type.OID,!1,A)),T.value.push(r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,""));var $=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,x.digest().getBytes());return _.value.push(T),_.value.push($),r.toDer(_).getBytes()},d=function(x,g,I){if(I)return x.modPow(g.e,g.n);if(!g.p||!g.q)return x.modPow(g.d,g.n);g.dP||(g.dP=g.d.mod(g.p.subtract(t.ONE))),g.dQ||(g.dQ=g.d.mod(g.q.subtract(t.ONE))),g.qInv||(g.qInv=g.q.modInverse(g.p));var A;do A=new t(e.util.bytesToHex(e.random.getBytes(g.n.bitLength()/8)),16);while(A.compareTo(g.n)>=0||!A.gcd(g.n).equals(t.ONE));x=x.multiply(A.modPow(g.e,g.n)).mod(g.n);for(var _=x.mod(g.p).modPow(g.dP,g.p),T=x.mod(g.q).modPow(g.dQ,g.q);_.compareTo(T)<0;)_=_.add(g.p);var $=_.subtract(T).multiply(g.qInv).mod(g.p).multiply(g.q).add(T);return $=$.multiply(A.modInverse(g.n)).mod(g.n),$};a.rsa.encrypt=function(x,g,I){var A=I,_,T=Math.ceil(g.n.bitLength()/8);I!==!1&&I!==!0?(A=I===2,_=v(x,g,I)):(_=e.util.createBuffer(),_.putBytes(x));for(var $=new t(_.toHex(),16),B=d($,g,A),P=B.toString(16),k=e.util.createBuffer(),O=T-Math.ceil(P.length/2);O>0;)k.putByte(0),--O;return k.putBytes(e.util.hexToBytes(P)),k.getBytes()},a.rsa.decrypt=function(x,g,I,A){var _=Math.ceil(g.n.bitLength()/8);if(x.length!==_){var T=new Error("Encrypted message length is invalid.");throw T.length=x.length,T.expected=_,T}var $=new t(e.util.createBuffer(x).toHex(),16);if($.compareTo(g.n)>=0)throw new Error("Encrypted message is invalid.");for(var B=d($,g,I),P=B.toString(16),k=e.util.createBuffer(),O=_-Math.ceil(P.length/2);O>0;)k.putByte(0),--O;return k.putBytes(e.util.hexToBytes(P)),A!==!1?m(k.getBytes(),g,I):k.getBytes()},a.rsa.createKeyPairGenerationState=function(x,g,I){typeof x=="string"&&(x=parseInt(x,10)),x=x||2048,I=I||{};var A=I.prng||e.random,_={nextBytes:function(B){for(var P=A.getBytesSync(B.length),k=0;k<B.length;++k)B[k]=P.charCodeAt(k)}},T=I.algorithm||"PRIMEINC",$;if(T==="PRIMEINC")$={algorithm:T,state:0,bits:x,rng:_,eInt:g||65537,e:new t(null),p:null,q:null,qBits:x>>1,pBits:x-(x>>1),pqState:0,num:null,keys:null},$.e.fromInt($.eInt);else throw new Error("Invalid key generation algorithm: "+T);return $},a.rsa.stepKeyPairGenerationState=function(x,g){"algorithm"in x||(x.algorithm="PRIMEINC");var I=new t(null);I.fromInt(30);for(var A=0,_=function(M,G){return M|G},T=+new Date,$,B=0;x.keys===null&&(g<=0||B<g);){if(x.state===0){var P=x.p===null?x.pBits:x.qBits,k=P-1;x.pqState===0?(x.num=new t(P,x.rng),x.num.testBit(k)||x.num.bitwiseTo(t.ONE.shiftLeft(k),_,x.num),x.num.dAddOffset(31-x.num.mod(I).byteValue(),0),A=0,++x.pqState):x.pqState===1?x.num.bitLength()>P?x.pqState=0:x.num.isProbablePrime(y(x.num.bitLength()))?++x.pqState:x.num.dAddOffset(o[A++%8],0):x.pqState===2?x.pqState=x.num.subtract(t.ONE).gcd(x.e).compareTo(t.ONE)===0?3:0:x.pqState===3&&(x.pqState=0,x.p===null?x.p=x.num:x.q=x.num,x.p!==null&&x.q!==null&&++x.state,x.num=null)}else if(x.state===1)x.p.compareTo(x.q)<0&&(x.num=x.p,x.p=x.q,x.q=x.num),++x.state;else if(x.state===2)x.p1=x.p.subtract(t.ONE),x.q1=x.q.subtract(t.ONE),x.phi=x.p1.multiply(x.q1),++x.state;else if(x.state===3)x.phi.gcd(x.e).compareTo(t.ONE)===0?++x.state:(x.p=null,x.q=null,x.state=0);else if(x.state===4)x.n=x.p.multiply(x.q),x.n.bitLength()===x.bits?++x.state:(x.q=null,x.state=0);else if(x.state===5){var O=x.e.modInverse(x.phi);x.keys={privateKey:a.rsa.setPrivateKey(x.n,x.e,O,x.p,x.q,O.mod(x.p1),O.mod(x.q1),x.q.modInverse(x.p)),publicKey:a.rsa.setPublicKey(x.n,x.e)}}$=+new Date,B+=$-T,T=$}return x.keys!==null},a.rsa.generateKeyPair=function(x,g,I,A){if(arguments.length===1?typeof x=="object"?(I=x,x=void 0):typeof x=="function"&&(A=x,x=void 0):arguments.length===2?typeof x=="number"?typeof g=="function"?(A=g,g=void 0):typeof g!="number"&&(I=g,g=void 0):(I=x,A=g,x=void 0,g=void 0):arguments.length===3&&(typeof g=="number"?typeof I=="function"&&(A=I,I=void 0):(A=I,I=g,g=void 0)),I=I||{},x===void 0&&(x=I.bits||2048),g===void 0&&(g=I.e||65537),!e.options.usePureJavaScript&&!I.prng&&x>=256&&x<=16384&&(g===65537||g===3)){if(A){if(C("generateKeyPair"))return n.generateKeyPair("rsa",{modulusLength:x,publicExponent:g,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(B,P,k){if(B)return A(B);A(null,{privateKey:a.privateKeyFromPem(k),publicKey:a.publicKeyFromPem(P)})});if(S("generateKey")&&S("exportKey"))return i.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:x,publicExponent:E(g),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(B){return i.globalScope.crypto.subtle.exportKey("pkcs8",B.privateKey)}).then(void 0,function(B){A(B)}).then(function(B){if(B){var P=a.privateKeyFromAsn1(r.fromDer(e.util.createBuffer(B)));A(null,{privateKey:P,publicKey:a.setRsaPublicKey(P.n,P.e)})}});if(w("generateKey")&&w("exportKey")){var _=i.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:x,publicExponent:E(g),hash:{name:"SHA-256"}},!0,["sign","verify"]);_.oncomplete=function(B){var P=B.target.result,k=i.globalScope.msCrypto.subtle.exportKey("pkcs8",P.privateKey);k.oncomplete=function(O){var M=O.target.result,G=a.privateKeyFromAsn1(r.fromDer(e.util.createBuffer(M)));A(null,{privateKey:G,publicKey:a.setRsaPublicKey(G.n,G.e)})},k.onerror=function(O){A(O)}},_.onerror=function(B){A(B)};return}}else if(C("generateKeyPairSync")){var T=n.generateKeyPairSync("rsa",{modulusLength:x,publicExponent:g,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:a.privateKeyFromPem(T.privateKey),publicKey:a.publicKeyFromPem(T.publicKey)}}}var $=a.rsa.createKeyPairGenerationState(x,g,I);if(!A)return a.rsa.stepKeyPairGenerationState($,0),$.keys;b($,I,A)},a.setRsaPublicKey=a.rsa.setPublicKey=function(x,g){var I={n:x,e:g};return I.encrypt=function(A,_,T){if(typeof _=="string"?_=_.toUpperCase():_===void 0&&(_="RSAES-PKCS1-V1_5"),_==="RSAES-PKCS1-V1_5")_={encode:function(B,P,k){return v(B,P,2).getBytes()}};else if(_==="RSA-OAEP"||_==="RSAES-OAEP")_={encode:function(B,P){return e.pkcs1.encode_rsa_oaep(P,B,T)}};else if(["RAW","NONE","NULL",null].indexOf(_)!==-1)_={encode:function(B){return B}};else if(typeof _=="string")throw new Error('Unsupported encryption scheme: "'+_+'".');var $=_.encode(A,I,!0);return a.rsa.encrypt($,I,!0)},I.verify=function(A,_,T,$){typeof T=="string"?T=T.toUpperCase():T===void 0&&(T="RSASSA-PKCS1-V1_5"),$===void 0&&($={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in $||($._parseAllDigestBytes=!0),T==="RSASSA-PKCS1-V1_5"?T={verify:function(P,k){k=m(k,I,!0);var O=r.fromDer(k,{parseAllBytes:$._parseAllDigestBytes}),M={},G=[];if(!r.validate(O,p,M,G)){var W=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw W.errors=G,W}var U=r.derToOid(M.algorithmIdentifier);if(!(U===e.oids.md2||U===e.oids.md5||U===e.oids.sha1||U===e.oids.sha224||U===e.oids.sha256||U===e.oids.sha384||U===e.oids.sha512||U===e.oids["sha512-224"]||U===e.oids["sha512-256"])){var W=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw W.oid=U,W}if((U===e.oids.md2||U===e.oids.md5)&&!("parameters"in M))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return P===M.digest}}:(T==="NONE"||T==="NULL"||T===null)&&(T={verify:function(P,k){return k=m(k,I,!0),P===k}});var B=a.rsa.decrypt(_,I,!0,!1);return T.verify(A,B,I.n.bitLength())},I},a.setRsaPrivateKey=a.rsa.setPrivateKey=function(x,g,I,A,_,T,$,B){var P={n:x,e:g,d:I,p:A,q:_,dP:T,dQ:$,qInv:B};return P.decrypt=function(k,O,M){typeof O=="string"?O=O.toUpperCase():O===void 0&&(O="RSAES-PKCS1-V1_5");var G=a.rsa.decrypt(k,P,!1,!1);if(O==="RSAES-PKCS1-V1_5")O={decode:m};else if(O==="RSA-OAEP"||O==="RSAES-OAEP")O={decode:function(W,U){return e.pkcs1.decode_rsa_oaep(U,W,M)}};else if(["RAW","NONE","NULL",null].indexOf(O)!==-1)O={decode:function(W){return W}};else throw new Error('Unsupported encryption scheme: "'+O+'".');return O.decode(G,P,!1)},P.sign=function(k,O){var M=!1;typeof O=="string"&&(O=O.toUpperCase()),O===void 0||O==="RSASSA-PKCS1-V1_5"?(O={encode:h},M=1):(O==="NONE"||O==="NULL"||O===null)&&(O={encode:function(){return k}},M=1);var G=O.encode(k,P.n.bitLength());return a.rsa.encrypt(G,P,M)},P},a.wrapRsaPrivateKey=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(0).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a.oids.rsaEncryption).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,r.toDer(x).getBytes())])},a.privateKeyFromAsn1=function(x){var g={},I=[];if(r.validate(x,s,g,I)&&(x=r.fromDer(e.util.createBuffer(g.privateKey))),g={},I=[],!r.validate(x,l,g,I)){var A=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw A.errors=I,A}var _,T,$,B,P,k,O,M;return _=e.util.createBuffer(g.privateKeyModulus).toHex(),T=e.util.createBuffer(g.privateKeyPublicExponent).toHex(),$=e.util.createBuffer(g.privateKeyPrivateExponent).toHex(),B=e.util.createBuffer(g.privateKeyPrime1).toHex(),P=e.util.createBuffer(g.privateKeyPrime2).toHex(),k=e.util.createBuffer(g.privateKeyExponent1).toHex(),O=e.util.createBuffer(g.privateKeyExponent2).toHex(),M=e.util.createBuffer(g.privateKeyCoefficient).toHex(),a.setRsaPrivateKey(new t(_,16),new t(T,16),new t($,16),new t(B,16),new t(P,16),new t(k,16),new t(O,16),new t(M,16))},a.privateKeyToAsn1=a.privateKeyToRSAPrivateKey=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(0).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.n)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.e)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.d)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.p)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.q)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.dP)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.dQ)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.qInv))])},a.publicKeyFromAsn1=function(x){var g={},I=[];if(r.validate(x,c,g,I)){var A=r.derToOid(g.publicKeyOid);if(A!==a.oids.rsaEncryption){var _=new Error("Cannot read public key. Unknown OID.");throw _.oid=A,_}x=g.rsaPublicKey}if(I=[],!r.validate(x,u,g,I)){var _=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw _.errors=I,_}var T=e.util.createBuffer(g.publicKeyModulus).toHex(),$=e.util.createBuffer(g.publicKeyExponent).toHex();return a.setRsaPublicKey(new t(T,16),new t($,16))},a.publicKeyToAsn1=a.publicKeyToSubjectPublicKeyInfo=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a.oids.rsaEncryption).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.BITSTRING,!1,[a.publicKeyToRSAPublicKey(x)])])},a.publicKeyToRSAPublicKey=function(x){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.n)),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,f(x.e))])};function v(x,g,I){var A=e.util.createBuffer(),_=Math.ceil(g.n.bitLength()/8);if(x.length>_-11){var T=new Error("Message is too long for PKCS#1 v1.5 padding.");throw T.length=x.length,T.max=_-11,T}A.putByte(0),A.putByte(I);var $=_-3-x.length,B;if(I===0||I===1){B=I===0?0:255;for(var P=0;P<$;++P)A.putByte(B)}else for(;$>0;){for(var k=0,O=e.random.getBytes($),P=0;P<$;++P)B=O.charCodeAt(P),B===0?++k:A.putByte(B);$=k}return A.putByte(0),A.putBytes(x),A}function m(x,g,I,A){var _=Math.ceil(g.n.bitLength()/8),T=e.util.createBuffer(x),$=T.getByte(),B=T.getByte();if($!==0||I&&B!==0&&B!==1||!I&&B!=2||I&&B===0&&typeof A>"u")throw new Error("Encryption block is invalid.");var P=0;if(B===0){P=_-3-A;for(var k=0;k<P;++k)if(T.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(B===1)for(P=0;T.length()>1;){if(T.getByte()!==255){--T.read;break}++P}else if(B===2)for(P=0;T.length()>1;){if(T.getByte()===0){--T.read;break}++P}var O=T.getByte();if(O!==0||P!==_-3-T.length())throw new Error("Encryption block is invalid.");return T.getBytes()}function b(x,g,I){typeof g=="function"&&(I=g,g={}),g=g||{};var A={algorithm:{name:g.algorithm||"PRIMEINC",options:{workers:g.workers||2,workLoad:g.workLoad||100,workerScript:g.workerScript}}};"prng"in g&&(A.prng=g.prng),_();function _(){T(x.pBits,function(B,P){if(B)return I(B);if(x.p=P,x.q!==null)return $(B,x.q);T(x.qBits,$)})}function T(B,P){e.prime.generateProbablePrime(B,A,P)}function $(B,P){if(B)return I(B);if(x.q=P,x.p.compareTo(x.q)<0){var k=x.p;x.p=x.q,x.q=k}if(x.p.subtract(t.ONE).gcd(x.e).compareTo(t.ONE)!==0){x.p=null,_();return}if(x.q.subtract(t.ONE).gcd(x.e).compareTo(t.ONE)!==0){x.q=null,T(x.qBits,$);return}if(x.p1=x.p.subtract(t.ONE),x.q1=x.q.subtract(t.ONE),x.phi=x.p1.multiply(x.q1),x.phi.gcd(x.e).compareTo(t.ONE)!==0){x.p=x.q=null,_();return}if(x.n=x.p.multiply(x.q),x.n.bitLength()!==x.bits){x.q=null,T(x.qBits,$);return}var O=x.e.modInverse(x.phi);x.keys={privateKey:a.rsa.setPrivateKey(x.n,x.e,O,x.p,x.q,O.mod(x.p1),O.mod(x.q1),x.q.modInverse(x.p)),publicKey:a.rsa.setPublicKey(x.n,x.e)},I(null,x.keys)}}function f(x){var g=x.toString(16);g[0]>="8"&&(g="00"+g);var I=e.util.hexToBytes(g);return I.length>1&&(I.charCodeAt(0)===0&&(I.charCodeAt(1)&128)===0||I.charCodeAt(0)===255&&(I.charCodeAt(1)&128)===128)?I.substr(1):I}function y(x){return x<=100?27:x<=150?18:x<=200?15:x<=250?12:x<=300?9:x<=350?8:x<=400?7:x<=500?6:x<=600?5:x<=800?4:x<=1250?3:2}function C(x){return e.util.isNodejs&&typeof n[x]=="function"}function S(x){return typeof i.globalScope<"u"&&typeof i.globalScope.crypto=="object"&&typeof i.globalScope.crypto.subtle=="object"&&typeof i.globalScope.crypto.subtle[x]=="function"}function w(x){return typeof i.globalScope<"u"&&typeof i.globalScope.msCrypto=="object"&&typeof i.globalScope.msCrypto.subtle=="object"&&typeof i.globalScope.msCrypto.subtle[x]=="function"}function E(x){for(var g=e.util.hexToBytes(x.toString(16)),I=new Uint8Array(g.length),A=0;A<g.length;++A)I[A]=g.charCodeAt(A);return I}return zd}var Gd,xm;function wx(){if(xm)return Gd;xm=1;var e=Le();if(Ma(),Wr(),Ac(),mi(),Oa(),j0(),Oo(),Er(),Cx(),Bc(),Xe(),typeof t>"u")var t=e.jsbn.BigInteger;var n=e.asn1,r=e.pki=e.pki||{};Gd=r.pbe=e.pbe=e.pbe||{};var i=r.oids,a={name:"EncryptedPrivateKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},o={name:"PBES2Algorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},s={name:"pkcs-12PbeParams",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"iterations"}]};r.encryptPrivateKeyInfo=function(h,d,v){v=v||{},v.saltSize=v.saltSize||8,v.count=v.count||2048,v.algorithm=v.algorithm||"aes128",v.prfAlgorithm=v.prfAlgorithm||"sha1";var m=e.random.getBytesSync(v.saltSize),b=v.count,f=n.integerToDer(b),y,C,S;if(v.algorithm.indexOf("aes")===0||v.algorithm==="des"){var w,E,x;switch(v.algorithm){case"aes128":y=16,w=16,E=i["aes128-CBC"],x=e.aes.createEncryptionCipher;break;case"aes192":y=24,w=16,E=i["aes192-CBC"],x=e.aes.createEncryptionCipher;break;case"aes256":y=32,w=16,E=i["aes256-CBC"],x=e.aes.createEncryptionCipher;break;case"des":y=8,w=8,E=i.desCBC,x=e.des.createEncryptionCipher;break;default:var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=v.algorithm,g}var I="hmacWith"+v.prfAlgorithm.toUpperCase(),A=c(I),_=e.pkcs5.pbkdf2(d,m,b,y,A),T=e.random.getBytesSync(w),$=x(_);$.start(T),$.update(n.toDer(h)),$.finish(),S=$.output.getBytes();var B=p(m,f,y,I);C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.pkcs5PBES2).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.pkcs5PBKDF2).getBytes()),B]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(E).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,T)])])])}else if(v.algorithm==="3des"){y=24;var P=new e.util.ByteBuffer(m),_=r.pbe.generatePkcs12Key(d,P,1,b,y),T=r.pbe.generatePkcs12Key(d,P,2,b,y),$=e.des.createEncryptionCipher(_);$.start(T),$.update(n.toDer(h)),$.finish(),S=$.output.getBytes(),C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,m),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,f.getBytes())])])}else{var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=v.algorithm,g}var k=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[C,n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,S)]);return k},r.decryptPrivateKeyInfo=function(h,d){var v=null,m={},b=[];if(!n.validate(h,a,m,b)){var f=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=b,f}var y=n.derToOid(m.encryptionOid),C=r.pbe.getCipher(y,m.encryptionParams,d),S=e.util.createBuffer(m.encryptedData);return C.update(S),C.finish()&&(v=n.fromDer(C.output)),v},r.encryptedPrivateKeyToPem=function(h,d){var v={type:"ENCRYPTED PRIVATE KEY",body:n.toDer(h).getBytes()};return e.pem.encode(v,{maxline:d})},r.encryptedPrivateKeyFromPem=function(h){var d=e.pem.decode(h)[0];if(d.type!=="ENCRYPTED PRIVATE KEY"){var v=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw v.headerType=d.type,v}if(d.procType&&d.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return n.fromDer(d.body)},r.encryptRsaPrivateKey=function(h,d,v){if(v=v||{},!v.legacy){var m=r.wrapRsaPrivateKey(r.privateKeyToAsn1(h));return m=r.encryptPrivateKeyInfo(m,d,v),r.encryptedPrivateKeyToPem(m)}var b,f,y,C;switch(v.algorithm){case"aes128":b="AES-128-CBC",y=16,f=e.random.getBytesSync(16),C=e.aes.createEncryptionCipher;break;case"aes192":b="AES-192-CBC",y=24,f=e.random.getBytesSync(16),C=e.aes.createEncryptionCipher;break;case"aes256":b="AES-256-CBC",y=32,f=e.random.getBytesSync(16),C=e.aes.createEncryptionCipher;break;case"3des":b="DES-EDE3-CBC",y=24,f=e.random.getBytesSync(8),C=e.des.createEncryptionCipher;break;case"des":b="DES-CBC",y=8,f=e.random.getBytesSync(8),C=e.des.createEncryptionCipher;break;default:var S=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+v.algorithm+'".');throw S.algorithm=v.algorithm,S}var w=e.pbe.opensslDeriveBytes(d,f.substr(0,8),y),E=C(w);E.start(f),E.update(n.toDer(r.privateKeyToAsn1(h))),E.finish();var x={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:b,parameters:e.util.bytesToHex(f).toUpperCase()},body:E.output.getBytes()};return e.pem.encode(x)},r.decryptRsaPrivateKey=function(h,d){var v=null,m=e.pem.decode(h)[0];if(m.type!=="ENCRYPTED PRIVATE KEY"&&m.type!=="PRIVATE KEY"&&m.type!=="RSA PRIVATE KEY"){var b=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw b.headerType=b,b}if(m.procType&&m.procType.type==="ENCRYPTED"){var f,y;switch(m.dekInfo.algorithm){case"DES-CBC":f=8,y=e.des.createDecryptionCipher;break;case"DES-EDE3-CBC":f=24,y=e.des.createDecryptionCipher;break;case"AES-128-CBC":f=16,y=e.aes.createDecryptionCipher;break;case"AES-192-CBC":f=24,y=e.aes.createDecryptionCipher;break;case"AES-256-CBC":f=32,y=e.aes.createDecryptionCipher;break;case"RC2-40-CBC":f=5,y=function(x){return e.rc2.createDecryptionCipher(x,40)};break;case"RC2-64-CBC":f=8,y=function(x){return e.rc2.createDecryptionCipher(x,64)};break;case"RC2-128-CBC":f=16,y=function(x){return e.rc2.createDecryptionCipher(x,128)};break;default:var b=new Error('Could not decrypt private key; unsupported encryption algorithm "'+m.dekInfo.algorithm+'".');throw b.algorithm=m.dekInfo.algorithm,b}var C=e.util.hexToBytes(m.dekInfo.parameters),S=e.pbe.opensslDeriveBytes(d,C.substr(0,8),f),w=y(S);if(w.start(C),w.update(e.util.createBuffer(m.body)),w.finish())v=w.output.getBytes();else return v}else v=m.body;return m.type==="ENCRYPTED PRIVATE KEY"?v=r.decryptPrivateKeyInfo(n.fromDer(v),d):v=n.fromDer(v),v!==null&&(v=r.privateKeyFromAsn1(v)),v},r.pbe.generatePkcs12Key=function(h,d,v,m,b,f){var y,C;if(typeof f>"u"||f===null){if(!("sha1"in e.md))throw new Error('"sha1" hash algorithm unavailable.');f=e.md.sha1.create()}var S=f.digestLength,w=f.blockLength,E=new e.util.ByteBuffer,x=new e.util.ByteBuffer;if(h!=null){for(C=0;C<h.length;C++)x.putInt16(h.charCodeAt(C));x.putInt16(0)}var g=x.length(),I=d.length(),A=new e.util.ByteBuffer;A.fillWithByte(v,w);var _=w*Math.ceil(I/w),T=new e.util.ByteBuffer;for(C=0;C<_;C++)T.putByte(d.at(C%I));var $=w*Math.ceil(g/w),B=new e.util.ByteBuffer;for(C=0;C<$;C++)B.putByte(x.at(C%g));var P=T;P.putBuffer(B);for(var k=Math.ceil(b/S),O=1;O<=k;O++){var M=new e.util.ByteBuffer;M.putBytes(A.bytes()),M.putBytes(P.bytes());for(var G=0;G<m;G++)f.start(),f.update(M.getBytes()),M=f.digest();var W=new e.util.ByteBuffer;for(C=0;C<w;C++)W.putByte(M.at(C%S));var U=Math.ceil(I/w)+Math.ceil(g/w),q=new e.util.ByteBuffer;for(y=0;y<U;y++){var Q=new e.util.ByteBuffer(P.getBytes(w)),Z=511;for(C=W.length()-1;C>=0;C--)Z=Z>>8,Z+=W.at(C)+Q.at(C),Q.setAt(C,Z&255);q.putBuffer(Q)}P=q,E.putBuffer(M)}return E.truncate(E.length()-b),E},r.pbe.getCipher=function(h,d,v){switch(h){case r.oids.pkcs5PBES2:return r.pbe.getCipherForPBES2(h,d,v);case r.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case r.oids["pbewithSHAAnd40BitRC2-CBC"]:return r.pbe.getCipherForPKCS12PBE(h,d,v);default:var m=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw m.oid=h,m.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],m}},r.pbe.getCipherForPBES2=function(h,d,v){var m={},b=[];if(!n.validate(d,o,m,b)){var f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=b,f}if(h=n.derToOid(m.kdfOid),h!==r.oids.pkcs5PBKDF2){var f=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw f.oid=h,f.supportedOids=["pkcs5PBKDF2"],f}if(h=n.derToOid(m.encOid),h!==r.oids["aes128-CBC"]&&h!==r.oids["aes192-CBC"]&&h!==r.oids["aes256-CBC"]&&h!==r.oids["des-EDE3-CBC"]&&h!==r.oids.desCBC){var f=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw f.oid=h,f.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],f}var y=m.kdfSalt,C=e.util.createBuffer(m.kdfIterationCount);C=C.getInt(C.length()<<3);var S,w;switch(r.oids[h]){case"aes128-CBC":S=16,w=e.aes.createDecryptionCipher;break;case"aes192-CBC":S=24,w=e.aes.createDecryptionCipher;break;case"aes256-CBC":S=32,w=e.aes.createDecryptionCipher;break;case"des-EDE3-CBC":S=24,w=e.des.createDecryptionCipher;break;case"desCBC":S=8,w=e.des.createDecryptionCipher;break}var E=u(m.prfOid),x=e.pkcs5.pbkdf2(v,y,C,S,E),g=m.encIv,I=w(x);return I.start(g),I},r.pbe.getCipherForPKCS12PBE=function(h,d,v){var m={},b=[];if(!n.validate(d,s,m,b)){var f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=b,f}var y=e.util.createBuffer(m.salt),C=e.util.createBuffer(m.iterations);C=C.getInt(C.length()<<3);var S,w,E;switch(h){case r.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:S=24,w=8,E=e.des.startDecrypting;break;case r.oids["pbewithSHAAnd40BitRC2-CBC"]:S=5,w=8,E=function(_,T){var $=e.rc2.createDecryptionCipher(_,40);return $.start(T,null),$};break;default:var f=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw f.oid=h,f}var x=u(m.prfOid),g=r.pbe.generatePkcs12Key(v,y,1,C,S,x);x.start();var I=r.pbe.generatePkcs12Key(v,y,2,C,w,x);return E(g,I)},r.pbe.opensslDeriveBytes=function(h,d,v,m){if(typeof m>"u"||m===null){if(!("md5"in e.md))throw new Error('"md5" hash algorithm unavailable.');m=e.md.md5.create()}d===null&&(d="");for(var b=[l(m,h+d)],f=16,y=1;f<v;++y,f+=16)b.push(l(m,b[y-1]+h+d));return b.join("").substr(0,v)};function l(h,d){return h.start().update(d).digest().getBytes()}function u(h){var d;if(!h)d="hmacWithSHA1";else if(d=r.oids[n.derToOid(h)],!d){var v=new Error("Unsupported PRF OID.");throw v.oid=h,v.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],v}return c(d)}function c(h){var d=e.md;switch(h){case"hmacWithSHA224":d=e.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":h=h.substr(8).toLowerCase();break;default:var v=new Error("Unsupported PRF algorithm.");throw v.algorithm=h,v.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],v}if(!d||!(h in d))throw new Error("Unknown hash algorithm: "+h);return d[h].create()}function p(h,d,v,m){var b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,h),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,d.getBytes())]);return m!=="hmacWithSHA1"&&b.value.push(n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,e.util.hexToBytes(v.toString(16))),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(r.oids[m]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])),b}return Gd}var Wd={exports:{}},Ud={exports:{}},Cm;function Ix(){if(Cm)return Ud.exports;Cm=1;var e=Le();Wr(),Xe();var t=e.asn1,n=Ud.exports=e.pkcs7asn1=e.pkcs7asn1||{};e.pkcs7=e.pkcs7||{},e.pkcs7.asn1=n;var r={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};n.contentInfoValidator=r;var i={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};n.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(i)},n.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"}].concat(i)};var a={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};return n.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},r,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[a]}]},n.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]},Ud.exports}var Xd={exports:{}},Yd={exports:{}},Em;function _x(){if(Em)return Yd.exports;Em=1;var e=Le();Xe(),e.mgf=e.mgf||{};var t=Yd.exports=e.mgf.mgf1=e.mgf1=e.mgf1||{};return t.create=function(n){var r={generate:function(i,a){for(var o=new e.util.ByteBuffer,s=Math.ceil(a/n.digestLength),l=0;l<s;l++){var u=new e.util.ByteBuffer;u.putInt32(l),n.start(),n.update(i+u.getBytes()),o.putBuffer(n.digest())}return o.truncate(o.length()-a),o.getBytes()}};return r},Yd.exports}var Kd,Sm;function sD(){if(Sm)return Kd;Sm=1;var e=Le();return _x(),Kd=e.mgf=e.mgf||{},e.mgf.mgf1=e.mgf1,Kd}var Zd={exports:{}},wm;function z0(){if(wm)return Zd.exports;wm=1;var e=Le();Er(),Xe();var t=Zd.exports=e.pss=e.pss||{};return t.create=function(n){arguments.length===3&&(n={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var r=n.md,i=n.mgf,a=r.digestLength,o=n.salt||null;typeof o=="string"&&(o=e.util.createBuffer(o));var s;if("saltLength"in n)s=n.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var l=n.prng||e.random,u={};return u.encode=function(c,p){var h,d=p-1,v=Math.ceil(d/8),m=c.digest().getBytes();if(v<a+s+2)throw new Error("Message is too long to encrypt.");var b;o===null?b=l.getBytesSync(s):b=o.bytes();var f=new e.util.ByteBuffer;f.fillWithByte(0,8),f.putBytes(m),f.putBytes(b),r.start(),r.update(f.getBytes());var y=r.digest().getBytes(),C=new e.util.ByteBuffer;C.fillWithByte(0,v-s-a-2),C.putByte(1),C.putBytes(b);var S=C.getBytes(),w=v-a-1,E=i.generate(y,w),x="";for(h=0;h<w;h++)x+=String.fromCharCode(S.charCodeAt(h)^E.charCodeAt(h));var g=65280>>8*v-d&255;return x=String.fromCharCode(x.charCodeAt(0)&~g)+x.substr(1),x+y+"¼"},u.verify=function(c,p,h){var d,v=h-1,m=Math.ceil(v/8);if(p=p.substr(-m),m<a+s+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(p.charCodeAt(m-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var b=m-a-1,f=p.substr(0,b),y=p.substr(b,a),C=65280>>8*m-v&255;if((f.charCodeAt(0)&C)!==0)throw new Error("Bits beyond keysize not zero as expected.");var S=i.generate(y,b),w="";for(d=0;d<b;d++)w+=String.fromCharCode(f.charCodeAt(d)^S.charCodeAt(d));w=String.fromCharCode(w.charCodeAt(0)&~C)+w.substr(1);var E=m-a-s-2;for(d=0;d<E;d++)if(w.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(w.charCodeAt(E)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var x=w.substr(-s),g=new e.util.ByteBuffer;g.fillWithByte(0,8),g.putBytes(c),g.putBytes(x),r.start(),r.update(g.getBytes());var I=r.digest().getBytes();return y===I},u},Zd.exports}var Im;function G0(){if(Im)return Xd.exports;Im=1;var e=Le();Ma(),Wr(),Ac(),mi(),sD(),Oa(),Oo(),z0(),Bc(),Xe();var t=e.asn1,n=Xd.exports=e.pki=e.pki||{},r=n.oids,i={};i.CN=r.commonName,i.commonName="CN",i.C=r.countryName,i.countryName="C",i.L=r.localityName,i.localityName="L",i.ST=r.stateOrProvinceName,i.stateOrProvinceName="ST",i.O=r.organizationName,i.organizationName="O",i.OU=r.organizationalUnitName,i.organizationalUnitName="OU",i.E=r.emailAddress,i.emailAddress="E";var a=e.pki.rsa.publicKeyValidator,o={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},a,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},s={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},a,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},u={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};n.RDNAttributesAsArray=function(E,x){for(var g=[],I,A,_,T=0;T<E.value.length;++T){I=E.value[T];for(var $=0;$<I.value.length;++$)_={},A=I.value[$],_.type=t.derToOid(A.value[0].value),_.value=A.value[1].value,_.valueTagClass=A.value[1].type,_.type in r&&(_.name=r[_.type],_.name in i&&(_.shortName=i[_.name])),x&&(x.update(_.type),x.update(_.value)),g.push(_)}return g},n.CRIAttributesAsArray=function(E){for(var x=[],g=0;g<E.length;++g)for(var I=E[g],A=t.derToOid(I.value[0].value),_=I.value[1].value,T=0;T<_.length;++T){var $={};if($.type=A,$.value=_[T].value,$.valueTagClass=_[T].type,$.type in r&&($.name=r[$.type],$.name in i&&($.shortName=i[$.name])),$.type===r.extensionRequest){$.extensions=[];for(var B=0;B<$.value.length;++B)$.extensions.push(n.certificateExtensionFromAsn1($.value[B]))}x.push($)}return x};function c(E,x){typeof x=="string"&&(x={shortName:x});for(var g=null,I,A=0;g===null&&A<E.attributes.length;++A)I=E.attributes[A],(x.type&&x.type===I.type||x.name&&x.name===I.name||x.shortName&&x.shortName===I.shortName)&&(g=I);return g}var p=function(E,x,g){var I={};if(E!==r["RSASSA-PSS"])return I;g&&(I={hash:{algorithmOid:r.sha1},mgf:{algorithmOid:r.mgf1,hash:{algorithmOid:r.sha1}},saltLength:20});var A={},_=[];if(!t.validate(x,s,A,_)){var T=new Error("Cannot read RSASSA-PSS parameter block.");throw T.errors=_,T}return A.hashOid!==void 0&&(I.hash=I.hash||{},I.hash.algorithmOid=t.derToOid(A.hashOid)),A.maskGenOid!==void 0&&(I.mgf=I.mgf||{},I.mgf.algorithmOid=t.derToOid(A.maskGenOid),I.mgf.hash=I.mgf.hash||{},I.mgf.hash.algorithmOid=t.derToOid(A.maskGenHashOid)),A.saltLength!==void 0&&(I.saltLength=A.saltLength.charCodeAt(0)),I},h=function(E){switch(r[E.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return e.md.sha1.create();case"md5WithRSAEncryption":return e.md.md5.create();case"sha256WithRSAEncryption":return e.md.sha256.create();case"sha384WithRSAEncryption":return e.md.sha384.create();case"sha512WithRSAEncryption":return e.md.sha512.create();case"RSASSA-PSS":return e.md.sha256.create();default:var x=new Error("Could not compute "+E.type+" digest. Unknown signature OID.");throw x.signatureOid=E.signatureOid,x}},d=function(E){var x=E.certificate,g;switch(x.signatureOid){case r.sha1WithRSAEncryption:case r.sha1WithRSASignature:break;case r["RSASSA-PSS"]:var I,A;if(I=r[x.signatureParameters.mgf.hash.algorithmOid],I===void 0||e.md[I]===void 0){var _=new Error("Unsupported MGF hash function.");throw _.oid=x.signatureParameters.mgf.hash.algorithmOid,_.name=I,_}if(A=r[x.signatureParameters.mgf.algorithmOid],A===void 0||e.mgf[A]===void 0){var _=new Error("Unsupported MGF function.");throw _.oid=x.signatureParameters.mgf.algorithmOid,_.name=A,_}if(A=e.mgf[A].create(e.md[I].create()),I=r[x.signatureParameters.hash.algorithmOid],I===void 0||e.md[I]===void 0){var _=new Error("Unsupported RSASSA-PSS hash function.");throw _.oid=x.signatureParameters.hash.algorithmOid,_.name=I,_}g=e.pss.create(e.md[I].create(),A,x.signatureParameters.saltLength);break}return x.publicKey.verify(E.md.digest().getBytes(),E.signature,g)};n.certificateFromPem=function(E,x,g){var I=e.pem.decode(E)[0];if(I.type!=="CERTIFICATE"&&I.type!=="X509 CERTIFICATE"&&I.type!=="TRUSTED CERTIFICATE"){var A=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw A.headerType=I.type,A}if(I.procType&&I.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var _=t.fromDer(I.body,g);return n.certificateFromAsn1(_,x)},n.certificateToPem=function(E,x){var g={type:"CERTIFICATE",body:t.toDer(n.certificateToAsn1(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.publicKeyFromPem=function(E){var x=e.pem.decode(E)[0];if(x.type!=="PUBLIC KEY"&&x.type!=="RSA PUBLIC KEY"){var g=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw g.headerType=x.type,g}if(x.procType&&x.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var I=t.fromDer(x.body);return n.publicKeyFromAsn1(I)},n.publicKeyToPem=function(E,x){var g={type:"PUBLIC KEY",body:t.toDer(n.publicKeyToAsn1(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.publicKeyToRSAPublicKeyPem=function(E,x){var g={type:"RSA PUBLIC KEY",body:t.toDer(n.publicKeyToRSAPublicKey(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.getPublicKeyFingerprint=function(E,x){x=x||{};var g=x.md||e.md.sha1.create(),I=x.type||"RSAPublicKey",A;switch(I){case"RSAPublicKey":A=t.toDer(n.publicKeyToRSAPublicKey(E)).getBytes();break;case"SubjectPublicKeyInfo":A=t.toDer(n.publicKeyToAsn1(E)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+x.type+'".')}g.start(),g.update(A);var _=g.digest();if(x.encoding==="hex"){var T=_.toHex();return x.delimiter?T.match(/.{2}/g).join(x.delimiter):T}else{if(x.encoding==="binary")return _.getBytes();if(x.encoding)throw new Error('Unknown encoding "'+x.encoding+'".')}return _},n.certificationRequestFromPem=function(E,x,g){var I=e.pem.decode(E)[0];if(I.type!=="CERTIFICATE REQUEST"){var A=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw A.headerType=I.type,A}if(I.procType&&I.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var _=t.fromDer(I.body,g);return n.certificationRequestFromAsn1(_,x)},n.certificationRequestToPem=function(E,x){var g={type:"CERTIFICATE REQUEST",body:t.toDer(n.certificationRequestToAsn1(E)).getBytes()};return e.pem.encode(g,{maxline:x})},n.createCertificate=function(){var E={};return E.version=2,E.serialNumber="00",E.signatureOid=null,E.signature=null,E.siginfo={},E.siginfo.algorithmOid=null,E.validity={},E.validity.notBefore=new Date,E.validity.notAfter=new Date,E.issuer={},E.issuer.getField=function(x){return c(E.issuer,x)},E.issuer.addField=function(x){m([x]),E.issuer.attributes.push(x)},E.issuer.attributes=[],E.issuer.hash=null,E.subject={},E.subject.getField=function(x){return c(E.subject,x)},E.subject.addField=function(x){m([x]),E.subject.attributes.push(x)},E.subject.attributes=[],E.subject.hash=null,E.extensions=[],E.publicKey=null,E.md=null,E.setSubject=function(x,g){m(x),E.subject.attributes=x,delete E.subject.uniqueId,g&&(E.subject.uniqueId=g),E.subject.hash=null},E.setIssuer=function(x,g){m(x),E.issuer.attributes=x,delete E.issuer.uniqueId,g&&(E.issuer.uniqueId=g),E.issuer.hash=null},E.setExtensions=function(x){for(var g=0;g<x.length;++g)b(x[g],{cert:E});E.extensions=x},E.getExtension=function(x){typeof x=="string"&&(x={name:x});for(var g=null,I,A=0;g===null&&A<E.extensions.length;++A)I=E.extensions[A],(x.id&&I.id===x.id||x.name&&I.name===x.name)&&(g=I);return g},E.sign=function(x,g){E.md=g||e.md.sha1.create();var I=r[E.md.algorithm+"WithRSAEncryption"];if(!I){var A=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw A.algorithm=E.md.algorithm,A}E.signatureOid=E.siginfo.algorithmOid=I,E.tbsCertificate=n.getTBSCertificate(E);var _=t.toDer(E.tbsCertificate);E.md.update(_.getBytes()),E.signature=x.sign(E.md)},E.verify=function(x){var g=!1;if(!E.issued(x)){var I=x.issuer,A=E.subject,_=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw _.expectedIssuer=A.attributes,_.actualIssuer=I.attributes,_}var T=x.md;if(T===null){T=h({signatureOid:x.signatureOid,type:"certificate"});var $=x.tbsCertificate||n.getTBSCertificate(x),B=t.toDer($);T.update(B.getBytes())}return T!==null&&(g=d({certificate:E,md:T,signature:x.signature})),g},E.isIssuer=function(x){var g=!1,I=E.issuer,A=x.subject;if(I.hash&&A.hash)g=I.hash===A.hash;else if(I.attributes.length===A.attributes.length){g=!0;for(var _,T,$=0;g&&$<I.attributes.length;++$)_=I.attributes[$],T=A.attributes[$],(_.type!==T.type||_.value!==T.value)&&(g=!1)}return g},E.issued=function(x){return x.isIssuer(E)},E.generateSubjectKeyIdentifier=function(){return n.getPublicKeyFingerprint(E.publicKey,{type:"RSAPublicKey"})},E.verifySubjectKeyIdentifier=function(){for(var x=r.subjectKeyIdentifier,g=0;g<E.extensions.length;++g){var I=E.extensions[g];if(I.id===x){var A=E.generateSubjectKeyIdentifier().getBytes();return e.util.hexToBytes(I.subjectKeyIdentifier)===A}}return!1},E},n.certificateFromAsn1=function(E,x){var g={},I=[];if(!t.validate(E,o,g,I)){var A=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw A.errors=I,A}var _=t.derToOid(g.publicKeyOid);if(_!==n.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var T=n.createCertificate();T.version=g.certVersion?g.certVersion.charCodeAt(0):0;var $=e.util.createBuffer(g.certSerialNumber);T.serialNumber=$.toHex(),T.signatureOid=e.asn1.derToOid(g.certSignatureOid),T.signatureParameters=p(T.signatureOid,g.certSignatureParams,!0),T.siginfo.algorithmOid=e.asn1.derToOid(g.certinfoSignatureOid),T.siginfo.parameters=p(T.siginfo.algorithmOid,g.certinfoSignatureParams,!1),T.signature=g.certSignature;var B=[];if(g.certValidity1UTCTime!==void 0&&B.push(t.utcTimeToDate(g.certValidity1UTCTime)),g.certValidity2GeneralizedTime!==void 0&&B.push(t.generalizedTimeToDate(g.certValidity2GeneralizedTime)),g.certValidity3UTCTime!==void 0&&B.push(t.utcTimeToDate(g.certValidity3UTCTime)),g.certValidity4GeneralizedTime!==void 0&&B.push(t.generalizedTimeToDate(g.certValidity4GeneralizedTime)),B.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(B.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(T.validity.notBefore=B[0],T.validity.notAfter=B[1],T.tbsCertificate=g.tbsCertificate,x){T.md=h({signatureOid:T.signatureOid,type:"certificate"});var P=t.toDer(T.tbsCertificate);T.md.update(P.getBytes())}var k=e.md.sha1.create(),O=t.toDer(g.certIssuer);k.update(O.getBytes()),T.issuer.getField=function(W){return c(T.issuer,W)},T.issuer.addField=function(W){m([W]),T.issuer.attributes.push(W)},T.issuer.attributes=n.RDNAttributesAsArray(g.certIssuer),g.certIssuerUniqueId&&(T.issuer.uniqueId=g.certIssuerUniqueId),T.issuer.hash=k.digest().toHex();var M=e.md.sha1.create(),G=t.toDer(g.certSubject);return M.update(G.getBytes()),T.subject.getField=function(W){return c(T.subject,W)},T.subject.addField=function(W){m([W]),T.subject.attributes.push(W)},T.subject.attributes=n.RDNAttributesAsArray(g.certSubject),g.certSubjectUniqueId&&(T.subject.uniqueId=g.certSubjectUniqueId),T.subject.hash=M.digest().toHex(),g.certExtensions?T.extensions=n.certificateExtensionsFromAsn1(g.certExtensions):T.extensions=[],T.publicKey=n.publicKeyFromAsn1(g.subjectPublicKeyInfo),T},n.certificateExtensionsFromAsn1=function(E){for(var x=[],g=0;g<E.value.length;++g)for(var I=E.value[g],A=0;A<I.value.length;++A)x.push(n.certificateExtensionFromAsn1(I.value[A]));return x},n.certificateExtensionFromAsn1=function(E){var x={};if(x.id=t.derToOid(E.value[0].value),x.critical=!1,E.value[1].type===t.Type.BOOLEAN?(x.critical=E.value[1].value.charCodeAt(0)!==0,x.value=E.value[2].value):x.value=E.value[1].value,x.id in r){if(x.name=r[x.id],x.name==="keyUsage"){var g=t.fromDer(x.value),I=0,A=0;g.value.length>1&&(I=g.value.charCodeAt(1),A=g.value.length>2?g.value.charCodeAt(2):0),x.digitalSignature=(I&128)===128,x.nonRepudiation=(I&64)===64,x.keyEncipherment=(I&32)===32,x.dataEncipherment=(I&16)===16,x.keyAgreement=(I&8)===8,x.keyCertSign=(I&4)===4,x.cRLSign=(I&2)===2,x.encipherOnly=(I&1)===1,x.decipherOnly=(A&128)===128}else if(x.name==="basicConstraints"){var g=t.fromDer(x.value);g.value.length>0&&g.value[0].type===t.Type.BOOLEAN?x.cA=g.value[0].value.charCodeAt(0)!==0:x.cA=!1;var _=null;g.value.length>0&&g.value[0].type===t.Type.INTEGER?_=g.value[0].value:g.value.length>1&&(_=g.value[1].value),_!==null&&(x.pathLenConstraint=t.derToInteger(_))}else if(x.name==="extKeyUsage")for(var g=t.fromDer(x.value),T=0;T<g.value.length;++T){var $=t.derToOid(g.value[T].value);$ in r?x[r[$]]=!0:x[$]=!0}else if(x.name==="nsCertType"){var g=t.fromDer(x.value),I=0;g.value.length>1&&(I=g.value.charCodeAt(1)),x.client=(I&128)===128,x.server=(I&64)===64,x.email=(I&32)===32,x.objsign=(I&16)===16,x.reserved=(I&8)===8,x.sslCA=(I&4)===4,x.emailCA=(I&2)===2,x.objCA=(I&1)===1}else if(x.name==="subjectAltName"||x.name==="issuerAltName"){x.altNames=[];for(var B,g=t.fromDer(x.value),P=0;P<g.value.length;++P){B=g.value[P];var k={type:B.type,value:B.value};switch(x.altNames.push(k),B.type){case 1:case 2:case 6:break;case 7:k.ip=e.util.bytesToIP(B.value);break;case 8:k.oid=t.derToOid(B.value);break}}}else if(x.name==="subjectKeyIdentifier"){var g=t.fromDer(x.value);x.subjectKeyIdentifier=e.util.bytesToHex(g.value)}}return x},n.certificationRequestFromAsn1=function(E,x){var g={},I=[];if(!t.validate(E,u,g,I)){var A=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw A.errors=I,A}var _=t.derToOid(g.publicKeyOid);if(_!==n.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var T=n.createCertificationRequest();if(T.version=g.csrVersion?g.csrVersion.charCodeAt(0):0,T.signatureOid=e.asn1.derToOid(g.csrSignatureOid),T.signatureParameters=p(T.signatureOid,g.csrSignatureParams,!0),T.siginfo.algorithmOid=e.asn1.derToOid(g.csrSignatureOid),T.siginfo.parameters=p(T.siginfo.algorithmOid,g.csrSignatureParams,!1),T.signature=g.csrSignature,T.certificationRequestInfo=g.certificationRequestInfo,x){T.md=h({signatureOid:T.signatureOid,type:"certification request"});var $=t.toDer(T.certificationRequestInfo);T.md.update($.getBytes())}var B=e.md.sha1.create();return T.subject.getField=function(P){return c(T.subject,P)},T.subject.addField=function(P){m([P]),T.subject.attributes.push(P)},T.subject.attributes=n.RDNAttributesAsArray(g.certificationRequestInfoSubject,B),T.subject.hash=B.digest().toHex(),T.publicKey=n.publicKeyFromAsn1(g.subjectPublicKeyInfo),T.getAttribute=function(P){return c(T,P)},T.addAttribute=function(P){m([P]),T.attributes.push(P)},T.attributes=n.CRIAttributesAsArray(g.certificationRequestInfoAttributes||[]),T},n.createCertificationRequest=function(){var E={};return E.version=0,E.signatureOid=null,E.signature=null,E.siginfo={},E.siginfo.algorithmOid=null,E.subject={},E.subject.getField=function(x){return c(E.subject,x)},E.subject.addField=function(x){m([x]),E.subject.attributes.push(x)},E.subject.attributes=[],E.subject.hash=null,E.publicKey=null,E.attributes=[],E.getAttribute=function(x){return c(E,x)},E.addAttribute=function(x){m([x]),E.attributes.push(x)},E.md=null,E.setSubject=function(x){m(x),E.subject.attributes=x,E.subject.hash=null},E.setAttributes=function(x){m(x),E.attributes=x},E.sign=function(x,g){E.md=g||e.md.sha1.create();var I=r[E.md.algorithm+"WithRSAEncryption"];if(!I){var A=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw A.algorithm=E.md.algorithm,A}E.signatureOid=E.siginfo.algorithmOid=I,E.certificationRequestInfo=n.getCertificationRequestInfo(E);var _=t.toDer(E.certificationRequestInfo);E.md.update(_.getBytes()),E.signature=x.sign(E.md)},E.verify=function(){var x=!1,g=E.md;if(g===null){g=h({signatureOid:E.signatureOid,type:"certification request"});var I=E.certificationRequestInfo||n.getCertificationRequestInfo(E),A=t.toDer(I);g.update(A.getBytes())}return g!==null&&(x=d({certificate:E,md:g,signature:E.signature})),x},E};function v(E){for(var x=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),g,I,A=E.attributes,_=0;_<A.length;++_){g=A[_];var T=g.value,$=t.Type.PRINTABLESTRING;"valueTagClass"in g&&($=g.valueTagClass,$===t.Type.UTF8&&(T=e.util.encodeUtf8(T))),I=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(g.type).getBytes()),t.create(t.Class.UNIVERSAL,$,!1,T)])]),x.value.push(I)}return x}function m(E){for(var x,g=0;g<E.length;++g){if(x=E[g],typeof x.name>"u"&&(x.type&&x.type in n.oids?x.name=n.oids[x.type]:x.shortName&&x.shortName in i&&(x.name=n.oids[i[x.shortName]])),typeof x.type>"u")if(x.name&&x.name in n.oids)x.type=n.oids[x.name];else{var I=new Error("Attribute type not specified.");throw I.attribute=x,I}if(typeof x.shortName>"u"&&x.name&&x.name in i&&(x.shortName=i[x.name]),x.type===r.extensionRequest&&(x.valueConstructed=!0,x.valueTagClass=t.Type.SEQUENCE,!x.value&&x.extensions)){x.value=[];for(var A=0;A<x.extensions.length;++A)x.value.push(n.certificateExtensionToAsn1(b(x.extensions[A])))}if(typeof x.value>"u"){var I=new Error("Attribute value not specified.");throw I.attribute=x,I}}}function b(E,x){if(x=x||{},typeof E.name>"u"&&E.id&&E.id in n.oids&&(E.name=n.oids[E.id]),typeof E.id>"u")if(E.name&&E.name in n.oids)E.id=n.oids[E.name];else{var g=new Error("Extension ID not specified.");throw g.extension=E,g}if(typeof E.value<"u")return E;if(E.name==="keyUsage"){var I=0,A=0,_=0;E.digitalSignature&&(A|=128,I=7),E.nonRepudiation&&(A|=64,I=6),E.keyEncipherment&&(A|=32,I=5),E.dataEncipherment&&(A|=16,I=4),E.keyAgreement&&(A|=8,I=3),E.keyCertSign&&(A|=4,I=2),E.cRLSign&&(A|=2,I=1),E.encipherOnly&&(A|=1,I=0),E.decipherOnly&&(_|=128,I=7);var T=String.fromCharCode(I);_!==0?T+=String.fromCharCode(A)+String.fromCharCode(_):A!==0&&(T+=String.fromCharCode(A)),E.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,T)}else if(E.name==="basicConstraints")E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),E.cA&&E.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in E&&E.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.pathLenConstraint).getBytes()));else if(E.name==="extKeyUsage"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var $=E.value.value;for(var B in E)E[B]===!0&&(B in r?$.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r[B]).getBytes())):B.indexOf(".")!==-1&&$.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(B).getBytes())))}else if(E.name==="nsCertType"){var I=0,A=0;E.client&&(A|=128,I=7),E.server&&(A|=64,I=6),E.email&&(A|=32,I=5),E.objsign&&(A|=16,I=4),E.reserved&&(A|=8,I=3),E.sslCA&&(A|=4,I=2),E.emailCA&&(A|=2,I=1),E.objCA&&(A|=1,I=0);var T=String.fromCharCode(I);A!==0&&(T+=String.fromCharCode(A)),E.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,T)}else if(E.name==="subjectAltName"||E.name==="issuerAltName"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var P,k=0;k<E.altNames.length;++k){P=E.altNames[k];var T=P.value;if(P.type===7&&P.ip){if(T=e.util.bytesFromIP(P.ip),T===null){var g=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw g.extension=E,g}}else P.type===8&&(P.oid?T=t.oidToDer(t.oidToDer(P.oid)):T=t.oidToDer(T));E.value.value.push(t.create(t.Class.CONTEXT_SPECIFIC,P.type,!1,T))}}else if(E.name==="nsComment"&&x.cert){if(!/^[\x00-\x7F]*$/.test(E.comment)||E.comment.length<1||E.comment.length>128)throw new Error('Invalid "nsComment" content.');E.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,E.comment)}else if(E.name==="subjectKeyIdentifier"&&x.cert){var O=x.cert.generateSubjectKeyIdentifier();E.subjectKeyIdentifier=O.toHex(),E.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,O.getBytes())}else if(E.name==="authorityKeyIdentifier"&&x.cert){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var $=E.value.value;if(E.keyIdentifier){var M=E.keyIdentifier===!0?x.cert.generateSubjectKeyIdentifier().getBytes():E.keyIdentifier;$.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,M))}if(E.authorityCertIssuer){var G=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[v(E.authorityCertIssuer===!0?x.cert.issuer:E.authorityCertIssuer)])];$.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,G))}if(E.serialNumber){var W=e.util.hexToBytes(E.serialNumber===!0?x.cert.serialNumber:E.serialNumber);$.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,W))}}else if(E.name==="cRLDistributionPoints"){E.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var $=E.value.value,U=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),q=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]),P,k=0;k<E.altNames.length;++k){P=E.altNames[k];var T=P.value;if(P.type===7&&P.ip){if(T=e.util.bytesFromIP(P.ip),T===null){var g=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw g.extension=E,g}}else P.type===8&&(P.oid?T=t.oidToDer(t.oidToDer(P.oid)):T=t.oidToDer(T));q.value.push(t.create(t.Class.CONTEXT_SPECIFIC,P.type,!1,T))}U.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[q])),$.push(U)}if(typeof E.value>"u"){var g=new Error("Extension value not specified.");throw g.extension=E,g}return E}function f(E,x){switch(E){case r["RSASSA-PSS"]:var g=[];return x.hash.algorithmOid!==void 0&&g.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),x.mgf.algorithmOid!==void 0&&g.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(x.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])])),x.saltLength!==void 0&&g.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(x.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,g);default:return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}}function y(E){var x=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(E.attributes.length===0)return x;for(var g=E.attributes,I=0;I<g.length;++I){var A=g[I],_=A.value,T=t.Type.UTF8;"valueTagClass"in A&&(T=A.valueTagClass),T===t.Type.UTF8&&(_=e.util.encodeUtf8(_));var $=!1;"valueConstructed"in A&&($=A.valueConstructed);var B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(A.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,T,$,_)])]);x.value.push(B)}return x}var C=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function w(E){return E>=C&&E<S?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(E)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(E))}return n.getTBSCertificate=function(E){var x=w(E.validity.notBefore),g=w(E.validity.notAfter),I=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.version).getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(E.serialNumber)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.siginfo.algorithmOid).getBytes()),f(E.siginfo.algorithmOid,E.siginfo.parameters)]),v(E.issuer),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[x,g]),v(E.subject),n.publicKeyToAsn1(E.publicKey)]);return E.issuer.uniqueId&&I.value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.issuer.uniqueId)])),E.subject.uniqueId&&I.value.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.subject.uniqueId)])),E.extensions.length>0&&I.value.push(n.certificateExtensionsToAsn1(E.extensions)),I},n.getCertificationRequestInfo=function(E){var x=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(E.version).getBytes()),v(E.subject),n.publicKeyToAsn1(E.publicKey),y(E)]);return x},n.distinguishedNameToAsn1=function(E){return v(E)},n.certificateToAsn1=function(E){var x=E.tbsCertificate||n.getTBSCertificate(E);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[x,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.signatureOid).getBytes()),f(E.signatureOid,E.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.signature)])},n.certificateExtensionsToAsn1=function(E){var x=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),g=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);x.value.push(g);for(var I=0;I<E.length;++I)g.value.push(n.certificateExtensionToAsn1(E[I]));return x},n.certificateExtensionToAsn1=function(E){var x=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);x.value.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.id).getBytes())),E.critical&&x.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,"ÿ"));var g=E.value;return typeof E.value!="string"&&(g=t.toDer(g).getBytes()),x.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,g)),x},n.certificationRequestToAsn1=function(E){var x=E.certificationRequestInfo||n.getCertificationRequestInfo(E);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[x,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(E.signatureOid).getBytes()),f(E.signatureOid,E.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,"\0"+E.signature)])},n.createCaStore=function(E){var x={certs:{}};x.getIssuer=function(T){var $=g(T.issuer);return $},x.addCertificate=function(T){if(typeof T=="string"&&(T=e.pki.certificateFromPem(T)),I(T.subject),!x.hasCertificate(T))if(T.subject.hash in x.certs){var $=x.certs[T.subject.hash];e.util.isArray($)||($=[$]),$.push(T),x.certs[T.subject.hash]=$}else x.certs[T.subject.hash]=T},x.hasCertificate=function(T){typeof T=="string"&&(T=e.pki.certificateFromPem(T));var $=g(T.subject);if(!$)return!1;e.util.isArray($)||($=[$]);for(var B=t.toDer(n.certificateToAsn1(T)).getBytes(),P=0;P<$.length;++P){var k=t.toDer(n.certificateToAsn1($[P])).getBytes();if(B===k)return!0}return!1},x.listAllCertificates=function(){var T=[];for(var $ in x.certs)if(x.certs.hasOwnProperty($)){var B=x.certs[$];if(!e.util.isArray(B))T.push(B);else for(var P=0;P<B.length;++P)T.push(B[P])}return T},x.removeCertificate=function(T){var $;if(typeof T=="string"&&(T=e.pki.certificateFromPem(T)),I(T.subject),!x.hasCertificate(T))return null;var B=g(T.subject);if(!e.util.isArray(B))return $=x.certs[T.subject.hash],delete x.certs[T.subject.hash],$;for(var P=t.toDer(n.certificateToAsn1(T)).getBytes(),k=0;k<B.length;++k){var O=t.toDer(n.certificateToAsn1(B[k])).getBytes();P===O&&($=B[k],B.splice(k,1))}return B.length===0&&delete x.certs[T.subject.hash],$};function g(T){return I(T),x.certs[T.hash]||null}function I(T){if(!T.hash){var $=e.md.sha1.create();T.attributes=n.RDNAttributesAsArray(v(T),$),T.hash=$.digest().toHex()}}if(E)for(var A=0;A<E.length;++A){var _=E[A];x.addCertificate(_)}return x},n.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},n.verifyCertificateChain=function(E,x,g){typeof g=="function"&&(g={verify:g}),g=g||{},x=x.slice(0);var I=x.slice(0),A=g.validityCheckDate;typeof A>"u"&&(A=new Date);var _=!0,T=null,$=0;do{var B=x.shift(),P=null,k=!1;if(A&&(A<B.validity.notBefore||A>B.validity.notAfter)&&(T={message:"Certificate is not valid yet or has expired.",error:n.certificateError.certificate_expired,notBefore:B.validity.notBefore,notAfter:B.validity.notAfter,now:A}),T===null){if(P=x[0]||E.getIssuer(B),P===null&&B.isIssuer(B)&&(k=!0,P=B),P){var O=P;e.util.isArray(O)||(O=[O]);for(var M=!1;!M&&O.length>0;){P=O.shift();try{M=P.verify(B)}catch{}}M||(T={message:"Certificate signature is invalid.",error:n.certificateError.bad_certificate})}T===null&&(!P||k)&&!E.hasCertificate(B)&&(T={message:"Certificate is not trusted.",error:n.certificateError.unknown_ca})}if(T===null&&P&&!B.isIssuer(P)&&(T={message:"Certificate issuer is invalid.",error:n.certificateError.bad_certificate}),T===null)for(var G={keyUsage:!0,basicConstraints:!0},W=0;T===null&&W<B.extensions.length;++W){var U=B.extensions[W];U.critical&&!(U.name in G)&&(T={message:"Certificate has an unsupported critical extension.",error:n.certificateError.unsupported_certificate})}if(T===null&&(!_||x.length===0&&(!P||k))){var q=B.getExtension("basicConstraints"),Q=B.getExtension("keyUsage");if(Q!==null&&(!Q.keyCertSign||q===null)&&(T={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:n.certificateError.bad_certificate}),T===null&&q!==null&&!q.cA&&(T={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:n.certificateError.bad_certificate}),T===null&&Q!==null&&"pathLenConstraint"in q){var Z=$-1;Z>q.pathLenConstraint&&(T={message:"Certificate basicConstraints pathLenConstraint violated.",error:n.certificateError.bad_certificate})}}var ee=T===null?!0:T.error,J=g.verify?g.verify(ee,$,I):ee;if(J===!0)T=null;else throw ee===!0&&(T={message:"The application rejected the certificate.",error:n.certificateError.bad_certificate}),(J||J===0)&&(typeof J=="object"&&!e.util.isArray(J)?(J.message&&(T.message=J.message),J.error&&(T.error=J.error)):typeof J=="string"&&(T.error=J)),T;_=!1,++$}while(x.length>0);return!0},Xd.exports}var _m;function Dx(){if(_m)return Wd.exports;_m=1;var e=Le();Wr(),rl(),Oa(),Ix(),wx(),Er(),Bc(),il(),Xe(),G0();var t=e.asn1,n=e.pki,r=Wd.exports=e.pkcs12=e.pkcs12||{},i={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},a={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},i,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},o={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},s={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},l={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function u(m,b,f,y){for(var C=[],S=0;S<m.length;S++)for(var w=0;w<m[S].safeBags.length;w++){var E=m[S].safeBags[w];if(!(y!==void 0&&E.type!==y)){if(b===null){C.push(E);continue}E.attributes[b]!==void 0&&E.attributes[b].indexOf(f)>=0&&C.push(E)}}return C}r.pkcs12FromAsn1=function(m,b,f){typeof b=="string"?(f=b,b=!0):b===void 0&&(b=!0);var y={},C=[];if(!t.validate(m,a,y,C)){var S=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw S.errors=S,S}var w={version:y.version.charCodeAt(0),safeContents:[],getBags:function(P){var k={},O;return"localKeyId"in P?O=P.localKeyId:"localKeyIdHex"in P&&(O=e.util.hexToBytes(P.localKeyIdHex)),O===void 0&&!("friendlyName"in P)&&"bagType"in P&&(k[P.bagType]=u(w.safeContents,null,null,P.bagType)),O!==void 0&&(k.localKeyId=u(w.safeContents,"localKeyId",O,P.bagType)),"friendlyName"in P&&(k.friendlyName=u(w.safeContents,"friendlyName",P.friendlyName,P.bagType)),k},getBagsByFriendlyName:function(P,k){return u(w.safeContents,"friendlyName",P,k)},getBagsByLocalKeyId:function(P,k){return u(w.safeContents,"localKeyId",P,k)}};if(y.version.charCodeAt(0)!==3){var S=new Error("PKCS#12 PFX of version other than 3 not supported.");throw S.version=y.version.charCodeAt(0),S}if(t.derToOid(y.contentType)!==n.oids.data){var S=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw S.oid=t.derToOid(y.contentType),S}var E=y.content.value[0];if(E.tagClass!==t.Class.UNIVERSAL||E.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(E=c(E),y.mac){var x=null,g=0,I=t.derToOid(y.macAlgorithm);switch(I){case n.oids.sha1:x=e.md.sha1.create(),g=20;break;case n.oids.sha256:x=e.md.sha256.create(),g=32;break;case n.oids.sha384:x=e.md.sha384.create(),g=48;break;case n.oids.sha512:x=e.md.sha512.create(),g=64;break;case n.oids.md5:x=e.md.md5.create(),g=16;break}if(x===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+I);var A=new e.util.ByteBuffer(y.macSalt),_="macIterations"in y?parseInt(e.util.bytesToHex(y.macIterations),16):1,T=r.generateKey(f,A,3,_,g,x),$=e.hmac.create();$.start(x,T),$.update(E.value);var B=$.getMac();if(B.getBytes()!==y.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return p(w,E.value,b,f),w};function c(m){if(m.composed||m.constructed){for(var b=e.util.createBuffer(),f=0;f<m.value.length;++f)b.putBytes(m.value[f].value);m.composed=m.constructed=!1,m.value=b.getBytes()}return m}function p(m,b,f,y){if(b=t.fromDer(b,f),b.tagClass!==t.Class.UNIVERSAL||b.type!==t.Type.SEQUENCE||b.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var C=0;C<b.value.length;C++){var S=b.value[C],w={},E=[];if(!t.validate(S,i,w,E)){var x=new Error("Cannot read ContentInfo.");throw x.errors=E,x}var g={encrypted:!1},I=null,A=w.content.value[0];switch(t.derToOid(w.contentType)){case n.oids.data:if(A.tagClass!==t.Class.UNIVERSAL||A.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");I=c(A).value;break;case n.oids.encryptedData:I=h(A,y),g.encrypted=!0;break;default:var x=new Error("Unsupported PKCS#12 contentType.");throw x.contentType=t.derToOid(w.contentType),x}g.safeBags=d(I,f,y),m.safeContents.push(g)}}function h(m,b){var f={},y=[];if(!t.validate(m,e.pkcs7.asn1.encryptedDataValidator,f,y)){var C=new Error("Cannot read EncryptedContentInfo.");throw C.errors=y,C}var S=t.derToOid(f.contentType);if(S!==n.oids.data){var C=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw C.oid=S,C}S=t.derToOid(f.encAlgorithm);var w=n.pbe.getCipher(S,f.encParameter,b),E=c(f.encryptedContentAsn1),x=e.util.createBuffer(E.value);if(w.update(x),!w.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return w.output.getBytes()}function d(m,b,f){if(!b&&m.length===0)return[];if(m=t.fromDer(m,b),m.tagClass!==t.Class.UNIVERSAL||m.type!==t.Type.SEQUENCE||m.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var y=[],C=0;C<m.value.length;C++){var S=m.value[C],w={},E=[];if(!t.validate(S,o,w,E)){var x=new Error("Cannot read SafeBag.");throw x.errors=E,x}var g={type:t.derToOid(w.bagId),attributes:v(w.bagAttributes)};y.push(g);var I,A,_=w.bagValue.value[0];switch(g.type){case n.oids.pkcs8ShroudedKeyBag:if(_=n.decryptPrivateKeyInfo(_,f),_===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case n.oids.keyBag:try{g.key=n.privateKeyFromAsn1(_)}catch{g.key=null,g.asn1=_}continue;case n.oids.certBag:I=l,A=function(){if(t.derToOid(w.certId)!==n.oids.x509Certificate){var $=new Error("Unsupported certificate type, only X.509 supported.");throw $.oid=t.derToOid(w.certId),$}var B=t.fromDer(w.cert,b);try{g.cert=n.certificateFromAsn1(B,!0)}catch{g.cert=null,g.asn1=B}};break;default:var x=new Error("Unsupported PKCS#12 SafeBag type.");throw x.oid=g.type,x}if(I!==void 0&&!t.validate(_,I,w,E)){var x=new Error("Cannot read PKCS#12 "+I.name);throw x.errors=E,x}A()}return y}function v(m){var b={};if(m!==void 0)for(var f=0;f<m.length;++f){var y={},C=[];if(!t.validate(m[f],s,y,C)){var S=new Error("Cannot read PKCS#12 BagAttribute.");throw S.errors=C,S}var w=t.derToOid(y.oid);if(n.oids[w]!==void 0){b[n.oids[w]]=[];for(var E=0;E<y.values.length;++E)b[n.oids[w]].push(y.values[E].value)}}return b}return r.toPkcs12Asn1=function(m,b,f,y){y=y||{},y.saltSize=y.saltSize||8,y.count=y.count||2048,y.algorithm=y.algorithm||y.encAlgorithm||"aes128","useMac"in y||(y.useMac=!0),"localKeyId"in y||(y.localKeyId=null),"generateLocalKeyId"in y||(y.generateLocalKeyId=!0);var C=y.localKeyId,S;if(C!==null)C=e.util.hexToBytes(C);else if(y.generateLocalKeyId)if(b){var w=e.util.isArray(b)?b[0]:b;typeof w=="string"&&(w=n.certificateFromPem(w));var E=e.md.sha1.create();E.update(t.toDer(n.certificateToAsn1(w)).getBytes()),C=E.digest().getBytes()}else C=e.random.getBytes(20);var x=[];C!==null&&x.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.localKeyId).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,C)])])),"friendlyName"in y&&x.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.friendlyName).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.BMPSTRING,!1,y.friendlyName)])])),x.length>0&&(S=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,x));var g=[],I=[];b!==null&&(e.util.isArray(b)?I=b:I=[b]);for(var A=[],_=0;_<I.length;++_){b=I[_],typeof b=="string"&&(b=n.certificateFromPem(b));var T=_===0?S:void 0,$=n.certificateToAsn1(b),B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.certBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.x509Certificate).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer($).getBytes())])])]),T]);A.push(B)}if(A.length>0){var P=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,A),k=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(P).getBytes())])]);g.push(k)}var O=null;if(m!==null){var M=n.wrapRsaPrivateKey(n.privateKeyToAsn1(m));f===null?O=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[M]),S]):O=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[n.encryptPrivateKeyInfo(M,f,y)]),S]);var G=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[O]),W=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(G).getBytes())])]);g.push(W)}var U=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,g),q;if(y.useMac){var E=e.md.sha1.create(),Q=new e.util.ByteBuffer(e.random.getBytes(y.saltSize)),Z=y.count,m=r.generateKey(f,Q,3,Z,20),ee=e.hmac.create();ee.start(E,m),ee.update(t.toDer(U).getBytes());var J=ee.getMac();q=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,J.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,Q.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(Z).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(U).getBytes())])]),q])},r.generateKey=e.pbe.generatePkcs12Key,Wd.exports}var Dm;function Tx(){if(Dm)return $d.exports;Dm=1;var e=Le();Wr(),Oa(),wx(),Oo(),j0(),Dx(),z0(),Bc(),Xe(),G0();var t=e.asn1,n=$d.exports=e.pki=e.pki||{};return n.pemToDer=function(r){var i=e.pem.decode(r)[0];if(i.procType&&i.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return e.util.createBuffer(i.body)},n.privateKeyFromPem=function(r){var i=e.pem.decode(r)[0];if(i.type!=="PRIVATE KEY"&&i.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw a.headerType=i.type,a}if(i.procType&&i.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=t.fromDer(i.body);return n.privateKeyFromAsn1(o)},n.privateKeyToPem=function(r,i){var a={type:"RSA PRIVATE KEY",body:t.toDer(n.privateKeyToAsn1(r)).getBytes()};return e.pem.encode(a,{maxline:i})},n.privateKeyInfoToPem=function(r,i){var a={type:"PRIVATE KEY",body:t.toDer(r).getBytes()};return e.pem.encode(a,{maxline:i})},$d.exports}var Jd,Tm;function Ax(){if(Tm)return Jd;Tm=1;var e=Le();Wr(),rl(),V0(),Oo(),Tx(),Er(),il(),Xe();var t=function(R,H,V,D){var L=e.util.createBuffer(),K=R.length>>1,X=K+(R.length&1),se=R.substr(0,X),ie=R.substr(K,X),oe=e.util.createBuffer(),te=e.hmac.create();V=H+V;var ue=Math.ceil(D/16),ve=Math.ceil(D/20);te.start("MD5",se);var be=e.util.createBuffer();oe.putBytes(V);for(var pe=0;pe<ue;++pe)te.start(null,null),te.update(oe.getBytes()),oe.putBuffer(te.digest()),te.start(null,null),te.update(oe.bytes()+V),be.putBuffer(te.digest());te.start("SHA1",ie);var Te=e.util.createBuffer();oe.clear(),oe.putBytes(V);for(var pe=0;pe<ve;++pe)te.start(null,null),te.update(oe.getBytes()),oe.putBuffer(te.digest()),te.start(null,null),te.update(oe.bytes()+V),Te.putBuffer(te.digest());return L.putBytes(e.util.xorBytes(be.getBytes(),Te.getBytes(),D)),L},n=function(R,H,V){var D=e.hmac.create();D.start("SHA1",R);var L=e.util.createBuffer();return L.putInt32(H[0]),L.putInt32(H[1]),L.putByte(V.type),L.putByte(V.version.major),L.putByte(V.version.minor),L.putInt16(V.length),L.putBytes(V.fragment.bytes()),D.update(L.getBytes()),D.digest().getBytes()},r=function(R,H,V){var D=!1;try{var L=R.deflate(H.fragment.getBytes());H.fragment=e.util.createBuffer(L),H.length=L.length,D=!0}catch{}return D},i=function(R,H,V){var D=!1;try{var L=R.inflate(H.fragment.getBytes());H.fragment=e.util.createBuffer(L),H.length=L.length,D=!0}catch{}return D},a=function(R,H){var V=0;switch(H){case 1:V=R.getByte();break;case 2:V=R.getInt16();break;case 3:V=R.getInt24();break;case 4:V=R.getInt32();break}return e.util.createBuffer(R.getBytes(V))},o=function(R,H,V){R.putInt(V.length(),H<<3),R.putBuffer(V)},s={};s.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},s.SupportedVersions=[s.Versions.TLS_1_1,s.Versions.TLS_1_0],s.Version=s.SupportedVersions[0],s.MaxFragment=15360,s.ConnectionEnd={server:0,client:1},s.PRFAlgorithm={tls_prf_sha256:0},s.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},s.CipherType={stream:0,block:1,aead:2},s.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},s.CompressionMethod={none:0,deflate:1},s.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},s.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},s.Alert={},s.Alert.Level={warning:1,fatal:2},s.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},s.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},s.CipherSuites={},s.getCipherSuite=function(R){var H=null;for(var V in s.CipherSuites){var D=s.CipherSuites[V];if(D.id[0]===R.charCodeAt(0)&&D.id[1]===R.charCodeAt(1)){H=D;break}}return H},s.handleUnexpected=function(R,H){var V=!R.open&&R.entity===s.ConnectionEnd.client;V||R.error(R,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unexpected_message}})},s.handleHelloRequest=function(R,H,V){!R.handshaking&&R.handshakes>0&&(s.queue(R,s.createAlert(R,{level:s.Alert.Level.warning,description:s.Alert.Description.no_renegotiation})),s.flush(R)),R.process()},s.parseHelloMessage=function(R,H,V){var D=null,L=R.entity===s.ConnectionEnd.client;if(V<38)R.error(R,{message:L?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});else{var K=H.fragment,X=K.length();if(D={version:{major:K.getByte(),minor:K.getByte()},random:e.util.createBuffer(K.getBytes(32)),session_id:a(K,1),extensions:[]},L?(D.cipher_suite=K.getBytes(2),D.compression_method=K.getByte()):(D.cipher_suites=a(K,2),D.compression_methods=a(K,1)),X=V-(X-K.length()),X>0){for(var se=a(K,2);se.length()>0;)D.extensions.push({type:[se.getByte(),se.getByte()],data:a(se,2)});if(!L)for(var ie=0;ie<D.extensions.length;++ie){var oe=D.extensions[ie];if(oe.type[0]===0&&oe.type[1]===0)for(var te=a(oe.data,2);te.length()>0;){var ue=te.getByte();if(ue!==0)break;R.session.extensions.server_name.serverNameList.push(a(te,2).getBytes())}}}if(R.session.version&&(D.version.major!==R.session.version.major||D.version.minor!==R.session.version.minor))return R.error(R,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.protocol_version}});if(L)R.session.cipherSuite=s.getCipherSuite(D.cipher_suite);else for(var ve=e.util.createBuffer(D.cipher_suites.bytes());ve.length()>0&&(R.session.cipherSuite=s.getCipherSuite(ve.getBytes(2)),R.session.cipherSuite===null););if(R.session.cipherSuite===null)return R.error(R,{message:"No cipher suites in common.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.handshake_failure},cipherSuite:e.util.bytesToHex(D.cipher_suite)});L?R.session.compressionMethod=D.compression_method:R.session.compressionMethod=s.CompressionMethod.none}return D},s.createSecurityParameters=function(R,H){var V=R.entity===s.ConnectionEnd.client,D=H.random.bytes(),L=V?R.session.sp.client_random:D,K=V?D:s.createRandom().getBytes();R.session.sp={entity:R.entity,prf_algorithm:s.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:R.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:L,server_random:K}},s.handleServerHello=function(R,H,V){var D=s.parseHelloMessage(R,H,V);if(!R.fail){if(D.version.minor<=R.version.minor)R.version.minor=D.version.minor;else return R.error(R,{message:"Incompatible TLS version.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.protocol_version}});R.session.version=R.version;var L=D.session_id.bytes();L.length>0&&L===R.session.id?(R.expect=d,R.session.resuming=!0,R.session.sp.server_random=D.random.bytes()):(R.expect=u,R.session.resuming=!1,s.createSecurityParameters(R,D)),R.session.id=L,R.process()}},s.handleClientHello=function(R,H,V){var D=s.parseHelloMessage(R,H,V);if(!R.fail){var L=D.session_id.bytes(),K=null;if(R.sessionCache&&(K=R.sessionCache.getSession(L),K===null?L="":(K.version.major!==D.version.major||K.version.minor>D.version.minor)&&(K=null,L="")),L.length===0&&(L=e.random.getBytes(32)),R.session.id=L,R.session.clientHelloVersion=D.version,R.session.sp={},K)R.version=R.session.version=K.version,R.session.sp=K.sp;else{for(var X,se=1;se<s.SupportedVersions.length&&(X=s.SupportedVersions[se],!(X.minor<=D.version.minor));++se);R.version={major:X.major,minor:X.minor},R.session.version=R.version}K!==null?(R.expect=w,R.session.resuming=!0,R.session.sp.client_random=D.random.bytes()):(R.expect=R.verifyClient!==!1?y:C,R.session.resuming=!1,s.createSecurityParameters(R,D)),R.open=!0,s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createServerHello(R)})),R.session.resuming?(s.queue(R,s.createRecord(R,{type:s.ContentType.change_cipher_spec,data:s.createChangeCipherSpec()})),R.state.pending=s.createConnectionState(R),R.state.current.write=R.state.pending.write,s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createFinished(R)}))):(s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createCertificate(R)})),R.fail||(s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createServerKeyExchange(R)})),R.verifyClient!==!1&&s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createCertificateRequest(R)})),s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createServerHelloDone(R)})))),s.flush(R),R.process()}},s.handleCertificate=function(R,H,V){if(V<3)return R.error(R,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var D=H.fragment,L={certificate_list:a(D,3)},K,X,se=[];try{for(;L.certificate_list.length()>0;)K=a(L.certificate_list,3),X=e.asn1.fromDer(K),K=e.pki.certificateFromAsn1(X,!0),se.push(K)}catch(oe){return R.error(R,{message:"Could not parse certificate list.",cause:oe,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.bad_certificate}})}var ie=R.entity===s.ConnectionEnd.client;(ie||R.verifyClient===!0)&&se.length===0?R.error(R,{message:ie?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}}):se.length===0?R.expect=ie?c:C:(ie?R.session.serverCertificate=se[0]:R.session.clientCertificate=se[0],s.verifyCertificateChain(R,se)&&(R.expect=ie?c:C)),R.process()},s.handleServerKeyExchange=function(R,H,V){if(V>0)return R.error(R,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unsupported_certificate}});R.expect=p,R.process()},s.handleClientKeyExchange=function(R,H,V){if(V<48)return R.error(R,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unsupported_certificate}});var D=H.fragment,L={enc_pre_master_secret:a(D,2).getBytes()},K=null;if(R.getPrivateKey)try{K=R.getPrivateKey(R,R.session.serverCertificate),K=e.pki.privateKeyFromPem(K)}catch(ie){R.error(R,{message:"Could not get private key.",cause:ie,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}})}if(K===null)return R.error(R,{message:"No private key set.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}});try{var X=R.session.sp;X.pre_master_secret=K.decrypt(L.enc_pre_master_secret);var se=R.session.clientHelloVersion;if(se.major!==X.pre_master_secret.charCodeAt(0)||se.minor!==X.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{X.pre_master_secret=e.random.getBytes(48)}R.expect=w,R.session.clientCertificate!==null&&(R.expect=S),R.process()},s.handleCertificateRequest=function(R,H,V){if(V<3)return R.error(R,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var D=H.fragment,L={certificate_types:a(D,1),certificate_authorities:a(D,2)};R.session.certificateRequest=L,R.expect=h,R.process()},s.handleCertificateVerify=function(R,H,V){if(V<2)return R.error(R,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var D=H.fragment;D.read-=4;var L=D.bytes();D.read+=4;var K={signature:a(D,2).getBytes()},X=e.util.createBuffer();X.putBuffer(R.session.md5.digest()),X.putBuffer(R.session.sha1.digest()),X=X.getBytes();try{var se=R.session.clientCertificate;if(!se.publicKey.verify(X,K.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");R.session.md5.update(L),R.session.sha1.update(L)}catch{return R.error(R,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.handshake_failure}})}R.expect=w,R.process()},s.handleServerHelloDone=function(R,H,V){if(V>0)return R.error(R,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.record_overflow}});if(R.serverCertificate===null){var D={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.insufficient_security}},L=0,K=R.verify(R,D.alert.description,L,[]);if(K!==!0)return(K||K===0)&&(typeof K=="object"&&!e.util.isArray(K)?(K.message&&(D.message=K.message),K.alert&&(D.alert.description=K.alert)):typeof K=="number"&&(D.alert.description=K)),R.error(R,D)}R.session.certificateRequest!==null&&(H=s.createRecord(R,{type:s.ContentType.handshake,data:s.createCertificate(R)}),s.queue(R,H)),H=s.createRecord(R,{type:s.ContentType.handshake,data:s.createClientKeyExchange(R)}),s.queue(R,H),R.expect=b;var X=function(se,ie){se.session.certificateRequest!==null&&se.session.clientCertificate!==null&&s.queue(se,s.createRecord(se,{type:s.ContentType.handshake,data:s.createCertificateVerify(se,ie)})),s.queue(se,s.createRecord(se,{type:s.ContentType.change_cipher_spec,data:s.createChangeCipherSpec()})),se.state.pending=s.createConnectionState(se),se.state.current.write=se.state.pending.write,s.queue(se,s.createRecord(se,{type:s.ContentType.handshake,data:s.createFinished(se)})),se.expect=d,s.flush(se),se.process()};if(R.session.certificateRequest===null||R.session.clientCertificate===null)return X(R,null);s.getClientSignature(R,X)},s.handleChangeCipherSpec=function(R,H){if(H.fragment.getByte()!==1)return R.error(R,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.illegal_parameter}});var V=R.entity===s.ConnectionEnd.client;(R.session.resuming&&V||!R.session.resuming&&!V)&&(R.state.pending=s.createConnectionState(R)),R.state.current.read=R.state.pending.read,(!R.session.resuming&&V||R.session.resuming&&!V)&&(R.state.pending=null),R.expect=V?v:E,R.process()},s.handleFinished=function(R,H,V){var D=H.fragment;D.read-=4;var L=D.bytes();D.read+=4;var K=H.fragment.getBytes();D=e.util.createBuffer(),D.putBuffer(R.session.md5.digest()),D.putBuffer(R.session.sha1.digest());var X=R.entity===s.ConnectionEnd.client,se=X?"server finished":"client finished",ie=R.session.sp,oe=12,te=t;if(D=te(ie.master_secret,se,D.getBytes(),oe),D.getBytes()!==K)return R.error(R,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.decrypt_error}});R.session.md5.update(L),R.session.sha1.update(L),(R.session.resuming&&X||!R.session.resuming&&!X)&&(s.queue(R,s.createRecord(R,{type:s.ContentType.change_cipher_spec,data:s.createChangeCipherSpec()})),R.state.current.write=R.state.pending.write,R.state.pending=null,s.queue(R,s.createRecord(R,{type:s.ContentType.handshake,data:s.createFinished(R)}))),R.expect=X?m:x,R.handshaking=!1,++R.handshakes,R.peerCertificate=X?R.session.serverCertificate:R.session.clientCertificate,s.flush(R),R.isConnected=!0,R.connected(R),R.process()},s.handleAlert=function(R,H){var V=H.fragment,D={level:V.getByte(),description:V.getByte()},L;switch(D.description){case s.Alert.Description.close_notify:L="Connection closed.";break;case s.Alert.Description.unexpected_message:L="Unexpected message.";break;case s.Alert.Description.bad_record_mac:L="Bad record MAC.";break;case s.Alert.Description.decryption_failed:L="Decryption failed.";break;case s.Alert.Description.record_overflow:L="Record overflow.";break;case s.Alert.Description.decompression_failure:L="Decompression failed.";break;case s.Alert.Description.handshake_failure:L="Handshake failure.";break;case s.Alert.Description.bad_certificate:L="Bad certificate.";break;case s.Alert.Description.unsupported_certificate:L="Unsupported certificate.";break;case s.Alert.Description.certificate_revoked:L="Certificate revoked.";break;case s.Alert.Description.certificate_expired:L="Certificate expired.";break;case s.Alert.Description.certificate_unknown:L="Certificate unknown.";break;case s.Alert.Description.illegal_parameter:L="Illegal parameter.";break;case s.Alert.Description.unknown_ca:L="Unknown certificate authority.";break;case s.Alert.Description.access_denied:L="Access denied.";break;case s.Alert.Description.decode_error:L="Decode error.";break;case s.Alert.Description.decrypt_error:L="Decrypt error.";break;case s.Alert.Description.export_restriction:L="Export restriction.";break;case s.Alert.Description.protocol_version:L="Unsupported protocol version.";break;case s.Alert.Description.insufficient_security:L="Insufficient security.";break;case s.Alert.Description.internal_error:L="Internal error.";break;case s.Alert.Description.user_canceled:L="User canceled.";break;case s.Alert.Description.no_renegotiation:L="Renegotiation not supported.";break;default:L="Unknown error.";break}if(D.description===s.Alert.Description.close_notify)return R.close();R.error(R,{message:L,send:!1,origin:R.entity===s.ConnectionEnd.client?"server":"client",alert:D}),R.process()},s.handleHandshake=function(R,H){var V=H.fragment,D=V.getByte(),L=V.getInt24();if(L>V.length())return R.fragmented=H,H.fragment=e.util.createBuffer(),V.read-=4,R.process();R.fragmented=null,V.read-=4;var K=V.bytes(L+4);V.read+=4,D in q[R.entity][R.expect]?(R.entity===s.ConnectionEnd.server&&!R.open&&!R.fail&&(R.handshaking=!0,R.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:e.md.md5.create(),sha1:e.md.sha1.create()}),D!==s.HandshakeType.hello_request&&D!==s.HandshakeType.certificate_verify&&D!==s.HandshakeType.finished&&(R.session.md5.update(K),R.session.sha1.update(K)),q[R.entity][R.expect][D](R,H,L)):s.handleUnexpected(R,H)},s.handleApplicationData=function(R,H){R.data.putBuffer(H.fragment),R.dataReady(R),R.process()},s.handleHeartbeat=function(R,H){var V=H.fragment,D=V.getByte(),L=V.getInt16(),K=V.getBytes(L);if(D===s.HeartbeatMessageType.heartbeat_request){if(R.handshaking||L>K.length)return R.process();s.queue(R,s.createRecord(R,{type:s.ContentType.heartbeat,data:s.createHeartbeat(s.HeartbeatMessageType.heartbeat_response,K)})),s.flush(R)}else if(D===s.HeartbeatMessageType.heartbeat_response){if(K!==R.expectedHeartbeatPayload)return R.process();R.heartbeatReceived&&R.heartbeatReceived(R,e.util.createBuffer(K))}R.process()};var l=0,u=1,c=2,p=3,h=4,d=5,v=6,m=7,b=8,f=0,y=1,C=2,S=3,w=4,E=5,x=6,g=s.handleUnexpected,I=s.handleChangeCipherSpec,A=s.handleAlert,_=s.handleHandshake,T=s.handleApplicationData,$=s.handleHeartbeat,B=[];B[s.ConnectionEnd.client]=[[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[I,A,g,g,$],[g,A,_,g,$],[g,A,_,T,$],[g,A,_,g,$]],B[s.ConnectionEnd.server]=[[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[g,A,_,g,$],[I,A,g,g,$],[g,A,_,g,$],[g,A,_,T,$],[g,A,_,g,$]];var P=s.handleHelloRequest,k=s.handleServerHello,O=s.handleCertificate,M=s.handleServerKeyExchange,G=s.handleCertificateRequest,W=s.handleServerHelloDone,U=s.handleFinished,q=[];q[s.ConnectionEnd.client]=[[g,g,k,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,O,M,G,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,M,G,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,G,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,W,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,U],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[P,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g]];var Q=s.handleClientHello,Z=s.handleClientKeyExchange,ee=s.handleCertificateVerify;q[s.ConnectionEnd.server]=[[g,Q,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,O,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,Z,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,ee,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,U],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g],[g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g]],s.generateKeys=function(R,H){var V=t,D=H.client_random+H.server_random;R.session.resuming||(H.master_secret=V(H.pre_master_secret,"master secret",D,48).bytes(),H.pre_master_secret=null),D=H.server_random+H.client_random;var L=2*H.mac_key_length+2*H.enc_key_length,K=R.version.major===s.Versions.TLS_1_0.major&&R.version.minor===s.Versions.TLS_1_0.minor;K&&(L+=2*H.fixed_iv_length);var X=V(H.master_secret,"key expansion",D,L),se={client_write_MAC_key:X.getBytes(H.mac_key_length),server_write_MAC_key:X.getBytes(H.mac_key_length),client_write_key:X.getBytes(H.enc_key_length),server_write_key:X.getBytes(H.enc_key_length)};return K&&(se.client_write_IV=X.getBytes(H.fixed_iv_length),se.server_write_IV=X.getBytes(H.fixed_iv_length)),se},s.createConnectionState=function(R){var H=R.entity===s.ConnectionEnd.client,V=function(){var K={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(X){return!0},compressionState:null,compressFunction:function(X){return!0},updateSequenceNumber:function(){K.sequenceNumber[1]===4294967295?(K.sequenceNumber[1]=0,++K.sequenceNumber[0]):++K.sequenceNumber[1]}};return K},D={read:V(),write:V()};if(D.read.update=function(K,X){return D.read.cipherFunction(X,D.read)?D.read.compressFunction(K,X,D.read)||K.error(K,{message:"Could not decompress record.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.decompression_failure}}):K.error(K,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.bad_record_mac}}),!K.fail},D.write.update=function(K,X){return D.write.compressFunction(K,X,D.write)?D.write.cipherFunction(X,D.write)||K.error(K,{message:"Could not encrypt record.",send:!1,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}}):K.error(K,{message:"Could not compress record.",send:!1,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}}),!K.fail},R.session){var L=R.session.sp;switch(R.session.cipherSuite.initSecurityParameters(L),L.keys=s.generateKeys(R,L),D.read.macKey=H?L.keys.server_write_MAC_key:L.keys.client_write_MAC_key,D.write.macKey=H?L.keys.client_write_MAC_key:L.keys.server_write_MAC_key,R.session.cipherSuite.initConnectionState(D,R,L),L.compression_algorithm){case s.CompressionMethod.none:break;case s.CompressionMethod.deflate:D.read.compressFunction=i,D.write.compressFunction=r;break;default:throw new Error("Unsupported compression algorithm.")}}return D},s.createRandom=function(){var R=new Date,H=+R+R.getTimezoneOffset()*6e4,V=e.util.createBuffer();return V.putInt32(H),V.putBytes(e.random.getBytes(28)),V},s.createRecord=function(R,H){if(!H.data)return null;var V={type:H.type,version:{major:R.version.major,minor:R.version.minor},length:H.data.length(),fragment:H.data};return V},s.createAlert=function(R,H){var V=e.util.createBuffer();return V.putByte(H.level),V.putByte(H.description),s.createRecord(R,{type:s.ContentType.alert,data:V})},s.createClientHello=function(R){R.session.clientHelloVersion={major:R.version.major,minor:R.version.minor};for(var H=e.util.createBuffer(),V=0;V<R.cipherSuites.length;++V){var D=R.cipherSuites[V];H.putByte(D.id[0]),H.putByte(D.id[1])}var L=H.length(),K=e.util.createBuffer();K.putByte(s.CompressionMethod.none);var X=K.length(),se=e.util.createBuffer();if(R.virtualHost){var ie=e.util.createBuffer();ie.putByte(0),ie.putByte(0);var oe=e.util.createBuffer();oe.putByte(0),o(oe,2,e.util.createBuffer(R.virtualHost));var te=e.util.createBuffer();o(te,2,oe),o(ie,2,te),se.putBuffer(ie)}var ue=se.length();ue>0&&(ue+=2);var ve=R.session.id,be=ve.length+1+2+4+28+2+L+1+X+ue,pe=e.util.createBuffer();return pe.putByte(s.HandshakeType.client_hello),pe.putInt24(be),pe.putByte(R.version.major),pe.putByte(R.version.minor),pe.putBytes(R.session.sp.client_random),o(pe,1,e.util.createBuffer(ve)),o(pe,2,H),o(pe,1,K),ue>0&&o(pe,2,se),pe},s.createServerHello=function(R){var H=R.session.id,V=H.length+1+2+4+28+2+1,D=e.util.createBuffer();return D.putByte(s.HandshakeType.server_hello),D.putInt24(V),D.putByte(R.version.major),D.putByte(R.version.minor),D.putBytes(R.session.sp.server_random),o(D,1,e.util.createBuffer(H)),D.putByte(R.session.cipherSuite.id[0]),D.putByte(R.session.cipherSuite.id[1]),D.putByte(R.session.compressionMethod),D},s.createCertificate=function(R){var H=R.entity===s.ConnectionEnd.client,V=null;if(R.getCertificate){var D;H?D=R.session.certificateRequest:D=R.session.extensions.server_name.serverNameList,V=R.getCertificate(R,D)}var L=e.util.createBuffer();if(V!==null)try{e.util.isArray(V)||(V=[V]);for(var K=null,X=0;X<V.length;++X){var se=e.pem.decode(V[X])[0];if(se.type!=="CERTIFICATE"&&se.type!=="X509 CERTIFICATE"&&se.type!=="TRUSTED CERTIFICATE"){var ie=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw ie.headerType=se.type,ie}if(se.procType&&se.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var oe=e.util.createBuffer(se.body);K===null&&(K=e.asn1.fromDer(oe.bytes(),!1));var te=e.util.createBuffer();o(te,3,oe),L.putBuffer(te)}V=e.pki.certificateFromAsn1(K),H?R.session.clientCertificate=V:R.session.serverCertificate=V}catch(be){return R.error(R,{message:"Could not send certificate list.",cause:be,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.bad_certificate}})}var ue=3+L.length(),ve=e.util.createBuffer();return ve.putByte(s.HandshakeType.certificate),ve.putInt24(ue),o(ve,3,L),ve},s.createClientKeyExchange=function(R){var H=e.util.createBuffer();H.putByte(R.session.clientHelloVersion.major),H.putByte(R.session.clientHelloVersion.minor),H.putBytes(e.random.getBytes(46));var V=R.session.sp;V.pre_master_secret=H.getBytes();var D=R.session.serverCertificate.publicKey;H=D.encrypt(V.pre_master_secret);var L=H.length+2,K=e.util.createBuffer();return K.putByte(s.HandshakeType.client_key_exchange),K.putInt24(L),K.putInt16(H.length),K.putBytes(H),K},s.createServerKeyExchange=function(R){var H=e.util.createBuffer();return H},s.getClientSignature=function(R,H){var V=e.util.createBuffer();V.putBuffer(R.session.md5.digest()),V.putBuffer(R.session.sha1.digest()),V=V.getBytes(),R.getSignature=R.getSignature||function(D,L,K){var X=null;if(D.getPrivateKey)try{X=D.getPrivateKey(D,D.session.clientCertificate),X=e.pki.privateKeyFromPem(X)}catch(se){D.error(D,{message:"Could not get private key.",cause:se,send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}})}X===null?D.error(D,{message:"No private key set.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.internal_error}}):L=X.sign(L,null),K(D,L)},R.getSignature(R,V,H)},s.createCertificateVerify=function(R,H){var V=H.length+2,D=e.util.createBuffer();return D.putByte(s.HandshakeType.certificate_verify),D.putInt24(V),D.putInt16(H.length),D.putBytes(H),D},s.createCertificateRequest=function(R){var H=e.util.createBuffer();H.putByte(1);var V=e.util.createBuffer();for(var D in R.caStore.certs){var L=R.caStore.certs[D],K=e.pki.distinguishedNameToAsn1(L.subject),X=e.asn1.toDer(K);V.putInt16(X.length()),V.putBuffer(X)}var se=1+H.length()+2+V.length(),ie=e.util.createBuffer();return ie.putByte(s.HandshakeType.certificate_request),ie.putInt24(se),o(ie,1,H),o(ie,2,V),ie},s.createServerHelloDone=function(R){var H=e.util.createBuffer();return H.putByte(s.HandshakeType.server_hello_done),H.putInt24(0),H},s.createChangeCipherSpec=function(){var R=e.util.createBuffer();return R.putByte(1),R},s.createFinished=function(R){var H=e.util.createBuffer();H.putBuffer(R.session.md5.digest()),H.putBuffer(R.session.sha1.digest());var V=R.entity===s.ConnectionEnd.client,D=R.session.sp,L=12,K=t,X=V?"client finished":"server finished";H=K(D.master_secret,X,H.getBytes(),L);var se=e.util.createBuffer();return se.putByte(s.HandshakeType.finished),se.putInt24(H.length()),se.putBuffer(H),se},s.createHeartbeat=function(R,H,V){typeof V>"u"&&(V=H.length);var D=e.util.createBuffer();D.putByte(R),D.putInt16(V),D.putBytes(H);var L=D.length(),K=Math.max(16,L-V-3);return D.putBytes(e.random.getBytes(K)),D},s.queue=function(R,H){if(H&&!(H.fragment.length()===0&&(H.type===s.ContentType.handshake||H.type===s.ContentType.alert||H.type===s.ContentType.change_cipher_spec))){if(H.type===s.ContentType.handshake){var V=H.fragment.bytes();R.session.md5.update(V),R.session.sha1.update(V),V=null}var D;if(H.fragment.length()<=s.MaxFragment)D=[H];else{D=[];for(var L=H.fragment.bytes();L.length>s.MaxFragment;)D.push(s.createRecord(R,{type:H.type,data:e.util.createBuffer(L.slice(0,s.MaxFragment))})),L=L.slice(s.MaxFragment);L.length>0&&D.push(s.createRecord(R,{type:H.type,data:e.util.createBuffer(L)}))}for(var K=0;K<D.length&&!R.fail;++K){var X=D[K],se=R.state.current.write;se.update(R,X)&&R.records.push(X)}}},s.flush=function(R){for(var H=0;H<R.records.length;++H){var V=R.records[H];R.tlsData.putByte(V.type),R.tlsData.putByte(V.version.major),R.tlsData.putByte(V.version.minor),R.tlsData.putInt16(V.fragment.length()),R.tlsData.putBuffer(R.records[H].fragment)}return R.records=[],R.tlsDataReady(R)};var J=function(R){switch(R){case!0:return!0;case e.pki.certificateError.bad_certificate:return s.Alert.Description.bad_certificate;case e.pki.certificateError.unsupported_certificate:return s.Alert.Description.unsupported_certificate;case e.pki.certificateError.certificate_revoked:return s.Alert.Description.certificate_revoked;case e.pki.certificateError.certificate_expired:return s.Alert.Description.certificate_expired;case e.pki.certificateError.certificate_unknown:return s.Alert.Description.certificate_unknown;case e.pki.certificateError.unknown_ca:return s.Alert.Description.unknown_ca;default:return s.Alert.Description.bad_certificate}},le=function(R){switch(R){case!0:return!0;case s.Alert.Description.bad_certificate:return e.pki.certificateError.bad_certificate;case s.Alert.Description.unsupported_certificate:return e.pki.certificateError.unsupported_certificate;case s.Alert.Description.certificate_revoked:return e.pki.certificateError.certificate_revoked;case s.Alert.Description.certificate_expired:return e.pki.certificateError.certificate_expired;case s.Alert.Description.certificate_unknown:return e.pki.certificateError.certificate_unknown;case s.Alert.Description.unknown_ca:return e.pki.certificateError.unknown_ca;default:return e.pki.certificateError.bad_certificate}};s.verifyCertificateChain=function(R,H){try{var V={};for(var D in R.verifyOptions)V[D]=R.verifyOptions[D];V.verify=function(K,X,se){var ie=J(K),oe=R.verify(R,K,X,se);if(oe!==!0){if(typeof oe=="object"&&!e.util.isArray(oe)){var te=new Error("The application rejected the certificate.");throw te.send=!0,te.alert={level:s.Alert.Level.fatal,description:s.Alert.Description.bad_certificate},oe.message&&(te.message=oe.message),oe.alert&&(te.alert.description=oe.alert),te}oe!==K&&(oe=le(oe))}return oe},e.pki.verifyCertificateChain(R.caStore,H,V)}catch(K){var L=K;(typeof L!="object"||e.util.isArray(L))&&(L={send:!0,alert:{level:s.Alert.Level.fatal,description:J(K)}}),"send"in L||(L.send=!0),"alert"in L||(L.alert={level:s.Alert.Level.fatal,description:J(L.error)}),R.error(R,L)}return!R.fail},s.createSessionCache=function(R,H){var V=null;if(R&&R.getSession&&R.setSession&&R.order)V=R;else{V={},V.cache=R||{},V.capacity=Math.max(H||100,1),V.order=[];for(var D in R)V.order.length<=H?V.order.push(D):delete R[D];V.getSession=function(L){var K=null,X=null;if(L?X=e.util.bytesToHex(L):V.order.length>0&&(X=V.order[0]),X!==null&&X in V.cache){K=V.cache[X],delete V.cache[X];for(var se in V.order)if(V.order[se]===X){V.order.splice(se,1);break}}return K},V.setSession=function(L,K){if(V.order.length===V.capacity){var X=V.order.shift();delete V.cache[X]}var X=e.util.bytesToHex(L);V.order.push(X),V.cache[X]=K}}return V},s.createConnection=function(R){var H=null;R.caStore?e.util.isArray(R.caStore)?H=e.pki.createCaStore(R.caStore):H=R.caStore:H=e.pki.createCaStore();var V=R.cipherSuites||null;if(V===null){V=[];for(var D in s.CipherSuites)V.push(s.CipherSuites[D])}var L=R.server?s.ConnectionEnd.server:s.ConnectionEnd.client,K=R.sessionCache?s.createSessionCache(R.sessionCache):null,X={version:{major:s.Version.major,minor:s.Version.minor},entity:L,sessionId:R.sessionId,caStore:H,sessionCache:K,cipherSuites:V,connected:R.connected,virtualHost:R.virtualHost||null,verifyClient:R.verifyClient||!1,verify:R.verify||function(te,ue,ve,be){return ue},verifyOptions:R.verifyOptions||{},getCertificate:R.getCertificate||null,getPrivateKey:R.getPrivateKey||null,getSignature:R.getSignature||null,input:e.util.createBuffer(),tlsData:e.util.createBuffer(),data:e.util.createBuffer(),tlsDataReady:R.tlsDataReady,dataReady:R.dataReady,heartbeatReceived:R.heartbeatReceived,closed:R.closed,error:function(te,ue){ue.origin=ue.origin||(te.entity===s.ConnectionEnd.client?"client":"server"),ue.send&&(s.queue(te,s.createAlert(te,ue.alert)),s.flush(te));var ve=ue.fatal!==!1;ve&&(te.fail=!0),R.error(te,ue),ve&&te.close(!1)},deflate:R.deflate||null,inflate:R.inflate||null};X.reset=function(te){X.version={major:s.Version.major,minor:s.Version.minor},X.record=null,X.session=null,X.peerCertificate=null,X.state={pending:null,current:null},X.expect=X.entity===s.ConnectionEnd.client?l:f,X.fragmented=null,X.records=[],X.open=!1,X.handshakes=0,X.handshaking=!1,X.isConnected=!1,X.fail=!(te||typeof te>"u"),X.input.clear(),X.tlsData.clear(),X.data.clear(),X.state.current=s.createConnectionState(X)},X.reset();var se=function(te,ue){var ve=ue.type-s.ContentType.change_cipher_spec,be=B[te.entity][te.expect];ve in be?be[ve](te,ue):s.handleUnexpected(te,ue)},ie=function(te){var ue=0,ve=te.input,be=ve.length();if(be<5)ue=5-be;else{te.record={type:ve.getByte(),version:{major:ve.getByte(),minor:ve.getByte()},length:ve.getInt16(),fragment:e.util.createBuffer(),ready:!1};var pe=te.record.version.major===te.version.major;pe&&te.session&&te.session.version&&(pe=te.record.version.minor===te.version.minor),pe||te.error(te,{message:"Incompatible TLS version.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.protocol_version}})}return ue},oe=function(te){var ue=0,ve=te.input,be=ve.length();if(be<te.record.length)ue=te.record.length-be;else{te.record.fragment.putBytes(ve.getBytes(te.record.length)),ve.compact();var pe=te.state.current.read;pe.update(te,te.record)&&(te.fragmented!==null&&(te.fragmented.type===te.record.type?(te.fragmented.fragment.putBuffer(te.record.fragment),te.record=te.fragmented):te.error(te,{message:"Invalid fragmented record.",send:!0,alert:{level:s.Alert.Level.fatal,description:s.Alert.Description.unexpected_message}})),te.record.ready=!0)}return ue};return X.handshake=function(te){if(X.entity!==s.ConnectionEnd.client)X.error(X,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(X.handshaking)X.error(X,{message:"Handshake already in progress.",fatal:!1});else{X.fail&&!X.open&&X.handshakes===0&&(X.fail=!1),X.handshaking=!0,te=te||"";var ue=null;te.length>0&&(X.sessionCache&&(ue=X.sessionCache.getSession(te)),ue===null&&(te="")),te.length===0&&X.sessionCache&&(ue=X.sessionCache.getSession(),ue!==null&&(te=ue.id)),X.session={id:te,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:e.md.md5.create(),sha1:e.md.sha1.create()},ue&&(X.version=ue.version,X.session.sp=ue.sp),X.session.sp.client_random=s.createRandom().getBytes(),X.open=!0,s.queue(X,s.createRecord(X,{type:s.ContentType.handshake,data:s.createClientHello(X)})),s.flush(X)}},X.process=function(te){var ue=0;return te&&X.input.putBytes(te),X.fail||(X.record!==null&&X.record.ready&&X.record.fragment.isEmpty()&&(X.record=null),X.record===null&&(ue=ie(X)),!X.fail&&X.record!==null&&!X.record.ready&&(ue=oe(X)),!X.fail&&X.record!==null&&X.record.ready&&se(X,X.record)),ue},X.prepare=function(te){return s.queue(X,s.createRecord(X,{type:s.ContentType.application_data,data:e.util.createBuffer(te)})),s.flush(X)},X.prepareHeartbeatRequest=function(te,ue){return te instanceof e.util.ByteBuffer&&(te=te.bytes()),typeof ue>"u"&&(ue=te.length),X.expectedHeartbeatPayload=te,s.queue(X,s.createRecord(X,{type:s.ContentType.heartbeat,data:s.createHeartbeat(s.HeartbeatMessageType.heartbeat_request,te,ue)})),s.flush(X)},X.close=function(te){if(!X.fail&&X.sessionCache&&X.session){var ue={id:X.session.id,version:X.session.version,sp:X.session.sp};ue.sp.keys=null,X.sessionCache.setSession(ue.id,ue)}X.open&&(X.open=!1,X.input.clear(),(X.isConnected||X.handshaking)&&(X.isConnected=X.handshaking=!1,s.queue(X,s.createAlert(X,{level:s.Alert.Level.warning,description:s.Alert.Description.close_notify})),s.flush(X)),X.closed(X)),X.reset(te)},X},Jd=e.tls=e.tls||{};for(var re in s)typeof s[re]!="function"&&(e.tls[re]=s[re]);return e.tls.prf_tls1=t,e.tls.hmac_sha1=n,e.tls.createSessionCache=s.createSessionCache,e.tls.createConnection=s.createConnection,Jd}var Am;function lD(){if(Am)return Dd.exports;Am=1;var e=Le();Ma(),Ax();var t=Dd.exports=e.tls;t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(l){l.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,l.cipher_type=t.CipherType.block,l.enc_key_length=16,l.block_length=16,l.fixed_iv_length=16,l.record_iv_length=16,l.mac_algorithm=t.MACAlgorithm.hmac_sha1,l.mac_length=20,l.mac_key_length=20},initConnectionState:n},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(l){l.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,l.cipher_type=t.CipherType.block,l.enc_key_length=32,l.block_length=16,l.fixed_iv_length=16,l.record_iv_length=16,l.mac_algorithm=t.MACAlgorithm.hmac_sha1,l.mac_length=20,l.mac_key_length=20},initConnectionState:n};function n(l,u,c){var p=u.entity===e.tls.ConnectionEnd.client;l.read.cipherState={init:!1,cipher:e.cipher.createDecipher("AES-CBC",p?c.keys.server_write_key:c.keys.client_write_key),iv:p?c.keys.server_write_IV:c.keys.client_write_IV},l.write.cipherState={init:!1,cipher:e.cipher.createCipher("AES-CBC",p?c.keys.client_write_key:c.keys.server_write_key),iv:p?c.keys.client_write_IV:c.keys.server_write_IV},l.read.cipherFunction=o,l.write.cipherFunction=r,l.read.macLength=l.write.macLength=c.mac_length,l.read.macFunction=l.write.macFunction=t.hmac_sha1}function r(l,u){var c=!1,p=u.macFunction(u.macKey,u.sequenceNumber,l);l.fragment.putBytes(p),u.updateSequenceNumber();var h;l.version.minor===t.Versions.TLS_1_0.minor?h=u.cipherState.init?null:u.cipherState.iv:h=e.random.getBytesSync(16),u.cipherState.init=!0;var d=u.cipherState.cipher;return d.start({iv:h}),l.version.minor>=t.Versions.TLS_1_1.minor&&d.output.putBytes(h),d.update(l.fragment),d.finish(i)&&(l.fragment=d.output,l.length=l.fragment.length(),c=!0),c}function i(l,u,c){if(!c){var p=l-u.length()%l;u.fillWithByte(p-1,p)}return!0}function a(l,u,c){var p=!0;if(c){for(var h=u.length(),d=u.last(),v=h-1-d;v<h-1;++v)p=p&&u.at(v)==d;p&&u.truncate(d+1)}return p}function o(l,u){var c=!1,p;l.version.minor===t.Versions.TLS_1_0.minor?p=u.cipherState.init?null:u.cipherState.iv:p=l.fragment.getBytes(16),u.cipherState.init=!0;var h=u.cipherState.cipher;h.start({iv:p}),h.update(l.fragment),c=h.finish(a);var d=u.macLength,v=e.random.getBytesSync(d),m=h.output.length();m>=d?(l.fragment=h.output.getBytes(m-d),v=h.output.getBytes(d)):l.fragment=h.output.getBytes(),l.fragment=e.util.createBuffer(l.fragment),l.length=l.fragment.length();var b=u.macFunction(u.macKey,u.sequenceNumber,l);return u.updateSequenceNumber(),c=s(u.macKey,v,b)&&c,c}function s(l,u,c){var p=e.hmac.create();return p.start("SHA1",l),p.update(u),u=p.digest().getBytes(),p.start(null,null),p.update(c),c=p.digest().getBytes(),u===c}return Dd.exports}var qd={exports:{}},Rm;function Rx(){if(Rm)return qd.exports;Rm=1;var e=Le();mi(),Xe();var t=qd.exports=e.sha512=e.sha512||{};e.md.sha512=e.md.algorithms.sha512=t;var n=e.sha384=e.sha512.sha384=e.sha512.sha384||{};n.create=function(){return t.create("SHA-384")},e.md.sha384=e.md.algorithms.sha384=n,e.sha512.sha256=e.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},e.md["sha512/256"]=e.md.algorithms["sha512/256"]=e.sha512.sha256,e.sha512.sha224=e.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},e.md["sha512/224"]=e.md.algorithms["sha512/224"]=e.sha512.sha224,t.create=function(u){if(i||s(),typeof u>"u"&&(u="SHA-512"),!(u in o))throw new Error("Invalid SHA-512 algorithm: "+u);for(var c=o[u],p=null,h=e.util.createBuffer(),d=new Array(80),v=0;v<80;++v)d[v]=new Array(2);var m=64;switch(u){case"SHA-384":m=48;break;case"SHA-512/256":m=32;break;case"SHA-512/224":m=28;break}var b={algorithm:u.replace("-","").toLowerCase(),blockLength:128,digestLength:m,messageLength:0,fullMessageLength:null,messageLengthSize:16};return b.start=function(){b.messageLength=0,b.fullMessageLength=b.messageLength128=[];for(var f=b.messageLengthSize/4,y=0;y<f;++y)b.fullMessageLength.push(0);h=e.util.createBuffer(),p=new Array(c.length);for(var y=0;y<c.length;++y)p[y]=c[y].slice(0);return b},b.start(),b.update=function(f,y){y==="utf8"&&(f=e.util.encodeUtf8(f));var C=f.length;b.messageLength+=C,C=[C/4294967296>>>0,C>>>0];for(var S=b.fullMessageLength.length-1;S>=0;--S)b.fullMessageLength[S]+=C[1],C[1]=C[0]+(b.fullMessageLength[S]/4294967296>>>0),b.fullMessageLength[S]=b.fullMessageLength[S]>>>0,C[0]=C[1]/4294967296>>>0;return h.putBytes(f),l(p,d,h),(h.read>2048||h.length()===0)&&h.compact(),b},b.digest=function(){var f=e.util.createBuffer();f.putBytes(h.bytes());var y=b.fullMessageLength[b.fullMessageLength.length-1]+b.messageLengthSize,C=y&b.blockLength-1;f.putBytes(r.substr(0,b.blockLength-C));for(var S,w,E=b.fullMessageLength[0]*8,x=0;x<b.fullMessageLength.length-1;++x)S=b.fullMessageLength[x+1]*8,w=S/4294967296>>>0,E+=w,f.putInt32(E>>>0),E=S>>>0;f.putInt32(E);for(var g=new Array(p.length),x=0;x<p.length;++x)g[x]=p[x].slice(0);l(g,d,f);var I=e.util.createBuffer(),A;u==="SHA-512"?A=g.length:u==="SHA-384"?A=g.length-2:A=g.length-4;for(var x=0;x<A;++x)I.putInt32(g[x][0]),(x!==A-1||u!=="SHA-512/224")&&I.putInt32(g[x][1]);return I},b};var r=null,i=!1,a=null,o=null;function s(){r="€",r+=e.util.fillString("\0",128),a=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],o={},o["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],o["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],o["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],o["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],i=!0}function l(u,c,p){for(var h,d,v,m,b,f,y,C,S,w,E,x,g,I,A,_,T,$,B,P,k,O,M,G,W,U,q,Q,Z,ee,J,le,re,R,H,V=p.length();V>=128;){for(Z=0;Z<16;++Z)c[Z][0]=p.getInt32()>>>0,c[Z][1]=p.getInt32()>>>0;for(;Z<80;++Z)le=c[Z-2],ee=le[0],J=le[1],h=((ee>>>19|J<<13)^(J>>>29|ee<<3)^ee>>>6)>>>0,d=((ee<<13|J>>>19)^(J<<3|ee>>>29)^(ee<<26|J>>>6))>>>0,R=c[Z-15],ee=R[0],J=R[1],v=((ee>>>1|J<<31)^(ee>>>8|J<<24)^ee>>>7)>>>0,m=((ee<<31|J>>>1)^(ee<<24|J>>>8)^(ee<<25|J>>>7))>>>0,re=c[Z-7],H=c[Z-16],J=d+re[1]+m+H[1],c[Z][0]=h+re[0]+v+H[0]+(J/4294967296>>>0)>>>0,c[Z][1]=J>>>0;for(g=u[0][0],I=u[0][1],A=u[1][0],_=u[1][1],T=u[2][0],$=u[2][1],B=u[3][0],P=u[3][1],k=u[4][0],O=u[4][1],M=u[5][0],G=u[5][1],W=u[6][0],U=u[6][1],q=u[7][0],Q=u[7][1],Z=0;Z<80;++Z)y=((k>>>14|O<<18)^(k>>>18|O<<14)^(O>>>9|k<<23))>>>0,C=((k<<18|O>>>14)^(k<<14|O>>>18)^(O<<23|k>>>9))>>>0,S=(W^k&(M^W))>>>0,w=(U^O&(G^U))>>>0,b=((g>>>28|I<<4)^(I>>>2|g<<30)^(I>>>7|g<<25))>>>0,f=((g<<4|I>>>28)^(I<<30|g>>>2)^(I<<25|g>>>7))>>>0,E=(g&A|T&(g^A))>>>0,x=(I&_|$&(I^_))>>>0,J=Q+C+w+a[Z][1]+c[Z][1],h=q+y+S+a[Z][0]+c[Z][0]+(J/4294967296>>>0)>>>0,d=J>>>0,J=f+x,v=b+E+(J/4294967296>>>0)>>>0,m=J>>>0,q=W,Q=U,W=M,U=G,M=k,G=O,J=P+d,k=B+h+(J/4294967296>>>0)>>>0,O=J>>>0,B=T,P=$,T=A,$=_,A=g,_=I,J=d+m,g=h+v+(J/4294967296>>>0)>>>0,I=J>>>0;J=u[0][1]+I,u[0][0]=u[0][0]+g+(J/4294967296>>>0)>>>0,u[0][1]=J>>>0,J=u[1][1]+_,u[1][0]=u[1][0]+A+(J/4294967296>>>0)>>>0,u[1][1]=J>>>0,J=u[2][1]+$,u[2][0]=u[2][0]+T+(J/4294967296>>>0)>>>0,u[2][1]=J>>>0,J=u[3][1]+P,u[3][0]=u[3][0]+B+(J/4294967296>>>0)>>>0,u[3][1]=J>>>0,J=u[4][1]+O,u[4][0]=u[4][0]+k+(J/4294967296>>>0)>>>0,u[4][1]=J>>>0,J=u[5][1]+G,u[5][0]=u[5][0]+M+(J/4294967296>>>0)>>>0,u[5][1]=J>>>0,J=u[6][1]+U,u[6][0]=u[6][0]+W+(J/4294967296>>>0)>>>0,u[6][1]=J>>>0,J=u[7][1]+Q,u[7][0]=u[7][0]+q+(J/4294967296>>>0)>>>0,u[7][1]=J>>>0,V-=128}}return qd.exports}var Rl={},Bm;function uD(){if(Bm)return Rl;Bm=1;var e=Le();Wr();var t=e.asn1;return Rl.privateKeyValidator={name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Rl.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]},Rl}var Qd,km;function cD(){if(km)return Qd;km=1;var e=Le();Rc(),Er(),Rx(),Xe();var t=uD(),n=t.publicKeyValidator,r=t.privateKeyValidator;if(typeof i>"u")var i=e.jsbn.BigInteger;var a=e.util.ByteBuffer,o=typeof Buffer>"u"?Uint8Array:Buffer;e.pki=e.pki||{},Qd=e.pki.ed25519=e.ed25519=e.ed25519||{};var s=e.ed25519;s.constants={},s.constants.PUBLIC_KEY_BYTE_LENGTH=32,s.constants.PRIVATE_KEY_BYTE_LENGTH=64,s.constants.SEED_BYTE_LENGTH=32,s.constants.SIGN_BYTE_LENGTH=64,s.constants.HASH_BYTE_LENGTH=64,s.generateKeyPair=function(R){R=R||{};var H=R.seed;if(H===void 0)H=e.random.getBytesSync(s.constants.SEED_BYTE_LENGTH);else if(typeof H=="string"){if(H.length!==s.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+s.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(H instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');H=l({message:H,encoding:"binary"});for(var V=new o(s.constants.PUBLIC_KEY_BYTE_LENGTH),D=new o(s.constants.PRIVATE_KEY_BYTE_LENGTH),L=0;L<32;++L)D[L]=H[L];return y(V,D),{publicKey:V,privateKey:D}},s.privateKeyFromAsn1=function(R){var H={},V=[],D=e.asn1.validate(R,r,H,V);if(!D){var L=new Error("Invalid Key.");throw L.errors=V,L}var K=e.asn1.derToOid(H.privateKeyOid),X=e.oids.EdDSA25519;if(K!==X)throw new Error('Invalid OID "'+K+'"; OID must be "'+X+'".');var se=H.privateKey,ie=l({message:e.asn1.fromDer(se).value,encoding:"binary"});return{privateKeyBytes:ie}},s.publicKeyFromAsn1=function(R){var H={},V=[],D=e.asn1.validate(R,n,H,V);if(!D){var L=new Error("Invalid Key.");throw L.errors=V,L}var K=e.asn1.derToOid(H.publicKeyOid),X=e.oids.EdDSA25519;if(K!==X)throw new Error('Invalid OID "'+K+'"; OID must be "'+X+'".');var se=H.ed25519PublicKey;if(se.length!==s.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return l({message:se,encoding:"binary"})},s.publicKeyFromPrivateKey=function(R){R=R||{};var H=l({message:R.privateKey,encoding:"binary"});if(H.length!==s.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+s.constants.PRIVATE_KEY_BYTE_LENGTH);for(var V=new o(s.constants.PUBLIC_KEY_BYTE_LENGTH),D=0;D<V.length;++D)V[D]=H[32+D];return V},s.sign=function(R){R=R||{};var H=l(R),V=l({message:R.privateKey,encoding:"binary"});if(V.length===s.constants.SEED_BYTE_LENGTH){var D=s.generateKeyPair({seed:V});V=D.privateKey}else if(V.length!==s.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+s.constants.SEED_BYTE_LENGTH+" or "+s.constants.PRIVATE_KEY_BYTE_LENGTH);var L=new o(s.constants.SIGN_BYTE_LENGTH+H.length);C(L,H,H.length,V);for(var K=new o(s.constants.SIGN_BYTE_LENGTH),X=0;X<K.length;++X)K[X]=L[X];return K},s.verify=function(R){R=R||{};var H=l(R);if(R.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var V=l({message:R.signature,encoding:"binary"});if(V.length!==s.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+s.constants.SIGN_BYTE_LENGTH);var D=l({message:R.publicKey,encoding:"binary"});if(D.length!==s.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+s.constants.PUBLIC_KEY_BYTE_LENGTH);var L=new o(s.constants.SIGN_BYTE_LENGTH+H.length),K=new o(s.constants.SIGN_BYTE_LENGTH+H.length),X;for(X=0;X<s.constants.SIGN_BYTE_LENGTH;++X)L[X]=V[X];for(X=0;X<H.length;++X)L[X+s.constants.SIGN_BYTE_LENGTH]=H[X];return S(K,L,L.length,D)>=0};function l(R){var H=R.message;if(H instanceof Uint8Array||H instanceof o)return H;var V=R.encoding;if(H===void 0)if(R.md)H=R.md.digest().getBytes(),V="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof H=="string"&&!V)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof H=="string"){if(typeof Buffer<"u")return Buffer.from(H,V);H=new a(H,V)}else if(!(H instanceof a))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var D=new o(H.length()),L=0;L<D.length;++L)D[L]=H.at(L);return D}var u=Z(),c=Z([1]),p=Z([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=Z([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=Z([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=Z([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=Z([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function f(R,H){var V=e.md.sha512.create(),D=new a(R);V.update(D.getBytes(H),"binary");var L=V.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(L,"binary");for(var K=new o(s.constants.HASH_BYTE_LENGTH),X=0;X<64;++X)K[X]=L.charCodeAt(X);return K}function y(R,H){var V=[Z(),Z(),Z(),Z()],D,L=f(H,32);for(L[0]&=248,L[31]&=127,L[31]|=64,G(V,L),I(R,V),D=0;D<32;++D)H[D+32]=R[D];return 0}function C(R,H,V,D){var L,K,X=new Float64Array(64),se=[Z(),Z(),Z(),Z()],ie=f(D,32);ie[0]&=248,ie[31]&=127,ie[31]|=64;var oe=V+64;for(L=0;L<V;++L)R[64+L]=H[L];for(L=0;L<32;++L)R[32+L]=ie[32+L];var te=f(R.subarray(32),V+32);for(E(te),G(se,te),I(R,se),L=32;L<64;++L)R[L]=D[L];var ue=f(R,V+64);for(E(ue),L=32;L<64;++L)X[L]=0;for(L=0;L<32;++L)X[L]=te[L];for(L=0;L<32;++L)for(K=0;K<32;K++)X[L+K]+=ue[L]*ie[K];return w(R.subarray(32),X),oe}function S(R,H,V,D){var L,K,X=new o(32),se=[Z(),Z(),Z(),Z()],ie=[Z(),Z(),Z(),Z()];if(K=-1,V<64||_(ie,D))return-1;for(L=0;L<V;++L)R[L]=H[L];for(L=0;L<32;++L)R[L+32]=D[L];var oe=f(R,V);if(E(oe),M(se,ie,oe),G(ie,H.subarray(32)),x(se,ie),I(X,se),V-=64,P(H,0,X,0)){for(L=0;L<V;++L)R[L]=0;return-1}for(L=0;L<V;++L)R[L]=H[L+64];return K=V,K}function w(R,H){var V,D,L,K;for(D=63;D>=32;--D){for(V=0,L=D-32,K=D-12;L<K;++L)H[L]+=V-16*H[D]*m[L-(D-32)],V=H[L]+128>>8,H[L]-=V*256;H[L]+=V,H[D]=0}for(V=0,L=0;L<32;++L)H[L]+=V-(H[31]>>4)*m[L],V=H[L]>>8,H[L]&=255;for(L=0;L<32;++L)H[L]-=V*m[L];for(D=0;D<32;++D)H[D+1]+=H[D]>>8,R[D]=H[D]&255}function E(R){for(var H=new Float64Array(64),V=0;V<64;++V)H[V]=R[V],R[V]=0;w(R,H)}function x(R,H){var V=Z(),D=Z(),L=Z(),K=Z(),X=Z(),se=Z(),ie=Z(),oe=Z(),te=Z();J(V,R[1],R[0]),J(te,H[1],H[0]),re(V,V,te),ee(D,R[0],R[1]),ee(te,H[0],H[1]),re(D,D,te),re(L,R[3],H[3]),re(L,L,h),re(K,R[2],H[2]),ee(K,K,K),J(X,D,V),J(se,K,L),ee(ie,K,L),ee(oe,D,V),re(R[0],X,se),re(R[1],oe,ie),re(R[2],ie,se),re(R[3],X,oe)}function g(R,H,V){for(var D=0;D<4;++D)Q(R[D],H[D],V)}function I(R,H){var V=Z(),D=Z(),L=Z();U(L,H[2]),re(V,H[0],L),re(D,H[1],L),A(R,D),R[31]^=O(V)<<7}function A(R,H){var V,D,L,K=Z(),X=Z();for(V=0;V<16;++V)X[V]=H[V];for(q(X),q(X),q(X),D=0;D<2;++D){for(K[0]=X[0]-65517,V=1;V<15;++V)K[V]=X[V]-65535-(K[V-1]>>16&1),K[V-1]&=65535;K[15]=X[15]-32767-(K[14]>>16&1),L=K[15]>>16&1,K[14]&=65535,Q(X,K,1-L)}for(V=0;V<16;V++)R[2*V]=X[V]&255,R[2*V+1]=X[V]>>8}function _(R,H){var V=Z(),D=Z(),L=Z(),K=Z(),X=Z(),se=Z(),ie=Z();return W(R[2],c),T(R[1],H),le(L,R[1]),re(K,L,p),J(L,L,R[2]),ee(K,R[2],K),le(X,K),le(se,X),re(ie,se,X),re(V,ie,L),re(V,V,K),$(V,V),re(V,V,L),re(V,V,K),re(V,V,K),re(R[0],V,K),le(D,R[0]),re(D,D,K),B(D,L)&&re(R[0],R[0],b),le(D,R[0]),re(D,D,K),B(D,L)?-1:(O(R[0])===H[31]>>7&&J(R[0],u,R[0]),re(R[3],R[0],R[1]),0)}function T(R,H){var V;for(V=0;V<16;++V)R[V]=H[2*V]+(H[2*V+1]<<8);R[15]&=32767}function $(R,H){var V=Z(),D;for(D=0;D<16;++D)V[D]=H[D];for(D=250;D>=0;--D)le(V,V),D!==1&&re(V,V,H);for(D=0;D<16;++D)R[D]=V[D]}function B(R,H){var V=new o(32),D=new o(32);return A(V,R),A(D,H),P(V,0,D,0)}function P(R,H,V,D){return k(R,H,V,D,32)}function k(R,H,V,D,L){var K,X=0;for(K=0;K<L;++K)X|=R[H+K]^V[D+K];return(1&X-1>>>8)-1}function O(R){var H=new o(32);return A(H,R),H[0]&1}function M(R,H,V){var D,L;for(W(R[0],u),W(R[1],c),W(R[2],c),W(R[3],u),L=255;L>=0;--L)D=V[L/8|0]>>(L&7)&1,g(R,H,D),x(H,R),x(R,R),g(R,H,D)}function G(R,H){var V=[Z(),Z(),Z(),Z()];W(V[0],d),W(V[1],v),W(V[2],c),re(V[3],d,v),M(R,V,H)}function W(R,H){var V;for(V=0;V<16;V++)R[V]=H[V]|0}function U(R,H){var V=Z(),D;for(D=0;D<16;++D)V[D]=H[D];for(D=253;D>=0;--D)le(V,V),D!==2&&D!==4&&re(V,V,H);for(D=0;D<16;++D)R[D]=V[D]}function q(R){var H,V,D=1;for(H=0;H<16;++H)V=R[H]+D+65535,D=Math.floor(V/65536),R[H]=V-D*65536;R[0]+=D-1+37*(D-1)}function Q(R,H,V){for(var D,L=~(V-1),K=0;K<16;++K)D=L&(R[K]^H[K]),R[K]^=D,H[K]^=D}function Z(R){var H,V=new Float64Array(16);if(R)for(H=0;H<R.length;++H)V[H]=R[H];return V}function ee(R,H,V){for(var D=0;D<16;++D)R[D]=H[D]+V[D]}function J(R,H,V){for(var D=0;D<16;++D)R[D]=H[D]-V[D]}function le(R,H){re(R,H,H)}function re(R,H,V){var D,L,K=0,X=0,se=0,ie=0,oe=0,te=0,ue=0,ve=0,be=0,pe=0,Te=0,Ne=0,Ue=0,tt=0,lt=0,ut=0,xt=0,Dt=0,kt=0,vn=0,bn=0,Pn=0,Gn=0,or=0,Sr=0,Yr=0,Ei=0,ea=0,Ga=0,Uo=0,Sl=0,Vt=V[0],Ht=V[1],jt=V[2],zt=V[3],Gt=V[4],Wt=V[5],Ut=V[6],Xt=V[7],Yt=V[8],Kt=V[9],Zt=V[10],Jt=V[11],Ct=V[12],Pt=V[13],qt=V[14],Qt=V[15];D=H[0],K+=D*Vt,X+=D*Ht,se+=D*jt,ie+=D*zt,oe+=D*Gt,te+=D*Wt,ue+=D*Ut,ve+=D*Xt,be+=D*Yt,pe+=D*Kt,Te+=D*Zt,Ne+=D*Jt,Ue+=D*Ct,tt+=D*Pt,lt+=D*qt,ut+=D*Qt,D=H[1],X+=D*Vt,se+=D*Ht,ie+=D*jt,oe+=D*zt,te+=D*Gt,ue+=D*Wt,ve+=D*Ut,be+=D*Xt,pe+=D*Yt,Te+=D*Kt,Ne+=D*Zt,Ue+=D*Jt,tt+=D*Ct,lt+=D*Pt,ut+=D*qt,xt+=D*Qt,D=H[2],se+=D*Vt,ie+=D*Ht,oe+=D*jt,te+=D*zt,ue+=D*Gt,ve+=D*Wt,be+=D*Ut,pe+=D*Xt,Te+=D*Yt,Ne+=D*Kt,Ue+=D*Zt,tt+=D*Jt,lt+=D*Ct,ut+=D*Pt,xt+=D*qt,Dt+=D*Qt,D=H[3],ie+=D*Vt,oe+=D*Ht,te+=D*jt,ue+=D*zt,ve+=D*Gt,be+=D*Wt,pe+=D*Ut,Te+=D*Xt,Ne+=D*Yt,Ue+=D*Kt,tt+=D*Zt,lt+=D*Jt,ut+=D*Ct,xt+=D*Pt,Dt+=D*qt,kt+=D*Qt,D=H[4],oe+=D*Vt,te+=D*Ht,ue+=D*jt,ve+=D*zt,be+=D*Gt,pe+=D*Wt,Te+=D*Ut,Ne+=D*Xt,Ue+=D*Yt,tt+=D*Kt,lt+=D*Zt,ut+=D*Jt,xt+=D*Ct,Dt+=D*Pt,kt+=D*qt,vn+=D*Qt,D=H[5],te+=D*Vt,ue+=D*Ht,ve+=D*jt,be+=D*zt,pe+=D*Gt,Te+=D*Wt,Ne+=D*Ut,Ue+=D*Xt,tt+=D*Yt,lt+=D*Kt,ut+=D*Zt,xt+=D*Jt,Dt+=D*Ct,kt+=D*Pt,vn+=D*qt,bn+=D*Qt,D=H[6],ue+=D*Vt,ve+=D*Ht,be+=D*jt,pe+=D*zt,Te+=D*Gt,Ne+=D*Wt,Ue+=D*Ut,tt+=D*Xt,lt+=D*Yt,ut+=D*Kt,xt+=D*Zt,Dt+=D*Jt,kt+=D*Ct,vn+=D*Pt,bn+=D*qt,Pn+=D*Qt,D=H[7],ve+=D*Vt,be+=D*Ht,pe+=D*jt,Te+=D*zt,Ne+=D*Gt,Ue+=D*Wt,tt+=D*Ut,lt+=D*Xt,ut+=D*Yt,xt+=D*Kt,Dt+=D*Zt,kt+=D*Jt,vn+=D*Ct,bn+=D*Pt,Pn+=D*qt,Gn+=D*Qt,D=H[8],be+=D*Vt,pe+=D*Ht,Te+=D*jt,Ne+=D*zt,Ue+=D*Gt,tt+=D*Wt,lt+=D*Ut,ut+=D*Xt,xt+=D*Yt,Dt+=D*Kt,kt+=D*Zt,vn+=D*Jt,bn+=D*Ct,Pn+=D*Pt,Gn+=D*qt,or+=D*Qt,D=H[9],pe+=D*Vt,Te+=D*Ht,Ne+=D*jt,Ue+=D*zt,tt+=D*Gt,lt+=D*Wt,ut+=D*Ut,xt+=D*Xt,Dt+=D*Yt,kt+=D*Kt,vn+=D*Zt,bn+=D*Jt,Pn+=D*Ct,Gn+=D*Pt,or+=D*qt,Sr+=D*Qt,D=H[10],Te+=D*Vt,Ne+=D*Ht,Ue+=D*jt,tt+=D*zt,lt+=D*Gt,ut+=D*Wt,xt+=D*Ut,Dt+=D*Xt,kt+=D*Yt,vn+=D*Kt,bn+=D*Zt,Pn+=D*Jt,Gn+=D*Ct,or+=D*Pt,Sr+=D*qt,Yr+=D*Qt,D=H[11],Ne+=D*Vt,Ue+=D*Ht,tt+=D*jt,lt+=D*zt,ut+=D*Gt,xt+=D*Wt,Dt+=D*Ut,kt+=D*Xt,vn+=D*Yt,bn+=D*Kt,Pn+=D*Zt,Gn+=D*Jt,or+=D*Ct,Sr+=D*Pt,Yr+=D*qt,Ei+=D*Qt,D=H[12],Ue+=D*Vt,tt+=D*Ht,lt+=D*jt,ut+=D*zt,xt+=D*Gt,Dt+=D*Wt,kt+=D*Ut,vn+=D*Xt,bn+=D*Yt,Pn+=D*Kt,Gn+=D*Zt,or+=D*Jt,Sr+=D*Ct,Yr+=D*Pt,Ei+=D*qt,ea+=D*Qt,D=H[13],tt+=D*Vt,lt+=D*Ht,ut+=D*jt,xt+=D*zt,Dt+=D*Gt,kt+=D*Wt,vn+=D*Ut,bn+=D*Xt,Pn+=D*Yt,Gn+=D*Kt,or+=D*Zt,Sr+=D*Jt,Yr+=D*Ct,Ei+=D*Pt,ea+=D*qt,Ga+=D*Qt,D=H[14],lt+=D*Vt,ut+=D*Ht,xt+=D*jt,Dt+=D*zt,kt+=D*Gt,vn+=D*Wt,bn+=D*Ut,Pn+=D*Xt,Gn+=D*Yt,or+=D*Kt,Sr+=D*Zt,Yr+=D*Jt,Ei+=D*Ct,ea+=D*Pt,Ga+=D*qt,Uo+=D*Qt,D=H[15],ut+=D*Vt,xt+=D*Ht,Dt+=D*jt,kt+=D*zt,vn+=D*Gt,bn+=D*Wt,Pn+=D*Ut,Gn+=D*Xt,or+=D*Yt,Sr+=D*Kt,Yr+=D*Zt,Ei+=D*Jt,ea+=D*Ct,Ga+=D*Pt,Uo+=D*qt,Sl+=D*Qt,K+=38*xt,X+=38*Dt,se+=38*kt,ie+=38*vn,oe+=38*bn,te+=38*Pn,ue+=38*Gn,ve+=38*or,be+=38*Sr,pe+=38*Yr,Te+=38*Ei,Ne+=38*ea,Ue+=38*Ga,tt+=38*Uo,lt+=38*Sl,L=1,D=K+L+65535,L=Math.floor(D/65536),K=D-L*65536,D=X+L+65535,L=Math.floor(D/65536),X=D-L*65536,D=se+L+65535,L=Math.floor(D/65536),se=D-L*65536,D=ie+L+65535,L=Math.floor(D/65536),ie=D-L*65536,D=oe+L+65535,L=Math.floor(D/65536),oe=D-L*65536,D=te+L+65535,L=Math.floor(D/65536),te=D-L*65536,D=ue+L+65535,L=Math.floor(D/65536),ue=D-L*65536,D=ve+L+65535,L=Math.floor(D/65536),ve=D-L*65536,D=be+L+65535,L=Math.floor(D/65536),be=D-L*65536,D=pe+L+65535,L=Math.floor(D/65536),pe=D-L*65536,D=Te+L+65535,L=Math.floor(D/65536),Te=D-L*65536,D=Ne+L+65535,L=Math.floor(D/65536),Ne=D-L*65536,D=Ue+L+65535,L=Math.floor(D/65536),Ue=D-L*65536,D=tt+L+65535,L=Math.floor(D/65536),tt=D-L*65536,D=lt+L+65535,L=Math.floor(D/65536),lt=D-L*65536,D=ut+L+65535,L=Math.floor(D/65536),ut=D-L*65536,K+=L-1+37*(L-1),L=1,D=K+L+65535,L=Math.floor(D/65536),K=D-L*65536,D=X+L+65535,L=Math.floor(D/65536),X=D-L*65536,D=se+L+65535,L=Math.floor(D/65536),se=D-L*65536,D=ie+L+65535,L=Math.floor(D/65536),ie=D-L*65536,D=oe+L+65535,L=Math.floor(D/65536),oe=D-L*65536,D=te+L+65535,L=Math.floor(D/65536),te=D-L*65536,D=ue+L+65535,L=Math.floor(D/65536),ue=D-L*65536,D=ve+L+65535,L=Math.floor(D/65536),ve=D-L*65536,D=be+L+65535,L=Math.floor(D/65536),be=D-L*65536,D=pe+L+65535,L=Math.floor(D/65536),pe=D-L*65536,D=Te+L+65535,L=Math.floor(D/65536),Te=D-L*65536,D=Ne+L+65535,L=Math.floor(D/65536),Ne=D-L*65536,D=Ue+L+65535,L=Math.floor(D/65536),Ue=D-L*65536,D=tt+L+65535,L=Math.floor(D/65536),tt=D-L*65536,D=lt+L+65535,L=Math.floor(D/65536),lt=D-L*65536,D=ut+L+65535,L=Math.floor(D/65536),ut=D-L*65536,K+=L-1+37*(L-1),R[0]=K,R[1]=X,R[2]=se,R[3]=ie,R[4]=oe,R[5]=te,R[6]=ue,R[7]=ve,R[8]=be,R[9]=pe,R[10]=Te,R[11]=Ne,R[12]=Ue,R[13]=tt,R[14]=lt,R[15]=ut}return Qd}var ef,Pm;function dD(){if(Pm)return ef;Pm=1;var e=Le();Xe(),Er(),Rc(),ef=e.kem=e.kem||{};var t=e.jsbn.BigInteger;e.kem.rsa={},e.kem.rsa.create=function(r,i){i=i||{};var a=i.prng||e.random,o={};return o.encrypt=function(s,l){var u=Math.ceil(s.n.bitLength()/8),c;do c=new t(e.util.bytesToHex(a.getBytesSync(u)),16).mod(s.n);while(c.compareTo(t.ONE)<=0);c=e.util.hexToBytes(c.toString(16));var p=u-c.length;p>0&&(c=e.util.fillString("\0",p)+c);var h=s.encrypt(c,"NONE"),d=r.generate(c,l);return{encapsulation:h,key:d}},o.decrypt=function(s,l,u){var c=s.decrypt(l,"NONE");return r.generate(c,u)},o},e.kem.kdf1=function(r,i){n(this,r,0,i||r.digestLength)},e.kem.kdf2=function(r,i){n(this,r,1,i||r.digestLength)};function n(r,i,a,o){r.generate=function(s,l){for(var u=new e.util.ByteBuffer,c=Math.ceil(l/o)+a,p=new e.util.ByteBuffer,h=a;h<c;++h){p.putInt32(h),i.start(),i.update(s+p.getBytes());var d=i.digest();u.putBytes(d.getBytes(o))}return u.truncate(u.length()-l),u.getBytes()}}return ef}var tf,$m;function fD(){if($m)return tf;$m=1;var e=Le();Xe(),tf=e.log=e.log||{},e.log.levels=["none","error","warning","info","debug","verbose","max"];var t={},n=[],r=null;e.log.LEVEL_LOCKED=2,e.log.NO_LEVEL_CHECK=4,e.log.INTERPOLATE=8;for(var i=0;i<e.log.levels.length;++i){var a=e.log.levels[i];t[a]={index:i,name:a.toUpperCase()}}e.log.logMessage=function(h){for(var d=t[h.level].index,v=0;v<n.length;++v){var m=n[v];if(m.flags&e.log.NO_LEVEL_CHECK)m.f(h);else{var b=t[m.level].index;d<=b&&m.f(m,h)}}},e.log.prepareStandard=function(h){"standard"in h||(h.standard=t[h.level].name+" ["+h.category+"] "+h.message)},e.log.prepareFull=function(h){if(!("full"in h)){var d=[h.message];d=d.concat([]),h.full=e.util.format.apply(this,d)}},e.log.prepareStandardFull=function(h){"standardFull"in h||(e.log.prepareStandard(h),h.standardFull=h.standard)};for(var o=["error","warning","info","debug","verbose"],i=0;i<o.length;++i)(function(d){e.log[d]=function(v,m){var b=Array.prototype.slice.call(arguments).slice(2),f={timestamp:new Date,level:d,category:v,message:m,arguments:b};e.log.logMessage(f)}})(o[i]);if(e.log.makeLogger=function(h){var d={flags:0,f:h};return e.log.setLevel(d,"none"),d},e.log.setLevel=function(h,d){var v=!1;if(h&&!(h.flags&e.log.LEVEL_LOCKED))for(var m=0;m<e.log.levels.length;++m){var b=e.log.levels[m];if(d==b){h.level=d,v=!0;break}}return v},e.log.lock=function(h,d){typeof d>"u"||d?h.flags|=e.log.LEVEL_LOCKED:h.flags&=~e.log.LEVEL_LOCKED},e.log.addLogger=function(h){n.push(h)},typeof console<"u"&&"log"in console){var s;if(console.error&&console.warn&&console.info&&console.debug){var l={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},u=function(h,d){e.log.prepareStandard(d);var v=l[d.level],m=[d.standard];m=m.concat(d.arguments.slice()),v.apply(console,m)};s=e.log.makeLogger(u)}else{var u=function(d,v){e.log.prepareStandardFull(v),console.log(v.standardFull)};s=e.log.makeLogger(u)}e.log.setLevel(s,"debug"),e.log.addLogger(s),r=s}else console={log:function(){}};if(r!==null&&typeof window<"u"&&window.location){var c=new URL(window.location.href).searchParams;if(c.has("console.level")&&e.log.setLevel(r,c.get("console.level").slice(-1)[0]),c.has("console.lock")){var p=c.get("console.lock").slice(-1)[0];p=="true"&&e.log.lock(r)}}return e.log.consoleLogger=r,tf}var nf,Fm;function hD(){return Fm||(Fm=1,nf=mi(),V0(),il(),yx(),Rx()),nf}var rf={exports:{}},Nm;function gD(){if(Nm)return rf.exports;Nm=1;var e=Le();Ma(),Wr(),Ac(),Oa(),Oo(),Ix(),Er(),Xe(),G0();var t=e.asn1,n=rf.exports=e.pkcs7=e.pkcs7||{};n.messageFromPem=function(d){var v=e.pem.decode(d)[0];if(v.type!=="PKCS7"){var m=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw m.headerType=v.type,m}if(v.procType&&v.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var b=t.fromDer(v.body);return n.messageFromAsn1(b)},n.messageToPem=function(d,v){var m={type:"PKCS7",body:t.toDer(d.toAsn1()).getBytes()};return e.pem.encode(m,{maxline:v})},n.messageFromAsn1=function(d){var v={},m=[];if(!t.validate(d,n.asn1.contentInfoValidator,v,m)){var b=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw b.errors=m,b}var f=t.derToOid(v.contentType),y;switch(f){case e.pki.oids.envelopedData:y=n.createEnvelopedData();break;case e.pki.oids.encryptedData:y=n.createEncryptedData();break;case e.pki.oids.signedData:y=n.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+f+" is not (yet) supported.")}return y.fromAsn1(v.content.value[0]),y},n.createSignedData=function(){var d=null;return d={type:e.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(b){if(p(d,b,n.asn1.signedDataValidator),d.certificates=[],d.crls=[],d.digestAlgorithmIdentifiers=[],d.contentInfo=null,d.signerInfos=[],d.rawCapture.certificates)for(var f=d.rawCapture.certificates.value,y=0;y<f.length;++y)d.certificates.push(e.pki.certificateFromAsn1(f[y]))},toAsn1:function(){d.contentInfo||d.sign();for(var b=[],f=0;f<d.certificates.length;++f)b.push(e.pki.certificateToAsn1(d.certificates[f]));var y=[],C=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d.digestAlgorithmIdentifiers),d.contentInfo])]);return b.length>0&&C.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,b)),y.length>0&&C.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,y)),C.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,d.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),C])},addSigner:function(b){var f=b.issuer,y=b.serialNumber;if(b.certificate){var C=b.certificate;typeof C=="string"&&(C=e.pki.certificateFromPem(C)),f=C.issuer.attributes,y=C.serialNumber}var S=b.key;if(!S)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof S=="string"&&(S=e.pki.privateKeyFromPem(S));var w=b.digestAlgorithm||e.pki.oids.sha1;switch(w){case e.pki.oids.sha1:case e.pki.oids.sha256:case e.pki.oids.sha384:case e.pki.oids.sha512:case e.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+w)}var E=b.authenticatedAttributes||[];if(E.length>0){for(var x=!1,g=!1,I=0;I<E.length;++I){var A=E[I];if(!x&&A.type===e.pki.oids.contentType){if(x=!0,g)break;continue}if(!g&&A.type===e.pki.oids.messageDigest){if(g=!0,x)break;continue}}if(!x||!g)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}d.signers.push({key:S,version:1,issuer:f,serialNumber:y,digestAlgorithm:w,signatureAlgorithm:e.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:E,unauthenticatedAttributes:[]})},sign:function(b){if(b=b||{},(typeof d.content!="object"||d.contentInfo===null)&&(d.contentInfo=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.pki.oids.data).getBytes())]),"content"in d)){var f;d.content instanceof e.util.ByteBuffer?f=d.content.bytes():typeof d.content=="string"&&(f=e.util.encodeUtf8(d.content)),b.detached?d.detachedContent=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,f):d.contentInfo.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,f)]))}if(d.signers.length!==0){var y=v();m(y)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(b){typeof b=="string"&&(b=e.pki.certificateFromPem(b)),d.certificates.push(b)},addCertificateRevokationList:function(b){throw new Error("PKCS#7 CRL support not yet implemented.")}},d;function v(){for(var b={},f=0;f<d.signers.length;++f){var y=d.signers[f],C=y.digestAlgorithm;C in b||(b[C]=e.md[e.pki.oids[C]].create()),y.authenticatedAttributes.length===0?y.md=b[C]:y.md=e.md[e.pki.oids[C]].create()}d.digestAlgorithmIdentifiers=[];for(var C in b)d.digestAlgorithmIdentifiers.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(C).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]));return b}function m(b){var f;if(d.detachedContent?f=d.detachedContent:(f=d.contentInfo.value[1],f=f.value[0]),!f)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var y=t.derToOid(d.contentInfo.value[0].value),C=t.toDer(f);C.getByte(),t.getBerValueLength(C),C=C.getBytes();for(var S in b)b[S].start().update(C);for(var w=new Date,E=0;E<d.signers.length;++E){var x=d.signers[E];if(x.authenticatedAttributes.length===0){if(y!==e.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{x.authenticatedAttributesAsn1=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var g=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[]),I=0;I<x.authenticatedAttributes.length;++I){var A=x.authenticatedAttributes[I];A.type===e.pki.oids.messageDigest?A.value=b[x.digestAlgorithm].digest():A.type===e.pki.oids.signingTime&&(A.value||(A.value=w)),g.value.push(u(A)),x.authenticatedAttributesAsn1.value.push(u(A))}C=t.toDer(g).getBytes(),x.md.start().update(C)}x.signature=x.key.sign(x.md,"RSASSA-PKCS1-V1_5")}d.signerInfos=l(d.signers)}},n.createEncryptedData=function(){var d=null;return d={type:e.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:e.pki.oids["aes256-CBC"]},fromAsn1:function(v){p(d,v,n.asn1.encryptedDataValidator)},decrypt:function(v){v!==void 0&&(d.encryptedContent.key=v),h(d)}},d},n.createEnvelopedData=function(){var d=null;return d={type:e.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:e.pki.oids["aes256-CBC"]},fromAsn1:function(v){var m=p(d,v,n.asn1.envelopedDataValidator);d.recipients=a(m.recipientInfos.value)},toAsn1:function(){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,o(d.recipients)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,c(d.encryptedContent))])])])},findRecipient:function(v){for(var m=v.issuer.attributes,b=0;b<d.recipients.length;++b){var f=d.recipients[b],y=f.issuer;if(f.serialNumber===v.serialNumber&&y.length===m.length){for(var C=!0,S=0;S<m.length;++S)if(y[S].type!==m[S].type||y[S].value!==m[S].value){C=!1;break}if(C)return f}}return null},decrypt:function(v,m){if(d.encryptedContent.key===void 0&&v!==void 0&&m!==void 0)switch(v.encryptedContent.algorithm){case e.pki.oids.rsaEncryption:case e.pki.oids.desCBC:var b=m.decrypt(v.encryptedContent.content);d.encryptedContent.key=e.util.createBuffer(b);break;default:throw new Error("Unsupported asymmetric cipher, OID "+v.encryptedContent.algorithm)}h(d)},addRecipient:function(v){d.recipients.push({version:0,issuer:v.issuer.attributes,serialNumber:v.serialNumber,encryptedContent:{algorithm:e.pki.oids.rsaEncryption,key:v.publicKey}})},encrypt:function(v,m){if(d.encryptedContent.content===void 0){m=m||d.encryptedContent.algorithm,v=v||d.encryptedContent.key;var b,f,y;switch(m){case e.pki.oids["aes128-CBC"]:b=16,f=16,y=e.aes.createEncryptionCipher;break;case e.pki.oids["aes192-CBC"]:b=24,f=16,y=e.aes.createEncryptionCipher;break;case e.pki.oids["aes256-CBC"]:b=32,f=16,y=e.aes.createEncryptionCipher;break;case e.pki.oids["des-EDE3-CBC"]:b=24,f=8,y=e.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+m)}if(v===void 0)v=e.util.createBuffer(e.random.getBytes(b));else if(v.length()!=b)throw new Error("Symmetric key has wrong length; got "+v.length()+" bytes, expected "+b+".");d.encryptedContent.algorithm=m,d.encryptedContent.key=v,d.encryptedContent.parameter=e.util.createBuffer(e.random.getBytes(f));var C=y(v);if(C.start(d.encryptedContent.parameter.copy()),C.update(d.content),!C.finish())throw new Error("Symmetric encryption failed.");d.encryptedContent.content=C.output}for(var S=0;S<d.recipients.length;++S){var w=d.recipients[S];if(w.encryptedContent.content===void 0)switch(w.encryptedContent.algorithm){case e.pki.oids.rsaEncryption:w.encryptedContent.content=w.encryptedContent.key.encrypt(d.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+w.encryptedContent.algorithm)}}}},d};function r(d){var v={},m=[];if(!t.validate(d,n.asn1.recipientInfoValidator,v,m)){var b=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw b.errors=m,b}return{version:v.version.charCodeAt(0),issuer:e.pki.RDNAttributesAsArray(v.issuer),serialNumber:e.util.createBuffer(v.serial).toHex(),encryptedContent:{algorithm:t.derToOid(v.encAlgorithm),parameter:v.encParameter?v.encParameter.value:void 0,content:v.encKey}}}function i(d){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[e.pki.distinguishedNameToAsn1({attributes:d.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(d.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.encryptedContent.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.encryptedContent.content)])}function a(d){for(var v=[],m=0;m<d.length;++m)v.push(r(d[m]));return v}function o(d){for(var v=[],m=0;m<d.length;++m)v.push(i(d[m]));return v}function s(d){var v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(d.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[e.pki.distinguishedNameToAsn1({attributes:d.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,e.util.hexToBytes(d.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.digestAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])]);if(d.authenticatedAttributesAsn1&&v.value.push(d.authenticatedAttributesAsn1),v.value.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.signatureAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])),v.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.signature)),d.unauthenticatedAttributes.length>0){for(var m=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),b=0;b<d.unauthenticatedAttributes.length;++b){var f=d.unauthenticatedAttributes[b];m.values.push(u(f))}v.value.push(m)}return v}function l(d){for(var v=[],m=0;m<d.length;++m)v.push(s(d[m]));return v}function u(d){var v;if(d.type===e.pki.oids.contentType)v=t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.value).getBytes());else if(d.type===e.pki.oids.messageDigest)v=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.value.bytes());else if(d.type===e.pki.oids.signingTime){var m=new Date("1950-01-01T00:00:00Z"),b=new Date("2050-01-01T00:00:00Z"),f=d.value;if(typeof f=="string"){var y=Date.parse(f);isNaN(y)?f.length===13?f=t.utcTimeToDate(f):f=t.generalizedTimeToDate(f):f=new Date(y)}f>=m&&f<b?v=t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(f)):v=t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(f))}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[v])])}function c(d){return[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.pki.oids.data).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(d.algorithm).getBytes()),d.parameter?t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.parameter.getBytes()):void 0]),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,d.content.getBytes())])]}function p(d,v,m){var b={},f=[];if(!t.validate(v,m,b,f)){var y=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw y.errors=y,y}var C=t.derToOid(b.contentType);if(C!==e.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(b.encryptedContent){var S="";if(e.util.isArray(b.encryptedContent))for(var w=0;w<b.encryptedContent.length;++w){if(b.encryptedContent[w].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");S+=b.encryptedContent[w].value}else S=b.encryptedContent;d.encryptedContent={algorithm:t.derToOid(b.encAlgorithm),parameter:e.util.createBuffer(b.encParameter.value),content:e.util.createBuffer(S)}}if(b.content){var S="";if(e.util.isArray(b.content))for(var w=0;w<b.content.length;++w){if(b.content[w].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");S+=b.content[w].value}else S=b.content;d.content=e.util.createBuffer(S)}return d.version=b.version.charCodeAt(0),d.rawCapture=b,b}function h(d){if(d.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(d.content===void 0){var v;switch(d.encryptedContent.algorithm){case e.pki.oids["aes128-CBC"]:case e.pki.oids["aes192-CBC"]:case e.pki.oids["aes256-CBC"]:v=e.aes.createDecryptionCipher(d.encryptedContent.key);break;case e.pki.oids.desCBC:case e.pki.oids["des-EDE3-CBC"]:v=e.des.createDecryptionCipher(d.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+d.encryptedContent.algorithm)}if(v.start(d.encryptedContent.parameter),v.update(d.encryptedContent.content),!v.finish())throw new Error("Symmetric decryption failed.");d.content=v.output}}return rf.exports}var af={exports:{}},Mm;function pD(){if(Mm)return af.exports;Mm=1;var e=Le();Ma(),rl(),V0(),il(),Xe();var t=af.exports=e.ssh=e.ssh||{};t.privateKeyToPutty=function(a,o,s){s=s||"",o=o||"";var l="ssh-rsa",u=o===""?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: "+l+`\r
15
15
  `;c+="Encryption: "+u+`\r
16
16
  `,c+="Comment: "+s+`\r
17
17
  `;var p=e.util.createBuffer();r(p,l),n(p,a.e),n(p,a.n);var h=e.util.encode64(p.bytes(),64),d=Math.floor(h.length/66)+1;c+="Public-Lines: "+d+`\r
@@ -19,8 +19,8 @@
19
19
  Private-Lines: `+d+`\r
20
20
  `,c+=m;var w=i("putty-private-key-file-mac-key",o),E=e.util.createBuffer();r(E,l),r(E,u),r(E,s),E.putInt32(p.length()),E.putBuffer(p),E.putInt32(v.length()),E.putBuffer(v);var x=e.hmac.create();return x.start("sha1",w),x.update(E.bytes()),c+=`\r
21
21
  Private-MAC: `+x.digest().toHex()+`\r
22
- `,c},t.publicKeyToOpenSSH=function(a,o){var s="ssh-rsa";o=o||"";var l=e.util.createBuffer();return r(l,s),n(l,a.e),n(l,a.n),s+" "+e.util.encode64(l.bytes())+" "+o},t.privateKeyToOpenSSH=function(a,o){return o?e.pki.encryptRsaPrivateKey(a,o,{legacy:!0,algorithm:"aes128"}):e.pki.privateKeyToPem(a)},t.getPublicKeyFingerprint=function(a,o){o=o||{};var s=o.md||e.md.md5.create(),l="ssh-rsa",u=e.util.createBuffer();r(u,l),n(u,a.e),n(u,a.n),s.start(),s.update(u.getBytes());var c=s.digest();if(o.encoding==="hex"){var p=c.toHex();return o.delimiter?p.match(/.{2}/g).join(o.delimiter):p}else{if(o.encoding==="binary")return c.getBytes();if(o.encoding)throw new Error('Unknown encoding "'+o.encoding+'".')}return c};function n(a,o){var s=o.toString(16);s[0]>="8"&&(s="00"+s);var l=e.util.hexToBytes(s);a.putInt32(l.length),a.putBytes(l)}function r(a,o){a.putInt32(o.length),a.putString(o)}function i(){for(var a=e.md.sha1.create(),o=arguments.length,s=0;s<o;++s)a.update(arguments[s]);return a.digest()}return af.exports}var of,Om;function mD(){return Om||(Om=1,of=Le(),Ma(),lD(),Wr(),L0(),Ac(),cD(),rl(),dD(),fD(),hD(),_x(),j0(),Oo(),Ex(),Dx(),gD(),Tx(),Sx(),xx(),z0(),Er(),Cx(),pD(),Ax(),Ue()),of}var vD=mD();const na=nD(vD),jr=e=>{try{return bt(e).isFinite()}catch{return!1}},Bx=e=>{if(typeof e=="number"&&Number.isFinite(e))return!0;if(typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e))){const t=Number(e);return Number.isFinite(t)}return!1};function kc(e,t){const{decimals:n=2,instance:r=!1}=t||{};jr(e)||(e="0");const i=bt(e).toFixed(n);return r?bt(i):i}const W0=(e,t=2)=>{let n=parseFloat(Bx(e)?e:0);return n=(+(Math.round(n+"e"+t)+"e-"+t)).toFixed(t),n=Number(n),n};function Ri(e,t="currency",n){const{minimumFractionDigits:r=0,locale:i="id-ID",currency:a="IDR",withSpace:o=!1}=n||{},s=new Intl.NumberFormat(i,{style:t,currency:a,minimumFractionDigits:r}).format(W0(e,r>0?r:2));return o?s:s.replace(/\s/g,"")}const ao=(e,t,n,r)=>{const i={"id-ID":Mu,"zh-CN":px,"en-US":O0,"nl-BE":gx};let a=n??"-";return e&&!isNaN(new Date(e).getTime())&&(a=Ss(e,t??"dd/MM/yyyy",{locale:i[r??"id-ID"]})),a},bD=(e,t,n,r,i,a)=>{const o={"id-ID":Mu,"zh-CN":px,"en-US":O0,"nl-NL":gx};if(e&&!isNaN(new Date(e).getTime())){const s=Ss(e,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});if(t&&!isNaN(new Date(t).getTime())){const l=Ss(t,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});return s===l?s:`${s}${r??"-"}${l}`}return s}return i??"-"},kx=(e,t)=>e.reduce((n,r)=>{const i=String(r[t]);return n[i]||(n[i]=[]),n[i].push(r),n},{}),yD=({value:e,keyDate:t="date",keyFormat:n="formatDate",format:r="dd/MM/yyyy"})=>{const i=e.map(a=>({...a,[n]:ao(a[t],r)}));return kx(i,n)},xD=e=>(Object.keys(e).forEach(t=>{["",null,void 0,[],{}].includes(e[t])&&delete e[t]}),e),CD=(e,t)=>{var h,d;const n=/^-?\d+[0-9.,]*$/,r=/([.])(?=.*\1)/,i=/([,])(?=.*\1)/,a=((h=e.split(",")[0])==null?void 0:h.trim())||"",o=((d=e.split(",")[1])==null?void 0:d.trim())||"",s=!r.test(a)&&(a==="-"||n.test(a)||!a),l=!r.test(o)&&(o==="-"||n.test(o)||!o),u=(v,m,b)=>{let f=v;const y=v.split(".")[0];return isNaN(parseFloat(y.split(".")[0]))||(parseFloat(y.split(".")[0])<=m?f=`${m}`:parseFloat(y)>=b&&(f=`${b}`)),f},c=u(a,(t==null?void 0:t.latMin)??-85,(t==null?void 0:t.latMax)??85),p=u(o,(t==null?void 0:t.longMin)??-180,(t==null?void 0:t.longMax)??180);return{latitude:c,longitude:p,latlong:`${c}${e.includes(",")?","+p:""}`,isValid:!i.test(e)&&s&&l}},Lm=(e,t)=>e?Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith(e))):t,U0=(e,t)=>e.map(n=>n[t]).join(","),X0=(e,t)=>e.map(n=>n[t]),ED=(e,t)=>Array.isArray(e)?e==null?void 0:e.map((n,r,i)=>typeof t=="function"?t(n,r,i):n):[],SD=(e,t,n,r,i)=>Array.isArray(e)?{[t]:e==null?void 0:e.map((a,o,s)=>typeof n=="function"?n(a,o,s):a),[`${t}-val-be`]:a=>r==="array-of-object-to-array"?X0(a,i):U0(a,i)}:{[t]:"",[`${t}-val-be`]:()=>""};function Y0(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||!Y0(e[i],t[i]))return!1;return!0}function wD(e,t={maxTime:"hour"}){const{maxTime:n="hour"}=t,r=l=>l<10?`0${l}`:l;let i=r(0),a=r(0);const o=r(Math.floor(e%3600/60)),s=r(Math.floor(e%60));return n==="hour"?a=r(Math.floor(e/3600)):n==="day"&&(i=r(Math.floor(e/(3600*24))),a=r(Math.floor(e%(3600*24)/3600))),{day:i,hour:a,minute:o,second:s}}function sf(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ws(e,...t){if(!t.length)return e;const n=t.shift();if(sf(e)&&sf(n))for(const r in n)sf(n[r])?(e[r]||Object.assign(e,{[r]:{}}),ws(e[r],n[r])):Object.assign(e,{[r]:n[r]});return ws(e,...t)}function Ou(e,t){const n=t.match(/[^.[\]]+/g);if(!n||n.length===0)return;const r=(i,a)=>{if(typeof i!="object"||i===null||a.length===0)return;const o=i,s=a[0],l=a.slice(1);if(l.length===0){delete o[s];return}const u=o[s];if(s==="*"&&Array.isArray(o)){for(const c of o)r(c,l);return}r(u,l)};r(e,n)}function ID(e,t){if(!e||!t)return e;if(Array.isArray(t))for(const n of t)Ou(e,n);else Ou(e,t);return e}function _D(e,t){const n=JSON.parse(JSON.stringify(e));if(Array.isArray(t))for(const r of t)Ou(n,r);else Ou(n,t);return n}const DD=e=>W0(e||0),TD=e=>kc(e||0),AD=e=>isNaN(e)?void 0:e,Pc=e=>{const t=e.toString().split(""),n=t[1]!=="0"?`,${t[1]}`:"";let[r]=e.toString().split(".");return r=r.replaceAll("-",""),r.length>=15?`${+r.substring(0,3)} T`:r.length===14?`${+r.substring(0,2)} T`:r.length===13?`${+r.substring(0,1)}${n} T`:r.length===12?`${+r.substring(0,3)} M`:r.length===11?`${+r.substring(0,2)} M`:r.length===10?`${+r.substring(0,1)}${n} M`:r.length===9?`${+r.substring(0,3)} JT`:r.length===8?`${+r.substring(0,2)} JT`:r.length===7?`${+r.substring(0,1)}${n} JT`:r.length===6?`${+r.substring(0,3)} RB`:r.length===5?`${+r.substring(0,2)} RB`:r.length===4?`${+r.substring(0,1)}${n} RB`:r.length<=3?+r?`${+r}`:0:null};function _h(e){if(typeof e!="string")throw new Error("Input harus berupa string");const t=e.split(".");if(t.length===1)return{filename:e,extension:""};const n="."+t[t.length-1];return{filename:t.slice(0,-1).join("."),extension:n}}const RD=e=>(new DOMParser().parseFromString(e||"","text/html").body.textContent??"").toString();function BD(e,t){const n=typeof e=="string"?e:JSON.stringify(e),r=na.util.decode64(t.replace(/\s+/g,"")),i=na.util.decode64(r),a=na.asn1.fromDer(i),s=na.pki.publicKeyFromAsn1(a).encrypt(n,"RSA-OAEP",{md:na.md.sha256.create(),mgf1:{md:na.md.sha1.create()}});return na.util.encode64(s)}function kD(e,t={}){const{locale:n,currency:r,minimumFractionDigits:i,maximumFractionDigits:a=2,withSpace:o,currencyDisplay:s}=t,l=kc(e,{decimals:a}),[u,c=""]=l.split("."),p=u.replace(/\B(?=(\d{3})+(?!\d))/g,".");let h=c.slice(0,a);i===void 0?h=h.replace(/0+$/,""):h&&i>0&&(h=h.padEnd(i,"0"));let d=h?`${p},${h}`:p;if(!n||!r)return d;const m={"id-ID":{symbol:"Rp",code:"IDR",name:"Rupiah",negativePosition:"start"},"en-US":{symbol:"$",code:"USD",name:"US Dollar",negativePosition:"middle"},"ja-JP":{symbol:"¥",code:"JPY",name:"Yen",negativePosition:"middle"}}[n]||{symbol:"",code:r,name:r},b={symbol:m.symbol,code:m.code,name:m.name}[s||"symbol"],f=d.includes("-");return d=m.negativePosition==="start"?d.replace("-",""):d,o?`${m.negativePosition==="start"&&f?"-":""}${b} ${d}`:`${m.negativePosition==="start"&&f?"-":""}${b}${d}`}function PD(e){if(!jr(e))return"0";const t=typeof e=="number"?bt(e).toString():e;if(!t.includes("."))return t;const[n,r]=t.split("."),i=r.replace(/0+$/,"");return i?`${n}.${i}`:n}/*! js-cookie v3.0.5 | MIT */function Bl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var $D={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Dh(e,t){function n(i,a,o){if(!(typeof document>"u")){o=Bl({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=i+"="+e.write(a,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],o={},s=0;s<a.length;s++){var l=a[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(o[c]=e.read(u,c),i===c)break}catch{}}return i?o[i]:o}}return Object.create({set:n,get:r,remove:function(i,a){n(i,"",Bl({},a,{expires:-1}))},withAttributes:function(i){return Dh(this.converter,Bl({},this.attributes,i))},withConverter:function(i){return Dh(Bl({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var wr=Dh($D,{path:"/"});const FD={setItem(e,t,n={},r=3e3){const a={...{path:"/",expires:365},...n};parseInt(wr.get(`${e}_count`)??"0",10)&&this.removeItem(e,n);const s=Math.ceil(t.length/r);for(let l=0;l<s;l++){const u=t.slice(l*r,(l+1)*r);wr.set(`${e}_${l}`,u,a)}wr.set(`${e}_count`,s.toString(),a)},getItem(e){const t=parseInt(wr.get(`${e}_count`)??"0",10);if(!t)return null;let n="";for(let r=0;r<t;r++){const i=wr.get(`${e}_${r}`);if(!i)return null;n+=i}return n},removeItem(e,t={}){const n=parseInt(wr.get(`${e}_count`)??"0",10),r={path:"/",...t};if(!isNaN(n)){for(let i=0;i<n;i++)wr.remove(`${e}_${i}`,r);wr.remove(`${e}_count`,r)}},clear(e={}){const t={path:"/",...e},n=wr.get();Object.keys(n).forEach(r=>wr.remove(r,t))}};function Px(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Px(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ji(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Px(e))&&(r&&(r+=" "),r+=t);return r}function ND(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}ND(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
23
- `);var al=e=>typeof e=="number"&&!isNaN(e),_a=e=>typeof e=="string",hi=e=>typeof e=="function",MD=e=>_a(e)||al(e),Th=e=>_a(e)||hi(e)?e:null,OD=(e,t)=>e===!1||al(e)&&e>0?e:t,Ah=e=>N.isValidElement(e)||_a(e)||hi(e)||al(e);function LD(e,t,n=300){let{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function VD({enter:e,exit:t,appendPosition:n=!1,collapse:r=!0,collapseDuration:i=300}){return function({children:a,position:o,preventExitTransition:s,done:l,nodeRef:u,isIn:c,playToast:p}){let h=n?`${e}--${o}`:e,d=n?`${t}--${o}`:t,v=N.useRef(0);return N.useLayoutEffect(()=>{let m=u.current,b=h.split(" "),f=y=>{y.target===u.current&&(p(),m.removeEventListener("animationend",f),m.removeEventListener("animationcancel",f),v.current===0&&y.type!=="animationcancel"&&m.classList.remove(...b))};m.classList.add(...b),m.addEventListener("animationend",f),m.addEventListener("animationcancel",f)},[]),N.useEffect(()=>{let m=u.current,b=()=>{m.removeEventListener("animationend",b),r?LD(m,l,i):l()};c||(s?b():(v.current=1,m.className+=` ${d}`,m.addEventListener("animationend",b)))},[c]),N.createElement(N.Fragment,null,a)}}function Vm(e,t){return{content:$x(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function $x(e,t,n=!1){return N.isValidElement(e)&&!_a(e.type)?N.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):hi(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function HD({closeToast:e,theme:t,ariaLabel:n="close"}){return N.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:r=>{r.stopPropagation(),e(!0)},"aria-label":n},N.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},N.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function jD({delay:e,isRunning:t,closeToast:n,type:r="default",hide:i,className:a,controlledProgress:o,progress:s,rtl:l,isIn:u,theme:c}){let p=i||o&&s===0,h={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};o&&(h.transform=`scaleX(${s})`);let d=ji("Toastify__progress-bar",o?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${c}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":l}),v=hi(a)?a({rtl:l,type:r,defaultClassName:d}):ji(d,a),m={[o&&s>=1?"onTransitionEnd":"onAnimationEnd"]:o&&s<1?null:()=>{u&&n()}};return N.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},N.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${c} Toastify__progress-bar--${r}`}),N.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:h,...m}))}var zD=1,Fx=()=>`${zD++}`;function GD(e,t,n){let r=1,i=0,a=[],o=[],s=t,l=new Map,u=new Set,c=y=>(u.add(y),()=>u.delete(y)),p=()=>{o=Array.from(l.values()),u.forEach(y=>y())},h=({containerId:y,toastId:C,updateId:S})=>{let w=y?y!==e:e!==1,E=l.has(C)&&S==null;return w||E},d=(y,C)=>{l.forEach(S=>{var w;(C==null||C===S.props.toastId)&&((w=S.toggle)==null||w.call(S,y))})},v=y=>{var C,S;(S=(C=y.props)==null?void 0:C.onClose)==null||S.call(C,y.removalReason),y.isActive=!1},m=y=>{if(y==null)l.forEach(v);else{let C=l.get(y);C&&v(C)}p()},b=()=>{i-=a.length,a=[]},f=y=>{var C,S;let{toastId:w,updateId:E}=y.props,x=E==null;y.staleId&&l.delete(y.staleId),y.isActive=!0,l.set(w,y),p(),n(Vm(y,x?"added":"updated")),x&&((S=(C=y.props).onOpen)==null||S.call(C))};return{id:e,props:s,observe:c,toggle:d,removeToast:m,toasts:l,clearQueue:b,buildToast:(y,C)=>{if(h(C))return;let{toastId:S,updateId:w,data:E,staleId:x,delay:g}=C,I=w==null;I&&i++;let A={...s,style:s.toastStyle,key:r++,...Object.fromEntries(Object.entries(C).filter(([T,$])=>$!=null)),toastId:S,updateId:w,data:E,isIn:!1,className:Th(C.className||s.toastClassName),progressClassName:Th(C.progressClassName||s.progressClassName),autoClose:C.isLoading?!1:OD(C.autoClose,s.autoClose),closeToast(T){l.get(S).removalReason=T,m(S)},deleteToast(){let T=l.get(S);if(T!=null){if(n(Vm(T,"removed")),l.delete(S),i--,i<0&&(i=0),a.length>0){f(a.shift());return}p()}}};A.closeButton=s.closeButton,C.closeButton===!1||Ah(C.closeButton)?A.closeButton=C.closeButton:C.closeButton===!0&&(A.closeButton=Ah(s.closeButton)?s.closeButton:!0);let _={content:y,props:A,staleId:x};s.limit&&s.limit>0&&i>s.limit&&I?a.push(_):al(g)?setTimeout(()=>{f(_)},g):f(_)},setProps(y){s=y},setToggle:(y,C)=>{let S=l.get(y);S&&(S.toggle=C)},isToastActive:y=>{var C;return(C=l.get(y))==null?void 0:C.isActive},getSnapshot:()=>o}}var yn=new Map,Is=[],Rh=new Set,WD=e=>Rh.forEach(t=>t(e)),Nx=()=>yn.size>0;function UD(){Is.forEach(e=>Ox(e.content,e.options)),Is=[]}var XD=(e,{containerId:t})=>{var n;return(n=yn.get(t||1))==null?void 0:n.toasts.get(e)};function Mx(e,t){var n;if(t)return!!((n=yn.get(t))!=null&&n.isToastActive(e));let r=!1;return yn.forEach(i=>{i.isToastActive(e)&&(r=!0)}),r}function YD(e){if(!Nx()){Is=Is.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||MD(e))yn.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=yn.get(e.containerId);t?t.removeToast(e.id):yn.forEach(n=>{n.removeToast(e.id)})}}var KD=(e={})=>{yn.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function Ox(e,t){Ah(e)&&(Nx()||Is.push({content:e,options:t}),yn.forEach(n=>{n.buildToast(e,t)}))}function ZD(e){var t;(t=yn.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function Lx(e,t){yn.forEach(n=>{(t==null||!(t!=null&&t.containerId)||(t==null?void 0:t.containerId)===n.id)&&n.toggle(e,t==null?void 0:t.id)})}function JD(e){let t=e.containerId||1;return{subscribe(n){let r=GD(t,e,WD);yn.set(t,r);let i=r.observe(n);return UD(),()=>{i(),yn.delete(t)}},setProps(n){var r;(r=yn.get(t))==null||r.setProps(n)},getSnapshot(){var n;return(n=yn.get(t))==null?void 0:n.getSnapshot()}}}function qD(e){return Rh.add(e),()=>{Rh.delete(e)}}function QD(e){return e&&(_a(e.toastId)||al(e.toastId))?e.toastId:Fx()}function ol(e,t){return Ox(e,t),t.toastId}function $c(e,t){return{...t,type:t&&t.type||e,toastId:QD(t)}}function Fc(e){return(t,n)=>ol(t,$c(e,n))}function Ke(e,t){return ol(e,$c("default",t))}Ke.loading=(e,t)=>ol(e,$c("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t}));function eT(e,{pending:t,error:n,success:r},i){let a;t&&(a=_a(t)?Ke.loading(t,i):Ke.loading(t.render,{...i,...t}));let o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(u,c,p)=>{if(c==null){Ke.dismiss(a);return}let h={type:u,...o,...i,data:p},d=_a(c)?{render:c}:c;return a?Ke.update(a,{...h,...d}):Ke(d.render,{...h,...d}),p},l=hi(e)?e():e;return l.then(u=>s("success",r,u)).catch(u=>s("error",n,u)),l}Ke.promise=eT;Ke.success=Fc("success");Ke.info=Fc("info");Ke.error=Fc("error");Ke.warning=Fc("warning");Ke.warn=Ke.warning;Ke.dark=(e,t)=>ol(e,$c("default",{theme:"dark",...t}));function tT(e){YD(e)}Ke.dismiss=tT;Ke.clearWaitingQueue=KD;Ke.isActive=Mx;Ke.update=(e,t={})=>{let n=XD(e,t);if(n){let{props:r,content:i}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:Fx()};a.toastId!==e&&(a.staleId=e);let o=a.render||i;delete a.render,ol(o,a)}};Ke.done=e=>{Ke.update(e,{progress:1})};Ke.onChange=qD;Ke.play=e=>Lx(!0,e);Ke.pause=e=>Lx(!1,e);function nT(e){var t;let{subscribe:n,getSnapshot:r,setProps:i}=N.useRef(JD(e)).current;i(e);let a=(t=N.useSyncExternalStore(n,r,r))==null?void 0:t.slice();function o(s){if(!a)return[];let l=new Map;return e.newestOnTop&&a.reverse(),a.forEach(u=>{let{position:c}=u.props;l.has(c)||l.set(c,[]),l.get(c).push(u)}),Array.from(l,u=>s(u[0],u[1]))}return{getToastToRender:o,isToastActive:Mx,count:a==null?void 0:a.length}}function rT(e){let[t,n]=N.useState(!1),[r,i]=N.useState(!1),a=N.useRef(null),o=N.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:p}=e;ZD({id:e.toastId,containerId:e.containerId,fn:n}),N.useEffect(()=>{if(e.pauseOnFocusLoss)return h(),()=>{d()}},[e.pauseOnFocusLoss]);function h(){document.hasFocus()||f(),window.addEventListener("focus",b),window.addEventListener("blur",f)}function d(){window.removeEventListener("focus",b),window.removeEventListener("blur",f)}function v(x){if(e.draggable===!0||e.draggable===x.pointerType){y();let g=a.current;o.canCloseOnClick=!0,o.canDrag=!0,g.style.transition="none",e.draggableDirection==="x"?(o.start=x.clientX,o.removalDistance=g.offsetWidth*(e.draggablePercent/100)):(o.start=x.clientY,o.removalDistance=g.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function m(x){let{top:g,bottom:I,left:A,right:_}=a.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&e.pauseOnHover&&x.clientX>=A&&x.clientX<=_&&x.clientY>=g&&x.clientY<=I?f():b()}function b(){n(!0)}function f(){n(!1)}function y(){o.didMove=!1,document.addEventListener("pointermove",S),document.addEventListener("pointerup",w)}function C(){document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",w)}function S(x){let g=a.current;if(o.canDrag&&g){o.didMove=!0,t&&f(),e.draggableDirection==="x"?o.delta=x.clientX-o.start:o.delta=x.clientY-o.start,o.start!==x.clientX&&(o.canCloseOnClick=!1);let I=e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`;g.style.transform=`translate3d(${I},0)`,g.style.opacity=`${1-Math.abs(o.delta/o.removalDistance)}`}}function w(){C();let x=a.current;if(o.canDrag&&o.didMove&&x){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance){i(!0),e.closeToast(!0),e.collapseAll();return}x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}let E={onPointerDown:v,onPointerUp:m};return s&&l&&(E.onMouseEnter=f,e.stacked||(E.onMouseLeave=b)),p&&(E.onClick=x=>{c&&c(x),o.canCloseOnClick&&u(!0)}),{playToast:b,pauseToast:f,isRunning:t,preventExitTransition:r,toastRef:a,eventHandlers:E}}var iT=typeof window<"u"?N.useLayoutEffect:N.useEffect,Nc=({theme:e,type:t,isLoading:n,...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r});function aT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function oT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function sT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function lT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function uT(){return N.createElement("div",{className:"Toastify__spinner"})}var Bh={info:oT,warning:aT,success:sT,error:lT,spinner:uT},cT=e=>e in Bh;function dT({theme:e,type:t,isLoading:n,icon:r}){let i=null,a={theme:e,type:t};return r===!1||(hi(r)?i=r({...a,isLoading:n}):N.isValidElement(r)?i=N.cloneElement(r,a):n?i=Bh.spinner():cT(t)&&(i=Bh[t](a))),i}var fT=e=>{let{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:a}=rT(e),{closeButton:o,children:s,autoClose:l,onClick:u,type:c,hideProgressBar:p,closeToast:h,transition:d,position:v,className:m,style:b,progressClassName:f,updateId:y,role:C,progress:S,rtl:w,toastId:E,deleteToast:x,isIn:g,isLoading:I,closeOnClick:A,theme:_,ariaLabel:T}=e,$=ji("Toastify__toast",`Toastify__toast-theme--${_}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":w},{"Toastify__toast--close-on-click":A}),B=hi(m)?m({rtl:w,position:v,type:c,defaultClassName:$}):ji($,m),P=dT(e),k=!!S||!l,O={closeToast:h,type:c,theme:_},M=null;return o===!1||(hi(o)?M=o(O):N.isValidElement(o)?M=N.cloneElement(o,O):M=HD(O)),N.createElement(d,{isIn:g,done:x,position:v,preventExitTransition:n,nodeRef:r,playToast:a},N.createElement("div",{id:E,tabIndex:0,onClick:u,"data-in":g,className:B,...i,style:b,ref:r,...g&&{role:C,"aria-label":T}},P!=null&&N.createElement("div",{className:ji("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},P),$x(s,e,!t),M,!e.customProgressBar&&N.createElement(jD,{...y&&!k?{key:`p-${y}`}:{},rtl:w,theme:_,delay:l,isRunning:t,isIn:g,closeToast:h,hide:p,type:c,className:f,controlledProgress:k,progress:S||0})))},hT=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),gT=VD(hT("bounce",!0)),pT={position:"top-right",transition:gT,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function mT(e){let t={...pT,...e},n=e.stacked,[r,i]=N.useState(!0),a=N.useRef(null),{getToastToRender:o,isToastActive:s,count:l}=nT(t),{className:u,style:c,rtl:p,containerId:h,hotKeys:d}=t;function v(b){let f=ji("Toastify__toast-container",`Toastify__toast-container--${b}`,{"Toastify__toast-container--rtl":p});return hi(u)?u({position:b,rtl:p,defaultClassName:f}):ji(f,Th(u))}function m(){n&&(i(!0),Ke.play())}return iT(()=>{var b;if(n){let f=a.current.querySelectorAll('[data-in="true"]'),y=12,C=(b=t.position)==null?void 0:b.includes("top"),S=0,w=0;Array.from(f).reverse().forEach((E,x)=>{let g=E;g.classList.add("Toastify__toast--stacked"),x>0&&(g.dataset.collapsed=`${r}`),g.dataset.pos||(g.dataset.pos=C?"top":"bot");let I=S*(r?.2:1)+(r?0:y*x);g.style.setProperty("--y",`${C?I:I*-1}px`),g.style.setProperty("--g",`${y}`),g.style.setProperty("--s",`${1-(r?w:0)}`),S+=g.offsetHeight,w+=.025})}},[r,l,n]),N.useEffect(()=>{function b(f){var y;let C=a.current;d(f)&&((y=C.querySelector('[tabIndex="0"]'))==null||y.focus(),i(!1),Ke.pause()),f.key==="Escape"&&(document.activeElement===C||C!=null&&C.contains(document.activeElement))&&(i(!0),Ke.play())}return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[d]),N.createElement("section",{ref:a,className:"Toastify",id:h,onMouseEnter:()=>{n&&(i(!1),Ke.pause())},onMouseLeave:m,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},o((b,f)=>{let y=f.length?{...c}:{...c,pointerEvents:"none"};return N.createElement("div",{tabIndex:-1,className:v(b),"data-stacked":n,style:y,key:`c-${b}`},f.map(({content:C,props:S})=>N.createElement(fT,{...S,stacked:n,collapseAll:m,isIn:s(S.toastId,S.containerId),key:`t-${S.key}`},C)))}))}const Xn={"alert-success-outlined":"_alert-success-outlined_thic4_115","alert-error-outlined":"_alert-error-outlined_thic4_115","alert-warning-outlined":"_alert-warning-outlined_thic4_115","alert-info-outlined":"_alert-info-outlined_thic4_115","alert-success-filled":"_alert-success-filled_thic4_115","alert-error-filled":"_alert-error-filled_thic4_115","alert-warning-filled":"_alert-warning-filled_thic4_115","alert-info-filled":"_alert-info-filled_thic4_115","text-header":"_text-header_thic4_241"},vT=(e,t,n)=>{const r=(n==null?void 0:n.kind)??"payhere",i={position:"top-center",autoClose:2e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0},a={icon:{laba:{success:F.jsx(yT,{}),warning:F.jsx(wT,{}),error:F.jsx(ET,{}),info:F.jsx(CT,{})},payhere:{success:F.jsx(bT,{}),warning:F.jsx(ST,{}),error:F.jsx(xT,{}),info:F.jsx(IT,{})}},variant:{laba:{success:Xn["alert-success-filled"],error:Xn["alert-error-filled"],warning:Xn["alert-warning-filled"],info:Xn["alert-info-filled"]},payhere:{success:Xn["alert-success-outlined"],error:Xn["alert-error-outlined"],warning:Xn["alert-warning-outlined"],info:Xn["alert-info-outlined"]}}};return t==="error"?Ke.error(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Error"}),e]}),{icon:a.icon[r].error,className:a.variant[r].error,...i,...n}):t==="info"?Ke.info(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Info"}),e]}),{icon:a.icon[r].info,className:a.variant[r].info,...i,...n}):t==="warning"?Ke.warning(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Warning"}),e]}),{icon:a.icon[r].warning,className:a.variant[r].warning,...i,...n}):Ke(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Success"}),e]}),{icon:a.icon[r].success,className:a.variant[r].success,...i,...n})},bT=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"check-circle",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M10 18.5C12.1217 18.5 14.1566 17.6571 15.6569 16.1569C17.1571 14.6566 18 12.6217 18 10.5C18 8.37827 17.1571 6.34344 15.6569 4.84315C14.1566 3.34285 12.1217 2.5 10 2.5C7.87827 2.5 5.84344 3.34285 4.34315 4.84315C2.84285 6.34344 2 8.37827 2 10.5C2 12.6217 2.84285 14.6566 4.34315 16.1569C5.84344 17.6571 7.87827 18.5 10 18.5ZM13.707 9.207C13.8892 9.0184 13.99 8.7658 13.9877 8.5036C13.9854 8.2414 13.8802 7.99059 13.6948 7.80518C13.5094 7.61977 13.2586 7.5146 12.9964 7.51233C12.7342 7.51005 12.4816 7.61084 12.293 7.793L9 11.086L7.707 9.793C7.5184 9.61084 7.2658 9.51005 7.0036 9.51233C6.7414 9.5146 6.49059 9.61977 6.30518 9.80518C6.11977 9.99059 6.0146 10.2414 6.01233 10.5036C6.01005 10.7658 6.11084 11.0184 6.293 11.207L8.293 13.207C8.48053 13.3945 8.73484 13.4998 9 13.4998C9.26516 13.4998 9.51947 13.3945 9.707 13.207L13.707 9.207Z",fill:"#388E3C"})})}),yT=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"circle",children:[F.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M9 12L11 14L15 10",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),xT=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"exclamation-circle",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 14.5C11 14.7652 10.8946 15.0196 10.7071 15.2071C10.5196 15.3946 10.2652 15.5 10 15.5C9.73478 15.5 9.48043 15.3946 9.29289 15.2071C9.10536 15.0196 9 14.7652 9 14.5C9 14.2348 9.10536 13.9804 9.29289 13.7929C9.48043 13.6054 9.73478 13.5 10 13.5C10.2652 13.5 10.5196 13.6054 10.7071 13.7929C10.8946 13.9804 11 14.2348 11 14.5ZM10 5.5C9.73478 5.5 9.48043 5.60536 9.29289 5.79289C9.10536 5.98043 9 6.23478 9 6.5V10.5C9 10.7652 9.10536 11.0196 9.29289 11.2071C9.48043 11.3946 9.73478 11.5 10 11.5C10.2652 11.5 10.5196 11.3946 10.7071 11.2071C10.8946 11.0196 11 10.7652 11 10.5V6.5C11 6.23478 10.8946 5.98043 10.7071 5.79289C10.5196 5.60536 10.2652 5.5 10 5.5Z",fill:"#F44336"})})}),CT=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"alert",children:[F.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ET=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"alert",children:[F.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ST=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"exclamation",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M8.25697 3.59898C9.02197 2.23898 10.979 2.23898 11.743 3.59898L17.323 13.519C18.073 14.853 17.11 16.499 15.581 16.499H4.41997C2.88997 16.499 1.92697 14.853 2.67697 13.519L8.25697 3.59898ZM11 13.5C11 13.7652 10.8946 14.0196 10.7071 14.2071C10.5195 14.3946 10.2652 14.5 9.99997 14.5C9.73475 14.5 9.4804 14.3946 9.29286 14.2071C9.10533 14.0196 8.99997 13.7652 8.99997 13.5C8.99997 13.2348 9.10533 12.9804 9.29286 12.7929C9.4804 12.6053 9.73475 12.5 9.99997 12.5C10.2652 12.5 10.5195 12.6053 10.7071 12.7929C10.8946 12.9804 11 13.2348 11 13.5ZM9.99997 5.49998C9.73475 5.49998 9.4804 5.60534 9.29286 5.79287C9.10533 5.98041 8.99997 6.23476 8.99997 6.49998V9.49998C8.99997 9.7652 9.10533 10.0195 9.29286 10.2071C9.4804 10.3946 9.73475 10.5 9.99997 10.5C10.2652 10.5 10.5195 10.3946 10.7071 10.2071C10.8946 10.0195 11 9.7652 11 9.49998V6.49998C11 6.23476 10.8946 5.98041 10.7071 5.79287C10.5195 5.60534 10.2652 5.49998 9.99997 5.49998Z",fill:"#F9A825"})})}),wT=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"alert",children:[F.jsx("path",{id:"Vector",d:"M12 15V15.01M12 9V11V9Z",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M5 19H19C19.3263 18.9977 19.6471 18.9156 19.9344 18.7609C20.2217 18.6061 20.4667 18.3835 20.6482 18.1123C20.8297 17.841 20.942 17.5296 20.9754 17.205C21.0089 16.8804 20.9624 16.5525 20.84 16.25L13.74 4.00002C13.567 3.68741 13.3135 3.42685 13.0058 3.2454C12.698 3.06396 12.3473 2.96826 11.99 2.96826C11.6327 2.96826 11.282 3.06396 10.9742 3.2454C10.6665 3.42685 10.413 3.68741 10.24 4.00002L3.14 16.25C3.01994 16.5456 2.97233 16.8656 3.00115 17.1833C3.02997 17.501 3.13437 17.8073 3.30565 18.0764C3.47693 18.3456 3.71011 18.5698 3.98573 18.7305C4.26134 18.8912 4.57139 18.9836 4.89 19",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),IT=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"information-circle",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 6.5C11 6.76522 10.8946 7.01957 10.7071 7.20711C10.5196 7.39464 10.2652 7.5 10 7.5C9.73478 7.5 9.48043 7.39464 9.29289 7.20711C9.10536 7.01957 9 6.76522 9 6.5C9 6.23478 9.10536 5.98043 9.29289 5.79289C9.48043 5.60536 9.73478 5.5 10 5.5C10.2652 5.5 10.5196 5.60536 10.7071 5.79289C10.8946 5.98043 11 6.23478 11 6.5ZM9 9.5C8.73478 9.5 8.48043 9.60536 8.29289 9.79289C8.10536 9.98043 8 10.2348 8 10.5C8 10.7652 8.10536 11.0196 8.29289 11.2071C8.48043 11.3946 8.73478 11.5 9 11.5V14.5C9 14.7652 9.10536 15.0196 9.29289 15.2071C9.48043 15.3946 9.73478 15.5 10 15.5H11C11.2652 15.5 11.5196 15.3946 11.7071 15.2071C11.8946 15.0196 12 14.7652 12 14.5C12 14.2348 11.8946 13.9804 11.7071 13.7929C11.5196 13.6054 11.2652 13.5 11 13.5V10.5C11 10.2348 10.8946 9.98043 10.7071 9.79289C10.5196 9.60536 10.2652 9.5 10 9.5H9Z",fill:"#0288D1"})})}),sl=e=>typeof e=="string"||typeof e=="number"||typeof e=="bigint"?kc(e):"";function _T(e,t){return{name:"minBig",message:t||`Value must be greater than or equal to ${e}`,test(n){return n=sl(n),jr(n)?bt(n).gte(bt(e))?!0:this.createError({message:t||`Value must be greater than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function DT(e,t){return{name:"maxBig",message:t||`Value must be less than or equal to ${e}`,test(n){return n=sl(n),jr(n)?bt(n).lte(bt(e))?!0:this.createError({message:t||`Value must be less than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function TT(e,t){return{name:"moreThanBig",message:t||`Value must be greater than ${e}`,test(n){return n=sl(n),jr(n)?bt(n).gt(bt(e))?!0:this.createError({message:t||`Value must be greater than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function AT(e,t){return{name:"lessThanBig",message:t||`Value must be less than ${e}`,test(n){return n=sl(n),jr(n)?bt(n).lt(bt(e))?!0:this.createError({message:t||`Value must be less than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function RT(e,t,n){return{name:"betweenBig",message:n||`Value must be between ${e} and ${t}`,test(r){if(r=sl(r),!jr(r))return this.createError({message:n||"Invalid BigNumber value"});const i=bt(r),a=bt(e),o=bt(t);return i.lt(a)||i.gt(o)?this.createError({message:n||`Value must be between ${e} and ${t}`}):!0}}}function K0(e){return BT.test(e)}const BT=/^-?[0-9]+$/;function kT(e){return PT.test(e)}const PT=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Vx(e,t){const n=Number.parseFloat(e),r=String(n),i=Hm(e),a=Hm(r);return!!(i===a||(t==null?void 0:t.approx)===!0&&!K0(e)&&a.length>=14&&i.startsWith(a.substring(0,14)))}let ns=function(e){return e.underflow="underflow",e.overflow="overflow",e.truncate_integer="truncate_integer",e.truncate_float="truncate_float",e}({});function $T(e){if(Vx(e,{approx:!1}))return;if(K0(e))return ns.truncate_integer;const t=Number.parseFloat(e);return Number.isFinite(t)?t===0?ns.underflow:ns.truncate_float:ns.overflow}function Hm(e){return e.replace(FT,"").replace(MT,"").replace(OT,"").replace(NT,"")}const FT=/[eE][+-]?\d+$/,NT=/^-?(0*)?/,MT=/\./,OT=/0+$/;class LT{constructor(t){Ce(this,"isLosslessNumber",!0);if(!kT(t))throw new Error(`Invalid number (value: "${t}")`);this.value=t}valueOf(){const t=$T(this.value);if(t===void 0||t===ns.truncate_float)return Number.parseFloat(this.value);if(K0(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${t} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function VT(e){return e&&typeof e=="object"&&e.isLosslessNumber===!0||!1}function HT(e){return new LT(e)}function jT(e,t){return Z0({"":e},"",e,t)}function Z0(e,t,n,r){return Array.isArray(n)?r.call(e,t,GT(n,r)):n&&typeof n=="object"&&!VT(n)?r.call(e,t,zT(n,r)):r.call(e,t,n)}function zT(e,t){for(const n of Object.keys(e)){const r=Z0(e,n,e[n],t);r!==void 0?e[n]=r:delete e[n]}return e}function GT(e,t){for(let n=0;n<e.length;n++)e[n]=Z0(e,String(n),e[n],t);return e}function WT(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:HT,r=0;const i=s();return v(i),b(),t?jT(i,t):i;function a(){if(e.charCodeAt(r)===JT){r++,u();const B={};let P=!0;for(;r<e.length&&e.charCodeAt(r)!==zm;){P?P=!1:(h(),u());const k=r,O=c();if(O===void 0){C();return}u(),d();const M=s();if(M===void 0){I();return}Object.prototype.hasOwnProperty.call(B,O)&&!kh(M,B[O])&&S(O,k+1),B[O]=M}return e.charCodeAt(r)!==zm&&w(),r++,B}}function o(){if(e.charCodeAt(r)===qT){r++,u();const B=[];let P=!0;for(;r<e.length&&e.charCodeAt(r)!==Gm;){P?P=!1:h();const k=s();m(k),B.push(k)}return e.charCodeAt(r)!==Gm&&E(),r++,B}}function s(){u();const B=c()??p()??a()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),B}function l(B,P){if(e.slice(r,r+B.length)===B)return r+=B.length,P}function u(){for(;UT(e.charCodeAt(r));)r++}function c(){if(e.charCodeAt(r)===lf){r++;let B="";for(;r<e.length&&e.charCodeAt(r)!==lf;){if(e.charCodeAt(r)===ZT){const P=e[r+1],k=KT[P];k!==void 0?(B+=k,r++):P==="u"?kl(e.charCodeAt(r+2))&&kl(e.charCodeAt(r+3))&&kl(e.charCodeAt(r+4))&&kl(e.charCodeAt(r+5))?(B+=String.fromCharCode(Number.parseInt(e.slice(r+2,r+6),16)),r+=5):A(r):g(r)}else YT(e.charCodeAt(r))?B+=e[r]:x(e[r]);r++}return y(),r++,B}}function p(){const B=r;if(e.charCodeAt(r)===Wm&&(r++,f(B)),e.charCodeAt(r)===J0)r++;else if(XT(e.charCodeAt(r)))for(r++;Pl(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===oA)for(r++,f(B);Pl(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===dA||e.charCodeAt(r)===cA)for(r++,(e.charCodeAt(r)===Wm||e.charCodeAt(r)===rA)&&r++,f(B);Pl(e.charCodeAt(r));)r++;if(r>B)return n(e.slice(B,r))}function h(){if(e.charCodeAt(r)!==aA)throw new SyntaxError(`Comma ',' expected after value ${$()}`);r++}function d(){if(e.charCodeAt(r)!==sA)throw new SyntaxError(`Colon ':' expected after property name ${$()}`);r++}function v(B){if(B===void 0)throw new SyntaxError(`JSON value expected ${$()}`)}function m(B){if(B===void 0)throw new SyntaxError(`Array item expected ${$()}`)}function b(){if(r<e.length)throw new SyntaxError(`Expected end of input ${$()}`)}function f(B){if(!Pl(e.charCodeAt(r))){const P=e.slice(B,r);throw new SyntaxError(`Invalid number '${P}', expecting a digit ${$()}`)}}function y(){if(e.charCodeAt(r)!==lf)throw new SyntaxError(`End of string '"' expected ${$()}`)}function C(){throw new SyntaxError(`Quoted object key expected ${$()}`)}function S(B,P){throw new SyntaxError(`Duplicate key '${B}' encountered at position ${P}`)}function w(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${$()}`)}function E(){throw new SyntaxError(`Array item or end of array ']' expected ${$()}`)}function x(B){throw new SyntaxError(`Invalid character '${B}' ${_()}`)}function g(B){const P=e.slice(B,B+2);throw new SyntaxError(`Invalid escape character '${P}' ${_()}`)}function I(){throw new SyntaxError(`Object value expected after ':' ${_()}`)}function A(B){const P=e.slice(B,B+6);throw new SyntaxError(`Invalid unicode character '${P}' ${_()}`)}function _(){return`at position ${r}`}function T(){return r<e.length?`but got '${e[r]}'`:"but reached end of input"}function $(){return`${T()} ${_()}`}}function UT(e){return e===QT||e===eA||e===tA||e===nA}function kl(e){return e>=J0&&e<=q0||e>=lA&&e<=fA||e>=uA&&e<=hA}function Pl(e){return e>=J0&&e<=q0}function XT(e){return e>=iA&&e<=q0}function YT(e){return e>=32&&e<=1114111}function kh(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>kh(n,t[r])):jm(e)&&jm(t)?[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>kh(e[r],t[r])):!1}function jm(e){return typeof e=="object"&&e!==null}const KT={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
22
+ `,c},t.publicKeyToOpenSSH=function(a,o){var s="ssh-rsa";o=o||"";var l=e.util.createBuffer();return r(l,s),n(l,a.e),n(l,a.n),s+" "+e.util.encode64(l.bytes())+" "+o},t.privateKeyToOpenSSH=function(a,o){return o?e.pki.encryptRsaPrivateKey(a,o,{legacy:!0,algorithm:"aes128"}):e.pki.privateKeyToPem(a)},t.getPublicKeyFingerprint=function(a,o){o=o||{};var s=o.md||e.md.md5.create(),l="ssh-rsa",u=e.util.createBuffer();r(u,l),n(u,a.e),n(u,a.n),s.start(),s.update(u.getBytes());var c=s.digest();if(o.encoding==="hex"){var p=c.toHex();return o.delimiter?p.match(/.{2}/g).join(o.delimiter):p}else{if(o.encoding==="binary")return c.getBytes();if(o.encoding)throw new Error('Unknown encoding "'+o.encoding+'".')}return c};function n(a,o){var s=o.toString(16);s[0]>="8"&&(s="00"+s);var l=e.util.hexToBytes(s);a.putInt32(l.length),a.putBytes(l)}function r(a,o){a.putInt32(o.length),a.putString(o)}function i(){for(var a=e.md.sha1.create(),o=arguments.length,s=0;s<o;++s)a.update(arguments[s]);return a.digest()}return af.exports}var of,Om;function mD(){return Om||(Om=1,of=Le(),Ma(),lD(),Wr(),L0(),Ac(),cD(),rl(),dD(),fD(),hD(),_x(),j0(),Oo(),Ex(),Dx(),gD(),Tx(),Sx(),xx(),z0(),Er(),Cx(),pD(),Ax(),Xe()),of}var vD=mD();const na=nD(vD),jr=e=>{try{return bt(e).isFinite()}catch{return!1}},Bx=e=>{if(typeof e=="number"&&Number.isFinite(e))return!0;if(typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e))){const t=Number(e);return Number.isFinite(t)}return!1};function kc(e,t){const{decimals:n=2,instance:r=!1}=t||{};jr(e)||(e="0");const i=bt(e).toFixed(n);return r?bt(i):i}const W0=(e,t=2)=>{let n=parseFloat(Bx(e)?e:0);return n=(+(Math.round(n+"e"+t)+"e-"+t)).toFixed(t),n=Number(n),n};function Ri(e,t="currency",n){const{minimumFractionDigits:r=0,locale:i="id-ID",currency:a="IDR",withSpace:o=!1}=n||{},s=new Intl.NumberFormat(i,{style:t,currency:a,minimumFractionDigits:r}).format(W0(e,r>0?r:2));return o?s:s.replace(/\s/g,"")}const ao=(e,t,n,r)=>{const i={"id-ID":Mu,"zh-CN":px,"en-US":O0,"nl-BE":gx};let a=n??"-";return e&&!isNaN(new Date(e).getTime())&&(a=Ss(e,t??"dd/MM/yyyy",{locale:i[r??"id-ID"]})),a},bD=(e,t,n,r,i,a)=>{const o={"id-ID":Mu,"zh-CN":px,"en-US":O0,"nl-NL":gx};if(e&&!isNaN(new Date(e).getTime())){const s=Ss(e,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});if(t&&!isNaN(new Date(t).getTime())){const l=Ss(t,n??"dd/MM/yyyy",{locale:o[a??"id-ID"]});return s===l?s:`${s}${r??"-"}${l}`}return s}return i??"-"},kx=(e,t)=>e.reduce((n,r)=>{const i=String(r[t]);return n[i]||(n[i]=[]),n[i].push(r),n},{}),yD=({value:e,keyDate:t="date",keyFormat:n="formatDate",format:r="dd/MM/yyyy"})=>{const i=e.map(a=>({...a,[n]:ao(a[t],r)}));return kx(i,n)},xD=e=>(Object.keys(e).forEach(t=>{["",null,void 0,[],{}].includes(e[t])&&delete e[t]}),e),CD=(e,t)=>{var h,d;const n=/^-?\d+[0-9.,]*$/,r=/([.])(?=.*\1)/,i=/([,])(?=.*\1)/,a=((h=e.split(",")[0])==null?void 0:h.trim())||"",o=((d=e.split(",")[1])==null?void 0:d.trim())||"",s=!r.test(a)&&(a==="-"||n.test(a)||!a),l=!r.test(o)&&(o==="-"||n.test(o)||!o),u=(v,m,b)=>{let f=v;const y=v.split(".")[0];return isNaN(parseFloat(y.split(".")[0]))||(parseFloat(y.split(".")[0])<=m?f=`${m}`:parseFloat(y)>=b&&(f=`${b}`)),f},c=u(a,(t==null?void 0:t.latMin)??-85,(t==null?void 0:t.latMax)??85),p=u(o,(t==null?void 0:t.longMin)??-180,(t==null?void 0:t.longMax)??180);return{latitude:c,longitude:p,latlong:`${c}${e.includes(",")?","+p:""}`,isValid:!i.test(e)&&s&&l}},Lm=(e,t)=>e?Object.fromEntries(Object.entries(t).filter(([r])=>r.startsWith(e))):t,U0=(e,t)=>e.map(n=>n[t]).join(","),X0=(e,t)=>e.map(n=>n[t]),ED=(e,t)=>Array.isArray(e)?e==null?void 0:e.map((n,r,i)=>typeof t=="function"?t(n,r,i):n):[],SD=(e,t,n,r,i)=>Array.isArray(e)?{[t]:e==null?void 0:e.map((a,o,s)=>typeof n=="function"?n(a,o,s):a),[`${t}-val-be`]:a=>r==="array-of-object-to-array"?X0(a,i):U0(a,i)}:{[t]:"",[`${t}-val-be`]:()=>""};function Y0(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||!Y0(e[i],t[i]))return!1;return!0}function wD(e,t={maxTime:"hour"}){const{maxTime:n="hour"}=t,r=l=>l<10?`0${l}`:l;let i=r(0),a=r(0);const o=r(Math.floor(e%3600/60)),s=r(Math.floor(e%60));return n==="hour"?a=r(Math.floor(e/3600)):n==="day"&&(i=r(Math.floor(e/(3600*24))),a=r(Math.floor(e%(3600*24)/3600))),{day:i,hour:a,minute:o,second:s}}function sf(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ws(e,...t){if(!t.length)return e;const n=t.shift();if(sf(e)&&sf(n))for(const r in n)sf(n[r])?(e[r]||Object.assign(e,{[r]:{}}),ws(e[r],n[r])):Object.assign(e,{[r]:n[r]});return ws(e,...t)}function Ou(e,t){const n=t.match(/[^.[\]]+/g);if(!n||n.length===0)return;const r=(i,a)=>{if(typeof i!="object"||i===null||a.length===0)return;const o=i,s=a[0],l=a.slice(1);if(l.length===0){delete o[s];return}const u=o[s];if(s==="*"&&Array.isArray(o)){for(const c of o)r(c,l);return}r(u,l)};r(e,n)}function ID(e,t){if(!e||!t)return e;if(Array.isArray(t))for(const n of t)Ou(e,n);else Ou(e,t);return e}function _D(e,t){const n=JSON.parse(JSON.stringify(e));if(Array.isArray(t))for(const r of t)Ou(n,r);else Ou(n,t);return n}const DD=e=>W0(e||0),TD=e=>kc(e||0),AD=e=>isNaN(e)?void 0:e,Pc=e=>{const t=e.toString().split(""),n=t[1]!=="0"?`,${t[1]}`:"";let[r]=e.toString().split(".");return r=r.replaceAll("-",""),r.length>=15?`${+r.substring(0,3)} T`:r.length===14?`${+r.substring(0,2)} T`:r.length===13?`${+r.substring(0,1)}${n} T`:r.length===12?`${+r.substring(0,3)} M`:r.length===11?`${+r.substring(0,2)} M`:r.length===10?`${+r.substring(0,1)}${n} M`:r.length===9?`${+r.substring(0,3)} JT`:r.length===8?`${+r.substring(0,2)} JT`:r.length===7?`${+r.substring(0,1)}${n} JT`:r.length===6?`${+r.substring(0,3)} RB`:r.length===5?`${+r.substring(0,2)} RB`:r.length===4?`${+r.substring(0,1)}${n} RB`:r.length<=3?+r?`${+r}`:0:null};function _h(e){if(typeof e!="string")throw new Error("Input harus berupa string");const t=e.split(".");if(t.length===1)return{filename:e,extension:""};const n="."+t[t.length-1];return{filename:t.slice(0,-1).join("."),extension:n}}const RD=e=>(new DOMParser().parseFromString(e||"","text/html").body.textContent??"").toString();function BD(e,t){const n=typeof e=="string"?e:JSON.stringify(e),r=na.util.decode64(t.replace(/\s+/g,"")),i=na.util.decode64(r),a=na.asn1.fromDer(i),s=na.pki.publicKeyFromAsn1(a).encrypt(n,"RSA-OAEP",{md:na.md.sha256.create(),mgf1:{md:na.md.sha1.create()}});return na.util.encode64(s)}function kD(e,t={}){const{locale:n,currency:r,minimumFractionDigits:i,maximumFractionDigits:a=2,withSpace:o,currencyDisplay:s}=t,l=kc(e,{decimals:a}),[u,c=""]=l.split("."),p=u.replace(/\B(?=(\d{3})+(?!\d))/g,".");let h=c.slice(0,a);i===void 0?h=h.replace(/0+$/,""):h&&i>0&&(h=h.padEnd(i,"0"));let d=h?`${p},${h}`:p;if(!n||!r)return d;const m={"id-ID":{symbol:"Rp",code:"IDR",name:"Rupiah",negativePosition:"start"},"en-US":{symbol:"$",code:"USD",name:"US Dollar",negativePosition:"middle"},"ja-JP":{symbol:"¥",code:"JPY",name:"Yen",negativePosition:"middle"}}[n]||{symbol:"",code:r,name:r},b={symbol:m.symbol,code:m.code,name:m.name}[s||"symbol"],f=d.includes("-");return d=m.negativePosition==="start"?d.replace("-",""):d,o?`${m.negativePosition==="start"&&f?"-":""}${b} ${d}`:`${m.negativePosition==="start"&&f?"-":""}${b}${d}`}function PD(e){if(!jr(e))return"0";const t=typeof e=="number"?bt(e).toString():e;if(!t.includes("."))return t;const[n,r]=t.split("."),i=r.replace(/0+$/,"");return i?`${n}.${i}`:n}/*! js-cookie v3.0.5 | MIT */function Bl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var $D={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Dh(e,t){function n(i,a,o){if(!(typeof document>"u")){o=Bl({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,o[l]!==!0&&(s+="="+o[l].split(";")[0]));return document.cookie=i+"="+e.write(a,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],o={},s=0;s<a.length;s++){var l=a[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(o[c]=e.read(u,c),i===c)break}catch{}}return i?o[i]:o}}return Object.create({set:n,get:r,remove:function(i,a){n(i,"",Bl({},a,{expires:-1}))},withAttributes:function(i){return Dh(this.converter,Bl({},this.attributes,i))},withConverter:function(i){return Dh(Bl({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var wr=Dh($D,{path:"/"});const FD={setItem(e,t,n={},r=3e3){const a={...{path:"/",expires:365},...n};parseInt(wr.get(`${e}_count`)??"0",10)&&this.removeItem(e,n);const s=Math.ceil(t.length/r);for(let l=0;l<s;l++){const u=t.slice(l*r,(l+1)*r);wr.set(`${e}_${l}`,u,a)}wr.set(`${e}_count`,s.toString(),a)},getItem(e){const t=parseInt(wr.get(`${e}_count`)??"0",10);if(!t)return null;let n="";for(let r=0;r<t;r++){const i=wr.get(`${e}_${r}`);if(!i)return null;n+=i}return n},removeItem(e,t={}){const n=parseInt(wr.get(`${e}_count`)??"0",10),r={path:"/",...t};if(!isNaN(n)){for(let i=0;i<n;i++)wr.remove(`${e}_${i}`,r);wr.remove(`${e}_count`,r)}},clear(e={}){const t={path:"/",...e},n=wr.get();Object.keys(n).forEach(r=>wr.remove(r,t))}};function Px(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Px(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ji(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Px(e))&&(r&&(r+=" "),r+=t);return r}function ND(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}ND(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
23
+ `);var al=e=>typeof e=="number"&&!isNaN(e),_a=e=>typeof e=="string",hi=e=>typeof e=="function",MD=e=>_a(e)||al(e),Th=e=>_a(e)||hi(e)?e:null,OD=(e,t)=>e===!1||al(e)&&e>0?e:t,Ah=e=>N.isValidElement(e)||_a(e)||hi(e)||al(e);function LD(e,t,n=300){let{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}function VD({enter:e,exit:t,appendPosition:n=!1,collapse:r=!0,collapseDuration:i=300}){return function({children:a,position:o,preventExitTransition:s,done:l,nodeRef:u,isIn:c,playToast:p}){let h=n?`${e}--${o}`:e,d=n?`${t}--${o}`:t,v=N.useRef(0);return N.useLayoutEffect(()=>{let m=u.current,b=h.split(" "),f=y=>{y.target===u.current&&(p(),m.removeEventListener("animationend",f),m.removeEventListener("animationcancel",f),v.current===0&&y.type!=="animationcancel"&&m.classList.remove(...b))};m.classList.add(...b),m.addEventListener("animationend",f),m.addEventListener("animationcancel",f)},[]),N.useEffect(()=>{let m=u.current,b=()=>{m.removeEventListener("animationend",b),r?LD(m,l,i):l()};c||(s?b():(v.current=1,m.className+=` ${d}`,m.addEventListener("animationend",b)))},[c]),N.createElement(N.Fragment,null,a)}}function Vm(e,t){return{content:$x(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function $x(e,t,n=!1){return N.isValidElement(e)&&!_a(e.type)?N.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):hi(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function HD({closeToast:e,theme:t,ariaLabel:n="close"}){return N.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:r=>{r.stopPropagation(),e(!0)},"aria-label":n},N.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},N.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function jD({delay:e,isRunning:t,closeToast:n,type:r="default",hide:i,className:a,controlledProgress:o,progress:s,rtl:l,isIn:u,theme:c}){let p=i||o&&s===0,h={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};o&&(h.transform=`scaleX(${s})`);let d=ji("Toastify__progress-bar",o?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${c}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":l}),v=hi(a)?a({rtl:l,type:r,defaultClassName:d}):ji(d,a),m={[o&&s>=1?"onTransitionEnd":"onAnimationEnd"]:o&&s<1?null:()=>{u&&n()}};return N.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},N.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${c} Toastify__progress-bar--${r}`}),N.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:h,...m}))}var zD=1,Fx=()=>`${zD++}`;function GD(e,t,n){let r=1,i=0,a=[],o=[],s=t,l=new Map,u=new Set,c=y=>(u.add(y),()=>u.delete(y)),p=()=>{o=Array.from(l.values()),u.forEach(y=>y())},h=({containerId:y,toastId:C,updateId:S})=>{let w=y?y!==e:e!==1,E=l.has(C)&&S==null;return w||E},d=(y,C)=>{l.forEach(S=>{var w;(C==null||C===S.props.toastId)&&((w=S.toggle)==null||w.call(S,y))})},v=y=>{var C,S;(S=(C=y.props)==null?void 0:C.onClose)==null||S.call(C,y.removalReason),y.isActive=!1},m=y=>{if(y==null)l.forEach(v);else{let C=l.get(y);C&&v(C)}p()},b=()=>{i-=a.length,a=[]},f=y=>{var C,S;let{toastId:w,updateId:E}=y.props,x=E==null;y.staleId&&l.delete(y.staleId),y.isActive=!0,l.set(w,y),p(),n(Vm(y,x?"added":"updated")),x&&((S=(C=y.props).onOpen)==null||S.call(C))};return{id:e,props:s,observe:c,toggle:d,removeToast:m,toasts:l,clearQueue:b,buildToast:(y,C)=>{if(h(C))return;let{toastId:S,updateId:w,data:E,staleId:x,delay:g}=C,I=w==null;I&&i++;let A={...s,style:s.toastStyle,key:r++,...Object.fromEntries(Object.entries(C).filter(([T,$])=>$!=null)),toastId:S,updateId:w,data:E,isIn:!1,className:Th(C.className||s.toastClassName),progressClassName:Th(C.progressClassName||s.progressClassName),autoClose:C.isLoading?!1:OD(C.autoClose,s.autoClose),closeToast(T){l.get(S).removalReason=T,m(S)},deleteToast(){let T=l.get(S);if(T!=null){if(n(Vm(T,"removed")),l.delete(S),i--,i<0&&(i=0),a.length>0){f(a.shift());return}p()}}};A.closeButton=s.closeButton,C.closeButton===!1||Ah(C.closeButton)?A.closeButton=C.closeButton:C.closeButton===!0&&(A.closeButton=Ah(s.closeButton)?s.closeButton:!0);let _={content:y,props:A,staleId:x};s.limit&&s.limit>0&&i>s.limit&&I?a.push(_):al(g)?setTimeout(()=>{f(_)},g):f(_)},setProps(y){s=y},setToggle:(y,C)=>{let S=l.get(y);S&&(S.toggle=C)},isToastActive:y=>{var C;return(C=l.get(y))==null?void 0:C.isActive},getSnapshot:()=>o}}var xn=new Map,Is=[],Rh=new Set,WD=e=>Rh.forEach(t=>t(e)),Nx=()=>xn.size>0;function UD(){Is.forEach(e=>Ox(e.content,e.options)),Is=[]}var XD=(e,{containerId:t})=>{var n;return(n=xn.get(t||1))==null?void 0:n.toasts.get(e)};function Mx(e,t){var n;if(t)return!!((n=xn.get(t))!=null&&n.isToastActive(e));let r=!1;return xn.forEach(i=>{i.isToastActive(e)&&(r=!0)}),r}function YD(e){if(!Nx()){Is=Is.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||MD(e))xn.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=xn.get(e.containerId);t?t.removeToast(e.id):xn.forEach(n=>{n.removeToast(e.id)})}}var KD=(e={})=>{xn.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function Ox(e,t){Ah(e)&&(Nx()||Is.push({content:e,options:t}),xn.forEach(n=>{n.buildToast(e,t)}))}function ZD(e){var t;(t=xn.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function Lx(e,t){xn.forEach(n=>{(t==null||!(t!=null&&t.containerId)||(t==null?void 0:t.containerId)===n.id)&&n.toggle(e,t==null?void 0:t.id)})}function JD(e){let t=e.containerId||1;return{subscribe(n){let r=GD(t,e,WD);xn.set(t,r);let i=r.observe(n);return UD(),()=>{i(),xn.delete(t)}},setProps(n){var r;(r=xn.get(t))==null||r.setProps(n)},getSnapshot(){var n;return(n=xn.get(t))==null?void 0:n.getSnapshot()}}}function qD(e){return Rh.add(e),()=>{Rh.delete(e)}}function QD(e){return e&&(_a(e.toastId)||al(e.toastId))?e.toastId:Fx()}function ol(e,t){return Ox(e,t),t.toastId}function $c(e,t){return{...t,type:t&&t.type||e,toastId:QD(t)}}function Fc(e){return(t,n)=>ol(t,$c(e,n))}function Ze(e,t){return ol(e,$c("default",t))}Ze.loading=(e,t)=>ol(e,$c("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t}));function eT(e,{pending:t,error:n,success:r},i){let a;t&&(a=_a(t)?Ze.loading(t,i):Ze.loading(t.render,{...i,...t}));let o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(u,c,p)=>{if(c==null){Ze.dismiss(a);return}let h={type:u,...o,...i,data:p},d=_a(c)?{render:c}:c;return a?Ze.update(a,{...h,...d}):Ze(d.render,{...h,...d}),p},l=hi(e)?e():e;return l.then(u=>s("success",r,u)).catch(u=>s("error",n,u)),l}Ze.promise=eT;Ze.success=Fc("success");Ze.info=Fc("info");Ze.error=Fc("error");Ze.warning=Fc("warning");Ze.warn=Ze.warning;Ze.dark=(e,t)=>ol(e,$c("default",{theme:"dark",...t}));function tT(e){YD(e)}Ze.dismiss=tT;Ze.clearWaitingQueue=KD;Ze.isActive=Mx;Ze.update=(e,t={})=>{let n=XD(e,t);if(n){let{props:r,content:i}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:Fx()};a.toastId!==e&&(a.staleId=e);let o=a.render||i;delete a.render,ol(o,a)}};Ze.done=e=>{Ze.update(e,{progress:1})};Ze.onChange=qD;Ze.play=e=>Lx(!0,e);Ze.pause=e=>Lx(!1,e);function nT(e){var t;let{subscribe:n,getSnapshot:r,setProps:i}=N.useRef(JD(e)).current;i(e);let a=(t=N.useSyncExternalStore(n,r,r))==null?void 0:t.slice();function o(s){if(!a)return[];let l=new Map;return e.newestOnTop&&a.reverse(),a.forEach(u=>{let{position:c}=u.props;l.has(c)||l.set(c,[]),l.get(c).push(u)}),Array.from(l,u=>s(u[0],u[1]))}return{getToastToRender:o,isToastActive:Mx,count:a==null?void 0:a.length}}function rT(e){let[t,n]=N.useState(!1),[r,i]=N.useState(!1),a=N.useRef(null),o=N.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:p}=e;ZD({id:e.toastId,containerId:e.containerId,fn:n}),N.useEffect(()=>{if(e.pauseOnFocusLoss)return h(),()=>{d()}},[e.pauseOnFocusLoss]);function h(){document.hasFocus()||f(),window.addEventListener("focus",b),window.addEventListener("blur",f)}function d(){window.removeEventListener("focus",b),window.removeEventListener("blur",f)}function v(x){if(e.draggable===!0||e.draggable===x.pointerType){y();let g=a.current;o.canCloseOnClick=!0,o.canDrag=!0,g.style.transition="none",e.draggableDirection==="x"?(o.start=x.clientX,o.removalDistance=g.offsetWidth*(e.draggablePercent/100)):(o.start=x.clientY,o.removalDistance=g.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function m(x){let{top:g,bottom:I,left:A,right:_}=a.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&e.pauseOnHover&&x.clientX>=A&&x.clientX<=_&&x.clientY>=g&&x.clientY<=I?f():b()}function b(){n(!0)}function f(){n(!1)}function y(){o.didMove=!1,document.addEventListener("pointermove",S),document.addEventListener("pointerup",w)}function C(){document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",w)}function S(x){let g=a.current;if(o.canDrag&&g){o.didMove=!0,t&&f(),e.draggableDirection==="x"?o.delta=x.clientX-o.start:o.delta=x.clientY-o.start,o.start!==x.clientX&&(o.canCloseOnClick=!1);let I=e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`;g.style.transform=`translate3d(${I},0)`,g.style.opacity=`${1-Math.abs(o.delta/o.removalDistance)}`}}function w(){C();let x=a.current;if(o.canDrag&&o.didMove&&x){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance){i(!0),e.closeToast(!0),e.collapseAll();return}x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}let E={onPointerDown:v,onPointerUp:m};return s&&l&&(E.onMouseEnter=f,e.stacked||(E.onMouseLeave=b)),p&&(E.onClick=x=>{c&&c(x),o.canCloseOnClick&&u(!0)}),{playToast:b,pauseToast:f,isRunning:t,preventExitTransition:r,toastRef:a,eventHandlers:E}}var iT=typeof window<"u"?N.useLayoutEffect:N.useEffect,Nc=({theme:e,type:t,isLoading:n,...r})=>N.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r});function aT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function oT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function sT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function lT(e){return N.createElement(Nc,{...e},N.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function uT(){return N.createElement("div",{className:"Toastify__spinner"})}var Bh={info:oT,warning:aT,success:sT,error:lT,spinner:uT},cT=e=>e in Bh;function dT({theme:e,type:t,isLoading:n,icon:r}){let i=null,a={theme:e,type:t};return r===!1||(hi(r)?i=r({...a,isLoading:n}):N.isValidElement(r)?i=N.cloneElement(r,a):n?i=Bh.spinner():cT(t)&&(i=Bh[t](a))),i}var fT=e=>{let{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:a}=rT(e),{closeButton:o,children:s,autoClose:l,onClick:u,type:c,hideProgressBar:p,closeToast:h,transition:d,position:v,className:m,style:b,progressClassName:f,updateId:y,role:C,progress:S,rtl:w,toastId:E,deleteToast:x,isIn:g,isLoading:I,closeOnClick:A,theme:_,ariaLabel:T}=e,$=ji("Toastify__toast",`Toastify__toast-theme--${_}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":w},{"Toastify__toast--close-on-click":A}),B=hi(m)?m({rtl:w,position:v,type:c,defaultClassName:$}):ji($,m),P=dT(e),k=!!S||!l,O={closeToast:h,type:c,theme:_},M=null;return o===!1||(hi(o)?M=o(O):N.isValidElement(o)?M=N.cloneElement(o,O):M=HD(O)),N.createElement(d,{isIn:g,done:x,position:v,preventExitTransition:n,nodeRef:r,playToast:a},N.createElement("div",{id:E,tabIndex:0,onClick:u,"data-in":g,className:B,...i,style:b,ref:r,...g&&{role:C,"aria-label":T}},P!=null&&N.createElement("div",{className:ji("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},P),$x(s,e,!t),M,!e.customProgressBar&&N.createElement(jD,{...y&&!k?{key:`p-${y}`}:{},rtl:w,theme:_,delay:l,isRunning:t,isIn:g,closeToast:h,hide:p,type:c,className:f,controlledProgress:k,progress:S||0})))},hT=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),gT=VD(hT("bounce",!0)),pT={position:"top-right",transition:gT,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function mT(e){let t={...pT,...e},n=e.stacked,[r,i]=N.useState(!0),a=N.useRef(null),{getToastToRender:o,isToastActive:s,count:l}=nT(t),{className:u,style:c,rtl:p,containerId:h,hotKeys:d}=t;function v(b){let f=ji("Toastify__toast-container",`Toastify__toast-container--${b}`,{"Toastify__toast-container--rtl":p});return hi(u)?u({position:b,rtl:p,defaultClassName:f}):ji(f,Th(u))}function m(){n&&(i(!0),Ze.play())}return iT(()=>{var b;if(n){let f=a.current.querySelectorAll('[data-in="true"]'),y=12,C=(b=t.position)==null?void 0:b.includes("top"),S=0,w=0;Array.from(f).reverse().forEach((E,x)=>{let g=E;g.classList.add("Toastify__toast--stacked"),x>0&&(g.dataset.collapsed=`${r}`),g.dataset.pos||(g.dataset.pos=C?"top":"bot");let I=S*(r?.2:1)+(r?0:y*x);g.style.setProperty("--y",`${C?I:I*-1}px`),g.style.setProperty("--g",`${y}`),g.style.setProperty("--s",`${1-(r?w:0)}`),S+=g.offsetHeight,w+=.025})}},[r,l,n]),N.useEffect(()=>{function b(f){var y;let C=a.current;d(f)&&((y=C.querySelector('[tabIndex="0"]'))==null||y.focus(),i(!1),Ze.pause()),f.key==="Escape"&&(document.activeElement===C||C!=null&&C.contains(document.activeElement))&&(i(!0),Ze.play())}return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[d]),N.createElement("section",{ref:a,className:"Toastify",id:h,onMouseEnter:()=>{n&&(i(!1),Ze.pause())},onMouseLeave:m,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},o((b,f)=>{let y=f.length?{...c}:{...c,pointerEvents:"none"};return N.createElement("div",{tabIndex:-1,className:v(b),"data-stacked":n,style:y,key:`c-${b}`},f.map(({content:C,props:S})=>N.createElement(fT,{...S,stacked:n,collapseAll:m,isIn:s(S.toastId,S.containerId),key:`t-${S.key}`},C)))}))}const Xn={"alert-success-outlined":"_alert-success-outlined_thic4_115","alert-error-outlined":"_alert-error-outlined_thic4_115","alert-warning-outlined":"_alert-warning-outlined_thic4_115","alert-info-outlined":"_alert-info-outlined_thic4_115","alert-success-filled":"_alert-success-filled_thic4_115","alert-error-filled":"_alert-error-filled_thic4_115","alert-warning-filled":"_alert-warning-filled_thic4_115","alert-info-filled":"_alert-info-filled_thic4_115","text-header":"_text-header_thic4_241"},vT=(e,t,n)=>{const r=(n==null?void 0:n.kind)??"payhere",i={position:"top-center",autoClose:2e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0},a={icon:{laba:{success:F.jsx(yT,{}),warning:F.jsx(wT,{}),error:F.jsx(ET,{}),info:F.jsx(CT,{})},payhere:{success:F.jsx(bT,{}),warning:F.jsx(ST,{}),error:F.jsx(xT,{}),info:F.jsx(IT,{})}},variant:{laba:{success:Xn["alert-success-filled"],error:Xn["alert-error-filled"],warning:Xn["alert-warning-filled"],info:Xn["alert-info-filled"]},payhere:{success:Xn["alert-success-outlined"],error:Xn["alert-error-outlined"],warning:Xn["alert-warning-outlined"],info:Xn["alert-info-outlined"]}}};return t==="error"?Ze.error(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Error"}),e]}),{icon:a.icon[r].error,className:a.variant[r].error,...i,...n}):t==="info"?Ze.info(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Info"}),e]}),{icon:a.icon[r].info,className:a.variant[r].info,...i,...n}):t==="warning"?Ze.warning(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Warning"}),e]}),{icon:a.icon[r].warning,className:a.variant[r].warning,...i,...n}):Ze(F.jsxs("div",{children:[["laba"].includes(r)&&F.jsx("p",{className:Xn["text-header"],children:"Success"}),e]}),{icon:a.icon[r].success,className:a.variant[r].success,...i,...n})},bT=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"check-circle",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M10 18.5C12.1217 18.5 14.1566 17.6571 15.6569 16.1569C17.1571 14.6566 18 12.6217 18 10.5C18 8.37827 17.1571 6.34344 15.6569 4.84315C14.1566 3.34285 12.1217 2.5 10 2.5C7.87827 2.5 5.84344 3.34285 4.34315 4.84315C2.84285 6.34344 2 8.37827 2 10.5C2 12.6217 2.84285 14.6566 4.34315 16.1569C5.84344 17.6571 7.87827 18.5 10 18.5ZM13.707 9.207C13.8892 9.0184 13.99 8.7658 13.9877 8.5036C13.9854 8.2414 13.8802 7.99059 13.6948 7.80518C13.5094 7.61977 13.2586 7.5146 12.9964 7.51233C12.7342 7.51005 12.4816 7.61084 12.293 7.793L9 11.086L7.707 9.793C7.5184 9.61084 7.2658 9.51005 7.0036 9.51233C6.7414 9.5146 6.49059 9.61977 6.30518 9.80518C6.11977 9.99059 6.0146 10.2414 6.01233 10.5036C6.01005 10.7658 6.11084 11.0184 6.293 11.207L8.293 13.207C8.48053 13.3945 8.73484 13.4998 9 13.4998C9.26516 13.4998 9.51947 13.3945 9.707 13.207L13.707 9.207Z",fill:"#388E3C"})})}),yT=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"circle",children:[F.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M9 12L11 14L15 10",stroke:"#038C67",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),xT=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"exclamation-circle",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 14.5C11 14.7652 10.8946 15.0196 10.7071 15.2071C10.5196 15.3946 10.2652 15.5 10 15.5C9.73478 15.5 9.48043 15.3946 9.29289 15.2071C9.10536 15.0196 9 14.7652 9 14.5C9 14.2348 9.10536 13.9804 9.29289 13.7929C9.48043 13.6054 9.73478 13.5 10 13.5C10.2652 13.5 10.5196 13.6054 10.7071 13.7929C10.8946 13.9804 11 14.2348 11 14.5ZM10 5.5C9.73478 5.5 9.48043 5.60536 9.29289 5.79289C9.10536 5.98043 9 6.23478 9 6.5V10.5C9 10.7652 9.10536 11.0196 9.29289 11.2071C9.48043 11.3946 9.73478 11.5 10 11.5C10.2652 11.5 10.5196 11.3946 10.7071 11.2071C10.8946 11.0196 11 10.7652 11 10.5V6.5C11 6.23478 10.8946 5.98043 10.7071 5.79289C10.5196 5.60536 10.2652 5.5 10 5.5Z",fill:"#F44336"})})}),CT=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"alert",children:[F.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#006DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ET=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"alert",children:[F.jsx("path",{id:"Vector",d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M12 8V12",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_3",d:"M12 16H12.01",stroke:"#ED0019",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),ST=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"exclamation",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M8.25697 3.59898C9.02197 2.23898 10.979 2.23898 11.743 3.59898L17.323 13.519C18.073 14.853 17.11 16.499 15.581 16.499H4.41997C2.88997 16.499 1.92697 14.853 2.67697 13.519L8.25697 3.59898ZM11 13.5C11 13.7652 10.8946 14.0196 10.7071 14.2071C10.5195 14.3946 10.2652 14.5 9.99997 14.5C9.73475 14.5 9.4804 14.3946 9.29286 14.2071C9.10533 14.0196 8.99997 13.7652 8.99997 13.5C8.99997 13.2348 9.10533 12.9804 9.29286 12.7929C9.4804 12.6053 9.73475 12.5 9.99997 12.5C10.2652 12.5 10.5195 12.6053 10.7071 12.7929C10.8946 12.9804 11 13.2348 11 13.5ZM9.99997 5.49998C9.73475 5.49998 9.4804 5.60534 9.29286 5.79287C9.10533 5.98041 8.99997 6.23476 8.99997 6.49998V9.49998C8.99997 9.7652 9.10533 10.0195 9.29286 10.2071C9.4804 10.3946 9.73475 10.5 9.99997 10.5C10.2652 10.5 10.5195 10.3946 10.7071 10.2071C10.8946 10.0195 11 9.7652 11 9.49998V6.49998C11 6.23476 10.8946 5.98041 10.7071 5.79287C10.5195 5.60534 10.2652 5.49998 9.99997 5.49998Z",fill:"#F9A825"})})}),wT=()=>F.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-6 1ru-w-6",children:F.jsxs("g",{id:"alert",children:[F.jsx("path",{id:"Vector",d:"M12 15V15.01M12 9V11V9Z",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.jsx("path",{id:"Vector_2",d:"M5 19H19C19.3263 18.9977 19.6471 18.9156 19.9344 18.7609C20.2217 18.6061 20.4667 18.3835 20.6482 18.1123C20.8297 17.841 20.942 17.5296 20.9754 17.205C21.0089 16.8804 20.9624 16.5525 20.84 16.25L13.74 4.00002C13.567 3.68741 13.3135 3.42685 13.0058 3.2454C12.698 3.06396 12.3473 2.96826 11.99 2.96826C11.6327 2.96826 11.282 3.06396 10.9742 3.2454C10.6665 3.42685 10.413 3.68741 10.24 4.00002L3.14 16.25C3.01994 16.5456 2.97233 16.8656 3.00115 17.1833C3.02997 17.501 3.13437 17.8073 3.30565 18.0764C3.47693 18.3456 3.71011 18.5698 3.98573 18.7305C4.26134 18.8912 4.57139 18.9836 4.89 19",stroke:"#FF7200",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),IT=()=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"1ru-h-5 1ru-w-5",children:F.jsx("g",{id:"information-circle",children:F.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M18 10.5C18 12.6217 17.1571 14.6566 15.6569 16.1569C14.1566 17.6571 12.1217 18.5 10 18.5C7.87827 18.5 5.84344 17.6571 4.34315 16.1569C2.84285 14.6566 2 12.6217 2 10.5C2 8.37827 2.84285 6.34344 4.34315 4.84315C5.84344 3.34285 7.87827 2.5 10 2.5C12.1217 2.5 14.1566 3.34285 15.6569 4.84315C17.1571 6.34344 18 8.37827 18 10.5ZM11 6.5C11 6.76522 10.8946 7.01957 10.7071 7.20711C10.5196 7.39464 10.2652 7.5 10 7.5C9.73478 7.5 9.48043 7.39464 9.29289 7.20711C9.10536 7.01957 9 6.76522 9 6.5C9 6.23478 9.10536 5.98043 9.29289 5.79289C9.48043 5.60536 9.73478 5.5 10 5.5C10.2652 5.5 10.5196 5.60536 10.7071 5.79289C10.8946 5.98043 11 6.23478 11 6.5ZM9 9.5C8.73478 9.5 8.48043 9.60536 8.29289 9.79289C8.10536 9.98043 8 10.2348 8 10.5C8 10.7652 8.10536 11.0196 8.29289 11.2071C8.48043 11.3946 8.73478 11.5 9 11.5V14.5C9 14.7652 9.10536 15.0196 9.29289 15.2071C9.48043 15.3946 9.73478 15.5 10 15.5H11C11.2652 15.5 11.5196 15.3946 11.7071 15.2071C11.8946 15.0196 12 14.7652 12 14.5C12 14.2348 11.8946 13.9804 11.7071 13.7929C11.5196 13.6054 11.2652 13.5 11 13.5V10.5C11 10.2348 10.8946 9.98043 10.7071 9.79289C10.5196 9.60536 10.2652 9.5 10 9.5H9Z",fill:"#0288D1"})})}),sl=e=>typeof e=="string"||typeof e=="number"||typeof e=="bigint"?kc(e):"";function _T(e,t){return{name:"minBig",message:t||`Value must be greater than or equal to ${e}`,test(n){return n=sl(n),jr(n)?bt(n).gte(bt(e))?!0:this.createError({message:t||`Value must be greater than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function DT(e,t){return{name:"maxBig",message:t||`Value must be less than or equal to ${e}`,test(n){return n=sl(n),jr(n)?bt(n).lte(bt(e))?!0:this.createError({message:t||`Value must be less than or equal to ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function TT(e,t){return{name:"moreThanBig",message:t||`Value must be greater than ${e}`,test(n){return n=sl(n),jr(n)?bt(n).gt(bt(e))?!0:this.createError({message:t||`Value must be greater than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function AT(e,t){return{name:"lessThanBig",message:t||`Value must be less than ${e}`,test(n){return n=sl(n),jr(n)?bt(n).lt(bt(e))?!0:this.createError({message:t||`Value must be less than ${e}`}):this.createError({message:t||"Invalid BigNumber value"})}}}function RT(e,t,n){return{name:"betweenBig",message:n||`Value must be between ${e} and ${t}`,test(r){if(r=sl(r),!jr(r))return this.createError({message:n||"Invalid BigNumber value"});const i=bt(r),a=bt(e),o=bt(t);return i.lt(a)||i.gt(o)?this.createError({message:n||`Value must be between ${e} and ${t}`}):!0}}}function K0(e){return BT.test(e)}const BT=/^-?[0-9]+$/;function kT(e){return PT.test(e)}const PT=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Vx(e,t){const n=Number.parseFloat(e),r=String(n),i=Hm(e),a=Hm(r);return!!(i===a||(t==null?void 0:t.approx)===!0&&!K0(e)&&a.length>=14&&i.startsWith(a.substring(0,14)))}let ns=function(e){return e.underflow="underflow",e.overflow="overflow",e.truncate_integer="truncate_integer",e.truncate_float="truncate_float",e}({});function $T(e){if(Vx(e,{approx:!1}))return;if(K0(e))return ns.truncate_integer;const t=Number.parseFloat(e);return Number.isFinite(t)?t===0?ns.underflow:ns.truncate_float:ns.overflow}function Hm(e){return e.replace(FT,"").replace(MT,"").replace(OT,"").replace(NT,"")}const FT=/[eE][+-]?\d+$/,NT=/^-?(0*)?/,MT=/\./,OT=/0+$/;class LT{constructor(t){Ce(this,"isLosslessNumber",!0);if(!kT(t))throw new Error(`Invalid number (value: "${t}")`);this.value=t}valueOf(){const t=$T(this.value);if(t===void 0||t===ns.truncate_float)return Number.parseFloat(this.value);if(K0(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${t} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function VT(e){return e&&typeof e=="object"&&e.isLosslessNumber===!0||!1}function HT(e){return new LT(e)}function jT(e,t){return Z0({"":e},"",e,t)}function Z0(e,t,n,r){return Array.isArray(n)?r.call(e,t,GT(n,r)):n&&typeof n=="object"&&!VT(n)?r.call(e,t,zT(n,r)):r.call(e,t,n)}function zT(e,t){for(const n of Object.keys(e)){const r=Z0(e,n,e[n],t);r!==void 0?e[n]=r:delete e[n]}return e}function GT(e,t){for(let n=0;n<e.length;n++)e[n]=Z0(e,String(n),e[n],t);return e}function WT(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:HT,r=0;const i=s();return v(i),b(),t?jT(i,t):i;function a(){if(e.charCodeAt(r)===JT){r++,u();const B={};let P=!0;for(;r<e.length&&e.charCodeAt(r)!==zm;){P?P=!1:(h(),u());const k=r,O=c();if(O===void 0){C();return}u(),d();const M=s();if(M===void 0){I();return}Object.prototype.hasOwnProperty.call(B,O)&&!kh(M,B[O])&&S(O,k+1),B[O]=M}return e.charCodeAt(r)!==zm&&w(),r++,B}}function o(){if(e.charCodeAt(r)===qT){r++,u();const B=[];let P=!0;for(;r<e.length&&e.charCodeAt(r)!==Gm;){P?P=!1:h();const k=s();m(k),B.push(k)}return e.charCodeAt(r)!==Gm&&E(),r++,B}}function s(){u();const B=c()??p()??a()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),B}function l(B,P){if(e.slice(r,r+B.length)===B)return r+=B.length,P}function u(){for(;UT(e.charCodeAt(r));)r++}function c(){if(e.charCodeAt(r)===lf){r++;let B="";for(;r<e.length&&e.charCodeAt(r)!==lf;){if(e.charCodeAt(r)===ZT){const P=e[r+1],k=KT[P];k!==void 0?(B+=k,r++):P==="u"?kl(e.charCodeAt(r+2))&&kl(e.charCodeAt(r+3))&&kl(e.charCodeAt(r+4))&&kl(e.charCodeAt(r+5))?(B+=String.fromCharCode(Number.parseInt(e.slice(r+2,r+6),16)),r+=5):A(r):g(r)}else YT(e.charCodeAt(r))?B+=e[r]:x(e[r]);r++}return y(),r++,B}}function p(){const B=r;if(e.charCodeAt(r)===Wm&&(r++,f(B)),e.charCodeAt(r)===J0)r++;else if(XT(e.charCodeAt(r)))for(r++;Pl(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===oA)for(r++,f(B);Pl(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===dA||e.charCodeAt(r)===cA)for(r++,(e.charCodeAt(r)===Wm||e.charCodeAt(r)===rA)&&r++,f(B);Pl(e.charCodeAt(r));)r++;if(r>B)return n(e.slice(B,r))}function h(){if(e.charCodeAt(r)!==aA)throw new SyntaxError(`Comma ',' expected after value ${$()}`);r++}function d(){if(e.charCodeAt(r)!==sA)throw new SyntaxError(`Colon ':' expected after property name ${$()}`);r++}function v(B){if(B===void 0)throw new SyntaxError(`JSON value expected ${$()}`)}function m(B){if(B===void 0)throw new SyntaxError(`Array item expected ${$()}`)}function b(){if(r<e.length)throw new SyntaxError(`Expected end of input ${$()}`)}function f(B){if(!Pl(e.charCodeAt(r))){const P=e.slice(B,r);throw new SyntaxError(`Invalid number '${P}', expecting a digit ${$()}`)}}function y(){if(e.charCodeAt(r)!==lf)throw new SyntaxError(`End of string '"' expected ${$()}`)}function C(){throw new SyntaxError(`Quoted object key expected ${$()}`)}function S(B,P){throw new SyntaxError(`Duplicate key '${B}' encountered at position ${P}`)}function w(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${$()}`)}function E(){throw new SyntaxError(`Array item or end of array ']' expected ${$()}`)}function x(B){throw new SyntaxError(`Invalid character '${B}' ${_()}`)}function g(B){const P=e.slice(B,B+2);throw new SyntaxError(`Invalid escape character '${P}' ${_()}`)}function I(){throw new SyntaxError(`Object value expected after ':' ${_()}`)}function A(B){const P=e.slice(B,B+6);throw new SyntaxError(`Invalid unicode character '${P}' ${_()}`)}function _(){return`at position ${r}`}function T(){return r<e.length?`but got '${e[r]}'`:"but reached end of input"}function $(){return`${T()} ${_()}`}}function UT(e){return e===QT||e===eA||e===tA||e===nA}function kl(e){return e>=J0&&e<=q0||e>=lA&&e<=fA||e>=uA&&e<=hA}function Pl(e){return e>=J0&&e<=q0}function XT(e){return e>=iA&&e<=q0}function YT(e){return e>=32&&e<=1114111}function kh(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>kh(n,t[r])):jm(e)&&jm(t)?[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>kh(e[r],t[r])):!1}function jm(e){return typeof e=="object"&&e!==null}const KT={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
24
24
  `,r:"\r",t:" "},ZT=92,JT=123,zm=125,qT=91,Gm=93,QT=32,eA=10,tA=9,nA=13,lf=34,rA=43,Wm=45,J0=48,iA=49,q0=57,aA=44,oA=46,sA=58,lA=65,uA=97,cA=69,dA=101,fA=70,hA=102;function Ph(e){if(typeof e=="object"&&e!==null){if(Array.isArray(e))return e.map(Ph);const t={};for(const[n,r]of Object.entries(e))typeof r=="number"||typeof r=="string"?typeof r=="number"&&!Number.isSafeInteger(r)||typeof r=="string"&&/^-?\d+(?:\.\d+)?$/.test(r)?t[n]=bt(r).toString():t[n]=r:typeof r=="object"?t[n]=Ph(r):t[n]=r;return t}return e}function $h(e){if(typeof e=="object"&&e!==null){if(Array.isArray(e))return e.map($h);if(e instanceof bt)return e.toString();const t={};for(const[n,r]of Object.entries(e))t[n]=$h(r);return t}return e}const gA=e=>WT(e,null,n=>typeof n=="number"&&!Number.isSafeInteger(n)||typeof n=="string"&&/^-?\d+(?:\.\d+)?$/.test(n)?Vx(n)?parseFloat(n):bt(n).toString():n),Hx={transparent:"transparent",black:"#212121",white:"#FFFFFF","primary-50":"#E3F2FD","primary-100":"#BBDEFB","primary-200":"#90CAF9","primary-300":"#64B5F6","primary-400":"#42A5F5","primary-500":"#2196F3","primary-600":"#1E88E5","primary-700":"#1976D2","primary-800":"#1565C0","primary-900":"#0D47A1","blue-gray-50":"#ECEFF1","blue-gray-100":"#CFD8DC","blue-gray-200":"#B0BEC5","blue-gray-300":"#90A4AE","blue-gray-400":"#78909C","blue-gray-500":"#607D8B","blue-gray-600":"#546E7A","blue-gray-700":"#455A64","blue-gray-800":"#37474F","blue-gray-900":"#263238","gray-50":"#FAFAFA","gray-100":"#F5F5F5","gray-200":"#EEEEEE","gray-300":"#E0E0E0","gray-400":"#BDBDBD","gray-500":"#9E9E9E","gray-600":"#757575","gray-700":"#616161","gray-800":"#424242","gray-900":"#212121","brown-50":"#EFEBE9","brown-100":"#D7CCC8","brown-200":"#BCAAA4","brown-300":"#A1887F","brown-400":"#8D6E63","brown-500":"#795548","brown-600":"#6D4C41","brown-700":"#5D4037","brown-800":"#4E342E","brown-900":"#3E2723","deep-orange-50":"#FBE9E7","deep-orange-100":"#FFCCBC","deep-orange-200":"#FFAB91","deep-orange-300":"#FF8A65","deep-orange-400":"#FF7043","deep-orange-500":"#FF5722","deep-orange-600":"#F4511E","deep-orange-700":"#E64A19","deep-orange-800":"#D84315","deep-orange-900":"#BF360C","orange-50":"#FFF3E0","orange-100":"#FFE0B2","orange-200":"#FFCC80","orange-300":"#FFB74D","orange-400":"#FFA726","orange-500":"#FF9800","orange-600":"#FB8C00","orange-700":"#F57C00","orange-800":"#EF6C00","orange-900":"#E65100","amber-50":"#FFF8E1","amber-100":"#FFECB3","amber-200":"#FFE082","amber-300":"#FFD54F","amber-400":"#FFCA28","amber-500":"#FFC107","amber-600":"#FFB300","amber-700":"#FFA000","amber-800":"#FF8F00","amber-900":"#FF6F00","yellow-50":"#FFFDE7","yellow-100":"#FFF9C4","yellow-200":"#FFF59D","yellow-300":"#FFF176","yellow-400":"#FFEE58","yellow-500":"#FFEB3B","yellow-600":"#FDD835","yellow-700":"#FBC02D","yellow-800":"#F9A825","yellow-900":"#F57F17","lime-50":"#F9FBE7","lime-100":"#F0F4C3","lime-200":"#E6EE9C","lime-300":"#DCE775","lime-400":"#D4E157","lime-500":"#CDDC39","lime-600":"#C0CA33","lime-700":"#AFB42B","lime-800":"#9E9D24","lime-900":"#827717","light-green-50":"#F1F8E9","light-green-100":"#DCEDC8","light-green-200":"#C5E1A5","light-green-300":"#AED581","light-green-400":"#9CCC65","light-green-500":"#8BC34A","light-green-600":"#7CB342","light-green-700":"#689F38","light-green-800":"#558B2F","light-green-900":"#33691E","green-50":"#E8F5E9","green-100":"#C8E6C9","green-200":"#A5D6A7","green-300":"#81C784","green-400":"#66BB6A","green-500":"#4CAF50","green-600":"#43A047","green-700":"#388E3C","green-800":"#2E7D32","green-900":"#1B5E20","teal-50":"#E0F2F1","teal-100":"#B2DFDB","teal-200":"#80CBC4","teal-300":"#4DB6AC","teal-400":"#26A69A","teal-500":"#009688","teal-600":"#00897B","teal-700":"#00796B","teal-800":"#00695C","teal-900":"#004D40","cyan-50":"#E0F7FA","cyan-100":"#B2EBF2","cyan-200":"#80DEEA","cyan-300":"#4DD0E1","cyan-400":"#26C6DA","cyan-500":"#00BCD4","cyan-600":"#00ACC1","cyan-700":"#0097A7","cyan-800":"#00838F","cyan-900":"#006064","light-blue-50":"#E1F5FE","light-blue-100":"#B3E5FC","light-blue-200":"#81D4FA","light-blue-300":"#4FC3F7","light-blue-400":"#29B6F6","light-blue-500":"#03A9F4","light-blue-600":"#039BE5","light-blue-700":"#0288D1","light-blue-800":"#0277BD","light-blue-900":"#01579B","blue-50":"#E3F2FD","blue-100":"#BBDEFB","blue-200":"#90CAF9","blue-300":"#64B5F6","blue-400":"#42A5F5","blue-500":"#2196F3","blue-600":"#1E88E5","blue-700":"#1976D2","blue-800":"#1565C0","blue-900":"#0D47A1","indigo-50":"#E8EAF6","indigo-100":"#C5CAE9","indigo-200":"#9FA8DA","indigo-300":"#7986CB","indigo-400":"#5C6BC0","indigo-500":"#3F51B5","indigo-600":"#3949AB","indigo-700":"#303F9F","indigo-800":"#283593","indigo-900":"#1A237E","deep-purple-50":"#EDE7F6","deep-purple-100":"#D1C4E9","deep-purple-200":"#B39DDB","deep-purple-300":"#9575CD","deep-purple-400":"#7E57C2","deep-purple-500":"#673AB7","deep-purple-600":"#5E35B1","deep-purple-700":"#512DA8","deep-purple-800":"#4527A0","deep-purple-900":"#311B92","purple-50":"#F3E5F5","purple-100":"#E1BEE7","purple-200":"#CE93D8","purple-300":"#BA68C8","purple-400":"#AB47BC","purple-500":"#9C27B0","purple-600":"#8E24AA","purple-700":"#7B1FA2","purple-800":"#6A1B9A","purple-900":"#4A148C","pink-50":"#FCE4EC","pink-100":"#F8BBD0","pink-200":"#F48FB1","pink-300":"#F06292","pink-400":"#EC407A","pink-500":"#E91E63","pink-600":"#D81B60","pink-700":"#C2185B","pink-800":"#AD1457","pink-900":"#880E4F","red-50":"#FFEBEE","red-100":"#FFCDD2","red-200":"#EF9A9A","red-300":"#E57373","red-400":"#EF5350","red-500":"#F44336","red-600":"#E53935","red-700":"#D32F2F","red-800":"#C62828","red-900":"#B71C1C","payhere-brand-base":"#102A4D","payhere-brand-10":"#CFD4DB","payhere-brand-20":"#AFB8C4","payhere-brand-30":"#8794A6","payhere-brand-40":"#607188","payhere-brand-50":"#384E6B","payhere-brand-60":"#0D2340","laba-black":"#212529","laba-white":"#FFFFFF","laba-blue-10":"#0163C8","laba-blue-08":"#006DFF","laba-blue-06":"#2899FF","laba-blue-05":"#73A4D6","laba-blue-02":"#DBECFF","laba-blue-01":"#F0F7FF","laba-green-10":"#038C67","laba-green-08":"#04BA27","laba-green-06":"#78D798","laba-green-05":"#ABF3CC","laba-green-02":"#CAEEE5","laba-green-01":"#DFF6F6","laba-grey-10":"#898989","laba-grey-08":"#AEAEAE","laba-grey-06":"#D6D6D6","laba-grey-05":"#EEEEEE","laba-grey-02":"#F2F2F2","laba-grey-01":"#FDFDFD","laba-orange-10":"#C05000","laba-orange-08":"#FF7200","laba-orange-06":"#FF9300","laba-orange-05":"#FFBD78","laba-orange-02":"#FFDDBB","laba-orange-01":"#FFF5EB","laba-red-10":"#9E101F","laba-red-08":"#ED0019","laba-red-06":"#FB004E","laba-red-05":"#FF5378","laba-red-02":"#FFAEBF","laba-red-01":"#FFEBEF","lpd-primary-50":"#CEDBFE","lpd-primary-100":"#B6CAFE","lpd-primary-200":"#9DB8FE","lpd-primary-300":"#6C94FD","lpd-primary-400":"#3B71FD","lpd-primary-500":"#0A4DFC","lpd-primary-600":"#083ECA","lpd-primary-700":"#062E97","lpd-primary-800":"#041F65","lpd-primary-900":"#03174C","lpd-secondary-50":"#FEF5CE","lpd-secondary-100":"#FEEFB5","lpd-secondary-200":"#FDEA9D","lpd-secondary-300":"#FDE06B","lpd-secondary-400":"#FCD53A","lpd-secondary-500":"#FBCB09","lpd-secondary-600":"#C9A207","lpd-secondary-700":"#977A05","lpd-secondary-800":"#645104","lpd-secondary-900":"#4B3D03"},jx={"payhere-h1":["60px",{lineHeight:"72px",fontWeight:700}],"payhere-h2":["48px",{lineHeight:"58px",fontWeight:700}],"payhere-h3":["40px",{lineHeight:"48px",fontWeight:700}],"payhere-h4":["30px",{lineHeight:"38px",fontWeight:700}],"payhere-h5":["28px",{lineHeight:"40px",fontWeight:600}],"payhere-h6":["24px",{lineHeight:"30px",fontWeight:600}],"payhere-body-lr":["18px",{lineHeight:"26px",fontWeight:400}],"payhere-body-lm":["18px",{lineHeight:"26px",fontWeight:500}],"payhere-body-ls":["18px",{lineHeight:"26px",fontWeight:600}],"payhere-body-lb":["18px",{lineHeight:"26px",fontWeight:700}],"payhere-body-mr":["16px",{lineHeight:"24px",fontWeight:400}],"payhere-body-mm":["16px",{lineHeight:"24px",fontWeight:500}],"payhere-body-ms":["16px",{lineHeight:"24px",fontWeight:600}],"payhere-body-mb":["16px",{lineHeight:"24px",fontWeight:700}],"payhere-label-r":["15px",{lineHeight:"26px",fontWeight:400}],"payhere-label-m":["15px",{lineHeight:"26px",fontWeight:500}],"payhere-label-sb":["15px",{lineHeight:"26px",fontWeight:600}],"payhere-label-b":["15px",{lineHeight:"26px",fontWeight:700}],"payhere-body-sr":["14px",{lineHeight:"22px",fontWeight:400}],"payhere-body-sm":["14px",{lineHeight:"22px",fontWeight:500}],"payhere-body-smb":["14px",{lineHeight:"22px",fontWeight:600}],"payhere-body-sb":["14px",{lineHeight:"22px",fontWeight:700}],"payhere-body-esr":["12px",{lineHeight:"20px",fontWeight:400}],"payhere-body-esm":["12px",{lineHeight:"20px",fontWeight:500}],"payhere-body-esmb":["12px",{lineHeight:"20px",fontWeight:600}],"payhere-body-esb":["12px",{lineHeight:"20px",fontWeight:700}]},zx={"laba-title-lb":["36px",{lineHeight:"44px",fontWeight:700}],"laba-title-ls":["36px",{lineHeight:"44px",fontWeight:600}],"laba-title-lr":["36px",{lineHeight:"44px",fontWeight:400}],"laba-title-mb":["32px",{lineHeight:"40px",fontWeight:700}],"laba-title-ms":["32px",{lineHeight:"40px",fontWeight:600}],"laba-title-mr":["32px",{lineHeight:"40px",fontWeight:400}],"laba-h1":["24px",{lineHeight:"30px",fontWeight:700}],"laba-h1-b":["24px",{lineHeight:"30px",fontWeight:700}],"laba-h1-sb":["24px",{lineHeight:"30px",fontWeight:600}],"laba-h1-r":["24px",{lineHeight:"30px",fontWeight:400}],"laba-h2":["18px",{lineHeight:"26px",fontWeight:700}],"laba-h2-b":["18px",{lineHeight:"26px",fontWeight:700}],"laba-h2-sb":["18px",{lineHeight:"26px",fontWeight:600}],"laba-h2-r":["18px",{lineHeight:"26px",fontWeight:400}],"laba-base-rb":["16px",{lineHeight:"24px",fontWeight:700}],"laba-base-rs":["16px",{lineHeight:"24px",fontWeight:600}],"laba-base-rr":["16px",{lineHeight:"24px",fontWeight:400}],"laba-base-sb":["14px",{lineHeight:"20px",fontWeight:700}],"laba-base-ss":["14px",{lineHeight:"20px",fontWeight:600}],"laba-base-sr":["14px",{lineHeight:"20px",fontWeight:400}],"laba-subtitle-rb":["12px",{lineHeight:"16px",fontWeight:700}],"laba-subtitle-rs":["12px",{lineHeight:"16px",fontWeight:600}],"laba-subtitle-rr":["12px",{lineHeight:"16px",fontWeight:400}],"laba-subtitle-sb":["10px",{lineHeight:"12px",fontWeight:700}],"laba-subtitle-ss":["10px",{lineHeight:"12px",fontWeight:600}],"laba-subtitle-sr":["10px",{lineHeight:"12px",fontWeight:400}]},pA={...jx,...zx},mA={"sm-default":"640px",sm:"576px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},vA={"sm-default":640,sm:576,md:768,lg:1024,xl:1280,"2xl":1536},bA=()=>F.jsx("div",{className:"1ru-w-full 1ru-bg-red-900",children:"index"}),yA="_loading_15bmc_327",$e={"button-l":"_button-l_15bmc_67","button-m":"_button-m_15bmc_67","button-s":"_button-s_15bmc_115","button-xs":"_button-xs_15bmc_115","button-large":"_button-large_15bmc_241","button-reguler":"_button-reguler_15bmc_241","button-small":"_button-small_15bmc_259","button-extra-small":"_button-extra-small_15bmc_259",loading:yA,"nude-laba-red-05":"_nude-laba-red-05_15bmc_342","nude-laba-red-08":"_nude-laba-red-08_15bmc_342","nude-laba-red-10":"_nude-laba-red-10_15bmc_342","nude-gray-500":"_nude-gray-500_15bmc_342","nude-green-700":"_nude-green-700_15bmc_342","nude-red-700":"_nude-red-700_15bmc_342","nude-laba-blue-10":"_nude-laba-blue-10_15bmc_342","ghost-blue-gray-100-bg_white-text_blue-gray-400":"_ghost-blue-gray-100-bg_white-text_blue-gray-400_15bmc_342","ghost-blue-gray-100-bg_white":"_ghost-blue-gray-100-bg_white_15bmc_342","ghost-laba-green-10":"_ghost-laba-green-10_15bmc_342","ghost-laba-blue-01":"_ghost-laba-blue-01_15bmc_342","ghost-laba-blue-05":"_ghost-laba-blue-05_15bmc_342","ghost-green-700":"_ghost-green-700_15bmc_342","ghost-red-700":"_ghost-red-700_15bmc_342","ghost-laba-blue-10":"_ghost-laba-blue-10_15bmc_342","filled-laba-white_laba-red-05":"_filled-laba-white_laba-red-05_15bmc_342","filled-laba-white_laba-blue-10":"_filled-laba-white_laba-blue-10_15bmc_342","primary-green-700":"_primary-green-700_15bmc_342","primary-red-700-dsb_laba-grey-06":"_primary-red-700-dsb_laba-grey-06_15bmc_342","primary-laba-blue-10":"_primary-laba-blue-10_15bmc_342","tertiary-black":"_tertiary-black_15bmc_342","tertiary-gray-500":"_tertiary-gray-500_15bmc_342","tertiary-red-600":"_tertiary-red-600_15bmc_342","tertiary-red-300":"_tertiary-red-300_15bmc_342","tertiary-blue-700":"_tertiary-blue-700_15bmc_342","secondary-green-600":"_secondary-green-600_15bmc_342","secondary-red-700":"_secondary-red-700_15bmc_342","secondary-red-600":"_secondary-red-600_15bmc_342","secondary-blue-700":"_secondary-blue-700_15bmc_342","primary-red-700":"_primary-red-700_15bmc_342","primary-blue-700":"_primary-blue-700_15bmc_342","icon-loading":"_icon-loading_15bmc_434"},xA=({className:e=""})=>F.jsx("svg",{className:`${$e["icon-loading"]} ${e??""}`,xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:F.jsx("path",{d:`M21.6311 6.63315C22.3017 6.23898 22.5321 5.36957 22.0621 4.7497C20.7187 2.9779 18.9029 1.6063
25
25
  16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629
26
26
  3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861
@@ -35,15 +35,15 @@ Private-MAC: `+x.digest().toHex()+`\r
35
35
  ${u?$e.loading:""} ${s??""}`,type:p,disabled:h??u,...d,children:[!u&&F.jsxs(F.Fragment,{children:[typeof i=="function"&&i(),N.isValidElement(i)&&i]}),u&&F.jsx(xA,{className:`${v.loadingSize[n]} ${l}`}),o,!u&&F.jsxs(F.Fragment,{children:[typeof a=="function"&&a(),N.isValidElement(a)&&a]})]})});vr.displayName="Button";function Mc(){return typeof window<"u"}function Zi(e){return Q0(e)?(e.nodeName||"").toLowerCase():"#document"}function On(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ur(e){var t;return(t=(Q0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Q0(e){return Mc()?e instanceof Node||e instanceof On(e).Node:!1}function Et(e){return Mc()?e instanceof Element||e instanceof On(e).Element:!1}function Nt(e){return Mc()?e instanceof HTMLElement||e instanceof On(e).HTMLElement:!1}function Fh(e){return!Mc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof On(e).ShadowRoot}const CA=new Set(["inline","contents"]);function ll(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!CA.has(i)}const EA=new Set(["table","td","th"]);function SA(e){return EA.has(Zi(e))}const wA=[":popover-open",":modal"];function Oc(e){return wA.some(t=>{try{return e.matches(t)}catch{return!1}})}const IA=["transform","translate","scale","rotate","perspective"],_A=["transform","translate","scale","rotate","perspective","filter"],DA=["paint","layout","strict","content"];function eg(e){const t=Lc(),n=Et(e)?jn(e):e;return IA.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||_A.some(r=>(n.willChange||"").includes(r))||DA.some(r=>(n.contain||"").includes(r))}function TA(e){let t=gi(e);for(;Nt(t)&&!di(t);){if(eg(t))return t;if(Oc(t))return null;t=gi(t)}return null}function Lc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AA=new Set(["html","body","#document"]);function di(e){return AA.has(Zi(e))}function jn(e){return On(e).getComputedStyle(e)}function Vc(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gi(e){if(Zi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fh(e)&&e.host||Ur(e);return Fh(t)?t.host:t}function Gx(e){const t=gi(e);return di(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nt(t)&&ll(t)?t:Gx(t)}function zi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Gx(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=On(i);if(a){const s=Nh(o);return t.concat(o,o.visualViewport||[],ll(i)?i:[],s&&n?zi(s):[])}return t.concat(i,zi(i,[],n))}function Nh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const RA=["top","right","bottom","left"],Um=["start","end"],Xm=RA.reduce((e,t)=>e.concat(t,t+"-"+Um[0],t+"-"+Um[1]),[]),wo=Math.min,ya=Math.max,Lu=Math.round,$l=Math.floor,Mr=e=>({x:e,y:e}),BA={left:"right",right:"left",bottom:"top",top:"bottom"},kA={start:"end",end:"start"};function Mh(e,t,n){return ya(e,wo(t,n))}function Lo(e,t){return typeof e=="function"?e(t):e}function pi(e){return e.split("-")[0]}function Or(e){return e.split("-")[1]}function Wx(e){return e==="x"?"y":"x"}function tg(e){return e==="y"?"height":"width"}const PA=new Set(["top","bottom"]);function Ni(e){return PA.has(pi(e))?"y":"x"}function ng(e){return Wx(Ni(e))}function Ux(e,t,n){n===void 0&&(n=!1);const r=Or(e),i=ng(e),a=tg(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Hu(o)),[o,Hu(o)]}function $A(e){const t=Hu(e);return[Vu(e),t,Vu(t)]}function Vu(e){return e.replace(/start|end/g,t=>kA[t])}const Ym=["left","right"],Km=["right","left"],FA=["top","bottom"],NA=["bottom","top"];function MA(e,t,n){switch(e){case"top":case"bottom":return n?t?Km:Ym:t?Ym:Km;case"left":case"right":return t?FA:NA;default:return[]}}function OA(e,t,n,r){const i=Or(e);let a=MA(pi(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Vu)))),a}function Hu(e){return e.replace(/left|right|bottom|top/g,t=>BA[t])}function LA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xx(e){return typeof e!="number"?LA(e):{top:e,right:e,bottom:e,left:e}}function ju(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}/*!
36
36
  * tabbable 6.2.0
37
37
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
38
- */var VA=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],zu=VA.join(","),Yx=typeof Element>"u",Io=Yx?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gu=!Yx&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Wu=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=i===""||i==="true",o=a||n&&t&&e(t.parentNode);return o},HA=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Kx=function(t,n,r){if(Wu(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(zu));return n&&Io.call(t,zu)&&i.unshift(t),i=i.filter(r),i},Zx=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!Wu(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=e(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var c=Io.call(o,zu);c&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!Wu(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&h){var d=e(p===!0?o.children:p.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}return i},Jx=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qx=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||HA(t))&&!Jx(t)?0:t.tabIndex},jA=function(t,n){var r=qx(t);return r<0&&n&&!Jx(t)?0:r},zA=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qx=function(t){return t.tagName==="INPUT"},GA=function(t){return Qx(t)&&t.type==="hidden"},WA=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},UA=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},XA=function(t){if(!t.name)return!0;var n=t.form||Gu(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=UA(i,t.form);return!a||a===t},YA=function(t){return Qx(t)&&t.type==="radio"},KA=function(t){return YA(t)&&!XA(t)},ZA=function(t){var n,r=t&&Gu(t),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var o,s,l;for(a=!!((o=i)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!a&&i;){var u,c,p;r=Gu(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(i))}}return a},Zm=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},JA=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=Io.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(Io.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var l=t.parentElement,u=Gu(t);if(l&&!l.shadowRoot&&i(l)===!0)return Zm(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(ZA(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Zm(t);return!1},qA=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Io.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Oh=function(t,n){return!(n.disabled||Wu(n)||GA(n)||JA(n,t)||WA(n)||qA(n))},Lh=function(t,n){return!(KA(n)||qx(n)<0||!Oh(t,n))},QA=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},e6=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=jA(s,o),u=o?e(i.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:a,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(zA).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Hc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Zx([t],n.includeContainer,{filter:Lh.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:QA}):r=Kx(t,n.includeContainer,Lh.bind(null,n)),e6(r)},t6=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Zx([t],n.includeContainer,{filter:Oh.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Kx(t,n.includeContainer,Oh.bind(null,n)),r},eC=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Io.call(t,zu)===!1?!1:Lh(n,t)};function n6(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function tC(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function r6(){return/apple/i.test(navigator.vendor)}function Vh(){const e=/android/i;return e.test(n6())||e.test(tC())}function i6(){return tC().includes("jsdom/")}const Jm="data-floating-ui-focusable",a6="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ro(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Fn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Fh(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Pi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function uf(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function o6(e){return e.matches("html,body")}function hr(e){return(e==null?void 0:e.ownerDocument)||document}function nC(e){return Nt(e)&&e.matches(a6)}function qm(e){return e?e.getAttribute("role")==="combobox"&&nC(e):!1}function Hh(e){return e?e.hasAttribute(Jm)?e:e.querySelector("["+Jm+"]")||e:null}function uo(e,t,n){return n===void 0&&(n=!0),e.filter(i=>{var a;return i.parentId===t&&(!n||((a=i.context)==null?void 0:a.open))}).flatMap(i=>[i,...uo(e,i.id,n)])}function Qm(e,t){var n;let r=[],i=(n=e.find(a=>a.id===t))==null?void 0:n.parentId;for(;i;){const a=e.find(o=>o.id===i);i=a==null?void 0:a.parentId,a&&(r=r.concat(a))}return r}function cf(e){e.preventDefault(),e.stopPropagation()}function s6(e){return"nativeEvent"in e}function l6(e){return e.mozInputSource===0&&e.isTrusted?!0:Vh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function u6(e){return i6()?!1:!Vh()&&e.width===0&&e.height===0||Vh()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function e1(e,t){return["mouse","pen"].includes(e)}var c6=typeof document<"u",d6=function(){},xn=c6?N.useLayoutEffect:d6;const f6={...ae};function ga(e){const t=ae.useRef(e);return xn(()=>{t.current=e}),t}const h6=f6.useInsertionEffect,g6=h6||(e=>e());function $r(e){const t=ae.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return g6(()=>{t.current=e}),ae.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const ul=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rC(e,t){const n=Hc(e,ul()),r=n.length;if(r===0)return;const i=ro(hr(e)),a=n.indexOf(i),o=a===-1?t===1?0:r-1:a+t;return n[o]}function iC(e){return rC(hr(e).body,1)||e}function aC(e){return rC(hr(e).body,-1)||e}function gs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Fn(n,r)}function p6(e){Hc(e,ul()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function t1(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function n1(e,t,n){let{reference:r,floating:i}=e;const a=Ni(t),o=ng(t),s=tg(o),l=pi(t),u=a==="y",c=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let d;switch(l){case"top":d={x:c,y:r.y-i.height};break;case"bottom":d={x:c,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:p};break;case"left":d={x:r.x-i.width,y:p};break;default:d={x:r.x,y:r.y}}switch(Or(t)){case"start":d[o]-=h*(n&&u?-1:1);break;case"end":d[o]+=h*(n&&u?-1:1);break}return d}const m6=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:p}=n1(u,r,l),h=r,d={},v=0;for(let m=0;m<s.length;m++){const{name:b,fn:f}=s[m],{x:y,y:C,data:S,reset:w}=await f({x:c,y:p,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:o,elements:{reference:e,floating:t}});c=y??c,p=C??p,d={...d,[b]:{...d[b],...S}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:p}=n1(u,h,l)),m=-1)}return{x:c,y:p,placement:h,strategy:i,middlewareData:d}};async function rg(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:h=!1,padding:d=0}=Lo(t,e),v=Xx(d),b=s[h?p==="floating"?"reference":"floating":p],f=ju(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y=p==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},w=ju(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:C,strategy:l}):y);return{top:(f.top-w.top+v.top)/S.y,bottom:(w.bottom-f.bottom+v.bottom)/S.y,left:(f.left-w.left+v.left)/S.x,right:(w.right-f.right+v.right)/S.x}}const v6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=Lo(e,t)||{};if(u==null)return{};const p=Xx(c),h={x:n,y:r},d=ng(i),v=tg(d),m=await o.getDimensions(u),b=d==="y",f=b?"top":"left",y=b?"bottom":"right",C=b?"clientHeight":"clientWidth",S=a.reference[v]+a.reference[d]-h[d]-a.floating[v],w=h[d]-a.reference[d],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let x=E?E[C]:0;(!x||!await(o.isElement==null?void 0:o.isElement(E)))&&(x=s.floating[C]||a.floating[v]);const g=S/2-w/2,I=x/2-m[v]/2-1,A=wo(p[f],I),_=wo(p[y],I),T=A,$=x-m[v]-_,B=x/2-m[v]/2+g,P=Mh(T,B,$),k=!l.arrow&&Or(i)!=null&&B!==P&&a.reference[v]/2-(B<T?A:_)-m[v]/2<0,O=k?B<T?B-T:B-$:0;return{[d]:h[d]+O,data:{[d]:P,centerOffset:B-P-O,...k&&{alignmentOffset:O}},reset:k}}});function b6(e,t,n){return(e?[...n.filter(i=>Or(i)===e),...n.filter(i=>Or(i)!==e)]:n.filter(i=>pi(i)===i)).filter(i=>e?Or(i)===e||(t?Vu(i)!==i:!1):!0)}const y6=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:o,placement:s,platform:l,elements:u}=t,{crossAxis:c=!1,alignment:p,allowedPlacements:h=Xm,autoAlignment:d=!0,...v}=Lo(e,t),m=p!==void 0||h===Xm?b6(p||null,d,h):h,b=await rg(t,v),f=((n=o.autoPlacement)==null?void 0:n.index)||0,y=m[f];if(y==null)return{};const C=Ux(y,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==y)return{reset:{placement:m[0]}};const S=[b[pi(y)],b[C[0]],b[C[1]]],w=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:y,overflows:S}],E=m[f+1];if(E)return{data:{index:f+1,overflows:w},reset:{placement:E}};const x=w.map(A=>{const _=Or(A.placement);return[A.placement,_&&c?A.overflows.slice(0,2).reduce((T,$)=>T+$,0):A.overflows[0],A.overflows]}).sort((A,_)=>A[1]-_[1]),I=((i=x.filter(A=>A[2].slice(0,Or(A[0])?2:3).every(_=>_<=0))[0])==null?void 0:i[0])||x[0][0];return I!==s?{data:{index:f+1,overflows:w},reset:{placement:I}}:{}}}},x6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=Lo(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const f=pi(i),y=Ni(s),C=pi(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=h||(C||!m?[Hu(s)]:$A(s)),E=v!=="none";!h&&E&&w.push(...OA(s,m,v,S));const x=[s,...w],g=await rg(t,b),I=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&I.push(g[f]),p){const B=Ux(i,o,S);I.push(g[B[0]],g[B[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(B=>B<=0)){var _,T;const B=(((_=a.flip)==null?void 0:_.index)||0)+1,P=x[B];if(P&&(!(p==="alignment"?y!==Ni(P):!1)||A.every(M=>Ni(M.placement)===y?M.overflows[0]>0:!0)))return{data:{index:B,overflows:A},reset:{placement:P}};let k=(T=A.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:T.placement;if(!k)switch(d){case"bestFit":{var $;const O=($=A.filter(M=>{if(E){const G=Ni(M.placement);return G===y||G==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(G=>G>0).reduce((G,W)=>G+W,0)]).sort((M,G)=>M[1]-G[1])[0])==null?void 0:$[0];O&&(k=O);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}},C6=new Set(["left","top"]);async function E6(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=pi(n),s=Or(n),l=Ni(n)==="y",u=C6.has(o)?-1:1,c=a&&l?-1:1,p=Lo(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof v=="number"&&(d=s==="end"?v*-1:v),l?{x:d*c,y:h*u}:{x:h*u,y:d*c}}const S6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await E6(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},w6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:b=>{let{x:f,y}=b;return{x:f,y}}},...l}=Lo(e,t),u={x:n,y:r},c=await rg(t,l),p=Ni(pi(i)),h=Wx(p);let d=u[h],v=u[p];if(a){const b=h==="y"?"top":"left",f=h==="y"?"bottom":"right",y=d+c[b],C=d-c[f];d=Mh(y,d,C)}if(o){const b=p==="y"?"top":"left",f=p==="y"?"bottom":"right",y=v+c[b],C=v-c[f];v=Mh(y,v,C)}const m=s.fn({...t,[h]:d,[p]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:o}}}}}};function oC(e){const t=jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Nt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Lu(n)!==a||Lu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ig(e){return Et(e)?e:e.contextElement}function co(e){const t=ig(e);if(!Nt(t))return Mr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=oC(t);let o=(a?Lu(n.width):n.width)/r,s=(a?Lu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const I6=Mr(0);function sC(e){const t=On(e);return!Lc()||!t.visualViewport?I6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==On(e)?!1:t}function Da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=ig(e);let o=Mr(1);t&&(r?Et(r)&&(o=co(r)):o=co(e));const s=_6(a,n,r)?sC(a):Mr(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,p=i.height/o.y;if(a){const h=On(a),d=r&&Et(r)?On(r):r;let v=h,m=Nh(v);for(;m&&r&&d!==v;){const b=co(m),f=m.getBoundingClientRect(),y=jn(m),C=f.left+(m.clientLeft+parseFloat(y.paddingLeft))*b.x,S=f.top+(m.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,p*=b.y,l+=C,u+=S,v=On(m),m=Nh(v)}}return ju({width:c,height:p,x:l,y:u})}function ag(e,t){const n=Vc(e).scrollLeft;return t?t.left+n:Da(Ur(e)).left+n}function lC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:ag(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function D6(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Ur(r),s=t?Oc(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Mr(1);const c=Mr(0),p=Nt(r);if((p||!p&&!a)&&((Zi(r)!=="body"||ll(o))&&(l=Vc(r)),Nt(r))){const d=Da(r);u=co(r),c.x=d.x+r.clientLeft,c.y=d.y+r.clientTop}const h=o&&!p&&!a?lC(o,l,!0):Mr(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function T6(e){return Array.from(e.getClientRects())}function A6(e){const t=Ur(e),n=Vc(e),r=e.ownerDocument.body,i=ya(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ya(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ag(e);const s=-n.scrollTop;return jn(r).direction==="rtl"&&(o+=ya(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function R6(e,t){const n=On(e),r=Ur(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=Lc();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}const B6=new Set(["absolute","fixed"]);function k6(e,t){const n=Da(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Nt(e)?co(e):Mr(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function r1(e,t,n){let r;if(t==="viewport")r=R6(e,n);else if(t==="document")r=A6(Ur(e));else if(Et(t))r=k6(t,n);else{const i=sC(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ju(r)}function uC(e,t){const n=gi(e);return n===t||!Et(n)||di(n)?!1:jn(n).position==="fixed"||uC(n,t)}function P6(e,t){const n=t.get(e);if(n)return n;let r=zi(e,[],!1).filter(s=>Et(s)&&Zi(s)!=="body"),i=null;const a=jn(e).position==="fixed";let o=a?gi(e):e;for(;Et(o)&&!di(o);){const s=jn(o),l=eg(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&B6.has(i.position)||ll(o)&&!l&&uC(e,o))?r=r.filter(c=>c!==o):i=s,o=gi(o)}return t.set(e,r),r}function $6(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Oc(t)?[]:P6(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const p=r1(t,c,i);return u.top=ya(p.top,u.top),u.right=wo(p.right,u.right),u.bottom=wo(p.bottom,u.bottom),u.left=ya(p.left,u.left),u},r1(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function F6(e){const{width:t,height:n}=oC(e);return{width:t,height:n}}function N6(e,t,n){const r=Nt(t),i=Ur(t),a=n==="fixed",o=Da(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mr(0);function u(){l.x=ag(i)}if(r||!r&&!a)if((Zi(t)!=="body"||ll(i))&&(s=Vc(t)),r){const d=Da(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();a&&!r&&i&&u();const c=i&&!r&&!a?lC(i,s):Mr(0),p=o.left+s.scrollLeft-l.x-c.x,h=o.top+s.scrollTop-l.y-c.y;return{x:p,y:h,width:o.width,height:o.height}}function df(e){return jn(e).position==="static"}function i1(e,t){if(!Nt(e)||jn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ur(e)===n&&(n=n.ownerDocument.body),n}function cC(e,t){const n=On(e);if(Oc(e))return n;if(!Nt(e)){let i=gi(e);for(;i&&!di(i);){if(Et(i)&&!df(i))return i;i=gi(i)}return n}let r=i1(e,t);for(;r&&SA(r)&&df(r);)r=i1(r,t);return r&&di(r)&&df(r)&&!eg(r)?n:r||TA(e)||n}const M6=async function(e){const t=this.getOffsetParent||cC,n=this.getDimensions,r=await n(e.floating);return{reference:N6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function O6(e){return jn(e).direction==="rtl"}const L6={convertOffsetParentRelativeRectToViewportRelativeRect:D6,getDocumentElement:Ur,getClippingRect:$6,getOffsetParent:cC,getElementRects:M6,getClientRects:T6,getDimensions:F6,getScale:co,isElement:Et,isRTL:O6};function dC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function V6(e,t){let n=null,r;const i=Ur(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=e.getBoundingClientRect(),{left:c,top:p,width:h,height:d}=u;if(s||t(),!h||!d)return;const v=$l(p),m=$l(i.clientWidth-(c+h)),b=$l(i.clientHeight-(p+d)),f=$l(c),C={rootMargin:-v+"px "+-m+"px "+-b+"px "+-f+"px",threshold:ya(0,wo(1,l))||1};let S=!0;function w(E){const x=E[0].intersectionRatio;if(x!==l){if(!S)return o();x?o(!1,x):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x===1&&!dC(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(w,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,C)}n.observe(e)}return o(!0),a}function fC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ig(e),c=i||a?[...u?zi(u):[],...zi(t)]:[];c.forEach(f=>{i&&f.addEventListener("scroll",n,{passive:!0}),a&&f.addEventListener("resize",n)});const p=u&&s?V6(u,n):null;let h=-1,d=null;o&&(d=new ResizeObserver(f=>{let[y]=f;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let v,m=l?Da(e):null;l&&b();function b(){const f=Da(e);m&&!dC(m,f)&&n(),m=f,v=requestAnimationFrame(b)}return n(),()=>{var f;c.forEach(y=>{i&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),p==null||p(),(f=d)==null||f.disconnect(),d=null,l&&cancelAnimationFrame(v)}}const H6=S6,j6=y6,z6=w6,G6=x6,a1=v6,W6=(e,t,n)=>{const r=new Map,i={platform:L6,...n},a={...i.platform,_c:r};return m6(e,t,{...i,platform:a})};var U6=typeof document<"u",X6=function(){},vu=U6?N.useLayoutEffect:X6;function Uu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Uu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Uu(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function hC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o1(e,t){const n=hC(e);return Math.round(t*n)/n}function ff(e){const t=ae.useRef(e);return vu(()=>{t.current=e}),t}function Y6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,p]=ae.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=ae.useState(r);Uu(h,r)||d(r);const[v,m]=ae.useState(null),[b,f]=ae.useState(null),y=ae.useCallback(M=>{M!==E.current&&(E.current=M,m(M))},[]),C=ae.useCallback(M=>{M!==x.current&&(x.current=M,f(M))},[]),S=a||v,w=o||b,E=ae.useRef(null),x=ae.useRef(null),g=ae.useRef(c),I=l!=null,A=ff(l),_=ff(i),T=ff(u),$=ae.useCallback(()=>{if(!E.current||!x.current)return;const M={placement:t,strategy:n,middleware:h};_.current&&(M.platform=_.current),W6(E.current,x.current,M).then(G=>{const W={...G,isPositioned:T.current!==!1};B.current&&!Uu(g.current,W)&&(g.current=W,M0.flushSync(()=>{p(W)}))})},[h,t,n,_,T]);vu(()=>{u===!1&&g.current.isPositioned&&(g.current.isPositioned=!1,p(M=>({...M,isPositioned:!1})))},[u]);const B=ae.useRef(!1);vu(()=>(B.current=!0,()=>{B.current=!1}),[]),vu(()=>{if(S&&(E.current=S),w&&(x.current=w),S&&w){if(A.current)return A.current(S,w,$);$()}},[S,w,$,A,I]);const P=ae.useMemo(()=>({reference:E,floating:x,setReference:y,setFloating:C}),[y,C]),k=ae.useMemo(()=>({reference:S,floating:w}),[S,w]),O=ae.useMemo(()=>{const M={position:n,left:0,top:0};if(!k.floating)return M;const G=o1(k.floating,c.x),W=o1(k.floating,c.y);return s?{...M,transform:"translate("+G+"px, "+W+"px)",...hC(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:W}},[n,s,k.floating,c.x,c.y]);return ae.useMemo(()=>({...c,update:$,refs:P,elements:k,floatingStyles:O}),[c,$,P,k,O])}const K6=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?a1({element:r.current,padding:i}).fn(n):{}:r?a1({element:r,padding:i}).fn(n):{}}}},Z6=(e,t)=>({...H6(e),options:[e,t]}),J6=(e,t)=>({...z6(e),options:[e,t]}),q6=(e,t)=>({...G6(e),options:[e,t]}),Q6=(e,t)=>({...j6(e),options:[e,t]}),eR=(e,t)=>({...K6(e),options:[e,t]}),tR="data-floating-ui-focusable",s1="active",l1="selected",nR={...ae};let u1=!1,rR=0;const c1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rR++;function iR(){const[e,t]=ae.useState(()=>u1?c1():void 0);return xn(()=>{e==null&&t(c1())},[]),ae.useEffect(()=>{u1=!0},[]),e}const aR=nR.useId,jc=aR||iR;let _s;process.env.NODE_ENV!=="production"&&(_s=new Set);function oR(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=_s)!=null&&e.has(i))){var a;(a=_s)==null||a.add(i),console.warn(i)}}function sR(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=_s)!=null&&e.has(i))){var a;(a=_s)==null||a.add(i),console.error(i)}}const lR=ae.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:i},middlewareData:{arrow:a,shift:o}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:p,stroke:h,d,style:{transform:v,...m}={},...b}=t;process.env.NODE_ENV!=="production"&&(n||oR("The `ref` prop is required for `FloatingArrow`."));const f=jc(),[y,C]=ae.useState(!1);if(xn(()=>{if(!i)return;jn(i).direction==="rtl"&&C(!0)},[i]),!i)return null;const[S,w]=r.split("-"),E=S==="top"||S==="bottom";let x=p;(E&&o!=null&&o.x||!E&&o!=null&&o.y)&&(x=null);const g=c*2,I=g/2,A=s/2*(u/-8+1),_=l/2*u/4,T=!!d,$=x&&w==="end"?"bottom":"top";let B=x&&w==="end"?"right":"left";x&&y&&(B=w==="end"?"left":"right");const P=(a==null?void 0:a.x)!=null?x||a.x:"",k=(a==null?void 0:a.y)!=null?x||a.y:"",O=d||"M0,0"+(" H"+s)+(" L"+(s-A)+","+(l-_))+(" Q"+s/2+","+l+" "+A+","+(l-_))+" Z",M={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[S];return F.jsxs("svg",{...b,"aria-hidden":!0,ref:n,width:T?s:s+g,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[B]:P,[$]:k,[S]:E||T?"100%":"calc(100% - "+g/2+"px)",transform:[M,v].filter(G=>!!G).join(" "),...m},children:[g>0&&F.jsx("path",{clipPath:"url(#"+f+")",fill:"none",stroke:h,strokeWidth:g+(d?0:1),d:O}),F.jsx("path",{stroke:g&&!d?b.fill:"none",d:O}),F.jsx("clipPath",{id:f,children:F.jsx("rect",{x:-I,y:I*(T?-1:1),width:s+g,height:s})})]})});function uR(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const cR=ae.createContext(null),dR=ae.createContext(null),gC=()=>{var e;return((e=ae.useContext(cR))==null?void 0:e.id)||null},og=()=>ae.useContext(dR);function Ds(e){return"data-floating-ui-"+e}function fR(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let d1=0;function Xa(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(d1);const a=()=>e==null?void 0:e.focus({preventScroll:n});i?a():d1=requestAnimationFrame(a)}function hR(e){return(e==null?void 0:e.ownerDocument)||document}const fo={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function f1(e){return e==="inert"?fo.inert:e==="aria-hidden"?fo["aria-hidden"]:fo.none}let Fl=new WeakSet,Nl={},hf=0;const gR=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,pC=e=>e&&(e.host||pC(e.parentNode)),pR=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=pC(n);return e.contains(r)?r:null}).filter(n=>n!=null);function mR(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=pR(t,e),s=new Set,l=new Set(o),u=[];Nl[i]||(Nl[i]=new WeakMap);const c=Nl[i];o.forEach(p),h(t),s.clear();function p(d){!d||s.has(d)||(s.add(d),d.parentNode&&p(d.parentNode))}function h(d){!d||l.has(d)||[].forEach.call(d.children,v=>{if(Zi(v)!=="script")if(s.has(v))h(v);else{const m=a?v.getAttribute(a):null,b=m!==null&&m!=="false",f=f1(a),y=(f.get(v)||0)+1,C=(c.get(v)||0)+1;f.set(v,y),c.set(v,C),u.push(v),y===1&&b&&Fl.add(v),C===1&&v.setAttribute(i,""),!b&&a&&v.setAttribute(a,a==="inert"?"":"true")}})}return hf++,()=>{u.forEach(d=>{const v=f1(a),b=(v.get(d)||0)-1,f=(c.get(d)||0)-1;v.set(d,b),c.set(d,f),b||(!Fl.has(d)&&a&&d.removeAttribute(a),Fl.delete(d)),f||d.removeAttribute(i)}),hf--,hf||(fo.inert=new WeakMap,fo["aria-hidden"]=new WeakMap,fo.none=new WeakMap,Fl=new WeakSet,Nl={})}}function h1(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=hR(e[0]).body;return mR(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const zc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Xu=ae.forwardRef(function(t,n){const[r,i]=ae.useState();xn(()=>{r6()&&i("button")},[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ds("focus-guard")]:"",style:zc};return F.jsx("span",{...t,...a})}),mC=ae.createContext(null),g1=Ds("portal");function vR(e){e===void 0&&(e={});const{id:t,root:n}=e,r=jc(),i=vC(),[a,o]=ae.useState(null),s=ae.useRef(null);return xn(()=>()=>{a==null||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),xn(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(g1,""),l.appendChild(u),s.current=u,o(u)},[t,r]),xn(()=>{if(n===null||!r||s.current)return;let l=n||(i==null?void 0:i.portalNode);l&&!Q0(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=r,c.setAttribute(g1,""),l=u||l,l.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function bR(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=vR({id:n,root:r}),[o,s]=ae.useState(null),l=ae.useRef(null),u=ae.useRef(null),c=ae.useRef(null),p=ae.useRef(null),h=o==null?void 0:o.modal,d=o==null?void 0:o.open,v=!!o&&!o.modal&&o.open&&i&&!!(r||a);return ae.useEffect(()=>{if(!a||!i||h)return;function m(b){a&&gs(b)&&(b.type==="focusin"?t1:p6)(a)}return a.addEventListener("focusin",m,!0),a.addEventListener("focusout",m,!0),()=>{a.removeEventListener("focusin",m,!0),a.removeEventListener("focusout",m,!0)}},[a,i,h]),ae.useEffect(()=>{a&&(d||t1(a))},[d,a]),F.jsxs(mC.Provider,{value:ae.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:p,portalNode:a,setFocusManagerState:s}),[i,a]),children:[v&&a&&F.jsx(Xu,{"data-type":"outside",ref:l,onFocus:m=>{if(gs(m,a)){var b;(b=c.current)==null||b.focus()}else{const f=o?o.domReference:null,y=aC(f);y==null||y.focus()}}}),v&&a&&F.jsx("span",{"aria-owns":a.id,style:zc}),a&&M0.createPortal(t,a),v&&a&&F.jsx(Xu,{"data-type":"outside",ref:u,onFocus:m=>{if(gs(m,a)){var b;(b=p.current)==null||b.focus()}else{const f=o?o.domReference:null,y=iC(f);y==null||y.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const vC=()=>ae.useContext(mC);function p1(e){return ae.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const yR=20;let Mi=[];function sg(){Mi=Mi.filter(e=>e.isConnected)}function xR(e){sg(),e&&Zi(e)!=="body"&&(Mi.push(e),Mi.length>yR&&(Mi=Mi.slice(-20)))}function m1(){return sg(),Mi[Mi.length-1]}function CR(e){const t=ul();return eC(e,t)?e:Hc(e,t)[0]||e}function v1(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=ul(),a=t6(e,r).filter(s=>{const l=s.getAttribute("data-tabindex")||"";return eC(s,r)||s.hasAttribute("data-tabindex")&&!l.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||a.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const ER=ae.forwardRef(function(t,n){return F.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:zc})});function SR(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:p=!0,outsideElementsInert:h=!1,getInsideElements:d=()=>[]}=e,{open:v,onOpenChange:m,events:b,dataRef:f,elements:{domReference:y,floating:C}}=t,S=$r(()=>{var D;return(D=f.current.floatingContext)==null?void 0:D.nodeId}),w=$r(d),E=typeof o=="number"&&o<0,x=qm(y)&&E,g=gR(),I=g?a:!0,A=!I||g&&h,_=ga(i),T=ga(o),$=ga(s),B=og(),P=vC(),k=ae.useRef(null),O=ae.useRef(null),M=ae.useRef(!1),G=ae.useRef(!1),W=ae.useRef(-1),U=ae.useRef(-1),q=P!=null,Q=Hh(C),Z=$r(function(D){return D===void 0&&(D=Q),D?Hc(D,ul()):[]}),ee=$r(D=>{const L=Z(D);return _.current.map(K=>y&&K==="reference"?y:Q&&K==="floating"?Q:L).filter(Boolean).flat()});ae.useEffect(()=>{if(r||!u)return;function D(K){if(K.key==="Tab"){Fn(Q,ro(hr(Q)))&&Z().length===0&&!x&&cf(K);const X=ee(),se=Pi(K);_.current[0]==="reference"&&se===y&&(cf(K),K.shiftKey?Xa(X[X.length-1]):Xa(X[1])),_.current[1]==="floating"&&se===Q&&K.shiftKey&&(cf(K),Xa(X[0]))}}const L=hr(Q);return L.addEventListener("keydown",D),()=>{L.removeEventListener("keydown",D)}},[r,y,Q,u,_,x,Z,ee]),ae.useEffect(()=>{if(r||!C)return;function D(L){const K=Pi(L),se=Z().indexOf(K);se!==-1&&(W.current=se)}return C.addEventListener("focusin",D),()=>{C.removeEventListener("focusin",D)}},[r,C,Z]),ae.useEffect(()=>{if(r||!p)return;function D(){G.current=!0,setTimeout(()=>{G.current=!1})}function L(se){const ie=se.relatedTarget,oe=se.currentTarget,te=Pi(se);queueMicrotask(()=>{const ue=S(),ve=!(Fn(y,ie)||Fn(C,ie)||Fn(ie,C)||Fn(P==null?void 0:P.portalNode,ie)||ie!=null&&ie.hasAttribute(Ds("focus-guard"))||B&&(uo(B.nodesRef.current,ue).find(be=>{var pe,Te;return Fn((pe=be.context)==null?void 0:pe.elements.floating,ie)||Fn((Te=be.context)==null?void 0:Te.elements.domReference,ie)})||Qm(B.nodesRef.current,ue).find(be=>{var pe,Te,Ne;return[(pe=be.context)==null?void 0:pe.elements.floating,Hh((Te=be.context)==null?void 0:Te.elements.floating)].includes(ie)||((Ne=be.context)==null?void 0:Ne.elements.domReference)===ie})));if(oe===y&&Q&&v1(Q,_),l&&oe!==y&&!(te!=null&&te.isConnected)&&ro(hr(Q))===hr(Q).body){Nt(Q)&&Q.focus();const be=W.current,pe=Z(),Te=pe[be]||pe[pe.length-1]||Q;Nt(Te)&&Te.focus()}if(f.current.insideReactTree){f.current.insideReactTree=!1;return}(x||!u)&&ie&&ve&&!G.current&&ie!==m1()&&(M.current=!0,m(!1,se,"focus-out"))})}const K=!!(!B&&P);function X(){fR(U),f.current.insideReactTree=!0,U.current=window.setTimeout(()=>{f.current.insideReactTree=!1})}if(C&&Nt(y))return y.addEventListener("focusout",L),y.addEventListener("pointerdown",D),C.addEventListener("focusout",L),K&&C.addEventListener("focusout",X,!0),()=>{y.removeEventListener("focusout",L),y.removeEventListener("pointerdown",D),C.removeEventListener("focusout",L),K&&C.removeEventListener("focusout",X,!0)}},[r,y,C,Q,u,B,P,m,p,l,Z,x,S,_,f]);const J=ae.useRef(null),le=ae.useRef(null),re=p1([J,P==null?void 0:P.beforeInsideRef]),R=p1([le,P==null?void 0:P.afterInsideRef]);ae.useEffect(()=>{var D,L;if(r||!C)return;const K=Array.from((P==null||(D=P.portalNode)==null?void 0:D.querySelectorAll("["+Ds("portal")+"]"))||[]),se=(L=(B?Qm(B.nodesRef.current,S()):[]).find(te=>{var ue;return qm(((ue=te.context)==null?void 0:ue.elements.domReference)||null)}))==null||(L=L.context)==null?void 0:L.elements.domReference,ie=[C,se,...K,...w(),k.current,O.current,J.current,le.current,P==null?void 0:P.beforeOutsideRef.current,P==null?void 0:P.afterOutsideRef.current,_.current.includes("reference")||x?y:null].filter(te=>te!=null),oe=u||x?h1(ie,!A,A):h1(ie);return()=>{oe()}},[r,y,C,u,_,P,x,I,A,B,S,w]),xn(()=>{if(r||!Nt(Q))return;const D=hr(Q),L=ro(D);queueMicrotask(()=>{const K=ee(Q),X=T.current,se=(typeof X=="number"?K[X]:X.current)||Q,ie=Fn(Q,L);!E&&!ie&&v&&Xa(se,{preventScroll:se===Q})})},[r,v,Q,E,ee,T]),xn(()=>{if(r||!Q)return;const D=hr(Q),L=ro(D);xR(L);function K(ie){let{reason:oe,event:te,nested:ue}=ie;if(["hover","safe-polygon"].includes(oe)&&te.type==="mouseleave"&&(M.current=!0),oe==="outside-press")if(ue)M.current=!1;else if(l6(te)||u6(te))M.current=!1;else{let ve=!1;document.createElement("div").focus({get preventScroll(){return ve=!0,!1}}),ve?M.current=!1:M.current=!0}}b.on("openchange",K);const X=D.createElement("span");X.setAttribute("tabindex","-1"),X.setAttribute("aria-hidden","true"),Object.assign(X.style,zc),q&&y&&y.insertAdjacentElement("afterend",X);function se(){if(typeof $.current=="boolean"){const ie=y||m1();return ie&&ie.isConnected?ie:X}return $.current.current||X}return()=>{b.off("openchange",K);const ie=ro(D),oe=Fn(C,ie)||B&&uo(B.nodesRef.current,S(),!1).some(ue=>{var ve;return Fn((ve=ue.context)==null?void 0:ve.elements.floating,ie)}),te=se();queueMicrotask(()=>{const ue=CR(te);$.current&&!M.current&&Nt(ue)&&(!(ue!==ie&&ie!==D.body)||oe)&&ue.focus({preventScroll:!0}),X.remove()})}},[r,C,Q,$,f,b,B,q,y,S]),ae.useEffect(()=>(queueMicrotask(()=>{M.current=!1}),()=>{queueMicrotask(sg)}),[r]),xn(()=>{if(!r&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:p,open:v,onOpenChange:m,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,u,v,m,p,y]),xn(()=>{r||Q&&v1(Q,_)},[r,Q,_]);function H(D){return r||!c||!u?null:F.jsx(ER,{ref:D==="start"?k:O,onClick:L=>m(!1,L.nativeEvent),children:typeof c=="string"?c:"Dismiss"})}const V=!r&&I&&(u?!x:!0)&&(q||u);return F.jsxs(F.Fragment,{children:[V&&F.jsx(Xu,{"data-type":"inside",ref:re,onFocus:D=>{if(u){const K=ee();Xa(i[0]==="reference"?K[0]:K[K.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(M.current=!1,gs(D,P.portalNode)){const K=iC(y);K==null||K.focus()}else{var L;(L=P.beforeOutsideRef.current)==null||L.focus()}}}),!x&&H("start"),n,H("end"),V&&F.jsx(Xu,{"data-type":"inside",ref:R,onFocus:D=>{if(u)Xa(ee()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(p&&(M.current=!0),gs(D,P.portalNode)){const K=aC(y);K==null||K.focus()}else{var L;(L=P.afterOutsideRef.current)==null||L.focus()}}})]})}function b1(e){return Nt(e.target)&&e.target.tagName==="BUTTON"}function wR(e){return Nt(e.target)&&e.target.tagName==="A"}function y1(e){return nC(e)}function IR(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0,stickIfOpen:p=!0}=t,h=ae.useRef(),d=ae.useRef(!1),v=ae.useMemo(()=>({onPointerDown(m){h.current=m.pointerType},onMouseDown(m){const b=h.current;m.button===0&&s!=="click"&&(e1(b)&&u||(n&&l&&(!(i.current.openEvent&&p)||i.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const b=h.current;if(s==="mousedown"&&h.current){h.current=void 0;return}e1(b)&&u||(n&&l&&(!(i.current.openEvent&&p)||i.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){h.current=void 0,!(m.defaultPrevented||!c||b1(m))&&(m.key===" "&&!y1(a)&&(m.preventDefault(),d.current=!0),!wR(m)&&m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!c||b1(m)||y1(a)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[i,a,s,u,c,r,n,p,l]);return ae.useMemo(()=>o?{reference:v}:{},[o,v])}const _R={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},DR={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},x1=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function TR(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:v}=t,m=og(),b=$r(typeof l=="function"?l:()=>!1),f=typeof l=="function"?b:l,y=ae.useRef(!1),{escapeKey:C,outsidePress:S}=x1(d),{escapeKey:w,outsidePress:E}=x1(v),x=ae.useRef(!1),g=$r(B=>{var P;if(!n||!o||!s||B.key!=="Escape"||x.current)return;const k=(P=a.current.floatingContext)==null?void 0:P.nodeId,O=m?uo(m.nodesRef.current,k):[];if(!C&&(B.stopPropagation(),O.length>0)){let M=!0;if(O.forEach(G=>{var W;if((W=G.context)!=null&&W.open&&!G.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,s6(B)?B.nativeEvent:B,"escape-key")}),I=$r(B=>{var P;const k=()=>{var O;g(B),(O=Pi(B))==null||O.removeEventListener("keydown",k)};(P=Pi(B))==null||P.addEventListener("keydown",k)}),A=$r(B=>{var P;const k=a.current.insideReactTree;a.current.insideReactTree=!1;const O=y.current;if(y.current=!1,u==="click"&&O||k||typeof f=="function"&&!f(B))return;const M=Pi(B),G="["+Ds("inert")+"]",W=hr(i.floating).querySelectorAll(G);let U=Et(M)?M:null;for(;U&&!di(U);){const ee=gi(U);if(di(ee)||!Et(ee))break;U=ee}if(W.length&&Et(M)&&!o6(M)&&!Fn(M,i.floating)&&Array.from(W).every(ee=>!Fn(U,ee)))return;if(Nt(M)&&$){const ee=di(M),J=jn(M),le=/auto|scroll/,re=ee||le.test(J.overflowX),R=ee||le.test(J.overflowY),H=re&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,V=R&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,D=J.direction==="rtl",L=V&&(D?B.offsetX<=M.offsetWidth-M.clientWidth:B.offsetX>M.clientWidth),K=H&&B.offsetY>M.clientHeight;if(L||K)return}const q=(P=a.current.floatingContext)==null?void 0:P.nodeId,Q=m&&uo(m.nodesRef.current,q).some(ee=>{var J;return uf(B,(J=ee.context)==null?void 0:J.elements.floating)});if(uf(B,i.floating)||uf(B,i.domReference)||Q)return;const Z=m?uo(m.nodesRef.current,q):[];if(Z.length>0){let ee=!0;if(Z.forEach(J=>{var le;if((le=J.context)!=null&&le.open&&!J.context.dataRef.current.__outsidePressBubbles){ee=!1;return}}),!ee)return}r(!1,B,"outside-press")}),_=$r(B=>{var P;const k=()=>{var O;A(B),(O=Pi(B))==null||O.removeEventListener(u,k)};(P=Pi(B))==null||P.addEventListener(u,k)});ae.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=S;let B=-1;function P(W){r(!1,W,"ancestor-scroll")}function k(){window.clearTimeout(B),x.current=!0}function O(){B=window.setTimeout(()=>{x.current=!1},Lc()?5:0)}const M=hr(i.floating);s&&(M.addEventListener("keydown",w?I:g,w),M.addEventListener("compositionstart",k),M.addEventListener("compositionend",O)),f&&M.addEventListener(u,E?_:A,E);let G=[];return h&&(Et(i.domReference)&&(G=zi(i.domReference)),Et(i.floating)&&(G=G.concat(zi(i.floating))),!Et(i.reference)&&i.reference&&i.reference.contextElement&&(G=G.concat(zi(i.reference.contextElement)))),G=G.filter(W=>{var U;return W!==((U=M.defaultView)==null?void 0:U.visualViewport)}),G.forEach(W=>{W.addEventListener("scroll",P,{passive:!0})}),()=>{s&&(M.removeEventListener("keydown",w?I:g,w),M.removeEventListener("compositionstart",k),M.removeEventListener("compositionend",O)),f&&M.removeEventListener(u,E?_:A,E),G.forEach(W=>{W.removeEventListener("scroll",P)}),window.clearTimeout(B)}},[a,i,s,f,u,n,r,h,o,C,S,g,w,I,A,E,_]),ae.useEffect(()=>{a.current.insideReactTree=!1},[a,f,u]);const T=ae.useMemo(()=>({onKeyDown:g,...c&&{[_R[p]]:B=>{r(!1,B.nativeEvent,"reference-press")},...p!=="click"&&{onClick(B){r(!1,B.nativeEvent,"reference-press")}}}}),[g,r,c,p]),$=ae.useMemo(()=>({onKeyDown:g,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[DR[u]]:()=>{a.current.insideReactTree=!0}}),[g,u,a]);return ae.useMemo(()=>o?{reference:T,floating:$}:{},[o,T,$])}function AR(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=jc(),a=ae.useRef({}),[o]=ae.useState(()=>uR()),s=gC()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!Et(d)&&sR("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=ae.useState(r.reference),c=$r((d,v,m)=>{a.current.openEvent=d?v:void 0,o.emit("openchange",{open:d,event:v,reason:m,nested:s}),n==null||n(d,v,m)}),p=ae.useMemo(()=>({setPositionReference:u}),[]),h=ae.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return ae.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:h,events:o,floatingId:i,refs:p}),[t,c,h,o,i,p])}function RR(e){e===void 0&&(e={});const{nodeId:t}=e,n=AR({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=ae.useState(null),[s,l]=ae.useState(null),c=(i==null?void 0:i.domReference)||a,p=ae.useRef(null),h=og();xn(()=>{c&&(p.current=c)},[c]);const d=Y6({...e,elements:{...i,...s&&{reference:s}}}),v=ae.useCallback(C=>{const S=Et(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;l(S),d.refs.setReference(S)},[d.refs]),m=ae.useCallback(C=>{(Et(C)||C===null)&&(p.current=C,o(C)),(Et(d.refs.reference.current)||d.refs.reference.current===null||C!==null&&!Et(C))&&d.refs.setReference(C)},[d.refs]),b=ae.useMemo(()=>({...d.refs,setReference:m,setPositionReference:v,domReference:p}),[d.refs,m,v]),f=ae.useMemo(()=>({...d.elements,domReference:c}),[d.elements,c]),y=ae.useMemo(()=>({...d,...r,refs:b,elements:f,nodeId:t}),[d,b,f,t,r]);return xn(()=>{r.dataRef.current.floatingContext=y;const C=h==null?void 0:h.nodesRef.current.find(S=>S.id===t);C&&(C.context=y)}),ae.useMemo(()=>({...d,context:y,refs:b,elements:f}),[d,b,f,y])}function gf(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[s1]:o,[l1]:s,...l}=e;a=l}return{...n==="floating"&&{tabIndex:-1,[tR]:""},...a,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(i&&[s1,l1].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var p;(p=r.get(u))==null||p.push(c),o[u]=function(){for(var h,d=arguments.length,v=new Array(d),m=0;m<d;m++)v[m]=arguments[m];return(h=r.get(u))==null?void 0:h.map(b=>b(...v)).find(b=>b!==void 0)}}}else o[u]=c}),o),{})}}function BR(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),i=ae.useCallback(s=>gf(s,e,"reference"),t),a=ae.useCallback(s=>gf(s,e,"floating"),n),o=ae.useCallback(s=>gf(s,e,"item"),r);return ae.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}const kR=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PR(e,t){var n,r;t===void 0&&(t={});const{open:i,elements:a,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=jc(),c=((n=a.domReference)==null?void 0:n.id)||u,p=ae.useMemo(()=>{var y;return((y=Hh(a.floating))==null?void 0:y.id)||o},[a.floating,o]),h=(r=kR.get(l))!=null?r:l,v=gC()!=null,m=ae.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:i?p:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":i?p:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:c},...h==="menu"&&v&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,p,v,i,c,l]),b=ae.useMemo(()=>{const y={id:p,...h&&{role:h}};return h==="tooltip"||l==="label"?y:{...y,...h==="menu"&&{"aria-labelledby":c}}},[h,p,c,l]),f=ae.useCallback(y=>{let{active:C,selected:S}=y;const w={role:"option",...C&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":S}}return{}},[p,l]);return ae.useMemo(()=>s?{reference:m,floating:b,item:f}:{},[s,m,b,f])}const C1=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Ya(e,t){return typeof e=="function"?e(t):e}function $R(e,t){const[n,r]=ae.useState(e);return e&&!n&&r(!0),ae.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function FR(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=(typeof i=="number"?i:i.close)||0,[s,l]=ae.useState("unmounted"),u=$R(n,o);return!u&&s==="close"&&l("unmounted"),xn(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{M0.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:s}}function NR(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,l=s.split("-")[0],u=ae.useMemo(()=>({side:l,placement:s}),[l,s]),c=typeof o=="number",p=(c?o:o.open)||0,h=(c?o:o.close)||0,[d,v]=ae.useState(()=>({...Ya(a,u),...Ya(n,u)})),{isMounted:m,status:b}=FR(e,{duration:o}),f=ga(n),y=ga(r),C=ga(i),S=ga(a);return xn(()=>{const w=Ya(f.current,u),E=Ya(C.current,u),x=Ya(S.current,u),g=Ya(y.current,u)||Object.keys(w).reduce((I,A)=>(I[A]="",I),{});if(b==="initial"&&v(I=>({transitionProperty:I.transitionProperty,...x,...w})),b==="open"&&v({transitionProperty:Object.keys(g).map(C1).join(","),transitionDuration:p+"ms",...x,...g}),b==="close"){const I=E||w;v({transitionProperty:Object.keys(I).map(C1).join(","),transitionDuration:h+"ms",...x,...I})}},[h,C,f,y,S,p,b,u]),{isMounted:m,styles:d}}const MR="_popover_cskuc_1",OR={popover:MR},bi=N.forwardRef((e,t)=>{const{children:n,className:r,offset:i=10,isShow:a,anchorEl:o,useAutoPlacement:s=!1,flipOptions:l,autoPlacementOptions:u,zIndex:c=10,width:p,styleInnerPopover:h={},floatingOptions:d={},onClose:v=()=>{},withArrow:m,propsArrow:b={},...f}=e,y=N.useRef(null),[C,S]=N.useState(!1),{refs:w,floatingStyles:E,context:x}=RR({open:C,onOpenChange:O=>{S(O),O||v()},middleware:[Z6(i),s?Q6(u):q6(l),J6(),eR({element:y})],whileElementsMounted:fC,...d}),g=IR(x),I=TR(x),A=PR(x),{getReferenceProps:_,getFloatingProps:T}=BR([g,I,A]),{styles:$,isMounted:B}=NR(x),P=O=>{w.setReference(O.currentTarget),S(M=>!M),C&&v()};N.useEffect(()=>{a&&o?P({currentTarget:o}):a||S(!1)},[a,o]),N.useImperativeHandle(t,()=>({show:C,setShow:S,handlerShow:P,getReferenceProps:_}),[C]);const k=()=>{let O={...E,...$,...h,zIndex:c};return p&&(O={...O,width:p}),O};return F.jsx(F.Fragment,{children:B&&C&&F.jsx(bR,{children:F.jsx(SR,{context:x,modal:!1,children:F.jsxs("div",{ref:w.setFloating,style:k(),...T(),className:`${OR.popover} ${r??""}`,...f,children:[n,m&&F.jsx(lR,{ref:y,context:x,...b})]})})})})});bi.displayName="Popover";const LR="_input_juw80_271",VR="_label_juw80_271",HR="_error_juw80_307",En={"container-large":"_container-large_juw80_271","container-input":"_container-input_juw80_271",input:LR,label:VR,"container-medium":"_container-medium_juw80_271","container-small":"_container-small_juw80_271",error:HR,"label-error":"_label-error_juw80_307","isset-right-icon":"_isset-right-icon_juw80_396","isset-left-icon":"_isset-left-icon_juw80_400","start-icon":"_start-icon_juw80_417","end-icon":"_end-icon_juw80_425"},bC=N.forwardRef((e,t)=>{var C;const{isRequired:n,classNameContainer:r,classNameLabelError:i,classNameLabel:a,className:o,name:s,id:l,label:u,type:c="text",startIcon:p,endIcon:h,error:d,sizeInput:v="large",...m}=e,b={size:{large:En["container-large"],medium:En["container-medium"],small:En["container-small"]}},f=()=>typeof p=="function"||N.isValidElement(p),y=()=>typeof h=="function"||N.isValidElement(h);return F.jsxs("div",{className:`${En.container} ${(C=b.size)==null?void 0:C[v]} ${r??""}`,children:[F.jsxs("div",{className:En["container-input"],children:[F.jsx("input",{id:l??s,className:`${En.input} ${d?En.error:""}
39
- ${f()?En["isset-left-icon"]:""}
40
- ${y()?En["isset-right-icon"]:""}
41
- ${o??""}`,ref:t,type:c,...m}),F.jsxs("div",{className:En["start-icon"],children:[typeof p=="function"&&p(),N.isValidElement(p)&&p]}),F.jsxs("label",{className:`${En.label} ${a??""}`,htmlFor:l??s,children:[u," ",n&&F.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),F.jsxs("div",{className:En["end-icon"],children:[typeof h=="function"&&h(),N.isValidElement(h)&&h]})]}),d&&F.jsx("label",{className:`${En["label-error"]}
42
- ${m.disabled?En.disabled:""} ${i??""}`,children:d})]})});bC.displayName="InputFloatingInner";const jR="_input_xzyo2_61",zR="_label_xzyo2_67",GR="_disabled_xzyo2_324",WR="_error_xzyo2_375",Sn={"container-large":"_container-large_xzyo2_61","container-input":"_container-input_xzyo2_61",input:jR,label:zR,"label-error":"_label-error_xzyo2_109","container-medium":"_container-medium_xzyo2_109","container-small":"_container-small_xzyo2_133",disabled:GR,error:WR,"isset-right-icon":"_isset-right-icon_xzyo2_384","isset-left-icon":"_isset-left-icon_xzyo2_388","start-icon":"_start-icon_xzyo2_392","end-icon":"_end-icon_xzyo2_399"},lg=N.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,type:c="text",startIcon:p,endIcon:h,error:d,sizeInput:v="large",...m}=e,b={size:{large:Sn["container-large"],medium:Sn["container-medium"],small:Sn["container-small"]}},f=()=>typeof p=="function"||N.isValidElement(p),y=()=>typeof h=="function"||N.isValidElement(h);return F.jsxs("div",{className:`${b.size[v]} ${r??""}`,children:[u&&F.jsxs("label",{htmlFor:l??s,className:`${Sn.label} ${m.disabled?Sn.disabled:""} ${a??""}`,children:[u," ",n&&F.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),F.jsxs("div",{className:`${Sn["container-input"]}`,children:[F.jsxs("div",{className:Sn["start-icon"],children:[typeof p=="function"&&p(),N.isValidElement(p)&&p]}),F.jsx("input",{id:l??s,className:`${Sn.input} ${d?Sn.error:""}
38
+ */var VA=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],zu=VA.join(","),Yx=typeof Element>"u",Io=Yx?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gu=!Yx&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Wu=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=i===""||i==="true",o=a||n&&t&&e(t.parentNode);return o},HA=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Kx=function(t,n,r){if(Wu(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(zu));return n&&Io.call(t,zu)&&i.unshift(t),i=i.filter(r),i},Zx=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!Wu(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=e(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var c=Io.call(o,zu);c&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!Wu(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&h){var d=e(p===!0?o.children:p.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}return i},Jx=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qx=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||HA(t))&&!Jx(t)?0:t.tabIndex},jA=function(t,n){var r=qx(t);return r<0&&n&&!Jx(t)?0:r},zA=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qx=function(t){return t.tagName==="INPUT"},GA=function(t){return Qx(t)&&t.type==="hidden"},WA=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},UA=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},XA=function(t){if(!t.name)return!0;var n=t.form||Gu(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=UA(i,t.form);return!a||a===t},YA=function(t){return Qx(t)&&t.type==="radio"},KA=function(t){return YA(t)&&!XA(t)},ZA=function(t){var n,r=t&&Gu(t),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var o,s,l;for(a=!!((o=i)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!a&&i;){var u,c,p;r=Gu(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(i))}}return a},Zm=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},JA=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=Io.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(Io.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var l=t.parentElement,u=Gu(t);if(l&&!l.shadowRoot&&i(l)===!0)return Zm(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(ZA(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Zm(t);return!1},qA=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Io.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Oh=function(t,n){return!(n.disabled||Wu(n)||GA(n)||JA(n,t)||WA(n)||qA(n))},Lh=function(t,n){return!(KA(n)||qx(n)<0||!Oh(t,n))},QA=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},e6=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=jA(s,o),u=o?e(i.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:a,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(zA).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Hc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Zx([t],n.includeContainer,{filter:Lh.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:QA}):r=Kx(t,n.includeContainer,Lh.bind(null,n)),e6(r)},t6=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Zx([t],n.includeContainer,{filter:Oh.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Kx(t,n.includeContainer,Oh.bind(null,n)),r},eC=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Io.call(t,zu)===!1?!1:Lh(n,t)};function n6(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function tC(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function r6(){return/apple/i.test(navigator.vendor)}function Vh(){const e=/android/i;return e.test(n6())||e.test(tC())}function i6(){return tC().includes("jsdom/")}const Jm="data-floating-ui-focusable",a6="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ro(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Fn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Fh(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Pi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function uf(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function o6(e){return e.matches("html,body")}function hr(e){return(e==null?void 0:e.ownerDocument)||document}function nC(e){return Nt(e)&&e.matches(a6)}function qm(e){return e?e.getAttribute("role")==="combobox"&&nC(e):!1}function Hh(e){return e?e.hasAttribute(Jm)?e:e.querySelector("["+Jm+"]")||e:null}function uo(e,t,n){return n===void 0&&(n=!0),e.filter(i=>{var a;return i.parentId===t&&(!n||((a=i.context)==null?void 0:a.open))}).flatMap(i=>[i,...uo(e,i.id,n)])}function Qm(e,t){var n;let r=[],i=(n=e.find(a=>a.id===t))==null?void 0:n.parentId;for(;i;){const a=e.find(o=>o.id===i);i=a==null?void 0:a.parentId,a&&(r=r.concat(a))}return r}function cf(e){e.preventDefault(),e.stopPropagation()}function s6(e){return"nativeEvent"in e}function l6(e){return e.mozInputSource===0&&e.isTrusted?!0:Vh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function u6(e){return i6()?!1:!Vh()&&e.width===0&&e.height===0||Vh()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function e1(e,t){return["mouse","pen"].includes(e)}var c6=typeof document<"u",d6=function(){},Cn=c6?N.useLayoutEffect:d6;const f6={...ae};function ga(e){const t=ae.useRef(e);return Cn(()=>{t.current=e}),t}const h6=f6.useInsertionEffect,g6=h6||(e=>e());function $r(e){const t=ae.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return g6(()=>{t.current=e}),ae.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const ul=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rC(e,t){const n=Hc(e,ul()),r=n.length;if(r===0)return;const i=ro(hr(e)),a=n.indexOf(i),o=a===-1?t===1?0:r-1:a+t;return n[o]}function iC(e){return rC(hr(e).body,1)||e}function aC(e){return rC(hr(e).body,-1)||e}function gs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Fn(n,r)}function p6(e){Hc(e,ul()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function t1(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function n1(e,t,n){let{reference:r,floating:i}=e;const a=Ni(t),o=ng(t),s=tg(o),l=pi(t),u=a==="y",c=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let d;switch(l){case"top":d={x:c,y:r.y-i.height};break;case"bottom":d={x:c,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:p};break;case"left":d={x:r.x-i.width,y:p};break;default:d={x:r.x,y:r.y}}switch(Or(t)){case"start":d[o]-=h*(n&&u?-1:1);break;case"end":d[o]+=h*(n&&u?-1:1);break}return d}const m6=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:p}=n1(u,r,l),h=r,d={},v=0;for(let m=0;m<s.length;m++){const{name:b,fn:f}=s[m],{x:y,y:C,data:S,reset:w}=await f({x:c,y:p,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:o,elements:{reference:e,floating:t}});c=y??c,p=C??p,d={...d,[b]:{...d[b],...S}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(u=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:c,y:p}=n1(u,h,l)),m=-1)}return{x:c,y:p,placement:h,strategy:i,middlewareData:d}};async function rg(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:h=!1,padding:d=0}=Lo(t,e),v=Xx(d),b=s[h?p==="floating"?"reference":"floating":p],f=ju(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y=p==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},w=ju(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:C,strategy:l}):y);return{top:(f.top-w.top+v.top)/S.y,bottom:(w.bottom-f.bottom+v.bottom)/S.y,left:(f.left-w.left+v.left)/S.x,right:(w.right-f.right+v.right)/S.x}}const v6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=Lo(e,t)||{};if(u==null)return{};const p=Xx(c),h={x:n,y:r},d=ng(i),v=tg(d),m=await o.getDimensions(u),b=d==="y",f=b?"top":"left",y=b?"bottom":"right",C=b?"clientHeight":"clientWidth",S=a.reference[v]+a.reference[d]-h[d]-a.floating[v],w=h[d]-a.reference[d],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let x=E?E[C]:0;(!x||!await(o.isElement==null?void 0:o.isElement(E)))&&(x=s.floating[C]||a.floating[v]);const g=S/2-w/2,I=x/2-m[v]/2-1,A=wo(p[f],I),_=wo(p[y],I),T=A,$=x-m[v]-_,B=x/2-m[v]/2+g,P=Mh(T,B,$),k=!l.arrow&&Or(i)!=null&&B!==P&&a.reference[v]/2-(B<T?A:_)-m[v]/2<0,O=k?B<T?B-T:B-$:0;return{[d]:h[d]+O,data:{[d]:P,centerOffset:B-P-O,...k&&{alignmentOffset:O}},reset:k}}});function b6(e,t,n){return(e?[...n.filter(i=>Or(i)===e),...n.filter(i=>Or(i)!==e)]:n.filter(i=>pi(i)===i)).filter(i=>e?Or(i)===e||(t?Vu(i)!==i:!1):!0)}const y6=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:a,middlewareData:o,placement:s,platform:l,elements:u}=t,{crossAxis:c=!1,alignment:p,allowedPlacements:h=Xm,autoAlignment:d=!0,...v}=Lo(e,t),m=p!==void 0||h===Xm?b6(p||null,d,h):h,b=await rg(t,v),f=((n=o.autoPlacement)==null?void 0:n.index)||0,y=m[f];if(y==null)return{};const C=Ux(y,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==y)return{reset:{placement:m[0]}};const S=[b[pi(y)],b[C[0]],b[C[1]]],w=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:y,overflows:S}],E=m[f+1];if(E)return{data:{index:f+1,overflows:w},reset:{placement:E}};const x=w.map(A=>{const _=Or(A.placement);return[A.placement,_&&c?A.overflows.slice(0,2).reduce((T,$)=>T+$,0):A.overflows[0],A.overflows]}).sort((A,_)=>A[1]-_[1]),I=((i=x.filter(A=>A[2].slice(0,Or(A[0])?2:3).every(_=>_<=0))[0])==null?void 0:i[0])||x[0][0];return I!==s?{data:{index:f+1,overflows:w},reset:{placement:I}}:{}}}},x6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=Lo(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const f=pi(i),y=Ni(s),C=pi(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=h||(C||!m?[Hu(s)]:$A(s)),E=v!=="none";!h&&E&&w.push(...OA(s,m,v,S));const x=[s,...w],g=await rg(t,b),I=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&I.push(g[f]),p){const B=Ux(i,o,S);I.push(g[B[0]],g[B[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(B=>B<=0)){var _,T;const B=(((_=a.flip)==null?void 0:_.index)||0)+1,P=x[B];if(P&&(!(p==="alignment"?y!==Ni(P):!1)||A.every(M=>Ni(M.placement)===y?M.overflows[0]>0:!0)))return{data:{index:B,overflows:A},reset:{placement:P}};let k=(T=A.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:T.placement;if(!k)switch(d){case"bestFit":{var $;const O=($=A.filter(M=>{if(E){const G=Ni(M.placement);return G===y||G==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(G=>G>0).reduce((G,W)=>G+W,0)]).sort((M,G)=>M[1]-G[1])[0])==null?void 0:$[0];O&&(k=O);break}case"initialPlacement":k=s;break}if(i!==k)return{reset:{placement:k}}}return{}}}},C6=new Set(["left","top"]);async function E6(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=pi(n),s=Or(n),l=Ni(n)==="y",u=C6.has(o)?-1:1,c=a&&l?-1:1,p=Lo(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof v=="number"&&(d=s==="end"?v*-1:v),l?{x:d*c,y:h*u}:{x:h*u,y:d*c}}const S6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await E6(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},w6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:b=>{let{x:f,y}=b;return{x:f,y}}},...l}=Lo(e,t),u={x:n,y:r},c=await rg(t,l),p=Ni(pi(i)),h=Wx(p);let d=u[h],v=u[p];if(a){const b=h==="y"?"top":"left",f=h==="y"?"bottom":"right",y=d+c[b],C=d-c[f];d=Mh(y,d,C)}if(o){const b=p==="y"?"top":"left",f=p==="y"?"bottom":"right",y=v+c[b],C=v-c[f];v=Mh(y,v,C)}const m=s.fn({...t,[h]:d,[p]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:o}}}}}};function oC(e){const t=jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Nt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Lu(n)!==a||Lu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ig(e){return Et(e)?e:e.contextElement}function co(e){const t=ig(e);if(!Nt(t))return Mr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=oC(t);let o=(a?Lu(n.width):n.width)/r,s=(a?Lu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const I6=Mr(0);function sC(e){const t=On(e);return!Lc()||!t.visualViewport?I6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==On(e)?!1:t}function Da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=ig(e);let o=Mr(1);t&&(r?Et(r)&&(o=co(r)):o=co(e));const s=_6(a,n,r)?sC(a):Mr(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,p=i.height/o.y;if(a){const h=On(a),d=r&&Et(r)?On(r):r;let v=h,m=Nh(v);for(;m&&r&&d!==v;){const b=co(m),f=m.getBoundingClientRect(),y=jn(m),C=f.left+(m.clientLeft+parseFloat(y.paddingLeft))*b.x,S=f.top+(m.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,p*=b.y,l+=C,u+=S,v=On(m),m=Nh(v)}}return ju({width:c,height:p,x:l,y:u})}function ag(e,t){const n=Vc(e).scrollLeft;return t?t.left+n:Da(Ur(e)).left+n}function lC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:ag(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function D6(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Ur(r),s=t?Oc(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Mr(1);const c=Mr(0),p=Nt(r);if((p||!p&&!a)&&((Zi(r)!=="body"||ll(o))&&(l=Vc(r)),Nt(r))){const d=Da(r);u=co(r),c.x=d.x+r.clientLeft,c.y=d.y+r.clientTop}const h=o&&!p&&!a?lC(o,l,!0):Mr(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:n.y*u.y-l.scrollTop*u.y+c.y+h.y}}function T6(e){return Array.from(e.getClientRects())}function A6(e){const t=Ur(e),n=Vc(e),r=e.ownerDocument.body,i=ya(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ya(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ag(e);const s=-n.scrollTop;return jn(r).direction==="rtl"&&(o+=ya(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function R6(e,t){const n=On(e),r=Ur(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=Lc();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}const B6=new Set(["absolute","fixed"]);function k6(e,t){const n=Da(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Nt(e)?co(e):Mr(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function r1(e,t,n){let r;if(t==="viewport")r=R6(e,n);else if(t==="document")r=A6(Ur(e));else if(Et(t))r=k6(t,n);else{const i=sC(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ju(r)}function uC(e,t){const n=gi(e);return n===t||!Et(n)||di(n)?!1:jn(n).position==="fixed"||uC(n,t)}function P6(e,t){const n=t.get(e);if(n)return n;let r=zi(e,[],!1).filter(s=>Et(s)&&Zi(s)!=="body"),i=null;const a=jn(e).position==="fixed";let o=a?gi(e):e;for(;Et(o)&&!di(o);){const s=jn(o),l=eg(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&B6.has(i.position)||ll(o)&&!l&&uC(e,o))?r=r.filter(c=>c!==o):i=s,o=gi(o)}return t.set(e,r),r}function $6(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Oc(t)?[]:P6(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const p=r1(t,c,i);return u.top=ya(p.top,u.top),u.right=wo(p.right,u.right),u.bottom=wo(p.bottom,u.bottom),u.left=ya(p.left,u.left),u},r1(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function F6(e){const{width:t,height:n}=oC(e);return{width:t,height:n}}function N6(e,t,n){const r=Nt(t),i=Ur(t),a=n==="fixed",o=Da(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mr(0);function u(){l.x=ag(i)}if(r||!r&&!a)if((Zi(t)!=="body"||ll(i))&&(s=Vc(t)),r){const d=Da(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();a&&!r&&i&&u();const c=i&&!r&&!a?lC(i,s):Mr(0),p=o.left+s.scrollLeft-l.x-c.x,h=o.top+s.scrollTop-l.y-c.y;return{x:p,y:h,width:o.width,height:o.height}}function df(e){return jn(e).position==="static"}function i1(e,t){if(!Nt(e)||jn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ur(e)===n&&(n=n.ownerDocument.body),n}function cC(e,t){const n=On(e);if(Oc(e))return n;if(!Nt(e)){let i=gi(e);for(;i&&!di(i);){if(Et(i)&&!df(i))return i;i=gi(i)}return n}let r=i1(e,t);for(;r&&SA(r)&&df(r);)r=i1(r,t);return r&&di(r)&&df(r)&&!eg(r)?n:r||TA(e)||n}const M6=async function(e){const t=this.getOffsetParent||cC,n=this.getDimensions,r=await n(e.floating);return{reference:N6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function O6(e){return jn(e).direction==="rtl"}const L6={convertOffsetParentRelativeRectToViewportRelativeRect:D6,getDocumentElement:Ur,getClippingRect:$6,getOffsetParent:cC,getElementRects:M6,getClientRects:T6,getDimensions:F6,getScale:co,isElement:Et,isRTL:O6};function dC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function V6(e,t){let n=null,r;const i=Ur(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=e.getBoundingClientRect(),{left:c,top:p,width:h,height:d}=u;if(s||t(),!h||!d)return;const v=$l(p),m=$l(i.clientWidth-(c+h)),b=$l(i.clientHeight-(p+d)),f=$l(c),C={rootMargin:-v+"px "+-m+"px "+-b+"px "+-f+"px",threshold:ya(0,wo(1,l))||1};let S=!0;function w(E){const x=E[0].intersectionRatio;if(x!==l){if(!S)return o();x?o(!1,x):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x===1&&!dC(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(w,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,C)}n.observe(e)}return o(!0),a}function fC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ig(e),c=i||a?[...u?zi(u):[],...zi(t)]:[];c.forEach(f=>{i&&f.addEventListener("scroll",n,{passive:!0}),a&&f.addEventListener("resize",n)});const p=u&&s?V6(u,n):null;let h=-1,d=null;o&&(d=new ResizeObserver(f=>{let[y]=f;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let v,m=l?Da(e):null;l&&b();function b(){const f=Da(e);m&&!dC(m,f)&&n(),m=f,v=requestAnimationFrame(b)}return n(),()=>{var f;c.forEach(y=>{i&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),p==null||p(),(f=d)==null||f.disconnect(),d=null,l&&cancelAnimationFrame(v)}}const H6=S6,j6=y6,z6=w6,G6=x6,a1=v6,W6=(e,t,n)=>{const r=new Map,i={platform:L6,...n},a={...i.platform,_c:r};return m6(e,t,{...i,platform:a})};var U6=typeof document<"u",X6=function(){},vu=U6?N.useLayoutEffect:X6;function Uu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Uu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Uu(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function hC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o1(e,t){const n=hC(e);return Math.round(t*n)/n}function ff(e){const t=ae.useRef(e);return vu(()=>{t.current=e}),t}function Y6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,p]=ae.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=ae.useState(r);Uu(h,r)||d(r);const[v,m]=ae.useState(null),[b,f]=ae.useState(null),y=ae.useCallback(M=>{M!==E.current&&(E.current=M,m(M))},[]),C=ae.useCallback(M=>{M!==x.current&&(x.current=M,f(M))},[]),S=a||v,w=o||b,E=ae.useRef(null),x=ae.useRef(null),g=ae.useRef(c),I=l!=null,A=ff(l),_=ff(i),T=ff(u),$=ae.useCallback(()=>{if(!E.current||!x.current)return;const M={placement:t,strategy:n,middleware:h};_.current&&(M.platform=_.current),W6(E.current,x.current,M).then(G=>{const W={...G,isPositioned:T.current!==!1};B.current&&!Uu(g.current,W)&&(g.current=W,M0.flushSync(()=>{p(W)}))})},[h,t,n,_,T]);vu(()=>{u===!1&&g.current.isPositioned&&(g.current.isPositioned=!1,p(M=>({...M,isPositioned:!1})))},[u]);const B=ae.useRef(!1);vu(()=>(B.current=!0,()=>{B.current=!1}),[]),vu(()=>{if(S&&(E.current=S),w&&(x.current=w),S&&w){if(A.current)return A.current(S,w,$);$()}},[S,w,$,A,I]);const P=ae.useMemo(()=>({reference:E,floating:x,setReference:y,setFloating:C}),[y,C]),k=ae.useMemo(()=>({reference:S,floating:w}),[S,w]),O=ae.useMemo(()=>{const M={position:n,left:0,top:0};if(!k.floating)return M;const G=o1(k.floating,c.x),W=o1(k.floating,c.y);return s?{...M,transform:"translate("+G+"px, "+W+"px)",...hC(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:W}},[n,s,k.floating,c.x,c.y]);return ae.useMemo(()=>({...c,update:$,refs:P,elements:k,floatingStyles:O}),[c,$,P,k,O])}const K6=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?a1({element:r.current,padding:i}).fn(n):{}:r?a1({element:r,padding:i}).fn(n):{}}}},Z6=(e,t)=>({...H6(e),options:[e,t]}),J6=(e,t)=>({...z6(e),options:[e,t]}),q6=(e,t)=>({...G6(e),options:[e,t]}),Q6=(e,t)=>({...j6(e),options:[e,t]}),eR=(e,t)=>({...K6(e),options:[e,t]}),tR="data-floating-ui-focusable",s1="active",l1="selected",nR={...ae};let u1=!1,rR=0;const c1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rR++;function iR(){const[e,t]=ae.useState(()=>u1?c1():void 0);return Cn(()=>{e==null&&t(c1())},[]),ae.useEffect(()=>{u1=!0},[]),e}const aR=nR.useId,jc=aR||iR;let _s;process.env.NODE_ENV!=="production"&&(_s=new Set);function oR(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=_s)!=null&&e.has(i))){var a;(a=_s)==null||a.add(i),console.warn(i)}}function sR(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=_s)!=null&&e.has(i))){var a;(a=_s)==null||a.add(i),console.error(i)}}const lR=ae.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:i},middlewareData:{arrow:a,shift:o}},width:s=14,height:l=7,tipRadius:u=0,strokeWidth:c=0,staticOffset:p,stroke:h,d,style:{transform:v,...m}={},...b}=t;process.env.NODE_ENV!=="production"&&(n||oR("The `ref` prop is required for `FloatingArrow`."));const f=jc(),[y,C]=ae.useState(!1);if(Cn(()=>{if(!i)return;jn(i).direction==="rtl"&&C(!0)},[i]),!i)return null;const[S,w]=r.split("-"),E=S==="top"||S==="bottom";let x=p;(E&&o!=null&&o.x||!E&&o!=null&&o.y)&&(x=null);const g=c*2,I=g/2,A=s/2*(u/-8+1),_=l/2*u/4,T=!!d,$=x&&w==="end"?"bottom":"top";let B=x&&w==="end"?"right":"left";x&&y&&(B=w==="end"?"left":"right");const P=(a==null?void 0:a.x)!=null?x||a.x:"",k=(a==null?void 0:a.y)!=null?x||a.y:"",O=d||"M0,0"+(" H"+s)+(" L"+(s-A)+","+(l-_))+(" Q"+s/2+","+l+" "+A+","+(l-_))+" Z",M={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[S];return F.jsxs("svg",{...b,"aria-hidden":!0,ref:n,width:T?s:s+g,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[B]:P,[$]:k,[S]:E||T?"100%":"calc(100% - "+g/2+"px)",transform:[M,v].filter(G=>!!G).join(" "),...m},children:[g>0&&F.jsx("path",{clipPath:"url(#"+f+")",fill:"none",stroke:h,strokeWidth:g+(d?0:1),d:O}),F.jsx("path",{stroke:g&&!d?b.fill:"none",d:O}),F.jsx("clipPath",{id:f,children:F.jsx("rect",{x:-I,y:I*(T?-1:1),width:s+g,height:s})})]})});function uR(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const cR=ae.createContext(null),dR=ae.createContext(null),gC=()=>{var e;return((e=ae.useContext(cR))==null?void 0:e.id)||null},og=()=>ae.useContext(dR);function Ds(e){return"data-floating-ui-"+e}function fR(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let d1=0;function Xa(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(d1);const a=()=>e==null?void 0:e.focus({preventScroll:n});i?a():d1=requestAnimationFrame(a)}function hR(e){return(e==null?void 0:e.ownerDocument)||document}const fo={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function f1(e){return e==="inert"?fo.inert:e==="aria-hidden"?fo["aria-hidden"]:fo.none}let Fl=new WeakSet,Nl={},hf=0;const gR=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,pC=e=>e&&(e.host||pC(e.parentNode)),pR=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=pC(n);return e.contains(r)?r:null}).filter(n=>n!=null);function mR(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=pR(t,e),s=new Set,l=new Set(o),u=[];Nl[i]||(Nl[i]=new WeakMap);const c=Nl[i];o.forEach(p),h(t),s.clear();function p(d){!d||s.has(d)||(s.add(d),d.parentNode&&p(d.parentNode))}function h(d){!d||l.has(d)||[].forEach.call(d.children,v=>{if(Zi(v)!=="script")if(s.has(v))h(v);else{const m=a?v.getAttribute(a):null,b=m!==null&&m!=="false",f=f1(a),y=(f.get(v)||0)+1,C=(c.get(v)||0)+1;f.set(v,y),c.set(v,C),u.push(v),y===1&&b&&Fl.add(v),C===1&&v.setAttribute(i,""),!b&&a&&v.setAttribute(a,a==="inert"?"":"true")}})}return hf++,()=>{u.forEach(d=>{const v=f1(a),b=(v.get(d)||0)-1,f=(c.get(d)||0)-1;v.set(d,b),c.set(d,f),b||(!Fl.has(d)&&a&&d.removeAttribute(a),Fl.delete(d)),f||d.removeAttribute(i)}),hf--,hf||(fo.inert=new WeakMap,fo["aria-hidden"]=new WeakMap,fo.none=new WeakMap,Fl=new WeakSet,Nl={})}}function h1(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=hR(e[0]).body;return mR(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const zc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Xu=ae.forwardRef(function(t,n){const[r,i]=ae.useState();Cn(()=>{r6()&&i("button")},[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ds("focus-guard")]:"",style:zc};return F.jsx("span",{...t,...a})}),mC=ae.createContext(null),g1=Ds("portal");function vR(e){e===void 0&&(e={});const{id:t,root:n}=e,r=jc(),i=vC(),[a,o]=ae.useState(null),s=ae.useRef(null);return Cn(()=>()=>{a==null||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),Cn(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(g1,""),l.appendChild(u),s.current=u,o(u)},[t,r]),Cn(()=>{if(n===null||!r||s.current)return;let l=n||(i==null?void 0:i.portalNode);l&&!Q0(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=r,c.setAttribute(g1,""),l=u||l,l.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function bR(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=vR({id:n,root:r}),[o,s]=ae.useState(null),l=ae.useRef(null),u=ae.useRef(null),c=ae.useRef(null),p=ae.useRef(null),h=o==null?void 0:o.modal,d=o==null?void 0:o.open,v=!!o&&!o.modal&&o.open&&i&&!!(r||a);return ae.useEffect(()=>{if(!a||!i||h)return;function m(b){a&&gs(b)&&(b.type==="focusin"?t1:p6)(a)}return a.addEventListener("focusin",m,!0),a.addEventListener("focusout",m,!0),()=>{a.removeEventListener("focusin",m,!0),a.removeEventListener("focusout",m,!0)}},[a,i,h]),ae.useEffect(()=>{a&&(d||t1(a))},[d,a]),F.jsxs(mC.Provider,{value:ae.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:p,portalNode:a,setFocusManagerState:s}),[i,a]),children:[v&&a&&F.jsx(Xu,{"data-type":"outside",ref:l,onFocus:m=>{if(gs(m,a)){var b;(b=c.current)==null||b.focus()}else{const f=o?o.domReference:null,y=aC(f);y==null||y.focus()}}}),v&&a&&F.jsx("span",{"aria-owns":a.id,style:zc}),a&&M0.createPortal(t,a),v&&a&&F.jsx(Xu,{"data-type":"outside",ref:u,onFocus:m=>{if(gs(m,a)){var b;(b=p.current)==null||b.focus()}else{const f=o?o.domReference:null,y=iC(f);y==null||y.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const vC=()=>ae.useContext(mC);function p1(e){return ae.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const yR=20;let Mi=[];function sg(){Mi=Mi.filter(e=>e.isConnected)}function xR(e){sg(),e&&Zi(e)!=="body"&&(Mi.push(e),Mi.length>yR&&(Mi=Mi.slice(-20)))}function m1(){return sg(),Mi[Mi.length-1]}function CR(e){const t=ul();return eC(e,t)?e:Hc(e,t)[0]||e}function v1(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=ul(),a=t6(e,r).filter(s=>{const l=s.getAttribute("data-tabindex")||"";return eC(s,r)||s.hasAttribute("data-tabindex")&&!l.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||a.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const ER=ae.forwardRef(function(t,n){return F.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:zc})});function SR(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:p=!0,outsideElementsInert:h=!1,getInsideElements:d=()=>[]}=e,{open:v,onOpenChange:m,events:b,dataRef:f,elements:{domReference:y,floating:C}}=t,S=$r(()=>{var D;return(D=f.current.floatingContext)==null?void 0:D.nodeId}),w=$r(d),E=typeof o=="number"&&o<0,x=qm(y)&&E,g=gR(),I=g?a:!0,A=!I||g&&h,_=ga(i),T=ga(o),$=ga(s),B=og(),P=vC(),k=ae.useRef(null),O=ae.useRef(null),M=ae.useRef(!1),G=ae.useRef(!1),W=ae.useRef(-1),U=ae.useRef(-1),q=P!=null,Q=Hh(C),Z=$r(function(D){return D===void 0&&(D=Q),D?Hc(D,ul()):[]}),ee=$r(D=>{const L=Z(D);return _.current.map(K=>y&&K==="reference"?y:Q&&K==="floating"?Q:L).filter(Boolean).flat()});ae.useEffect(()=>{if(r||!u)return;function D(K){if(K.key==="Tab"){Fn(Q,ro(hr(Q)))&&Z().length===0&&!x&&cf(K);const X=ee(),se=Pi(K);_.current[0]==="reference"&&se===y&&(cf(K),K.shiftKey?Xa(X[X.length-1]):Xa(X[1])),_.current[1]==="floating"&&se===Q&&K.shiftKey&&(cf(K),Xa(X[0]))}}const L=hr(Q);return L.addEventListener("keydown",D),()=>{L.removeEventListener("keydown",D)}},[r,y,Q,u,_,x,Z,ee]),ae.useEffect(()=>{if(r||!C)return;function D(L){const K=Pi(L),se=Z().indexOf(K);se!==-1&&(W.current=se)}return C.addEventListener("focusin",D),()=>{C.removeEventListener("focusin",D)}},[r,C,Z]),ae.useEffect(()=>{if(r||!p)return;function D(){G.current=!0,setTimeout(()=>{G.current=!1})}function L(se){const ie=se.relatedTarget,oe=se.currentTarget,te=Pi(se);queueMicrotask(()=>{const ue=S(),ve=!(Fn(y,ie)||Fn(C,ie)||Fn(ie,C)||Fn(P==null?void 0:P.portalNode,ie)||ie!=null&&ie.hasAttribute(Ds("focus-guard"))||B&&(uo(B.nodesRef.current,ue).find(be=>{var pe,Te;return Fn((pe=be.context)==null?void 0:pe.elements.floating,ie)||Fn((Te=be.context)==null?void 0:Te.elements.domReference,ie)})||Qm(B.nodesRef.current,ue).find(be=>{var pe,Te,Ne;return[(pe=be.context)==null?void 0:pe.elements.floating,Hh((Te=be.context)==null?void 0:Te.elements.floating)].includes(ie)||((Ne=be.context)==null?void 0:Ne.elements.domReference)===ie})));if(oe===y&&Q&&v1(Q,_),l&&oe!==y&&!(te!=null&&te.isConnected)&&ro(hr(Q))===hr(Q).body){Nt(Q)&&Q.focus();const be=W.current,pe=Z(),Te=pe[be]||pe[pe.length-1]||Q;Nt(Te)&&Te.focus()}if(f.current.insideReactTree){f.current.insideReactTree=!1;return}(x||!u)&&ie&&ve&&!G.current&&ie!==m1()&&(M.current=!0,m(!1,se,"focus-out"))})}const K=!!(!B&&P);function X(){fR(U),f.current.insideReactTree=!0,U.current=window.setTimeout(()=>{f.current.insideReactTree=!1})}if(C&&Nt(y))return y.addEventListener("focusout",L),y.addEventListener("pointerdown",D),C.addEventListener("focusout",L),K&&C.addEventListener("focusout",X,!0),()=>{y.removeEventListener("focusout",L),y.removeEventListener("pointerdown",D),C.removeEventListener("focusout",L),K&&C.removeEventListener("focusout",X,!0)}},[r,y,C,Q,u,B,P,m,p,l,Z,x,S,_,f]);const J=ae.useRef(null),le=ae.useRef(null),re=p1([J,P==null?void 0:P.beforeInsideRef]),R=p1([le,P==null?void 0:P.afterInsideRef]);ae.useEffect(()=>{var D,L;if(r||!C)return;const K=Array.from((P==null||(D=P.portalNode)==null?void 0:D.querySelectorAll("["+Ds("portal")+"]"))||[]),se=(L=(B?Qm(B.nodesRef.current,S()):[]).find(te=>{var ue;return qm(((ue=te.context)==null?void 0:ue.elements.domReference)||null)}))==null||(L=L.context)==null?void 0:L.elements.domReference,ie=[C,se,...K,...w(),k.current,O.current,J.current,le.current,P==null?void 0:P.beforeOutsideRef.current,P==null?void 0:P.afterOutsideRef.current,_.current.includes("reference")||x?y:null].filter(te=>te!=null),oe=u||x?h1(ie,!A,A):h1(ie);return()=>{oe()}},[r,y,C,u,_,P,x,I,A,B,S,w]),Cn(()=>{if(r||!Nt(Q))return;const D=hr(Q),L=ro(D);queueMicrotask(()=>{const K=ee(Q),X=T.current,se=(typeof X=="number"?K[X]:X.current)||Q,ie=Fn(Q,L);!E&&!ie&&v&&Xa(se,{preventScroll:se===Q})})},[r,v,Q,E,ee,T]),Cn(()=>{if(r||!Q)return;const D=hr(Q),L=ro(D);xR(L);function K(ie){let{reason:oe,event:te,nested:ue}=ie;if(["hover","safe-polygon"].includes(oe)&&te.type==="mouseleave"&&(M.current=!0),oe==="outside-press")if(ue)M.current=!1;else if(l6(te)||u6(te))M.current=!1;else{let ve=!1;document.createElement("div").focus({get preventScroll(){return ve=!0,!1}}),ve?M.current=!1:M.current=!0}}b.on("openchange",K);const X=D.createElement("span");X.setAttribute("tabindex","-1"),X.setAttribute("aria-hidden","true"),Object.assign(X.style,zc),q&&y&&y.insertAdjacentElement("afterend",X);function se(){if(typeof $.current=="boolean"){const ie=y||m1();return ie&&ie.isConnected?ie:X}return $.current.current||X}return()=>{b.off("openchange",K);const ie=ro(D),oe=Fn(C,ie)||B&&uo(B.nodesRef.current,S(),!1).some(ue=>{var ve;return Fn((ve=ue.context)==null?void 0:ve.elements.floating,ie)}),te=se();queueMicrotask(()=>{const ue=CR(te);$.current&&!M.current&&Nt(ue)&&(!(ue!==ie&&ie!==D.body)||oe)&&ue.focus({preventScroll:!0}),X.remove()})}},[r,C,Q,$,f,b,B,q,y,S]),ae.useEffect(()=>(queueMicrotask(()=>{M.current=!1}),()=>{queueMicrotask(sg)}),[r]),Cn(()=>{if(!r&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:p,open:v,onOpenChange:m,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,u,v,m,p,y]),Cn(()=>{r||Q&&v1(Q,_)},[r,Q,_]);function H(D){return r||!c||!u?null:F.jsx(ER,{ref:D==="start"?k:O,onClick:L=>m(!1,L.nativeEvent),children:typeof c=="string"?c:"Dismiss"})}const V=!r&&I&&(u?!x:!0)&&(q||u);return F.jsxs(F.Fragment,{children:[V&&F.jsx(Xu,{"data-type":"inside",ref:re,onFocus:D=>{if(u){const K=ee();Xa(i[0]==="reference"?K[0]:K[K.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(M.current=!1,gs(D,P.portalNode)){const K=iC(y);K==null||K.focus()}else{var L;(L=P.beforeOutsideRef.current)==null||L.focus()}}}),!x&&H("start"),n,H("end"),V&&F.jsx(Xu,{"data-type":"inside",ref:R,onFocus:D=>{if(u)Xa(ee()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(p&&(M.current=!0),gs(D,P.portalNode)){const K=aC(y);K==null||K.focus()}else{var L;(L=P.afterOutsideRef.current)==null||L.focus()}}})]})}function b1(e){return Nt(e.target)&&e.target.tagName==="BUTTON"}function wR(e){return Nt(e.target)&&e.target.tagName==="A"}function y1(e){return nC(e)}function IR(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0,stickIfOpen:p=!0}=t,h=ae.useRef(),d=ae.useRef(!1),v=ae.useMemo(()=>({onPointerDown(m){h.current=m.pointerType},onMouseDown(m){const b=h.current;m.button===0&&s!=="click"&&(e1(b)&&u||(n&&l&&(!(i.current.openEvent&&p)||i.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const b=h.current;if(s==="mousedown"&&h.current){h.current=void 0;return}e1(b)&&u||(n&&l&&(!(i.current.openEvent&&p)||i.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){h.current=void 0,!(m.defaultPrevented||!c||b1(m))&&(m.key===" "&&!y1(a)&&(m.preventDefault(),d.current=!0),!wR(m)&&m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!c||b1(m)||y1(a)||m.key===" "&&d.current&&(d.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[i,a,s,u,c,r,n,p,l]);return ae.useMemo(()=>o?{reference:v}:{},[o,v])}const _R={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},DR={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},x1=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function TR(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:v}=t,m=og(),b=$r(typeof l=="function"?l:()=>!1),f=typeof l=="function"?b:l,y=ae.useRef(!1),{escapeKey:C,outsidePress:S}=x1(d),{escapeKey:w,outsidePress:E}=x1(v),x=ae.useRef(!1),g=$r(B=>{var P;if(!n||!o||!s||B.key!=="Escape"||x.current)return;const k=(P=a.current.floatingContext)==null?void 0:P.nodeId,O=m?uo(m.nodesRef.current,k):[];if(!C&&(B.stopPropagation(),O.length>0)){let M=!0;if(O.forEach(G=>{var W;if((W=G.context)!=null&&W.open&&!G.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,s6(B)?B.nativeEvent:B,"escape-key")}),I=$r(B=>{var P;const k=()=>{var O;g(B),(O=Pi(B))==null||O.removeEventListener("keydown",k)};(P=Pi(B))==null||P.addEventListener("keydown",k)}),A=$r(B=>{var P;const k=a.current.insideReactTree;a.current.insideReactTree=!1;const O=y.current;if(y.current=!1,u==="click"&&O||k||typeof f=="function"&&!f(B))return;const M=Pi(B),G="["+Ds("inert")+"]",W=hr(i.floating).querySelectorAll(G);let U=Et(M)?M:null;for(;U&&!di(U);){const ee=gi(U);if(di(ee)||!Et(ee))break;U=ee}if(W.length&&Et(M)&&!o6(M)&&!Fn(M,i.floating)&&Array.from(W).every(ee=>!Fn(U,ee)))return;if(Nt(M)&&$){const ee=di(M),J=jn(M),le=/auto|scroll/,re=ee||le.test(J.overflowX),R=ee||le.test(J.overflowY),H=re&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,V=R&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,D=J.direction==="rtl",L=V&&(D?B.offsetX<=M.offsetWidth-M.clientWidth:B.offsetX>M.clientWidth),K=H&&B.offsetY>M.clientHeight;if(L||K)return}const q=(P=a.current.floatingContext)==null?void 0:P.nodeId,Q=m&&uo(m.nodesRef.current,q).some(ee=>{var J;return uf(B,(J=ee.context)==null?void 0:J.elements.floating)});if(uf(B,i.floating)||uf(B,i.domReference)||Q)return;const Z=m?uo(m.nodesRef.current,q):[];if(Z.length>0){let ee=!0;if(Z.forEach(J=>{var le;if((le=J.context)!=null&&le.open&&!J.context.dataRef.current.__outsidePressBubbles){ee=!1;return}}),!ee)return}r(!1,B,"outside-press")}),_=$r(B=>{var P;const k=()=>{var O;A(B),(O=Pi(B))==null||O.removeEventListener(u,k)};(P=Pi(B))==null||P.addEventListener(u,k)});ae.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=S;let B=-1;function P(W){r(!1,W,"ancestor-scroll")}function k(){window.clearTimeout(B),x.current=!0}function O(){B=window.setTimeout(()=>{x.current=!1},Lc()?5:0)}const M=hr(i.floating);s&&(M.addEventListener("keydown",w?I:g,w),M.addEventListener("compositionstart",k),M.addEventListener("compositionend",O)),f&&M.addEventListener(u,E?_:A,E);let G=[];return h&&(Et(i.domReference)&&(G=zi(i.domReference)),Et(i.floating)&&(G=G.concat(zi(i.floating))),!Et(i.reference)&&i.reference&&i.reference.contextElement&&(G=G.concat(zi(i.reference.contextElement)))),G=G.filter(W=>{var U;return W!==((U=M.defaultView)==null?void 0:U.visualViewport)}),G.forEach(W=>{W.addEventListener("scroll",P,{passive:!0})}),()=>{s&&(M.removeEventListener("keydown",w?I:g,w),M.removeEventListener("compositionstart",k),M.removeEventListener("compositionend",O)),f&&M.removeEventListener(u,E?_:A,E),G.forEach(W=>{W.removeEventListener("scroll",P)}),window.clearTimeout(B)}},[a,i,s,f,u,n,r,h,o,C,S,g,w,I,A,E,_]),ae.useEffect(()=>{a.current.insideReactTree=!1},[a,f,u]);const T=ae.useMemo(()=>({onKeyDown:g,...c&&{[_R[p]]:B=>{r(!1,B.nativeEvent,"reference-press")},...p!=="click"&&{onClick(B){r(!1,B.nativeEvent,"reference-press")}}}}),[g,r,c,p]),$=ae.useMemo(()=>({onKeyDown:g,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[DR[u]]:()=>{a.current.insideReactTree=!0}}),[g,u,a]);return ae.useMemo(()=>o?{reference:T,floating:$}:{},[o,T,$])}function AR(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=jc(),a=ae.useRef({}),[o]=ae.useState(()=>uR()),s=gC()!=null;if(process.env.NODE_ENV!=="production"){const d=r.reference;d&&!Et(d)&&sR("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=ae.useState(r.reference),c=$r((d,v,m)=>{a.current.openEvent=d?v:void 0,o.emit("openchange",{open:d,event:v,reason:m,nested:s}),n==null||n(d,v,m)}),p=ae.useMemo(()=>({setPositionReference:u}),[]),h=ae.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return ae.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:h,events:o,floatingId:i,refs:p}),[t,c,h,o,i,p])}function RR(e){e===void 0&&(e={});const{nodeId:t}=e,n=AR({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=ae.useState(null),[s,l]=ae.useState(null),c=(i==null?void 0:i.domReference)||a,p=ae.useRef(null),h=og();Cn(()=>{c&&(p.current=c)},[c]);const d=Y6({...e,elements:{...i,...s&&{reference:s}}}),v=ae.useCallback(C=>{const S=Et(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;l(S),d.refs.setReference(S)},[d.refs]),m=ae.useCallback(C=>{(Et(C)||C===null)&&(p.current=C,o(C)),(Et(d.refs.reference.current)||d.refs.reference.current===null||C!==null&&!Et(C))&&d.refs.setReference(C)},[d.refs]),b=ae.useMemo(()=>({...d.refs,setReference:m,setPositionReference:v,domReference:p}),[d.refs,m,v]),f=ae.useMemo(()=>({...d.elements,domReference:c}),[d.elements,c]),y=ae.useMemo(()=>({...d,...r,refs:b,elements:f,nodeId:t}),[d,b,f,t,r]);return Cn(()=>{r.dataRef.current.floatingContext=y;const C=h==null?void 0:h.nodesRef.current.find(S=>S.id===t);C&&(C.context=y)}),ae.useMemo(()=>({...d,context:y,refs:b,elements:f}),[d,b,f,y])}function gf(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[s1]:o,[l1]:s,...l}=e;a=l}return{...n==="floating"&&{tabIndex:-1,[tR]:""},...a,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,c]=l;if(!(i&&[s1,l1].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var p;(p=r.get(u))==null||p.push(c),o[u]=function(){for(var h,d=arguments.length,v=new Array(d),m=0;m<d;m++)v[m]=arguments[m];return(h=r.get(u))==null?void 0:h.map(b=>b(...v)).find(b=>b!==void 0)}}}else o[u]=c}),o),{})}}function BR(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),i=ae.useCallback(s=>gf(s,e,"reference"),t),a=ae.useCallback(s=>gf(s,e,"floating"),n),o=ae.useCallback(s=>gf(s,e,"item"),r);return ae.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}const kR=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function PR(e,t){var n,r;t===void 0&&(t={});const{open:i,elements:a,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=jc(),c=((n=a.domReference)==null?void 0:n.id)||u,p=ae.useMemo(()=>{var y;return((y=Hh(a.floating))==null?void 0:y.id)||o},[a.floating,o]),h=(r=kR.get(l))!=null?r:l,v=gC()!=null,m=ae.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:i?p:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":i?p:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:c},...h==="menu"&&v&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,p,v,i,c,l]),b=ae.useMemo(()=>{const y={id:p,...h&&{role:h}};return h==="tooltip"||l==="label"?y:{...y,...h==="menu"&&{"aria-labelledby":c}}},[h,p,c,l]),f=ae.useCallback(y=>{let{active:C,selected:S}=y;const w={role:"option",...C&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":S}}return{}},[p,l]);return ae.useMemo(()=>s?{reference:m,floating:b,item:f}:{},[s,m,b,f])}const C1=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Ya(e,t){return typeof e=="function"?e(t):e}function $R(e,t){const[n,r]=ae.useState(e);return e&&!n&&r(!0),ae.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function FR(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=(typeof i=="number"?i:i.close)||0,[s,l]=ae.useState("unmounted"),u=$R(n,o);return!u&&s==="close"&&l("unmounted"),Cn(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{M0.flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:s}}function NR(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,l=s.split("-")[0],u=ae.useMemo(()=>({side:l,placement:s}),[l,s]),c=typeof o=="number",p=(c?o:o.open)||0,h=(c?o:o.close)||0,[d,v]=ae.useState(()=>({...Ya(a,u),...Ya(n,u)})),{isMounted:m,status:b}=FR(e,{duration:o}),f=ga(n),y=ga(r),C=ga(i),S=ga(a);return Cn(()=>{const w=Ya(f.current,u),E=Ya(C.current,u),x=Ya(S.current,u),g=Ya(y.current,u)||Object.keys(w).reduce((I,A)=>(I[A]="",I),{});if(b==="initial"&&v(I=>({transitionProperty:I.transitionProperty,...x,...w})),b==="open"&&v({transitionProperty:Object.keys(g).map(C1).join(","),transitionDuration:p+"ms",...x,...g}),b==="close"){const I=E||w;v({transitionProperty:Object.keys(I).map(C1).join(","),transitionDuration:h+"ms",...x,...I})}},[h,C,f,y,S,p,b,u]),{isMounted:m,styles:d}}const MR="_popover_cskuc_1",OR={popover:MR},bi=N.forwardRef((e,t)=>{const{children:n,className:r,offset:i=10,isShow:a,anchorEl:o,useAutoPlacement:s=!1,flipOptions:l,autoPlacementOptions:u,zIndex:c=10,width:p,styleInnerPopover:h={},floatingOptions:d={},onClose:v=()=>{},withArrow:m,propsArrow:b={},...f}=e,y=N.useRef(null),[C,S]=N.useState(!1),{refs:w,floatingStyles:E,context:x}=RR({open:C,onOpenChange:O=>{S(O),O||v()},middleware:[Z6(i),s?Q6(u):q6(l),J6(),eR({element:y})],whileElementsMounted:fC,...d}),g=IR(x),I=TR(x),A=PR(x),{getReferenceProps:_,getFloatingProps:T}=BR([g,I,A]),{styles:$,isMounted:B}=NR(x),P=O=>{w.setReference(O.currentTarget),S(M=>!M),C&&v()};N.useEffect(()=>{a&&o?P({currentTarget:o}):a||S(!1)},[a,o]),N.useImperativeHandle(t,()=>({show:C,setShow:S,handlerShow:P,getReferenceProps:_}),[C]);const k=()=>{let O={...E,...$,...h,zIndex:c};return p&&(O={...O,width:p}),O};return F.jsx(F.Fragment,{children:B&&C&&F.jsx(bR,{children:F.jsx(SR,{context:x,modal:!1,children:F.jsxs("div",{ref:w.setFloating,style:k(),...T(),className:`${OR.popover} ${r??""}`,...f,children:[n,m&&F.jsx(lR,{ref:y,context:x,...b})]})})})})});bi.displayName="Popover";const LR="_input_juw80_271",VR="_label_juw80_271",HR="_error_juw80_307",Sn={"container-large":"_container-large_juw80_271","container-input":"_container-input_juw80_271",input:LR,label:VR,"container-medium":"_container-medium_juw80_271","container-small":"_container-small_juw80_271",error:HR,"label-error":"_label-error_juw80_307","isset-right-icon":"_isset-right-icon_juw80_396","isset-left-icon":"_isset-left-icon_juw80_400","start-icon":"_start-icon_juw80_417","end-icon":"_end-icon_juw80_425"},bC=N.forwardRef((e,t)=>{var C;const{isRequired:n,classNameContainer:r,classNameLabelError:i,classNameLabel:a,className:o,name:s,id:l,label:u,type:c="text",startIcon:p,endIcon:h,error:d,sizeInput:v="large",...m}=e,b={size:{large:Sn["container-large"],medium:Sn["container-medium"],small:Sn["container-small"]}},f=()=>typeof p=="function"||N.isValidElement(p),y=()=>typeof h=="function"||N.isValidElement(h);return F.jsxs("div",{className:`${Sn.container} ${(C=b.size)==null?void 0:C[v]} ${r??""}`,children:[F.jsxs("div",{className:Sn["container-input"],children:[F.jsx("input",{id:l??s,className:`${Sn.input} ${d?Sn.error:""}
43
39
  ${f()?Sn["isset-left-icon"]:""}
44
40
  ${y()?Sn["isset-right-icon"]:""}
45
- ${i??""}`,ref:t,type:c,...m}),F.jsxs("div",{className:Sn["end-icon"],children:[typeof h=="function"&&h(),N.isValidElement(h)&&h]})]}),d&&F.jsx("label",{className:`${Sn["label-error"]}
46
- ${m.disabled?Sn.disabled:""} ${o??""}`,children:d})]})});lg.displayName="InputReguler";/**
41
+ ${o??""}`,ref:t,type:c,...m}),F.jsxs("div",{className:Sn["start-icon"],children:[typeof p=="function"&&p(),N.isValidElement(p)&&p]}),F.jsxs("label",{className:`${Sn.label} ${a??""}`,htmlFor:l??s,children:[u," ",n&&F.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),F.jsxs("div",{className:Sn["end-icon"],children:[typeof h=="function"&&h(),N.isValidElement(h)&&h]})]}),d&&F.jsx("label",{className:`${Sn["label-error"]}
42
+ ${m.disabled?Sn.disabled:""} ${i??""}`,children:d})]})});bC.displayName="InputFloatingInner";const jR="_input_xzyo2_61",zR="_label_xzyo2_67",GR="_disabled_xzyo2_324",WR="_error_xzyo2_375",wn={"container-large":"_container-large_xzyo2_61","container-input":"_container-input_xzyo2_61",input:jR,label:zR,"label-error":"_label-error_xzyo2_109","container-medium":"_container-medium_xzyo2_109","container-small":"_container-small_xzyo2_133",disabled:GR,error:WR,"isset-right-icon":"_isset-right-icon_xzyo2_384","isset-left-icon":"_isset-left-icon_xzyo2_388","start-icon":"_start-icon_xzyo2_392","end-icon":"_end-icon_xzyo2_399"},lg=N.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,type:c="text",startIcon:p,endIcon:h,error:d,sizeInput:v="large",...m}=e,b={size:{large:wn["container-large"],medium:wn["container-medium"],small:wn["container-small"]}},f=()=>typeof p=="function"||N.isValidElement(p),y=()=>typeof h=="function"||N.isValidElement(h);return F.jsxs("div",{className:`${b.size[v]} ${r??""}`,children:[u&&F.jsxs("label",{htmlFor:l??s,className:`${wn.label} ${m.disabled?wn.disabled:""} ${a??""}`,children:[u," ",n&&F.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),F.jsxs("div",{className:`${wn["container-input"]}`,children:[F.jsxs("div",{className:wn["start-icon"],children:[typeof p=="function"&&p(),N.isValidElement(p)&&p]}),F.jsx("input",{id:l??s,className:`${wn.input} ${d?wn.error:""}
43
+ ${f()?wn["isset-left-icon"]:""}
44
+ ${y()?wn["isset-right-icon"]:""}
45
+ ${i??""}`,ref:t,type:c,...m}),F.jsxs("div",{className:wn["end-icon"],children:[typeof h=="function"&&h(),N.isValidElement(h)&&h]})]}),d&&F.jsx("label",{className:`${wn["label-error"]}
46
+ ${m.disabled?wn.disabled:""} ${o??""}`,children:d})]})});lg.displayName="InputReguler";/**
47
47
  * table-core
48
48
  *
49
49
  * Copyright (c) TanStack
@@ -64,36 +64,36 @@ Private-MAC: `+x.digest().toHex()+`\r
64
64
  * LICENSE.md file in the root directory of this source tree.
65
65
  *
66
66
  * @license MIT
67
- */function _o(e,t){return e?SB(e)?ae.createElement(e,t):e:null}function SB(e){return wB(e)||typeof e=="function"||IB(e)}function wB(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function IB(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _B(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ae.useState(()=>({current:YC(t)})),[r,i]=ae.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const DB=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:SC,ColumnFiltering:kC,ColumnGrouping:PC,ColumnOrdering:FC,ColumnPinning:NC,ColumnSizing:MC,ColumnVisibility:LC,GlobalFaceting:VC,GlobalFiltering:HC,Headers:EC,RowExpanding:jC,RowPagination:zC,RowPinning:GC,RowSelection:WC,RowSorting:XC,_getVisibleLeafColumns:ho,aggregationFns:bu,buildHeaderGroups:rs,createCell:xC,createColumn:CC,createColumnHelper:UR,createRow:dl,createTable:YC,defaultColumnSizing:is,expandRows:fg,filterFns:Br,flattenBy:ug,flexRender:_o,functionalUpdate:oi,getCoreRowModel:dB,getExpandedRowModel:fB,getFacetedMinMaxValues:hB,getFacetedRowModel:mB,getFacetedUniqueValues:vB,getFilteredRowModel:bB,getGroupedRowModel:yB,getMemoOptions:Se,getPaginationRowModel:CB,getSortedRowModel:EB,isFunction:cl,isNumberArray:yC,isRowSelected:Gc,isSubRowSelected:Yu,makeStateUpdater:Rn,memo:Ee,noop:XR,orderColumns:$C,passiveEventSupported:OC,reSplitAlphaNumeric:Ku,selectRowsFn:yu,shouldAutoRemoveFilter:jh,sortingFns:io,useReactTable:_B},Symbol.toStringTag,{value:"Module"})),Wc=0,Ji=1,Vo=2,ZC=4;function S1(e){return()=>e}function TB(e){e()}function Ts(e,t){return n=>e(t(n))}function w1(e,t){return()=>e(t)}function AB(e,t){return n=>e(t,n)}function hg(e){return e!==void 0}function RB(...e){return()=>{e.map(TB)}}function Ho(){}function Uc(e,t){return t(e),e}function BB(e,t){return t(e)}function gt(...e){return e}function at(e,t){return e(Ji,t)}function Oe(e,t){e(Wc,t)}function gg(e){e(Vo)}function nn(e){return e(ZC)}function we(e,t){return at(e,AB(t,Wc))}function zr(e,t){const n=e(Ji,r=>{n(),t(r)});return n}function I1(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function JC(e,t){return e===t}function ht(e=JC){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Re(e){return t=>n=>{e(n)&&t(n)}}function xe(e){return t=>Ts(t,e)}function kr(e){return t=>()=>{t(e)}}function he(e,...t){const n=kB(...t);return(r,i)=>{switch(r){case Vo:gg(e);return;case Ji:return at(e,n(i))}}}function Fr(e,t){return n=>r=>{n(t=e(t,r))}}function Do(e){return t=>n=>{e>0?e--:t(n)}}function Oi(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Ve(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);at(a,l=>{const u=n;n=n|s,t[o]=l,u!==i&&n===i&&r&&(r(),r=null)})}),a=>o=>{const s=()=>{a([o].concat(t))};n===i?s():r=s}}function kB(...e){return t=>e.reduceRight(BB,t)}function PB(e){let t,n;const r=()=>t==null?void 0:t();return function(i,a){switch(i){case Ji:return a?n===a?void 0:(r(),n=a,t=at(e,a),t):(r(),Ho);case Vo:r(),n=null;return}}}function ge(e){let t=e;const n=Ge();return(r,i)=>{switch(r){case Wc:t=i;break;case Ji:{i(t);break}case ZC:return t}return n(r,i)}}function fn(e,t){return Uc(ge(t),n=>we(e,n))}function Ge(){const e=[];return(t,n)=>{switch(t){case Wc:e.slice().forEach(r=>{r(n)});return;case Vo:e.splice(0,e.length);return;case Ji:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}}}function Ln(e){return Uc(Ge(),t=>we(e,t))}function Ze(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:$B(),singleton:n}}const $B=()=>Symbol();function FB(e){const t=new Map,n=({constructor:r,dependencies:i,id:a,singleton:o})=>{if(o&&t.has(a))return t.get(a);const s=r(i.map(l=>n(l)));return o&&t.set(a,s),s};return n(e)}function Mt(...e){const t=Ge(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);at(a,l=>{n[o]=l,r=r|s,r===i&&Oe(t,n)})}),function(a,o){switch(a){case Vo:{gg(t);return}case Ji:return r===i&&o(n),at(t,o)}}}function Be(e,t=JC){return he(e,ht(t))}function _1(...e){return function(t,n){switch(t){case Vo:return;case Ji:return RB(...e.map(r=>at(r,n)))}}}var An=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(An||{});const NB={0:"debug",3:"error",1:"log",2:"warn"},MB=()=>typeof globalThis>"u"?window:globalThis,qi=Ze(()=>{const e=ge(3);return{log:ge((t,n,r=1)=>{var i;const a=(i=MB().VIRTUOSO_LOG_LEVEL)!=null?i:nn(e);r>=a&&console[NB[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function Gr(e,t,n){return pg(e,t,n).callbackRef}function pg(e,t,n){const r=N.useRef(null);let i=o=>{};const a=N.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const s=()=>{const l=o[0].target;l.offsetParent!==null&&e(l)};n?s():requestAnimationFrame(s)}):null,[e,n]);return i=o=>{o&&t?(a==null||a.observe(o),r.current=o):(r.current&&(a==null||a.unobserve(r.current)),r.current=null)},{callbackRef:i,ref:r}}function qC(e,t,n,r,i,a,o,s,l){const u=N.useCallback(c=>{const p=OB(c.children,t,s?"offsetWidth":"offsetHeight",i);let h=c.parentElement;for(;!h.dataset.virtuosoScroller;)h=h.parentElement;const d=h.lastElementChild.dataset.viewportType==="window";let v;d&&(v=h.ownerDocument.defaultView);const m=o?s?o.scrollLeft:o.scrollTop:d?s?v.scrollX||v.document.documentElement.scrollLeft:v.scrollY||v.document.documentElement.scrollTop:s?h.scrollLeft:h.scrollTop,b=o?s?o.scrollWidth:o.scrollHeight:d?s?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:s?h.scrollWidth:h.scrollHeight,f=o?s?o.offsetWidth:o.offsetHeight:d?s?v.innerWidth:v.innerHeight:s?h.offsetWidth:h.offsetHeight;r({scrollHeight:b,scrollTop:Math.max(m,0),viewportHeight:f}),a==null||a(s?D1("column-gap",getComputedStyle(c).columnGap,i):D1("row-gap",getComputedStyle(c).rowGap,i)),p!==null&&e(p)},[e,t,i,a,o,r,s]);return pg(u,n,l)}function OB(e,t,n,r){const i=e.length;if(i===0)return null;const a=[];for(let o=0;o<i;o++){const s=e.item(o);if(s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,n);if(c===0&&r("Zero-sized element, this should not happen",{child:s},An.ERROR),c===u)continue;const p=a[a.length-1];a.length===0||p.size!==c||p.endIndex!==l-1?a.push({endIndex:l,size:c,startIndex:l}):a[a.length-1].endIndex++}return a}function D1(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,An.WARN),t==="normal"?0:parseInt(t??"0",10)}function mg(e,t,n){const r=N.useRef(null),i=N.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const u=l.getBoundingClientRect(),c=u.width;let p,h;if(t){const d=t.getBoundingClientRect(),v=u.top-d.top;h=d.height-Math.max(0,v),p=v+t.scrollTop}else{const d=o.current.ownerDocument.defaultView;h=d.innerHeight-Math.max(0,u.top),p=u.top+d.scrollY}r.current={offsetTop:p,visibleHeight:h,visibleWidth:c},e(r.current)},[e,t]),{callbackRef:a,ref:o}=pg(i,!0,n),s=N.useCallback(()=>{i(o.current)},[i,o]);return N.useEffect(()=>{var l;if(t){t.addEventListener("scroll",s);const u=new ResizeObserver(()=>{requestAnimationFrame(s)});return u.observe(t),()=>{t.removeEventListener("scroll",s),u.unobserve(t)}}else{const u=(l=o.current)==null?void 0:l.ownerDocument.defaultView;return u==null||u.addEventListener("scroll",s),u==null||u.addEventListener("resize",s),()=>{u==null||u.removeEventListener("scroll",s),u==null||u.removeEventListener("resize",s)}}},[s,t,o]),a}const Cn=Ze(()=>{const e=Ge(),t=Ge(),n=ge(0),r=Ge(),i=ge(0),a=Ge(),o=Ge(),s=ge(0),l=ge(0),u=ge(0),c=ge(0),p=Ge(),h=Ge(),d=ge(!1),v=ge(!1),m=ge(!1);return we(he(e,xe(({scrollTop:b})=>b)),t),we(he(e,xe(({scrollHeight:b})=>b)),o),we(t,i),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:s,horizontalDirection:v,scrollBy:h,scrollContainerState:e,scrollHeight:o,scrollingInProgress:d,scrollTo:p,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),As={lvl:0};function QC(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:s,value:l}=t(e[o]);a.push({end:s-1,start:r,value:i}),r=s,i=l}return a.push({end:1/0,start:r,value:i}),a}function st(e){return e===As}function Rs(e,t){if(!st(e))return t===e.k?e.v:t<e.k?Rs(e.l,t):Rs(e.r,t)}function br(e,t,n="k"){if(st(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=br(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return br(e.l,t,n)}function Mn(e,t,n){return st(e)?n2(t,n,1):t===e.k?Ft(e,{k:t,v:n}):t<e.k?T1(Ft(e,{l:Mn(e.l,t,n)})):T1(Ft(e,{r:Mn(e.r,t,n)}))}function go(){return As}function Xc(e,t,n){if(st(e))return[];const r=br(e,t)[0];return LB(Xh(e,r,n))}function Uh(e,t){if(st(e))return As;const{k:n,l:r,r:i}=e;if(t===n){if(st(r))return i;if(st(i))return r;{const[a,o]=t2(r);return xu(Ft(e,{k:a,l:e2(r),v:o}))}}else return t<n?xu(Ft(e,{l:Uh(r,t)})):xu(Ft(e,{r:Uh(i,t)}))}function pa(e){return st(e)?[]:[...pa(e.l),{k:e.k,v:e.v},...pa(e.r)]}function Xh(e,t,n){if(st(e))return[];const{k:r,l:i,r:a,v:o}=e;let s=[];return r>t&&(s=s.concat(Xh(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Xh(a,t,n))),s}function xu(e){const{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(xf(t))return r2(Ft(e,{lvl:n-1}));if(!st(t)&&!st(t.r))return Ft(t.r,{l:Ft(t,{r:t.r.l}),lvl:n,r:Ft(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(xf(e))return Yh(Ft(e,{lvl:n-1}));if(!st(r)&&!st(r.l)){const i=r.l,a=xf(i)?r.lvl-1:r.lvl;return Ft(i,{l:Ft(e,{lvl:n-1,r:i.l}),lvl:i.lvl+1,r:Yh(Ft(r,{l:i.r,lvl:a}))})}else throw new Error("Unexpected empty nodes")}}function Ft(e,t){return n2(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function e2(e){return st(e.r)?e.l:xu(Ft(e,{r:e2(e.r)}))}function xf(e){return st(e)||e.lvl>e.r.lvl}function t2(e){return st(e.r)?[e.k,e.v]:t2(e.r)}function n2(e,t,n,r=As,i=As){return{k:e,l:r,lvl:n,r:i,v:t}}function T1(e){return Yh(r2(e))}function r2(e){const{l:t}=e;return!st(t)&&t.lvl===e.lvl?Ft(t,{r:Ft(e,{l:t.r})}):e}function Yh(e){const{lvl:t,r:n}=e;return!st(n)&&!st(n.r)&&n.lvl===t&&n.r.lvl===t?Ft(n,{l:Ft(e,{r:n.l}),lvl:t+1}):e}function LB(e){return QC(e,({k:t,v:n})=>({index:t,value:n}))}function i2(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function Bs(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const vg=Ze(()=>({recalcInProgress:ge(!1)}),[],{singleton:!0});function a2(e,t,n){return e[Zu(e,t,n)]}function Zu(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function VB(e,t,n,r){const i=Zu(e,t,r),a=Zu(e,n,r,i);return e.slice(i,a+1)}function yr(e,t){return Math.round(e.getBoundingClientRect()[t])}function Yc(e){return!st(e.groupOffsetTree)}function bg({index:e},t){return t===e?0:t<e?-1:1}function HB(){return{groupIndices:[],groupOffsetTree:go(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:go()}}function jB(e,t){let n=st(e)?0:1/0;for(const r of t){const{endIndex:i,size:a,startIndex:o}=r;if(n=Math.min(n,o),st(e)){e=Mn(e,0,a);continue}const s=Xc(e,o-1,i+1);if(s.some(KB(r)))continue;let l=!1,u=!1;for(const{end:c,start:p,value:h}of s)l?(i>=p||a===h)&&(e=Uh(e,p)):(u=h!==a,l=!0),c>i&&i>=p&&h!==a&&(e=Mn(e,i+1,h));u&&(e=Mn(e,o,a))}return[e,n]}function zB(e){return typeof e.groupIndex<"u"}function GB({offset:e},t){return t===e?0:t<e?-1:1}function ks(e,t,n){if(t.length===0)return 0;const{index:r,offset:i,size:a}=a2(t,e,bg),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function o2(e,t){if(!Yc(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function s2(e,t,n){if(zB(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=o2(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function WB(e,t,n,r=0){return r>0&&(t=Math.max(t,a2(e,r,bg).offset)),QC(VB(e,t,n,GB),YB)}function UB(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,An.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&st(a)&&t.length===2){const h=t[0].size,d=t[1].size;o=n.reduce((v,m)=>Mn(Mn(v,m,h),m+1,d),o)}else[o,s]=jB(o,t);if(o===a)return e;const{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:p}=Kh(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((h,d)=>Mn(h,d,ks(d,p,i)),go()),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:p,sizeTree:o}}function XB(e){return pa(e).map(({k:t,v:n},r,i)=>{const a=i[r+1];return{endIndex:a?a.k-1:1/0,size:n,startIndex:t}})}function A1(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Kh(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=Zu(i,t-1,bg),s=i[l].offset;const u=br(n,t-1);a=u[0],o=u[1],i.length&&i[l].size===br(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of Xc(n,t,1/0)){const p=u-a,h=p*o+s+p*r;i.push({index:u,offset:h,size:c}),a=u,s=h,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function YB(e){return{index:e.index,value:e}}function KB(e){const{endIndex:t,size:n,startIndex:r}=e;return i=>i.start===r&&(i.end===t||i.end===1/0)&&i.value===n}const ZB={offsetHeight:"height",offsetWidth:"width"},Xr=Ze(([{log:e},{recalcInProgress:t}])=>{const n=Ge(),r=Ge(),i=fn(r,0),a=Ge(),o=Ge(),s=ge(0),l=ge([]),u=ge(void 0),c=ge(void 0),p=ge((w,E)=>yr(w,ZB[E])),h=ge(void 0),d=ge(0),v=HB(),m=fn(he(n,Ve(l,e,d),Fr(UB,v),ht()),v),b=fn(he(l,ht(),Fr((w,E)=>({current:E,prev:w.current}),{current:[],prev:[]}),xe(({prev:w})=>w)),[]);we(he(l,Re(w=>w.length>0),Ve(m,d),xe(([w,E,x])=>{const g=w.reduce((I,A,_)=>Mn(I,A,ks(A,E.offsetTree,x)||_),go());return{...E,groupIndices:w,groupOffsetTree:g}})),m),we(he(r,Ve(m),Re(([w,{lastIndex:E}])=>w<E),xe(([w,{lastIndex:E,lastSize:x}])=>[{endIndex:E,size:x,startIndex:w}])),n),we(u,c);const f=fn(he(u,xe(w=>w===void 0)),!0);we(he(c,Re(w=>w!==void 0&&st(nn(m).sizeTree)),xe(w=>[{endIndex:0,size:w,startIndex:0}])),n);const y=Ln(he(n,Ve(m),Fr(({sizes:w},[E,x])=>({changed:x!==w,sizes:x}),{changed:!1,sizes:v}),xe(w=>w.changed)));at(he(s,Fr((w,E)=>({diff:w.prev-E,prev:E}),{diff:0,prev:0}),xe(w=>w.diff)),w=>{const{groupIndices:E}=nn(m);if(w>0)Oe(t,!0),Oe(a,w+A1(w,E));else if(w<0){const x=nn(b);x.length>0&&(w-=A1(-w,x)),Oe(o,w)}}),at(he(s,Ve(e)),([w,E])=>{w<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},An.ERROR)});const C=Ln(a);we(he(a,Ve(m),xe(([w,E])=>{const x=E.groupIndices.length>0,g=[],I=E.lastSize;if(x){const A=Rs(E.sizeTree,0);let _=0,T=0;for(;_<w;){const B=E.groupIndices[T],P=E.groupIndices.length===T+1?1/0:E.groupIndices[T+1]-B-1;g.push({endIndex:B,size:A,startIndex:B}),g.push({endIndex:B+1+P-1,size:I,startIndex:B+1}),T++,_+=P+1}const $=pa(E.sizeTree);return _!==w&&$.shift(),$.reduce((B,{k:P,v:k})=>{let O=B.ranges;return B.prevSize!==0&&(O=[...B.ranges,{endIndex:P+w-1,size:B.prevSize,startIndex:B.prevIndex}]),{prevIndex:P+w,prevSize:k,ranges:O}},{prevIndex:w,prevSize:0,ranges:g}).ranges}return pa(E.sizeTree).reduce((A,{k:_,v:T})=>({prevIndex:_+w,prevSize:T,ranges:[...A.ranges,{endIndex:_+w-1,size:A.prevSize,startIndex:A.prevIndex}]}),{prevIndex:0,prevSize:I,ranges:[]}).ranges})),n);const S=Ln(he(o,Ve(m,d),xe(([w,{offsetTree:E},x])=>{const g=-w;return ks(g,E,x)})));return we(he(o,Ve(m,d),xe(([w,E,x])=>{if(E.groupIndices.length>0){if(st(E.sizeTree))return E;let g=go();const I=nn(b);let A=0,_=0,T=0;for(;A<-w;){T=I[_];const $=I[_+1]-T-1;_++,A+=$+1}if(g=pa(E.sizeTree).reduce(($,{k:B,v:P})=>Mn($,Math.max(0,B+w),P),g),A!==-w){const $=Rs(E.sizeTree,T);g=Mn(g,0,$);const B=br(E.sizeTree,-w+1)[1];g=Mn(g,1,B)}return{...E,sizeTree:g,...Kh(E.offsetTree,0,g,x)}}else{const g=pa(E.sizeTree).reduce((I,{k:A,v:_})=>Mn(I,Math.max(0,A+w),_),go());return{...E,sizeTree:g,...Kh(E.offsetTree,0,g,x)}}})),m),{beforeUnshiftWith:C,data:h,defaultItemSize:c,firstItemIndex:s,fixedItemSize:u,gap:d,groupIndices:l,itemSize:p,listRefresh:y,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:m,statefulTotalCount:i,totalCount:r,trackItemSizes:f,unshiftWith:a}},gt(qi,vg),{singleton:!0});function JB(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const l2=Ze(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const a=Ge(),o=Ge(),s=Ln(he(a,xe(JB)));return we(he(s,xe(l=>l.totalCount)),n),we(he(s,xe(l=>l.groupIndices)),e),we(he(Mt(i,t,r),Re(([l,u])=>Yc(u)),xe(([l,u,c])=>br(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),ht(),xe(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},gt(Xr,Cn)),Qi=Ze(([{log:e}])=>{const t=ge(!1),n=Ln(he(t,Re(r=>r),ht()));return at(t,r=>{r&&nn(e)("props updated",{},An.DEBUG)}),{didMount:n,propsReady:t}},gt(qi),{singleton:!0}),qB=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function u2(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!qB)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const fl=Ze(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:p},{log:h}])=>{const d=Ge(),v=Ge(),m=ge(0);let b=null,f=null,y=null;function C(){b&&(b(),b=null),y&&(y(),y=null),f&&(clearTimeout(f),f=null),Oe(l,!1)}return we(he(d,Ve(n,p,r,m,s,o,h),Ve(e,a,i),xe(([[S,w,E,x,g,I,A,_],T,$,B])=>{const P=u2(S),{align:k,behavior:O,offset:M}=P,G=x-1,W=s2(P,w,G);let U=ks(W,w.offsetTree,T)+I;k==="end"?(U+=$+br(w.sizeTree,W)[1]-E+B,W===G&&(U+=A)):k==="center"?U+=($+br(w.sizeTree,W)[1]-E+B)/2:U-=g,M&&(U+=M);const q=Q=>{C(),Q?(_("retrying to scroll to",{location:S},An.DEBUG),Oe(d,S)):(Oe(v,!0),_("list did not change, scroll successful",{},An.DEBUG))};if(C(),O==="smooth"){let Q=!1;y=at(t,Z=>{Q=Q||Z}),b=zr(c,()=>{q(Q)})}else b=zr(he(t,QB(150)),q);return f=setTimeout(()=>{C()},1200),Oe(l,!0),_("scrolling from index to",{behavior:O,index:W,top:U},An.DEBUG),{behavior:O,top:U}})),u),{scrollTargetReached:v,scrollToIndex:d,topListHeight:m}},gt(Xr,Cn,qi),{singleton:!0});function QB(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}function yg(e,t){e==0?t():requestAnimationFrame(()=>{yg(e-1,t)})}function xg(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const hl=Ze(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{const s=ge(!0),l=ge(0),u=ge(!0);return we(he(o,Ve(l),Re(([c,p])=>!!p),kr(!1)),s),we(he(o,Ve(l),Re(([c,p])=>!!p),kr(!1)),u),at(he(Mt(t,o),Ve(s,n,e,u),Re(([[,c],p,{sizeTree:h},d,v])=>c&&(!st(h)||hg(d))&&!p&&!v),Ve(l)),([,c])=>{zr(i,()=>{Oe(u,!0)}),yg(4,()=>{zr(r,()=>{Oe(s,!0)}),Oe(a,c)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:s}},gt(Xr,Cn,fl,Qi),{singleton:!0});function c2(e,t){return Math.abs(e-t)<1.01}const Ps="up",ps="down",e9="none",t9={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},n9=0,gl=Ze(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{const o=ge(!1),s=ge(!0),l=Ge(),u=Ge(),c=ge(4),p=ge(n9),h=fn(he(_1(he(Be(i),Do(1),kr(!0)),he(Be(i),Do(1),kr(!1),I1(100))),ht()),!1),d=fn(he(_1(he(n,kr(!0)),he(n,kr(!1),I1(200))),ht()),!1);we(he(Mt(Be(i),Be(p)),xe(([y,C])=>y<=C),ht()),s),we(he(s,Oi(50)),u);const v=Ln(he(Mt(r,Be(a),Be(t),Be(e),Be(c)),Fr((y,[{scrollHeight:C,scrollTop:S},w,E,x,g])=>{const I=S+w-C>-g,A={scrollHeight:C,scrollTop:S,viewportHeight:w};if(I){let T,$;return S>y.state.scrollTop?(T="SCROLLED_DOWN",$=y.state.scrollTop-S):(T="SIZE_DECREASED",$=y.state.scrollTop-S||y.scrollTopDelta),{atBottom:!0,atBottomBecause:T,scrollTopDelta:$,state:A}}let _;return A.scrollHeight>y.state.scrollHeight?_="SIZE_INCREASED":w<y.state.viewportHeight?_="VIEWPORT_HEIGHT_DECREASING":S<y.state.scrollTop?_="SCROLLING_UPWARDS":_="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:_,state:A}},t9),ht((y,C)=>y&&y.atBottom===C.atBottom))),m=fn(he(r,Fr((y,{scrollHeight:C,scrollTop:S,viewportHeight:w})=>{if(c2(y.scrollHeight,C))return{changed:!1,jump:0,scrollHeight:C,scrollTop:S};{const E=C-(S+w)<1;return y.scrollTop!==S&&E?{changed:!0,jump:y.scrollTop-S,scrollHeight:C,scrollTop:S}:{changed:!0,jump:0,scrollHeight:C,scrollTop:S}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Re(y=>y.changed),xe(y=>y.jump)),0);we(he(v,xe(y=>y.atBottom)),o),we(he(o,Oi(50)),l);const b=ge(ps);we(he(r,xe(({scrollTop:y})=>y),ht(),Fr((y,C)=>nn(d)?{direction:y.direction,prevScrollTop:C}:{direction:C<y.prevScrollTop?Ps:ps,prevScrollTop:C},{direction:ps,prevScrollTop:0}),xe(y=>y.direction)),b),we(he(r,Oi(50),kr(e9)),b);const f=ge(0);return we(he(h,Re(y=>!y),kr(0)),f),we(he(i,Oi(100),Ve(h),Re(([y,C])=>!!C),Fr(([y,C],[S])=>[C,S],[0,0]),xe(([y,C])=>C-y)),f),{atBottomState:v,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:p,isAtBottom:o,isAtTop:s,isScrolling:h,lastJumpDueToItemResize:m,scrollDirection:b,scrollVelocity:f}},gt(Cn)),Ju="top",qu="bottom",R1="none";function B1(e,t,n){return typeof e=="number"?n===Ps&&t===Ju||n===ps&&t===qu?e:0:n===Ps?t===Ju?e.main:e.reverse:t===qu?e.main:e.reverse}function k1(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const Cg=Ze(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const a=Ge(),o=ge(0),s=ge(0),l=ge(0),u=fn(he(Mt(Be(r),Be(i),Be(n),Be(a,Bs),Be(l),Be(o),Be(t),Be(e),Be(s)),xe(([c,p,h,[d,v],m,b,f,y,C])=>{const S=c-y,w=b+f,E=Math.max(h-S,0);let x=R1;const g=k1(C,Ju),I=k1(C,qu);return d-=y,d+=h+f,v+=h+f,v-=y,d>c+w-g&&(x=Ps),v<c-E+p+I&&(x=ps),x!==R1?[Math.max(S-h-B1(m,Ju,x)-g,0),S-E-f+p+B1(m,qu,x)+I]:null}),Re(c=>c!=null),ht(Bs)),[0,0]);return{increaseViewportBy:s,listBoundary:a,overscan:l,topListHeight:o,visibleRange:u}},gt(Cn),{singleton:!0});function r9(e,t,n){if(Yc(t)){const r=o2(e,t);return[{index:br(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:r,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const Cf={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Cu(e,t,n,r,i,a){const{lastIndex:o,lastOffset:s,lastSize:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const p=n-o,h=s+p*l+(p-1)*r,d=u,v=h-c;return{bottom:c,firstItemIndex:a,items:P1(e,i,a),offsetBottom:v,offsetTop:u,top:d,topItems:P1(t,i,a),topListHeight:t.reduce((m,b)=>b.size+m,0),totalCount:n}}function d2(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-o>=e)break;o++}const s=e+o,l=xg(t,s),u=Array.from({length:s}).map((c,p)=>({data:a[p+l],index:p+l,offset:0,size:0}));return Cu(u,[],s,i,n,r)}function P1(e,t,n){if(e.length===0)return[];if(!Yc(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=Xc(t.groupOffsetTree,r,i);let s,l=0;for(const u of e){(!s||s.end<u.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start));let c;u.index===s.start?c={index:l,type:"group"}:c={groupIndex:l,index:u.index-(l+1)+n},a.push({...c,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return a}const La=Ze(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:p},h,{didMount:d},{recalcInProgress:v}])=>{const m=ge([]),b=ge(0),f=Ge();we(a.topItemsIndexes,m);const y=fn(he(Mt(d,v,Be(l,Bs),Be(i),Be(r),Be(u),c,Be(m),Be(t),Be(n),e),Re(([E,x,,g,,,,,,,I])=>{const A=I&&I.length!==g;return E&&!x&&!A}),xe(([,,[E,x],g,I,A,_,T,$,B,P])=>{const k=I,{offsetTree:O,sizeTree:M}=k,G=nn(b);if(g===0)return{...Cf,totalCount:g};if(E===0&&x===0)return G===0?{...Cf,totalCount:g}:d2(G,A,I,$,B,P||[]);if(st(M))return G>0?null:Cu(r9(xg(A,g),k,P),[],g,B,k,$);const W=[];if(T.length>0){const ee=T[0],J=T[T.length-1];let le=0;for(const re of Xc(M,ee,J)){const R=re.value,H=Math.max(re.start,ee),V=Math.min(re.end,J);for(let D=H;D<=V;D++)W.push({data:P==null?void 0:P[D],index:D,offset:le,size:R}),le+=R}}if(!_)return Cu([],W,g,B,k,$);const U=T.length>0?T[T.length-1]+1:0,q=WB(O,E,x,U);if(q.length===0)return null;const Q=g-1,Z=Uc([],ee=>{for(const J of q){const le=J.value;let re=le.offset,R=J.start;const H=le.size;if(le.offset<E){R+=Math.floor((E-le.offset+B)/(H+B));const D=R-J.start;re+=D*H+D*B}R<U&&(re+=(U-R)*H,R=U);const V=Math.min(J.end,Q);for(let D=R;D<=V&&!(re>=x);D++)ee.push({data:P==null?void 0:P[D],index:D,offset:re,size:H}),re+=H+B}});return Cu(Z,W,g,B,k,$)}),Re(E=>E!==null),ht()),Cf);we(he(e,Re(hg),xe(E=>E==null?void 0:E.length)),i),we(he(y,xe(E=>E.topListHeight)),p),we(p,s),we(he(y,xe(E=>[E.top,E.bottom])),o),we(he(y,xe(E=>E.items)),f);const C=Ln(he(y,Re(({items:E})=>E.length>0),Ve(i,e),Re(([{items:E},x])=>E[E.length-1].originalIndex===x-1),xe(([,E,x])=>[E-1,x]),ht(Bs),xe(([E])=>E))),S=Ln(he(y,Oi(200),Re(({items:E,topItems:x})=>E.length>0&&E[0].originalIndex===x.length),xe(({items:E})=>E[0].index),ht())),w=Ln(he(y,Re(({items:E})=>E.length>0),xe(({items:E})=>{let x=0,g=E.length-1;for(;E[x].type==="group"&&x<g;)x++;for(;E[g].type==="group"&&g>x;)g--;return{endIndex:E[g].index,startIndex:E[x].index}}),ht(i2)));return{endReached:C,initialItemCount:b,itemsRendered:f,listState:y,rangeChanged:w,startReached:S,topItemsIndexes:m,...h}},gt(Xr,l2,Cg,hl,fl,gl,Qi,vg),{singleton:!0}),f2=Ze(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const a=Ge(),o=fn(he(Mt(n,e,r,t,i),xe(([s,l,u,c,p])=>s+l+u+c+p.offsetBottom+p.bottom)),0);return we(Be(o),a),{totalListHeight:o,totalListHeightChanged:a}},gt(Cn,La),{singleton:!0}),i9=Ze(([{viewportHeight:e},{totalListHeight:t}])=>{const n=ge(!1),r=fn(he(Mt(n,e,t),Re(([i])=>i),xe(([,i,a])=>Math.max(0,i-a)),Oi(0),ht()),0);return{alignToBottom:n,paddingTopAddition:r}},gt(Cn,f2),{singleton:!0});function $1(e){return e?e==="smooth"?"smooth":"auto":!1}const a9=(e,t)=>typeof e=="function"?$1(e(t)):t&&$1(e),o9=Ze(([{listRefresh:e,totalCount:t,fixedItemSize:n},{atBottomState:r,isAtBottom:i},{scrollToIndex:a},{scrolledToInitialItem:o},{didMount:s,propsReady:l},{log:u},{scrollingInProgress:c}])=>{const p=ge(!1),h=Ge();let d=null;function v(b){Oe(a,{align:"end",behavior:b,index:"LAST"})}at(he(Mt(he(Be(t),Do(1)),s),Ve(Be(p),i,o,c),xe(([[b,f],y,C,S,w])=>{let E=f&&S,x="auto";return E&&(x=a9(y,C||w),E=E&&!!x),{followOutputBehavior:x,shouldFollow:E,totalCount:b}}),Re(({shouldFollow:b})=>b)),({followOutputBehavior:b,totalCount:f})=>{d&&(d(),d=null),nn(n)?requestAnimationFrame(()=>{nn(u)("following output to ",{totalCount:f},An.DEBUG),v(b)}):d=zr(e,()=>{nn(u)("following output to ",{totalCount:f},An.DEBUG),v(b),d=null})});function m(b){const f=zr(r,y=>{b&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!d&&(nn(u)("scrolling to bottom due to increased size",{},An.DEBUG),v("auto"))});setTimeout(f,100)}return at(he(Mt(Be(p),t,l),Re(([b,,f])=>b&&f),Fr(({value:b},[,f])=>({refreshed:b===f,value:f}),{refreshed:!1,value:0}),Re(({refreshed:b})=>b),Ve(p,t)),([,b])=>{nn(o)&&m(b!==!1)}),at(h,()=>{m(nn(p)!==!1)}),at(Mt(Be(p),r),([b,f])=>{b&&!f.atBottom&&f.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&v("auto")}),{autoscrollToBottom:h,followOutput:p}},gt(Xr,gl,fl,hl,Qi,qi,Cn)),s9=Ze(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(we(he(s,Ve(a),Re(([,l])=>l!==0),Ve(i,r,t,n,e),xe(([[,l],u,c,p,h,d=[]])=>d2(l,u,c,p,h,d))),o),{}),gt(Xr,hl,La,Qi),{singleton:!0}),l9=Ze(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=ge(0);return at(he(e,Ve(r),Re(([,i])=>i!==0),xe(([,i])=>({top:i}))),i=>{zr(he(n,Do(1),Re(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{Oe(t,i)})})}),{initialScrollTop:r}},gt(Qi,Cn,La),{singleton:!0}),u9=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??"start",behavior:r}:e>a?{...i,align:n??"end",behavior:r}:null,c9=Ze(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:l},{scrollToIndex:u}])=>{const c=Ge();return we(he(c,Ve(t,l,n,a,i,r,s),Ve(e),xe(([[p,h,d,v,m,b,f,y],C])=>{const{align:S,behavior:w,calculateViewLocation:E=u9,done:x,...g}=p,I=s2(p,h,v-1),A=ks(I,h.offsetTree,C)+m+b,_=A+br(h.sizeTree,I)[1],T=y+b,$=y+d-f,B=E({itemBottom:_,itemTop:A,locationParams:{align:S,behavior:w,...g},viewportBottom:$,viewportTop:T});return B?x&&zr(he(o,Re(P=>!P),Do(nn(o)?1:2)),x):x&&x(),B}),Re(p=>p!==null)),u),{scrollIntoView:c}},gt(Xr,Cn,fl,La,qi),{singleton:!0}),h2=Ze(([{scrollVelocity:e}])=>{const t=ge(!1),n=Ge(),r=ge(!1);return we(he(e,Ve(r,t,n),Re(([i,a])=>!!a),xe(([i,a,o,s])=>{const{enter:l,exit:u}=a;if(o){if(u(i,s))return!1}else if(l(i,s))return!0;return o}),ht()),t),at(he(Mt(t,e,n),Ve(r)),([[i,a,o],s])=>{i&&s&&s.change&&s.change(a,o)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},gt(gl),{singleton:!0}),Eg=Ze(([{scrollContainerState:e,scrollTo:t}])=>{const n=Ge(),r=Ge(),i=Ge(),a=ge(!1),o=ge(void 0);return we(he(Mt(n,r),xe(([{scrollHeight:s,scrollTop:l,viewportHeight:u},{offsetTop:c}])=>({scrollHeight:s,scrollTop:Math.max(0,l-c),viewportHeight:u}))),e),we(he(t,Ve(r),xe(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},gt(Cn)),d9=Ze(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:l}])=>{const u=Ge(),c=ge(void 0),p=ge(null),h=ge(null);return we(s,p),we(l,h),at(he(u,Ve(t,r,o,p,h,n)),([d,v,m,b,f,y,C])=>{const S=XB(v.sizeTree);b&&f!==null&&y!==null&&(m=f.scrollTop-y.offsetTop),m-=C,d({ranges:S,scrollTop:m})}),we(he(c,Re(hg),xe(f9)),i),we(he(a,Ve(c),Re(([,d])=>d!==void 0),ht(),xe(([,d])=>d.ranges)),e),{getState:u,restoreStateFrom:c}},gt(Xr,Cn,hl,Qi,Eg));function f9(e){return{align:"start",index:0,offset:e.scrollTop}}const h9=Ze(([{topItemsIndexes:e}])=>{const t=ge(0);return we(he(t,Re(n=>n>=0),xe(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},gt(La));function g2(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const g9=g2(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),p9=Ze(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:p,sizes:h},{log:d},{recalcInProgress:v}])=>{const m=Ln(he(l,Ve(o),Fr(([,f,y,C],[{bottom:S,items:w,offsetBottom:E,totalCount:x},g])=>{const I=S+E;let A=0;return y===x&&f.length>0&&w.length>0&&(w[0].originalIndex===0&&f[0].originalIndex===0||(A=I-C,A!==0&&(A+=g))),[A,w,x,I]},[0,[],0,0]),Re(([f])=>f!==0),Ve(r,s,n,i,d,v),Re(([,f,y,C,,,S])=>!S&&!C&&f!==0&&y===Ps),xe(([[f],,,,,y])=>(y("Upward scrolling compensation",{amount:f},An.DEBUG),f))));function b(f){f>0?(Oe(t,{behavior:"auto",top:-f}),Oe(e,0)):(Oe(e,0),Oe(t,{behavior:"auto",top:-f}))}return at(he(m,Ve(e,a)),([f,y,C])=>{C&&g9()?Oe(e,y-f):b(-f)}),at(he(Mt(fn(a,!1),e,v),Re(([f,y,C])=>!f&&!C&&y!==0),xe(([f,y])=>y),Oi(1)),b),we(he(p,xe(f=>({top:-f}))),t),at(he(u,Ve(h,c),xe(([f,{groupIndices:y,lastSize:C,sizeTree:S},w])=>{function E(x){return x*(C+w)}if(y.length===0)return E(f);{let x=0;const g=Rs(S,0);let I=0,A=0;for(;I<f;){I++,x+=g;let _=y.length===A+1?1/0:y[A+1]-y[A]-1;I+_>f&&(x-=g,_=f-I+1),I+=_,x+=E(_),A++}return x}})),f=>{Oe(e,f),requestAnimationFrame(()=>{Oe(t,{top:f}),requestAnimationFrame(()=>{Oe(e,0),Oe(v,!1)})})}),{deviation:e}},gt(Cn,gl,La,Xr,qi,vg)),m9=Ze(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),gt(Cg,s9,Qi,h2,f2,l9,i9,Eg,c9,qi)),p2=Ze(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:i,groupIndices:a,itemSize:o,sizeRanges:s,sizes:l,statefulTotalCount:u,totalCount:c,trackItemSizes:p},{initialItemFinalLocationReached:h,initialTopMostItemIndex:d,scrolledToInitialItem:v},m,b,f,{listState:y,topItemsIndexes:C,...S},{scrollToIndex:w},E,{topItemCount:x},{groupCounts:g},I])=>(we(S.rangeChanged,I.scrollSeekRangeChanged),we(he(I.windowViewportRect,xe(A=>A.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:i,groupCounts:g,initialItemFinalLocationReached:h,initialTopMostItemIndex:d,scrolledToInitialItem:v,sizeRanges:s,topItemCount:x,topItemsIndexes:C,totalCount:c,...f,groupIndices:a,itemSize:o,listState:y,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:p,...S,...I,...m,sizes:l,...b}),gt(Xr,hl,Cn,d9,o9,La,fl,p9,h9,l2,m9));function v9(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const o in t)Object.hasOwn(r,o)||(n[o]=t[o]);return n}const Ol=typeof document<"u"?N.useLayoutEffect:N.useEffect;function Sg(e,t,n){const r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=N.createContext({});function l(b,f){b.propsReady&&Oe(b.propsReady,!1);for(const y of r){const C=b[t.required[y]];Oe(C,f[y])}for(const y of i)if(y in f){const C=b[t.optional[y]];Oe(C,f[y])}b.propsReady&&Oe(b.propsReady,!0)}function u(b){return a.reduce((f,y)=>(f[y]=C=>{const S=b[t.methods[y]];Oe(S,C)},f),{})}function c(b){return o.reduce((f,y)=>(f[y]=PB(b[t.events[y]]),f),{})}const p=N.forwardRef((b,f)=>{const{children:y,...C}=b,[S]=N.useState(()=>Uc(FB(e),x=>{l(x,C)})),[w]=N.useState(w1(c,S));Ol(()=>{for(const x of o)x in C&&at(w[x],C[x]);return()=>{Object.values(w).map(gg)}},[C,w,S]),Ol(()=>{l(S,C)}),N.useImperativeHandle(f,S1(u(S)));const E=n;return F.jsx(s.Provider,{value:S,children:n?F.jsx(E,{...v9([...r,...i,...o],C),children:y}):y})}),h=b=>{const f=N.useContext(s);return N.useCallback(y=>{Oe(f[b],y)},[f,b])},d=b=>{const f=N.useContext(s)[b],y=N.useCallback(C=>at(f,C),[f]);return N.useSyncExternalStore(y,()=>nn(f),()=>nn(f))},v=b=>{const f=N.useContext(s)[b],[y,C]=N.useState(w1(nn,f));return Ol(()=>at(f,S=>{S!==y&&C(S1(S))}),[f,y]),y},m=N.version.startsWith("18")?d:v;return{Component:p,useEmitter:(b,f)=>{const y=N.useContext(s)[b];Ol(()=>at(y,f),[f,y])},useEmitterValue:m,usePublisher:h}}const Kc=N.createContext(void 0),m2=N.createContext(void 0),v2=typeof document<"u"?N.useLayoutEffect:N.useEffect;function Ef(e){return"self"in e}function b9(e){return"body"in e}function b2(e,t,n,r=Ho,i,a){const o=N.useRef(null),s=N.useRef(null),l=N.useRef(null),u=N.useCallback(h=>{let d,v,m;const b=h.target;if(b9(b)||Ef(b)){const y=Ef(b)?b:b.defaultView;m=a?y.scrollX:y.scrollY,d=a?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight,v=a?y.innerWidth:y.innerHeight}else m=a?b.scrollLeft:b.scrollTop,d=a?b.scrollWidth:b.scrollHeight,v=a?b.offsetWidth:b.offsetHeight;const f=()=>{e({scrollHeight:d,scrollTop:Math.max(m,0),viewportHeight:v})};h.suppressFlushSync?f():Mo.flushSync(f),s.current!==null&&(m===s.current||m<=0||m===d-v)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,a]);N.useEffect(()=>{const h=i||o.current;return r(i||o.current),u({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",u,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",u)}},[o,u,n,r,i]);function c(h){const d=o.current;if(!d||(a?"offsetWidth"in d&&d.offsetWidth===0:"offsetHeight"in d&&d.offsetHeight===0))return;const v=h.behavior==="smooth";let m,b,f;Ef(d)?(b=Math.max(yr(d.document.documentElement,a?"width":"height"),a?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight),m=a?d.innerWidth:d.innerHeight,f=a?window.scrollX:window.scrollY):(b=d[a?"scrollWidth":"scrollHeight"],m=yr(d,a?"width":"height"),f=d[a?"scrollLeft":"scrollTop"]);const y=b-m;if(h.top=Math.ceil(Math.max(Math.min(y,h.top),0)),c2(m,b)||h.top===f){e({scrollHeight:b,scrollTop:f,viewportHeight:m}),v&&t(!0);return}v?(s.current=h.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,a&&(h={behavior:h.behavior,left:h.top}),d.scrollTo(h)}function p(h){a&&(h={behavior:h.behavior,left:h.top}),o.current.scrollBy(h)}return{scrollByCallback:p,scrollerRef:o,scrollToCallback:c}}const Sf="-webkit-sticky",F1="sticky",wg=g2(()=>{if(typeof document>"u")return F1;const e=document.createElement("div");return e.style.position=Sf,e.style.position===Sf?Sf:F1});function Ig(e){return e}const y9=Ze(()=>{const e=ge(l=>`Item ${l}`),t=ge(null),n=ge(l=>`Group ${l}`),r=ge({}),i=ge(Ig),a=ge("div"),o=ge(Ho),s=(l,u=null)=>fn(he(r,xe(c=>c[l]),ht()),u);return{components:r,computeItemKey:i,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:a,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),x9=Ze(([e,t])=>({...e,...t}),gt(p2,y9)),C9=({height:e})=>F.jsx("div",{style:{height:e}}),E9={overflowAnchor:"none",position:wg(),zIndex:1},y2={overflowAnchor:"none"},S9={...y2,display:"inline-block",height:"100%"},N1=N.memo(function({showTopList:e=!1}){const t=ke("listState"),n=er("sizeRanges"),r=ke("useWindowScroll"),i=ke("customScrollParent"),a=er("windowScrollContainerState"),o=er("scrollContainerState"),s=i||r?a:o,l=ke("itemContent"),u=ke("context"),c=ke("groupContent"),p=ke("trackItemSizes"),h=ke("itemSize"),d=ke("log"),v=er("gap"),m=ke("horizontalDirection"),{callbackRef:b}=qC(n,h,p,e?Ho:s,d,v,i,m,ke("skipAnimationFrameInResizeObserver")),[f,y]=N.useState(0);Tg("deviation",B=>{f!==B&&y(B)});const C=ke("EmptyPlaceholder"),S=ke("ScrollSeekPlaceholder")||C9,w=ke("ListComponent"),E=ke("ItemComponent"),x=ke("GroupComponent"),g=ke("computeItemKey"),I=ke("isSeeking"),A=ke("groupIndices").length>0,_=ke("alignToBottom"),T=ke("initialItemFinalLocationReached"),$=e?{}:{boxSizing:"border-box",...m?{display:"inline-block",height:"100%",marginLeft:f!==0?f:_?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:f!==0?f:_?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...T?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&C?F.jsx(C,{...ct(C,u)}):F.jsx(w,{...ct(w,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:b,style:$,children:(e?t.topItems:t.items).map(B=>{const P=B.originalIndex,k=g(P+t.firstItemIndex,B.data,u);return I?N.createElement(S,{...ct(S,u),height:B.size,index:B.index,key:k,type:B.type||"item",...B.type==="group"?{}:{groupIndex:B.groupIndex}}):B.type==="group"?N.createElement(x,{...ct(x,u),"data-index":P,"data-item-index":B.index,"data-known-size":B.size,key:k,style:E9},c(B.index,u)):N.createElement(E,{...ct(E,u),...x2(E,B.data),"data-index":P,"data-item-group-index":B.groupIndex,"data-item-index":B.index,"data-known-size":B.size,key:k,style:m?S9:y2},A?l(B.index,B.groupIndex,B.data,u):l(B.index,B.data,u))})})}),w9={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},I9={outline:"none",overflowX:"auto",position:"relative"},jo=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),_9={position:wg(),top:0,width:"100%",zIndex:1};function ct(e,t){if(typeof e!="string")return{context:t}}function x2(e,t){return{item:typeof e=="string"?void 0:t}}const D9=N.memo(function(){const e=ke("HeaderComponent"),t=er("headerHeight"),n=ke("HeaderFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,ke("skipAnimationFrameInResizeObserver")),i=ke("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null}),T9=N.memo(function(){const e=ke("FooterComponent"),t=er("footerHeight"),n=ke("HeaderFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,ke("skipAnimationFrameInResizeObserver")),i=ke("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null});function _g({useEmitter:e,useEmitterValue:t,usePublisher:n}){return N.memo(function({children:r,style:i,...a}){const o=n("scrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),u=t("scrollerRef"),c=t("context"),p=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:d,scrollToCallback:v}=b2(o,l,s,u,void 0,p);return e("scrollTo",v),e("scrollBy",h),F.jsx(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:d,style:{...p?I9:w9,...i},tabIndex:0,...a,...ct(s,c),children:r})})}function Dg({useEmitter:e,useEmitterValue:t,usePublisher:n}){return N.memo(function({children:r,style:i,...a}){const o=n("windowScrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),u=t("totalListHeight"),c=t("deviation"),p=t("customScrollParent"),h=t("context"),d=N.useRef(null),v=t("scrollerRef"),{scrollByCallback:m,scrollerRef:b,scrollToCallback:f}=b2(o,l,s,v,p);return v2(()=>{var y;return b.current=p||((y=d.current)==null?void 0:y.ownerDocument.defaultView),()=>{b.current=null}},[b,p]),e("windowScrollTo",f),e("scrollBy",m),F.jsx(s,{ref:d,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...u!==0?{height:u+c}:{}},...a,...ct(s,h),children:r})})}const A9=({children:e})=>{const t=N.useContext(Kc),n=er("viewportHeight"),r=er("fixedItemHeight"),i=ke("alignToBottom"),a=ke("horizontalDirection"),o=N.useMemo(()=>Ts(n,l=>yr(l,a?"width":"height")),[n,a]),s=Gr(o,!0,ke("skipAnimationFrameInResizeObserver"));return N.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),F.jsx("div",{"data-viewport-type":"element",ref:s,style:jo(i),children:e})},R9=({children:e})=>{const t=N.useContext(Kc),n=er("windowViewportRect"),r=er("fixedItemHeight"),i=ke("customScrollParent"),a=mg(n,i,ke("skipAnimationFrameInResizeObserver")),o=ke("alignToBottom");return N.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),F.jsx("div",{"data-viewport-type":"window",ref:a,style:jo(o),children:e})},B9=({children:e})=>{const t=ke("TopItemListComponent")||"div",n=ke("headerHeight"),r={..._9,marginTop:`${n}px`},i=ke("context");return F.jsx(t,{style:r,...ct(t,i),children:e})},k9=N.memo(function(e){const t=ke("useWindowScroll"),n=ke("topItemsIndexes").length>0,r=ke("customScrollParent"),i=ke("context"),a=r||t?F9:$9,o=r||t?R9:A9;return F.jsxs(a,{...e,...ct(a,i),children:[n&&F.jsx(B9,{children:F.jsx(N1,{showTopList:!0})}),F.jsxs(o,{children:[F.jsx(D9,{}),F.jsx(N1,{}),F.jsx(T9,{})]})]})}),{Component:P9,useEmitter:Tg,useEmitterValue:ke,usePublisher:er}=Sg(x9,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},k9),$9=_g({useEmitter:Tg,useEmitterValue:ke,usePublisher:er}),F9=Dg({useEmitter:Tg,useEmitterValue:ke,usePublisher:er}),N9=P9,M9=Ze(()=>{const e=ge(u=>F.jsxs("td",{children:["Item $",u]})),t=ge(null),n=ge(u=>F.jsxs("td",{colSpan:1e3,children:["Group ",u]})),r=ge(null),i=ge(null),a=ge({}),o=ge(Ig),s=ge(Ho),l=(u,c=null)=>fn(he(a,xe(p=>p[u]),ht()),c);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),O9=Ze(([e,t])=>({...e,...t}),gt(p2,M9)),L9=({height:e})=>F.jsx("tr",{children:F.jsx("td",{style:{height:e}})}),V9=({height:e})=>F.jsx("tr",{children:F.jsx("td",{style:{border:0,height:e,padding:0}})}),H9={overflowAnchor:"none"},M1={position:wg(),zIndex:2,overflowAnchor:"none"},O1=N.memo(function({showTopList:e=!1}){const t=Fe("listState"),n=Fe("computeItemKey"),r=Fe("firstItemIndex"),i=Fe("context"),a=Fe("isSeeking"),o=Fe("fixedHeaderHeight"),s=Fe("groupIndices").length>0,l=Fe("itemContent"),u=Fe("groupContent"),c=Fe("ScrollSeekPlaceholder")||L9,p=Fe("GroupComponent"),h=Fe("TableRowComponent"),d=(e?t.topItems:[]).reduce((m,b,f)=>(f===0?m.push(b.size):m.push(m[f-1]+b.size),m),[]),v=(e?t.topItems:t.items).map(m=>{const b=m.originalIndex,f=n(b+r,m.data,i),y=e?b===0?0:d[b-1]:0;return a?N.createElement(c,{...ct(c,i),height:m.size,index:m.index,key:f,type:m.type||"item"}):m.type==="group"?N.createElement(p,{...ct(p,i),"data-index":b,"data-item-index":m.index,"data-known-size":m.size,key:f,style:{...M1,top:o}},u(m.index,i)):N.createElement(h,{...ct(h,i),...x2(h,m.data),"data-index":b,"data-item-index":m.index,"data-known-size":m.size,"data-item-group-index":m.groupIndex,key:f,style:e?{...M1,top:o+y}:H9},s?l(m.index,m.groupIndex,m.data,i):l(m.index,m.data,i))});return F.jsx(F.Fragment,{children:v})}),j9=N.memo(function(){const e=Fe("listState"),t=Fe("topItemsIndexes").length>0,n=mr("sizeRanges"),r=Fe("useWindowScroll"),i=Fe("customScrollParent"),a=mr("windowScrollContainerState"),o=mr("scrollContainerState"),s=i||r?a:o,l=Fe("trackItemSizes"),u=Fe("itemSize"),c=Fe("log"),{callbackRef:p,ref:h}=qC(n,u,l,s,c,void 0,i,!1,Fe("skipAnimationFrameInResizeObserver")),[d,v]=N.useState(0);Ag("deviation",A=>{d!==A&&(h.current.style.marginTop=`${A}px`,v(A))});const m=Fe("EmptyPlaceholder"),b=Fe("FillerRow")||V9,f=Fe("TableBodyComponent"),y=Fe("paddingTopAddition"),C=Fe("statefulTotalCount"),S=Fe("context");if(C===0&&m)return F.jsx(m,{...ct(m,S)});const w=(t?e.topItems:[]).reduce((A,_)=>A+_.size,0),E=e.offsetTop+y+d-w,x=e.offsetBottom,g=E>0?F.jsx(b,{context:S,height:E},"padding-top"):null,I=x>0?F.jsx(b,{context:S,height:x},"padding-bottom"):null;return F.jsxs(f,{"data-testid":"virtuoso-item-list",ref:p,...ct(f,S),children:[g,t&&F.jsx(O1,{showTopList:!0}),F.jsx(O1,{}),I]})}),z9=({children:e})=>{const t=N.useContext(Kc),n=mr("viewportHeight"),r=mr("fixedItemHeight"),i=Gr(N.useMemo(()=>Ts(n,a=>yr(a,"height")),[n]),!0,Fe("skipAnimationFrameInResizeObserver"));return N.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),F.jsx("div",{"data-viewport-type":"element",ref:i,style:jo(!1),children:e})},G9=({children:e})=>{const t=N.useContext(Kc),n=mr("windowViewportRect"),r=mr("fixedItemHeight"),i=Fe("customScrollParent"),a=mg(n,i,Fe("skipAnimationFrameInResizeObserver"));return N.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),F.jsx("div",{"data-viewport-type":"window",ref:a,style:jo(!1),children:e})},W9=N.memo(function(e){const t=Fe("useWindowScroll"),n=Fe("customScrollParent"),r=mr("fixedHeaderHeight"),i=mr("fixedFooterHeight"),a=Fe("fixedHeaderContent"),o=Fe("fixedFooterContent"),s=Fe("context"),l=Gr(N.useMemo(()=>Ts(r,f=>yr(f,"height")),[r]),!0,Fe("skipAnimationFrameInResizeObserver")),u=Gr(N.useMemo(()=>Ts(i,f=>yr(f,"height")),[i]),!0,Fe("skipAnimationFrameInResizeObserver")),c=n||t?Y9:X9,p=n||t?G9:z9,h=Fe("TableComponent"),d=Fe("TableHeadComponent"),v=Fe("TableFooterComponent"),m=a?F.jsx(d,{ref:l,style:{position:"sticky",top:0,zIndex:2},...ct(d,s),children:a()},"TableHead"):null,b=o?F.jsx(v,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...ct(v,s),children:o()},"TableFoot"):null;return F.jsx(c,{...e,...ct(c,s),children:F.jsx(p,{children:F.jsxs(h,{style:{borderSpacing:0,overflowAnchor:"none"},...ct(h,s),children:[m,F.jsx(j9,{},"TableBody"),b]})})})}),{Component:U9,useEmitter:Ag,useEmitterValue:Fe,usePublisher:mr}=Sg(O9,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},W9),X9=_g({useEmitter:Ag,useEmitterValue:Fe,usePublisher:mr}),Y9=Dg({useEmitter:Ag,useEmitterValue:Fe,usePublisher:mr}),K9=U9,L1={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Z9={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:V1,floor:Qu,max:ms,min:wf,round:H1}=Math;function j1(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>({data:n===null?null:n[i+e],index:i+e}))}function J9(e){return{...Z9,items:e}}function Ll(e,t){return e&&e.width===t.width&&e.height===t.height}function q9(e,t){return e&&e.column===t.column&&e.row===t.row}const Q9=Ze(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:p},h,d,{didMount:v,propsReady:m},{customScrollParent:b,useWindowScroll:f,windowScrollContainerState:y,windowScrollTo:C,windowViewportRect:S},w])=>{const E=ge(0),x=ge(0),g=ge(L1),I=ge({height:0,width:0}),A=ge({height:0,width:0}),_=Ge(),T=Ge(),$=ge(0),B=ge(null),P=ge({column:0,row:0}),k=Ge(),O=Ge(),M=ge(!1),G=ge(0),W=ge(!0),U=ge(!1),q=ge(!1);at(he(v,Ve(G),Re(([re,R])=>!!R)),()=>{Oe(W,!1)}),at(he(Mt(v,W,A,I,G,U),Re(([re,R,H,V,,D])=>re&&!R&&H.height!==0&&V.height!==0&&!D)),([,,,,re])=>{Oe(U,!0),yg(1,()=>{Oe(_,re)}),zr(he(u),()=>{Oe(t,[0,0]),Oe(W,!0)})}),we(he(O,Re(re=>re!=null&&re.scrollTop>0),kr(0)),x),at(he(v,Ve(O),Re(([,re])=>re!=null)),([,re])=>{re&&(Oe(I,re.viewport),Oe(A,re.item),Oe(P,re.gap),re.scrollTop>0&&(Oe(M,!0),zr(he(u,Do(1)),R=>{Oe(M,!1)}),Oe(l,{top:re.scrollTop})))}),we(he(I,xe(({height:re})=>re)),p),we(he(Mt(Be(I,Ll),Be(A,Ll),Be(P,(re,R)=>re&&re.column===R.column&&re.row===R.row),Be(u)),xe(([re,R,H,V])=>({gap:H,item:R,scrollTop:V,viewport:re}))),k),we(he(Mt(Be(E),r,Be(P,q9),Be(A,Ll),Be(I,Ll),Be(B),Be(x),Be(M),Be(W),Be(G)),Re(([,,,,,,,re])=>!re),xe(([re,[R,H],V,D,L,K,X,,se,ie])=>{const{column:oe,row:te}=V,{height:ue,width:ve}=D,{width:be}=L;if(X===0&&(re===0||be===0))return L1;if(ve===0){const Dt=xg(ie,re),kt=Dt+Math.max(X-1,0);return J9(j1(Dt,kt,K))}const pe=C2(be,ve,oe);let Te,Ne;se?R===0&&H===0&&X>0?(Te=0,Ne=X-1):(Te=pe*Qu((R+te)/(ue+te)),Ne=pe*V1((H+te)/(ue+te))-1,Ne=wf(re-1,ms(Ne,pe-1)),Te=wf(Ne,ms(0,Te))):(Te=0,Ne=-1);const We=j1(Te,Ne,K),{bottom:et,top:lt}=z1(L,V,D,We),ut=V1(re/pe),xt=ut*ue+(ut-1)*te-et;return{bottom:et,itemHeight:ue,items:We,itemWidth:ve,offsetBottom:xt,offsetTop:lt,top:lt}})),g),we(he(B,Re(re=>re!==null),xe(re=>re.length)),E),we(he(Mt(I,A,g,P),Re(([re,R,{items:H}])=>H.length>0&&R.height!==0&&re.height!==0),xe(([re,R,{items:H},V])=>{const{bottom:D,top:L}=z1(re,V,R,H);return[L,D]}),ht(Bs)),t);const Q=ge(!1);we(he(u,Ve(Q),xe(([re,R])=>R||re!==0)),Q);const Z=Ln(he(Mt(g,E),Re(([{items:re}])=>re.length>0),Ve(Q),Re(([[re,R],H])=>{const V=re.items[re.items.length-1].index===R-1;return(H||re.bottom>0&&re.itemHeight>0&&re.offsetBottom===0&&re.items.length===R)&&V}),xe(([[,re]])=>re-1),ht())),ee=Ln(he(Be(g),Re(({items:re})=>re.length>0&&re[0].index===0),kr(0),ht())),J=Ln(he(Be(g),Ve(M),Re(([{items:re},R])=>re.length>0&&!R),xe(([{items:re}])=>({endIndex:re[re.length-1].index,startIndex:re[0].index})),ht(i2),Oi(0)));we(J,d.scrollSeekRangeChanged),we(he(_,Ve(I,A,E,P),xe(([re,R,H,V,D])=>{const L=u2(re),{align:K,behavior:X,offset:se}=L;let ie=L.index;ie==="LAST"&&(ie=V-1),ie=ms(0,ie,wf(V-1,ie));let oe=Zh(R,D,H,ie);return K==="end"?oe=H1(oe-R.height+H.height):K==="center"&&(oe=H1(oe-R.height/2+H.height/2)),se&&(oe+=se),{behavior:X,top:oe}})),l);const le=fn(he(g,xe(re=>re.offsetBottom+re.bottom)),0);return we(he(S,xe(re=>({height:re.visibleHeight,width:re.visibleWidth}))),I),{customScrollParent:b,data:B,deviation:$,footerHeight:i,gap:P,headerHeight:a,increaseViewportBy:e,initialItemCount:x,itemDimensions:A,overscan:n,restoreStateFrom:O,scrollBy:o,scrollContainerState:s,scrollHeight:T,scrollTo:l,scrollToIndex:_,scrollTop:u,smoothScrollTargetReached:c,totalCount:E,useWindowScroll:f,viewportDimensions:I,windowScrollContainerState:y,windowScrollTo:C,windowViewportRect:S,...d,gridState:g,horizontalDirection:q,initialTopMostItemIndex:G,totalListHeight:le,...h,endReached:Z,propsReady:m,rangeChanged:J,startReached:ee,stateChanged:k,stateRestoreInProgress:M,...w}},gt(Cg,Cn,gl,h2,Qi,Eg,qi));function C2(e,t,n){return ms(1,Qu((e+n)/(Qu(t)+n)))}function z1(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};const a=Zh(e,t,n,r[0].index);return{bottom:Zh(e,t,n,r[r.length-1].index)+i,top:a}}function Zh(e,t,n,r){const i=C2(e.width,n.width,t.column),a=Qu(r/i),o=a*n.height+ms(0,a-1)*t.row;return o>0?o+t.row:o}const ek=Ze(()=>{const e=ge(p=>`Item ${p}`),t=ge({}),n=ge(null),r=ge("virtuoso-grid-item"),i=ge("virtuoso-grid-list"),a=ge(Ig),o=ge("div"),s=ge(Ho),l=(p,h=null)=>fn(he(t,xe(d=>d[p]),ht()),h),u=ge(!1),c=ge(!1);return we(Be(c),u),{components:t,computeItemKey:a,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:o,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:i,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),tk=Ze(([e,t])=>({...e,...t}),gt(Q9,ek)),nk=N.memo(function(){const e=pt("gridState"),t=pt("listClassName"),n=pt("itemClassName"),r=pt("itemContent"),i=pt("computeItemKey"),a=pt("isSeeking"),o=tr("scrollHeight"),s=pt("ItemComponent"),l=pt("ListComponent"),u=pt("ScrollSeekPlaceholder"),c=pt("context"),p=tr("itemDimensions"),h=tr("gap"),d=pt("log"),v=pt("stateRestoreInProgress"),m=tr("reportReadyState"),b=Gr(N.useMemo(()=>f=>{const y=f.parentElement.parentElement.scrollHeight;o(y);const C=f.firstChild;if(C){const{height:S,width:w}=C.getBoundingClientRect();p({height:S,width:w})}h({column:G1("column-gap",getComputedStyle(f).columnGap,d),row:G1("row-gap",getComputedStyle(f).rowGap,d)})},[o,p,h,d]),!0,!1);return v2(()=>{e.itemHeight>0&&e.itemWidth>0&&m(!0)},[e]),v?null:F.jsx(l,{className:t,ref:b,...ct(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(f=>{const y=i(f.index,f.data,c);return a?F.jsx(u,{...ct(u,c),height:e.itemHeight,index:f.index,width:e.itemWidth},y):N.createElement(s,{...ct(s,c),className:n,"data-index":f.index,key:y},r(f.index,f.data,c))})})}),rk=N.memo(function(){const e=pt("HeaderComponent"),t=tr("headerHeight"),n=pt("headerFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,!1),i=pt("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null}),ik=N.memo(function(){const e=pt("FooterComponent"),t=tr("footerHeight"),n=pt("headerFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,!1),i=pt("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null}),ak=({children:e})=>{const t=N.useContext(m2),n=tr("itemDimensions"),r=tr("viewportDimensions"),i=Gr(N.useMemo(()=>a=>{r(a.getBoundingClientRect())},[r]),!0,!1);return N.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),F.jsx("div",{ref:i,style:jo(!1),children:e})},ok=({children:e})=>{const t=N.useContext(m2),n=tr("windowViewportRect"),r=tr("itemDimensions"),i=pt("customScrollParent"),a=mg(n,i,!1);return N.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),F.jsx("div",{ref:a,style:jo(!1),children:e})},sk=N.memo(function({...e}){const t=pt("useWindowScroll"),n=pt("customScrollParent"),r=n||t?uk:lk,i=n||t?ok:ak,a=pt("context");return F.jsx(r,{...e,...ct(r,a),children:F.jsxs(i,{children:[F.jsx(rk,{}),F.jsx(nk,{}),F.jsx(ik,{})]})})}),{useEmitter:E2,useEmitterValue:pt,usePublisher:tr}=Sg(tk,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},sk),lk=_g({useEmitter:E2,useEmitterValue:pt,usePublisher:tr}),uk=Dg({useEmitter:E2,useEmitterValue:pt,usePublisher:tr});function G1(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,An.WARN),t==="normal"?0:parseInt(t??"0",10)}const ck=({children:e,...t})=>F.jsx(F.Fragment,{children:e(t)}),dk=({children:e,...t})=>F.jsx(F.Fragment,{children:N.isValidElement(e)&&F.jsx(F.Fragment,{children:N.cloneElement(e,t)})}),Rg=N.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,fixedHeaderContent:c,itemContent:p,typeCalculateItemSize:h="manual",itemSizeNames:d=[],overscan:v=null,component:m={},idContainer:b="",triggerCalCulateContainer:f="",accumulationHeight:y=0,delayTriggerCalculateHeight:C=0,increaseViewportBy:S=()=>0,context:w={},endReached:E,increaseTotalCount:x=1}=e,[g,I]=N.useState(0),A=()=>{if(o==="min-max"){const $=(a+x)*s;return{height:a>u?l:g>$?g:$}}return o==="container"?{height:g}:{}},_=$=>{var k;const B=$.getAttribute("data-index");let P=((k=$.getBoundingClientRect())==null?void 0:k.height)||0;return d==null||d.forEach(O=>{var M,G;P+=((G=(M=document.querySelector(`[${O}="${B}"]`))==null?void 0:M.getBoundingClientRect())==null?void 0:G.height)??0}),P},T=()=>{var $;if(b&&o==="container"){const B=(($=document==null?void 0:document.getElementById(b))==null?void 0:$.offsetHeight)??0;I(B-y)}};return N.useEffect(()=>{const $=setTimeout(T,C);return window==null||window.addEventListener("resize",T),window==null||window.addEventListener("load",T),()=>{clearTimeout($),window==null||window.removeEventListener("resize",T),window==null||window.removeEventListener("load",T)}},[o,f]),F.jsx("div",{className:`1ru-w-full ${n}`,children:F.jsx(K9,{context:w,ref:t,overscan:typeof v=="function"?v(o==="container"?g:l):o==="container"?g:l,totalListHeightChanged:$=>o==="min-max"?I($):null,style:A(),totalCount:a,computeItemKey:r,itemSize:N.useCallback($=>h==="manual"?i($):_($),[]),components:{TableRow:dk,...m},fixedHeaderContent:c,itemContent:(...$)=>p(ck,...$),endReached:E,increaseViewportBy:S(o==="container"?g:l)})})});Rg.displayName="TableVirtualization";const fk="_sorting_14xsf_375",dr={"payhere-reguler":"_payhere-reguler_14xsf_109","laba-reguler":"_laba-reguler_14xsf_259","laba-small":"_laba-small_14xsf_295","pointer-laba":"_pointer-laba_14xsf_333","pointer-payhere":"_pointer-payhere_14xsf_338","resize-menu":"_resize-menu_14xsf_343",sorting:fk,"laba-grey-02":"_laba-grey-02_14xsf_396"},If={"sub-mobile-payhere-reguler":"_sub-mobile-payhere-reguler_11jpn_115"},Ka="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6673%2011.3333L8.00065%2014M8.00065%2014L5.33398%2011.3333M8.00065%2014V2'%20stroke='%23CFD8DC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function hk(e,t=null){const[n,r]=N.useState(!1);return N.useEffect(()=>{let i=null,a=null;const o=()=>{const s=i instanceof HTMLElement?i.getBoundingClientRect().width:window.innerWidth,l=window.matchMedia(e.replace("WIDTH",s.toString()));r(l.matches)};if(t){if(i=document.getElementById(t),!i)return;a=new ResizeObserver(o),a.observe(i)}else i=window,window.addEventListener("resize",o);return o(),()=>{a?a.disconnect():window.removeEventListener("resize",o)}},[e,t]),n}const gk=e=>{const t=h=>{const d=new Date,v=h.getTime()-d.getTime();return Math.max(Math.floor(v/1e3),0)},n=new Date(new Date(e.date).setHours(new Date(e.date).getHours()-((e==null?void 0:e.adjustTimesTime)??0))),[r,i]=N.useState(t(n)),[a,o]=N.useState(e.running??!1),[s,l]=N.useState(()=>e==null?void 0:e.callbackDone);return N.useEffect(()=>{let h;return a&&r>0?h=setInterval(()=>{i(d=>Math.max(d-1,0))},e.intervalMs):a&&r===0&&typeof s=="function"&&s(),()=>{h&&clearInterval(h)}},[a,r,e.intervalMs,s]),{count:r,startCountdown:()=>{o(!0)},stopCountdown:()=>{o(!1)},resetCountdown:h=>{i(typeof h=="number"?h:t(h??n))},setCallbackDone:h=>l(()=>h)}};function S2(e,t=0){const n=N.useRef({promise:null,resolve:null,reject:null,timeout:null});return N.useCallback((...i)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((a,o)=>{n.current.resolve=a,n.current.reject=o})),n.current.timeout=setTimeout(()=>{e(...i).then(a=>{n.current.resolve&&n.current.resolve(a)}).catch(a=>{n.current.reject&&n.current.reject(a)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const Bg=typeof window<"u"?N.useLayoutEffect:N.useEffect,pk=(e,t)=>{const[n,r]=N.useState({width:0,height:0}),[i,a]=N.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=N.useRef(null);return Bg(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=p=>{for(const h of p){const{width:d,height:v,top:m,left:b,bottom:f,right:y,x:C,y:S}=h.contentRect;a({width:d,height:v,top:m,left:b,bottom:f,right:y,x:C,y:S})}};let u=null;t?u=document.querySelector(t):o.current&&(u=o.current);const c=new ResizeObserver(l);return u&&c.observe(u),window.addEventListener("resize",s),s(),()=>{u&&c.unobserve(u),window.removeEventListener("resize",s)}},[t,...e??[]]),{ref:o,windowSize:n,contentRect:i}};function mk(e){const[t,n]=N.useState(e),r=N.useRef(t);return N.useEffect(()=>{r.current=t},[t]),[t,n,r]}function vk(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${JSON.stringify(t)}' to ref '${JSON.stringify(e)}'`)}}}function bk(...e){return t=>{e.forEach(n=>{vk(n,t)})}}function kg(...e){return N.useMemo(()=>bk(...e),e)}function $s(e){const t=N.useRef(e);return Y0(e,t.current)||(t.current=e),t.current}function Gi(e,t){const n=t.map($s);N.useEffect(e,n)}function yk({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){N.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const xk=({containerRef:e,children:t,columnCount:n,gapX:r,gapY:i,direction:a="masonry-ltr",debounceRecalculate:o=500,durationAnimation:s=500,enableAnimation:l=!1})=>{const u=N.useCallback(()=>{const p=e.current;if(!p)return;const h=Array.from(p.children);if(h.length===0){p.style.height="0px";return}const d=Array(n).fill(0),v=p.offsetWidth;if(v===0)return;const m=(v-(n-1)*r)/n,b=a.includes("rtl"),f=a.includes("top-down");h.forEach((C,S)=>{C.style.width=`${m}px`,C.style.position="absolute",l&&(C.style.transition=`top ${s}ms ease, left ${s}ms ease`);let w;if(f)w=S%n;else{const g=Math.min(...d);w=d.indexOf(g)}const E=d[w];let x;b?x=v-(m*(w+1)+r*w):x=w*(m+r),C.style.top=`${E}px`,C.style.left=`${x}px`,d[w]+=C.offsetHeight+i});const y=Math.max(...d);p.style.height=`${y-i}px`},[e,n,r,a,i]),c=S2(async()=>{u()},o);return N.useLayoutEffect(()=>{u()},[t,u]),N.useEffect(()=>(window.addEventListener("load",u),window.addEventListener("resize",c),()=>{window.removeEventListener("load",u),window.removeEventListener("resize",c)}),[t,c,u]),{recalculateLayout:u}},Ck=(e,t)=>{var r,i;let n={};return e&&(n={position:"sticky",top:0,zIndex:2}),(r=t.column.columnDef.meta)!=null&&r.styleTh&&(n={...n,...(i=t.column.columnDef.meta)==null?void 0:i.styleTh(t.column.columnDef)}),n},ec=(e,t=!1)=>{const n=e.getIsPinned(),r=n==="left"&&e.getIsLastColumn("left"),i=n==="right"&&e.getIsFirstColumn("right");return n?{boxShadow:r?"-4px 0 4px -4px gray inset":i?"4px 0 4px -4px gray inset":void 0,left:n==="left"?`${e.getStart("left")}px`:void 0,right:n==="right"?`${e.getAfter("right")}px`:void 0,position:"sticky",width:e.getSize(),zIndex:1,background:t?"white":""}:{}},w2=e=>{const t=e.columnPinning.left||[],n=e.columnPinning.right||[],r=e.rowPinning.top||[],i=e.rowPinning.bottom||[];return{left:t,right:n,top:r,bottom:i,isPinning:t.length>0||n.length>0||r.length>0||i.length>0}},bn=()=>({kind:{"payhere-reguler":dr["payhere-reguler"],"laba-reguler":dr["laba-reguler"],"laba-small":dr["laba-small"]},subMobile:{"payhere-reguler":If["sub-mobile-payhere-reguler"],"laba-reguler":If["sub-mobile-laba-reguler"],"laba-small":If["sub-mobile-laba-small"]},pointer:{"payhere-reguler":dr["pointer-payhere"],"laba-reguler":dr["pointer-laba"],"laba-small":dr["pointer-laba"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4"}),desc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4"}),desc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4"}),desc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":dr["laba-grey-02"]}}),Ek=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,maxHeight:s,idCalculateHeight:l,componentSortASC:u,componentSortDESC:c,classNamePointer:p,emptyPlaceholder:h,renderSubComponent:d,visibilityColumns:v,classNameSubMobile:m})=>F.jsx("div",{id:"1ru-table",style:s?{height:s,overflow:"auto"}:{},className:t??"",children:F.jsxs("table",{className:n,style:{width:w2(e.getState()).isPinning?e.getCenterTotalSize():""},children:[F.jsx("thead",{id:a,"data-calculate-height-header":l,children:e.getHeaderGroups().map(b=>F.jsx("tr",{children:b.headers.map(f=>{var C,S,w,E;const y=(S=(C=f.column.columnDef.meta)==null?void 0:C.rowSpan)==null?void 0:S.call(C,f);return!f.isPlaceholder&&y!==void 0&&f.id===f.column.id?F.jsx(F.Fragment,{}):F.jsxs("th",{style:{...Ck(s,f),...ec(f.column),...v.columns.includes(f.column.id)?{display:"none"}:{}},colSpan:typeof((w=f.column.columnDef.meta)==null?void 0:w.colSpan)=="function"?(E=f.column.columnDef.meta)==null?void 0:E.colSpan(f.column.columnDef):f.colSpan,rowSpan:y,children:[f.isPlaceholder&&y===void 0?null:F.jsxs("div",{className:f.column.getCanSort()?dr.sorting:"",onClick:f.column.getToggleSortingHandler(),children:[_o(f.column.columnDef.header,f.getContext()),f.column.getCanSort()&&F.jsx("span",{className:"1ru-flex-shrink-0",children:f.column.getIsSorted()==="asc"||f.column.getIsSorted()==="desc"?F.jsxs(F.Fragment,{children:[f.column.getIsSorted()==="asc"&&F.jsx(F.Fragment,{children:u}),f.column.getIsSorted()==="desc"&&F.jsx(F.Fragment,{children:c})]}):F.jsx(F.Fragment,{})})]}),f.column.getIsPinned()&&F.jsx("div",{onDoubleClick:()=>f.column.resetSize(),onMouseDown:f.getResizeHandler(),onTouchStart:f.getResizeHandler(),className:dr["resize-menu"]})]},f.id)})},b.id))}),F.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((b,f)=>{var y;return F.jsxs(N.Fragment,{children:[F.jsx("tr",{onClick:C=>{C.stopPropagation(),i&&typeof r=="function"&&r(b.original,b)},className:i?p:"","data-calculate-height":`${l}-${f}`,id:o(b),children:b.getVisibleCells().map(C=>{var S,w,E;return F.jsx("td",{style:{...typeof((S=C.column.columnDef.meta)==null?void 0:S.styleTd)=="function"?C.column.columnDef.meta.styleTd(b.original,b):{},...ec(C.column,!0),...v.columns.includes(C.column.id)?{display:"none"}:{}},className:typeof((w=C.column.columnDef.meta)==null?void 0:w.classNameTd)=="function"?(E=C.column.columnDef.meta)==null?void 0:E.classNameTd(b.original,b):"",children:_o(C.column.columnDef.cell,C.getContext())},C.id)})},b.id),b.getIsExpanded()&&typeof d=="function"&&F.jsx("tr",{children:F.jsx("td",{colSpan:b.getVisibleCells().length-(((y=v==null?void 0:v.realColumns)==null?void 0:y.length)||0),children:d(b.original,b,{visibilityColumns:v,classNameSubMobile:m})})})]},b.id)}),e.getRowModel().rows.length===0&&N.isValidElement(h)&&F.jsx("tr",{children:F.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:h})})]})]})}),I2=N.forwardRef((e,t)=>{const{context:n,...r}=e;return F.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});I2.displayName="VirtualizationHead";const Sk=({style:e,context:t,...n})=>F.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:{...e,width:t==null?void 0:t.width}}),wk=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,classNameTable:s,componentSortASC:l,componentSortDESC:u,classNamePointer:c,emptyPlaceholder:p,renderSubComponent:h,visibilityColumns:d,classNameSubMobile:v})=>{var f,y,C;const[m,b]=N.useState(0);return F.jsx(Rg,{context:{headerId:a,classNameTable:s,width:w2(e.getState()).isPinning?e.getCenterTotalSize():""},typeHight:"min-max",totalCount:((f=e.getRowModel().rows)==null?void 0:f.length)||0,minLengthItem:((y=e.getRowModel().rows)==null?void 0:y.length)||0,typeCalculateItemSize:"auto",component:{TableHead:I2,Table:Sk,EmptyPlaceholder:()=>F.jsx("tbody",{ref:S=>{var w;return b(((w=S==null?void 0:S.getBoundingClientRect())==null?void 0:w.height)??0)},children:F.jsx("tr",{children:F.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:N.isValidElement(p)&&p})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(S=>F.jsx("tr",{children:S.headers.map(w=>{var x,g,I,A;const E=(g=(x=w.column.columnDef.meta)==null?void 0:x.rowSpan)==null?void 0:g.call(x,w);return!w.isPlaceholder&&E!==void 0&&w.id===w.column.id?F.jsx(F.Fragment,{}):F.jsxs("th",{colSpan:w.colSpan,rowSpan:E,style:{...typeof((I=w.column.columnDef.meta)==null?void 0:I.styleTh)=="function"?(A=w.column.columnDef.meta)==null?void 0:A.styleTh(w.column.columnDef):{},...ec(w.column),...d.columns.includes(w.column.id)?{display:"none"}:{}},children:[w.isPlaceholder&&E===void 0?null:F.jsxs("div",{className:w.column.getCanSort()?dr.sorting:"",onClick:w.column.getToggleSortingHandler(),children:[_o(w.column.columnDef.header,w.getContext()),w.column.getCanSort()&&F.jsx("span",{className:"1ru-flex-shrink-0",children:w.column.getIsSorted()==="asc"||w.column.getIsSorted()==="desc"?F.jsxs(F.Fragment,{children:[w.column.getIsSorted()==="asc"&&F.jsx(F.Fragment,{children:l}),w.column.getIsSorted()==="desc"&&F.jsx(F.Fragment,{children:u})]}):F.jsx(F.Fragment,{})})]}),w.column.getIsPinned()&&F.jsx("div",{onDoubleClick:()=>w.column.resetSize(),onMouseDown:w.getResizeHandler(),onTouchStart:w.getResizeHandler(),className:dr["resize-menu"]})]},w.id)})},S.id)),itemContent:(S,w)=>{var x,g;const E=(g=(x=e.getRowModel())==null?void 0:x.rows)==null?void 0:g[w];return F.jsx(S,{children:({...I})=>{var A;return F.jsxs(N.Fragment,{children:[F.jsx("tr",{...I,onClick:_=>{_.stopPropagation(),r&&typeof n=="function"&&n(E.original,E)},className:r?c:"",id:o(E),children:E.getVisibleCells().map(_=>{var T,$,B;return F.jsx(F.Fragment,{children:F.jsx("td",{style:{...typeof((T=_.column.columnDef.meta)==null?void 0:T.styleTd)=="function"?_.column.columnDef.meta.styleTd(E.original,E):{},...ec(_.column,!0),...d.columns.includes(_.column.id)?{display:"none"}:{}},className:typeof(($=_.column.columnDef.meta)==null?void 0:$.classNameTd)=="function"?(B=_.column.columnDef.meta)==null?void 0:B.classNameTd(E.original,E):"",children:_o(_.column.columnDef.cell,_.getContext())},_.id)})})}),E.getIsExpanded()&&typeof h=="function"&&F.jsx("tr",{"data-sub-component":w,children:F.jsx("td",{colSpan:E.getVisibleCells().length-(((A=d==null?void 0:d.realColumns)==null?void 0:A.length)||0),children:h(E.original,E,{visibilityColumns:d,classNameSubMobile:v})})})]},E.id)}},E.id)},...i,minHeightItem:((i==null?void 0:i.minHeightItem)??60)+((((C=e.getRowModel().rows)==null?void 0:C.length)||0)>0?0:m),itemSizeNames:typeof h=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},Ik=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",maxHeight:c=0,idCalculateHeight:p=void 0,kind:h="laba-reguler",componentSortASC:d,componentSortDESC:v,scrollTop:m=!1,emptyPlaceholder:b,variant:f,renderSubComponent:y,columnBreakpoints:C})=>{var A;const[S,w]=N.useState(0),[E,x]=N.useState({columns:[],realColumns:[]}),g=()=>{if(![void 0,"undefined"].includes(p)){const _=document.querySelector(`[data-calculate-height-header="${p}"]`);let T=0;const $=document.querySelectorAll(`[data-calculate-height^="${p}-"]`);return $==null||$.forEach(B=>{T+=B.offsetHeight}),T>c?c+_.offsetHeight:0}return c},I=()=>{var B;const _=((B=document.querySelector("body"))==null?void 0:B.offsetWidth)||0,T=C==null?void 0:C.sort((P,k)=>{const O=(P.maxWidth??P.minWidth)||0,M=(k.maxWidth??k.minWidth)||0;return O!==M?O-M:P.maxWidth?-1:1}),$=(T==null?void 0:T.find(P=>!!(Object.hasOwnProperty.call(P,"maxWidth")&&_<=(P.maxWidth||0)||Object.hasOwnProperty.call(P,"minWidth")&&_>=(P.minWidth||0))))||{};Object.keys($).length>0?(x({columns:$.columns,realColumns:$.realColumns||$.columns}),$!=null&&$.resetExpanded&&e.resetExpanded()):x({columns:[],realColumns:[]})};return Gi(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),Gi(()=>{c>0&&w(g())},[(A=e==null?void 0:e.options)==null?void 0:A.data,c]),Gi(()=>{if(Array.isArray(C)&&(C==null?void 0:C.length)>0)return I(),window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[C]),F.jsxs(F.Fragment,{children:[!o&&F.jsx(Ek,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${bn().kind[h]} ${f?bn().variant[f]:""}
68
- ${m?bn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,maxHeight:S,idCalculateHeight:p,componentSortASC:N.isValidElement(d)?d:bn().sortingIcon[h].asc,componentSortDESC:N.isValidElement(v)?v:bn().sortingIcon[h].desc,classNamePointer:bn().pointer[h],emptyPlaceholder:b,renderSubComponent:y,visibilityColumns:E,classNameSubMobile:bn().subMobile[h]}),o&&F.jsx(wk,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${bn().kind[h]} ${f?bn().variant[f]:""}
69
- ${m?bn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,virtualizationProps:s,componentSortASC:N.isValidElement(d)?d:bn().sortingIcon[h].asc,componentSortDESC:N.isValidElement(v)?v:bn().sortingIcon[h].desc,classNamePointer:bn().pointer[h],emptyPlaceholder:b,renderSubComponent:y,visibilityColumns:E,classNameSubMobile:bn().subMobile[h]})]})},_k=(e,t,{visibilityColumns:n,classNameSubMobile:r})=>F.jsx("table",{className:"-1ru-mx-6 -1ru-my-3 !1ru-w-[calc(100%+48px)]",children:F.jsx("tbody",{children:t.getVisibleCells().map((i,a)=>{var o,s,l,u,c,p;return F.jsx(F.Fragment,{children:n!=null&&n.columns.includes(i.column.id)?F.jsxs("tr",{className:r,children:[F.jsx("td",{"data-section":"left",style:{...typeof((o=i.column.columnDef.meta)==null?void 0:o.styleTdLeftCellSubs)=="function"?(s=i.column.columnDef.meta)==null?void 0:s.styleTdLeftCellSubs(t.original,t):{}},children:F.jsxs("div",{children:[typeof i.column.columnDef.header=="string"&&F.jsx(F.Fragment,{children:i.column.columnDef.header}),typeof i.column.columnDef.header!="string"&&((l=i.column.columnDef.meta)==null?void 0:l.labelCellSubs)&&F.jsx(F.Fragment,{children:(u=i.column.columnDef.meta)==null?void 0:u.labelCellSubs(t.original,t)})]})}),F.jsx("td",{"data-section":"right",style:{...typeof((c=i.column.columnDef.meta)==null?void 0:c.styleTdRightCellSubs)=="function"?(p=i.column.columnDef.meta)==null?void 0:p.styleTdRightCellSubs(t.original,t):{}},children:F.jsxs("div",{children:[F.jsx("div",{className:"1ru-pr-1",children:":"})," ",_o(i.column.columnDef.cell,i.getContext())]})})]},i.id):F.jsx(F.Fragment,{})},a)})})}),Dk=({children:e,...t})=>F.jsx(F.Fragment,{children:e(t)}),Tk=({children:e,...t})=>F.jsx(F.Fragment,{children:N.isValidElement(e)&&F.jsx(F.Fragment,{children:N.cloneElement(e,t)})}),_2=N.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,itemContent:c,typeCalculateItemSize:p="manual",itemSizeNames:h=[],overscan:d=null,component:v={},idContainer:m="",triggerCalCulateContainer:b="",accumulationHeight:f=0,delayTriggerCalculateHeight:y=0,increaseViewportBy:C=()=>0,context:S={},endReached:w,increaseTotalCount:E=1}=e,[x,g]=N.useState(0),I=()=>{if(o==="min-max"){const T=(a+E)*s;return{height:a>u?l:x>T?x:T}}return o==="container"?{height:x}:{}},A=T=>{var P;const $=T.getAttribute("data-index");let B=((P=T.getBoundingClientRect())==null?void 0:P.height)||0;return h==null||h.forEach(k=>{var O,M;B+=((M=(O=document.querySelector(`[${k}="${$}"]`))==null?void 0:O.getBoundingClientRect())==null?void 0:M.height)??0}),B},_=()=>{var T;if(m&&o==="container"){const $=((T=document==null?void 0:document.getElementById(m))==null?void 0:T.offsetHeight)??0;g($-f)}};return N.useEffect(()=>{const T=setTimeout(_,y);return window==null||window.addEventListener("resize",_),window==null||window.addEventListener("load",_),()=>{clearTimeout(T),window==null||window.removeEventListener("resize",_),window==null||window.removeEventListener("load",_)}},[o,b]),F.jsx("div",{className:`1ru-w-full ${n}`,children:F.jsx(N9,{context:S,ref:t,overscan:typeof d=="function"?d(o==="container"?x:l):o==="container"?x:l,totalListHeightChanged:T=>o==="min-max"?g(T):null,style:I(),totalCount:a,computeItemKey:r,itemSize:N.useCallback(T=>p==="manual"?i(T):A(T),[]),itemContent:(...T)=>c(Dk,...T),components:{Item:Tk,...v},endReached:w,increaseViewportBy:C(o==="container"?x:l)})})});_2.displayName="ListVirtualization";const Ak="_ripple_14zyp_393",Rk="_active_14zyp_400",$t={"tabs-m":"_tabs-m_14zyp_115","tabs-list":"_tabs-list_14zyp_115","button-tabs":"_button-tabs_14zyp_115","container-tabs":"_container-tabs_14zyp_115","original-laba-blue-10":"_original-laba-blue-10_14zyp_115","tabs-s":"_tabs-s_14zyp_139","tabs-medium":"_tabs-medium_14zyp_259","tabs-small":"_tabs-small_14zyp_289","disable-transition":"_disable-transition_14zyp_313","tab-panel":"_tab-panel_14zyp_317",ripple:Ak,active:Rk,"tabs-slider":"_tabs-slider_14zyp_407","container-payhere-brand-base":"_container-payhere-brand-base_14zyp_415","container-payhere-brand-base-bg_white":"_container-payhere-brand-base-bg_white_14zyp_452","container-laba-blue-10":"_container-laba-blue-10_14zyp_489","container-laba-blue-10-bg_white":"_container-laba-blue-10-bg_white_14zyp_526","container-laba-blue-10-bg_blue-01":"_container-laba-blue-10-bg_blue-01_14zyp_563"},Zc={"0px":"1ru-rounded-none","2px":"1ru-rounded-sm","4px":"1ru-rounded","6px":"1ru-rounded-md","8px":"1ru-rounded-lg","12px":"1ru-rounded-xl","16px":"1ru-rounded-2xl","24px":"1ru-rounded-3xl",full:"1ru-rounded-full"},Bk=({id:e,value:t="",keyValueTab:n="",tabsList:r,className:i,classNameContainer:a,classNameButton:o,variant:s="original-laba-blue-10",size:l="tabs-m",borderRadius:u="0px",disabled:c,animation:p=!0,mountedExecuteChange:h=!0,typeButton:d="button",onChange:v,locale:m})=>{var _;const b=N.useRef([]);let f=r||[];const y=Object.fromEntries(new URL(window.location.href).searchParams.entries()),C={tabsVariant:{"original-laba-blue-10":$t["original-laba-blue-10"],"container-payhere-brand-base":$t["container-payhere-brand-base"],"container-payhere-brand-base-bg_white":$t["container-payhere-brand-base-bg_white"],"container-laba-blue-10":$t["container-laba-blue-10"],"container-laba-blue-10-bg_white":$t["container-laba-blue-10-bg_white"],"container-laba-blue-10-bg_blue-01":$t["container-laba-blue-10-bg_blue-01"]},size:{"tabs-m":$t["tabs-m"],"tabs-s":$t["tabs-s"],"tabs-medium":$t["tabs-medium"],"tabs-small":$t["tabs-small"]},borderRadius:Zc,isContainer:["container-payhere-brand-base","container-payhere-brand-base-bg_white","container-laba-blue-10","container-laba-blue-10-bg_white","container-laba-blue-10-bg_blue-01"]},[S,w]=N.useState(-1),[E,x]=N.useState({height:0,width:0,left:0});f=f.filter(T=>typeof(T==null?void 0:T.isHide)=="boolean"?!T.isHide:!0);const g=T=>{const $=T.currentTarget,B=document.createElement("span"),P=Math.max($.clientWidth,$.clientHeight),k=P/2;B.style.width=B.style.height=`${P}px`,B.style.left=`${T.clientX-$.getBoundingClientRect().left-k}px`,B.style.top=`${T.clientY-$.getBoundingClientRect().top-k}px`,B.classList.add($t.ripple);const O=$.getElementsByClassName($t.ripple)[0];O&&O.remove(),$.appendChild(B),setTimeout(()=>{B.remove()},500)},I=(T,$)=>{typeof v=="function"&&v(T,$)},A=N.useCallback((T,$)=>{var B,P;return m&&((P=(B=r.find(O=>O.id===T))==null?void 0:B.locale)==null?void 0:P[m])||$},[m]);return N.useEffect(()=>{function T(){const $=b.current[S],B={left:($==null?void 0:$.offsetLeft)??0,width:($==null?void 0:$.clientWidth)??0,height:C.isContainer.includes(s)?($==null?void 0:$.clientHeight)||0:4};x(B)}return S>=0&&T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[S]),N.useEffect(()=>{const T=f.findIndex($=>$.id===(y==null?void 0:y[n])||$.id===t);if((y!=null&&y[n]||t)&&T>=0){w(T);const $=f==null?void 0:f.find(B=>B.id===(y==null?void 0:y[n]));y!=null&&y[n]&&$&&!t&&h&&I($,"mounted")}T<0&&h&&I(f[0],"mounted")},[JSON.stringify(t),JSON.stringify(y==null?void 0:y[n])]),F.jsx("div",{className:`${$t["container-tabs"]} ${c?"1ru-opacity-50":""} ${a??""}`,children:F.jsxs("div",{className:`${C.tabsVariant[s]}
67
+ */function _o(e,t){return e?SB(e)?ae.createElement(e,t):e:null}function SB(e){return wB(e)||typeof e=="function"||IB(e)}function wB(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function IB(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _B(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ae.useState(()=>({current:YC(t)})),[r,i]=ae.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const DB=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:SC,ColumnFiltering:kC,ColumnGrouping:PC,ColumnOrdering:FC,ColumnPinning:NC,ColumnSizing:MC,ColumnVisibility:LC,GlobalFaceting:VC,GlobalFiltering:HC,Headers:EC,RowExpanding:jC,RowPagination:zC,RowPinning:GC,RowSelection:WC,RowSorting:XC,_getVisibleLeafColumns:ho,aggregationFns:bu,buildHeaderGroups:rs,createCell:xC,createColumn:CC,createColumnHelper:UR,createRow:dl,createTable:YC,defaultColumnSizing:is,expandRows:fg,filterFns:Br,flattenBy:ug,flexRender:_o,functionalUpdate:oi,getCoreRowModel:dB,getExpandedRowModel:fB,getFacetedMinMaxValues:hB,getFacetedRowModel:mB,getFacetedUniqueValues:vB,getFilteredRowModel:bB,getGroupedRowModel:yB,getMemoOptions:Se,getPaginationRowModel:CB,getSortedRowModel:EB,isFunction:cl,isNumberArray:yC,isRowSelected:Gc,isSubRowSelected:Yu,makeStateUpdater:Rn,memo:Ee,noop:XR,orderColumns:$C,passiveEventSupported:OC,reSplitAlphaNumeric:Ku,selectRowsFn:yu,shouldAutoRemoveFilter:jh,sortingFns:io,useReactTable:_B},Symbol.toStringTag,{value:"Module"})),Wc=0,Ji=1,Vo=2,ZC=4;function S1(e){return()=>e}function TB(e){e()}function Ts(e,t){return n=>e(t(n))}function w1(e,t){return()=>e(t)}function AB(e,t){return n=>e(t,n)}function hg(e){return e!==void 0}function RB(...e){return()=>{e.map(TB)}}function Ho(){}function Uc(e,t){return t(e),e}function BB(e,t){return t(e)}function gt(...e){return e}function at(e,t){return e(Ji,t)}function Oe(e,t){e(Wc,t)}function gg(e){e(Vo)}function nn(e){return e(ZC)}function we(e,t){return at(e,AB(t,Wc))}function zr(e,t){const n=e(Ji,r=>{n(),t(r)});return n}function I1(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function JC(e,t){return e===t}function ht(e=JC){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Re(e){return t=>n=>{e(n)&&t(n)}}function xe(e){return t=>Ts(t,e)}function kr(e){return t=>()=>{t(e)}}function he(e,...t){const n=kB(...t);return(r,i)=>{switch(r){case Vo:gg(e);return;case Ji:return at(e,n(i))}}}function Fr(e,t){return n=>r=>{n(t=e(t,r))}}function Do(e){return t=>n=>{e>0?e--:t(n)}}function Oi(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Ve(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);at(a,l=>{const u=n;n=n|s,t[o]=l,u!==i&&n===i&&r&&(r(),r=null)})}),a=>o=>{const s=()=>{a([o].concat(t))};n===i?s():r=s}}function kB(...e){return t=>e.reduceRight(BB,t)}function PB(e){let t,n;const r=()=>t==null?void 0:t();return function(i,a){switch(i){case Ji:return a?n===a?void 0:(r(),n=a,t=at(e,a),t):(r(),Ho);case Vo:r(),n=null;return}}}function ge(e){let t=e;const n=We();return(r,i)=>{switch(r){case Wc:t=i;break;case Ji:{i(t);break}case ZC:return t}return n(r,i)}}function hn(e,t){return Uc(ge(t),n=>we(e,n))}function We(){const e=[];return(t,n)=>{switch(t){case Wc:e.slice().forEach(r=>{r(n)});return;case Vo:e.splice(0,e.length);return;case Ji:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}}}function Ln(e){return Uc(We(),t=>we(e,t))}function Je(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:$B(),singleton:n}}const $B=()=>Symbol();function FB(e){const t=new Map,n=({constructor:r,dependencies:i,id:a,singleton:o})=>{if(o&&t.has(a))return t.get(a);const s=r(i.map(l=>n(l)));return o&&t.set(a,s),s};return n(e)}function Mt(...e){const t=We(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((a,o)=>{const s=Math.pow(2,o);at(a,l=>{n[o]=l,r=r|s,r===i&&Oe(t,n)})}),function(a,o){switch(a){case Vo:{gg(t);return}case Ji:return r===i&&o(n),at(t,o)}}}function Be(e,t=JC){return he(e,ht(t))}function _1(...e){return function(t,n){switch(t){case Vo:return;case Ji:return RB(...e.map(r=>at(r,n)))}}}var An=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(An||{});const NB={0:"debug",3:"error",1:"log",2:"warn"},MB=()=>typeof globalThis>"u"?window:globalThis,qi=Je(()=>{const e=ge(3);return{log:ge((t,n,r=1)=>{var i;const a=(i=MB().VIRTUOSO_LOG_LEVEL)!=null?i:nn(e);r>=a&&console[NB[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function Gr(e,t,n){return pg(e,t,n).callbackRef}function pg(e,t,n){const r=N.useRef(null);let i=o=>{};const a=N.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const s=()=>{const l=o[0].target;l.offsetParent!==null&&e(l)};n?s():requestAnimationFrame(s)}):null,[e,n]);return i=o=>{o&&t?(a==null||a.observe(o),r.current=o):(r.current&&(a==null||a.unobserve(r.current)),r.current=null)},{callbackRef:i,ref:r}}function qC(e,t,n,r,i,a,o,s,l){const u=N.useCallback(c=>{const p=OB(c.children,t,s?"offsetWidth":"offsetHeight",i);let h=c.parentElement;for(;!h.dataset.virtuosoScroller;)h=h.parentElement;const d=h.lastElementChild.dataset.viewportType==="window";let v;d&&(v=h.ownerDocument.defaultView);const m=o?s?o.scrollLeft:o.scrollTop:d?s?v.scrollX||v.document.documentElement.scrollLeft:v.scrollY||v.document.documentElement.scrollTop:s?h.scrollLeft:h.scrollTop,b=o?s?o.scrollWidth:o.scrollHeight:d?s?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:s?h.scrollWidth:h.scrollHeight,f=o?s?o.offsetWidth:o.offsetHeight:d?s?v.innerWidth:v.innerHeight:s?h.offsetWidth:h.offsetHeight;r({scrollHeight:b,scrollTop:Math.max(m,0),viewportHeight:f}),a==null||a(s?D1("column-gap",getComputedStyle(c).columnGap,i):D1("row-gap",getComputedStyle(c).rowGap,i)),p!==null&&e(p)},[e,t,i,a,o,r,s]);return pg(u,n,l)}function OB(e,t,n,r){const i=e.length;if(i===0)return null;const a=[];for(let o=0;o<i;o++){const s=e.item(o);if(s.dataset.index===void 0)continue;const l=parseInt(s.dataset.index),u=parseFloat(s.dataset.knownSize),c=t(s,n);if(c===0&&r("Zero-sized element, this should not happen",{child:s},An.ERROR),c===u)continue;const p=a[a.length-1];a.length===0||p.size!==c||p.endIndex!==l-1?a.push({endIndex:l,size:c,startIndex:l}):a[a.length-1].endIndex++}return a}function D1(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,An.WARN),t==="normal"?0:parseInt(t??"0",10)}function mg(e,t,n){const r=N.useRef(null),i=N.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const u=l.getBoundingClientRect(),c=u.width;let p,h;if(t){const d=t.getBoundingClientRect(),v=u.top-d.top;h=d.height-Math.max(0,v),p=v+t.scrollTop}else{const d=o.current.ownerDocument.defaultView;h=d.innerHeight-Math.max(0,u.top),p=u.top+d.scrollY}r.current={offsetTop:p,visibleHeight:h,visibleWidth:c},e(r.current)},[e,t]),{callbackRef:a,ref:o}=pg(i,!0,n),s=N.useCallback(()=>{i(o.current)},[i,o]);return N.useEffect(()=>{var l;if(t){t.addEventListener("scroll",s);const u=new ResizeObserver(()=>{requestAnimationFrame(s)});return u.observe(t),()=>{t.removeEventListener("scroll",s),u.unobserve(t)}}else{const u=(l=o.current)==null?void 0:l.ownerDocument.defaultView;return u==null||u.addEventListener("scroll",s),u==null||u.addEventListener("resize",s),()=>{u==null||u.removeEventListener("scroll",s),u==null||u.removeEventListener("resize",s)}}},[s,t,o]),a}const En=Je(()=>{const e=We(),t=We(),n=ge(0),r=We(),i=ge(0),a=We(),o=We(),s=ge(0),l=ge(0),u=ge(0),c=ge(0),p=We(),h=We(),d=ge(!1),v=ge(!1),m=ge(!1);return we(he(e,xe(({scrollTop:b})=>b)),t),we(he(e,xe(({scrollHeight:b})=>b)),o),we(t,i),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:s,horizontalDirection:v,scrollBy:h,scrollContainerState:e,scrollHeight:o,scrollingInProgress:d,scrollTo:p,scrollTop:t,skipAnimationFrameInResizeObserver:m,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),As={lvl:0};function QC(e,t){const n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:s,value:l}=t(e[o]);a.push({end:s-1,start:r,value:i}),r=s,i=l}return a.push({end:1/0,start:r,value:i}),a}function st(e){return e===As}function Rs(e,t){if(!st(e))return t===e.k?e.v:t<e.k?Rs(e.l,t):Rs(e.r,t)}function br(e,t,n="k"){if(st(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=br(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return br(e.l,t,n)}function Mn(e,t,n){return st(e)?n2(t,n,1):t===e.k?Ft(e,{k:t,v:n}):t<e.k?T1(Ft(e,{l:Mn(e.l,t,n)})):T1(Ft(e,{r:Mn(e.r,t,n)}))}function go(){return As}function Xc(e,t,n){if(st(e))return[];const r=br(e,t)[0];return LB(Xh(e,r,n))}function Uh(e,t){if(st(e))return As;const{k:n,l:r,r:i}=e;if(t===n){if(st(r))return i;if(st(i))return r;{const[a,o]=t2(r);return xu(Ft(e,{k:a,l:e2(r),v:o}))}}else return t<n?xu(Ft(e,{l:Uh(r,t)})):xu(Ft(e,{r:Uh(i,t)}))}function pa(e){return st(e)?[]:[...pa(e.l),{k:e.k,v:e.v},...pa(e.r)]}function Xh(e,t,n){if(st(e))return[];const{k:r,l:i,r:a,v:o}=e;let s=[];return r>t&&(s=s.concat(Xh(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Xh(a,t,n))),s}function xu(e){const{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(xf(t))return r2(Ft(e,{lvl:n-1}));if(!st(t)&&!st(t.r))return Ft(t.r,{l:Ft(t,{r:t.r.l}),lvl:n,r:Ft(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(xf(e))return Yh(Ft(e,{lvl:n-1}));if(!st(r)&&!st(r.l)){const i=r.l,a=xf(i)?r.lvl-1:r.lvl;return Ft(i,{l:Ft(e,{lvl:n-1,r:i.l}),lvl:i.lvl+1,r:Yh(Ft(r,{l:i.r,lvl:a}))})}else throw new Error("Unexpected empty nodes")}}function Ft(e,t){return n2(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function e2(e){return st(e.r)?e.l:xu(Ft(e,{r:e2(e.r)}))}function xf(e){return st(e)||e.lvl>e.r.lvl}function t2(e){return st(e.r)?[e.k,e.v]:t2(e.r)}function n2(e,t,n,r=As,i=As){return{k:e,l:r,lvl:n,r:i,v:t}}function T1(e){return Yh(r2(e))}function r2(e){const{l:t}=e;return!st(t)&&t.lvl===e.lvl?Ft(t,{r:Ft(e,{l:t.r})}):e}function Yh(e){const{lvl:t,r:n}=e;return!st(n)&&!st(n.r)&&n.lvl===t&&n.r.lvl===t?Ft(n,{l:Ft(e,{r:n.l}),lvl:t+1}):e}function LB(e){return QC(e,({k:t,v:n})=>({index:t,value:n}))}function i2(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function Bs(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const vg=Je(()=>({recalcInProgress:ge(!1)}),[],{singleton:!0});function a2(e,t,n){return e[Zu(e,t,n)]}function Zu(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function VB(e,t,n,r){const i=Zu(e,t,r),a=Zu(e,n,r,i);return e.slice(i,a+1)}function yr(e,t){return Math.round(e.getBoundingClientRect()[t])}function Yc(e){return!st(e.groupOffsetTree)}function bg({index:e},t){return t===e?0:t<e?-1:1}function HB(){return{groupIndices:[],groupOffsetTree:go(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:go()}}function jB(e,t){let n=st(e)?0:1/0;for(const r of t){const{endIndex:i,size:a,startIndex:o}=r;if(n=Math.min(n,o),st(e)){e=Mn(e,0,a);continue}const s=Xc(e,o-1,i+1);if(s.some(KB(r)))continue;let l=!1,u=!1;for(const{end:c,start:p,value:h}of s)l?(i>=p||a===h)&&(e=Uh(e,p)):(u=h!==a,l=!0),c>i&&i>=p&&h!==a&&(e=Mn(e,i+1,h));u&&(e=Mn(e,o,a))}return[e,n]}function zB(e){return typeof e.groupIndex<"u"}function GB({offset:e},t){return t===e?0:t<e?-1:1}function ks(e,t,n){if(t.length===0)return 0;const{index:r,offset:i,size:a}=a2(t,e,bg),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function o2(e,t){if(!Yc(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function s2(e,t,n){if(zB(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=o2(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function WB(e,t,n,r=0){return r>0&&(t=Math.max(t,a2(e,r,bg).offset)),QC(VB(e,t,n,GB),YB)}function UB(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,An.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&st(a)&&t.length===2){const h=t[0].size,d=t[1].size;o=n.reduce((v,m)=>Mn(Mn(v,m,h),m+1,d),o)}else[o,s]=jB(o,t);if(o===a)return e;const{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:p}=Kh(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((h,d)=>Mn(h,d,ks(d,p,i)),go()),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:p,sizeTree:o}}function XB(e){return pa(e).map(({k:t,v:n},r,i)=>{const a=i[r+1];return{endIndex:a?a.k-1:1/0,size:n,startIndex:t}})}function A1(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Kh(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=Zu(i,t-1,bg),s=i[l].offset;const u=br(n,t-1);a=u[0],o=u[1],i.length&&i[l].size===br(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of Xc(n,t,1/0)){const p=u-a,h=p*o+s+p*r;i.push({index:u,offset:h,size:c}),a=u,s=h,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function YB(e){return{index:e.index,value:e}}function KB(e){const{endIndex:t,size:n,startIndex:r}=e;return i=>i.start===r&&(i.end===t||i.end===1/0)&&i.value===n}const ZB={offsetHeight:"height",offsetWidth:"width"},Xr=Je(([{log:e},{recalcInProgress:t}])=>{const n=We(),r=We(),i=hn(r,0),a=We(),o=We(),s=ge(0),l=ge([]),u=ge(void 0),c=ge(void 0),p=ge((w,E)=>yr(w,ZB[E])),h=ge(void 0),d=ge(0),v=HB(),m=hn(he(n,Ve(l,e,d),Fr(UB,v),ht()),v),b=hn(he(l,ht(),Fr((w,E)=>({current:E,prev:w.current}),{current:[],prev:[]}),xe(({prev:w})=>w)),[]);we(he(l,Re(w=>w.length>0),Ve(m,d),xe(([w,E,x])=>{const g=w.reduce((I,A,_)=>Mn(I,A,ks(A,E.offsetTree,x)||_),go());return{...E,groupIndices:w,groupOffsetTree:g}})),m),we(he(r,Ve(m),Re(([w,{lastIndex:E}])=>w<E),xe(([w,{lastIndex:E,lastSize:x}])=>[{endIndex:E,size:x,startIndex:w}])),n),we(u,c);const f=hn(he(u,xe(w=>w===void 0)),!0);we(he(c,Re(w=>w!==void 0&&st(nn(m).sizeTree)),xe(w=>[{endIndex:0,size:w,startIndex:0}])),n);const y=Ln(he(n,Ve(m),Fr(({sizes:w},[E,x])=>({changed:x!==w,sizes:x}),{changed:!1,sizes:v}),xe(w=>w.changed)));at(he(s,Fr((w,E)=>({diff:w.prev-E,prev:E}),{diff:0,prev:0}),xe(w=>w.diff)),w=>{const{groupIndices:E}=nn(m);if(w>0)Oe(t,!0),Oe(a,w+A1(w,E));else if(w<0){const x=nn(b);x.length>0&&(w-=A1(-w,x)),Oe(o,w)}}),at(he(s,Ve(e)),([w,E])=>{w<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},An.ERROR)});const C=Ln(a);we(he(a,Ve(m),xe(([w,E])=>{const x=E.groupIndices.length>0,g=[],I=E.lastSize;if(x){const A=Rs(E.sizeTree,0);let _=0,T=0;for(;_<w;){const B=E.groupIndices[T],P=E.groupIndices.length===T+1?1/0:E.groupIndices[T+1]-B-1;g.push({endIndex:B,size:A,startIndex:B}),g.push({endIndex:B+1+P-1,size:I,startIndex:B+1}),T++,_+=P+1}const $=pa(E.sizeTree);return _!==w&&$.shift(),$.reduce((B,{k:P,v:k})=>{let O=B.ranges;return B.prevSize!==0&&(O=[...B.ranges,{endIndex:P+w-1,size:B.prevSize,startIndex:B.prevIndex}]),{prevIndex:P+w,prevSize:k,ranges:O}},{prevIndex:w,prevSize:0,ranges:g}).ranges}return pa(E.sizeTree).reduce((A,{k:_,v:T})=>({prevIndex:_+w,prevSize:T,ranges:[...A.ranges,{endIndex:_+w-1,size:A.prevSize,startIndex:A.prevIndex}]}),{prevIndex:0,prevSize:I,ranges:[]}).ranges})),n);const S=Ln(he(o,Ve(m,d),xe(([w,{offsetTree:E},x])=>{const g=-w;return ks(g,E,x)})));return we(he(o,Ve(m,d),xe(([w,E,x])=>{if(E.groupIndices.length>0){if(st(E.sizeTree))return E;let g=go();const I=nn(b);let A=0,_=0,T=0;for(;A<-w;){T=I[_];const $=I[_+1]-T-1;_++,A+=$+1}if(g=pa(E.sizeTree).reduce(($,{k:B,v:P})=>Mn($,Math.max(0,B+w),P),g),A!==-w){const $=Rs(E.sizeTree,T);g=Mn(g,0,$);const B=br(E.sizeTree,-w+1)[1];g=Mn(g,1,B)}return{...E,sizeTree:g,...Kh(E.offsetTree,0,g,x)}}else{const g=pa(E.sizeTree).reduce((I,{k:A,v:_})=>Mn(I,Math.max(0,A+w),_),go());return{...E,sizeTree:g,...Kh(E.offsetTree,0,g,x)}}})),m),{beforeUnshiftWith:C,data:h,defaultItemSize:c,firstItemIndex:s,fixedItemSize:u,gap:d,groupIndices:l,itemSize:p,listRefresh:y,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:m,statefulTotalCount:i,totalCount:r,trackItemSizes:f,unshiftWith:a}},gt(qi,vg),{singleton:!0});function JB(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const l2=Je(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const a=We(),o=We(),s=Ln(he(a,xe(JB)));return we(he(s,xe(l=>l.totalCount)),n),we(he(s,xe(l=>l.groupIndices)),e),we(he(Mt(i,t,r),Re(([l,u])=>Yc(u)),xe(([l,u,c])=>br(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),ht(),xe(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},gt(Xr,En)),Qi=Je(([{log:e}])=>{const t=ge(!1),n=Ln(he(t,Re(r=>r),ht()));return at(t,r=>{r&&nn(e)("props updated",{},An.DEBUG)}),{didMount:n,propsReady:t}},gt(qi),{singleton:!0}),qB=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function u2(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!qB)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const fl=Je(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:p},{log:h}])=>{const d=We(),v=We(),m=ge(0);let b=null,f=null,y=null;function C(){b&&(b(),b=null),y&&(y(),y=null),f&&(clearTimeout(f),f=null),Oe(l,!1)}return we(he(d,Ve(n,p,r,m,s,o,h),Ve(e,a,i),xe(([[S,w,E,x,g,I,A,_],T,$,B])=>{const P=u2(S),{align:k,behavior:O,offset:M}=P,G=x-1,W=s2(P,w,G);let U=ks(W,w.offsetTree,T)+I;k==="end"?(U+=$+br(w.sizeTree,W)[1]-E+B,W===G&&(U+=A)):k==="center"?U+=($+br(w.sizeTree,W)[1]-E+B)/2:U-=g,M&&(U+=M);const q=Q=>{C(),Q?(_("retrying to scroll to",{location:S},An.DEBUG),Oe(d,S)):(Oe(v,!0),_("list did not change, scroll successful",{},An.DEBUG))};if(C(),O==="smooth"){let Q=!1;y=at(t,Z=>{Q=Q||Z}),b=zr(c,()=>{q(Q)})}else b=zr(he(t,QB(150)),q);return f=setTimeout(()=>{C()},1200),Oe(l,!0),_("scrolling from index to",{behavior:O,index:W,top:U},An.DEBUG),{behavior:O,top:U}})),u),{scrollTargetReached:v,scrollToIndex:d,topListHeight:m}},gt(Xr,En,qi),{singleton:!0});function QB(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}function yg(e,t){e==0?t():requestAnimationFrame(()=>{yg(e-1,t)})}function xg(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const hl=Je(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{const s=ge(!0),l=ge(0),u=ge(!0);return we(he(o,Ve(l),Re(([c,p])=>!!p),kr(!1)),s),we(he(o,Ve(l),Re(([c,p])=>!!p),kr(!1)),u),at(he(Mt(t,o),Ve(s,n,e,u),Re(([[,c],p,{sizeTree:h},d,v])=>c&&(!st(h)||hg(d))&&!p&&!v),Ve(l)),([,c])=>{zr(i,()=>{Oe(u,!0)}),yg(4,()=>{zr(r,()=>{Oe(s,!0)}),Oe(a,c)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:s}},gt(Xr,En,fl,Qi),{singleton:!0});function c2(e,t){return Math.abs(e-t)<1.01}const Ps="up",ps="down",e9="none",t9={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},n9=0,gl=Je(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{const o=ge(!1),s=ge(!0),l=We(),u=We(),c=ge(4),p=ge(n9),h=hn(he(_1(he(Be(i),Do(1),kr(!0)),he(Be(i),Do(1),kr(!1),I1(100))),ht()),!1),d=hn(he(_1(he(n,kr(!0)),he(n,kr(!1),I1(200))),ht()),!1);we(he(Mt(Be(i),Be(p)),xe(([y,C])=>y<=C),ht()),s),we(he(s,Oi(50)),u);const v=Ln(he(Mt(r,Be(a),Be(t),Be(e),Be(c)),Fr((y,[{scrollHeight:C,scrollTop:S},w,E,x,g])=>{const I=S+w-C>-g,A={scrollHeight:C,scrollTop:S,viewportHeight:w};if(I){let T,$;return S>y.state.scrollTop?(T="SCROLLED_DOWN",$=y.state.scrollTop-S):(T="SIZE_DECREASED",$=y.state.scrollTop-S||y.scrollTopDelta),{atBottom:!0,atBottomBecause:T,scrollTopDelta:$,state:A}}let _;return A.scrollHeight>y.state.scrollHeight?_="SIZE_INCREASED":w<y.state.viewportHeight?_="VIEWPORT_HEIGHT_DECREASING":S<y.state.scrollTop?_="SCROLLING_UPWARDS":_="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:_,state:A}},t9),ht((y,C)=>y&&y.atBottom===C.atBottom))),m=hn(he(r,Fr((y,{scrollHeight:C,scrollTop:S,viewportHeight:w})=>{if(c2(y.scrollHeight,C))return{changed:!1,jump:0,scrollHeight:C,scrollTop:S};{const E=C-(S+w)<1;return y.scrollTop!==S&&E?{changed:!0,jump:y.scrollTop-S,scrollHeight:C,scrollTop:S}:{changed:!0,jump:0,scrollHeight:C,scrollTop:S}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Re(y=>y.changed),xe(y=>y.jump)),0);we(he(v,xe(y=>y.atBottom)),o),we(he(o,Oi(50)),l);const b=ge(ps);we(he(r,xe(({scrollTop:y})=>y),ht(),Fr((y,C)=>nn(d)?{direction:y.direction,prevScrollTop:C}:{direction:C<y.prevScrollTop?Ps:ps,prevScrollTop:C},{direction:ps,prevScrollTop:0}),xe(y=>y.direction)),b),we(he(r,Oi(50),kr(e9)),b);const f=ge(0);return we(he(h,Re(y=>!y),kr(0)),f),we(he(i,Oi(100),Ve(h),Re(([y,C])=>!!C),Fr(([y,C],[S])=>[C,S],[0,0]),xe(([y,C])=>C-y)),f),{atBottomState:v,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:p,isAtBottom:o,isAtTop:s,isScrolling:h,lastJumpDueToItemResize:m,scrollDirection:b,scrollVelocity:f}},gt(En)),Ju="top",qu="bottom",R1="none";function B1(e,t,n){return typeof e=="number"?n===Ps&&t===Ju||n===ps&&t===qu?e:0:n===Ps?t===Ju?e.main:e.reverse:t===qu?e.main:e.reverse}function k1(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const Cg=Je(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const a=We(),o=ge(0),s=ge(0),l=ge(0),u=hn(he(Mt(Be(r),Be(i),Be(n),Be(a,Bs),Be(l),Be(o),Be(t),Be(e),Be(s)),xe(([c,p,h,[d,v],m,b,f,y,C])=>{const S=c-y,w=b+f,E=Math.max(h-S,0);let x=R1;const g=k1(C,Ju),I=k1(C,qu);return d-=y,d+=h+f,v+=h+f,v-=y,d>c+w-g&&(x=Ps),v<c-E+p+I&&(x=ps),x!==R1?[Math.max(S-h-B1(m,Ju,x)-g,0),S-E-f+p+B1(m,qu,x)+I]:null}),Re(c=>c!=null),ht(Bs)),[0,0]);return{increaseViewportBy:s,listBoundary:a,overscan:l,topListHeight:o,visibleRange:u}},gt(En),{singleton:!0});function r9(e,t,n){if(Yc(t)){const r=o2(e,t);return[{index:br(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:r,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const Cf={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Cu(e,t,n,r,i,a){const{lastIndex:o,lastOffset:s,lastSize:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const p=n-o,h=s+p*l+(p-1)*r,d=u,v=h-c;return{bottom:c,firstItemIndex:a,items:P1(e,i,a),offsetBottom:v,offsetTop:u,top:d,topItems:P1(t,i,a),topListHeight:t.reduce((m,b)=>b.size+m,0),totalCount:n}}function d2(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-o>=e)break;o++}const s=e+o,l=xg(t,s),u=Array.from({length:s}).map((c,p)=>({data:a[p+l],index:p+l,offset:0,size:0}));return Cu(u,[],s,i,n,r)}function P1(e,t,n){if(e.length===0)return[];if(!Yc(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=Xc(t.groupOffsetTree,r,i);let s,l=0;for(const u of e){(!s||s.end<u.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start));let c;u.index===s.start?c={index:l,type:"group"}:c={groupIndex:l,index:u.index-(l+1)+n},a.push({...c,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return a}const La=Je(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:p},h,{didMount:d},{recalcInProgress:v}])=>{const m=ge([]),b=ge(0),f=We();we(a.topItemsIndexes,m);const y=hn(he(Mt(d,v,Be(l,Bs),Be(i),Be(r),Be(u),c,Be(m),Be(t),Be(n),e),Re(([E,x,,g,,,,,,,I])=>{const A=I&&I.length!==g;return E&&!x&&!A}),xe(([,,[E,x],g,I,A,_,T,$,B,P])=>{const k=I,{offsetTree:O,sizeTree:M}=k,G=nn(b);if(g===0)return{...Cf,totalCount:g};if(E===0&&x===0)return G===0?{...Cf,totalCount:g}:d2(G,A,I,$,B,P||[]);if(st(M))return G>0?null:Cu(r9(xg(A,g),k,P),[],g,B,k,$);const W=[];if(T.length>0){const ee=T[0],J=T[T.length-1];let le=0;for(const re of Xc(M,ee,J)){const R=re.value,H=Math.max(re.start,ee),V=Math.min(re.end,J);for(let D=H;D<=V;D++)W.push({data:P==null?void 0:P[D],index:D,offset:le,size:R}),le+=R}}if(!_)return Cu([],W,g,B,k,$);const U=T.length>0?T[T.length-1]+1:0,q=WB(O,E,x,U);if(q.length===0)return null;const Q=g-1,Z=Uc([],ee=>{for(const J of q){const le=J.value;let re=le.offset,R=J.start;const H=le.size;if(le.offset<E){R+=Math.floor((E-le.offset+B)/(H+B));const D=R-J.start;re+=D*H+D*B}R<U&&(re+=(U-R)*H,R=U);const V=Math.min(J.end,Q);for(let D=R;D<=V&&!(re>=x);D++)ee.push({data:P==null?void 0:P[D],index:D,offset:re,size:H}),re+=H+B}});return Cu(Z,W,g,B,k,$)}),Re(E=>E!==null),ht()),Cf);we(he(e,Re(hg),xe(E=>E==null?void 0:E.length)),i),we(he(y,xe(E=>E.topListHeight)),p),we(p,s),we(he(y,xe(E=>[E.top,E.bottom])),o),we(he(y,xe(E=>E.items)),f);const C=Ln(he(y,Re(({items:E})=>E.length>0),Ve(i,e),Re(([{items:E},x])=>E[E.length-1].originalIndex===x-1),xe(([,E,x])=>[E-1,x]),ht(Bs),xe(([E])=>E))),S=Ln(he(y,Oi(200),Re(({items:E,topItems:x})=>E.length>0&&E[0].originalIndex===x.length),xe(({items:E})=>E[0].index),ht())),w=Ln(he(y,Re(({items:E})=>E.length>0),xe(({items:E})=>{let x=0,g=E.length-1;for(;E[x].type==="group"&&x<g;)x++;for(;E[g].type==="group"&&g>x;)g--;return{endIndex:E[g].index,startIndex:E[x].index}}),ht(i2)));return{endReached:C,initialItemCount:b,itemsRendered:f,listState:y,rangeChanged:w,startReached:S,topItemsIndexes:m,...h}},gt(Xr,l2,Cg,hl,fl,gl,Qi,vg),{singleton:!0}),f2=Je(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const a=We(),o=hn(he(Mt(n,e,r,t,i),xe(([s,l,u,c,p])=>s+l+u+c+p.offsetBottom+p.bottom)),0);return we(Be(o),a),{totalListHeight:o,totalListHeightChanged:a}},gt(En,La),{singleton:!0}),i9=Je(([{viewportHeight:e},{totalListHeight:t}])=>{const n=ge(!1),r=hn(he(Mt(n,e,t),Re(([i])=>i),xe(([,i,a])=>Math.max(0,i-a)),Oi(0),ht()),0);return{alignToBottom:n,paddingTopAddition:r}},gt(En,f2),{singleton:!0});function $1(e){return e?e==="smooth"?"smooth":"auto":!1}const a9=(e,t)=>typeof e=="function"?$1(e(t)):t&&$1(e),o9=Je(([{listRefresh:e,totalCount:t,fixedItemSize:n},{atBottomState:r,isAtBottom:i},{scrollToIndex:a},{scrolledToInitialItem:o},{didMount:s,propsReady:l},{log:u},{scrollingInProgress:c}])=>{const p=ge(!1),h=We();let d=null;function v(b){Oe(a,{align:"end",behavior:b,index:"LAST"})}at(he(Mt(he(Be(t),Do(1)),s),Ve(Be(p),i,o,c),xe(([[b,f],y,C,S,w])=>{let E=f&&S,x="auto";return E&&(x=a9(y,C||w),E=E&&!!x),{followOutputBehavior:x,shouldFollow:E,totalCount:b}}),Re(({shouldFollow:b})=>b)),({followOutputBehavior:b,totalCount:f})=>{d&&(d(),d=null),nn(n)?requestAnimationFrame(()=>{nn(u)("following output to ",{totalCount:f},An.DEBUG),v(b)}):d=zr(e,()=>{nn(u)("following output to ",{totalCount:f},An.DEBUG),v(b),d=null})});function m(b){const f=zr(r,y=>{b&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!d&&(nn(u)("scrolling to bottom due to increased size",{},An.DEBUG),v("auto"))});setTimeout(f,100)}return at(he(Mt(Be(p),t,l),Re(([b,,f])=>b&&f),Fr(({value:b},[,f])=>({refreshed:b===f,value:f}),{refreshed:!1,value:0}),Re(({refreshed:b})=>b),Ve(p,t)),([,b])=>{nn(o)&&m(b!==!1)}),at(h,()=>{m(nn(p)!==!1)}),at(Mt(Be(p),r),([b,f])=>{b&&!f.atBottom&&f.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&v("auto")}),{autoscrollToBottom:h,followOutput:p}},gt(Xr,gl,fl,hl,Qi,qi,En)),s9=Je(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(we(he(s,Ve(a),Re(([,l])=>l!==0),Ve(i,r,t,n,e),xe(([[,l],u,c,p,h,d=[]])=>d2(l,u,c,p,h,d))),o),{}),gt(Xr,hl,La,Qi),{singleton:!0}),l9=Je(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=ge(0);return at(he(e,Ve(r),Re(([,i])=>i!==0),xe(([,i])=>({top:i}))),i=>{zr(he(n,Do(1),Re(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{Oe(t,i)})})}),{initialScrollTop:r}},gt(Qi,En,La),{singleton:!0}),u9=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??"start",behavior:r}:e>a?{...i,align:n??"end",behavior:r}:null,c9=Je(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:l},{scrollToIndex:u}])=>{const c=We();return we(he(c,Ve(t,l,n,a,i,r,s),Ve(e),xe(([[p,h,d,v,m,b,f,y],C])=>{const{align:S,behavior:w,calculateViewLocation:E=u9,done:x,...g}=p,I=s2(p,h,v-1),A=ks(I,h.offsetTree,C)+m+b,_=A+br(h.sizeTree,I)[1],T=y+b,$=y+d-f,B=E({itemBottom:_,itemTop:A,locationParams:{align:S,behavior:w,...g},viewportBottom:$,viewportTop:T});return B?x&&zr(he(o,Re(P=>!P),Do(nn(o)?1:2)),x):x&&x(),B}),Re(p=>p!==null)),u),{scrollIntoView:c}},gt(Xr,En,fl,La,qi),{singleton:!0}),h2=Je(([{scrollVelocity:e}])=>{const t=ge(!1),n=We(),r=ge(!1);return we(he(e,Ve(r,t,n),Re(([i,a])=>!!a),xe(([i,a,o,s])=>{const{enter:l,exit:u}=a;if(o){if(u(i,s))return!1}else if(l(i,s))return!0;return o}),ht()),t),at(he(Mt(t,e,n),Ve(r)),([[i,a,o],s])=>{i&&s&&s.change&&s.change(a,o)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},gt(gl),{singleton:!0}),Eg=Je(([{scrollContainerState:e,scrollTo:t}])=>{const n=We(),r=We(),i=We(),a=ge(!1),o=ge(void 0);return we(he(Mt(n,r),xe(([{scrollHeight:s,scrollTop:l,viewportHeight:u},{offsetTop:c}])=>({scrollHeight:s,scrollTop:Math.max(0,l-c),viewportHeight:u}))),e),we(he(t,Ve(r),xe(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},gt(En)),d9=Je(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:l}])=>{const u=We(),c=ge(void 0),p=ge(null),h=ge(null);return we(s,p),we(l,h),at(he(u,Ve(t,r,o,p,h,n)),([d,v,m,b,f,y,C])=>{const S=XB(v.sizeTree);b&&f!==null&&y!==null&&(m=f.scrollTop-y.offsetTop),m-=C,d({ranges:S,scrollTop:m})}),we(he(c,Re(hg),xe(f9)),i),we(he(a,Ve(c),Re(([,d])=>d!==void 0),ht(),xe(([,d])=>d.ranges)),e),{getState:u,restoreStateFrom:c}},gt(Xr,En,hl,Qi,Eg));function f9(e){return{align:"start",index:0,offset:e.scrollTop}}const h9=Je(([{topItemsIndexes:e}])=>{const t=ge(0);return we(he(t,Re(n=>n>=0),xe(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},gt(La));function g2(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const g9=g2(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),p9=Je(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:p,sizes:h},{log:d},{recalcInProgress:v}])=>{const m=Ln(he(l,Ve(o),Fr(([,f,y,C],[{bottom:S,items:w,offsetBottom:E,totalCount:x},g])=>{const I=S+E;let A=0;return y===x&&f.length>0&&w.length>0&&(w[0].originalIndex===0&&f[0].originalIndex===0||(A=I-C,A!==0&&(A+=g))),[A,w,x,I]},[0,[],0,0]),Re(([f])=>f!==0),Ve(r,s,n,i,d,v),Re(([,f,y,C,,,S])=>!S&&!C&&f!==0&&y===Ps),xe(([[f],,,,,y])=>(y("Upward scrolling compensation",{amount:f},An.DEBUG),f))));function b(f){f>0?(Oe(t,{behavior:"auto",top:-f}),Oe(e,0)):(Oe(e,0),Oe(t,{behavior:"auto",top:-f}))}return at(he(m,Ve(e,a)),([f,y,C])=>{C&&g9()?Oe(e,y-f):b(-f)}),at(he(Mt(hn(a,!1),e,v),Re(([f,y,C])=>!f&&!C&&y!==0),xe(([f,y])=>y),Oi(1)),b),we(he(p,xe(f=>({top:-f}))),t),at(he(u,Ve(h,c),xe(([f,{groupIndices:y,lastSize:C,sizeTree:S},w])=>{function E(x){return x*(C+w)}if(y.length===0)return E(f);{let x=0;const g=Rs(S,0);let I=0,A=0;for(;I<f;){I++,x+=g;let _=y.length===A+1?1/0:y[A+1]-y[A]-1;I+_>f&&(x-=g,_=f-I+1),I+=_,x+=E(_),A++}return x}})),f=>{Oe(e,f),requestAnimationFrame(()=>{Oe(t,{top:f}),requestAnimationFrame(()=>{Oe(e,0),Oe(v,!1)})})}),{deviation:e}},gt(En,gl,La,Xr,qi,vg)),m9=Je(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),gt(Cg,s9,Qi,h2,f2,l9,i9,Eg,c9,qi)),p2=Je(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:i,groupIndices:a,itemSize:o,sizeRanges:s,sizes:l,statefulTotalCount:u,totalCount:c,trackItemSizes:p},{initialItemFinalLocationReached:h,initialTopMostItemIndex:d,scrolledToInitialItem:v},m,b,f,{listState:y,topItemsIndexes:C,...S},{scrollToIndex:w},E,{topItemCount:x},{groupCounts:g},I])=>(we(S.rangeChanged,I.scrollSeekRangeChanged),we(he(I.windowViewportRect,xe(A=>A.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:i,groupCounts:g,initialItemFinalLocationReached:h,initialTopMostItemIndex:d,scrolledToInitialItem:v,sizeRanges:s,topItemCount:x,topItemsIndexes:C,totalCount:c,...f,groupIndices:a,itemSize:o,listState:y,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:p,...S,...I,...m,sizes:l,...b}),gt(Xr,hl,En,d9,o9,La,fl,p9,h9,l2,m9));function v9(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const o in t)Object.hasOwn(r,o)||(n[o]=t[o]);return n}const Ol=typeof document<"u"?N.useLayoutEffect:N.useEffect;function Sg(e,t,n){const r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=N.createContext({});function l(b,f){b.propsReady&&Oe(b.propsReady,!1);for(const y of r){const C=b[t.required[y]];Oe(C,f[y])}for(const y of i)if(y in f){const C=b[t.optional[y]];Oe(C,f[y])}b.propsReady&&Oe(b.propsReady,!0)}function u(b){return a.reduce((f,y)=>(f[y]=C=>{const S=b[t.methods[y]];Oe(S,C)},f),{})}function c(b){return o.reduce((f,y)=>(f[y]=PB(b[t.events[y]]),f),{})}const p=N.forwardRef((b,f)=>{const{children:y,...C}=b,[S]=N.useState(()=>Uc(FB(e),x=>{l(x,C)})),[w]=N.useState(w1(c,S));Ol(()=>{for(const x of o)x in C&&at(w[x],C[x]);return()=>{Object.values(w).map(gg)}},[C,w,S]),Ol(()=>{l(S,C)}),N.useImperativeHandle(f,S1(u(S)));const E=n;return F.jsx(s.Provider,{value:S,children:n?F.jsx(E,{...v9([...r,...i,...o],C),children:y}):y})}),h=b=>{const f=N.useContext(s);return N.useCallback(y=>{Oe(f[b],y)},[f,b])},d=b=>{const f=N.useContext(s)[b],y=N.useCallback(C=>at(f,C),[f]);return N.useSyncExternalStore(y,()=>nn(f),()=>nn(f))},v=b=>{const f=N.useContext(s)[b],[y,C]=N.useState(w1(nn,f));return Ol(()=>at(f,S=>{S!==y&&C(S1(S))}),[f,y]),y},m=N.version.startsWith("18")?d:v;return{Component:p,useEmitter:(b,f)=>{const y=N.useContext(s)[b];Ol(()=>at(y,f),[f,y])},useEmitterValue:m,usePublisher:h}}const Kc=N.createContext(void 0),m2=N.createContext(void 0),v2=typeof document<"u"?N.useLayoutEffect:N.useEffect;function Ef(e){return"self"in e}function b9(e){return"body"in e}function b2(e,t,n,r=Ho,i,a){const o=N.useRef(null),s=N.useRef(null),l=N.useRef(null),u=N.useCallback(h=>{let d,v,m;const b=h.target;if(b9(b)||Ef(b)){const y=Ef(b)?b:b.defaultView;m=a?y.scrollX:y.scrollY,d=a?y.document.documentElement.scrollWidth:y.document.documentElement.scrollHeight,v=a?y.innerWidth:y.innerHeight}else m=a?b.scrollLeft:b.scrollTop,d=a?b.scrollWidth:b.scrollHeight,v=a?b.offsetWidth:b.offsetHeight;const f=()=>{e({scrollHeight:d,scrollTop:Math.max(m,0),viewportHeight:v})};h.suppressFlushSync?f():Mo.flushSync(f),s.current!==null&&(m===s.current||m<=0||m===d-v)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,a]);N.useEffect(()=>{const h=i||o.current;return r(i||o.current),u({suppressFlushSync:!0,target:h}),h.addEventListener("scroll",u,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",u)}},[o,u,n,r,i]);function c(h){const d=o.current;if(!d||(a?"offsetWidth"in d&&d.offsetWidth===0:"offsetHeight"in d&&d.offsetHeight===0))return;const v=h.behavior==="smooth";let m,b,f;Ef(d)?(b=Math.max(yr(d.document.documentElement,a?"width":"height"),a?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight),m=a?d.innerWidth:d.innerHeight,f=a?window.scrollX:window.scrollY):(b=d[a?"scrollWidth":"scrollHeight"],m=yr(d,a?"width":"height"),f=d[a?"scrollLeft":"scrollTop"]);const y=b-m;if(h.top=Math.ceil(Math.max(Math.min(y,h.top),0)),c2(m,b)||h.top===f){e({scrollHeight:b,scrollTop:f,viewportHeight:m}),v&&t(!0);return}v?(s.current=h.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,a&&(h={behavior:h.behavior,left:h.top}),d.scrollTo(h)}function p(h){a&&(h={behavior:h.behavior,left:h.top}),o.current.scrollBy(h)}return{scrollByCallback:p,scrollerRef:o,scrollToCallback:c}}const Sf="-webkit-sticky",F1="sticky",wg=g2(()=>{if(typeof document>"u")return F1;const e=document.createElement("div");return e.style.position=Sf,e.style.position===Sf?Sf:F1});function Ig(e){return e}const y9=Je(()=>{const e=ge(l=>`Item ${l}`),t=ge(null),n=ge(l=>`Group ${l}`),r=ge({}),i=ge(Ig),a=ge("div"),o=ge(Ho),s=(l,u=null)=>hn(he(r,xe(c=>c[l]),ht()),u);return{components:r,computeItemKey:i,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:a,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}}),x9=Je(([e,t])=>({...e,...t}),gt(p2,y9)),C9=({height:e})=>F.jsx("div",{style:{height:e}}),E9={overflowAnchor:"none",position:wg(),zIndex:1},y2={overflowAnchor:"none"},S9={...y2,display:"inline-block",height:"100%"},N1=N.memo(function({showTopList:e=!1}){const t=ke("listState"),n=er("sizeRanges"),r=ke("useWindowScroll"),i=ke("customScrollParent"),a=er("windowScrollContainerState"),o=er("scrollContainerState"),s=i||r?a:o,l=ke("itemContent"),u=ke("context"),c=ke("groupContent"),p=ke("trackItemSizes"),h=ke("itemSize"),d=ke("log"),v=er("gap"),m=ke("horizontalDirection"),{callbackRef:b}=qC(n,h,p,e?Ho:s,d,v,i,m,ke("skipAnimationFrameInResizeObserver")),[f,y]=N.useState(0);Tg("deviation",B=>{f!==B&&y(B)});const C=ke("EmptyPlaceholder"),S=ke("ScrollSeekPlaceholder")||C9,w=ke("ListComponent"),E=ke("ItemComponent"),x=ke("GroupComponent"),g=ke("computeItemKey"),I=ke("isSeeking"),A=ke("groupIndices").length>0,_=ke("alignToBottom"),T=ke("initialItemFinalLocationReached"),$=e?{}:{boxSizing:"border-box",...m?{display:"inline-block",height:"100%",marginLeft:f!==0?f:_?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:f!==0?f:_?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...T?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&C?F.jsx(C,{...ct(C,u)}):F.jsx(w,{...ct(w,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:b,style:$,children:(e?t.topItems:t.items).map(B=>{const P=B.originalIndex,k=g(P+t.firstItemIndex,B.data,u);return I?N.createElement(S,{...ct(S,u),height:B.size,index:B.index,key:k,type:B.type||"item",...B.type==="group"?{}:{groupIndex:B.groupIndex}}):B.type==="group"?N.createElement(x,{...ct(x,u),"data-index":P,"data-item-index":B.index,"data-known-size":B.size,key:k,style:E9},c(B.index,u)):N.createElement(E,{...ct(E,u),...x2(E,B.data),"data-index":P,"data-item-group-index":B.groupIndex,"data-item-index":B.index,"data-known-size":B.size,key:k,style:m?S9:y2},A?l(B.index,B.groupIndex,B.data,u):l(B.index,B.data,u))})})}),w9={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},I9={outline:"none",overflowX:"auto",position:"relative"},jo=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),_9={position:wg(),top:0,width:"100%",zIndex:1};function ct(e,t){if(typeof e!="string")return{context:t}}function x2(e,t){return{item:typeof e=="string"?void 0:t}}const D9=N.memo(function(){const e=ke("HeaderComponent"),t=er("headerHeight"),n=ke("HeaderFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,ke("skipAnimationFrameInResizeObserver")),i=ke("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null}),T9=N.memo(function(){const e=ke("FooterComponent"),t=er("footerHeight"),n=ke("HeaderFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,ke("skipAnimationFrameInResizeObserver")),i=ke("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null});function _g({useEmitter:e,useEmitterValue:t,usePublisher:n}){return N.memo(function({children:r,style:i,...a}){const o=n("scrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),u=t("scrollerRef"),c=t("context"),p=t("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:d,scrollToCallback:v}=b2(o,l,s,u,void 0,p);return e("scrollTo",v),e("scrollBy",h),F.jsx(s,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:d,style:{...p?I9:w9,...i},tabIndex:0,...a,...ct(s,c),children:r})})}function Dg({useEmitter:e,useEmitterValue:t,usePublisher:n}){return N.memo(function({children:r,style:i,...a}){const o=n("windowScrollContainerState"),s=t("ScrollerComponent"),l=n("smoothScrollTargetReached"),u=t("totalListHeight"),c=t("deviation"),p=t("customScrollParent"),h=t("context"),d=N.useRef(null),v=t("scrollerRef"),{scrollByCallback:m,scrollerRef:b,scrollToCallback:f}=b2(o,l,s,v,p);return v2(()=>{var y;return b.current=p||((y=d.current)==null?void 0:y.ownerDocument.defaultView),()=>{b.current=null}},[b,p]),e("windowScrollTo",f),e("scrollBy",m),F.jsx(s,{ref:d,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...u!==0?{height:u+c}:{}},...a,...ct(s,h),children:r})})}const A9=({children:e})=>{const t=N.useContext(Kc),n=er("viewportHeight"),r=er("fixedItemHeight"),i=ke("alignToBottom"),a=ke("horizontalDirection"),o=N.useMemo(()=>Ts(n,l=>yr(l,a?"width":"height")),[n,a]),s=Gr(o,!0,ke("skipAnimationFrameInResizeObserver"));return N.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),F.jsx("div",{"data-viewport-type":"element",ref:s,style:jo(i),children:e})},R9=({children:e})=>{const t=N.useContext(Kc),n=er("windowViewportRect"),r=er("fixedItemHeight"),i=ke("customScrollParent"),a=mg(n,i,ke("skipAnimationFrameInResizeObserver")),o=ke("alignToBottom");return N.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),F.jsx("div",{"data-viewport-type":"window",ref:a,style:jo(o),children:e})},B9=({children:e})=>{const t=ke("TopItemListComponent")||"div",n=ke("headerHeight"),r={..._9,marginTop:`${n}px`},i=ke("context");return F.jsx(t,{style:r,...ct(t,i),children:e})},k9=N.memo(function(e){const t=ke("useWindowScroll"),n=ke("topItemsIndexes").length>0,r=ke("customScrollParent"),i=ke("context"),a=r||t?F9:$9,o=r||t?R9:A9;return F.jsxs(a,{...e,...ct(a,i),children:[n&&F.jsx(B9,{children:F.jsx(N1,{showTopList:!0})}),F.jsxs(o,{children:[F.jsx(D9,{}),F.jsx(N1,{}),F.jsx(T9,{})]})]})}),{Component:P9,useEmitter:Tg,useEmitterValue:ke,usePublisher:er}=Sg(x9,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},k9),$9=_g({useEmitter:Tg,useEmitterValue:ke,usePublisher:er}),F9=Dg({useEmitter:Tg,useEmitterValue:ke,usePublisher:er}),N9=P9,M9=Je(()=>{const e=ge(u=>F.jsxs("td",{children:["Item $",u]})),t=ge(null),n=ge(u=>F.jsxs("td",{colSpan:1e3,children:["Group ",u]})),r=ge(null),i=ge(null),a=ge({}),o=ge(Ig),s=ge(Ho),l=(u,c=null)=>hn(he(a,xe(p=>p[u]),ht()),c);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),O9=Je(([e,t])=>({...e,...t}),gt(p2,M9)),L9=({height:e})=>F.jsx("tr",{children:F.jsx("td",{style:{height:e}})}),V9=({height:e})=>F.jsx("tr",{children:F.jsx("td",{style:{border:0,height:e,padding:0}})}),H9={overflowAnchor:"none"},M1={position:wg(),zIndex:2,overflowAnchor:"none"},O1=N.memo(function({showTopList:e=!1}){const t=Fe("listState"),n=Fe("computeItemKey"),r=Fe("firstItemIndex"),i=Fe("context"),a=Fe("isSeeking"),o=Fe("fixedHeaderHeight"),s=Fe("groupIndices").length>0,l=Fe("itemContent"),u=Fe("groupContent"),c=Fe("ScrollSeekPlaceholder")||L9,p=Fe("GroupComponent"),h=Fe("TableRowComponent"),d=(e?t.topItems:[]).reduce((m,b,f)=>(f===0?m.push(b.size):m.push(m[f-1]+b.size),m),[]),v=(e?t.topItems:t.items).map(m=>{const b=m.originalIndex,f=n(b+r,m.data,i),y=e?b===0?0:d[b-1]:0;return a?N.createElement(c,{...ct(c,i),height:m.size,index:m.index,key:f,type:m.type||"item"}):m.type==="group"?N.createElement(p,{...ct(p,i),"data-index":b,"data-item-index":m.index,"data-known-size":m.size,key:f,style:{...M1,top:o}},u(m.index,i)):N.createElement(h,{...ct(h,i),...x2(h,m.data),"data-index":b,"data-item-index":m.index,"data-known-size":m.size,"data-item-group-index":m.groupIndex,key:f,style:e?{...M1,top:o+y}:H9},s?l(m.index,m.groupIndex,m.data,i):l(m.index,m.data,i))});return F.jsx(F.Fragment,{children:v})}),j9=N.memo(function(){const e=Fe("listState"),t=Fe("topItemsIndexes").length>0,n=mr("sizeRanges"),r=Fe("useWindowScroll"),i=Fe("customScrollParent"),a=mr("windowScrollContainerState"),o=mr("scrollContainerState"),s=i||r?a:o,l=Fe("trackItemSizes"),u=Fe("itemSize"),c=Fe("log"),{callbackRef:p,ref:h}=qC(n,u,l,s,c,void 0,i,!1,Fe("skipAnimationFrameInResizeObserver")),[d,v]=N.useState(0);Ag("deviation",A=>{d!==A&&(h.current.style.marginTop=`${A}px`,v(A))});const m=Fe("EmptyPlaceholder"),b=Fe("FillerRow")||V9,f=Fe("TableBodyComponent"),y=Fe("paddingTopAddition"),C=Fe("statefulTotalCount"),S=Fe("context");if(C===0&&m)return F.jsx(m,{...ct(m,S)});const w=(t?e.topItems:[]).reduce((A,_)=>A+_.size,0),E=e.offsetTop+y+d-w,x=e.offsetBottom,g=E>0?F.jsx(b,{context:S,height:E},"padding-top"):null,I=x>0?F.jsx(b,{context:S,height:x},"padding-bottom"):null;return F.jsxs(f,{"data-testid":"virtuoso-item-list",ref:p,...ct(f,S),children:[g,t&&F.jsx(O1,{showTopList:!0}),F.jsx(O1,{}),I]})}),z9=({children:e})=>{const t=N.useContext(Kc),n=mr("viewportHeight"),r=mr("fixedItemHeight"),i=Gr(N.useMemo(()=>Ts(n,a=>yr(a,"height")),[n]),!0,Fe("skipAnimationFrameInResizeObserver"));return N.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),F.jsx("div",{"data-viewport-type":"element",ref:i,style:jo(!1),children:e})},G9=({children:e})=>{const t=N.useContext(Kc),n=mr("windowViewportRect"),r=mr("fixedItemHeight"),i=Fe("customScrollParent"),a=mg(n,i,Fe("skipAnimationFrameInResizeObserver"));return N.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),F.jsx("div",{"data-viewport-type":"window",ref:a,style:jo(!1),children:e})},W9=N.memo(function(e){const t=Fe("useWindowScroll"),n=Fe("customScrollParent"),r=mr("fixedHeaderHeight"),i=mr("fixedFooterHeight"),a=Fe("fixedHeaderContent"),o=Fe("fixedFooterContent"),s=Fe("context"),l=Gr(N.useMemo(()=>Ts(r,f=>yr(f,"height")),[r]),!0,Fe("skipAnimationFrameInResizeObserver")),u=Gr(N.useMemo(()=>Ts(i,f=>yr(f,"height")),[i]),!0,Fe("skipAnimationFrameInResizeObserver")),c=n||t?Y9:X9,p=n||t?G9:z9,h=Fe("TableComponent"),d=Fe("TableHeadComponent"),v=Fe("TableFooterComponent"),m=a?F.jsx(d,{ref:l,style:{position:"sticky",top:0,zIndex:2},...ct(d,s),children:a()},"TableHead"):null,b=o?F.jsx(v,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...ct(v,s),children:o()},"TableFoot"):null;return F.jsx(c,{...e,...ct(c,s),children:F.jsx(p,{children:F.jsxs(h,{style:{borderSpacing:0,overflowAnchor:"none"},...ct(h,s),children:[m,F.jsx(j9,{},"TableBody"),b]})})})}),{Component:U9,useEmitter:Ag,useEmitterValue:Fe,usePublisher:mr}=Sg(O9,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},W9),X9=_g({useEmitter:Ag,useEmitterValue:Fe,usePublisher:mr}),Y9=Dg({useEmitter:Ag,useEmitterValue:Fe,usePublisher:mr}),K9=U9,L1={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Z9={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:V1,floor:Qu,max:ms,min:wf,round:H1}=Math;function j1(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>({data:n===null?null:n[i+e],index:i+e}))}function J9(e){return{...Z9,items:e}}function Ll(e,t){return e&&e.width===t.width&&e.height===t.height}function q9(e,t){return e&&e.column===t.column&&e.row===t.row}const Q9=Je(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:p},h,d,{didMount:v,propsReady:m},{customScrollParent:b,useWindowScroll:f,windowScrollContainerState:y,windowScrollTo:C,windowViewportRect:S},w])=>{const E=ge(0),x=ge(0),g=ge(L1),I=ge({height:0,width:0}),A=ge({height:0,width:0}),_=We(),T=We(),$=ge(0),B=ge(null),P=ge({column:0,row:0}),k=We(),O=We(),M=ge(!1),G=ge(0),W=ge(!0),U=ge(!1),q=ge(!1);at(he(v,Ve(G),Re(([re,R])=>!!R)),()=>{Oe(W,!1)}),at(he(Mt(v,W,A,I,G,U),Re(([re,R,H,V,,D])=>re&&!R&&H.height!==0&&V.height!==0&&!D)),([,,,,re])=>{Oe(U,!0),yg(1,()=>{Oe(_,re)}),zr(he(u),()=>{Oe(t,[0,0]),Oe(W,!0)})}),we(he(O,Re(re=>re!=null&&re.scrollTop>0),kr(0)),x),at(he(v,Ve(O),Re(([,re])=>re!=null)),([,re])=>{re&&(Oe(I,re.viewport),Oe(A,re.item),Oe(P,re.gap),re.scrollTop>0&&(Oe(M,!0),zr(he(u,Do(1)),R=>{Oe(M,!1)}),Oe(l,{top:re.scrollTop})))}),we(he(I,xe(({height:re})=>re)),p),we(he(Mt(Be(I,Ll),Be(A,Ll),Be(P,(re,R)=>re&&re.column===R.column&&re.row===R.row),Be(u)),xe(([re,R,H,V])=>({gap:H,item:R,scrollTop:V,viewport:re}))),k),we(he(Mt(Be(E),r,Be(P,q9),Be(A,Ll),Be(I,Ll),Be(B),Be(x),Be(M),Be(W),Be(G)),Re(([,,,,,,,re])=>!re),xe(([re,[R,H],V,D,L,K,X,,se,ie])=>{const{column:oe,row:te}=V,{height:ue,width:ve}=D,{width:be}=L;if(X===0&&(re===0||be===0))return L1;if(ve===0){const Dt=xg(ie,re),kt=Dt+Math.max(X-1,0);return J9(j1(Dt,kt,K))}const pe=C2(be,ve,oe);let Te,Ne;se?R===0&&H===0&&X>0?(Te=0,Ne=X-1):(Te=pe*Qu((R+te)/(ue+te)),Ne=pe*V1((H+te)/(ue+te))-1,Ne=wf(re-1,ms(Ne,pe-1)),Te=wf(Ne,ms(0,Te))):(Te=0,Ne=-1);const Ue=j1(Te,Ne,K),{bottom:tt,top:lt}=z1(L,V,D,Ue),ut=V1(re/pe),xt=ut*ue+(ut-1)*te-tt;return{bottom:tt,itemHeight:ue,items:Ue,itemWidth:ve,offsetBottom:xt,offsetTop:lt,top:lt}})),g),we(he(B,Re(re=>re!==null),xe(re=>re.length)),E),we(he(Mt(I,A,g,P),Re(([re,R,{items:H}])=>H.length>0&&R.height!==0&&re.height!==0),xe(([re,R,{items:H},V])=>{const{bottom:D,top:L}=z1(re,V,R,H);return[L,D]}),ht(Bs)),t);const Q=ge(!1);we(he(u,Ve(Q),xe(([re,R])=>R||re!==0)),Q);const Z=Ln(he(Mt(g,E),Re(([{items:re}])=>re.length>0),Ve(Q),Re(([[re,R],H])=>{const V=re.items[re.items.length-1].index===R-1;return(H||re.bottom>0&&re.itemHeight>0&&re.offsetBottom===0&&re.items.length===R)&&V}),xe(([[,re]])=>re-1),ht())),ee=Ln(he(Be(g),Re(({items:re})=>re.length>0&&re[0].index===0),kr(0),ht())),J=Ln(he(Be(g),Ve(M),Re(([{items:re},R])=>re.length>0&&!R),xe(([{items:re}])=>({endIndex:re[re.length-1].index,startIndex:re[0].index})),ht(i2),Oi(0)));we(J,d.scrollSeekRangeChanged),we(he(_,Ve(I,A,E,P),xe(([re,R,H,V,D])=>{const L=u2(re),{align:K,behavior:X,offset:se}=L;let ie=L.index;ie==="LAST"&&(ie=V-1),ie=ms(0,ie,wf(V-1,ie));let oe=Zh(R,D,H,ie);return K==="end"?oe=H1(oe-R.height+H.height):K==="center"&&(oe=H1(oe-R.height/2+H.height/2)),se&&(oe+=se),{behavior:X,top:oe}})),l);const le=hn(he(g,xe(re=>re.offsetBottom+re.bottom)),0);return we(he(S,xe(re=>({height:re.visibleHeight,width:re.visibleWidth}))),I),{customScrollParent:b,data:B,deviation:$,footerHeight:i,gap:P,headerHeight:a,increaseViewportBy:e,initialItemCount:x,itemDimensions:A,overscan:n,restoreStateFrom:O,scrollBy:o,scrollContainerState:s,scrollHeight:T,scrollTo:l,scrollToIndex:_,scrollTop:u,smoothScrollTargetReached:c,totalCount:E,useWindowScroll:f,viewportDimensions:I,windowScrollContainerState:y,windowScrollTo:C,windowViewportRect:S,...d,gridState:g,horizontalDirection:q,initialTopMostItemIndex:G,totalListHeight:le,...h,endReached:Z,propsReady:m,rangeChanged:J,startReached:ee,stateChanged:k,stateRestoreInProgress:M,...w}},gt(Cg,En,gl,h2,Qi,Eg,qi));function C2(e,t,n){return ms(1,Qu((e+n)/(Qu(t)+n)))}function z1(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};const a=Zh(e,t,n,r[0].index);return{bottom:Zh(e,t,n,r[r.length-1].index)+i,top:a}}function Zh(e,t,n,r){const i=C2(e.width,n.width,t.column),a=Qu(r/i),o=a*n.height+ms(0,a-1)*t.row;return o>0?o+t.row:o}const ek=Je(()=>{const e=ge(p=>`Item ${p}`),t=ge({}),n=ge(null),r=ge("virtuoso-grid-item"),i=ge("virtuoso-grid-list"),a=ge(Ig),o=ge("div"),s=ge(Ho),l=(p,h=null)=>hn(he(t,xe(d=>d[p]),ht()),h),u=ge(!1),c=ge(!1);return we(Be(c),u),{components:t,computeItemKey:a,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:o,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:i,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),tk=Je(([e,t])=>({...e,...t}),gt(Q9,ek)),nk=N.memo(function(){const e=pt("gridState"),t=pt("listClassName"),n=pt("itemClassName"),r=pt("itemContent"),i=pt("computeItemKey"),a=pt("isSeeking"),o=tr("scrollHeight"),s=pt("ItemComponent"),l=pt("ListComponent"),u=pt("ScrollSeekPlaceholder"),c=pt("context"),p=tr("itemDimensions"),h=tr("gap"),d=pt("log"),v=pt("stateRestoreInProgress"),m=tr("reportReadyState"),b=Gr(N.useMemo(()=>f=>{const y=f.parentElement.parentElement.scrollHeight;o(y);const C=f.firstChild;if(C){const{height:S,width:w}=C.getBoundingClientRect();p({height:S,width:w})}h({column:G1("column-gap",getComputedStyle(f).columnGap,d),row:G1("row-gap",getComputedStyle(f).rowGap,d)})},[o,p,h,d]),!0,!1);return v2(()=>{e.itemHeight>0&&e.itemWidth>0&&m(!0)},[e]),v?null:F.jsx(l,{className:t,ref:b,...ct(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(f=>{const y=i(f.index,f.data,c);return a?F.jsx(u,{...ct(u,c),height:e.itemHeight,index:f.index,width:e.itemWidth},y):N.createElement(s,{...ct(s,c),className:n,"data-index":f.index,key:y},r(f.index,f.data,c))})})}),rk=N.memo(function(){const e=pt("HeaderComponent"),t=tr("headerHeight"),n=pt("headerFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,!1),i=pt("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null}),ik=N.memo(function(){const e=pt("FooterComponent"),t=tr("footerHeight"),n=pt("headerFooterTag"),r=Gr(N.useMemo(()=>a=>{t(yr(a,"height"))},[t]),!0,!1),i=pt("context");return e?F.jsx(n,{ref:r,children:F.jsx(e,{...ct(e,i)})}):null}),ak=({children:e})=>{const t=N.useContext(m2),n=tr("itemDimensions"),r=tr("viewportDimensions"),i=Gr(N.useMemo(()=>a=>{r(a.getBoundingClientRect())},[r]),!0,!1);return N.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),F.jsx("div",{ref:i,style:jo(!1),children:e})},ok=({children:e})=>{const t=N.useContext(m2),n=tr("windowViewportRect"),r=tr("itemDimensions"),i=pt("customScrollParent"),a=mg(n,i,!1);return N.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),F.jsx("div",{ref:a,style:jo(!1),children:e})},sk=N.memo(function({...e}){const t=pt("useWindowScroll"),n=pt("customScrollParent"),r=n||t?uk:lk,i=n||t?ok:ak,a=pt("context");return F.jsx(r,{...e,...ct(r,a),children:F.jsxs(i,{children:[F.jsx(rk,{}),F.jsx(nk,{}),F.jsx(ik,{})]})})}),{useEmitter:E2,useEmitterValue:pt,usePublisher:tr}=Sg(tk,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},sk),lk=_g({useEmitter:E2,useEmitterValue:pt,usePublisher:tr}),uk=Dg({useEmitter:E2,useEmitterValue:pt,usePublisher:tr});function G1(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,An.WARN),t==="normal"?0:parseInt(t??"0",10)}const ck=({children:e,...t})=>F.jsx(F.Fragment,{children:e(t)}),dk=({children:e,...t})=>F.jsx(F.Fragment,{children:N.isValidElement(e)&&F.jsx(F.Fragment,{children:N.cloneElement(e,t)})}),Rg=N.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,fixedHeaderContent:c,itemContent:p,typeCalculateItemSize:h="manual",itemSizeNames:d=[],overscan:v=null,component:m={},idContainer:b="",triggerCalCulateContainer:f="",accumulationHeight:y=0,delayTriggerCalculateHeight:C=0,increaseViewportBy:S=()=>0,context:w={},endReached:E,increaseTotalCount:x=1}=e,[g,I]=N.useState(0),A=()=>{if(o==="min-max"){const $=(a+x)*s;return{height:a>u?l:g>$?g:$}}return o==="container"?{height:g}:{}},_=$=>{var k;const B=$.getAttribute("data-index");let P=((k=$.getBoundingClientRect())==null?void 0:k.height)||0;return d==null||d.forEach(O=>{var M,G;P+=((G=(M=document.querySelector(`[${O}="${B}"]`))==null?void 0:M.getBoundingClientRect())==null?void 0:G.height)??0}),P},T=()=>{var $;if(b&&o==="container"){const B=(($=document==null?void 0:document.getElementById(b))==null?void 0:$.offsetHeight)??0;I(B-y)}};return N.useEffect(()=>{const $=setTimeout(T,C);return window==null||window.addEventListener("resize",T),window==null||window.addEventListener("load",T),()=>{clearTimeout($),window==null||window.removeEventListener("resize",T),window==null||window.removeEventListener("load",T)}},[o,f]),F.jsx("div",{className:`1ru-w-full ${n}`,children:F.jsx(K9,{context:w,ref:t,overscan:typeof v=="function"?v(o==="container"?g:l):o==="container"?g:l,totalListHeightChanged:$=>o==="min-max"?I($):null,style:A(),totalCount:a,computeItemKey:r,itemSize:N.useCallback($=>h==="manual"?i($):_($),[]),components:{TableRow:dk,...m},fixedHeaderContent:c,itemContent:(...$)=>p(ck,...$),endReached:E,increaseViewportBy:S(o==="container"?g:l)})})});Rg.displayName="TableVirtualization";const fk="_sorting_14xsf_375",dr={"payhere-reguler":"_payhere-reguler_14xsf_109","laba-reguler":"_laba-reguler_14xsf_259","laba-small":"_laba-small_14xsf_295","pointer-laba":"_pointer-laba_14xsf_333","pointer-payhere":"_pointer-payhere_14xsf_338","resize-menu":"_resize-menu_14xsf_343",sorting:fk,"laba-grey-02":"_laba-grey-02_14xsf_396"},If={"sub-mobile-payhere-reguler":"_sub-mobile-payhere-reguler_11jpn_115"},Ka="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6673%2011.3333L8.00065%2014M8.00065%2014L5.33398%2011.3333M8.00065%2014V2'%20stroke='%23CFD8DC'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function hk(e,t=null){const[n,r]=N.useState(!1);return N.useEffect(()=>{let i=null,a=null;const o=()=>{const s=i instanceof HTMLElement?i.getBoundingClientRect().width:window.innerWidth,l=window.matchMedia(e.replace("WIDTH",s.toString()));r(l.matches)};if(t){if(i=document.getElementById(t),!i)return;a=new ResizeObserver(o),a.observe(i)}else i=window,window.addEventListener("resize",o);return o(),()=>{a?a.disconnect():window.removeEventListener("resize",o)}},[e,t]),n}const gk=e=>{const t=h=>{const d=new Date,v=h.getTime()-d.getTime();return Math.max(Math.floor(v/1e3),0)},n=new Date(new Date(e.date).setHours(new Date(e.date).getHours()-((e==null?void 0:e.adjustTimesTime)??0))),[r,i]=N.useState(t(n)),[a,o]=N.useState(e.running??!1),[s,l]=N.useState(()=>e==null?void 0:e.callbackDone);return N.useEffect(()=>{let h;return a&&r>0?h=setInterval(()=>{i(d=>Math.max(d-1,0))},e.intervalMs):a&&r===0&&typeof s=="function"&&s(),()=>{h&&clearInterval(h)}},[a,r,e.intervalMs,s]),{count:r,startCountdown:()=>{o(!0)},stopCountdown:()=>{o(!1)},resetCountdown:h=>{i(typeof h=="number"?h:t(h??n))},setCallbackDone:h=>l(()=>h)}};function S2(e,t=0){const n=N.useRef({promise:null,resolve:null,reject:null,timeout:null});return N.useCallback((...i)=>(n.current.timeout&&clearTimeout(n.current.timeout),n.current.promise||(n.current.promise=new Promise((a,o)=>{n.current.resolve=a,n.current.reject=o})),n.current.timeout=setTimeout(()=>{e(...i).then(a=>{n.current.resolve&&n.current.resolve(a)}).catch(a=>{n.current.reject&&n.current.reject(a)}).finally(()=>{n.current.promise=null,n.current.resolve=null,n.current.reject=null,n.current.timeout=null})},t),n.current.promise),[e,t])}const Bg=typeof window<"u"?N.useLayoutEffect:N.useEffect,pk=(e,t)=>{const[n,r]=N.useState({width:0,height:0}),[i,a]=N.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=N.useRef(null);return Bg(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=p=>{for(const h of p){const{width:d,height:v,top:m,left:b,bottom:f,right:y,x:C,y:S}=h.contentRect;a({width:d,height:v,top:m,left:b,bottom:f,right:y,x:C,y:S})}};let u=null;t?u=document.querySelector(t):o.current&&(u=o.current);const c=new ResizeObserver(l);return u&&c.observe(u),window.addEventListener("resize",s),s(),()=>{u&&c.unobserve(u),window.removeEventListener("resize",s)}},[t,...e??[]]),{ref:o,windowSize:n,contentRect:i}};function mk(e){const[t,n]=N.useState(e),r=N.useRef(t);return N.useEffect(()=>{r.current=t},[t]),[t,n,r]}function vk(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${JSON.stringify(t)}' to ref '${JSON.stringify(e)}'`)}}}function bk(...e){return t=>{e.forEach(n=>{vk(n,t)})}}function kg(...e){return N.useMemo(()=>bk(...e),e)}function $s(e){const t=N.useRef(e);return Y0(e,t.current)||(t.current=e),t.current}function Gi(e,t){const n=t.map($s);N.useEffect(e,n)}function yk({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){N.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const xk=({containerRef:e,children:t,columnCount:n,gapX:r,gapY:i,direction:a="masonry-ltr",debounceRecalculate:o=500,durationAnimation:s=500,enableAnimation:l=!1})=>{const u=N.useCallback(()=>{const p=e.current;if(!p)return;const h=Array.from(p.children);if(h.length===0){p.style.height="0px";return}const d=Array(n).fill(0),v=p.offsetWidth;if(v===0)return;const m=(v-(n-1)*r)/n,b=a.includes("rtl"),f=a.includes("top-down");h.forEach((C,S)=>{C.style.width=`${m}px`,C.style.position="absolute",l&&(C.style.transition=`top ${s}ms ease, left ${s}ms ease`);let w;if(f)w=S%n;else{const g=Math.min(...d);w=d.indexOf(g)}const E=d[w];let x;b?x=v-(m*(w+1)+r*w):x=w*(m+r),C.style.top=`${E}px`,C.style.left=`${x}px`,d[w]+=C.offsetHeight+i});const y=Math.max(...d);p.style.height=`${y-i}px`},[e,n,r,a,i]),c=S2(async()=>{u()},o);return N.useLayoutEffect(()=>{u()},[t,u]),N.useEffect(()=>(window.addEventListener("load",u),window.addEventListener("resize",c),()=>{window.removeEventListener("load",u),window.removeEventListener("resize",c)}),[t,c,u]),{recalculateLayout:u}},Ck=(e,t)=>{var r,i;let n={};return e&&(n={position:"sticky",top:0,zIndex:2}),(r=t.column.columnDef.meta)!=null&&r.styleTh&&(n={...n,...(i=t.column.columnDef.meta)==null?void 0:i.styleTh(t.column.columnDef)}),n},ec=(e,t=!1)=>{const n=e.getIsPinned(),r=n==="left"&&e.getIsLastColumn("left"),i=n==="right"&&e.getIsFirstColumn("right");return n?{boxShadow:r?"-4px 0 4px -4px gray inset":i?"4px 0 4px -4px gray inset":void 0,left:n==="left"?`${e.getStart("left")}px`:void 0,right:n==="right"?`${e.getAfter("right")}px`:void 0,position:"sticky",width:e.getSize(),zIndex:1,background:t?"white":""}:{}},w2=e=>{const t=e.columnPinning.left||[],n=e.columnPinning.right||[],r=e.rowPinning.top||[],i=e.rowPinning.bottom||[];return{left:t,right:n,top:r,bottom:i,isPinning:t.length>0||n.length>0||r.length>0||i.length>0}},yn=()=>({kind:{"payhere-reguler":dr["payhere-reguler"],"laba-reguler":dr["laba-reguler"],"laba-small":dr["laba-small"]},subMobile:{"payhere-reguler":If["sub-mobile-payhere-reguler"],"laba-reguler":If["sub-mobile-laba-reguler"],"laba-small":If["sub-mobile-laba-small"]},pointer:{"payhere-reguler":dr["pointer-payhere"],"laba-reguler":dr["pointer-laba"],"laba-small":dr["pointer-laba"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4"}),desc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4"}),desc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4"}),desc:F.jsx("img",{src:Ka,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":dr["laba-grey-02"]}}),Ek=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,maxHeight:s,idCalculateHeight:l,componentSortASC:u,componentSortDESC:c,classNamePointer:p,emptyPlaceholder:h,renderSubComponent:d,visibilityColumns:v,classNameSubMobile:m})=>F.jsx("div",{id:"1ru-table",style:s?{height:s,overflow:"auto"}:{},className:t??"",children:F.jsxs("table",{className:n,style:{width:w2(e.getState()).isPinning?e.getCenterTotalSize():""},children:[F.jsx("thead",{id:a,"data-calculate-height-header":l,children:e.getHeaderGroups().map(b=>F.jsx("tr",{children:b.headers.map(f=>{var C,S,w,E;const y=(S=(C=f.column.columnDef.meta)==null?void 0:C.rowSpan)==null?void 0:S.call(C,f);return!f.isPlaceholder&&y!==void 0&&f.id===f.column.id?F.jsx(F.Fragment,{}):F.jsxs("th",{style:{...Ck(s,f),...ec(f.column),...v.columns.includes(f.column.id)?{display:"none"}:{}},colSpan:typeof((w=f.column.columnDef.meta)==null?void 0:w.colSpan)=="function"?(E=f.column.columnDef.meta)==null?void 0:E.colSpan(f.column.columnDef):f.colSpan,rowSpan:y,children:[f.isPlaceholder&&y===void 0?null:F.jsxs("div",{className:f.column.getCanSort()?dr.sorting:"",onClick:f.column.getToggleSortingHandler(),children:[_o(f.column.columnDef.header,f.getContext()),f.column.getCanSort()&&F.jsx("span",{className:"1ru-flex-shrink-0",children:f.column.getIsSorted()==="asc"||f.column.getIsSorted()==="desc"?F.jsxs(F.Fragment,{children:[f.column.getIsSorted()==="asc"&&F.jsx(F.Fragment,{children:u}),f.column.getIsSorted()==="desc"&&F.jsx(F.Fragment,{children:c})]}):F.jsx(F.Fragment,{})})]}),f.column.getIsPinned()&&F.jsx("div",{onDoubleClick:()=>f.column.resetSize(),onMouseDown:f.getResizeHandler(),onTouchStart:f.getResizeHandler(),className:dr["resize-menu"]})]},f.id)})},b.id))}),F.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((b,f)=>{var y;return F.jsxs(N.Fragment,{children:[F.jsx("tr",{onClick:C=>{C.stopPropagation(),i&&typeof r=="function"&&r(b.original,b)},className:i?p:"","data-calculate-height":`${l}-${f}`,id:o(b),children:b.getVisibleCells().map(C=>{var S,w,E;return F.jsx("td",{style:{...typeof((S=C.column.columnDef.meta)==null?void 0:S.styleTd)=="function"?C.column.columnDef.meta.styleTd(b.original,b):{},...ec(C.column,!0),...v.columns.includes(C.column.id)?{display:"none"}:{}},className:typeof((w=C.column.columnDef.meta)==null?void 0:w.classNameTd)=="function"?(E=C.column.columnDef.meta)==null?void 0:E.classNameTd(b.original,b):"",children:_o(C.column.columnDef.cell,C.getContext())},C.id)})},b.id),b.getIsExpanded()&&typeof d=="function"&&F.jsx("tr",{children:F.jsx("td",{colSpan:b.getVisibleCells().length-(((y=v==null?void 0:v.realColumns)==null?void 0:y.length)||0),children:d(b.original,b,{visibilityColumns:v,classNameSubMobile:m})})})]},b.id)}),e.getRowModel().rows.length===0&&N.isValidElement(h)&&F.jsx("tr",{children:F.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:h})})]})]})}),I2=N.forwardRef((e,t)=>{const{context:n,...r}=e;return F.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});I2.displayName="VirtualizationHead";const Sk=({style:e,context:t,...n})=>F.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:{...e,width:t==null?void 0:t.width}}),wk=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,classNameTable:s,componentSortASC:l,componentSortDESC:u,classNamePointer:c,emptyPlaceholder:p,renderSubComponent:h,visibilityColumns:d,classNameSubMobile:v})=>{var f,y,C;const[m,b]=N.useState(0);return F.jsx(Rg,{context:{headerId:a,classNameTable:s,width:w2(e.getState()).isPinning?e.getCenterTotalSize():""},typeHight:"min-max",totalCount:((f=e.getRowModel().rows)==null?void 0:f.length)||0,minLengthItem:((y=e.getRowModel().rows)==null?void 0:y.length)||0,typeCalculateItemSize:"auto",component:{TableHead:I2,Table:Sk,EmptyPlaceholder:()=>F.jsx("tbody",{ref:S=>{var w;return b(((w=S==null?void 0:S.getBoundingClientRect())==null?void 0:w.height)??0)},children:F.jsx("tr",{children:F.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:N.isValidElement(p)&&p})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(S=>F.jsx("tr",{children:S.headers.map(w=>{var x,g,I,A;const E=(g=(x=w.column.columnDef.meta)==null?void 0:x.rowSpan)==null?void 0:g.call(x,w);return!w.isPlaceholder&&E!==void 0&&w.id===w.column.id?F.jsx(F.Fragment,{}):F.jsxs("th",{colSpan:w.colSpan,rowSpan:E,style:{...typeof((I=w.column.columnDef.meta)==null?void 0:I.styleTh)=="function"?(A=w.column.columnDef.meta)==null?void 0:A.styleTh(w.column.columnDef):{},...ec(w.column),...d.columns.includes(w.column.id)?{display:"none"}:{}},children:[w.isPlaceholder&&E===void 0?null:F.jsxs("div",{className:w.column.getCanSort()?dr.sorting:"",onClick:w.column.getToggleSortingHandler(),children:[_o(w.column.columnDef.header,w.getContext()),w.column.getCanSort()&&F.jsx("span",{className:"1ru-flex-shrink-0",children:w.column.getIsSorted()==="asc"||w.column.getIsSorted()==="desc"?F.jsxs(F.Fragment,{children:[w.column.getIsSorted()==="asc"&&F.jsx(F.Fragment,{children:l}),w.column.getIsSorted()==="desc"&&F.jsx(F.Fragment,{children:u})]}):F.jsx(F.Fragment,{})})]}),w.column.getIsPinned()&&F.jsx("div",{onDoubleClick:()=>w.column.resetSize(),onMouseDown:w.getResizeHandler(),onTouchStart:w.getResizeHandler(),className:dr["resize-menu"]})]},w.id)})},S.id)),itemContent:(S,w)=>{var x,g;const E=(g=(x=e.getRowModel())==null?void 0:x.rows)==null?void 0:g[w];return F.jsx(S,{children:({...I})=>{var A;return F.jsxs(N.Fragment,{children:[F.jsx("tr",{...I,onClick:_=>{_.stopPropagation(),r&&typeof n=="function"&&n(E.original,E)},className:r?c:"",id:o(E),children:E.getVisibleCells().map(_=>{var T,$,B;return F.jsx(F.Fragment,{children:F.jsx("td",{style:{...typeof((T=_.column.columnDef.meta)==null?void 0:T.styleTd)=="function"?_.column.columnDef.meta.styleTd(E.original,E):{},...ec(_.column,!0),...d.columns.includes(_.column.id)?{display:"none"}:{}},className:typeof(($=_.column.columnDef.meta)==null?void 0:$.classNameTd)=="function"?(B=_.column.columnDef.meta)==null?void 0:B.classNameTd(E.original,E):"",children:_o(_.column.columnDef.cell,_.getContext())},_.id)})})}),E.getIsExpanded()&&typeof h=="function"&&F.jsx("tr",{"data-sub-component":w,children:F.jsx("td",{colSpan:E.getVisibleCells().length-(((A=d==null?void 0:d.realColumns)==null?void 0:A.length)||0),children:h(E.original,E,{visibilityColumns:d,classNameSubMobile:v})})})]},E.id)}},E.id)},...i,minHeightItem:((i==null?void 0:i.minHeightItem)??60)+((((C=e.getRowModel().rows)==null?void 0:C.length)||0)>0?0:m),itemSizeNames:typeof h=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},Ik=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",maxHeight:c=0,idCalculateHeight:p=void 0,kind:h="laba-reguler",componentSortASC:d,componentSortDESC:v,scrollTop:m=!1,emptyPlaceholder:b,variant:f,renderSubComponent:y,columnBreakpoints:C})=>{var A;const[S,w]=N.useState(0),[E,x]=N.useState({columns:[],realColumns:[]}),g=()=>{if(![void 0,"undefined"].includes(p)){const _=document.querySelector(`[data-calculate-height-header="${p}"]`);let T=0;const $=document.querySelectorAll(`[data-calculate-height^="${p}-"]`);return $==null||$.forEach(B=>{T+=B.offsetHeight}),T>c?c+_.offsetHeight:0}return c},I=()=>{var B;const _=((B=document.querySelector("body"))==null?void 0:B.offsetWidth)||0,T=C==null?void 0:C.sort((P,k)=>{const O=(P.maxWidth??P.minWidth)||0,M=(k.maxWidth??k.minWidth)||0;return O!==M?O-M:P.maxWidth?-1:1}),$=(T==null?void 0:T.find(P=>!!(Object.hasOwnProperty.call(P,"maxWidth")&&_<=(P.maxWidth||0)||Object.hasOwnProperty.call(P,"minWidth")&&_>=(P.minWidth||0))))||{};Object.keys($).length>0?(x({columns:$.columns,realColumns:$.realColumns||$.columns}),$!=null&&$.resetExpanded&&e.resetExpanded()):x({columns:[],realColumns:[]})};return Gi(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),Gi(()=>{c>0&&w(g())},[(A=e==null?void 0:e.options)==null?void 0:A.data,c]),Gi(()=>{if(Array.isArray(C)&&(C==null?void 0:C.length)>0)return I(),window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[C]),F.jsxs(F.Fragment,{children:[!o&&F.jsx(Ek,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${yn().kind[h]} ${f?yn().variant[f]:""}
68
+ ${m?yn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,maxHeight:S,idCalculateHeight:p,componentSortASC:N.isValidElement(d)?d:yn().sortingIcon[h].asc,componentSortDESC:N.isValidElement(v)?v:yn().sortingIcon[h].desc,classNamePointer:yn().pointer[h],emptyPlaceholder:b,renderSubComponent:y,visibilityColumns:E,classNameSubMobile:yn().subMobile[h]}),o&&F.jsx(wk,{tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${yn().kind[h]} ${f?yn().variant[f]:""}
69
+ ${m?yn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,virtualizationProps:s,componentSortASC:N.isValidElement(d)?d:yn().sortingIcon[h].asc,componentSortDESC:N.isValidElement(v)?v:yn().sortingIcon[h].desc,classNamePointer:yn().pointer[h],emptyPlaceholder:b,renderSubComponent:y,visibilityColumns:E,classNameSubMobile:yn().subMobile[h]})]})},_k=(e,t,{visibilityColumns:n,classNameSubMobile:r})=>F.jsx("table",{className:"-1ru-mx-6 -1ru-my-3 !1ru-w-[calc(100%+48px)]",children:F.jsx("tbody",{children:t.getVisibleCells().map((i,a)=>{var o,s,l,u,c,p;return F.jsx(F.Fragment,{children:n!=null&&n.columns.includes(i.column.id)?F.jsxs("tr",{className:r,children:[F.jsx("td",{"data-section":"left",style:{...typeof((o=i.column.columnDef.meta)==null?void 0:o.styleTdLeftCellSubs)=="function"?(s=i.column.columnDef.meta)==null?void 0:s.styleTdLeftCellSubs(t.original,t):{}},children:F.jsxs("div",{children:[typeof i.column.columnDef.header=="string"&&F.jsx(F.Fragment,{children:i.column.columnDef.header}),typeof i.column.columnDef.header!="string"&&((l=i.column.columnDef.meta)==null?void 0:l.labelCellSubs)&&F.jsx(F.Fragment,{children:(u=i.column.columnDef.meta)==null?void 0:u.labelCellSubs(t.original,t)})]})}),F.jsx("td",{"data-section":"right",style:{...typeof((c=i.column.columnDef.meta)==null?void 0:c.styleTdRightCellSubs)=="function"?(p=i.column.columnDef.meta)==null?void 0:p.styleTdRightCellSubs(t.original,t):{}},children:F.jsxs("div",{children:[F.jsx("div",{className:"1ru-pr-1",children:":"})," ",_o(i.column.columnDef.cell,i.getContext())]})})]},i.id):F.jsx(F.Fragment,{})},a)})})}),Dk=({children:e,...t})=>F.jsx(F.Fragment,{children:e(t)}),Tk=({children:e,...t})=>F.jsx(F.Fragment,{children:N.isValidElement(e)&&F.jsx(F.Fragment,{children:N.cloneElement(e,t)})}),_2=N.forwardRef((e,t)=>{const{classNameContainer:n="",computeItemKey:r=()=>"",itemSize:i=()=>0,totalCount:a=0,typeHight:o="min-max",minHeightItem:s=0,maxHeightTable:l=0,minLengthItem:u=0,itemContent:c,typeCalculateItemSize:p="manual",itemSizeNames:h=[],overscan:d=null,component:v={},idContainer:m="",triggerCalCulateContainer:b="",accumulationHeight:f=0,delayTriggerCalculateHeight:y=0,increaseViewportBy:C=()=>0,context:S={},endReached:w,increaseTotalCount:E=1}=e,[x,g]=N.useState(0),I=()=>{if(o==="min-max"){const T=(a+E)*s;return{height:a>u?l:x>T?x:T}}return o==="container"?{height:x}:{}},A=T=>{var P;const $=T.getAttribute("data-index");let B=((P=T.getBoundingClientRect())==null?void 0:P.height)||0;return h==null||h.forEach(k=>{var O,M;B+=((M=(O=document.querySelector(`[${k}="${$}"]`))==null?void 0:O.getBoundingClientRect())==null?void 0:M.height)??0}),B},_=()=>{var T;if(m&&o==="container"){const $=((T=document==null?void 0:document.getElementById(m))==null?void 0:T.offsetHeight)??0;g($-f)}};return N.useEffect(()=>{const T=setTimeout(_,y);return window==null||window.addEventListener("resize",_),window==null||window.addEventListener("load",_),()=>{clearTimeout(T),window==null||window.removeEventListener("resize",_),window==null||window.removeEventListener("load",_)}},[o,b]),F.jsx("div",{className:`1ru-w-full ${n}`,children:F.jsx(N9,{context:S,ref:t,overscan:typeof d=="function"?d(o==="container"?x:l):o==="container"?x:l,totalListHeightChanged:T=>o==="min-max"?g(T):null,style:I(),totalCount:a,computeItemKey:r,itemSize:N.useCallback(T=>p==="manual"?i(T):A(T),[]),itemContent:(...T)=>c(Dk,...T),components:{Item:Tk,...v},endReached:w,increaseViewportBy:C(o==="container"?x:l)})})});_2.displayName="ListVirtualization";const Ak="_ripple_14zyp_393",Rk="_active_14zyp_400",$t={"tabs-m":"_tabs-m_14zyp_115","tabs-list":"_tabs-list_14zyp_115","button-tabs":"_button-tabs_14zyp_115","container-tabs":"_container-tabs_14zyp_115","original-laba-blue-10":"_original-laba-blue-10_14zyp_115","tabs-s":"_tabs-s_14zyp_139","tabs-medium":"_tabs-medium_14zyp_259","tabs-small":"_tabs-small_14zyp_289","disable-transition":"_disable-transition_14zyp_313","tab-panel":"_tab-panel_14zyp_317",ripple:Ak,active:Rk,"tabs-slider":"_tabs-slider_14zyp_407","container-payhere-brand-base":"_container-payhere-brand-base_14zyp_415","container-payhere-brand-base-bg_white":"_container-payhere-brand-base-bg_white_14zyp_452","container-laba-blue-10":"_container-laba-blue-10_14zyp_489","container-laba-blue-10-bg_white":"_container-laba-blue-10-bg_white_14zyp_526","container-laba-blue-10-bg_blue-01":"_container-laba-blue-10-bg_blue-01_14zyp_563"},Zc={"0px":"1ru-rounded-none","2px":"1ru-rounded-sm","4px":"1ru-rounded","6px":"1ru-rounded-md","8px":"1ru-rounded-lg","12px":"1ru-rounded-xl","16px":"1ru-rounded-2xl","24px":"1ru-rounded-3xl",full:"1ru-rounded-full"},Bk=({id:e,value:t="",keyValueTab:n="",tabsList:r,className:i,classNameContainer:a,classNameButton:o,variant:s="original-laba-blue-10",size:l="tabs-m",borderRadius:u="0px",disabled:c,animation:p=!0,mountedExecuteChange:h=!0,typeButton:d="button",onChange:v,locale:m})=>{var _;const b=N.useRef([]);let f=r||[];const y=Object.fromEntries(new URL(window.location.href).searchParams.entries()),C={tabsVariant:{"original-laba-blue-10":$t["original-laba-blue-10"],"container-payhere-brand-base":$t["container-payhere-brand-base"],"container-payhere-brand-base-bg_white":$t["container-payhere-brand-base-bg_white"],"container-laba-blue-10":$t["container-laba-blue-10"],"container-laba-blue-10-bg_white":$t["container-laba-blue-10-bg_white"],"container-laba-blue-10-bg_blue-01":$t["container-laba-blue-10-bg_blue-01"]},size:{"tabs-m":$t["tabs-m"],"tabs-s":$t["tabs-s"],"tabs-medium":$t["tabs-medium"],"tabs-small":$t["tabs-small"]},borderRadius:Zc,isContainer:["container-payhere-brand-base","container-payhere-brand-base-bg_white","container-laba-blue-10","container-laba-blue-10-bg_white","container-laba-blue-10-bg_blue-01"]},[S,w]=N.useState(-1),[E,x]=N.useState({height:0,width:0,left:0});f=f.filter(T=>typeof(T==null?void 0:T.isHide)=="boolean"?!T.isHide:!0);const g=T=>{const $=T.currentTarget,B=document.createElement("span"),P=Math.max($.clientWidth,$.clientHeight),k=P/2;B.style.width=B.style.height=`${P}px`,B.style.left=`${T.clientX-$.getBoundingClientRect().left-k}px`,B.style.top=`${T.clientY-$.getBoundingClientRect().top-k}px`,B.classList.add($t.ripple);const O=$.getElementsByClassName($t.ripple)[0];O&&O.remove(),$.appendChild(B),setTimeout(()=>{B.remove()},500)},I=(T,$)=>{typeof v=="function"&&v(T,$)},A=N.useCallback((T,$)=>{var B,P;return m&&((P=(B=r.find(O=>O.id===T))==null?void 0:B.locale)==null?void 0:P[m])||$},[m]);return N.useEffect(()=>{function T(){const $=b.current[S],B={left:($==null?void 0:$.offsetLeft)??0,width:($==null?void 0:$.clientWidth)??0,height:C.isContainer.includes(s)?($==null?void 0:$.clientHeight)||0:4};x(B)}return S>=0&&T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[S]),N.useEffect(()=>{const T=f.findIndex($=>$.id===(y==null?void 0:y[n])||$.id===t);if((y!=null&&y[n]||t)&&T>=0){w(T);const $=f==null?void 0:f.find(B=>B.id===(y==null?void 0:y[n]));y!=null&&y[n]&&$&&!t&&h&&I($,"mounted")}T<0&&h&&I(f[0],"mounted")},[JSON.stringify(t),JSON.stringify(y==null?void 0:y[n])]),F.jsx("div",{className:`${$t["container-tabs"]} ${c?"1ru-opacity-50":""} ${a??""}`,children:F.jsxs("div",{className:`${C.tabsVariant[s]}
70
70
  ${C.isContainer.includes(s)?C.size[l]:""}
71
71
  ${i??""}
72
72
  `,id:e??"1ru-tabs",children:[F.jsx("div",{className:$t["tabs-list"],children:f.map((T,$)=>F.jsx("button",{type:d,id:`1ru-tabs-button-${T.id}`,ref:B=>{b.current[$]=B},className:`${$t["button-tabs"]} ${C.borderRadius[u]}
73
73
  ${o??""} ${(T==null?void 0:T.className)??""}
74
74
  ${S===$?$t.active:""}`,disabled:c,onClick:B=>{C.isContainer.includes(s)||g(B),S!=$&&I(T,"change")},children:A(T.id,T.label)},$))}),F.jsx("div",{className:`${$t["tabs-slider"]} ${C.borderRadius[u]}
75
75
  ${o??""} ${p?"":$t["disable-transition"]}
76
- `,style:{left:E.left,width:E.width,height:E.height,background:((_=r[S])==null?void 0:_.activeColor)??""}})]})})},kk=({children:e,id:t,value:n,selected:r,className:i,isHide:a})=>F.jsx("div",{role:"tabpanel",id:t??`1ru-tabpanel-${n}`,hidden:a??n!==r,className:`${$t["tab-panel"]} ${i??""}`,children:e}),Pk="_option_sd3zj_109",$k="_active_sd3zj_468",wn={"pagination-box":"_pagination-box_sd3zj_61","navigation-container":"_navigation-container_sd3zj_61","goto-page":"_goto-page_sd3zj_61","goto-page-input":"_goto-page-input_sd3zj_61","pagination-nude":"_pagination-nude_sd3zj_61","options-size":"_options-size_sd3zj_109",option:Pk,"pagination-size":"_pagination-size_sd3zj_324","button-container":"_button-container_sd3zj_338","button-next":"_button-next_sd3zj_338","button-prev":"_button-prev_sd3zj_338","pagination-active":"_pagination-active_sd3zj_361",active:$k},Fk="_selected_12d64_1",Nk="_disabled_12d64_19",Mk="_valid_12d64_66",Ok="_invalid_12d64_72",Lk="_error_12d64_103",Ae={"container-calendar":"_container-calendar_12d64_1","month-calendar":"_month-calendar_12d64_1","cell-month":"_cell-month_12d64_1",selected:Fk,"year-calendar":"_year-calendar_12d64_2","cell-year":"_cell-year_12d64_2","cell-calendar":"_cell-calendar_12d64_2","active-cell-calendar":"_active-cell-calendar_12d64_2","custom-time-calendar":"_custom-time-calendar_12d64_3","container-cell-time":"_container-cell-time_12d64_3","cell-time":"_cell-time_12d64_3","header-calendar":"_header-calendar_12d64_11","header-button-calendar":"_header-button-calendar_12d64_15",disabled:Nk,"days-calendar":"_days-calendar_12d64_26","visible-cell-calendar":"_visible-cell-calendar_12d64_33","header-time":"_header-time_12d64_46","type-time":"_type-time_12d64_51",valid:Mk,invalid:Ok,"footer-calendar":"_footer-calendar_12d64_91","container-filter-date":"_container-filter-date_12d64_96","button-filter-date":"_button-filter-date_12d64_99",error:Lk},Lr=({className:e})=>F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:`1ru-h-4 1ru-w-4 1ru-text-blue-700 ${e??""}`,viewBox:"0 0 512 512",children:F.jsx("path",{d:`M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8
76
+ `,style:{left:E.left,width:E.width,height:E.height,background:((_=r[S])==null?void 0:_.activeColor)??""}})]})})},kk=({children:e,id:t,value:n,selected:r,className:i,isHide:a})=>F.jsx("div",{role:"tabpanel",id:t??`1ru-tabpanel-${n}`,hidden:a??n!==r,className:`${$t["tab-panel"]} ${i??""}`,children:e}),Pk="_option_sd3zj_109",$k="_active_sd3zj_468",In={"pagination-box":"_pagination-box_sd3zj_61","navigation-container":"_navigation-container_sd3zj_61","goto-page":"_goto-page_sd3zj_61","goto-page-input":"_goto-page-input_sd3zj_61","pagination-nude":"_pagination-nude_sd3zj_61","options-size":"_options-size_sd3zj_109",option:Pk,"pagination-size":"_pagination-size_sd3zj_324","button-container":"_button-container_sd3zj_338","button-next":"_button-next_sd3zj_338","button-prev":"_button-prev_sd3zj_338","pagination-active":"_pagination-active_sd3zj_361",active:$k},Fk="_selected_12d64_1",Nk="_disabled_12d64_19",Mk="_valid_12d64_66",Ok="_invalid_12d64_72",Lk="_error_12d64_103",Ae={"container-calendar":"_container-calendar_12d64_1","month-calendar":"_month-calendar_12d64_1","cell-month":"_cell-month_12d64_1",selected:Fk,"year-calendar":"_year-calendar_12d64_2","cell-year":"_cell-year_12d64_2","cell-calendar":"_cell-calendar_12d64_2","active-cell-calendar":"_active-cell-calendar_12d64_2","custom-time-calendar":"_custom-time-calendar_12d64_3","container-cell-time":"_container-cell-time_12d64_3","cell-time":"_cell-time_12d64_3","header-calendar":"_header-calendar_12d64_11","header-button-calendar":"_header-button-calendar_12d64_15",disabled:Nk,"days-calendar":"_days-calendar_12d64_26","visible-cell-calendar":"_visible-cell-calendar_12d64_33","header-time":"_header-time_12d64_46","type-time":"_type-time_12d64_51",valid:Mk,invalid:Ok,"footer-calendar":"_footer-calendar_12d64_91","container-filter-date":"_container-filter-date_12d64_96","button-filter-date":"_button-filter-date_12d64_99",error:Lk},Lr=({className:e})=>F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:`1ru-h-4 1ru-w-4 1ru-text-blue-700 ${e??""}`,viewBox:"0 0 512 512",children:F.jsx("path",{d:`M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8
77
77
  0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3
78
- 0s-12.5 32.8 0 45.3l192 192z`})}),D2=({title:e,state:t,type:n,setUpYear:r={startYear:1970,endAfterThisYear:20},hiddenHeader:i,setActiveTypeCalendar:a,onChangeYear:o})=>{const s=(u,c)=>{const p=t.focusedDate.set({year:u});c?(a("month"),t.setFocusedDate(p)):!c&&typeof o=="function"&&o(p)},l=(u,c,p)=>Array.from({length:(c-u)/p+1},(h,d)=>u+d*p);return N.useEffect(()=>{const u=document.getElementById(`calendar-year-${t.focusedDate.year}`),c=document.getElementById("wrapper-calendar-year");u&&c&&c.scrollTo({behavior:"instant",top:u.offsetTop-93})},[]),F.jsxs("div",{className:`1ru-w-[296px] ${Ae["container-calendar"]}`,children:[!i&&F.jsx("div",{className:`${Ae["header-calendar"]} 1ru-my-2`,children:F.jsxs("div",{className:`${Ae["header-button-calendar"]} ${n.includes("date")||n.includes("month")?"":Ae.disabled}`,onClick:()=>{n.includes("date")?a("date"):n.includes("month")&&a("month")},children:[e," ",(n.includes("date")||n.includes("month"))&&F.jsx(Lr,{})]})}),F.jsx("div",{id:"wrapper-calendar-year",className:Ae["year-calendar"],children:l(r==null?void 0:r.startYear,new Date().getFullYear()+r.endAfterThisYear,1).map(u=>{var v,m;const c=Number(u),p=t!=null&&t.minValue?c<((v=t==null?void 0:t.minValue)==null?void 0:v.year):!1,h=t!=null&&t.maxValue?c>((m=t==null?void 0:t.maxValue)==null?void 0:m.year):!1,d=p||h;return F.jsx("div",{id:`calendar-year-${u}`,onClick:()=>{d||s(c,n.includes("month"))},className:`${Ae["cell-year"]} ${t.focusedDate.year===c&&!d?Ae.selected:""} ${t.focusedDate.year!==c&&!d?"hover:1ru-bg-laba-blue-01":""} ${d?"1ru-text-gray-400":"1ru-cursor-pointer"}`,children:u},u)})})]})},Vl=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)},_f={"en-US":{"Rows per page:":"Rows per page:",of:"of","Go to:":"Go to:"},"id-ID":{"Rows per page:":"Baris per halaman:",of:"dari","Go to:":"Go to:"},"zh-CN":{"Rows per page:":"每页行数:",of:"共","Go to:":"跳至:"},"nl-NL":{"Rows per page:":"Rijen per pagina:",of:"van","Go to:":"Ga naar:"}},Vk=({totalData:e,totalPage:t,pageNumber:n,pageSize:r,className:i,id:a,kind:o="box",prevIcon:s,nextIcon:l,onChange:u,optionPageSize:c=[25,50,75,100],offset:p=1.5,zIndex:h,withGotoPage:d=!1,withMorePage:v=!0,withOptionPageSize:m=!1,locale:b="id-ID"})=>{const f=N.useRef(null),[y,C]=N.useState(n),[S,w]=N.useState(n.toString()),E={box:wn["pagination-box"],nude:wn["pagination-nude"]},x=1,g=(y-1)*r+1,I=r*y,A=e?`${Ri(g,"decimal")}-${I>=e?Ri(e,"decimal"):Ri(I,"decimal")}`:0,_=N.useMemo(()=>{const P=Math.ceil(e/r);if(x+5>=P)return Vl(1,P);const O=Math.max(y-x,1),M=Math.min(y+x,P),G=O>2,W=M<P-2,U=1,q=P;if(!G&&W){const Q=3+2*x;return[...Vl(1,Q),"mr",P]}if(G&&!W){const Q=3+2*x,Z=Vl(P-Q+1,P);return[U,"ml",...Z]}if(G&&W){const Q=Vl(O,M);return[U,"ml",...Q,"mr",q]}},[e,r,x,y]),T=P=>{typeof u=="function"&&(u(P),C(P.pageNumber),w(P.pageNumber.toString()))},$=P=>{if(typeof u=="function"&&v){if(P==="ml"){const O=y-5;C(O<1?1:y-5)}else if(P==="mr"){const O=y+5;C(O>t?t:y+5)}}},B=P=>{w(P);const k=Number(P);k>0&&k<=t&&T({pageSize:r,totalData:e,totalPage:t,pageNumber:k})};return F.jsxs(F.Fragment,{children:[F.jsxs("div",{id:a??"1ru-pagination",className:`${E[o]} ${i}`,children:[F.jsxs("div",{className:wn["pagination-size"],children:[F.jsx("span",{children:_f[b]["Rows per page:"]}),m&&F.jsx(vr,{variants:"ghost-blue-gray-100-bg_white",size:"xs",endIcon:F.jsx(Lr,{className:"!1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px] 1ru-mx-0.5"}),className:"!1ru-rounded-md !1ru-min-w-[60px] 1ru-justify-between",onClick:P=>{var k;return(k=f.current)==null?void 0:k.handlerShow(P)},children:Ri(r,"decimal")}),F.jsxs("span",{children:[A," ",_f[b].of," ",Ri(e,"decimal")]})]}),F.jsxs("div",{className:wn["navigation-container"],children:[F.jsx("button",{id:"1ru-pagination-button-prev",className:`${wn["button-prev"]}`,disabled:y===1,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n-1}),children:typeof s=="function"||N.isValidElement(s)?N.isValidElement(s)?s:s():F.jsx(Lr,{className:"1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),(_??[]).map((P,k)=>{if(typeof P!="number"){const O=["ml","mr"].includes(P);return F.jsx("button",{className:wn["button-container"],disabled:!v,onClick:()=>$(P),children:O?"...":P},k)}return F.jsx("button",{id:`1ru-pagination-button-${P}`,className:`${P===n?wn["pagination-active"]:""} ${wn["button-container"]}`,disabled:P===n,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:P}),children:Ri(P,"decimal")},k)}),F.jsx("button",{id:"1ru-pagination-button-next",className:`${wn["button-next"]}`,disabled:y===t||!t,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n+1}),children:typeof l=="function"||N.isValidElement(l)?N.isValidElement(l)?l:l():F.jsx(Lr,{className:"-1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),d&&F.jsxs("div",{className:wn["goto-page"],children:[F.jsx("span",{children:_f[b]["Go to:"]}),F.jsx("input",{type:"number",className:wn["goto-page-input"],value:S,onChange:P=>B(P.target.value),onBlur:()=>w(y.toString())})]})]})]}),F.jsx(bi,{floatingOptions:{placement:"bottom-end"},ref:f,className:wn["options-size"],offset:p,zIndex:h,children:c.map((P,k)=>F.jsx("p",{className:`${wn.option} ${P===r?wn.active:""}`,onClick:()=>{var O;T({totalData:e,totalPage:t,pageSize:P,pageNumber:1}),(O=f.current)==null||O.setShow(!1)},children:Ri(P,"decimal")},k))})]})};function Ta(e){"@babel/helpers - typeof";return Ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(e)}function Hk(e,t){if(Ta(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ta(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T2(e){var t=Hk(e,"string");return Ta(t)=="symbol"?t:t+""}function as(e,t,n){return(t=T2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach(function(r){as(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jk(e){if(Array.isArray(e))return e}function zk(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function Jh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A2(e,t){if(e){if(typeof e=="string")return Jh(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jh(e,t):void 0}}function Gk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
78
+ 0s-12.5 32.8 0 45.3l192 192z`})}),D2=({title:e,state:t,type:n,setUpYear:r={startYear:1970,endAfterThisYear:20},hiddenHeader:i,setActiveTypeCalendar:a,onChangeYear:o})=>{const s=(u,c)=>{const p=t.focusedDate.set({year:u});c?(a("month"),t.setFocusedDate(p)):!c&&typeof o=="function"&&o(p)},l=(u,c,p)=>Array.from({length:(c-u)/p+1},(h,d)=>u+d*p);return N.useEffect(()=>{const u=document.getElementById(`calendar-year-${t.focusedDate.year}`),c=document.getElementById("wrapper-calendar-year");u&&c&&c.scrollTo({behavior:"instant",top:u.offsetTop-93})},[]),F.jsxs("div",{className:`1ru-w-[296px] ${Ae["container-calendar"]}`,children:[!i&&F.jsx("div",{className:`${Ae["header-calendar"]} 1ru-my-2`,children:F.jsxs("div",{className:`${Ae["header-button-calendar"]} ${n.includes("date")||n.includes("month")?"":Ae.disabled}`,onClick:()=>{n.includes("date")?a("date"):n.includes("month")&&a("month")},children:[e," ",(n.includes("date")||n.includes("month"))&&F.jsx(Lr,{})]})}),F.jsx("div",{id:"wrapper-calendar-year",className:Ae["year-calendar"],children:l(r==null?void 0:r.startYear,new Date().getFullYear()+r.endAfterThisYear,1).map(u=>{var v,m;const c=Number(u),p=t!=null&&t.minValue?c<((v=t==null?void 0:t.minValue)==null?void 0:v.year):!1,h=t!=null&&t.maxValue?c>((m=t==null?void 0:t.maxValue)==null?void 0:m.year):!1,d=p||h;return F.jsx("div",{id:`calendar-year-${u}`,onClick:()=>{d||s(c,n.includes("month"))},className:`${Ae["cell-year"]} ${t.focusedDate.year===c&&!d?Ae.selected:""} ${t.focusedDate.year!==c&&!d?"hover:1ru-bg-laba-blue-01":""} ${d?"1ru-text-gray-400":"1ru-cursor-pointer"}`,children:u},u)})})]})},Vl=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)},_f={"en-US":{"Rows per page:":"Rows per page:",of:"of","Go to:":"Go to:"},"id-ID":{"Rows per page:":"Baris per halaman:",of:"dari","Go to:":"Go to:"},"zh-CN":{"Rows per page:":"每页行数:",of:"共","Go to:":"跳至:"},"nl-NL":{"Rows per page:":"Rijen per pagina:",of:"van","Go to:":"Ga naar:"}},Vk=({totalData:e,totalPage:t,pageNumber:n,pageSize:r,className:i,id:a,kind:o="box",prevIcon:s,nextIcon:l,onChange:u,optionPageSize:c=[25,50,75,100],offset:p=1.5,zIndex:h,withGotoPage:d=!1,withMorePage:v=!0,withOptionPageSize:m=!1,locale:b="id-ID"})=>{const f=N.useRef(null),[y,C]=N.useState(n),[S,w]=N.useState(n.toString()),E={box:In["pagination-box"],nude:In["pagination-nude"]},x=1,g=(y-1)*r+1,I=r*y,A=e?`${Ri(g,"decimal")}-${I>=e?Ri(e,"decimal"):Ri(I,"decimal")}`:0,_=N.useMemo(()=>{const P=Math.ceil(e/r);if(x+5>=P)return Vl(1,P);const O=Math.max(y-x,1),M=Math.min(y+x,P),G=O>2,W=M<P-2,U=1,q=P;if(!G&&W){const Q=3+2*x;return[...Vl(1,Q),"mr",P]}if(G&&!W){const Q=3+2*x,Z=Vl(P-Q+1,P);return[U,"ml",...Z]}if(G&&W){const Q=Vl(O,M);return[U,"ml",...Q,"mr",q]}},[e,r,x,y]),T=P=>{typeof u=="function"&&(u(P),C(P.pageNumber),w(P.pageNumber.toString()))},$=P=>{if(typeof u=="function"&&v){if(P==="ml"){const O=y-5;C(O<1?1:y-5)}else if(P==="mr"){const O=y+5;C(O>t?t:y+5)}}},B=P=>{w(P);const k=Number(P);k>0&&k<=t&&T({pageSize:r,totalData:e,totalPage:t,pageNumber:k})};return F.jsxs(F.Fragment,{children:[F.jsxs("div",{id:a??"1ru-pagination",className:`${E[o]} ${i}`,children:[F.jsxs("div",{className:In["pagination-size"],children:[F.jsx("span",{children:_f[b]["Rows per page:"]}),m&&F.jsx(vr,{variants:"ghost-blue-gray-100-bg_white",size:"xs",endIcon:F.jsx(Lr,{className:"!1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px] 1ru-mx-0.5"}),className:"!1ru-rounded-md !1ru-min-w-[60px] 1ru-justify-between",onClick:P=>{var k;return(k=f.current)==null?void 0:k.handlerShow(P)},children:Ri(r,"decimal")}),F.jsxs("span",{children:[A," ",_f[b].of," ",Ri(e,"decimal")]})]}),F.jsxs("div",{className:In["navigation-container"],children:[F.jsx("button",{id:"1ru-pagination-button-prev",className:`${In["button-prev"]}`,disabled:y===1,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n-1}),children:typeof s=="function"||N.isValidElement(s)?N.isValidElement(s)?s:s():F.jsx(Lr,{className:"1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),(_??[]).map((P,k)=>{if(typeof P!="number"){const O=["ml","mr"].includes(P);return F.jsx("button",{className:In["button-container"],disabled:!v,onClick:()=>$(P),children:O?"...":P},k)}return F.jsx("button",{id:`1ru-pagination-button-${P}`,className:`${P===n?In["pagination-active"]:""} ${In["button-container"]}`,disabled:P===n,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:P}),children:Ri(P,"decimal")},k)}),F.jsx("button",{id:"1ru-pagination-button-next",className:`${In["button-next"]}`,disabled:y===t||!t,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n+1}),children:typeof l=="function"||N.isValidElement(l)?N.isValidElement(l)?l:l():F.jsx(Lr,{className:"-1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),d&&F.jsxs("div",{className:In["goto-page"],children:[F.jsx("span",{children:_f[b]["Go to:"]}),F.jsx("input",{type:"number",className:In["goto-page-input"],value:S,onChange:P=>B(P.target.value),onBlur:()=>w(y.toString())})]})]})]}),F.jsx(bi,{floatingOptions:{placement:"bottom-end"},ref:f,className:In["options-size"],offset:p,zIndex:h,children:c.map((P,k)=>F.jsx("p",{className:`${In.option} ${P===r?In.active:""}`,onClick:()=>{var O;T({totalData:e,totalPage:t,pageSize:P,pageNumber:1}),(O=f.current)==null||O.setShow(!1)},children:Ri(P,"decimal")},k))})]})};function Ta(e){"@babel/helpers - typeof";return Ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(e)}function Hk(e,t){if(Ta(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ta(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T2(e){var t=Hk(e,"string");return Ta(t)=="symbol"?t:t+""}function as(e,t,n){return(t=T2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach(function(r){as(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jk(e){if(Array.isArray(e))return e}function zk(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function Jh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A2(e,t){if(e){if(typeof e=="string")return Jh(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jh(e,t):void 0}}function Gk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
79
79
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fi(e,t){return jk(e)||zk(e,t)||A2(e,t)||Gk()}function Wk(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yi(e,t){if(e==null)return{};var n,r,i=Wk(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Uk=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Xk(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,a=e.defaultValue,o=a===void 0?null:a,s=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,p=e.onMenuClose,h=e.onMenuOpen,d=e.value,v=yi(e,Uk),m=N.useState(s!==void 0?s:n),b=fi(m,2),f=b[0],y=b[1],C=N.useState(l!==void 0?l:i),S=fi(C,2),w=S[0],E=S[1],x=N.useState(d!==void 0?d:o),g=fi(x,2),I=g[0],A=g[1],_=N.useCallback(function(M,G){typeof u=="function"&&u(M,G),A(M)},[u]),T=N.useCallback(function(M,G){var W;typeof c=="function"&&(W=c(M,G)),y(W!==void 0?W:M)},[c]),$=N.useCallback(function(){typeof h=="function"&&h(),E(!0)},[h]),B=N.useCallback(function(){typeof p=="function"&&p(),E(!1)},[p]),P=s!==void 0?s:f,k=l!==void 0?l:w,O=d!==void 0?d:I;return _e(_e({},v),{},{inputValue:P,menuIsOpen:k,onChange:_,onInputChange:T,onMenuClose:B,onMenuOpen:$,value:O})}function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(null,arguments)}function Yk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T2(r.key),r)}}function Kk(e,t,n){return t&&U1(e.prototype,t),n&&U1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qh(e,t){return qh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},qh(e,t)}function Zk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qh(e,t)}function tc(e){return tc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tc(e)}function R2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R2=function(){return!!e})()}function Jk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qk(e,t){if(t&&(Ta(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jk(e)}function Qk(e){var t=R2();return function(){var n,r=tc(e);if(t){var i=tc(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return qk(this,n)}}function eP(e){if(Array.isArray(e))return Jh(e)}function tP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
80
80
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pg(e){return eP(e)||tP(e)||A2(e)||nP()}function rP(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function iP(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var aP=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?process.env.NODE_ENV==="production":n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(iP(this));var i=this.tags[this.tags.length-1];if(process.env.NODE_ENV!=="production"){var a=r.charCodeAt(0)===64&&r.charCodeAt(1)===105;a&&this._alreadyInsertedOrderInsensitiveRule&&console.error(`You're attempting to insert the following rule:
81
- `+r+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!a}if(this.isSpeedy){var o=rP(i);try{o.insertRule(r,o.cssRules.length)}catch(s){process.env.NODE_ENV!=="production"&&!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(r)&&console.error('There was a problem inserting the following rule: "'+r+'"',s)}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0,process.env.NODE_ENV!=="production"&&(this._alreadyInsertedOrderInsensitiveRule=!1)},e}(),cn="-ms-",nc="-moz-",Xe="-webkit-",$g="comm",Fg="rule",Ng="decl",oP="@import",B2="@keyframes",sP="@layer",lP=Math.abs,Jc=String.fromCharCode,uP=Object.assign;function cP(e,t){return on(e,0)^45?(((t<<2^on(e,0))<<2^on(e,1))<<2^on(e,2))<<2^on(e,3):0}function k2(e){return e.trim()}function dP(e,t){return(e=t.exec(e))?e[0]:e}function Ye(e,t,n){return e.replace(t,n)}function Qh(e,t){return e.indexOf(t)}function on(e,t){return e.charCodeAt(t)|0}function Fs(e,t,n){return e.slice(t,n)}function Pr(e){return e.length}function Mg(e){return e.length}function Hl(e,t){return t.push(e),e}function fP(e,t){return e.map(t).join("")}var qc=1,To=1,P2=0,Bn=0,Tt=0,zo="";function Qc(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:qc,column:To,length:o,return:""}}function Xo(e,t){return uP(Qc("",null,null,"",null,null,0),e,{length:-e.length},t)}function hP(){return Tt}function gP(){return Tt=Bn>0?on(zo,--Bn):0,To--,Tt===10&&(To=1,qc--),Tt}function Vn(){return Tt=Bn<P2?on(zo,Bn++):0,To++,Tt===10&&(To=1,qc++),Tt}function Vr(){return on(zo,Bn)}function Eu(){return Bn}function pl(e,t){return Fs(zo,e,t)}function Ns(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $2(e){return qc=To=1,P2=Pr(zo=e),Bn=0,[]}function F2(e){return zo="",e}function Su(e){return k2(pl(Bn-1,e0(e===91?e+2:e===40?e+1:e)))}function pP(e){for(;(Tt=Vr())&&Tt<33;)Vn();return Ns(e)>2||Ns(Tt)>3?"":" "}function mP(e,t){for(;--t&&Vn()&&!(Tt<48||Tt>102||Tt>57&&Tt<65||Tt>70&&Tt<97););return pl(e,Eu()+(t<6&&Vr()==32&&Vn()==32))}function e0(e){for(;Vn();)switch(Tt){case e:return Bn;case 34:case 39:e!==34&&e!==39&&e0(Tt);break;case 40:e===41&&e0(e);break;case 92:Vn();break}return Bn}function vP(e,t){for(;Vn()&&e+Tt!==57;)if(e+Tt===84&&Vr()===47)break;return"/*"+pl(t,Bn-1)+"*"+Jc(e===47?e:Vn())}function bP(e){for(;!Ns(Vr());)Vn();return pl(e,Bn)}function yP(e){return F2(wu("",null,null,null,[""],e=$2(e),0,[0],e))}function wu(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,p=o,h=0,d=0,v=0,m=1,b=1,f=1,y=0,C="",S=i,w=a,E=r,x=C;b;)switch(v=y,y=Vn()){case 40:if(v!=108&&on(x,p-1)==58){Qh(x+=Ye(Su(y),"&","&\f"),"&\f")!=-1&&(f=-1);break}case 34:case 39:case 91:x+=Su(y);break;case 9:case 10:case 13:case 32:x+=pP(v);break;case 92:x+=mP(Eu()-1,7);continue;case 47:switch(Vr()){case 42:case 47:Hl(xP(vP(Vn(),Eu()),t,n),l);break;default:x+="/"}break;case 123*m:s[u++]=Pr(x)*f;case 125*m:case 59:case 0:switch(y){case 0:case 125:b=0;case 59+c:f==-1&&(x=Ye(x,/\f/g,"")),d>0&&Pr(x)-p&&Hl(d>32?Y1(x+";",r,n,p-1):Y1(Ye(x," ","")+";",r,n,p-2),l);break;case 59:x+=";";default:if(Hl(E=X1(x,t,n,u,c,i,s,C,S=[],w=[],p),a),y===123)if(c===0)wu(x,t,E,E,S,a,p,s,w);else switch(h===99&&on(x,3)===110?100:h){case 100:case 108:case 109:case 115:wu(e,E,E,r&&Hl(X1(e,E,E,0,0,i,s,C,i,S=[],p),w),i,w,p,s,r?S:w);break;default:wu(x,E,E,E,[""],w,0,s,w)}}u=c=d=0,m=f=1,C=x="",p=o;break;case 58:p=1+Pr(x),d=v;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&gP()==125)continue}switch(x+=Jc(y),y*m){case 38:f=c>0?1:(x+="\f",-1);break;case 44:s[u++]=(Pr(x)-1)*f,f=1;break;case 64:Vr()===45&&(x+=Su(Vn())),h=Vr(),c=p=Pr(C=x+=bP(Eu())),y++;break;case 45:v===45&&Pr(x)==2&&(m=0)}}return a}function X1(e,t,n,r,i,a,o,s,l,u,c){for(var p=i-1,h=i===0?a:[""],d=Mg(h),v=0,m=0,b=0;v<r;++v)for(var f=0,y=Fs(e,p+1,p=lP(m=o[v])),C=e;f<d;++f)(C=k2(m>0?h[f]+" "+y:Ye(y,/&\f/g,h[f])))&&(l[b++]=C);return Qc(e,t,n,i===0?Fg:s,l,u,c)}function xP(e,t,n){return Qc(e,t,n,$g,Jc(hP()),Fs(e,2,-2),0)}function Y1(e,t,n,r){return Qc(e,t,n,Ng,Fs(e,0,r),Fs(e,r+1,-1),r)}function po(e,t){for(var n="",r=Mg(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function CP(e,t,n,r){switch(e.type){case sP:if(e.children.length)break;case oP:case Ng:return e.return=e.return||e.value;case $g:return"";case B2:return e.return=e.value+"{"+po(e.children,r)+"}";case Fg:e.value=e.props.join(",")}return Pr(n=po(e.children,r))?e.return=e.value+"{"+n+"}":""}function EP(e){var t=Mg(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}function SP(e){return function(t){t.root||(t=t.return)&&e(t)}}var wP=function(t,n,r){for(var i=0,a=0;i=a,a=Vr(),i===38&&a===12&&(n[r]=1),!Ns(a);)Vn();return pl(t,Bn)},IP=function(t,n){var r=-1,i=44;do switch(Ns(i)){case 0:i===38&&Vr()===12&&(n[r]=1),t[r]+=wP(Bn-1,n,r);break;case 2:t[r]+=Su(i);break;case 4:if(i===44){t[++r]=Vr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Jc(i)}while(i=Vn());return t},_P=function(t,n){return F2(IP($2(t),n))},K1=new WeakMap,DP=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!K1.get(r))&&!i){K1.set(t,!0);for(var a=[],o=_P(n,a),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=a[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},TP=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}},AP="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",RP=function(t){return t.type==="comm"&&t.children.indexOf(AP)>-1},BP=function(t){return function(n,r,i){if(!(n.type!=="rule"||t.compat)){var a=n.value.match(/(:first|:nth|:nth-last)-child/g);if(a){for(var o=!!n.parent,s=o?n.parent.children:i,l=s.length-1;l>=0;l--){var u=s[l];if(u.line<n.line)break;if(u.column<n.column){if(RP(u))return;break}}a.forEach(function(c){console.error('The pseudo class "'+c+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+c.split("-child")[0]+'-of-type".')})}}}},N2=function(t){return t.type.charCodeAt(1)===105&&t.type.charCodeAt(0)===64},kP=function(t,n){for(var r=t-1;r>=0;r--)if(!N2(n[r]))return!0;return!1},Z1=function(t){t.type="",t.value="",t.return="",t.children="",t.props=""},PP=function(t,n,r){N2(t)&&(t.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),Z1(t)):kP(n,r)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Z1(t)))};function M2(e,t){switch(cP(e,t)){case 5103:return Xe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Xe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Xe+e+nc+e+cn+e+e;case 6828:case 4268:return Xe+e+cn+e+e;case 6165:return Xe+e+cn+"flex-"+e+e;case 5187:return Xe+e+Ye(e,/(\w+).+(:[^]+)/,Xe+"box-$1$2"+cn+"flex-$1$2")+e;case 5443:return Xe+e+cn+"flex-item-"+Ye(e,/flex-|-self/,"")+e;case 4675:return Xe+e+cn+"flex-line-pack"+Ye(e,/align-content|flex-|-self/,"")+e;case 5548:return Xe+e+cn+Ye(e,"shrink","negative")+e;case 5292:return Xe+e+cn+Ye(e,"basis","preferred-size")+e;case 6060:return Xe+"box-"+Ye(e,"-grow","")+Xe+e+cn+Ye(e,"grow","positive")+e;case 4554:return Xe+Ye(e,/([^-])(transform)/g,"$1"+Xe+"$2")+e;case 6187:return Ye(Ye(Ye(e,/(zoom-|grab)/,Xe+"$1"),/(image-set)/,Xe+"$1"),e,"")+e;case 5495:case 3959:return Ye(e,/(image-set\([^]*)/,Xe+"$1$`$1");case 4968:return Ye(Ye(e,/(.+:)(flex-)?(.*)/,Xe+"box-pack:$3"+cn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Xe+e+e;case 4095:case 3583:case 4068:case 2532:return Ye(e,/(.+)-inline(.+)/,Xe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Pr(e)-1-t>6)switch(on(e,t+1)){case 109:if(on(e,t+4)!==45)break;case 102:return Ye(e,/(.+:)(.+)-([^]+)/,"$1"+Xe+"$2-$3$1"+nc+(on(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Qh(e,"stretch")?M2(Ye(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(on(e,t+1)!==115)break;case 6444:switch(on(e,Pr(e)-3-(~Qh(e,"!important")&&10))){case 107:return Ye(e,":",":"+Xe)+e;case 101:return Ye(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Xe+(on(e,14)===45?"inline-":"")+"box$3$1"+Xe+"$2$3$1"+cn+"$2box$3")+e}break;case 5936:switch(on(e,t+11)){case 114:return Xe+e+cn+Ye(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Xe+e+cn+Ye(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Xe+e+cn+Ye(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Xe+e+cn+e+e}return e}var $P=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Ng:t.return=M2(t.value,t.length);break;case B2:return po([Xo(t,{value:Ye(t.value,"@","@"+Xe)})],i);case Fg:if(t.length)return fP(t.props,function(a){switch(dP(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return po([Xo(t,{props:[Ye(a,/:(read-\w+)/,":"+nc+"$1")]})],i);case"::placeholder":return po([Xo(t,{props:[Ye(a,/:(plac\w+)/,":"+Xe+"input-$1")]}),Xo(t,{props:[Ye(a,/:(plac\w+)/,":"+nc+"$1")]}),Xo(t,{props:[Ye(a,/:(plac\w+)/,cn+"input-$1")]})],i)}return""})}},FP=[$P],NP=function(t){var n=t.key;if(process.env.NODE_ENV!=="production"&&!n)throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
82
- If multiple caches share the same key they might "fight" for each other's style elements.`);if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||FP;if(process.env.NODE_ENV!=="production"&&/[^a-z-]/.test(n))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+n+'" was passed');var a={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),f=1;f<b.length;f++)a[b[f]]=!0;s.push(m)});var l,u=[DP,TP];process.env.NODE_ENV!=="production"&&u.push(BP({get compat(){return v.compat}}),PP);{var c,p=[CP,process.env.NODE_ENV!=="production"?function(m){m.root||(m.return?c.insert(m.return):m.value&&m.type!==$g&&c.insert(m.value+"{}"))}:SP(function(m){c.insert(m)})],h=EP(u.concat(i,p)),d=function(b){return po(yP(b),h)};l=function(b,f,y,C){c=y,process.env.NODE_ENV!=="production"&&f.map!==void 0&&(c={insert:function(w){y.insert(w+f.map)}}),d(b?b+"{"+f.styles+"}":f.styles),C&&(v.inserted[f.name]=!0)}}var v={key:n,sheet:new aP({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return v.sheet.hydrate(s),v},jl={exports:{}},Je={};/** @license React v16.13.1
81
+ `+r+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!a}if(this.isSpeedy){var o=rP(i);try{o.insertRule(r,o.cssRules.length)}catch(s){process.env.NODE_ENV!=="production"&&!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(r)&&console.error('There was a problem inserting the following rule: "'+r+'"',s)}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0,process.env.NODE_ENV!=="production"&&(this._alreadyInsertedOrderInsensitiveRule=!1)},e}(),dn="-ms-",nc="-moz-",Ye="-webkit-",$g="comm",Fg="rule",Ng="decl",oP="@import",B2="@keyframes",sP="@layer",lP=Math.abs,Jc=String.fromCharCode,uP=Object.assign;function cP(e,t){return on(e,0)^45?(((t<<2^on(e,0))<<2^on(e,1))<<2^on(e,2))<<2^on(e,3):0}function k2(e){return e.trim()}function dP(e,t){return(e=t.exec(e))?e[0]:e}function Ke(e,t,n){return e.replace(t,n)}function Qh(e,t){return e.indexOf(t)}function on(e,t){return e.charCodeAt(t)|0}function Fs(e,t,n){return e.slice(t,n)}function Pr(e){return e.length}function Mg(e){return e.length}function Hl(e,t){return t.push(e),e}function fP(e,t){return e.map(t).join("")}var qc=1,To=1,P2=0,Bn=0,Tt=0,zo="";function Qc(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:qc,column:To,length:o,return:""}}function Xo(e,t){return uP(Qc("",null,null,"",null,null,0),e,{length:-e.length},t)}function hP(){return Tt}function gP(){return Tt=Bn>0?on(zo,--Bn):0,To--,Tt===10&&(To=1,qc--),Tt}function Vn(){return Tt=Bn<P2?on(zo,Bn++):0,To++,Tt===10&&(To=1,qc++),Tt}function Vr(){return on(zo,Bn)}function Eu(){return Bn}function pl(e,t){return Fs(zo,e,t)}function Ns(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $2(e){return qc=To=1,P2=Pr(zo=e),Bn=0,[]}function F2(e){return zo="",e}function Su(e){return k2(pl(Bn-1,e0(e===91?e+2:e===40?e+1:e)))}function pP(e){for(;(Tt=Vr())&&Tt<33;)Vn();return Ns(e)>2||Ns(Tt)>3?"":" "}function mP(e,t){for(;--t&&Vn()&&!(Tt<48||Tt>102||Tt>57&&Tt<65||Tt>70&&Tt<97););return pl(e,Eu()+(t<6&&Vr()==32&&Vn()==32))}function e0(e){for(;Vn();)switch(Tt){case e:return Bn;case 34:case 39:e!==34&&e!==39&&e0(Tt);break;case 40:e===41&&e0(e);break;case 92:Vn();break}return Bn}function vP(e,t){for(;Vn()&&e+Tt!==57;)if(e+Tt===84&&Vr()===47)break;return"/*"+pl(t,Bn-1)+"*"+Jc(e===47?e:Vn())}function bP(e){for(;!Ns(Vr());)Vn();return pl(e,Bn)}function yP(e){return F2(wu("",null,null,null,[""],e=$2(e),0,[0],e))}function wu(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,p=o,h=0,d=0,v=0,m=1,b=1,f=1,y=0,C="",S=i,w=a,E=r,x=C;b;)switch(v=y,y=Vn()){case 40:if(v!=108&&on(x,p-1)==58){Qh(x+=Ke(Su(y),"&","&\f"),"&\f")!=-1&&(f=-1);break}case 34:case 39:case 91:x+=Su(y);break;case 9:case 10:case 13:case 32:x+=pP(v);break;case 92:x+=mP(Eu()-1,7);continue;case 47:switch(Vr()){case 42:case 47:Hl(xP(vP(Vn(),Eu()),t,n),l);break;default:x+="/"}break;case 123*m:s[u++]=Pr(x)*f;case 125*m:case 59:case 0:switch(y){case 0:case 125:b=0;case 59+c:f==-1&&(x=Ke(x,/\f/g,"")),d>0&&Pr(x)-p&&Hl(d>32?Y1(x+";",r,n,p-1):Y1(Ke(x," ","")+";",r,n,p-2),l);break;case 59:x+=";";default:if(Hl(E=X1(x,t,n,u,c,i,s,C,S=[],w=[],p),a),y===123)if(c===0)wu(x,t,E,E,S,a,p,s,w);else switch(h===99&&on(x,3)===110?100:h){case 100:case 108:case 109:case 115:wu(e,E,E,r&&Hl(X1(e,E,E,0,0,i,s,C,i,S=[],p),w),i,w,p,s,r?S:w);break;default:wu(x,E,E,E,[""],w,0,s,w)}}u=c=d=0,m=f=1,C=x="",p=o;break;case 58:p=1+Pr(x),d=v;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&gP()==125)continue}switch(x+=Jc(y),y*m){case 38:f=c>0?1:(x+="\f",-1);break;case 44:s[u++]=(Pr(x)-1)*f,f=1;break;case 64:Vr()===45&&(x+=Su(Vn())),h=Vr(),c=p=Pr(C=x+=bP(Eu())),y++;break;case 45:v===45&&Pr(x)==2&&(m=0)}}return a}function X1(e,t,n,r,i,a,o,s,l,u,c){for(var p=i-1,h=i===0?a:[""],d=Mg(h),v=0,m=0,b=0;v<r;++v)for(var f=0,y=Fs(e,p+1,p=lP(m=o[v])),C=e;f<d;++f)(C=k2(m>0?h[f]+" "+y:Ke(y,/&\f/g,h[f])))&&(l[b++]=C);return Qc(e,t,n,i===0?Fg:s,l,u,c)}function xP(e,t,n){return Qc(e,t,n,$g,Jc(hP()),Fs(e,2,-2),0)}function Y1(e,t,n,r){return Qc(e,t,n,Ng,Fs(e,0,r),Fs(e,r+1,-1),r)}function po(e,t){for(var n="",r=Mg(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function CP(e,t,n,r){switch(e.type){case sP:if(e.children.length)break;case oP:case Ng:return e.return=e.return||e.value;case $g:return"";case B2:return e.return=e.value+"{"+po(e.children,r)+"}";case Fg:e.value=e.props.join(",")}return Pr(n=po(e.children,r))?e.return=e.value+"{"+n+"}":""}function EP(e){var t=Mg(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}function SP(e){return function(t){t.root||(t=t.return)&&e(t)}}var wP=function(t,n,r){for(var i=0,a=0;i=a,a=Vr(),i===38&&a===12&&(n[r]=1),!Ns(a);)Vn();return pl(t,Bn)},IP=function(t,n){var r=-1,i=44;do switch(Ns(i)){case 0:i===38&&Vr()===12&&(n[r]=1),t[r]+=wP(Bn-1,n,r);break;case 2:t[r]+=Su(i);break;case 4:if(i===44){t[++r]=Vr()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Jc(i)}while(i=Vn());return t},_P=function(t,n){return F2(IP($2(t),n))},K1=new WeakMap,DP=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!K1.get(r))&&!i){K1.set(t,!0);for(var a=[],o=_P(n,a),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=a[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},TP=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}},AP="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",RP=function(t){return t.type==="comm"&&t.children.indexOf(AP)>-1},BP=function(t){return function(n,r,i){if(!(n.type!=="rule"||t.compat)){var a=n.value.match(/(:first|:nth|:nth-last)-child/g);if(a){for(var o=!!n.parent,s=o?n.parent.children:i,l=s.length-1;l>=0;l--){var u=s[l];if(u.line<n.line)break;if(u.column<n.column){if(RP(u))return;break}}a.forEach(function(c){console.error('The pseudo class "'+c+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+c.split("-child")[0]+'-of-type".')})}}}},N2=function(t){return t.type.charCodeAt(1)===105&&t.type.charCodeAt(0)===64},kP=function(t,n){for(var r=t-1;r>=0;r--)if(!N2(n[r]))return!0;return!1},Z1=function(t){t.type="",t.value="",t.return="",t.children="",t.props=""},PP=function(t,n,r){N2(t)&&(t.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),Z1(t)):kP(n,r)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),Z1(t)))};function M2(e,t){switch(cP(e,t)){case 5103:return Ye+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ye+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ye+e+nc+e+dn+e+e;case 6828:case 4268:return Ye+e+dn+e+e;case 6165:return Ye+e+dn+"flex-"+e+e;case 5187:return Ye+e+Ke(e,/(\w+).+(:[^]+)/,Ye+"box-$1$2"+dn+"flex-$1$2")+e;case 5443:return Ye+e+dn+"flex-item-"+Ke(e,/flex-|-self/,"")+e;case 4675:return Ye+e+dn+"flex-line-pack"+Ke(e,/align-content|flex-|-self/,"")+e;case 5548:return Ye+e+dn+Ke(e,"shrink","negative")+e;case 5292:return Ye+e+dn+Ke(e,"basis","preferred-size")+e;case 6060:return Ye+"box-"+Ke(e,"-grow","")+Ye+e+dn+Ke(e,"grow","positive")+e;case 4554:return Ye+Ke(e,/([^-])(transform)/g,"$1"+Ye+"$2")+e;case 6187:return Ke(Ke(Ke(e,/(zoom-|grab)/,Ye+"$1"),/(image-set)/,Ye+"$1"),e,"")+e;case 5495:case 3959:return Ke(e,/(image-set\([^]*)/,Ye+"$1$`$1");case 4968:return Ke(Ke(e,/(.+:)(flex-)?(.*)/,Ye+"box-pack:$3"+dn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ye+e+e;case 4095:case 3583:case 4068:case 2532:return Ke(e,/(.+)-inline(.+)/,Ye+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Pr(e)-1-t>6)switch(on(e,t+1)){case 109:if(on(e,t+4)!==45)break;case 102:return Ke(e,/(.+:)(.+)-([^]+)/,"$1"+Ye+"$2-$3$1"+nc+(on(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Qh(e,"stretch")?M2(Ke(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(on(e,t+1)!==115)break;case 6444:switch(on(e,Pr(e)-3-(~Qh(e,"!important")&&10))){case 107:return Ke(e,":",":"+Ye)+e;case 101:return Ke(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ye+(on(e,14)===45?"inline-":"")+"box$3$1"+Ye+"$2$3$1"+dn+"$2box$3")+e}break;case 5936:switch(on(e,t+11)){case 114:return Ye+e+dn+Ke(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ye+e+dn+Ke(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ye+e+dn+Ke(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ye+e+dn+e+e}return e}var $P=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Ng:t.return=M2(t.value,t.length);break;case B2:return po([Xo(t,{value:Ke(t.value,"@","@"+Ye)})],i);case Fg:if(t.length)return fP(t.props,function(a){switch(dP(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return po([Xo(t,{props:[Ke(a,/:(read-\w+)/,":"+nc+"$1")]})],i);case"::placeholder":return po([Xo(t,{props:[Ke(a,/:(plac\w+)/,":"+Ye+"input-$1")]}),Xo(t,{props:[Ke(a,/:(plac\w+)/,":"+nc+"$1")]}),Xo(t,{props:[Ke(a,/:(plac\w+)/,dn+"input-$1")]})],i)}return""})}},FP=[$P],NP=function(t){var n=t.key;if(process.env.NODE_ENV!=="production"&&!n)throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
82
+ If multiple caches share the same key they might "fight" for each other's style elements.`);if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||FP;if(process.env.NODE_ENV!=="production"&&/[^a-z-]/.test(n))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+n+'" was passed');var a={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),f=1;f<b.length;f++)a[b[f]]=!0;s.push(m)});var l,u=[DP,TP];process.env.NODE_ENV!=="production"&&u.push(BP({get compat(){return v.compat}}),PP);{var c,p=[CP,process.env.NODE_ENV!=="production"?function(m){m.root||(m.return?c.insert(m.return):m.value&&m.type!==$g&&c.insert(m.value+"{}"))}:SP(function(m){c.insert(m)})],h=EP(u.concat(i,p)),d=function(b){return po(yP(b),h)};l=function(b,f,y,C){c=y,process.env.NODE_ENV!=="production"&&f.map!==void 0&&(c={insert:function(w){y.insert(w+f.map)}}),d(b?b+"{"+f.styles+"}":f.styles),C&&(v.inserted[f.name]=!0)}}var v={key:n,sheet:new aP({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return v.sheet.hydrate(s),v},jl={exports:{}},qe={};/** @license React v16.13.1
83
83
  * react-is.production.min.js
84
84
  *
85
85
  * Copyright (c) Facebook, Inc. and its affiliates.
86
86
  *
87
87
  * This source code is licensed under the MIT license found in the
88
88
  * LICENSE file in the root directory of this source tree.
89
- */var J1;function MP(){if(J1)return Je;J1=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function C(w){if(typeof w=="object"&&w!==null){var E=w.$$typeof;switch(E){case t:switch(w=w.type,w){case l:case u:case r:case a:case i:case p:return w;default:switch(w=w&&w.$$typeof,w){case s:case c:case v:case d:case o:return w;default:return E}}case n:return E}}}function S(w){return C(w)===u}return Je.AsyncMode=l,Je.ConcurrentMode=u,Je.ContextConsumer=s,Je.ContextProvider=o,Je.Element=t,Je.ForwardRef=c,Je.Fragment=r,Je.Lazy=v,Je.Memo=d,Je.Portal=n,Je.Profiler=a,Je.StrictMode=i,Je.Suspense=p,Je.isAsyncMode=function(w){return S(w)||C(w)===l},Je.isConcurrentMode=S,Je.isContextConsumer=function(w){return C(w)===s},Je.isContextProvider=function(w){return C(w)===o},Je.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Je.isForwardRef=function(w){return C(w)===c},Je.isFragment=function(w){return C(w)===r},Je.isLazy=function(w){return C(w)===v},Je.isMemo=function(w){return C(w)===d},Je.isPortal=function(w){return C(w)===n},Je.isProfiler=function(w){return C(w)===a},Je.isStrictMode=function(w){return C(w)===i},Je.isSuspense=function(w){return C(w)===p},Je.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===a||w===i||w===p||w===h||typeof w=="object"&&w!==null&&(w.$$typeof===v||w.$$typeof===d||w.$$typeof===o||w.$$typeof===s||w.$$typeof===c||w.$$typeof===b||w.$$typeof===f||w.$$typeof===y||w.$$typeof===m)},Je.typeOf=C,Je}var qe={};/** @license React v16.13.1
89
+ */var J1;function MP(){if(J1)return qe;J1=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function C(w){if(typeof w=="object"&&w!==null){var E=w.$$typeof;switch(E){case t:switch(w=w.type,w){case l:case u:case r:case a:case i:case p:return w;default:switch(w=w&&w.$$typeof,w){case s:case c:case v:case d:case o:return w;default:return E}}case n:return E}}}function S(w){return C(w)===u}return qe.AsyncMode=l,qe.ConcurrentMode=u,qe.ContextConsumer=s,qe.ContextProvider=o,qe.Element=t,qe.ForwardRef=c,qe.Fragment=r,qe.Lazy=v,qe.Memo=d,qe.Portal=n,qe.Profiler=a,qe.StrictMode=i,qe.Suspense=p,qe.isAsyncMode=function(w){return S(w)||C(w)===l},qe.isConcurrentMode=S,qe.isContextConsumer=function(w){return C(w)===s},qe.isContextProvider=function(w){return C(w)===o},qe.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},qe.isForwardRef=function(w){return C(w)===c},qe.isFragment=function(w){return C(w)===r},qe.isLazy=function(w){return C(w)===v},qe.isMemo=function(w){return C(w)===d},qe.isPortal=function(w){return C(w)===n},qe.isProfiler=function(w){return C(w)===a},qe.isStrictMode=function(w){return C(w)===i},qe.isSuspense=function(w){return C(w)===p},qe.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===u||w===a||w===i||w===p||w===h||typeof w=="object"&&w!==null&&(w.$$typeof===v||w.$$typeof===d||w.$$typeof===o||w.$$typeof===s||w.$$typeof===c||w.$$typeof===b||w.$$typeof===f||w.$$typeof===y||w.$$typeof===m)},qe.typeOf=C,qe}var Qe={};/** @license React v16.13.1
90
90
  * react-is.development.js
91
91
  *
92
92
  * Copyright (c) Facebook, Inc. and its affiliates.
93
93
  *
94
94
  * This source code is licensed under the MIT license found in the
95
95
  * LICENSE file in the root directory of this source tree.
96
- */var q1;function OP(){return q1||(q1=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function C(D){return typeof D=="string"||typeof D=="function"||D===r||D===u||D===a||D===i||D===p||D===h||typeof D=="object"&&D!==null&&(D.$$typeof===v||D.$$typeof===d||D.$$typeof===o||D.$$typeof===s||D.$$typeof===c||D.$$typeof===b||D.$$typeof===f||D.$$typeof===y||D.$$typeof===m)}function S(D){if(typeof D=="object"&&D!==null){var L=D.$$typeof;switch(L){case t:var K=D.type;switch(K){case l:case u:case r:case a:case i:case p:return K;default:var X=K&&K.$$typeof;switch(X){case s:case c:case v:case d:case o:return X;default:return L}}case n:return L}}}var w=l,E=u,x=s,g=o,I=t,A=c,_=r,T=v,$=d,B=n,P=a,k=i,O=p,M=!1;function G(D){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),W(D)||S(D)===l}function W(D){return S(D)===u}function U(D){return S(D)===s}function q(D){return S(D)===o}function Q(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Z(D){return S(D)===c}function ee(D){return S(D)===r}function J(D){return S(D)===v}function le(D){return S(D)===d}function re(D){return S(D)===n}function R(D){return S(D)===a}function H(D){return S(D)===i}function V(D){return S(D)===p}qe.AsyncMode=w,qe.ConcurrentMode=E,qe.ContextConsumer=x,qe.ContextProvider=g,qe.Element=I,qe.ForwardRef=A,qe.Fragment=_,qe.Lazy=T,qe.Memo=$,qe.Portal=B,qe.Profiler=P,qe.StrictMode=k,qe.Suspense=O,qe.isAsyncMode=G,qe.isConcurrentMode=W,qe.isContextConsumer=U,qe.isContextProvider=q,qe.isElement=Q,qe.isForwardRef=Z,qe.isFragment=ee,qe.isLazy=J,qe.isMemo=le,qe.isPortal=re,qe.isProfiler=R,qe.isStrictMode=H,qe.isSuspense=V,qe.isValidElementType=C,qe.typeOf=S}()),qe}var Q1;function Og(){return Q1||(Q1=1,process.env.NODE_ENV==="production"?jl.exports=MP():jl.exports=OP()),jl.exports}var Df,ev;function LP(){if(ev)return Df;ev=1;var e=Og(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=i;function o(v){return e.isMemo(v)?i:a[v.$$typeof]||t}var s=Object.defineProperty,l=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;function d(v,m,b){if(typeof m!="string"){if(h){var f=p(m);f&&f!==h&&d(v,f,b)}var y=l(m);u&&(y=y.concat(u(m)));for(var C=o(v),S=o(m),w=0;w<y.length;++w){var E=y[w];if(!n[E]&&!(b&&b[E])&&!(S&&S[E])&&!(C&&C[E])){var x=c(m,E);try{s(v,E,x)}catch{}}}}return v}return Df=d,Df}LP();var VP=!0;function O2(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Lg=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||VP===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Vg=function(t,n,r){Lg(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function HP(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var jP={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function zP(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var tv=`You have illegal escape sequence in your template literal, most likely inside content's property value.
96
+ */var q1;function OP(){return q1||(q1=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,f=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function C(D){return typeof D=="string"||typeof D=="function"||D===r||D===u||D===a||D===i||D===p||D===h||typeof D=="object"&&D!==null&&(D.$$typeof===v||D.$$typeof===d||D.$$typeof===o||D.$$typeof===s||D.$$typeof===c||D.$$typeof===b||D.$$typeof===f||D.$$typeof===y||D.$$typeof===m)}function S(D){if(typeof D=="object"&&D!==null){var L=D.$$typeof;switch(L){case t:var K=D.type;switch(K){case l:case u:case r:case a:case i:case p:return K;default:var X=K&&K.$$typeof;switch(X){case s:case c:case v:case d:case o:return X;default:return L}}case n:return L}}}var w=l,E=u,x=s,g=o,I=t,A=c,_=r,T=v,$=d,B=n,P=a,k=i,O=p,M=!1;function G(D){return M||(M=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),W(D)||S(D)===l}function W(D){return S(D)===u}function U(D){return S(D)===s}function q(D){return S(D)===o}function Q(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function Z(D){return S(D)===c}function ee(D){return S(D)===r}function J(D){return S(D)===v}function le(D){return S(D)===d}function re(D){return S(D)===n}function R(D){return S(D)===a}function H(D){return S(D)===i}function V(D){return S(D)===p}Qe.AsyncMode=w,Qe.ConcurrentMode=E,Qe.ContextConsumer=x,Qe.ContextProvider=g,Qe.Element=I,Qe.ForwardRef=A,Qe.Fragment=_,Qe.Lazy=T,Qe.Memo=$,Qe.Portal=B,Qe.Profiler=P,Qe.StrictMode=k,Qe.Suspense=O,Qe.isAsyncMode=G,Qe.isConcurrentMode=W,Qe.isContextConsumer=U,Qe.isContextProvider=q,Qe.isElement=Q,Qe.isForwardRef=Z,Qe.isFragment=ee,Qe.isLazy=J,Qe.isMemo=le,Qe.isPortal=re,Qe.isProfiler=R,Qe.isStrictMode=H,Qe.isSuspense=V,Qe.isValidElementType=C,Qe.typeOf=S}()),Qe}var Q1;function Og(){return Q1||(Q1=1,process.env.NODE_ENV==="production"?jl.exports=MP():jl.exports=OP()),jl.exports}var Df,ev;function LP(){if(ev)return Df;ev=1;var e=Og(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=i;function o(v){return e.isMemo(v)?i:a[v.$$typeof]||t}var s=Object.defineProperty,l=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;function d(v,m,b){if(typeof m!="string"){if(h){var f=p(m);f&&f!==h&&d(v,f,b)}var y=l(m);u&&(y=y.concat(u(m)));for(var C=o(v),S=o(m),w=0;w<y.length;++w){var E=y[w];if(!n[E]&&!(b&&b[E])&&!(S&&S[E])&&!(C&&C[E])){var x=c(m,E);try{s(v,E,x)}catch{}}}}return v}return Df=d,Df}LP();var VP=!0;function O2(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Lg=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||VP===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Vg=function(t,n,r){Lg(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function HP(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var jP={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function zP(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var tv=`You have illegal escape sequence in your template literal, most likely inside content's property value.
97
97
  Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
98
98
  You can read more about this here:
99
99
  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`,GP="You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).",WP=/[A-Z]|^ms/g,L2=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Hg=function(t){return t.charCodeAt(1)===45},nv=function(t){return t!=null&&typeof t!="boolean"},Tf=zP(function(e){return Hg(e)?e:e.replace(WP,"-$&").toLowerCase()}),rc=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(L2,function(r,i,a){return gr={name:i,styles:a,next:gr},i})}return jP[t]!==1&&!Hg(t)&&typeof n=="number"&&n!==0?n+"px":n};if(process.env.NODE_ENV!=="production"){var UP=/(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/,XP=["normal","none","initial","inherit","unset"],YP=rc,KP=/^-ms-/,ZP=/-(.)/g,rv={};rc=function(t,n){if(t==="content"&&(typeof n!="string"||XP.indexOf(n)===-1&&!UP.test(n)&&(n.charAt(0)!==n.charAt(n.length-1)||n.charAt(0)!=='"'&&n.charAt(0)!=="'")))throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+n+"\"'`");var r=YP(t,n);return r!==""&&!Hg(t)&&t.indexOf("-")!==-1&&rv[t]===void 0&&(rv[t]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+t.replace(KP,"ms-").replace(ZP,function(i,a){return a.toUpperCase()})+"?")),r}}var V2="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Ms(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0){if(process.env.NODE_ENV!=="production"&&n.toString()==="NO_COMPONENT_SELECTOR")throw new Error(V2);return n}switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return gr={name:n.name,styles:n.styles,next:gr},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)gr={name:r.name,styles:r.styles,next:gr},r=r.next;var i=n.styles+";";return process.env.NODE_ENV!=="production"&&n.map!==void 0&&(i+=n.map),i}return JP(e,t,n)}case"function":{if(e!==void 0){var a=gr,o=n(e);return gr=a,Ms(e,t,o)}else process.env.NODE_ENV!=="production"&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break}case"string":if(process.env.NODE_ENV!=="production"){var s=[],l=n.replace(L2,function(c,p,h){var d="animation"+s.length;return s.push("const "+d+" = keyframes`"+h.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+d+"}"});s.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(s,["`"+l+"`"]).join(`
@@ -132,11 +132,11 @@ You should wrap it with \`css\` like this:
132
132
  ${b()} ${f()} ${u?aa.disabled:""} ${l??""}`,htmlFor:n??t,children:[F.jsx(ud,{id:n,name:t,type:r,disabled:u,...e,...v}),F.jsxs("div",{children:[F.jsx("p",{className:`${aa.label}
133
133
  ${i?`${m.typographyLabel[i]} custom-typography`:""}`,children:p}),F.jsx("p",{className:`${aa.desc} ${a?`${m.typographyDesc[a]} custom-typography`:""}`,children:h})]})]})},bb={"gap-0":"1ru-gap-0","gap-x-0":"1ru-gap-x-0","gap-y-0":"1ru-gap-y-0","gap-px":"1ru-gap-px","gap-x-px":"1ru-gap-x-px","gap-y-px":"1ru-gap-y-px","gap-0.5":"1ru-gap-0.5","gap-x-0.5":"1ru-gap-x-0.5","gap-y-0.5":"1ru-gap-y-0.5","gap-1":"1ru-gap-1","gap-x-1":"1ru-gap-x-1","gap-y-1":"1ru-gap-y-1","gap-1.5":"1ru-gap-1.5","gap-x-1.5":"1ru-gap-x-1.5","gap-y-1.5":"1ru-gap-y-1.5","gap-2":"1ru-gap-2","gap-x-2":"1ru-gap-x-2","gap-y-2":"1ru-gap-y-2","gap-2.5":"1ru-gap-2.5","gap-x-2.5":"1ru-gap-x-2.5","gap-y-2.5":"1ru-gap-y-2.5","gap-3":"1ru-gap-3","gap-x-3":"1ru-gap-x-3","gap-y-3":"1ru-gap-y-3","gap-3.5":"1ru-gap-3.5","gap-x-3.5":"1ru-gap-x-3.5","gap-y-3.5":"1ru-gap-y-3.5","gap-4":"1ru-gap-4","gap-x-4":"1ru-gap-x-4","gap-y-4":"1ru-gap-y-4","gap-5":"1ru-gap-5","gap-x-5":"1ru-gap-x-5","gap-y-5":"1ru-gap-y-5","gap-6":"1ru-gap-6","gap-x-6":"1ru-gap-x-6","gap-y-6":"1ru-gap-y-6","gap-7":"1ru-gap-7","gap-x-7":"1ru-gap-x-7","gap-y-7":"1ru-gap-y-7","gap-8":"1ru-gap-8","gap-x-8":"1ru-gap-x-8","gap-y-8":"1ru-gap-y-8","gap-9":"1ru-gap-9","gap-x-9":"1ru-gap-x-9","gap-y-9":"1ru-gap-y-9","gap-10":"1ru-gap-10","gap-x-10":"1ru-gap-x-10","gap-y-10":"1ru-gap-y-10"},WM="_urls_j9vj0_85",UM="_action_j9vj0_115",XM="_url_j9vj0_85",YM="_active_j9vj0_350",Qa={"blue-700":"_blue-700_j9vj0_85",urls:WM,action:UM,"laba-blue-10":"_laba-blue-10_j9vj0_241",url:XM,active:YM},KM=({as:e,variants:t="laba-blue-10",fonts:n="lato",urls:r=[],textBreadcrumbs:i=[],onClickBreadcrumbs:a=[],gapAction:o,gapUrls:s,className:l,textAction:u="Kembali",iconAction:c,onClickAction:p,onClickUrls:h,separator:d=">",propsLink:v,classNameAction:m,classNameUrl:b,renderAction:f,...y})=>{const C=e??"div",S={fonts:{lato:"1ru-font-lato",inter:"1ru-font-Inter"},variants:{"laba-blue-10":Qa["laba-blue-10"],"blue-700":Qa["blue-700"]},gapAction:bb,gapUrls:bb},w=E=>!!(Array.isArray(r)&&r.length>0&&r.length-1===E);return F.jsxs("div",{className:`${S.fonts[n]} ${S.variants[t]}
134
134
  ${l??""}`,...y,children:[p&&F.jsxs("div",{onClick:p,className:`${Qa.action} ${m??""}
135
- ${o?S.gapAction[o]:""}`,children:[c,u]}),typeof f=="function"&&f(),F.jsx("div",{className:`${Qa.urls} ${s?S.gapUrls[s]:""}`,children:r==null?void 0:r.map((E,x)=>F.jsxs(N.Fragment,{children:[F.jsx(C,{className:`${Qa.url} ${w(x)?Qa.active:""} ${b??""}`,onClick:()=>{(a==null?void 0:a[x])!==void 0&&typeof a[x]=="function"?a[x]():typeof h=="function"&&h(E)},...v?v(E,x,r):{},children:i[x]}),!w(x)&&F.jsx(F.Fragment,{children:d})]},x))})]})},ZM="_sidebar_1hfwn_328",In={"splace-screen":"_splace-screen_1hfwn_313","payhere-brand-base-white":"_payhere-brand-base-white_1hfwn_325",sidebar:ZM,"button-collaps-sidebar":"_button-collaps-sidebar_1hfwn_343","menu-sidebar":"_menu-sidebar_1hfwn_360","sidebar-open":"_sidebar-open_1hfwn_388","container-icon-company-sidebar":"_container-icon-company-sidebar_1hfwn_405","icon-company-sidebar":"_icon-company-sidebar_1hfwn_408","sidebar-close":"_sidebar-close_1hfwn_416","content-sidebar":"_content-sidebar_1hfwn_441","payhere-brand-base-transparent":"_payhere-brand-base-transparent_1hfwn_520","laba-white":"_laba-white_1hfwn_715","lpd-brand-base-white":"_lpd-brand-base-white_1hfwn_1099","lpd-brand-base-transparent":"_lpd-brand-base-transparent_1hfwn_1330"},JM="_hidden_twfoe_402",tt={"item-sidebar-1":"_item-sidebar-1_twfoe_67","item-sidebar-2":"_item-sidebar-2_twfoe_67","item-label":"_item-label_twfoe_115","item-icon-subs":"_item-icon-subs_twfoe_313","item-icon":"_item-icon_twfoe_313","item-sidebar-open":"_item-sidebar-open_twfoe_362","item-sidebar-close":"_item-sidebar-close_twfoe_377","item-sidebar-lpd":"_item-sidebar-lpd_twfoe_386","item-sidebar-laba":"_item-sidebar-laba_twfoe_386","item-sidebar-payhere":"_item-sidebar-payhere_twfoe_386","item-subs-sidebar":"_item-subs-sidebar_twfoe_393",hidden:JM,"divider-item-sidebar-payhere":"_divider-item-sidebar-payhere_twfoe_412","divider-item-sidebar-lpd":"_divider-item-sidebar-lpd_twfoe_417","hover-sidebar-payhere":"_hover-sidebar-payhere_twfoe_459","hover-sidebar-laba":"_hover-sidebar-laba_twfoe_468","hover-sidebar-lpd":"_hover-sidebar-lpd_twfoe_477"},$S=({as:e,show:t,open:n,patch:r,iconSubs:i,variant:a="payhere-brand-base-white",setShow:o,onClickItems:s,propsLink:l,...u})=>{var C,S,w,E,x,g,I;const c={activeColor:{"payhere-brand-base-white":tt["item-sidebar-payhere"],"payhere-brand-base-transparent":tt["item-sidebar-payhere"],"laba-white":tt["item-sidebar-laba"],"lpd-brand-base-white":tt["item-sidebar-lpd"],"lpd-brand-base-transparent":tt["item-sidebar-lpd"]},hoverColor:{"payhere-brand-base-white":tt["hover-sidebar-payhere"],"payhere-brand-base-transparent":tt["hover-sidebar-payhere"],"laba-white":tt["hover-sidebar-laba"],"lpd-brand-base-white":tt["hover-sidebar-lpd"],"lpd-brand-base-transparent":tt["hover-sidebar-lpd"]},divider:{"payhere-brand-base-white":tt["divider-item-sidebar-payhere"],"payhere-brand-base-transparent":tt["divider-item-sidebar-payhere"],"laba-white":tt["divider-item-sidebar-laba"],"lpd-brand-base-white":tt["divider-item-sidebar-lpd"],"lpd-brand-base-transparent":tt["divider-item-sidebar-lpd"]}};let p=F.jsx(F.Fragment,{});const h=e??"div",[d,v]=N.useState(!1),m=r===u.slug,b=t.split("/"),f=b.includes(u.name),y=()=>{if(u.subs.length>0)if(f){const A=b.splice(0,b.indexOf(u.name));A.length>0?o(`${A.join("/")}/`):o("")}else o(`${t}${u.name}/`);else typeof s=="function"&&s(u)};return u.isShow?((u.parent===1||u.parent===3)&&(p=F.jsxs(F.Fragment,{children:[F.jsxs(h,{id:u.name,className:`${tt["item-sidebar-1"]} ${(C=c.hoverColor)==null?void 0:C[a]}
136
- ${m||u.subs.length>0&&f?(S=c.activeColor)==null?void 0:S[a]:""} ${typeof n=="boolean"&&n?tt["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?tt["item-sidebar-close"]:""}
137
- `,onClick:y,onMouseOver:()=>v(!0),onMouseOut:()=>v(!1),...l?l(u.slug,u):{},children:[F.jsxs("div",{className:"1ru-flex 1ru-items-center 1ru-gap-3 1ru-relative",children:[N.isValidElement(u.svgIcon)&&F.jsx("div",{className:tt["item-icon"],children:m||u.subs.length>0&&f?u==null?void 0:u.svgIconActive:d?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),F.jsx("div",{className:tt["item-label"],children:u.label})]}),u.subs.length>0&&n&&F.jsxs("div",{className:tt["item-icon-subs"],children:[N.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===3&&!u.subs.length&&F.jsx("div",{className:(w=c.divider)==null?void 0:w[a]})]})),(u.parent===2||u.parent===4)&&(p=F.jsxs(F.Fragment,{children:[F.jsxs(h,{id:u.name,className:`${tt["item-sidebar-2"]} ${(E=c.hoverColor)==null?void 0:E[a]}
138
- ${m||u.subs.length>0&&f?(x=c.activeColor)==null?void 0:x[a]:""} ${typeof n=="boolean"&&n?tt["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?tt["item-sidebar-close"]:""}
139
- `,onClick:y,onMouseOver:()=>v(!0),onMouseOut:()=>v(!1),...l?l(u.slug,u):{},children:[N.isValidElement(u.svgIcon)&&F.jsx("div",{className:tt["item-icon"],children:m||u.subs.length>0&&f?u==null?void 0:u.svgIconActive:d?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),F.jsx("div",{className:tt["item-label"],children:u.label}),u.subs.length>0&&n&&F.jsxs("div",{className:tt["item-icon-subs"],children:[N.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===4&&!u.subs.length&&F.jsx("div",{className:(g=c.divider)==null?void 0:g[a]})]})),u.subs.length>0?F.jsxs("div",{className:`${n||f?"":"-mt-2"}`,children:[p,F.jsx("div",{className:`${tt["item-subs-sidebar"]} ${!n||!f?tt.hidden:""}`,children:u.subs.map(A=>N.createElement($S,{...A,as:A.manualRoute?"div":A.subs.length>0?e:u.linkComponent,key:A.name,patch:r,iconSubs:i,show:t,open:n,variant:a,setShow:o}))}),[3,4].includes(u.parent)&&F.jsx("div",{className:(I=c.divider)==null?void 0:I[a]})]}):p):F.jsx(F.Fragment,{})},FS=N.forwardRef((e,t)=>{var P;const{as:n,children:r,patch:i="/",iconCompany:a,iconSubs:o,iconCollapse:s,iconCollapseClose:l,modules:u,toleranceWidthIconCompany:c=25,onClickItems:p,variant:h="payhere-brand-base-white",footer:d,withInheritance:v,...m}=e,b=N.useRef(null),f={withCuctomWidthIconCompany:["payhere-brand-base-white","payhere-brand-base-transparent"],variants:{"payhere-brand-base-white":In["payhere-brand-base-white"],"payhere-brand-base-transparent":In["payhere-brand-base-transparent"],"laba-white":In["laba-white"],"lpd-brand-base-white":In["lpd-brand-base-white"],"lpd-brand-base-transparent":In["lpd-brand-base-transparent"]}},[y,C]=N.useState(null),[S,w]=N.useState(null),[E,x]=N.useState(""),[g,I]=N.useState(),[A,_]=N.useState(0),T=()=>{var M;let k=0;const O=document.getElementById("icon-company-sidebar");(M=O==null?void 0:O.childNodes)==null||M.forEach(G=>{k+=G.getBoundingClientRect().width??0}),I(k+c+"px")},$=()=>{_(window.innerWidth)},B=()=>{C(!S),S?I("auto"):setTimeout(()=>{T()},100)};return N.useEffect(()=>{A>=768?(C(!0),setTimeout(()=>{T()},100)):(C(!1),I("auto"))},[A]),N.useEffect(()=>{typeof y=="boolean"&&w(y)},[y]),N.useImperativeHandle(t,()=>({openSidebar:y,setOpenSidebar:C,handlerClickCollapse:B}),[y,S]),N.useEffect(()=>(i&&i.split("/").length>1&&x(i+"/"),T(),$(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)),[]),F.jsxs("div",{className:f.variants[h],...m,ref:b,children:[F.jsxs("div",{id:"1ru-sidebar",className:`${In.sidebar} ${typeof S=="boolean"&&S?In["sidebar-open"]:""} ${typeof S=="boolean"&&!S?In["sidebar-close"]:""}`,children:[N.isValidElement(s)&&F.jsxs("div",{className:In["button-collaps-sidebar"],onClick:B,children:[y&&s,y?"":N.isValidElement(l)?l:s]}),F.jsx("div",{className:In["container-icon-company-sidebar"],children:F.jsxs("div",{id:"icon-company-sidebar",className:In["icon-company-sidebar"],style:{width:g&&f.withCuctomWidthIconCompany.includes(h)?g:"100%"},children:[N.isValidElement(a)&&a,typeof a=="function"&&a({openSidebar:S,setOpenSidebar:C})]})}),F.jsx("div",{className:In["menu-sidebar"],onMouseOver:()=>{y||w(!0)},onMouseOut:()=>{y||w(!1)},children:u.map(k=>N.createElement($S,{...k,as:k.manualRoute||k.subs.length>0?"div":n,linkComponent:n,key:k.name,show:E,open:S,patch:i,iconSubs:o,variant:h,setShow:x,onClickItems:p}))}),d&&F.jsxs("div",{className:S?"1ru-opacity-[1]":"1ru-opacity-0",children:[N.isValidElement(d)&&F.jsx("div",{children:d}),typeof d=="function"&&F.jsx("div",{children:d()})]})]}),y&&F.jsx("div",{className:In["splace-screen"],onClick:B}),F.jsxs("div",{className:In["content-sidebar"],children:[v&&((P=N.Children)==null?void 0:P.map(r,k=>F.jsx(F.Fragment,{children:N.isValidElement(k)&&F.jsx(F.Fragment,{children:N.cloneElement(k,{openSidebar:y,handlerClickCollapse:B})})}))),!v&&F.jsx(F.Fragment,{children:r})]})]})});FS.displayName="Sidebar";const qM="_collapse_qzzyu_1",NS={collapse:qM},QM=({children:e,id:t,open:n,className:r,classNameContainer:i,maxCollapsedHeight:a="0px",triggerCalCulateContainer:o,delayTriggerCalculateHeight:s=0})=>{const[l,u]=N.useState("1000vh"),c=()=>{var h;const p=((h=document==null?void 0:document.getElementById(t))==null?void 0:h.offsetHeight)??0;u(p||"1000vh")};return N.useEffect(()=>{const p=setTimeout(c,s);return window==null||window.addEventListener("resize",c),window==null||window.addEventListener("load",c),()=>{clearTimeout(p),window==null||window.removeEventListener("resize",c),window==null||window.removeEventListener("load",c)}},[o]),F.jsx("div",{className:`${NS.collapse} ${i??""}`,style:{maxHeight:n?l:a},children:F.jsx("div",{id:t,className:r??"",children:e})})},eO="_modal_12o7y_1",Di={modal:eO,"modal-content":"_modal-content_12o7y_1","with-overlay":"_with-overlay_12o7y_23","modal-small":"_modal-small_12o7y_40","modal-medium":"_modal-medium_12o7y_44","modal-regular":"_modal-regular_12o7y_48","modal-large":"_modal-large_12o7y_52","modal-show":"_modal-show_12o7y_56"},tO=({as:e,children:t,id:n="modal",idModal:r="1ru-modal",withOverlay:i=!0,show:a,size:o="regular",className:s,classNameContainer:l,onClose:u,...c})=>{const p=e??"div",h={size:{small:Di["modal-small"],medium:Di["modal-medium"],regular:Di["modal-regular"],large:Di["modal-large"]}},d=()=>{typeof u=="function"&&u()};return F.jsx(F.Fragment,{children:a&&document.getElementById(r)&&Mo.createPortal(F.jsx("div",{id:n,onClick:d,className:`${Di.modal} ${i?Di["with-overlay"]:""} ${a?Di["modal-show"]:""} ${l??""}`,children:F.jsx(p,{onClick:v=>v.stopPropagation(),className:`${Di["modal-content"]} ${h.size[o]} ${s??""}`,...c,children:t})}),document.getElementById(r))})},nO="_dot_10oqk_31",Tr={"timeline-container":"_timeline-container_10oqk_1","no-time":"_no-time_10oqk_11","timeline-content":"_timeline-content_10oqk_15","left-content":"_left-content_10oqk_18","time-content":"_time-content_10oqk_24","text-time":"_text-time_10oqk_27",dot:nO,"right-content":"_right-content_10oqk_34"},rO=({children:e,noTime:t=!1})=>F.jsx("div",{className:`${Tr["timeline-container"]} ${t?Tr["no-time"]:""}`,children:e}),iO=({children:e,time:t,clasName:n,noTime:r=!1})=>F.jsxs("div",{className:Tr["timeline-content"],children:[F.jsx("div",{className:`${Tr["left-content"]} ${r?Tr["no-time"]:""}`,children:F.jsxs("div",{className:Tr["time-content"],children:[!r&&F.jsx("time",{className:Tr["text-time"],children:t??""}),F.jsx("div",{className:Tr.dot})]})}),F.jsx("div",{className:`${Tr["right-content"]} ${r?Tr["no-time"]:""} ${n??""}`,children:e})]}),aO=Object.assign(rO,{TimelineContent:iO}),Ql=(e,t,n)=>{if((t==null?void 0:t.length)>0){const r={};return t.forEach(i=>{e[i]&&(r[i]=e[i]),n&&e[`${n}${i}`]&&(r[`${n}${i}`]=e[`${n}${i}`])}),r}return e},MS=N.forwardRef((e,t)=>{const{children:n,onChange:r,prefixNativeValue:i="",defaultNativeValue:a,defaultValue:o,mountedExecuteChange:s=!0,keepKeys:l=[],resetPagination:u=!0,keyPageNumber:c="pageNumber",triggerReset:p={},reset:h}=e,d=u?{[c]:1}:{},[v,m]=N.useState(Ql(o??{},l,"")),[b,f]=N.useState(Lm(i,Ql(a??{},l,i))),[y,C]=N.useState(!1),S=(x,g)=>{const I={};return Object.keys(g).forEach(A=>{I[`${x}${A}`]=g[A]}),I},w=(x,g,I,A)=>{let _=x;const T=S(i,{[g]:x});Array.isArray(x)&&(I==="array-of-object-to-array"?_=X0(x,A):I==="array-of-object-to-string"?_=U0(x,A):I==="array-to-string"&&(_=_.toString())),typeof r=="function"&&r({...v,[g]:_,...d},{...b,...T}),m($=>({...$,[g]:_})),f($=>({...$,...T}))},E=(x,g)=>{const A=S(i,{...g??x});typeof r=="function"&&r({...v,...x,...d},{...b,...A}),m(_=>({..._,...x})),f(_=>({..._,...A}))};return Gi(()=>{!y&&typeof r=="function"&&s&&(r(v,b),C(!0))},[v,b,y,s]),Gi(()=>{h&&(f(Lm(i,Ql(a??{},l,i))),m(Ql(o??{},l,"")))},[h,p]),N.useImperativeHandle(t,()=>({nativeValue:b,value:v,handlerOnChange:w,handlerOnChangeNative:E}),[$s(v),$s(b)]),F.jsx(F.Fragment,{children:n({handlerOnChange:w,handlerOnChangeNative:E,value:v,nativeValue:b})})});MS.displayName="FilterContainer";function Ep(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Xs;(function(e){e.event="event",e.props="prop"})(Xs||(Xs={}));function ai(){}function oO(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(a,o){return a===t[o]})||(t=r,n=e.apply(void 0,r)),n}}function $a(e){return!!(e||"").match(/\d/)}function xa(e){return e==null}function sO(e){return typeof e=="number"&&isNaN(e)}function OS(e){return xa(e)||sO(e)||typeof e=="number"&&!isFinite(e)}function LS(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function lO(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function uO(e,t,n){var r=lO(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function cO(e){var t=N.useRef(e);t.current=e;var n=N.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function Sp(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),a=i[0],o=i[1]||"";return{beforeDecimal:a,afterDecimal:o,hasNegation:n,addNegation:r}}function dO(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function VS(e,t,n){for(var r="",i=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||i;return r}function yb(e,t){return Array(t+1).join(e)}function HS(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(".","");var o=1+a,s=i.length;return o<0?i="0."+yb("0",Math.abs(o))+i:o>=s?i=i+yb("0",o-s):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function xb(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Sp(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,l=parseFloat("0."+(o||"0")),u=o.length<=t?"0."+o:l.toFixed(t),c=u.split("."),p=a;a&&Number(c[0])&&(p=a.split("").reverse().reduce(function(m,b,f){return m.length>f?(Number(m[0])+Number(b)).toString()+m.substring(1,m.length):b+m},c[0]));var h=VS(c[1]||"",t,n),d=s?"-":"",v=r?".":"";return""+d+p+v+h}function Fi(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var jS=oO(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),fO=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function hO(e,t,n){return Math.min(Math.max(e,t),n)}function eh(e){return Math.max(e.selectionStart,e.selectionEnd)}function gO(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function zS(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function GS(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function pO(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function mO(e,t,n,r,i,a,o){o===void 0&&(o=pO);var s=i.findIndex(function(S){return S}),l=e.slice(0,s);!t&&!n.startsWith(l)&&(t=l,n=l+n,r=r+l.length);for(var u=n.length,c=e.length,p={},h=new Array(u),d=0;d<u;d++){h[d]=-1;for(var v=0,m=c;v<m;v++){var b=o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:d,formattedValueIndex:v});if(b&&p[v]!==!0){h[d]=v,p[v]=!0;break}}}for(var f=r;f<u&&(h[f]===-1||!a(n[f]));)f++;var y=f===u||h[f]===-1?c:h[f];for(f=r-1;f>0&&h[f]===-1;)f--;var C=f===-1||h[f]===-1?0:h[f]+1;return C>y?y:r-C<y-r?C:y}function vc(e,t,n,r){var i=e.length;if(t=hO(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function vO(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!($a(e[n])||$a(e[n-1]));return t}function WS(e,t,n,r,i,a){a===void 0&&(a=ai);var o=cO(function(v,m){var b,f;return OS(v)?(f="",b=""):typeof v=="number"||m?(f=typeof v=="number"?HS(v):v,b=r(f)):(f=i(v,void 0),b=r(f)),{formattedValue:b,numAsString:f}}),s=N.useState(function(){return o(xa(e)?t:e,n)}),l=s[0],u=s[1],c=function(v,m){v.formattedValue!==l.formattedValue&&u({formattedValue:v.formattedValue,numAsString:v.value}),a(v,m)},p=e,h=n;xa(e)&&(p=l.numAsString,h=!0);var d=o(p,h);return N.useMemo(function(){u(d)},[d.formattedValue]),[l,c]}function bO(e){return e.replace(/[^0-9]/g,"")}function yO(e){return e}function US(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=yO);var s=e.removeFormatting;s===void 0&&(s=bO);var l=e.defaultValue,u=e.valueIsNumericString,c=e.onValueChange,p=e.isAllowed,h=e.onChange;h===void 0&&(h=ai);var d=e.onKeyDown;d===void 0&&(d=ai);var v=e.onMouseUp;v===void 0&&(v=ai);var m=e.onFocus;m===void 0&&(m=ai);var b=e.onBlur;b===void 0&&(b=ai);var f=e.value,y=e.getCaretBoundary;y===void 0&&(y=vO);var C=e.isValidInputCharacter;C===void 0&&(C=$a);var S=e.isCharacterSame,w=Ep(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=WS(f,l,!!u,o,s,c),x=E[0],g=x.formattedValue,I=x.numAsString,A=E[1],_=N.useRef(),T=N.useRef({formattedValue:g,numAsString:I}),$=function(ie,oe){T.current={formattedValue:ie.formattedValue,numAsString:ie.value},A(ie,oe)},B=N.useState(!1),P=B[0],k=B[1],O=N.useRef(null),M=N.useRef({setCaretTimeout:null,focusTimeout:null});N.useEffect(function(){return k(!0),function(){clearTimeout(M.current.setCaretTimeout),clearTimeout(M.current.focusTimeout)}},[]);var G=o,W=function(ie,oe){var te=parseFloat(oe);return{formattedValue:ie,value:oe,floatValue:isNaN(te)?void 0:te}},U=function(ie,oe,te){ie.selectionStart===0&&ie.selectionEnd===ie.value.length||(Fi(ie,oe),M.current.setCaretTimeout=setTimeout(function(){ie.value===te&&ie.selectionStart!==oe&&Fi(ie,oe)},0))},q=function(ie,oe,te){return vc(ie,oe,y(ie),te)},Q=function(ie,oe,te){var ue=y(oe),ve=mO(oe,g,ie,te,ue,C,S);return ve=vc(oe,ve,ue),ve},Z=function(ie){var oe=ie.formattedValue;oe===void 0&&(oe="");var te=ie.input,ue=ie.source,ve=ie.event,be=ie.numAsString,pe;if(te){var Te=ie.inputValue||te.value,Ne=eh(te);te.value=oe,pe=Q(Te,oe,Ne),pe!==void 0&&U(te,pe,oe)}oe!==g&&$(W(oe,be),{event:ve,source:ue})};N.useEffect(function(){var ie=T.current,oe=ie.formattedValue,te=ie.numAsString;(g!==oe||I!==te)&&$(W(g,I),{event:void 0,source:Xs.props})},[g,I]);var ee=O.current?eh(O.current):void 0,J=typeof window<"u"?N.useLayoutEffect:N.useEffect;J(function(){var ie=O.current;if(g!==T.current.formattedValue&&ie){var oe=Q(T.current.formattedValue,g,ee);ie.value=g,U(ie,oe,g)}},[g]);var le=function(ie,oe,te){var ue=oe.target,ve=_.current?fO(_.current,ue.selectionEnd):jS(g,ie),be=Object.assign(Object.assign({},ve),{lastValue:g}),pe=s(ie,be),Te=G(pe);if(pe=s(Te,void 0),p&&!p(W(Te,pe))){var Ne=oe.target,We=eh(Ne),et=Q(ie,g,We);return Ne.value=g,U(Ne,et,g),!1}return Z({formattedValue:Te,numAsString:pe,inputValue:ie,event:oe,source:te,input:oe.target}),!0},re=function(ie,oe){oe===void 0&&(oe=0);var te=ie.selectionStart,ue=ie.selectionEnd;_.current={selectionStart:te,selectionEnd:ue+oe}},R=function(ie){var oe=ie.target,te=oe.value,ue=le(te,ie,Xs.event);ue&&h(ie),_.current=void 0},H=function(ie){var oe=ie.target,te=ie.key,ue=oe.selectionStart,ve=oe.selectionEnd,be=oe.value;be===void 0&&(be="");var pe;te==="ArrowLeft"||te==="Backspace"?pe=Math.max(ue-1,0):te==="ArrowRight"?pe=Math.min(ue+1,be.length):te==="Delete"&&(pe=ue);var Te=0;te==="Delete"&&ue===ve&&(Te=1);var Ne=te==="ArrowLeft"||te==="ArrowRight";if(pe===void 0||ue!==ve&&!Ne){d(ie),re(oe,Te);return}var We=pe;if(Ne){var et=te==="ArrowLeft"?"left":"right";We=q(be,pe,et),We!==pe&&ie.preventDefault()}else te==="Delete"&&!C(be[pe])?We=q(be,pe,"right"):te==="Backspace"&&!C(be[pe])&&(We=q(be,pe,"left"));We!==pe&&U(oe,We,be),d(ie),re(oe,Te)},V=function(ie){var oe=ie.target,te=function(){var ue=oe.selectionStart,ve=oe.selectionEnd,be=oe.value;if(be===void 0&&(be=""),ue===ve){var pe=q(be,ue);pe!==ue&&U(oe,pe,be)}};te(),requestAnimationFrame(function(){te()}),v(ie),re(oe)},D=function(ie){ie.persist&&ie.persist();var oe=ie.target,te=ie.currentTarget;O.current=oe,M.current.focusTimeout=setTimeout(function(){var ue=oe.selectionStart,ve=oe.selectionEnd,be=oe.value;be===void 0&&(be="");var pe=q(be,ue);pe!==ue&&!(ue===0&&ve===be.length)&&U(oe,pe,be),m(Object.assign(Object.assign({},ie),{currentTarget:te}))},0)},L=function(ie){O.current=null,clearTimeout(M.current.focusTimeout),clearTimeout(M.current.setCaretTimeout),b(ie)},K=P&&gO()?"numeric":void 0,X=Object.assign({inputMode:K},w,{type:t,value:g,onChange:R,onKeyDown:H,onMouseUp:V,onFocus:D,onBlur:L});if(n==="text")return i?N.createElement(N.Fragment,null,i(g,w)||null):N.createElement("span",Object.assign({},w,{ref:a}),g);if(r){var se=r;return N.createElement(se,Object.assign({},X,{ref:a}))}return N.createElement("input",Object.assign({},X,{ref:a}))}function Cb(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var a=t.suffix;a===void 0&&(a="");var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var l=cd(t),u=l.thousandSeparator,c=l.decimalSeparator,p=n!==0&&e.indexOf(".")!==-1||n&&r,h=Sp(e,o),d=h.beforeDecimal,v=h.afterDecimal,m=h.addNegation;return n!==void 0&&(v=VS(v,n,!!r)),u&&(d=uO(d,u,s)),i&&(d=i+d),a&&(v=v+a),m&&(d="-"+d),e=d+(p&&c||"")+v,e}function cd(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function xO(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),i&&!a&&t&&(e="-"+e),e}function CO(e,t){return new RegExp("(^-)|[0-9]|"+LS(e),"g")}function EO(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function SO(e,t,n){var r;t===void 0&&(t=zS(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a="");var o=n.suffix;o===void 0&&(o="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,p=u.end,h=cd(n),d=h.allowedDecimalSeparators,v=h.decimalSeparator,m=e[p]===v;if($a(e)&&(e===a||e===o)&&t.lastValue==="")return e;if(p-c===1&&d.indexOf(e[c])!==-1){var b=s===0?"":v;e=e.substring(0,c)+b+e.substring(c+1,e.length)}var f=function(O,M,G){var W=!1,U=!1;a.startsWith("-")?W=!1:O.startsWith("--")?(W=!1,U=!0):o.startsWith("-")&&O.length===o.length?W=!1:O[0]==="-"&&(W=!0);var q=W?1:0;return U&&(q=2),q&&(O=O.substring(q),M-=q,G-=q),{value:O,start:M,end:G,hasNegation:W}},y=f(e,c,p),C=y.hasNegation;r=y,e=r.value,c=r.start,p=r.end;var S=f(t.lastValue,l.start,l.end),w=S.start,E=S.end,x=S.value,g=e.substring(c,p);e.length&&x.length&&(w>x.length-o.length||E<a.length)&&!(g&&o.startsWith(g))&&(e=x);var I=0;e.startsWith(a)?I+=a.length:c<a.length&&(I=c),e=e.substring(I),p-=I;var A=e.length,_=e.length-o.length;e.endsWith(o)?A=_:(p>_||p>e.length-o.length)&&(A=p),e=e.substring(0,A),e=xO(C?"-"+e:e,i),e=(e.match(CO(v))||[]).join("");var T=e.indexOf(v);e=e.replace(new RegExp(LS(v),"g"),function(O,M){return M===T?".":""});var $=Sp(e,i),B=$.beforeDecimal,P=$.afterDecimal,k=$.addNegation;return u.end-u.start<l.end-l.start&&B===""&&m&&!parseFloat(P)&&(e=k?"-":""),e}function wO(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]==="-";i.fill(!1,0,n.length+(a?1:0));var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function IO(e){var t=cd(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw new Error(`
135
+ ${o?S.gapAction[o]:""}`,children:[c,u]}),typeof f=="function"&&f(),F.jsx("div",{className:`${Qa.urls} ${s?S.gapUrls[s]:""}`,children:r==null?void 0:r.map((E,x)=>F.jsxs(N.Fragment,{children:[F.jsx(C,{className:`${Qa.url} ${w(x)?Qa.active:""} ${b??""}`,onClick:()=>{(a==null?void 0:a[x])!==void 0&&typeof a[x]=="function"?a[x]():typeof h=="function"&&h(E)},...v?v(E,x,r):{},children:i[x]}),!w(x)&&F.jsx(F.Fragment,{children:d})]},x))})]})},ZM="_sidebar_1d1n2_328",un={"splace-screen":"_splace-screen_1d1n2_313","payhere-brand-base-white":"_payhere-brand-base-white_1d1n2_325",sidebar:ZM,"button-collaps-sidebar":"_button-collaps-sidebar_1d1n2_343","menu-sidebar":"_menu-sidebar_1d1n2_360","sidebar-open":"_sidebar-open_1d1n2_388","container-icon-company-sidebar":"_container-icon-company-sidebar_1d1n2_405","icon-company-sidebar":"_icon-company-sidebar_1d1n2_408","sidebar-close":"_sidebar-close_1d1n2_416","content-sidebar":"_content-sidebar_1d1n2_441","payhere-brand-base-transparent":"_payhere-brand-base-transparent_1d1n2_520","laba-white":"_laba-white_1d1n2_715","lpd-brand-base-white":"_lpd-brand-base-white_1d1n2_1099","lpd-brand-base-transparent":"_lpd-brand-base-transparent_1d1n2_1294","lpd-brand-base-white-responsive":"_lpd-brand-base-white-responsive_1d1n2_1489","lpd-brand-base-transparent-responsive":"_lpd-brand-base-transparent-responsive_1d1n2_1720"},JM="_hidden_twfoe_402",Ge={"item-sidebar-1":"_item-sidebar-1_twfoe_67","item-sidebar-2":"_item-sidebar-2_twfoe_67","item-label":"_item-label_twfoe_115","item-icon-subs":"_item-icon-subs_twfoe_313","item-icon":"_item-icon_twfoe_313","item-sidebar-open":"_item-sidebar-open_twfoe_362","item-sidebar-close":"_item-sidebar-close_twfoe_377","item-sidebar-lpd":"_item-sidebar-lpd_twfoe_386","item-sidebar-laba":"_item-sidebar-laba_twfoe_386","item-sidebar-payhere":"_item-sidebar-payhere_twfoe_386","item-subs-sidebar":"_item-subs-sidebar_twfoe_393",hidden:JM,"divider-item-sidebar-payhere":"_divider-item-sidebar-payhere_twfoe_412","divider-item-sidebar-lpd":"_divider-item-sidebar-lpd_twfoe_417","hover-sidebar-payhere":"_hover-sidebar-payhere_twfoe_459","hover-sidebar-laba":"_hover-sidebar-laba_twfoe_468","hover-sidebar-lpd":"_hover-sidebar-lpd_twfoe_477"},$S=({as:e,show:t,open:n,patch:r,iconSubs:i,variant:a="payhere-brand-base-white",setShow:o,onClickItems:s,propsLink:l,...u})=>{var C,S,w,E,x,g,I;const c={activeColor:{"payhere-brand-base-white":Ge["item-sidebar-payhere"],"payhere-brand-base-transparent":Ge["item-sidebar-payhere"],"laba-white":Ge["item-sidebar-laba"],"lpd-brand-base-white":Ge["item-sidebar-lpd"],"lpd-brand-base-transparent":Ge["item-sidebar-lpd"],"lpd-brand-base-white-responsive":Ge["item-sidebar-lpd"],"lpd-brand-base-transparent-responsive":Ge["item-sidebar-lpd"]},hoverColor:{"payhere-brand-base-white":Ge["hover-sidebar-payhere"],"payhere-brand-base-transparent":Ge["hover-sidebar-payhere"],"laba-white":Ge["hover-sidebar-laba"],"lpd-brand-base-white":Ge["hover-sidebar-lpd"],"lpd-brand-base-transparent":Ge["hover-sidebar-lpd"],"lpd-brand-base-white-responsive":Ge["hover-sidebar-lpd"],"lpd-brand-base-transparent-responsive":Ge["hover-sidebar-lpd"]},divider:{"payhere-brand-base-white":Ge["divider-item-sidebar-payhere"],"payhere-brand-base-transparent":Ge["divider-item-sidebar-payhere"],"laba-white":Ge["divider-item-sidebar-laba"],"lpd-brand-base-white":Ge["divider-item-sidebar-lpd"],"lpd-brand-base-transparent":Ge["divider-item-sidebar-lpd"],"lpd-brand-base-white-responsive":Ge["divider-item-sidebar-lpd"],"lpd-brand-base-transparent-responsive":Ge["divider-item-sidebar-lpd"]}};let p=F.jsx(F.Fragment,{});const h=e??"div",[d,v]=N.useState(!1),m=r===u.slug,b=t.split("/"),f=b.includes(u.name),y=()=>{if(u.subs.length>0)if(f){const A=b.splice(0,b.indexOf(u.name));A.length>0?o(`${A.join("/")}/`):o("")}else o(`${t}${u.name}/`);else typeof s=="function"&&s(u)};return u.isShow?((u.parent===1||u.parent===3)&&(p=F.jsxs(F.Fragment,{children:[F.jsxs(h,{id:u.name,className:`${Ge["item-sidebar-1"]} ${(C=c.hoverColor)==null?void 0:C[a]}
136
+ ${m||u.subs.length>0&&f?(S=c.activeColor)==null?void 0:S[a]:""} ${typeof n=="boolean"&&n?Ge["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?Ge["item-sidebar-close"]:""}
137
+ `,onClick:y,onMouseOver:()=>v(!0),onMouseOut:()=>v(!1),...l?l(u.slug,u):{},children:[F.jsxs("div",{className:"1ru-flex 1ru-items-center 1ru-gap-3 1ru-relative",children:[N.isValidElement(u.svgIcon)&&F.jsx("div",{className:Ge["item-icon"],children:m||u.subs.length>0&&f?u==null?void 0:u.svgIconActive:d?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),F.jsx("div",{className:Ge["item-label"],children:u.label})]}),u.subs.length>0&&n&&F.jsxs("div",{className:Ge["item-icon-subs"],children:[N.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===3&&!u.subs.length&&F.jsx("div",{className:(w=c.divider)==null?void 0:w[a]})]})),(u.parent===2||u.parent===4)&&(p=F.jsxs(F.Fragment,{children:[F.jsxs(h,{id:u.name,className:`${Ge["item-sidebar-2"]} ${(E=c.hoverColor)==null?void 0:E[a]}
138
+ ${m||u.subs.length>0&&f?(x=c.activeColor)==null?void 0:x[a]:""} ${typeof n=="boolean"&&n?Ge["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?Ge["item-sidebar-close"]:""}
139
+ `,onClick:y,onMouseOver:()=>v(!0),onMouseOut:()=>v(!1),...l?l(u.slug,u):{},children:[N.isValidElement(u.svgIcon)&&F.jsx("div",{className:Ge["item-icon"],children:m||u.subs.length>0&&f?u==null?void 0:u.svgIconActive:d?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),F.jsx("div",{className:Ge["item-label"],children:u.label}),u.subs.length>0&&n&&F.jsxs("div",{className:Ge["item-icon-subs"],children:[N.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===4&&!u.subs.length&&F.jsx("div",{className:(g=c.divider)==null?void 0:g[a]})]})),u.subs.length>0?F.jsxs("div",{className:`${n||f?"":"-mt-2"}`,children:[p,F.jsx("div",{className:`${Ge["item-subs-sidebar"]} ${!n||!f?Ge.hidden:""}`,children:u.subs.map(A=>N.createElement($S,{...A,as:A.manualRoute?"div":A.subs.length>0?e:u.linkComponent,key:A.name,patch:r,iconSubs:i,show:t,open:n,variant:a,setShow:o}))}),[3,4].includes(u.parent)&&F.jsx("div",{className:(I=c.divider)==null?void 0:I[a]})]}):p):F.jsx(F.Fragment,{})},FS=N.forwardRef((e,t)=>{var P;const{as:n,children:r,patch:i="/",iconCompany:a,iconSubs:o,iconCollapse:s,iconCollapseClose:l,modules:u,toleranceWidthIconCompany:c=25,onClickItems:p,variant:h="payhere-brand-base-white",footer:d,withInheritance:v,...m}=e,b=N.useRef(null),f={withCuctomWidthIconCompany:["payhere-brand-base-white","payhere-brand-base-transparent"],variants:{"payhere-brand-base-white":un["payhere-brand-base-white"],"payhere-brand-base-transparent":un["payhere-brand-base-transparent"],"laba-white":un["laba-white"],"lpd-brand-base-white":un["lpd-brand-base-white"],"lpd-brand-base-transparent":un["lpd-brand-base-transparent"],"lpd-brand-base-white-responsive":un["lpd-brand-base-white-responsive"],"lpd-brand-base-transparent-responsive":un["lpd-brand-base-transparent-responsive"]}},[y,C]=N.useState(null),[S,w]=N.useState(null),[E,x]=N.useState(""),[g,I]=N.useState(),[A,_]=N.useState(0),T=()=>{var M;let k=0;const O=document.getElementById("icon-company-sidebar");(M=O==null?void 0:O.childNodes)==null||M.forEach(G=>{k+=G.getBoundingClientRect().width??0}),I(k+c+"px")},$=()=>{_(window.innerWidth)},B=()=>{C(!S),S?I("auto"):setTimeout(()=>{T()},100)};return N.useEffect(()=>{A>=768?(C(!0),setTimeout(()=>{T()},100)):(C(!1),I("auto"))},[A]),N.useEffect(()=>{typeof y=="boolean"&&w(y)},[y]),N.useImperativeHandle(t,()=>({openSidebar:y,setOpenSidebar:C,handlerClickCollapse:B}),[y,S]),N.useEffect(()=>(i&&i.split("/").length>1&&x(i+"/"),T(),$(),window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)),[]),F.jsxs("div",{className:f.variants[h],...m,ref:b,children:[F.jsxs("div",{id:"1ru-sidebar",className:`${un.sidebar} ${typeof S=="boolean"&&S?un["sidebar-open"]:""} ${typeof S=="boolean"&&!S?un["sidebar-close"]:""}`,children:[N.isValidElement(s)&&F.jsxs("div",{className:un["button-collaps-sidebar"],onClick:B,children:[y&&s,y?"":N.isValidElement(l)?l:s]}),F.jsx("div",{className:un["container-icon-company-sidebar"],children:F.jsxs("div",{id:"icon-company-sidebar",className:un["icon-company-sidebar"],style:{width:g&&f.withCuctomWidthIconCompany.includes(h)?g:"100%"},children:[N.isValidElement(a)&&a,typeof a=="function"&&a({openSidebar:S,setOpenSidebar:C})]})}),F.jsx("div",{className:un["menu-sidebar"],onMouseOver:()=>{y||w(!0)},onMouseOut:()=>{y||w(!1)},children:u.map(k=>N.createElement($S,{...k,as:k.manualRoute||k.subs.length>0?"div":n,linkComponent:n,key:k.name,show:E,open:S,patch:i,iconSubs:o,variant:h,setShow:x,onClickItems:p}))}),d&&F.jsxs("div",{className:S?"1ru-opacity-[1]":"1ru-opacity-0",children:[N.isValidElement(d)&&F.jsx("div",{children:d}),typeof d=="function"&&F.jsx("div",{children:d()})]})]}),y&&F.jsx("div",{className:un["splace-screen"],onClick:B}),F.jsxs("div",{className:un["content-sidebar"],children:[v&&((P=N.Children)==null?void 0:P.map(r,k=>F.jsx(F.Fragment,{children:N.isValidElement(k)&&F.jsx(F.Fragment,{children:N.cloneElement(k,{openSidebar:y,handlerClickCollapse:B})})}))),!v&&F.jsx(F.Fragment,{children:r})]})]})});FS.displayName="Sidebar";const qM="_collapse_qzzyu_1",NS={collapse:qM},QM=({children:e,id:t,open:n,className:r,classNameContainer:i,maxCollapsedHeight:a="0px",triggerCalCulateContainer:o,delayTriggerCalculateHeight:s=0})=>{const[l,u]=N.useState("1000vh"),c=()=>{var h;const p=((h=document==null?void 0:document.getElementById(t))==null?void 0:h.offsetHeight)??0;u(p||"1000vh")};return N.useEffect(()=>{const p=setTimeout(c,s);return window==null||window.addEventListener("resize",c),window==null||window.addEventListener("load",c),()=>{clearTimeout(p),window==null||window.removeEventListener("resize",c),window==null||window.removeEventListener("load",c)}},[o]),F.jsx("div",{className:`${NS.collapse} ${i??""}`,style:{maxHeight:n?l:a},children:F.jsx("div",{id:t,className:r??"",children:e})})},eO="_modal_12o7y_1",Di={modal:eO,"modal-content":"_modal-content_12o7y_1","with-overlay":"_with-overlay_12o7y_23","modal-small":"_modal-small_12o7y_40","modal-medium":"_modal-medium_12o7y_44","modal-regular":"_modal-regular_12o7y_48","modal-large":"_modal-large_12o7y_52","modal-show":"_modal-show_12o7y_56"},tO=({as:e,children:t,id:n="modal",idModal:r="1ru-modal",withOverlay:i=!0,show:a,size:o="regular",className:s,classNameContainer:l,onClose:u,...c})=>{const p=e??"div",h={size:{small:Di["modal-small"],medium:Di["modal-medium"],regular:Di["modal-regular"],large:Di["modal-large"]}},d=()=>{typeof u=="function"&&u()};return F.jsx(F.Fragment,{children:a&&document.getElementById(r)&&Mo.createPortal(F.jsx("div",{id:n,onClick:d,className:`${Di.modal} ${i?Di["with-overlay"]:""} ${a?Di["modal-show"]:""} ${l??""}`,children:F.jsx(p,{onClick:v=>v.stopPropagation(),className:`${Di["modal-content"]} ${h.size[o]} ${s??""}`,...c,children:t})}),document.getElementById(r))})},nO="_dot_10oqk_31",Tr={"timeline-container":"_timeline-container_10oqk_1","no-time":"_no-time_10oqk_11","timeline-content":"_timeline-content_10oqk_15","left-content":"_left-content_10oqk_18","time-content":"_time-content_10oqk_24","text-time":"_text-time_10oqk_27",dot:nO,"right-content":"_right-content_10oqk_34"},rO=({children:e,noTime:t=!1})=>F.jsx("div",{className:`${Tr["timeline-container"]} ${t?Tr["no-time"]:""}`,children:e}),iO=({children:e,time:t,clasName:n,noTime:r=!1})=>F.jsxs("div",{className:Tr["timeline-content"],children:[F.jsx("div",{className:`${Tr["left-content"]} ${r?Tr["no-time"]:""}`,children:F.jsxs("div",{className:Tr["time-content"],children:[!r&&F.jsx("time",{className:Tr["text-time"],children:t??""}),F.jsx("div",{className:Tr.dot})]})}),F.jsx("div",{className:`${Tr["right-content"]} ${r?Tr["no-time"]:""} ${n??""}`,children:e})]}),aO=Object.assign(rO,{TimelineContent:iO}),Ql=(e,t,n)=>{if((t==null?void 0:t.length)>0){const r={};return t.forEach(i=>{e[i]&&(r[i]=e[i]),n&&e[`${n}${i}`]&&(r[`${n}${i}`]=e[`${n}${i}`])}),r}return e},MS=N.forwardRef((e,t)=>{const{children:n,onChange:r,prefixNativeValue:i="",defaultNativeValue:a,defaultValue:o,mountedExecuteChange:s=!0,keepKeys:l=[],resetPagination:u=!0,keyPageNumber:c="pageNumber",triggerReset:p={},reset:h}=e,d=u?{[c]:1}:{},[v,m]=N.useState(Ql(o??{},l,"")),[b,f]=N.useState(Lm(i,Ql(a??{},l,i))),[y,C]=N.useState(!1),S=(x,g)=>{const I={};return Object.keys(g).forEach(A=>{I[`${x}${A}`]=g[A]}),I},w=(x,g,I,A)=>{let _=x;const T=S(i,{[g]:x});Array.isArray(x)&&(I==="array-of-object-to-array"?_=X0(x,A):I==="array-of-object-to-string"?_=U0(x,A):I==="array-to-string"&&(_=_.toString())),typeof r=="function"&&r({...v,[g]:_,...d},{...b,...T}),m($=>({...$,[g]:_})),f($=>({...$,...T}))},E=(x,g)=>{const A=S(i,{...g??x});typeof r=="function"&&r({...v,...x,...d},{...b,...A}),m(_=>({..._,...x})),f(_=>({..._,...A}))};return Gi(()=>{!y&&typeof r=="function"&&s&&(r(v,b),C(!0))},[v,b,y,s]),Gi(()=>{h&&(f(Lm(i,Ql(a??{},l,i))),m(Ql(o??{},l,"")))},[h,p]),N.useImperativeHandle(t,()=>({nativeValue:b,value:v,handlerOnChange:w,handlerOnChangeNative:E}),[$s(v),$s(b)]),F.jsx(F.Fragment,{children:n({handlerOnChange:w,handlerOnChangeNative:E,value:v,nativeValue:b})})});MS.displayName="FilterContainer";function Ep(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Xs;(function(e){e.event="event",e.props="prop"})(Xs||(Xs={}));function ai(){}function oO(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(a,o){return a===t[o]})||(t=r,n=e.apply(void 0,r)),n}}function $a(e){return!!(e||"").match(/\d/)}function xa(e){return e==null}function sO(e){return typeof e=="number"&&isNaN(e)}function OS(e){return xa(e)||sO(e)||typeof e=="number"&&!isFinite(e)}function LS(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function lO(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function uO(e,t,n){var r=lO(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function cO(e){var t=N.useRef(e);t.current=e;var n=N.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function Sp(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),a=i[0],o=i[1]||"";return{beforeDecimal:a,afterDecimal:o,hasNegation:n,addNegation:r}}function dO(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function VS(e,t,n){for(var r="",i=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||i;return r}function yb(e,t){return Array(t+1).join(e)}function HS(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(".","");var o=1+a,s=i.length;return o<0?i="0."+yb("0",Math.abs(o))+i:o>=s?i=i+yb("0",o-s):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function xb(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Sp(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,l=parseFloat("0."+(o||"0")),u=o.length<=t?"0."+o:l.toFixed(t),c=u.split("."),p=a;a&&Number(c[0])&&(p=a.split("").reverse().reduce(function(m,b,f){return m.length>f?(Number(m[0])+Number(b)).toString()+m.substring(1,m.length):b+m},c[0]));var h=VS(c[1]||"",t,n),d=s?"-":"",v=r?".":"";return""+d+p+v+h}function Fi(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var jS=oO(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),fO=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function hO(e,t,n){return Math.min(Math.max(e,t),n)}function eh(e){return Math.max(e.selectionStart,e.selectionEnd)}function gO(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function zS(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function GS(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function pO(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function mO(e,t,n,r,i,a,o){o===void 0&&(o=pO);var s=i.findIndex(function(S){return S}),l=e.slice(0,s);!t&&!n.startsWith(l)&&(t=l,n=l+n,r=r+l.length);for(var u=n.length,c=e.length,p={},h=new Array(u),d=0;d<u;d++){h[d]=-1;for(var v=0,m=c;v<m;v++){var b=o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:d,formattedValueIndex:v});if(b&&p[v]!==!0){h[d]=v,p[v]=!0;break}}}for(var f=r;f<u&&(h[f]===-1||!a(n[f]));)f++;var y=f===u||h[f]===-1?c:h[f];for(f=r-1;f>0&&h[f]===-1;)f--;var C=f===-1||h[f]===-1?0:h[f]+1;return C>y?y:r-C<y-r?C:y}function vc(e,t,n,r){var i=e.length;if(t=hO(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function vO(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!($a(e[n])||$a(e[n-1]));return t}function WS(e,t,n,r,i,a){a===void 0&&(a=ai);var o=cO(function(v,m){var b,f;return OS(v)?(f="",b=""):typeof v=="number"||m?(f=typeof v=="number"?HS(v):v,b=r(f)):(f=i(v,void 0),b=r(f)),{formattedValue:b,numAsString:f}}),s=N.useState(function(){return o(xa(e)?t:e,n)}),l=s[0],u=s[1],c=function(v,m){v.formattedValue!==l.formattedValue&&u({formattedValue:v.formattedValue,numAsString:v.value}),a(v,m)},p=e,h=n;xa(e)&&(p=l.numAsString,h=!0);var d=o(p,h);return N.useMemo(function(){u(d)},[d.formattedValue]),[l,c]}function bO(e){return e.replace(/[^0-9]/g,"")}function yO(e){return e}function US(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=yO);var s=e.removeFormatting;s===void 0&&(s=bO);var l=e.defaultValue,u=e.valueIsNumericString,c=e.onValueChange,p=e.isAllowed,h=e.onChange;h===void 0&&(h=ai);var d=e.onKeyDown;d===void 0&&(d=ai);var v=e.onMouseUp;v===void 0&&(v=ai);var m=e.onFocus;m===void 0&&(m=ai);var b=e.onBlur;b===void 0&&(b=ai);var f=e.value,y=e.getCaretBoundary;y===void 0&&(y=vO);var C=e.isValidInputCharacter;C===void 0&&(C=$a);var S=e.isCharacterSame,w=Ep(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=WS(f,l,!!u,o,s,c),x=E[0],g=x.formattedValue,I=x.numAsString,A=E[1],_=N.useRef(),T=N.useRef({formattedValue:g,numAsString:I}),$=function(ie,oe){T.current={formattedValue:ie.formattedValue,numAsString:ie.value},A(ie,oe)},B=N.useState(!1),P=B[0],k=B[1],O=N.useRef(null),M=N.useRef({setCaretTimeout:null,focusTimeout:null});N.useEffect(function(){return k(!0),function(){clearTimeout(M.current.setCaretTimeout),clearTimeout(M.current.focusTimeout)}},[]);var G=o,W=function(ie,oe){var te=parseFloat(oe);return{formattedValue:ie,value:oe,floatValue:isNaN(te)?void 0:te}},U=function(ie,oe,te){ie.selectionStart===0&&ie.selectionEnd===ie.value.length||(Fi(ie,oe),M.current.setCaretTimeout=setTimeout(function(){ie.value===te&&ie.selectionStart!==oe&&Fi(ie,oe)},0))},q=function(ie,oe,te){return vc(ie,oe,y(ie),te)},Q=function(ie,oe,te){var ue=y(oe),ve=mO(oe,g,ie,te,ue,C,S);return ve=vc(oe,ve,ue),ve},Z=function(ie){var oe=ie.formattedValue;oe===void 0&&(oe="");var te=ie.input,ue=ie.source,ve=ie.event,be=ie.numAsString,pe;if(te){var Te=ie.inputValue||te.value,Ne=eh(te);te.value=oe,pe=Q(Te,oe,Ne),pe!==void 0&&U(te,pe,oe)}oe!==g&&$(W(oe,be),{event:ve,source:ue})};N.useEffect(function(){var ie=T.current,oe=ie.formattedValue,te=ie.numAsString;(g!==oe||I!==te)&&$(W(g,I),{event:void 0,source:Xs.props})},[g,I]);var ee=O.current?eh(O.current):void 0,J=typeof window<"u"?N.useLayoutEffect:N.useEffect;J(function(){var ie=O.current;if(g!==T.current.formattedValue&&ie){var oe=Q(T.current.formattedValue,g,ee);ie.value=g,U(ie,oe,g)}},[g]);var le=function(ie,oe,te){var ue=oe.target,ve=_.current?fO(_.current,ue.selectionEnd):jS(g,ie),be=Object.assign(Object.assign({},ve),{lastValue:g}),pe=s(ie,be),Te=G(pe);if(pe=s(Te,void 0),p&&!p(W(Te,pe))){var Ne=oe.target,Ue=eh(Ne),tt=Q(ie,g,Ue);return Ne.value=g,U(Ne,tt,g),!1}return Z({formattedValue:Te,numAsString:pe,inputValue:ie,event:oe,source:te,input:oe.target}),!0},re=function(ie,oe){oe===void 0&&(oe=0);var te=ie.selectionStart,ue=ie.selectionEnd;_.current={selectionStart:te,selectionEnd:ue+oe}},R=function(ie){var oe=ie.target,te=oe.value,ue=le(te,ie,Xs.event);ue&&h(ie),_.current=void 0},H=function(ie){var oe=ie.target,te=ie.key,ue=oe.selectionStart,ve=oe.selectionEnd,be=oe.value;be===void 0&&(be="");var pe;te==="ArrowLeft"||te==="Backspace"?pe=Math.max(ue-1,0):te==="ArrowRight"?pe=Math.min(ue+1,be.length):te==="Delete"&&(pe=ue);var Te=0;te==="Delete"&&ue===ve&&(Te=1);var Ne=te==="ArrowLeft"||te==="ArrowRight";if(pe===void 0||ue!==ve&&!Ne){d(ie),re(oe,Te);return}var Ue=pe;if(Ne){var tt=te==="ArrowLeft"?"left":"right";Ue=q(be,pe,tt),Ue!==pe&&ie.preventDefault()}else te==="Delete"&&!C(be[pe])?Ue=q(be,pe,"right"):te==="Backspace"&&!C(be[pe])&&(Ue=q(be,pe,"left"));Ue!==pe&&U(oe,Ue,be),d(ie),re(oe,Te)},V=function(ie){var oe=ie.target,te=function(){var ue=oe.selectionStart,ve=oe.selectionEnd,be=oe.value;if(be===void 0&&(be=""),ue===ve){var pe=q(be,ue);pe!==ue&&U(oe,pe,be)}};te(),requestAnimationFrame(function(){te()}),v(ie),re(oe)},D=function(ie){ie.persist&&ie.persist();var oe=ie.target,te=ie.currentTarget;O.current=oe,M.current.focusTimeout=setTimeout(function(){var ue=oe.selectionStart,ve=oe.selectionEnd,be=oe.value;be===void 0&&(be="");var pe=q(be,ue);pe!==ue&&!(ue===0&&ve===be.length)&&U(oe,pe,be),m(Object.assign(Object.assign({},ie),{currentTarget:te}))},0)},L=function(ie){O.current=null,clearTimeout(M.current.focusTimeout),clearTimeout(M.current.setCaretTimeout),b(ie)},K=P&&gO()?"numeric":void 0,X=Object.assign({inputMode:K},w,{type:t,value:g,onChange:R,onKeyDown:H,onMouseUp:V,onFocus:D,onBlur:L});if(n==="text")return i?N.createElement(N.Fragment,null,i(g,w)||null):N.createElement("span",Object.assign({},w,{ref:a}),g);if(r){var se=r;return N.createElement(se,Object.assign({},X,{ref:a}))}return N.createElement("input",Object.assign({},X,{ref:a}))}function Cb(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var a=t.suffix;a===void 0&&(a="");var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var l=cd(t),u=l.thousandSeparator,c=l.decimalSeparator,p=n!==0&&e.indexOf(".")!==-1||n&&r,h=Sp(e,o),d=h.beforeDecimal,v=h.afterDecimal,m=h.addNegation;return n!==void 0&&(v=VS(v,n,!!r)),u&&(d=uO(d,u,s)),i&&(d=i+d),a&&(v=v+a),m&&(d="-"+d),e=d+(p&&c||"")+v,e}function cd(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function xO(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),i&&!a&&t&&(e="-"+e),e}function CO(e,t){return new RegExp("(^-)|[0-9]|"+LS(e),"g")}function EO(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function SO(e,t,n){var r;t===void 0&&(t=zS(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a="");var o=n.suffix;o===void 0&&(o="");var s=n.decimalScale,l=t.from,u=t.to,c=u.start,p=u.end,h=cd(n),d=h.allowedDecimalSeparators,v=h.decimalSeparator,m=e[p]===v;if($a(e)&&(e===a||e===o)&&t.lastValue==="")return e;if(p-c===1&&d.indexOf(e[c])!==-1){var b=s===0?"":v;e=e.substring(0,c)+b+e.substring(c+1,e.length)}var f=function(O,M,G){var W=!1,U=!1;a.startsWith("-")?W=!1:O.startsWith("--")?(W=!1,U=!0):o.startsWith("-")&&O.length===o.length?W=!1:O[0]==="-"&&(W=!0);var q=W?1:0;return U&&(q=2),q&&(O=O.substring(q),M-=q,G-=q),{value:O,start:M,end:G,hasNegation:W}},y=f(e,c,p),C=y.hasNegation;r=y,e=r.value,c=r.start,p=r.end;var S=f(t.lastValue,l.start,l.end),w=S.start,E=S.end,x=S.value,g=e.substring(c,p);e.length&&x.length&&(w>x.length-o.length||E<a.length)&&!(g&&o.startsWith(g))&&(e=x);var I=0;e.startsWith(a)?I+=a.length:c<a.length&&(I=c),e=e.substring(I),p-=I;var A=e.length,_=e.length-o.length;e.endsWith(o)?A=_:(p>_||p>e.length-o.length)&&(A=p),e=e.substring(0,A),e=xO(C?"-"+e:e,i),e=(e.match(CO(v))||[]).join("");var T=e.indexOf(v);e=e.replace(new RegExp(LS(v),"g"),function(O,M){return M===T?".":""});var $=Sp(e,i),B=$.beforeDecimal,P=$.afterDecimal,k=$.addNegation;return u.end-u.start<l.end-l.start&&B===""&&m&&!parseFloat(P)&&(e=k?"-":""),e}function wO(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]==="-";i.fill(!1,0,n.length+(a?1:0));var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function IO(e){var t=cd(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw new Error(`
140
140
  Decimal separator can't be same as thousand separator.
141
141
  thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
142
142
  decimalSeparator: `+r+` (default value for decimalSeparator is .)
@@ -155,13 +155,13 @@ You should wrap it with \`css\` like this:
155
155
  13.6689 6.00984 13.5017 6.00832 13.3269C6.0068 13.1521 6.074 12.9837 6.19544 12.8579L9.05744 9.99592L6.19544
156
156
  7.13392C6.07045 7.00891 6.00024 6.83937 6.00024 6.66259C6.00024 6.48581 6.07045 6.31628 6.19544 6.19126Z`})})}),zO=({className:e})=>F.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-5 1ru-w-5 ${e??""}`,children:F.jsx("g",{id:"upload",children:F.jsx("path",{id:"Vector",d:`M3.83337 13.3333V14.1666C3.83337 14.8297 4.09677 15.4656 4.56561 15.9344C5.03445 16.4033 5.67033
157
157
  16.6666 6.33337 16.6666H14.6667C15.3297 16.6666 15.9656 16.4033 16.4345 15.9344C16.9033 15.4656 17.1667
158
- 14.8297 17.1667 14.1666V13.3333M13.8334 6.66665L10.5 3.33331M10.5 3.33331L7.16671 6.66665M10.5 3.33331V13.3333`,stroke:"#1976D2",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),GO=({onChange:e,valueUrl:t,validateFile:n,validateFileDesc:r="Max 2MB (.jpg, .jpeg, .png, .svg)",maxSize:i=2,icon:a,desc:o,classNameContainer:s,classNameImage:l,classNameAction:u,id:c})=>{const p=N.useRef(null),h=n||["image/png","image/jpeg","image/jpg"],[d,v]=N.useState(""),[m,b]=N.useState(""),f=S=>{if(S!=null&&S.length){const w=S[0],E=w.size/1024/1024;if(!h.some(x=>{var g;return(g=S[0].type)==null?void 0:g.includes(x)}))b("Berkas tidak didukung, silahkan pilih file kembali.");else if(E>i){const x=`${S.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${i}MB.`;b(x)}else{if(!(p!=null&&p.current))return;b(""),e(w),v(URL.createObjectURL(w)),p.current.value=""}}},y=S=>{S.preventDefault(),f(S.dataTransfer.files)},C=S=>{S.preventDefault(),p!=null&&p.current&&(typeof e=="function"&&e(null),v(""),p.current.value="")};return F.jsxs("div",{className:`${qr.container} ${s}`,children:[F.jsx("input",{accept:h==null?void 0:h.join(", "),ref:p,hidden:!0,type:"file",multiple:!1,onChange:S=>{S.target.files&&f(S.target.files)}}),d||t?F.jsx("div",{id:`${c}-exist`,className:`${qr["image-content"]} ${l}`,onDrop:y,onDragOver:S=>S.preventDefault(),onDragLeave:S=>S.preventDefault(),children:F.jsx("img",{src:d||t,alt:"upload-image",className:`${qr.image} ${l}`})}):F.jsxs("div",{id:c,className:`${qr["image-content"]} ${l}`,onDrop:y,onDragOver:S=>S.preventDefault(),onDragLeave:S=>S.preventDefault(),children:[a,F.jsx("div",{className:qr["text-desc"],children:typeof o=="function"?o():o})]}),F.jsxs("div",{className:qr["action-content"],children:[F.jsxs("div",{className:`${qr["button-content"]} ${u}`,children:[(d||t)&&F.jsx(vr,{id:`${c}-delete-img`,variants:"tertiary-red-600",size:"xs",startIcon:F.jsx(jO,{}),onClick:S=>C(S),children:"Hapus"}),F.jsxs(vr,{id:`${c}-change-img`,variants:"tertiary-blue-700",size:"xs",onClick:()=>{var S;return(S=p.current)==null?void 0:S.click()},startIcon:F.jsx(zO,{}),children:[d||t?"Ganti":"Pilih"," Gambar"]})]}),F.jsx("p",{className:qr["text-desc"],children:r}),m&&F.jsx("p",{className:qr["text-error"],children:m})]})]})},WO="_container_qyhmv_1",UO="_label_qyhmv_4",XO="_disabled_qyhmv_9",YO="_textarea_qyhmv_15",KO="_error_qyhmv_41",un={container:WO,"size-medium":"_size-medium_qyhmv_1",label:UO,disabled:XO,"container-textarea":"_container-textarea_qyhmv_12",textarea:YO,error:KO,"label-error":"_label-error_qyhmv_49","size-medium-border-bottom":"_size-medium-border-bottom_qyhmv_57","size-m":"_size-m_qyhmv_1","solid-blue-300":"_solid-blue-300_qyhmv_169","dashed-blue-300":"_dashed-blue-300_qyhmv_182","solid-laba-blue-10":"_solid-laba-blue-10_qyhmv_192","dashed-laba-blue-10":"_dashed-laba-blue-10_qyhmv_205","border-bottom-laba-blue-08":"_border-bottom-laba-blue-08_qyhmv_215"},YS=N.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:p,minHeight:h=94,maxHeight:d=150,style:v,sizeInput:m="m",variant:b="solid-blue-300",...f}=e,y=N.useRef(null),C=kg(y,t),S={...v??{},maxHeight:d,height:p??h,minHeight:h},[w,E]=N.useState(!1),x={size:{m:un["size-m"],medium:un["size-medium"],"medium-border-bottom":un["size-medium-border-bottom"]},variant:{"solid-blue-300":{border:0,style:un["solid-blue-300"]},"dashed-blue-300":{border:3.7,style:un["dashed-blue-300"]},"solid-laba-blue-10":{border:0,style:un["solid-laba-blue-10"]},"dashed-laba-blue-10":{border:3.7,style:un["dashed-laba-blue-10"]},"border-bottom-laba-blue-08":{border:1,style:un["border-bottom-laba-blue-08"]}}},g=function(_){var T;E(!0),(T=e.onFocus)==null||T.call(e,_)},I=function(_){var T;E(!1),(T=e.onBlur)==null||T.call(e,_)},A=function(_){const T=(_==null?void 0:_.target)??y.current;T.style.height="0px",T.style.height=T.scrollHeight+x.variant[b].border+"px"};return Bg(()=>(w&&y.current?y.current.addEventListener("input",A):A(),()=>{var _;(_=y.current)==null||_.removeEventListener("input",A)}),[w]),F.jsxs("div",{className:`${un.container}
158
+ 14.8297 17.1667 14.1666V13.3333M13.8334 6.66665L10.5 3.33331M10.5 3.33331L7.16671 6.66665M10.5 3.33331V13.3333`,stroke:"#1976D2",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),GO=({onChange:e,valueUrl:t,validateFile:n,validateFileDesc:r="Max 2MB (.jpg, .jpeg, .png, .svg)",maxSize:i=2,icon:a,desc:o,classNameContainer:s,classNameImage:l,classNameAction:u,id:c})=>{const p=N.useRef(null),h=n||["image/png","image/jpeg","image/jpg"],[d,v]=N.useState(""),[m,b]=N.useState(""),f=S=>{if(S!=null&&S.length){const w=S[0],E=w.size/1024/1024;if(!h.some(x=>{var g;return(g=S[0].type)==null?void 0:g.includes(x)}))b("Berkas tidak didukung, silahkan pilih file kembali.");else if(E>i){const x=`${S.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${i}MB.`;b(x)}else{if(!(p!=null&&p.current))return;b(""),e(w),v(URL.createObjectURL(w)),p.current.value=""}}},y=S=>{S.preventDefault(),f(S.dataTransfer.files)},C=S=>{S.preventDefault(),p!=null&&p.current&&(typeof e=="function"&&e(null),v(""),p.current.value="")};return F.jsxs("div",{className:`${qr.container} ${s}`,children:[F.jsx("input",{accept:h==null?void 0:h.join(", "),ref:p,hidden:!0,type:"file",multiple:!1,onChange:S=>{S.target.files&&f(S.target.files)}}),d||t?F.jsx("div",{id:`${c}-exist`,className:`${qr["image-content"]} ${l}`,onDrop:y,onDragOver:S=>S.preventDefault(),onDragLeave:S=>S.preventDefault(),children:F.jsx("img",{src:d||t,alt:"upload-image",className:`${qr.image} ${l}`})}):F.jsxs("div",{id:c,className:`${qr["image-content"]} ${l}`,onDrop:y,onDragOver:S=>S.preventDefault(),onDragLeave:S=>S.preventDefault(),children:[a,F.jsx("div",{className:qr["text-desc"],children:typeof o=="function"?o():o})]}),F.jsxs("div",{className:qr["action-content"],children:[F.jsxs("div",{className:`${qr["button-content"]} ${u}`,children:[(d||t)&&F.jsx(vr,{id:`${c}-delete-img`,variants:"tertiary-red-600",size:"xs",startIcon:F.jsx(jO,{}),onClick:S=>C(S),children:"Hapus"}),F.jsxs(vr,{id:`${c}-change-img`,variants:"tertiary-blue-700",size:"xs",onClick:()=>{var S;return(S=p.current)==null?void 0:S.click()},startIcon:F.jsx(zO,{}),children:[d||t?"Ganti":"Pilih"," Gambar"]})]}),F.jsx("p",{className:qr["text-desc"],children:r}),m&&F.jsx("p",{className:qr["text-error"],children:m})]})]})},WO="_container_qyhmv_1",UO="_label_qyhmv_4",XO="_disabled_qyhmv_9",YO="_textarea_qyhmv_15",KO="_error_qyhmv_41",cn={container:WO,"size-medium":"_size-medium_qyhmv_1",label:UO,disabled:XO,"container-textarea":"_container-textarea_qyhmv_12",textarea:YO,error:KO,"label-error":"_label-error_qyhmv_49","size-medium-border-bottom":"_size-medium-border-bottom_qyhmv_57","size-m":"_size-m_qyhmv_1","solid-blue-300":"_solid-blue-300_qyhmv_169","dashed-blue-300":"_dashed-blue-300_qyhmv_182","solid-laba-blue-10":"_solid-laba-blue-10_qyhmv_192","dashed-laba-blue-10":"_dashed-laba-blue-10_qyhmv_205","border-bottom-laba-blue-08":"_border-bottom-laba-blue-08_qyhmv_215"},YS=N.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:p,minHeight:h=94,maxHeight:d=150,style:v,sizeInput:m="m",variant:b="solid-blue-300",...f}=e,y=N.useRef(null),C=kg(y,t),S={...v??{},maxHeight:d,height:p??h,minHeight:h},[w,E]=N.useState(!1),x={size:{m:cn["size-m"],medium:cn["size-medium"],"medium-border-bottom":cn["size-medium-border-bottom"]},variant:{"solid-blue-300":{border:0,style:cn["solid-blue-300"]},"dashed-blue-300":{border:3.7,style:cn["dashed-blue-300"]},"solid-laba-blue-10":{border:0,style:cn["solid-laba-blue-10"]},"dashed-laba-blue-10":{border:3.7,style:cn["dashed-laba-blue-10"]},"border-bottom-laba-blue-08":{border:1,style:cn["border-bottom-laba-blue-08"]}}},g=function(_){var T;E(!0),(T=e.onFocus)==null||T.call(e,_)},I=function(_){var T;E(!1),(T=e.onBlur)==null||T.call(e,_)},A=function(_){const T=(_==null?void 0:_.target)??y.current;T.style.height="0px",T.style.height=T.scrollHeight+x.variant[b].border+"px"};return Bg(()=>(w&&y.current?y.current.addEventListener("input",A):A(),()=>{var _;(_=y.current)==null||_.removeEventListener("input",A)}),[w]),F.jsxs("div",{className:`${cn.container}
159
159
  ${x.size[m]}
160
160
  ${x.variant[b].style}
161
- ${r??""}`,children:[u&&F.jsxs("label",{htmlFor:l??s,className:`${un.label} ${f.disabled?un.disabled:""} ${a??""}`,children:[u," ",n&&F.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),F.jsx("div",{className:`${un["container-textarea"]}`,children:F.jsx("textarea",{id:l??s,className:` ${c?un.error:""}
162
- ${un.textarea}
163
- ${i??""}`,ref:C,style:S,...f,onFocus:g,onBlur:I})}),c&&F.jsx("label",{className:`${un["label-error"]}
164
- ${f.disabled?un.disabled:""} ${o??""}`,children:c})]})});YS.displayName="Textarea";/*!
161
+ ${r??""}`,children:[u&&F.jsxs("label",{htmlFor:l??s,className:`${cn.label} ${f.disabled?cn.disabled:""} ${a??""}`,children:[u," ",n&&F.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),F.jsx("div",{className:`${cn["container-textarea"]}`,children:F.jsx("textarea",{id:l??s,className:` ${c?cn.error:""}
162
+ ${cn.textarea}
163
+ ${i??""}`,ref:C,style:S,...f,onFocus:g,onBlur:I})}),c&&F.jsx("label",{className:`${cn["label-error"]}
164
+ ${f.disabled?cn.disabled:""} ${o??""}`,children:c})]})});YS.displayName="Textarea";/*!
165
165
  * @kurkle/color v0.3.2
166
166
  * https://github.com/kurkle/color#readme
167
167
  * (c) 2023 Jukka Kurkela
@@ -171,14 +171,14 @@ You should wrap it with \`css\` like this:
171
171
  * https://www.chartjs.org
172
172
  * (c) 2025 Chart.js Contributors
173
173
  * Released under the MIT License
174
- */function Qr(){}const bL=(()=>{let e=0;return()=>e++})();function Qe(e){return e==null}function Bt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function je(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function pn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function _r(e,t){return pn(e)?e:t}function Me(e,t){return typeof e>"u"?t:e}const yL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function rt(e,t,n,r){let i,a,o;if(Bt(e))for(a=e.length,i=0;i<a;i++)t.call(n,e[i],i);else if(je(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function bc(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function yc(e){if(Bt(e))return e.map(yc);if(je(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=yc(e[n[i]]);return t}return e}function QS(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function xL(e,t,n,r){if(!QS(e))return;const i=t[e],a=n[e];je(i)&&je(a)?Ks(i,a,r):t[e]=yc(a)}function Ks(e,t,n){const r=Bt(t)?t:[t],i=r.length;if(!je(e))return e;n=n||{};const a=n.merger||xL;let o;for(let s=0;s<i;++s){if(o=r[s],!je(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)a(l[u],e,o,n)}return e}function ys(e,t){return Ks(e,t,{merger:CL})}function CL(e,t,n){if(!QS(e))return;const r=t[e],i=n[e];je(r)&&je(i)?ys(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=yc(i))}const _b={"":e=>e,x:e=>e.x,y:e=>e.y};function EL(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function SL(e){const t=EL(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Fa(e,t){return(_b[t]||(_b[t]=SL(t)))(e)}function Tp(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Zs=e=>typeof e<"u",Ki=e=>typeof e=="function",Db=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wL(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const it=Math.PI,yt=2*it,IL=yt+it,xc=Number.POSITIVE_INFINITY,_L=it/180,Lt=it/2,oa=it/4,Tb=it*2/3,ew=Math.log10,Hr=Math.sign;function xs(e,t,n){return Math.abs(e-t)<n}function Ab(e){const t=Math.round(e);e=xs(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ew(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function DL(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,a)=>i-a).pop(),t}function TL(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Js(e){return!TL(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function AL(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function RL(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function ui(e){return e*(it/180)}function BL(e){return e*(180/it)}function Rb(e){if(!pn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function tw(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*it&&(a+=yt),{angle:a,distance:i}}function T0(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function kL(e,t){return(e-t+IL)%yt-it}function Nn(e){return(e%yt+yt)%yt}function qs(e,t,n,r){const i=Nn(e),a=Nn(t),o=Nn(n),s=Nn(a-i),l=Nn(o-i),u=Nn(i-a),c=Nn(i-o);return i===a||i===o||r&&a===o||s>l&&u<c}function hn(e,t,n){return Math.max(t,Math.min(n,e))}function PL(e){return hn(e,-32768,32767)}function ci(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Ap(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}const ba=(e,t,n,r)=>Ap(e,n,r?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),$L=(e,t,n)=>Ap(e,n,r=>e[r][t]>=n);function FL(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const nw=["push","pop","shift","splice","unshift"];function NL(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),nw.forEach(n=>{const r="_onData"+Tp(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...a){const o=i.apply(this,a);return e._chartjs.listeners.forEach(s=>{typeof s[r]=="function"&&s[r](...a)}),o}})})}function Bb(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(nw.forEach(a=>{delete e[a]}),delete e._chartjs)}function rw(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const iw=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function aw(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,iw.call(window,()=>{r=!1,e.apply(t,n)}))}}function ML(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Rp=e=>e==="start"?"left":e==="end"?"right":"center",dn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,OL=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function LL(e,t,n){const r=t.length;let i=0,a=r;if(e._sorted){const{iScale:o,vScale:s,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=o.axis,{min:p,max:h,minDefined:d,maxDefined:v}=o.getUserBounds();if(d){if(i=Math.min(ba(l,c,p).lo,n?r:ba(t,c,o.getPixelForValue(p)).lo),u){const m=l.slice(0,i+1).reverse().findIndex(b=>!Qe(b[s.axis]));i-=Math.max(0,m)}i=hn(i,0,r-1)}if(v){let m=Math.max(ba(l,o.axis,h,!0).hi+1,n?0:ba(t,c,o.getPixelForValue(h),!0).hi+1);if(u){const b=l.slice(m-1).findIndex(f=>!Qe(f[s.axis]));m+=Math.max(0,b)}a=hn(m,i,r)-i}else a=r-i}return{start:i,count:a}}function VL(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}const ru=e=>e===0||e===1,kb=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*yt/n)),Pb=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*yt/n)+1,Cs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Lt)+1,easeOutSine:e=>Math.sin(e*Lt),easeInOutSine:e=>-.5*(Math.cos(it*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ru(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ru(e)?e:kb(e,.075,.3),easeOutElastic:e=>ru(e)?e:Pb(e,.075,.3),easeInOutElastic(e){return ru(e)?e:e<.5?.5*kb(e*2,.1125,.45):.5+.5*Pb(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Cs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Cs.easeInBounce(e*2)*.5:Cs.easeOutBounce(e*2-1)*.5+.5};function Bp(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $b(e){return Bp(e)?e:new Ys(e)}function nh(e){return Bp(e)?e:new Ys(e).saturate(.5).darken(.1).hexString()}const HL=["x","y","borderWidth","radius","tension"],jL=["color","borderColor","backgroundColor"];function zL(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:jL},numbers:{type:"number",properties:HL}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function GL(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Fb=new Map;function WL(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Fb.get(n);return r||(r=new Intl.NumberFormat(e,t),Fb.set(n,r)),r}function kp(e,t,n){return WL(t,n).format(e)}const UL={values(e){return Bt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,a=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),a=XL(e,n)}const o=ew(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),kp(e,r,l)}};function XL(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ow={formatters:UL};function YL(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ow.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Na=Object.create(null),A0=Object.create(null);function Es(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const a=n[r];e=e[a]||(e[a]=Object.create(null))}return e}function rh(e,t,n){return typeof t=="string"?Ks(Es(e,t),n):Ks(Es(e,""),t)}class KL{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>nh(i.backgroundColor),this.hoverBorderColor=(r,i)=>nh(i.borderColor),this.hoverColor=(r,i)=>nh(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return rh(this,t,n)}get(t){return Es(this,t)}describe(t,n){return rh(A0,t,n)}override(t,n){return rh(Na,t,n)}route(t,n,r,i){const a=Es(this,t),o=Es(this,r),s="_"+n;Object.defineProperties(a,{[s]:{value:a[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[s],u=o[i];return je(l)?Object.assign({},u,l):Me(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var _t=new KL({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[zL,GL,YL]);function ZL(e){return!e||Qe(e.size)||Qe(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Nb(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function sa(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function Mb(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function R0(e,t,n,r){sw(e,t,n,r,null)}function sw(e,t,n,r,i){let a,o,s,l,u,c,p,h;const d=t.pointStyle,v=t.rotation,m=t.radius;let b=(v||0)*_L;if(d&&typeof d=="object"&&(a=d.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(b),e.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),d){default:i?e.ellipse(n,r,i/2,m,0,0,yt):e.arc(n,r,m,0,yt),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(b)*c,r-Math.cos(b)*m),b+=Tb,e.lineTo(n+Math.sin(b)*c,r-Math.cos(b)*m),b+=Tb,e.lineTo(n+Math.sin(b)*c,r-Math.cos(b)*m),e.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(b+oa)*l,p=Math.cos(b+oa)*(i?i/2-u:l),s=Math.sin(b+oa)*l,h=Math.sin(b+oa)*(i?i/2-u:l),e.arc(n-p,r-s,u,b-it,b-Lt),e.arc(n+h,r-o,u,b-Lt,b),e.arc(n+p,r+s,u,b,b+Lt),e.arc(n-h,r+o,u,b+Lt,b+it),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}b+=oa;case"rectRot":p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+h,r-o),e.lineTo(n+p,r+s),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":b+=oa;case"cross":p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+p,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+p,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),b+=oa,p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+p,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(b)*m,s=Math.sin(b)*m,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(b)*(i?i/2:m),r+Math.sin(b)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Qs(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function dd(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fd(e){e.restore()}function JL(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const a=(t.x+n.x)/2;e.lineTo(a,t.y),e.lineTo(a,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function qL(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function QL(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Qe(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function eV(e,t,n,r,i){if(i.strikethrough||i.underline){const a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,l=n-a.actualBoundingBoxAscent,u=n+a.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(s,c),e.stroke()}}function tV(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function el(e,t,n,r,i,a={}){const o=Bt(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,QL(e,a),l=0;l<o.length;++l)u=o[l],a.backdrop&&tV(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),Qe(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(u,n,r,a.maxWidth)),e.fillText(u,n,r,a.maxWidth),eV(e,n,r,u,a),r+=Number(i.lineHeight);e.restore()}function Cc(e,t){const{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*it,it,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,it,Lt,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,Lt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Lt,!0),e.lineTo(n+o.topLeft,r)}const nV=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rV=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function iV(e,t){const n=(""+e).match(nV);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const aV=e=>+e||0;function Pp(e,t){const n={},r=je(t),i=r?Object.keys(t):t,a=je(e)?r?o=>Me(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=aV(a(o));return n}function lw(e){return Pp(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Eo(e){return Pp(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ar(e){const t=lw(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function gn(e,t){e=e||{},t=t||_t.font;let n=Me(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Me(e.style,t.style);r&&!(""+r).match(rV)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Me(e.family,t.family),lineHeight:iV(Me(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Me(e.weight,t.weight),string:""};return i.string=ZL(i),i}function iu(e,t,n,r){let i,a,o;for(i=0,a=e.length;i<a;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function oV(e,t,n){const{min:r,max:i}=e,a=qS(t,(i-r)/2),o=(s,l)=>n&&s===0?0:s+l;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function ja(e,t){return Object.assign(Object.create(e),t)}function $p(e,t=[""],n,r,i=()=>e[0]){const a=n||e;typeof r>"u"&&(r=fw("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:s=>$p([s,...e],t,a,r)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete e[0][l],!0},get(s,l){return cw(s,l,()=>gV(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return Lb(s).includes(l)},ownKeys(s){return Lb(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function Po(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:uw(e,r),setContext:a=>Po(e,a,n,r),override:a=>Po(e.override(a),t,n,r)};return new Proxy(i,{deleteProperty(a,o){return delete a[o],delete e[o],!0},get(a,o,s){return cw(a,o,()=>lV(a,o,s))},getOwnPropertyDescriptor(a,o){return a._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(a,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(a,o,s){return e[o]=s,delete a[o],!0}})}function uw(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ki(n)?n:()=>n,isIndexable:Ki(r)?r:()=>r}}const sV=(e,t)=>e?e+Tp(t):t,Fp=(e,t)=>je(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function cw(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function lV(e,t,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e;let s=r[t];return Ki(s)&&o.isScriptable(t)&&(s=uV(t,s,e,n)),Bt(s)&&s.length&&(s=cV(t,s,e,o.isIndexable)),Fp(t,s)&&(s=Po(s,i,a&&a[t],o)),s}function uV(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(a,o||r);return s.delete(e),Fp(e,l)&&(l=Np(i._scopes,i,e,l)),l}function cV(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(typeof a.index<"u"&&r(e))return t[a.index%t.length];if(je(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const p=Np(u,i,e,c);t.push(Po(p,a,o&&o[e],s))}}return t}function dw(e,t,n){return Ki(e)?e(t,n):e}const dV=(e,t)=>e===!0?t:typeof e=="string"?Fa(t,e):void 0;function fV(e,t,n,r,i){for(const a of t){const o=dV(n,a);if(o){e.add(o);const s=dw(o._fallback,n,i);if(typeof s<"u"&&s!==n&&s!==r)return s}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Np(e,t,n,r){const i=t._rootScopes,a=dw(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let l=Ob(s,o,n,a||n,r);return l===null||typeof a<"u"&&a!==n&&(l=Ob(s,o,a,l,r),l===null)?!1:$p(Array.from(s),[""],i,a,()=>hV(t,n,r))}function Ob(e,t,n,r,i){for(;n;)n=fV(e,t,n,r,i);return n}function hV(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Bt(i)&&je(n)?n:i||{}}function gV(e,t,n,r){let i;for(const a of t)if(i=fw(sV(a,e),n),typeof i<"u")return Fp(e,i)?Np(n,r,e,i):i}function fw(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function Lb(e){let t=e._keys;return t||(t=e._keys=pV(e._scopes)),t}function pV(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}const mV=Number.EPSILON||1e-14,$o=(e,t)=>t<e.length&&!e[t].skip&&e[t],hw=e=>e==="x"?"y":"x";function vV(e,t,n,r){const i=e.skip?t:e,a=t,o=n.skip?t:n,s=T0(a,i),l=T0(o,a);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const p=r*u,h=r*c;return{previous:{x:a.x-p*(o.x-i.x),y:a.y-p*(o.y-i.y)},next:{x:a.x+h*(o.x-i.x),y:a.y+h*(o.y-i.y)}}}function bV(e,t,n){const r=e.length;let i,a,o,s,l,u=$o(e,0);for(let c=0;c<r-1;++c)if(l=u,u=$o(e,c+1),!(!l||!u)){if(xs(t[c],0,mV)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],a=n[c+1]/t[c],s=Math.pow(i,2)+Math.pow(a,2),!(s<=9)&&(o=3/Math.sqrt(s),n[c]=i*o*t[c],n[c+1]=a*o*t[c])}}function yV(e,t,n="x"){const r=hw(n),i=e.length;let a,o,s,l=$o(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=$o(e,u+1),!s)continue;const c=s[n],p=s[r];o&&(a=(c-o[n])/3,s[`cp1${n}`]=c-a,s[`cp1${r}`]=p-a*t[u]),l&&(a=(l[n]-c)/3,s[`cp2${n}`]=c+a,s[`cp2${r}`]=p+a*t[u])}}function xV(e,t="x"){const n=hw(t),r=e.length,i=Array(r).fill(0),a=Array(r);let o,s,l,u=$o(e,0);for(o=0;o<r;++o)if(s=l,l=u,u=$o(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}a[o]=s?u?Hr(i[o-1])!==Hr(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}bV(e,i,a),yV(e,a,t)}function au(e,t,n){return Math.max(Math.min(e,n),t)}function CV(e,t){let n,r,i,a,o,s=Qs(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&Qs(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=au(i.cp1x,t.left,t.right),i.cp1y=au(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=au(i.cp2x,t.left,t.right),i.cp2y=au(i.cp2y,t.top,t.bottom)))}function EV(e,t,n,r,i){let a,o,s,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")xV(e,i);else{let u=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],l=vV(u,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,u=s}t.capBezierPoints&&CV(e,n)}function Mp(){return typeof window<"u"&&typeof document<"u"}function Op(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ec(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const hd=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function SV(e,t){return hd(e).getPropertyValue(t)}const wV=["top","right","bottom","left"];function Ca(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=wV[i];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const IV=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function _V(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r;let o=!1,s,l;if(IV(i,a,e.target))s=i,l=a;else{const u=t.getBoundingClientRect();s=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function ca(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=hd(n),a=i.boxSizing==="border-box",o=Ca(i,"padding"),s=Ca(i,"border","width"),{x:l,y:u,box:c}=_V(e,n),p=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:d,height:v}=t;return a&&(d-=o.width+s.width,v-=o.height+s.height),{x:Math.round((l-p)/d*n.width/r),y:Math.round((u-h)/v*n.height/r)}}function DV(e,t,n){let r,i;if(t===void 0||n===void 0){const a=e&&Op(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{const o=a.getBoundingClientRect(),s=hd(a),l=Ca(s,"border","width"),u=Ca(s,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Ec(s.maxWidth,a,"clientWidth"),i=Ec(s.maxHeight,a,"clientHeight")}}return{width:t,height:n,maxWidth:r||xc,maxHeight:i||xc}}const ou=e=>Math.round(e*10)/10;function TV(e,t,n,r){const i=hd(e),a=Ca(i,"margin"),o=Ec(i.maxWidth,e,"clientWidth")||xc,s=Ec(i.maxHeight,e,"clientHeight")||xc,l=DV(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=Ca(i,"border","width"),d=Ca(i,"padding");u-=d.width+h.width,c-=d.height+h.height}return u=Math.max(0,u-a.width),c=Math.max(0,r?u/r:c-a.height),u=ou(Math.min(u,o,l.maxWidth)),c=ou(Math.min(c,s,l.maxHeight)),u&&!c&&(c=ou(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=ou(Math.floor(c*r))),{width:u,height:c}}function Vb(e,t,n){const r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const AV=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Mp()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Hb(e,t){const n=SV(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function da(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function RV(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function BV(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=da(e,i,n),s=da(i,a,n),l=da(a,t,n),u=da(o,s,n),c=da(s,l,n);return da(u,c,n)}const kV=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},PV=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function So(e,t,n){return e?kV(t,n):PV()}function gw(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function pw(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function mw(e){return e==="angle"?{between:qs,compare:kL,normalize:Nn}:{between:ci,compare:(t,n)=>t-n,normalize:t=>t}}function jb({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function $V(e,t,n){const{property:r,start:i,end:a}=n,{between:o,normalize:s}=mw(r),l=t.length;let{start:u,end:c,loop:p}=e,h,d;if(p){for(u+=l,c+=l,h=0,d=l;h<d&&o(s(t[u%l][r]),i,a);++h)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:p,style:e.style}}function vw(e,t,n){if(!n)return[e];const{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:l,normalize:u}=mw(r),{start:c,end:p,loop:h,style:d}=$V(e,t,n),v=[];let m=!1,b=null,f,y,C;const S=()=>l(i,C,f)&&s(i,C)!==0,w=()=>s(a,f)===0||l(a,C,f),E=()=>m||S(),x=()=>!m||w();for(let g=c,I=c;g<=p;++g)y=t[g%o],!y.skip&&(f=u(y[r]),f!==C&&(m=l(f,i,a),b===null&&E()&&(b=s(f,i)===0?g:I),b!==null&&x()&&(v.push(jb({start:b,end:g,loop:h,count:o,style:d})),b=null),I=g,C=f));return b!==null&&v.push(jb({start:b,end:p,loop:h,count:o,style:d})),v}function bw(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const a=vw(r[i],e.points,t);a.length&&n.push(...a)}return n}function FV(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function NV(e,t,n,r){const i=e.length,a=[];let o=t,s=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?s.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,s.skip&&(t=l)),s=u}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function MV(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const a=!!e._loop,{start:o,end:s}=FV(n,i,a,r);if(r===!0)return zb(e,[{start:o,end:s,loop:a}],n,t);const l=s<o?s+i:s,u=!!e._fullLoop&&o===0&&s===i-1;return zb(e,NV(n,o,l,u),n,t)}function zb(e,t,n,r){return!r||!r.setContext||!n?t:OV(e,t,n,r)}function OV(e,t,n,r){const i=e._chart.getContext(),a=Gb(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=a,p=t[0].start,h=p;function d(v,m,b,f){const y=s?-1:1;if(v!==m){for(v+=l;n[v%l].skip;)v-=y;for(;n[m%l].skip;)m+=y;v%l!==m%l&&(u.push({start:v%l,end:m%l,loop:b,style:f}),c=f,p=m%l)}}for(const v of t){p=s?p:v.start;let m=n[p%l],b;for(h=p+1;h<=v.end;h++){const f=n[h%l];b=Gb(r.setContext(ja(i,{type:"segment",p0:m,p1:f,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),LV(b,c)&&d(p,h-1,v.loop,c),m=f,c=b}p<h-1&&d(p,h-1,v.loop,c)}return u}function Gb(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function LV(e,t){if(!t)return!1;const n=[],r=function(i,a){return Bp(a)?(n.includes(a)||n.push(a),n.indexOf(a)):a};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function su(e,t,n){return e.options.clip?e[n]:t[n]}function VV(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(r,t,"top"),bottom:su(r,t,"bottom")}:t}function yw(e,t){const n=t._clip;if(n.disabled)return!1;const r=VV(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
174
+ */function Qr(){}const bL=(()=>{let e=0;return()=>e++})();function et(e){return e==null}function Bt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function je(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function mn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function _r(e,t){return mn(e)?e:t}function Me(e,t){return typeof e>"u"?t:e}const yL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function rt(e,t,n,r){let i,a,o;if(Bt(e))for(a=e.length,i=0;i<a;i++)t.call(n,e[i],i);else if(je(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function bc(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function yc(e){if(Bt(e))return e.map(yc);if(je(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=yc(e[n[i]]);return t}return e}function QS(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function xL(e,t,n,r){if(!QS(e))return;const i=t[e],a=n[e];je(i)&&je(a)?Ks(i,a,r):t[e]=yc(a)}function Ks(e,t,n){const r=Bt(t)?t:[t],i=r.length;if(!je(e))return e;n=n||{};const a=n.merger||xL;let o;for(let s=0;s<i;++s){if(o=r[s],!je(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)a(l[u],e,o,n)}return e}function ys(e,t){return Ks(e,t,{merger:CL})}function CL(e,t,n){if(!QS(e))return;const r=t[e],i=n[e];je(r)&&je(i)?ys(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=yc(i))}const _b={"":e=>e,x:e=>e.x,y:e=>e.y};function EL(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function SL(e){const t=EL(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Fa(e,t){return(_b[t]||(_b[t]=SL(t)))(e)}function Tp(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Zs=e=>typeof e<"u",Ki=e=>typeof e=="function",Db=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function wL(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const it=Math.PI,yt=2*it,IL=yt+it,xc=Number.POSITIVE_INFINITY,_L=it/180,Lt=it/2,oa=it/4,Tb=it*2/3,ew=Math.log10,Hr=Math.sign;function xs(e,t,n){return Math.abs(e-t)<n}function Ab(e){const t=Math.round(e);e=xs(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ew(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function DL(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,a)=>i-a).pop(),t}function TL(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Js(e){return!TL(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function AL(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function RL(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function ui(e){return e*(it/180)}function BL(e){return e*(180/it)}function Rb(e){if(!mn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function tw(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*it&&(a+=yt),{angle:a,distance:i}}function T0(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function kL(e,t){return(e-t+IL)%yt-it}function Nn(e){return(e%yt+yt)%yt}function qs(e,t,n,r){const i=Nn(e),a=Nn(t),o=Nn(n),s=Nn(a-i),l=Nn(o-i),u=Nn(i-a),c=Nn(i-o);return i===a||i===o||r&&a===o||s>l&&u<c}function gn(e,t,n){return Math.max(t,Math.min(n,e))}function PL(e){return gn(e,-32768,32767)}function ci(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Ap(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}const ba=(e,t,n,r)=>Ap(e,n,r?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),$L=(e,t,n)=>Ap(e,n,r=>e[r][t]>=n);function FL(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const nw=["push","pop","shift","splice","unshift"];function NL(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),nw.forEach(n=>{const r="_onData"+Tp(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...a){const o=i.apply(this,a);return e._chartjs.listeners.forEach(s=>{typeof s[r]=="function"&&s[r](...a)}),o}})})}function Bb(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(nw.forEach(a=>{delete e[a]}),delete e._chartjs)}function rw(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const iw=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function aw(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,iw.call(window,()=>{r=!1,e.apply(t,n)}))}}function ML(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Rp=e=>e==="start"?"left":e==="end"?"right":"center",fn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,OL=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function LL(e,t,n){const r=t.length;let i=0,a=r;if(e._sorted){const{iScale:o,vScale:s,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=o.axis,{min:p,max:h,minDefined:d,maxDefined:v}=o.getUserBounds();if(d){if(i=Math.min(ba(l,c,p).lo,n?r:ba(t,c,o.getPixelForValue(p)).lo),u){const m=l.slice(0,i+1).reverse().findIndex(b=>!et(b[s.axis]));i-=Math.max(0,m)}i=gn(i,0,r-1)}if(v){let m=Math.max(ba(l,o.axis,h,!0).hi+1,n?0:ba(t,c,o.getPixelForValue(h),!0).hi+1);if(u){const b=l.slice(m-1).findIndex(f=>!et(f[s.axis]));m+=Math.max(0,b)}a=gn(m,i,r)-i}else a=r-i}return{start:i,count:a}}function VL(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}const ru=e=>e===0||e===1,kb=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*yt/n)),Pb=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*yt/n)+1,Cs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Lt)+1,easeOutSine:e=>Math.sin(e*Lt),easeInOutSine:e=>-.5*(Math.cos(it*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ru(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ru(e)?e:kb(e,.075,.3),easeOutElastic:e=>ru(e)?e:Pb(e,.075,.3),easeInOutElastic(e){return ru(e)?e:e<.5?.5*kb(e*2,.1125,.45):.5+.5*Pb(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Cs.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Cs.easeInBounce(e*2)*.5:Cs.easeOutBounce(e*2-1)*.5+.5};function Bp(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $b(e){return Bp(e)?e:new Ys(e)}function nh(e){return Bp(e)?e:new Ys(e).saturate(.5).darken(.1).hexString()}const HL=["x","y","borderWidth","radius","tension"],jL=["color","borderColor","backgroundColor"];function zL(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:jL},numbers:{type:"number",properties:HL}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function GL(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Fb=new Map;function WL(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Fb.get(n);return r||(r=new Intl.NumberFormat(e,t),Fb.set(n,r)),r}function kp(e,t,n){return WL(t,n).format(e)}const UL={values(e){return Bt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,a=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),a=XL(e,n)}const o=ew(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),kp(e,r,l)}};function XL(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ow={formatters:UL};function YL(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ow.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Na=Object.create(null),A0=Object.create(null);function Es(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const a=n[r];e=e[a]||(e[a]=Object.create(null))}return e}function rh(e,t,n){return typeof t=="string"?Ks(Es(e,t),n):Ks(Es(e,""),t)}class KL{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>nh(i.backgroundColor),this.hoverBorderColor=(r,i)=>nh(i.borderColor),this.hoverColor=(r,i)=>nh(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return rh(this,t,n)}get(t){return Es(this,t)}describe(t,n){return rh(A0,t,n)}override(t,n){return rh(Na,t,n)}route(t,n,r,i){const a=Es(this,t),o=Es(this,r),s="_"+n;Object.defineProperties(a,{[s]:{value:a[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[s],u=o[i];return je(l)?Object.assign({},u,l):Me(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var _t=new KL({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[zL,GL,YL]);function ZL(e){return!e||et(e.size)||et(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Nb(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function sa(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function Mb(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function R0(e,t,n,r){sw(e,t,n,r,null)}function sw(e,t,n,r,i){let a,o,s,l,u,c,p,h;const d=t.pointStyle,v=t.rotation,m=t.radius;let b=(v||0)*_L;if(d&&typeof d=="object"&&(a=d.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(b),e.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),d){default:i?e.ellipse(n,r,i/2,m,0,0,yt):e.arc(n,r,m,0,yt),e.closePath();break;case"triangle":c=i?i/2:m,e.moveTo(n+Math.sin(b)*c,r-Math.cos(b)*m),b+=Tb,e.lineTo(n+Math.sin(b)*c,r-Math.cos(b)*m),b+=Tb,e.lineTo(n+Math.sin(b)*c,r-Math.cos(b)*m),e.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(b+oa)*l,p=Math.cos(b+oa)*(i?i/2-u:l),s=Math.sin(b+oa)*l,h=Math.sin(b+oa)*(i?i/2-u:l),e.arc(n-p,r-s,u,b-it,b-Lt),e.arc(n+h,r-o,u,b-Lt,b),e.arc(n+p,r+s,u,b,b+Lt),e.arc(n-h,r+o,u,b+Lt,b+it),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*m,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}b+=oa;case"rectRot":p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+h,r-o),e.lineTo(n+p,r+s),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":b+=oa;case"cross":p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+p,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+p,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),b+=oa,p=Math.cos(b)*(i?i/2:m),o=Math.cos(b)*m,s=Math.sin(b)*m,h=Math.sin(b)*(i?i/2:m),e.moveTo(n-p,r-s),e.lineTo(n+p,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(b)*m,s=Math.sin(b)*m,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(b)*(i?i/2:m),r+Math.sin(b)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Qs(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function dd(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fd(e){e.restore()}function JL(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const a=(t.x+n.x)/2;e.lineTo(a,t.y),e.lineTo(a,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function qL(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function QL(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),et(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function eV(e,t,n,r,i){if(i.strikethrough||i.underline){const a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,l=n-a.actualBoundingBoxAscent,u=n+a.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,c),e.lineTo(s,c),e.stroke()}}function tV(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function el(e,t,n,r,i,a={}){const o=Bt(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,QL(e,a),l=0;l<o.length;++l)u=o[l],a.backdrop&&tV(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),et(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(u,n,r,a.maxWidth)),e.fillText(u,n,r,a.maxWidth),eV(e,n,r,u,a),r+=Number(i.lineHeight);e.restore()}function Cc(e,t){const{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*it,it,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,it,Lt,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,Lt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Lt,!0),e.lineTo(n+o.topLeft,r)}const nV=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rV=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function iV(e,t){const n=(""+e).match(nV);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const aV=e=>+e||0;function Pp(e,t){const n={},r=je(t),i=r?Object.keys(t):t,a=je(e)?r?o=>Me(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=aV(a(o));return n}function lw(e){return Pp(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Eo(e){return Pp(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ar(e){const t=lw(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function pn(e,t){e=e||{},t=t||_t.font;let n=Me(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Me(e.style,t.style);r&&!(""+r).match(rV)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Me(e.family,t.family),lineHeight:iV(Me(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Me(e.weight,t.weight),string:""};return i.string=ZL(i),i}function iu(e,t,n,r){let i,a,o;for(i=0,a=e.length;i<a;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function oV(e,t,n){const{min:r,max:i}=e,a=qS(t,(i-r)/2),o=(s,l)=>n&&s===0?0:s+l;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function ja(e,t){return Object.assign(Object.create(e),t)}function $p(e,t=[""],n,r,i=()=>e[0]){const a=n||e;typeof r>"u"&&(r=fw("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:s=>$p([s,...e],t,a,r)};return new Proxy(o,{deleteProperty(s,l){return delete s[l],delete s._keys,delete e[0][l],!0},get(s,l){return cw(s,l,()=>gV(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return Lb(s).includes(l)},ownKeys(s){return Lb(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function Po(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:uw(e,r),setContext:a=>Po(e,a,n,r),override:a=>Po(e.override(a),t,n,r)};return new Proxy(i,{deleteProperty(a,o){return delete a[o],delete e[o],!0},get(a,o,s){return cw(a,o,()=>lV(a,o,s))},getOwnPropertyDescriptor(a,o){return a._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(a,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(a,o,s){return e[o]=s,delete a[o],!0}})}function uw(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ki(n)?n:()=>n,isIndexable:Ki(r)?r:()=>r}}const sV=(e,t)=>e?e+Tp(t):t,Fp=(e,t)=>je(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function cw(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function lV(e,t,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e;let s=r[t];return Ki(s)&&o.isScriptable(t)&&(s=uV(t,s,e,n)),Bt(s)&&s.length&&(s=cV(t,s,e,o.isIndexable)),Fp(t,s)&&(s=Po(s,i,a&&a[t],o)),s}function uV(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e);let l=t(a,o||r);return s.delete(e),Fp(e,l)&&(l=Np(i._scopes,i,e,l)),l}function cV(e,t,n,r){const{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(typeof a.index<"u"&&r(e))return t[a.index%t.length];if(je(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const p=Np(u,i,e,c);t.push(Po(p,a,o&&o[e],s))}}return t}function dw(e,t,n){return Ki(e)?e(t,n):e}const dV=(e,t)=>e===!0?t:typeof e=="string"?Fa(t,e):void 0;function fV(e,t,n,r,i){for(const a of t){const o=dV(n,a);if(o){e.add(o);const s=dw(o._fallback,n,i);if(typeof s<"u"&&s!==n&&s!==r)return s}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Np(e,t,n,r){const i=t._rootScopes,a=dw(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let l=Ob(s,o,n,a||n,r);return l===null||typeof a<"u"&&a!==n&&(l=Ob(s,o,a,l,r),l===null)?!1:$p(Array.from(s),[""],i,a,()=>hV(t,n,r))}function Ob(e,t,n,r,i){for(;n;)n=fV(e,t,n,r,i);return n}function hV(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Bt(i)&&je(n)?n:i||{}}function gV(e,t,n,r){let i;for(const a of t)if(i=fw(sV(a,e),n),typeof i<"u")return Fp(e,i)?Np(n,r,e,i):i}function fw(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function Lb(e){let t=e._keys;return t||(t=e._keys=pV(e._scopes)),t}function pV(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}const mV=Number.EPSILON||1e-14,$o=(e,t)=>t<e.length&&!e[t].skip&&e[t],hw=e=>e==="x"?"y":"x";function vV(e,t,n,r){const i=e.skip?t:e,a=t,o=n.skip?t:n,s=T0(a,i),l=T0(o,a);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const p=r*u,h=r*c;return{previous:{x:a.x-p*(o.x-i.x),y:a.y-p*(o.y-i.y)},next:{x:a.x+h*(o.x-i.x),y:a.y+h*(o.y-i.y)}}}function bV(e,t,n){const r=e.length;let i,a,o,s,l,u=$o(e,0);for(let c=0;c<r-1;++c)if(l=u,u=$o(e,c+1),!(!l||!u)){if(xs(t[c],0,mV)){n[c]=n[c+1]=0;continue}i=n[c]/t[c],a=n[c+1]/t[c],s=Math.pow(i,2)+Math.pow(a,2),!(s<=9)&&(o=3/Math.sqrt(s),n[c]=i*o*t[c],n[c+1]=a*o*t[c])}}function yV(e,t,n="x"){const r=hw(n),i=e.length;let a,o,s,l=$o(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=$o(e,u+1),!s)continue;const c=s[n],p=s[r];o&&(a=(c-o[n])/3,s[`cp1${n}`]=c-a,s[`cp1${r}`]=p-a*t[u]),l&&(a=(l[n]-c)/3,s[`cp2${n}`]=c+a,s[`cp2${r}`]=p+a*t[u])}}function xV(e,t="x"){const n=hw(t),r=e.length,i=Array(r).fill(0),a=Array(r);let o,s,l,u=$o(e,0);for(o=0;o<r;++o)if(s=l,l=u,u=$o(e,o+1),!!l){if(u){const c=u[t]-l[t];i[o]=c!==0?(u[n]-l[n])/c:0}a[o]=s?u?Hr(i[o-1])!==Hr(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}bV(e,i,a),yV(e,a,t)}function au(e,t,n){return Math.max(Math.min(e,n),t)}function CV(e,t){let n,r,i,a,o,s=Qs(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&Qs(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=au(i.cp1x,t.left,t.right),i.cp1y=au(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=au(i.cp2x,t.left,t.right),i.cp2y=au(i.cp2y,t.top,t.bottom)))}function EV(e,t,n,r,i){let a,o,s,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")xV(e,i);else{let u=r?e[e.length-1]:e[0];for(a=0,o=e.length;a<o;++a)s=e[a],l=vV(u,s,e[Math.min(a+1,o-(r?0:1))%o],t.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,u=s}t.capBezierPoints&&CV(e,n)}function Mp(){return typeof window<"u"&&typeof document<"u"}function Op(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ec(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const hd=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function SV(e,t){return hd(e).getPropertyValue(t)}const wV=["top","right","bottom","left"];function Ca(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=wV[i];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const IV=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function _V(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r;let o=!1,s,l;if(IV(i,a,e.target))s=i,l=a;else{const u=t.getBoundingClientRect();s=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:s,y:l,box:o}}function ca(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=hd(n),a=i.boxSizing==="border-box",o=Ca(i,"padding"),s=Ca(i,"border","width"),{x:l,y:u,box:c}=_V(e,n),p=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:d,height:v}=t;return a&&(d-=o.width+s.width,v-=o.height+s.height),{x:Math.round((l-p)/d*n.width/r),y:Math.round((u-h)/v*n.height/r)}}function DV(e,t,n){let r,i;if(t===void 0||n===void 0){const a=e&&Op(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{const o=a.getBoundingClientRect(),s=hd(a),l=Ca(s,"border","width"),u=Ca(s,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Ec(s.maxWidth,a,"clientWidth"),i=Ec(s.maxHeight,a,"clientHeight")}}return{width:t,height:n,maxWidth:r||xc,maxHeight:i||xc}}const ou=e=>Math.round(e*10)/10;function TV(e,t,n,r){const i=hd(e),a=Ca(i,"margin"),o=Ec(i.maxWidth,e,"clientWidth")||xc,s=Ec(i.maxHeight,e,"clientHeight")||xc,l=DV(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=Ca(i,"border","width"),d=Ca(i,"padding");u-=d.width+h.width,c-=d.height+h.height}return u=Math.max(0,u-a.width),c=Math.max(0,r?u/r:c-a.height),u=ou(Math.min(u,o,l.maxWidth)),c=ou(Math.min(c,s,l.maxHeight)),u&&!c&&(c=ou(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=ou(Math.floor(c*r))),{width:u,height:c}}function Vb(e,t,n){const r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const AV=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Mp()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Hb(e,t){const n=SV(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function da(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function RV(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function BV(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=da(e,i,n),s=da(i,a,n),l=da(a,t,n),u=da(o,s,n),c=da(s,l,n);return da(u,c,n)}const kV=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},PV=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function So(e,t,n){return e?kV(t,n):PV()}function gw(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function pw(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function mw(e){return e==="angle"?{between:qs,compare:kL,normalize:Nn}:{between:ci,compare:(t,n)=>t-n,normalize:t=>t}}function jb({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function $V(e,t,n){const{property:r,start:i,end:a}=n,{between:o,normalize:s}=mw(r),l=t.length;let{start:u,end:c,loop:p}=e,h,d;if(p){for(u+=l,c+=l,h=0,d=l;h<d&&o(s(t[u%l][r]),i,a);++h)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:p,style:e.style}}function vw(e,t,n){if(!n)return[e];const{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:l,normalize:u}=mw(r),{start:c,end:p,loop:h,style:d}=$V(e,t,n),v=[];let m=!1,b=null,f,y,C;const S=()=>l(i,C,f)&&s(i,C)!==0,w=()=>s(a,f)===0||l(a,C,f),E=()=>m||S(),x=()=>!m||w();for(let g=c,I=c;g<=p;++g)y=t[g%o],!y.skip&&(f=u(y[r]),f!==C&&(m=l(f,i,a),b===null&&E()&&(b=s(f,i)===0?g:I),b!==null&&x()&&(v.push(jb({start:b,end:g,loop:h,count:o,style:d})),b=null),I=g,C=f));return b!==null&&v.push(jb({start:b,end:p,loop:h,count:o,style:d})),v}function bw(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const a=vw(r[i],e.points,t);a.length&&n.push(...a)}return n}function FV(e,t,n,r){let i=0,a=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(a+=i);a>i&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function NV(e,t,n,r){const i=e.length,a=[];let o=t,s=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%i];u.skip||u.stop?s.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=o=u.stop?l:null):(o=l,s.skip&&(t=l)),s=u}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function MV(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const a=!!e._loop,{start:o,end:s}=FV(n,i,a,r);if(r===!0)return zb(e,[{start:o,end:s,loop:a}],n,t);const l=s<o?s+i:s,u=!!e._fullLoop&&o===0&&s===i-1;return zb(e,NV(n,o,l,u),n,t)}function zb(e,t,n,r){return!r||!r.setContext||!n?t:OV(e,t,n,r)}function OV(e,t,n,r){const i=e._chart.getContext(),a=Gb(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=a,p=t[0].start,h=p;function d(v,m,b,f){const y=s?-1:1;if(v!==m){for(v+=l;n[v%l].skip;)v-=y;for(;n[m%l].skip;)m+=y;v%l!==m%l&&(u.push({start:v%l,end:m%l,loop:b,style:f}),c=f,p=m%l)}}for(const v of t){p=s?p:v.start;let m=n[p%l],b;for(h=p+1;h<=v.end;h++){const f=n[h%l];b=Gb(r.setContext(ja(i,{type:"segment",p0:m,p1:f,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),LV(b,c)&&d(p,h-1,v.loop,c),m=f,c=b}p<h-1&&d(p,h-1,v.loop,c)}return u}function Gb(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function LV(e,t){if(!t)return!1;const n=[],r=function(i,a){return Bp(a)?(n.includes(a)||n.push(a),n.indexOf(a)):a};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function su(e,t,n){return e.options.clip?e[n]:t[n]}function VV(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(r,t,"top"),bottom:su(r,t,"bottom")}:t}function yw(e,t){const n=t._clip;if(n.disabled)return!1;const r=VV(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
175
175
  * Chart.js v4.5.0
176
176
  * https://www.chartjs.org
177
177
  * (c) 2025 Chart.js Contributors
178
178
  * Released under the MIT License
179
- */class HV{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const a=n.listeners[i],o=n.duration;a.forEach(s=>s({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=iw.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const a=r.items;let o=a.length-1,s=!1,l;for(;o>=0;--o)l=a[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(a[o]=a[a.length-1],a.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=a.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ti=new HV;const Wb="transparent",jV={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=$b(e||Wb),i=r.valid&&$b(t||Wb);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class zV{constructor(t,n,r,i){const a=n[r];i=iu([t.to,i,a,t.from]);const o=iu([t.from,a,i]);this._active=!0,this._fn=t.fn||jV[t.type||typeof o],this._easing=Cs[t.easing]||Cs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],a=r-this._start,o=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=iu([t.to,n,i,t.from]),this._from=iu([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,a=this._from,o=this._loop,s=this._to;let l;if(this._active=a!==s&&(o||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=a;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class xw{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!je(t))return;const n=Object.keys(_t.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!je(a))return;const o={};for(const s of n)o[s]=a[s];(Bt(a.properties)&&a.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,o)})})}_animateOptions(t,n){const r=n.options,i=WV(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&GV(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,n){const r=this._properties,i=[],a=t.$animations||(t.$animations={}),o=Object.keys(n),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let p=a[u];const h=r.get(u);if(p)if(h&&p.active()){p.update(h,c,s);continue}else p.cancel();if(!h||!h.duration){t[u]=c;continue}a[u]=p=new zV(h,t,u,c),i.push(p)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return ti.add(this._chart,r),!0}}function GV(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=e[r[i]];a&&a.active()&&n.push(a.wait())}return Promise.all(n)}function WV(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Ub(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function UV(e,t,n){if(n===!1)return!1;const r=Ub(e,n),i=Ub(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function XV(e){let t,n,r,i;return je(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Cw(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Xb(e,t,n,r={}){const i=e.keys,a=r.mode==="single";let o,s,l,u;if(t===null)return;let c=!1;for(o=0,s=i.length;o<s;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],pn(u)&&(a||t===0||Hr(t)===Hr(u))&&(t+=u)}return!c&&!r.all?0:t}function YV(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",a=r.axis==="x"?"x":"y",o=Object.keys(e),s=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],s[l]={[i]:c,[a]:e[c]};return s}function ih(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function KV(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function ZV(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function JV(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Yb(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=e[i.index];if(n&&a>0||!n&&a<0)return i.index}return null}function Kb(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:s}=r,l=a.axis,u=o.axis,c=KV(a,o,r),p=t.length;let h;for(let d=0;d<p;++d){const v=t[d],{[l]:m,[u]:b}=v,f=v._stacks||(v._stacks={});h=f[u]=JV(i,c,m),h[s]=b,h._top=Yb(h,o,!0,r.type),h._bottom=Yb(h,o,!1,r.type);const y=h._visualValues||(h._visualValues={});y[s]=b}}function ah(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function qV(e,t){return ja(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function QV(e,t,n){return ja(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Jo(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const a=i._stacks;if(!a||a[r]===void 0||a[r][n]===void 0)return;delete a[r][n],a[r]._visualValues!==void 0&&a[r]._visualValues[n]!==void 0&&delete a[r]._visualValues[n]}}}const oh=e=>e==="reset"||e==="none",Zb=(e,t)=>t?e:Object.assign({},e),eH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Cw(n,!0),values:null};class Ea{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ih(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Jo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(p,h,d,v)=>p==="x"?h:p==="r"?v:d,a=n.xAxisID=Me(r.xAxisID,ah(t,"x")),o=n.yAxisID=Me(r.yAxisID,ah(t,"y")),s=n.rAxisID=Me(r.rAxisID,ah(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,a,o,s),c=n.vAxisID=i(l,o,a,s);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bb(this._data,this),t._stacked&&Jo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(je(n)){const i=this._cachedMeta;this._data=YV(n,i)}else if(r!==n){if(r){Bb(r,this);const i=this._cachedMeta;Jo(i),i._parsed=[]}n&&Object.isExtensible(n)&&NL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const a=n._stacked;n._stacked=ih(n.vScale,n),n.stack!==r.stack&&(i=!0,Jo(n),n.stack=r.stack),this._resyncElements(t),(i||a!==n._stacked)&&(Kb(this,n._parsed),n._stacked=ih(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:a,_stacked:o}=r,s=a.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,p,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{Bt(i[t])?h=this.parseArrayData(r,i,t,n):je(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const d=()=>p[s]===null||u&&p[s]<u[s];for(c=0;c<n;++c)r._parsed[c+t]=p=h[c],l&&(d()&&(l=!1),u=p);r._sorted=l}o&&Kb(this,h)}parsePrimitiveData(t,n,r,i){const{iScale:a,vScale:o}=t,s=a.axis,l=o.axis,u=a.getLabels(),c=a===o,p=new Array(i);let h,d,v;for(h=0,d=i;h<d;++h)v=h+r,p[h]={[s]:c||a.parse(u[v],v),[l]:o.parse(n[v],v)};return p}parseArrayData(t,n,r,i){const{xScale:a,yScale:o}=t,s=new Array(i);let l,u,c,p;for(l=0,u=i;l<u;++l)c=l+r,p=n[c],s[l]={x:a.parse(p[0],c),y:o.parse(p[1],c)};return s}parseObjectData(t,n,r,i){const{xScale:a,yScale:o}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,p,h,d;for(c=0,p=i;c<p;++c)h=c+r,d=n[h],u[c]={x:a.parse(Fa(d,s),h),y:o.parse(Fa(d,l),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,a=this._cachedMeta,o=n[t.axis],s={keys:Cw(i,!0),values:n._stacks[t.axis]._visualValues};return Xb(s,o,a.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const a=r[n.axis];let o=a===null?NaN:a;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,o=Xb(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,o=i.length,s=this._getOtherScale(t),l=eH(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:p}=ZV(s);let h,d;function v(){d=i[h];const m=d[s.axis];return!pn(d[t.axis])||c>m||p<m}for(h=0;h<o&&!(!v()&&(this.updateRangeFromParsed(u,t,d,l),a));++h);if(a){for(h=o-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(u,t,d,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,a,o;for(i=0,a=n.length;i<a;++i)o=n[i][t.axis],pn(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=XV(Me(this.options.clip,UV(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],a=n.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||i.length-s,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,a,s,l),c=s;c<s+l;++c){const p=i[c];p.hidden||(p.active&&u?o.push(p):p.draw(t,a))}for(c=0;c<o.length;++c)o[c].draw(t,a)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];a=o.$context||(o.$context=QV(this.getContext(),t,o)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=qV(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=r,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",a=this._cachedDataOpts,o=t+"-"+n,s=a[o],l=this.enableOptionSharing&&Zs(r);if(s)return Zb(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),p=i?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),c),d=Object.keys(_t.elements[t]),v=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(h,d,v,p);return m.$shared&&(m.$shared=l,a[o]=Object.freeze(Zb(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,a=this._cachedDataOpts,o=`animation-${n}`,s=a[o];if(s)return s;let l;if(i.options.animation!==!1){const c=this.chart.config,p=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),p);l=c.createResolver(h,this.getContext(t,r,n))}const u=new xw(i,l&&l.animations);return l&&l._cacheable&&(a[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||oh(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,a=this.getSharedOptions(r),o=this.includeOptions(n,a)||a!==i;return this.updateSharedOptions(a,n,r),{sharedOptions:a,includeOptions:o}}updateElement(t,n,r,i){oh(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!oh(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const a=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const i=r.length,a=n.length,o=Math.min(a,i);o&&this.parse(0,o),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,n,r=!0){const i=this._cachedMeta,a=i.data,o=t+n;let s;const l=u=>{for(u.length+=n,s=u.length-1;s>=o;s--)u[s]=u[s-n]};for(l(a),s=t;s<o;++s)a[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(a,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Jo(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ce(Ea,"defaults",{}),Ce(Ea,"datasetElementType",null),Ce(Ea,"dataElementType",null);function tH(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,a=n.length;i<a;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=rw(r.sort((i,a)=>i-a))}return e._cache.$bar}function nH(e){const t=e.iScale,n=tH(t,e.type);let r=t._length,i,a,o,s;const l=()=>{o===32767||o===-32768||(Zs(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),l();return r}function rH(e,t,n,r){const i=n.barThickness;let a,o;return Qe(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function iH(e,t,n,r){const i=t.pixels,a=i[e];let o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);const u=a-(a-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/r,ratio:n.barPercentage,start:u}}function aH(e,t,n,r){const i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a);let l=o,u=s;Math.abs(o)>Math.abs(s)&&(l=s,u=o),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:i,end:a,min:o,max:s}}function Ew(e,t,n,r){return Bt(e)?aH(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Jb(e,t,n,r){const i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,l=[];let u,c,p,h;for(u=n,c=n+r;u<c;++u)h=t[u],p={},p[i.axis]=s||i.parse(o[u],u),l.push(Ew(h,p,a,u));return l}function sh(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function oH(e,t,n){return e!==0?Hr(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function sH(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",a="start"):(i="start",a="end"),{start:n,end:r,reverse:t,top:i,bottom:a}}function lH(e,t,n,r){let i=t.borderSkipped;const a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:s,reverse:l,top:u,bottom:c}=sH(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(a[qb(c,o,s,l)]=!0,i=u)),a[qb(i,o,s,l)]=!0,e.borderSkipped=a}function qb(e,t,n,r){return r?(e=uH(e,t,n),e=Qb(e,n,t)):e=Qb(e,t,n),e}function uH(e,t,n){return e===t?n:e===n?t:e}function Qb(e,t,n){return e==="start"?t:e==="end"?n:e}function cH(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Bu extends Ea{parsePrimitiveData(t,n,r,i){return Jb(t,n,r,i)}parseArrayData(t,n,r,i){return Jb(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:a,vScale:o}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=a.axis==="x"?s:l,c=o.axis==="x"?s:l,p=[];let h,d,v,m;for(h=r,d=r+i;h<d;++h)m=n[h],v={},v[a.axis]=a.parse(Fa(m,u),h),p.push(Ew(Fa(m,c),v,o,h));return p}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const a=r._custom;a&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,a=this.getParsed(t),o=a._custom,s=sh(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(a[i.axis]);return{label:""+r.getLabelForValue(a[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const a=i==="reset",{index:o,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),u=s.isHorizontal(),c=this._getRuler(),{sharedOptions:p,includeOptions:h}=this._getSharedOptions(n,i);for(let d=n;d<n+r;d++){const v=this.getParsed(d),m=a||Qe(v[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(d),b=this._calculateBarIndexPixels(d,c),f=(v._stacks||{})[s.axis],y={horizontal:u,base:m.base,enableBorderRadius:!f||sh(v._custom)||o===f._top||o===f._bottom,x:u?m.head:b.center,y:u?b.center:m.head,height:u?b.size:Math.abs(m.size),width:u?Math.abs(m.size):b.size};h&&(y.options=p||this.resolveDataElementOptions(d,t[d].active?"active":i));const C=y.options||t[d].options;lH(y,C,f,o),cH(y,C,c.ratio),this.updateElement(t[d],d,y,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),a=r.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],u=c=>{const p=c._parsed.find(d=>d[r.axis]===l),h=p&&p[c.vScale.axis];if(Qe(h)||isNaN(h))return!0};for(const c of i)if(!(n!==void 0&&u(c))&&((a===!1||o.indexOf(c.stack)===-1||a===void 0&&c.stack===void 0)&&o.push(c.stack),c.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Me(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),a=n!==void 0?i.indexOf(n):-1;return a===-1?i.length-1:a}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let a,o;for(a=0,o=n.data.length;a<o;++a)i.push(r.getPixelForValue(this.getParsed(a)[r.axis],a));const s=t.barThickness;return{min:s||nH(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:a,minBarLength:o}}=this,s=a||0,l=this.getParsed(t),u=l._custom,c=sh(u);let p=l[n.axis],h=0,d=r?this.applyStack(n,l,r):p,v,m;d!==p&&(h=d-p,d=p),c&&(p=u.barStart,d=u.barEnd-u.barStart,p!==0&&Hr(p)!==Hr(u.barEnd)&&(h=0),h+=p);const b=!Qe(a)&&!c?a:h;let f=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(h+d):v=f,m=v-f,Math.abs(m)<o){m=oH(m,n,s)*o,p===s&&(f-=m/2);const y=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),S=Math.min(y,C),w=Math.max(y,C);f=Math.max(Math.min(f,w),S),v=f+m,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(f))}if(f===n.getPixelForValue(s)){const y=Hr(m)*n.getLineWidthForValue(s)/2;f+=y,m-=y}return{size:m,base:f,head:v,center:v+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,a=i.skipNull,o=Me(i.maxBarThickness,1/0);let s,l;const u=this._getAxisCount();if(n.grouped){const c=a?this._getStackCount(t):n.stackCount,p=i.barThickness==="flex"?iH(t,n,i,c*u):rH(t,n,i,c*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(Me(h,this.getFirstScaleIdForIndexAxis())),v=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+d;s=p.start+p.chunk*v+p.chunk/2,l=Math.min(o,p.chunk*p.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let a=0;for(;a<i;++a)this.getParsed(a)[n.axis]!==null&&!r[a].hidden&&r[a].draw(this._ctx)}}Ce(Bu,"id","bar"),Ce(Bu,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ce(Bu,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function dH(e,t,n){let r=1,i=1,a=0,o=0;if(t<yt){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),p=Math.cos(l),h=Math.sin(l),d=(C,S,w)=>qs(C,s,l,!0)?1:Math.max(S,S*n,w,w*n),v=(C,S,w)=>qs(C,s,l,!0)?-1:Math.min(S,S*n,w,w*n),m=d(0,u,p),b=d(Lt,c,h),f=v(it,u,p),y=v(it+Lt,c,h);r=(m-f)/2,i=(b-y)/2,a=-(m+f)/2,o=-(b+y)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class cs extends Ea{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let a=l=>+r[l];if(je(r[t])){const{key:l="value"}=this._parsing;a=u=>+Fa(r[u],l)}let o,s;for(o=t,s=t+n;o<s;++o)i._parsed[o]=a(o)}}_getRotation(){return ui(this.options.rotation-90)}_getCircumference(){return ui(this.options.circumference)}_getRotationExtents(){let t=yt,n=-yt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,a=i._getRotation(),o=i._getCircumference();t=Math.min(t,a),n=Math.max(n,a+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,a=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(yL(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:p}=this._getRotationExtents(),{ratioX:h,ratioY:d,offsetX:v,offsetY:m}=dH(p,c,l),b=(r.width-o)/h,f=(r.height-o)/d,y=Math.max(Math.min(b,f)/2,0),C=qS(this.options.radius,y),S=Math.max(C*l,0),w=(C-S)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=m*C,i.total=this.calculateTotal(),this.outerRadius=C-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(a,0,a.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,a=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*a/yt)}updateElements(t,n,r,i){const a=i==="reset",o=this.chart,s=o.chartArea,u=o.options.animation,c=(s.left+s.right)/2,p=(s.top+s.bottom)/2,h=a&&u.animateScale,d=h?0:this.innerRadius,v=h?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,i);let f=this._getRotation(),y;for(y=0;y<n;++y)f+=this._circumference(y,a);for(y=n;y<n+r;++y){const C=this._circumference(y,a),S=t[y],w={x:c+this.offsetX,y:p+this.offsetY,startAngle:f,endAngle:f+C,circumference:C,outerRadius:v,innerRadius:d};b&&(w.options=m||this.resolveDataElementOptions(y,S.active?"active":i)),f+=C,this.updateElement(S,y,w,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?yt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=kp(n._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,a,o,s,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,s=o.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const a=this.resolveDataElementOptions(r);n=Math.max(n,a.offset||0,a.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Me(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ce(cs,"id","doughnut"),Ce(cs,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Ce(cs,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ce(cs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((a,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class ku extends Ea{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:a}=n,o=this.chart._animationsDisabled;let{start:s,count:l}=LL(n,i,o);this._drawStart=s,this._drawCount=l,VL(n)&&(s=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,s,l,t)}updateElements(t,n,r,i){const a=i==="reset",{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:p}=this._getSharedOptions(n,i),h=o.axis,d=s.axis,{spanGaps:v,segment:m}=this.options,b=Js(v)?v:Number.POSITIVE_INFINITY,f=this.chart._animationsDisabled||a||i==="none",y=n+r,C=t.length;let S=n>0&&this.getParsed(n-1);for(let w=0;w<C;++w){const E=t[w],x=f?E:{};if(w<n||w>=y){x.skip=!0;continue}const g=this.getParsed(w),I=Qe(g[d]),A=x[h]=o.getPixelForValue(g[h],w),_=x[d]=a||I?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,g,l):g[d],w);x.skip=isNaN(A)||isNaN(_)||I,x.stop=w>0&&Math.abs(g[h]-S[h])>b,m&&(x.parsed=g,x.raw=u.data[w]),p&&(x.options=c||this.resolveDataElementOptions(w,E.active?"active":i)),f||this.updateElement(E,w,x,i),S=g}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const a=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,a,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ce(ku,"id","line"),Ce(ku,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ce(ku,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function la(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lp{constructor(t){Ce(this,"options");this.options=t||{}}static override(t){Object.assign(Lp.prototype,t)}init(){}formats(){return la()}parse(){return la()}format(){return la()}add(){return la()}diff(){return la()}startOf(){return la()}endOf(){return la()}}var fH={_date:Lp};function hH(e,t,n,r){const{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const u=s._reversePixels?$L:ba;if(r){if(i._sharedOptions){const c=a[0],p=typeof c.getRange=="function"&&c.getRange(t);if(p){const h=u(a,t,n-p),d=u(a,t,n+p);return{lo:h.lo,hi:d.hi}}}}else{const c=u(a,t,n);if(l){const{vScale:p}=i._cachedMeta,{_parsed:h}=e,d=h.slice(0,c.lo+1).reverse().findIndex(m=>!Qe(m[p.axis]));c.lo-=Math.max(0,d);const v=h.slice(c.hi).findIndex(m=>!Qe(m[p.axis]));c.hi+=Math.max(0,v)}return c}}return{lo:0,hi:a.length-1}}function gd(e,t,n,r,i){const a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let s=0,l=a.length;s<l;++s){const{index:u,data:c}=a[s],{lo:p,hi:h}=hH(a[s],t,o,i);for(let d=p;d<=h;++d){const v=c[d];v.skip||r(v,u,d)}}}function gH(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function lh(e,t,n,r,i){const a=[];return!i&&!e.isPointInArea(t)||gd(e,n,t,function(s,l,u){!i&&!Qs(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&a.push({element:s,datasetIndex:l,index:u})},!0),a}function pH(e,t,n,r){let i=[];function a(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:p}=tw(o,{x:t.x,y:t.y});qs(p,u,c)&&i.push({element:o,datasetIndex:s,index:l})}return gd(e,n,t,a),i}function mH(e,t,n,r,i,a){let o=[];const s=gH(n);let l=Number.POSITIVE_INFINITY;function u(c,p,h){const d=c.inRange(t.x,t.y,i);if(r&&!d)return;const v=c.getCenterPoint(i);if(!(!!a||e.isPointInArea(v))&&!d)return;const b=s(t,v);b<l?(o=[{element:c,datasetIndex:p,index:h}],l=b):b===l&&o.push({element:c,datasetIndex:p,index:h})}return gd(e,n,t,u),o}function uh(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n==="r"&&!r?pH(e,t,n,i):mH(e,t,n,r,i,a)}function ey(e,t,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let s=!1;return gd(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(a.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:a}var vH={modes:{index(e,t,n,r){const i=ca(t,e),a=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?lh(e,i,a,r,o):uh(e,i,a,!1,r,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,p=u.data[c];p&&!p.skip&&l.push({element:p,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=ca(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?lh(e,i,a,r,o):uh(e,i,a,!1,r,o);if(s.length>0){const l=s[0].datasetIndex,u=e.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(e,t,n,r){const i=ca(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return lh(e,i,a,r,o)},nearest(e,t,n,r){const i=ca(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return uh(e,i,a,n.intersect,r,o)},x(e,t,n,r){const i=ca(t,e);return ey(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ca(t,e);return ey(e,i,"y",n.intersect,r)}}};const Sw=["left","top","right","bottom"];function qo(e,t){return e.filter(n=>n.pos===t)}function ty(e,t){return e.filter(n=>Sw.indexOf(n.pos)===-1&&n.box.axis===t)}function Qo(e,t){return e.sort((n,r)=>{const i=t?r:n,a=t?n:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function bH(e){const t=[];let n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function yH(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!Sw.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=a}return t}function xH(e,t){const n=yH(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];const{fullSize:l}=s.box,u=n[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:l&&t.availableHeight)}return n}function CH(e){const t=bH(e),n=Qo(t.filter(u=>u.box.fullSize),!0),r=Qo(qo(t,"left"),!0),i=Qo(qo(t,"right")),a=Qo(qo(t,"top"),!0),o=Qo(qo(t,"bottom")),s=ty(t,"x"),l=ty(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:qo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(o).concat(s)}}function ny(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function ww(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function EH(e,t,n,r){const{pos:i,box:a}=n,o=e.maxPadding;if(!je(i)){n.size&&(e[i]-=n.size);const p=r[n.stack]||{size:0,count:1};p.size=Math.max(p.size,n.horizontal?a.height:a.width),n.size=p.size/p.count,e[i]+=n.size}a.getPadding&&ww(o,a.getPadding());const s=Math.max(0,t.outerWidth-ny(o,e,"left","right")),l=Math.max(0,t.outerHeight-ny(o,e,"top","bottom")),u=s!==e.w,c=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function SH(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function wH(e,t){const n=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{a[o]=Math.max(t[o],n[o])}),a}return r(e?["left","right"]:["top","bottom"])}function ds(e,t,n,r){const i=[];let a,o,s,l,u,c;for(a=0,o=e.length,u=0;a<o;++a){s=e[a],l=s.box,l.update(s.width||t.w,s.height||t.h,wH(s.horizontal,t));const{same:p,other:h}=EH(t,n,s,r);u|=p&&i.length,c=c||h,l.fullSize||i.push(s)}return u&&ds(i,t,n,r)||c}function lu(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ry(e,t,n,r){const i=n.padding;let{x:a,y:o}=t;for(const s of e){const l=s.box,u=r[s.stack]||{placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const p=t.w*c,h=u.size||l.height;Zs(u.start)&&(o=u.start),l.fullSize?lu(l,i.left,o,n.outerWidth-i.right-i.left,h):lu(l,t.left+u.placed,o,p,h),u.start=o,u.placed+=p,o=l.bottom}else{const p=t.h*c,h=u.size||l.width;Zs(u.start)&&(a=u.start),l.fullSize?lu(l,a,i.top,h,n.outerHeight-i.bottom-i.top):lu(l,a,t.top+u.placed,h,p),u.start=a,u.placed+=p,a=l.right}}t.x=a,t.y=o}var rr={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=ar(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=CH(e.boxes),l=s.vertical,u=s.horizontal;rt(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);ww(h,ar(r));const d=Object.assign({maxPadding:h,w:a,h:o,x:i.left,y:i.top},i),v=xH(l.concat(u),p);ds(s.fullSize,d,p,v),ds(l,d,p,v),ds(u,d,p,v)&&ds(l,d,p,v),SH(d),ry(s.leftAndTop,d,p,v),d.x+=d.w,d.y+=d.h,ry(s.rightAndBottom,d,p,v),e.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},rt(s.chartArea,m=>{const b=m.box;Object.assign(b,e.chartArea),b.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}};class Iw{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class IH extends Iw{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pu="$chartjs",_H={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},iy=e=>e===null||e==="";function DH(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Pu]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",iy(i)){const a=Hb(e,"width");a!==void 0&&(e.width=a)}if(iy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const a=Hb(e,"height");a!==void 0&&(e.height=a)}return e}const _w=AV?{passive:!0}:!1;function TH(e,t,n){e&&e.addEventListener(t,n,_w)}function AH(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,_w)}function RH(e,t){const n=_H[e.type]||e.type,{x:r,y:i}=ca(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Sc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function BH(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Sc(s.addedNodes,r),o=o&&!Sc(s.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function kH(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Sc(s.removedNodes,r),o=o&&!Sc(s.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const tl=new Map;let ay=0;function Dw(){const e=window.devicePixelRatio;e!==ay&&(ay=e,tl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function PH(e,t){tl.size||window.addEventListener("resize",Dw),tl.set(e,t)}function $H(e){tl.delete(e),tl.size||window.removeEventListener("resize",Dw)}function FH(e,t,n){const r=e.canvas,i=r&&Op(r);if(!i)return;const a=aw((s,l)=>{const u=i.clientWidth;n(s,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||a(u,c)});return o.observe(i),PH(e,a),o}function ch(e,t,n){n&&n.disconnect(),t==="resize"&&$H(e)}function NH(e,t,n){const r=e.canvas,i=aw(a=>{e.ctx!==null&&n(RH(a,e))},e);return TH(r,t,i),i}class MH extends Iw{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(DH(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Pu])return!1;const r=n[Pu].initial;["height","width"].forEach(a=>{const o=r[a];Qe(o)?n.removeAttribute(a):n.setAttribute(a,o)});const i=r.style||{};return Object.keys(i).forEach(a=>{n.style[a]=i[a]}),n.width=n.width,delete n[Pu],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:BH,detach:kH,resize:FH}[n]||NH;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:ch,detach:ch,resize:ch}[n]||AH)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return TV(t,n,r,i)}isAttached(t){const n=t&&Op(t);return!!(n&&n.isConnected)}}function OH(e){return!Mp()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?IH:MH}var mu;let Ci=(mu=class{constructor(){Ce(this,"x");Ce(this,"y");Ce(this,"active",!1);Ce(this,"options");Ce(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Js(this.x)&&Js(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}},Ce(mu,"defaults",{}),Ce(mu,"defaultRoutes"),mu);function LH(e,t){const n=e.options.ticks,r=VH(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?jH(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>i)return zH(t,u,a,o/i),u;const c=HH(a,t,i);if(o>0){let p,h;const d=o>1?Math.round((l-s)/(o-1)):null;for(uu(t,u,c,Qe(d)?0:s-d,s),p=0,h=o-1;p<h;p++)uu(t,u,c,a[p],a[p+1]);return uu(t,u,c,l,Qe(d)?t.length:l+d),u}return uu(t,u,c),u}function VH(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function HH(e,t,n){const r=GH(e),i=t.length/n;if(!r)return Math.max(i,1);const a=DL(r);for(let o=0,s=a.length-1;o<s;o++){const l=a[o];if(l>i)return l}return Math.max(i,1)}function jH(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function zH(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function uu(e,t,n,r,i){const a=Me(r,0),o=Math.min(Me(i,e.length),e.length);let s=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=a;c<0;)s++,c=Math.round(a+s*n);for(u=Math.max(a,0);u<o;u++)u===c&&(t.push(e[u]),s++,c=Math.round(a+s*n))}function GH(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const WH=e=>e==="left"?"right":e==="right"?"left":e,oy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,sy=(e,t)=>Math.min(t||e,e);function ly(e,t){const n=[],r=e.length/t,i=e.length;let a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function UH(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-a,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<a-s||l>o+s)))return l}function XH(e,t){rt(e,n=>{const r=n.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete n.data[r[a]];r.splice(0,i)}})}function es(e){return e.drawTicks?e.tickLength:0}function uy(e,t){if(!e.display)return 0;const n=gn(e.font,t),r=ar(e.padding);return(Bt(e.text)?e.text.length:1)*n.lineHeight+r.height}function YH(e,t){return ja(e,{scale:t,type:"scale"})}function KH(e,t,n){return ja(e,{tick:n,index:t,type:"tick"})}function ZH(e,t,n){let r=Rp(e);return(n&&t!=="right"||!n&&t==="right")&&(r=WH(r)),r}function JH(e,t,n,r){const{top:i,left:a,bottom:o,right:s,chart:l}=e,{chartArea:u,scales:c}=l;let p=0,h,d,v;const m=o-i,b=s-a;if(e.isHorizontal()){if(d=dn(r,a,s),je(n)){const f=Object.keys(n)[0],y=n[f];v=c[f].getPixelForValue(y)+m-t}else n==="center"?v=(u.bottom+u.top)/2+m-t:v=oy(e,n,t);h=s-a}else{if(je(n)){const f=Object.keys(n)[0],y=n[f];d=c[f].getPixelForValue(y)-b+t}else n==="center"?d=(u.left+u.right)/2-b+t:d=oy(e,n,t);v=dn(r,o,i),p=n==="left"?-Lt:Lt}return{titleX:d,titleY:v,maxWidth:h,rotation:p}}class Wo extends Ci{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=_r(t,Number.POSITIVE_INFINITY),n=_r(n,Number.NEGATIVE_INFINITY),r=_r(r,Number.POSITIVE_INFINITY),i=_r(i,Number.NEGATIVE_INFINITY),{min:_r(t,r),max:_r(n,i),minDefined:pn(t),maxDefined:pn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),o;if(i&&a)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)o=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),a||(r=Math.max(r,o.max));return n=a&&n>r?r:n,r=i&&n>r?n:r,{min:_r(n,_r(r,n)),max:_r(r,_r(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:a,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=oV(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?ly(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=LH(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ft(this.options.afterUpdate,[this])}beforeSetDimensions(){ft(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=ft(n.callback,[a.value,r,t],this)}afterTickToLabelConversion(){ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=sy(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,a=n.maxRotation;let o=i,s,l,u;if(!this._isVisible()||!n.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),p=c.widest.width,h=c.highest.height,d=hn(this.chart.width-p,0,this.maxWidth);s=t.offset?this.maxWidth/r:d/(r-1),p+6>s&&(s=d/(r-(t.offset?.5:1)),l=this.maxHeight-es(t.grid)-n.padding-uy(t.title,this.chart.options.font),u=Math.sqrt(p*p+h*h),o=BL(Math.min(Math.asin(hn((c.highest.height+6)/s,-1,1)),Math.asin(hn(l/u,-1,1))-Math.asin(hn(h/u,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:a}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=uy(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=es(a)+l):(t.height=this.maxHeight,t.width=es(a)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:p,highest:h}=this._getLabelSizes(),d=r.padding*2,v=ui(this.labelRotation),m=Math.cos(v),b=Math.sin(v);if(s){const f=r.mirror?0:b*p.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+f+d)}else{const f=r.mirror?0:m*p.width+b*h.height;t.width=Math.min(this.maxWidth,t.width+f+d)}this._calculatePadding(u,c,b,m)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:a,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;l?u?(h=i*t.width,d=r*n.height):(h=r*t.height,d=i*n.width):a==="start"?d=n.width:a==="end"?h=t.width:a!=="inner"&&(h=t.width/2,d=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((d-p+o)*this.width/(this.width-p),0)}else{let c=n.height/2,p=t.height/2;a==="start"?(c=0,p=t.height):a==="end"&&(c=n.height,p=0),this.paddingTop=c+o,this.paddingBottom=p+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Qe(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=ly(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:a}=this,o=[],s=[],l=Math.floor(n/sy(n,r));let u=0,c=0,p,h,d,v,m,b,f,y,C,S,w;for(p=0;p<n;p+=l){if(v=t[p].label,m=this._resolveTickFontOptions(p),i.font=b=m.string,f=a[b]=a[b]||{data:{},gc:[]},y=m.lineHeight,C=S=0,!Qe(v)&&!Bt(v))C=Nb(i,f.data,f.gc,C,v),S=y;else if(Bt(v))for(h=0,d=v.length;h<d;++h)w=v[h],!Qe(w)&&!Bt(w)&&(C=Nb(i,f.data,f.gc,C,w),S+=y);o.push(C),s.push(S),u=Math.max(C,u),c=Math.max(S,c)}XH(a,n);const E=o.indexOf(u),x=s.indexOf(c),g=I=>({width:o[I]||0,height:s[I]||0});return{first:g(0),last:g(n-1),widest:g(E),highest:g(x),widths:o,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return PL(this._alignToPixels?sa(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=KH(this.getContext(),t,r))}return this.$context||(this.$context=YH(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ui(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),a=this._getLabelSizes(),o=t.autoSkipPadding||0,s=a?a.widest.width+o:0,l=a?a.highest.height+o:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:a,position:o,border:s}=i,l=a.offset,u=this.isHorizontal(),p=this.ticks.length+(l?1:0),h=es(a),d=[],v=s.setContext(this.getContext()),m=v.display?v.width:0,b=m/2,f=function(k){return sa(r,k,m)};let y,C,S,w,E,x,g,I,A,_,T,$;if(o==="top")y=f(this.bottom),x=this.bottom-h,I=y-b,_=f(t.top)+b,$=t.bottom;else if(o==="bottom")y=f(this.top),_=t.top,$=f(t.bottom)-b,x=y+b,I=this.top+h;else if(o==="left")y=f(this.right),E=this.right-h,g=y-b,A=f(t.left)+b,T=t.right;else if(o==="right")y=f(this.left),A=t.left,T=f(t.right)-b,E=y+b,g=this.left+h;else if(n==="x"){if(o==="center")y=f((t.top+t.bottom)/2+.5);else if(je(o)){const k=Object.keys(o)[0],O=o[k];y=f(this.chart.scales[k].getPixelForValue(O))}_=t.top,$=t.bottom,x=y+b,I=x+h}else if(n==="y"){if(o==="center")y=f((t.left+t.right)/2);else if(je(o)){const k=Object.keys(o)[0],O=o[k];y=f(this.chart.scales[k].getPixelForValue(O))}E=y-b,g=E-h,A=t.left,T=t.right}const B=Me(i.ticks.maxTicksLimit,p),P=Math.max(1,Math.ceil(p/B));for(C=0;C<p;C+=P){const k=this.getContext(C),O=a.setContext(k),M=s.setContext(k),G=O.lineWidth,W=O.color,U=M.dash||[],q=M.dashOffset,Q=O.tickWidth,Z=O.tickColor,ee=O.tickBorderDash||[],J=O.tickBorderDashOffset;S=UH(this,C,l),S!==void 0&&(w=sa(r,S,G),u?E=g=A=T=w:x=I=_=$=w,d.push({tx1:E,ty1:x,tx2:g,ty2:I,x1:A,y1:_,x2:T,y2:$,width:G,color:W,borderDash:U,borderDashOffset:q,tickWidth:Q,tickColor:Z,tickBorderDash:ee,tickBorderDashOffset:J}))}return this._ticksLength=p,this._borderValue=y,d}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:a}=r,o=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:p}=a,h=es(r.grid),d=h+c,v=p?-c:d,m=-ui(this.labelRotation),b=[];let f,y,C,S,w,E,x,g,I,A,_,T,$="middle";if(i==="top")E=this.bottom-v,x=this._getXAxisLabelAlignment();else if(i==="bottom")E=this.top+v,x=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(h);x=P.textAlign,w=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(h);x=P.textAlign,w=P.x}else if(n==="x"){if(i==="center")E=(t.top+t.bottom)/2+d;else if(je(i)){const P=Object.keys(i)[0],k=i[P];E=this.chart.scales[P].getPixelForValue(k)+d}x=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-d;else if(je(i)){const P=Object.keys(i)[0],k=i[P];w=this.chart.scales[P].getPixelForValue(k)}x=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?$="top":l==="end"&&($="bottom"));const B=this._getLabelSizes();for(f=0,y=s.length;f<y;++f){C=s[f],S=C.label;const P=a.setContext(this.getContext(f));g=this.getPixelForTick(f)+a.labelOffset,I=this._resolveTickFontOptions(f),A=I.lineHeight,_=Bt(S)?S.length:1;const k=_/2,O=P.color,M=P.textStrokeColor,G=P.textStrokeWidth;let W=x;o?(w=g,x==="inner"&&(f===y-1?W=this.options.reverse?"left":"right":f===0?W=this.options.reverse?"right":"left":W="center"),i==="top"?u==="near"||m!==0?T=-_*A+A/2:u==="center"?T=-B.highest.height/2-k*A+A:T=-B.highest.height+A/2:u==="near"||m!==0?T=A/2:u==="center"?T=B.highest.height/2-k*A:T=B.highest.height-_*A,p&&(T*=-1),m!==0&&!P.showLabelBackdrop&&(w+=A/2*Math.sin(m))):(E=g,T=(1-_)*A/2);let U;if(P.showLabelBackdrop){const q=ar(P.backdropPadding),Q=B.heights[f],Z=B.widths[f];let ee=T-q.top,J=0-q.left;switch($){case"middle":ee-=Q/2;break;case"bottom":ee-=Q;break}switch(x){case"center":J-=Z/2;break;case"right":J-=Z;break;case"inner":f===y-1?J-=Z:f>0&&(J-=Z/2);break}U={left:J,top:ee,width:Z+q.width,height:Q+q.height,color:P.backdropColor}}b.push({label:S,font:I,textOffset:T,options:{rotation:m,color:O,strokeColor:M,strokeWidth:G,textAlign:W,textBaseline:$,translation:[w,E],backdrop:U}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ui(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:a}}=this.options,o=this._getLabelSizes(),s=t+a,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:a,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,a,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(a=>a.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,o;const s=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(a=0,o=i.length;a<o;++a){const l=i[a];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,a=r.setContext(this.getContext()),o=r.display?a.width:0;if(!o)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,p,h;this.isHorizontal()?(u=sa(t,this.left,o)-o/2,c=sa(t,this.right,s)+s/2,p=h=l):(p=sa(t,this.top,o)-o/2,h=sa(t,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(u,p),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&dd(r,i);const a=this.getLabelItems(t);for(const o of a){const s=o.options,l=o.font,u=o.label,c=o.textOffset;el(r,u,0,c,l,s)}i&&fd(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=gn(r.font),o=ar(r.padding),s=r.align;let l=a.lineHeight/2;n==="bottom"||n==="center"||je(n)?(l+=o.bottom,Bt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:p,rotation:h}=JH(this,l,n,s);el(t,r.text,0,0,a,{color:r.color,maxWidth:p,rotation:h,textAlign:ZH(s,n,i),textBaseline:"middle",translation:[u,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Me(t.grid&&t.grid.z,-1),i=Me(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Wo.prototype.draw?[{z:n,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,o;for(a=0,o=n.length;a<o;++a){const s=n[a];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return gn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class cu{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;ej(n)&&(r=this.register(n));const i=this.items,a=t.id,o=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,qH(t,o,r),this.override&&_t.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in _t[i]&&(delete _t[i][r],this.override&&delete Na[r])}}function qH(e,t,n){const r=Ks(Object.create(null),[n?_t.get(n):{},_t.get(t),e.defaults]);_t.set(t,r),e.defaultRoutes&&QH(t,e.defaultRoutes),e.descriptors&&_t.describe(t,e.descriptors)}function QH(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),a=[e].concat(r).join("."),o=t[n].split("."),s=o.pop(),l=o.join(".");_t.route(a,i,l,s)})}function ej(e){return"id"in e&&"defaults"in e}class tj{constructor(){this.controllers=new cu(Ea,"datasets",!0),this.elements=new cu(Ci,"elements"),this.plugins=new cu(Object,"plugins"),this.scales=new cu(Wo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):rt(i,o=>{const s=r||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,n,r){const i=Tp(t);ft(r["before"+i],[],r),n[t](r),ft(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Ar=new tj;class nj{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(a,t,n,r);return n==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const a of t){const o=a.plugin,s=o[r],l=[n,i,a.options];if(ft(s,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Qe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Me(r.options&&r.options.plugins,{}),a=rj(r);return i===!1&&!n?[]:aj(t,a,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(a,o)=>a.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function rj(e){const t={},n=[],r=Object.keys(Ar.plugins.items);for(let a=0;a<r.length;a++)n.push(Ar.getPlugin(r[a]));const i=e.plugins||[];for(let a=0;a<i.length;a++){const o=i[a];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function ij(e,t){return!t&&e===!1?null:e===!0?{}:e}function aj(e,{plugins:t,localIds:n},r,i){const a=[],o=e.getContext();for(const s of t){const l=s.id,u=ij(r[l],i);u!==null&&a.push({plugin:s,options:oj(e.config,{plugin:s,local:n[l]},u,o)})}return a}function oj(e,{plugin:t,local:n},r,i){const a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function B0(e,t){const n=_t.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function sj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function lj(e,t){return e===t?"_index_":"_value_"}function cy(e){if(e==="x"||e==="y"||e==="r")return e}function uj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function k0(e,...t){if(cy(e))return e;for(const n of t){const r=n.axis||uj(n.position)||e.length>1&&cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function dy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function cj(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return dy(e,"x",n[0])||dy(e,"y",n[0])}return{}}function dj(e,t){const n=Na[e.type]||{scales:{}},r=t.scales||{},i=B0(e.type,t),a=Object.create(null);return Object.keys(r).forEach(o=>{const s=r[o];if(!je(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=k0(o,s,cj(o,e),_t.scales[s.type]),u=lj(l,i),c=n.scales||{};a[o]=ys(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||B0(s,t),c=(Na[s]||{}).scales||{};Object.keys(c).forEach(p=>{const h=sj(p,l),d=o[h+"AxisID"]||h;a[d]=a[d]||Object.create(null),ys(a[d],[{axis:h},r[d],c[p]])})}),Object.keys(a).forEach(o=>{const s=a[o];ys(s,[_t.scales[s.type],_t.scale])}),a}function Tw(e){const t=e.options||(e.options={});t.plugins=Me(t.plugins,{}),t.scales=dj(e,t)}function Aw(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function fj(e){return e=e||{},e.data=Aw(e.data),Tw(e),e}const fy=new Map,Rw=new Set;function du(e,t){let n=fy.get(e);return n||(n=t(),fy.set(e,n),Rw.add(n)),n}const ts=(e,t,n)=>{const r=Fa(t,n);r!==void 0&&e.add(r)};class hj{constructor(t){this._config=fj(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Aw(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Tw(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return du(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return du(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return du(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return du(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:a}=this,o=this._cachedScopes(t,r),s=o.get(n);if(s)return s;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(p=>ts(l,t,p))),c.forEach(p=>ts(l,i,p)),c.forEach(p=>ts(l,Na[a]||{},p)),c.forEach(p=>ts(l,_t,p)),c.forEach(p=>ts(l,A0,p))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Rw.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Na[n]||{},_t.datasets[n]||{},{type:n},_t,A0]}resolveNamedOptions(t,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=hy(this._resolverCache,t,i);let l=o;if(pj(o,n)){a.$shared=!1,r=Ki(r)?r():r;const u=this.createResolver(t,r,s);l=Po(o,r,u)}for(const u of n)a[u]=l[u];return a}createResolver(t,n,r=[""],i){const{resolver:a}=hy(this._resolverCache,t,r);return je(n)?Po(a,n,void 0,i):a}}function hy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let a=r.get(i);return a||(a={resolver:$p(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,a)),a}const gj=e=>je(e)&&Object.getOwnPropertyNames(e).some(t=>Ki(e[t]));function pj(e,t){const{isScriptable:n,isIndexable:r}=uw(e);for(const i of t){const a=n(i),o=r(i),s=(o||a)&&e[i];if(a&&(Ki(s)||gj(s))||o&&Bt(s))return!0}return!1}var mj="4.5.0";const vj=["top","bottom","left","right","chartArea"];function gy(e,t){return e==="top"||e==="bottom"||vj.indexOf(e)===-1&&t==="x"}function py(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function my(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ft(n&&n.onComplete,[e],t)}function bj(e){const t=e.chart,n=t.options.animation;ft(n&&n.onProgress,[e],t)}function Bw(e){return Mp()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $u={},vy=e=>{const t=Bw(e);return Object.values($u).filter(n=>n.canvas===t).pop()};function yj(e,t,n){const r=Object.keys(e);for(const i of r){const a=+i;if(a>=t){const o=e[i];delete e[i],(n>0||a>t)&&(e[a+n]=o)}}}function xj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Ai;let za=(Ai=class{static register(...t){Ar.add(...t),by()}static unregister(...t){Ar.remove(...t),by()}constructor(t,n){const r=this.config=new hj(n),i=Bw(t),a=vy(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||OH(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=bL(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new nj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ML(p=>this.update(p),o.resizeDelay||0),this._dataChanges=[],$u[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ti.listen(this,"complete",my),ti.listen(this,"progress",bj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:a}=this;return Qe(t)?n&&a?a:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ar}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Vb(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mb(this.canvas,this.ctx),this}stop(){return ti.stop(this),this}resize(t,n){ti.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,a),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Vb(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),ft(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};rt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,s)=>(o[s]=!1,o),{});let a=[];n&&(a=a.concat(Object.keys(n).map(o=>{const s=n[o],l=k0(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),rt(a,o=>{const s=o.options,l=s.id,u=k0(l,s),c=Me(s.type,o.dtype);(s.position===void 0||gy(s.position,u)!==gy(o.dposition))&&(s.position=o.dposition),i[l]=!0;let p=null;if(l in r&&r[l].type===c)p=r[l];else{const h=Ar.getScale(c);p=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[p.id]=p}p.init(s,t)}),rt(i,(o,s)=>{o||delete r[s]}),rt(r,o=>{rr.configure(this,o,o.options),rr.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(py("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(a=>a===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const a=n[r];let o=this.getDatasetMeta(r);const s=a.type||this.config.type;if(o.type&&o.type!==s&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=s,o.indexAxis=a.indexAxis||B0(s,this.options),o.order=a.order||0,o.index=r,o.label=""+a.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Ar.getController(s),{datasetElementType:u,dataElementType:c}=_t.datasets[s];Object.assign(l,{dataElementType:Ar.getElement(c),datasetElementType:u&&Ar.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){rt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:p}=this.getDatasetMeta(u),h=!i&&a.indexOf(p)===-1;p.buildOrUpdateElements(h),o=Math.max(+p.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||rt(a,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(py("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){rt(this.scales,t=>{rr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Db(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:a}of n){const o=r==="_removeElements"?-a:a;yj(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=a=>new Set(t.filter(o=>o[0]===a).map((o,s)=>s+","+o.splice(1).join(","))),i=r(0);for(let a=1;a<n;a++)if(!Db(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],rt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Ki(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ti.has(this)?this.attached&&!ti.running(this)&&ti.start(this):(this.draw(),my({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,a;for(i=0,a=n.length;i<a;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=yw(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&dd(n,i),t.controller.draw(),i&&fd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Qs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const a=vH.modes[n];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ja(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",a=this.getDatasetMeta(t),o=a.controller._resolveAnimations(void 0,i);Zs(n)?(a.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(a,{visible:r}),this.update(s=>s.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ti.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Mb(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete $u[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(a,o)=>{n.addEventListener(this,a,o),t[a]=o},i=(a,o,s)=>{a.offsetX=o,a.offsetY=s,this._eventHandler(a)};rt(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},a=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",a),r("detach",o)};o=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():o()}unbindEvents(){rt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},rt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let a,o,s,l;for(n==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){o=t[s];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:a,index:o})=>{const s=this.getDatasetMeta(a);if(!s)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:s.data[o],index:o}});!bc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,a=(l,u)=>l.filter(c=>!u.some(p=>c.datasetIndex===p.datasetIndex&&c.index===p.index)),o=a(n,t),s=r?t:a(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:a}=this,o=n,s=this._getActiveElements(t,i,r,o),l=wL(t),u=xj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,ft(a.onHover,[t,s,this],this),l&&ft(a.onClick,[t,s,this],this));const c=!bc(s,i);return(c||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},Ce(Ai,"defaults",_t),Ce(Ai,"instances",$u),Ce(Ai,"overrides",Na),Ce(Ai,"registry",Ar),Ce(Ai,"version",mj),Ce(Ai,"getChart",vy),Ai);function by(){return rt(za.instances,e=>e._plugins.invalidate())}function Cj(e,t,n){const{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:l}=t,{borderWidth:u,borderJoinStyle:c}=l,p=Math.min(u/o,Nn(r-n));if(e.beginPath(),e.arc(i,a,o-u/2,r+p/2,n-p/2),s>0){const h=Math.min(u/s,Nn(r-n));e.arc(i,a,s+u/2,n-h/2,r+h/2,!0)}else{const h=Math.min(u/2,o*Nn(r-n));if(c==="round")e.arc(i,a,h,n-it/2,r+it/2,!0);else if(c==="bevel"){const d=2*h*h,v=-d*Math.cos(n+it/2)+i,m=-d*Math.sin(n+it/2)+a,b=d*Math.cos(r+it/2)+i,f=d*Math.sin(r+it/2)+a;e.lineTo(v,m),e.lineTo(b,f)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ej(e,t,n){const{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:l}=t;let u=i/s;e.beginPath(),e.arc(a,o,s,r-u,n+u),l>i?(u=i/l,e.arc(a,o,l,n+u,r-u,!0)):e.arc(a,o,i,n+Lt,r-Lt),e.closePath(),e.clip()}function Sj(e){return Pp(e,["outerStart","outerEnd","innerStart","innerEnd"])}function wj(e,t,n,r){const i=Sj(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=l=>{const u=(n-Math.min(a,l))*r/2;return hn(l,0,Math.min(a,u))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:hn(i.innerStart,0,o),innerEnd:hn(i.innerEnd,0,o)}}function to(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function wc(e,t,n,r,i,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,p=Math.max(t.outerRadius+r+n-u,0),h=c>0?c+r+n+u:0;let d=0;const v=i-l;if(r){const P=c>0?c-r:0,k=p>0?p-r:0,O=(P+k)/2,M=O!==0?v*O/(O+r):v;d=(v-M)/2}const m=Math.max(.001,v*p-n/it)/p,b=(v-m)/2,f=l+b+d,y=i-b-d,{outerStart:C,outerEnd:S,innerStart:w,innerEnd:E}=wj(t,h,p,y-f),x=p-C,g=p-S,I=f+C/x,A=y-S/g,_=h+w,T=h+E,$=f+w/_,B=y-E/T;if(e.beginPath(),a){const P=(I+A)/2;if(e.arc(o,s,p,I,P),e.arc(o,s,p,P,A),S>0){const G=to(g,A,o,s);e.arc(G.x,G.y,S,A,y+Lt)}const k=to(T,y,o,s);if(e.lineTo(k.x,k.y),E>0){const G=to(T,B,o,s);e.arc(G.x,G.y,E,y+Lt,B+Math.PI)}const O=(y-E/h+(f+w/h))/2;if(e.arc(o,s,h,y-E/h,O,!0),e.arc(o,s,h,O,f+w/h,!0),w>0){const G=to(_,$,o,s);e.arc(G.x,G.y,w,$+Math.PI,f-Lt)}const M=to(x,f,o,s);if(e.lineTo(M.x,M.y),C>0){const G=to(x,I,o,s);e.arc(G.x,G.y,C,f-Lt,I)}}else{e.moveTo(o,s);const P=Math.cos(I)*p+o,k=Math.sin(I)*p+s;e.lineTo(P,k);const O=Math.cos(A)*p+o,M=Math.sin(A)*p+s;e.lineTo(O,M)}e.closePath()}function Ij(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){wc(e,t,n,r,l,i);for(let u=0;u<a;++u)e.fill();isNaN(s)||(l=o+(s%yt||yt))}return wc(e,t,n,r,l,i),e.fill(),l}function _j(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:p,borderDashOffset:h,borderRadius:d}=l,v=l.borderAlign==="inner";if(!u)return;e.setLineDash(p||[]),e.lineDashOffset=h,v?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let m=t.endAngle;if(a){wc(e,t,n,r,m,i);for(let b=0;b<a;++b)e.stroke();isNaN(s)||(m=o+(s%yt||yt))}v&&Ej(e,t,m),l.selfJoin&&m-o>=it&&d===0&&c!=="miter"&&Cj(e,t,m),a||(wc(e,t,n,r,m,i),e.stroke())}class fs extends Ci{constructor(n){super();Ce(this,"circumference");Ce(this,"endAngle");Ce(this,"fullCircles");Ce(this,"innerRadius");Ce(this,"outerRadius");Ce(this,"pixelMargin");Ce(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const a=this.getProps(["x","y"],i),{angle:o,distance:s}=tw(a,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:p,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,v=Me(h,u-l),m=qs(o,l,u)&&l!==u,b=v>=yt||m,f=ci(s,c+d,p+d);return b&&f}getCenterPoint(n){const{x:r,y:i,startAngle:a,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:c}=this.options,p=(a+o)/2,h=(s+l+c+u)/2;return{x:r+Math.cos(p)*h,y:i+Math.sin(p)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,a=(r.offset||0)/4,o=(r.spacing||0)/2,s=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>yt?Math.floor(i/yt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*a,Math.sin(l)*a);const u=1-Math.sin(Math.min(it,i||0)),c=a*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Ij(n,this,c,o,s),_j(n,this,c,o,s),n.restore()}}Ce(fs,"id","arc"),Ce(fs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),Ce(fs,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ce(fs,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function kw(e,t,n=t){e.lineCap=Me(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Me(n.borderDash,t.borderDash)),e.lineDashOffset=Me(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Me(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Me(n.borderWidth,t.borderWidth),e.strokeStyle=Me(n.borderColor,t.borderColor)}function Dj(e,t,n){e.lineTo(n.x,n.y)}function Tj(e){return e.stepped?JL:e.tension||e.cubicInterpolationMode==="monotone"?qL:Dj}function Pw(e,t,n={}){const r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,l=Math.max(i,o),u=Math.min(a,s),c=i<o&&a<o||i>s&&a>s;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function Aj(e,t,n,r){const{points:i,options:a}=t,{count:o,start:s,loop:l,ilen:u}=Pw(i,n,r),c=Tj(a);let{move:p=!0,reverse:h}=r||{},d,v,m;for(d=0;d<=u;++d)v=i[(s+(h?u-d:d))%o],!v.skip&&(p?(e.moveTo(v.x,v.y),p=!1):c(e,m,v,h,a.stepped),m=v);return l&&(v=i[(s+(h?u:0))%o],c(e,m,v,h,a.stepped)),!!l}function Rj(e,t,n,r){const i=t.points,{count:a,start:o,ilen:s}=Pw(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,p=0,h,d,v,m,b,f;const y=S=>(o+(u?s-S:S))%a,C=()=>{m!==b&&(e.lineTo(c,b),e.lineTo(c,m),e.lineTo(c,f))};for(l&&(d=i[y(0)],e.moveTo(d.x,d.y)),h=0;h<=s;++h){if(d=i[y(h)],d.skip)continue;const S=d.x,w=d.y,E=S|0;E===v?(w<m?m=w:w>b&&(b=w),c=(p*c+S)/++p):(C(),e.lineTo(S,w),v=E,p=0,m=b=w),f=w}C()}function P0(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Rj:Aj}function Bj(e){return e.stepped?RV:e.tension||e.cubicInterpolationMode==="monotone"?BV:da}function kj(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),kw(e,t.options),e.stroke(i)}function Pj(e,t,n,r){const{segments:i,options:a}=t,o=P0(t);for(const s of i)kw(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const $j=typeof Path2D=="function";function Fj(e,t,n,r){$j&&!t.options.segment?kj(e,t,n,r):Pj(e,t,n,r)}class Nr extends Ci{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;EV(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=MV(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],a=this.points,o=bw(this,{property:n,start:i,end:i});if(!o.length)return;const s=[],l=Bj(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:p,end:h}=o[u],d=a[p],v=a[h];if(d===v){s.push(d);continue}const m=Math.abs((i-d[n])/(v[n]-d[n])),b=l(d,v,m,r.stepped);b[n]=t[n],s.push(b)}return s.length===1?s[0]:s}pathSegment(t,n,r){return P0(this)(t,this,n,r)}path(t,n,r){const i=this.segments,a=P0(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)o&=a(t,this,s,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Fj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ce(Nr,"id","line"),Ce(Nr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ce(Nr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ce(Nr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function yy(e,t,n,r){const i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}class Sa extends Ci{constructor(n){super();Ce(this,"parsed");Ce(this,"skip");Ce(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const a=this.options,{x:o,y:s}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-s,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(n,r){return yy(this,n,"x",r)}inYRange(n,r){return yy(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!Qs(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,R0(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ce(Sa,"id","point"),Ce(Sa,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ce(Sa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function $w(e,t){const{x:n,y:r,base:i,width:a,height:o}=e.getProps(["x","y","base","width","height"],t);let s,l,u,c,p;return e.horizontal?(p=o/2,s=Math.min(n,i),l=Math.max(n,i),u=r-p,c=r+p):(p=a/2,s=n-p,l=n+p,u=Math.min(r,i),c=Math.max(r,i)),{left:s,top:u,right:l,bottom:c}}function Hi(e,t,n,r){return e?0:hn(t,n,r)}function Nj(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,a=lw(r);return{t:Hi(i.top,a.top,0,n),r:Hi(i.right,a.right,0,t),b:Hi(i.bottom,a.bottom,0,n),l:Hi(i.left,a.left,0,t)}}function Mj(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,a=Eo(i),o=Math.min(t,n),s=e.borderSkipped,l=r||je(i);return{topLeft:Hi(!l||s.top||s.left,a.topLeft,0,o),topRight:Hi(!l||s.top||s.right,a.topRight,0,o),bottomLeft:Hi(!l||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:Hi(!l||s.bottom||s.right,a.bottomRight,0,o)}}function Oj(e){const t=$w(e),n=t.right-t.left,r=t.bottom-t.top,i=Nj(e,n/2,r/2),a=Mj(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function dh(e,t,n,r){const i=t===null,a=n===null,s=e&&!(i&&a)&&$w(e,r);return s&&(i||ci(t,s.left,s.right))&&(a||ci(n,s.top,s.bottom))}function Lj(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Vj(e,t){e.rect(t.x,t.y,t.w,t.h)}function fh(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,a=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}class Fu extends Ci{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:a,outer:o}=Oj(this),s=Lj(o.radius)?Cc:Vj;t.save(),(o.w!==a.w||o.h!==a.h)&&(t.beginPath(),s(t,fh(o,n,a)),t.clip(),s(t,fh(a,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,fh(a,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return dh(this,t,n,r)}inXRange(t,n){return dh(this,t,null,n)}inYRange(t,n){return dh(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(n+i)/2:n,y:a?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Ce(Fu,"id","bar"),Ce(Fu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ce(Fu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hj(e,t,n){const r=e.segments,i=e.points,a=t.points,o=[];for(const s of r){let{start:l,end:u}=s;u=pd(l,u,i);const c=$0(n,i[l],i[u],s.loop);if(!t.segments){o.push({source:s,target:c,start:i[l],end:i[u]});continue}const p=bw(t,c);for(const h of p){const d=$0(n,a[h.start],a[h.end],h.loop),v=vw(s,i,d);for(const m of v)o.push({source:m,target:h,start:{[n]:xy(c,d,"start",Math.max)},end:{[n]:xy(c,d,"end",Math.min)}})}}return o}function $0(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e==="angle"&&(i=Nn(i),a=Nn(a)),{property:e,start:i,end:a}}function jj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:o,end:s})=>{s=pd(o,s,i);const l=i[o],u=i[s];r!==null?(a.push({x:l.x,y:r}),a.push({x:u.x,y:r})):n!==null&&(a.push({x:n,y:l.y}),a.push({x:n,y:u.y}))}),a}function pd(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function xy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Fw(e,t){let n=[],r=!1;return Bt(e)?(r=!0,n=e):n=jj(e,t),n.length?new Nr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Cy(e){return e&&e.fill!==!1}function zj(e,t,n){let i=e[t].fill;const a=[t];let o;if(!n)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!pn(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;a.push(i),i=o.fill}return!1}function Gj(e,t,n){const r=Yj(e);if(je(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return pn(i)&&Math.floor(i)===i?Wj(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Wj(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Uj(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:je(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Xj(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:je(e)?r=e.value:r=t.getBaseValue(),r}function Yj(e){const t=e.options,n=t.fill;let r=Me(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Kj(e){const{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Zj(t,n);s.push(Fw({x:null,y:t.bottom},r));for(let l=0;l<a.length;l++){const u=a[l];for(let c=u.start;c<=u.end;c++)Jj(i,o[c],s)}return new Nr({points:i,options:{}})}function Zj(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const a=r[i];if(a.index===t)break;a.hidden||n.unshift(a.dataset)}return n}function Jj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const a=n[i],{first:o,last:s,point:l}=qj(a,t,"x");if(!(!l||o&&s)){if(o)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function qj(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],a=e.segments,o=e.points;let s=!1,l=!1;for(let u=0;u<a.length;u++){const c=a[u],p=o[c.start][n],h=o[c.end][n];if(ci(i,p,h)){s=i===p,l=i===h;break}}return{first:s,last:l,point:r}}class Nw{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:a,radius:o}=this;return n=n||{start:0,end:yt},t.arc(i,a,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,a=t.angle;return{x:n+Math.cos(a)*i,y:r+Math.sin(a)*i,angle:a}}}function Qj(e){const{chart:t,fill:n,line:r}=e;if(pn(n))return ez(t,n);if(n==="stack")return Kj(e);if(n==="shape")return!0;const i=tz(e);return i instanceof Nw?i:Fw(i,r)}function ez(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function tz(e){return(e.scale||{}).getPointPositionForValue?rz(e):nz(e)}function nz(e){const{scale:t={},fill:n}=e,r=Uj(n,t);if(pn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function rz(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=Xj(n,t,a),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new Nw({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)s.push(t.getPointPositionForValue(l,o));return s}function hh(e,t,n){const r=Qj(t),{chart:i,index:a,line:o,scale:s,axis:l}=t,u=o.options,c=u.fill,p=u.backgroundColor,{above:h=p,below:d=p}=c||{},v=i.getDatasetMeta(a),m=yw(i,v);r&&o.points.length&&(dd(e,n),iz(e,{line:o,target:r,above:h,below:d,area:n,scale:s,axis:l,clip:m}),fd(e))}function iz(e,t){const{line:n,target:r,above:i,below:a,area:o,scale:s,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=a;a!==i&&(u==="x"?(Ey(e,r,o.top),gh(e,{line:n,target:r,color:i,scale:s,property:u,clip:l}),e.restore(),e.save(),Ey(e,r,o.bottom)):u==="y"&&(Sy(e,r,o.left),gh(e,{line:n,target:r,color:a,scale:s,property:u,clip:l}),e.restore(),e.save(),Sy(e,r,o.right),c=i)),gh(e,{line:n,target:r,color:c,scale:s,property:u,clip:l}),e.restore()}function Ey(e,t,n){const{segments:r,points:i}=t;let a=!0,o=!1;e.beginPath();for(const s of r){const{start:l,end:u}=s,c=i[l],p=i[pd(l,u,i)];a?(e.moveTo(c.x,c.y),a=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(p.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Sy(e,t,n){const{segments:r,points:i}=t;let a=!0,o=!1;e.beginPath();for(const s of r){const{start:l,end:u}=s,c=i[l],p=i[pd(l,u,i)];a?(e.moveTo(c.x,c.y),a=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,p.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function gh(e,t){const{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,l=Hj(n,r,i);for(const{source:u,target:c,start:p,end:h}of l){const{style:{backgroundColor:d=a}={}}=u,v=r!==!0;e.save(),e.fillStyle=d,az(e,o,s,v&&$0(i,p,h)),e.beginPath();const m=!!n.pathSegment(e,u);let b;if(v){m?e.closePath():wy(e,r,h,i);const f=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&f,b||wy(e,r,p,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function az(e,t,n,r){const i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a==="x"||a==="y"){let l,u,c,p;a==="x"?(l=o,u=i.top,c=s,p=i.bottom):(l=i.left,u=o,c=i.right,p=s),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),p=Math.min(p,n.bottom)),e.rect(l,u,c-l,p-u),e.clip()}}function wy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Mw={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let a,o,s,l;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,l=null,s&&s.options&&s instanceof Nr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Gj(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=zj(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let o=i.length-1;o>=0;--o){const s=i[o].$filler;s&&(s.line.updateControlPoints(a,s.axis),r&&s.fill&&hh(e.ctx,s,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const a=r[i].$filler;Cy(a)&&hh(e.ctx,a,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Cy(r)||n.drawTime!=="beforeDatasetDraw"||hh(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Iy=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},oz=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class _y extends Ci{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=gn(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=Iy(r,a);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,a,s,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,s,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:a,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+s;let p=t;a.textAlign="left",a.textBaseline="middle";let h=-1,d=-c;return this.legendItems.forEach((v,m)=>{const b=r+n/2+a.measureText(v.text).width;(m===0||u[u.length-1]+b+2*s>o)&&(p+=c,u[u.length-(m>0?0:1)]=0,d+=c,h++),l[m]={left:0,top:d,row:h,width:b,height:i},u[u.length-1]+=b+s}),p}_fitCols(t,n,r,i){const{ctx:a,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let p=s,h=0,d=0,v=0,m=0;return this.legendItems.forEach((b,f)=>{const{itemWidth:y,itemHeight:C}=sz(r,n,a,b,i);f>0&&d+C+2*s>c&&(p+=h+s,u.push({width:h,height:d}),v+=h+s,m++,h=d=0),l[f]={left:v,top:d,col:m,width:y,height:C},h=Math.max(h,y),d+=C+s}),p+=h,u.push({width:h,height:d}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=So(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=dn(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=dn(r,this.left+i,this.right-this.lineWidths[s])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let s=0,l=dn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=dn(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;dd(t,this),this._draw(),fd(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=t,s=_t.color,l=So(t.rtl,this.left,this.width),u=gn(o.font),{padding:c}=o,p=u.size,h=p/2;let d;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:v,boxHeight:m,itemHeight:b}=Iy(o,p),f=function(E,x,g){if(isNaN(v)||v<=0||isNaN(m)||m<0)return;i.save();const I=Me(g.lineWidth,1);if(i.fillStyle=Me(g.fillStyle,s),i.lineCap=Me(g.lineCap,"butt"),i.lineDashOffset=Me(g.lineDashOffset,0),i.lineJoin=Me(g.lineJoin,"miter"),i.lineWidth=I,i.strokeStyle=Me(g.strokeStyle,s),i.setLineDash(Me(g.lineDash,[])),o.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:g.pointStyle,rotation:g.rotation,borderWidth:I},_=l.xPlus(E,v/2),T=x+h;sw(i,A,_,T,o.pointStyleWidth&&v)}else{const A=x+Math.max((p-m)/2,0),_=l.leftForLtr(E,v),T=Eo(g.borderRadius);i.beginPath(),Object.values(T).some($=>$!==0)?Cc(i,{x:_,y:A,w:v,h:m,radius:T}):i.rect(_,A,v,m),i.fill(),I!==0&&i.stroke()}i.restore()},y=function(E,x,g){el(i,g.text,E,x+b/2,u,{strikethrough:g.hidden,textAlign:l.textAlign(g.textAlign)})},C=this.isHorizontal(),S=this._computeTitleHeight();C?d={x:dn(a,this.left+c,this.right-r[0]),y:this.top+c+S,line:0}:d={x:this.left+c,y:dn(a,this.top+S+c,this.bottom-n[0].height),line:0},gw(this.ctx,t.textDirection);const w=b+c;this.legendItems.forEach((E,x)=>{i.strokeStyle=E.fontColor,i.fillStyle=E.fontColor;const g=i.measureText(E.text).width,I=l.textAlign(E.textAlign||(E.textAlign=o.textAlign)),A=v+h+g;let _=d.x,T=d.y;l.setWidth(this.width),C?x>0&&_+A+c>this.right&&(T=d.y+=w,d.line++,_=d.x=dn(a,this.left+c,this.right-r[d.line])):x>0&&T+w>this.bottom&&(_=d.x=_+n[d.line].width+c,d.line++,T=d.y=dn(a,this.top+S+c,this.bottom-n[d.line].height));const $=l.x(_);if(f($,T,E),_=OL(I,_+v+h,C?_+A:this.right,t.rtl),y(l.x(_),T,E),C)d.x+=A+c;else if(typeof E.text!="string"){const B=u.lineHeight;d.y+=Ow(E,B)+c}else d.y+=w}),pw(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=gn(n.font),i=ar(n.padding);if(!n.display)return;const a=So(t.rtl,this.left,this.width),o=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,p=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,p=dn(t.align,p,this.right-h);else{const v=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);c=u+dn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const d=dn(s,p,p+h);o.textAlign=a.textAlign(Rp(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,el(o,n.text,d,c,r)}_computeTitleHeight(){const t=this.options.title,n=gn(t.font),r=ar(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,a;if(ci(t,this.left,this.right)&&ci(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],ci(t,i.left,i.left+i.width)&&ci(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!cz(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=oz(i,r);i&&!a&&ft(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&ft(n.onHover,[t,r,this],this)}else r&&ft(n.onClick,[t,r,this],this)}}function sz(e,t,n,r,i){const a=lz(r,e,t,n),o=uz(i,r,t.lineHeight);return{itemWidth:a,itemHeight:o}}function lz(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((a,o)=>a.length>o.length?a:o)),t+n.size/2+r.measureText(i).width}function uz(e,t,n){let r=e;return typeof t.text!="string"&&(r=Ow(t,n)),r}function Ow(e,t){const n=e.text?e.text.length:0;return t*n}function cz(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Lw={id:"legend",_element:_y,start(e,t,n){const r=e.legend=new _y({ctx:e.ctx,options:n,chart:e});rr.configure(e,r,n),rr.addBox(e,r)},stop(e){rr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;rr.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=ar(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(s||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Vw extends Ci{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Bt(r.text)?r.text.length:1;this._padding=ar(r.padding);const a=i*gn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:a,options:o}=this,s=o.align;let l=0,u,c,p;return this.isHorizontal()?(c=dn(s,r,a),p=n+t,u=a-r):(o.position==="left"?(c=r+t,p=dn(s,i,n),l=it*-.5):(c=a-t,p=dn(s,n,i),l=it*.5),u=i-n),{titleX:c,titleY:p,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=gn(n.font),a=r.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);el(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Rp(n.align),textBaseline:"middle",translation:[o,s]})}}function dz(e,t){const n=new Vw({ctx:e.ctx,options:t,chart:e});rr.configure(e,n,t),rr.addBox(e,n),e.titleBlock=n}var Hw={id:"title",_element:Vw,start(e,t,n){dz(e,n)},stop(e){const t=e.titleBlock;rr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;rr.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,a,o,s;for(a=0,o=e.length;a<o;++a){const l=e[a].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=T0(t,u);c<i&&(i=c,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Dr(e,t){return t&&(Bt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ni(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
179
+ */class HV{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const a=n.listeners[i],o=n.duration;a.forEach(s=>s({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=iw.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const a=r.items;let o=a.length-1,s=!1,l;for(;o>=0;--o)l=a[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(a[o]=a[a.length-1],a.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=a.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ti=new HV;const Wb="transparent",jV={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=$b(e||Wb),i=r.valid&&$b(t||Wb);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class zV{constructor(t,n,r,i){const a=n[r];i=iu([t.to,i,a,t.from]);const o=iu([t.from,a,i]);this._active=!0,this._fn=t.fn||jV[t.type||typeof o],this._easing=Cs[t.easing]||Cs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],a=r-this._start,o=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=iu([t.to,n,i,t.from]),this._from=iu([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,a=this._from,o=this._loop,s=this._to;let l;if(this._active=a!==s&&(o||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=a;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class xw{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!je(t))return;const n=Object.keys(_t.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!je(a))return;const o={};for(const s of n)o[s]=a[s];(Bt(a.properties)&&a.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,o)})})}_animateOptions(t,n){const r=n.options,i=WV(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&GV(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,n){const r=this._properties,i=[],a=t.$animations||(t.$animations={}),o=Object.keys(n),s=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(t,n));continue}const c=n[u];let p=a[u];const h=r.get(u);if(p)if(h&&p.active()){p.update(h,c,s);continue}else p.cancel();if(!h||!h.duration){t[u]=c;continue}a[u]=p=new zV(h,t,u,c),i.push(p)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return ti.add(this._chart,r),!0}}function GV(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=e[r[i]];a&&a.active()&&n.push(a.wait())}return Promise.all(n)}function WV(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Ub(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function UV(e,t,n){if(n===!1)return!1;const r=Ub(e,n),i=Ub(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function XV(e){let t,n,r,i;return je(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Cw(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function Xb(e,t,n,r={}){const i=e.keys,a=r.mode==="single";let o,s,l,u;if(t===null)return;let c=!1;for(o=0,s=i.length;o<s;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=e.values[l],mn(u)&&(a||t===0||Hr(t)===Hr(u))&&(t+=u)}return!c&&!r.all?0:t}function YV(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",a=r.axis==="x"?"x":"y",o=Object.keys(e),s=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],s[l]={[i]:c,[a]:e[c]};return s}function ih(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function KV(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function ZV(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function JV(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Yb(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=e[i.index];if(n&&a>0||!n&&a<0)return i.index}return null}function Kb(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:a,vScale:o,index:s}=r,l=a.axis,u=o.axis,c=KV(a,o,r),p=t.length;let h;for(let d=0;d<p;++d){const v=t[d],{[l]:m,[u]:b}=v,f=v._stacks||(v._stacks={});h=f[u]=JV(i,c,m),h[s]=b,h._top=Yb(h,o,!0,r.type),h._bottom=Yb(h,o,!1,r.type);const y=h._visualValues||(h._visualValues={});y[s]=b}}function ah(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function qV(e,t){return ja(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function QV(e,t,n){return ja(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Jo(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const a=i._stacks;if(!a||a[r]===void 0||a[r][n]===void 0)return;delete a[r][n],a[r]._visualValues!==void 0&&a[r]._visualValues[n]!==void 0&&delete a[r]._visualValues[n]}}}const oh=e=>e==="reset"||e==="none",Zb=(e,t)=>t?e:Object.assign({},e),eH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Cw(n,!0),values:null};class Ea{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ih(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Jo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(p,h,d,v)=>p==="x"?h:p==="r"?v:d,a=n.xAxisID=Me(r.xAxisID,ah(t,"x")),o=n.yAxisID=Me(r.yAxisID,ah(t,"y")),s=n.rAxisID=Me(r.rAxisID,ah(t,"r")),l=n.indexAxis,u=n.iAxisID=i(l,a,o,s),c=n.vAxisID=i(l,o,a,s);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bb(this._data,this),t._stacked&&Jo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(je(n)){const i=this._cachedMeta;this._data=YV(n,i)}else if(r!==n){if(r){Bb(r,this);const i=this._cachedMeta;Jo(i),i._parsed=[]}n&&Object.isExtensible(n)&&NL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const a=n._stacked;n._stacked=ih(n.vScale,n),n.stack!==r.stack&&(i=!0,Jo(n),n.stack=r.stack),this._resyncElements(t),(i||a!==n._stacked)&&(Kb(this,n._parsed),n._stacked=ih(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:a,_stacked:o}=r,s=a.axis;let l=t===0&&n===i.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,p,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{Bt(i[t])?h=this.parseArrayData(r,i,t,n):je(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const d=()=>p[s]===null||u&&p[s]<u[s];for(c=0;c<n;++c)r._parsed[c+t]=p=h[c],l&&(d()&&(l=!1),u=p);r._sorted=l}o&&Kb(this,h)}parsePrimitiveData(t,n,r,i){const{iScale:a,vScale:o}=t,s=a.axis,l=o.axis,u=a.getLabels(),c=a===o,p=new Array(i);let h,d,v;for(h=0,d=i;h<d;++h)v=h+r,p[h]={[s]:c||a.parse(u[v],v),[l]:o.parse(n[v],v)};return p}parseArrayData(t,n,r,i){const{xScale:a,yScale:o}=t,s=new Array(i);let l,u,c,p;for(l=0,u=i;l<u;++l)c=l+r,p=n[c],s[l]={x:a.parse(p[0],c),y:o.parse(p[1],c)};return s}parseObjectData(t,n,r,i){const{xScale:a,yScale:o}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,p,h,d;for(c=0,p=i;c<p;++c)h=c+r,d=n[h],u[c]={x:a.parse(Fa(d,s),h),y:o.parse(Fa(d,l),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,a=this._cachedMeta,o=n[t.axis],s={keys:Cw(i,!0),values:n._stacks[t.axis]._visualValues};return Xb(s,o,a.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const a=r[n.axis];let o=a===null?NaN:a;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,o=Xb(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,o=i.length,s=this._getOtherScale(t),l=eH(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:p}=ZV(s);let h,d;function v(){d=i[h];const m=d[s.axis];return!mn(d[t.axis])||c>m||p<m}for(h=0;h<o&&!(!v()&&(this.updateRangeFromParsed(u,t,d,l),a));++h);if(a){for(h=o-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(u,t,d,l);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,a,o;for(i=0,a=n.length;i<a;++i)o=n[i][t.axis],mn(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=XV(Me(this.options.clip,UV(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],a=n.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||i.length-s,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,a,s,l),c=s;c<s+l;++c){const p=i[c];p.hidden||(p.active&&u?o.push(p):p.draw(t,a))}for(c=0;c<o.length;++c)o[c].draw(t,a)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];a=o.$context||(o.$context=QV(this.getContext(),t,o)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=qV(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=r,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",a=this._cachedDataOpts,o=t+"-"+n,s=a[o],l=this.enableOptionSharing&&Zs(r);if(s)return Zb(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),p=i?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),c),d=Object.keys(_t.elements[t]),v=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(h,d,v,p);return m.$shared&&(m.$shared=l,a[o]=Object.freeze(Zb(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,a=this._cachedDataOpts,o=`animation-${n}`,s=a[o];if(s)return s;let l;if(i.options.animation!==!1){const c=this.chart.config,p=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),p);l=c.createResolver(h,this.getContext(t,r,n))}const u=new xw(i,l&&l.animations);return l&&l._cacheable&&(a[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||oh(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,a=this.getSharedOptions(r),o=this.includeOptions(n,a)||a!==i;return this.updateSharedOptions(a,n,r),{sharedOptions:a,includeOptions:o}}updateElement(t,n,r,i){oh(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!oh(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const a=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const i=r.length,a=n.length,o=Math.min(a,i);o&&this.parse(0,o),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,n,r=!0){const i=this._cachedMeta,a=i.data,o=t+n;let s;const l=u=>{for(u.length+=n,s=u.length-1;s>=o;s--)u[s]=u[s-n]};for(l(a),s=t;s<o;++s)a[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(a,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Jo(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ce(Ea,"defaults",{}),Ce(Ea,"datasetElementType",null),Ce(Ea,"dataElementType",null);function tH(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,a=n.length;i<a;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=rw(r.sort((i,a)=>i-a))}return e._cache.$bar}function nH(e){const t=e.iScale,n=tH(t,e.type);let r=t._length,i,a,o,s;const l=()=>{o===32767||o===-32768||(Zs(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),l();return r}function rH(e,t,n,r){const i=n.barThickness;let a,o;return et(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function iH(e,t,n,r){const i=t.pixels,a=i[e];let o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);const u=a-(a-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/r,ratio:n.barPercentage,start:u}}function aH(e,t,n,r){const i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a);let l=o,u=s;Math.abs(o)>Math.abs(s)&&(l=s,u=o),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:i,end:a,min:o,max:s}}function Ew(e,t,n,r){return Bt(e)?aH(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Jb(e,t,n,r){const i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,l=[];let u,c,p,h;for(u=n,c=n+r;u<c;++u)h=t[u],p={},p[i.axis]=s||i.parse(o[u],u),l.push(Ew(h,p,a,u));return l}function sh(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function oH(e,t,n){return e!==0?Hr(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function sH(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",a="start"):(i="start",a="end"),{start:n,end:r,reverse:t,top:i,bottom:a}}function lH(e,t,n,r){let i=t.borderSkipped;const a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:s,reverse:l,top:u,bottom:c}=sH(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(a[qb(c,o,s,l)]=!0,i=u)),a[qb(i,o,s,l)]=!0,e.borderSkipped=a}function qb(e,t,n,r){return r?(e=uH(e,t,n),e=Qb(e,n,t)):e=Qb(e,t,n),e}function uH(e,t,n){return e===t?n:e===n?t:e}function Qb(e,t,n){return e==="start"?t:e==="end"?n:e}function cH(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Bu extends Ea{parsePrimitiveData(t,n,r,i){return Jb(t,n,r,i)}parseArrayData(t,n,r,i){return Jb(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:a,vScale:o}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=a.axis==="x"?s:l,c=o.axis==="x"?s:l,p=[];let h,d,v,m;for(h=r,d=r+i;h<d;++h)m=n[h],v={},v[a.axis]=a.parse(Fa(m,u),h),p.push(Ew(Fa(m,c),v,o,h));return p}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const a=r._custom;a&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,a=this.getParsed(t),o=a._custom,s=sh(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(a[i.axis]);return{label:""+r.getLabelForValue(a[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const a=i==="reset",{index:o,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),u=s.isHorizontal(),c=this._getRuler(),{sharedOptions:p,includeOptions:h}=this._getSharedOptions(n,i);for(let d=n;d<n+r;d++){const v=this.getParsed(d),m=a||et(v[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(d),b=this._calculateBarIndexPixels(d,c),f=(v._stacks||{})[s.axis],y={horizontal:u,base:m.base,enableBorderRadius:!f||sh(v._custom)||o===f._top||o===f._bottom,x:u?m.head:b.center,y:u?b.center:m.head,height:u?b.size:Math.abs(m.size),width:u?Math.abs(m.size):b.size};h&&(y.options=p||this.resolveDataElementOptions(d,t[d].active?"active":i));const C=y.options||t[d].options;lH(y,C,f,o),cH(y,C,c.ratio),this.updateElement(t[d],d,y,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),a=r.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],u=c=>{const p=c._parsed.find(d=>d[r.axis]===l),h=p&&p[c.vScale.axis];if(et(h)||isNaN(h))return!0};for(const c of i)if(!(n!==void 0&&u(c))&&((a===!1||o.indexOf(c.stack)===-1||a===void 0&&c.stack===void 0)&&o.push(c.stack),c.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Me(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),a=n!==void 0?i.indexOf(n):-1;return a===-1?i.length-1:a}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let a,o;for(a=0,o=n.data.length;a<o;++a)i.push(r.getPixelForValue(this.getParsed(a)[r.axis],a));const s=t.barThickness;return{min:s||nH(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:a,minBarLength:o}}=this,s=a||0,l=this.getParsed(t),u=l._custom,c=sh(u);let p=l[n.axis],h=0,d=r?this.applyStack(n,l,r):p,v,m;d!==p&&(h=d-p,d=p),c&&(p=u.barStart,d=u.barEnd-u.barStart,p!==0&&Hr(p)!==Hr(u.barEnd)&&(h=0),h+=p);const b=!et(a)&&!c?a:h;let f=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(h+d):v=f,m=v-f,Math.abs(m)<o){m=oH(m,n,s)*o,p===s&&(f-=m/2);const y=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),S=Math.min(y,C),w=Math.max(y,C);f=Math.max(Math.min(f,w),S),v=f+m,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(f))}if(f===n.getPixelForValue(s)){const y=Hr(m)*n.getLineWidthForValue(s)/2;f+=y,m-=y}return{size:m,base:f,head:v,center:v+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,a=i.skipNull,o=Me(i.maxBarThickness,1/0);let s,l;const u=this._getAxisCount();if(n.grouped){const c=a?this._getStackCount(t):n.stackCount,p=i.barThickness==="flex"?iH(t,n,i,c*u):rH(t,n,i,c*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(Me(h,this.getFirstScaleIdForIndexAxis())),v=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+d;s=p.start+p.chunk*v+p.chunk/2,l=Math.min(o,p.chunk*p.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let a=0;for(;a<i;++a)this.getParsed(a)[n.axis]!==null&&!r[a].hidden&&r[a].draw(this._ctx)}}Ce(Bu,"id","bar"),Ce(Bu,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ce(Bu,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function dH(e,t,n){let r=1,i=1,a=0,o=0;if(t<yt){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),p=Math.cos(l),h=Math.sin(l),d=(C,S,w)=>qs(C,s,l,!0)?1:Math.max(S,S*n,w,w*n),v=(C,S,w)=>qs(C,s,l,!0)?-1:Math.min(S,S*n,w,w*n),m=d(0,u,p),b=d(Lt,c,h),f=v(it,u,p),y=v(it+Lt,c,h);r=(m-f)/2,i=(b-y)/2,a=-(m+f)/2,o=-(b+y)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class cs extends Ea{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let a=l=>+r[l];if(je(r[t])){const{key:l="value"}=this._parsing;a=u=>+Fa(r[u],l)}let o,s;for(o=t,s=t+n;o<s;++o)i._parsed[o]=a(o)}}_getRotation(){return ui(this.options.rotation-90)}_getCircumference(){return ui(this.options.circumference)}_getRotationExtents(){let t=yt,n=-yt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,a=i._getRotation(),o=i._getCircumference();t=Math.min(t,a),n=Math.max(n,a+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,a=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(yL(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:p}=this._getRotationExtents(),{ratioX:h,ratioY:d,offsetX:v,offsetY:m}=dH(p,c,l),b=(r.width-o)/h,f=(r.height-o)/d,y=Math.max(Math.min(b,f)/2,0),C=qS(this.options.radius,y),S=Math.max(C*l,0),w=(C-S)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=m*C,i.total=this.calculateTotal(),this.outerRadius=C-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(a,0,a.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,a=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*a/yt)}updateElements(t,n,r,i){const a=i==="reset",o=this.chart,s=o.chartArea,u=o.options.animation,c=(s.left+s.right)/2,p=(s.top+s.bottom)/2,h=a&&u.animateScale,d=h?0:this.innerRadius,v=h?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,i);let f=this._getRotation(),y;for(y=0;y<n;++y)f+=this._circumference(y,a);for(y=n;y<n+r;++y){const C=this._circumference(y,a),S=t[y],w={x:c+this.offsetX,y:p+this.offsetY,startAngle:f,endAngle:f+C,circumference:C,outerRadius:v,innerRadius:d};b&&(w.options=m||this.resolveDataElementOptions(y,S.active?"active":i)),f+=C,this.updateElement(S,y,w,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?yt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=kp(n._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,a,o,s,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,s=o.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const a=this.resolveDataElementOptions(r);n=Math.max(n,a.offset||0,a.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Me(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ce(cs,"id","doughnut"),Ce(cs,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Ce(cs,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ce(cs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((a,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class ku extends Ea{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:a}=n,o=this.chart._animationsDisabled;let{start:s,count:l}=LL(n,i,o);this._drawStart=s,this._drawCount=l,VL(n)&&(s=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:u},t),this.updateElements(i,s,l,t)}updateElements(t,n,r,i){const a=i==="reset",{iScale:o,vScale:s,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:p}=this._getSharedOptions(n,i),h=o.axis,d=s.axis,{spanGaps:v,segment:m}=this.options,b=Js(v)?v:Number.POSITIVE_INFINITY,f=this.chart._animationsDisabled||a||i==="none",y=n+r,C=t.length;let S=n>0&&this.getParsed(n-1);for(let w=0;w<C;++w){const E=t[w],x=f?E:{};if(w<n||w>=y){x.skip=!0;continue}const g=this.getParsed(w),I=et(g[d]),A=x[h]=o.getPixelForValue(g[h],w),_=x[d]=a||I?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,g,l):g[d],w);x.skip=isNaN(A)||isNaN(_)||I,x.stop=w>0&&Math.abs(g[h]-S[h])>b,m&&(x.parsed=g,x.raw=u.data[w]),p&&(x.options=c||this.resolveDataElementOptions(w,E.active?"active":i)),f||this.updateElement(E,w,x,i),S=g}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const a=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,a,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ce(ku,"id","line"),Ce(ku,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ce(ku,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function la(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lp{constructor(t){Ce(this,"options");this.options=t||{}}static override(t){Object.assign(Lp.prototype,t)}init(){}formats(){return la()}parse(){return la()}format(){return la()}add(){return la()}diff(){return la()}startOf(){return la()}endOf(){return la()}}var fH={_date:Lp};function hH(e,t,n,r){const{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const u=s._reversePixels?$L:ba;if(r){if(i._sharedOptions){const c=a[0],p=typeof c.getRange=="function"&&c.getRange(t);if(p){const h=u(a,t,n-p),d=u(a,t,n+p);return{lo:h.lo,hi:d.hi}}}}else{const c=u(a,t,n);if(l){const{vScale:p}=i._cachedMeta,{_parsed:h}=e,d=h.slice(0,c.lo+1).reverse().findIndex(m=>!et(m[p.axis]));c.lo-=Math.max(0,d);const v=h.slice(c.hi).findIndex(m=>!et(m[p.axis]));c.hi+=Math.max(0,v)}return c}}return{lo:0,hi:a.length-1}}function gd(e,t,n,r,i){const a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let s=0,l=a.length;s<l;++s){const{index:u,data:c}=a[s],{lo:p,hi:h}=hH(a[s],t,o,i);for(let d=p;d<=h;++d){const v=c[d];v.skip||r(v,u,d)}}}function gH(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function lh(e,t,n,r,i){const a=[];return!i&&!e.isPointInArea(t)||gd(e,n,t,function(s,l,u){!i&&!Qs(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&a.push({element:s,datasetIndex:l,index:u})},!0),a}function pH(e,t,n,r){let i=[];function a(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:p}=tw(o,{x:t.x,y:t.y});qs(p,u,c)&&i.push({element:o,datasetIndex:s,index:l})}return gd(e,n,t,a),i}function mH(e,t,n,r,i,a){let o=[];const s=gH(n);let l=Number.POSITIVE_INFINITY;function u(c,p,h){const d=c.inRange(t.x,t.y,i);if(r&&!d)return;const v=c.getCenterPoint(i);if(!(!!a||e.isPointInArea(v))&&!d)return;const b=s(t,v);b<l?(o=[{element:c,datasetIndex:p,index:h}],l=b):b===l&&o.push({element:c,datasetIndex:p,index:h})}return gd(e,n,t,u),o}function uh(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n==="r"&&!r?pH(e,t,n,i):mH(e,t,n,r,i,a)}function ey(e,t,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let s=!1;return gd(e,n,t,(l,u,c)=>{l[o]&&l[o](t[n],i)&&(a.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:a}var vH={modes:{index(e,t,n,r){const i=ca(t,e),a=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?lh(e,i,a,r,o):uh(e,i,a,!1,r,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,p=u.data[c];p&&!p.skip&&l.push({element:p,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=ca(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?lh(e,i,a,r,o):uh(e,i,a,!1,r,o);if(s.length>0){const l=s[0].datasetIndex,u=e.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(e,t,n,r){const i=ca(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return lh(e,i,a,r,o)},nearest(e,t,n,r){const i=ca(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return uh(e,i,a,n.intersect,r,o)},x(e,t,n,r){const i=ca(t,e);return ey(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ca(t,e);return ey(e,i,"y",n.intersect,r)}}};const Sw=["left","top","right","bottom"];function qo(e,t){return e.filter(n=>n.pos===t)}function ty(e,t){return e.filter(n=>Sw.indexOf(n.pos)===-1&&n.box.axis===t)}function Qo(e,t){return e.sort((n,r)=>{const i=t?r:n,a=t?n:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function bH(e){const t=[];let n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function yH(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!Sw.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=a}return t}function xH(e,t){const n=yH(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];const{fullSize:l}=s.box,u=n[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:l&&t.availableHeight)}return n}function CH(e){const t=bH(e),n=Qo(t.filter(u=>u.box.fullSize),!0),r=Qo(qo(t,"left"),!0),i=Qo(qo(t,"right")),a=Qo(qo(t,"top"),!0),o=Qo(qo(t,"bottom")),s=ty(t,"x"),l=ty(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:qo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(o).concat(s)}}function ny(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function ww(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function EH(e,t,n,r){const{pos:i,box:a}=n,o=e.maxPadding;if(!je(i)){n.size&&(e[i]-=n.size);const p=r[n.stack]||{size:0,count:1};p.size=Math.max(p.size,n.horizontal?a.height:a.width),n.size=p.size/p.count,e[i]+=n.size}a.getPadding&&ww(o,a.getPadding());const s=Math.max(0,t.outerWidth-ny(o,e,"left","right")),l=Math.max(0,t.outerHeight-ny(o,e,"top","bottom")),u=s!==e.w,c=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function SH(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function wH(e,t){const n=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{a[o]=Math.max(t[o],n[o])}),a}return r(e?["left","right"]:["top","bottom"])}function ds(e,t,n,r){const i=[];let a,o,s,l,u,c;for(a=0,o=e.length,u=0;a<o;++a){s=e[a],l=s.box,l.update(s.width||t.w,s.height||t.h,wH(s.horizontal,t));const{same:p,other:h}=EH(t,n,s,r);u|=p&&i.length,c=c||h,l.fullSize||i.push(s)}return u&&ds(i,t,n,r)||c}function lu(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function ry(e,t,n,r){const i=n.padding;let{x:a,y:o}=t;for(const s of e){const l=s.box,u=r[s.stack]||{placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const p=t.w*c,h=u.size||l.height;Zs(u.start)&&(o=u.start),l.fullSize?lu(l,i.left,o,n.outerWidth-i.right-i.left,h):lu(l,t.left+u.placed,o,p,h),u.start=o,u.placed+=p,o=l.bottom}else{const p=t.h*c,h=u.size||l.width;Zs(u.start)&&(a=u.start),l.fullSize?lu(l,a,i.top,h,n.outerHeight-i.bottom-i.top):lu(l,a,t.top+u.placed,h,p),u.start=a,u.placed+=p,a=l.right}}t.x=a,t.y=o}var rr={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=ar(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=CH(e.boxes),l=s.vertical,u=s.horizontal;rt(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);ww(h,ar(r));const d=Object.assign({maxPadding:h,w:a,h:o,x:i.left,y:i.top},i),v=xH(l.concat(u),p);ds(s.fullSize,d,p,v),ds(l,d,p,v),ds(u,d,p,v)&&ds(l,d,p,v),SH(d),ry(s.leftAndTop,d,p,v),d.x+=d.w,d.y+=d.h,ry(s.rightAndBottom,d,p,v),e.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},rt(s.chartArea,m=>{const b=m.box;Object.assign(b,e.chartArea),b.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}};class Iw{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class IH extends Iw{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pu="$chartjs",_H={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},iy=e=>e===null||e==="";function DH(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Pu]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",iy(i)){const a=Hb(e,"width");a!==void 0&&(e.width=a)}if(iy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const a=Hb(e,"height");a!==void 0&&(e.height=a)}return e}const _w=AV?{passive:!0}:!1;function TH(e,t,n){e&&e.addEventListener(t,n,_w)}function AH(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,_w)}function RH(e,t){const n=_H[e.type]||e.type,{x:r,y:i}=ca(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Sc(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function BH(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Sc(s.addedNodes,r),o=o&&!Sc(s.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function kH(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Sc(s.removedNodes,r),o=o&&!Sc(s.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const tl=new Map;let ay=0;function Dw(){const e=window.devicePixelRatio;e!==ay&&(ay=e,tl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function PH(e,t){tl.size||window.addEventListener("resize",Dw),tl.set(e,t)}function $H(e){tl.delete(e),tl.size||window.removeEventListener("resize",Dw)}function FH(e,t,n){const r=e.canvas,i=r&&Op(r);if(!i)return;const a=aw((s,l)=>{const u=i.clientWidth;n(s,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||a(u,c)});return o.observe(i),PH(e,a),o}function ch(e,t,n){n&&n.disconnect(),t==="resize"&&$H(e)}function NH(e,t,n){const r=e.canvas,i=aw(a=>{e.ctx!==null&&n(RH(a,e))},e);return TH(r,t,i),i}class MH extends Iw{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(DH(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Pu])return!1;const r=n[Pu].initial;["height","width"].forEach(a=>{const o=r[a];et(o)?n.removeAttribute(a):n.setAttribute(a,o)});const i=r.style||{};return Object.keys(i).forEach(a=>{n.style[a]=i[a]}),n.width=n.width,delete n[Pu],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:BH,detach:kH,resize:FH}[n]||NH;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:ch,detach:ch,resize:ch}[n]||AH)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return TV(t,n,r,i)}isAttached(t){const n=t&&Op(t);return!!(n&&n.isConnected)}}function OH(e){return!Mp()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?IH:MH}var mu;let Ci=(mu=class{constructor(){Ce(this,"x");Ce(this,"y");Ce(this,"active",!1);Ce(this,"options");Ce(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Js(this.x)&&Js(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}},Ce(mu,"defaults",{}),Ce(mu,"defaultRoutes"),mu);function LH(e,t){const n=e.options.ticks,r=VH(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?jH(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>i)return zH(t,u,a,o/i),u;const c=HH(a,t,i);if(o>0){let p,h;const d=o>1?Math.round((l-s)/(o-1)):null;for(uu(t,u,c,et(d)?0:s-d,s),p=0,h=o-1;p<h;p++)uu(t,u,c,a[p],a[p+1]);return uu(t,u,c,l,et(d)?t.length:l+d),u}return uu(t,u,c),u}function VH(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function HH(e,t,n){const r=GH(e),i=t.length/n;if(!r)return Math.max(i,1);const a=DL(r);for(let o=0,s=a.length-1;o<s;o++){const l=a[o];if(l>i)return l}return Math.max(i,1)}function jH(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function zH(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function uu(e,t,n,r,i){const a=Me(r,0),o=Math.min(Me(i,e.length),e.length);let s=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=a;c<0;)s++,c=Math.round(a+s*n);for(u=Math.max(a,0);u<o;u++)u===c&&(t.push(e[u]),s++,c=Math.round(a+s*n))}function GH(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const WH=e=>e==="left"?"right":e==="right"?"left":e,oy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,sy=(e,t)=>Math.min(t||e,e);function ly(e,t){const n=[],r=e.length/t,i=e.length;let a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function UH(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-a,o-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(i-1))/2,l+=i<t?u:-u,l<a-s||l>o+s)))return l}function XH(e,t){rt(e,n=>{const r=n.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete n.data[r[a]];r.splice(0,i)}})}function es(e){return e.drawTicks?e.tickLength:0}function uy(e,t){if(!e.display)return 0;const n=pn(e.font,t),r=ar(e.padding);return(Bt(e.text)?e.text.length:1)*n.lineHeight+r.height}function YH(e,t){return ja(e,{scale:t,type:"scale"})}function KH(e,t,n){return ja(e,{tick:n,index:t,type:"tick"})}function ZH(e,t,n){let r=Rp(e);return(n&&t!=="right"||!n&&t==="right")&&(r=WH(r)),r}function JH(e,t,n,r){const{top:i,left:a,bottom:o,right:s,chart:l}=e,{chartArea:u,scales:c}=l;let p=0,h,d,v;const m=o-i,b=s-a;if(e.isHorizontal()){if(d=fn(r,a,s),je(n)){const f=Object.keys(n)[0],y=n[f];v=c[f].getPixelForValue(y)+m-t}else n==="center"?v=(u.bottom+u.top)/2+m-t:v=oy(e,n,t);h=s-a}else{if(je(n)){const f=Object.keys(n)[0],y=n[f];d=c[f].getPixelForValue(y)-b+t}else n==="center"?d=(u.left+u.right)/2-b+t:d=oy(e,n,t);v=fn(r,o,i),p=n==="left"?-Lt:Lt}return{titleX:d,titleY:v,maxWidth:h,rotation:p}}class Wo extends Ci{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=_r(t,Number.POSITIVE_INFINITY),n=_r(n,Number.NEGATIVE_INFINITY),r=_r(r,Number.POSITIVE_INFINITY),i=_r(i,Number.NEGATIVE_INFINITY),{min:_r(t,r),max:_r(n,i),minDefined:mn(t),maxDefined:mn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),o;if(i&&a)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)o=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),a||(r=Math.max(r,o.max));return n=a&&n>r?r:n,r=i&&n>r?n:r,{min:_r(n,_r(r,n)),max:_r(r,_r(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:a,ticks:o}=this.options,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=oV(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?ly(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=LH(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ft(this.options.afterUpdate,[this])}beforeSetDimensions(){ft(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=ft(n.callback,[a.value,r,t],this)}afterTickToLabelConversion(){ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=sy(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,a=n.maxRotation;let o=i,s,l,u;if(!this._isVisible()||!n.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),p=c.widest.width,h=c.highest.height,d=gn(this.chart.width-p,0,this.maxWidth);s=t.offset?this.maxWidth/r:d/(r-1),p+6>s&&(s=d/(r-(t.offset?.5:1)),l=this.maxHeight-es(t.grid)-n.padding-uy(t.title,this.chart.options.font),u=Math.sqrt(p*p+h*h),o=BL(Math.min(Math.asin(gn((c.highest.height+6)/s,-1,1)),Math.asin(gn(l/u,-1,1))-Math.asin(gn(h/u,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:a}}=this,o=this._isVisible(),s=this.isHorizontal();if(o){const l=uy(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=es(a)+l):(t.height=this.maxHeight,t.width=es(a)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:p,highest:h}=this._getLabelSizes(),d=r.padding*2,v=ui(this.labelRotation),m=Math.cos(v),b=Math.sin(v);if(s){const f=r.mirror?0:b*p.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+f+d)}else{const f=r.mirror?0:m*p.width+b*h.height;t.width=Math.min(this.maxWidth,t.width+f+d)}this._calculatePadding(u,c,b,m)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:a,padding:o},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;l?u?(h=i*t.width,d=r*n.height):(h=r*t.height,d=i*n.width):a==="start"?d=n.width:a==="end"?h=t.width:a!=="inner"&&(h=t.width/2,d=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((d-p+o)*this.width/(this.width-p),0)}else{let c=n.height/2,p=t.height/2;a==="start"?(c=0,p=t.height):a==="end"&&(c=n.height,p=0),this.paddingTop=c+o,this.paddingBottom=p+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)et(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=ly(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:a}=this,o=[],s=[],l=Math.floor(n/sy(n,r));let u=0,c=0,p,h,d,v,m,b,f,y,C,S,w;for(p=0;p<n;p+=l){if(v=t[p].label,m=this._resolveTickFontOptions(p),i.font=b=m.string,f=a[b]=a[b]||{data:{},gc:[]},y=m.lineHeight,C=S=0,!et(v)&&!Bt(v))C=Nb(i,f.data,f.gc,C,v),S=y;else if(Bt(v))for(h=0,d=v.length;h<d;++h)w=v[h],!et(w)&&!Bt(w)&&(C=Nb(i,f.data,f.gc,C,w),S+=y);o.push(C),s.push(S),u=Math.max(C,u),c=Math.max(S,c)}XH(a,n);const E=o.indexOf(u),x=s.indexOf(c),g=I=>({width:o[I]||0,height:s[I]||0});return{first:g(0),last:g(n-1),widest:g(E),highest:g(x),widths:o,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return PL(this._alignToPixels?sa(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=KH(this.getContext(),t,r))}return this.$context||(this.$context=YH(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=ui(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),a=this._getLabelSizes(),o=t.autoSkipPadding||0,s=a?a.widest.width+o:0,l=a?a.highest.height+o:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:a,position:o,border:s}=i,l=a.offset,u=this.isHorizontal(),p=this.ticks.length+(l?1:0),h=es(a),d=[],v=s.setContext(this.getContext()),m=v.display?v.width:0,b=m/2,f=function(k){return sa(r,k,m)};let y,C,S,w,E,x,g,I,A,_,T,$;if(o==="top")y=f(this.bottom),x=this.bottom-h,I=y-b,_=f(t.top)+b,$=t.bottom;else if(o==="bottom")y=f(this.top),_=t.top,$=f(t.bottom)-b,x=y+b,I=this.top+h;else if(o==="left")y=f(this.right),E=this.right-h,g=y-b,A=f(t.left)+b,T=t.right;else if(o==="right")y=f(this.left),A=t.left,T=f(t.right)-b,E=y+b,g=this.left+h;else if(n==="x"){if(o==="center")y=f((t.top+t.bottom)/2+.5);else if(je(o)){const k=Object.keys(o)[0],O=o[k];y=f(this.chart.scales[k].getPixelForValue(O))}_=t.top,$=t.bottom,x=y+b,I=x+h}else if(n==="y"){if(o==="center")y=f((t.left+t.right)/2);else if(je(o)){const k=Object.keys(o)[0],O=o[k];y=f(this.chart.scales[k].getPixelForValue(O))}E=y-b,g=E-h,A=t.left,T=t.right}const B=Me(i.ticks.maxTicksLimit,p),P=Math.max(1,Math.ceil(p/B));for(C=0;C<p;C+=P){const k=this.getContext(C),O=a.setContext(k),M=s.setContext(k),G=O.lineWidth,W=O.color,U=M.dash||[],q=M.dashOffset,Q=O.tickWidth,Z=O.tickColor,ee=O.tickBorderDash||[],J=O.tickBorderDashOffset;S=UH(this,C,l),S!==void 0&&(w=sa(r,S,G),u?E=g=A=T=w:x=I=_=$=w,d.push({tx1:E,ty1:x,tx2:g,ty2:I,x1:A,y1:_,x2:T,y2:$,width:G,color:W,borderDash:U,borderDashOffset:q,tickWidth:Q,tickColor:Z,tickBorderDash:ee,tickBorderDashOffset:J}))}return this._ticksLength=p,this._borderValue=y,d}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:a}=r,o=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:p}=a,h=es(r.grid),d=h+c,v=p?-c:d,m=-ui(this.labelRotation),b=[];let f,y,C,S,w,E,x,g,I,A,_,T,$="middle";if(i==="top")E=this.bottom-v,x=this._getXAxisLabelAlignment();else if(i==="bottom")E=this.top+v,x=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(h);x=P.textAlign,w=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(h);x=P.textAlign,w=P.x}else if(n==="x"){if(i==="center")E=(t.top+t.bottom)/2+d;else if(je(i)){const P=Object.keys(i)[0],k=i[P];E=this.chart.scales[P].getPixelForValue(k)+d}x=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-d;else if(je(i)){const P=Object.keys(i)[0],k=i[P];w=this.chart.scales[P].getPixelForValue(k)}x=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?$="top":l==="end"&&($="bottom"));const B=this._getLabelSizes();for(f=0,y=s.length;f<y;++f){C=s[f],S=C.label;const P=a.setContext(this.getContext(f));g=this.getPixelForTick(f)+a.labelOffset,I=this._resolveTickFontOptions(f),A=I.lineHeight,_=Bt(S)?S.length:1;const k=_/2,O=P.color,M=P.textStrokeColor,G=P.textStrokeWidth;let W=x;o?(w=g,x==="inner"&&(f===y-1?W=this.options.reverse?"left":"right":f===0?W=this.options.reverse?"right":"left":W="center"),i==="top"?u==="near"||m!==0?T=-_*A+A/2:u==="center"?T=-B.highest.height/2-k*A+A:T=-B.highest.height+A/2:u==="near"||m!==0?T=A/2:u==="center"?T=B.highest.height/2-k*A:T=B.highest.height-_*A,p&&(T*=-1),m!==0&&!P.showLabelBackdrop&&(w+=A/2*Math.sin(m))):(E=g,T=(1-_)*A/2);let U;if(P.showLabelBackdrop){const q=ar(P.backdropPadding),Q=B.heights[f],Z=B.widths[f];let ee=T-q.top,J=0-q.left;switch($){case"middle":ee-=Q/2;break;case"bottom":ee-=Q;break}switch(x){case"center":J-=Z/2;break;case"right":J-=Z;break;case"inner":f===y-1?J-=Z:f>0&&(J-=Z/2);break}U={left:J,top:ee,width:Z+q.width,height:Q+q.height,color:P.backdropColor}}b.push({label:S,font:I,textOffset:T,options:{rotation:m,color:O,strokeColor:M,strokeWidth:G,textAlign:W,textBaseline:$,translation:[w,E],backdrop:U}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-ui(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:a}}=this.options,o=this._getLabelSizes(),s=t+a,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:a,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,a,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(a=>a.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,o;const s=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(a=0,o=i.length;a<o;++a){const l=i[a];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,a=r.setContext(this.getContext()),o=r.display?a.width:0;if(!o)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,p,h;this.isHorizontal()?(u=sa(t,this.left,o)-o/2,c=sa(t,this.right,s)+s/2,p=h=l):(p=sa(t,this.top,o)-o/2,h=sa(t,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(u,p),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&dd(r,i);const a=this.getLabelItems(t);for(const o of a){const s=o.options,l=o.font,u=o.label,c=o.textOffset;el(r,u,0,c,l,s)}i&&fd(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=pn(r.font),o=ar(r.padding),s=r.align;let l=a.lineHeight/2;n==="bottom"||n==="center"||je(n)?(l+=o.bottom,Bt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:p,rotation:h}=JH(this,l,n,s);el(t,r.text,0,0,a,{color:r.color,maxWidth:p,rotation:h,textAlign:ZH(s,n,i),textBaseline:"middle",translation:[u,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Me(t.grid&&t.grid.z,-1),i=Me(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Wo.prototype.draw?[{z:n,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,o;for(a=0,o=n.length;a<o;++a){const s=n[a];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return pn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class cu{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;ej(n)&&(r=this.register(n));const i=this.items,a=t.id,o=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,qH(t,o,r),this.override&&_t.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in _t[i]&&(delete _t[i][r],this.override&&delete Na[r])}}function qH(e,t,n){const r=Ks(Object.create(null),[n?_t.get(n):{},_t.get(t),e.defaults]);_t.set(t,r),e.defaultRoutes&&QH(t,e.defaultRoutes),e.descriptors&&_t.describe(t,e.descriptors)}function QH(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),a=[e].concat(r).join("."),o=t[n].split("."),s=o.pop(),l=o.join(".");_t.route(a,i,l,s)})}function ej(e){return"id"in e&&"defaults"in e}class tj{constructor(){this.controllers=new cu(Ea,"datasets",!0),this.elements=new cu(Ci,"elements"),this.plugins=new cu(Object,"plugins"),this.scales=new cu(Wo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):rt(i,o=>{const s=r||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,n,r){const i=Tp(t);ft(r["before"+i],[],r),n[t](r),ft(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Ar=new tj;class nj{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(a,t,n,r);return n==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const a of t){const o=a.plugin,s=o[r],l=[n,i,a.options];if(ft(s,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){et(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Me(r.options&&r.options.plugins,{}),a=rj(r);return i===!1&&!n?[]:aj(t,a,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(a,o)=>a.filter(s=>!o.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function rj(e){const t={},n=[],r=Object.keys(Ar.plugins.items);for(let a=0;a<r.length;a++)n.push(Ar.getPlugin(r[a]));const i=e.plugins||[];for(let a=0;a<i.length;a++){const o=i[a];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function ij(e,t){return!t&&e===!1?null:e===!0?{}:e}function aj(e,{plugins:t,localIds:n},r,i){const a=[],o=e.getContext();for(const s of t){const l=s.id,u=ij(r[l],i);u!==null&&a.push({plugin:s,options:oj(e.config,{plugin:s,local:n[l]},u,o)})}return a}function oj(e,{plugin:t,local:n},r,i){const a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function B0(e,t){const n=_t.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function sj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function lj(e,t){return e===t?"_index_":"_value_"}function cy(e){if(e==="x"||e==="y"||e==="r")return e}function uj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function k0(e,...t){if(cy(e))return e;for(const n of t){const r=n.axis||uj(n.position)||e.length>1&&cy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function dy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function cj(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return dy(e,"x",n[0])||dy(e,"y",n[0])}return{}}function dj(e,t){const n=Na[e.type]||{scales:{}},r=t.scales||{},i=B0(e.type,t),a=Object.create(null);return Object.keys(r).forEach(o=>{const s=r[o];if(!je(s))return console.error(`Invalid scale configuration for scale: ${o}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=k0(o,s,cj(o,e),_t.scales[s.type]),u=lj(l,i),c=n.scales||{};a[o]=ys(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||B0(s,t),c=(Na[s]||{}).scales||{};Object.keys(c).forEach(p=>{const h=sj(p,l),d=o[h+"AxisID"]||h;a[d]=a[d]||Object.create(null),ys(a[d],[{axis:h},r[d],c[p]])})}),Object.keys(a).forEach(o=>{const s=a[o];ys(s,[_t.scales[s.type],_t.scale])}),a}function Tw(e){const t=e.options||(e.options={});t.plugins=Me(t.plugins,{}),t.scales=dj(e,t)}function Aw(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function fj(e){return e=e||{},e.data=Aw(e.data),Tw(e),e}const fy=new Map,Rw=new Set;function du(e,t){let n=fy.get(e);return n||(n=t(),fy.set(e,n),Rw.add(n)),n}const ts=(e,t,n)=>{const r=Fa(t,n);r!==void 0&&e.add(r)};class hj{constructor(t){this._config=fj(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Aw(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Tw(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return du(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return du(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return du(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return du(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:a}=this,o=this._cachedScopes(t,r),s=o.get(n);if(s)return s;const l=new Set;n.forEach(c=>{t&&(l.add(t),c.forEach(p=>ts(l,t,p))),c.forEach(p=>ts(l,i,p)),c.forEach(p=>ts(l,Na[a]||{},p)),c.forEach(p=>ts(l,_t,p)),c.forEach(p=>ts(l,A0,p))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Rw.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Na[n]||{},_t.datasets[n]||{},{type:n},_t,A0]}resolveNamedOptions(t,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=hy(this._resolverCache,t,i);let l=o;if(pj(o,n)){a.$shared=!1,r=Ki(r)?r():r;const u=this.createResolver(t,r,s);l=Po(o,r,u)}for(const u of n)a[u]=l[u];return a}createResolver(t,n,r=[""],i){const{resolver:a}=hy(this._resolverCache,t,r);return je(n)?Po(a,n,void 0,i):a}}function hy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let a=r.get(i);return a||(a={resolver:$p(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,a)),a}const gj=e=>je(e)&&Object.getOwnPropertyNames(e).some(t=>Ki(e[t]));function pj(e,t){const{isScriptable:n,isIndexable:r}=uw(e);for(const i of t){const a=n(i),o=r(i),s=(o||a)&&e[i];if(a&&(Ki(s)||gj(s))||o&&Bt(s))return!0}return!1}var mj="4.5.0";const vj=["top","bottom","left","right","chartArea"];function gy(e,t){return e==="top"||e==="bottom"||vj.indexOf(e)===-1&&t==="x"}function py(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function my(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ft(n&&n.onComplete,[e],t)}function bj(e){const t=e.chart,n=t.options.animation;ft(n&&n.onProgress,[e],t)}function Bw(e){return Mp()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const $u={},vy=e=>{const t=Bw(e);return Object.values($u).filter(n=>n.canvas===t).pop()};function yj(e,t,n){const r=Object.keys(e);for(const i of r){const a=+i;if(a>=t){const o=e[i];delete e[i],(n>0||a>t)&&(e[a+n]=o)}}}function xj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var Ai;let za=(Ai=class{static register(...t){Ar.add(...t),by()}static unregister(...t){Ar.remove(...t),by()}constructor(t,n){const r=this.config=new hj(n),i=Bw(t),a=vy(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||OH(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,o.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=bL(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new nj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ML(p=>this.update(p),o.resizeDelay||0),this._dataChanges=[],$u[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ti.listen(this,"complete",my),ti.listen(this,"progress",bj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:a}=this;return et(t)?n&&a?a:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ar}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Vb(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mb(this.canvas,this.ctx),this}stop(){return ti.stop(this),this}resize(t,n){ti.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,a),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Vb(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),ft(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};rt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,s)=>(o[s]=!1,o),{});let a=[];n&&(a=a.concat(Object.keys(n).map(o=>{const s=n[o],l=k0(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),rt(a,o=>{const s=o.options,l=s.id,u=k0(l,s),c=Me(s.type,o.dtype);(s.position===void 0||gy(s.position,u)!==gy(o.dposition))&&(s.position=o.dposition),i[l]=!0;let p=null;if(l in r&&r[l].type===c)p=r[l];else{const h=Ar.getScale(c);p=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[p.id]=p}p.init(s,t)}),rt(i,(o,s)=>{o||delete r[s]}),rt(r,o=>{rr.configure(this,o,o.options),rr.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(py("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(a=>a===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const a=n[r];let o=this.getDatasetMeta(r);const s=a.type||this.config.type;if(o.type&&o.type!==s&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=s,o.indexAxis=a.indexAxis||B0(s,this.options),o.order=a.order||0,o.index=r,o.label=""+a.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Ar.getController(s),{datasetElementType:u,dataElementType:c}=_t.datasets[s];Object.assign(l,{dataElementType:Ar.getElement(c),datasetElementType:u&&Ar.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){rt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:p}=this.getDatasetMeta(u),h=!i&&a.indexOf(p)===-1;p.buildOrUpdateElements(h),o=Math.max(+p.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||rt(a,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(py("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){rt(this.scales,t=>{rr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Db(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:a}of n){const o=r==="_removeElements"?-a:a;yj(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=a=>new Set(t.filter(o=>o[0]===a).map((o,s)=>s+","+o.splice(1).join(","))),i=r(0);for(let a=1;a<n;a++)if(!Db(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;rr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],rt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Ki(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ti.has(this)?this.attached&&!ti.running(this)&&ti.start(this):(this.draw(),my({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,a;for(i=0,a=n.length;i<a;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=yw(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&dd(n,i),t.controller.draw(),i&&fd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Qs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const a=vH.modes[n];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ja(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",a=this.getDatasetMeta(t),o=a.controller._resolveAnimations(void 0,i);Zs(n)?(a.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(a,{visible:r}),this.update(s=>s.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ti.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Mb(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete $u[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(a,o)=>{n.addEventListener(this,a,o),t[a]=o},i=(a,o,s)=>{a.offsetX=o,a.offsetY=s,this._eventHandler(a)};rt(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},i=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},a=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",a),r("detach",o)};o=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():o()}unbindEvents(){rt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},rt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let a,o,s,l;for(n==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){o=t[s];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:a,index:o})=>{const s=this.getDatasetMeta(a);if(!s)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:s.data[o],index:o}});!bc(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,a=(l,u)=>l.filter(c=>!u.some(p=>c.datasetIndex===p.datasetIndex&&c.index===p.index)),o=a(n,t),s=r?t:a(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:a}=this,o=n,s=this._getActiveElements(t,i,r,o),l=wL(t),u=xj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,ft(a.onHover,[t,s,this],this),l&&ft(a.onClick,[t,s,this],this));const c=!bc(s,i);return(c||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=u,c}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},Ce(Ai,"defaults",_t),Ce(Ai,"instances",$u),Ce(Ai,"overrides",Na),Ce(Ai,"registry",Ar),Ce(Ai,"version",mj),Ce(Ai,"getChart",vy),Ai);function by(){return rt(za.instances,e=>e._plugins.invalidate())}function Cj(e,t,n){const{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:l}=t,{borderWidth:u,borderJoinStyle:c}=l,p=Math.min(u/o,Nn(r-n));if(e.beginPath(),e.arc(i,a,o-u/2,r+p/2,n-p/2),s>0){const h=Math.min(u/s,Nn(r-n));e.arc(i,a,s+u/2,n-h/2,r+h/2,!0)}else{const h=Math.min(u/2,o*Nn(r-n));if(c==="round")e.arc(i,a,h,n-it/2,r+it/2,!0);else if(c==="bevel"){const d=2*h*h,v=-d*Math.cos(n+it/2)+i,m=-d*Math.sin(n+it/2)+a,b=d*Math.cos(r+it/2)+i,f=d*Math.sin(r+it/2)+a;e.lineTo(v,m),e.lineTo(b,f)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ej(e,t,n){const{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:l}=t;let u=i/s;e.beginPath(),e.arc(a,o,s,r-u,n+u),l>i?(u=i/l,e.arc(a,o,l,n+u,r-u,!0)):e.arc(a,o,i,n+Lt,r-Lt),e.closePath(),e.clip()}function Sj(e){return Pp(e,["outerStart","outerEnd","innerStart","innerEnd"])}function wj(e,t,n,r){const i=Sj(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=l=>{const u=(n-Math.min(a,l))*r/2;return gn(l,0,Math.min(a,u))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:gn(i.innerStart,0,o),innerEnd:gn(i.innerEnd,0,o)}}function to(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function wc(e,t,n,r,i,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,p=Math.max(t.outerRadius+r+n-u,0),h=c>0?c+r+n+u:0;let d=0;const v=i-l;if(r){const P=c>0?c-r:0,k=p>0?p-r:0,O=(P+k)/2,M=O!==0?v*O/(O+r):v;d=(v-M)/2}const m=Math.max(.001,v*p-n/it)/p,b=(v-m)/2,f=l+b+d,y=i-b-d,{outerStart:C,outerEnd:S,innerStart:w,innerEnd:E}=wj(t,h,p,y-f),x=p-C,g=p-S,I=f+C/x,A=y-S/g,_=h+w,T=h+E,$=f+w/_,B=y-E/T;if(e.beginPath(),a){const P=(I+A)/2;if(e.arc(o,s,p,I,P),e.arc(o,s,p,P,A),S>0){const G=to(g,A,o,s);e.arc(G.x,G.y,S,A,y+Lt)}const k=to(T,y,o,s);if(e.lineTo(k.x,k.y),E>0){const G=to(T,B,o,s);e.arc(G.x,G.y,E,y+Lt,B+Math.PI)}const O=(y-E/h+(f+w/h))/2;if(e.arc(o,s,h,y-E/h,O,!0),e.arc(o,s,h,O,f+w/h,!0),w>0){const G=to(_,$,o,s);e.arc(G.x,G.y,w,$+Math.PI,f-Lt)}const M=to(x,f,o,s);if(e.lineTo(M.x,M.y),C>0){const G=to(x,I,o,s);e.arc(G.x,G.y,C,f-Lt,I)}}else{e.moveTo(o,s);const P=Math.cos(I)*p+o,k=Math.sin(I)*p+s;e.lineTo(P,k);const O=Math.cos(A)*p+o,M=Math.sin(A)*p+s;e.lineTo(O,M)}e.closePath()}function Ij(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){wc(e,t,n,r,l,i);for(let u=0;u<a;++u)e.fill();isNaN(s)||(l=o+(s%yt||yt))}return wc(e,t,n,r,l,i),e.fill(),l}function _j(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:p,borderDashOffset:h,borderRadius:d}=l,v=l.borderAlign==="inner";if(!u)return;e.setLineDash(p||[]),e.lineDashOffset=h,v?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let m=t.endAngle;if(a){wc(e,t,n,r,m,i);for(let b=0;b<a;++b)e.stroke();isNaN(s)||(m=o+(s%yt||yt))}v&&Ej(e,t,m),l.selfJoin&&m-o>=it&&d===0&&c!=="miter"&&Cj(e,t,m),a||(wc(e,t,n,r,m,i),e.stroke())}class fs extends Ci{constructor(n){super();Ce(this,"circumference");Ce(this,"endAngle");Ce(this,"fullCircles");Ce(this,"innerRadius");Ce(this,"outerRadius");Ce(this,"pixelMargin");Ce(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const a=this.getProps(["x","y"],i),{angle:o,distance:s}=tw(a,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:p,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,v=Me(h,u-l),m=qs(o,l,u)&&l!==u,b=v>=yt||m,f=ci(s,c+d,p+d);return b&&f}getCenterPoint(n){const{x:r,y:i,startAngle:a,endAngle:o,innerRadius:s,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:c}=this.options,p=(a+o)/2,h=(s+l+c+u)/2;return{x:r+Math.cos(p)*h,y:i+Math.sin(p)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,a=(r.offset||0)/4,o=(r.spacing||0)/2,s=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>yt?Math.floor(i/yt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*a,Math.sin(l)*a);const u=1-Math.sin(Math.min(it,i||0)),c=a*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Ij(n,this,c,o,s),_j(n,this,c,o,s),n.restore()}}Ce(fs,"id","arc"),Ce(fs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),Ce(fs,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ce(fs,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function kw(e,t,n=t){e.lineCap=Me(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Me(n.borderDash,t.borderDash)),e.lineDashOffset=Me(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Me(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Me(n.borderWidth,t.borderWidth),e.strokeStyle=Me(n.borderColor,t.borderColor)}function Dj(e,t,n){e.lineTo(n.x,n.y)}function Tj(e){return e.stepped?JL:e.tension||e.cubicInterpolationMode==="monotone"?qL:Dj}function Pw(e,t,n={}){const r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,l=Math.max(i,o),u=Math.min(a,s),c=i<o&&a<o||i>s&&a>s;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function Aj(e,t,n,r){const{points:i,options:a}=t,{count:o,start:s,loop:l,ilen:u}=Pw(i,n,r),c=Tj(a);let{move:p=!0,reverse:h}=r||{},d,v,m;for(d=0;d<=u;++d)v=i[(s+(h?u-d:d))%o],!v.skip&&(p?(e.moveTo(v.x,v.y),p=!1):c(e,m,v,h,a.stepped),m=v);return l&&(v=i[(s+(h?u:0))%o],c(e,m,v,h,a.stepped)),!!l}function Rj(e,t,n,r){const i=t.points,{count:a,start:o,ilen:s}=Pw(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,p=0,h,d,v,m,b,f;const y=S=>(o+(u?s-S:S))%a,C=()=>{m!==b&&(e.lineTo(c,b),e.lineTo(c,m),e.lineTo(c,f))};for(l&&(d=i[y(0)],e.moveTo(d.x,d.y)),h=0;h<=s;++h){if(d=i[y(h)],d.skip)continue;const S=d.x,w=d.y,E=S|0;E===v?(w<m?m=w:w>b&&(b=w),c=(p*c+S)/++p):(C(),e.lineTo(S,w),v=E,p=0,m=b=w),f=w}C()}function P0(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Rj:Aj}function Bj(e){return e.stepped?RV:e.tension||e.cubicInterpolationMode==="monotone"?BV:da}function kj(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),kw(e,t.options),e.stroke(i)}function Pj(e,t,n,r){const{segments:i,options:a}=t,o=P0(t);for(const s of i)kw(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const $j=typeof Path2D=="function";function Fj(e,t,n,r){$j&&!t.options.segment?kj(e,t,n,r):Pj(e,t,n,r)}class Nr extends Ci{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;EV(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=MV(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],a=this.points,o=bw(this,{property:n,start:i,end:i});if(!o.length)return;const s=[],l=Bj(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:p,end:h}=o[u],d=a[p],v=a[h];if(d===v){s.push(d);continue}const m=Math.abs((i-d[n])/(v[n]-d[n])),b=l(d,v,m,r.stepped);b[n]=t[n],s.push(b)}return s.length===1?s[0]:s}pathSegment(t,n,r){return P0(this)(t,this,n,r)}path(t,n,r){const i=this.segments,a=P0(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)o&=a(t,this,s,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),Fj(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ce(Nr,"id","line"),Ce(Nr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ce(Nr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ce(Nr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function yy(e,t,n,r){const i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}class Sa extends Ci{constructor(n){super();Ce(this,"parsed");Ce(this,"skip");Ce(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const a=this.options,{x:o,y:s}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-s,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(n,r){return yy(this,n,"x",r)}inYRange(n,r){return yy(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!Qs(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,R0(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ce(Sa,"id","point"),Ce(Sa,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ce(Sa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function $w(e,t){const{x:n,y:r,base:i,width:a,height:o}=e.getProps(["x","y","base","width","height"],t);let s,l,u,c,p;return e.horizontal?(p=o/2,s=Math.min(n,i),l=Math.max(n,i),u=r-p,c=r+p):(p=a/2,s=n-p,l=n+p,u=Math.min(r,i),c=Math.max(r,i)),{left:s,top:u,right:l,bottom:c}}function Hi(e,t,n,r){return e?0:gn(t,n,r)}function Nj(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,a=lw(r);return{t:Hi(i.top,a.top,0,n),r:Hi(i.right,a.right,0,t),b:Hi(i.bottom,a.bottom,0,n),l:Hi(i.left,a.left,0,t)}}function Mj(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,a=Eo(i),o=Math.min(t,n),s=e.borderSkipped,l=r||je(i);return{topLeft:Hi(!l||s.top||s.left,a.topLeft,0,o),topRight:Hi(!l||s.top||s.right,a.topRight,0,o),bottomLeft:Hi(!l||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:Hi(!l||s.bottom||s.right,a.bottomRight,0,o)}}function Oj(e){const t=$w(e),n=t.right-t.left,r=t.bottom-t.top,i=Nj(e,n/2,r/2),a=Mj(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function dh(e,t,n,r){const i=t===null,a=n===null,s=e&&!(i&&a)&&$w(e,r);return s&&(i||ci(t,s.left,s.right))&&(a||ci(n,s.top,s.bottom))}function Lj(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Vj(e,t){e.rect(t.x,t.y,t.w,t.h)}function fh(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,a=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}class Fu extends Ci{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:a,outer:o}=Oj(this),s=Lj(o.radius)?Cc:Vj;t.save(),(o.w!==a.w||o.h!==a.h)&&(t.beginPath(),s(t,fh(o,n,a)),t.clip(),s(t,fh(a,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,fh(a,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return dh(this,t,n,r)}inXRange(t,n){return dh(this,t,null,n)}inYRange(t,n){return dh(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(n+i)/2:n,y:a?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Ce(Fu,"id","bar"),Ce(Fu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ce(Fu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hj(e,t,n){const r=e.segments,i=e.points,a=t.points,o=[];for(const s of r){let{start:l,end:u}=s;u=pd(l,u,i);const c=$0(n,i[l],i[u],s.loop);if(!t.segments){o.push({source:s,target:c,start:i[l],end:i[u]});continue}const p=bw(t,c);for(const h of p){const d=$0(n,a[h.start],a[h.end],h.loop),v=vw(s,i,d);for(const m of v)o.push({source:m,target:h,start:{[n]:xy(c,d,"start",Math.max)},end:{[n]:xy(c,d,"end",Math.min)}})}}return o}function $0(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e==="angle"&&(i=Nn(i),a=Nn(a)),{property:e,start:i,end:a}}function jj(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:o,end:s})=>{s=pd(o,s,i);const l=i[o],u=i[s];r!==null?(a.push({x:l.x,y:r}),a.push({x:u.x,y:r})):n!==null&&(a.push({x:n,y:l.y}),a.push({x:n,y:u.y}))}),a}function pd(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function xy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Fw(e,t){let n=[],r=!1;return Bt(e)?(r=!0,n=e):n=jj(e,t),n.length?new Nr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Cy(e){return e&&e.fill!==!1}function zj(e,t,n){let i=e[t].fill;const a=[t];let o;if(!n)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!mn(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;a.push(i),i=o.fill}return!1}function Gj(e,t,n){const r=Yj(e);if(je(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return mn(i)&&Math.floor(i)===i?Wj(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Wj(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Uj(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:je(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Xj(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:je(e)?r=e.value:r=t.getBaseValue(),r}function Yj(e){const t=e.options,n=t.fill;let r=Me(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Kj(e){const{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Zj(t,n);s.push(Fw({x:null,y:t.bottom},r));for(let l=0;l<a.length;l++){const u=a[l];for(let c=u.start;c<=u.end;c++)Jj(i,o[c],s)}return new Nr({points:i,options:{}})}function Zj(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const a=r[i];if(a.index===t)break;a.hidden||n.unshift(a.dataset)}return n}function Jj(e,t,n){const r=[];for(let i=0;i<n.length;i++){const a=n[i],{first:o,last:s,point:l}=qj(a,t,"x");if(!(!l||o&&s)){if(o)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function qj(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],a=e.segments,o=e.points;let s=!1,l=!1;for(let u=0;u<a.length;u++){const c=a[u],p=o[c.start][n],h=o[c.end][n];if(ci(i,p,h)){s=i===p,l=i===h;break}}return{first:s,last:l,point:r}}class Nw{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:a,radius:o}=this;return n=n||{start:0,end:yt},t.arc(i,a,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,a=t.angle;return{x:n+Math.cos(a)*i,y:r+Math.sin(a)*i,angle:a}}}function Qj(e){const{chart:t,fill:n,line:r}=e;if(mn(n))return ez(t,n);if(n==="stack")return Kj(e);if(n==="shape")return!0;const i=tz(e);return i instanceof Nw?i:Fw(i,r)}function ez(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function tz(e){return(e.scale||{}).getPointPositionForValue?rz(e):nz(e)}function nz(e){const{scale:t={},fill:n}=e,r=Uj(n,t);if(mn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function rz(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=Xj(n,t,a),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new Nw({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)s.push(t.getPointPositionForValue(l,o));return s}function hh(e,t,n){const r=Qj(t),{chart:i,index:a,line:o,scale:s,axis:l}=t,u=o.options,c=u.fill,p=u.backgroundColor,{above:h=p,below:d=p}=c||{},v=i.getDatasetMeta(a),m=yw(i,v);r&&o.points.length&&(dd(e,n),iz(e,{line:o,target:r,above:h,below:d,area:n,scale:s,axis:l,clip:m}),fd(e))}function iz(e,t){const{line:n,target:r,above:i,below:a,area:o,scale:s,clip:l}=t,u=n._loop?"angle":t.axis;e.save();let c=a;a!==i&&(u==="x"?(Ey(e,r,o.top),gh(e,{line:n,target:r,color:i,scale:s,property:u,clip:l}),e.restore(),e.save(),Ey(e,r,o.bottom)):u==="y"&&(Sy(e,r,o.left),gh(e,{line:n,target:r,color:a,scale:s,property:u,clip:l}),e.restore(),e.save(),Sy(e,r,o.right),c=i)),gh(e,{line:n,target:r,color:c,scale:s,property:u,clip:l}),e.restore()}function Ey(e,t,n){const{segments:r,points:i}=t;let a=!0,o=!1;e.beginPath();for(const s of r){const{start:l,end:u}=s,c=i[l],p=i[pd(l,u,i)];a?(e.moveTo(c.x,c.y),a=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(p.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Sy(e,t,n){const{segments:r,points:i}=t;let a=!0,o=!1;e.beginPath();for(const s of r){const{start:l,end:u}=s,c=i[l],p=i[pd(l,u,i)];a?(e.moveTo(c.x,c.y),a=!1):(e.lineTo(n,c.y),e.lineTo(c.x,c.y)),o=!!t.pathSegment(e,s,{move:o}),o?e.closePath():e.lineTo(n,p.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function gh(e,t){const{line:n,target:r,property:i,color:a,scale:o,clip:s}=t,l=Hj(n,r,i);for(const{source:u,target:c,start:p,end:h}of l){const{style:{backgroundColor:d=a}={}}=u,v=r!==!0;e.save(),e.fillStyle=d,az(e,o,s,v&&$0(i,p,h)),e.beginPath();const m=!!n.pathSegment(e,u);let b;if(v){m?e.closePath():wy(e,r,h,i);const f=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&f,b||wy(e,r,p,i)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function az(e,t,n,r){const i=t.chart.chartArea,{property:a,start:o,end:s}=r||{};if(a==="x"||a==="y"){let l,u,c,p;a==="x"?(l=o,u=i.top,c=s,p=i.bottom):(l=i.left,u=o,c=i.right,p=s),e.beginPath(),n&&(l=Math.max(l,n.left),c=Math.min(c,n.right),u=Math.max(u,n.top),p=Math.min(p,n.bottom)),e.rect(l,u,c-l,p-u),e.clip()}}function wy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Mw={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let a,o,s,l;for(o=0;o<r;++o)a=e.getDatasetMeta(o),s=a.dataset,l=null,s&&s.options&&s instanceof Nr&&(l={visible:e.isDatasetVisible(o),index:o,fill:Gj(s,o,r),chart:e,axis:a.controller.options.indexAxis,scale:a.vScale,line:s}),a.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=zj(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),a=e.chartArea;for(let o=i.length-1;o>=0;--o){const s=i[o].$filler;s&&(s.line.updateControlPoints(a,s.axis),r&&s.fill&&hh(e.ctx,s,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const a=r[i].$filler;Cy(a)&&hh(e.ctx,a,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Cy(r)||n.drawTime!=="beforeDatasetDraw"||hh(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Iy=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},oz=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class _y extends Ci{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=pn(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=Iy(r,a);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,a,s,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,s,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:a,maxWidth:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+s;let p=t;a.textAlign="left",a.textBaseline="middle";let h=-1,d=-c;return this.legendItems.forEach((v,m)=>{const b=r+n/2+a.measureText(v.text).width;(m===0||u[u.length-1]+b+2*s>o)&&(p+=c,u[u.length-(m>0?0:1)]=0,d+=c,h++),l[m]={left:0,top:d,row:h,width:b,height:i},u[u.length-1]+=b+s}),p}_fitCols(t,n,r,i){const{ctx:a,maxHeight:o,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-t;let p=s,h=0,d=0,v=0,m=0;return this.legendItems.forEach((b,f)=>{const{itemWidth:y,itemHeight:C}=sz(r,n,a,b,i);f>0&&d+C+2*s>c&&(p+=h+s,u.push({width:h,height:d}),v+=h+s,m++,h=d=0),l[f]={left:v,top:d,col:m,width:y,height:C},h=Math.max(h,y),d+=C+s}),p+=h,u.push({width:h,height:d}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=So(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=fn(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=fn(r,this.left+i,this.right-this.lineWidths[s])),u.top+=this.top+t+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let s=0,l=fn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=fn(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;dd(t,this),this._draw(),fd(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=t,s=_t.color,l=So(t.rtl,this.left,this.width),u=pn(o.font),{padding:c}=o,p=u.size,h=p/2;let d;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:v,boxHeight:m,itemHeight:b}=Iy(o,p),f=function(E,x,g){if(isNaN(v)||v<=0||isNaN(m)||m<0)return;i.save();const I=Me(g.lineWidth,1);if(i.fillStyle=Me(g.fillStyle,s),i.lineCap=Me(g.lineCap,"butt"),i.lineDashOffset=Me(g.lineDashOffset,0),i.lineJoin=Me(g.lineJoin,"miter"),i.lineWidth=I,i.strokeStyle=Me(g.strokeStyle,s),i.setLineDash(Me(g.lineDash,[])),o.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:g.pointStyle,rotation:g.rotation,borderWidth:I},_=l.xPlus(E,v/2),T=x+h;sw(i,A,_,T,o.pointStyleWidth&&v)}else{const A=x+Math.max((p-m)/2,0),_=l.leftForLtr(E,v),T=Eo(g.borderRadius);i.beginPath(),Object.values(T).some($=>$!==0)?Cc(i,{x:_,y:A,w:v,h:m,radius:T}):i.rect(_,A,v,m),i.fill(),I!==0&&i.stroke()}i.restore()},y=function(E,x,g){el(i,g.text,E,x+b/2,u,{strikethrough:g.hidden,textAlign:l.textAlign(g.textAlign)})},C=this.isHorizontal(),S=this._computeTitleHeight();C?d={x:fn(a,this.left+c,this.right-r[0]),y:this.top+c+S,line:0}:d={x:this.left+c,y:fn(a,this.top+S+c,this.bottom-n[0].height),line:0},gw(this.ctx,t.textDirection);const w=b+c;this.legendItems.forEach((E,x)=>{i.strokeStyle=E.fontColor,i.fillStyle=E.fontColor;const g=i.measureText(E.text).width,I=l.textAlign(E.textAlign||(E.textAlign=o.textAlign)),A=v+h+g;let _=d.x,T=d.y;l.setWidth(this.width),C?x>0&&_+A+c>this.right&&(T=d.y+=w,d.line++,_=d.x=fn(a,this.left+c,this.right-r[d.line])):x>0&&T+w>this.bottom&&(_=d.x=_+n[d.line].width+c,d.line++,T=d.y=fn(a,this.top+S+c,this.bottom-n[d.line].height));const $=l.x(_);if(f($,T,E),_=OL(I,_+v+h,C?_+A:this.right,t.rtl),y(l.x(_),T,E),C)d.x+=A+c;else if(typeof E.text!="string"){const B=u.lineHeight;d.y+=Ow(E,B)+c}else d.y+=w}),pw(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=pn(n.font),i=ar(n.padding);if(!n.display)return;const a=So(t.rtl,this.left,this.width),o=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,p=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,p=fn(t.align,p,this.right-h);else{const v=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);c=u+fn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const d=fn(s,p,p+h);o.textAlign=a.textAlign(Rp(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,el(o,n.text,d,c,r)}_computeTitleHeight(){const t=this.options.title,n=pn(t.font),r=ar(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,a;if(ci(t,this.left,this.right)&&ci(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],ci(t,i.left,i.left+i.width)&&ci(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!cz(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=oz(i,r);i&&!a&&ft(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&ft(n.onHover,[t,r,this],this)}else r&&ft(n.onClick,[t,r,this],this)}}function sz(e,t,n,r,i){const a=lz(r,e,t,n),o=uz(i,r,t.lineHeight);return{itemWidth:a,itemHeight:o}}function lz(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((a,o)=>a.length>o.length?a:o)),t+n.size/2+r.measureText(i).width}function uz(e,t,n){let r=e;return typeof t.text!="string"&&(r=Ow(t,n)),r}function Ow(e,t){const n=e.text?e.text.length:0;return t*n}function cz(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Lw={id:"legend",_element:_y,start(e,t,n){const r=e.legend=new _y({ctx:e.ctx,options:n,chart:e});rr.configure(e,r,n),rr.addBox(e,r)},stop(e){rr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;rr.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=ar(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:o&&(s||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Vw extends Ci{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Bt(r.text)?r.text.length:1;this._padding=ar(r.padding);const a=i*pn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:a,options:o}=this,s=o.align;let l=0,u,c,p;return this.isHorizontal()?(c=fn(s,r,a),p=n+t,u=a-r):(o.position==="left"?(c=r+t,p=fn(s,i,n),l=it*-.5):(c=a-t,p=fn(s,n,i),l=it*.5),u=i-n),{titleX:c,titleY:p,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=pn(n.font),a=r.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);el(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Rp(n.align),textBaseline:"middle",translation:[o,s]})}}function dz(e,t){const n=new Vw({ctx:e.ctx,options:t,chart:e});rr.configure(e,n,t),rr.addBox(e,n),e.titleBlock=n}var Hw={id:"title",_element:Vw,start(e,t,n){dz(e,n)},stop(e){const t=e.titleBlock;rr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;rr.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,a,o,s;for(a=0,o=e.length;a<o;++a){const l=e[a].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=T0(t,u);c<i&&(i=c,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Dr(e,t){return t&&(Bt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ni(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
180
180
  `)>-1?e.split(`
181
- `):e}function fz(e,t){const{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Dy(e,t){const n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,l=gn(t.bodyFont),u=gn(t.titleFont),c=gn(t.footerFont),p=a.length,h=i.length,d=r.length,v=ar(t.padding);let m=v.height,b=0,f=r.reduce((S,w)=>S+w.before.length+w.lines.length+w.after.length,0);if(f+=e.beforeBody.length+e.afterBody.length,p&&(m+=p*u.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),f){const S=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=d*S+(f-d)*l.lineHeight+(f-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*c.lineHeight+(h-1)*t.footerSpacing);let y=0;const C=function(S){b=Math.max(b,n.measureText(S).width+y)};return n.save(),n.font=u.string,rt(e.title,C),n.font=l.string,rt(e.beforeBody.concat(e.afterBody),C),y=t.displayColors?o+2+t.boxPadding:0,rt(r,S=>{rt(S.before,C),rt(S.lines,C),rt(S.after,C)}),y=0,n.font=c.string,rt(e.footer,C),n.restore(),b+=v.width,{width:b,height:m}}function hz(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function gz(e,t,n,r){const{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+a+o>t.width||e==="right"&&i-a-o<0)return!0}function pz(e,t,n,r){const{x:i,width:a}=n,{width:o,chartArea:{left:s,right:l}}=e;let u="center";return r==="center"?u=i<=(s+l)/2?"left":"right":i<=a/2?u="left":i>=o-a/2&&(u="right"),gz(u,e,t,n)&&(u="center"),u}function Ty(e,t,n){const r=n.yAlign||t.yAlign||hz(e,n);return{xAlign:n.xAlign||t.xAlign||pz(e,t,n,r),yAlign:r}}function mz(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function vz(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Ay(e,t,n,r){const{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:l}=n,u=i+a,{topLeft:c,topRight:p,bottomLeft:h,bottomRight:d}=Eo(o);let v=mz(t,s);const m=vz(t,l,u);return l==="center"?s==="left"?v+=u:s==="right"&&(v-=u):s==="left"?v-=Math.max(c,h)+i:s==="right"&&(v+=Math.max(p,d)+i),{x:hn(v,0,r.width-t.width),y:hn(m,0,r.height-t.height)}}function fu(e,t,n){const r=ar(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Ry(e){return Dr([],ni(e))}function bz(e,t,n){return ja(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function By(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jw={beforeTitle:Qr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Qr,beforeBody:Qr,beforeLabel:Qr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Qe(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Qr,afterBody:Qr,beforeFooter:Qr,footer:Qr,afterFooter:Qr};function _n(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?jw[t].call(n,r):i}var wh;let ky=(wh=class extends Ci{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,a=new xw(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=bz(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=_n(r,"beforeTitle",this,t),a=_n(r,"title",this,t),o=_n(r,"afterTitle",this,t);let s=[];return s=Dr(s,ni(i)),s=Dr(s,ni(a)),s=Dr(s,ni(o)),s}getBeforeBody(t,n){return Ry(_n(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return rt(t,a=>{const o={before:[],lines:[],after:[]},s=By(r,a);Dr(o.before,ni(_n(s,"beforeLabel",this,a))),Dr(o.lines,_n(s,"label",this,a)),Dr(o.after,ni(_n(s,"afterLabel",this,a))),i.push(o)}),i}getAfterBody(t,n){return Ry(_n(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=_n(r,"beforeFooter",this,t),a=_n(r,"footer",this,t),o=_n(r,"afterFooter",this,t);let s=[];return s=Dr(s,ni(i)),s=Dr(s,ni(a)),s=Dr(s,ni(o)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],a=[],o=[];let s=[],l,u;for(l=0,u=n.length;l<u;++l)s.push(fz(this.chart,n[l]));return t.filter&&(s=s.filter((c,p,h)=>t.filter(c,p,h,r))),t.itemSort&&(s=s.sort((c,p)=>t.itemSort(c,p,r))),rt(s,c=>{const p=By(t.callbacks,c);i.push(_n(p,"labelColor",this,c)),a.push(_n(p,"labelPointStyle",this,c)),o.push(_n(p,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let a,o=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const s=hs[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Dy(this,r),u=Object.assign({},s,l),c=Ty(this.chart,r,u),p=Ay(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:p.x,y:p.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const a=this.getCaretPosition(t,r,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:a}=this,{caretSize:o,cornerRadius:s}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:p}=Eo(s),{x:h,y:d}=t,{width:v,height:m}=n;let b,f,y,C,S,w;return a==="center"?(S=d+m/2,i==="left"?(b=h,f=b-o,C=S+o,w=S-o):(b=h+v,f=b+o,C=S-o,w=S+o),y=b):(i==="left"?f=h+Math.max(l,c)+o:i==="right"?f=h+v-Math.max(u,p)-o:f=this.caretX,a==="top"?(C=d,S=C-o,b=f-o,y=f+o):(C=d+m,S=C+o,b=f+o,y=f-o),w=C),{x1:b,x2:f,x3:y,y1:C,y2:S,y3:w}}drawTitle(t,n,r){const i=this.title,a=i.length;let o,s,l;if(a){const u=So(r.rtl,this.x,this.width);for(t.x=fu(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=gn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<a;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s,l+1===a&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,a){const o=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=a,c=gn(a.bodyFont),p=fu(this,"left",a),h=i.x(p),d=l<c.lineHeight?(c.lineHeight-l)/2:0,v=n.y+d;if(a.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},b=i.leftForLtr(h,u)+u/2,f=v+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,R0(t,m,b,f),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,R0(t,m,b,f)}else{t.lineWidth=je(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(h,u),b=i.leftForLtr(i.xPlus(h,1),u-2),f=Eo(o.borderRadius);Object.values(f).some(y=>y!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Cc(t,{x:m,y:v,w:u,h:l,radius:f}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Cc(t,{x:b,y:v+1,w:u-2,h:l-2,radius:f}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,v,u,l),t.strokeRect(m,v,u,l),t.fillStyle=o.backgroundColor,t.fillRect(b,v+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:a,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=r,p=gn(r.bodyFont);let h=p.lineHeight,d=0;const v=So(r.rtl,this.x,this.width),m=function(g){n.fillText(g,v.x(t.x+d),t.y+h/2),t.y+=h+a},b=v.textAlign(o);let f,y,C,S,w,E,x;for(n.textAlign=o,n.textBaseline="middle",n.font=p.string,t.x=fu(this,b,r),n.fillStyle=r.bodyColor,rt(this.beforeBody,m),d=s&&b!=="right"?o==="center"?u/2+c:u+2+c:0,S=0,E=i.length;S<E;++S){for(f=i[S],y=this.labelTextColors[S],n.fillStyle=y,rt(f.before,m),C=f.lines,s&&C.length&&(this._drawColorBox(n,t,S,v,r),h=Math.max(p.lineHeight,l)),w=0,x=C.length;w<x;++w)m(C[w]),h=p.lineHeight;rt(f.after,m)}d=0,h=p.lineHeight,rt(this.afterBody,m),t.y-=a}drawFooter(t,n,r){const i=this.footer,a=i.length;let o,s;if(a){const l=So(r.rtl,this.x,this.width);for(t.x=fu(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=gn(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,s=0;s<a;++s)n.fillText(i[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:a,yAlign:o}=this,{x:s,y:l}=t,{width:u,height:c}=r,{topLeft:p,topRight:h,bottomLeft:d,bottomRight:v}=Eo(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+p,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+u-h,l),n.quadraticCurveTo(s+u,l,s+u,l+h),o==="center"&&a==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+u,l+c-v),n.quadraticCurveTo(s+u,l+c,s+u-v,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+d,l+c),n.quadraticCurveTo(s,l+c,s,l+c-d),o==="center"&&a==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+p),n.quadraticCurveTo(s,l,s+p,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const o=hs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=Dy(this,t),l=Object.assign({},o,this._size),u=Ty(n,t,l),c=Ay(t,l,u,n);(i._to!==c.x||a._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=ar(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(a,t,i,n),gw(t,n.textDirection),a.y+=o.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),pw(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),a=!bc(r,i),o=this._positionChanged(i,n);(a||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],o=this._getActiveElements(t,a,n,r),s=this._positionChanged(o,t),l=n||!bc(o,a)||s;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:a}=this,o=hs[a.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}},Ce(wh,"positioners",hs),wh);var nl={id:"tooltip",_element:ky,positioners:hs,afterInit(e,t,n){n&&(e.tooltip=new ky({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jw},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yz=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function xz(e,t,n,r){const i=e.indexOf(t);if(i===-1)return yz(e,t,n,r);const a=e.lastIndexOf(t);return i!==a?n:i}const Cz=(e,t)=>e===null?null:hn(Math.round(e),0,t);function Py(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Fo extends Wo{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:a}of n)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Qe(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:xz(r,t,Me(n,t),this._addedLabels),Cz(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let a=this.getLabels();a=t===0&&n===a.length-1?a:a.slice(t,n+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return Py.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ce(Fo,"id","category"),Ce(Fo,"defaults",{ticks:{callback:Py}});function Ez(e,t){const n=[],{bounds:i,step:a,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:p,includeBounds:h}=e,d=a||1,v=c-1,{min:m,max:b}=t,f=!Qe(o),y=!Qe(s),C=!Qe(u),S=(b-m)/(p+1);let w=Ab((b-m)/v/d)*d,E,x,g,I;if(w<1e-14&&!f&&!y)return[{value:m},{value:b}];I=Math.ceil(b/w)-Math.floor(m/w),I>v&&(w=Ab(I*w/v/d)*d),Qe(l)||(E=Math.pow(10,l),w=Math.ceil(w*E)/E),i==="ticks"?(x=Math.floor(m/w)*w,g=Math.ceil(b/w)*w):(x=m,g=b),f&&y&&a&&AL((s-o)/a,w/1e3)?(I=Math.round(Math.min((s-o)/w,c)),w=(s-o)/I,x=o,g=s):C?(x=f?o:x,g=y?s:g,I=u-1,w=(g-x)/I):(I=(g-x)/w,xs(I,Math.round(I),w/1e3)?I=Math.round(I):I=Math.ceil(I));const A=Math.max(Rb(w),Rb(x));E=Math.pow(10,Qe(l)?A:l),x=Math.round(x*E)/E,g=Math.round(g*E)/E;let _=0;for(f&&(h&&x!==o?(n.push({value:o}),x<o&&_++,xs(Math.round((x+_*w)*E)/E,o,$y(o,S,e))&&_++):x<o&&_++);_<I;++_){const T=Math.round((x+_*w)*E)/E;if(y&&T>s)break;n.push({value:T})}return y&&h&&g!==s?n.length&&xs(n[n.length-1].value,s,$y(s,S,e))?n[n.length-1].value=s:n.push({value:s}):(!y||g===s)&&n.push({value:g}),n}function $y(e,t,{horizontal:n,minRotation:r}){const i=ui(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/a,o)}class Sz extends Wo{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Qe(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:a}=this;const o=l=>i=n?i:l,s=l=>a=r?a:l;if(t){const l=Hr(i),u=Hr(a);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);s(a+l),t||o(i-l)}this.min=i,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},a=this._range||this,o=Ez(i,a);return t.bounds==="ticks"&&RL(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return kp(t,this.chart.options.locale,this.options.ticks.format)}}class No extends Sz{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=pn(t)?t:0,this.max=pn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=ui(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,a.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ce(No,"id","linear"),Ce(No,"defaults",{ticks:{callback:ow.formatters.numeric}});const md={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Tn=Object.keys(md);function Fy(e,t){return e-t}function Ny(e,t){if(Qe(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),pn(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Js(a)||a===!0)?n.startOf(o,"isoWeek",a):n.startOf(o,i)),+o)}function My(e,t,n,r){const i=Tn.length;for(let a=Tn.indexOf(e);a<i-1;++a){const o=md[Tn[a]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(s*o.size))<=r)return Tn[a]}return Tn[i-1]}function wz(e,t,n,r,i){for(let a=Tn.length-1;a>=Tn.indexOf(n);a--){const o=Tn[a];if(md[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Tn[n?Tn.indexOf(n):0]}function Iz(e){for(let t=Tn.indexOf(e)+1,n=Tn.length;t<n;++t)if(md[Tn[t]].common)return Tn[t]}function Oy(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ap(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function _z(e,t,n,r){const i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value;let s,l;for(s=a;s<=o;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function Ly(e,t,n){const r=[],i={},a=t.length;let o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:_z(e,r,i,n)}class Ic extends Wo{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new fH._date(t.adapters.date);i.init(n),ys(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Ny(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:a,minDefined:o,maxDefined:s}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!s&&!isNaN(u.max)&&(a=Math.max(a,u.max))}(!o||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=pn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),a=pn(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,o=this.max,s=FL(i,a,o);return this._unit=n.unit||(r.autoSkip?My(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):wz(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Iz(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),Ly(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=hn(n,0,o),r=hn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,a=i.time,o=a.unit||My(a.minUnit,n,r,this._getLabelCapacity(n)),s=Me(i.ticks.stepSize,1),l=o==="week"?a.isoWeekday:!1,u=Js(l)||l===!0,c={};let p=n,h,d;if(u&&(p=+t.startOf(p,"isoWeek",l)),p=+t.startOf(p,u?"day":o),t.diff(r,n,o)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+o);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(h=p,d=0;h<r;h=+t.add(h,s,o),d++)Oy(c,h,v);return(h===r||i.bounds==="ticks"||d===1)&&Oy(c,h,v),Object.keys(c).sort(Fy).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,a=this._unit,o=n||i[a];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const a=this.options,o=a.ticks.callback;if(o)return ft(o,[t,n,r],this);const s=a.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],p=u&&s[u],h=r[n],d=u&&p&&h&&h.major;return this._adapter.format(t,i||(d?p:c))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=ui(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(i),o=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*a+s*o,h:r*o+s*a}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,a=this._tickFormatFunction(t,0,Ly(this,[t],this._majorUnit),i),o=this._getLabelSize(a),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(Ny(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rw(t.sort(Fy))}}Ce(Ic,"id","time"),Ce(Ic,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function hu(e,t,n){let r=0,i=e.length-1,a,o,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ba(e,"pos",t)),{pos:a,time:s}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ba(e,"time",t)),{time:a,pos:s}=e[r],{time:o,pos:l}=e[i]);const u=o-a;return u?s+(l-s)*(t-a)/u:s}class Vy extends Ic{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=hu(n,this.min),this._tableRange=hu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],a=[];let o,s,l,u,c;for(o=0,s=t.length;o<s;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,s=i.length;o<s;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&a.push({time:u,pos:o/(s-1)});return a}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,a)=>i-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(hu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return hu(this._table,r*this._tableRange+this._minPos,!0)}}Ce(Vy,"id","timeseries"),Ce(Vy,"defaults",Ic.defaults);const zw="label";function Hy(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Dz(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Gw(e,t){e.labels=t}function Ww(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zw;const r=[];e.datasets=t.map(i=>{const a=e.datasets.find(o=>o[n]===i[n]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function Tz(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zw;const n={labels:[],datasets:[]};return Gw(n,e.labels),Ww(n,e.datasets,t),n}function Az(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:l,plugins:u=[],fallbackContent:c,updateMode:p,...h}=e,d=N.useRef(null),v=N.useRef(null),m=()=>{d.current&&(v.current=new za(d.current,{type:o,data:Tz(s,a),options:l&&{...l},plugins:u}),Hy(t,v.current))},b=()=>{Hy(t,null),v.current&&(v.current.destroy(),v.current=null)};return N.useEffect(()=>{!i&&v.current&&l&&Dz(v.current,l)},[i,l]),N.useEffect(()=>{!i&&v.current&&Gw(v.current.config.data,s.labels)},[i,s.labels]),N.useEffect(()=>{!i&&v.current&&s.datasets&&Ww(v.current.config.data,s.datasets,a)},[i,s.datasets]),N.useEffect(()=>{v.current&&(i?(b(),setTimeout(m)):v.current.update(p))},[i,l,s.labels,s.datasets,p]),N.useEffect(()=>{v.current&&(b(),setTimeout(m))},[o]),N.useEffect(()=>(m(),()=>b()),[]),N.createElement("canvas",{ref:d,role:"img",height:n,width:r,...h},c)}const Rz=N.forwardRef(Az);function Vp(e,t){return za.register(t),N.forwardRef((n,r)=>N.createElement(Rz,{...n,ref:r,type:e}))}const Uw=Vp("line",ku),Bz=Vp("bar",Bu),jy=Vp("doughnut",cs);za.register(Fo,No,Sa,Nr,fs,Hw,nl,Lw);const zy=(e,t)=>{var i,a,o,s;const n=e.getVisibleDatasetCount(),r=e.getDatasetMeta(n-1).data.at(0);if(r){const{innerRadius:l}=r.getProps(["innerRadius"]),{ctx:u}=e,c=()=>{var _;const S=[].concat(t),w=S.length,E=u.font;let x=0,g=0,I;for(I=0;I<w;++I)u.font=S[I].font,x=Math.max(u.measureText(S[I].text).width,x),g+=(_=S[I].font)==null?void 0:_.lineHeight;return u.font=E,{height:g,width:x}},p=(S,w)=>{let E=document.createElement("div");document.body.appendChild(E),E.style.fontSize=`${w}px`,E.style.position="absolute",E.style.left="-10",E.style.top="-10",E.textContent=S;const x={width:E.clientWidth,height:E.clientHeight};return document.body.removeChild(E),E=null,x},h=c(),d=parseFloat(parseFloat(l).toFixed(2));u.textAlign="center",u.textBaseline="middle";const v=(e.chartArea.left+e.chartArea.right)/2,b=(e.chartArea.top+e.chartArea.bottom)/2-h.height/2;let f;const y=t.length;let C=0;for(f=0;f<y;++f){let S=(i=t[f].font)==null?void 0:i.size,w=(a=t[f].font)==null?void 0:a.lineHeight;const E=typeof t[f].text=="number"?t[f].text.toString():t[f].text;for(;p(E,S).width>d+(t[f].id==="value"?50:0);)S-=1,w=p(E,S).height;E.length>22&&w<14&&(w=18);const x=b+w/2+C,g=typeof t[f].text=="number"?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(t[f].text):t[f].text;let I=t[f].urlIconDesc?" ":"";if(t[f].percentage!==void 0?I+=`${t[f].percentage}% ${t[f].text}`:I+=g,u.fillStyle=t[f].color,u.font=`${S<10?10:S}px sans-serif`,C+=w,t[f].percentage!==void 0&&t[f].urlIconDesc){const A=((s=(o=t[f])==null?void 0:o.percentage)==null?void 0:s.length)??0,_=new Image;_.src=t[f].urlIconDesc,u.drawImage(_,45-(A>6?A+2:A-2.5),x-8,16,14)}u.fillText(I,v,x)}u.restore(),u.save()}},kz=({labels:e,data:t,backgroundColor:n,options:r={},redraw:i,widthInnerDoughnut:a,innerLabels:o,open:s=!0,keyRemoveDataOpen:l="gap",keyLabel:u="title",keyValue:c="originalValue",keyBackground:p="backgroundColor",className:h})=>{const d={labels:e||t.map(m=>m[u]),datasets:[{data:t.map(m=>m[c]),backgroundColor:n||t.map(m=>m[p])}]},v={cutout:a,animation:{duration:i?400:0},plugins:{legend:{display:!1},tooltip:{external(m){let b=document.getElementById("chartjs-tooltip");b||(b=document.createElement("div"),b.id="chartjs-tooltip",b.innerHTML="<table></table>",document.body.appendChild(b));const f=m.tooltip;if(f.opacity===0){b.style.opacity="0";return}b.classList.remove("above","below","no-transform"),f.yAlign?b.classList.add(f.yAlign):b.classList.add("no-transform");const y=t.filter(x=>!x[u]),C=t.filter(x=>x[c]>0&&x[c]<1);if(y.length===1&&C.length===1)return;function S(x){return x.lines}if(f.body){const x=f.title||[];let g=f.body.map(S),I="<thead>";x.forEach(_=>{let T="";T+="display: flex",T+="; justify-content: center",T+="; font-weight: 600",T+="; font-size: 12px",T+="; padding: 0px 14px",I+=`<tr><span style="${T}">${_}</span></tr>`}),I+="</thead><tbody>",g.length>1&&g[0][0]===g[1][0]&&(g=[g[0]]),g.forEach(_=>{let T="";T+="display: flex",T+="; justify-content: center",T+="; color: #0163C8",T+="; padding: 0px 14px",T+="; font-size: 12px";const $=`<span style="${T}">${_}</span>`;I+=`<tr><td>${$}</td></tr>`}),I+="</tbody>";const A=b.querySelector("table");A&&(A.innerHTML=I)}const w=m.chart.canvas.getBoundingClientRect(),E=w.top+window.pageYOffset+f.caretY;b.style.opacity="1",b.style.border="solid 1px #0163C8",b.style.background="white",b.style.height="fit-content",b.style.borderRadius="10px",b.style.position="absolute",b.style.zIndex="10",b.style.padding="4px 0",b.style.left=`${w.left+window.pageXOffset+f.caretX-80}px`,b.style.top=`${E>300&&!s?280:E}px`,b.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title(m){const b=t[m[0].dataIndex];return b==null?void 0:b[u]},label(m){const b=t==null?void 0:t[m.dataIndex];let f="Nilai: ";return b&&(f+=b.value),f}}}},elements:{arc:{borderWidth:0}}};return F.jsxs("div",{className:h??"",children:[!s&&F.jsx(jy,{data:d,redraw:i,plugins:[{id:"draw",beforeDraw(m){zy(m,o)}}],options:Object.keys(r).length>1?r:v}),s&&F.jsx(jy,{data:d,redraw:i,plugins:[{id:"draw",beforeDraw(m){zy(m,o.filter(b=>b.id!==l))}}],options:Object.keys(r).length>1?r:v})]})},gu=e=>{let t;const n=new Date(e??new Date);return e&&(t=rp(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},Pz=({month:e,year:t,type:n=["month","year"],activeType:r="month",minDate:i,maxDate:a,className:o,classNameButton:s,onChange:l,buttonClick:u,id:c="date-picker",idPopover:p="date-picker-popover",floatingOptions:h={},offsetPopover:d=5,zIndexPopper:v=1,hiddenHeader:m})=>{const{locale:b}=xr(),f=N.useRef(null),y=gu(i),C=gu(a),S=w=>{var E;typeof l=="function"&&(l({month:w.month,year:w.year}),(E=f.current)==null||E.setShow(!1))};return F.jsxs(F.Fragment,{children:[F.jsx("div",{id:c,onClick:w=>{var E;w.stopPropagation(),(E=f.current)==null||E.handlerShow(w)},className:s,children:typeof u=="function"?u({month:e,year:t}):"Pilih Tanggal"}),F.jsx("div",{className:o??"",children:F.jsx(bi,{zIndex:v,ref:f,offset:d,id:p,floatingOptions:{placement:"bottom-end",...h},onClick:w=>w.stopPropagation(),children:F.jsx(yp,{locale:"id-ID",children:F.jsx(ld,{minValue:y,maxValue:C,minDate:i,maxDate:a,activeType:n.length===1?n[0]:r,locale:b,value:gu(`${t}/${e}/1`),createCalendar:yl,defaultValue:gu(`${t}/${e}/1`),onChange:S,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:n,hiddenHeader:m})})})})]})},$z=({indeterminate:e,className:t="",classNameContainer:n,...r})=>{const i=N.useRef(null);return N.useEffect(()=>{typeof e=="boolean"&&(i.current.indeterminate=!r.checked&&e)},[i,e]),F.jsx("div",{className:`1ru-flex 1ru-items-center 1ru-h-full ${t??""}`,children:F.jsx(ud,{ref:i,label:"",variants:"blue-700",borderRadius:"full",className:"1ru-flex 1ru-items-center 1ru-h-full",classNameContainer:`1ru-flex 1ru-items-center 1ru-h-full ${n??""}}`,...r,onClick:a=>{a.stopPropagation(),typeof r.onClick=="function"&&r.onClick(a)},type:"checkbox"})})},Fz="_input_1782u_253",Nz="_error_1782u_357",Kn={"container-l":"_container-l_1782u_253","container-input":"_container-input_1782u_253",input:Fz,"container-s":"_container-s_1782u_271","container-xs":"_container-xs_1782u_289","label-error":"_label-error_1782u_307",error:Nz,"isset-right-icon":"_isset-right-icon_1782u_366","isset-left-icon":"_isset-left-icon_1782u_370","start-icon":"_start-icon_1782u_374","end-icon":"_end-icon_1782u_381"},Hp=N.forwardRef(({name:e,classNameContainer:t,id:n,type:r="text",startIcon:i,endIcon:a,error:o,sizeInput:s="xs",classNameLabelError:l,className:u,...c},p)=>{const h={size:{l:Kn["container-l"],s:Kn["container-s"],xs:Kn["container-xs"]}},d=()=>typeof i=="function"||N.isValidElement(i),v=()=>typeof a=="function"||N.isValidElement(a);return F.jsxs("div",{className:`${h.size[s]} ${t}`,children:[F.jsxs("div",{className:`${Kn["container-input"]}`,children:[F.jsxs("div",{className:Kn["start-icon"],children:[typeof i=="function"&&i(),N.isValidElement(i)&&i]}),F.jsx("input",{id:n??e,className:`${Kn.input} ${o?Kn.error:""}
181
+ `):e}function fz(e,t){const{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Dy(e,t){const n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,l=pn(t.bodyFont),u=pn(t.titleFont),c=pn(t.footerFont),p=a.length,h=i.length,d=r.length,v=ar(t.padding);let m=v.height,b=0,f=r.reduce((S,w)=>S+w.before.length+w.lines.length+w.after.length,0);if(f+=e.beforeBody.length+e.afterBody.length,p&&(m+=p*u.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),f){const S=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=d*S+(f-d)*l.lineHeight+(f-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*c.lineHeight+(h-1)*t.footerSpacing);let y=0;const C=function(S){b=Math.max(b,n.measureText(S).width+y)};return n.save(),n.font=u.string,rt(e.title,C),n.font=l.string,rt(e.beforeBody.concat(e.afterBody),C),y=t.displayColors?o+2+t.boxPadding:0,rt(r,S=>{rt(S.before,C),rt(S.lines,C),rt(S.after,C)}),y=0,n.font=c.string,rt(e.footer,C),n.restore(),b+=v.width,{width:b,height:m}}function hz(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function gz(e,t,n,r){const{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+a+o>t.width||e==="right"&&i-a-o<0)return!0}function pz(e,t,n,r){const{x:i,width:a}=n,{width:o,chartArea:{left:s,right:l}}=e;let u="center";return r==="center"?u=i<=(s+l)/2?"left":"right":i<=a/2?u="left":i>=o-a/2&&(u="right"),gz(u,e,t,n)&&(u="center"),u}function Ty(e,t,n){const r=n.yAlign||t.yAlign||hz(e,n);return{xAlign:n.xAlign||t.xAlign||pz(e,t,n,r),yAlign:r}}function mz(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function vz(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function Ay(e,t,n,r){const{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:l}=n,u=i+a,{topLeft:c,topRight:p,bottomLeft:h,bottomRight:d}=Eo(o);let v=mz(t,s);const m=vz(t,l,u);return l==="center"?s==="left"?v+=u:s==="right"&&(v-=u):s==="left"?v-=Math.max(c,h)+i:s==="right"&&(v+=Math.max(p,d)+i),{x:gn(v,0,r.width-t.width),y:gn(m,0,r.height-t.height)}}function fu(e,t,n){const r=ar(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Ry(e){return Dr([],ni(e))}function bz(e,t,n){return ja(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function By(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jw={beforeTitle:Qr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Qr,beforeBody:Qr,beforeLabel:Qr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return et(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Qr,afterBody:Qr,beforeFooter:Qr,footer:Qr,afterFooter:Qr};function _n(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?jw[t].call(n,r):i}var wh;let ky=(wh=class extends Ci{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,a=new xw(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=bz(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=_n(r,"beforeTitle",this,t),a=_n(r,"title",this,t),o=_n(r,"afterTitle",this,t);let s=[];return s=Dr(s,ni(i)),s=Dr(s,ni(a)),s=Dr(s,ni(o)),s}getBeforeBody(t,n){return Ry(_n(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return rt(t,a=>{const o={before:[],lines:[],after:[]},s=By(r,a);Dr(o.before,ni(_n(s,"beforeLabel",this,a))),Dr(o.lines,_n(s,"label",this,a)),Dr(o.after,ni(_n(s,"afterLabel",this,a))),i.push(o)}),i}getAfterBody(t,n){return Ry(_n(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=_n(r,"beforeFooter",this,t),a=_n(r,"footer",this,t),o=_n(r,"afterFooter",this,t);let s=[];return s=Dr(s,ni(i)),s=Dr(s,ni(a)),s=Dr(s,ni(o)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],a=[],o=[];let s=[],l,u;for(l=0,u=n.length;l<u;++l)s.push(fz(this.chart,n[l]));return t.filter&&(s=s.filter((c,p,h)=>t.filter(c,p,h,r))),t.itemSort&&(s=s.sort((c,p)=>t.itemSort(c,p,r))),rt(s,c=>{const p=By(t.callbacks,c);i.push(_n(p,"labelColor",this,c)),a.push(_n(p,"labelPointStyle",this,c)),o.push(_n(p,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=o,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let a,o=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const s=hs[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Dy(this,r),u=Object.assign({},s,l),c=Ty(this.chart,r,u),p=Ay(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:p.x,y:p.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=o,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const a=this.getCaretPosition(t,r,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:a}=this,{caretSize:o,cornerRadius:s}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:p}=Eo(s),{x:h,y:d}=t,{width:v,height:m}=n;let b,f,y,C,S,w;return a==="center"?(S=d+m/2,i==="left"?(b=h,f=b-o,C=S+o,w=S-o):(b=h+v,f=b+o,C=S-o,w=S+o),y=b):(i==="left"?f=h+Math.max(l,c)+o:i==="right"?f=h+v-Math.max(u,p)-o:f=this.caretX,a==="top"?(C=d,S=C-o,b=f-o,y=f+o):(C=d+m,S=C+o,b=f+o,y=f-o),w=C),{x1:b,x2:f,x3:y,y1:C,y2:S,y3:w}}drawTitle(t,n,r){const i=this.title,a=i.length;let o,s,l;if(a){const u=So(r.rtl,this.x,this.width);for(t.x=fu(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=pn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<a;++l)n.fillText(i[l],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s,l+1===a&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,a){const o=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=a,c=pn(a.bodyFont),p=fu(this,"left",a),h=i.x(p),d=l<c.lineHeight?(c.lineHeight-l)/2:0,v=n.y+d;if(a.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},b=i.leftForLtr(h,u)+u/2,f=v+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,R0(t,m,b,f),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,R0(t,m,b,f)}else{t.lineWidth=je(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(h,u),b=i.leftForLtr(i.xPlus(h,1),u-2),f=Eo(o.borderRadius);Object.values(f).some(y=>y!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Cc(t,{x:m,y:v,w:u,h:l,radius:f}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Cc(t,{x:b,y:v+1,w:u-2,h:l-2,radius:f}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,v,u,l),t.strokeRect(m,v,u,l),t.fillStyle=o.backgroundColor,t.fillRect(b,v+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:a,bodyAlign:o,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=r,p=pn(r.bodyFont);let h=p.lineHeight,d=0;const v=So(r.rtl,this.x,this.width),m=function(g){n.fillText(g,v.x(t.x+d),t.y+h/2),t.y+=h+a},b=v.textAlign(o);let f,y,C,S,w,E,x;for(n.textAlign=o,n.textBaseline="middle",n.font=p.string,t.x=fu(this,b,r),n.fillStyle=r.bodyColor,rt(this.beforeBody,m),d=s&&b!=="right"?o==="center"?u/2+c:u+2+c:0,S=0,E=i.length;S<E;++S){for(f=i[S],y=this.labelTextColors[S],n.fillStyle=y,rt(f.before,m),C=f.lines,s&&C.length&&(this._drawColorBox(n,t,S,v,r),h=Math.max(p.lineHeight,l)),w=0,x=C.length;w<x;++w)m(C[w]),h=p.lineHeight;rt(f.after,m)}d=0,h=p.lineHeight,rt(this.afterBody,m),t.y-=a}drawFooter(t,n,r){const i=this.footer,a=i.length;let o,s;if(a){const l=So(r.rtl,this.x,this.width);for(t.x=fu(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=pn(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,s=0;s<a;++s)n.fillText(i[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:a,yAlign:o}=this,{x:s,y:l}=t,{width:u,height:c}=r,{topLeft:p,topRight:h,bottomLeft:d,bottomRight:v}=Eo(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+p,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+u-h,l),n.quadraticCurveTo(s+u,l,s+u,l+h),o==="center"&&a==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+u,l+c-v),n.quadraticCurveTo(s+u,l+c,s+u-v,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+d,l+c),n.quadraticCurveTo(s,l+c,s,l+c-d),o==="center"&&a==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+p),n.quadraticCurveTo(s,l,s+p,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const o=hs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=Dy(this,t),l=Object.assign({},o,this._size),u=Ty(n,t,l),c=Ay(t,l,u,n);(i._to!==c.x||a._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=ar(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(a,t,i,n),gw(t,n.textDirection),a.y+=o.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),pw(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),a=!bc(r,i),o=this._positionChanged(i,n);(a||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],o=this._getActiveElements(t,a,n,r),s=this._positionChanged(o,t),l=n||!bc(o,a)||s;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:a}=this,o=hs[a.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}},Ce(wh,"positioners",hs),wh);var nl={id:"tooltip",_element:ky,positioners:hs,afterInit(e,t,n){n&&(e.tooltip=new ky({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jw},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yz=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function xz(e,t,n,r){const i=e.indexOf(t);if(i===-1)return yz(e,t,n,r);const a=e.lastIndexOf(t);return i!==a?n:i}const Cz=(e,t)=>e===null?null:gn(Math.round(e),0,t);function Py(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Fo extends Wo{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:a}of n)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(et(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:xz(r,t,Me(n,t),this._addedLabels),Cz(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let a=this.getLabels();a=t===0&&n===a.length-1?a:a.slice(t,n+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return Py.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ce(Fo,"id","category"),Ce(Fo,"defaults",{ticks:{callback:Py}});function Ez(e,t){const n=[],{bounds:i,step:a,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:p,includeBounds:h}=e,d=a||1,v=c-1,{min:m,max:b}=t,f=!et(o),y=!et(s),C=!et(u),S=(b-m)/(p+1);let w=Ab((b-m)/v/d)*d,E,x,g,I;if(w<1e-14&&!f&&!y)return[{value:m},{value:b}];I=Math.ceil(b/w)-Math.floor(m/w),I>v&&(w=Ab(I*w/v/d)*d),et(l)||(E=Math.pow(10,l),w=Math.ceil(w*E)/E),i==="ticks"?(x=Math.floor(m/w)*w,g=Math.ceil(b/w)*w):(x=m,g=b),f&&y&&a&&AL((s-o)/a,w/1e3)?(I=Math.round(Math.min((s-o)/w,c)),w=(s-o)/I,x=o,g=s):C?(x=f?o:x,g=y?s:g,I=u-1,w=(g-x)/I):(I=(g-x)/w,xs(I,Math.round(I),w/1e3)?I=Math.round(I):I=Math.ceil(I));const A=Math.max(Rb(w),Rb(x));E=Math.pow(10,et(l)?A:l),x=Math.round(x*E)/E,g=Math.round(g*E)/E;let _=0;for(f&&(h&&x!==o?(n.push({value:o}),x<o&&_++,xs(Math.round((x+_*w)*E)/E,o,$y(o,S,e))&&_++):x<o&&_++);_<I;++_){const T=Math.round((x+_*w)*E)/E;if(y&&T>s)break;n.push({value:T})}return y&&h&&g!==s?n.length&&xs(n[n.length-1].value,s,$y(s,S,e))?n[n.length-1].value=s:n.push({value:s}):(!y||g===s)&&n.push({value:g}),n}function $y(e,t,{horizontal:n,minRotation:r}){const i=ui(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/a,o)}class Sz extends Wo{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return et(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:a}=this;const o=l=>i=n?i:l,s=l=>a=r?a:l;if(t){const l=Hr(i),u=Hr(a);l<0&&u<0?s(0):l>0&&u>0&&o(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);s(a+l),t||o(i-l)}this.min=i,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},a=this._range||this,o=Ez(i,a);return t.bounds==="ticks"&&RL(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return kp(t,this.chart.options.locale,this.options.ticks.format)}}class No extends Sz{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=mn(t)?t:0,this.max=mn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=ui(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,a.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ce(No,"id","linear"),Ce(No,"defaults",{ticks:{callback:ow.formatters.numeric}});const md={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Tn=Object.keys(md);function Fy(e,t){return e-t}function Ny(e,t){if(et(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),mn(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Js(a)||a===!0)?n.startOf(o,"isoWeek",a):n.startOf(o,i)),+o)}function My(e,t,n,r){const i=Tn.length;for(let a=Tn.indexOf(e);a<i-1;++a){const o=md[Tn[a]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(s*o.size))<=r)return Tn[a]}return Tn[i-1]}function wz(e,t,n,r,i){for(let a=Tn.length-1;a>=Tn.indexOf(n);a--){const o=Tn[a];if(md[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Tn[n?Tn.indexOf(n):0]}function Iz(e){for(let t=Tn.indexOf(e)+1,n=Tn.length;t<n;++t)if(md[Tn[t]].common)return Tn[t]}function Oy(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Ap(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function _z(e,t,n,r){const i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value;let s,l;for(s=a;s<=o;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function Ly(e,t,n){const r=[],i={},a=t.length;let o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:_z(e,r,i,n)}class Ic extends Wo{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new fH._date(t.adapters.date);i.init(n),ys(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Ny(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:a,minDefined:o,maxDefined:s}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!s&&!isNaN(u.max)&&(a=Math.max(a,u.max))}(!o||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=mn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),a=mn(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,o=this.max,s=FL(i,a,o);return this._unit=n.unit||(r.autoSkip?My(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):wz(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Iz(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),Ly(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=gn(n,0,o),r=gn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,a=i.time,o=a.unit||My(a.minUnit,n,r,this._getLabelCapacity(n)),s=Me(i.ticks.stepSize,1),l=o==="week"?a.isoWeekday:!1,u=Js(l)||l===!0,c={};let p=n,h,d;if(u&&(p=+t.startOf(p,"isoWeek",l)),p=+t.startOf(p,u?"day":o),t.diff(r,n,o)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+o);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(h=p,d=0;h<r;h=+t.add(h,s,o),d++)Oy(c,h,v);return(h===r||i.bounds==="ticks"||d===1)&&Oy(c,h,v),Object.keys(c).sort(Fy).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,a=this._unit,o=n||i[a];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const a=this.options,o=a.ticks.callback;if(o)return ft(o,[t,n,r],this);const s=a.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],p=u&&s[u],h=r[n],d=u&&p&&h&&h.major;return this._adapter.format(t,i||(d?p:c))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=ui(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(i),o=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*a+s*o,h:r*o+s*a}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,a=this._tickFormatFunction(t,0,Ly(this,[t],this._majorUnit),i),o=this._getLabelSize(a),s=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(Ny(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rw(t.sort(Fy))}}Ce(Ic,"id","time"),Ce(Ic,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function hu(e,t,n){let r=0,i=e.length-1,a,o,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ba(e,"pos",t)),{pos:a,time:s}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ba(e,"time",t)),{time:a,pos:s}=e[r],{time:o,pos:l}=e[i]);const u=o-a;return u?s+(l-s)*(t-a)/u:s}class Vy extends Ic{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=hu(n,this.min),this._tableRange=hu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],a=[];let o,s,l,u,c;for(o=0,s=t.length;o<s;++o)u=t[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,s=i.length;o<s;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&a.push({time:u,pos:o/(s-1)});return a}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,a)=>i-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(hu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return hu(this._table,r*this._tableRange+this._minPos,!0)}}Ce(Vy,"id","timeseries"),Ce(Vy,"defaults",Ic.defaults);const zw="label";function Hy(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Dz(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Gw(e,t){e.labels=t}function Ww(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zw;const r=[];e.datasets=t.map(i=>{const a=e.datasets.find(o=>o[n]===i[n]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function Tz(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zw;const n={labels:[],datasets:[]};return Gw(n,e.labels),Ww(n,e.datasets,t),n}function Az(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:l,plugins:u=[],fallbackContent:c,updateMode:p,...h}=e,d=N.useRef(null),v=N.useRef(null),m=()=>{d.current&&(v.current=new za(d.current,{type:o,data:Tz(s,a),options:l&&{...l},plugins:u}),Hy(t,v.current))},b=()=>{Hy(t,null),v.current&&(v.current.destroy(),v.current=null)};return N.useEffect(()=>{!i&&v.current&&l&&Dz(v.current,l)},[i,l]),N.useEffect(()=>{!i&&v.current&&Gw(v.current.config.data,s.labels)},[i,s.labels]),N.useEffect(()=>{!i&&v.current&&s.datasets&&Ww(v.current.config.data,s.datasets,a)},[i,s.datasets]),N.useEffect(()=>{v.current&&(i?(b(),setTimeout(m)):v.current.update(p))},[i,l,s.labels,s.datasets,p]),N.useEffect(()=>{v.current&&(b(),setTimeout(m))},[o]),N.useEffect(()=>(m(),()=>b()),[]),N.createElement("canvas",{ref:d,role:"img",height:n,width:r,...h},c)}const Rz=N.forwardRef(Az);function Vp(e,t){return za.register(t),N.forwardRef((n,r)=>N.createElement(Rz,{...n,ref:r,type:e}))}const Uw=Vp("line",ku),Bz=Vp("bar",Bu),jy=Vp("doughnut",cs);za.register(Fo,No,Sa,Nr,fs,Hw,nl,Lw);const zy=(e,t)=>{var i,a,o,s;const n=e.getVisibleDatasetCount(),r=e.getDatasetMeta(n-1).data.at(0);if(r){const{innerRadius:l}=r.getProps(["innerRadius"]),{ctx:u}=e,c=()=>{var _;const S=[].concat(t),w=S.length,E=u.font;let x=0,g=0,I;for(I=0;I<w;++I)u.font=S[I].font,x=Math.max(u.measureText(S[I].text).width,x),g+=(_=S[I].font)==null?void 0:_.lineHeight;return u.font=E,{height:g,width:x}},p=(S,w)=>{let E=document.createElement("div");document.body.appendChild(E),E.style.fontSize=`${w}px`,E.style.position="absolute",E.style.left="-10",E.style.top="-10",E.textContent=S;const x={width:E.clientWidth,height:E.clientHeight};return document.body.removeChild(E),E=null,x},h=c(),d=parseFloat(parseFloat(l).toFixed(2));u.textAlign="center",u.textBaseline="middle";const v=(e.chartArea.left+e.chartArea.right)/2,b=(e.chartArea.top+e.chartArea.bottom)/2-h.height/2;let f;const y=t.length;let C=0;for(f=0;f<y;++f){let S=(i=t[f].font)==null?void 0:i.size,w=(a=t[f].font)==null?void 0:a.lineHeight;const E=typeof t[f].text=="number"?t[f].text.toString():t[f].text;for(;p(E,S).width>d+(t[f].id==="value"?50:0);)S-=1,w=p(E,S).height;E.length>22&&w<14&&(w=18);const x=b+w/2+C,g=typeof t[f].text=="number"?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(t[f].text):t[f].text;let I=t[f].urlIconDesc?" ":"";if(t[f].percentage!==void 0?I+=`${t[f].percentage}% ${t[f].text}`:I+=g,u.fillStyle=t[f].color,u.font=`${S<10?10:S}px sans-serif`,C+=w,t[f].percentage!==void 0&&t[f].urlIconDesc){const A=((s=(o=t[f])==null?void 0:o.percentage)==null?void 0:s.length)??0,_=new Image;_.src=t[f].urlIconDesc,u.drawImage(_,45-(A>6?A+2:A-2.5),x-8,16,14)}u.fillText(I,v,x)}u.restore(),u.save()}},kz=({labels:e,data:t,backgroundColor:n,options:r={},redraw:i,widthInnerDoughnut:a,innerLabels:o,open:s=!0,keyRemoveDataOpen:l="gap",keyLabel:u="title",keyValue:c="originalValue",keyBackground:p="backgroundColor",className:h})=>{const d={labels:e||t.map(m=>m[u]),datasets:[{data:t.map(m=>m[c]),backgroundColor:n||t.map(m=>m[p])}]},v={cutout:a,animation:{duration:i?400:0},plugins:{legend:{display:!1},tooltip:{external(m){let b=document.getElementById("chartjs-tooltip");b||(b=document.createElement("div"),b.id="chartjs-tooltip",b.innerHTML="<table></table>",document.body.appendChild(b));const f=m.tooltip;if(f.opacity===0){b.style.opacity="0";return}b.classList.remove("above","below","no-transform"),f.yAlign?b.classList.add(f.yAlign):b.classList.add("no-transform");const y=t.filter(x=>!x[u]),C=t.filter(x=>x[c]>0&&x[c]<1);if(y.length===1&&C.length===1)return;function S(x){return x.lines}if(f.body){const x=f.title||[];let g=f.body.map(S),I="<thead>";x.forEach(_=>{let T="";T+="display: flex",T+="; justify-content: center",T+="; font-weight: 600",T+="; font-size: 12px",T+="; padding: 0px 14px",I+=`<tr><span style="${T}">${_}</span></tr>`}),I+="</thead><tbody>",g.length>1&&g[0][0]===g[1][0]&&(g=[g[0]]),g.forEach(_=>{let T="";T+="display: flex",T+="; justify-content: center",T+="; color: #0163C8",T+="; padding: 0px 14px",T+="; font-size: 12px";const $=`<span style="${T}">${_}</span>`;I+=`<tr><td>${$}</td></tr>`}),I+="</tbody>";const A=b.querySelector("table");A&&(A.innerHTML=I)}const w=m.chart.canvas.getBoundingClientRect(),E=w.top+window.pageYOffset+f.caretY;b.style.opacity="1",b.style.border="solid 1px #0163C8",b.style.background="white",b.style.height="fit-content",b.style.borderRadius="10px",b.style.position="absolute",b.style.zIndex="10",b.style.padding="4px 0",b.style.left=`${w.left+window.pageXOffset+f.caretX-80}px`,b.style.top=`${E>300&&!s?280:E}px`,b.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title(m){const b=t[m[0].dataIndex];return b==null?void 0:b[u]},label(m){const b=t==null?void 0:t[m.dataIndex];let f="Nilai: ";return b&&(f+=b.value),f}}}},elements:{arc:{borderWidth:0}}};return F.jsxs("div",{className:h??"",children:[!s&&F.jsx(jy,{data:d,redraw:i,plugins:[{id:"draw",beforeDraw(m){zy(m,o)}}],options:Object.keys(r).length>1?r:v}),s&&F.jsx(jy,{data:d,redraw:i,plugins:[{id:"draw",beforeDraw(m){zy(m,o.filter(b=>b.id!==l))}}],options:Object.keys(r).length>1?r:v})]})},gu=e=>{let t;const n=new Date(e??new Date);return e&&(t=rp(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},Pz=({month:e,year:t,type:n=["month","year"],activeType:r="month",minDate:i,maxDate:a,className:o,classNameButton:s,onChange:l,buttonClick:u,id:c="date-picker",idPopover:p="date-picker-popover",floatingOptions:h={},offsetPopover:d=5,zIndexPopper:v=1,hiddenHeader:m})=>{const{locale:b}=xr(),f=N.useRef(null),y=gu(i),C=gu(a),S=w=>{var E;typeof l=="function"&&(l({month:w.month,year:w.year}),(E=f.current)==null||E.setShow(!1))};return F.jsxs(F.Fragment,{children:[F.jsx("div",{id:c,onClick:w=>{var E;w.stopPropagation(),(E=f.current)==null||E.handlerShow(w)},className:s,children:typeof u=="function"?u({month:e,year:t}):"Pilih Tanggal"}),F.jsx("div",{className:o??"",children:F.jsx(bi,{zIndex:v,ref:f,offset:d,id:p,floatingOptions:{placement:"bottom-end",...h},onClick:w=>w.stopPropagation(),children:F.jsx(yp,{locale:"id-ID",children:F.jsx(ld,{minValue:y,maxValue:C,minDate:i,maxDate:a,activeType:n.length===1?n[0]:r,locale:b,value:gu(`${t}/${e}/1`),createCalendar:yl,defaultValue:gu(`${t}/${e}/1`),onChange:S,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:n,hiddenHeader:m})})})})]})},$z=({indeterminate:e,className:t="",classNameContainer:n,...r})=>{const i=N.useRef(null);return N.useEffect(()=>{typeof e=="boolean"&&(i.current.indeterminate=!r.checked&&e)},[i,e]),F.jsx("div",{className:`1ru-flex 1ru-items-center 1ru-h-full ${t??""}`,children:F.jsx(ud,{ref:i,label:"",variants:"blue-700",borderRadius:"full",className:"1ru-flex 1ru-items-center 1ru-h-full",classNameContainer:`1ru-flex 1ru-items-center 1ru-h-full ${n??""}}`,...r,onClick:a=>{a.stopPropagation(),typeof r.onClick=="function"&&r.onClick(a)},type:"checkbox"})})},Fz="_input_1782u_253",Nz="_error_1782u_357",Kn={"container-l":"_container-l_1782u_253","container-input":"_container-input_1782u_253",input:Fz,"container-s":"_container-s_1782u_271","container-xs":"_container-xs_1782u_289","label-error":"_label-error_1782u_307",error:Nz,"isset-right-icon":"_isset-right-icon_1782u_366","isset-left-icon":"_isset-left-icon_1782u_370","start-icon":"_start-icon_1782u_374","end-icon":"_end-icon_1782u_381"},Hp=N.forwardRef(({name:e,classNameContainer:t,id:n,type:r="text",startIcon:i,endIcon:a,error:o,sizeInput:s="xs",classNameLabelError:l,className:u,...c},p)=>{const h={size:{l:Kn["container-l"],s:Kn["container-s"],xs:Kn["container-xs"]}},d=()=>typeof i=="function"||N.isValidElement(i),v=()=>typeof a=="function"||N.isValidElement(a);return F.jsxs("div",{className:`${h.size[s]} ${t}`,children:[F.jsxs("div",{className:`${Kn["container-input"]}`,children:[F.jsxs("div",{className:Kn["start-icon"],children:[typeof i=="function"&&i(),N.isValidElement(i)&&i]}),F.jsx("input",{id:n??e,className:`${Kn.input} ${o?Kn.error:""}
182
182
  ${d()?Kn["isset-left-icon"]:""}
183
183
  ${v()?Kn["isset-right-icon"]:""}
184
184
  ${u??""}`,ref:p,type:r,...c}),F.jsxs("div",{className:Kn["end-icon"],children:[typeof a=="function"&&a(),N.isValidElement(a)&&a]})]}),o&&F.jsx("label",{className:`${Kn["label-error"]}
@@ -194,7 +194,7 @@ You should wrap it with \`css\` like this:
194
194
  ${(p.step??d)<=e?Rr.active:""}`,style:{maxWidth:h+1===(t==null?void 0:t.length)||h===0?(n-30)*2:n-30,marginRight:h+1===(t==null?void 0:t.length)?-(n/2):0,marginLeft:h===0?-(n/2):0},children:p.desc})]},h)})});za.register(Fo,No,Sa,Nr,Hw,nl,Lw);const Zz=(e,t,n)=>{const r=e,i=t||new Date().getMonth(),a=n||new Date().getFullYear();return new Date(`${i}/${r}/${a}`)},Jz=({data:e,className:t,height:n=65})=>{const r=N.useRef(null),i=e.map(h=>Ss(Zz(1,h.label,h.year),"MMM yy",{locale:Mu}))||[],[a,o]=N.useState(""),[s,l]=N.useState(""),u=h=>{const d=[],v=[];let m=!h.find(b=>b.isCurrent);return h.forEach(b=>{m?(v.push(b.value),d.push(null)):(d.push(b.value),b.isCurrent?(m=!0,v.push(b.value)):v.push(null))}),{passed:d,notPassed:v}},c={labels:i,datasets:[{label:"",fill:"blue",backgroundColor:"rgba(75,192,192,1)",borderColor:a,borderCapStyle:"butt",borderDashOffset:0,borderJoinStyle:"miter",pointBackgroundColor:function(h){const d=e[h.dataIndex];let v=s;return d.isCurrent&&(v="#ED0019"),v},pointBorderWidth:.1,pointHoverRadius:4,pointRadius:5,pointBorderColor:s,pointHoverBorderColor:a,data:u(e).passed||[]},{label:"",fill:"grey",backgroundColor:"rgba(75,192,192,1)",borderColor:"#D6D6D6",borderCapStyle:"butt",borderDashOffset:0,pointRadius:5,borderJoinStyle:"miter",pointBackgroundColor:s,pointBorderWidth:.1,pointHoverRadius:4,borderDash:[15,5],data:u(e).notPassed||[]}]},p={interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1,labels:{usePointStyle:!0}},tooltip:{external:function(h){let d=document.getElementById("chartjs-tooltip");d||(d=document.createElement("div"),d.id="chartjs-tooltip",d.innerHTML="<table></table>",document.body.appendChild(d));const v=h.tooltip;if(v.opacity===0){d.style.opacity="0";return}d.classList.remove("above","below","no-transform"),v.yAlign?d.classList.add(v.yAlign):d.classList.add("no-transform");function m(f){return f.lines}if(v.body){const f=v.title||[];let y=v.body.map(m),C="<thead>";f.forEach(w=>{let E="";E+="display: flex",E+="; justify-content: center",E+="; font-weight: 600",E+="; font-size: 12px",E+="; padding: 0px 14px",C+=`<tr><span style="${E}">${w}</span></tr>`}),C+="</thead><tbody>",y.length>1&&y[0][0]===y[1][0]&&(y=[y[0]]),y.forEach(w=>{let E="";E+="display: flex",E+="; justify-content: center",E+="; color: #0163C8",E+="; padding: 0px 14px",E+="; font-size: 12px";const x=`<span style="${E}">${w}</span>`;C+=`<tr><td>${x}</td></tr>`}),C+="</tbody>";const S=d.querySelector("table");S&&(S.innerHTML=C)}const b=h.chart.canvas.getBoundingClientRect();d.style.opacity="1",d.style.border="solid 1px #0163C8",d.style.background="white",d.style.height="fit-content",d.style.borderRadius="10px",d.style.position="absolute",d.style.zIndex="10",d.style.padding="4px 0",d.style.left=b.left+window.pageXOffset+v.caretX-30+"px",d.style.top=b.top+window.pageYOffset+v.caretY-60+"px",d.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title:function(h){const d=e[h[0].dataIndex];return Ss(new Date(`1/${d.label}/${d.year}`),"MMMM yyyy",{locale:Mu})},label:function(h){let d=h.dataset.label??"";return d&&(d+=": "),h.parsed.y!==null&&(d+=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(h.parsed.y)),d}}}},scales:{x:{grid:{display:!1},beginAtZero:!0,ticks:{autoSkip:!0,maxTicksLimit:20}},y:{min:0,grid:{display:!1},beginAtZero:!0,ticks:{maxTicksLimit:6,callback:function(h){return Pc(h)??0}}}}};return N.useEffect(()=>{if(r.current){const h=r.current.getContext("2d"),d=h==null?void 0:h.createLinearGradient(0,100,500,-500);d==null||d.addColorStop(0,"rgba(237, 0, 25, 0)"),d==null||d.addColorStop(1,"rgba(237, 0, 25, 20)");const v=h.fillStyle="rgba(255, 255, 255, 0)";l(v),o(d)}},[]),F.jsxs("div",{className:t??"",children:[F.jsx(Uw,{options:p,data:c,height:n}),F.jsx("div",{className:"1ru-h-5",children:F.jsx("canvas",{ref:r})})]})},qz="_container_1oiqk_1",Xy={container:qz,"container-popover":"_container-popover_1oiqk_5"},Qz=({id:e="1ru-tooltip",children:t,text:n,zIndexPopover:r=1,onShow:i,onClose:a,placement:o="top",backgroundColor:s="black",popoverProps:l={},arrowProps:u={},className:c,isHover:p,delay:h=600})=>{let d;const v=N.useRef(null),m={backgroundColor:Hx[s]||s},[b,f]=N.useState(!1),[y,C]=N.useState(!1),S=E=>{var x;(x=v.current)==null||x.handlerShow(E),C(!0),typeof i=="function"&&i()},w=()=>{var E;C(!1),b||(clearInterval(d),(E=v.current)==null||E.setShow(!1),typeof a=="function"&&a())};return F.jsxs(F.Fragment,{children:[F.jsx("div",{id:e,onMouseEnter:E=>{if(p&&!b){const x=E.currentTarget;d=setTimeout(()=>{S({...E,currentTarget:x})},h)}},onMouseLeave:()=>{p&&!b&&w()},onClick:E=>{f(!0),clearInterval(d),y||S(E)},className:Xy.container,children:t}),F.jsx(bi,{floatingOptions:{placement:o},ref:v,id:"1ru-popover-tooltip",offset:10,withArrow:!0,zIndex:r,onClose:()=>{b&&(f(!1),w())},styleInnerPopover:{backgroundColor:m.backgroundColor},propsArrow:{fill:m.backgroundColor,...u},className:`${Xy["container-popover"]} ${c??""}`,...l,children:n})]})},eG="_icon_zrudt_5",tG="_show_zrudt_10",ph={"container-popover":"_container-popover_zrudt_1",icon:eG,show:tG},Yw=N.forwardRef((e,t)=>{const{children:n,id:r="1ru-button-popover",text:i="",startIcon:a,endIcon:o,startIconShow:s,endIconShow:l,classNameButton:u="",classNameButtonShow:c="",className:p="",placement:h="top-end",popoverProps:d,zIndexPopover:v=1,offset:m=5,idPopover:b="1ru-popover-button-popover",onClick:f,onClose:y,...C}=e,S=N.useRef(null),w=N.useRef(null),[E,x]=N.useState(!1),g=(T,$,B)=>{let P=F.jsx(F.Fragment,{});return T&&N.isValidElement($)?P=$:N.isValidElement(B)&&(P=F.jsx("div",{className:`${ph.icon} ${T?ph.show:""}`,children:B})),P},I=T=>{var $;($=S.current)==null||$.setShow(T),x(T)},A=T=>{var $;($=S.current)==null||$.handlerShow(T),x(!0)},_=()=>{var T;x(!1),(T=S.current)==null||T.setShow(!1),typeof y=="function"&&y()};return N.useImperativeHandle(t,()=>({show:E,setShow:I,handlerClose:_,handlerShow:A}),[E]),F.jsxs(F.Fragment,{children:[F.jsx(vr,{ref:w,id:r,className:`${u} ${E?c:""}`,onClick:T=>{E?_():typeof f=="function"?f(T):A(T)},startIcon:g(E,s,a),endIcon:g(E,l,o),...C,children:i}),F.jsx(bi,{ref:S,id:b,offset:m,floatingOptions:{placement:h},zIndex:v,onClose:_,className:`${ph["container-popover"]} ${p}`,...d,children:n})]})});Yw.displayName="ButtonPopover";za.register(Fo,No,Sa,Nr,Mw,nl);const nG=e=>({chart:t,tooltip:n})=>{var l,u,c,p,h,d;const r={};if(n.opacity===0){e(v=>({...v,style:{...v.style,opacity:0,pointerEvents:"none"}}));return}if(!n.dataPoints||n.dataPoints.length===0)return;r.opacity="1",r.position="absolute",r.pointerEvents="none";const i=t.canvas.getBoundingClientRect();r.left=i.left+window.pageXOffset+n.caretX+"px",r.top=i.top+window.pageYOffset+n.caretY+"px";const a=((u=(l=n.dataPoints)==null?void 0:l[0])==null?void 0:u.label)??"",o=((p=(c=n.dataPoints)==null?void 0:c[0])==null?void 0:p.raw)??"",s=((d=(h=n.dataPoints)==null?void 0:h[0])==null?void 0:d.dataset.label)??"";e({dataset:s,label:a,value:o,style:r,dataPoints:n.dataPoints})},rG={id:"hairlinePlugin",beforeDatasetsDraw:e=>{const t=e.scales.y;if(!t)return;const{ctx:n}=e,{top:r,bottom:i,left:a,right:o}=e.chartArea;if(t.min>0||t.max<0)return;const s=t.getPixelForValue(0);s<r||s>i||(n.save(),n.beginPath(),n.moveTo(a,s),n.lineTo(o,s),n.lineWidth=2,n.strokeStyle="rgb(207, 216, 220)",n.setLineDash([4,3]),n.stroke(),n.restore())}},iG={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{grace:"15%",position:"right",border:{display:!1,dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},padding:10,color:"#898989"}},x:{border:{dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},color:"#898989"}}},interaction:{mode:"index",intersect:!1}},aG=({data:e,height:t,classNameContainer:n,id:r,options:i,CustomTooltip:a})=>{const o=N.useRef(void 0),s=N.useRef(0),l=N.useRef(0),[u,c]=N.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),p=N.useCallback(function({ctx:m,chartArea:b,scales:f,chartHeight:y,gradientFor:C,item:S}){let x=(f.y.getPixelForValue(0)-b.top)/y;x=x<0?0:x>1?1:x,o.current=m.createLinearGradient(0,b.top,0,y+b.top),C==="background"?(o.current.addColorStop(0,(S==null?void 0:S.colorBackgroundPositiveZero)||"#9FD2FF"),o.current.addColorStop(x,(S==null?void 0:S.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),o.current.addColorStop(x,(S==null?void 0:S.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),o.current.addColorStop(1,(S==null?void 0:S.colorBackgroundNegativeOne)||"#EB6B6B")):(o.current.addColorStop(x,(S==null?void 0:S.colorBorderPositive)||"#80CBC4"),o.current.addColorStop(x,(S==null?void 0:S.colorBorderNegative)||"#EB6B6B"))},[]),h=N.useCallback(function({ctx:m,chartArea:b,scales:f,gradientFor:y,item:C}){const S=b.right-b.left,w=b.bottom-b.top;return(!o.current||s.current!==S||l.current!==w)&&(s.current=S,l.current=w,p({ctx:m,chartArea:b,scales:f,chartHeight:w,gradientFor:y,item:C})),p({ctx:m,chartArea:b,scales:f,chartHeight:w,gradientFor:y,item:C}),o.current},[]),d=N.useMemo(()=>({...e,datasets:e.datasets.map(b=>({fill:!0,backgroundColor:function(f){const y=f.chart,{ctx:C,chartArea:S,scales:w}=y;if(S)return h({ctx:C,chartArea:S,scales:w,gradientFor:"background",item:b})},borderColor:function(f){const y=f.chart,{ctx:C,chartArea:S,scales:w}=y;if(S)return h({ctx:C,chartArea:S,scales:w,gradientFor:"border",item:b})},borderWidth:3,tension:0,pointRadius:0,pointHoverRadius:4,...b,data:b.data}))}),[e]),v=N.useMemo(()=>ws(iG,{plugins:{tooltip:{enabled:!a,external:({chart:b,tooltip:f})=>a?nG(c)({chart:b,tooltip:f}):void 0}}},i??{}),[i,a]);return F.jsxs("div",{id:r,className:n,style:{height:t||"300px"},children:[a&&F.jsx(wp,{selector:"body",children:F.jsx(a,{...u})}),F.jsx(Uw,{data:d,options:v,plugins:[rG]})]})};za.register(Fo,No,Fu,nl,Sa,Mw,nl);const oG=e=>({chart:t,tooltip:n})=>{var l,u,c,p,h,d;const r={};if(n.opacity===0){e(v=>({...v,style:{...v.style,opacity:0,pointerEvents:"none"}}));return}if(!n.dataPoints||n.dataPoints.length===0)return;r.opacity="1",r.position="absolute",r.pointerEvents="none";const i=t.canvas.getBoundingClientRect();r.left=i.left+window.pageXOffset+n.caretX+"px",r.top=i.top+window.pageYOffset+n.caretY+"px";const a=((u=(l=n.dataPoints)==null?void 0:l[0])==null?void 0:u.label)??"",o=((p=(c=n.dataPoints)==null?void 0:c[0])==null?void 0:p.raw)??"",s=((d=(h=n.dataPoints)==null?void 0:h[0])==null?void 0:d.dataset.label)??"";e({dataset:s,label:a,value:o,style:r,dataPoints:n.dataPoints})},sG={id:"labelplugin",afterDatasetsDraw(e){const{ctx:t,chartArea:{top:n,bottom:r}}=e;t.save(),e.data.datasets.forEach((i,a)=>{const o=e.getDatasetMeta(a);o.visible&&o.data.forEach((s,l)=>{const u=i.data[l]||0,c=i!=null&&i.setDigit?Pc(String(u)):String(u);t.font="12px Lato",t.textAlign="center";let p,h=!1;typeof u=="number"&&u>=0?(t.textBaseline="bottom",t.fillStyle=(i==null?void 0:i.colorTextLabelPositive)||s.options.borderColor,p=s.y-5,p>n&&(h=!0)):(t.textBaseline="top",t.fillStyle=(i==null?void 0:i.colorTextLabelNegative)||s.options.borderColor,p=s.y+5,p<r&&(h=!0)),h&&t.fillText(c,s.x,p)})}),t.restore()}},lG={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{grace:"15%",position:"left",border:{display:!1,dash:[5,3],color:"#CFD8DC"},ticks:{callback:function(e){return Pc(e)??0},font:{size:10,weight:"normal"},padding:10,color:"#898989"}},x:{grid:{display:!1},border:{dash:[5,3],color:"#CFD8DC"},ticks:{font:{size:10,weight:"normal"},color:"#898989"}}},interaction:{mode:"index",intersect:!1}},uG=({data:e,classNameContainer:t,height:n,id:r,options:i,CustomTooltip:a})=>{const o=N.useRef(void 0),s=N.useRef(0),l=N.useRef(0),[u,c]=N.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),p=N.useCallback(function({ctx:m,chartArea:b,scales:f,chartHeight:y,gradientFor:C,item:S}){let x=(f.y.getPixelForValue(0)-b.top)/y;x=x<0?0:x>1?1:x,o.current=m.createLinearGradient(0,b.top,0,y+b.top),C==="background"?(o.current.addColorStop(0,(S==null?void 0:S.colorBackgroundPositiveZero)||"#9FD2FF"),o.current.addColorStop(x,(S==null?void 0:S.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),o.current.addColorStop(x,(S==null?void 0:S.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),o.current.addColorStop(1,(S==null?void 0:S.colorBackgroundNegativeOne)||"#EB6B6B")):(o.current.addColorStop(x,(S==null?void 0:S.colorBorderPositive)||"#80CBC4"),o.current.addColorStop(x,(S==null?void 0:S.colorBorderNegative)||"#EB6B6B"))},[]),h=N.useCallback(function({ctx:m,chartArea:b,scales:f,gradientFor:y,item:C}){const S=b.right-b.left,w=b.bottom-b.top;return(!o.current||s.current!==S||l.current!==w)&&(s.current=S,l.current=w,p({ctx:m,chartArea:b,scales:f,chartHeight:w,gradientFor:y,item:C})),p({ctx:m,chartArea:b,scales:f,chartHeight:w,gradientFor:y,item:C}),o.current},[]),d=N.useMemo(()=>({...e,datasets:e.datasets.map(b=>({fill:!0,backgroundColor:function(f){const y=f.chart,{ctx:C,chartArea:S,scales:w}=y;if(S)return h({ctx:C,chartArea:S,scales:w,gradientFor:"background",item:b})},borderColor:function(f){const y=f.chart,{ctx:C,chartArea:S,scales:w}=y;if(S)return h({ctx:C,chartArea:S,scales:w,gradientFor:"border",item:b})},borderWidth:0,tension:0,pointRadius:0,pointHoverRadius:4,setDigit:!0,...b,data:b.data}))}),[e]),v=N.useMemo(()=>ws(lG,{plugins:{tooltip:{enabled:!a,external:({chart:b,tooltip:f})=>a?oG(c)({chart:b,tooltip:f}):void 0}}},i??{}),[i,a]);return F.jsxs("div",{id:r,className:t,style:{height:n||"300px"},children:[a&&F.jsx(wp,{selector:"body",children:F.jsx(a,{...u})}),F.jsx(Bz,{data:d,options:v,plugins:[sG]})]})},cG="_left_16fym_319",dG="_right_16fym_322",fG="_indicator_16fym_333",hG="_active_16fym_338",Ti={"container-step-indicator":"_container-step-indicator_16fym_301","text-step-indicator":"_text-step-indicator_16fym_301",left:cG,right:dG,"step-indicator":"_step-indicator_16fym_329",indicator:fG,active:hG};function gG(e,t){if(e<=0)return"0px";if(e===1)return"100%";const n=e-1;return`calc((100% - (${t} * ${n})) / ${e})`}const pG=({activeStep:e=0,countStep:t=0,classNameActiveStepIndicator:n="",classNameContainer:r="",classNameDesc:i="",classNameStepIndicator:a="",id:o="1ru-step-indicator",locationStepIndicator:s="right",widthStepIndicator:l=120,dynamicWidthStepIndicator:u=!1,gapStepIndicator:c="2px",classNameStepIndicatorContainer:p=""})=>F.jsxs("div",{id:o,className:`${Ti["container-step-indicator"]}
195
195
  ${s==="left"?Ti.left:Ti.right} ${r||""}`,children:[s==="left"&&F.jsxs("p",{className:`${Ti["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]}),F.jsx("div",{className:`${Ti["step-indicator"]} ${p||""}
196
196
  ${u?"1ru-w-full":""} ${c}`,style:{gap:c},children:Array.from({length:t}).map((h,d)=>F.jsx("div",{className:`${Ti.indicator} ${a||""}
197
- ${d<=e?`${Ti.active} ${n}`:""}`,style:{width:u?gG(t,c):l}},d))}),s==="right"&&F.jsxs("p",{className:`${Ti["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]})]}),mG="0.2.0-beta.18",Yy={version:mG},vG=({label:e})=>({tinymceScriptSrc:`https://unpkg.com/1mpacto-react-ui@${Yy.version}/dist/tinymce/js/tinymce/tinymce.min.js`,init:{plugins:"lists",menubar:!1,statusbar:!1,content_css:`https://unpkg.com/1mpacto-react-ui@${Yy.version}/dist/assets/fontfamily.css`,toolbar:"fontfamily fontsize italic bold underline bullist numlist",font_size_formats:"8px 10px 12px 14px 16px 18px 24px 36px 48px",image_advtab:!0,importcss_append:!0,min_height:220,image_caption:!0,noneditable_class:"mceNonEditable",toolbar_mode:"sliding",table_tab_navigation:!1,line_height_formats:"100px",font_family_formats:`
197
+ ${d<=e?`${Ti.active} ${n}`:""}`,style:{width:u?gG(t,c):l}},d))}),s==="right"&&F.jsxs("p",{className:`${Ti["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]})]}),mG="0.2.0-beta.19",Yy={version:mG},vG=({label:e})=>({tinymceScriptSrc:`https://unpkg.com/1mpacto-react-ui@${Yy.version}/dist/tinymce/js/tinymce/tinymce.min.js`,init:{plugins:"lists",menubar:!1,statusbar:!1,content_css:`https://unpkg.com/1mpacto-react-ui@${Yy.version}/dist/assets/fontfamily.css`,toolbar:"fontfamily fontsize italic bold underline bullist numlist",font_size_formats:"8px 10px 12px 14px 16px 18px 24px 36px 48px",image_advtab:!0,importcss_append:!0,min_height:220,image_caption:!0,noneditable_class:"mceNonEditable",toolbar_mode:"sliding",table_tab_navigation:!1,line_height_formats:"100px",font_family_formats:`
198
198
  Lato=Lato;
199
199
  Inter=Inter;
200
200
  Andale Mono=Andale Mono,times;
@@ -226,5 +226,5 @@ object-assign
226
226
  (c) Sindre Sorhus
227
227
  @license MIT
228
228
  */var mh,Ky;function xG(){if(Ky)return mh;Ky=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mh=i()?Object.assign:function(a,o){for(var s,l=r(a),u,c=1;c<arguments.length;c++){s=Object(arguments[c]);for(var p in s)t.call(s,p)&&(l[p]=s[p]);if(e){u=e(s);for(var h=0;h<u.length;h++)n.call(s,u[h])&&(l[u[h]]=s[u[h]])}}return l},mh}var vh,Zy;function jp(){if(Zy)return vh;Zy=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return vh=e,vh}var bh,Jy;function Kw(){return Jy||(Jy=1,bh=Function.call.bind(Object.prototype.hasOwnProperty)),bh}var yh,qy;function CG(){if(qy)return yh;qy=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=jp(),n={},r=Kw();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,l,u){if(process.env.NODE_ENV!=="production"){for(var c in a)if(r(a,c)){var p;try{if(typeof a[c]!="function"){var h=Error((l||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}p=a[c](o,c,l,s,null,t)}catch(v){p=v}if(p&&!(p instanceof Error)&&e((l||"React class")+": type specification of "+s+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in n)){n[p.message]=!0;var d=u?u():"";e("Failed "+s+" type: "+p.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},yh=i,yh}var xh,Qy;function EG(){if(Qy)return xh;Qy=1;var e=Og(),t=xG(),n=jp(),r=Kw(),i=CG(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return xh=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function p(W){var U=W&&(u&&W[u]||W[c]);if(typeof U=="function")return U}var h="<<anonymous>>",d={array:f("array"),bigint:f("bigint"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:y(),arrayOf:C,element:S(),elementType:w(),instanceOf:E,node:A(),objectOf:g,oneOf:x,oneOfType:I,shape:T,exact:$};function v(W,U){return W===U?W!==0||1/W===1/U:W!==W&&U!==U}function m(W,U){this.message=W,this.data=U&&typeof U=="object"?U:{},this.stack=""}m.prototype=Error.prototype;function b(W){if(process.env.NODE_ENV!=="production")var U={},q=0;function Q(ee,J,le,re,R,H,V){if(re=re||h,H=H||le,V!==n){if(l){var D=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw D.name="Invariant Violation",D}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var L=re+":"+le;!U[L]&&q<3&&(a("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+re+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),U[L]=!0,q++)}}return J[le]==null?ee?J[le]===null?new m("The "+R+" `"+H+"` is marked as required "+("in `"+re+"`, but its value is `null`.")):new m("The "+R+" `"+H+"` is marked as required in "+("`"+re+"`, but its value is `undefined`.")):null:W(J,le,re,R,H)}var Z=Q.bind(null,!1);return Z.isRequired=Q.bind(null,!0),Z}function f(W){function U(q,Q,Z,ee,J,le){var re=q[Q],R=k(re);if(R!==W){var H=O(re);return new m("Invalid "+ee+" `"+J+"` of type "+("`"+H+"` supplied to `"+Z+"`, expected ")+("`"+W+"`."),{expectedType:W})}return null}return b(U)}function y(){return b(o)}function C(W){function U(q,Q,Z,ee,J){if(typeof W!="function")return new m("Property `"+J+"` of component `"+Z+"` has invalid PropType notation inside arrayOf.");var le=q[Q];if(!Array.isArray(le)){var re=k(le);return new m("Invalid "+ee+" `"+J+"` of type "+("`"+re+"` supplied to `"+Z+"`, expected an array."))}for(var R=0;R<le.length;R++){var H=W(le,R,Z,ee,J+"["+R+"]",n);if(H instanceof Error)return H}return null}return b(U)}function S(){function W(U,q,Q,Z,ee){var J=U[q];if(!s(J)){var le=k(J);return new m("Invalid "+Z+" `"+ee+"` of type "+("`"+le+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return b(W)}function w(){function W(U,q,Q,Z,ee){var J=U[q];if(!e.isValidElementType(J)){var le=k(J);return new m("Invalid "+Z+" `"+ee+"` of type "+("`"+le+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return b(W)}function E(W){function U(q,Q,Z,ee,J){if(!(q[Q]instanceof W)){var le=W.name||h,re=G(q[Q]);return new m("Invalid "+ee+" `"+J+"` of type "+("`"+re+"` supplied to `"+Z+"`, expected ")+("instance of `"+le+"`."))}return null}return b(U)}function x(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function U(q,Q,Z,ee,J){for(var le=q[Q],re=0;re<W.length;re++)if(v(le,W[re]))return null;var R=JSON.stringify(W,function(V,D){var L=O(D);return L==="symbol"?String(D):D});return new m("Invalid "+ee+" `"+J+"` of value `"+String(le)+"` "+("supplied to `"+Z+"`, expected one of "+R+"."))}return b(U)}function g(W){function U(q,Q,Z,ee,J){if(typeof W!="function")return new m("Property `"+J+"` of component `"+Z+"` has invalid PropType notation inside objectOf.");var le=q[Q],re=k(le);if(re!=="object")return new m("Invalid "+ee+" `"+J+"` of type "+("`"+re+"` supplied to `"+Z+"`, expected an object."));for(var R in le)if(r(le,R)){var H=W(le,R,Z,ee,J+"."+R,n);if(H instanceof Error)return H}return null}return b(U)}function I(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var U=0;U<W.length;U++){var q=W[U];if(typeof q!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+M(q)+" at index "+U+"."),o}function Q(Z,ee,J,le,re){for(var R=[],H=0;H<W.length;H++){var V=W[H],D=V(Z,ee,J,le,re,n);if(D==null)return null;D.data&&r(D.data,"expectedType")&&R.push(D.data.expectedType)}var L=R.length>0?", expected one of type ["+R.join(", ")+"]":"";return new m("Invalid "+le+" `"+re+"` supplied to "+("`"+J+"`"+L+"."))}return b(Q)}function A(){function W(U,q,Q,Z,ee){return B(U[q])?null:new m("Invalid "+Z+" `"+ee+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return b(W)}function _(W,U,q,Q,Z){return new m((W||"React class")+": "+U+" type `"+q+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Z+"`.")}function T(W){function U(q,Q,Z,ee,J){var le=q[Q],re=k(le);if(re!=="object")return new m("Invalid "+ee+" `"+J+"` of type `"+re+"` "+("supplied to `"+Z+"`, expected `object`."));for(var R in W){var H=W[R];if(typeof H!="function")return _(Z,ee,J,R,O(H));var V=H(le,R,Z,ee,J+"."+R,n);if(V)return V}return null}return b(U)}function $(W){function U(q,Q,Z,ee,J){var le=q[Q],re=k(le);if(re!=="object")return new m("Invalid "+ee+" `"+J+"` of type `"+re+"` "+("supplied to `"+Z+"`, expected `object`."));var R=t({},q[Q],W);for(var H in R){var V=W[H];if(r(W,H)&&typeof V!="function")return _(Z,ee,J,H,O(V));if(!V)return new m("Invalid "+ee+" `"+J+"` key `"+H+"` supplied to `"+Z+"`.\nBad object: "+JSON.stringify(q[Q],null," ")+`
229
- Valid keys: `+JSON.stringify(Object.keys(W),null," "));var D=V(le,H,Z,ee,J+"."+H,n);if(D)return D}return null}return b(U)}function B(W){switch(typeof W){case"number":case"string":case"undefined":return!0;case"boolean":return!W;case"object":if(Array.isArray(W))return W.every(B);if(W===null||s(W))return!0;var U=p(W);if(U){var q=U.call(W),Q;if(U!==W.entries){for(;!(Q=q.next()).done;)if(!B(Q.value))return!1}else for(;!(Q=q.next()).done;){var Z=Q.value;if(Z&&!B(Z[1]))return!1}}else return!1;return!0;default:return!1}}function P(W,U){return W==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function k(W){var U=typeof W;return Array.isArray(W)?"array":W instanceof RegExp?"object":P(U,W)?"symbol":U}function O(W){if(typeof W>"u"||W===null)return""+W;var U=k(W);if(U==="object"){if(W instanceof Date)return"date";if(W instanceof RegExp)return"regexp"}return U}function M(W){var U=O(W);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function G(W){return!W.constructor||!W.constructor.name?h:W.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},xh}var Ch,ex;function SG(){if(ex)return Ch;ex=1;var e=jp();function t(){}function n(){}return n.resetWarningCache=t,Ch=function(){function r(o,s,l,u,c,p){if(p!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},Ch}var tx;function wG(){if(tx)return pu.exports;if(tx=1,process.env.NODE_ENV!=="production"){var e=Og(),t=!0;pu.exports=EG()(e.isElement,t)}else pu.exports=SG()();return pu.exports}var ce=wG(),F0=function(){return F0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},F0.apply(this,arguments)},Zw={onActivate:ce.func,onAddUndo:ce.func,onBeforeAddUndo:ce.func,onBeforeExecCommand:ce.func,onBeforeGetContent:ce.func,onBeforeRenderUI:ce.func,onBeforeSetContent:ce.func,onBeforePaste:ce.func,onBlur:ce.func,onChange:ce.func,onClearUndos:ce.func,onClick:ce.func,onContextMenu:ce.func,onCommentChange:ce.func,onCompositionEnd:ce.func,onCompositionStart:ce.func,onCompositionUpdate:ce.func,onCopy:ce.func,onCut:ce.func,onDblclick:ce.func,onDeactivate:ce.func,onDirty:ce.func,onDrag:ce.func,onDragDrop:ce.func,onDragEnd:ce.func,onDragGesture:ce.func,onDragOver:ce.func,onDrop:ce.func,onExecCommand:ce.func,onFocus:ce.func,onFocusIn:ce.func,onFocusOut:ce.func,onGetContent:ce.func,onHide:ce.func,onInit:ce.func,onInput:ce.func,onKeyDown:ce.func,onKeyPress:ce.func,onKeyUp:ce.func,onLoadContent:ce.func,onMouseDown:ce.func,onMouseEnter:ce.func,onMouseLeave:ce.func,onMouseMove:ce.func,onMouseOut:ce.func,onMouseOver:ce.func,onMouseUp:ce.func,onNodeChange:ce.func,onObjectResizeStart:ce.func,onObjectResized:ce.func,onObjectSelected:ce.func,onPaste:ce.func,onPostProcess:ce.func,onPostRender:ce.func,onPreProcess:ce.func,onProgressState:ce.func,onRedo:ce.func,onRemove:ce.func,onReset:ce.func,onSaveContent:ce.func,onSelectionChange:ce.func,onSetAttrib:ce.func,onSetContent:ce.func,onShow:ce.func,onSubmit:ce.func,onUndo:ce.func,onVisualAid:ce.func,onSkinLoadError:ce.func,onThemeLoadError:ce.func,onModelLoadError:ce.func,onPluginLoadError:ce.func,onIconsLoadError:ce.func,onLanguageLoadError:ce.func,onScriptsLoad:ce.func,onScriptsLoadError:ce.func},IG=F0({apiKey:ce.string,licenseKey:ce.string,id:ce.string,inline:ce.bool,init:ce.object,initialValue:ce.string,onEditorChange:ce.func,value:ce.string,tagName:ce.string,tabIndex:ce.number,cloudChannel:ce.string,plugins:ce.oneOfType([ce.string,ce.array]),toolbar:ce.oneOfType([ce.string,ce.array]),disabled:ce.bool,readonly:ce.bool,textareaName:ce.string,tinymceScriptSrc:ce.oneOfType([ce.string,ce.arrayOf(ce.string),ce.arrayOf(ce.shape({src:ce.string,async:ce.bool,defer:ce.bool}))]),rollback:ce.oneOfType([ce.number,ce.oneOf([!1])]),scriptLoading:ce.shape({async:ce.bool,defer:ce.bool,delay:ce.number})},Zw),Jw=function(e){var t=e;return t&&t.tinymce?t.tinymce:null},Eh=function(e){return typeof e=="function"},nx=function(e){return e in Zw},rx=function(e){return e.substr(2)},_G=function(e,t,n,r,i,a,o){var s=Object.keys(i).filter(nx),l=Object.keys(a).filter(nx),u=s.filter(function(p){return a[p]===void 0}),c=l.filter(function(p){return i[p]===void 0});u.forEach(function(p){var h=rx(p),d=o[h];n(h,d),delete o[h]}),c.forEach(function(p){var h=r(e,p),d=rx(p);o[d]=h,t(d,h)})},DG=function(e,t,n,r,i){return _G(i,e.on.bind(e),e.off.bind(e),function(a,o){return function(s){var l;return(l=a(o))===null||l===void 0?void 0:l(s,e)}},t,n,r)},ix=0,qw=function(e){var t=Date.now(),n=Math.floor(Math.random()*1e9);return ix++,e+"_"+n+ix+String(t)},ax=function(e){return e!==null&&(e.tagName.toLowerCase()==="textarea"||e.tagName.toLowerCase()==="input")},ox=function(e){return typeof e>"u"||e===""?[]:Array.isArray(e)?e:e.split(" ")},TG=function(e,t){return ox(e).concat(ox(t))},AG=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},RG=function(e){if(!("isConnected"in Node.prototype)){for(var t=e,n=e.parentNode;n!=null;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected},sx=function(e,t){e!==void 0&&(e.mode!=null&&typeof e.mode=="object"&&typeof e.mode.set=="function"?e.mode.set(t):e.setMode(t))},BG=function(e){var t=Jw(e);if(!t)throw new Error("tinymce should have been loaded into global scope");return t},lx=function(e){return e.options&&e.options.isRegistered("disabled")},N0=function(){return N0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},N0.apply(this,arguments)},kG=function(e,t,n){var r,i,a=e.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=t.id,a.src=t.src,a.async=(r=t.async)!==null&&r!==void 0?r:!1,a.defer=(i=t.defer)!==null&&i!==void 0?i:!1;var o=function(){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src)},s=function(l){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src,l)};a.addEventListener("load",o),a.addEventListener("error",s),e.head&&e.head.appendChild(a)},PG=function(e){var t={},n=function(o,s){var l=t[o];l.done=!0,l.error=s;for(var u=0,c=l.handlers;u<c.length;u++){var p=c[u];p(o,s)}l.handlers=[]},r=function(o,s,l){var u=function(y){return l!==void 0?l(y):console.error(y)};if(o.length===0){u(new Error("At least one script must be provided"));return}for(var c=0,p=!1,h=function(y,C){p||(C?(p=!0,u(C)):++c===o.length&&s())},d=0,v=o;d<v.length;d++){var m=v[d],b=t[m.src];if(b)b.done?h(m.src,b.error):b.handlers.push(h);else{var f=qw("tiny-");t[m.src]={id:f,src:m.src,done:!1,error:null,handlers:[h]},kG(e,N0({id:f},m),n)}}},i=function(){for(var o,s=0,l=Object.values(t);s<l.length;s++){var u=l[s],c=e.getElementById(u.id);c!=null&&c.tagName==="SCRIPT"&&((o=c.parentNode)===null||o===void 0||o.removeChild(c))}t={}},a=function(){return e};return{loadScripts:r,deleteScripts:i,getDocument:a}},$G=function(){var e=[],t=function(i){var a=e.find(function(o){return o.getDocument()===i});return a===void 0&&(a=PG(i),e.push(a)),a},n=function(i,a,o,s,l){var u=function(){return t(i).loadScripts(a,s,l)};o>0?setTimeout(u,o):u()},r=function(){for(var i=e.pop();i!=null;i=e.pop())i.deleteScripts()};return{loadList:n,reinitialize:r}},FG=$G(),NG=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lo=function(){return lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lo.apply(this,arguments)},Sh="change keyup compositionend setcontent CommentChange",MG=function(e){NG(t,e);function t(n){var r,i,a,o=e.call(this,n)||this;return o.rollbackTimer=void 0,o.valueCursor=void 0,o.rollbackChange=function(){var s=o.editor,l=o.props.value;s&&l&&l!==o.currentContent&&s.undoManager.ignore(function(){if(s.setContent(l),o.valueCursor&&(!o.inline||s.hasFocus()))try{s.selection.moveToBookmark(o.valueCursor)}catch{}}),o.rollbackTimer=void 0},o.handleBeforeInput=function(s){if(o.props.value!==void 0&&o.props.value===o.currentContent&&o.editor&&(!o.inline||o.editor.hasFocus()))try{o.valueCursor=o.editor.selection.getBookmark(3)}catch{}},o.handleBeforeInputSpecial=function(s){(s.key==="Enter"||s.key==="Backspace"||s.key==="Delete")&&o.handleBeforeInput(s)},o.handleEditorChange=function(s){var l=o.editor;if(l&&l.initialized){var u=l.getContent();o.props.value!==void 0&&o.props.value!==u&&o.props.rollback!==!1&&(o.rollbackTimer||(o.rollbackTimer=window.setTimeout(o.rollbackChange,typeof o.props.rollback=="number"?o.props.rollback:200))),u!==o.currentContent&&(o.currentContent=u,Eh(o.props.onEditorChange)&&o.props.onEditorChange(u,l))}},o.handleEditorChangeSpecial=function(s){(s.key==="Backspace"||s.key==="Delete")&&o.handleEditorChange(s)},o.initialise=function(s){var l,u,c;s===void 0&&(s=0);var p=o.elementRef.current;if(p){if(!RG(p)){if(s===0)setTimeout(function(){return o.initialise(1)},1);else if(s<100)setTimeout(function(){return o.initialise(s+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var h=BG(o.view),d=lo(lo(lo(lo({},o.props.init),{selector:void 0,target:p,disabled:o.props.disabled,readonly:o.props.readonly,inline:o.inline,plugins:TG((l=o.props.init)===null||l===void 0?void 0:l.plugins,o.props.plugins),toolbar:(u=o.props.toolbar)!==null&&u!==void 0?u:(c=o.props.init)===null||c===void 0?void 0:c.toolbar}),o.props.licenseKey?{license_key:o.props.licenseKey}:{}),{setup:function(v){o.editor=v,o.bindHandlers({}),o.inline&&!ax(p)&&v.once("PostRender",function(m){v.setContent(o.getInitialValue(),{no_events:!0})}),o.props.init&&Eh(o.props.init.setup)&&o.props.init.setup(v),o.props.disabled&&(lx(o.editor)?o.editor.options.set("disabled",o.props.disabled):o.editor.mode.set("readonly"))},init_instance_callback:function(v){var m,b=o.getInitialValue();o.currentContent=(m=o.currentContent)!==null&&m!==void 0?m:v.getContent(),o.currentContent!==b&&(o.currentContent=b,v.setContent(b),v.undoManager.clear(),v.undoManager.add(),v.setDirty(!1)),o.props.init&&Eh(o.props.init.init_instance_callback)&&o.props.init.init_instance_callback(v)}});o.inline||(p.style.visibility=""),ax(p)&&(p.value=o.getInitialValue()),h.init(d)}},o.id=o.props.id||qw("tiny-react"),o.elementRef=ae.createRef(),o.inline=(a=(r=o.props.inline)!==null&&r!==void 0?r:(i=o.props.init)===null||i===void 0?void 0:i.inline)!==null&&a!==void 0?a:!1,o.boundHandlers={},o}return Object.defineProperty(t.prototype,"view",{get:function(){var n,r;return(r=(n=this.elementRef.current)===null||n===void 0?void 0:n.ownerDocument.defaultView)!==null&&r!==void 0?r:window},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(n){var r=this,i,a;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(n),this.editor.initialized)){if(this.currentContent=(i=this.currentContent)!==null&&i!==void 0?i:this.editor.getContent(),typeof this.props.initialValue=="string"&&this.props.initialValue!==n.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if(typeof this.props.value=="string"&&this.props.value!==this.currentContent){var o=this.editor;o.undoManager.transact(function(){var l;if(!r.inline||o.hasFocus())try{l=o.selection.getBookmark(3)}catch{}var u=r.valueCursor;if(o.setContent(r.props.value),!r.inline||o.hasFocus())for(var c=0,p=[l,u];c<p.length;c++){var h=p[c];if(h)try{o.selection.moveToBookmark(h),r.valueCursor=h;break}catch{}}})}if(this.props.readonly!==n.readonly){var s=(a=this.props.readonly)!==null&&a!==void 0?a:!1;sx(this.editor,s?"readonly":"design")}this.props.disabled!==n.disabled&&(lx(this.editor)?this.editor.options.set("disabled",this.props.disabled):sx(this.editor,this.props.disabled?"readonly":"design"))}},t.prototype.componentDidMount=function(){var n=this,r,i,a,o,s;if(Jw(this.view)!==null)this.initialise();else if(Array.isArray(this.props.tinymceScriptSrc)&&this.props.tinymceScriptSrc.length===0)(i=(r=this.props).onScriptsLoadError)===null||i===void 0||i.call(r,new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));else if(!((a=this.elementRef.current)===null||a===void 0)&&a.ownerDocument){var l=function(){var c,p;(p=(c=n.props).onScriptsLoad)===null||p===void 0||p.call(c),n.initialise()},u=function(c){var p,h;(h=(p=n.props).onScriptsLoadError)===null||h===void 0||h.call(p,c)};FG.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(s=(o=this.props.scriptLoading)===null||o===void 0?void 0:o.delay)!==null&&s!==void 0?s:0,l,u)}},t.prototype.componentWillUnmount=function(){var n=this,r=this.editor;r&&(r.off(Sh,this.handleEditorChange),r.off(this.beforeInputEvent(),this.handleBeforeInput),r.off("keypress",this.handleEditorChangeSpecial),r.off("keydown",this.handleBeforeInputSpecial),r.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(i){r.off(i,n.boundHandlers[i])}),this.boundHandlers={},r.remove(),this.editor=void 0)},t.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},t.prototype.beforeInputEvent=function(){return AG()?"beforeinput SelectionChange":"SelectionChange"},t.prototype.renderInline=function(){var n=this.props.tagName,r=n===void 0?"div":n;return ae.createElement(r,{ref:this.elementRef,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.renderIframe=function(){return ae.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.getScriptSources=function(){var n,r,i=(n=this.props.scriptLoading)===null||n===void 0?void 0:n.async,a=(r=this.props.scriptLoading)===null||r===void 0?void 0:r.defer;if(this.props.tinymceScriptSrc!==void 0)return typeof this.props.tinymceScriptSrc=="string"?[{src:this.props.tinymceScriptSrc,async:i,defer:a}]:this.props.tinymceScriptSrc.map(function(u){return typeof u=="string"?{src:u,async:i,defer:a}:u});var o=this.props.cloudChannel,s=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(s,"/tinymce/").concat(o,"/tinymce.min.js");return[{src:l,async:i,defer:a}]},t.prototype.getInitialValue=function(){return typeof this.props.initialValue=="string"?this.props.initialValue:typeof this.props.value=="string"?this.props.value:""},t.prototype.bindHandlers=function(n){var r=this;if(this.editor!==void 0){DG(this.editor,n,this.props,this.boundHandlers,function(s){return r.props[s]});var i=function(s){return s.onEditorChange!==void 0||s.value!==void 0},a=i(n),o=i(this.props);!a&&o?(this.editor.on(Sh,this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!o&&(this.editor.off(Sh,this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},t.propTypes=IG,t.defaultProps={cloudChannel:"7"},t}(ae.Component);const OG=e=>F.jsx("div",{className:`${yG.container}`,children:F.jsx(MG,{...ws(vG({label:e.label}),e)})}),LG=({children:e,open:t,className:n,id:r,classNameContainer:i})=>(N.useLayoutEffect(()=>{const a=document.getElementById(r),o=document.getElementById(`inner-${r}`);if(!a||!o)return;const s=new ResizeObserver(()=>{const l=o.getBoundingClientRect().height;a.style.height=`${l}px`});if(t){const l=o.getBoundingClientRect().height;a.style.height=`${l}px`,s.observe(o)}else a.style.height="0px";return()=>{s.disconnect()}},[t,r]),F.jsx("div",{id:r,className:`${NS.collapse} ${i??""}`,style:{height:0},children:F.jsx("div",{id:`inner-${r}`,className:n??"",children:e})}));exports.AlertContainer=mT;exports.Badges=RS;exports.BigNumber=bt;exports.Breadcrumbs=KM;exports.Button=vr;exports.ButtonIcon=AS;exports.ButtonPopover=Yw;exports.Calendar=ld;exports.CalendarRange=DS;exports.CheckboxTable=$z;exports.Chips=BS;exports.Collapse=QM;exports.CollapseV2=LG;exports.ConfigColors=Hx;exports.ConfigTable=bn;exports.DatePicker=RM;exports.DateRangePicker=TS;exports.DefaultCheckedChecboxIcon=kS;exports.DefaultRadioChecboxIcon=PS;exports.DoughnutChart=kz;exports.ErrorMessage=Hz;exports.FilterContainer=MS;exports.FilterDate=BM;exports.GradientBarChart=uG;exports.GradientLineChart=aG;exports.InputFloatingInner=bC;exports.InputNative=Hp;exports.InputReguler=lg;exports.LineChart=Jz;exports.ListVirtualization=_2;exports.ModalDialog=tO;exports.MonthYearPicker=Pz;exports.NumberFormat=FO;exports.Pagination=Vk;exports.PatternFormat=$O;exports.Popover=bi;exports.PortalComponent=wp;exports.RadioCheckbox=ud;exports.RadioCheckboxLabel=GM;exports.SelectDropdownContainer=g4;exports.SelectDropdownContainerComponents=n4;exports.Sidebar=FS;exports.Step=Kz;exports.StepIndicator=pG;exports.Switch=$M;exports.TPublish=bA;exports.TabPanel=kk;exports.Table=Ik;exports.TableSubComponent=_k;exports.TableVirtualization=Rg;exports.Tabs=Bk;exports.TextEditor=OG;exports.Textarea=YS;exports.TextareaFloatingInner=Xw;exports.Timeline=aO;exports.Tooltip=Qz;exports.TruncateComponent=LO;exports.TypeBigNumber=Tc;exports.UploadFile=XS;exports.UploadImage=GO;exports.UploadMultipleFile=Vz;exports.betweenBig=RT;exports.configNativeScreens=vA;exports.configScreens=mA;exports.configTypography=pA;exports.configTypographyLabaBisnis=zx;exports.configTypographyPayhere=jx;exports.convertBigNumbersToStrings=$h;exports.convertNumbersToBigNumbers=Ph;exports.convertTextToJsonBigNumbers=gA;exports.cookieStorage=FD;exports.deepCompareEquals=Y0;exports.defaultConfig=vx;exports.deleteKeysImmutable=_D;exports.deleteKeysMutable=ID;exports.encryptRSAOAEP=BD;exports.extractElementStringToOriginalValue=RD;exports.formatBigNumber=kD;exports.formatDate=ao;exports.formatDateRange=bD;exports.formatNumber=Ri;exports.groupByKey=kx;exports.isAccurateBigNumber=jr;exports.isAccurateNumber=Bx;exports.lessThanBig=AT;exports.maxBig=DT;exports.minBig=_T;exports.moreThanBig=TT;exports.openAlert=vT;exports.parseBigDecimal=kc;exports.parseDecimal=W0;exports.parseFileName=_h;exports.removeKeyObjectEmptyValue=xD;exports.removeTrailingZeros=PD;exports.setDigit=Pc;exports.transformArrayMapping=ED;exports.transformArrayMappingObjectFC=SD;exports.transformArrayOfObjectToArray=X0;exports.transformArrayOfObjectToString=U0;exports.transformBigNumber=TD;exports.transformDataHistory=yD;exports.transformLatLong=CD;exports.transformNumber=DD;exports.transformSecondTime=wD;exports.transfromIsNan=AD;exports.useAsyncDebounce=S2;exports.useCombinedResizeObserver=pk;exports.useCountdown=gk;exports.useDeepCompareEffect=Gi;exports.useDeepCompareMemoize=$s;exports.useElementOrWindowMediaQuery=hk;exports.useEventListener=yk;exports.useMasonry=xk;exports.useMergeRefs=kg;exports.useStateRef=mk;exports.utilTable=DB;
229
+ Valid keys: `+JSON.stringify(Object.keys(W),null," "));var D=V(le,H,Z,ee,J+"."+H,n);if(D)return D}return null}return b(U)}function B(W){switch(typeof W){case"number":case"string":case"undefined":return!0;case"boolean":return!W;case"object":if(Array.isArray(W))return W.every(B);if(W===null||s(W))return!0;var U=p(W);if(U){var q=U.call(W),Q;if(U!==W.entries){for(;!(Q=q.next()).done;)if(!B(Q.value))return!1}else for(;!(Q=q.next()).done;){var Z=Q.value;if(Z&&!B(Z[1]))return!1}}else return!1;return!0;default:return!1}}function P(W,U){return W==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function k(W){var U=typeof W;return Array.isArray(W)?"array":W instanceof RegExp?"object":P(U,W)?"symbol":U}function O(W){if(typeof W>"u"||W===null)return""+W;var U=k(W);if(U==="object"){if(W instanceof Date)return"date";if(W instanceof RegExp)return"regexp"}return U}function M(W){var U=O(W);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function G(W){return!W.constructor||!W.constructor.name?h:W.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},xh}var Ch,ex;function SG(){if(ex)return Ch;ex=1;var e=jp();function t(){}function n(){}return n.resetWarningCache=t,Ch=function(){function r(o,s,l,u,c,p){if(p!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},Ch}var tx;function wG(){if(tx)return pu.exports;if(tx=1,process.env.NODE_ENV!=="production"){var e=Og(),t=!0;pu.exports=EG()(e.isElement,t)}else pu.exports=SG()();return pu.exports}var ce=wG(),F0=function(){return F0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},F0.apply(this,arguments)},Zw={onActivate:ce.func,onAddUndo:ce.func,onBeforeAddUndo:ce.func,onBeforeExecCommand:ce.func,onBeforeGetContent:ce.func,onBeforeRenderUI:ce.func,onBeforeSetContent:ce.func,onBeforePaste:ce.func,onBlur:ce.func,onChange:ce.func,onClearUndos:ce.func,onClick:ce.func,onContextMenu:ce.func,onCommentChange:ce.func,onCompositionEnd:ce.func,onCompositionStart:ce.func,onCompositionUpdate:ce.func,onCopy:ce.func,onCut:ce.func,onDblclick:ce.func,onDeactivate:ce.func,onDirty:ce.func,onDrag:ce.func,onDragDrop:ce.func,onDragEnd:ce.func,onDragGesture:ce.func,onDragOver:ce.func,onDrop:ce.func,onExecCommand:ce.func,onFocus:ce.func,onFocusIn:ce.func,onFocusOut:ce.func,onGetContent:ce.func,onHide:ce.func,onInit:ce.func,onInput:ce.func,onKeyDown:ce.func,onKeyPress:ce.func,onKeyUp:ce.func,onLoadContent:ce.func,onMouseDown:ce.func,onMouseEnter:ce.func,onMouseLeave:ce.func,onMouseMove:ce.func,onMouseOut:ce.func,onMouseOver:ce.func,onMouseUp:ce.func,onNodeChange:ce.func,onObjectResizeStart:ce.func,onObjectResized:ce.func,onObjectSelected:ce.func,onPaste:ce.func,onPostProcess:ce.func,onPostRender:ce.func,onPreProcess:ce.func,onProgressState:ce.func,onRedo:ce.func,onRemove:ce.func,onReset:ce.func,onSaveContent:ce.func,onSelectionChange:ce.func,onSetAttrib:ce.func,onSetContent:ce.func,onShow:ce.func,onSubmit:ce.func,onUndo:ce.func,onVisualAid:ce.func,onSkinLoadError:ce.func,onThemeLoadError:ce.func,onModelLoadError:ce.func,onPluginLoadError:ce.func,onIconsLoadError:ce.func,onLanguageLoadError:ce.func,onScriptsLoad:ce.func,onScriptsLoadError:ce.func},IG=F0({apiKey:ce.string,licenseKey:ce.string,id:ce.string,inline:ce.bool,init:ce.object,initialValue:ce.string,onEditorChange:ce.func,value:ce.string,tagName:ce.string,tabIndex:ce.number,cloudChannel:ce.string,plugins:ce.oneOfType([ce.string,ce.array]),toolbar:ce.oneOfType([ce.string,ce.array]),disabled:ce.bool,readonly:ce.bool,textareaName:ce.string,tinymceScriptSrc:ce.oneOfType([ce.string,ce.arrayOf(ce.string),ce.arrayOf(ce.shape({src:ce.string,async:ce.bool,defer:ce.bool}))]),rollback:ce.oneOfType([ce.number,ce.oneOf([!1])]),scriptLoading:ce.shape({async:ce.bool,defer:ce.bool,delay:ce.number})},Zw),Jw=function(e){var t=e;return t&&t.tinymce?t.tinymce:null},Eh=function(e){return typeof e=="function"},nx=function(e){return e in Zw},rx=function(e){return e.substr(2)},_G=function(e,t,n,r,i,a,o){var s=Object.keys(i).filter(nx),l=Object.keys(a).filter(nx),u=s.filter(function(p){return a[p]===void 0}),c=l.filter(function(p){return i[p]===void 0});u.forEach(function(p){var h=rx(p),d=o[h];n(h,d),delete o[h]}),c.forEach(function(p){var h=r(e,p),d=rx(p);o[d]=h,t(d,h)})},DG=function(e,t,n,r,i){return _G(i,e.on.bind(e),e.off.bind(e),function(a,o){return function(s){var l;return(l=a(o))===null||l===void 0?void 0:l(s,e)}},t,n,r)},ix=0,qw=function(e){var t=Date.now(),n=Math.floor(Math.random()*1e9);return ix++,e+"_"+n+ix+String(t)},ax=function(e){return e!==null&&(e.tagName.toLowerCase()==="textarea"||e.tagName.toLowerCase()==="input")},ox=function(e){return typeof e>"u"||e===""?[]:Array.isArray(e)?e:e.split(" ")},TG=function(e,t){return ox(e).concat(ox(t))},AG=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},RG=function(e){if(!("isConnected"in Node.prototype)){for(var t=e,n=e.parentNode;n!=null;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected},sx=function(e,t){e!==void 0&&(e.mode!=null&&typeof e.mode=="object"&&typeof e.mode.set=="function"?e.mode.set(t):e.setMode(t))},BG=function(e){var t=Jw(e);if(!t)throw new Error("tinymce should have been loaded into global scope");return t},lx=function(e){return e.options&&e.options.isRegistered("disabled")},N0=function(){return N0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},N0.apply(this,arguments)},kG=function(e,t,n){var r,i,a=e.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=t.id,a.src=t.src,a.async=(r=t.async)!==null&&r!==void 0?r:!1,a.defer=(i=t.defer)!==null&&i!==void 0?i:!1;var o=function(){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src)},s=function(l){a.removeEventListener("load",o),a.removeEventListener("error",s),n(t.src,l)};a.addEventListener("load",o),a.addEventListener("error",s),e.head&&e.head.appendChild(a)},PG=function(e){var t={},n=function(o,s){var l=t[o];l.done=!0,l.error=s;for(var u=0,c=l.handlers;u<c.length;u++){var p=c[u];p(o,s)}l.handlers=[]},r=function(o,s,l){var u=function(y){return l!==void 0?l(y):console.error(y)};if(o.length===0){u(new Error("At least one script must be provided"));return}for(var c=0,p=!1,h=function(y,C){p||(C?(p=!0,u(C)):++c===o.length&&s())},d=0,v=o;d<v.length;d++){var m=v[d],b=t[m.src];if(b)b.done?h(m.src,b.error):b.handlers.push(h);else{var f=qw("tiny-");t[m.src]={id:f,src:m.src,done:!1,error:null,handlers:[h]},kG(e,N0({id:f},m),n)}}},i=function(){for(var o,s=0,l=Object.values(t);s<l.length;s++){var u=l[s],c=e.getElementById(u.id);c!=null&&c.tagName==="SCRIPT"&&((o=c.parentNode)===null||o===void 0||o.removeChild(c))}t={}},a=function(){return e};return{loadScripts:r,deleteScripts:i,getDocument:a}},$G=function(){var e=[],t=function(i){var a=e.find(function(o){return o.getDocument()===i});return a===void 0&&(a=PG(i),e.push(a)),a},n=function(i,a,o,s,l){var u=function(){return t(i).loadScripts(a,s,l)};o>0?setTimeout(u,o):u()},r=function(){for(var i=e.pop();i!=null;i=e.pop())i.deleteScripts()};return{loadList:n,reinitialize:r}},FG=$G(),NG=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lo=function(){return lo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lo.apply(this,arguments)},Sh="change keyup compositionend setcontent CommentChange",MG=function(e){NG(t,e);function t(n){var r,i,a,o=e.call(this,n)||this;return o.rollbackTimer=void 0,o.valueCursor=void 0,o.rollbackChange=function(){var s=o.editor,l=o.props.value;s&&l&&l!==o.currentContent&&s.undoManager.ignore(function(){if(s.setContent(l),o.valueCursor&&(!o.inline||s.hasFocus()))try{s.selection.moveToBookmark(o.valueCursor)}catch{}}),o.rollbackTimer=void 0},o.handleBeforeInput=function(s){if(o.props.value!==void 0&&o.props.value===o.currentContent&&o.editor&&(!o.inline||o.editor.hasFocus()))try{o.valueCursor=o.editor.selection.getBookmark(3)}catch{}},o.handleBeforeInputSpecial=function(s){(s.key==="Enter"||s.key==="Backspace"||s.key==="Delete")&&o.handleBeforeInput(s)},o.handleEditorChange=function(s){var l=o.editor;if(l&&l.initialized){var u=l.getContent();o.props.value!==void 0&&o.props.value!==u&&o.props.rollback!==!1&&(o.rollbackTimer||(o.rollbackTimer=window.setTimeout(o.rollbackChange,typeof o.props.rollback=="number"?o.props.rollback:200))),u!==o.currentContent&&(o.currentContent=u,Eh(o.props.onEditorChange)&&o.props.onEditorChange(u,l))}},o.handleEditorChangeSpecial=function(s){(s.key==="Backspace"||s.key==="Delete")&&o.handleEditorChange(s)},o.initialise=function(s){var l,u,c;s===void 0&&(s=0);var p=o.elementRef.current;if(p){if(!RG(p)){if(s===0)setTimeout(function(){return o.initialise(1)},1);else if(s<100)setTimeout(function(){return o.initialise(s+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var h=BG(o.view),d=lo(lo(lo(lo({},o.props.init),{selector:void 0,target:p,disabled:o.props.disabled,readonly:o.props.readonly,inline:o.inline,plugins:TG((l=o.props.init)===null||l===void 0?void 0:l.plugins,o.props.plugins),toolbar:(u=o.props.toolbar)!==null&&u!==void 0?u:(c=o.props.init)===null||c===void 0?void 0:c.toolbar}),o.props.licenseKey?{license_key:o.props.licenseKey}:{}),{setup:function(v){o.editor=v,o.bindHandlers({}),o.inline&&!ax(p)&&v.once("PostRender",function(m){v.setContent(o.getInitialValue(),{no_events:!0})}),o.props.init&&Eh(o.props.init.setup)&&o.props.init.setup(v),o.props.disabled&&(lx(o.editor)?o.editor.options.set("disabled",o.props.disabled):o.editor.mode.set("readonly"))},init_instance_callback:function(v){var m,b=o.getInitialValue();o.currentContent=(m=o.currentContent)!==null&&m!==void 0?m:v.getContent(),o.currentContent!==b&&(o.currentContent=b,v.setContent(b),v.undoManager.clear(),v.undoManager.add(),v.setDirty(!1)),o.props.init&&Eh(o.props.init.init_instance_callback)&&o.props.init.init_instance_callback(v)}});o.inline||(p.style.visibility=""),ax(p)&&(p.value=o.getInitialValue()),h.init(d)}},o.id=o.props.id||qw("tiny-react"),o.elementRef=ae.createRef(),o.inline=(a=(r=o.props.inline)!==null&&r!==void 0?r:(i=o.props.init)===null||i===void 0?void 0:i.inline)!==null&&a!==void 0?a:!1,o.boundHandlers={},o}return Object.defineProperty(t.prototype,"view",{get:function(){var n,r;return(r=(n=this.elementRef.current)===null||n===void 0?void 0:n.ownerDocument.defaultView)!==null&&r!==void 0?r:window},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(n){var r=this,i,a;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(n),this.editor.initialized)){if(this.currentContent=(i=this.currentContent)!==null&&i!==void 0?i:this.editor.getContent(),typeof this.props.initialValue=="string"&&this.props.initialValue!==n.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if(typeof this.props.value=="string"&&this.props.value!==this.currentContent){var o=this.editor;o.undoManager.transact(function(){var l;if(!r.inline||o.hasFocus())try{l=o.selection.getBookmark(3)}catch{}var u=r.valueCursor;if(o.setContent(r.props.value),!r.inline||o.hasFocus())for(var c=0,p=[l,u];c<p.length;c++){var h=p[c];if(h)try{o.selection.moveToBookmark(h),r.valueCursor=h;break}catch{}}})}if(this.props.readonly!==n.readonly){var s=(a=this.props.readonly)!==null&&a!==void 0?a:!1;sx(this.editor,s?"readonly":"design")}this.props.disabled!==n.disabled&&(lx(this.editor)?this.editor.options.set("disabled",this.props.disabled):sx(this.editor,this.props.disabled?"readonly":"design"))}},t.prototype.componentDidMount=function(){var n=this,r,i,a,o,s;if(Jw(this.view)!==null)this.initialise();else if(Array.isArray(this.props.tinymceScriptSrc)&&this.props.tinymceScriptSrc.length===0)(i=(r=this.props).onScriptsLoadError)===null||i===void 0||i.call(r,new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));else if(!((a=this.elementRef.current)===null||a===void 0)&&a.ownerDocument){var l=function(){var c,p;(p=(c=n.props).onScriptsLoad)===null||p===void 0||p.call(c),n.initialise()},u=function(c){var p,h;(h=(p=n.props).onScriptsLoadError)===null||h===void 0||h.call(p,c)};FG.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(s=(o=this.props.scriptLoading)===null||o===void 0?void 0:o.delay)!==null&&s!==void 0?s:0,l,u)}},t.prototype.componentWillUnmount=function(){var n=this,r=this.editor;r&&(r.off(Sh,this.handleEditorChange),r.off(this.beforeInputEvent(),this.handleBeforeInput),r.off("keypress",this.handleEditorChangeSpecial),r.off("keydown",this.handleBeforeInputSpecial),r.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(i){r.off(i,n.boundHandlers[i])}),this.boundHandlers={},r.remove(),this.editor=void 0)},t.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},t.prototype.beforeInputEvent=function(){return AG()?"beforeinput SelectionChange":"SelectionChange"},t.prototype.renderInline=function(){var n=this.props.tagName,r=n===void 0?"div":n;return ae.createElement(r,{ref:this.elementRef,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.renderIframe=function(){return ae.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id,tabIndex:this.props.tabIndex})},t.prototype.getScriptSources=function(){var n,r,i=(n=this.props.scriptLoading)===null||n===void 0?void 0:n.async,a=(r=this.props.scriptLoading)===null||r===void 0?void 0:r.defer;if(this.props.tinymceScriptSrc!==void 0)return typeof this.props.tinymceScriptSrc=="string"?[{src:this.props.tinymceScriptSrc,async:i,defer:a}]:this.props.tinymceScriptSrc.map(function(u){return typeof u=="string"?{src:u,async:i,defer:a}:u});var o=this.props.cloudChannel,s=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(s,"/tinymce/").concat(o,"/tinymce.min.js");return[{src:l,async:i,defer:a}]},t.prototype.getInitialValue=function(){return typeof this.props.initialValue=="string"?this.props.initialValue:typeof this.props.value=="string"?this.props.value:""},t.prototype.bindHandlers=function(n){var r=this;if(this.editor!==void 0){DG(this.editor,n,this.props,this.boundHandlers,function(s){return r.props[s]});var i=function(s){return s.onEditorChange!==void 0||s.value!==void 0},a=i(n),o=i(this.props);!a&&o?(this.editor.on(Sh,this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):a&&!o&&(this.editor.off(Sh,this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},t.propTypes=IG,t.defaultProps={cloudChannel:"7"},t}(ae.Component);const OG=e=>F.jsx("div",{className:`${yG.container}`,children:F.jsx(MG,{...ws(vG({label:e.label}),e)})}),LG=({children:e,open:t,className:n,id:r,classNameContainer:i})=>(N.useLayoutEffect(()=>{const a=document.getElementById(r),o=document.getElementById(`inner-${r}`);if(!a||!o)return;const s=new ResizeObserver(()=>{const l=o.getBoundingClientRect().height;a.style.height=`${l}px`});if(t){const l=o.getBoundingClientRect().height;a.style.height=`${l}px`,s.observe(o)}else a.style.height="0px";return()=>{s.disconnect()}},[t,r]),F.jsx("div",{id:r,className:`${NS.collapse} ${i??""}`,style:{height:0},children:F.jsx("div",{id:`inner-${r}`,className:n??"",children:e})}));exports.AlertContainer=mT;exports.Badges=RS;exports.BigNumber=bt;exports.Breadcrumbs=KM;exports.Button=vr;exports.ButtonIcon=AS;exports.ButtonPopover=Yw;exports.Calendar=ld;exports.CalendarRange=DS;exports.CheckboxTable=$z;exports.Chips=BS;exports.Collapse=QM;exports.CollapseV2=LG;exports.ConfigColors=Hx;exports.ConfigTable=yn;exports.DatePicker=RM;exports.DateRangePicker=TS;exports.DefaultCheckedChecboxIcon=kS;exports.DefaultRadioChecboxIcon=PS;exports.DoughnutChart=kz;exports.ErrorMessage=Hz;exports.FilterContainer=MS;exports.FilterDate=BM;exports.GradientBarChart=uG;exports.GradientLineChart=aG;exports.InputFloatingInner=bC;exports.InputNative=Hp;exports.InputReguler=lg;exports.LineChart=Jz;exports.ListVirtualization=_2;exports.ModalDialog=tO;exports.MonthYearPicker=Pz;exports.NumberFormat=FO;exports.Pagination=Vk;exports.PatternFormat=$O;exports.Popover=bi;exports.PortalComponent=wp;exports.RadioCheckbox=ud;exports.RadioCheckboxLabel=GM;exports.SelectDropdownContainer=g4;exports.SelectDropdownContainerComponents=n4;exports.Sidebar=FS;exports.Step=Kz;exports.StepIndicator=pG;exports.Switch=$M;exports.TPublish=bA;exports.TabPanel=kk;exports.Table=Ik;exports.TableSubComponent=_k;exports.TableVirtualization=Rg;exports.Tabs=Bk;exports.TextEditor=OG;exports.Textarea=YS;exports.TextareaFloatingInner=Xw;exports.Timeline=aO;exports.Tooltip=Qz;exports.TruncateComponent=LO;exports.TypeBigNumber=Tc;exports.UploadFile=XS;exports.UploadImage=GO;exports.UploadMultipleFile=Vz;exports.betweenBig=RT;exports.configNativeScreens=vA;exports.configScreens=mA;exports.configTypography=pA;exports.configTypographyLabaBisnis=zx;exports.configTypographyPayhere=jx;exports.convertBigNumbersToStrings=$h;exports.convertNumbersToBigNumbers=Ph;exports.convertTextToJsonBigNumbers=gA;exports.cookieStorage=FD;exports.deepCompareEquals=Y0;exports.defaultConfig=vx;exports.deleteKeysImmutable=_D;exports.deleteKeysMutable=ID;exports.encryptRSAOAEP=BD;exports.extractElementStringToOriginalValue=RD;exports.formatBigNumber=kD;exports.formatDate=ao;exports.formatDateRange=bD;exports.formatNumber=Ri;exports.groupByKey=kx;exports.isAccurateBigNumber=jr;exports.isAccurateNumber=Bx;exports.lessThanBig=AT;exports.maxBig=DT;exports.minBig=_T;exports.moreThanBig=TT;exports.openAlert=vT;exports.parseBigDecimal=kc;exports.parseDecimal=W0;exports.parseFileName=_h;exports.removeKeyObjectEmptyValue=xD;exports.removeTrailingZeros=PD;exports.setDigit=Pc;exports.transformArrayMapping=ED;exports.transformArrayMappingObjectFC=SD;exports.transformArrayOfObjectToArray=X0;exports.transformArrayOfObjectToString=U0;exports.transformBigNumber=TD;exports.transformDataHistory=yD;exports.transformLatLong=CD;exports.transformNumber=DD;exports.transformSecondTime=wD;exports.transfromIsNan=AD;exports.useAsyncDebounce=S2;exports.useCombinedResizeObserver=pk;exports.useCountdown=gk;exports.useDeepCompareEffect=Gi;exports.useDeepCompareMemoize=$s;exports.useElementOrWindowMediaQuery=hk;exports.useEventListener=yk;exports.useMasonry=xk;exports.useMergeRefs=kg;exports.useStateRef=mk;exports.utilTable=DB;
230
230
  //# sourceMappingURL=index.cjs.map