1mpacto-react-ui 1.0.13 → 1.0.15

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
@@ -11,7 +11,7 @@
11
11
  `,n};fC.decode=function(e){for(var t=[],n=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,r=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/,a;a=n.exec(e),!!a;){var o=a[1];o==="NEW CERTIFICATE REQUEST"&&(o="CERTIFICATE REQUEST");var s={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:qc.util.decode64(a[3])};if(t.push(s),!!a[2]){for(var l=a[2].split(i),u=0;a&&u<l.length;){for(var c=l[u].replace(/\s+$/,""),d=u+1;d<l.length;++d){var h=l[d];if(!/\s/.test(h[0]))break;c+=h,u=d}if(a=c.match(r),a){for(var f={name:a[1],values:[]},g=a[2].split(","),p=0;p<g.length;++p)f.values.push(y6(g[p]));if(s.procType)if(!s.contentDomain&&f.name==="Content-Domain")s.contentDomain=g[0]||"";else if(!s.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.');s.dekInfo={algorithm:g[0],parameters:g[1]||null}}else s.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.');s.procType={version:g[0],type:g[1]}}}++u}if(s.procType==="ENCRYPTED"&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function $u(e){for(var t=e.name+": ",n=[],r=function(l,u){return" "+u},i=0;i<e.values.length;++i)n.push(e.values[i].replace(/^(\S+\r\n)/,r));t+=n.join(",")+`\r
12
12
  `;for(var a=0,o=-1,i=0;i<t.length;++i,++a)if(a>65&&o!==-1){var s=t[o];s===","?(++o,t=t.substr(0,o)+`\r
13
13
  `+t.substr(o)):t=t.substr(0,o)+`\r
14
- `+s+t.substr(o+1),a=i-o-1,o=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(o=i);return t}function y6(e){return e.replace(/^\s+/,"")}var Tt=ze;Tt.des=Tt.des||{};Tt.des.startEncrypting=function(e,t,n,r){var i=af({key:e,output:n,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Tt.des.createEncryptionCipher=function(e,t){return af({key:e,output:null,decrypt:!1,mode:t})};Tt.des.startDecrypting=function(e,t,n,r){var i=af({key:e,output:n,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Tt.des.createDecryptionCipher=function(e,t){return af({key:e,output:null,decrypt:!0,mode:t})};Tt.des.Algorithm=function(e,t){var n=this;n.name=e,n.mode=new t({blockSize:8,cipher:{encrypt:function(r,i){return y1(n._keys,r,i,!1)},decrypt:function(r,i){return y1(n._keys,r,i,!0)}}}),n._init=!1};Tt.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Tt.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=A6(t),this._init=!0}};gi("DES-ECB",Tt.cipher.modes.ecb);gi("DES-CBC",Tt.cipher.modes.cbc);gi("DES-CFB",Tt.cipher.modes.cfb);gi("DES-OFB",Tt.cipher.modes.ofb);gi("DES-CTR",Tt.cipher.modes.ctr);gi("3DES-ECB",Tt.cipher.modes.ecb);gi("3DES-CBC",Tt.cipher.modes.cbc);gi("3DES-CFB",Tt.cipher.modes.cfb);gi("3DES-OFB",Tt.cipher.modes.ofb);gi("3DES-CTR",Tt.cipher.modes.ctr);function gi(e,t){var n=function(){return new Tt.des.Algorithm(e,t)};Tt.cipher.registerAlgorithm(e,n)}var x6=[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],C6=[-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],E6=[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],S6=[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],w6=[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],I6=[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],_6=[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],D6=[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 A6(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[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],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],f=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,x,C=0;C<p;C++){var E=e.getInt32(),w=e.getInt32();x=(E>>>4^w)&252645135,w^=x,E^=x<<4,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>2^w)&858993459,w^=x,E^=x<<2,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=(w>>>8^E)&16711935,E^=x,w^=x<<8,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=E<<8|w>>>20&240,E=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=x;for(var B=0;B<b.length;++B){b[B]?(E=E<<2|E>>>26,w=w<<2|w>>>26):(E=E<<1|E>>>27,w=w<<1|w>>>27),E&=-15,w&=-15;var y=t[E>>>28]|n[E>>>24&15]|r[E>>>20&15]|i[E>>>16&15]|a[E>>>12&15]|o[E>>>8&15]|s[E>>>4&15],S=l[w>>>28]|u[w>>>24&15]|c[w>>>20&15]|d[w>>>16&15]|h[w>>>12&15]|f[w>>>8&15]|g[w>>>4&15];x=(S>>>16^y)&65535,m[v++]=y^x,m[v++]=S^x<<16}}return m}function y1(e,t,n,r){var i=e.length===32?3:9,a;i===3?a=r?[30,-2,-2]:[0,32,2]:a=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=t[0],l=t[1];o=(s>>>4^l)&252645135,l^=o,s^=o<<4,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,s=s<<1|s>>>31,l=l<<1|l>>>31;for(var u=0;u<i;u+=3){for(var c=a[u+1],d=a[u+2],h=a[u];h!=c;h+=d){var f=l^e[h],g=(l>>>4|l<<28)^e[h+1];o=s,s=l,l=o^(C6[f>>>24&63]|S6[f>>>16&63]|I6[f>>>8&63]|D6[f&63]|x6[g>>>24&63]|E6[g>>>16&63]|w6[g>>>8&63]|_6[g&63])}o=s,s=l,l=o}s=s>>>1|s<<31,l=l>>>1|l<<31,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(s>>>4^l)&252645135,l^=o,s^=o<<4,n[0]=s,n[1]=l}function af(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),n="DES-"+t,r;e.decrypt?r=Tt.cipher.createDecipher(n,e.key):r=Tt.cipher.createCipher(n,e.key);var i=r.start;return r.start=function(a,o){var s=null;o instanceof Tt.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(r,o)},r}const T6={},R6=Object.freeze(Object.defineProperty({__proto__:null,default:T6},Symbol.toStringTag,{value:"Module"})),np=s6(R6);var _n=ze,B6=_n.pkcs5=_n.pkcs5||{},wi;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(wi=np);_n.pbkdf2=B6.pbkdf2=function(e,t,n,r,i,a){if(typeof i=="function"&&(a=i,i=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&wi.pbkdf2&&(i===null||typeof i!="object")&&(wi.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?wi.pbkdf2Sync.length===4?wi.pbkdf2(e,t,n,r,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):wi.pbkdf2(e,t,n,r,i,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):wi.pbkdf2Sync.length===4?wi.pbkdf2Sync(e,t,n,r).toString("binary"):wi.pbkdf2Sync(e,t,n,r,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=_n.md[i].create()}var o=i.digestLength;if(r>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var l=Math.ceil(r/o),u=r-(l-1)*o,c=_n.hmac.create();c.start(i,e);var d="",h,f,g;if(!a){for(var p=1;p<=l;++p){c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes();for(var m=2;m<=n;++m)c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f;d+=p<l?h:h.substr(0,u)}return d}var p=1,m;function b(){if(p>l)return a(null,d);c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes(),m=2,v()}function v(){if(m<=n)return c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f,++m,_n.util.setImmediate(v);d+=p<l?h:h.substr(0,u),++p,b()}b()};var ei=ze,hC=ei.sha256=ei.sha256||{};ei.md.sha256=ei.md.algorithms.sha256=hC;hC.create=function(){gC||$6();var e=null,t=ei.util.createBuffer(),n=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ei.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ei.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),x1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ei.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(_0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};x1(d,n,i);var h=ei.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h.putInt32(d.h5),h.putInt32(d.h6),h.putInt32(d.h7),h},r};var _0=null,gC=!1,pC=null;function $6(){_0="€",_0+=ei.util.fillString("\0",64),pC=[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],gC=!0}function x1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v=n.length();v>=64;){for(u=0;u<16;++u)t[u]=n.getInt32();for(;u<64;++u)r=t[u-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=t[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=r+t[u-7]+i+t[u-16]|0;for(c=e.h0,d=e.h1,h=e.h2,f=e.h3,g=e.h4,p=e.h5,m=e.h6,b=e.h7,u=0;u<64;++u)o=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),s=m^g&(p^m),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),l=c&d|h&(c^d),r=b+o+s+pC[u]+t[u],i=a+l,b=m,m=p,p=g,g=f+r>>>0,f=h,h=d,d=c,c=r+i>>>0;e.h0=e.h0+c|0,e.h1=e.h1+d|0,e.h2=e.h2+h|0,e.h3=e.h3+f|0,e.h4=e.h4+g|0,e.h5=e.h5+p|0,e.h6=e.h6+m|0,e.h7=e.h7+b|0,v-=64}}var Yr=ze,Ac=null;Yr.util.isNodejs&&!Yr.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ac=np);var k6=Yr.prng=Yr.prng||{};k6.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,r=new Array(32),i=0;i<32;++i)r[i]=n.create();t.pools=r,t.pool=0,t.generate=function(u,c){if(!c)return t.generateSync(u);var d=t.plugin.cipher,h=t.plugin.increment,f=t.plugin.formatKey,g=t.plugin.formatSeed,p=Yr.util.createBuffer();t.key=null,m();function m(b){if(b)return c(b);if(p.length()>=u)return c(null,p.getBytes(u));if(t.generated>1048575&&(t.key=null),t.key===null)return Yr.util.nextTick(function(){a(m)});var v=d(t.key,t.seed);t.generated+=v.length,p.putBytes(v),t.key=f(d(t.key,h(t.seed))),t.seed=g(d(t.key,t.seed)),Yr.util.setImmediate(m)}},t.generateSync=function(u){var c=t.plugin.cipher,d=t.plugin.increment,h=t.plugin.formatKey,f=t.plugin.formatSeed;t.key=null;for(var g=Yr.util.createBuffer();g.length()<u;){t.generated>1048575&&(t.key=null),t.key===null&&o();var p=c(t.key,t.seed);t.generated+=p.length,g.putBytes(p),t.key=h(c(t.key,d(t.seed))),t.seed=f(c(t.key,t.seed))}return g.getBytes(u)};function a(u){if(t.pools[0].messageLength>=32)return s(),u();var c=32-t.pools[0].messageLength<<5;t.seedFile(c,function(d,h){if(d)return u(d);t.collect(h),s(),u()})}function o(){if(t.pools[0].messageLength>=32)return s();var u=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(u)),s()}function s(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var u=t.plugin.md.create();u.update(t.keyBytes);for(var c=1,d=0;d<32;++d)t.reseeds%c===0&&(u.update(t.pools[d].digest().getBytes()),t.pools[d].start()),c=c<<1;t.keyBytes=u.digest().getBytes(),u.start(),u.update(t.keyBytes);var h=u.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(h),t.generated=0}function l(u){var c=null,d=Yr.util.globalScope,h=d.crypto||d.msCrypto;h&&h.getRandomValues&&(c=function(E){return h.getRandomValues(E)});var f=Yr.util.createBuffer();if(c)for(;f.length()<u;){var g=Math.max(1,Math.min(u-f.length(),65536)/4),p=new Uint32Array(Math.floor(g));try{c(p);for(var m=0;m<p.length;++m)f.putInt32(p[m])}catch(E){if(!(typeof QuotaExceededError<"u"&&E instanceof QuotaExceededError))throw E}}if(f.length()<u)for(var b,v,x,C=Math.floor(Math.random()*65536);f.length()<u;){v=16807*(C&65535),b=16807*(C>>16),v+=(b&32767)<<16,v+=b>>15,v=(v&2147483647)+(v>>31),C=v&4294967295;for(var m=0;m<3;++m)x=C>>>(m<<3),x^=Math.floor(Math.random()*256),f.putByte(x&255)}return f.getBytes(u)}return Ac?(t.seedFile=function(u,c){Ac.randomBytes(u,function(d,h){if(d)return c(d);c(null,h.toString())})},t.seedFileSync=function(u){return Ac.randomBytes(u).toString()}):(t.seedFile=function(u,c){try{c(null,l(u))}catch(d){c(d)}},t.seedFileSync=l),t.collect=function(u){for(var c=u.length,d=0;d<c;++d)t.pools[t.pool].update(u.substr(d,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(u,c){for(var d="",h=0;h<c;h+=8)d+=String.fromCharCode(u>>h&255);t.collect(d)},t.registerWorker=function(u){if(u===self)t.seedFile=function(d,h){function f(g){var p=g.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",f),h(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",f),self.postMessage({forge:{prng:{needed:d}}})};else{var c=function(d){var h=d.data;h.forge&&h.forge.prng&&t.seedFile(h.forge.prng.needed,function(f,g){u.postMessage({forge:{prng:{err:f,bytes:g}}})})};u.addEventListener("message",c)}},t};var en=ze;(function(){if(en.random&&en.random.getBytes){en.random;return}(function(e){var t={},n=new Array(4),r=en.util.createBuffer();t.formatKey=function(d){var h=en.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),en.aes._expandKey(d,!1)},t.formatSeed=function(d){var h=en.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),d},t.cipher=function(d,h){return en.aes._updateBlock(d,h,n,!1),r.putInt32(n[0]),r.putInt32(n[1]),r.putInt32(n[2]),r.putInt32(n[3]),r.getBytes()},t.increment=function(d){return++d[3],d},t.md=en.md.sha256;function i(){var d=en.prng.create(t);return d.getBytes=function(h,f){return d.generate(h,f)},d.getBytesSync=function(h){return d.generate(h)},d}var a=i(),o=null,s=en.util.globalScope,l=s.crypto||s.msCrypto;if(l&&l.getRandomValues&&(o=function(d){return l.getRandomValues(d)}),en.options.usePureJavaScript||!en.util.isNodejs&&!o){if(a.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var c in navigator)try{typeof navigator[c]=="string"&&(u+=navigator[c])}catch{}a.collect(u),u=null}e&&(e().mousemove(function(d){a.collectInt(d.clientX,16),a.collectInt(d.clientY,16)}),e().keypress(function(d){a.collectInt(d.charCode,8)}))}if(!en.random)en.random=a;else for(var c in a)en.random[c]=a[c];en.random.createInstance=i,en.random})(typeof jQuery<"u"?jQuery:null)})();var Vn=ze,Zf=[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],C1=[1,2,3,5],P6=function(e,t){return e<<t&65535|(e&65535)>>16-t},F6=function(e,t){return(e&65535)>>t|e<<16-t&65535};Vn.rc2=Vn.rc2||{};Vn.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Vn.util.createBuffer(e)),t=t||128;var n=e,r=e.length(),i=t,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=r;s<128;s++)n.putByte(Zf[n.at(s-1)+n.at(s-r)&255]);for(n.setAt(128-a,Zf[n.at(128-a)&o]),s=127-a;s>=0;s--)n.setAt(s,Zf[n.at(s+1)^n.at(s+a)]);return n};var mC=function(e,t,n){var r=!1,i=null,a=null,o=null,s,l,u,c,d=[];for(e=Vn.rc2.expandKey(e,t),u=0;u<64;u++)d.push(e.getInt16Le());n?(s=function(g){for(u=0;u<4;u++)g[u]+=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),g[u]=P6(g[u],C1[u]),c++},l=function(g){for(u=0;u<4;u++)g[u]+=d[g[(u+3)%4]&63]}):(s=function(g){for(u=3;u>=0;u--)g[u]=F6(g[u],C1[u]),g[u]-=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),c--},l=function(g){for(u=3;u>=0;u--)g[u]-=d[g[(u+3)%4]&63]});var h=function(g){var p=[];for(u=0;u<4;u++){var m=i.getInt16Le();o!==null&&(n?m^=o.getInt16Le():o.putInt16Le(m)),p.push(m&65535)}c=n?0:63;for(var b=0;b<g.length;b++)for(var v=0;v<g[b][0];v++)g[b][1](p);for(u=0;u<4;u++)o!==null&&(n?o.putInt16Le(p[u]):p[u]^=o.getInt16Le()),a.putInt16Le(p[u])},f=null;return f={start:function(g,p){g&&typeof g=="string"&&(g=Vn.util.createBuffer(g)),r=!1,i=Vn.util.createBuffer(),a=p||new Vn.util.createBuffer,o=g,f.output=a},update:function(g){for(r||i.putBuffer(g);i.length()>=8;)h([[5,s],[1,l],[6,s],[1,l],[5,s]])},finish:function(g){var p=!0;if(n)if(g)p=g(8,i,!n);else{var m=i.length()===8?8:8-i.length();i.fillWithByte(m,m)}if(p&&(r=!0,f.update()),!n&&(p=i.length()===0,p))if(g)p=g(8,a,!n);else{var b=a.length(),v=a.at(b-1);v>b?p=!1:a.truncate(v)}return p}},f};Vn.rc2.startEncrypting=function(e,t,n){var r=Vn.rc2.createEncryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createEncryptionCipher=function(e,t){return mC(e,t,!0)};Vn.rc2.startDecrypting=function(e,t,n){var r=Vn.rc2.createDecryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createDecryptionCipher=function(e,t){return mC(e,t,!1)};var D0=ze;D0.jsbn=D0.jsbn||{};var ki;function oe(e,t,n){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,n):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}D0.jsbn.BigInteger=oe;function it(){return new oe(null)}function N6(e,t,n,r,i,a){for(;--a>=0;){var o=t*this.data[e++]+n.data[r]+i;i=Math.floor(o/67108864),n.data[r++]=o&67108863}return i}function M6(e,t,n,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this.data[e]&32767,u=this.data[e++]>>15,c=s*l+u*o;l=o*l+((c&32767)<<15)+n.data[r]+(i&1073741823),i=(l>>>30)+(c>>>15)+s*u+(i>>>30),n.data[r++]=l&1073741823}return i}function E1(e,t,n,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this.data[e]&16383,u=this.data[e++]>>14,c=s*l+u*o;l=o*l+((c&16383)<<14)+n.data[r]+i,i=(l>>28)+(c>>14)+s*u,n.data[r++]=l&268435455}return i}typeof navigator>"u"?(oe.prototype.am=E1,ki=28):navigator.appName=="Microsoft Internet Explorer"?(oe.prototype.am=M6,ki=30):navigator.appName!="Netscape"?(oe.prototype.am=N6,ki=26):(oe.prototype.am=E1,ki=28);oe.prototype.DB=ki;oe.prototype.DM=(1<<ki)-1;oe.prototype.DV=1<<ki;var rp=52;oe.prototype.FV=Math.pow(2,rp);oe.prototype.F1=rp-ki;oe.prototype.F2=2*ki-rp;var L6="0123456789abcdefghijklmnopqrstuvwxyz",of=new Array,As,mr;As=48;for(mr=0;mr<=9;++mr)of[As++]=mr;As=97;for(mr=10;mr<36;++mr)of[As++]=mr;As=65;for(mr=10;mr<36;++mr)of[As++]=mr;function S1(e){return L6.charAt(e)}function bC(e,t){var n=of[e.charCodeAt(t)];return n??-1}function O6(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function V6(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function oa(e){var t=it();return t.fromInt(e),t}function H6(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,i=!1,a=0;--r>=0;){var o=n==8?e[r]&255:bC(e,r);if(o<0){e.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+n>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=n,a>=this.DB&&(a-=this.DB)}n==8&&e[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&oe.ZERO.subTo(this,this)}function j6(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function W6(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=S1(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=S1(r));return i?a:"0"}function z6(){var e=it();return oe.ZERO.subTo(this,e),e}function G6(){return this.s<0?this.negate():this}function U6(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this.data[n]-e.data[n])!=0)return t;return 0}function sf(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}function X6(){return this.t<=0?0:this.DB*(this.t-1)+sf(this.data[this.t-1]^this.s&this.DM)}function Z6(e,t){var n;for(n=this.t-1;n>=0;--n)t.data[n+e]=this.data[n];for(n=e-1;n>=0;--n)t.data[n]=0;t.t=this.t+e,t.s=this.s}function Y6(e,t){for(var n=e;n<this.t;++n)t.data[n-e]=this.data[n];t.t=Math.max(this.t-e,0),t.s=this.s}function K6(e,t){var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>r|o,o=(this.data[s]&i)<<n;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function J6(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB,i=this.DB-r,a=(1<<r)-1;t.data[0]=this.data[n]>>r;for(var o=n+1;o<this.t;++o)t.data[o-n-1]|=(this.data[o]&a)<<i,t.data[o-n]=this.data[o]>>r;r>0&&(t.data[this.t-n-1]|=(this.s&a)<<i),t.t=this.t-n,t.clamp()}function q6(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]-e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[n++]=this.DV+r:r>0&&(t.data[n++]=r),t.t=n,t.clamp()}function Q6(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+n.t]=n.am(0,r.data[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&oe.ZERO.subTo(t,t)}function eA(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e.data[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t.data[n],e,2*n,0,1);(e.data[n+t.t]+=t.am(n+1,2*t.data[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e.data[n+t.t]-=t.DV,e.data[n+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(n,t.data[n],e,2*n,0,1)),e.s=0,e.clamp()}function tA(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=it());var a=it(),o=this.s,s=e.s,l=this.DB-sf(r.data[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,n)):(r.copyTo(a),i.copyTo(n));var u=a.t,c=a.data[u-1];if(c!=0){var d=c*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),h=this.FV/d,f=(1<<this.F1)/d,g=1<<this.F2,p=n.t,m=p-u,b=t??it();for(a.dlShiftTo(m,b),n.compareTo(b)>=0&&(n.data[n.t++]=1,n.subTo(b,n)),oe.ONE.dlShiftTo(u,b),b.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var v=n.data[--p]==c?this.DM:Math.floor(n.data[p]*h+(n.data[p-1]+g)*f);if((n.data[p]+=a.am(0,v,n,m,0,u))<v)for(a.dlShiftTo(m,b),n.subTo(b,n);n.data[p]<--v;)n.subTo(b,n)}t!=null&&(n.drShiftTo(u,t),o!=s&&oe.ZERO.subTo(t,t)),n.t=u,n.clamp(),l>0&&n.rShiftTo(l,n),o<0&&oe.ZERO.subTo(n,n)}}}function nA(e){var t=it();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(oe.ZERO)>0&&e.subTo(t,t),t}function Eo(e){this.m=e}function rA(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function iA(e){return e}function aA(e){e.divRemTo(this.m,null,e)}function oA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function sA(e,t){e.squareTo(t),this.reduce(t)}Eo.prototype.convert=rA;Eo.prototype.revert=iA;Eo.prototype.reduce=aA;Eo.prototype.mulTo=oA;Eo.prototype.sqrTo=sA;function lA(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function So(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function uA(e){var t=it();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(oe.ZERO)>0&&this.m.subTo(t,t),t}function cA(e){var t=it();return e.copyTo(t),this.reduce(t),t}function dA(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e.data[t]&32767,r=n*this.mpl+((n*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e.data[n]+=this.m.am(0,r,e,t,0,this.m.t);e.data[n]>=e.DV;)e.data[n]-=e.DV,e.data[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function fA(e,t){e.squareTo(t),this.reduce(t)}function hA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}So.prototype.convert=uA;So.prototype.revert=cA;So.prototype.reduce=dA;So.prototype.mulTo=hA;So.prototype.sqrTo=fA;function gA(){return(this.t>0?this.data[0]&1:this.s)==0}function pA(e,t){if(e>4294967295||e<1)return oe.ONE;var n=it(),r=it(),i=t.convert(this),a=sf(e)-1;for(i.copyTo(n);--a>=0;)if(t.sqrTo(n,r),(e&1<<a)>0)t.mulTo(r,i,n);else{var o=n;n=r,r=o}return t.revert(n)}function mA(e,t){var n;return e<256||t.isEven()?n=new Eo(t):n=new So(t),this.exp(e,n)}oe.prototype.copyTo=O6;oe.prototype.fromInt=V6;oe.prototype.fromString=H6;oe.prototype.clamp=j6;oe.prototype.dlShiftTo=Z6;oe.prototype.drShiftTo=Y6;oe.prototype.lShiftTo=K6;oe.prototype.rShiftTo=J6;oe.prototype.subTo=q6;oe.prototype.multiplyTo=Q6;oe.prototype.squareTo=eA;oe.prototype.divRemTo=tA;oe.prototype.invDigit=lA;oe.prototype.isEven=gA;oe.prototype.exp=pA;oe.prototype.toString=W6;oe.prototype.negate=z6;oe.prototype.abs=G6;oe.prototype.compareTo=U6;oe.prototype.bitLength=X6;oe.prototype.mod=nA;oe.prototype.modPowInt=mA;oe.ZERO=oa(0);oe.ONE=oa(1);function bA(){var e=it();return this.copyTo(e),e}function vA(){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 yA(){return this.t==0?this.s:this.data[0]<<24>>24}function xA(){return this.t==0?this.s:this.data[0]<<16>>16}function CA(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function EA(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function SA(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=oa(n),i=it(),a=it(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(n+a.intValue()).toString(e).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(e)+o}function wA(e,t){this.fromInt(0),t==null&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,a=0,o=0,s=0;s<e.length;++s){var l=bC(e,s);if(l<0){e.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=t*o+l,++a>=n&&(this.dMultiply(r),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&oe.ZERO.subTo(this,this)}function IA(e,t,n){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(oe.ONE.shiftLeft(e-1),ip,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(oe.ONE.shiftLeft(e-1),this);else{var r=new Array,i=e&7;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function _A(){var e=this.t,t=new Array;t[0]=this.s;var n=this.DB-e*this.DB%8,r,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),r&128&&(r|=-256),i==0&&(this.s&128)!=(r&128)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function DA(e){return this.compareTo(e)==0}function AA(e){return this.compareTo(e)<0?this:e}function TA(e){return this.compareTo(e)>0?this:e}function RA(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n.data[r]=t(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;r<e.t;++r)n.data[r]=t(i,e.data[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}function BA(e,t){return e&t}function $A(e){var t=it();return this.bitwiseTo(e,BA,t),t}function ip(e,t){return e|t}function kA(e){var t=it();return this.bitwiseTo(e,ip,t),t}function vC(e,t){return e^t}function PA(e){var t=it();return this.bitwiseTo(e,vC,t),t}function yC(e,t){return e&~t}function FA(e){var t=it();return this.bitwiseTo(e,yC,t),t}function NA(){for(var e=it(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function MA(e){var t=it();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function LA(e){var t=it();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function OA(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function VA(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+OA(this.data[e]);return this.s<0?this.t*this.DB:-1}function HA(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function jA(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=HA(this.data[n]^t);return e}function WA(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function zA(e,t){var n=oe.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}function GA(e){return this.changeBit(e,ip)}function UA(e){return this.changeBit(e,yC)}function XA(e){return this.changeBit(e,vC)}function ZA(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]+e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[n++]=r:r<-1&&(t.data[n++]=this.DV+r),t.t=n,t.clamp()}function YA(e){var t=it();return this.addTo(e,t),t}function KA(e){var t=it();return this.subTo(e,t),t}function JA(e){var t=it();return this.multiplyTo(e,t),t}function qA(e){var t=it();return this.divRemTo(e,t,null),t}function QA(e){var t=it();return this.divRemTo(e,null,t),t}function eT(e){var t=it(),n=it();return this.divRemTo(e,t,n),new Array(t,n)}function tT(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function nT(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function fu(){}function xC(e){return e}function rT(e,t,n){e.multiplyTo(t,n)}function iT(e,t){e.squareTo(t)}fu.prototype.convert=xC;fu.prototype.revert=xC;fu.prototype.mulTo=rT;fu.prototype.sqrTo=iT;function aT(e){return this.exp(e,new fu)}function oT(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n.data[--r]=0;var i;for(i=n.t-this.t;r<i;++r)n.data[r+this.t]=this.am(0,e.data[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e.data[r],n,r,0,t-r);n.clamp()}function sT(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n.data[this.t+r-t]=this.am(t-r,e.data[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}function Ts(e){this.r2=it(),this.q3=it(),oe.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function lT(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=it();return e.copyTo(t),this.reduce(t),t}function uT(e){return e}function cT(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function dT(e,t){e.squareTo(t),this.reduce(t)}function fT(e,t,n){e.multiplyTo(t,n),this.reduce(n)}Ts.prototype.convert=lT;Ts.prototype.revert=uT;Ts.prototype.reduce=cT;Ts.prototype.mulTo=fT;Ts.prototype.sqrTo=dT;function hT(e,t){var n=e.bitLength(),r,i=oa(1),a;if(n<=0)return i;n<18?r=1:n<48?r=3:n<144?r=4:n<768?r=5:r=6,n<8?a=new Eo(t):t.isEven()?a=new Ts(t):a=new So(t);var o=new Array,s=3,l=r-1,u=(1<<r)-1;if(o[1]=a.convert(this),r>1){var c=it();for(a.sqrTo(o[1],c);s<=u;)o[s]=it(),a.mulTo(c,o[s-2],o[s]),s+=2}var d=e.t-1,h,f=!0,g=it(),p;for(n=sf(e.data[d])-1;d>=0;){for(n>=l?h=e.data[d]>>n-l&u:(h=(e.data[d]&(1<<n+1)-1)<<l-n,d>0&&(h|=e.data[d-1]>>this.DB+n-l)),s=r;!(h&1);)h>>=1,--s;if((n-=s)<0&&(n+=this.DB,--d),f)o[h].copyTo(i),f=!1;else{for(;s>1;)a.sqrTo(i,g),a.sqrTo(g,i),s-=2;s>0?a.sqrTo(i,g):(p=i,i=g,g=p),a.mulTo(g,o[h],i)}for(;d>=0&&!(e.data[d]&1<<n);)a.sqrTo(i,g),p=i,i=g,g=p,--n<0&&(n=this.DB-1,--d)}return a.revert(i)}function gT(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return a>0&&n.lShiftTo(a,n),n}function pT(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this.data[r])%e;return n}function mT(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return oe.ZERO;for(var n=e.clone(),r=this.clone(),i=oa(1),a=oa(0),o=oa(0),s=oa(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(o,i),a.subTo(s,a)):(r.subTo(n,r),t&&o.subTo(i,o),s.subTo(a,s))}if(r.compareTo(oe.ONE)!=0)return oe.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;return s.signum()<0?s.add(e):s}var Dr=[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],bT=(1<<26)/Dr[Dr.length-1];function vT(e){var t,n=this.abs();if(n.t==1&&n.data[0]<=Dr[Dr.length-1]){for(t=0;t<Dr.length;++t)if(n.data[0]==Dr[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<Dr.length;){for(var r=Dr[t],i=t+1;i<Dr.length&&r<bT;)r*=Dr[i++];for(r=n.modInt(r);t<i;)if(r%Dr[t++]==0)return!1}return n.millerRabin(e)}function yT(e){var t=this.subtract(oe.ONE),n=t.getLowestSetBit();if(n<=0)return!1;for(var r=t.shiftRight(n),i=xT(),a,o=0;o<e;++o){do a=new oe(this.bitLength(),i);while(a.compareTo(oe.ONE)<=0||a.compareTo(t)>=0);var s=a.modPow(r,this);if(s.compareTo(oe.ONE)!=0&&s.compareTo(t)!=0){for(var l=1;l++<n&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(oe.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}function xT(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}oe.prototype.chunkSize=CA;oe.prototype.toRadix=SA;oe.prototype.fromRadix=wA;oe.prototype.fromNumber=IA;oe.prototype.bitwiseTo=RA;oe.prototype.changeBit=zA;oe.prototype.addTo=ZA;oe.prototype.dMultiply=tT;oe.prototype.dAddOffset=nT;oe.prototype.multiplyLowerTo=oT;oe.prototype.multiplyUpperTo=sT;oe.prototype.modInt=pT;oe.prototype.millerRabin=yT;oe.prototype.clone=bA;oe.prototype.intValue=vA;oe.prototype.byteValue=yA;oe.prototype.shortValue=xA;oe.prototype.signum=EA;oe.prototype.toByteArray=_A;oe.prototype.equals=DA;oe.prototype.min=AA;oe.prototype.max=TA;oe.prototype.and=$A;oe.prototype.or=kA;oe.prototype.xor=PA;oe.prototype.andNot=FA;oe.prototype.not=NA;oe.prototype.shiftLeft=MA;oe.prototype.shiftRight=LA;oe.prototype.getLowestSetBit=VA;oe.prototype.bitCount=jA;oe.prototype.testBit=WA;oe.prototype.setBit=GA;oe.prototype.clearBit=UA;oe.prototype.flipBit=XA;oe.prototype.add=YA;oe.prototype.subtract=KA;oe.prototype.multiply=JA;oe.prototype.divide=qA;oe.prototype.remainder=QA;oe.prototype.divideAndRemainder=eT;oe.prototype.modPow=hT;oe.prototype.modInverse=mT;oe.prototype.pow=aT;oe.prototype.gcd=gT;oe.prototype.isProbablePrime=vT;var ti=ze,CC=ti.sha1=ti.sha1||{};ti.md.sha1=ti.md.algorithms.sha1=CC;CC.create=function(){EC||CT();var e=null,t=ti.util.createBuffer(),n=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ti.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ti.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),w1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ti.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(A0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};w1(d,n,i);var h=ti.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h},r};var A0=null,EC=!1;function CT(){A0="€",A0+=ti.util.fillString("\0",64),EC=!0}function w1(e,t,n){for(var r,i,a,o,s,l,u,c,d=n.length();d>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,l=e.h4,c=0;c<16;++c)r=n.getInt32(),t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<20;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<32;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<40;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<60;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a&o|s&(a^o),r=(i<<5|i>>>27)+u+l+2400959708+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<80;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+3395469782+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+l|0,d-=64}}var ri=ze,SC=ri.pkcs1=ri.pkcs1||{};SC.encode_rsa_oaep=function(e,t,n){var r,i,a,o;typeof n=="string"?(r=n,i=arguments[3]||void 0,a=arguments[4]||void 0):n&&(r=n.label||void 0,i=n.seed||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md)),a?a.start():a=ri.md.sha1.create(),o||(o=a);var s=Math.ceil(e.n.bitLength()/8),l=s-2*a.digestLength-2;if(t.length>l){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=t.length,u.maxLength=l,u}r||(r=""),a.update(r,"raw");for(var c=a.digest(),d="",h=l-t.length,f=0;f<h;f++)d+="\0";var g=c.getBytes()+d+""+t;if(!i)i=ri.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var u=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw u.seedLength=i.length,u.digestLength=a.digestLength,u}var p=Qc(i,s-a.digestLength-1,o),m=ri.util.xorBytes(g,p,g.length),b=Qc(m,a.digestLength,o),v=ri.util.xorBytes(i,b,i.length);return"\0"+v+m};SC.decode_rsa_oaep=function(e,t,n){var r,i,a;typeof n=="string"?(r=n,i=arguments[3]||void 0):n&&(r=n.label||void 0,i=n.md||void 0,n.mgf1&&n.mgf1.md&&(a=n.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var m=new Error("RSAES-OAEP encoded message length is invalid.");throw m.length=t.length,m.expectedLength=o,m}if(i===void 0?i=ri.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),i.update(r,"raw");for(var s=i.digest().getBytes(),l=t.charAt(0),u=t.substring(1,i.digestLength+1),c=t.substring(1+i.digestLength),d=Qc(c,i.digestLength,a),h=ri.util.xorBytes(u,d,u.length),f=Qc(h,o-i.digestLength-1,a),g=ri.util.xorBytes(c,f,c.length),p=g.substring(0,i.digestLength),m=l!=="\0",b=0;b<i.digestLength;++b)m|=s.charAt(b)!==p.charAt(b);for(var v=1,x=i.digestLength,C=i.digestLength;C<g.length;C++){var E=g.charCodeAt(C),w=E&1^1,B=v?65534:0;m|=E&B,v=v&w,x+=v}if(m||g.charCodeAt(x)!==1)throw new Error("Invalid RSAES-OAEP padding.");return g.substring(x+1)};function Qc(e,t,n){n||(n=ri.md.sha1.create());for(var r="",i=Math.ceil(t/n.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);n.start(),n.update(e+o),r+=n.digest().getBytes()}return r.substring(0,t)}var Zi=ze;(function(){if(Zi.prime){Zi.prime;return}var e=Zi.prime=Zi.prime||{},t=Zi.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var i=function(d,h){return d|h};e.generateProbablePrime=function(d,h,f){typeof h=="function"&&(f=h,h={}),h=h||{};var g=h.algorithm||"PRIMEINC";typeof g=="string"&&(g={name:g}),g.options=g.options||{};var p=h.prng||Zi.random,m={nextBytes:function(b){for(var v=p.getBytesSync(b.length),x=0;x<b.length;++x)b[x]=v.charCodeAt(x)}};if(g.name==="PRIMEINC")return a(d,m,g.options,f);throw new Error("Invalid prime generation algorithm: "+g.name)};function a(d,h,f,g){return"workers"in f?l(d,h,f,g):o(d,h,f,g)}function o(d,h,f,g){var p=u(d,h),m=0,b=c(p.bitLength());"millerRabinTests"in f&&(b=f.millerRabinTests);var v=10;"maxBlockTime"in f&&(v=f.maxBlockTime),s(p,d,h,m,b,v,g)}function s(d,h,f,g,p,m,b){var v=+new Date;do{if(d.bitLength()>h&&(d=u(h,f)),d.isProbablePrime(p))return b(null,d);d.dAddOffset(n[g++%8],0)}while(m<0||+new Date-v<m);Zi.util.setImmediate(function(){s(d,h,f,g,p,m,b)})}function l(d,h,f,g){if(typeof Worker>"u")return o(d,h,f,g);var p=u(d,h),m=f.workers,b=f.workLoad||100,v=b*30/8,x=f.workerScript||"forge/prime.worker.js";if(m===-1)return Zi.util.estimateCores(function(E,w){E&&(w=2),m=w-1,C()});C();function C(){m=Math.max(1,m);for(var E=[],w=0;w<m;++w)E[w]=new Worker(x);for(var w=0;w<m;++w)E[w].addEventListener("message",y);var B=!1;function y(S){if(!B){var D=S.data;if(D.found){for(var A=0;A<E.length;++A)E[A].terminate();return B=!0,g(null,new t(D.prime,16))}p.bitLength()>d&&(p=u(d,h));var T=p.toString(16);S.target.postMessage({hex:T,workLoad:b}),p.dAddOffset(v,0)}}}}function u(d,h){var f=new t(d,h),g=d-1;return f.testBit(g)||f.bitwiseTo(t.ONE.shiftLeft(g),i,f),f.dAddOffset(31-f.mod(r).byteValue(),0),f}function c(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}})();var De=ze;if(typeof rt>"u")var rt=De.jsbn.BigInteger;var T0=De.util.isNodejs?np:null,J=De.asn1,br=De.util;De.pki=De.pki||{};De.pki.rsa=De.rsa=De.rsa||{};var Ve=De.pki,ET=[6,4,2,4,2,4,6,2],ST={name:"PrivateKeyInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},wT={name:"RSAPrivateKey",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},IT={name:"RSAPublicKey",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},_T=De.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:J.Class.UNIVERSAL,type:J.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},DT={name:"DigestInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:J.Class.UNIVERSAL,type:J.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:J.Class.UNIVERSAL,type:J.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:J.Class.UNIVERSAL,type:J.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},AT=function(e){var t;if(e.algorithm in Ve.oids)t=Ve.oids[e.algorithm];else{var n=new Error("Unknown message digest algorithm.");throw n.algorithm=e.algorithm,n}var r=J.oidToDer(t).getBytes(),i=J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[]),a=J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[]);a.value.push(J.create(J.Class.UNIVERSAL,J.Type.OID,!1,r)),a.value.push(J.create(J.Class.UNIVERSAL,J.Type.NULL,!1,""));var o=J.create(J.Class.UNIVERSAL,J.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),J.toDer(i).getBytes()},wC=function(e,t,n){if(n)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(rt.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(rt.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new rt(De.util.bytesToHex(De.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(rt.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o=o.multiply(r.modInverse(t.n)).mod(t.n),o};Ve.rsa.encrypt=function(e,t,n){var r=n,i,a=Math.ceil(t.n.bitLength()/8);n!==!1&&n!==!0?(r=n===2,i=IC(e,t,n)):(i=De.util.createBuffer(),i.putBytes(e));for(var o=new rt(i.toHex(),16),s=wC(o,t,r),l=s.toString(16),u=De.util.createBuffer(),c=a-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),u.getBytes()};Ve.rsa.decrypt=function(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new rt(De.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=wC(o,t,n),l=s.toString(16),u=De.util.createBuffer(),c=i-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),r!==!1?ed(u.getBytes(),t,n):u.getBytes()};Ve.rsa.createKeyPairGenerationState=function(e,t,n){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,n=n||{};var r=n.prng||De.random,i={nextBytes:function(s){for(var l=r.getBytesSync(s.length),u=0;u<s.length;++u)s[u]=l.charCodeAt(u)}},a=n.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:e,rng:i,eInt:t||65537,e:new rt(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};Ve.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var n=new rt(null);n.fromInt(30);for(var r=0,i=function(d,h){return d|h},a=+new Date,o,s=0;e.keys===null&&(t<=0||s<t);){if(e.state===0){var l=e.p===null?e.pBits:e.qBits,u=l-1;e.pqState===0?(e.num=new rt(l,e.rng),e.num.testBit(u)||e.num.bitwiseTo(rt.ONE.shiftLeft(u),i,e.num),e.num.dAddOffset(31-e.num.mod(n).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(RT(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(ET[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(rt.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)}}o=+new Date,s+=o-a,a=o}return e.keys!==null};Ve.rsa.generateKeyPair=function(e,t,n,r){if(arguments.length===1?typeof e=="object"?(n=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(n=t,t=void 0):(n=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof n=="function"&&(r=n,n=void 0):(r=n,n=t,t=void 0)),n=n||{},e===void 0&&(e=n.bits||2048),t===void 0&&(t=n.e||65537),!De.options.usePureJavaScript&&!n.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(I1("generateKeyPair"))return T0.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,l,u){if(s)return r(s);r(null,{privateKey:Ve.privateKeyFromPem(u),publicKey:Ve.publicKeyFromPem(l)})});if(_1("generateKey")&&_1("exportKey"))return br.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return br.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){r(s)}).then(function(s){if(s){var l=Ve.privateKeyFromAsn1(J.fromDer(De.util.createBuffer(s)));r(null,{privateKey:l,publicKey:Ve.setRsaPublicKey(l.n,l.e)})}});if(D1("generateKey")&&D1("exportKey")){var i=br.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var l=s.target.result,u=br.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);u.oncomplete=function(c){var d=c.target.result,h=Ve.privateKeyFromAsn1(J.fromDer(De.util.createBuffer(d)));r(null,{privateKey:h,publicKey:Ve.setRsaPublicKey(h.n,h.e)})},u.onerror=function(c){r(c)}},i.onerror=function(s){r(s)};return}}else if(I1("generateKeyPairSync")){var a=T0.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Ve.privateKeyFromPem(a.privateKey),publicKey:Ve.publicKeyFromPem(a.publicKey)}}}var o=Ve.rsa.createKeyPairGenerationState(e,t,n);if(!r)return Ve.rsa.stepKeyPairGenerationState(o,0),o.keys;TT(o,n,r)};Ve.setRsaPublicKey=Ve.rsa.setPublicKey=function(e,t){var n={n:e,e:t};return n.encrypt=function(r,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,l,u){return IC(s,l,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,l){return De.pkcs1.encode_rsa_oaep(l,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(r,n,!0);return Ve.rsa.encrypt(o,n,!0)},n.verify=function(r,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(l,u){u=ed(u,n,!0);var c=J.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),d={},h=[];if(!J.validate(c,DT,d,h)){var f=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw f.errors=h,f}var g=J.derToOid(d.algorithmIdentifier);if(!(g===De.oids.md2||g===De.oids.md5||g===De.oids.sha1||g===De.oids.sha224||g===De.oids.sha256||g===De.oids.sha384||g===De.oids.sha512||g===De.oids["sha512-224"]||g===De.oids["sha512-256"])){var f=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw f.oid=g,f}if((g===De.oids.md2||g===De.oids.md5)&&!("parameters"in d))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===d.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(l,u){return u=ed(u,n,!0),l===u}});var s=Ve.rsa.decrypt(i,n,!0,!1);return a.verify(r,s,n.n.bitLength())},n};Ve.setRsaPrivateKey=Ve.rsa.setPrivateKey=function(e,t,n,r,i,a,o,s){var l={n:e,e:t,d:n,p:r,q:i,dP:a,dQ:o,qInv:s};return l.decrypt=function(u,c,d){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var h=Ve.rsa.decrypt(u,l,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:ed};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(f,g){return De.pkcs1.decode_rsa_oaep(g,f,d)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(f){return f}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(h,l,!1)},l.sign=function(u,c){var d=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:AT},d=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return u}},d=1);var h=c.encode(u,l.n.bitLength());return Ve.rsa.encrypt(h,l,d)},l};Ve.wrapRsaPrivateKey=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,J.integerToDer(0).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.OID,!1,J.oidToDer(Ve.oids.rsaEncryption).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.NULL,!1,"")]),J.create(J.Class.UNIVERSAL,J.Type.OCTETSTRING,!1,J.toDer(e).getBytes())])};Ve.privateKeyFromAsn1=function(e){var t={},n=[];if(J.validate(e,ST,t,n)&&(e=J.fromDer(De.util.createBuffer(t.privateKey))),t={},n=[],!J.validate(e,wT,t,n)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=n,r}var i,a,o,s,l,u,c,d;return i=De.util.createBuffer(t.privateKeyModulus).toHex(),a=De.util.createBuffer(t.privateKeyPublicExponent).toHex(),o=De.util.createBuffer(t.privateKeyPrivateExponent).toHex(),s=De.util.createBuffer(t.privateKeyPrime1).toHex(),l=De.util.createBuffer(t.privateKeyPrime2).toHex(),u=De.util.createBuffer(t.privateKeyExponent1).toHex(),c=De.util.createBuffer(t.privateKeyExponent2).toHex(),d=De.util.createBuffer(t.privateKeyCoefficient).toHex(),Ve.setRsaPrivateKey(new rt(i,16),new rt(a,16),new rt(o,16),new rt(s,16),new rt(l,16),new rt(u,16),new rt(c,16),new rt(d,16))};Ve.privateKeyToAsn1=Ve.privateKeyToRSAPrivateKey=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,J.integerToDer(0).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.n)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.e)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.d)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.p)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.q)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.dP)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.dQ)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.qInv))])};Ve.publicKeyFromAsn1=function(e){var t={},n=[];if(J.validate(e,_T,t,n)){var r=J.derToOid(t.publicKeyOid);if(r!==Ve.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=r,i}e=t.rsaPublicKey}if(n=[],!J.validate(e,IT,t,n)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=n,i}var a=De.util.createBuffer(t.publicKeyModulus).toHex(),o=De.util.createBuffer(t.publicKeyExponent).toHex();return Ve.setRsaPublicKey(new rt(a,16),new rt(o,16))};Ve.publicKeyToAsn1=Ve.publicKeyToSubjectPublicKeyInfo=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.OID,!1,J.oidToDer(Ve.oids.rsaEncryption).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.NULL,!1,"")]),J.create(J.Class.UNIVERSAL,J.Type.BITSTRING,!1,[Ve.publicKeyToRSAPublicKey(e)])])};Ve.publicKeyToRSAPublicKey=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.n)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.e))])};function IC(e,t,n){var r=De.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}r.putByte(0),r.putByte(n);var o=i-3-e.length,s;if(n===0||n===1){s=n===0?0:255;for(var l=0;l<o;++l)r.putByte(s)}else for(;o>0;){for(var u=0,c=De.random.getBytes(o),l=0;l<o;++l)s=c.charCodeAt(l),s===0?++u:r.putByte(s);o=u}return r.putByte(0),r.putBytes(e),r}function ed(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8),a=De.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(o!==0||n&&s!==0&&s!==1||!n&&s!=2||n&&s===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(s===0){l=i-3-r;for(var u=0;u<l;++u)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(l=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++l}else if(s===2)for(l=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++l}var c=a.getByte();if(c!==0||l!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function TT(e,t,n){typeof t=="function"&&(n=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),i();function i(){a(e.pBits,function(s,l){if(s)return n(s);if(e.p=l,e.q!==null)return o(s,e.q);a(e.qBits,o)})}function a(s,l){De.prime.generateProbablePrime(s,r,l)}function o(s,l){if(s)return n(s);if(e.q=l,e.p.compareTo(e.q)<0){var u=e.p;e.p=e.q,e.q=u}if(e.p.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.p=null,i();return}if(e.q.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.q=null,a(e.qBits,o);return}if(e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(rt.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,a(e.qBits,o);return}var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)},n(null,e.keys)}}function jr(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=De.util.hexToBytes(t);return n.length>1&&(n.charCodeAt(0)===0&&!(n.charCodeAt(1)&128)||n.charCodeAt(0)===255&&(n.charCodeAt(1)&128)===128)?n.substr(1):n}function RT(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function I1(e){return De.util.isNodejs&&typeof T0[e]=="function"}function _1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.crypto=="object"&&typeof br.globalScope.crypto.subtle=="object"&&typeof br.globalScope.crypto.subtle[e]=="function"}function D1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.msCrypto=="object"&&typeof br.globalScope.msCrypto.subtle=="object"&&typeof br.globalScope.msCrypto.subtle[e]=="function"}function A1(e){for(var t=De.util.hexToBytes(e.toString(16)),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}var me=ze;if(typeof BT>"u")var BT=me.jsbn.BigInteger;var ne=me.asn1,je=me.pki=me.pki||{};je.pbe=me.pbe=me.pbe||{};var ka=je.oids,$T={name:"EncryptedPrivateKeyInfo",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},kT={name:"PBES2Algorithms",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},PT={name:"pkcs-12PbeParams",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"iterations"}]};je.encryptPrivateKeyInfo=function(e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||"aes128",n.prfAlgorithm=n.prfAlgorithm||"sha1";var r=me.random.getBytesSync(n.saltSize),i=n.count,a=ne.integerToDer(i),o,s,l;if(n.algorithm.indexOf("aes")===0||n.algorithm==="des"){var u,c,d;switch(n.algorithm){case"aes128":o=16,u=16,c=ka["aes128-CBC"],d=me.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,c=ka["aes192-CBC"],d=me.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,c=ka["aes256-CBC"],d=me.aes.createEncryptionCipher;break;case"des":o=8,u=8,c=ka.desCBC,d=me.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var f="hmacWith"+n.prfAlgorithm.toUpperCase(),g=DC(f),p=me.pkcs5.pbkdf2(t,r,i,o,g),m=me.random.getBytesSync(u),b=d(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes();var v=FT(r,a,o,f);s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBES2).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBKDF2).getBytes()),v]),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(c).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,m)])])])}else if(n.algorithm==="3des"){o=24;var x=new me.util.ByteBuffer(r),p=je.pbe.generatePkcs12Key(t,x,1,i,o),m=je.pbe.generatePkcs12Key(t,x,2,i,o),b=me.des.createEncryptionCipher(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes(),s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,r),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,a.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var C=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[s,ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,l)]);return C};je.decryptPrivateKeyInfo=function(e,t){var n=null,r={},i=[];if(!ne.validate(e,$T,r,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=ne.derToOid(r.encryptionOid),s=je.pbe.getCipher(o,r.encryptionParams,t),l=me.util.createBuffer(r.encryptedData);return s.update(l),s.finish()&&(n=ne.fromDer(s.output)),n};je.encryptedPrivateKeyToPem=function(e,t){var n={type:"ENCRYPTED PRIVATE KEY",body:ne.toDer(e).getBytes()};return me.pem.encode(n,{maxline:t})};je.encryptedPrivateKeyFromPem=function(e){var t=me.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var n=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ne.fromDer(t.body)};je.encryptRsaPrivateKey=function(e,t,n){if(n=n||{},!n.legacy){var r=je.wrapRsaPrivateKey(je.privateKeyToAsn1(e));return r=je.encryptPrivateKeyInfo(r,t,n),je.encryptedPrivateKeyToPem(r)}var i,a,o,s;switch(n.algorithm){case"aes128":i="AES-128-CBC",o=16,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+n.algorithm+'".');throw l.algorithm=n.algorithm,l}var u=me.pbe.opensslDeriveBytes(t,a.substr(0,8),o),c=s(u);c.start(a),c.update(ne.toDer(je.privateKeyToAsn1(e))),c.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:me.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return me.pem.encode(d)};je.decryptRsaPrivateKey=function(e,t){var n=null,r=me.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(r.procType&&r.procType.type==="ENCRYPTED"){var a,o;switch(r.dekInfo.algorithm){case"DES-CBC":a=8,o=me.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=me.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=me.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=me.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=me.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(d){return me.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":a=8,o=function(d){return me.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":a=16,o=function(d){return me.rc2.createDecryptionCipher(d,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw i.algorithm=r.dekInfo.algorithm,i}var s=me.util.hexToBytes(r.dekInfo.parameters),l=me.pbe.opensslDeriveBytes(t,s.substr(0,8),a),u=o(l);if(u.start(s),u.update(me.util.createBuffer(r.body)),u.finish())n=u.output.getBytes();else return n}else n=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?n=je.decryptPrivateKeyInfo(ne.fromDer(n),t):n=ne.fromDer(n),n!==null&&(n=je.privateKeyFromAsn1(n)),n};je.pbe.generatePkcs12Key=function(e,t,n,r,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in me.md))throw new Error('"sha1" hash algorithm unavailable.');a=me.md.sha1.create()}var l=a.digestLength,u=a.blockLength,c=new me.util.ByteBuffer,d=new me.util.ByteBuffer;if(e!=null){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var h=d.length(),f=t.length(),g=new me.util.ByteBuffer;g.fillWithByte(n,u);var p=u*Math.ceil(f/u),m=new me.util.ByteBuffer;for(s=0;s<p;s++)m.putByte(t.at(s%f));var b=u*Math.ceil(h/u),v=new me.util.ByteBuffer;for(s=0;s<b;s++)v.putByte(d.at(s%h));var x=m;x.putBuffer(v);for(var C=Math.ceil(i/l),E=1;E<=C;E++){var w=new me.util.ByteBuffer;w.putBytes(g.bytes()),w.putBytes(x.bytes());for(var B=0;B<r;B++)a.start(),a.update(w.getBytes()),w=a.digest();var y=new me.util.ByteBuffer;for(s=0;s<u;s++)y.putByte(w.at(s%l));var S=Math.ceil(f/u)+Math.ceil(h/u),D=new me.util.ByteBuffer;for(o=0;o<S;o++){var A=new me.util.ByteBuffer(x.getBytes(u)),T=511;for(s=y.length()-1;s>=0;s--)T=T>>8,T+=y.at(s)+A.at(s),A.setAt(s,T&255);D.putBuffer(A)}x=D,c.putBuffer(w)}return c.truncate(c.length()-i),c};je.pbe.getCipher=function(e,t,n){switch(e){case je.oids.pkcs5PBES2:return je.pbe.getCipherForPBES2(e,t,n);case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case je.oids["pbewithSHAAnd40BitRC2-CBC"]:return je.pbe.getCipherForPKCS12PBE(e,t,n);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};je.pbe.getCipherForPBES2=function(e,t,n){var r={},i=[];if(!ne.validate(t,kT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(e=ne.derToOid(r.kdfOid),e!==je.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=e,a.supportedOids=["pkcs5PBKDF2"],a}if(e=ne.derToOid(r.encOid),e!==je.oids["aes128-CBC"]&&e!==je.oids["aes192-CBC"]&&e!==je.oids["aes256-CBC"]&&e!==je.oids["des-EDE3-CBC"]&&e!==je.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=r.kdfSalt,s=me.util.createBuffer(r.kdfIterationCount);s=s.getInt(s.length()<<3);var l,u;switch(je.oids[e]){case"aes128-CBC":l=16,u=me.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,u=me.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,u=me.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,u=me.des.createDecryptionCipher;break;case"desCBC":l=8,u=me.des.createDecryptionCipher;break}var c=_C(r.prfOid),d=me.pkcs5.pbkdf2(n,o,s,l,c),h=r.encIv,f=u(d);return f.start(h),f};je.pbe.getCipherForPKCS12PBE=function(e,t,n){var r={},i=[];if(!ne.validate(t,PT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=me.util.createBuffer(r.salt),s=me.util.createBuffer(r.iterations);s=s.getInt(s.length()<<3);var l,u,c;switch(e){case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,u=8,c=me.des.startDecrypting;break;case je.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,u=8,c=function(p,m){var b=me.rc2.createDecryptionCipher(p,40);return b.start(m,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=e,a}var d=_C(r.prfOid),h=je.pbe.generatePkcs12Key(n,o,1,s,l,d);d.start();var f=je.pbe.generatePkcs12Key(n,o,2,s,u,d);return c(h,f)};je.pbe.opensslDeriveBytes=function(e,t,n,r){if(typeof r>"u"||r===null){if(!("md5"in me.md))throw new Error('"md5" hash algorithm unavailable.');r=me.md.md5.create()}t===null&&(t="");for(var i=[T1(r,e+t)],a=16,o=1;a<n;++o,a+=16)i.push(T1(r,i[o-1]+e+t));return i.join("").substr(0,n)};function T1(e,t){return e.start().update(t).digest().getBytes()}function _C(e){var t;if(!e)t="hmacWithSHA1";else if(t=je.oids[ne.derToOid(e)],!t){var n=new Error("Unsupported PRF OID.");throw n.oid=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}return DC(t)}function DC(e){var t=me.md;switch(e){case"hmacWithSHA224":t=me.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var n=new Error("Unsupported PRF algorithm.");throw n.algorithm=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function FT(e,t,n,r){var i=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,e),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&i.value.push(ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,me.util.hexToBytes(n.toString(16))),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(je.oids[r]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.NULL,!1,"")])),i}var ds=ze,pe=ds.asn1,Rs=ds.pkcs7asn1=ds.pkcs7asn1||{};ds.pkcs7=ds.pkcs7||{};ds.pkcs7.asn1=Rs;var AC={name:"ContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Rs.contentInfoValidator=AC;var TC={name:"EncryptedContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Rs.envelopedDataValidator={name:"EnvelopedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(TC)};Rs.encryptedDataValidator={name:"EncryptedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"}].concat(TC)};var NT={name:"SignerInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Rs.signedDataValidator={name:"SignedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},AC,{name:"SignedData.Certificates",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,capture:"signerInfos",optional:!0,value:[NT]}]};Rs.recipientInfoValidator={name:"RecipientInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var ao=ze;ao.mgf=ao.mgf||{};var MT=ao.mgf.mgf1=ao.mgf1=ao.mgf1||{};MT.create=function(e){var t={generate:function(n,r){for(var i=new ao.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new ao.util.ByteBuffer;s.putInt32(o),e.start(),e.update(n+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}};return t};var td=ze;td.mgf=td.mgf||{};td.mgf.mgf1=td.mgf1;var Ga=ze,LT=Ga.pss=Ga.pss||{};LT.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,n=e.mgf,r=t.digestLength,i=e.salt||null;typeof i=="string"&&(i=Ga.util.createBuffer(i));var a;if("saltLength"in e)a=e.saltLength;else if(i!==null)a=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==a)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||Ga.random,s={};return s.encode=function(l,u){var c,d=u-1,h=Math.ceil(d/8),f=l.digest().getBytes();if(h<r+a+2)throw new Error("Message is too long to encrypt.");var g;i===null?g=o.getBytesSync(a):g=i.bytes();var p=new Ga.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(g),t.start(),t.update(p.getBytes());var m=t.digest().getBytes(),b=new Ga.util.ByteBuffer;b.fillWithByte(0,h-a-r-2),b.putByte(1),b.putBytes(g);var v=b.getBytes(),x=h-r-1,C=n.generate(m,x),E="";for(c=0;c<x;c++)E+=String.fromCharCode(v.charCodeAt(c)^C.charCodeAt(c));var w=65280>>8*h-d&255;return E=String.fromCharCode(E.charCodeAt(0)&~w)+E.substr(1),E+m+"¼"},s.verify=function(l,u,c){var d,h=c-1,f=Math.ceil(h/8);if(u=u.substr(-f),f<r+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(u.charCodeAt(f-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var g=f-r-1,p=u.substr(0,g),m=u.substr(g,r),b=65280>>8*f-h&255;if(p.charCodeAt(0)&b)throw new Error("Bits beyond keysize not zero as expected.");var v=n.generate(m,g),x="";for(d=0;d<g;d++)x+=String.fromCharCode(p.charCodeAt(d)^v.charCodeAt(d));x=String.fromCharCode(x.charCodeAt(0)&~b)+x.substr(1);var C=f-r-a-2;for(d=0;d<C;d++)if(x.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(x.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var E=x.substr(-a),w=new Ga.util.ByteBuffer;w.fillWithByte(0,8),w.putBytes(l),w.putBytes(E),t.start(),t.update(w.getBytes());var B=t.digest().getBytes();return m===B},s};var Ae=ze,N=Ae.asn1,de=Ae.pki=Ae.pki||{},nt=de.oids,Nt={};Nt.CN=nt.commonName;Nt.commonName="CN";Nt.C=nt.countryName;Nt.countryName="C";Nt.L=nt.localityName;Nt.localityName="L";Nt.ST=nt.stateOrProvinceName;Nt.stateOrProvinceName="ST";Nt.O=nt.organizationName;Nt.organizationName="O";Nt.OU=nt.organizationalUnitName;Nt.organizationalUnitName="OU";Nt.E=nt.emailAddress;Nt.emailAddress="E";var RC=Ae.pki.rsa.publicKeyValidator,OT={name:"Certificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},RC,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},VT={name:"rsapss",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},HT={name:"CertificationRequestInfo",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},RC,{name:"CertificationRequestInfo.attributes",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:N.Class.UNIVERSAL,type:N.Type.SET,constructed:!0}]}]}]},jT={name:"CertificationRequest",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[HT,{name:"CertificationRequest.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};de.RDNAttributesAsArray=function(e,t){for(var n=[],r,i,a,o=0;o<e.value.length;++o){r=e.value[o];for(var s=0;s<r.value.length;++s)a={},i=r.value[s],a.type=N.derToOid(i.value[0].value),a.value=i.value[1].value,a.valueTagClass=i.value[1].type,a.type in nt&&(a.name=nt[a.type],a.name in Nt&&(a.shortName=Nt[a.name])),t&&(t.update(a.type),t.update(a.value)),n.push(a)}return n};de.CRIAttributesAsArray=function(e){for(var t=[],n=0;n<e.length;++n)for(var r=e[n],i=N.derToOid(r.value[0].value),a=r.value[1].value,o=0;o<a.length;++o){var s={};if(s.type=i,s.value=a[o].value,s.valueTagClass=a[o].type,s.type in nt&&(s.name=nt[s.type],s.name in Nt&&(s.shortName=Nt[s.name])),s.type===nt.extensionRequest){s.extensions=[];for(var l=0;l<s.value.length;++l)s.extensions.push(de.certificateExtensionFromAsn1(s.value[l]))}t.push(s)}return t};function xa(e,t){typeof t=="string"&&(t={shortName:t});for(var n=null,r,i=0;n===null&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}var nd=function(e,t,n){var r={};if(e!==nt["RSASSA-PSS"])return r;n&&(r={hash:{algorithmOid:nt.sha1},mgf:{algorithmOid:nt.mgf1,hash:{algorithmOid:nt.sha1}},saltLength:20});var i={},a=[];if(!N.validate(t,VT,i,a)){var o=new Error("Cannot read RSASSA-PSS parameter block.");throw o.errors=a,o}return i.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=N.derToOid(i.hashOid)),i.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=N.derToOid(i.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=N.derToOid(i.maskGenHashOid)),i.saltLength!==void 0&&(r.saltLength=i.saltLength.charCodeAt(0)),r},lf=function(e){switch(nt[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return Ae.md.sha1.create();case"md5WithRSAEncryption":return Ae.md.md5.create();case"sha256WithRSAEncryption":return Ae.md.sha256.create();case"sha384WithRSAEncryption":return Ae.md.sha384.create();case"sha512WithRSAEncryption":return Ae.md.sha512.create();case"RSASSA-PSS":return Ae.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},BC=function(e){var t=e.certificate,n;switch(t.signatureOid){case nt.sha1WithRSAEncryption:case nt.sha1WithRSASignature:break;case nt["RSASSA-PSS"]:var r,i;if(r=nt[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported MGF hash function.");throw a.oid=t.signatureParameters.mgf.hash.algorithmOid,a.name=r,a}if(i=nt[t.signatureParameters.mgf.algorithmOid],i===void 0||Ae.mgf[i]===void 0){var a=new Error("Unsupported MGF function.");throw a.oid=t.signatureParameters.mgf.algorithmOid,a.name=i,a}if(i=Ae.mgf[i].create(Ae.md[r].create()),r=nt[t.signatureParameters.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported RSASSA-PSS hash function.");throw a.oid=t.signatureParameters.hash.algorithmOid,a.name=r,a}n=Ae.pss.create(Ae.md[r].create(),i,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,n)};de.certificateFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificateFromAsn1(a,t)};de.certificateToPem=function(e,t){var n={type:"CERTIFICATE",body:N.toDer(de.certificateToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyFromPem=function(e){var t=Ae.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var n=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=N.fromDer(t.body);return de.publicKeyFromAsn1(r)};de.publicKeyToPem=function(e,t){var n={type:"PUBLIC KEY",body:N.toDer(de.publicKeyToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyToRSAPublicKeyPem=function(e,t){var n={type:"RSA PUBLIC KEY",body:N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||Ae.md.sha1.create(),r=t.type||"RSAPublicKey",i;switch(r){case"RSAPublicKey":i=N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=N.toDer(de.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}n.start(),n.update(i);var a=n.digest();if(t.encoding==="hex"){var o=a.toHex();return t.delimiter?o.match(/.{2}/g).join(t.delimiter):o}else{if(t.encoding==="binary")return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return a};de.certificationRequestFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificationRequestFromAsn1(a,t)};de.certificationRequestToPem=function(e,t){var n={type:"CERTIFICATE REQUEST",body:N.toDer(de.certificationRequestToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.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(t){return xa(e.issuer,t)},e.issuer.addField=function(t){vr([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,n){vr(t),e.subject.attributes=t,delete e.subject.uniqueId,n&&(e.subject.uniqueId=n),e.subject.hash=null},e.setIssuer=function(t,n){vr(t),e.issuer.attributes=t,delete e.issuer.uniqueId,n&&(e.issuer.uniqueId=n),e.issuer.hash=null},e.setExtensions=function(t){for(var n=0;n<t.length;++n)$C(t[n],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var n=null,r,i=0;n===null&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=de.getTBSCertificate(e);var a=N.toDer(e.tbsCertificate);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var n=!1;if(!e.issued(t)){var r=t.issuer,i=e.subject,a=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 a.expectedIssuer=i.attributes,a.actualIssuer=r.attributes,a}var o=t.md;if(o===null){o=lf({signatureOid:t.signatureOid,type:"certificate"});var s=t.tbsCertificate||de.getTBSCertificate(t),l=N.toDer(s);o.update(l.getBytes())}return o!==null&&(n=BC({certificate:e,md:o,signature:t.signature})),n},e.isIssuer=function(t){var n=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)n=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){n=!0;for(var a,o,s=0;n&&s<r.attributes.length;++s)a=r.attributes[s],o=i.attributes[s],(a.type!==o.type||a.value!==o.value)&&(n=!1)}return n},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return de.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=nt.subjectKeyIdentifier,n=0;n<e.extensions.length;++n){var r=e.extensions[n];if(r.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return Ae.util.hexToBytes(r.subjectKeyIdentifier)===i}}return!1},e};de.certificateFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,OT,n,r)){var i=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificate();o.version=n.certVersion?n.certVersion.charCodeAt(0):0;var s=Ae.util.createBuffer(n.certSerialNumber);o.serialNumber=s.toHex(),o.signatureOid=Ae.asn1.derToOid(n.certSignatureOid),o.signatureParameters=nd(o.signatureOid,n.certSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.certinfoSignatureOid),o.siginfo.parameters=nd(o.siginfo.algorithmOid,n.certinfoSignatureParams,!1),o.signature=n.certSignature;var l=[];if(n.certValidity1UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity1UTCTime)),n.certValidity2GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity2GeneralizedTime)),n.certValidity3UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity3UTCTime)),n.certValidity4GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(o.validity.notBefore=l[0],o.validity.notAfter=l[1],o.tbsCertificate=n.tbsCertificate,t){o.md=lf({signatureOid:o.signatureOid,type:"certificate"});var u=N.toDer(o.tbsCertificate);o.md.update(u.getBytes())}var c=Ae.md.sha1.create(),d=N.toDer(n.certIssuer);c.update(d.getBytes()),o.issuer.getField=function(g){return xa(o.issuer,g)},o.issuer.addField=function(g){vr([g]),o.issuer.attributes.push(g)},o.issuer.attributes=de.RDNAttributesAsArray(n.certIssuer),n.certIssuerUniqueId&&(o.issuer.uniqueId=n.certIssuerUniqueId),o.issuer.hash=c.digest().toHex();var h=Ae.md.sha1.create(),f=N.toDer(n.certSubject);return h.update(f.getBytes()),o.subject.getField=function(g){return xa(o.subject,g)},o.subject.addField=function(g){vr([g]),o.subject.attributes.push(g)},o.subject.attributes=de.RDNAttributesAsArray(n.certSubject),n.certSubjectUniqueId&&(o.subject.uniqueId=n.certSubjectUniqueId),o.subject.hash=h.digest().toHex(),n.certExtensions?o.extensions=de.certificateExtensionsFromAsn1(n.certExtensions):o.extensions=[],o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o};de.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var r=e.value[n],i=0;i<r.value.length;++i)t.push(de.certificateExtensionFromAsn1(r.value[i]));return t};de.certificateExtensionFromAsn1=function(e){var t={};if(t.id=N.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===N.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in nt){if(t.name=nt[t.id],t.name==="keyUsage"){var n=N.fromDer(t.value),r=0,i=0;n.value.length>1&&(r=n.value.charCodeAt(1),i=n.value.length>2?n.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(i&128)===128}else if(t.name==="basicConstraints"){var n=N.fromDer(t.value);n.value.length>0&&n.value[0].type===N.Type.BOOLEAN?t.cA=n.value[0].value.charCodeAt(0)!==0:t.cA=!1;var a=null;n.value.length>0&&n.value[0].type===N.Type.INTEGER?a=n.value[0].value:n.value.length>1&&(a=n.value[1].value),a!==null&&(t.pathLenConstraint=N.derToInteger(a))}else if(t.name==="extKeyUsage")for(var n=N.fromDer(t.value),o=0;o<n.value.length;++o){var s=N.derToOid(n.value[o].value);s in nt?t[nt[s]]=!0:t[s]=!0}else if(t.name==="nsCertType"){var n=N.fromDer(t.value),r=0;n.value.length>1&&(r=n.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var l,n=N.fromDer(t.value),u=0;u<n.value.length;++u){l=n.value[u];var c={type:l.type,value:l.value};switch(t.altNames.push(c),l.type){case 1:case 2:case 6:break;case 7:c.ip=Ae.util.bytesToIP(l.value);break;case 8:c.oid=N.derToOid(l.value);break}}}else if(t.name==="subjectKeyIdentifier"){var n=N.fromDer(t.value);t.subjectKeyIdentifier=Ae.util.bytesToHex(n.value)}}return t};de.certificationRequestFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,jT,n,r)){var i=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificationRequest();if(o.version=n.csrVersion?n.csrVersion.charCodeAt(0):0,o.signatureOid=Ae.asn1.derToOid(n.csrSignatureOid),o.signatureParameters=nd(o.signatureOid,n.csrSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.csrSignatureOid),o.siginfo.parameters=nd(o.siginfo.algorithmOid,n.csrSignatureParams,!1),o.signature=n.csrSignature,o.certificationRequestInfo=n.certificationRequestInfo,t){o.md=lf({signatureOid:o.signatureOid,type:"certification request"});var s=N.toDer(o.certificationRequestInfo);o.md.update(s.getBytes())}var l=Ae.md.sha1.create();return o.subject.getField=function(u){return xa(o.subject,u)},o.subject.addField=function(u){vr([u]),o.subject.attributes.push(u)},o.subject.attributes=de.RDNAttributesAsArray(n.certificationRequestInfoSubject,l),o.subject.hash=l.digest().toHex(),o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o.getAttribute=function(u){return xa(o,u)},o.addAttribute=function(u){vr([u]),o.attributes.push(u)},o.attributes=de.CRIAttributesAsArray(n.certificationRequestInfoAttributes||[]),o};de.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(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return xa(e,t)},e.addAttribute=function(t){vr([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){vr(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){vr(t),e.attributes=t},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=de.getCertificationRequestInfo(e);var a=N.toDer(e.certificationRequestInfo);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,n=e.md;if(n===null){n=lf({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||de.getCertificationRequestInfo(e),i=N.toDer(r);n.update(i.getBytes())}return n!==null&&(t=BC({certificate:e,md:n,signature:e.signature})),t},e};function fs(e){for(var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),n,r,i=e.attributes,a=0;a<i.length;++a){n=i[a];var o=n.value,s=N.Type.PRINTABLESTRING;"valueTagClass"in n&&(s=n.valueTagClass,s===N.Type.UTF8&&(o=Ae.util.encodeUtf8(o))),r=N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(n.type).getBytes()),N.create(N.Class.UNIVERSAL,s,!1,o)])]),t.value.push(r)}return t}function vr(e){for(var t,n=0;n<e.length;++n){if(t=e[n],typeof t.name>"u"&&(t.type&&t.type in de.oids?t.name=de.oids[t.type]:t.shortName&&t.shortName in Nt&&(t.name=de.oids[Nt[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in de.oids)t.type=de.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Nt&&(t.shortName=Nt[t.name]),t.type===nt.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=N.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(de.certificateExtensionToAsn1($C(t.extensions[i])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function $C(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in de.oids&&(e.name=de.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in de.oids)e.id=de.oids[e.name];else{var n=new Error("Extension ID not specified.");throw n.extension=e,n}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,i=0,a=0;e.digitalSignature&&(i|=128,r=7),e.nonRepudiation&&(i|=64,r=6),e.keyEncipherment&&(i|=32,r=5),e.dataEncipherment&&(i|=16,r=4),e.keyAgreement&&(i|=8,r=3),e.keyCertSign&&(i|=4,r=2),e.cRLSign&&(i|=2,r=1),e.encipherOnly&&(i|=1,r=0),e.decipherOnly&&(a|=128,r=7);var o=String.fromCharCode(r);a!==0?o+=String.fromCharCode(i)+String.fromCharCode(a):i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="basicConstraints")e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in e&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;for(var l in e)e[l]===!0&&(l in nt?s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(nt[l]).getBytes())):l.indexOf(".")!==-1&&s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(l).getBytes())))}else if(e.name==="nsCertType"){var r=0,i=0;e.client&&(i|=128,r=7),e.server&&(i|=64,r=6),e.email&&(i|=32,r=5),e.objsign&&(i|=16,r=4),e.reserved&&(i|=8,r=3),e.sslCA&&(i|=4,r=2),e.emailCA&&(i|=2,r=1),e.objCA&&(i|=1,r=0);var o=String.fromCharCode(r);i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));e.value.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=N.create(N.Class.UNIVERSAL,N.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,d.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;if(e.keyIdentifier){var h=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;s.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var f=[N.create(N.Class.CONTEXT_SPECIFIC,4,!0,[fs(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];s.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,f))}if(e.serialNumber){var g=Ae.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);s.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if(e.name==="cRLDistributionPoints"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var s=e.value.value,p=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),m=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]),u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));m.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}p.value.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[m])),s.push(p)}if(typeof e.value>"u"){var n=new Error("Extension value not specified.");throw n.extension=e,n}return e}function ap(e,t){switch(e){case nt["RSASSA-PSS"]:var n=[];return t.hash.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(t.saltLength).getBytes())])),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,n);default:return N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")}}function WT(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var n=e.attributes,r=0;r<n.length;++r){var i=n[r],a=i.value,o=N.Type.UTF8;"valueTagClass"in i&&(o=i.valueTagClass),o===N.Type.UTF8&&(a=Ae.util.encodeUtf8(a));var s=!1;"valueConstructed"in i&&(s=i.valueConstructed);var l=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(i.type).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,o,s,a)])]);t.value.push(l)}return t}var zT=new Date("1950-01-01T00:00:00Z"),GT=new Date("2050-01-01T00:00:00Z");function R1(e){return e>=zT&&e<GT?N.create(N.Class.UNIVERSAL,N.Type.UTCTIME,!1,N.dateToUtcTime(e)):N.create(N.Class.UNIVERSAL,N.Type.GENERALIZEDTIME,!1,N.dateToGeneralizedTime(e))}de.getTBSCertificate=function(e){var t=R1(e.validity.notBefore),n=R1(e.validity.notAfter),r=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes())]),N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,Ae.util.hexToBytes(e.serialNumber)),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.siginfo.algorithmOid).getBytes()),ap(e.siginfo.algorithmOid,e.siginfo.parameters)]),fs(e.issuer),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,n]),fs(e.subject),de.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(de.certificateExtensionsToAsn1(e.extensions)),r};de.getCertificationRequestInfo=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes()),fs(e.subject),de.publicKeyToAsn1(e.publicKey),WT(e)]);return t};de.distinguishedNameToAsn1=function(e){return fs(e)};de.certificateToAsn1=function(e){var t=e.tbsCertificate||de.getTBSCertificate(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.certificateExtensionsToAsn1=function(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,3,!0,[]),n=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(n);for(var r=0;r<e.length;++r)n.value.push(de.certificateExtensionToAsn1(e[r]));return t};de.certificateExtensionToAsn1=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.id).getBytes())),e.critical&&t.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ"));var n=e.value;return typeof e.value!="string"&&(n=N.toDer(n).getBytes()),t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,n)),t};de.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||de.getCertificationRequestInfo(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(o){var s=n(o.issuer);return s},t.addCertificate=function(o){if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))if(o.subject.hash in t.certs){var s=t.certs[o.subject.hash];Ae.util.isArray(s)||(s=[s]),s.push(o),t.certs[o.subject.hash]=s}else t.certs[o.subject.hash]=o},t.hasCertificate=function(o){typeof o=="string"&&(o=Ae.pki.certificateFromPem(o));var s=n(o.subject);if(!s)return!1;Ae.util.isArray(s)||(s=[s]);for(var l=N.toDer(de.certificateToAsn1(o)).getBytes(),u=0;u<s.length;++u){var c=N.toDer(de.certificateToAsn1(s[u])).getBytes();if(l===c)return!0}return!1},t.listAllCertificates=function(){var o=[];for(var s in t.certs)if(t.certs.hasOwnProperty(s)){var l=t.certs[s];if(!Ae.util.isArray(l))o.push(l);else for(var u=0;u<l.length;++u)o.push(l[u])}return o},t.removeCertificate=function(o){var s;if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))return null;var l=n(o.subject);if(!Ae.util.isArray(l))return s=t.certs[o.subject.hash],delete t.certs[o.subject.hash],s;for(var u=N.toDer(de.certificateToAsn1(o)).getBytes(),c=0;c<l.length;++c){var d=N.toDer(de.certificateToAsn1(l[c])).getBytes();u===d&&(s=l[c],l.splice(c,1))}return l.length===0&&delete t.certs[o.subject.hash],s};function n(o){return r(o),t.certs[o.hash]||null}function r(o){if(!o.hash){var s=Ae.md.sha1.create();o.attributes=de.RDNAttributesAsArray(fs(o),s),o.hash=s.digest().toHex()}}if(e)for(var i=0;i<e.length;++i){var a=e[i];t.addCertificate(a)}return t};de.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"};de.verifyCertificateChain=function(e,t,n){typeof n=="function"&&(n={verify:n}),n=n||{},t=t.slice(0);var r=t.slice(0),i=n.validityCheckDate;typeof i>"u"&&(i=new Date);var a=!0,o=null,s=0;do{var l=t.shift(),u=null,c=!1;if(i&&(i<l.validity.notBefore||i>l.validity.notAfter)&&(o={message:"Certificate is not valid yet or has expired.",error:de.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:i}),o===null){if(u=t[0]||e.getIssuer(l),u===null&&l.isIssuer(l)&&(c=!0,u=l),u){var d=u;Ae.util.isArray(d)||(d=[d]);for(var h=!1;!h&&d.length>0;){u=d.shift();try{h=u.verify(l)}catch{}}h||(o={message:"Certificate signature is invalid.",error:de.certificateError.bad_certificate})}o===null&&(!u||c)&&!e.hasCertificate(l)&&(o={message:"Certificate is not trusted.",error:de.certificateError.unknown_ca})}if(o===null&&u&&!l.isIssuer(u)&&(o={message:"Certificate issuer is invalid.",error:de.certificateError.bad_certificate}),o===null)for(var f={keyUsage:!0,basicConstraints:!0},g=0;o===null&&g<l.extensions.length;++g){var p=l.extensions[g];p.critical&&!(p.name in f)&&(o={message:"Certificate has an unsupported critical extension.",error:de.certificateError.unsupported_certificate})}if(o===null&&(!a||t.length===0&&(!u||c))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||m===null)&&(o={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:de.certificateError.bad_certificate}),o===null&&m!==null&&!m.cA&&(o={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:de.certificateError.bad_certificate}),o===null&&b!==null&&"pathLenConstraint"in m){var v=s-1;v>m.pathLenConstraint&&(o={message:"Certificate basicConstraints pathLenConstraint violated.",error:de.certificateError.bad_certificate})}}var x=o===null?!0:o.error,C=n.verify?n.verify(x,s,r):x;if(C===!0)o=null;else throw x===!0&&(o={message:"The application rejected the certificate.",error:de.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!Ae.util.isArray(C)?(C.message&&(o.message=C.message),C.error&&(o.error=C.error)):typeof C=="string"&&(o.error=C)),o;a=!1,++s}while(t.length>0);return!0};var xt=ze,G=xt.asn1,Xe=xt.pki,Il=xt.pkcs12=xt.pkcs12||{},kC={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},UT={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},kC,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},XT={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ZT={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},YT={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Ms(e,t,n,r){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];if(!(r!==void 0&&s.type!==r)){if(t===null){i.push(s);continue}s.attributes[t]!==void 0&&s.attributes[t].indexOf(n)>=0&&i.push(s)}}return i}Il.pkcs12FromAsn1=function(e,t,n){typeof t=="string"?(n=t,t=!0):t===void 0&&(t=!0);var r={},i=[];if(!G.validate(e,UT,r,i)){var a=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw a.errors=a,a}var o={version:r.version.charCodeAt(0),safeContents:[],getBags:function(m){var b={},v;return"localKeyId"in m?v=m.localKeyId:"localKeyIdHex"in m&&(v=xt.util.hexToBytes(m.localKeyIdHex)),v===void 0&&!("friendlyName"in m)&&"bagType"in m&&(b[m.bagType]=Ms(o.safeContents,null,null,m.bagType)),v!==void 0&&(b.localKeyId=Ms(o.safeContents,"localKeyId",v,m.bagType)),"friendlyName"in m&&(b.friendlyName=Ms(o.safeContents,"friendlyName",m.friendlyName,m.bagType)),b},getBagsByFriendlyName:function(m,b){return Ms(o.safeContents,"friendlyName",m,b)},getBagsByLocalKeyId:function(m,b){return Ms(o.safeContents,"localKeyId",m,b)}};if(r.version.charCodeAt(0)!==3){var a=new Error("PKCS#12 PFX of version other than 3 not supported.");throw a.version=r.version.charCodeAt(0),a}if(G.derToOid(r.contentType)!==Xe.oids.data){var a=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw a.oid=G.derToOid(r.contentType),a}var s=r.content.value[0];if(s.tagClass!==G.Class.UNIVERSAL||s.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(s=op(s),r.mac){var l=null,u=0,c=G.derToOid(r.macAlgorithm);switch(c){case Xe.oids.sha1:l=xt.md.sha1.create(),u=20;break;case Xe.oids.sha256:l=xt.md.sha256.create(),u=32;break;case Xe.oids.sha384:l=xt.md.sha384.create(),u=48;break;case Xe.oids.sha512:l=xt.md.sha512.create(),u=64;break;case Xe.oids.md5:l=xt.md.md5.create(),u=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var d=new xt.util.ByteBuffer(r.macSalt),h="macIterations"in r?parseInt(xt.util.bytesToHex(r.macIterations),16):1,f=Il.generateKey(n,d,3,h,u,l),g=xt.hmac.create();g.start(l,f),g.update(s.value);var p=g.getMac();if(p.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return KT(o,s.value,t,n),o};function op(e){if(e.composed||e.constructed){for(var t=xt.util.createBuffer(),n=0;n<e.value.length;++n)t.putBytes(e.value[n].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function KT(e,t,n,r){if(t=G.fromDer(t,n),t.tagClass!==G.Class.UNIVERSAL||t.type!==G.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var a=t.value[i],o={},s=[];if(!G.validate(a,kC,o,s)){var l=new Error("Cannot read ContentInfo.");throw l.errors=s,l}var u={encrypted:!1},c=null,d=o.content.value[0];switch(G.derToOid(o.contentType)){case Xe.oids.data:if(d.tagClass!==G.Class.UNIVERSAL||d.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=op(d).value;break;case Xe.oids.encryptedData:c=JT(d,r),u.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(o.contentType),l}u.safeBags=qT(c,n,r),e.safeContents.push(u)}}function JT(e,t){var n={},r=[];if(!G.validate(e,xt.pkcs7.asn1.encryptedDataValidator,n,r)){var i=new Error("Cannot read EncryptedContentInfo.");throw i.errors=r,i}var a=G.derToOid(n.contentType);if(a!==Xe.oids.data){var i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw i.oid=a,i}a=G.derToOid(n.encAlgorithm);var o=Xe.pbe.getCipher(a,n.encParameter,t),s=op(n.encryptedContentAsn1),l=xt.util.createBuffer(s.value);if(o.update(l),!o.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return o.output.getBytes()}function qT(e,t,n){if(!t&&e.length===0)return[];if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],i=0;i<e.value.length;i++){var a=e.value[i],o={},s=[];if(!G.validate(a,XT,o,s)){var l=new Error("Cannot read SafeBag.");throw l.errors=s,l}var u={type:G.derToOid(o.bagId),attributes:QT(o.bagAttributes)};r.push(u);var c,d,h=o.bagValue.value[0];switch(u.type){case Xe.oids.pkcs8ShroudedKeyBag:if(h=Xe.decryptPrivateKeyInfo(h,n),h===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Xe.oids.keyBag:try{u.key=Xe.privateKeyFromAsn1(h)}catch{u.key=null,u.asn1=h}continue;case Xe.oids.certBag:c=YT,d=function(){if(G.derToOid(o.certId)!==Xe.oids.x509Certificate){var g=new Error("Unsupported certificate type, only X.509 supported.");throw g.oid=G.derToOid(o.certId),g}var p=G.fromDer(o.cert,t);try{u.cert=Xe.certificateFromAsn1(p,!0)}catch{u.cert=null,u.asn1=p}};break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=u.type,l}if(c!==void 0&&!G.validate(h,c,o,s)){var l=new Error("Cannot read PKCS#12 "+c.name);throw l.errors=s,l}d()}return r}function QT(e){var t={};if(e!==void 0)for(var n=0;n<e.length;++n){var r={},i=[];if(!G.validate(e[n],ZT,r,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var o=G.derToOid(r.oid);if(Xe.oids[o]!==void 0){t[Xe.oids[o]]=[];for(var s=0;s<r.values.length;++s)t[Xe.oids[o]].push(r.values[s].value)}}return t}Il.toPkcs12Asn1=function(e,t,n,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var i=r.localKeyId,a;if(i!==null)i=xt.util.hexToBytes(i);else if(r.generateLocalKeyId)if(t){var o=xt.util.isArray(t)?t[0]:t;typeof o=="string"&&(o=Xe.certificateFromPem(o));var s=xt.md.sha1.create();s.update(G.toDer(Xe.certificateToAsn1(o)).getBytes()),i=s.digest().getBytes()}else i=xt.random.getBytes(20);var l=[];i!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,i)])])),"friendlyName"in r&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,r.friendlyName)])])),l.length>0&&(a=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var u=[],c=[];t!==null&&(xt.util.isArray(t)?c=t:c=[t]);for(var d=[],h=0;h<c.length;++h){t=c[h],typeof t=="string"&&(t=Xe.certificateFromPem(t));var f=h===0?a:void 0,g=Xe.certificateToAsn1(t),p=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(g).getBytes())])])]),f]);d.push(p)}if(d.length>0){var m=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,d),b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])]);u.push(b)}var v=null;if(e!==null){var x=Xe.wrapRsaPrivateKey(Xe.privateKeyToAsn1(e));n===null?v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[x]),a]):v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Xe.encryptPrivateKeyInfo(x,n,r)]),a]);var C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[v]),E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(C).getBytes())])]);u.push(E)}var w=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,u),B;if(r.useMac){var s=xt.md.sha1.create(),y=new xt.util.ByteBuffer(xt.random.getBytes(r.saltSize)),S=r.count,e=Il.generateKey(n,y,3,S,20),D=xt.hmac.create();D.start(s,e),D.update(G.toDer(w).getBytes());var A=D.getMac();B=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,A.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,y.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(S).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(w).getBytes())])]),B])};Il.generateKey=xt.pbe.generatePkcs12Key;var Ca=ze,sp=Ca.asn1,hs=Ca.pki=Ca.pki||{};hs.pemToDer=function(e){var t=Ca.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Ca.util.createBuffer(t.body)};hs.privateKeyFromPem=function(e){var t=Ca.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=sp.fromDer(t.body);return hs.privateKeyFromAsn1(r)};hs.privateKeyToPem=function(e,t){var n={type:"RSA PRIVATE KEY",body:sp.toDer(hs.privateKeyToAsn1(e)).getBytes()};return Ca.pem.encode(n,{maxline:t})};hs.privateKeyInfoToPem=function(e,t){var n={type:"PRIVATE KEY",body:sp.toDer(e).getBytes()};return Ca.pem.encode(n,{maxline:t})};var ae=ze,uf=function(e,t,n,r){var i=ae.util.createBuffer(),a=e.length>>1,o=a+(e.length&1),s=e.substr(0,o),l=e.substr(a,o),u=ae.util.createBuffer(),c=ae.hmac.create();n=t+n;var d=Math.ceil(r/16),h=Math.ceil(r/20);c.start("MD5",s);var f=ae.util.createBuffer();u.putBytes(n);for(var g=0;g<d;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),f.putBuffer(c.digest());c.start("SHA1",l);var p=ae.util.createBuffer();u.clear(),u.putBytes(n);for(var g=0;g<h;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),p.putBuffer(c.digest());return i.putBytes(ae.util.xorBytes(f.getBytes(),p.getBytes(),r)),i},eR=function(e,t,n){var r=ae.hmac.create();r.start("SHA1",e);var i=ae.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(n.type),i.putByte(n.version.major),i.putByte(n.version.minor),i.putInt16(n.length),i.putBytes(n.fragment.bytes()),r.update(i.getBytes()),r.digest().getBytes()},tR=function(e,t,n){var r=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},nR=function(e,t,n){var r=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},Yn=function(e,t){var n=0;switch(t){case 1:n=e.getByte();break;case 2:n=e.getInt16();break;case 3:n=e.getInt24();break;case 4:n=e.getInt32();break}return ae.util.createBuffer(e.getBytes(n))},gr=function(e,t,n){e.putInt(n.length(),t<<3),e.putBuffer(n)},L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.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};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.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};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(e){var t=null;for(var n in L.CipherSuites){var r=L.CipherSuites[n];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};L.handleUnexpected=function(e,t){var n=!e.open&&e.entity===L.ConnectionEnd.client;n||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(e,t,n){!e.handshaking&&e.handshakes>0&&(L.queue(e,L.createAlert(e,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(e)),e.process()};L.parseHelloMessage=function(e,t,n){var r=null,i=e.entity===L.ConnectionEnd.client;if(n<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var a=t.fragment,o=a.length();if(r={version:{major:a.getByte(),minor:a.getByte()},random:ae.util.createBuffer(a.getBytes(32)),session_id:Yn(a,1),extensions:[]},i?(r.cipher_suite=a.getBytes(2),r.compression_method=a.getByte()):(r.cipher_suites=Yn(a,2),r.compression_methods=Yn(a,1)),o=n-(o-a.length()),o>0){for(var s=Yn(a,2);s.length()>0;)r.extensions.push({type:[s.getByte(),s.getByte()],data:Yn(s,2)});if(!i)for(var l=0;l<r.extensions.length;++l){var u=r.extensions[l];if(u.type[0]===0&&u.type[1]===0)for(var c=Yn(u.data,2);c.length()>0;){var d=c.getByte();if(d!==0)break;e.session.extensions.server_name.serverNameList.push(Yn(c,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=L.getCipherSuite(r.cipher_suite);else for(var h=ae.util.createBuffer(r.cipher_suites.bytes());h.length()>0&&(e.session.cipherSuite=L.getCipherSuite(h.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:ae.util.bytesToHex(r.cipher_suite)});i?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=L.CompressionMethod.none}return r};L.createSecurityParameters=function(e,t){var n=e.entity===L.ConnectionEnd.client,r=t.random.bytes(),i=n?e.session.sp.client_random:r,a=n?r:L.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:L.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:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}};L.handleServerHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=PC,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=iR,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.session.id=i,e.process()}};L.handleClientHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){var i=r.session_id.bytes(),a=null;if(e.sessionCache&&(a=e.sessionCache.getSession(i),a===null?i="":(a.version.major!==r.version.major||a.version.minor>r.version.minor)&&(a=null,i="")),i.length===0&&(i=ae.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=r.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,s=1;s<L.SupportedVersions.length&&(o=L.SupportedVersions[s],!(o.minor<=r.version.minor));++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}a!==null?(e.expect=lp,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?dR:R0,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.open=!0,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHello(e)})),e.session.resuming?(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.pending=L.createConnectionState(e),e.state.current.write=e.state.pending.write,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))):(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)})),e.fail||(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerKeyExchange(e)})),e.verifyClient!==!1&&L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificateRequest(e)})),L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHelloDone(e)})))),L.flush(e),e.process()}};L.handleCertificate=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_list:Yn(r,3)},a,o,s=[];try{for(;i.certificate_list.length()>0;)a=Yn(i.certificate_list,3),o=ae.asn1.fromDer(a),a=ae.pki.certificateFromAsn1(o,!0),s.push(a)}catch(u){return e.error(e,{message:"Could not parse certificate list.",cause:u,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=e.entity===L.ConnectionEnd.client;(l||e.verifyClient===!0)&&s.length===0?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):s.length===0?e.expect=l?B1:R0:(l?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],L.verifyCertificateChain(e,s)&&(e.expect=l?B1:R0)),e.process()};L.handleServerKeyExchange=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});e.expect=aR,e.process()};L.handleClientKeyExchange=function(e,t,n){if(n<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var r=t.fragment,i={enc_pre_master_secret:Yn(r,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=ae.pki.privateKeyFromPem(a)}catch(l){e.error(e,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(a===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{o.pre_master_secret=ae.random.getBytes(48)}e.expect=lp,e.session.clientCertificate!==null&&(e.expect=fR),e.process()};L.handleCertificateRequest=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:Yn(r,1),certificate_authorities:Yn(r,2)};e.session.certificateRequest=i,e.expect=oR,e.process()};L.handleCertificateVerify=function(e,t,n){if(n<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a={signature:Yn(r,2).getBytes()},o=ae.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{var s=e.session.clientCertificate;if(!s.publicKey.verify(o,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}e.expect=lp,e.process()};L.handleServerHelloDone=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},i=0,a=e.verify(e,r.alert.description,i,[]);if(a!==!0)return(a||a===0)&&(typeof a=="object"&&!ae.util.isArray(a)?(a.message&&(r.message=a.message),a.alert&&(r.alert.description=a.alert)):typeof a=="number"&&(r.alert.description=a)),e.error(e,r)}e.session.certificateRequest!==null&&(t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)}),L.queue(e,t)),t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createClientKeyExchange(e)}),L.queue(e,t),e.expect=uR;var o=function(s,l){s.session.certificateRequest!==null&&s.session.clientCertificate!==null&&L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createCertificateVerify(s,l)})),L.queue(s,L.createRecord(s,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),s.state.pending=L.createConnectionState(s),s.state.current.write=s.state.pending.write,L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createFinished(s)})),s.expect=PC,L.flush(s),s.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return o(e,null);L.getClientSignature(e,o)};L.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.entity===L.ConnectionEnd.client;(e.session.resuming&&n||!e.session.resuming&&!n)&&(e.state.pending=L.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&n||e.session.resuming&&!n)&&(e.state.pending=null),e.expect=n?sR:hR,e.process()};L.handleFinished=function(e,t,n){var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a=t.fragment.getBytes();r=ae.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var o=e.entity===L.ConnectionEnd.client,s=o?"server finished":"client finished",l=e.session.sp,u=12,c=uf;if(r=c(l.master_secret,s,r.getBytes(),u),r.getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))),e.expect=o?lR:gR,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,L.flush(e),e.isConnected=!0,e.connected(e),e.process()};L.handleAlert=function(e,t){var n=t.fragment,r={level:n.getByte(),description:n.getByte()},i;switch(r.description){case L.Alert.Description.close_notify:i="Connection closed.";break;case L.Alert.Description.unexpected_message:i="Unexpected message.";break;case L.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case L.Alert.Description.decryption_failed:i="Decryption failed.";break;case L.Alert.Description.record_overflow:i="Record overflow.";break;case L.Alert.Description.decompression_failure:i="Decompression failed.";break;case L.Alert.Description.handshake_failure:i="Handshake failure.";break;case L.Alert.Description.bad_certificate:i="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case L.Alert.Description.certificate_expired:i="Certificate expired.";break;case L.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case L.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case L.Alert.Description.access_denied:i="Access denied.";break;case L.Alert.Description.decode_error:i="Decode error.";break;case L.Alert.Description.decrypt_error:i="Decrypt error.";break;case L.Alert.Description.export_restriction:i="Export restriction.";break;case L.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:i="Insufficient security.";break;case L.Alert.Description.internal_error:i="Internal error.";break;case L.Alert.Description.user_canceled:i="User canceled.";break;case L.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error.";break}if(r.description===L.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===L.ConnectionEnd.client?"server":"client",alert:r}),e.process()};L.handleHandshake=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt24();if(i>n.length())return e.fragmented=t,t.fragment=ae.util.createBuffer(),n.read-=4,e.process();e.fragmented=null,n.read-=4;var a=n.bytes(i+4);n.read+=4,r in rd[e.entity][e.expect]?(e.entity===L.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:ae.md.md5.create(),sha1:ae.md.sha1.create()}),r!==L.HandshakeType.hello_request&&r!==L.HandshakeType.certificate_verify&&r!==L.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),rd[e.entity][e.expect][r](e,t,i)):L.handleUnexpected(e,t)};L.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};L.handleHeartbeat=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt16(),a=n.getBytes(i);if(r===L.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();L.queue(e,L.createRecord(e,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,a)})),L.flush(e)}else if(r===L.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,ae.util.createBuffer(a))}e.process()};var rR=0,iR=1,B1=2,aR=3,oR=4,PC=5,sR=6,lR=7,uR=8,cR=0,dR=1,R0=2,fR=3,lp=4,hR=5,gR=6,M=L.handleUnexpected,FC=L.handleChangeCipherSpec,dn=L.handleAlert,Dn=L.handleHandshake,NC=L.handleApplicationData,fn=L.handleHeartbeat,up=[];up[L.ConnectionEnd.client]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];up[L.ConnectionEnd.server]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];var Yi=L.handleHelloRequest,pR=L.handleServerHello,MC=L.handleCertificate,$1=L.handleServerKeyExchange,Yf=L.handleCertificateRequest,ku=L.handleServerHelloDone,LC=L.handleFinished,rd=[];rd[L.ConnectionEnd.client]=[[M,M,pR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,MC,$1,Yf,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,$1,Yf,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,Yf,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];var mR=L.handleClientHello,bR=L.handleClientKeyExchange,vR=L.handleCertificateVerify;rd[L.ConnectionEnd.server]=[[M,mR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,MC,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,bR,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,vR,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];L.generateKeys=function(e,t){var n=uf,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=n(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===L.Versions.TLS_1_0.major&&e.version.minor===L.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var o=n(t.master_secret,"key expansion",r,i),s={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s};L.createConnectionState=function(e){var t=e.entity===L.ConnectionEnd.client,n=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(o){return!0},compressionState:null,compressFunction:function(o){return!0},updateSequenceNumber:function(){a.sequenceNumber[1]===4294967295?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},r={read:n(),write:n()};if(r.read.update=function(a,o){return r.read.cipherFunction(o,r.read)?r.read.compressFunction(a,o,r.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_record_mac}}),!a.fail},r.write.update=function(a,o){return r.write.compressFunction(a,o,r.write)?r.write.cipherFunction(o,r.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!a.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=L.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case L.CompressionMethod.none:break;case L.CompressionMethod.deflate:r.read.compressFunction=nR,r.write.compressFunction=tR;break;default:throw new Error("Unsupported compression algorithm.")}}return r};L.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,n=ae.util.createBuffer();return n.putInt32(t),n.putBytes(ae.random.getBytes(28)),n};L.createRecord=function(e,t){if(!t.data)return null;var n={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return n};L.createAlert=function(e,t){var n=ae.util.createBuffer();return n.putByte(t.level),n.putByte(t.description),L.createRecord(e,{type:L.ContentType.alert,data:n})};L.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=ae.util.createBuffer(),n=0;n<e.cipherSuites.length;++n){var r=e.cipherSuites[n];t.putByte(r.id[0]),t.putByte(r.id[1])}var i=t.length(),a=ae.util.createBuffer();a.putByte(L.CompressionMethod.none);var o=a.length(),s=ae.util.createBuffer();if(e.virtualHost){var l=ae.util.createBuffer();l.putByte(0),l.putByte(0);var u=ae.util.createBuffer();u.putByte(0),gr(u,2,ae.util.createBuffer(e.virtualHost));var c=ae.util.createBuffer();gr(c,2,u),gr(l,2,c),s.putBuffer(l)}var d=s.length();d>0&&(d+=2);var h=e.session.id,f=h.length+1+2+4+28+2+i+1+o+d,g=ae.util.createBuffer();return g.putByte(L.HandshakeType.client_hello),g.putInt24(f),g.putByte(e.version.major),g.putByte(e.version.minor),g.putBytes(e.session.sp.client_random),gr(g,1,ae.util.createBuffer(h)),gr(g,2,t),gr(g,1,a),d>0&&gr(g,2,s),g};L.createServerHello=function(e){var t=e.session.id,n=t.length+1+2+4+28+2+1,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.server_hello),r.putInt24(n),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),gr(r,1,ae.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};L.createCertificate=function(e){var t=e.entity===L.ConnectionEnd.client,n=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,r)}var i=ae.util.createBuffer();if(n!==null)try{ae.util.isArray(n)||(n=[n]);for(var a=null,o=0;o<n.length;++o){var s=ae.pem.decode(n[o])[0];if(s.type!=="CERTIFICATE"&&s.type!=="X509 CERTIFICATE"&&s.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=s.type,l}if(s.procType&&s.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=ae.util.createBuffer(s.body);a===null&&(a=ae.asn1.fromDer(u.bytes(),!1));var c=ae.util.createBuffer();gr(c,3,u),i.putBuffer(c)}n=ae.pki.certificateFromAsn1(a),t?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(f){return e.error(e,{message:"Could not send certificate list.",cause:f,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var d=3+i.length(),h=ae.util.createBuffer();return h.putByte(L.HandshakeType.certificate),h.putInt24(d),gr(h,3,i),h};L.createClientKeyExchange=function(e){var t=ae.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(ae.random.getBytes(46));var n=e.session.sp;n.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(n.pre_master_secret);var i=t.length+2,a=ae.util.createBuffer();return a.putByte(L.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a};L.createServerKeyExchange=function(e){var t=ae.util.createBuffer();return t};L.getClientSignature=function(e,t){var n=ae.util.createBuffer();n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest()),n=n.getBytes(),e.getSignature=e.getSignature||function(r,i,a){var o=null;if(r.getPrivateKey)try{o=r.getPrivateKey(r,r.session.clientCertificate),o=ae.pki.privateKeyFromPem(o)}catch(s){r.error(r,{message:"Could not get private key.",cause:s,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}o===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i=o.sign(i,null),a(r,i)},e.getSignature(e,n,t)};L.createCertificateVerify=function(e,t){var n=t.length+2,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.certificate_verify),r.putInt24(n),r.putInt16(t.length),r.putBytes(t),r};L.createCertificateRequest=function(e){var t=ae.util.createBuffer();t.putByte(1);var n=ae.util.createBuffer();for(var r in e.caStore.certs){var i=e.caStore.certs[r],a=ae.pki.distinguishedNameToAsn1(i.subject),o=ae.asn1.toDer(a);n.putInt16(o.length()),n.putBuffer(o)}var s=1+t.length()+2+n.length(),l=ae.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(s),gr(l,1,t),gr(l,2,n),l};L.createServerHelloDone=function(e){var t=ae.util.createBuffer();return t.putByte(L.HandshakeType.server_hello_done),t.putInt24(0),t};L.createChangeCipherSpec=function(){var e=ae.util.createBuffer();return e.putByte(1),e};L.createFinished=function(e){var t=ae.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var n=e.entity===L.ConnectionEnd.client,r=e.session.sp,i=12,a=uf,o=n?"client finished":"server finished";t=a(r.master_secret,o,t.getBytes(),i);var s=ae.util.createBuffer();return s.putByte(L.HandshakeType.finished),s.putInt24(t.length()),s.putBuffer(t),s};L.createHeartbeat=function(e,t,n){typeof n>"u"&&(n=t.length);var r=ae.util.createBuffer();r.putByte(e),r.putInt16(n),r.putBytes(t);var i=r.length(),a=Math.max(16,i-n-3);return r.putBytes(ae.random.getBytes(a)),r};L.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===L.ContentType.handshake||t.type===L.ContentType.alert||t.type===L.ContentType.change_cipher_spec))){if(t.type===L.ContentType.handshake){var n=t.fragment.bytes();e.session.md5.update(n),e.session.sha1.update(n),n=null}var r;if(t.fragment.length()<=L.MaxFragment)r=[t];else{r=[];for(var i=t.fragment.bytes();i.length>L.MaxFragment;)r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i.slice(0,L.MaxFragment))})),i=i.slice(L.MaxFragment);i.length>0&&r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i)}))}for(var a=0;a<r.length&&!e.fail;++a){var o=r[a],s=e.state.current.write;s.update(e,o)&&e.records.push(o)}}};L.flush=function(e){for(var t=0;t<e.records.length;++t){var n=e.records[t];e.tlsData.putByte(n.type),e.tlsData.putByte(n.version.major),e.tlsData.putByte(n.version.minor),e.tlsData.putInt16(n.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Kf=function(e){switch(e){case!0:return!0;case ae.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case ae.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case ae.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case ae.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case ae.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case ae.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},yR=function(e){switch(e){case!0:return!0;case L.Alert.Description.bad_certificate:return ae.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return ae.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return ae.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return ae.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return ae.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return ae.pki.certificateError.unknown_ca;default:return ae.pki.certificateError.bad_certificate}};L.verifyCertificateChain=function(e,t){try{var n={};for(var r in e.verifyOptions)n[r]=e.verifyOptions[r];n.verify=function(a,o,s){var l=Kf(a),u=e.verify(e,a,o,s);if(u!==!0){if(typeof u=="object"&&!ae.util.isArray(u)){var c=new Error("The application rejected the certificate.");throw c.send=!0,c.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},u.message&&(c.message=u.message),u.alert&&(c.alert.description=u.alert),c}u!==a&&(u=yR(u))}return u},ae.pki.verifyCertificateChain(e.caStore,t,n)}catch(a){var i=a;(typeof i!="object"||ae.util.isArray(i))&&(i={send:!0,alert:{level:L.Alert.Level.fatal,description:Kf(a)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:L.Alert.Level.fatal,description:Kf(i.error)}),e.error(e,i)}return!e.fail};L.createSessionCache=function(e,t){var n=null;if(e&&e.getSession&&e.setSession&&e.order)n=e;else{n={},n.cache=e||{},n.capacity=Math.max(t||100,1),n.order=[];for(var r in e)n.order.length<=t?n.order.push(r):delete e[r];n.getSession=function(i){var a=null,o=null;if(i?o=ae.util.bytesToHex(i):n.order.length>0&&(o=n.order[0]),o!==null&&o in n.cache){a=n.cache[o],delete n.cache[o];for(var s in n.order)if(n.order[s]===o){n.order.splice(s,1);break}}return a},n.setSession=function(i,a){if(n.order.length===n.capacity){var o=n.order.shift();delete n.cache[o]}var o=ae.util.bytesToHex(i);n.order.push(o),n.cache[o]=a}}return n};L.createConnection=function(e){var t=null;e.caStore?ae.util.isArray(e.caStore)?t=ae.pki.createCaStore(e.caStore):t=e.caStore:t=ae.pki.createCaStore();var n=e.cipherSuites||null;if(n===null){n=[];for(var r in L.CipherSuites)n.push(L.CipherSuites[r])}var i=e.server?L.ConnectionEnd.server:L.ConnectionEnd.client,a=e.sessionCache?L.createSessionCache(e.sessionCache):null,o={version:{major:L.Version.major,minor:L.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:n,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(c,d,h,f){return d},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:ae.util.createBuffer(),tlsData:ae.util.createBuffer(),data:ae.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(c,d){d.origin=d.origin||(c.entity===L.ConnectionEnd.client?"client":"server"),d.send&&(L.queue(c,L.createAlert(c,d.alert)),L.flush(c));var h=d.fatal!==!1;h&&(c.fail=!0),e.error(c,d),h&&c.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};o.reset=function(c){o.version={major:L.Version.major,minor:L.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=o.entity===L.ConnectionEnd.client?rR:cR,o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(c||typeof c>"u"),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=L.createConnectionState(o)},o.reset();var s=function(c,d){var h=d.type-L.ContentType.change_cipher_spec,f=up[c.entity][c.expect];h in f?f[h](c,d):L.handleUnexpected(c,d)},l=function(c){var d=0,h=c.input,f=h.length();if(f<5)d=5-f;else{c.record={type:h.getByte(),version:{major:h.getByte(),minor:h.getByte()},length:h.getInt16(),fragment:ae.util.createBuffer(),ready:!1};var g=c.record.version.major===c.version.major;g&&c.session&&c.session.version&&(g=c.record.version.minor===c.version.minor),g||c.error(c,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return d},u=function(c){var d=0,h=c.input,f=h.length();if(f<c.record.length)d=c.record.length-f;else{c.record.fragment.putBytes(h.getBytes(c.record.length)),h.compact();var g=c.state.current.read;g.update(c,c.record)&&(c.fragmented!==null&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),c.record.ready=!0)}return d};return o.handshake=function(c){if(o.entity!==L.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&o.handshakes===0&&(o.fail=!1),o.handshaking=!0,c=c||"";var d=null;c.length>0&&(o.sessionCache&&(d=o.sessionCache.getSession(c)),d===null&&(c="")),c.length===0&&o.sessionCache&&(d=o.sessionCache.getSession(),d!==null&&(c=d.id)),o.session={id:c,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ae.md.md5.create(),sha1:ae.md.sha1.create()},d&&(o.version=d.version,o.session.sp=d.sp),o.session.sp.client_random=L.createRandom().getBytes(),o.open=!0,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createClientHello(o)})),L.flush(o)}},o.process=function(c){var d=0;return c&&o.input.putBytes(c),o.fail||(o.record!==null&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),o.record===null&&(d=l(o)),!o.fail&&o.record!==null&&!o.record.ready&&(d=u(o)),!o.fail&&o.record!==null&&o.record.ready&&s(o,o.record)),d},o.prepare=function(c){return L.queue(o,L.createRecord(o,{type:L.ContentType.application_data,data:ae.util.createBuffer(c)})),L.flush(o)},o.prepareHeartbeatRequest=function(c,d){return c instanceof ae.util.ByteBuffer&&(c=c.bytes()),typeof d>"u"&&(d=c.length),o.expectedHeartbeatPayload=c,L.queue(o,L.createRecord(o,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,c,d)})),L.flush(o)},o.close=function(c){if(!o.fail&&o.sessionCache&&o.session){var d={id:o.session.id,version:o.session.version,sp:o.session.sp};d.sp.keys=null,o.sessionCache.setSession(d.id,d)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,L.queue(o,L.createAlert(o,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(o)),o.closed(o)),o.reset(c)},o};ae.tls=ae.tls||{};for(var Jf in L)typeof L[Jf]!="function"&&(ae.tls[Jf]=L[Jf]);ae.tls.prf_tls1=uf;ae.tls.hmac_sha1=eR;ae.tls.createSessionCache=L.createSessionCache;ae.tls.createConnection=L.createConnection;var pa=ze,yr=pa.tls;yr.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};yr.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};function OC(e,t,n){var r=t.entity===pa.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:pa.cipher.createDecipher("AES-CBC",r?n.keys.server_write_key:n.keys.client_write_key),iv:r?n.keys.server_write_IV:n.keys.client_write_IV},e.write.cipherState={init:!1,cipher:pa.cipher.createCipher("AES-CBC",r?n.keys.client_write_key:n.keys.server_write_key),iv:r?n.keys.client_write_IV:n.keys.server_write_IV},e.read.cipherFunction=SR,e.write.cipherFunction=xR,e.read.macLength=e.write.macLength=n.mac_length,e.read.macFunction=e.write.macFunction=yr.hmac_sha1}function xR(e,t){var n=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var i;e.version.minor===yr.Versions.TLS_1_0.minor?i=t.cipherState.init?null:t.cipherState.iv:i=pa.random.getBytesSync(16),t.cipherState.init=!0;var a=t.cipherState.cipher;return a.start({iv:i}),e.version.minor>=yr.Versions.TLS_1_1.minor&&a.output.putBytes(i),a.update(e.fragment),a.finish(CR)&&(e.fragment=a.output,e.length=e.fragment.length(),n=!0),n}function CR(e,t,n){if(!n){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function ER(e,t,n){var r=!0;if(n){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)r=r&&t.at(o)==a;r&&t.truncate(a+1)}return r}function SR(e,t){var n=!1,r;e.version.minor===yr.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:r}),i.update(e.fragment),n=i.finish(ER);var a=t.macLength,o=pa.random.getBytesSync(a),s=i.output.length();s>=a?(e.fragment=i.output.getBytes(s-a),o=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=pa.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),n=wR(t.macKey,o,l)&&n,n}function wR(e,t,n){var r=pa.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(n),n=r.digest().getBytes(),t===n}var It=ze,hu=It.sha512=It.sha512||{};It.md.sha512=It.md.algorithms.sha512=hu;var VC=It.sha384=It.sha512.sha384=It.sha512.sha384||{};VC.create=function(){return hu.create("SHA-384")};It.md.sha384=It.md.algorithms.sha384=VC;It.sha512.sha256=It.sha512.sha256||{create:function(){return hu.create("SHA-512/256")}};It.md["sha512/256"]=It.md.algorithms["sha512/256"]=It.sha512.sha256;It.sha512.sha224=It.sha512.sha224||{create:function(){return hu.create("SHA-512/224")}};It.md["sha512/224"]=It.md.algorithms["sha512/224"]=It.sha512.sha224;hu.create=function(e){if(HC||IR(),typeof e>"u"&&(e="SHA-512"),!(e in Ua))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Ua[e],n=null,r=It.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var l=s.messageLengthSize/4,u=0;u<l;++u)s.fullMessageLength.push(0);r=It.util.createBuffer(),n=new Array(t.length);for(var u=0;u<t.length;++u)n[u]=t[u].slice(0);return s},s.start(),s.update=function(l,u){u==="utf8"&&(l=It.util.encodeUtf8(l));var c=l.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var d=s.fullMessageLength.length-1;d>=0;--d)s.fullMessageLength[d]+=c[1],c[1]=c[0]+(s.fullMessageLength[d]/4294967296>>>0),s.fullMessageLength[d]=s.fullMessageLength[d]>>>0,c[0]=c[1]/4294967296>>>0;return r.putBytes(l),k1(n,i,r),(r.read>2048||r.length()===0)&&r.compact(),s},s.digest=function(){var l=It.util.createBuffer();l.putBytes(r.bytes());var u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,c=u&s.blockLength-1;l.putBytes(B0.substr(0,s.blockLength-c));for(var d,h,f=s.fullMessageLength[0]*8,g=0;g<s.fullMessageLength.length-1;++g)d=s.fullMessageLength[g+1]*8,h=d/4294967296>>>0,f+=h,l.putInt32(f>>>0),f=d>>>0;l.putInt32(f);for(var p=new Array(n.length),g=0;g<n.length;++g)p[g]=n[g].slice(0);k1(p,i,l);var m=It.util.createBuffer(),b;e==="SHA-512"?b=p.length:e==="SHA-384"?b=p.length-2:b=p.length-4;for(var g=0;g<b;++g)m.putInt32(p[g][0]),(g!==b-1||e!=="SHA-512/224")&&m.putInt32(p[g][1]);return m},s};var B0=null,HC=!1,$0=null,Ua=null;function IR(){B0="€",B0+=It.util.fillString("\0",128),$0=[[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]],Ua={},Ua["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Ua["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Ua["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Ua["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],HC=!0}function k1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v,x,C,E,w,B,y,S,D,A,T,F,k,P,$,R,O,j,V,W,U=n.length();U>=128;){for(P=0;P<16;++P)t[P][0]=n.getInt32()>>>0,t[P][1]=n.getInt32()>>>0;for(;P<80;++P)O=t[P-2],$=O[0],R=O[1],r=(($>>>19|R<<13)^(R>>>29|$<<3)^$>>>6)>>>0,i=(($<<13|R>>>19)^(R<<3|$>>>29)^($<<26|R>>>6))>>>0,V=t[P-15],$=V[0],R=V[1],a=(($>>>1|R<<31)^($>>>8|R<<24)^$>>>7)>>>0,o=(($<<31|R>>>1)^($<<24|R>>>8)^($<<25|R>>>7))>>>0,j=t[P-7],W=t[P-16],R=i+j[1]+o+W[1],t[P][0]=r+j[0]+a+W[0]+(R/4294967296>>>0)>>>0,t[P][1]=R>>>0;for(p=e[0][0],m=e[0][1],b=e[1][0],v=e[1][1],x=e[2][0],C=e[2][1],E=e[3][0],w=e[3][1],B=e[4][0],y=e[4][1],S=e[5][0],D=e[5][1],A=e[6][0],T=e[6][1],F=e[7][0],k=e[7][1],P=0;P<80;++P)u=((B>>>14|y<<18)^(B>>>18|y<<14)^(y>>>9|B<<23))>>>0,c=((B<<18|y>>>14)^(B<<14|y>>>18)^(y<<23|B>>>9))>>>0,d=(A^B&(S^A))>>>0,h=(T^y&(D^T))>>>0,s=((p>>>28|m<<4)^(m>>>2|p<<30)^(m>>>7|p<<25))>>>0,l=((p<<4|m>>>28)^(m<<30|p>>>2)^(m<<25|p>>>7))>>>0,f=(p&b|x&(p^b))>>>0,g=(m&v|C&(m^v))>>>0,R=k+c+h+$0[P][1]+t[P][1],r=F+u+d+$0[P][0]+t[P][0]+(R/4294967296>>>0)>>>0,i=R>>>0,R=l+g,a=s+f+(R/4294967296>>>0)>>>0,o=R>>>0,F=A,k=T,A=S,T=D,S=B,D=y,R=w+i,B=E+r+(R/4294967296>>>0)>>>0,y=R>>>0,E=x,w=C,x=b,C=v,b=p,v=m,R=i+o,p=r+a+(R/4294967296>>>0)>>>0,m=R>>>0;R=e[0][1]+m,e[0][0]=e[0][0]+p+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+v,e[1][0]=e[1][0]+b+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+C,e[2][0]=e[2][0]+x+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+w,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+y,e[4][0]=e[4][0]+B+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+D,e[5][0]=e[5][0]+S+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+T,e[6][0]=e[6][0]+A+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+k,e[7][0]=e[7][0]+F+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,U-=128}}var cp={},_R=ze,nn=_R.asn1;cp.privateKeyValidator={name:"PrivateKeyInfo",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:nn.Class.UNIVERSAL,type:nn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:nn.Class.UNIVERSAL,type:nn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:nn.Class.UNIVERSAL,type:nn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};cp.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:nn.Class.UNIVERSAL,type:nn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:nn.Class.UNIVERSAL,type:nn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var gn=ze,jC=cp,DR=jC.publicKeyValidator,AR=jC.privateKeyValidator;if(typeof TR>"u")var TR=gn.jsbn.BigInteger;var k0=gn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;gn.pki=gn.pki||{};gn.pki.ed25519=gn.ed25519=gn.ed25519||{};var Ze=gn.ed25519;Ze.constants={};Ze.constants.PUBLIC_KEY_BYTE_LENGTH=32;Ze.constants.PRIVATE_KEY_BYTE_LENGTH=64;Ze.constants.SEED_BYTE_LENGTH=32;Ze.constants.SIGN_BYTE_LENGTH=64;Ze.constants.HASH_BYTE_LENGTH=64;Ze.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=gn.random.getBytesSync(Ze.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==Ze.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ze.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Oi({message:t,encoding:"binary"});for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=new Hn(Ze.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)r[i]=t[i];return kR(n,r),{publicKey:n,privateKey:r}};Ze.privateKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,AR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.privateKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.privateKey,l=Oi({message:gn.asn1.fromDer(s).value,encoding:"binary"});return{privateKeyBytes:l}};Ze.publicKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,DR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.publicKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.ed25519PublicKey;if(s.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Oi({message:s,encoding:"binary"})};Ze.publicKeyFromPrivateKey=function(e){e=e||{};var t=Oi({message:e.privateKey,encoding:"binary"});if(t.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<n.length;++r)n[r]=t[32+r];return n};Ze.sign=function(e){e=e||{};var t=Oi(e),n=Oi({message:e.privateKey,encoding:"binary"});if(n.length===Ze.constants.SEED_BYTE_LENGTH){var r=Ze.generateKeyPair({seed:n});n=r.privateKey}else if(n.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.SEED_BYTE_LENGTH+" or "+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length);PR(i,t,t.length,n);for(var a=new Hn(Ze.constants.SIGN_BYTE_LENGTH),o=0;o<a.length;++o)a[o]=i[o];return a};Ze.verify=function(e){e=e||{};var t=Oi(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var n=Oi({message:e.signature,encoding:"binary"});if(n.length!==Ze.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Ze.constants.SIGN_BYTE_LENGTH);var r=Oi({message:e.publicKey,encoding:"binary"});if(r.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Ze.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),a=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),o;for(o=0;o<Ze.constants.SIGN_BYTE_LENGTH;++o)i[o]=n[o];for(o=0;o<t.length;++o)i[o+Ze.constants.SIGN_BYTE_LENGTH]=t[o];return FR(a,i,i.length,r)>=0};function Oi(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Hn)return t;var n=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),n="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,n);t=new k0(t,n)}else if(!(t instanceof k0))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 r=new Hn(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}var P0=ke(),id=ke([1]),RR=ke([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),BR=ke([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),P1=ke([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),F1=ke([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),qf=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]),$R=ke([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function dl(e,t){var n=gn.md.sha512.create(),r=new k0(e);n.update(r.getBytes(t),"binary");var i=n.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(i,"binary");for(var a=new Hn(Ze.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)a[o]=i.charCodeAt(o);return a}function kR(e,t){var n=[ke(),ke(),ke(),ke()],r,i=dl(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,fp(n,i),dp(e,n),r=0;r<32;++r)t[r+32]=e[r];return 0}function PR(e,t,n,r){var i,a,o=new Float64Array(64),s=[ke(),ke(),ke(),ke()],l=dl(r,32);l[0]&=248,l[31]&=127,l[31]|=64;var u=n+64;for(i=0;i<n;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=l[32+i];var c=dl(e.subarray(32),n+32);for(F0(c),fp(s,c),dp(e,s),i=32;i<64;++i)e[i]=r[i];var d=dl(e,n+64);for(F0(d),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=c[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=d[i]*l[a];return WC(e.subarray(32),o),u}function FR(e,t,n,r){var i,a,o=new Hn(32),s=[ke(),ke(),ke(),ke()],l=[ke(),ke(),ke(),ke()];if(a=-1,n<64||NR(l,r))return-1;for(i=0;i<n;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var u=dl(e,n);if(F0(u),UC(s,l,u),fp(l,t.subarray(32)),N0(s,l),dp(o,s),n-=64,zC(t,0,o,0)){for(i=0;i<n;++i)e[i]=0;return-1}for(i=0;i<n;++i)e[i]=t[i+64];return a=n,a}function WC(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*qf[i-(r-32)],n=t[i]+128>>8,t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;++i)t[i]+=n-(t[31]>>4)*qf[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=n*qf[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function F0(e){for(var t=new Float64Array(64),n=0;n<64;++n)t[n]=e[n],e[n]=0;WC(e,t)}function N0(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke(),u=ke(),c=ke();Yo(n,e[1],e[0]),Yo(c,t[1],t[0]),vt(n,n,c),Go(r,e[0],e[1]),Go(c,t[0],t[1]),vt(r,r,c),vt(i,e[3],t[3]),vt(i,i,BR),vt(a,e[2],t[2]),Go(a,a,a),Yo(o,r,n),Yo(s,a,i),Go(l,a,i),Go(u,r,n),vt(e[0],o,s),vt(e[1],u,l),vt(e[2],l,s),vt(e[3],o,u)}function N1(e,t,n){for(var r=0;r<4;++r)XC(e[r],t[r],n)}function dp(e,t){var n=ke(),r=ke(),i=ke();VR(i,t[2]),vt(n,t[0],i),vt(r,t[1],i),ad(e,r),e[31]^=GC(n)<<7}function ad(e,t){var n,r,i,a=ke(),o=ke();for(n=0;n<16;++n)o[n]=t[n];for(Qf(o),Qf(o),Qf(o),r=0;r<2;++r){for(a[0]=o[0]-65517,n=1;n<15;++n)a[n]=o[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,XC(o,a,1-i)}for(n=0;n<16;n++)e[2*n]=o[n]&255,e[2*n+1]=o[n]>>8}function NR(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke();return sa(e[2],id),MR(e[1],t),Xa(i,e[1]),vt(a,i,RR),Yo(i,i,e[2]),Go(a,e[2],a),Xa(o,a),Xa(s,o),vt(l,s,o),vt(n,l,i),vt(n,n,a),LR(n,n),vt(n,n,i),vt(n,n,a),vt(n,n,a),vt(e[0],n,a),Xa(r,e[0]),vt(r,r,a),M1(r,i)&&vt(e[0],e[0],$R),Xa(r,e[0]),vt(r,r,a),M1(r,i)?-1:(GC(e[0])===t[31]>>7&&Yo(e[0],P0,e[0]),vt(e[3],e[0],e[1]),0)}function MR(e,t){var n;for(n=0;n<16;++n)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function LR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)Xa(n,n),r!==1&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function M1(e,t){var n=new Hn(32),r=new Hn(32);return ad(n,e),ad(r,t),zC(n,0,r,0)}function zC(e,t,n,r){return OR(e,t,n,r,32)}function OR(e,t,n,r,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function GC(e){var t=new Hn(32);return ad(t,e),t[0]&1}function UC(e,t,n){var r,i;for(sa(e[0],P0),sa(e[1],id),sa(e[2],id),sa(e[3],P0),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,N1(e,t,r),N0(t,e),N0(e,e),N1(e,t,r)}function fp(e,t){var n=[ke(),ke(),ke(),ke()];sa(n[0],P1),sa(n[1],F1),sa(n[2],id),vt(n[3],P1,F1),UC(e,n,t)}function sa(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function VR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)Xa(n,n),r!==2&&r!==4&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function Qf(e){var t,n,r=1;for(t=0;t<16;++t)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function XC(e,t,n){for(var r,i=~(n-1),a=0;a<16;++a)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function ke(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;++t)n[t]=e[t];return n}function Go(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]+n[r]}function Yo(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]-n[r]}function Xa(e,t){vt(e,t,t)}function vt(e,t,n){var r,i,a=0,o=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,g=0,p=0,m=0,b=0,v=0,x=0,C=0,E=0,w=0,B=0,y=0,S=0,D=0,A=0,T=0,F=0,k=0,P=0,$=0,R=0,O=0,j=0,V=n[0],W=n[1],U=n[2],K=n[3],ee=n[4],z=n[5],H=n[6],X=n[7],te=n[8],ie=n[9],le=n[10],ce=n[11],Q=n[12],be=n[13],Ce=n[14],Se=n[15];r=t[0],a+=r*V,o+=r*W,s+=r*U,l+=r*K,u+=r*ee,c+=r*z,d+=r*H,h+=r*X,f+=r*te,g+=r*ie,p+=r*le,m+=r*ce,b+=r*Q,v+=r*be,x+=r*Ce,C+=r*Se,r=t[1],o+=r*V,s+=r*W,l+=r*U,u+=r*K,c+=r*ee,d+=r*z,h+=r*H,f+=r*X,g+=r*te,p+=r*ie,m+=r*le,b+=r*ce,v+=r*Q,x+=r*be,C+=r*Ce,E+=r*Se,r=t[2],s+=r*V,l+=r*W,u+=r*U,c+=r*K,d+=r*ee,h+=r*z,f+=r*H,g+=r*X,p+=r*te,m+=r*ie,b+=r*le,v+=r*ce,x+=r*Q,C+=r*be,E+=r*Ce,w+=r*Se,r=t[3],l+=r*V,u+=r*W,c+=r*U,d+=r*K,h+=r*ee,f+=r*z,g+=r*H,p+=r*X,m+=r*te,b+=r*ie,v+=r*le,x+=r*ce,C+=r*Q,E+=r*be,w+=r*Ce,B+=r*Se,r=t[4],u+=r*V,c+=r*W,d+=r*U,h+=r*K,f+=r*ee,g+=r*z,p+=r*H,m+=r*X,b+=r*te,v+=r*ie,x+=r*le,C+=r*ce,E+=r*Q,w+=r*be,B+=r*Ce,y+=r*Se,r=t[5],c+=r*V,d+=r*W,h+=r*U,f+=r*K,g+=r*ee,p+=r*z,m+=r*H,b+=r*X,v+=r*te,x+=r*ie,C+=r*le,E+=r*ce,w+=r*Q,B+=r*be,y+=r*Ce,S+=r*Se,r=t[6],d+=r*V,h+=r*W,f+=r*U,g+=r*K,p+=r*ee,m+=r*z,b+=r*H,v+=r*X,x+=r*te,C+=r*ie,E+=r*le,w+=r*ce,B+=r*Q,y+=r*be,S+=r*Ce,D+=r*Se,r=t[7],h+=r*V,f+=r*W,g+=r*U,p+=r*K,m+=r*ee,b+=r*z,v+=r*H,x+=r*X,C+=r*te,E+=r*ie,w+=r*le,B+=r*ce,y+=r*Q,S+=r*be,D+=r*Ce,A+=r*Se,r=t[8],f+=r*V,g+=r*W,p+=r*U,m+=r*K,b+=r*ee,v+=r*z,x+=r*H,C+=r*X,E+=r*te,w+=r*ie,B+=r*le,y+=r*ce,S+=r*Q,D+=r*be,A+=r*Ce,T+=r*Se,r=t[9],g+=r*V,p+=r*W,m+=r*U,b+=r*K,v+=r*ee,x+=r*z,C+=r*H,E+=r*X,w+=r*te,B+=r*ie,y+=r*le,S+=r*ce,D+=r*Q,A+=r*be,T+=r*Ce,F+=r*Se,r=t[10],p+=r*V,m+=r*W,b+=r*U,v+=r*K,x+=r*ee,C+=r*z,E+=r*H,w+=r*X,B+=r*te,y+=r*ie,S+=r*le,D+=r*ce,A+=r*Q,T+=r*be,F+=r*Ce,k+=r*Se,r=t[11],m+=r*V,b+=r*W,v+=r*U,x+=r*K,C+=r*ee,E+=r*z,w+=r*H,B+=r*X,y+=r*te,S+=r*ie,D+=r*le,A+=r*ce,T+=r*Q,F+=r*be,k+=r*Ce,P+=r*Se,r=t[12],b+=r*V,v+=r*W,x+=r*U,C+=r*K,E+=r*ee,w+=r*z,B+=r*H,y+=r*X,S+=r*te,D+=r*ie,A+=r*le,T+=r*ce,F+=r*Q,k+=r*be,P+=r*Ce,$+=r*Se,r=t[13],v+=r*V,x+=r*W,C+=r*U,E+=r*K,w+=r*ee,B+=r*z,y+=r*H,S+=r*X,D+=r*te,A+=r*ie,T+=r*le,F+=r*ce,k+=r*Q,P+=r*be,$+=r*Ce,R+=r*Se,r=t[14],x+=r*V,C+=r*W,E+=r*U,w+=r*K,B+=r*ee,y+=r*z,S+=r*H,D+=r*X,A+=r*te,T+=r*ie,F+=r*le,k+=r*ce,P+=r*Q,$+=r*be,R+=r*Ce,O+=r*Se,r=t[15],C+=r*V,E+=r*W,w+=r*U,B+=r*K,y+=r*ee,S+=r*z,D+=r*H,A+=r*X,T+=r*te,F+=r*ie,k+=r*le,P+=r*ce,$+=r*Q,R+=r*be,O+=r*Ce,j+=r*Se,a+=38*E,o+=38*w,s+=38*B,l+=38*y,u+=38*S,c+=38*D,d+=38*A,h+=38*T,f+=38*F,g+=38*k,p+=38*P,m+=38*$,b+=38*R,v+=38*O,x+=38*j,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=l,e[4]=u,e[5]=c,e[6]=d,e[7]=h,e[8]=f,e[9]=g,e[10]=p,e[11]=m,e[12]=b,e[13]=v,e[14]=x,e[15]=C}var Jn=ze;Jn.kem=Jn.kem||{};var L1=Jn.jsbn.BigInteger;Jn.kem.rsa={};Jn.kem.rsa.create=function(e,t){t=t||{};var n=t.prng||Jn.random,r={};return r.encrypt=function(i,a){var o=Math.ceil(i.n.bitLength()/8),s;do s=new L1(Jn.util.bytesToHex(n.getBytesSync(o)),16).mod(i.n);while(s.compareTo(L1.ONE)<=0);s=Jn.util.hexToBytes(s.toString(16));var l=o-s.length;l>0&&(s=Jn.util.fillString("\0",l)+s);var u=i.encrypt(s,"NONE"),c=e.generate(s,a);return{encapsulation:u,key:c}},r.decrypt=function(i,a,o){var s=i.decrypt(a,"NONE");return e.generate(s,o)},r};Jn.kem.kdf1=function(e,t){ZC(this,e,0,t||e.digestLength)};Jn.kem.kdf2=function(e,t){ZC(this,e,1,t||e.digestLength)};function ZC(e,t,n,r){e.generate=function(i,a){for(var o=new Jn.util.ByteBuffer,s=Math.ceil(a/r)+n,l=new Jn.util.ByteBuffer,u=n;u<s;++u){l.putInt32(u),t.start(),t.update(i+l.getBytes());var c=t.digest();o.putBytes(c.getBytes(r))}return o.truncate(o.length()-a),o.getBytes()}}var Je=ze;Je.log=Je.log||{};Je.log.levels=["none","error","warning","info","debug","verbose","max"];var od={},M0=[],fl=null;Je.log.LEVEL_LOCKED=2;Je.log.NO_LEVEL_CHECK=4;Je.log.INTERPOLATE=8;for(var la=0;la<Je.log.levels.length;++la){var O1=Je.log.levels[la];od[O1]={index:la,name:O1.toUpperCase()}}Je.log.logMessage=function(e){for(var t=od[e.level].index,n=0;n<M0.length;++n){var r=M0[n];if(r.flags&Je.log.NO_LEVEL_CHECK)r.f(e);else{var i=od[r.level].index;t<=i&&r.f(r,e)}}};Je.log.prepareStandard=function(e){"standard"in e||(e.standard=od[e.level].name+" ["+e.category+"] "+e.message)};Je.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=Je.util.format.apply(this,t)}};Je.log.prepareStandardFull=function(e){"standardFull"in e||(Je.log.prepareStandard(e),e.standardFull=e.standard)};for(var V1=["error","warning","info","debug","verbose"],la=0;la<V1.length;++la)(function(t){Je.log[t]=function(n,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:t,category:n,message:r,arguments:i};Je.log.logMessage(a)}})(V1[la]);Je.log.makeLogger=function(e){var t={flags:0,f:e};return Je.log.setLevel(t,"none"),t};Je.log.setLevel=function(e,t){var n=!1;if(e&&!(e.flags&Je.log.LEVEL_LOCKED))for(var r=0;r<Je.log.levels.length;++r){var i=Je.log.levels[r];if(t==i){e.level=t,n=!0;break}}return n};Je.log.lock=function(e,t){typeof t>"u"||t?e.flags|=Je.log.LEVEL_LOCKED:e.flags&=~Je.log.LEVEL_LOCKED};Je.log.addLogger=function(e){M0.push(e)};if(typeof console<"u"&&"log"in console){var Ls;if(console.error&&console.warn&&console.info&&console.debug){var HR={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},hp=function(e,t){Je.log.prepareStandard(t);var n=HR[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),n.apply(console,r)};Ls=Je.log.makeLogger(hp)}else{var hp=function(t,n){Je.log.prepareStandardFull(n),console.log(n.standardFull)};Ls=Je.log.makeLogger(hp)}Je.log.setLevel(Ls,"debug"),Je.log.addLogger(Ls),fl=Ls}else console={log:function(){}};if(fl!==null&&typeof window<"u"&&window.location){var Pu=new URL(window.location.href).searchParams;if(Pu.has("console.level")&&Je.log.setLevel(fl,Pu.get("console.level").slice(-1)[0]),Pu.has("console.lock")){var jR=Pu.get("console.lock").slice(-1)[0];jR=="true"&&Je.log.lock(fl)}}Je.log.consoleLogger=fl;var he=ze,Z=he.asn1,An=he.pkcs7=he.pkcs7||{};An.messageFromPem=function(e){var t=he.pem.decode(e)[0];if(t.type!=="PKCS7"){var n=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=Z.fromDer(t.body);return An.messageFromAsn1(r)};An.messageToPem=function(e,t){var n={type:"PKCS7",body:Z.toDer(e.toAsn1()).getBytes()};return he.pem.encode(n,{maxline:t})};An.messageFromAsn1=function(e){var t={},n=[];if(!Z.validate(e,An.asn1.contentInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=n,r}var i=Z.derToOid(t.contentType),a;switch(i){case he.pki.oids.envelopedData:a=An.createEnvelopedData();break;case he.pki.oids.encryptedData:a=An.createEncryptedData();break;case he.pki.oids.signedData:a=An.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+i+" is not (yet) supported.")}return a.fromAsn1(t.content.value[0]),a};An.createSignedData=function(){var e=null;return e={type:he.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(gp(e,r,An.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var i=e.rawCapture.certificates.value,a=0;a<i.length;++a)e.certificates.push(he.pki.certificateFromAsn1(i[a]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],i=0;i<e.certificates.length;++i)r.push(he.pki.certificateToAsn1(e.certificates[i]));var a=[],o=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,r)),a.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.signerInfos)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),o])},addSigner:function(r){var i=r.issuer,a=r.serialNumber;if(r.certificate){var o=r.certificate;typeof o=="string"&&(o=he.pki.certificateFromPem(o)),i=o.issuer.attributes,a=o.serialNumber}var s=r.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof s=="string"&&(s=he.pki.privateKeyFromPem(s));var l=r.digestAlgorithm||he.pki.oids.sha1;switch(l){case he.pki.oids.sha1:case he.pki.oids.sha256:case he.pki.oids.sha384:case he.pki.oids.sha512:case he.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var u=r.authenticatedAttributes||[];if(u.length>0){for(var c=!1,d=!1,h=0;h<u.length;++h){var f=u[h];if(!c&&f.type===he.pki.oids.contentType){if(c=!0,d)break;continue}if(!d&&f.type===he.pki.oids.messageDigest){if(d=!0,c)break;continue}}if(!c||!d)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.")}e.signers.push({key:s,version:1,issuer:i,serialNumber:a,digestAlgorithm:l,signatureAlgorithm:he.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes())]),"content"in e)){var i;e.content instanceof he.util.ByteBuffer?i=e.content.bytes():typeof e.content=="string"&&(i=he.util.encodeUtf8(e.content)),r.detached?e.detachedContent=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i):e.contentInfo.value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i)]))}if(e.signers.length!==0){var a=t();n(a)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=he.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},i=0;i<e.signers.length;++i){var a=e.signers[i],o=a.digestAlgorithm;o in r||(r[o]=he.md[he.pki.oids[o]].create()),a.authenticatedAttributes.length===0?a.md=r[o]:a.md=he.md[he.pki.oids[o]].create()}e.digestAlgorithmIdentifiers=[];for(var o in r)e.digestAlgorithmIdentifiers.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(o).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]));return r}function n(r){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=Z.derToOid(e.contentInfo.value[0].value),o=Z.toDer(i);o.getByte(),Z.getBerValueLength(o),o=o.getBytes();for(var s in r)r[s].start().update(o);for(var l=new Date,u=0;u<e.signers.length;++u){var c=e.signers[u];if(c.authenticatedAttributes.length===0){if(a!==he.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{c.authenticatedAttributesAsn1=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[]),h=0;h<c.authenticatedAttributes.length;++h){var f=c.authenticatedAttributes[h];f.type===he.pki.oids.messageDigest?f.value=r[c.digestAlgorithm].digest():f.type===he.pki.oids.signingTime&&(f.value||(f.value=l)),d.value.push(L0(f)),c.authenticatedAttributesAsn1.value.push(L0(f))}o=Z.toDer(d).getBytes(),c.md.start().update(o)}c.signature=c.key.sign(c.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=ZR(e.signers)}};An.createEncryptedData=function(){var e=null;return e={type:he.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){gp(e,t,An.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),YC(e)}},e};An.createEnvelopedData=function(){var e=null;return e={type:he.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){var n=gp(e,t,An.asn1.envelopedDataValidator);e.recipients=GR(n.recipientInfos.value)},toAsn1:function(){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,UR(e.recipients)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,YR(e.encryptedContent))])])])},findRecipient:function(t){for(var n=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===n.length){for(var o=!0,s=0;s<n.length;++s)if(a[s].type!==n[s].type||a[s].value!==n[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,n){if(e.encryptedContent.key===void 0&&t!==void 0&&n!==void 0)switch(t.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:case he.pki.oids.desCBC:var r=n.decrypt(t.encryptedContent.content);e.encryptedContent.key=he.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}YC(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:he.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,n){if(e.encryptedContent.content===void 0){n=n||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,i,a;switch(n){case he.pki.oids["aes128-CBC"]:r=16,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes192-CBC"]:r=24,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes256-CBC"]:r=32,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["des-EDE3-CBC"]:r=24,i=8,a=he.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+n)}if(t===void 0)t=he.util.createBuffer(he.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=n,e.encryptedContent.key=t,e.encryptedContent.parameter=he.util.createBuffer(he.random.getBytes(i));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var s=0;s<e.recipients.length;++s){var l=e.recipients[s];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}}},e};function WR(e){var t={},n=[];if(!Z.validate(e,An.asn1.recipientInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=n,r}return{version:t.version.charCodeAt(0),issuer:he.pki.RDNAttributesAsArray(t.issuer),serialNumber:he.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:Z.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function zR(e){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.encryptedContent.algorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]),Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function GR(e){for(var t=[],n=0;n<e.length;++n)t.push(WR(e[n]));return t}function UR(e){for(var t=[],n=0;n<e.length;++n)t.push(zR(e[n]));return t}function XR(e){var t=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.digestAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.signatureAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var i=e.unauthenticatedAttributes[r];n.values.push(L0(i))}t.value.push(n)}return t}function ZR(e){for(var t=[],n=0;n<e.length;++n)t.push(XR(e[n]));return t}function L0(e){var t;if(e.type===he.pki.oids.contentType)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.value).getBytes());else if(e.type===he.pki.oids.messageDigest)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===he.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),i=e.value;if(typeof i=="string"){var a=Date.parse(i);isNaN(a)?i.length===13?i=Z.utcTimeToDate(i):i=Z.generalizedTimeToDate(i):i=new Date(a)}i>=n&&i<r?t=Z.create(Z.Class.UNIVERSAL,Z.Type.UTCTIME,!1,Z.dateToUtcTime(i)):t=Z.create(Z.Class.UNIVERSAL,Z.Type.GENERALIZEDTIME,!1,Z.dateToGeneralizedTime(i))}return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[t])])}function YR(e){return[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.algorithm).getBytes()),e.parameter?Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.content.getBytes())])]}function gp(e,t,n){var r={},i=[];if(!Z.validate(t,n,r,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}var o=Z.derToOid(r.contentType);if(o!==he.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var s="";if(he.util.isArray(r.encryptedContent))for(var l=0;l<r.encryptedContent.length;++l){if(r.encryptedContent[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=r.encryptedContent[l].value}else s=r.encryptedContent;e.encryptedContent={algorithm:Z.derToOid(r.encAlgorithm),parameter:he.util.createBuffer(r.encParameter.value),content:he.util.createBuffer(s)}}if(r.content){var s="";if(he.util.isArray(r.content))for(var l=0;l<r.content.length;++l){if(r.content[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=r.content[l].value}else s=r.content;e.content=he.util.createBuffer(s)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function YC(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case he.pki.oids["aes128-CBC"]:case he.pki.oids["aes192-CBC"]:case he.pki.oids["aes256-CBC"]:t=he.aes.createDecryptionCipher(e.encryptedContent.key);break;case he.pki.oids.desCBC:case he.pki.oids["des-EDE3-CBC"]:t=he.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var zt=ze,cf=zt.ssh=zt.ssh||{};cf.privateKeyToPutty=function(e,t,n){n=n||"",t=t||"";var r="ssh-rsa",i=t===""?"none":"aes256-cbc",a="PuTTY-User-Key-File-2: "+r+`\r
14
+ `+s+t.substr(o+1),a=i-o-1,o=-1,++i}else(t[i]===" "||t[i]===" "||t[i]===",")&&(o=i);return t}function y6(e){return e.replace(/^\s+/,"")}var Tt=ze;Tt.des=Tt.des||{};Tt.des.startEncrypting=function(e,t,n,r){var i=af({key:e,output:n,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Tt.des.createEncryptionCipher=function(e,t){return af({key:e,output:null,decrypt:!1,mode:t})};Tt.des.startDecrypting=function(e,t,n,r){var i=af({key:e,output:n,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return i.start(t),i};Tt.des.createDecryptionCipher=function(e,t){return af({key:e,output:null,decrypt:!0,mode:t})};Tt.des.Algorithm=function(e,t){var n=this;n.name=e,n.mode=new t({blockSize:8,cipher:{encrypt:function(r,i){return y1(n._keys,r,i,!1)},decrypt:function(r,i){return y1(n._keys,r,i,!0)}}}),n._init=!1};Tt.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Tt.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=A6(t),this._init=!0}};gi("DES-ECB",Tt.cipher.modes.ecb);gi("DES-CBC",Tt.cipher.modes.cbc);gi("DES-CFB",Tt.cipher.modes.cfb);gi("DES-OFB",Tt.cipher.modes.ofb);gi("DES-CTR",Tt.cipher.modes.ctr);gi("3DES-ECB",Tt.cipher.modes.ecb);gi("3DES-CBC",Tt.cipher.modes.cbc);gi("3DES-CFB",Tt.cipher.modes.cfb);gi("3DES-OFB",Tt.cipher.modes.ofb);gi("3DES-CTR",Tt.cipher.modes.ctr);function gi(e,t){var n=function(){return new Tt.des.Algorithm(e,t)};Tt.cipher.registerAlgorithm(e,n)}var x6=[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],C6=[-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],E6=[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],S6=[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],w6=[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],I6=[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],_6=[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],D6=[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 A6(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[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],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],c=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],f=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],p=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,x,C=0;C<p;C++){var E=e.getInt32(),w=e.getInt32();x=(E>>>4^w)&252645135,w^=x,E^=x<<4,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>2^w)&858993459,w^=x,E^=x<<2,x=(w>>>-16^E)&65535,E^=x,w^=x<<-16,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=(w>>>8^E)&16711935,E^=x,w^=x<<8,x=(E>>>1^w)&1431655765,w^=x,E^=x<<1,x=E<<8|w>>>20&240,E=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=x;for(var B=0;B<b.length;++B){b[B]?(E=E<<2|E>>>26,w=w<<2|w>>>26):(E=E<<1|E>>>27,w=w<<1|w>>>27),E&=-15,w&=-15;var y=t[E>>>28]|n[E>>>24&15]|r[E>>>20&15]|i[E>>>16&15]|a[E>>>12&15]|o[E>>>8&15]|s[E>>>4&15],S=l[w>>>28]|u[w>>>24&15]|c[w>>>20&15]|d[w>>>16&15]|h[w>>>12&15]|f[w>>>8&15]|g[w>>>4&15];x=(S>>>16^y)&65535,m[v++]=y^x,m[v++]=S^x<<16}}return m}function y1(e,t,n,r){var i=e.length===32?3:9,a;i===3?a=r?[30,-2,-2]:[0,32,2]:a=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var o,s=t[0],l=t[1];o=(s>>>4^l)&252645135,l^=o,s^=o<<4,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,s=s<<1|s>>>31,l=l<<1|l>>>31;for(var u=0;u<i;u+=3){for(var c=a[u+1],d=a[u+2],h=a[u];h!=c;h+=d){var f=l^e[h],g=(l>>>4|l<<28)^e[h+1];o=s,s=l,l=o^(C6[f>>>24&63]|S6[f>>>16&63]|I6[f>>>8&63]|D6[f&63]|x6[g>>>24&63]|E6[g>>>16&63]|w6[g>>>8&63]|_6[g&63])}o=s,s=l,l=o}s=s>>>1|s<<31,l=l>>>1|l<<31,o=(s>>>1^l)&1431655765,l^=o,s^=o<<1,o=(l>>>8^s)&16711935,s^=o,l^=o<<8,o=(l>>>2^s)&858993459,s^=o,l^=o<<2,o=(s>>>16^l)&65535,l^=o,s^=o<<16,o=(s>>>4^l)&252645135,l^=o,s^=o<<4,n[0]=s,n[1]=l}function af(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),n="DES-"+t,r;e.decrypt?r=Tt.cipher.createDecipher(n,e.key):r=Tt.cipher.createCipher(n,e.key);var i=r.start;return r.start=function(a,o){var s=null;o instanceof Tt.util.ByteBuffer&&(s=o,o={}),o=o||{},o.output=s,o.iv=a,i.call(r,o)},r}const T6={},R6=Object.freeze(Object.defineProperty({__proto__:null,default:T6},Symbol.toStringTag,{value:"Module"})),np=s6(R6);var _n=ze,B6=_n.pkcs5=_n.pkcs5||{},wi;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(wi=np);_n.pbkdf2=B6.pbkdf2=function(e,t,n,r,i,a){if(typeof i=="function"&&(a=i,i=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&wi.pbkdf2&&(i===null||typeof i!="object")&&(wi.pbkdf2Sync.length>4||!i||i==="sha1"))return typeof i!="string"&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?wi.pbkdf2Sync.length===4?wi.pbkdf2(e,t,n,r,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):wi.pbkdf2(e,t,n,r,i,function(x,C){if(x)return a(x);a(null,C.toString("binary"))}):wi.pbkdf2Sync.length===4?wi.pbkdf2Sync(e,t,n,r).toString("binary"):wi.pbkdf2Sync(e,t,n,r,i).toString("binary");if((typeof i>"u"||i===null)&&(i="sha1"),typeof i=="string"){if(!(i in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=_n.md[i].create()}var o=i.digestLength;if(r>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var l=Math.ceil(r/o),u=r-(l-1)*o,c=_n.hmac.create();c.start(i,e);var d="",h,f,g;if(!a){for(var p=1;p<=l;++p){c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes();for(var m=2;m<=n;++m)c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f;d+=p<l?h:h.substr(0,u)}return d}var p=1,m;function b(){if(p>l)return a(null,d);c.start(null,null),c.update(t),c.update(_n.util.int32ToBytes(p)),h=g=c.digest().getBytes(),m=2,v()}function v(){if(m<=n)return c.start(null,null),c.update(g),f=c.digest().getBytes(),h=_n.util.xorBytes(h,f,o),g=f,++m,_n.util.setImmediate(v);d+=p<l?h:h.substr(0,u),++p,b()}b()};var ei=ze,hC=ei.sha256=ei.sha256||{};ei.md.sha256=ei.md.algorithms.sha256=hC;hC.create=function(){gC||$6();var e=null,t=ei.util.createBuffer(),n=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ei.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ei.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),x1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ei.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(_0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};x1(d,n,i);var h=ei.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h.putInt32(d.h5),h.putInt32(d.h6),h.putInt32(d.h7),h},r};var _0=null,gC=!1,pC=null;function $6(){_0="€",_0+=ei.util.fillString("\0",64),pC=[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],gC=!0}function x1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v=n.length();v>=64;){for(u=0;u<16;++u)t[u]=n.getInt32();for(;u<64;++u)r=t[u-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,i=t[u-15],i=(i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=r+t[u-7]+i+t[u-16]|0;for(c=e.h0,d=e.h1,h=e.h2,f=e.h3,g=e.h4,p=e.h5,m=e.h6,b=e.h7,u=0;u<64;++u)o=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),s=m^g&(p^m),a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),l=c&d|h&(c^d),r=b+o+s+pC[u]+t[u],i=a+l,b=m,m=p,p=g,g=f+r>>>0,f=h,h=d,d=c,c=r+i>>>0;e.h0=e.h0+c|0,e.h1=e.h1+d|0,e.h2=e.h2+h|0,e.h3=e.h3+f|0,e.h4=e.h4+g|0,e.h5=e.h5+p|0,e.h6=e.h6+m|0,e.h7=e.h7+b|0,v-=64}}var Yr=ze,Ac=null;Yr.util.isNodejs&&!Yr.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Ac=np);var k6=Yr.prng=Yr.prng||{};k6.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,r=new Array(32),i=0;i<32;++i)r[i]=n.create();t.pools=r,t.pool=0,t.generate=function(u,c){if(!c)return t.generateSync(u);var d=t.plugin.cipher,h=t.plugin.increment,f=t.plugin.formatKey,g=t.plugin.formatSeed,p=Yr.util.createBuffer();t.key=null,m();function m(b){if(b)return c(b);if(p.length()>=u)return c(null,p.getBytes(u));if(t.generated>1048575&&(t.key=null),t.key===null)return Yr.util.nextTick(function(){a(m)});var v=d(t.key,t.seed);t.generated+=v.length,p.putBytes(v),t.key=f(d(t.key,h(t.seed))),t.seed=g(d(t.key,t.seed)),Yr.util.setImmediate(m)}},t.generateSync=function(u){var c=t.plugin.cipher,d=t.plugin.increment,h=t.plugin.formatKey,f=t.plugin.formatSeed;t.key=null;for(var g=Yr.util.createBuffer();g.length()<u;){t.generated>1048575&&(t.key=null),t.key===null&&o();var p=c(t.key,t.seed);t.generated+=p.length,g.putBytes(p),t.key=h(c(t.key,d(t.seed))),t.seed=f(c(t.key,t.seed))}return g.getBytes(u)};function a(u){if(t.pools[0].messageLength>=32)return s(),u();var c=32-t.pools[0].messageLength<<5;t.seedFile(c,function(d,h){if(d)return u(d);t.collect(h),s(),u()})}function o(){if(t.pools[0].messageLength>=32)return s();var u=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(u)),s()}function s(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var u=t.plugin.md.create();u.update(t.keyBytes);for(var c=1,d=0;d<32;++d)t.reseeds%c===0&&(u.update(t.pools[d].digest().getBytes()),t.pools[d].start()),c=c<<1;t.keyBytes=u.digest().getBytes(),u.start(),u.update(t.keyBytes);var h=u.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(h),t.generated=0}function l(u){var c=null,d=Yr.util.globalScope,h=d.crypto||d.msCrypto;h&&h.getRandomValues&&(c=function(E){return h.getRandomValues(E)});var f=Yr.util.createBuffer();if(c)for(;f.length()<u;){var g=Math.max(1,Math.min(u-f.length(),65536)/4),p=new Uint32Array(Math.floor(g));try{c(p);for(var m=0;m<p.length;++m)f.putInt32(p[m])}catch(E){if(!(typeof QuotaExceededError<"u"&&E instanceof QuotaExceededError))throw E}}if(f.length()<u)for(var b,v,x,C=Math.floor(Math.random()*65536);f.length()<u;){v=16807*(C&65535),b=16807*(C>>16),v+=(b&32767)<<16,v+=b>>15,v=(v&2147483647)+(v>>31),C=v&4294967295;for(var m=0;m<3;++m)x=C>>>(m<<3),x^=Math.floor(Math.random()*256),f.putByte(x&255)}return f.getBytes(u)}return Ac?(t.seedFile=function(u,c){Ac.randomBytes(u,function(d,h){if(d)return c(d);c(null,h.toString())})},t.seedFileSync=function(u){return Ac.randomBytes(u).toString()}):(t.seedFile=function(u,c){try{c(null,l(u))}catch(d){c(d)}},t.seedFileSync=l),t.collect=function(u){for(var c=u.length,d=0;d<c;++d)t.pools[t.pool].update(u.substr(d,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(u,c){for(var d="",h=0;h<c;h+=8)d+=String.fromCharCode(u>>h&255);t.collect(d)},t.registerWorker=function(u){if(u===self)t.seedFile=function(d,h){function f(g){var p=g.data;p.forge&&p.forge.prng&&(self.removeEventListener("message",f),h(p.forge.prng.err,p.forge.prng.bytes))}self.addEventListener("message",f),self.postMessage({forge:{prng:{needed:d}}})};else{var c=function(d){var h=d.data;h.forge&&h.forge.prng&&t.seedFile(h.forge.prng.needed,function(f,g){u.postMessage({forge:{prng:{err:f,bytes:g}}})})};u.addEventListener("message",c)}},t};var en=ze;(function(){if(en.random&&en.random.getBytes){en.random;return}(function(e){var t={},n=new Array(4),r=en.util.createBuffer();t.formatKey=function(d){var h=en.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),en.aes._expandKey(d,!1)},t.formatSeed=function(d){var h=en.util.createBuffer(d);return d=new Array(4),d[0]=h.getInt32(),d[1]=h.getInt32(),d[2]=h.getInt32(),d[3]=h.getInt32(),d},t.cipher=function(d,h){return en.aes._updateBlock(d,h,n,!1),r.putInt32(n[0]),r.putInt32(n[1]),r.putInt32(n[2]),r.putInt32(n[3]),r.getBytes()},t.increment=function(d){return++d[3],d},t.md=en.md.sha256;function i(){var d=en.prng.create(t);return d.getBytes=function(h,f){return d.generate(h,f)},d.getBytesSync=function(h){return d.generate(h)},d}var a=i(),o=null,s=en.util.globalScope,l=s.crypto||s.msCrypto;if(l&&l.getRandomValues&&(o=function(d){return l.getRandomValues(d)}),en.options.usePureJavaScript||!en.util.isNodejs&&!o){if(a.collectInt(+new Date,32),typeof navigator<"u"){var u="";for(var c in navigator)try{typeof navigator[c]=="string"&&(u+=navigator[c])}catch{}a.collect(u),u=null}e&&(e().mousemove(function(d){a.collectInt(d.clientX,16),a.collectInt(d.clientY,16)}),e().keypress(function(d){a.collectInt(d.charCode,8)}))}if(!en.random)en.random=a;else for(var c in a)en.random[c]=a[c];en.random.createInstance=i,en.random})(typeof jQuery<"u"?jQuery:null)})();var Vn=ze,Zf=[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],C1=[1,2,3,5],P6=function(e,t){return e<<t&65535|(e&65535)>>16-t},F6=function(e,t){return(e&65535)>>t|e<<16-t&65535};Vn.rc2=Vn.rc2||{};Vn.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Vn.util.createBuffer(e)),t=t||128;var n=e,r=e.length(),i=t,a=Math.ceil(i/8),o=255>>(i&7),s;for(s=r;s<128;s++)n.putByte(Zf[n.at(s-1)+n.at(s-r)&255]);for(n.setAt(128-a,Zf[n.at(128-a)&o]),s=127-a;s>=0;s--)n.setAt(s,Zf[n.at(s+1)^n.at(s+a)]);return n};var mC=function(e,t,n){var r=!1,i=null,a=null,o=null,s,l,u,c,d=[];for(e=Vn.rc2.expandKey(e,t),u=0;u<64;u++)d.push(e.getInt16Le());n?(s=function(g){for(u=0;u<4;u++)g[u]+=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),g[u]=P6(g[u],C1[u]),c++},l=function(g){for(u=0;u<4;u++)g[u]+=d[g[(u+3)%4]&63]}):(s=function(g){for(u=3;u>=0;u--)g[u]=F6(g[u],C1[u]),g[u]-=d[c]+(g[(u+3)%4]&g[(u+2)%4])+(~g[(u+3)%4]&g[(u+1)%4]),c--},l=function(g){for(u=3;u>=0;u--)g[u]-=d[g[(u+3)%4]&63]});var h=function(g){var p=[];for(u=0;u<4;u++){var m=i.getInt16Le();o!==null&&(n?m^=o.getInt16Le():o.putInt16Le(m)),p.push(m&65535)}c=n?0:63;for(var b=0;b<g.length;b++)for(var v=0;v<g[b][0];v++)g[b][1](p);for(u=0;u<4;u++)o!==null&&(n?o.putInt16Le(p[u]):p[u]^=o.getInt16Le()),a.putInt16Le(p[u])},f=null;return f={start:function(g,p){g&&typeof g=="string"&&(g=Vn.util.createBuffer(g)),r=!1,i=Vn.util.createBuffer(),a=p||new Vn.util.createBuffer,o=g,f.output=a},update:function(g){for(r||i.putBuffer(g);i.length()>=8;)h([[5,s],[1,l],[6,s],[1,l],[5,s]])},finish:function(g){var p=!0;if(n)if(g)p=g(8,i,!n);else{var m=i.length()===8?8:8-i.length();i.fillWithByte(m,m)}if(p&&(r=!0,f.update()),!n&&(p=i.length()===0,p))if(g)p=g(8,a,!n);else{var b=a.length(),v=a.at(b-1);v>b?p=!1:a.truncate(v)}return p}},f};Vn.rc2.startEncrypting=function(e,t,n){var r=Vn.rc2.createEncryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createEncryptionCipher=function(e,t){return mC(e,t,!0)};Vn.rc2.startDecrypting=function(e,t,n){var r=Vn.rc2.createDecryptionCipher(e,128);return r.start(t,n),r};Vn.rc2.createDecryptionCipher=function(e,t){return mC(e,t,!1)};var D0=ze;D0.jsbn=D0.jsbn||{};var ki;function oe(e,t,n){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,n):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}D0.jsbn.BigInteger=oe;function it(){return new oe(null)}function N6(e,t,n,r,i,a){for(;--a>=0;){var o=t*this.data[e++]+n.data[r]+i;i=Math.floor(o/67108864),n.data[r++]=o&67108863}return i}function M6(e,t,n,r,i,a){for(var o=t&32767,s=t>>15;--a>=0;){var l=this.data[e]&32767,u=this.data[e++]>>15,c=s*l+u*o;l=o*l+((c&32767)<<15)+n.data[r]+(i&1073741823),i=(l>>>30)+(c>>>15)+s*u+(i>>>30),n.data[r++]=l&1073741823}return i}function E1(e,t,n,r,i,a){for(var o=t&16383,s=t>>14;--a>=0;){var l=this.data[e]&16383,u=this.data[e++]>>14,c=s*l+u*o;l=o*l+((c&16383)<<14)+n.data[r]+i,i=(l>>28)+(c>>14)+s*u,n.data[r++]=l&268435455}return i}typeof navigator>"u"?(oe.prototype.am=E1,ki=28):navigator.appName=="Microsoft Internet Explorer"?(oe.prototype.am=M6,ki=30):navigator.appName!="Netscape"?(oe.prototype.am=N6,ki=26):(oe.prototype.am=E1,ki=28);oe.prototype.DB=ki;oe.prototype.DM=(1<<ki)-1;oe.prototype.DV=1<<ki;var rp=52;oe.prototype.FV=Math.pow(2,rp);oe.prototype.F1=rp-ki;oe.prototype.F2=2*ki-rp;var L6="0123456789abcdefghijklmnopqrstuvwxyz",of=new Array,As,mr;As=48;for(mr=0;mr<=9;++mr)of[As++]=mr;As=97;for(mr=10;mr<36;++mr)of[As++]=mr;As=65;for(mr=10;mr<36;++mr)of[As++]=mr;function S1(e){return L6.charAt(e)}function bC(e,t){var n=of[e.charCodeAt(t)];return n??-1}function O6(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function V6(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function oa(e){var t=it();return t.fromInt(e),t}function H6(e,t){var n;if(t==16)n=4;else if(t==8)n=3;else if(t==256)n=8;else if(t==2)n=1;else if(t==32)n=5;else if(t==4)n=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,i=!1,a=0;--r>=0;){var o=n==8?e[r]&255:bC(e,r);if(o<0){e.charAt(r)=="-"&&(i=!0);continue}i=!1,a==0?this.data[this.t++]=o:a+n>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,a+=n,a>=this.DB&&(a-=this.DB)}n==8&&e[0]&128&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&oe.ZERO.subTo(this,this)}function j6(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function W6(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var n=(1<<t)-1,r,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=S1(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=S1(r));return i?a:"0"}function z6(){var e=it();return oe.ZERO.subTo(this,e),e}function G6(){return this.s<0?this.negate():this}function U6(e){var t=this.s-e.s;if(t!=0)return t;var n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this.data[n]-e.data[n])!=0)return t;return 0}function sf(e){var t=1,n;return(n=e>>>16)!=0&&(e=n,t+=16),(n=e>>8)!=0&&(e=n,t+=8),(n=e>>4)!=0&&(e=n,t+=4),(n=e>>2)!=0&&(e=n,t+=2),(n=e>>1)!=0&&(e=n,t+=1),t}function X6(){return this.t<=0?0:this.DB*(this.t-1)+sf(this.data[this.t-1]^this.s&this.DM)}function Z6(e,t){var n;for(n=this.t-1;n>=0;--n)t.data[n+e]=this.data[n];for(n=e-1;n>=0;--n)t.data[n]=0;t.t=this.t+e,t.s=this.s}function Y6(e,t){for(var n=e;n<this.t;++n)t.data[n-e]=this.data[n];t.t=Math.max(this.t-e,0),t.s=this.s}function K6(e,t){var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,s;for(s=this.t-1;s>=0;--s)t.data[s+a+1]=this.data[s]>>r|o,o=(this.data[s]&i)<<n;for(s=a-1;s>=0;--s)t.data[s]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()}function J6(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}var r=e%this.DB,i=this.DB-r,a=(1<<r)-1;t.data[0]=this.data[n]>>r;for(var o=n+1;o<this.t;++o)t.data[o-n-1]|=(this.data[o]&a)<<i,t.data[o-n]=this.data[o]>>r;r>0&&(t.data[this.t-n-1]|=(this.s&a)<<i),t.t=this.t-n,t.clamp()}function q6(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]-e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[n++]=this.DV+r:r>0&&(t.data[n++]=r),t.t=n,t.clamp()}function Q6(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t.data[i]=0;for(i=0;i<r.t;++i)t.data[i+n.t]=n.am(0,r.data[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&oe.ZERO.subTo(t,t)}function eA(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e.data[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t.data[n],e,2*n,0,1);(e.data[n+t.t]+=t.am(n+1,2*t.data[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e.data[n+t.t]-=t.DV,e.data[n+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(n,t.data[n],e,2*n,0,1)),e.s=0,e.clamp()}function tA(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t){t!=null&&t.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=it());var a=it(),o=this.s,s=e.s,l=this.DB-sf(r.data[r.t-1]);l>0?(r.lShiftTo(l,a),i.lShiftTo(l,n)):(r.copyTo(a),i.copyTo(n));var u=a.t,c=a.data[u-1];if(c!=0){var d=c*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),h=this.FV/d,f=(1<<this.F1)/d,g=1<<this.F2,p=n.t,m=p-u,b=t??it();for(a.dlShiftTo(m,b),n.compareTo(b)>=0&&(n.data[n.t++]=1,n.subTo(b,n)),oe.ONE.dlShiftTo(u,b),b.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var v=n.data[--p]==c?this.DM:Math.floor(n.data[p]*h+(n.data[p-1]+g)*f);if((n.data[p]+=a.am(0,v,n,m,0,u))<v)for(a.dlShiftTo(m,b),n.subTo(b,n);n.data[p]<--v;)n.subTo(b,n)}t!=null&&(n.drShiftTo(u,t),o!=s&&oe.ZERO.subTo(t,t)),n.t=u,n.clamp(),l>0&&n.rShiftTo(l,n),o<0&&oe.ZERO.subTo(n,n)}}}function nA(e){var t=it();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(oe.ZERO)>0&&e.subTo(t,t),t}function Eo(e){this.m=e}function rA(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function iA(e){return e}function aA(e){e.divRemTo(this.m,null,e)}function oA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}function sA(e,t){e.squareTo(t),this.reduce(t)}Eo.prototype.convert=rA;Eo.prototype.revert=iA;Eo.prototype.reduce=aA;Eo.prototype.mulTo=oA;Eo.prototype.sqrTo=sA;function lA(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function So(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function uA(e){var t=it();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(oe.ZERO)>0&&this.m.subTo(t,t),t}function cA(e){var t=it();return e.copyTo(t),this.reduce(t),t}function dA(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=e.data[t]&32767,r=n*this.mpl+((n*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e.data[n]+=this.m.am(0,r,e,t,0,this.m.t);e.data[n]>=e.DV;)e.data[n]-=e.DV,e.data[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function fA(e,t){e.squareTo(t),this.reduce(t)}function hA(e,t,n){e.multiplyTo(t,n),this.reduce(n)}So.prototype.convert=uA;So.prototype.revert=cA;So.prototype.reduce=dA;So.prototype.mulTo=hA;So.prototype.sqrTo=fA;function gA(){return(this.t>0?this.data[0]&1:this.s)==0}function pA(e,t){if(e>4294967295||e<1)return oe.ONE;var n=it(),r=it(),i=t.convert(this),a=sf(e)-1;for(i.copyTo(n);--a>=0;)if(t.sqrTo(n,r),(e&1<<a)>0)t.mulTo(r,i,n);else{var o=n;n=r,r=o}return t.revert(n)}function mA(e,t){var n;return e<256||t.isEven()?n=new Eo(t):n=new So(t),this.exp(e,n)}oe.prototype.copyTo=O6;oe.prototype.fromInt=V6;oe.prototype.fromString=H6;oe.prototype.clamp=j6;oe.prototype.dlShiftTo=Z6;oe.prototype.drShiftTo=Y6;oe.prototype.lShiftTo=K6;oe.prototype.rShiftTo=J6;oe.prototype.subTo=q6;oe.prototype.multiplyTo=Q6;oe.prototype.squareTo=eA;oe.prototype.divRemTo=tA;oe.prototype.invDigit=lA;oe.prototype.isEven=gA;oe.prototype.exp=pA;oe.prototype.toString=W6;oe.prototype.negate=z6;oe.prototype.abs=G6;oe.prototype.compareTo=U6;oe.prototype.bitLength=X6;oe.prototype.mod=nA;oe.prototype.modPowInt=mA;oe.ZERO=oa(0);oe.ONE=oa(1);function bA(){var e=it();return this.copyTo(e),e}function vA(){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 yA(){return this.t==0?this.s:this.data[0]<<24>>24}function xA(){return this.t==0?this.s:this.data[0]<<16>>16}function CA(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function EA(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function SA(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=oa(n),i=it(),a=it(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(n+a.intValue()).toString(e).substr(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(e)+o}function wA(e,t){this.fromInt(0),t==null&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,a=0,o=0,s=0;s<e.length;++s){var l=bC(e,s);if(l<0){e.charAt(s)=="-"&&this.signum()==0&&(i=!0);continue}o=t*o+l,++a>=n&&(this.dMultiply(r),this.dAddOffset(o,0),a=0,o=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&oe.ZERO.subTo(this,this)}function IA(e,t,n){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(oe.ONE.shiftLeft(e-1),ip,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(oe.ONE.shiftLeft(e-1),this);else{var r=new Array,i=e&7;r.length=(e>>3)+1,t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function _A(){var e=this.t,t=new Array;t[0]=this.s;var n=this.DB-e*this.DB%8,r,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),r&128&&(r|=-256),i==0&&(this.s&128)!=(r&128)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t}function DA(e){return this.compareTo(e)==0}function AA(e){return this.compareTo(e)<0?this:e}function TA(e){return this.compareTo(e)>0?this:e}function RA(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n.data[r]=t(this.data[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;r<e.t;++r)n.data[r]=t(i,e.data[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()}function BA(e,t){return e&t}function $A(e){var t=it();return this.bitwiseTo(e,BA,t),t}function ip(e,t){return e|t}function kA(e){var t=it();return this.bitwiseTo(e,ip,t),t}function vC(e,t){return e^t}function PA(e){var t=it();return this.bitwiseTo(e,vC,t),t}function yC(e,t){return e&~t}function FA(e){var t=it();return this.bitwiseTo(e,yC,t),t}function NA(){for(var e=it(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function MA(e){var t=it();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function LA(e){var t=it();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function OA(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function VA(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+OA(this.data[e]);return this.s<0?this.t*this.DB:-1}function HA(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function jA(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=HA(this.data[n]^t);return e}function WA(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function zA(e,t){var n=oe.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n}function GA(e){return this.changeBit(e,ip)}function UA(e){return this.changeBit(e,yC)}function XA(e){return this.changeBit(e,vC)}function ZA(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this.data[n]+e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e.data[n],t.data[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[n++]=r:r<-1&&(t.data[n++]=this.DV+r),t.t=n,t.clamp()}function YA(e){var t=it();return this.addTo(e,t),t}function KA(e){var t=it();return this.subTo(e,t),t}function JA(e){var t=it();return this.multiplyTo(e,t),t}function qA(e){var t=it();return this.divRemTo(e,t,null),t}function QA(e){var t=it();return this.divRemTo(e,null,t),t}function eT(e){var t=it(),n=it();return this.divRemTo(e,t,n),new Array(t,n)}function tT(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function nT(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function fu(){}function xC(e){return e}function rT(e,t,n){e.multiplyTo(t,n)}function iT(e,t){e.squareTo(t)}fu.prototype.convert=xC;fu.prototype.revert=xC;fu.prototype.mulTo=rT;fu.prototype.sqrTo=iT;function aT(e){return this.exp(e,new fu)}function oT(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n.data[--r]=0;var i;for(i=n.t-this.t;r<i;++r)n.data[r+this.t]=this.am(0,e.data[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e.data[r],n,r,0,t-r);n.clamp()}function sT(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n.data[this.t+r-t]=this.am(t-r,e.data[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)}function Ts(e){this.r2=it(),this.q3=it(),oe.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function lT(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=it();return e.copyTo(t),this.reduce(t),t}function uT(e){return e}function cT(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function dT(e,t){e.squareTo(t),this.reduce(t)}function fT(e,t,n){e.multiplyTo(t,n),this.reduce(n)}Ts.prototype.convert=lT;Ts.prototype.revert=uT;Ts.prototype.reduce=cT;Ts.prototype.mulTo=fT;Ts.prototype.sqrTo=dT;function hT(e,t){var n=e.bitLength(),r,i=oa(1),a;if(n<=0)return i;n<18?r=1:n<48?r=3:n<144?r=4:n<768?r=5:r=6,n<8?a=new Eo(t):t.isEven()?a=new Ts(t):a=new So(t);var o=new Array,s=3,l=r-1,u=(1<<r)-1;if(o[1]=a.convert(this),r>1){var c=it();for(a.sqrTo(o[1],c);s<=u;)o[s]=it(),a.mulTo(c,o[s-2],o[s]),s+=2}var d=e.t-1,h,f=!0,g=it(),p;for(n=sf(e.data[d])-1;d>=0;){for(n>=l?h=e.data[d]>>n-l&u:(h=(e.data[d]&(1<<n+1)-1)<<l-n,d>0&&(h|=e.data[d-1]>>this.DB+n-l)),s=r;!(h&1);)h>>=1,--s;if((n-=s)<0&&(n+=this.DB,--d),f)o[h].copyTo(i),f=!1;else{for(;s>1;)a.sqrTo(i,g),a.sqrTo(g,i),s-=2;s>0?a.sqrTo(i,g):(p=i,i=g,g=p),a.mulTo(g,o[h],i)}for(;d>=0&&!(e.data[d]&1<<n);)a.sqrTo(i,g),p=i,i=g,g=p,--n<0&&(n=this.DB-1,--d)}return a.revert(i)}function gT(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return a>0&&n.lShiftTo(a,n),n}function pT(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(t==0)n=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this.data[r])%e;return n}function mT(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return oe.ZERO;for(var n=e.clone(),r=this.clone(),i=oa(1),a=oa(0),o=oa(0),s=oa(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),t?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(o,i),a.subTo(s,a)):(r.subTo(n,r),t&&o.subTo(i,o),s.subTo(a,s))}if(r.compareTo(oe.ONE)!=0)return oe.ZERO;if(s.compareTo(e)>=0)return s.subtract(e);if(s.signum()<0)s.addTo(e,s);else return s;return s.signum()<0?s.add(e):s}var Dr=[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],bT=(1<<26)/Dr[Dr.length-1];function vT(e){var t,n=this.abs();if(n.t==1&&n.data[0]<=Dr[Dr.length-1]){for(t=0;t<Dr.length;++t)if(n.data[0]==Dr[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<Dr.length;){for(var r=Dr[t],i=t+1;i<Dr.length&&r<bT;)r*=Dr[i++];for(r=n.modInt(r);t<i;)if(r%Dr[t++]==0)return!1}return n.millerRabin(e)}function yT(e){var t=this.subtract(oe.ONE),n=t.getLowestSetBit();if(n<=0)return!1;for(var r=t.shiftRight(n),i=xT(),a,o=0;o<e;++o){do a=new oe(this.bitLength(),i);while(a.compareTo(oe.ONE)<=0||a.compareTo(t)>=0);var s=a.modPow(r,this);if(s.compareTo(oe.ONE)!=0&&s.compareTo(t)!=0){for(var l=1;l++<n&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(oe.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}function xT(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}oe.prototype.chunkSize=CA;oe.prototype.toRadix=SA;oe.prototype.fromRadix=wA;oe.prototype.fromNumber=IA;oe.prototype.bitwiseTo=RA;oe.prototype.changeBit=zA;oe.prototype.addTo=ZA;oe.prototype.dMultiply=tT;oe.prototype.dAddOffset=nT;oe.prototype.multiplyLowerTo=oT;oe.prototype.multiplyUpperTo=sT;oe.prototype.modInt=pT;oe.prototype.millerRabin=yT;oe.prototype.clone=bA;oe.prototype.intValue=vA;oe.prototype.byteValue=yA;oe.prototype.shortValue=xA;oe.prototype.signum=EA;oe.prototype.toByteArray=_A;oe.prototype.equals=DA;oe.prototype.min=AA;oe.prototype.max=TA;oe.prototype.and=$A;oe.prototype.or=kA;oe.prototype.xor=PA;oe.prototype.andNot=FA;oe.prototype.not=NA;oe.prototype.shiftLeft=MA;oe.prototype.shiftRight=LA;oe.prototype.getLowestSetBit=VA;oe.prototype.bitCount=jA;oe.prototype.testBit=WA;oe.prototype.setBit=GA;oe.prototype.clearBit=UA;oe.prototype.flipBit=XA;oe.prototype.add=YA;oe.prototype.subtract=KA;oe.prototype.multiply=JA;oe.prototype.divide=qA;oe.prototype.remainder=QA;oe.prototype.divideAndRemainder=eT;oe.prototype.modPow=hT;oe.prototype.modInverse=mT;oe.prototype.pow=aT;oe.prototype.gcd=gT;oe.prototype.isProbablePrime=vT;var ti=ze,CC=ti.sha1=ti.sha1||{};ti.md.sha1=ti.md.algorithms.sha1=CC;CC.create=function(){EC||CT();var e=null,t=ti.util.createBuffer(),n=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var i=r.messageLengthSize/4,a=0;a<i;++a)r.fullMessageLength.push(0);return t=ti.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(i,a){a==="utf8"&&(i=ti.util.encodeUtf8(i));var o=i.length;r.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=r.fullMessageLength.length-1;s>=0;--s)r.fullMessageLength[s]+=o[1],o[1]=o[0]+(r.fullMessageLength[s]/4294967296>>>0),r.fullMessageLength[s]=r.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),w1(e,n,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var i=ti.util.createBuffer();i.putBytes(t.bytes());var a=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,o=a&r.blockLength-1;i.putBytes(A0.substr(0,r.blockLength-o));for(var s,l,u=r.fullMessageLength[0]*8,c=0;c<r.fullMessageLength.length-1;++c)s=r.fullMessageLength[c+1]*8,l=s/4294967296>>>0,u+=l,i.putInt32(u>>>0),u=s>>>0;i.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};w1(d,n,i);var h=ti.util.createBuffer();return h.putInt32(d.h0),h.putInt32(d.h1),h.putInt32(d.h2),h.putInt32(d.h3),h.putInt32(d.h4),h},r};var A0=null,EC=!1;function CT(){A0="€",A0+=ti.util.fillString("\0",64),EC=!0}function w1(e,t,n){for(var r,i,a,o,s,l,u,c,d=n.length();d>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,l=e.h4,c=0;c<16;++c)r=n.getInt32(),t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<20;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=s^a&(o^s),r=(i<<5|i>>>27)+u+l+1518500249+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<32;++c)r=t[c-3]^t[c-8]^t[c-14]^t[c-16],r=r<<1|r>>>31,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<40;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+1859775393+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<60;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a&o|s&(a^o),r=(i<<5|i>>>27)+u+l+2400959708+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;for(;c<80;++c)r=t[c-6]^t[c-16]^t[c-28]^t[c-32],r=r<<2|r>>>30,t[c]=r,u=a^o^s,r=(i<<5|i>>>27)+u+l+3395469782+r,l=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+l|0,d-=64}}var ri=ze,SC=ri.pkcs1=ri.pkcs1||{};SC.encode_rsa_oaep=function(e,t,n){var r,i,a,o;typeof n=="string"?(r=n,i=arguments[3]||void 0,a=arguments[4]||void 0):n&&(r=n.label||void 0,i=n.seed||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md)),a?a.start():a=ri.md.sha1.create(),o||(o=a);var s=Math.ceil(e.n.bitLength()/8),l=s-2*a.digestLength-2;if(t.length>l){var u=new Error("RSAES-OAEP input message length is too long.");throw u.length=t.length,u.maxLength=l,u}r||(r=""),a.update(r,"raw");for(var c=a.digest(),d="",h=l-t.length,f=0;f<h;f++)d+="\0";var g=c.getBytes()+d+""+t;if(!i)i=ri.random.getBytes(a.digestLength);else if(i.length!==a.digestLength){var u=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw u.seedLength=i.length,u.digestLength=a.digestLength,u}var p=Qc(i,s-a.digestLength-1,o),m=ri.util.xorBytes(g,p,g.length),b=Qc(m,a.digestLength,o),v=ri.util.xorBytes(i,b,i.length);return"\0"+v+m};SC.decode_rsa_oaep=function(e,t,n){var r,i,a;typeof n=="string"?(r=n,i=arguments[3]||void 0):n&&(r=n.label||void 0,i=n.md||void 0,n.mgf1&&n.mgf1.md&&(a=n.mgf1.md));var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var m=new Error("RSAES-OAEP encoded message length is invalid.");throw m.length=t.length,m.expectedLength=o,m}if(i===void 0?i=ri.md.sha1.create():i.start(),a||(a=i),o<2*i.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),i.update(r,"raw");for(var s=i.digest().getBytes(),l=t.charAt(0),u=t.substring(1,i.digestLength+1),c=t.substring(1+i.digestLength),d=Qc(c,i.digestLength,a),h=ri.util.xorBytes(u,d,u.length),f=Qc(h,o-i.digestLength-1,a),g=ri.util.xorBytes(c,f,c.length),p=g.substring(0,i.digestLength),m=l!=="\0",b=0;b<i.digestLength;++b)m|=s.charAt(b)!==p.charAt(b);for(var v=1,x=i.digestLength,C=i.digestLength;C<g.length;C++){var E=g.charCodeAt(C),w=E&1^1,B=v?65534:0;m|=E&B,v=v&w,x+=v}if(m||g.charCodeAt(x)!==1)throw new Error("Invalid RSAES-OAEP padding.");return g.substring(x+1)};function Qc(e,t,n){n||(n=ri.md.sha1.create());for(var r="",i=Math.ceil(t/n.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255);n.start(),n.update(e+o),r+=n.digest().getBytes()}return r.substring(0,t)}var Zi=ze;(function(){if(Zi.prime){Zi.prime;return}var e=Zi.prime=Zi.prime||{},t=Zi.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var i=function(d,h){return d|h};e.generateProbablePrime=function(d,h,f){typeof h=="function"&&(f=h,h={}),h=h||{};var g=h.algorithm||"PRIMEINC";typeof g=="string"&&(g={name:g}),g.options=g.options||{};var p=h.prng||Zi.random,m={nextBytes:function(b){for(var v=p.getBytesSync(b.length),x=0;x<b.length;++x)b[x]=v.charCodeAt(x)}};if(g.name==="PRIMEINC")return a(d,m,g.options,f);throw new Error("Invalid prime generation algorithm: "+g.name)};function a(d,h,f,g){return"workers"in f?l(d,h,f,g):o(d,h,f,g)}function o(d,h,f,g){var p=u(d,h),m=0,b=c(p.bitLength());"millerRabinTests"in f&&(b=f.millerRabinTests);var v=10;"maxBlockTime"in f&&(v=f.maxBlockTime),s(p,d,h,m,b,v,g)}function s(d,h,f,g,p,m,b){var v=+new Date;do{if(d.bitLength()>h&&(d=u(h,f)),d.isProbablePrime(p))return b(null,d);d.dAddOffset(n[g++%8],0)}while(m<0||+new Date-v<m);Zi.util.setImmediate(function(){s(d,h,f,g,p,m,b)})}function l(d,h,f,g){if(typeof Worker>"u")return o(d,h,f,g);var p=u(d,h),m=f.workers,b=f.workLoad||100,v=b*30/8,x=f.workerScript||"forge/prime.worker.js";if(m===-1)return Zi.util.estimateCores(function(E,w){E&&(w=2),m=w-1,C()});C();function C(){m=Math.max(1,m);for(var E=[],w=0;w<m;++w)E[w]=new Worker(x);for(var w=0;w<m;++w)E[w].addEventListener("message",y);var B=!1;function y(S){if(!B){var D=S.data;if(D.found){for(var A=0;A<E.length;++A)E[A].terminate();return B=!0,g(null,new t(D.prime,16))}p.bitLength()>d&&(p=u(d,h));var T=p.toString(16);S.target.postMessage({hex:T,workLoad:b}),p.dAddOffset(v,0)}}}}function u(d,h){var f=new t(d,h),g=d-1;return f.testBit(g)||f.bitwiseTo(t.ONE.shiftLeft(g),i,f),f.dAddOffset(31-f.mod(r).byteValue(),0),f}function c(d){return d<=100?27:d<=150?18:d<=200?15:d<=250?12:d<=300?9:d<=350?8:d<=400?7:d<=500?6:d<=600?5:d<=800?4:d<=1250?3:2}})();var De=ze;if(typeof rt>"u")var rt=De.jsbn.BigInteger;var T0=De.util.isNodejs?np:null,J=De.asn1,br=De.util;De.pki=De.pki||{};De.pki.rsa=De.rsa=De.rsa||{};var Ve=De.pki,ET=[6,4,2,4,2,4,6,2],ST={name:"PrivateKeyInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},wT={name:"RSAPrivateKey",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},IT={name:"RSAPublicKey",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:J.Class.UNIVERSAL,type:J.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},_T=De.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:J.Class.UNIVERSAL,type:J.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},DT={name:"DigestInfo",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:J.Class.UNIVERSAL,type:J.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:J.Class.UNIVERSAL,type:J.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:J.Class.UNIVERSAL,type:J.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:J.Class.UNIVERSAL,type:J.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},AT=function(e){var t;if(e.algorithm in Ve.oids)t=Ve.oids[e.algorithm];else{var n=new Error("Unknown message digest algorithm.");throw n.algorithm=e.algorithm,n}var r=J.oidToDer(t).getBytes(),i=J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[]),a=J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[]);a.value.push(J.create(J.Class.UNIVERSAL,J.Type.OID,!1,r)),a.value.push(J.create(J.Class.UNIVERSAL,J.Type.NULL,!1,""));var o=J.create(J.Class.UNIVERSAL,J.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),J.toDer(i).getBytes()},wC=function(e,t,n){if(n)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(rt.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(rt.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new rt(De.util.bytesToHex(De.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(rt.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var i=e.mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o=o.multiply(r.modInverse(t.n)).mod(t.n),o};Ve.rsa.encrypt=function(e,t,n){var r=n,i,a=Math.ceil(t.n.bitLength()/8);n!==!1&&n!==!0?(r=n===2,i=IC(e,t,n)):(i=De.util.createBuffer(),i.putBytes(e));for(var o=new rt(i.toHex(),16),s=wC(o,t,r),l=s.toString(16),u=De.util.createBuffer(),c=a-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),u.getBytes()};Ve.rsa.decrypt=function(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new rt(De.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=wC(o,t,n),l=s.toString(16),u=De.util.createBuffer(),c=i-Math.ceil(l.length/2);c>0;)u.putByte(0),--c;return u.putBytes(De.util.hexToBytes(l)),r!==!1?ed(u.getBytes(),t,n):u.getBytes()};Ve.rsa.createKeyPairGenerationState=function(e,t,n){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,n=n||{};var r=n.prng||De.random,i={nextBytes:function(s){for(var l=r.getBytesSync(s.length),u=0;u<s.length;++u)s[u]=l.charCodeAt(u)}},a=n.algorithm||"PRIMEINC",o;if(a==="PRIMEINC")o={algorithm:a,state:0,bits:e,rng:i,eInt:t||65537,e:new rt(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},o.e.fromInt(o.eInt);else throw new Error("Invalid key generation algorithm: "+a);return o};Ve.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var n=new rt(null);n.fromInt(30);for(var r=0,i=function(d,h){return d|h},a=+new Date,o,s=0;e.keys===null&&(t<=0||s<t);){if(e.state===0){var l=e.p===null?e.pBits:e.qBits,u=l-1;e.pqState===0?(e.num=new rt(l,e.rng),e.num.testBit(u)||e.num.bitwiseTo(rt.ONE.shiftLeft(u),i,e.num),e.num.dAddOffset(31-e.num.mod(n).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(RT(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(ET[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(rt.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)}}o=+new Date,s+=o-a,a=o}return e.keys!==null};Ve.rsa.generateKeyPair=function(e,t,n,r){if(arguments.length===1?typeof e=="object"?(n=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(n=t,t=void 0):(n=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof n=="function"&&(r=n,n=void 0):(r=n,n=t,t=void 0)),n=n||{},e===void 0&&(e=n.bits||2048),t===void 0&&(t=n.e||65537),!De.options.usePureJavaScript&&!n.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(I1("generateKeyPair"))return T0.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(s,l,u){if(s)return r(s);r(null,{privateKey:Ve.privateKeyFromPem(u),publicKey:Ve.publicKeyFromPem(l)})});if(_1("generateKey")&&_1("exportKey"))return br.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(s){return br.globalScope.crypto.subtle.exportKey("pkcs8",s.privateKey)}).then(void 0,function(s){r(s)}).then(function(s){if(s){var l=Ve.privateKeyFromAsn1(J.fromDer(De.util.createBuffer(s)));r(null,{privateKey:l,publicKey:Ve.setRsaPublicKey(l.n,l.e)})}});if(D1("generateKey")&&D1("exportKey")){var i=br.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A1(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);i.oncomplete=function(s){var l=s.target.result,u=br.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);u.oncomplete=function(c){var d=c.target.result,h=Ve.privateKeyFromAsn1(J.fromDer(De.util.createBuffer(d)));r(null,{privateKey:h,publicKey:Ve.setRsaPublicKey(h.n,h.e)})},u.onerror=function(c){r(c)}},i.onerror=function(s){r(s)};return}}else if(I1("generateKeyPairSync")){var a=T0.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Ve.privateKeyFromPem(a.privateKey),publicKey:Ve.publicKeyFromPem(a.publicKey)}}}var o=Ve.rsa.createKeyPairGenerationState(e,t,n);if(!r)return Ve.rsa.stepKeyPairGenerationState(o,0),o.keys;TT(o,n,r)};Ve.setRsaPublicKey=Ve.rsa.setPublicKey=function(e,t){var n={n:e,e:t};return n.encrypt=function(r,i,a){if(typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSAES-PKCS1-V1_5"),i==="RSAES-PKCS1-V1_5")i={encode:function(s,l,u){return IC(s,l,2).getBytes()}};else if(i==="RSA-OAEP"||i==="RSAES-OAEP")i={encode:function(s,l){return De.pkcs1.encode_rsa_oaep(l,s,a)}};else if(["RAW","NONE","NULL",null].indexOf(i)!==-1)i={encode:function(s){return s}};else if(typeof i=="string")throw new Error('Unsupported encryption scheme: "'+i+'".');var o=i.encode(r,n,!0);return Ve.rsa.encrypt(o,n,!0)},n.verify=function(r,i,a,o){typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSASSA-PKCS1-V1_5"),o===void 0&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),a==="RSASSA-PKCS1-V1_5"?a={verify:function(l,u){u=ed(u,n,!0);var c=J.fromDer(u,{parseAllBytes:o._parseAllDigestBytes}),d={},h=[];if(!J.validate(c,DT,d,h)){var f=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw f.errors=h,f}var g=J.derToOid(d.algorithmIdentifier);if(!(g===De.oids.md2||g===De.oids.md5||g===De.oids.sha1||g===De.oids.sha224||g===De.oids.sha256||g===De.oids.sha384||g===De.oids.sha512||g===De.oids["sha512-224"]||g===De.oids["sha512-256"])){var f=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw f.oid=g,f}if((g===De.oids.md2||g===De.oids.md5)&&!("parameters"in d))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===d.digest}}:(a==="NONE"||a==="NULL"||a===null)&&(a={verify:function(l,u){return u=ed(u,n,!0),l===u}});var s=Ve.rsa.decrypt(i,n,!0,!1);return a.verify(r,s,n.n.bitLength())},n};Ve.setRsaPrivateKey=Ve.rsa.setPrivateKey=function(e,t,n,r,i,a,o,s){var l={n:e,e:t,d:n,p:r,q:i,dP:a,dQ:o,qInv:s};return l.decrypt=function(u,c,d){typeof c=="string"?c=c.toUpperCase():c===void 0&&(c="RSAES-PKCS1-V1_5");var h=Ve.rsa.decrypt(u,l,!1,!1);if(c==="RSAES-PKCS1-V1_5")c={decode:ed};else if(c==="RSA-OAEP"||c==="RSAES-OAEP")c={decode:function(f,g){return De.pkcs1.decode_rsa_oaep(g,f,d)}};else if(["RAW","NONE","NULL",null].indexOf(c)!==-1)c={decode:function(f){return f}};else throw new Error('Unsupported encryption scheme: "'+c+'".');return c.decode(h,l,!1)},l.sign=function(u,c){var d=!1;typeof c=="string"&&(c=c.toUpperCase()),c===void 0||c==="RSASSA-PKCS1-V1_5"?(c={encode:AT},d=1):(c==="NONE"||c==="NULL"||c===null)&&(c={encode:function(){return u}},d=1);var h=c.encode(u,l.n.bitLength());return Ve.rsa.encrypt(h,l,d)},l};Ve.wrapRsaPrivateKey=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,J.integerToDer(0).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.OID,!1,J.oidToDer(Ve.oids.rsaEncryption).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.NULL,!1,"")]),J.create(J.Class.UNIVERSAL,J.Type.OCTETSTRING,!1,J.toDer(e).getBytes())])};Ve.privateKeyFromAsn1=function(e){var t={},n=[];if(J.validate(e,ST,t,n)&&(e=J.fromDer(De.util.createBuffer(t.privateKey))),t={},n=[],!J.validate(e,wT,t,n)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=n,r}var i,a,o,s,l,u,c,d;return i=De.util.createBuffer(t.privateKeyModulus).toHex(),a=De.util.createBuffer(t.privateKeyPublicExponent).toHex(),o=De.util.createBuffer(t.privateKeyPrivateExponent).toHex(),s=De.util.createBuffer(t.privateKeyPrime1).toHex(),l=De.util.createBuffer(t.privateKeyPrime2).toHex(),u=De.util.createBuffer(t.privateKeyExponent1).toHex(),c=De.util.createBuffer(t.privateKeyExponent2).toHex(),d=De.util.createBuffer(t.privateKeyCoefficient).toHex(),Ve.setRsaPrivateKey(new rt(i,16),new rt(a,16),new rt(o,16),new rt(s,16),new rt(l,16),new rt(u,16),new rt(c,16),new rt(d,16))};Ve.privateKeyToAsn1=Ve.privateKeyToRSAPrivateKey=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,J.integerToDer(0).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.n)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.e)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.d)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.p)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.q)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.dP)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.dQ)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.qInv))])};Ve.publicKeyFromAsn1=function(e){var t={},n=[];if(J.validate(e,_T,t,n)){var r=J.derToOid(t.publicKeyOid);if(r!==Ve.oids.rsaEncryption){var i=new Error("Cannot read public key. Unknown OID.");throw i.oid=r,i}e=t.rsaPublicKey}if(n=[],!J.validate(e,IT,t,n)){var i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw i.errors=n,i}var a=De.util.createBuffer(t.publicKeyModulus).toHex(),o=De.util.createBuffer(t.publicKeyExponent).toHex();return Ve.setRsaPublicKey(new rt(a,16),new rt(o,16))};Ve.publicKeyToAsn1=Ve.publicKeyToSubjectPublicKeyInfo=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.OID,!1,J.oidToDer(Ve.oids.rsaEncryption).getBytes()),J.create(J.Class.UNIVERSAL,J.Type.NULL,!1,"")]),J.create(J.Class.UNIVERSAL,J.Type.BITSTRING,!1,[Ve.publicKeyToRSAPublicKey(e)])])};Ve.publicKeyToRSAPublicKey=function(e){return J.create(J.Class.UNIVERSAL,J.Type.SEQUENCE,!0,[J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.n)),J.create(J.Class.UNIVERSAL,J.Type.INTEGER,!1,jr(e.e))])};function IC(e,t,n){var r=De.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}r.putByte(0),r.putByte(n);var o=i-3-e.length,s;if(n===0||n===1){s=n===0?0:255;for(var l=0;l<o;++l)r.putByte(s)}else for(;o>0;){for(var u=0,c=De.random.getBytes(o),l=0;l<o;++l)s=c.charCodeAt(l),s===0?++u:r.putByte(s);o=u}return r.putByte(0),r.putBytes(e),r}function ed(e,t,n,r){var i=Math.ceil(t.n.bitLength()/8),a=De.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(o!==0||n&&s!==0&&s!==1||!n&&s!=2||n&&s===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var l=0;if(s===0){l=i-3-r;for(var u=0;u<l;++u)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(s===1)for(l=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++l}else if(s===2)for(l=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++l}var c=a.getByte();if(c!==0||l!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function TT(e,t,n){typeof t=="function"&&(n=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),i();function i(){a(e.pBits,function(s,l){if(s)return n(s);if(e.p=l,e.q!==null)return o(s,e.q);a(e.qBits,o)})}function a(s,l){De.prime.generateProbablePrime(s,r,l)}function o(s,l){if(s)return n(s);if(e.q=l,e.p.compareTo(e.q)<0){var u=e.p;e.p=e.q,e.q=u}if(e.p.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.p=null,i();return}if(e.q.subtract(rt.ONE).gcd(e.e).compareTo(rt.ONE)!==0){e.q=null,a(e.qBits,o);return}if(e.p1=e.p.subtract(rt.ONE),e.q1=e.q.subtract(rt.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(rt.ONE)!==0){e.p=e.q=null,i();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,a(e.qBits,o);return}var c=e.e.modInverse(e.phi);e.keys={privateKey:Ve.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ve.rsa.setPublicKey(e.n,e.e)},n(null,e.keys)}}function jr(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=De.util.hexToBytes(t);return n.length>1&&(n.charCodeAt(0)===0&&!(n.charCodeAt(1)&128)||n.charCodeAt(0)===255&&(n.charCodeAt(1)&128)===128)?n.substr(1):n}function RT(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function I1(e){return De.util.isNodejs&&typeof T0[e]=="function"}function _1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.crypto=="object"&&typeof br.globalScope.crypto.subtle=="object"&&typeof br.globalScope.crypto.subtle[e]=="function"}function D1(e){return typeof br.globalScope<"u"&&typeof br.globalScope.msCrypto=="object"&&typeof br.globalScope.msCrypto.subtle=="object"&&typeof br.globalScope.msCrypto.subtle[e]=="function"}function A1(e){for(var t=De.util.hexToBytes(e.toString(16)),n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}var me=ze;if(typeof BT>"u")var BT=me.jsbn.BigInteger;var ne=me.asn1,je=me.pki=me.pki||{};je.pbe=me.pbe=me.pbe||{};var ka=je.oids,$T={name:"EncryptedPrivateKeyInfo",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},kT={name:"PBES2Algorithms",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},PT={name:"pkcs-12PbeParams",tagClass:ne.Class.UNIVERSAL,type:ne.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ne.Class.UNIVERSAL,type:ne.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ne.Class.UNIVERSAL,type:ne.Type.INTEGER,constructed:!1,capture:"iterations"}]};je.encryptPrivateKeyInfo=function(e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||"aes128",n.prfAlgorithm=n.prfAlgorithm||"sha1";var r=me.random.getBytesSync(n.saltSize),i=n.count,a=ne.integerToDer(i),o,s,l;if(n.algorithm.indexOf("aes")===0||n.algorithm==="des"){var u,c,d;switch(n.algorithm){case"aes128":o=16,u=16,c=ka["aes128-CBC"],d=me.aes.createEncryptionCipher;break;case"aes192":o=24,u=16,c=ka["aes192-CBC"],d=me.aes.createEncryptionCipher;break;case"aes256":o=32,u=16,c=ka["aes256-CBC"],d=me.aes.createEncryptionCipher;break;case"des":o=8,u=8,c=ka.desCBC,d=me.des.createEncryptionCipher;break;default:var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var f="hmacWith"+n.prfAlgorithm.toUpperCase(),g=DC(f),p=me.pkcs5.pbkdf2(t,r,i,o,g),m=me.random.getBytesSync(u),b=d(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes();var v=FT(r,a,o,f);s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBES2).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka.pkcs5PBKDF2).getBytes()),v]),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(c).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,m)])])])}else if(n.algorithm==="3des"){o=24;var x=new me.util.ByteBuffer(r),p=je.pbe.generatePkcs12Key(t,x,1,i,o),m=je.pbe.generatePkcs12Key(t,x,2,i,o),b=me.des.createEncryptionCipher(p);b.start(m),b.update(ne.toDer(e)),b.finish(),l=b.output.getBytes(),s=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(ka["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,r),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,a.getBytes())])])}else{var h=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw h.algorithm=n.algorithm,h}var C=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[s,ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,l)]);return C};je.decryptPrivateKeyInfo=function(e,t){var n=null,r={},i=[];if(!ne.validate(e,$T,r,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=ne.derToOid(r.encryptionOid),s=je.pbe.getCipher(o,r.encryptionParams,t),l=me.util.createBuffer(r.encryptedData);return s.update(l),s.finish()&&(n=ne.fromDer(s.output)),n};je.encryptedPrivateKeyToPem=function(e,t){var n={type:"ENCRYPTED PRIVATE KEY",body:ne.toDer(e).getBytes()};return me.pem.encode(n,{maxline:t})};je.encryptedPrivateKeyFromPem=function(e){var t=me.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var n=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ne.fromDer(t.body)};je.encryptRsaPrivateKey=function(e,t,n){if(n=n||{},!n.legacy){var r=je.wrapRsaPrivateKey(je.privateKeyToAsn1(e));return r=je.encryptPrivateKeyInfo(r,t,n),je.encryptedPrivateKeyToPem(r)}var i,a,o,s;switch(n.algorithm){case"aes128":i="AES-128-CBC",o=16,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=me.random.getBytesSync(16),s=me.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=me.random.getBytesSync(8),s=me.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+n.algorithm+'".');throw l.algorithm=n.algorithm,l}var u=me.pbe.opensslDeriveBytes(t,a.substr(0,8),o),c=s(u);c.start(a),c.update(ne.toDer(je.privateKeyToAsn1(e))),c.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:me.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return me.pem.encode(d)};je.decryptRsaPrivateKey=function(e,t){var n=null,r=me.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw i.headerType=i,i}if(r.procType&&r.procType.type==="ENCRYPTED"){var a,o;switch(r.dekInfo.algorithm){case"DES-CBC":a=8,o=me.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,o=me.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,o=me.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,o=me.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,o=me.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,o=function(d){return me.rc2.createDecryptionCipher(d,40)};break;case"RC2-64-CBC":a=8,o=function(d){return me.rc2.createDecryptionCipher(d,64)};break;case"RC2-128-CBC":a=16,o=function(d){return me.rc2.createDecryptionCipher(d,128)};break;default:var i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw i.algorithm=r.dekInfo.algorithm,i}var s=me.util.hexToBytes(r.dekInfo.parameters),l=me.pbe.opensslDeriveBytes(t,s.substr(0,8),a),u=o(l);if(u.start(s),u.update(me.util.createBuffer(r.body)),u.finish())n=u.output.getBytes();else return n}else n=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?n=je.decryptPrivateKeyInfo(ne.fromDer(n),t):n=ne.fromDer(n),n!==null&&(n=je.privateKeyFromAsn1(n)),n};je.pbe.generatePkcs12Key=function(e,t,n,r,i,a){var o,s;if(typeof a>"u"||a===null){if(!("sha1"in me.md))throw new Error('"sha1" hash algorithm unavailable.');a=me.md.sha1.create()}var l=a.digestLength,u=a.blockLength,c=new me.util.ByteBuffer,d=new me.util.ByteBuffer;if(e!=null){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var h=d.length(),f=t.length(),g=new me.util.ByteBuffer;g.fillWithByte(n,u);var p=u*Math.ceil(f/u),m=new me.util.ByteBuffer;for(s=0;s<p;s++)m.putByte(t.at(s%f));var b=u*Math.ceil(h/u),v=new me.util.ByteBuffer;for(s=0;s<b;s++)v.putByte(d.at(s%h));var x=m;x.putBuffer(v);for(var C=Math.ceil(i/l),E=1;E<=C;E++){var w=new me.util.ByteBuffer;w.putBytes(g.bytes()),w.putBytes(x.bytes());for(var B=0;B<r;B++)a.start(),a.update(w.getBytes()),w=a.digest();var y=new me.util.ByteBuffer;for(s=0;s<u;s++)y.putByte(w.at(s%l));var S=Math.ceil(f/u)+Math.ceil(h/u),D=new me.util.ByteBuffer;for(o=0;o<S;o++){var A=new me.util.ByteBuffer(x.getBytes(u)),T=511;for(s=y.length()-1;s>=0;s--)T=T>>8,T+=y.at(s)+A.at(s),A.setAt(s,T&255);D.putBuffer(A)}x=D,c.putBuffer(w)}return c.truncate(c.length()-i),c};je.pbe.getCipher=function(e,t,n){switch(e){case je.oids.pkcs5PBES2:return je.pbe.getCipherForPBES2(e,t,n);case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case je.oids["pbewithSHAAnd40BitRC2-CBC"]:return je.pbe.getCipherForPKCS12PBE(e,t,n);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};je.pbe.getCipherForPBES2=function(e,t,n){var r={},i=[];if(!ne.validate(t,kT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}if(e=ne.derToOid(r.kdfOid),e!==je.oids.pkcs5PBKDF2){var a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw a.oid=e,a.supportedOids=["pkcs5PBKDF2"],a}if(e=ne.derToOid(r.encOid),e!==je.oids["aes128-CBC"]&&e!==je.oids["aes192-CBC"]&&e!==je.oids["aes256-CBC"]&&e!==je.oids["des-EDE3-CBC"]&&e!==je.oids.desCBC){var a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw a.oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a}var o=r.kdfSalt,s=me.util.createBuffer(r.kdfIterationCount);s=s.getInt(s.length()<<3);var l,u;switch(je.oids[e]){case"aes128-CBC":l=16,u=me.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,u=me.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,u=me.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,u=me.des.createDecryptionCipher;break;case"desCBC":l=8,u=me.des.createDecryptionCipher;break}var c=_C(r.prfOid),d=me.pkcs5.pbkdf2(n,o,s,l,c),h=r.encIv,f=u(d);return f.start(h),f};je.pbe.getCipherForPKCS12PBE=function(e,t,n){var r={},i=[];if(!ne.validate(t,PT,r,i)){var a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=me.util.createBuffer(r.salt),s=me.util.createBuffer(r.iterations);s=s.getInt(s.length()<<3);var l,u,c;switch(e){case je.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,u=8,c=me.des.startDecrypting;break;case je.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,u=8,c=function(p,m){var b=me.rc2.createDecryptionCipher(p,40);return b.start(m,null),b};break;default:var a=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw a.oid=e,a}var d=_C(r.prfOid),h=je.pbe.generatePkcs12Key(n,o,1,s,l,d);d.start();var f=je.pbe.generatePkcs12Key(n,o,2,s,u,d);return c(h,f)};je.pbe.opensslDeriveBytes=function(e,t,n,r){if(typeof r>"u"||r===null){if(!("md5"in me.md))throw new Error('"md5" hash algorithm unavailable.');r=me.md.md5.create()}t===null&&(t="");for(var i=[T1(r,e+t)],a=16,o=1;a<n;++o,a+=16)i.push(T1(r,i[o-1]+e+t));return i.join("").substr(0,n)};function T1(e,t){return e.start().update(t).digest().getBytes()}function _C(e){var t;if(!e)t="hmacWithSHA1";else if(t=je.oids[ne.derToOid(e)],!t){var n=new Error("Unsupported PRF OID.");throw n.oid=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}return DC(t)}function DC(e){var t=me.md;switch(e){case"hmacWithSHA224":t=me.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var n=new Error("Unsupported PRF algorithm.");throw n.algorithm=e,n.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],n}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function FT(e,t,n,r){var i=ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OCTETSTRING,!1,e),ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&i.value.push(ne.create(ne.Class.UNIVERSAL,ne.Type.INTEGER,!1,me.util.hexToBytes(n.toString(16))),ne.create(ne.Class.UNIVERSAL,ne.Type.SEQUENCE,!0,[ne.create(ne.Class.UNIVERSAL,ne.Type.OID,!1,ne.oidToDer(je.oids[r]).getBytes()),ne.create(ne.Class.UNIVERSAL,ne.Type.NULL,!1,"")])),i}var ds=ze,pe=ds.asn1,Rs=ds.pkcs7asn1=ds.pkcs7asn1||{};ds.pkcs7=ds.pkcs7||{};ds.pkcs7.asn1=Rs;var AC={name:"ContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Rs.contentInfoValidator=AC;var TC={name:"EncryptedContentInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Rs.envelopedDataValidator={name:"EnvelopedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(TC)};Rs.encryptedDataValidator={name:"EncryptedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"}].concat(TC)};var NT={name:"SignerInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Rs.signedDataValidator={name:"SignedData",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},AC,{name:"SignedData.Certificates",tagClass:pe.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:pe.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SET,capture:"signerInfos",optional:!0,value:[NT]}]};Rs.recipientInfoValidator={name:"RecipientInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:pe.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]};var ao=ze;ao.mgf=ao.mgf||{};var MT=ao.mgf.mgf1=ao.mgf1=ao.mgf1||{};MT.create=function(e){var t={generate:function(n,r){for(var i=new ao.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new ao.util.ByteBuffer;s.putInt32(o),e.start(),e.update(n+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}};return t};var td=ze;td.mgf=td.mgf||{};td.mgf.mgf1=td.mgf1;var Ga=ze,LT=Ga.pss=Ga.pss||{};LT.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,n=e.mgf,r=t.digestLength,i=e.salt||null;typeof i=="string"&&(i=Ga.util.createBuffer(i));var a;if("saltLength"in e)a=e.saltLength;else if(i!==null)a=i.length();else throw new Error("Salt length not specified or specific salt not given.");if(i!==null&&i.length()!==a)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||Ga.random,s={};return s.encode=function(l,u){var c,d=u-1,h=Math.ceil(d/8),f=l.digest().getBytes();if(h<r+a+2)throw new Error("Message is too long to encrypt.");var g;i===null?g=o.getBytesSync(a):g=i.bytes();var p=new Ga.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(g),t.start(),t.update(p.getBytes());var m=t.digest().getBytes(),b=new Ga.util.ByteBuffer;b.fillWithByte(0,h-a-r-2),b.putByte(1),b.putBytes(g);var v=b.getBytes(),x=h-r-1,C=n.generate(m,x),E="";for(c=0;c<x;c++)E+=String.fromCharCode(v.charCodeAt(c)^C.charCodeAt(c));var w=65280>>8*h-d&255;return E=String.fromCharCode(E.charCodeAt(0)&~w)+E.substr(1),E+m+"¼"},s.verify=function(l,u,c){var d,h=c-1,f=Math.ceil(h/8);if(u=u.substr(-f),f<r+a+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(u.charCodeAt(f-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var g=f-r-1,p=u.substr(0,g),m=u.substr(g,r),b=65280>>8*f-h&255;if(p.charCodeAt(0)&b)throw new Error("Bits beyond keysize not zero as expected.");var v=n.generate(m,g),x="";for(d=0;d<g;d++)x+=String.fromCharCode(p.charCodeAt(d)^v.charCodeAt(d));x=String.fromCharCode(x.charCodeAt(0)&~b)+x.substr(1);var C=f-r-a-2;for(d=0;d<C;d++)if(x.charCodeAt(d)!==0)throw new Error("Leftmost octets not zero as expected");if(x.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var E=x.substr(-a),w=new Ga.util.ByteBuffer;w.fillWithByte(0,8),w.putBytes(l),w.putBytes(E),t.start(),t.update(w.getBytes());var B=t.digest().getBytes();return m===B},s};var Ae=ze,N=Ae.asn1,de=Ae.pki=Ae.pki||{},nt=de.oids,Mt={};Mt.CN=nt.commonName;Mt.commonName="CN";Mt.C=nt.countryName;Mt.countryName="C";Mt.L=nt.localityName;Mt.localityName="L";Mt.ST=nt.stateOrProvinceName;Mt.stateOrProvinceName="ST";Mt.O=nt.organizationName;Mt.organizationName="O";Mt.OU=nt.organizationalUnitName;Mt.organizationalUnitName="OU";Mt.E=nt.emailAddress;Mt.emailAddress="E";var RC=Ae.pki.rsa.publicKeyValidator,OT={name:"Certificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:N.Class.UNIVERSAL,type:N.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:N.Class.UNIVERSAL,type:N.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},RC,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},VT={name:"rsapss",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:N.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:N.Class.UNIVERSAL,type:N.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:N.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:N.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:N.Class.UNIVERSAL,type:N.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},HT={name:"CertificationRequestInfo",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:N.Class.UNIVERSAL,type:N.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},RC,{name:"CertificationRequestInfo.attributes",tagClass:N.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:N.Class.UNIVERSAL,type:N.Type.SET,constructed:!0}]}]}]},jT={name:"CertificationRequest",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[HT,{name:"CertificationRequest.signatureAlgorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:N.Class.UNIVERSAL,type:N.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:N.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:N.Class.UNIVERSAL,type:N.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};de.RDNAttributesAsArray=function(e,t){for(var n=[],r,i,a,o=0;o<e.value.length;++o){r=e.value[o];for(var s=0;s<r.value.length;++s)a={},i=r.value[s],a.type=N.derToOid(i.value[0].value),a.value=i.value[1].value,a.valueTagClass=i.value[1].type,a.type in nt&&(a.name=nt[a.type],a.name in Mt&&(a.shortName=Mt[a.name])),t&&(t.update(a.type),t.update(a.value)),n.push(a)}return n};de.CRIAttributesAsArray=function(e){for(var t=[],n=0;n<e.length;++n)for(var r=e[n],i=N.derToOid(r.value[0].value),a=r.value[1].value,o=0;o<a.length;++o){var s={};if(s.type=i,s.value=a[o].value,s.valueTagClass=a[o].type,s.type in nt&&(s.name=nt[s.type],s.name in Mt&&(s.shortName=Mt[s.name])),s.type===nt.extensionRequest){s.extensions=[];for(var l=0;l<s.value.length;++l)s.extensions.push(de.certificateExtensionFromAsn1(s.value[l]))}t.push(s)}return t};function xa(e,t){typeof t=="string"&&(t={shortName:t});for(var n=null,r,i=0;n===null&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}var nd=function(e,t,n){var r={};if(e!==nt["RSASSA-PSS"])return r;n&&(r={hash:{algorithmOid:nt.sha1},mgf:{algorithmOid:nt.mgf1,hash:{algorithmOid:nt.sha1}},saltLength:20});var i={},a=[];if(!N.validate(t,VT,i,a)){var o=new Error("Cannot read RSASSA-PSS parameter block.");throw o.errors=a,o}return i.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=N.derToOid(i.hashOid)),i.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=N.derToOid(i.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=N.derToOid(i.maskGenHashOid)),i.saltLength!==void 0&&(r.saltLength=i.saltLength.charCodeAt(0)),r},lf=function(e){switch(nt[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return Ae.md.sha1.create();case"md5WithRSAEncryption":return Ae.md.md5.create();case"sha256WithRSAEncryption":return Ae.md.sha256.create();case"sha384WithRSAEncryption":return Ae.md.sha384.create();case"sha512WithRSAEncryption":return Ae.md.sha512.create();case"RSASSA-PSS":return Ae.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},BC=function(e){var t=e.certificate,n;switch(t.signatureOid){case nt.sha1WithRSAEncryption:case nt.sha1WithRSASignature:break;case nt["RSASSA-PSS"]:var r,i;if(r=nt[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported MGF hash function.");throw a.oid=t.signatureParameters.mgf.hash.algorithmOid,a.name=r,a}if(i=nt[t.signatureParameters.mgf.algorithmOid],i===void 0||Ae.mgf[i]===void 0){var a=new Error("Unsupported MGF function.");throw a.oid=t.signatureParameters.mgf.algorithmOid,a.name=i,a}if(i=Ae.mgf[i].create(Ae.md[r].create()),r=nt[t.signatureParameters.hash.algorithmOid],r===void 0||Ae.md[r]===void 0){var a=new Error("Unsupported RSASSA-PSS hash function.");throw a.oid=t.signatureParameters.hash.algorithmOid,a.name=r,a}n=Ae.pss.create(Ae.md[r].create(),i,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,n)};de.certificateFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificateFromAsn1(a,t)};de.certificateToPem=function(e,t){var n={type:"CERTIFICATE",body:N.toDer(de.certificateToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyFromPem=function(e){var t=Ae.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var n=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=N.fromDer(t.body);return de.publicKeyFromAsn1(r)};de.publicKeyToPem=function(e,t){var n={type:"PUBLIC KEY",body:N.toDer(de.publicKeyToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.publicKeyToRSAPublicKeyPem=function(e,t){var n={type:"RSA PUBLIC KEY",body:N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||Ae.md.sha1.create(),r=t.type||"RSAPublicKey",i;switch(r){case"RSAPublicKey":i=N.toDer(de.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=N.toDer(de.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}n.start(),n.update(i);var a=n.digest();if(t.encoding==="hex"){var o=a.toHex();return t.delimiter?o.match(/.{2}/g).join(t.delimiter):o}else{if(t.encoding==="binary")return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return a};de.certificationRequestFromPem=function(e,t,n){var r=Ae.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=r.type,i}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var a=N.fromDer(r.body,n);return de.certificationRequestFromAsn1(a,t)};de.certificationRequestToPem=function(e,t){var n={type:"CERTIFICATE REQUEST",body:N.toDer(de.certificationRequestToAsn1(e)).getBytes()};return Ae.pem.encode(n,{maxline:t})};de.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(t){return xa(e.issuer,t)},e.issuer.addField=function(t){vr([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,n){vr(t),e.subject.attributes=t,delete e.subject.uniqueId,n&&(e.subject.uniqueId=n),e.subject.hash=null},e.setIssuer=function(t,n){vr(t),e.issuer.attributes=t,delete e.issuer.uniqueId,n&&(e.issuer.uniqueId=n),e.issuer.hash=null},e.setExtensions=function(t){for(var n=0;n<t.length;++n)$C(t[n],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var n=null,r,i=0;n===null&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=de.getTBSCertificate(e);var a=N.toDer(e.tbsCertificate);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var n=!1;if(!e.issued(t)){var r=t.issuer,i=e.subject,a=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 a.expectedIssuer=i.attributes,a.actualIssuer=r.attributes,a}var o=t.md;if(o===null){o=lf({signatureOid:t.signatureOid,type:"certificate"});var s=t.tbsCertificate||de.getTBSCertificate(t),l=N.toDer(s);o.update(l.getBytes())}return o!==null&&(n=BC({certificate:e,md:o,signature:t.signature})),n},e.isIssuer=function(t){var n=!1,r=e.issuer,i=t.subject;if(r.hash&&i.hash)n=r.hash===i.hash;else if(r.attributes.length===i.attributes.length){n=!0;for(var a,o,s=0;n&&s<r.attributes.length;++s)a=r.attributes[s],o=i.attributes[s],(a.type!==o.type||a.value!==o.value)&&(n=!1)}return n},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return de.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=nt.subjectKeyIdentifier,n=0;n<e.extensions.length;++n){var r=e.extensions[n];if(r.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return Ae.util.hexToBytes(r.subjectKeyIdentifier)===i}}return!1},e};de.certificateFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,OT,n,r)){var i=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificate();o.version=n.certVersion?n.certVersion.charCodeAt(0):0;var s=Ae.util.createBuffer(n.certSerialNumber);o.serialNumber=s.toHex(),o.signatureOid=Ae.asn1.derToOid(n.certSignatureOid),o.signatureParameters=nd(o.signatureOid,n.certSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.certinfoSignatureOid),o.siginfo.parameters=nd(o.siginfo.algorithmOid,n.certinfoSignatureParams,!1),o.signature=n.certSignature;var l=[];if(n.certValidity1UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity1UTCTime)),n.certValidity2GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity2GeneralizedTime)),n.certValidity3UTCTime!==void 0&&l.push(N.utcTimeToDate(n.certValidity3UTCTime)),n.certValidity4GeneralizedTime!==void 0&&l.push(N.generalizedTimeToDate(n.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(o.validity.notBefore=l[0],o.validity.notAfter=l[1],o.tbsCertificate=n.tbsCertificate,t){o.md=lf({signatureOid:o.signatureOid,type:"certificate"});var u=N.toDer(o.tbsCertificate);o.md.update(u.getBytes())}var c=Ae.md.sha1.create(),d=N.toDer(n.certIssuer);c.update(d.getBytes()),o.issuer.getField=function(g){return xa(o.issuer,g)},o.issuer.addField=function(g){vr([g]),o.issuer.attributes.push(g)},o.issuer.attributes=de.RDNAttributesAsArray(n.certIssuer),n.certIssuerUniqueId&&(o.issuer.uniqueId=n.certIssuerUniqueId),o.issuer.hash=c.digest().toHex();var h=Ae.md.sha1.create(),f=N.toDer(n.certSubject);return h.update(f.getBytes()),o.subject.getField=function(g){return xa(o.subject,g)},o.subject.addField=function(g){vr([g]),o.subject.attributes.push(g)},o.subject.attributes=de.RDNAttributesAsArray(n.certSubject),n.certSubjectUniqueId&&(o.subject.uniqueId=n.certSubjectUniqueId),o.subject.hash=h.digest().toHex(),n.certExtensions?o.extensions=de.certificateExtensionsFromAsn1(n.certExtensions):o.extensions=[],o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o};de.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var r=e.value[n],i=0;i<r.value.length;++i)t.push(de.certificateExtensionFromAsn1(r.value[i]));return t};de.certificateExtensionFromAsn1=function(e){var t={};if(t.id=N.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===N.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in nt){if(t.name=nt[t.id],t.name==="keyUsage"){var n=N.fromDer(t.value),r=0,i=0;n.value.length>1&&(r=n.value.charCodeAt(1),i=n.value.length>2?n.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(i&128)===128}else if(t.name==="basicConstraints"){var n=N.fromDer(t.value);n.value.length>0&&n.value[0].type===N.Type.BOOLEAN?t.cA=n.value[0].value.charCodeAt(0)!==0:t.cA=!1;var a=null;n.value.length>0&&n.value[0].type===N.Type.INTEGER?a=n.value[0].value:n.value.length>1&&(a=n.value[1].value),a!==null&&(t.pathLenConstraint=N.derToInteger(a))}else if(t.name==="extKeyUsage")for(var n=N.fromDer(t.value),o=0;o<n.value.length;++o){var s=N.derToOid(n.value[o].value);s in nt?t[nt[s]]=!0:t[s]=!0}else if(t.name==="nsCertType"){var n=N.fromDer(t.value),r=0;n.value.length>1&&(r=n.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var l,n=N.fromDer(t.value),u=0;u<n.value.length;++u){l=n.value[u];var c={type:l.type,value:l.value};switch(t.altNames.push(c),l.type){case 1:case 2:case 6:break;case 7:c.ip=Ae.util.bytesToIP(l.value);break;case 8:c.oid=N.derToOid(l.value);break}}}else if(t.name==="subjectKeyIdentifier"){var n=N.fromDer(t.value);t.subjectKeyIdentifier=Ae.util.bytesToHex(n.value)}}return t};de.certificationRequestFromAsn1=function(e,t){var n={},r=[];if(!N.validate(e,jT,n,r)){var i=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw i.errors=r,i}var a=N.derToOid(n.publicKeyOid);if(a!==de.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var o=de.createCertificationRequest();if(o.version=n.csrVersion?n.csrVersion.charCodeAt(0):0,o.signatureOid=Ae.asn1.derToOid(n.csrSignatureOid),o.signatureParameters=nd(o.signatureOid,n.csrSignatureParams,!0),o.siginfo.algorithmOid=Ae.asn1.derToOid(n.csrSignatureOid),o.siginfo.parameters=nd(o.siginfo.algorithmOid,n.csrSignatureParams,!1),o.signature=n.csrSignature,o.certificationRequestInfo=n.certificationRequestInfo,t){o.md=lf({signatureOid:o.signatureOid,type:"certification request"});var s=N.toDer(o.certificationRequestInfo);o.md.update(s.getBytes())}var l=Ae.md.sha1.create();return o.subject.getField=function(u){return xa(o.subject,u)},o.subject.addField=function(u){vr([u]),o.subject.attributes.push(u)},o.subject.attributes=de.RDNAttributesAsArray(n.certificationRequestInfoSubject,l),o.subject.hash=l.digest().toHex(),o.publicKey=de.publicKeyFromAsn1(n.subjectPublicKeyInfo),o.getAttribute=function(u){return xa(o,u)},o.addAttribute=function(u){vr([u]),o.attributes.push(u)},o.attributes=de.CRIAttributesAsArray(n.certificationRequestInfoAttributes||[]),o};de.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(t){return xa(e.subject,t)},e.subject.addField=function(t){vr([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return xa(e,t)},e.addAttribute=function(t){vr([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){vr(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){vr(t),e.attributes=t},e.sign=function(t,n){e.md=n||Ae.md.sha1.create();var r=nt[e.md.algorithm+"WithRSAEncryption"];if(!r){var i=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=e.md.algorithm,i}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=de.getCertificationRequestInfo(e);var a=N.toDer(e.certificationRequestInfo);e.md.update(a.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,n=e.md;if(n===null){n=lf({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||de.getCertificationRequestInfo(e),i=N.toDer(r);n.update(i.getBytes())}return n!==null&&(t=BC({certificate:e,md:n,signature:e.signature})),t},e};function fs(e){for(var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),n,r,i=e.attributes,a=0;a<i.length;++a){n=i[a];var o=n.value,s=N.Type.PRINTABLESTRING;"valueTagClass"in n&&(s=n.valueTagClass,s===N.Type.UTF8&&(o=Ae.util.encodeUtf8(o))),r=N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(n.type).getBytes()),N.create(N.Class.UNIVERSAL,s,!1,o)])]),t.value.push(r)}return t}function vr(e){for(var t,n=0;n<e.length;++n){if(t=e[n],typeof t.name>"u"&&(t.type&&t.type in de.oids?t.name=de.oids[t.type]:t.shortName&&t.shortName in Mt&&(t.name=de.oids[Mt[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in de.oids)t.type=de.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Mt&&(t.shortName=Mt[t.name]),t.type===nt.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=N.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var i=0;i<t.extensions.length;++i)t.value.push(de.certificateExtensionToAsn1($C(t.extensions[i])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function $C(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in de.oids&&(e.name=de.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in de.oids)e.id=de.oids[e.name];else{var n=new Error("Extension ID not specified.");throw n.extension=e,n}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,i=0,a=0;e.digitalSignature&&(i|=128,r=7),e.nonRepudiation&&(i|=64,r=6),e.keyEncipherment&&(i|=32,r=5),e.dataEncipherment&&(i|=16,r=4),e.keyAgreement&&(i|=8,r=3),e.keyCertSign&&(i|=4,r=2),e.cRLSign&&(i|=2,r=1),e.encipherOnly&&(i|=1,r=0),e.decipherOnly&&(a|=128,r=7);var o=String.fromCharCode(r);a!==0?o+=String.fromCharCode(i)+String.fromCharCode(a):i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="basicConstraints")e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ")),"pathLenConstraint"in e&&e.value.value.push(N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;for(var l in e)e[l]===!0&&(l in nt?s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(nt[l]).getBytes())):l.indexOf(".")!==-1&&s.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(l).getBytes())))}else if(e.name==="nsCertType"){var r=0,i=0;e.client&&(i|=128,r=7),e.server&&(i|=64,r=6),e.email&&(i|=32,r=5),e.objsign&&(i|=16,r=4),e.reserved&&(i|=8,r=3),e.sslCA&&(i|=4,r=2),e.emailCA&&(i|=2,r=1),e.objCA&&(i|=1,r=0);var o=String.fromCharCode(r);i!==0&&(o+=String.fromCharCode(i)),e.value=N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,o)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));e.value.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=N.create(N.Class.UNIVERSAL,N.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,d.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);var s=e.value.value;if(e.keyIdentifier){var h=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;s.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var f=[N.create(N.Class.CONTEXT_SPECIFIC,4,!0,[fs(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];s.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,f))}if(e.serialNumber){var g=Ae.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);s.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if(e.name==="cRLDistributionPoints"){e.value=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);for(var s=e.value.value,p=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]),m=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]),u,c=0;c<e.altNames.length;++c){u=e.altNames[c];var o=u.value;if(u.type===7&&u.ip){if(o=Ae.util.bytesFromIP(u.ip),o===null){var n=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw n.extension=e,n}}else u.type===8&&(u.oid?o=N.oidToDer(N.oidToDer(u.oid)):o=N.oidToDer(o));m.value.push(N.create(N.Class.CONTEXT_SPECIFIC,u.type,!1,o))}p.value.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[m])),s.push(p)}if(typeof e.value>"u"){var n=new Error("Extension value not specified.");throw n.extension=e,n}return e}function ap(e,t){switch(e){case nt["RSASSA-PSS"]:var n=[];return t.hash.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(t.mgf.hash.algorithmOid).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&n.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(t.saltLength).getBytes())])),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,n);default:return N.create(N.Class.UNIVERSAL,N.Type.NULL,!1,"")}}function WT(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var n=e.attributes,r=0;r<n.length;++r){var i=n[r],a=i.value,o=N.Type.UTF8;"valueTagClass"in i&&(o=i.valueTagClass),o===N.Type.UTF8&&(a=Ae.util.encodeUtf8(a));var s=!1;"valueConstructed"in i&&(s=i.valueConstructed);var l=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(i.type).getBytes()),N.create(N.Class.UNIVERSAL,N.Type.SET,!0,[N.create(N.Class.UNIVERSAL,o,s,a)])]);t.value.push(l)}return t}var zT=new Date("1950-01-01T00:00:00Z"),GT=new Date("2050-01-01T00:00:00Z");function R1(e){return e>=zT&&e<GT?N.create(N.Class.UNIVERSAL,N.Type.UTCTIME,!1,N.dateToUtcTime(e)):N.create(N.Class.UNIVERSAL,N.Type.GENERALIZEDTIME,!1,N.dateToGeneralizedTime(e))}de.getTBSCertificate=function(e){var t=R1(e.validity.notBefore),n=R1(e.validity.notAfter),r=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.CONTEXT_SPECIFIC,0,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes())]),N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,Ae.util.hexToBytes(e.serialNumber)),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.siginfo.algorithmOid).getBytes()),ap(e.siginfo.algorithmOid,e.siginfo.parameters)]),fs(e.issuer),N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,n]),fs(e.subject),de.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,1,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(N.create(N.Class.CONTEXT_SPECIFIC,2,!0,[N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(de.certificateExtensionsToAsn1(e.extensions)),r};de.getCertificationRequestInfo=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.INTEGER,!1,N.integerToDer(e.version).getBytes()),fs(e.subject),de.publicKeyToAsn1(e.publicKey),WT(e)]);return t};de.distinguishedNameToAsn1=function(e){return fs(e)};de.certificateToAsn1=function(e){var t=e.tbsCertificate||de.getTBSCertificate(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.certificateExtensionsToAsn1=function(e){var t=N.create(N.Class.CONTEXT_SPECIFIC,3,!0,[]),n=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(n);for(var r=0;r<e.length;++r)n.value.push(de.certificateExtensionToAsn1(e[r]));return t};de.certificateExtensionToAsn1=function(e){var t=N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[]);t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.id).getBytes())),e.critical&&t.value.push(N.create(N.Class.UNIVERSAL,N.Type.BOOLEAN,!1,"ÿ"));var n=e.value;return typeof e.value!="string"&&(n=N.toDer(n).getBytes()),t.value.push(N.create(N.Class.UNIVERSAL,N.Type.OCTETSTRING,!1,n)),t};de.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||de.getCertificationRequestInfo(e);return N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[t,N.create(N.Class.UNIVERSAL,N.Type.SEQUENCE,!0,[N.create(N.Class.UNIVERSAL,N.Type.OID,!1,N.oidToDer(e.signatureOid).getBytes()),ap(e.signatureOid,e.signatureParameters)]),N.create(N.Class.UNIVERSAL,N.Type.BITSTRING,!1,"\0"+e.signature)])};de.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(o){var s=n(o.issuer);return s},t.addCertificate=function(o){if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))if(o.subject.hash in t.certs){var s=t.certs[o.subject.hash];Ae.util.isArray(s)||(s=[s]),s.push(o),t.certs[o.subject.hash]=s}else t.certs[o.subject.hash]=o},t.hasCertificate=function(o){typeof o=="string"&&(o=Ae.pki.certificateFromPem(o));var s=n(o.subject);if(!s)return!1;Ae.util.isArray(s)||(s=[s]);for(var l=N.toDer(de.certificateToAsn1(o)).getBytes(),u=0;u<s.length;++u){var c=N.toDer(de.certificateToAsn1(s[u])).getBytes();if(l===c)return!0}return!1},t.listAllCertificates=function(){var o=[];for(var s in t.certs)if(t.certs.hasOwnProperty(s)){var l=t.certs[s];if(!Ae.util.isArray(l))o.push(l);else for(var u=0;u<l.length;++u)o.push(l[u])}return o},t.removeCertificate=function(o){var s;if(typeof o=="string"&&(o=Ae.pki.certificateFromPem(o)),r(o.subject),!t.hasCertificate(o))return null;var l=n(o.subject);if(!Ae.util.isArray(l))return s=t.certs[o.subject.hash],delete t.certs[o.subject.hash],s;for(var u=N.toDer(de.certificateToAsn1(o)).getBytes(),c=0;c<l.length;++c){var d=N.toDer(de.certificateToAsn1(l[c])).getBytes();u===d&&(s=l[c],l.splice(c,1))}return l.length===0&&delete t.certs[o.subject.hash],s};function n(o){return r(o),t.certs[o.hash]||null}function r(o){if(!o.hash){var s=Ae.md.sha1.create();o.attributes=de.RDNAttributesAsArray(fs(o),s),o.hash=s.digest().toHex()}}if(e)for(var i=0;i<e.length;++i){var a=e[i];t.addCertificate(a)}return t};de.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"};de.verifyCertificateChain=function(e,t,n){typeof n=="function"&&(n={verify:n}),n=n||{},t=t.slice(0);var r=t.slice(0),i=n.validityCheckDate;typeof i>"u"&&(i=new Date);var a=!0,o=null,s=0;do{var l=t.shift(),u=null,c=!1;if(i&&(i<l.validity.notBefore||i>l.validity.notAfter)&&(o={message:"Certificate is not valid yet or has expired.",error:de.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:i}),o===null){if(u=t[0]||e.getIssuer(l),u===null&&l.isIssuer(l)&&(c=!0,u=l),u){var d=u;Ae.util.isArray(d)||(d=[d]);for(var h=!1;!h&&d.length>0;){u=d.shift();try{h=u.verify(l)}catch{}}h||(o={message:"Certificate signature is invalid.",error:de.certificateError.bad_certificate})}o===null&&(!u||c)&&!e.hasCertificate(l)&&(o={message:"Certificate is not trusted.",error:de.certificateError.unknown_ca})}if(o===null&&u&&!l.isIssuer(u)&&(o={message:"Certificate issuer is invalid.",error:de.certificateError.bad_certificate}),o===null)for(var f={keyUsage:!0,basicConstraints:!0},g=0;o===null&&g<l.extensions.length;++g){var p=l.extensions[g];p.critical&&!(p.name in f)&&(o={message:"Certificate has an unsupported critical extension.",error:de.certificateError.unsupported_certificate})}if(o===null&&(!a||t.length===0&&(!u||c))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||m===null)&&(o={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:de.certificateError.bad_certificate}),o===null&&m!==null&&!m.cA&&(o={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:de.certificateError.bad_certificate}),o===null&&b!==null&&"pathLenConstraint"in m){var v=s-1;v>m.pathLenConstraint&&(o={message:"Certificate basicConstraints pathLenConstraint violated.",error:de.certificateError.bad_certificate})}}var x=o===null?!0:o.error,C=n.verify?n.verify(x,s,r):x;if(C===!0)o=null;else throw x===!0&&(o={message:"The application rejected the certificate.",error:de.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!Ae.util.isArray(C)?(C.message&&(o.message=C.message),C.error&&(o.error=C.error)):typeof C=="string"&&(o.error=C)),o;a=!1,++s}while(t.length>0);return!0};var xt=ze,G=xt.asn1,Xe=xt.pki,Il=xt.pkcs12=xt.pkcs12||{},kC={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},UT={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},kC,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},XT={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ZT={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},YT={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Ms(e,t,n,r){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];if(!(r!==void 0&&s.type!==r)){if(t===null){i.push(s);continue}s.attributes[t]!==void 0&&s.attributes[t].indexOf(n)>=0&&i.push(s)}}return i}Il.pkcs12FromAsn1=function(e,t,n){typeof t=="string"?(n=t,t=!0):t===void 0&&(t=!0);var r={},i=[];if(!G.validate(e,UT,r,i)){var a=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw a.errors=a,a}var o={version:r.version.charCodeAt(0),safeContents:[],getBags:function(m){var b={},v;return"localKeyId"in m?v=m.localKeyId:"localKeyIdHex"in m&&(v=xt.util.hexToBytes(m.localKeyIdHex)),v===void 0&&!("friendlyName"in m)&&"bagType"in m&&(b[m.bagType]=Ms(o.safeContents,null,null,m.bagType)),v!==void 0&&(b.localKeyId=Ms(o.safeContents,"localKeyId",v,m.bagType)),"friendlyName"in m&&(b.friendlyName=Ms(o.safeContents,"friendlyName",m.friendlyName,m.bagType)),b},getBagsByFriendlyName:function(m,b){return Ms(o.safeContents,"friendlyName",m,b)},getBagsByLocalKeyId:function(m,b){return Ms(o.safeContents,"localKeyId",m,b)}};if(r.version.charCodeAt(0)!==3){var a=new Error("PKCS#12 PFX of version other than 3 not supported.");throw a.version=r.version.charCodeAt(0),a}if(G.derToOid(r.contentType)!==Xe.oids.data){var a=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw a.oid=G.derToOid(r.contentType),a}var s=r.content.value[0];if(s.tagClass!==G.Class.UNIVERSAL||s.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(s=op(s),r.mac){var l=null,u=0,c=G.derToOid(r.macAlgorithm);switch(c){case Xe.oids.sha1:l=xt.md.sha1.create(),u=20;break;case Xe.oids.sha256:l=xt.md.sha256.create(),u=32;break;case Xe.oids.sha384:l=xt.md.sha384.create(),u=48;break;case Xe.oids.sha512:l=xt.md.sha512.create(),u=64;break;case Xe.oids.md5:l=xt.md.md5.create(),u=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+c);var d=new xt.util.ByteBuffer(r.macSalt),h="macIterations"in r?parseInt(xt.util.bytesToHex(r.macIterations),16):1,f=Il.generateKey(n,d,3,h,u,l),g=xt.hmac.create();g.start(l,f),g.update(s.value);var p=g.getMac();if(p.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return KT(o,s.value,t,n),o};function op(e){if(e.composed||e.constructed){for(var t=xt.util.createBuffer(),n=0;n<e.value.length;++n)t.putBytes(e.value[n].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function KT(e,t,n,r){if(t=G.fromDer(t,n),t.tagClass!==G.Class.UNIVERSAL||t.type!==G.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<t.value.length;i++){var a=t.value[i],o={},s=[];if(!G.validate(a,kC,o,s)){var l=new Error("Cannot read ContentInfo.");throw l.errors=s,l}var u={encrypted:!1},c=null,d=o.content.value[0];switch(G.derToOid(o.contentType)){case Xe.oids.data:if(d.tagClass!==G.Class.UNIVERSAL||d.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");c=op(d).value;break;case Xe.oids.encryptedData:c=JT(d,r),u.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(o.contentType),l}u.safeBags=qT(c,n,r),e.safeContents.push(u)}}function JT(e,t){var n={},r=[];if(!G.validate(e,xt.pkcs7.asn1.encryptedDataValidator,n,r)){var i=new Error("Cannot read EncryptedContentInfo.");throw i.errors=r,i}var a=G.derToOid(n.contentType);if(a!==Xe.oids.data){var i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw i.oid=a,i}a=G.derToOid(n.encAlgorithm);var o=Xe.pbe.getCipher(a,n.encParameter,t),s=op(n.encryptedContentAsn1),l=xt.util.createBuffer(s.value);if(o.update(l),!o.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return o.output.getBytes()}function qT(e,t,n){if(!t&&e.length===0)return[];if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],i=0;i<e.value.length;i++){var a=e.value[i],o={},s=[];if(!G.validate(a,XT,o,s)){var l=new Error("Cannot read SafeBag.");throw l.errors=s,l}var u={type:G.derToOid(o.bagId),attributes:QT(o.bagAttributes)};r.push(u);var c,d,h=o.bagValue.value[0];switch(u.type){case Xe.oids.pkcs8ShroudedKeyBag:if(h=Xe.decryptPrivateKeyInfo(h,n),h===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Xe.oids.keyBag:try{u.key=Xe.privateKeyFromAsn1(h)}catch{u.key=null,u.asn1=h}continue;case Xe.oids.certBag:c=YT,d=function(){if(G.derToOid(o.certId)!==Xe.oids.x509Certificate){var g=new Error("Unsupported certificate type, only X.509 supported.");throw g.oid=G.derToOid(o.certId),g}var p=G.fromDer(o.cert,t);try{u.cert=Xe.certificateFromAsn1(p,!0)}catch{u.cert=null,u.asn1=p}};break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=u.type,l}if(c!==void 0&&!G.validate(h,c,o,s)){var l=new Error("Cannot read PKCS#12 "+c.name);throw l.errors=s,l}d()}return r}function QT(e){var t={};if(e!==void 0)for(var n=0;n<e.length;++n){var r={},i=[];if(!G.validate(e[n],ZT,r,i)){var a=new Error("Cannot read PKCS#12 BagAttribute.");throw a.errors=i,a}var o=G.derToOid(r.oid);if(Xe.oids[o]!==void 0){t[Xe.oids[o]]=[];for(var s=0;s<r.values.length;++s)t[Xe.oids[o]].push(r.values[s].value)}}return t}Il.toPkcs12Asn1=function(e,t,n,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var i=r.localKeyId,a;if(i!==null)i=xt.util.hexToBytes(i);else if(r.generateLocalKeyId)if(t){var o=xt.util.isArray(t)?t[0]:t;typeof o=="string"&&(o=Xe.certificateFromPem(o));var s=xt.md.sha1.create();s.update(G.toDer(Xe.certificateToAsn1(o)).getBytes()),i=s.digest().getBytes()}else i=xt.random.getBytes(20);var l=[];i!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,i)])])),"friendlyName"in r&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,r.friendlyName)])])),l.length>0&&(a=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var u=[],c=[];t!==null&&(xt.util.isArray(t)?c=t:c=[t]);for(var d=[],h=0;h<c.length;++h){t=c[h],typeof t=="string"&&(t=Xe.certificateFromPem(t));var f=h===0?a:void 0,g=Xe.certificateToAsn1(t),p=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(g).getBytes())])])]),f]);d.push(p)}if(d.length>0){var m=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,d),b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])]);u.push(b)}var v=null;if(e!==null){var x=Xe.wrapRsaPrivateKey(Xe.privateKeyToAsn1(e));n===null?v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[x]),a]):v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Xe.encryptPrivateKeyInfo(x,n,r)]),a]);var C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[v]),E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(C).getBytes())])]);u.push(E)}var w=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,u),B;if(r.useMac){var s=xt.md.sha1.create(),y=new xt.util.ByteBuffer(xt.random.getBytes(r.saltSize)),S=r.count,e=Il.generateKey(n,y,3,S,20),D=xt.hmac.create();D.start(s,e),D.update(G.toDer(w).getBytes());var A=D.getMac();B=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,A.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,y.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(S).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Xe.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(w).getBytes())])]),B])};Il.generateKey=xt.pbe.generatePkcs12Key;var Ca=ze,sp=Ca.asn1,hs=Ca.pki=Ca.pki||{};hs.pemToDer=function(e){var t=Ca.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Ca.util.createBuffer(t.body)};hs.privateKeyFromPem=function(e){var t=Ca.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=sp.fromDer(t.body);return hs.privateKeyFromAsn1(r)};hs.privateKeyToPem=function(e,t){var n={type:"RSA PRIVATE KEY",body:sp.toDer(hs.privateKeyToAsn1(e)).getBytes()};return Ca.pem.encode(n,{maxline:t})};hs.privateKeyInfoToPem=function(e,t){var n={type:"PRIVATE KEY",body:sp.toDer(e).getBytes()};return Ca.pem.encode(n,{maxline:t})};var ae=ze,uf=function(e,t,n,r){var i=ae.util.createBuffer(),a=e.length>>1,o=a+(e.length&1),s=e.substr(0,o),l=e.substr(a,o),u=ae.util.createBuffer(),c=ae.hmac.create();n=t+n;var d=Math.ceil(r/16),h=Math.ceil(r/20);c.start("MD5",s);var f=ae.util.createBuffer();u.putBytes(n);for(var g=0;g<d;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),f.putBuffer(c.digest());c.start("SHA1",l);var p=ae.util.createBuffer();u.clear(),u.putBytes(n);for(var g=0;g<h;++g)c.start(null,null),c.update(u.getBytes()),u.putBuffer(c.digest()),c.start(null,null),c.update(u.bytes()+n),p.putBuffer(c.digest());return i.putBytes(ae.util.xorBytes(f.getBytes(),p.getBytes(),r)),i},eR=function(e,t,n){var r=ae.hmac.create();r.start("SHA1",e);var i=ae.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(n.type),i.putByte(n.version.major),i.putByte(n.version.minor),i.putInt16(n.length),i.putBytes(n.fragment.bytes()),r.update(i.getBytes()),r.digest().getBytes()},tR=function(e,t,n){var r=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},nR=function(e,t,n){var r=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=ae.util.createBuffer(i),t.length=i.length,r=!0}catch{}return r},Yn=function(e,t){var n=0;switch(t){case 1:n=e.getByte();break;case 2:n=e.getInt16();break;case 3:n=e.getInt24();break;case 4:n=e.getInt32();break}return ae.util.createBuffer(e.getBytes(n))},gr=function(e,t,n){e.putInt(n.length(),t<<3),e.putBuffer(n)},L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.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};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.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};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(e){var t=null;for(var n in L.CipherSuites){var r=L.CipherSuites[n];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};L.handleUnexpected=function(e,t){var n=!e.open&&e.entity===L.ConnectionEnd.client;n||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(e,t,n){!e.handshaking&&e.handshakes>0&&(L.queue(e,L.createAlert(e,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(e)),e.process()};L.parseHelloMessage=function(e,t,n){var r=null,i=e.entity===L.ConnectionEnd.client;if(n<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var a=t.fragment,o=a.length();if(r={version:{major:a.getByte(),minor:a.getByte()},random:ae.util.createBuffer(a.getBytes(32)),session_id:Yn(a,1),extensions:[]},i?(r.cipher_suite=a.getBytes(2),r.compression_method=a.getByte()):(r.cipher_suites=Yn(a,2),r.compression_methods=Yn(a,1)),o=n-(o-a.length()),o>0){for(var s=Yn(a,2);s.length()>0;)r.extensions.push({type:[s.getByte(),s.getByte()],data:Yn(s,2)});if(!i)for(var l=0;l<r.extensions.length;++l){var u=r.extensions[l];if(u.type[0]===0&&u.type[1]===0)for(var c=Yn(u.data,2);c.length()>0;){var d=c.getByte();if(d!==0)break;e.session.extensions.server_name.serverNameList.push(Yn(c,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=L.getCipherSuite(r.cipher_suite);else for(var h=ae.util.createBuffer(r.cipher_suites.bytes());h.length()>0&&(e.session.cipherSuite=L.getCipherSuite(h.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:ae.util.bytesToHex(r.cipher_suite)});i?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=L.CompressionMethod.none}return r};L.createSecurityParameters=function(e,t){var n=e.entity===L.ConnectionEnd.client,r=t.random.bytes(),i=n?e.session.sp.client_random:r,a=n?r:L.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:L.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:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}};L.handleServerHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});e.session.version=e.version;var i=r.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=PC,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=iR,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.session.id=i,e.process()}};L.handleClientHello=function(e,t,n){var r=L.parseHelloMessage(e,t,n);if(!e.fail){var i=r.session_id.bytes(),a=null;if(e.sessionCache&&(a=e.sessionCache.getSession(i),a===null?i="":(a.version.major!==r.version.major||a.version.minor>r.version.minor)&&(a=null,i="")),i.length===0&&(i=ae.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=r.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,s=1;s<L.SupportedVersions.length&&(o=L.SupportedVersions[s],!(o.minor<=r.version.minor));++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}a!==null?(e.expect=lp,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?dR:R0,e.session.resuming=!1,L.createSecurityParameters(e,r)),e.open=!0,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHello(e)})),e.session.resuming?(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.pending=L.createConnectionState(e),e.state.current.write=e.state.pending.write,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))):(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)})),e.fail||(L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerKeyExchange(e)})),e.verifyClient!==!1&&L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificateRequest(e)})),L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createServerHelloDone(e)})))),L.flush(e),e.process()}};L.handleCertificate=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_list:Yn(r,3)},a,o,s=[];try{for(;i.certificate_list.length()>0;)a=Yn(i.certificate_list,3),o=ae.asn1.fromDer(a),a=ae.pki.certificateFromAsn1(o,!0),s.push(a)}catch(u){return e.error(e,{message:"Could not parse certificate list.",cause:u,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=e.entity===L.ConnectionEnd.client;(l||e.verifyClient===!0)&&s.length===0?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):s.length===0?e.expect=l?B1:R0:(l?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],L.verifyCertificateChain(e,s)&&(e.expect=l?B1:R0)),e.process()};L.handleServerKeyExchange=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});e.expect=aR,e.process()};L.handleClientKeyExchange=function(e,t,n){if(n<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var r=t.fragment,i={enc_pre_master_secret:Yn(r,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=ae.pki.privateKeyFromPem(a)}catch(l){e.error(e,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(a===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{o.pre_master_secret=ae.random.getBytes(48)}e.expect=lp,e.session.clientCertificate!==null&&(e.expect=fR),e.process()};L.handleCertificateRequest=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment,i={certificate_types:Yn(r,1),certificate_authorities:Yn(r,2)};e.session.certificateRequest=i,e.expect=oR,e.process()};L.handleCertificateVerify=function(e,t,n){if(n<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a={signature:Yn(r,2).getBytes()},o=ae.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{var s=e.session.clientCertificate;if(!s.publicKey.verify(o,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}e.expect=lp,e.process()};L.handleServerHelloDone=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},i=0,a=e.verify(e,r.alert.description,i,[]);if(a!==!0)return(a||a===0)&&(typeof a=="object"&&!ae.util.isArray(a)?(a.message&&(r.message=a.message),a.alert&&(r.alert.description=a.alert)):typeof a=="number"&&(r.alert.description=a)),e.error(e,r)}e.session.certificateRequest!==null&&(t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createCertificate(e)}),L.queue(e,t)),t=L.createRecord(e,{type:L.ContentType.handshake,data:L.createClientKeyExchange(e)}),L.queue(e,t),e.expect=uR;var o=function(s,l){s.session.certificateRequest!==null&&s.session.clientCertificate!==null&&L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createCertificateVerify(s,l)})),L.queue(s,L.createRecord(s,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),s.state.pending=L.createConnectionState(s),s.state.current.write=s.state.pending.write,L.queue(s,L.createRecord(s,{type:L.ContentType.handshake,data:L.createFinished(s)})),s.expect=PC,L.flush(s),s.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return o(e,null);L.getClientSignature(e,o)};L.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.entity===L.ConnectionEnd.client;(e.session.resuming&&n||!e.session.resuming&&!n)&&(e.state.pending=L.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&n||e.session.resuming&&!n)&&(e.state.pending=null),e.expect=n?sR:hR,e.process()};L.handleFinished=function(e,t,n){var r=t.fragment;r.read-=4;var i=r.bytes();r.read+=4;var a=t.fragment.getBytes();r=ae.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var o=e.entity===L.ConnectionEnd.client,s=o?"server finished":"client finished",l=e.session.sp,u=12,c=uf;if(r=c(l.master_secret,s,r.getBytes(),u),r.getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(L.queue(e,L.createRecord(e,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,L.queue(e,L.createRecord(e,{type:L.ContentType.handshake,data:L.createFinished(e)}))),e.expect=o?lR:gR,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,L.flush(e),e.isConnected=!0,e.connected(e),e.process()};L.handleAlert=function(e,t){var n=t.fragment,r={level:n.getByte(),description:n.getByte()},i;switch(r.description){case L.Alert.Description.close_notify:i="Connection closed.";break;case L.Alert.Description.unexpected_message:i="Unexpected message.";break;case L.Alert.Description.bad_record_mac:i="Bad record MAC.";break;case L.Alert.Description.decryption_failed:i="Decryption failed.";break;case L.Alert.Description.record_overflow:i="Record overflow.";break;case L.Alert.Description.decompression_failure:i="Decompression failed.";break;case L.Alert.Description.handshake_failure:i="Handshake failure.";break;case L.Alert.Description.bad_certificate:i="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:i="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:i="Certificate revoked.";break;case L.Alert.Description.certificate_expired:i="Certificate expired.";break;case L.Alert.Description.certificate_unknown:i="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:i="Illegal parameter.";break;case L.Alert.Description.unknown_ca:i="Unknown certificate authority.";break;case L.Alert.Description.access_denied:i="Access denied.";break;case L.Alert.Description.decode_error:i="Decode error.";break;case L.Alert.Description.decrypt_error:i="Decrypt error.";break;case L.Alert.Description.export_restriction:i="Export restriction.";break;case L.Alert.Description.protocol_version:i="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:i="Insufficient security.";break;case L.Alert.Description.internal_error:i="Internal error.";break;case L.Alert.Description.user_canceled:i="User canceled.";break;case L.Alert.Description.no_renegotiation:i="Renegotiation not supported.";break;default:i="Unknown error.";break}if(r.description===L.Alert.Description.close_notify)return e.close();e.error(e,{message:i,send:!1,origin:e.entity===L.ConnectionEnd.client?"server":"client",alert:r}),e.process()};L.handleHandshake=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt24();if(i>n.length())return e.fragmented=t,t.fragment=ae.util.createBuffer(),n.read-=4,e.process();e.fragmented=null,n.read-=4;var a=n.bytes(i+4);n.read+=4,r in rd[e.entity][e.expect]?(e.entity===L.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:ae.md.md5.create(),sha1:ae.md.sha1.create()}),r!==L.HandshakeType.hello_request&&r!==L.HandshakeType.certificate_verify&&r!==L.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),rd[e.entity][e.expect][r](e,t,i)):L.handleUnexpected(e,t)};L.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};L.handleHeartbeat=function(e,t){var n=t.fragment,r=n.getByte(),i=n.getInt16(),a=n.getBytes(i);if(r===L.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();L.queue(e,L.createRecord(e,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,a)})),L.flush(e)}else if(r===L.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,ae.util.createBuffer(a))}e.process()};var rR=0,iR=1,B1=2,aR=3,oR=4,PC=5,sR=6,lR=7,uR=8,cR=0,dR=1,R0=2,fR=3,lp=4,hR=5,gR=6,M=L.handleUnexpected,FC=L.handleChangeCipherSpec,dn=L.handleAlert,Dn=L.handleHandshake,NC=L.handleApplicationData,fn=L.handleHeartbeat,up=[];up[L.ConnectionEnd.client]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];up[L.ConnectionEnd.server]=[[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,M,fn],[FC,dn,M,M,fn],[M,dn,Dn,M,fn],[M,dn,Dn,NC,fn],[M,dn,Dn,M,fn]];var Yi=L.handleHelloRequest,pR=L.handleServerHello,MC=L.handleCertificate,$1=L.handleServerKeyExchange,Yf=L.handleCertificateRequest,ku=L.handleServerHelloDone,LC=L.handleFinished,rd=[];rd[L.ConnectionEnd.client]=[[M,M,pR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,MC,$1,Yf,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,$1,Yf,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,Yf,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,ku,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[Yi,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];var mR=L.handleClientHello,bR=L.handleClientKeyExchange,vR=L.handleCertificateVerify;rd[L.ConnectionEnd.server]=[[M,mR,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,MC,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,bR,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,vR,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,LC],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M],[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M]];L.generateKeys=function(e,t){var n=uf,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=n(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===L.Versions.TLS_1_0.major&&e.version.minor===L.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var o=n(t.master_secret,"key expansion",r,i),s={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s};L.createConnectionState=function(e){var t=e.entity===L.ConnectionEnd.client,n=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(o){return!0},compressionState:null,compressFunction:function(o){return!0},updateSequenceNumber:function(){a.sequenceNumber[1]===4294967295?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},r={read:n(),write:n()};if(r.read.update=function(a,o){return r.read.cipherFunction(o,r.read)?r.read.compressFunction(a,o,r.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_record_mac}}),!a.fail},r.write.update=function(a,o){return r.write.compressFunction(a,o,r.write)?r.write.cipherFunction(o,r.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!a.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=L.generateKeys(e,i),r.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,r.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,i),i.compression_algorithm){case L.CompressionMethod.none:break;case L.CompressionMethod.deflate:r.read.compressFunction=nR,r.write.compressFunction=tR;break;default:throw new Error("Unsupported compression algorithm.")}}return r};L.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,n=ae.util.createBuffer();return n.putInt32(t),n.putBytes(ae.random.getBytes(28)),n};L.createRecord=function(e,t){if(!t.data)return null;var n={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return n};L.createAlert=function(e,t){var n=ae.util.createBuffer();return n.putByte(t.level),n.putByte(t.description),L.createRecord(e,{type:L.ContentType.alert,data:n})};L.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=ae.util.createBuffer(),n=0;n<e.cipherSuites.length;++n){var r=e.cipherSuites[n];t.putByte(r.id[0]),t.putByte(r.id[1])}var i=t.length(),a=ae.util.createBuffer();a.putByte(L.CompressionMethod.none);var o=a.length(),s=ae.util.createBuffer();if(e.virtualHost){var l=ae.util.createBuffer();l.putByte(0),l.putByte(0);var u=ae.util.createBuffer();u.putByte(0),gr(u,2,ae.util.createBuffer(e.virtualHost));var c=ae.util.createBuffer();gr(c,2,u),gr(l,2,c),s.putBuffer(l)}var d=s.length();d>0&&(d+=2);var h=e.session.id,f=h.length+1+2+4+28+2+i+1+o+d,g=ae.util.createBuffer();return g.putByte(L.HandshakeType.client_hello),g.putInt24(f),g.putByte(e.version.major),g.putByte(e.version.minor),g.putBytes(e.session.sp.client_random),gr(g,1,ae.util.createBuffer(h)),gr(g,2,t),gr(g,1,a),d>0&&gr(g,2,s),g};L.createServerHello=function(e){var t=e.session.id,n=t.length+1+2+4+28+2+1,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.server_hello),r.putInt24(n),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),gr(r,1,ae.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};L.createCertificate=function(e){var t=e.entity===L.ConnectionEnd.client,n=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,r)}var i=ae.util.createBuffer();if(n!==null)try{ae.util.isArray(n)||(n=[n]);for(var a=null,o=0;o<n.length;++o){var s=ae.pem.decode(n[o])[0];if(s.type!=="CERTIFICATE"&&s.type!=="X509 CERTIFICATE"&&s.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=s.type,l}if(s.procType&&s.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=ae.util.createBuffer(s.body);a===null&&(a=ae.asn1.fromDer(u.bytes(),!1));var c=ae.util.createBuffer();gr(c,3,u),i.putBuffer(c)}n=ae.pki.certificateFromAsn1(a),t?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(f){return e.error(e,{message:"Could not send certificate list.",cause:f,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var d=3+i.length(),h=ae.util.createBuffer();return h.putByte(L.HandshakeType.certificate),h.putInt24(d),gr(h,3,i),h};L.createClientKeyExchange=function(e){var t=ae.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(ae.random.getBytes(46));var n=e.session.sp;n.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(n.pre_master_secret);var i=t.length+2,a=ae.util.createBuffer();return a.putByte(L.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a};L.createServerKeyExchange=function(e){var t=ae.util.createBuffer();return t};L.getClientSignature=function(e,t){var n=ae.util.createBuffer();n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest()),n=n.getBytes(),e.getSignature=e.getSignature||function(r,i,a){var o=null;if(r.getPrivateKey)try{o=r.getPrivateKey(r,r.session.clientCertificate),o=ae.pki.privateKeyFromPem(o)}catch(s){r.error(r,{message:"Could not get private key.",cause:s,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}o===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i=o.sign(i,null),a(r,i)},e.getSignature(e,n,t)};L.createCertificateVerify=function(e,t){var n=t.length+2,r=ae.util.createBuffer();return r.putByte(L.HandshakeType.certificate_verify),r.putInt24(n),r.putInt16(t.length),r.putBytes(t),r};L.createCertificateRequest=function(e){var t=ae.util.createBuffer();t.putByte(1);var n=ae.util.createBuffer();for(var r in e.caStore.certs){var i=e.caStore.certs[r],a=ae.pki.distinguishedNameToAsn1(i.subject),o=ae.asn1.toDer(a);n.putInt16(o.length()),n.putBuffer(o)}var s=1+t.length()+2+n.length(),l=ae.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(s),gr(l,1,t),gr(l,2,n),l};L.createServerHelloDone=function(e){var t=ae.util.createBuffer();return t.putByte(L.HandshakeType.server_hello_done),t.putInt24(0),t};L.createChangeCipherSpec=function(){var e=ae.util.createBuffer();return e.putByte(1),e};L.createFinished=function(e){var t=ae.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var n=e.entity===L.ConnectionEnd.client,r=e.session.sp,i=12,a=uf,o=n?"client finished":"server finished";t=a(r.master_secret,o,t.getBytes(),i);var s=ae.util.createBuffer();return s.putByte(L.HandshakeType.finished),s.putInt24(t.length()),s.putBuffer(t),s};L.createHeartbeat=function(e,t,n){typeof n>"u"&&(n=t.length);var r=ae.util.createBuffer();r.putByte(e),r.putInt16(n),r.putBytes(t);var i=r.length(),a=Math.max(16,i-n-3);return r.putBytes(ae.random.getBytes(a)),r};L.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===L.ContentType.handshake||t.type===L.ContentType.alert||t.type===L.ContentType.change_cipher_spec))){if(t.type===L.ContentType.handshake){var n=t.fragment.bytes();e.session.md5.update(n),e.session.sha1.update(n),n=null}var r;if(t.fragment.length()<=L.MaxFragment)r=[t];else{r=[];for(var i=t.fragment.bytes();i.length>L.MaxFragment;)r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i.slice(0,L.MaxFragment))})),i=i.slice(L.MaxFragment);i.length>0&&r.push(L.createRecord(e,{type:t.type,data:ae.util.createBuffer(i)}))}for(var a=0;a<r.length&&!e.fail;++a){var o=r[a],s=e.state.current.write;s.update(e,o)&&e.records.push(o)}}};L.flush=function(e){for(var t=0;t<e.records.length;++t){var n=e.records[t];e.tlsData.putByte(n.type),e.tlsData.putByte(n.version.major),e.tlsData.putByte(n.version.minor),e.tlsData.putInt16(n.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var Kf=function(e){switch(e){case!0:return!0;case ae.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case ae.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case ae.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case ae.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case ae.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case ae.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},yR=function(e){switch(e){case!0:return!0;case L.Alert.Description.bad_certificate:return ae.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return ae.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return ae.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return ae.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return ae.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return ae.pki.certificateError.unknown_ca;default:return ae.pki.certificateError.bad_certificate}};L.verifyCertificateChain=function(e,t){try{var n={};for(var r in e.verifyOptions)n[r]=e.verifyOptions[r];n.verify=function(a,o,s){var l=Kf(a),u=e.verify(e,a,o,s);if(u!==!0){if(typeof u=="object"&&!ae.util.isArray(u)){var c=new Error("The application rejected the certificate.");throw c.send=!0,c.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},u.message&&(c.message=u.message),u.alert&&(c.alert.description=u.alert),c}u!==a&&(u=yR(u))}return u},ae.pki.verifyCertificateChain(e.caStore,t,n)}catch(a){var i=a;(typeof i!="object"||ae.util.isArray(i))&&(i={send:!0,alert:{level:L.Alert.Level.fatal,description:Kf(a)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:L.Alert.Level.fatal,description:Kf(i.error)}),e.error(e,i)}return!e.fail};L.createSessionCache=function(e,t){var n=null;if(e&&e.getSession&&e.setSession&&e.order)n=e;else{n={},n.cache=e||{},n.capacity=Math.max(t||100,1),n.order=[];for(var r in e)n.order.length<=t?n.order.push(r):delete e[r];n.getSession=function(i){var a=null,o=null;if(i?o=ae.util.bytesToHex(i):n.order.length>0&&(o=n.order[0]),o!==null&&o in n.cache){a=n.cache[o],delete n.cache[o];for(var s in n.order)if(n.order[s]===o){n.order.splice(s,1);break}}return a},n.setSession=function(i,a){if(n.order.length===n.capacity){var o=n.order.shift();delete n.cache[o]}var o=ae.util.bytesToHex(i);n.order.push(o),n.cache[o]=a}}return n};L.createConnection=function(e){var t=null;e.caStore?ae.util.isArray(e.caStore)?t=ae.pki.createCaStore(e.caStore):t=e.caStore:t=ae.pki.createCaStore();var n=e.cipherSuites||null;if(n===null){n=[];for(var r in L.CipherSuites)n.push(L.CipherSuites[r])}var i=e.server?L.ConnectionEnd.server:L.ConnectionEnd.client,a=e.sessionCache?L.createSessionCache(e.sessionCache):null,o={version:{major:L.Version.major,minor:L.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:n,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(c,d,h,f){return d},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:ae.util.createBuffer(),tlsData:ae.util.createBuffer(),data:ae.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(c,d){d.origin=d.origin||(c.entity===L.ConnectionEnd.client?"client":"server"),d.send&&(L.queue(c,L.createAlert(c,d.alert)),L.flush(c));var h=d.fatal!==!1;h&&(c.fail=!0),e.error(c,d),h&&c.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};o.reset=function(c){o.version={major:L.Version.major,minor:L.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=o.entity===L.ConnectionEnd.client?rR:cR,o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(c||typeof c>"u"),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=L.createConnectionState(o)},o.reset();var s=function(c,d){var h=d.type-L.ContentType.change_cipher_spec,f=up[c.entity][c.expect];h in f?f[h](c,d):L.handleUnexpected(c,d)},l=function(c){var d=0,h=c.input,f=h.length();if(f<5)d=5-f;else{c.record={type:h.getByte(),version:{major:h.getByte(),minor:h.getByte()},length:h.getInt16(),fragment:ae.util.createBuffer(),ready:!1};var g=c.record.version.major===c.version.major;g&&c.session&&c.session.version&&(g=c.record.version.minor===c.version.minor),g||c.error(c,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return d},u=function(c){var d=0,h=c.input,f=h.length();if(f<c.record.length)d=c.record.length-f;else{c.record.fragment.putBytes(h.getBytes(c.record.length)),h.compact();var g=c.state.current.read;g.update(c,c.record)&&(c.fragmented!==null&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),c.record.ready=!0)}return d};return o.handshake=function(c){if(o.entity!==L.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&o.handshakes===0&&(o.fail=!1),o.handshaking=!0,c=c||"";var d=null;c.length>0&&(o.sessionCache&&(d=o.sessionCache.getSession(c)),d===null&&(c="")),c.length===0&&o.sessionCache&&(d=o.sessionCache.getSession(),d!==null&&(c=d.id)),o.session={id:c,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ae.md.md5.create(),sha1:ae.md.sha1.create()},d&&(o.version=d.version,o.session.sp=d.sp),o.session.sp.client_random=L.createRandom().getBytes(),o.open=!0,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createClientHello(o)})),L.flush(o)}},o.process=function(c){var d=0;return c&&o.input.putBytes(c),o.fail||(o.record!==null&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),o.record===null&&(d=l(o)),!o.fail&&o.record!==null&&!o.record.ready&&(d=u(o)),!o.fail&&o.record!==null&&o.record.ready&&s(o,o.record)),d},o.prepare=function(c){return L.queue(o,L.createRecord(o,{type:L.ContentType.application_data,data:ae.util.createBuffer(c)})),L.flush(o)},o.prepareHeartbeatRequest=function(c,d){return c instanceof ae.util.ByteBuffer&&(c=c.bytes()),typeof d>"u"&&(d=c.length),o.expectedHeartbeatPayload=c,L.queue(o,L.createRecord(o,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,c,d)})),L.flush(o)},o.close=function(c){if(!o.fail&&o.sessionCache&&o.session){var d={id:o.session.id,version:o.session.version,sp:o.session.sp};d.sp.keys=null,o.sessionCache.setSession(d.id,d)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,L.queue(o,L.createAlert(o,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(o)),o.closed(o)),o.reset(c)},o};ae.tls=ae.tls||{};for(var Jf in L)typeof L[Jf]!="function"&&(ae.tls[Jf]=L[Jf]);ae.tls.prf_tls1=uf;ae.tls.hmac_sha1=eR;ae.tls.createSessionCache=L.createSessionCache;ae.tls.createConnection=L.createConnection;var pa=ze,yr=pa.tls;yr.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};yr.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=yr.BulkCipherAlgorithm.aes,e.cipher_type=yr.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=yr.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:OC};function OC(e,t,n){var r=t.entity===pa.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:pa.cipher.createDecipher("AES-CBC",r?n.keys.server_write_key:n.keys.client_write_key),iv:r?n.keys.server_write_IV:n.keys.client_write_IV},e.write.cipherState={init:!1,cipher:pa.cipher.createCipher("AES-CBC",r?n.keys.client_write_key:n.keys.server_write_key),iv:r?n.keys.client_write_IV:n.keys.server_write_IV},e.read.cipherFunction=SR,e.write.cipherFunction=xR,e.read.macLength=e.write.macLength=n.mac_length,e.read.macFunction=e.write.macFunction=yr.hmac_sha1}function xR(e,t){var n=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var i;e.version.minor===yr.Versions.TLS_1_0.minor?i=t.cipherState.init?null:t.cipherState.iv:i=pa.random.getBytesSync(16),t.cipherState.init=!0;var a=t.cipherState.cipher;return a.start({iv:i}),e.version.minor>=yr.Versions.TLS_1_1.minor&&a.output.putBytes(i),a.update(e.fragment),a.finish(CR)&&(e.fragment=a.output,e.length=e.fragment.length(),n=!0),n}function CR(e,t,n){if(!n){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function ER(e,t,n){var r=!0;if(n){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)r=r&&t.at(o)==a;r&&t.truncate(a+1)}return r}function SR(e,t){var n=!1,r;e.version.minor===yr.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var i=t.cipherState.cipher;i.start({iv:r}),i.update(e.fragment),n=i.finish(ER);var a=t.macLength,o=pa.random.getBytesSync(a),s=i.output.length();s>=a?(e.fragment=i.output.getBytes(s-a),o=i.output.getBytes(a)):e.fragment=i.output.getBytes(),e.fragment=pa.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),n=wR(t.macKey,o,l)&&n,n}function wR(e,t,n){var r=pa.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(n),n=r.digest().getBytes(),t===n}var It=ze,hu=It.sha512=It.sha512||{};It.md.sha512=It.md.algorithms.sha512=hu;var VC=It.sha384=It.sha512.sha384=It.sha512.sha384||{};VC.create=function(){return hu.create("SHA-384")};It.md.sha384=It.md.algorithms.sha384=VC;It.sha512.sha256=It.sha512.sha256||{create:function(){return hu.create("SHA-512/256")}};It.md["sha512/256"]=It.md.algorithms["sha512/256"]=It.sha512.sha256;It.sha512.sha224=It.sha512.sha224||{create:function(){return hu.create("SHA-512/224")}};It.md["sha512/224"]=It.md.algorithms["sha512/224"]=It.sha512.sha224;hu.create=function(e){if(HC||IR(),typeof e>"u"&&(e="SHA-512"),!(e in Ua))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Ua[e],n=null,r=It.util.createBuffer(),i=new Array(80),a=0;a<80;++a)i[a]=new Array(2);var o=64;switch(e){case"SHA-384":o=48;break;case"SHA-512/256":o=32;break;case"SHA-512/224":o=28;break}var s={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:o,messageLength:0,fullMessageLength:null,messageLengthSize:16};return s.start=function(){s.messageLength=0,s.fullMessageLength=s.messageLength128=[];for(var l=s.messageLengthSize/4,u=0;u<l;++u)s.fullMessageLength.push(0);r=It.util.createBuffer(),n=new Array(t.length);for(var u=0;u<t.length;++u)n[u]=t[u].slice(0);return s},s.start(),s.update=function(l,u){u==="utf8"&&(l=It.util.encodeUtf8(l));var c=l.length;s.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var d=s.fullMessageLength.length-1;d>=0;--d)s.fullMessageLength[d]+=c[1],c[1]=c[0]+(s.fullMessageLength[d]/4294967296>>>0),s.fullMessageLength[d]=s.fullMessageLength[d]>>>0,c[0]=c[1]/4294967296>>>0;return r.putBytes(l),k1(n,i,r),(r.read>2048||r.length()===0)&&r.compact(),s},s.digest=function(){var l=It.util.createBuffer();l.putBytes(r.bytes());var u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize,c=u&s.blockLength-1;l.putBytes(B0.substr(0,s.blockLength-c));for(var d,h,f=s.fullMessageLength[0]*8,g=0;g<s.fullMessageLength.length-1;++g)d=s.fullMessageLength[g+1]*8,h=d/4294967296>>>0,f+=h,l.putInt32(f>>>0),f=d>>>0;l.putInt32(f);for(var p=new Array(n.length),g=0;g<n.length;++g)p[g]=n[g].slice(0);k1(p,i,l);var m=It.util.createBuffer(),b;e==="SHA-512"?b=p.length:e==="SHA-384"?b=p.length-2:b=p.length-4;for(var g=0;g<b;++g)m.putInt32(p[g][0]),(g!==b-1||e!=="SHA-512/224")&&m.putInt32(p[g][1]);return m},s};var B0=null,HC=!1,$0=null,Ua=null;function IR(){B0="€",B0+=It.util.fillString("\0",128),$0=[[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]],Ua={},Ua["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Ua["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Ua["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Ua["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],HC=!0}function k1(e,t,n){for(var r,i,a,o,s,l,u,c,d,h,f,g,p,m,b,v,x,C,E,w,B,y,S,D,A,T,F,k,P,$,R,O,j,V,W,U=n.length();U>=128;){for(P=0;P<16;++P)t[P][0]=n.getInt32()>>>0,t[P][1]=n.getInt32()>>>0;for(;P<80;++P)O=t[P-2],$=O[0],R=O[1],r=(($>>>19|R<<13)^(R>>>29|$<<3)^$>>>6)>>>0,i=(($<<13|R>>>19)^(R<<3|$>>>29)^($<<26|R>>>6))>>>0,V=t[P-15],$=V[0],R=V[1],a=(($>>>1|R<<31)^($>>>8|R<<24)^$>>>7)>>>0,o=(($<<31|R>>>1)^($<<24|R>>>8)^($<<25|R>>>7))>>>0,j=t[P-7],W=t[P-16],R=i+j[1]+o+W[1],t[P][0]=r+j[0]+a+W[0]+(R/4294967296>>>0)>>>0,t[P][1]=R>>>0;for(p=e[0][0],m=e[0][1],b=e[1][0],v=e[1][1],x=e[2][0],C=e[2][1],E=e[3][0],w=e[3][1],B=e[4][0],y=e[4][1],S=e[5][0],D=e[5][1],A=e[6][0],T=e[6][1],F=e[7][0],k=e[7][1],P=0;P<80;++P)u=((B>>>14|y<<18)^(B>>>18|y<<14)^(y>>>9|B<<23))>>>0,c=((B<<18|y>>>14)^(B<<14|y>>>18)^(y<<23|B>>>9))>>>0,d=(A^B&(S^A))>>>0,h=(T^y&(D^T))>>>0,s=((p>>>28|m<<4)^(m>>>2|p<<30)^(m>>>7|p<<25))>>>0,l=((p<<4|m>>>28)^(m<<30|p>>>2)^(m<<25|p>>>7))>>>0,f=(p&b|x&(p^b))>>>0,g=(m&v|C&(m^v))>>>0,R=k+c+h+$0[P][1]+t[P][1],r=F+u+d+$0[P][0]+t[P][0]+(R/4294967296>>>0)>>>0,i=R>>>0,R=l+g,a=s+f+(R/4294967296>>>0)>>>0,o=R>>>0,F=A,k=T,A=S,T=D,S=B,D=y,R=w+i,B=E+r+(R/4294967296>>>0)>>>0,y=R>>>0,E=x,w=C,x=b,C=v,b=p,v=m,R=i+o,p=r+a+(R/4294967296>>>0)>>>0,m=R>>>0;R=e[0][1]+m,e[0][0]=e[0][0]+p+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+v,e[1][0]=e[1][0]+b+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+C,e[2][0]=e[2][0]+x+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+w,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+y,e[4][0]=e[4][0]+B+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+D,e[5][0]=e[5][0]+S+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+T,e[6][0]=e[6][0]+A+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+k,e[7][0]=e[7][0]+F+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,U-=128}}var cp={},_R=ze,nn=_R.asn1;cp.privateKeyValidator={name:"PrivateKeyInfo",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:nn.Class.UNIVERSAL,type:nn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:nn.Class.UNIVERSAL,type:nn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:nn.Class.UNIVERSAL,type:nn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};cp.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:nn.Class.UNIVERSAL,type:nn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:nn.Class.UNIVERSAL,type:nn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:nn.Class.UNIVERSAL,type:nn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]};var gn=ze,jC=cp,DR=jC.publicKeyValidator,AR=jC.privateKeyValidator;if(typeof TR>"u")var TR=gn.jsbn.BigInteger;var k0=gn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;gn.pki=gn.pki||{};gn.pki.ed25519=gn.ed25519=gn.ed25519||{};var Ze=gn.ed25519;Ze.constants={};Ze.constants.PUBLIC_KEY_BYTE_LENGTH=32;Ze.constants.PRIVATE_KEY_BYTE_LENGTH=64;Ze.constants.SEED_BYTE_LENGTH=32;Ze.constants.SIGN_BYTE_LENGTH=64;Ze.constants.HASH_BYTE_LENGTH=64;Ze.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=gn.random.getBytesSync(Ze.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==Ze.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Ze.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Oi({message:t,encoding:"binary"});for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=new Hn(Ze.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)r[i]=t[i];return kR(n,r),{publicKey:n,privateKey:r}};Ze.privateKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,AR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.privateKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.privateKey,l=Oi({message:gn.asn1.fromDer(s).value,encoding:"binary"});return{privateKeyBytes:l}};Ze.publicKeyFromAsn1=function(e){var t={},n=[],r=gn.asn1.validate(e,DR,t,n);if(!r){var i=new Error("Invalid Key.");throw i.errors=n,i}var a=gn.asn1.derToOid(t.publicKeyOid),o=gn.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var s=t.ed25519PublicKey;if(s.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Oi({message:s,encoding:"binary"})};Ze.publicKeyFromPrivateKey=function(e){e=e||{};var t=Oi({message:e.privateKey,encoding:"binary"});if(t.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);for(var n=new Hn(Ze.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<n.length;++r)n[r]=t[32+r];return n};Ze.sign=function(e){e=e||{};var t=Oi(e),n=Oi({message:e.privateKey,encoding:"binary"});if(n.length===Ze.constants.SEED_BYTE_LENGTH){var r=Ze.generateKeyPair({seed:n});n=r.privateKey}else if(n.length!==Ze.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Ze.constants.SEED_BYTE_LENGTH+" or "+Ze.constants.PRIVATE_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length);PR(i,t,t.length,n);for(var a=new Hn(Ze.constants.SIGN_BYTE_LENGTH),o=0;o<a.length;++o)a[o]=i[o];return a};Ze.verify=function(e){e=e||{};var t=Oi(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var n=Oi({message:e.signature,encoding:"binary"});if(n.length!==Ze.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Ze.constants.SIGN_BYTE_LENGTH);var r=Oi({message:e.publicKey,encoding:"binary"});if(r.length!==Ze.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Ze.constants.PUBLIC_KEY_BYTE_LENGTH);var i=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),a=new Hn(Ze.constants.SIGN_BYTE_LENGTH+t.length),o;for(o=0;o<Ze.constants.SIGN_BYTE_LENGTH;++o)i[o]=n[o];for(o=0;o<t.length;++o)i[o+Ze.constants.SIGN_BYTE_LENGTH]=t[o];return FR(a,i,i.length,r)>=0};function Oi(e){var t=e.message;if(t instanceof Uint8Array||t instanceof Hn)return t;var n=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),n="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,n);t=new k0(t,n)}else if(!(t instanceof k0))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 r=new Hn(t.length()),i=0;i<r.length;++i)r[i]=t.at(i);return r}var P0=ke(),id=ke([1]),RR=ke([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),BR=ke([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),P1=ke([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),F1=ke([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),qf=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]),$R=ke([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function dl(e,t){var n=gn.md.sha512.create(),r=new k0(e);n.update(r.getBytes(t),"binary");var i=n.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(i,"binary");for(var a=new Hn(Ze.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)a[o]=i.charCodeAt(o);return a}function kR(e,t){var n=[ke(),ke(),ke(),ke()],r,i=dl(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,fp(n,i),dp(e,n),r=0;r<32;++r)t[r+32]=e[r];return 0}function PR(e,t,n,r){var i,a,o=new Float64Array(64),s=[ke(),ke(),ke(),ke()],l=dl(r,32);l[0]&=248,l[31]&=127,l[31]|=64;var u=n+64;for(i=0;i<n;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=l[32+i];var c=dl(e.subarray(32),n+32);for(F0(c),fp(s,c),dp(e,s),i=32;i<64;++i)e[i]=r[i];var d=dl(e,n+64);for(F0(d),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=c[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=d[i]*l[a];return WC(e.subarray(32),o),u}function FR(e,t,n,r){var i,a,o=new Hn(32),s=[ke(),ke(),ke(),ke()],l=[ke(),ke(),ke(),ke()];if(a=-1,n<64||NR(l,r))return-1;for(i=0;i<n;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=r[i];var u=dl(e,n);if(F0(u),UC(s,l,u),fp(l,t.subarray(32)),N0(s,l),dp(o,s),n-=64,zC(t,0,o,0)){for(i=0;i<n;++i)e[i]=0;return-1}for(i=0;i<n;++i)e[i]=t[i+64];return a=n,a}function WC(e,t){var n,r,i,a;for(r=63;r>=32;--r){for(n=0,i=r-32,a=r-12;i<a;++i)t[i]+=n-16*t[r]*qf[i-(r-32)],n=t[i]+128>>8,t[i]-=n*256;t[i]+=n,t[r]=0}for(n=0,i=0;i<32;++i)t[i]+=n-(t[31]>>4)*qf[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=n*qf[i];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function F0(e){for(var t=new Float64Array(64),n=0;n<64;++n)t[n]=e[n],e[n]=0;WC(e,t)}function N0(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke(),u=ke(),c=ke();Yo(n,e[1],e[0]),Yo(c,t[1],t[0]),vt(n,n,c),Go(r,e[0],e[1]),Go(c,t[0],t[1]),vt(r,r,c),vt(i,e[3],t[3]),vt(i,i,BR),vt(a,e[2],t[2]),Go(a,a,a),Yo(o,r,n),Yo(s,a,i),Go(l,a,i),Go(u,r,n),vt(e[0],o,s),vt(e[1],u,l),vt(e[2],l,s),vt(e[3],o,u)}function N1(e,t,n){for(var r=0;r<4;++r)XC(e[r],t[r],n)}function dp(e,t){var n=ke(),r=ke(),i=ke();VR(i,t[2]),vt(n,t[0],i),vt(r,t[1],i),ad(e,r),e[31]^=GC(n)<<7}function ad(e,t){var n,r,i,a=ke(),o=ke();for(n=0;n<16;++n)o[n]=t[n];for(Qf(o),Qf(o),Qf(o),r=0;r<2;++r){for(a[0]=o[0]-65517,n=1;n<15;++n)a[n]=o[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,XC(o,a,1-i)}for(n=0;n<16;n++)e[2*n]=o[n]&255,e[2*n+1]=o[n]>>8}function NR(e,t){var n=ke(),r=ke(),i=ke(),a=ke(),o=ke(),s=ke(),l=ke();return sa(e[2],id),MR(e[1],t),Xa(i,e[1]),vt(a,i,RR),Yo(i,i,e[2]),Go(a,e[2],a),Xa(o,a),Xa(s,o),vt(l,s,o),vt(n,l,i),vt(n,n,a),LR(n,n),vt(n,n,i),vt(n,n,a),vt(n,n,a),vt(e[0],n,a),Xa(r,e[0]),vt(r,r,a),M1(r,i)&&vt(e[0],e[0],$R),Xa(r,e[0]),vt(r,r,a),M1(r,i)?-1:(GC(e[0])===t[31]>>7&&Yo(e[0],P0,e[0]),vt(e[3],e[0],e[1]),0)}function MR(e,t){var n;for(n=0;n<16;++n)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function LR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)Xa(n,n),r!==1&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function M1(e,t){var n=new Hn(32),r=new Hn(32);return ad(n,e),ad(r,t),zC(n,0,r,0)}function zC(e,t,n,r){return OR(e,t,n,r,32)}function OR(e,t,n,r,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^n[r+a];return(1&o-1>>>8)-1}function GC(e){var t=new Hn(32);return ad(t,e),t[0]&1}function UC(e,t,n){var r,i;for(sa(e[0],P0),sa(e[1],id),sa(e[2],id),sa(e[3],P0),i=255;i>=0;--i)r=n[i/8|0]>>(i&7)&1,N1(e,t,r),N0(t,e),N0(e,e),N1(e,t,r)}function fp(e,t){var n=[ke(),ke(),ke(),ke()];sa(n[0],P1),sa(n[1],F1),sa(n[2],id),vt(n[3],P1,F1),UC(e,n,t)}function sa(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function VR(e,t){var n=ke(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)Xa(n,n),r!==2&&r!==4&&vt(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function Qf(e){var t,n,r=1;for(t=0;t<16;++t)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function XC(e,t,n){for(var r,i=~(n-1),a=0;a<16;++a)r=i&(e[a]^t[a]),e[a]^=r,t[a]^=r}function ke(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;++t)n[t]=e[t];return n}function Go(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]+n[r]}function Yo(e,t,n){for(var r=0;r<16;++r)e[r]=t[r]-n[r]}function Xa(e,t){vt(e,t,t)}function vt(e,t,n){var r,i,a=0,o=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,g=0,p=0,m=0,b=0,v=0,x=0,C=0,E=0,w=0,B=0,y=0,S=0,D=0,A=0,T=0,F=0,k=0,P=0,$=0,R=0,O=0,j=0,V=n[0],W=n[1],U=n[2],K=n[3],ee=n[4],z=n[5],H=n[6],X=n[7],te=n[8],ie=n[9],le=n[10],ce=n[11],Q=n[12],be=n[13],Ce=n[14],Se=n[15];r=t[0],a+=r*V,o+=r*W,s+=r*U,l+=r*K,u+=r*ee,c+=r*z,d+=r*H,h+=r*X,f+=r*te,g+=r*ie,p+=r*le,m+=r*ce,b+=r*Q,v+=r*be,x+=r*Ce,C+=r*Se,r=t[1],o+=r*V,s+=r*W,l+=r*U,u+=r*K,c+=r*ee,d+=r*z,h+=r*H,f+=r*X,g+=r*te,p+=r*ie,m+=r*le,b+=r*ce,v+=r*Q,x+=r*be,C+=r*Ce,E+=r*Se,r=t[2],s+=r*V,l+=r*W,u+=r*U,c+=r*K,d+=r*ee,h+=r*z,f+=r*H,g+=r*X,p+=r*te,m+=r*ie,b+=r*le,v+=r*ce,x+=r*Q,C+=r*be,E+=r*Ce,w+=r*Se,r=t[3],l+=r*V,u+=r*W,c+=r*U,d+=r*K,h+=r*ee,f+=r*z,g+=r*H,p+=r*X,m+=r*te,b+=r*ie,v+=r*le,x+=r*ce,C+=r*Q,E+=r*be,w+=r*Ce,B+=r*Se,r=t[4],u+=r*V,c+=r*W,d+=r*U,h+=r*K,f+=r*ee,g+=r*z,p+=r*H,m+=r*X,b+=r*te,v+=r*ie,x+=r*le,C+=r*ce,E+=r*Q,w+=r*be,B+=r*Ce,y+=r*Se,r=t[5],c+=r*V,d+=r*W,h+=r*U,f+=r*K,g+=r*ee,p+=r*z,m+=r*H,b+=r*X,v+=r*te,x+=r*ie,C+=r*le,E+=r*ce,w+=r*Q,B+=r*be,y+=r*Ce,S+=r*Se,r=t[6],d+=r*V,h+=r*W,f+=r*U,g+=r*K,p+=r*ee,m+=r*z,b+=r*H,v+=r*X,x+=r*te,C+=r*ie,E+=r*le,w+=r*ce,B+=r*Q,y+=r*be,S+=r*Ce,D+=r*Se,r=t[7],h+=r*V,f+=r*W,g+=r*U,p+=r*K,m+=r*ee,b+=r*z,v+=r*H,x+=r*X,C+=r*te,E+=r*ie,w+=r*le,B+=r*ce,y+=r*Q,S+=r*be,D+=r*Ce,A+=r*Se,r=t[8],f+=r*V,g+=r*W,p+=r*U,m+=r*K,b+=r*ee,v+=r*z,x+=r*H,C+=r*X,E+=r*te,w+=r*ie,B+=r*le,y+=r*ce,S+=r*Q,D+=r*be,A+=r*Ce,T+=r*Se,r=t[9],g+=r*V,p+=r*W,m+=r*U,b+=r*K,v+=r*ee,x+=r*z,C+=r*H,E+=r*X,w+=r*te,B+=r*ie,y+=r*le,S+=r*ce,D+=r*Q,A+=r*be,T+=r*Ce,F+=r*Se,r=t[10],p+=r*V,m+=r*W,b+=r*U,v+=r*K,x+=r*ee,C+=r*z,E+=r*H,w+=r*X,B+=r*te,y+=r*ie,S+=r*le,D+=r*ce,A+=r*Q,T+=r*be,F+=r*Ce,k+=r*Se,r=t[11],m+=r*V,b+=r*W,v+=r*U,x+=r*K,C+=r*ee,E+=r*z,w+=r*H,B+=r*X,y+=r*te,S+=r*ie,D+=r*le,A+=r*ce,T+=r*Q,F+=r*be,k+=r*Ce,P+=r*Se,r=t[12],b+=r*V,v+=r*W,x+=r*U,C+=r*K,E+=r*ee,w+=r*z,B+=r*H,y+=r*X,S+=r*te,D+=r*ie,A+=r*le,T+=r*ce,F+=r*Q,k+=r*be,P+=r*Ce,$+=r*Se,r=t[13],v+=r*V,x+=r*W,C+=r*U,E+=r*K,w+=r*ee,B+=r*z,y+=r*H,S+=r*X,D+=r*te,A+=r*ie,T+=r*le,F+=r*ce,k+=r*Q,P+=r*be,$+=r*Ce,R+=r*Se,r=t[14],x+=r*V,C+=r*W,E+=r*U,w+=r*K,B+=r*ee,y+=r*z,S+=r*H,D+=r*X,A+=r*te,T+=r*ie,F+=r*le,k+=r*ce,P+=r*Q,$+=r*be,R+=r*Ce,O+=r*Se,r=t[15],C+=r*V,E+=r*W,w+=r*U,B+=r*K,y+=r*ee,S+=r*z,D+=r*H,A+=r*X,T+=r*te,F+=r*ie,k+=r*le,P+=r*ce,$+=r*Q,R+=r*be,O+=r*Ce,j+=r*Se,a+=38*E,o+=38*w,s+=38*B,l+=38*y,u+=38*S,c+=38*D,d+=38*A,h+=38*T,f+=38*F,g+=38*k,p+=38*P,m+=38*$,b+=38*R,v+=38*O,x+=38*j,i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),i=1,r=a+i+65535,i=Math.floor(r/65536),a=r-i*65536,r=o+i+65535,i=Math.floor(r/65536),o=r-i*65536,r=s+i+65535,i=Math.floor(r/65536),s=r-i*65536,r=l+i+65535,i=Math.floor(r/65536),l=r-i*65536,r=u+i+65535,i=Math.floor(r/65536),u=r-i*65536,r=c+i+65535,i=Math.floor(r/65536),c=r-i*65536,r=d+i+65535,i=Math.floor(r/65536),d=r-i*65536,r=h+i+65535,i=Math.floor(r/65536),h=r-i*65536,r=f+i+65535,i=Math.floor(r/65536),f=r-i*65536,r=g+i+65535,i=Math.floor(r/65536),g=r-i*65536,r=p+i+65535,i=Math.floor(r/65536),p=r-i*65536,r=m+i+65535,i=Math.floor(r/65536),m=r-i*65536,r=b+i+65535,i=Math.floor(r/65536),b=r-i*65536,r=v+i+65535,i=Math.floor(r/65536),v=r-i*65536,r=x+i+65535,i=Math.floor(r/65536),x=r-i*65536,r=C+i+65535,i=Math.floor(r/65536),C=r-i*65536,a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=l,e[4]=u,e[5]=c,e[6]=d,e[7]=h,e[8]=f,e[9]=g,e[10]=p,e[11]=m,e[12]=b,e[13]=v,e[14]=x,e[15]=C}var Jn=ze;Jn.kem=Jn.kem||{};var L1=Jn.jsbn.BigInteger;Jn.kem.rsa={};Jn.kem.rsa.create=function(e,t){t=t||{};var n=t.prng||Jn.random,r={};return r.encrypt=function(i,a){var o=Math.ceil(i.n.bitLength()/8),s;do s=new L1(Jn.util.bytesToHex(n.getBytesSync(o)),16).mod(i.n);while(s.compareTo(L1.ONE)<=0);s=Jn.util.hexToBytes(s.toString(16));var l=o-s.length;l>0&&(s=Jn.util.fillString("\0",l)+s);var u=i.encrypt(s,"NONE"),c=e.generate(s,a);return{encapsulation:u,key:c}},r.decrypt=function(i,a,o){var s=i.decrypt(a,"NONE");return e.generate(s,o)},r};Jn.kem.kdf1=function(e,t){ZC(this,e,0,t||e.digestLength)};Jn.kem.kdf2=function(e,t){ZC(this,e,1,t||e.digestLength)};function ZC(e,t,n,r){e.generate=function(i,a){for(var o=new Jn.util.ByteBuffer,s=Math.ceil(a/r)+n,l=new Jn.util.ByteBuffer,u=n;u<s;++u){l.putInt32(u),t.start(),t.update(i+l.getBytes());var c=t.digest();o.putBytes(c.getBytes(r))}return o.truncate(o.length()-a),o.getBytes()}}var Je=ze;Je.log=Je.log||{};Je.log.levels=["none","error","warning","info","debug","verbose","max"];var od={},M0=[],fl=null;Je.log.LEVEL_LOCKED=2;Je.log.NO_LEVEL_CHECK=4;Je.log.INTERPOLATE=8;for(var la=0;la<Je.log.levels.length;++la){var O1=Je.log.levels[la];od[O1]={index:la,name:O1.toUpperCase()}}Je.log.logMessage=function(e){for(var t=od[e.level].index,n=0;n<M0.length;++n){var r=M0[n];if(r.flags&Je.log.NO_LEVEL_CHECK)r.f(e);else{var i=od[r.level].index;t<=i&&r.f(r,e)}}};Je.log.prepareStandard=function(e){"standard"in e||(e.standard=od[e.level].name+" ["+e.category+"] "+e.message)};Je.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=Je.util.format.apply(this,t)}};Je.log.prepareStandardFull=function(e){"standardFull"in e||(Je.log.prepareStandard(e),e.standardFull=e.standard)};for(var V1=["error","warning","info","debug","verbose"],la=0;la<V1.length;++la)(function(t){Je.log[t]=function(n,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:t,category:n,message:r,arguments:i};Je.log.logMessage(a)}})(V1[la]);Je.log.makeLogger=function(e){var t={flags:0,f:e};return Je.log.setLevel(t,"none"),t};Je.log.setLevel=function(e,t){var n=!1;if(e&&!(e.flags&Je.log.LEVEL_LOCKED))for(var r=0;r<Je.log.levels.length;++r){var i=Je.log.levels[r];if(t==i){e.level=t,n=!0;break}}return n};Je.log.lock=function(e,t){typeof t>"u"||t?e.flags|=Je.log.LEVEL_LOCKED:e.flags&=~Je.log.LEVEL_LOCKED};Je.log.addLogger=function(e){M0.push(e)};if(typeof console<"u"&&"log"in console){var Ls;if(console.error&&console.warn&&console.info&&console.debug){var HR={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},hp=function(e,t){Je.log.prepareStandard(t);var n=HR[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),n.apply(console,r)};Ls=Je.log.makeLogger(hp)}else{var hp=function(t,n){Je.log.prepareStandardFull(n),console.log(n.standardFull)};Ls=Je.log.makeLogger(hp)}Je.log.setLevel(Ls,"debug"),Je.log.addLogger(Ls),fl=Ls}else console={log:function(){}};if(fl!==null&&typeof window<"u"&&window.location){var Pu=new URL(window.location.href).searchParams;if(Pu.has("console.level")&&Je.log.setLevel(fl,Pu.get("console.level").slice(-1)[0]),Pu.has("console.lock")){var jR=Pu.get("console.lock").slice(-1)[0];jR=="true"&&Je.log.lock(fl)}}Je.log.consoleLogger=fl;var he=ze,Z=he.asn1,An=he.pkcs7=he.pkcs7||{};An.messageFromPem=function(e){var t=he.pem.decode(e)[0];if(t.type!=="PKCS7"){var n=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=Z.fromDer(t.body);return An.messageFromAsn1(r)};An.messageToPem=function(e,t){var n={type:"PKCS7",body:Z.toDer(e.toAsn1()).getBytes()};return he.pem.encode(n,{maxline:t})};An.messageFromAsn1=function(e){var t={},n=[];if(!Z.validate(e,An.asn1.contentInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=n,r}var i=Z.derToOid(t.contentType),a;switch(i){case he.pki.oids.envelopedData:a=An.createEnvelopedData();break;case he.pki.oids.encryptedData:a=An.createEncryptedData();break;case he.pki.oids.signedData:a=An.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+i+" is not (yet) supported.")}return a.fromAsn1(t.content.value[0]),a};An.createSignedData=function(){var e=null;return e={type:he.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(gp(e,r,An.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var i=e.rawCapture.certificates.value,a=0;a<i.length;++a)e.certificates.push(he.pki.certificateFromAsn1(i[a]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],i=0;i<e.certificates.length;++i)r.push(he.pki.certificateToAsn1(e.certificates[i]));var a=[],o=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,r)),a.length>0&&o.value[0].value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,e.signerInfos)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),o])},addSigner:function(r){var i=r.issuer,a=r.serialNumber;if(r.certificate){var o=r.certificate;typeof o=="string"&&(o=he.pki.certificateFromPem(o)),i=o.issuer.attributes,a=o.serialNumber}var s=r.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof s=="string"&&(s=he.pki.privateKeyFromPem(s));var l=r.digestAlgorithm||he.pki.oids.sha1;switch(l){case he.pki.oids.sha1:case he.pki.oids.sha256:case he.pki.oids.sha384:case he.pki.oids.sha512:case he.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var u=r.authenticatedAttributes||[];if(u.length>0){for(var c=!1,d=!1,h=0;h<u.length;++h){var f=u[h];if(!c&&f.type===he.pki.oids.contentType){if(c=!0,d)break;continue}if(!d&&f.type===he.pki.oids.messageDigest){if(d=!0,c)break;continue}}if(!c||!d)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.")}e.signers.push({key:s,version:1,issuer:i,serialNumber:a,digestAlgorithm:l,signatureAlgorithm:he.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes())]),"content"in e)){var i;e.content instanceof he.util.ByteBuffer?i=e.content.bytes():typeof e.content=="string"&&(i=he.util.encodeUtf8(e.content)),r.detached?e.detachedContent=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i):e.contentInfo.value.push(Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,i)]))}if(e.signers.length!==0){var a=t();n(a)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=he.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},i=0;i<e.signers.length;++i){var a=e.signers[i],o=a.digestAlgorithm;o in r||(r[o]=he.md[he.pki.oids[o]].create()),a.authenticatedAttributes.length===0?a.md=r[o]:a.md=he.md[he.pki.oids[o]].create()}e.digestAlgorithmIdentifiers=[];for(var o in r)e.digestAlgorithmIdentifiers.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(o).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]));return r}function n(r){var i;if(e.detachedContent?i=e.detachedContent:(i=e.contentInfo.value[1],i=i.value[0]),!i)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=Z.derToOid(e.contentInfo.value[0].value),o=Z.toDer(i);o.getByte(),Z.getBerValueLength(o),o=o.getBytes();for(var s in r)r[s].start().update(o);for(var l=new Date,u=0;u<e.signers.length;++u){var c=e.signers[u];if(c.authenticatedAttributes.length===0){if(a!==he.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{c.authenticatedAttributesAsn1=Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[]),h=0;h<c.authenticatedAttributes.length;++h){var f=c.authenticatedAttributes[h];f.type===he.pki.oids.messageDigest?f.value=r[c.digestAlgorithm].digest():f.type===he.pki.oids.signingTime&&(f.value||(f.value=l)),d.value.push(L0(f)),c.authenticatedAttributesAsn1.value.push(L0(f))}o=Z.toDer(d).getBytes(),c.md.start().update(o)}c.signature=c.key.sign(c.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=ZR(e.signers)}};An.createEncryptedData=function(){var e=null;return e={type:he.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){gp(e,t,An.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),YC(e)}},e};An.createEnvelopedData=function(){var e=null;return e={type:he.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:he.pki.oids["aes256-CBC"]},fromAsn1:function(t){var n=gp(e,t,An.asn1.envelopedDataValidator);e.recipients=GR(n.recipientInfos.value)},toAsn1:function(){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,UR(e.recipients)),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,YR(e.encryptedContent))])])])},findRecipient:function(t){for(var n=t.issuer.attributes,r=0;r<e.recipients.length;++r){var i=e.recipients[r],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===n.length){for(var o=!0,s=0;s<n.length;++s)if(a[s].type!==n[s].type||a[s].value!==n[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,n){if(e.encryptedContent.key===void 0&&t!==void 0&&n!==void 0)switch(t.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:case he.pki.oids.desCBC:var r=n.decrypt(t.encryptedContent.content);e.encryptedContent.key=he.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}YC(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:he.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,n){if(e.encryptedContent.content===void 0){n=n||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,i,a;switch(n){case he.pki.oids["aes128-CBC"]:r=16,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes192-CBC"]:r=24,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["aes256-CBC"]:r=32,i=16,a=he.aes.createEncryptionCipher;break;case he.pki.oids["des-EDE3-CBC"]:r=24,i=8,a=he.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+n)}if(t===void 0)t=he.util.createBuffer(he.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=n,e.encryptedContent.key=t,e.encryptedContent.parameter=he.util.createBuffer(he.random.getBytes(i));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var s=0;s<e.recipients.length;++s){var l=e.recipients[s];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case he.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}}},e};function WR(e){var t={},n=[];if(!Z.validate(e,An.asn1.recipientInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=n,r}return{version:t.version.charCodeAt(0),issuer:he.pki.RDNAttributesAsArray(t.issuer),serialNumber:he.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:Z.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function zR(e){return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.encryptedContent.algorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")]),Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function GR(e){for(var t=[],n=0;n<e.length;++n)t.push(WR(e[n]));return t}function UR(e){for(var t=[],n=0;n<e.length;++n)t.push(zR(e[n]));return t}function XR(e){var t=Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,Z.integerToDer(e.version).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[he.pki.distinguishedNameToAsn1({attributes:e.issuer}),Z.create(Z.Class.UNIVERSAL,Z.Type.INTEGER,!1,he.util.hexToBytes(e.serialNumber))]),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.digestAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.signatureAlgorithm).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.NULL,!1,"")])),t.value.push(Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=Z.create(Z.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var i=e.unauthenticatedAttributes[r];n.values.push(L0(i))}t.value.push(n)}return t}function ZR(e){for(var t=[],n=0;n<e.length;++n)t.push(XR(e[n]));return t}function L0(e){var t;if(e.type===he.pki.oids.contentType)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.value).getBytes());else if(e.type===he.pki.oids.messageDigest)t=Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===he.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),i=e.value;if(typeof i=="string"){var a=Date.parse(i);isNaN(a)?i.length===13?i=Z.utcTimeToDate(i):i=Z.generalizedTimeToDate(i):i=new Date(a)}i>=n&&i<r?t=Z.create(Z.Class.UNIVERSAL,Z.Type.UTCTIME,!1,Z.dateToUtcTime(i)):t=Z.create(Z.Class.UNIVERSAL,Z.Type.GENERALIZEDTIME,!1,Z.dateToGeneralizedTime(i))}return Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.type).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SET,!0,[t])])}function YR(e){return[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(he.pki.oids.data).getBytes()),Z.create(Z.Class.UNIVERSAL,Z.Type.SEQUENCE,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OID,!1,Z.oidToDer(e.algorithm).getBytes()),e.parameter?Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),Z.create(Z.Class.CONTEXT_SPECIFIC,0,!0,[Z.create(Z.Class.UNIVERSAL,Z.Type.OCTETSTRING,!1,e.content.getBytes())])]}function gp(e,t,n){var r={},i=[];if(!Z.validate(t,n,r,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}var o=Z.derToOid(r.contentType);if(o!==he.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var s="";if(he.util.isArray(r.encryptedContent))for(var l=0;l<r.encryptedContent.length;++l){if(r.encryptedContent[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=r.encryptedContent[l].value}else s=r.encryptedContent;e.encryptedContent={algorithm:Z.derToOid(r.encAlgorithm),parameter:he.util.createBuffer(r.encParameter.value),content:he.util.createBuffer(s)}}if(r.content){var s="";if(he.util.isArray(r.content))for(var l=0;l<r.content.length;++l){if(r.content[l].type!==Z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=r.content[l].value}else s=r.content;e.content=he.util.createBuffer(s)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function YC(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case he.pki.oids["aes128-CBC"]:case he.pki.oids["aes192-CBC"]:case he.pki.oids["aes256-CBC"]:t=he.aes.createDecryptionCipher(e.encryptedContent.key);break;case he.pki.oids.desCBC:case he.pki.oids["des-EDE3-CBC"]:t=he.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}var zt=ze,cf=zt.ssh=zt.ssh||{};cf.privateKeyToPutty=function(e,t,n){n=n||"",t=t||"";var r="ssh-rsa",i=t===""?"none":"aes256-cbc",a="PuTTY-User-Key-File-2: "+r+`\r
15
15
  `;a+="Encryption: "+i+`\r
16
16
  `,a+="Comment: "+n+`\r
17
17
  `;var o=zt.util.createBuffer();Ko(o,r),Kr(o,e.e),Kr(o,e.n);var s=zt.util.encode64(o.bytes(),64),l=Math.floor(s.length/66)+1;a+="Public-Lines: "+l+`\r
@@ -31,10 +31,10 @@ Private-MAC: `+v.digest().toHex()+`\r
31
31
  8.57931 4.89118 6.85872C6.05378 5.13813 7.76522 3.86239 9.7462 3.23967C11.7272 2.61695 13.8607 \r
32
32
  2.68403 15.7987 3.42996C17.296 4.0063 18.6083 4.96159 19.6129 6.19191C20.1049 \r
33
33
  6.79445 20.9604 7.02733 21.6311 6.63315Z`,fill:"currentColor"})}),jn=I.forwardRef((e,t)=>{const{size:n="reguler",variants:r="primary-laba-blue-10",startIcon:i=()=>_.jsx(_.Fragment,{}),endIcon:a=()=>_.jsx(_.Fragment,{}),children:o,className:s,classNameIconLoading:l,loading:u,onClick:c,type:d="button",disabled:h,...f}=e;return _.jsxs("button",{onClick:u?void 0:c,ref:t,className:`${nh.size[n]} ${nh.variants[r]}
34
- ${u?Re.loading:""} ${s??""}`,type:d,disabled:h??u,...f,children:[!u&&_.jsxs(_.Fragment,{children:[typeof i=="function"&&i(),I.isValidElement(i)&&i]}),u&&_.jsx(B9,{className:`${nh.loadingSize[n]} ${l}`}),o,!u&&_.jsxs(_.Fragment,{children:[typeof a=="function"&&a(),I.isValidElement(a)&&a]})]})});jn.displayName="Button";function Aa(e){return l4(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wi(e){var t;return(t=(l4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function l4(e){return e instanceof Node||e instanceof er(e).Node}function Pt(e){return e instanceof Element||e instanceof er(e).Element}function on(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function X0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function mu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function $9(e){return["table","td","th"].includes(Aa(e))}function gf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Sp(e){const t=wp(),n=ir(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function k9(e){let t=Hi(e);for(;on(t)&&!Ea(t);){if(gf(t))return null;if(Sp(t))return t;t=Hi(t)}return null}function wp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ea(e){return["html","body","#document"].includes(Aa(e))}function ir(e){return er(e).getComputedStyle(e)}function pf(e){return Pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hi(e){if(Aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||X0(e)&&e.host||Wi(e);return X0(t)?t.host:t}function u4(e){const t=Hi(e);return Ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:on(t)&&mu(t)?t:u4(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=u4(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=er(i);return a?t.concat(o,o.visualViewport||[],mu(i)?i:[],o.frameElement&&n?ma(o.frameElement):[]):t.concat(i,ma(i,[],n))}function Ha(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 Zn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&X0(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function P9(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function c4(){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 F9(e){return e.mozInputSource===0&&e.isTrusted?!0:Z0()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function N9(e){return L9()?!1:!Z0()&&e.width===0&&e.height===0||Z0()&&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 M9(){return/apple/i.test(navigator.vendor)}function Z0(){const e=/android/i;return e.test(P9())||e.test(c4())}function L9(){return c4().includes("jsdom/")}function Y1(e,t){return["mouse","pen"].includes(e)}function O9(e){return"nativeEvent"in e}function V9(e){return e.matches("html,body")}function Ar(e){return(e==null?void 0:e.ownerDocument)||document}function rh(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 Za(e){return"composedPath"in e?e.composedPath()[0]:e.target}const H9="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function d4(e){return on(e)&&e.matches(H9)}function ih(e){e.preventDefault(),e.stopPropagation()}function j9(e){return e?e.getAttribute("role")==="combobox"&&d4(e):!1}const W9=["top","right","bottom","left"],K1=["start","end"],J1=W9.reduce((e,t)=>e.concat(t,t+"-"+K1[0],t+"-"+K1[1]),[]),gs=Math.min,so=Math.max,ud=Math.round,Hu=Math.floor,Sa=e=>({x:e,y:e}),z9={left:"right",right:"left",bottom:"top",top:"bottom"},G9={start:"end",end:"start"};function Y0(e,t,n){return so(e,gs(t,n))}function Bs(e,t){return typeof e=="function"?e(t):e}function ji(e){return e.split("-")[0]}function si(e){return e.split("-")[1]}function f4(e){return e==="x"?"y":"x"}function Ip(e){return e==="y"?"height":"width"}function ps(e){return["top","bottom"].includes(ji(e))?"y":"x"}function _p(e){return f4(ps(e))}function h4(e,t,n){n===void 0&&(n=!1);const r=si(e),i=_p(e),a=Ip(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=dd(o)),[o,dd(o)]}function U9(e){const t=dd(e);return[cd(e),t,cd(t)]}function cd(e){return e.replace(/start|end/g,t=>G9[t])}function X9(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function Z9(e,t,n,r){const i=si(e);let a=X9(ji(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(cd)))),a}function dd(e){return e.replace(/left|right|bottom|top/g,t=>z9[t])}function Y9(e){return{top:0,right:0,bottom:0,left:0,...e}}function g4(e){return typeof e!="number"?Y9(e):{top:e,right:e,bottom:e,left:e}}function fd(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}}/*!
34
+ ${u?Re.loading:""} ${s??""}`,type:d,disabled:h??u,...f,children:[!u&&_.jsxs(_.Fragment,{children:[typeof i=="function"&&i(),I.isValidElement(i)&&i]}),u&&_.jsx(B9,{className:`${nh.loadingSize[n]} ${l}`}),o,!u&&_.jsxs(_.Fragment,{children:[typeof a=="function"&&a(),I.isValidElement(a)&&a]})]})});jn.displayName="Button";function Aa(e){return l4(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wi(e){var t;return(t=(l4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function l4(e){return e instanceof Node||e instanceof er(e).Node}function Ft(e){return e instanceof Element||e instanceof er(e).Element}function on(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function X0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function mu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function $9(e){return["table","td","th"].includes(Aa(e))}function gf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Sp(e){const t=wp(),n=ir(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function k9(e){let t=Hi(e);for(;on(t)&&!Ea(t);){if(gf(t))return null;if(Sp(t))return t;t=Hi(t)}return null}function wp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ea(e){return["html","body","#document"].includes(Aa(e))}function ir(e){return er(e).getComputedStyle(e)}function pf(e){return Ft(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hi(e){if(Aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||X0(e)&&e.host||Wi(e);return X0(t)?t.host:t}function u4(e){const t=Hi(e);return Ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:on(t)&&mu(t)?t:u4(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=u4(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=er(i);return a?t.concat(o,o.visualViewport||[],mu(i)?i:[],o.frameElement&&n?ma(o.frameElement):[]):t.concat(i,ma(i,[],n))}function Ha(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 Zn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&X0(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function P9(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function c4(){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 F9(e){return e.mozInputSource===0&&e.isTrusted?!0:Z0()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function N9(e){return L9()?!1:!Z0()&&e.width===0&&e.height===0||Z0()&&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 M9(){return/apple/i.test(navigator.vendor)}function Z0(){const e=/android/i;return e.test(P9())||e.test(c4())}function L9(){return c4().includes("jsdom/")}function Y1(e,t){return["mouse","pen"].includes(e)}function O9(e){return"nativeEvent"in e}function V9(e){return e.matches("html,body")}function Ar(e){return(e==null?void 0:e.ownerDocument)||document}function rh(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 Za(e){return"composedPath"in e?e.composedPath()[0]:e.target}const H9="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function d4(e){return on(e)&&e.matches(H9)}function ih(e){e.preventDefault(),e.stopPropagation()}function j9(e){return e?e.getAttribute("role")==="combobox"&&d4(e):!1}const W9=["top","right","bottom","left"],K1=["start","end"],J1=W9.reduce((e,t)=>e.concat(t,t+"-"+K1[0],t+"-"+K1[1]),[]),gs=Math.min,so=Math.max,ud=Math.round,Hu=Math.floor,Sa=e=>({x:e,y:e}),z9={left:"right",right:"left",bottom:"top",top:"bottom"},G9={start:"end",end:"start"};function Y0(e,t,n){return so(e,gs(t,n))}function Bs(e,t){return typeof e=="function"?e(t):e}function ji(e){return e.split("-")[0]}function si(e){return e.split("-")[1]}function f4(e){return e==="x"?"y":"x"}function Ip(e){return e==="y"?"height":"width"}function ps(e){return["top","bottom"].includes(ji(e))?"y":"x"}function _p(e){return f4(ps(e))}function h4(e,t,n){n===void 0&&(n=!1);const r=si(e),i=_p(e),a=Ip(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=dd(o)),[o,dd(o)]}function U9(e){const t=dd(e);return[cd(e),t,cd(t)]}function cd(e){return e.replace(/start|end/g,t=>G9[t])}function X9(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function Z9(e,t,n,r){const i=si(e);let a=X9(ji(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(cd)))),a}function dd(e){return e.replace(/left|right|bottom|top/g,t=>z9[t])}function Y9(e){return{top:0,right:0,bottom:0,left:0,...e}}function g4(e){return typeof e!="number"?Y9(e):{top:e,right:e,bottom:e,left:e}}function fd(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}}/*!
35
35
  * tabbable 6.2.0
36
36
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
37
- */var K9=["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])"],hd=K9.join(","),p4=typeof Element>"u",ms=p4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gd=!p4&&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},pd=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},J9=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},q9=function(t,n,r){if(pd(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(hd));return n&&ms.call(t,hd)&&i.unshift(t),i=i.filter(r),i},Q9=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!pd(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=ms.call(o,hd);c&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!pd(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var f=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else a.unshift.apply(a,o.children)}}return i},m4=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},b4=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||J9(t))&&!m4(t)?0:t.tabIndex},e$=function(t,n){var r=b4(t);return r<0&&n&&!m4(t)?0:r},t$=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},v4=function(t){return t.tagName==="INPUT"},n$=function(t){return v4(t)&&t.type==="hidden"},r$=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},i$=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},a$=function(t){if(!t.name)return!0;var n=t.form||gd(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=i$(i,t.form);return!a||a===t},o$=function(t){return v4(t)&&t.type==="radio"},s$=function(t){return o$(t)&&!a$(t)},l$=function(t){var n,r=t&&gd(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,d;r=gd(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return a},q1=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},u$=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=ms.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(ms.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=gd(t);if(l&&!l.shadowRoot&&i(l)===!0)return q1(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(l$(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return q1(t);return!1},c$=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 ms.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},d$=function(t,n){return!(n.disabled||pd(n)||n$(n)||u$(n,t)||r$(n)||c$(n))},K0=function(t,n){return!(s$(n)||b4(n)<0||!d$(t,n))},f$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},h$=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=e$(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(t$).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},mf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Q9([t],n.includeContainer,{filter:K0.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:f$}):r=q9(t,n.includeContainer,K0.bind(null,n)),h$(r)},g$=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ms.call(t,hd)===!1?!1:K0(n,t)};function Q1(e,t,n){let{reference:r,floating:i}=e;const a=ps(t),o=_p(t),s=Ip(o),l=ji(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-i.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(si(t)){case"start":f[o]-=h*(n&&u?-1:1);break;case"end":f[o]+=h*(n&&u?-1:1);break}return f}const p$=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:d}=Q1(u,r,l),h=r,f={},g=0;for(let p=0;p<s.length;p++){const{name:m,fn:b}=s[p],{x:v,y:x,data:C,reset:E}=await b({x:c,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=x??d,f={...f,[m]:{...f[m],...C}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:c,y:d}=Q1(u,h,l)),p=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:f}};async function Dp(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:d="floating",altBoundary:h=!1,padding:f=0}=Bs(t,e),g=g4(f),m=s[h?d==="floating"?"reference":"floating":d],b=fd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(m)))==null||n?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},E=fd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:x,strategy:l}):v);return{top:(b.top-E.top+g.top)/C.y,bottom:(E.bottom-b.bottom+g.bottom)/C.y,left:(b.left-E.left+g.left)/C.x,right:(E.right-b.right+g.right)/C.x}}const m$=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}=Bs(e,t)||{};if(u==null)return{};const d=g4(c),h={x:n,y:r},f=_p(i),g=Ip(f),p=await o.getDimensions(u),m=f==="y",b=m?"top":"left",v=m?"bottom":"right",x=m?"clientHeight":"clientWidth",C=a.reference[g]+a.reference[f]-h[f]-a.floating[g],E=h[f]-a.reference[f],w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let B=w?w[x]:0;(!B||!await(o.isElement==null?void 0:o.isElement(w)))&&(B=s.floating[x]||a.floating[g]);const y=C/2-E/2,S=B/2-p[g]/2-1,D=gs(d[b],S),A=gs(d[v],S),T=D,F=B-p[g]-A,k=B/2-p[g]/2+y,P=Y0(T,k,F),$=!l.arrow&&si(i)!=null&&k!==P&&a.reference[g]/2-(k<T?D:A)-p[g]/2<0,R=$?k<T?k-T:k-F:0;return{[f]:h[f]+R,data:{[f]:P,centerOffset:k-P-R,...$&&{alignmentOffset:R}},reset:$}}});function b$(e,t,n){return(e?[...n.filter(i=>si(i)===e),...n.filter(i=>si(i)!==e)]:n.filter(i=>ji(i)===i)).filter(i=>e?si(i)===e||(t?cd(i)!==i:!1):!0)}const v$=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:d,allowedPlacements:h=J1,autoAlignment:f=!0,...g}=Bs(e,t),p=d!==void 0||h===J1?b$(d||null,f,h):h,m=await Dp(t,g),b=((n=o.autoPlacement)==null?void 0:n.index)||0,v=p[b];if(v==null)return{};const x=h4(v,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==v)return{reset:{placement:p[0]}};const C=[m[ji(v)],m[x[0]],m[x[1]]],E=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:v,overflows:C}],w=p[b+1];if(w)return{data:{index:b+1,overflows:E},reset:{placement:w}};const B=E.map(D=>{const A=si(D.placement);return[D.placement,A&&c?D.overflows.slice(0,2).reduce((T,F)=>T+F,0):D.overflows[0],D.overflows]}).sort((D,A)=>D[1]-A[1]),S=((i=B.filter(D=>D[2].slice(0,si(D[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||B[0][0];return S!==s?{data:{index:b+1,overflows:E},reset:{placement:S}}:{}}}},y$=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:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Bs(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=ji(i),v=ps(s),x=ji(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=h||(x||!p?[dd(s)]:U9(s)),w=g!=="none";!h&&w&&E.push(...Z9(s,p,g,C));const B=[s,...E],y=await Dp(t,m),S=[];let D=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&S.push(y[b]),d){const k=h4(i,o,C);S.push(y[k[0]],y[k[1]])}if(D=[...D,{placement:i,overflows:S}],!S.every(k=>k<=0)){var A,T;const k=(((A=a.flip)==null?void 0:A.index)||0)+1,P=B[k];if(P)return{data:{index:k,overflows:D},reset:{placement:P}};let $=(T=D.filter(R=>R.overflows[0]<=0).sort((R,O)=>R.overflows[1]-O.overflows[1])[0])==null?void 0:T.placement;if(!$)switch(f){case"bestFit":{var F;const R=(F=D.filter(O=>{if(w){const j=ps(O.placement);return j===v||j==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(j=>j>0).reduce((j,V)=>j+V,0)]).sort((O,j)=>O[1]-j[1])[0])==null?void 0:F[0];R&&($=R);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};async function x$(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ji(n),s=si(n),l=ps(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bs(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(f=s==="end"?g*-1:g),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const C$=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 x$(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}}}}},E$=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:m=>{let{x:b,y:v}=m;return{x:b,y:v}}},...l}=Bs(e,t),u={x:n,y:r},c=await Dp(t,l),d=ps(ji(i)),h=f4(d);let f=u[h],g=u[d];if(a){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=f+c[m],x=f-c[b];f=Y0(v,f,x)}if(o){const m=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=g+c[m],x=g-c[b];g=Y0(v,g,x)}const p=s.fn({...t,[h]:f,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r}}}}};function y4(e){const t=ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ud(n)!==a||ud(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ap(e){return Pt(e)?e:e.contextElement}function ts(e){const t=Ap(e);if(!on(t))return Sa(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=y4(t);let o=(a?ud(n.width):n.width)/r,s=(a?ud(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const S$=Sa(0);function x4(e){const t=er(e);return!wp()||!t.visualViewport?S$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function po(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Ap(e);let o=Sa(1);t&&(r?Pt(r)&&(o=ts(r)):o=ts(e));const s=w$(a,n,r)?x4(a):Sa(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const h=er(a),f=r&&Pt(r)?er(r):r;let g=h,p=g.frameElement;for(;p&&r&&f!==g;){const m=ts(p),b=p.getBoundingClientRect(),v=ir(p),x=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,C=b.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,d*=m.y,l+=x,u+=C,g=er(p),p=g.frameElement}}return fd({width:c,height:d,x:l,y:u})}function I$(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Wi(r),s=t?gf(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Sa(1);const c=Sa(0),d=on(r);if((d||!d&&!a)&&((Aa(r)!=="body"||mu(o))&&(l=pf(r)),on(r))){const h=po(r);u=ts(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function _$(e){return Array.from(e.getClientRects())}function C4(e){return po(Wi(e)).left+pf(e).scrollLeft}function D$(e){const t=Wi(e),n=pf(e),r=e.ownerDocument.body,i=so(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=so(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+C4(e);const s=-n.scrollTop;return ir(r).direction==="rtl"&&(o+=so(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function A$(e,t){const n=er(e),r=Wi(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=wp();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function T$(e,t){const n=po(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=on(e)?ts(e):Sa(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 eb(e,t,n){let r;if(t==="viewport")r=A$(e,n);else if(t==="document")r=D$(Wi(e));else if(Pt(t))r=T$(t,n);else{const i=x4(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return fd(r)}function E4(e,t){const n=Hi(e);return n===t||!Pt(n)||Ea(n)?!1:ir(n).position==="fixed"||E4(n,t)}function R$(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(s=>Pt(s)&&Aa(s)!=="body"),i=null;const a=ir(e).position==="fixed";let o=a?Hi(e):e;for(;Pt(o)&&!Ea(o);){const s=ir(o),l=Sp(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mu(o)&&!l&&E4(e,o))?r=r.filter(c=>c!==o):i=s,o=Hi(o)}return t.set(e,r),r}function B$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?gf(t)?[]:R$(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=eb(t,c,i);return u.top=so(d.top,u.top),u.right=gs(d.right,u.right),u.bottom=gs(d.bottom,u.bottom),u.left=so(d.left,u.left),u},eb(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $$(e){const{width:t,height:n}=y4(e);return{width:t,height:n}}function k$(e,t,n){const r=on(t),i=Wi(t),a=n==="fixed",o=po(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Sa(0);if(r||!r&&!a)if((Aa(t)!=="body"||mu(i))&&(s=pf(t)),r){const d=po(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=C4(i));const u=o.left+s.scrollLeft-l.x,c=o.top+s.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function ah(e){return ir(e).position==="static"}function tb(e,t){return!on(e)||ir(e).position==="fixed"?null:t?t(e):e.offsetParent}function S4(e,t){const n=er(e);if(gf(e))return n;if(!on(e)){let i=Hi(e);for(;i&&!Ea(i);){if(Pt(i)&&!ah(i))return i;i=Hi(i)}return n}let r=tb(e,t);for(;r&&$9(r)&&ah(r);)r=tb(r,t);return r&&Ea(r)&&ah(r)&&!Sp(r)?n:r||k9(e)||n}const P$=async function(e){const t=this.getOffsetParent||S4,n=this.getDimensions,r=await n(e.floating);return{reference:k$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function F$(e){return ir(e).direction==="rtl"}const N$={convertOffsetParentRelativeRectToViewportRelativeRect:I$,getDocumentElement:Wi,getClippingRect:B$,getOffsetParent:S4,getElementRects:P$,getClientRects:_$,getDimensions:$$,getScale:ts,isElement:Pt,isRTL:F$};function M$(e,t){let n=null,r;const i=Wi(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{left:u,top:c,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const f=Hu(c),g=Hu(i.clientWidth-(u+d)),p=Hu(i.clientHeight-(c+h)),m=Hu(u),v={rootMargin:-f+"px "+-g+"px "+-p+"px "+-m+"px",threshold:so(0,gs(1,l))||1};let x=!0;function C(E){const w=E[0].intersectionRatio;if(w!==l){if(!x)return o();w?o(!1,w):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(C,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return o(!0),a}function w4(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=Ap(e),c=i||a?[...u?ma(u):[],...ma(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&s?M$(u,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let g,p=l?po(e):null;l&&m();function m(){const b=po(e);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&n(),p=b,g=requestAnimationFrame(m)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d==null||d(),(b=f)==null||b.disconnect(),f=null,l&&cancelAnimationFrame(g)}}const L$=C$,O$=v$,V$=E$,H$=y$,nb=m$,j$=(e,t,n)=>{const r=new Map,i={platform:N$,...n},a={...i.platform,_c:r};return p$(e,t,{...i,platform:a})};var Rc=typeof document<"u"?I.useLayoutEffect:I.useEffect;function md(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(!md(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)&&!md(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function I4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rb(e,t){const n=I4(e);return Math.round(t*n)/n}function ib(e){const t=q.useRef(e);return Rc(()=>{t.current=e}),t}function W$(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,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=q.useState(r);md(h,r)||f(r);const[g,p]=q.useState(null),[m,b]=q.useState(null),v=q.useCallback(R=>{R!==w.current&&(w.current=R,p(R))},[]),x=q.useCallback(R=>{R!==B.current&&(B.current=R,b(R))},[]),C=a||g,E=o||m,w=q.useRef(null),B=q.useRef(null),y=q.useRef(c),S=l!=null,D=ib(l),A=ib(i),T=q.useCallback(()=>{if(!w.current||!B.current)return;const R={placement:t,strategy:n,middleware:h};A.current&&(R.platform=A.current),j$(w.current,B.current,R).then(O=>{const j={...O,isPositioned:!0};F.current&&!md(y.current,j)&&(y.current=j,Jx.flushSync(()=>{d(j)}))})},[h,t,n,A]);Rc(()=>{u===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const F=q.useRef(!1);Rc(()=>(F.current=!0,()=>{F.current=!1}),[]),Rc(()=>{if(C&&(w.current=C),E&&(B.current=E),C&&E){if(D.current)return D.current(C,E,T);T()}},[C,E,T,D,S]);const k=q.useMemo(()=>({reference:w,floating:B,setReference:v,setFloating:x}),[v,x]),P=q.useMemo(()=>({reference:C,floating:E}),[C,E]),$=q.useMemo(()=>{const R={position:n,left:0,top:0};if(!P.floating)return R;const O=rb(P.floating,c.x),j=rb(P.floating,c.y);return s?{...R,transform:"translate("+O+"px, "+j+"px)",...I4(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:j}},[n,s,P.floating,c.x,c.y]);return q.useMemo(()=>({...c,update:T,refs:k,elements:P,floatingStyles:$}),[c,T,k,P,$])}const z$=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?nb({element:r.current,padding:i}).fn(n):{}:r?nb({element:r,padding:i}).fn(n):{}}}},G$=(e,t)=>({...L$(e),options:[e,t]}),U$=(e,t)=>({...V$(e),options:[e,t]}),X$=(e,t)=>({...H$(e),options:[e,t]}),Z$=(e,t)=>({...O$(e),options:[e,t]}),Y$=(e,t)=>({...z$(e),options:[e,t]}),_4={...q},K$=_4.useInsertionEffect,J$=K$||(e=>e());function na(e){const t=q.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return J$(()=>{t.current=e}),q.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)},[])}let ab=0;function Fa(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ab);const a=()=>e==null?void 0:e.focus({preventScroll:n});i?a():ab=requestAnimationFrame(a)}var Rn=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(this,arguments)}let ob=!1,q$=0;const sb=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+q$++;function Q$(){const[e,t]=q.useState(()=>ob?sb():void 0);return Rn(()=>{e==null&&t(sb())},[]),q.useEffect(()=>{ob=!0},[]),e}const ek=_4.useId,bf=ek||Q$;let Rl;process.env.NODE_ENV!=="production"&&(Rl=new Set);function tk(){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=Rl)!=null&&e.has(i))){var a;(a=Rl)==null||a.add(i),console.warn(i)}}function nk(){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=Rl)!=null&&e.has(i))){var a;(a=Rl)==null||a.add(i),console.error(i)}}const rk=q.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:i},middlewareData:{arrow:a}},width:o=14,height:s=7,tipRadius:l=0,strokeWidth:u=0,staticOffset:c,stroke:d,d:h,style:{transform:f,...g}={},...p}=t;process.env.NODE_ENV!=="production"&&(n||tk("The `ref` prop is required for `FloatingArrow`."));const m=bf(),[b,v]=q.useState(!1);if(Rn(()=>{if(!i)return;ir(i).direction==="rtl"&&v(!0)},[i]),!i)return null;const x=u*2,C=x/2,E=o/2*(l/-8+1),w=s/2*l/4,[B,y]=r.split("-"),S=!!h,D=B==="top"||B==="bottom",A=c&&y==="end"?"bottom":"top";let T=c&&y==="end"?"right":"left";c&&b&&(T=y==="end"?"left":"right");const F=(a==null?void 0:a.x)!=null?c||a.x:"",k=(a==null?void 0:a.y)!=null?c||a.y:"",P=h||"M0,0"+(" H"+o)+(" L"+(o-E)+","+(s-w))+(" Q"+o/2+","+s+" "+E+","+(s-w))+" Z",$={top:S?"rotate(180deg)":"",left:S?"rotate(90deg)":"rotate(-90deg)",bottom:S?"":"rotate(180deg)",right:S?"rotate(-90deg)":"rotate(90deg)"}[B];return q.createElement("svg",Tl({},p,{"aria-hidden":!0,ref:n,width:S?o:o+x,height:o,viewBox:"0 0 "+o+" "+(s>o?s:o),style:{position:"absolute",pointerEvents:"none",[T]:F,[A]:k,[B]:D||S?"100%":"calc(100% - "+x/2+"px)",transform:""+$+(f??""),...g}}),x>0&&q.createElement("path",{clipPath:"url(#"+m+")",fill:"none",stroke:d,strokeWidth:x+(h?0:1),d:P}),q.createElement("path",{stroke:x&&!h?p.fill:"none",d:P}),q.createElement("clipPath",{id:m},q.createElement("rect",{x:-C,y:C*(S?-1:1),width:o+x,height:o})))});function ik(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const ak=q.createContext(null),ok=q.createContext(null),D4=()=>{var e;return((e=q.useContext(ak))==null?void 0:e.id)||null},Tp=()=>q.useContext(ok);function Bl(e){return"data-floating-ui-"+e}function qa(e){const t=I.useRef(e);return Rn(()=>{t.current=e}),t}function sk(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 gl(e,t){let n=e.filter(i=>{var a;return i.parentId===t&&((a=i.context)==null?void 0:a.open)}),r=n;for(;r.length;)r=e.filter(i=>{var a;return(a=r)==null?void 0:a.some(o=>{var s;return i.parentId===o.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let ko=new WeakMap,ju=new WeakSet,Wu={},oh=0;const lk=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,A4=e=>e&&(e.host||A4(e.parentNode)),uk=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=A4(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ck(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=uk(t,e),s=new Set,l=new Set(o),u=[];Wu[i]||(Wu[i]=new WeakMap);const c=Wu[i];o.forEach(d),h(t),s.clear();function d(f){!f||s.has(f)||(s.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||[].forEach.call(f.children,g=>{if(Aa(g)!=="script")if(s.has(g))h(g);else{const p=a?g.getAttribute(a):null,m=p!==null&&p!=="false",b=(ko.get(g)||0)+1,v=(c.get(g)||0)+1;ko.set(g,b),c.set(g,v),u.push(g),b===1&&m&&ju.add(g),v===1&&g.setAttribute(i,""),!m&&a&&g.setAttribute(a,"true")}})}return oh++,()=>{u.forEach(f=>{const g=(ko.get(f)||0)-1,p=(c.get(f)||0)-1;ko.set(f,g),c.set(f,p),g||(!ju.has(f)&&a&&f.removeAttribute(a),ju.delete(f)),p||f.removeAttribute(i)}),oh--,oh||(ko=new WeakMap,ko=new WeakMap,ju=new WeakSet,Wu={})}}function lb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Ar(e[0]).body;return ck(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const $l=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function T4(e,t){const n=mf(e,$l());t==="prev"&&n.reverse();const r=n.indexOf(Ha(Ar(e)));return n.slice(r+1)[0]}function R4(){return T4(document.body,"next")}function B4(){return T4(document.body,"prev")}function pl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Zn(n,r)}function dk(e){mf(e,$l()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function fk(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Rp={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};let hk;function ub(e){e.key==="Tab"&&(e.target,clearTimeout(hk))}const bd=q.forwardRef(function(t,n){const[r,i]=q.useState();Rn(()=>(M9()&&i("button"),document.addEventListener("keydown",ub),()=>{document.removeEventListener("keydown",ub)}),[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Bl("focus-guard")]:"",style:Rp};return q.createElement("span",Tl({},t,a))}),$4=q.createContext(null),cb=Bl("portal");function gk(e){e===void 0&&(e={});const{id:t,root:n}=e,r=bf(),i=k4(),[a,o]=q.useState(null),s=q.useRef(null);return Rn(()=>()=>{a==null||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),Rn(()=>{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(cb,""),l.appendChild(u),s.current=u,o(u)},[t,r]),Rn(()=>{if(!r||s.current)return;let l=n||(i==null?void 0:i.portalNode);l&&!Pt(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(cb,""),l=u||l,l.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function pk(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,a=gk({id:n,root:r}),[o,s]=q.useState(null),l=q.useRef(null),u=q.useRef(null),c=q.useRef(null),d=q.useRef(null),h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return q.useEffect(()=>{if(!a||!i||o!=null&&o.modal)return;function f(g){a&&pl(g)&&(g.type==="focusin"?fk:dk)(a)}return a.addEventListener("focusin",f,!0),a.addEventListener("focusout",f,!0),()=>{a.removeEventListener("focusin",f,!0),a.removeEventListener("focusout",f,!0)}},[a,i,o==null?void 0:o.modal]),q.createElement($4.Provider,{value:q.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a])},h&&a&&q.createElement(bd,{"data-type":"outside",ref:l,onFocus:f=>{if(pl(f,a)){var g;(g=c.current)==null||g.focus()}else{const p=B4()||(o==null?void 0:o.refs.domReference.current);p==null||p.focus()}}}),h&&a&&q.createElement("span",{"aria-owns":a.id,style:Rp}),a&&Jx.createPortal(t,a),h&&a&&q.createElement(bd,{"data-type":"outside",ref:u,onFocus:f=>{if(pl(f,a)){var g;(g=d.current)==null||g.focus()}else{const p=R4()||(o==null?void 0:o.refs.domReference.current);p==null||p.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,f.nativeEvent))}}}))}const k4=()=>q.useContext($4),mk=20;let ja=[];function sh(e){ja=ja.filter(n=>n.isConnected);let t=e;if(!(!t||Aa(t)==="body")){if(!g$(t,$l())){const n=mf(t,$l())[0];n&&(t=n)}ja.push(t),ja.length>mk&&(ja=ja.slice(-20))}}function db(){return ja.slice().reverse().find(e=>e.isConnected)}const bk=q.forwardRef(function(t,n){return q.createElement("button",Tl({},t,{type:"button",ref:n,tabIndex:-1,style:Rp}))});function vk(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:d=!0}=e,{open:h,refs:f,nodeId:g,onOpenChange:p,events:m,dataRef:b,floatingId:v,elements:{domReference:x,floating:C}}=t,E=typeof o=="number"&&o<0,w=j9(x)&&E,B=lk()?a:!0,y=qa(i),S=qa(o),D=qa(s),A=Tp(),T=k4(),F=q.useRef(null),k=q.useRef(null),P=q.useRef(!1),$=q.useRef(!1),R=q.useRef(-1),O=T!=null,j=C==null?void 0:C.firstElementChild,V=(j==null?void 0:j.id)===v?j:C,W=na(function(z){return z===void 0&&(z=V),z?mf(z,$l()):[]}),U=na(z=>{const H=W(z);return y.current.map(X=>x&&X==="reference"?x:V&&X==="floating"?V:H).filter(Boolean).flat()});q.useEffect(()=>{if(r||!u)return;function z(X){if(X.key==="Tab"){Zn(V,Ha(Ar(V)))&&W().length===0&&!w&&ih(X);const te=U(),ie=Za(X);y.current[0]==="reference"&&ie===x&&(ih(X),X.shiftKey?Fa(te[te.length-1]):Fa(te[1])),y.current[1]==="floating"&&ie===V&&X.shiftKey&&(ih(X),Fa(te[0]))}}const H=Ar(V);return H.addEventListener("keydown",z),()=>{H.removeEventListener("keydown",z)}},[r,x,V,u,y,w,W,U]),q.useEffect(()=>{if(r||!C)return;function z(H){const X=Za(H),ie=W().indexOf(X);ie!==-1&&(R.current=ie)}return C.addEventListener("focusin",z),()=>{C.removeEventListener("focusin",z)}},[r,C,W]),q.useEffect(()=>{if(r||!d)return;function z(){$.current=!0,setTimeout(()=>{$.current=!1})}function H(X){const te=X.relatedTarget;queueMicrotask(()=>{const ie=!(Zn(x,te)||Zn(C,te)||Zn(te,C)||Zn(T==null?void 0:T.portalNode,te)||te!=null&&te.hasAttribute(Bl("focus-guard"))||A&&(gl(A.nodesRef.current,g).find(le=>{var ce,Q;return Zn((ce=le.context)==null?void 0:ce.elements.floating,te)||Zn((Q=le.context)==null?void 0:Q.elements.domReference,te)})||sk(A.nodesRef.current,g).find(le=>{var ce,Q;return((ce=le.context)==null?void 0:ce.elements.floating)===te||((Q=le.context)==null?void 0:Q.elements.domReference)===te})));if(l&&ie&&Ha(Ar(V))===Ar(V).body){on(V)&&(V==null||V.focus());const le=R.current,ce=W(),Q=ce[le]||ce[ce.length-1]||V;on(Q)&&Q.focus()}(w||!u)&&te&&ie&&!$.current&&te!==db()&&(P.current=!0,p(!1,X))})}if(C&&on(x))return x.addEventListener("focusout",H),x.addEventListener("pointerdown",z),C.addEventListener("focusout",H),()=>{x.removeEventListener("focusout",H),x.removeEventListener("pointerdown",z),C.removeEventListener("focusout",H)}},[r,x,C,V,u,g,A,T,p,d,l,W,w]),q.useEffect(()=>{var z;if(r)return;const H=Array.from((T==null||(z=T.portalNode)==null?void 0:z.querySelectorAll("["+Bl("portal")+"]"))||[]);if(C){const X=[C,...H,F.current,k.current,y.current.includes("reference")||w?x:null].filter(ie=>ie!=null),te=u||w?lb(X,B,!B):lb(X);return()=>{te()}}},[r,x,C,u,y,T,w,B]),Rn(()=>{if(r||!on(V))return;const z=Ar(V),H=Ha(z);queueMicrotask(()=>{const X=U(V),te=S.current,ie=(typeof te=="number"?X[te]:te.current)||V,le=Zn(V,H);!E&&!le&&h&&Fa(ie,{preventScroll:ie===V})})},[r,h,V,E,U,S]),Rn(()=>{if(r||!V)return;let z=!1;const H=Ar(V),X=Ha(H);let ie=b.current.openEvent;sh(X);function le(ce){let{open:Q,reason:be,event:Ce,nested:Se}=ce;Q&&(ie=Ce),be==="escape-key"&&f.domReference.current&&sh(f.domReference.current),be==="hover"&&Ce.type==="mouseleave"&&(P.current=!0),be==="outside-press"&&(Se?(P.current=!1,z=!0):P.current=!(F9(Ce)||N9(Ce)))}return m.on("openchange",le),()=>{m.off("openchange",le);const ce=Ha(H),Q=Zn(C,ce)||A&&gl(A.nodesRef.current,g).some(Se=>{var un;return Zn((un=Se.context)==null?void 0:un.elements.floating,ce)});(Q||ie&&["click","mousedown"].includes(ie.type))&&f.domReference.current&&sh(f.domReference.current);const Ce=db();D.current&&!P.current&&on(Ce)&&(!(Ce!==ce&&ce!==H.body)||Q)&&Fa(Ce,{cancelPrevious:!1,preventScroll:z})}},[r,C,V,D,b,f,m,A,g]),Rn(()=>{if(!r&&T)return T.setFocusManagerState({modal:u,closeOnFocusOut:d,open:h,onOpenChange:p,refs:f}),()=>{T.setFocusManagerState(null)}},[r,T,u,h,p,f,d]),Rn(()=>{if(r||!V||typeof MutationObserver!="function"||E)return;const z=()=>{const X=V.getAttribute("tabindex"),te=W(),ie=Ha(Ar(C)),le=te.indexOf(ie);le!==-1&&(R.current=le),y.current.includes("floating")||ie!==f.domReference.current&&te.length===0?X!=="0"&&V.setAttribute("tabindex","0"):X!=="-1"&&V.setAttribute("tabindex","-1")};z();const H=new MutationObserver(z);return H.observe(V,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}},[r,C,V,f,y,W,E]);function K(z){return r||!c||!u?null:q.createElement(bk,{ref:z==="start"?F:k,onClick:H=>p(!1,H.nativeEvent)},typeof c=="string"?c:"Dismiss")}const ee=!r&&B&&(u?!w:!0)&&(O||u);return q.createElement(q.Fragment,null,ee&&q.createElement(bd,{"data-type":"inside",ref:T==null?void 0:T.beforeInsideRef,onFocus:z=>{if(u){const X=U();Fa(i[0]==="reference"?X[0]:X[X.length-1])}else if(T!=null&&T.preserveTabOrder&&T.portalNode)if(P.current=!1,pl(z,T.portalNode)){const X=R4()||x;X==null||X.focus()}else{var H;(H=T.beforeOutsideRef.current)==null||H.focus()}}}),!w&&K("start"),n,K("end"),ee&&q.createElement(bd,{"data-type":"inside",ref:T==null?void 0:T.afterInsideRef,onFocus:z=>{if(u)Fa(U()[0]);else if(T!=null&&T.preserveTabOrder&&T.portalNode)if(d&&(P.current=!0),pl(z,T.portalNode)){const X=B4()||x;X==null||X.focus()}else{var H;(H=T.afterOutsideRef.current)==null||H.focus()}}}))}function fb(e){return on(e.target)&&e.target.tagName==="BUTTON"}function hb(e){return d4(e)}function yk(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}=t,d=q.useRef(),h=q.useRef(!1),f=q.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const p=d.current;g.button===0&&s!=="click"&&(Y1(p)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){const p=d.current;if(s==="mousedown"&&d.current){d.current=void 0;return}Y1(p)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!c||fb(g))&&(g.key===" "&&!hb(a)&&(g.preventDefault(),h.current=!0),g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!c||fb(g)||hb(a)||g.key===" "&&h.current&&(h.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[i,a,s,u,c,r,n,l]);return q.useMemo(()=>o?{reference:f}:{},[o,f])}const xk={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ck={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},gb=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 Ek(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:d="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:g}=t,p=Tp(),m=na(typeof l=="function"?l:()=>!1),b=typeof l=="function"?m:l,v=q.useRef(!1),x=q.useRef(!1),{escapeKey:C,outsidePress:E}=gb(f),{escapeKey:w,outsidePress:B}=gb(g),y=na(k=>{var P;if(!n||!o||!s||k.key!=="Escape")return;const $=(P=a.current.floatingContext)==null?void 0:P.nodeId,R=p?gl(p.nodesRef.current,$):[];if(!C&&(k.stopPropagation(),R.length>0)){let O=!0;if(R.forEach(j=>{var V;if((V=j.context)!=null&&V.open&&!j.context.dataRef.current.__escapeKeyBubbles){O=!1;return}}),!O)return}r(!1,O9(k)?k.nativeEvent:k,"escape-key")}),S=na(k=>{var P;const $=()=>{var R;y(k),(R=Za(k))==null||R.removeEventListener("keydown",$)};(P=Za(k))==null||P.addEventListener("keydown",$)}),D=na(k=>{var P;const $=v.current;v.current=!1;const R=x.current;if(x.current=!1,u==="click"&&R||$||typeof b=="function"&&!b(k))return;const O=Za(k),j="["+Bl("inert")+"]",V=Ar(i.floating).querySelectorAll(j);let W=Pt(O)?O:null;for(;W&&!Ea(W);){const z=Hi(W);if(Ea(z)||!Pt(z))break;W=z}if(V.length&&Pt(O)&&!V9(O)&&!Zn(O,i.floating)&&Array.from(V).every(z=>!Zn(W,z)))return;if(on(O)&&F){const z=O.clientWidth>0&&O.scrollWidth>O.clientWidth,H=O.clientHeight>0&&O.scrollHeight>O.clientHeight;let X=H&&k.offsetX>O.clientWidth;if(H&&ir(O).direction==="rtl"&&(X=k.offsetX<=O.offsetWidth-O.clientWidth),X||z&&k.offsetY>O.clientHeight)return}const U=(P=a.current.floatingContext)==null?void 0:P.nodeId,K=p&&gl(p.nodesRef.current,U).some(z=>{var H;return rh(k,(H=z.context)==null?void 0:H.elements.floating)});if(rh(k,i.floating)||rh(k,i.domReference)||K)return;const ee=p?gl(p.nodesRef.current,U):[];if(ee.length>0){let z=!0;if(ee.forEach(H=>{var X;if((X=H.context)!=null&&X.open&&!H.context.dataRef.current.__outsidePressBubbles){z=!1;return}}),!z)return}r(!1,k,"outside-press")}),A=na(k=>{var P;const $=()=>{var R;D(k),(R=Za(k))==null||R.removeEventListener(u,$)};(P=Za(k))==null||P.addEventListener(u,$)});q.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=E;function k(R){r(!1,R,"ancestor-scroll")}const P=Ar(i.floating);s&&P.addEventListener("keydown",w?S:y,w),b&&P.addEventListener(u,B?A:D,B);let $=[];return h&&(Pt(i.domReference)&&($=ma(i.domReference)),Pt(i.floating)&&($=$.concat(ma(i.floating))),!Pt(i.reference)&&i.reference&&i.reference.contextElement&&($=$.concat(ma(i.reference.contextElement)))),$=$.filter(R=>{var O;return R!==((O=P.defaultView)==null?void 0:O.visualViewport)}),$.forEach(R=>{R.addEventListener("scroll",k,{passive:!0})}),()=>{s&&P.removeEventListener("keydown",w?S:y,w),b&&P.removeEventListener(u,B?A:D,B),$.forEach(R=>{R.removeEventListener("scroll",k)})}},[a,i,s,b,u,n,r,h,o,C,E,y,w,S,D,B,A]),q.useEffect(()=>{v.current=!1},[b,u]);const T=q.useMemo(()=>({onKeyDown:y,[xk[d]]:k=>{c&&r(!1,k.nativeEvent,"reference-press")}}),[y,r,c,d]),F=q.useMemo(()=>({onKeyDown:y,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ck[u]]:()=>{v.current=!0}}),[y,u]);return q.useMemo(()=>o?{reference:T,floating:F}:{},[o,T,F])}function Sk(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=bf(),a=q.useRef({}),[o]=q.useState(()=>ik()),s=D4()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!Pt(f)&&nk("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]=q.useState(r.reference),c=na((f,g,p)=>{a.current.openEvent=f?g:void 0,o.emit("openchange",{open:f,event:g,reason:p,nested:s}),n==null||n(f,g,p)}),d=q.useMemo(()=>({setPositionReference:u}),[]),h=q.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return q.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:h,events:o,floatingId:i,refs:d}),[t,c,h,o,i,d])}function wk(e){e===void 0&&(e={});const{nodeId:t}=e,n=Sk({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=q.useState(null),[s,l]=q.useState(null),c=(i==null?void 0:i.reference)||a,d=q.useRef(null),h=Tp();Rn(()=>{c&&(d.current=c)},[c]);const f=W$({...e,elements:{...i,...s&&{reference:s}}}),g=q.useCallback(x=>{const C=Pt(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;l(C),f.refs.setReference(C)},[f.refs]),p=q.useCallback(x=>{(Pt(x)||x===null)&&(d.current=x,o(x)),(Pt(f.refs.reference.current)||f.refs.reference.current===null||x!==null&&!Pt(x))&&f.refs.setReference(x)},[f.refs]),m=q.useMemo(()=>({...f.refs,setReference:p,setPositionReference:g,domReference:d}),[f.refs,p,g]),b=q.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),v=q.useMemo(()=>({...f,...r,refs:m,elements:b,nodeId:t}),[f,m,b,t,r]);return Rn(()=>{r.dataRef.current.floatingContext=v;const x=h==null?void 0:h.nodesRef.current.find(C=>C.id===t);x&&(x.context=v)}),q.useMemo(()=>({...f,context:v,refs:m,elements:b}),[f,m,b,v])}const pb="active",mb="selected";function lh(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[pb]:o,[mb]:s,...l}=e;a=l}return{...n==="floating"&&{tabIndex:-1},...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&&[pb,mb].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var d;(d=r.get(u))==null||d.push(c),o[u]=function(){for(var h,f=arguments.length,g=new Array(f),p=0;p<f;p++)g[p]=arguments[p];return(h=r.get(u))==null?void 0:h.map(m=>m(...g)).find(m=>m!==void 0)}}}else o[u]=c}),o),{})}}function Ik(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=q.useCallback(s=>lh(s,e,"reference"),t),a=q.useCallback(s=>lh(s,e,"floating"),n),o=q.useCallback(s=>lh(s,e,"item"),r);return q.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}const _k=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Dk(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:a=!0,role:o="dialog"}=t,s=(n=_k.get(o))!=null?n:o,l=bf(),c=D4()!=null,d=q.useMemo(()=>s==="tooltip"||o==="label"?{["aria-"+(o==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":r?i:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:l},...s==="menu"&&c&&{role:"menuitem"},...o==="select"&&{"aria-autocomplete":"none"},...o==="combobox"&&{"aria-autocomplete":"list"}},[s,i,c,r,l,o]),h=q.useMemo(()=>{const g={id:i,...s&&{role:s}};return s==="tooltip"||o==="label"?g:{...g,...s==="menu"&&{"aria-labelledby":l}}},[s,i,l,o]),f=q.useCallback(g=>{let{active:p,selected:m}=g;const b={role:"option",...p&&{id:i+"-option"}};switch(o){case"select":return{...b,"aria-selected":p&&m};case"combobox":return{...b,...p&&{"aria-selected":!0}}}return{}},[i,o]);return q.useMemo(()=>a?{reference:d,floating:h,item:f}:{},[a,d,h,f])}const bb=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Po(e,t){return typeof e=="function"?e(t):e}function Ak(e,t){const[n,r]=q.useState(e);return e&&!n&&r(!0),q.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function Tk(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]=q.useState("unmounted"),u=Ak(n,o);return!u&&s==="close"&&l("unmounted"),Rn(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:s}}function Rk(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=q.useMemo(()=>({side:l,placement:s}),[l,s]),c=typeof o=="number",d=(c?o:o.open)||0,h=(c?o:o.close)||0,[f,g]=q.useState(()=>({...Po(a,u),...Po(n,u)})),{isMounted:p,status:m}=Tk(e,{duration:o}),b=qa(n),v=qa(r),x=qa(i),C=qa(a);return Rn(()=>{const E=Po(b.current,u),w=Po(x.current,u),B=Po(C.current,u),y=Po(v.current,u)||Object.keys(E).reduce((S,D)=>(S[D]="",S),{});if(m==="initial"&&g(S=>({transitionProperty:S.transitionProperty,...B,...E})),m==="open"&&g({transitionProperty:Object.keys(y).map(bb).join(","),transitionDuration:d+"ms",...B,...y}),m==="close"){const S=w||E;g({transitionProperty:Object.keys(S).map(bb).join(","),transitionDuration:h+"ms",...B,...S})}},[h,x,b,v,C,d,m,u]),{isMounted:p,styles:f}}const Bk="_popover_cskuc_1",$k={popover:Bk},pi=I.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:d,styleInnerPopover:h={},floatingOptions:f={},onClose:g=()=>{},withArrow:p,propsArrow:m={},floatingFocusManagerProps:b,useDismissProps:v,...x}=e,C=I.useRef(null),[E,w]=I.useState(!1),{refs:B,floatingStyles:y,context:S}=wk({open:E,onOpenChange:j=>{w(j),j||g()},middleware:[G$(i),s?Z$(u):X$(l),U$(),Y$({element:C})],whileElementsMounted:w4,...f}),D=yk(S),A=Ek(S,v),T=Dk(S),{getReferenceProps:F,getFloatingProps:k}=Ik([D,A,T]),{styles:P,isMounted:$}=Rk(S),R=j=>{B.setReference(j.currentTarget),w(V=>!V),E&&g()};I.useEffect(()=>{a&&o?R({currentTarget:o}):a||w(!1)},[a,o]),I.useImperativeHandle(t,()=>({show:E,setShow:w,handlerShow:R,getReferenceProps:F}),[E]);const O=()=>{let j={...y,...P,...h,zIndex:c};return d&&(j={...j,width:d}),j};return _.jsx(_.Fragment,{children:$&&E&&_.jsx(pk,{children:_.jsx(vk,{context:S,modal:!1,...b,children:_.jsxs("div",{ref:B.setFloating,style:O(),...k(),className:`${$k.popover} ${r??""}`,...x,children:[n,p&&_.jsx(rk,{ref:C,context:S,...m})]})})})})});pi.displayName="Popover";const kk="_input_1kwx0_271",Pk="_label_1kwx0_271",Fk="_error_1kwx0_307",Mn={"container-large":"_container-large_1kwx0_271","container-input":"_container-input_1kwx0_271",input:kk,label:Pk,"container-medium":"_container-medium_1kwx0_271","container-small":"_container-small_1kwx0_271",error:Fk,"label-error":"_label-error_1kwx0_307","isset-right-icon":"_isset-right-icon_1kwx0_552","isset-left-icon":"_isset-left-icon_1kwx0_556","start-icon":"_start-icon_1kwx0_573","end-icon":"_end-icon_1kwx0_581"},Nk={size:{large:Mn["container-large"],medium:Mn["container-medium"],small:Mn["container-small"]}},P4=I.forwardRef((e,t)=>{var v;const{isRequired:n,classNameContainer:r,classNameLabelError:i,classNameLabel:a,className:o,name:s,id:l,label:u,type:c="text",startIcon:d,endIcon:h,error:f,sizeInput:g="large",...p}=e,m=()=>typeof d=="function"||I.isValidElement(d),b=()=>typeof h=="function"||I.isValidElement(h);return _.jsxs("div",{className:`${Mn.container} ${(v=Nk.size)==null?void 0:v[g]} ${r??""}`,children:[_.jsxs("div",{className:Mn["container-input"],children:[_.jsx("input",{id:l??s,className:`${Mn.input} ${f?Mn.error:""}
37
+ */var K9=["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])"],hd=K9.join(","),p4=typeof Element>"u",ms=p4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gd=!p4&&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},pd=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},J9=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},q9=function(t,n,r){if(pd(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(hd));return n&&ms.call(t,hd)&&i.unshift(t),i=i.filter(r),i},Q9=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!pd(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=ms.call(o,hd);c&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!pd(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var f=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else a.unshift.apply(a,o.children)}}return i},m4=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},b4=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||J9(t))&&!m4(t)?0:t.tabIndex},e$=function(t,n){var r=b4(t);return r<0&&n&&!m4(t)?0:r},t$=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},v4=function(t){return t.tagName==="INPUT"},n$=function(t){return v4(t)&&t.type==="hidden"},r$=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},i$=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},a$=function(t){if(!t.name)return!0;var n=t.form||gd(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=i$(i,t.form);return!a||a===t},o$=function(t){return v4(t)&&t.type==="radio"},s$=function(t){return o$(t)&&!a$(t)},l$=function(t){var n,r=t&&gd(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,d;r=gd(i),i=(u=r)===null||u===void 0?void 0:u.host,a=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return a},q1=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},u$=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var a=ms.call(t,"details>summary:first-of-type"),o=a?t.parentElement:t;if(ms.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=gd(t);if(l&&!l.shadowRoot&&i(l)===!0)return q1(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=s}if(l$(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return q1(t);return!1},c$=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 ms.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},d$=function(t,n){return!(n.disabled||pd(n)||n$(n)||u$(n,t)||r$(n)||c$(n))},K0=function(t,n){return!(s$(n)||b4(n)<0||!d$(t,n))},f$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},h$=function e(t){var n=[],r=[];return t.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=e$(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(t$).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},mf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Q9([t],n.includeContainer,{filter:K0.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:f$}):r=q9(t,n.includeContainer,K0.bind(null,n)),h$(r)},g$=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ms.call(t,hd)===!1?!1:K0(n,t)};function Q1(e,t,n){let{reference:r,floating:i}=e;const a=ps(t),o=_p(t),s=Ip(o),l=ji(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-i.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(si(t)){case"start":f[o]-=h*(n&&u?-1:1);break;case"end":f[o]+=h*(n&&u?-1:1);break}return f}const p$=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:d}=Q1(u,r,l),h=r,f={},g=0;for(let p=0;p<s.length;p++){const{name:m,fn:b}=s[p],{x:v,y:x,data:C,reset:E}=await b({x:c,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:u,platform:o,elements:{reference:e,floating:t}});c=v??c,d=x??d,f={...f,[m]:{...f[m],...C}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:c,y:d}=Q1(u,h,l)),p=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:f}};async function Dp(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:d="floating",altBoundary:h=!1,padding:f=0}=Bs(t,e),g=g4(f),m=s[h?d==="floating"?"reference":"floating":d],b=fd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(m)))==null||n?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),C=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},E=fd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:x,strategy:l}):v);return{top:(b.top-E.top+g.top)/C.y,bottom:(E.bottom-b.bottom+g.bottom)/C.y,left:(b.left-E.left+g.left)/C.x,right:(E.right-b.right+g.right)/C.x}}const m$=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}=Bs(e,t)||{};if(u==null)return{};const d=g4(c),h={x:n,y:r},f=_p(i),g=Ip(f),p=await o.getDimensions(u),m=f==="y",b=m?"top":"left",v=m?"bottom":"right",x=m?"clientHeight":"clientWidth",C=a.reference[g]+a.reference[f]-h[f]-a.floating[g],E=h[f]-a.reference[f],w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let B=w?w[x]:0;(!B||!await(o.isElement==null?void 0:o.isElement(w)))&&(B=s.floating[x]||a.floating[g]);const y=C/2-E/2,S=B/2-p[g]/2-1,D=gs(d[b],S),A=gs(d[v],S),T=D,F=B-p[g]-A,k=B/2-p[g]/2+y,P=Y0(T,k,F),$=!l.arrow&&si(i)!=null&&k!==P&&a.reference[g]/2-(k<T?D:A)-p[g]/2<0,R=$?k<T?k-T:k-F:0;return{[f]:h[f]+R,data:{[f]:P,centerOffset:k-P-R,...$&&{alignmentOffset:R}},reset:$}}});function b$(e,t,n){return(e?[...n.filter(i=>si(i)===e),...n.filter(i=>si(i)!==e)]:n.filter(i=>ji(i)===i)).filter(i=>e?si(i)===e||(t?cd(i)!==i:!1):!0)}const v$=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:d,allowedPlacements:h=J1,autoAlignment:f=!0,...g}=Bs(e,t),p=d!==void 0||h===J1?b$(d||null,f,h):h,m=await Dp(t,g),b=((n=o.autoPlacement)==null?void 0:n.index)||0,v=p[b];if(v==null)return{};const x=h4(v,a,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(s!==v)return{reset:{placement:p[0]}};const C=[m[ji(v)],m[x[0]],m[x[1]]],E=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:v,overflows:C}],w=p[b+1];if(w)return{data:{index:b+1,overflows:E},reset:{placement:w}};const B=E.map(D=>{const A=si(D.placement);return[D.placement,A&&c?D.overflows.slice(0,2).reduce((T,F)=>T+F,0):D.overflows[0],D.overflows]}).sort((D,A)=>D[1]-A[1]),S=((i=B.filter(D=>D[2].slice(0,si(D[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||B[0][0];return S!==s?{data:{index:b+1,overflows:E},reset:{placement:S}}:{}}}},y$=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:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Bs(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=ji(i),v=ps(s),x=ji(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=h||(x||!p?[dd(s)]:U9(s)),w=g!=="none";!h&&w&&E.push(...Z9(s,p,g,C));const B=[s,...E],y=await Dp(t,m),S=[];let D=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&S.push(y[b]),d){const k=h4(i,o,C);S.push(y[k[0]],y[k[1]])}if(D=[...D,{placement:i,overflows:S}],!S.every(k=>k<=0)){var A,T;const k=(((A=a.flip)==null?void 0:A.index)||0)+1,P=B[k];if(P)return{data:{index:k,overflows:D},reset:{placement:P}};let $=(T=D.filter(R=>R.overflows[0]<=0).sort((R,O)=>R.overflows[1]-O.overflows[1])[0])==null?void 0:T.placement;if(!$)switch(f){case"bestFit":{var F;const R=(F=D.filter(O=>{if(w){const j=ps(O.placement);return j===v||j==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(j=>j>0).reduce((j,V)=>j+V,0)]).sort((O,j)=>O[1]-j[1])[0])==null?void 0:F[0];R&&($=R);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};async function x$(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ji(n),s=si(n),l=ps(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bs(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(f=s==="end"?g*-1:g),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const C$=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 x$(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}}}}},E$=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:m=>{let{x:b,y:v}=m;return{x:b,y:v}}},...l}=Bs(e,t),u={x:n,y:r},c=await Dp(t,l),d=ps(ji(i)),h=f4(d);let f=u[h],g=u[d];if(a){const m=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=f+c[m],x=f-c[b];f=Y0(v,f,x)}if(o){const m=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=g+c[m],x=g-c[b];g=Y0(v,g,x)}const p=s.fn({...t,[h]:f,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r}}}}};function y4(e){const t=ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ud(n)!==a||ud(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ap(e){return Ft(e)?e:e.contextElement}function ts(e){const t=Ap(e);if(!on(t))return Sa(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=y4(t);let o=(a?ud(n.width):n.width)/r,s=(a?ud(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const S$=Sa(0);function x4(e){const t=er(e);return!wp()||!t.visualViewport?S$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function po(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Ap(e);let o=Sa(1);t&&(r?Ft(r)&&(o=ts(r)):o=ts(e));const s=w$(a,n,r)?x4(a):Sa(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const h=er(a),f=r&&Ft(r)?er(r):r;let g=h,p=g.frameElement;for(;p&&r&&f!==g;){const m=ts(p),b=p.getBoundingClientRect(),v=ir(p),x=b.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,C=b.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,d*=m.y,l+=x,u+=C,g=er(p),p=g.frameElement}}return fd({width:c,height:d,x:l,y:u})}function I$(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Wi(r),s=t?gf(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Sa(1);const c=Sa(0),d=on(r);if((d||!d&&!a)&&((Aa(r)!=="body"||mu(o))&&(l=pf(r)),on(r))){const h=po(r);u=ts(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}}function _$(e){return Array.from(e.getClientRects())}function C4(e){return po(Wi(e)).left+pf(e).scrollLeft}function D$(e){const t=Wi(e),n=pf(e),r=e.ownerDocument.body,i=so(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=so(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+C4(e);const s=-n.scrollTop;return ir(r).direction==="rtl"&&(o+=so(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function A$(e,t){const n=er(e),r=Wi(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=wp();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function T$(e,t){const n=po(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=on(e)?ts(e):Sa(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 eb(e,t,n){let r;if(t==="viewport")r=A$(e,n);else if(t==="document")r=D$(Wi(e));else if(Ft(t))r=T$(t,n);else{const i=x4(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return fd(r)}function E4(e,t){const n=Hi(e);return n===t||!Ft(n)||Ea(n)?!1:ir(n).position==="fixed"||E4(n,t)}function R$(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(s=>Ft(s)&&Aa(s)!=="body"),i=null;const a=ir(e).position==="fixed";let o=a?Hi(e):e;for(;Ft(o)&&!Ea(o);){const s=ir(o),l=Sp(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mu(o)&&!l&&E4(e,o))?r=r.filter(c=>c!==o):i=s,o=Hi(o)}return t.set(e,r),r}function B$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?gf(t)?[]:R$(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=eb(t,c,i);return u.top=so(d.top,u.top),u.right=gs(d.right,u.right),u.bottom=gs(d.bottom,u.bottom),u.left=so(d.left,u.left),u},eb(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $$(e){const{width:t,height:n}=y4(e);return{width:t,height:n}}function k$(e,t,n){const r=on(t),i=Wi(t),a=n==="fixed",o=po(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Sa(0);if(r||!r&&!a)if((Aa(t)!=="body"||mu(i))&&(s=pf(t)),r){const d=po(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=C4(i));const u=o.left+s.scrollLeft-l.x,c=o.top+s.scrollTop-l.y;return{x:u,y:c,width:o.width,height:o.height}}function ah(e){return ir(e).position==="static"}function tb(e,t){return!on(e)||ir(e).position==="fixed"?null:t?t(e):e.offsetParent}function S4(e,t){const n=er(e);if(gf(e))return n;if(!on(e)){let i=Hi(e);for(;i&&!Ea(i);){if(Ft(i)&&!ah(i))return i;i=Hi(i)}return n}let r=tb(e,t);for(;r&&$9(r)&&ah(r);)r=tb(r,t);return r&&Ea(r)&&ah(r)&&!Sp(r)?n:r||k9(e)||n}const P$=async function(e){const t=this.getOffsetParent||S4,n=this.getDimensions,r=await n(e.floating);return{reference:k$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function F$(e){return ir(e).direction==="rtl"}const N$={convertOffsetParentRelativeRectToViewportRelativeRect:I$,getDocumentElement:Wi,getClippingRect:B$,getOffsetParent:S4,getElementRects:P$,getClientRects:_$,getDimensions:$$,getScale:ts,isElement:Ft,isRTL:F$};function M$(e,t){let n=null,r;const i=Wi(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{left:u,top:c,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const f=Hu(c),g=Hu(i.clientWidth-(u+d)),p=Hu(i.clientHeight-(c+h)),m=Hu(u),v={rootMargin:-f+"px "+-g+"px "+-p+"px "+-m+"px",threshold:so(0,gs(1,l))||1};let x=!0;function C(E){const w=E[0].intersectionRatio;if(w!==l){if(!x)return o();w?o(!1,w):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(C,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return o(!0),a}function w4(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=Ap(e),c=i||a?[...u?ma(u):[],...ma(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const d=u&&s?M$(u,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let g,p=l?po(e):null;l&&m();function m(){const b=po(e);p&&(b.x!==p.x||b.y!==p.y||b.width!==p.width||b.height!==p.height)&&n(),p=b,g=requestAnimationFrame(m)}return n(),()=>{var b;c.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),d==null||d(),(b=f)==null||b.disconnect(),f=null,l&&cancelAnimationFrame(g)}}const L$=C$,O$=v$,V$=E$,H$=y$,nb=m$,j$=(e,t,n)=>{const r=new Map,i={platform:N$,...n},a={...i.platform,_c:r};return p$(e,t,{...i,platform:a})};var Rc=typeof document<"u"?I.useLayoutEffect:I.useEffect;function md(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(!md(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)&&!md(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function I4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rb(e,t){const n=I4(e);return Math.round(t*n)/n}function ib(e){const t=q.useRef(e);return Rc(()=>{t.current=e}),t}function W$(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,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=q.useState(r);md(h,r)||f(r);const[g,p]=q.useState(null),[m,b]=q.useState(null),v=q.useCallback(R=>{R!==w.current&&(w.current=R,p(R))},[]),x=q.useCallback(R=>{R!==B.current&&(B.current=R,b(R))},[]),C=a||g,E=o||m,w=q.useRef(null),B=q.useRef(null),y=q.useRef(c),S=l!=null,D=ib(l),A=ib(i),T=q.useCallback(()=>{if(!w.current||!B.current)return;const R={placement:t,strategy:n,middleware:h};A.current&&(R.platform=A.current),j$(w.current,B.current,R).then(O=>{const j={...O,isPositioned:!0};F.current&&!md(y.current,j)&&(y.current=j,Jx.flushSync(()=>{d(j)}))})},[h,t,n,A]);Rc(()=>{u===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const F=q.useRef(!1);Rc(()=>(F.current=!0,()=>{F.current=!1}),[]),Rc(()=>{if(C&&(w.current=C),E&&(B.current=E),C&&E){if(D.current)return D.current(C,E,T);T()}},[C,E,T,D,S]);const k=q.useMemo(()=>({reference:w,floating:B,setReference:v,setFloating:x}),[v,x]),P=q.useMemo(()=>({reference:C,floating:E}),[C,E]),$=q.useMemo(()=>{const R={position:n,left:0,top:0};if(!P.floating)return R;const O=rb(P.floating,c.x),j=rb(P.floating,c.y);return s?{...R,transform:"translate("+O+"px, "+j+"px)",...I4(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:j}},[n,s,P.floating,c.x,c.y]);return q.useMemo(()=>({...c,update:T,refs:k,elements:P,floatingStyles:$}),[c,T,k,P,$])}const z$=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?nb({element:r.current,padding:i}).fn(n):{}:r?nb({element:r,padding:i}).fn(n):{}}}},G$=(e,t)=>({...L$(e),options:[e,t]}),U$=(e,t)=>({...V$(e),options:[e,t]}),X$=(e,t)=>({...H$(e),options:[e,t]}),Z$=(e,t)=>({...O$(e),options:[e,t]}),Y$=(e,t)=>({...z$(e),options:[e,t]}),_4={...q},K$=_4.useInsertionEffect,J$=K$||(e=>e());function na(e){const t=q.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return J$(()=>{t.current=e}),q.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)},[])}let ab=0;function Fa(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(ab);const a=()=>e==null?void 0:e.focus({preventScroll:n});i?a():ab=requestAnimationFrame(a)}var Rn=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(this,arguments)}let ob=!1,q$=0;const sb=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+q$++;function Q$(){const[e,t]=q.useState(()=>ob?sb():void 0);return Rn(()=>{e==null&&t(sb())},[]),q.useEffect(()=>{ob=!0},[]),e}const ek=_4.useId,bf=ek||Q$;let Rl;process.env.NODE_ENV!=="production"&&(Rl=new Set);function tk(){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=Rl)!=null&&e.has(i))){var a;(a=Rl)==null||a.add(i),console.warn(i)}}function nk(){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=Rl)!=null&&e.has(i))){var a;(a=Rl)==null||a.add(i),console.error(i)}}const rk=q.forwardRef(function(t,n){const{context:{placement:r,elements:{floating:i},middlewareData:{arrow:a}},width:o=14,height:s=7,tipRadius:l=0,strokeWidth:u=0,staticOffset:c,stroke:d,d:h,style:{transform:f,...g}={},...p}=t;process.env.NODE_ENV!=="production"&&(n||tk("The `ref` prop is required for `FloatingArrow`."));const m=bf(),[b,v]=q.useState(!1);if(Rn(()=>{if(!i)return;ir(i).direction==="rtl"&&v(!0)},[i]),!i)return null;const x=u*2,C=x/2,E=o/2*(l/-8+1),w=s/2*l/4,[B,y]=r.split("-"),S=!!h,D=B==="top"||B==="bottom",A=c&&y==="end"?"bottom":"top";let T=c&&y==="end"?"right":"left";c&&b&&(T=y==="end"?"left":"right");const F=(a==null?void 0:a.x)!=null?c||a.x:"",k=(a==null?void 0:a.y)!=null?c||a.y:"",P=h||"M0,0"+(" H"+o)+(" L"+(o-E)+","+(s-w))+(" Q"+o/2+","+s+" "+E+","+(s-w))+" Z",$={top:S?"rotate(180deg)":"",left:S?"rotate(90deg)":"rotate(-90deg)",bottom:S?"":"rotate(180deg)",right:S?"rotate(-90deg)":"rotate(90deg)"}[B];return q.createElement("svg",Tl({},p,{"aria-hidden":!0,ref:n,width:S?o:o+x,height:o,viewBox:"0 0 "+o+" "+(s>o?s:o),style:{position:"absolute",pointerEvents:"none",[T]:F,[A]:k,[B]:D||S?"100%":"calc(100% - "+x/2+"px)",transform:""+$+(f??""),...g}}),x>0&&q.createElement("path",{clipPath:"url(#"+m+")",fill:"none",stroke:d,strokeWidth:x+(h?0:1),d:P}),q.createElement("path",{stroke:x&&!h?p.fill:"none",d:P}),q.createElement("clipPath",{id:m},q.createElement("rect",{x:-C,y:C*(S?-1:1),width:o+x,height:o})))});function ik(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const ak=q.createContext(null),ok=q.createContext(null),D4=()=>{var e;return((e=q.useContext(ak))==null?void 0:e.id)||null},Tp=()=>q.useContext(ok);function Bl(e){return"data-floating-ui-"+e}function qa(e){const t=I.useRef(e);return Rn(()=>{t.current=e}),t}function sk(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 gl(e,t){let n=e.filter(i=>{var a;return i.parentId===t&&((a=i.context)==null?void 0:a.open)}),r=n;for(;r.length;)r=e.filter(i=>{var a;return(a=r)==null?void 0:a.some(o=>{var s;return i.parentId===o.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let ko=new WeakMap,ju=new WeakSet,Wu={},oh=0;const lk=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,A4=e=>e&&(e.host||A4(e.parentNode)),uk=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=A4(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ck(e,t,n,r){const i="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,o=uk(t,e),s=new Set,l=new Set(o),u=[];Wu[i]||(Wu[i]=new WeakMap);const c=Wu[i];o.forEach(d),h(t),s.clear();function d(f){!f||s.has(f)||(s.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||[].forEach.call(f.children,g=>{if(Aa(g)!=="script")if(s.has(g))h(g);else{const p=a?g.getAttribute(a):null,m=p!==null&&p!=="false",b=(ko.get(g)||0)+1,v=(c.get(g)||0)+1;ko.set(g,b),c.set(g,v),u.push(g),b===1&&m&&ju.add(g),v===1&&g.setAttribute(i,""),!m&&a&&g.setAttribute(a,"true")}})}return oh++,()=>{u.forEach(f=>{const g=(ko.get(f)||0)-1,p=(c.get(f)||0)-1;ko.set(f,g),c.set(f,p),g||(!ju.has(f)&&a&&f.removeAttribute(a),ju.delete(f)),p||f.removeAttribute(i)}),oh--,oh||(ko=new WeakMap,ko=new WeakMap,ju=new WeakSet,Wu={})}}function lb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Ar(e[0]).body;return ck(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const $l=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function T4(e,t){const n=mf(e,$l());t==="prev"&&n.reverse();const r=n.indexOf(Ha(Ar(e)));return n.slice(r+1)[0]}function R4(){return T4(document.body,"next")}function B4(){return T4(document.body,"prev")}function pl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Zn(n,r)}function dk(e){mf(e,$l()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function fk(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Rp={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};let hk;function ub(e){e.key==="Tab"&&(e.target,clearTimeout(hk))}const bd=q.forwardRef(function(t,n){const[r,i]=q.useState();Rn(()=>(M9()&&i("button"),document.addEventListener("keydown",ub),()=>{document.removeEventListener("keydown",ub)}),[]);const a={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Bl("focus-guard")]:"",style:Rp};return q.createElement("span",Tl({},t,a))}),$4=q.createContext(null),cb=Bl("portal");function gk(e){e===void 0&&(e={});const{id:t,root:n}=e,r=bf(),i=k4(),[a,o]=q.useState(null),s=q.useRef(null);return Rn(()=>()=>{a==null||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),Rn(()=>{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(cb,""),l.appendChild(u),s.current=u,o(u)},[t,r]),Rn(()=>{if(!r||s.current)return;let l=n||(i==null?void 0:i.portalNode);l&&!Ft(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(cb,""),l=u||l,l.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function pk(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,a=gk({id:n,root:r}),[o,s]=q.useState(null),l=q.useRef(null),u=q.useRef(null),c=q.useRef(null),d=q.useRef(null),h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return q.useEffect(()=>{if(!a||!i||o!=null&&o.modal)return;function f(g){a&&pl(g)&&(g.type==="focusin"?fk:dk)(a)}return a.addEventListener("focusin",f,!0),a.addEventListener("focusout",f,!0),()=>{a.removeEventListener("focusin",f,!0),a.removeEventListener("focusout",f,!0)}},[a,i,o==null?void 0:o.modal]),q.createElement($4.Provider,{value:q.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a])},h&&a&&q.createElement(bd,{"data-type":"outside",ref:l,onFocus:f=>{if(pl(f,a)){var g;(g=c.current)==null||g.focus()}else{const p=B4()||(o==null?void 0:o.refs.domReference.current);p==null||p.focus()}}}),h&&a&&q.createElement("span",{"aria-owns":a.id,style:Rp}),a&&Jx.createPortal(t,a),h&&a&&q.createElement(bd,{"data-type":"outside",ref:u,onFocus:f=>{if(pl(f,a)){var g;(g=d.current)==null||g.focus()}else{const p=R4()||(o==null?void 0:o.refs.domReference.current);p==null||p.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,f.nativeEvent))}}}))}const k4=()=>q.useContext($4),mk=20;let ja=[];function sh(e){ja=ja.filter(n=>n.isConnected);let t=e;if(!(!t||Aa(t)==="body")){if(!g$(t,$l())){const n=mf(t,$l())[0];n&&(t=n)}ja.push(t),ja.length>mk&&(ja=ja.slice(-20))}}function db(){return ja.slice().reverse().find(e=>e.isConnected)}const bk=q.forwardRef(function(t,n){return q.createElement("button",Tl({},t,{type:"button",ref:n,tabIndex:-1,style:Rp}))});function vk(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:d=!0}=e,{open:h,refs:f,nodeId:g,onOpenChange:p,events:m,dataRef:b,floatingId:v,elements:{domReference:x,floating:C}}=t,E=typeof o=="number"&&o<0,w=j9(x)&&E,B=lk()?a:!0,y=qa(i),S=qa(o),D=qa(s),A=Tp(),T=k4(),F=q.useRef(null),k=q.useRef(null),P=q.useRef(!1),$=q.useRef(!1),R=q.useRef(-1),O=T!=null,j=C==null?void 0:C.firstElementChild,V=(j==null?void 0:j.id)===v?j:C,W=na(function(z){return z===void 0&&(z=V),z?mf(z,$l()):[]}),U=na(z=>{const H=W(z);return y.current.map(X=>x&&X==="reference"?x:V&&X==="floating"?V:H).filter(Boolean).flat()});q.useEffect(()=>{if(r||!u)return;function z(X){if(X.key==="Tab"){Zn(V,Ha(Ar(V)))&&W().length===0&&!w&&ih(X);const te=U(),ie=Za(X);y.current[0]==="reference"&&ie===x&&(ih(X),X.shiftKey?Fa(te[te.length-1]):Fa(te[1])),y.current[1]==="floating"&&ie===V&&X.shiftKey&&(ih(X),Fa(te[0]))}}const H=Ar(V);return H.addEventListener("keydown",z),()=>{H.removeEventListener("keydown",z)}},[r,x,V,u,y,w,W,U]),q.useEffect(()=>{if(r||!C)return;function z(H){const X=Za(H),ie=W().indexOf(X);ie!==-1&&(R.current=ie)}return C.addEventListener("focusin",z),()=>{C.removeEventListener("focusin",z)}},[r,C,W]),q.useEffect(()=>{if(r||!d)return;function z(){$.current=!0,setTimeout(()=>{$.current=!1})}function H(X){const te=X.relatedTarget;queueMicrotask(()=>{const ie=!(Zn(x,te)||Zn(C,te)||Zn(te,C)||Zn(T==null?void 0:T.portalNode,te)||te!=null&&te.hasAttribute(Bl("focus-guard"))||A&&(gl(A.nodesRef.current,g).find(le=>{var ce,Q;return Zn((ce=le.context)==null?void 0:ce.elements.floating,te)||Zn((Q=le.context)==null?void 0:Q.elements.domReference,te)})||sk(A.nodesRef.current,g).find(le=>{var ce,Q;return((ce=le.context)==null?void 0:ce.elements.floating)===te||((Q=le.context)==null?void 0:Q.elements.domReference)===te})));if(l&&ie&&Ha(Ar(V))===Ar(V).body){on(V)&&(V==null||V.focus());const le=R.current,ce=W(),Q=ce[le]||ce[ce.length-1]||V;on(Q)&&Q.focus()}(w||!u)&&te&&ie&&!$.current&&te!==db()&&(P.current=!0,p(!1,X))})}if(C&&on(x))return x.addEventListener("focusout",H),x.addEventListener("pointerdown",z),C.addEventListener("focusout",H),()=>{x.removeEventListener("focusout",H),x.removeEventListener("pointerdown",z),C.removeEventListener("focusout",H)}},[r,x,C,V,u,g,A,T,p,d,l,W,w]),q.useEffect(()=>{var z;if(r)return;const H=Array.from((T==null||(z=T.portalNode)==null?void 0:z.querySelectorAll("["+Bl("portal")+"]"))||[]);if(C){const X=[C,...H,F.current,k.current,y.current.includes("reference")||w?x:null].filter(ie=>ie!=null),te=u||w?lb(X,B,!B):lb(X);return()=>{te()}}},[r,x,C,u,y,T,w,B]),Rn(()=>{if(r||!on(V))return;const z=Ar(V),H=Ha(z);queueMicrotask(()=>{const X=U(V),te=S.current,ie=(typeof te=="number"?X[te]:te.current)||V,le=Zn(V,H);!E&&!le&&h&&Fa(ie,{preventScroll:ie===V})})},[r,h,V,E,U,S]),Rn(()=>{if(r||!V)return;let z=!1;const H=Ar(V),X=Ha(H);let ie=b.current.openEvent;sh(X);function le(ce){let{open:Q,reason:be,event:Ce,nested:Se}=ce;Q&&(ie=Ce),be==="escape-key"&&f.domReference.current&&sh(f.domReference.current),be==="hover"&&Ce.type==="mouseleave"&&(P.current=!0),be==="outside-press"&&(Se?(P.current=!1,z=!0):P.current=!(F9(Ce)||N9(Ce)))}return m.on("openchange",le),()=>{m.off("openchange",le);const ce=Ha(H),Q=Zn(C,ce)||A&&gl(A.nodesRef.current,g).some(Se=>{var un;return Zn((un=Se.context)==null?void 0:un.elements.floating,ce)});(Q||ie&&["click","mousedown"].includes(ie.type))&&f.domReference.current&&sh(f.domReference.current);const Ce=db();D.current&&!P.current&&on(Ce)&&(!(Ce!==ce&&ce!==H.body)||Q)&&Fa(Ce,{cancelPrevious:!1,preventScroll:z})}},[r,C,V,D,b,f,m,A,g]),Rn(()=>{if(!r&&T)return T.setFocusManagerState({modal:u,closeOnFocusOut:d,open:h,onOpenChange:p,refs:f}),()=>{T.setFocusManagerState(null)}},[r,T,u,h,p,f,d]),Rn(()=>{if(r||!V||typeof MutationObserver!="function"||E)return;const z=()=>{const X=V.getAttribute("tabindex"),te=W(),ie=Ha(Ar(C)),le=te.indexOf(ie);le!==-1&&(R.current=le),y.current.includes("floating")||ie!==f.domReference.current&&te.length===0?X!=="0"&&V.setAttribute("tabindex","0"):X!=="-1"&&V.setAttribute("tabindex","-1")};z();const H=new MutationObserver(z);return H.observe(V,{childList:!0,subtree:!0,attributes:!0}),()=>{H.disconnect()}},[r,C,V,f,y,W,E]);function K(z){return r||!c||!u?null:q.createElement(bk,{ref:z==="start"?F:k,onClick:H=>p(!1,H.nativeEvent)},typeof c=="string"?c:"Dismiss")}const ee=!r&&B&&(u?!w:!0)&&(O||u);return q.createElement(q.Fragment,null,ee&&q.createElement(bd,{"data-type":"inside",ref:T==null?void 0:T.beforeInsideRef,onFocus:z=>{if(u){const X=U();Fa(i[0]==="reference"?X[0]:X[X.length-1])}else if(T!=null&&T.preserveTabOrder&&T.portalNode)if(P.current=!1,pl(z,T.portalNode)){const X=R4()||x;X==null||X.focus()}else{var H;(H=T.beforeOutsideRef.current)==null||H.focus()}}}),!w&&K("start"),n,K("end"),ee&&q.createElement(bd,{"data-type":"inside",ref:T==null?void 0:T.afterInsideRef,onFocus:z=>{if(u)Fa(U()[0]);else if(T!=null&&T.preserveTabOrder&&T.portalNode)if(d&&(P.current=!0),pl(z,T.portalNode)){const X=B4()||x;X==null||X.focus()}else{var H;(H=T.afterOutsideRef.current)==null||H.focus()}}}))}function fb(e){return on(e.target)&&e.target.tagName==="BUTTON"}function hb(e){return d4(e)}function yk(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}=t,d=q.useRef(),h=q.useRef(!1),f=q.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const p=d.current;g.button===0&&s!=="click"&&(Y1(p)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){const p=d.current;if(s==="mousedown"&&d.current){d.current=void 0;return}Y1(p)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!c||fb(g))&&(g.key===" "&&!hb(a)&&(g.preventDefault(),h.current=!0),g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!c||fb(g)||hb(a)||g.key===" "&&h.current&&(h.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[i,a,s,u,c,r,n,l]);return q.useMemo(()=>o?{reference:f}:{},[o,f])}const xk={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ck={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},gb=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 Ek(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:d="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:g}=t,p=Tp(),m=na(typeof l=="function"?l:()=>!1),b=typeof l=="function"?m:l,v=q.useRef(!1),x=q.useRef(!1),{escapeKey:C,outsidePress:E}=gb(f),{escapeKey:w,outsidePress:B}=gb(g),y=na(k=>{var P;if(!n||!o||!s||k.key!=="Escape")return;const $=(P=a.current.floatingContext)==null?void 0:P.nodeId,R=p?gl(p.nodesRef.current,$):[];if(!C&&(k.stopPropagation(),R.length>0)){let O=!0;if(R.forEach(j=>{var V;if((V=j.context)!=null&&V.open&&!j.context.dataRef.current.__escapeKeyBubbles){O=!1;return}}),!O)return}r(!1,O9(k)?k.nativeEvent:k,"escape-key")}),S=na(k=>{var P;const $=()=>{var R;y(k),(R=Za(k))==null||R.removeEventListener("keydown",$)};(P=Za(k))==null||P.addEventListener("keydown",$)}),D=na(k=>{var P;const $=v.current;v.current=!1;const R=x.current;if(x.current=!1,u==="click"&&R||$||typeof b=="function"&&!b(k))return;const O=Za(k),j="["+Bl("inert")+"]",V=Ar(i.floating).querySelectorAll(j);let W=Ft(O)?O:null;for(;W&&!Ea(W);){const z=Hi(W);if(Ea(z)||!Ft(z))break;W=z}if(V.length&&Ft(O)&&!V9(O)&&!Zn(O,i.floating)&&Array.from(V).every(z=>!Zn(W,z)))return;if(on(O)&&F){const z=O.clientWidth>0&&O.scrollWidth>O.clientWidth,H=O.clientHeight>0&&O.scrollHeight>O.clientHeight;let X=H&&k.offsetX>O.clientWidth;if(H&&ir(O).direction==="rtl"&&(X=k.offsetX<=O.offsetWidth-O.clientWidth),X||z&&k.offsetY>O.clientHeight)return}const U=(P=a.current.floatingContext)==null?void 0:P.nodeId,K=p&&gl(p.nodesRef.current,U).some(z=>{var H;return rh(k,(H=z.context)==null?void 0:H.elements.floating)});if(rh(k,i.floating)||rh(k,i.domReference)||K)return;const ee=p?gl(p.nodesRef.current,U):[];if(ee.length>0){let z=!0;if(ee.forEach(H=>{var X;if((X=H.context)!=null&&X.open&&!H.context.dataRef.current.__outsidePressBubbles){z=!1;return}}),!z)return}r(!1,k,"outside-press")}),A=na(k=>{var P;const $=()=>{var R;D(k),(R=Za(k))==null||R.removeEventListener(u,$)};(P=Za(k))==null||P.addEventListener(u,$)});q.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=E;function k(R){r(!1,R,"ancestor-scroll")}const P=Ar(i.floating);s&&P.addEventListener("keydown",w?S:y,w),b&&P.addEventListener(u,B?A:D,B);let $=[];return h&&(Ft(i.domReference)&&($=ma(i.domReference)),Ft(i.floating)&&($=$.concat(ma(i.floating))),!Ft(i.reference)&&i.reference&&i.reference.contextElement&&($=$.concat(ma(i.reference.contextElement)))),$=$.filter(R=>{var O;return R!==((O=P.defaultView)==null?void 0:O.visualViewport)}),$.forEach(R=>{R.addEventListener("scroll",k,{passive:!0})}),()=>{s&&P.removeEventListener("keydown",w?S:y,w),b&&P.removeEventListener(u,B?A:D,B),$.forEach(R=>{R.removeEventListener("scroll",k)})}},[a,i,s,b,u,n,r,h,o,C,E,y,w,S,D,B,A]),q.useEffect(()=>{v.current=!1},[b,u]);const T=q.useMemo(()=>({onKeyDown:y,[xk[d]]:k=>{c&&r(!1,k.nativeEvent,"reference-press")}}),[y,r,c,d]),F=q.useMemo(()=>({onKeyDown:y,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ck[u]]:()=>{v.current=!0}}),[y,u]);return q.useMemo(()=>o?{reference:T,floating:F}:{},[o,T,F])}function Sk(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=bf(),a=q.useRef({}),[o]=q.useState(()=>ik()),s=D4()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!Ft(f)&&nk("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]=q.useState(r.reference),c=na((f,g,p)=>{a.current.openEvent=f?g:void 0,o.emit("openchange",{open:f,event:g,reason:p,nested:s}),n==null||n(f,g,p)}),d=q.useMemo(()=>({setPositionReference:u}),[]),h=q.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return q.useMemo(()=>({dataRef:a,open:t,onOpenChange:c,elements:h,events:o,floatingId:i,refs:d}),[t,c,h,o,i,d])}function wk(e){e===void 0&&(e={});const{nodeId:t}=e,n=Sk({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=q.useState(null),[s,l]=q.useState(null),c=(i==null?void 0:i.reference)||a,d=q.useRef(null),h=Tp();Rn(()=>{c&&(d.current=c)},[c]);const f=W$({...e,elements:{...i,...s&&{reference:s}}}),g=q.useCallback(x=>{const C=Ft(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;l(C),f.refs.setReference(C)},[f.refs]),p=q.useCallback(x=>{(Ft(x)||x===null)&&(d.current=x,o(x)),(Ft(f.refs.reference.current)||f.refs.reference.current===null||x!==null&&!Ft(x))&&f.refs.setReference(x)},[f.refs]),m=q.useMemo(()=>({...f.refs,setReference:p,setPositionReference:g,domReference:d}),[f.refs,p,g]),b=q.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),v=q.useMemo(()=>({...f,...r,refs:m,elements:b,nodeId:t}),[f,m,b,t,r]);return Rn(()=>{r.dataRef.current.floatingContext=v;const x=h==null?void 0:h.nodesRef.current.find(C=>C.id===t);x&&(x.context=v)}),q.useMemo(()=>({...f,context:v,refs:m,elements:b}),[f,m,b,v])}const pb="active",mb="selected";function lh(e,t,n){const r=new Map,i=n==="item";let a=e;if(i&&e){const{[pb]:o,[mb]:s,...l}=e;a=l}return{...n==="floating"&&{tabIndex:-1},...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&&[pb,mb].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var d;(d=r.get(u))==null||d.push(c),o[u]=function(){for(var h,f=arguments.length,g=new Array(f),p=0;p<f;p++)g[p]=arguments[p];return(h=r.get(u))==null?void 0:h.map(m=>m(...g)).find(m=>m!==void 0)}}}else o[u]=c}),o),{})}}function Ik(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=q.useCallback(s=>lh(s,e,"reference"),t),a=q.useCallback(s=>lh(s,e,"floating"),n),o=q.useCallback(s=>lh(s,e,"item"),r);return q.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}const _k=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Dk(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:a=!0,role:o="dialog"}=t,s=(n=_k.get(o))!=null?n:o,l=bf(),c=D4()!=null,d=q.useMemo(()=>s==="tooltip"||o==="label"?{["aria-"+(o==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":r?i:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:l},...s==="menu"&&c&&{role:"menuitem"},...o==="select"&&{"aria-autocomplete":"none"},...o==="combobox"&&{"aria-autocomplete":"list"}},[s,i,c,r,l,o]),h=q.useMemo(()=>{const g={id:i,...s&&{role:s}};return s==="tooltip"||o==="label"?g:{...g,...s==="menu"&&{"aria-labelledby":l}}},[s,i,l,o]),f=q.useCallback(g=>{let{active:p,selected:m}=g;const b={role:"option",...p&&{id:i+"-option"}};switch(o){case"select":return{...b,"aria-selected":p&&m};case"combobox":return{...b,...p&&{"aria-selected":!0}}}return{}},[i,o]);return q.useMemo(()=>a?{reference:d,floating:h,item:f}:{},[a,d,h,f])}const bb=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function Po(e,t){return typeof e=="function"?e(t):e}function Ak(e,t){const[n,r]=q.useState(e);return e&&!n&&r(!0),q.useEffect(()=>{if(!e&&n){const i=setTimeout(()=>r(!1),t);return()=>clearTimeout(i)}},[e,n,t]),n}function Tk(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]=q.useState("unmounted"),u=Ak(n,o);return!u&&s==="close"&&l("unmounted"),Rn(()=>{if(r){if(n){l("initial");const c=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(c)}}l("close")}},[n,r]),{isMounted:u,status:s}}function Rk(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=q.useMemo(()=>({side:l,placement:s}),[l,s]),c=typeof o=="number",d=(c?o:o.open)||0,h=(c?o:o.close)||0,[f,g]=q.useState(()=>({...Po(a,u),...Po(n,u)})),{isMounted:p,status:m}=Tk(e,{duration:o}),b=qa(n),v=qa(r),x=qa(i),C=qa(a);return Rn(()=>{const E=Po(b.current,u),w=Po(x.current,u),B=Po(C.current,u),y=Po(v.current,u)||Object.keys(E).reduce((S,D)=>(S[D]="",S),{});if(m==="initial"&&g(S=>({transitionProperty:S.transitionProperty,...B,...E})),m==="open"&&g({transitionProperty:Object.keys(y).map(bb).join(","),transitionDuration:d+"ms",...B,...y}),m==="close"){const S=w||E;g({transitionProperty:Object.keys(S).map(bb).join(","),transitionDuration:h+"ms",...B,...S})}},[h,x,b,v,C,d,m,u]),{isMounted:p,styles:f}}const Bk="_popover_cskuc_1",$k={popover:Bk},pi=I.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:d,styleInnerPopover:h={},floatingOptions:f={},onClose:g=()=>{},withArrow:p,propsArrow:m={},floatingFocusManagerProps:b,useDismissProps:v,...x}=e,C=I.useRef(null),[E,w]=I.useState(!1),{refs:B,floatingStyles:y,context:S}=wk({open:E,onOpenChange:j=>{w(j),j||g()},middleware:[G$(i),s?Z$(u):X$(l),U$(),Y$({element:C})],whileElementsMounted:w4,...f}),D=yk(S),A=Ek(S,v),T=Dk(S),{getReferenceProps:F,getFloatingProps:k}=Ik([D,A,T]),{styles:P,isMounted:$}=Rk(S),R=j=>{B.setReference(j.currentTarget),w(V=>!V),E&&g()};I.useEffect(()=>{a&&o?R({currentTarget:o}):a||w(!1)},[a,o]),I.useImperativeHandle(t,()=>({show:E,setShow:w,handlerShow:R,getReferenceProps:F}),[E]);const O=()=>{let j={...y,...P,...h,zIndex:c};return d&&(j={...j,width:d}),j};return _.jsx(_.Fragment,{children:$&&E&&_.jsx(pk,{children:_.jsx(vk,{context:S,modal:!1,...b,children:_.jsxs("div",{ref:B.setFloating,style:O(),...k(),className:`${$k.popover} ${r??""}`,...x,children:[n,p&&_.jsx(rk,{ref:C,context:S,...m})]})})})})});pi.displayName="Popover";const kk="_input_1kwx0_271",Pk="_label_1kwx0_271",Fk="_error_1kwx0_307",Mn={"container-large":"_container-large_1kwx0_271","container-input":"_container-input_1kwx0_271",input:kk,label:Pk,"container-medium":"_container-medium_1kwx0_271","container-small":"_container-small_1kwx0_271",error:Fk,"label-error":"_label-error_1kwx0_307","isset-right-icon":"_isset-right-icon_1kwx0_552","isset-left-icon":"_isset-left-icon_1kwx0_556","start-icon":"_start-icon_1kwx0_573","end-icon":"_end-icon_1kwx0_581"},Nk={size:{large:Mn["container-large"],medium:Mn["container-medium"],small:Mn["container-small"]}},P4=I.forwardRef((e,t)=>{var v;const{isRequired:n,classNameContainer:r,classNameLabelError:i,classNameLabel:a,className:o,name:s,id:l,label:u,type:c="text",startIcon:d,endIcon:h,error:f,sizeInput:g="large",...p}=e,m=()=>typeof d=="function"||I.isValidElement(d),b=()=>typeof h=="function"||I.isValidElement(h);return _.jsxs("div",{className:`${Mn.container} ${(v=Nk.size)==null?void 0:v[g]} ${r??""}`,children:[_.jsxs("div",{className:Mn["container-input"],children:[_.jsx("input",{id:l??s,className:`${Mn.input} ${f?Mn.error:""}
38
38
  ${m()?Mn["isset-left-icon"]:""}
39
39
  ${b()?Mn["isset-right-icon"]:""}
40
40
  ${o??""}`,ref:t,type:c,...p}),_.jsxs("div",{className:Mn["start-icon"],children:[typeof d=="function"&&d(),I.isValidElement(d)&&d]}),_.jsxs("label",{className:`${Mn.label} ${a??""}`,htmlFor:l??s,children:[u," ",n&&_.jsx("span",{className:"1ru-text-laba-red-08",children:"*"})]}),_.jsxs("div",{className:Mn["end-icon"],children:[typeof h=="function"&&h(),I.isValidElement(h)&&h]})]}),f&&_.jsx("label",{className:`${Mn["label-error"]}
@@ -63,16 +63,16 @@ Private-MAC: `+v.digest().toHex()+`\r
63
63
  * LICENSE.md file in the root directory of this source tree.
64
64
  *
65
65
  * @license MIT
66
- */function bs(e,t){return e?v8(e)?q.createElement(e,t):e:null}function v8(e){return y8(e)||typeof e=="function"||x8(e)}function y8(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function x8(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function C8(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=q.useState(()=>({current:c2(t)})),[r,i]=q.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 E8=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:O4,ColumnFiltering:Z4,ColumnGrouping:Y4,ColumnOrdering:J4,ColumnPinning:q4,ColumnSizing:Q4,ColumnVisibility:t2,GlobalFaceting:n2,GlobalFiltering:r2,Headers:L4,RowExpanding:i2,RowPagination:a2,RowPinning:o2,RowSelection:s2,RowSorting:u2,_getVisibleLeafColumns:ns,aggregationFns:Bc,buildHeaderGroups:Qs,createCell:N4,createColumn:M4,createColumnHelper:jk,createRow:vu,createTable:c2,defaultColumnSizing:el,expandRows:Fp,filterFns:Xr,flattenBy:$p,flexRender:bs,functionalUpdate:Fi,getCoreRowModel:o8,getExpandedRowModel:s8,getFacetedMinMaxValues:l8,getFacetedRowModel:d8,getFacetedUniqueValues:f8,getFilteredRowModel:h8,getGroupedRowModel:g8,getMemoOptions:Ie,getPaginationRowModel:m8,getSortedRowModel:b8,isFunction:bu,isNumberArray:F4,isRowSelected:vf,isSubRowSelected:vd,makeStateUpdater:Wn,memo:we,noop:Wk,orderColumns:K4,passiveEventSupported:e2,reSplitAlphaNumeric:yd,selectRowsFn:$c,shouldAutoRemoveFilter:J0,sortingFns:Uo,useReactTable:C8},Symbol.toStringTag,{value:"Module"})),yf=0,Ta=1,$s=2,f2=4;function kl(e,t){return n=>e(t(n))}function S8(e,t){return t(e)}function h2(e,t){return n=>e(t,n)}function yb(e,t){return()=>e(t)}function xf(e,t){return t(e),e}function Dt(...e){return e}function w8(e){e()}function xb(e){return()=>e}function I8(...e){return()=>{e.map(w8)}}function Np(e){return e!==void 0}function wo(){}function mt(e,t){return e(Ta,t)}function We(e,t){e(yf,t)}function Mp(e){e($s)}function xn(e){return e(f2)}function _e(e,t){return mt(e,h2(t,yf))}function fi(e,t){const n=e(Ta,r=>{n(),t(r)});return n}function tt(){const e=[];return(t,n)=>{switch(t){case $s:e.splice(0,e.length);return;case Ta:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case yf:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=tt();return(r,i)=>{switch(r){case Ta:i(t);break;case yf:t=i;break;case f2:return t}return n(r,i)}}function _8(e){let t,n;const r=()=>t&&t();return function(i,a){switch(i){case Ta:return a?n===a?void 0:(r(),n=a,t=mt(e,a),t):(r(),wo);case $s:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function tr(e){return xf(tt(),t=>_e(e,t))}function Cn(e,t){return xf(fe(t),n=>_e(e,n))}function D8(...e){return t=>e.reduceRight(S8,t)}function ue(e,...t){const n=D8(...t);return(r,i)=>{switch(r){case Ta:return mt(e,n(i));case $s:Mp(e);return}}}function g2(e,t){return e===t}function _t(e=g2){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Ne(e){return t=>n=>{e(n)&&t(n)}}function ve(e){return t=>kl(t,e)}function Jr(e){return t=>()=>t(e)}function ii(e,t){return n=>r=>n(t=e(t,r))}function vs(e){return t=>n=>{e>0?e--:t(n)}}function ua(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Cb(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ge(...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);mt(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 Eb(...e){return function(t,n){switch(t){case Ta:return I8(...e.map(r=>mt(r,n)));case $s:return;default:throw new Error(`unrecognized action ${t}`)}}}function Le(e,t=g2){return ue(e,_t(t))}function sn(...e){const t=tt(),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);mt(a,l=>{n[o]=l,r=r|s,r===i&&We(t,n)})}),function(a,o){switch(a){case Ta:return r===i&&o(n),mt(t,o);case $s:return Mp(t);default:throw new Error(`unrecognized action ${a}`)}}}function lt(e,t=[],{singleton:n}={singleton:!0}){return{id:A8(),constructor:e,dependencies:t,singleton:n}}const A8=()=>Symbol();function T8(e){const t=new Map,n=({id:r,constructor:i,dependencies:a,singleton:o})=>{if(o&&t.has(r))return t.get(r);const s=i(a.map(l=>n(l)));return o&&t.set(r,s),s};return n(e)}function R8(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)r.hasOwnProperty(o)||(n[o]=t[o]);return n}const Gu=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Lp(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=I.createContext({});function l(b,v){b.propsReady&&We(b.propsReady,!1);for(const x of r){const C=b[t.required[x]];We(C,v[x])}for(const x of i)if(x in v){const C=b[t.optional[x]];We(C,v[x])}b.propsReady&&We(b.propsReady,!0)}function u(b){return a.reduce((v,x)=>(v[x]=C=>{const E=b[t.methods[x]];We(E,C)},v),{})}function c(b){return o.reduce((v,x)=>(v[x]=_8(b[t.events[x]]),v),{})}const d=I.forwardRef((b,v)=>{const{children:x,...C}=b,[E]=I.useState(()=>xf(T8(e),B=>l(B,C))),[w]=I.useState(yb(c,E));return Gu(()=>{for(const B of o)B in C&&mt(w[B],C[B]);return()=>{Object.values(w).map(Mp)}},[C,w,E]),Gu(()=>{l(E,C)}),I.useImperativeHandle(v,xb(u(E))),I.createElement(s.Provider,{value:E},n?I.createElement(n,R8([...r,...i,...o],C),x):x)}),h=b=>I.useCallback(h2(We,I.useContext(s)[b]),[b]),f=b=>{const x=I.useContext(s)[b],C=I.useCallback(E=>mt(x,E),[x]);return I.useSyncExternalStore(C,()=>xn(x),()=>xn(x))},g=b=>{const x=I.useContext(s)[b],[C,E]=I.useState(yb(xn,x));return Gu(()=>mt(x,w=>{w!==C&&E(xb(w))}),[x,C]),C},p=I.version.startsWith("18")?f:g;return{Component:d,usePublisher:h,useEmitterValue:p,useEmitter:(b,v)=>{const C=I.useContext(s)[b];Gu(()=>mt(C,v),[v,C])}}}const B8=typeof document<"u"?I.useLayoutEffect:I.useEffect,$8=B8;var nr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(nr||{});const k8={0:"debug",1:"log",2:"warn",3:"error"},P8=()=>typeof globalThis>"u"?window:globalThis,Ra=lt(()=>{const e=fe(3);return{log:fe((n,r,i=1)=>{var a;const o=(a=P8().VIRTUOSO_LOG_LEVEL)!=null?a:xn(e);i>=o&&console[k8[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Op(e,t=!0){const n=I.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=I.useMemo(()=>new ResizeObserver(a=>{requestAnimationFrame(()=>{const o=a[0].target;o.offsetParent!==null&&e(o)})}),[e]);r=a=>{a&&t?(i.observe(a),n.current=a):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function hi(e,t=!0){return Op(e,t).callbackRef}function p2(e,t,n,r,i,a,o){const s=I.useCallback(l=>{const u=F8(l.children,t,"offsetHeight",i);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const d=c.lastElementChild.dataset.viewportType==="window",h=o?o.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,f=o?o.scrollHeight:d?document.documentElement.scrollHeight:c.scrollHeight,g=o?o.offsetHeight:d?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(h,0),scrollHeight:f,viewportHeight:g}),a==null||a(N8("row-gap",getComputedStyle(l).rowGap,i)),u!==null&&e(u)},[e,t,i,a,o,r]);return Op(s,n)}function F8(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||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},nr.ERROR),c===u)continue;const d=a[a.length-1];a.length===0||d.size!==c||d.endIndex!==l-1?a.push({startIndex:l,endIndex:l,size:c}):a[a.length-1].endIndex++}return a}function N8(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}function Fr(e,t){return Math.round(e.getBoundingClientRect()[t])}function m2(e,t){return Math.abs(e-t)<1.01}function b2(e,t,n,r=wo,i){const a=I.useRef(null),o=I.useRef(null),s=I.useRef(null),l=I.useCallback(d=>{const h=d.target,f=h===window||h===document,g=f?window.pageYOffset||document.documentElement.scrollTop:h.scrollTop,p=f?document.documentElement.scrollHeight:h.scrollHeight,m=f?window.innerHeight:h.offsetHeight,b=()=>{e({scrollTop:Math.max(g,0),scrollHeight:p,viewportHeight:m})};d.suppressFlushSync?b():cu.flushSync(b),o.current!==null&&(g===o.current||g<=0||g===p-m)&&(o.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);I.useEffect(()=>{const d=i||a.current;return r(i||a.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[a,l,n,r,i]);function u(d){const h=a.current;if(!h||"offsetHeight"in h&&h.offsetHeight===0)return;const f=d.behavior==="smooth";let g,p,m;h===window?(p=Math.max(Fr(document.documentElement,"height"),document.documentElement.scrollHeight),g=window.innerHeight,m=document.documentElement.scrollTop):(p=h.scrollHeight,g=Fr(h,"height"),m=h.scrollTop);const b=p-g;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),m2(g,p)||d.top===m){e({scrollTop:m,scrollHeight:p,viewportHeight:g}),f&&t(!0);return}f?(o.current=d.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,o.current=null,t(!0)},1e3)):o.current=null,h.scrollTo(d)}function c(d){a.current.scrollBy(d)}return{scrollerRef:a,scrollByCallback:c,scrollToCallback:u}}const $n=lt(()=>{const e=tt(),t=tt(),n=fe(0),r=tt(),i=fe(0),a=tt(),o=tt(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),d=tt(),h=tt(),f=fe(!1);return _e(ue(e,ve(({scrollTop:g})=>g)),t),_e(ue(e,ve(({scrollHeight:g})=>g)),o),_e(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:o,smoothScrollTargetReached:r,scrollTo:d,scrollBy:h,statefulScrollTop:i,deviation:n,scrollingInProgress:f}},[],{singleton:!0}),Pl={lvl:0};function v2(e,t,n,r=Pl,i=Pl){return{k:e,v:t,lvl:n,l:r,r:i}}function yt(e){return e===Pl}function rs(){return Pl}function tg(e,t){if(yt(e))return Pl;const{k:n,l:r,r:i}=e;if(t===n){if(yt(r))return i;if(yt(i))return r;{const[a,o]=y2(r);return kc(qt(e,{k:a,v:o,l:x2(r)}))}}else return t<n?kc(qt(e,{l:tg(r,t)})):kc(qt(e,{r:tg(i,t)}))}function Fl(e,t){if(!yt(e))return t===e.k?e.v:t<e.k?Fl(e.l,t):Fl(e.r,t)}function Nr(e,t,n="k"){if(yt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Nr(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Nr(e.l,t,n)}function qn(e,t,n){return yt(e)?v2(t,n,1):t===e.k?qt(e,{k:t,v:n}):t<e.k?Sb(qt(e,{l:qn(e.l,t,n)})):Sb(qt(e,{r:qn(e.r,t,n)}))}function ng(e,t,n){if(yt(e))return[];const{k:r,v:i,l:a,r:o}=e;let s=[];return r>t&&(s=s.concat(ng(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:i}),r<=n&&(s=s.concat(ng(o,t,n))),s}function Qa(e){return yt(e)?[]:[...Qa(e.l),{k:e.k,v:e.v},...Qa(e.r)]}function y2(e){return yt(e.r)?[e.k,e.v]:y2(e.r)}function x2(e){return yt(e.r)?e.l:kc(qt(e,{r:x2(e.r)}))}function qt(e,t){return v2(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 gh(e){return yt(e)||e.lvl>e.r.lvl}function Sb(e){return rg(E2(e))}function kc(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(gh(t))return E2(qt(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return qt(t.r,{l:qt(t,{r:t.r.l}),r:qt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(gh(e))return rg(qt(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const i=n.l,a=gh(i)?n.lvl-1:n.lvl;return qt(i,{l:qt(e,{r:i.l,lvl:r-1}),r:rg(qt(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Cf(e,t,n){if(yt(e))return[];const r=Nr(e,t)[0];return M8(ng(e,r,n))}function C2(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({start:r,end:s-1,value:i}),r=s,i=l}return a.push({start:r,end:1/0,value:i}),a}function M8(e){return C2(e,({k:t,v:n})=>({index:t,value:n}))}function rg(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?qt(t,{l:qt(e,{r:t.l}),lvl:n+1}):e}function E2(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?qt(t,{r:qt(e,{l:t.r})}):e}function xd(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 S2(e,t,n){return e[xd(e,t,n)]}function L8(e,t,n,r){const i=xd(e,t,r),a=xd(e,n,r,i);return e.slice(i,a+1)}const Vp=lt(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function O8(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function wb(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 V8(e,t){let n=yt(e)?0:1/0;for(const r of t){const{size:i,startIndex:a,endIndex:o}=r;if(n=Math.min(n,a),yt(e)){e=qn(e,0,i);continue}const s=Cf(e,a-1,o+1);if(s.some(O8(r)))continue;let l=!1,u=!1;for(const{start:c,end:d,value:h}of s)l?(o>=c||i===h)&&(e=tg(e,c)):(u=h!==i,l=!0),d>o&&o>=c&&h!==i&&(e=qn(e,o+1,h));u&&(e=qn(e,a,i))}return[e,n]}function H8(){return{offsetTree:[],sizeTree:rs(),groupOffsetTree:rs(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Hp({index:e},t){return t===e?0:t<e?-1:1}function j8({offset:e},t){return t===e?0:t<e?-1:1}function W8(e){return{index:e.index,value:e}}function z8(e,t,n,r=0){return r>0&&(t=Math.max(t,S2(e,r,Hp).offset)),C2(L8(e,t,n,j8),W8)}function ig(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=xd(i,t-1,Hp),s=i[l].offset;const c=Nr(n,t-1);a=c[0],o=c[1],i.length&&i[l].size===Nr(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of Cf(n,t,1/0)){const d=u-a,h=d*o+s+d*r;i.push({offset:h,size:c,index:u}),a=u,s=h,o=c}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function G8(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,nr.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&yt(a)&&t.length===2){const h=t[0].size,f=t[1].size;o=n.reduce((g,p)=>qn(qn(g,p,h),p+1,f),o)}else[o,s]=V8(o,t);if(o===a)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:d}=ig(e.offsetTree,s,o,i);return{sizeTree:o,offsetTree:l,lastIndex:u,lastOffset:d,lastSize:c,groupOffsetTree:n.reduce((h,f)=>qn(h,f,Nl(f,l,i)),rs()),groupIndices:n}}function Nl(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:a}=S2(t,e,Hp),o=e-i,s=a*o+(o-1)*n+r;return s>0?s+n:s}function U8(e){return typeof e.groupIndex<"u"}function w2(e,t,n){if(U8(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=I2(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function I2(e,t){if(!Ef(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Ef(e){return!yt(e.groupOffsetTree)}function X8(e){return Qa(e).map(({k:t,v:n},r,i)=>{const a=i[r+1],o=a?a.k-1:1/0;return{startIndex:t,endIndex:o,size:n}})}const Z8={offsetHeight:"height",offsetWidth:"width"},mi=lt(([{log:e},{recalcInProgress:t}])=>{const n=tt(),r=tt(),i=Cn(r,0),a=tt(),o=tt(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),d=fe((E,w)=>Fr(E,Z8[w])),h=fe(void 0),f=fe(0),g=H8(),p=Cn(ue(n,Ge(l,e,f),ii(G8,g),_t()),g),m=Cn(ue(l,_t(),ii((E,w)=>({prev:E.current,current:w}),{prev:[],current:[]}),ve(({prev:E})=>E)),[]);_e(ue(l,Ne(E=>E.length>0),Ge(p,f),ve(([E,w,B])=>{const y=E.reduce((S,D,A)=>qn(S,D,Nl(D,w.offsetTree,B)||A),rs());return{...w,groupIndices:E,groupOffsetTree:y}})),p),_e(ue(r,Ge(p),Ne(([E,{lastIndex:w}])=>E<w),ve(([E,{lastIndex:w,lastSize:B}])=>[{startIndex:E,endIndex:w,size:B}])),n),_e(u,c);const b=Cn(ue(u,ve(E=>E===void 0)),!0);_e(ue(c,Ne(E=>E!==void 0&&yt(xn(p).sizeTree)),ve(E=>[{startIndex:0,endIndex:0,size:E}])),n);const v=tr(ue(n,Ge(p),ii(({sizes:E},[w,B])=>({changed:B!==E,sizes:B}),{changed:!1,sizes:g}),ve(E=>E.changed)));mt(ue(s,ii((E,w)=>({diff:E.prev-w,prev:w}),{diff:0,prev:0}),ve(E=>E.diff)),E=>{const{groupIndices:w}=xn(p);if(E>0)We(t,!0),We(a,E+wb(E,w));else if(E<0){const B=xn(m);B.length>0&&(E-=wb(-E,B)),We(o,E)}}),mt(ue(s,Ge(e)),([E,w])=>{E<0&&w("`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},nr.ERROR)});const x=tr(a);_e(ue(a,Ge(p),ve(([E,w])=>{const B=w.groupIndices.length>0,y=[],S=w.lastSize;if(B){const D=Fl(w.sizeTree,0);let A=0,T=0;for(;A<E;){const P=w.groupIndices[T],$=w.groupIndices.length===T+1?1/0:w.groupIndices[T+1]-P-1;y.push({startIndex:P,endIndex:P,size:D}),y.push({startIndex:P+1,endIndex:P+1+$-1,size:S}),T++,A+=$+1}const F=Qa(w.sizeTree);return A!==E&&F.shift(),F.reduce((P,{k:$,v:R})=>{let O=P.ranges;return P.prevSize!==0&&(O=[...P.ranges,{startIndex:P.prevIndex,endIndex:$+E-1,size:P.prevSize}]),{ranges:O,prevIndex:$+E,prevSize:R}},{ranges:y,prevIndex:E,prevSize:0}).ranges}return Qa(w.sizeTree).reduce((D,{k:A,v:T})=>({ranges:[...D.ranges,{startIndex:D.prevIndex,endIndex:A+E-1,size:D.prevSize}],prevIndex:A+E,prevSize:T}),{ranges:[],prevIndex:0,prevSize:S}).ranges})),n);const C=tr(ue(o,Ge(p,f),ve(([E,{offsetTree:w},B])=>{const y=-E;return Nl(y,w,B)})));return _e(ue(o,Ge(p,f),ve(([E,w,B])=>{if(w.groupIndices.length>0){if(yt(w.sizeTree))return w;let S=rs();const D=xn(m);let A=0,T=0,F=0;for(;A<-E;){F=D[T];const P=D[T+1]-F-1;T++,A+=P+1}if(S=Qa(w.sizeTree).reduce((P,{k:$,v:R})=>qn(P,Math.max(0,$+E),R),S),A!==-E){const P=Fl(w.sizeTree,F);S=qn(S,0,P);const $=Nr(w.sizeTree,-E+1)[1];S=qn(S,1,$)}return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}else{const S=Qa(w.sizeTree).reduce((D,{k:A,v:T})=>qn(D,Math.max(0,A+E),T),rs());return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}})),p),{data:h,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,shiftWith:o,shiftWithOffset:C,beforeUnshiftWith:x,firstItemIndex:s,gap:f,sizes:p,listRefresh:v,statefulTotalCount:i,trackItemSizes:b,itemSize:d}},Dt(Ra,Vp),{singleton:!0}),Y8=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function _2(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Y8)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const yu=lt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:a,scrollTo:o,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:d},{log:h}])=>{const f=tt(),g=tt(),p=fe(0);let m=null,b=null,v=null;function x(){m&&(m(),m=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),We(i,!1)}return _e(ue(f,Ge(e,a,t,p,l,u,h),Ge(r,c,d),ve(([[C,E,w,B,y,S,D,A],T,F,k])=>{const P=_2(C),{align:$,behavior:R,offset:O}=P,j=B-1,V=w2(P,E,j);let W=Nl(V,E.offsetTree,T)+S;$==="end"?(W+=F+Nr(E.sizeTree,V)[1]-w+k,V===j&&(W+=D)):$==="center"?W+=(F+Nr(E.sizeTree,V)[1]-w+k)/2:W-=y,O&&(W+=O);const U=K=>{x(),K?(A("retrying to scroll to",{location:C},nr.DEBUG),We(f,C)):(We(g,!0),A("list did not change, scroll successful",{},nr.DEBUG))};if(x(),R==="smooth"){let K=!1;v=mt(n,ee=>{K=K||ee}),m=fi(s,()=>{U(K)})}else m=fi(ue(n,K8(150)),U);return b=setTimeout(()=>{x()},1200),We(i,!0),A("scrolling from index to",{index:V,top:W,behavior:R},nr.DEBUG),{top:W,behavior:R}})),o),{scrollToIndex:f,scrollTargetReached:g,topListHeight:p}},Dt(mi,$n,Ra),{singleton:!0});function K8(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Ml="up",ml="down",J8="none",q8={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Q8=0,xu=lt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:a}])=>{const o=fe(!1),s=fe(!0),l=tt(),u=tt(),c=fe(4),d=fe(Q8),h=Cn(ue(Eb(ue(Le(t),vs(1),Jr(!0)),ue(Le(t),vs(1),Jr(!1),Cb(100))),_t()),!1),f=Cn(ue(Eb(ue(a,Jr(!0)),ue(a,Jr(!1),Cb(200))),_t()),!1);_e(ue(sn(Le(t),Le(d)),ve(([v,x])=>v<=x),_t()),s),_e(ue(s,ua(50)),u);const g=tr(ue(sn(e,Le(n),Le(r),Le(i),Le(c)),ii((v,[{scrollTop:x,scrollHeight:C},E,w,B,y])=>{const S=x+E-C>-y,D={viewportHeight:E,scrollTop:x,scrollHeight:C};if(S){let T,F;return x>v.state.scrollTop?(T="SCROLLED_DOWN",F=v.state.scrollTop-x):(T="SIZE_DECREASED",F=v.state.scrollTop-x||v.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:T,scrollTopDelta:F}}let A;return D.scrollHeight>v.state.scrollHeight?A="SIZE_INCREASED":E<v.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":x<v.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:D}},q8),_t((v,x)=>v&&v.atBottom===x.atBottom))),p=Cn(ue(e,ii((v,{scrollTop:x,scrollHeight:C,viewportHeight:E})=>{if(m2(v.scrollHeight,C))return{scrollTop:x,scrollHeight:C,jump:0,changed:!1};{const w=C-(x+E)<1;return v.scrollTop!==x&&w?{scrollHeight:C,scrollTop:x,jump:v.scrollTop-x,changed:!0}:{scrollHeight:C,scrollTop:x,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Ne(v=>v.changed),ve(v=>v.jump)),0);_e(ue(g,ve(v=>v.atBottom)),o),_e(ue(o,ua(50)),l);const m=fe(ml);_e(ue(e,ve(({scrollTop:v})=>v),_t(),ii((v,x)=>xn(f)?{direction:v.direction,prevScrollTop:x}:{direction:x<v.prevScrollTop?Ml:ml,prevScrollTop:x},{direction:ml,prevScrollTop:0}),ve(v=>v.direction)),m),_e(ue(e,ua(50),Jr(J8)),m);const b=fe(0);return _e(ue(h,Ne(v=>!v),Jr(0)),b),_e(ue(t,ua(100),Ge(h),Ne(([v,x])=>!!x),ii(([v,x],[C])=>[x,C],[0,0]),ve(([v,x])=>x-v)),b),{isScrolling:h,isAtTop:s,isAtBottom:o,atBottomState:g,atTopStateChange:u,atBottomStateChange:l,scrollDirection:m,atBottomThreshold:c,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:p}},Dt($n)),Ba=lt(([{log:e}])=>{const t=fe(!1),n=tr(ue(t,Ne(r=>r),_t()));return mt(t,r=>{r&&xn(e)("props updated",{},nr.DEBUG)}),{propsReady:t,didMount:n}},Dt(Ra),{singleton:!0});function jp(e,t){e==0?t():requestAnimationFrame(()=>jp(e-1,t))}function Wp(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Cu=lt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i,scrollTargetReached:a},{didMount:o}])=>{const s=fe(!0),l=fe(0),u=fe(!0);return _e(ue(o,Ge(l),Ne(([c,d])=>!!d),Jr(!1)),s),_e(ue(o,Ge(l),Ne(([c,d])=>!!d),Jr(!1)),u),mt(ue(sn(t,o),Ge(s,e,n,u),Ne(([[,c],d,{sizeTree:h},f,g])=>c&&(!yt(h)||Np(f))&&!d&&!g),Ge(l)),([,c])=>{fi(a,()=>{We(u,!0)}),jp(4,()=>{fi(r,()=>{We(s,!0)}),We(i,c)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:l,initialItemFinalLocationReached:u}},Dt(mi,$n,yu,Ba),{singleton:!0});function Ib(e){return e?e==="smooth"?"smooth":"auto":!1}const e7=(e,t)=>typeof e=="function"?Ib(e(t)):t&&Ib(e),t7=lt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:a},{propsReady:o,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),d=tt();let h=null;function f(p){We(i,{index:"LAST",align:"end",behavior:p})}mt(ue(sn(ue(Le(e),vs(1)),s),Ge(Le(c),n,a,u),ve(([[p,m],b,v,x,C])=>{let E=m&&x,w="auto";return E&&(w=e7(b,v||C),E=E&&!!w),{totalCount:p,shouldFollow:E,followOutputBehavior:w}}),Ne(({shouldFollow:p})=>p)),({totalCount:p,followOutputBehavior:m})=>{h&&(h(),h=null),h=fi(t,()=>{xn(l)("following output to ",{totalCount:p},nr.DEBUG),f(m),h=null})});function g(p){const m=fi(r,b=>{p&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(xn(l)("scrolling to bottom due to increased size",{},nr.DEBUG),f("auto"))});setTimeout(m,100)}return mt(ue(sn(Le(c),e,o),Ne(([p,,m])=>p&&m),ii(({value:p},[,m])=>({refreshed:p===m,value:m}),{refreshed:!1,value:0}),Ne(({refreshed:p})=>p),Ge(c,e)),([,p])=>{xn(a)&&g(p!==!1)}),mt(d,()=>{g(xn(c)!==!1)}),mt(sn(Le(c),r),([p,m])=>{p&&!m.atBottom&&m.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")}),{followOutput:c,autoscrollToBottom:d}},Dt(mi,xu,yu,Cu,Ba,Ra,$n));function n7(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const D2=lt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const a=tt(),o=tt(),s=tr(ue(a,ve(n7)));return _e(ue(s,ve(l=>l.totalCount)),e),_e(ue(s,ve(l=>l.groupIndices)),t),_e(ue(sn(r,n,i),Ne(([l,u])=>Ef(u)),ve(([l,u,c])=>Nr(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),_t(),ve(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},Dt(mi,$n));function Ll(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function A2(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const Cd="top",Ed="bottom",_b="none";function Db(e,t,n){return typeof e=="number"?n===Ml&&t===Cd||n===ml&&t===Ed?e:0:n===Ml?t===Cd?e.main:e.reverse:t===Ed?e.main:e.reverse}function Ab(e,t){return typeof e=="number"?e:e[t]||0}const zp=lt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const a=tt(),o=fe(0),s=fe(0),l=fe(0),u=Cn(ue(sn(Le(e),Le(t),Le(r),Le(a,Ll),Le(l),Le(o),Le(i),Le(n),Le(s)),ve(([c,d,h,[f,g],p,m,b,v,x])=>{const C=c-v,E=m+b,w=Math.max(h-C,0);let B=_b;const y=Ab(x,Cd),S=Ab(x,Ed);return f-=v,f+=h+b,g+=h+b,g-=v,f>c+E-y&&(B=Ml),g<c-w+d+S&&(B=ml),B!==_b?[Math.max(C-h-Db(p,Cd,B)-y,0),C-w-b+d+Db(p,Ed,B)+S]:null}),Ne(c=>c!=null),_t(Ll)),[0,0]);return{listBoundary:a,overscan:l,topListHeight:o,increaseViewportBy:s,visibleRange:u}},Dt($n),{singleton:!0});function r7(e,t,n){if(Ef(t)){const r=I2(e,t);return[{index:Nr(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ph={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Tb(e,t,n){if(e.length===0)return[];if(!Ef(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=Cf(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={type:"group",index:l}:c={index:u.index-(l+1)+n,groupIndex:l},a.push({...c,size:u.size,offset:u.offset,originalIndex:u.index,data:u.data})}return a}function Pc(e,t,n,r,i,a){const{lastSize:o,lastOffset:s,lastIndex:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const p=e[e.length-1];c=p.offset+p.size}const d=n-l,h=s+d*o+(d-1)*r,f=u,g=h-c;return{items:Tb(e,i,a),topItems:Tb(t,i,a),topListHeight:t.reduce((p,m)=>m.size+p,0),offsetTop:u,offsetBottom:g,top:f,bottom:c,totalCount:n,firstItemIndex:a}}function T2(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=Wp(t,s),u=Array.from({length:s}).map((c,d)=>({index:d+l,size:0,offset:0,data:a[d+l]}));return Pc(u,[],s,i,n,r)}const Io=lt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},a,{visibleRange:o,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:d},h,{didMount:f},{recalcInProgress:g}])=>{const p=fe([]),m=fe(0),b=tt();_e(a.topItemsIndexes,p);const v=Cn(ue(sn(f,g,Le(o,Ll),Le(t),Le(e),Le(c),u,Le(p),Le(r),Le(i),n),Ne(([w,B,,y,,,,,,,S])=>{const D=S&&S.length!==y;return w&&!B&&!D}),ve(([,,[w,B],y,S,D,A,T,F,k,P])=>{const $=S,{sizeTree:R,offsetTree:O}=$,j=xn(m);if(y===0)return{...ph,totalCount:y};if(w===0&&B===0)return j===0?{...ph,totalCount:y}:T2(j,D,S,F,k,P||[]);if(yt(R))return j>0?null:Pc(r7(Wp(D,y),$,P),[],y,k,$,F);const V=[];if(T.length>0){const z=T[0],H=T[T.length-1];let X=0;for(const te of Cf(R,z,H)){const ie=te.value,le=Math.max(te.start,z),ce=Math.min(te.end,H);for(let Q=le;Q<=ce;Q++)V.push({index:Q,size:ie,offset:X,data:P&&P[Q]}),X+=ie}}if(!A)return Pc([],V,y,k,$,F);const W=T.length>0?T[T.length-1]+1:0,U=z8(O,w,B,W);if(U.length===0)return null;const K=y-1,ee=xf([],z=>{for(const H of U){const X=H.value;let te=X.offset,ie=H.start;const le=X.size;if(X.offset<w){ie+=Math.floor((w-X.offset+k)/(le+k));const Q=ie-H.start;te+=Q*le+Q*k}ie<W&&(te+=(W-ie)*le,ie=W);const ce=Math.min(H.end,K);for(let Q=ie;Q<=ce&&!(te>=B);Q++)z.push({index:Q,size:le,offset:te,data:P&&P[Q]}),te+=le+k}});return Pc(ee,V,y,k,$,F)}),Ne(w=>w!==null),_t()),ph);_e(ue(n,Ne(Np),ve(w=>w==null?void 0:w.length)),t),_e(ue(v,ve(w=>w.topListHeight)),d),_e(d,l),_e(ue(v,ve(w=>[w.top,w.bottom])),s),_e(ue(v,ve(w=>w.items)),b);const x=tr(ue(v,Ne(({items:w})=>w.length>0),Ge(t,n),Ne(([{items:w},B])=>w[w.length-1].originalIndex===B-1),ve(([,w,B])=>[w-1,B]),_t(Ll),ve(([w])=>w))),C=tr(ue(v,ua(200),Ne(({items:w,topItems:B})=>w.length>0&&w[0].originalIndex===B.length),ve(({items:w})=>w[0].index),_t())),E=tr(ue(v,Ne(({items:w})=>w.length>0),ve(({items:w})=>{let B=0,y=w.length-1;for(;w[B].type==="group"&&B<y;)B++;for(;w[y].type==="group"&&y>B;)y--;return{startIndex:w[B].index,endIndex:w[y].index}}),_t(A2)));return{listState:v,topItemsIndexes:p,endReached:x,startReached:C,rangeChanged:E,itemsRendered:b,initialItemCount:m,...h}},Dt(mi,D2,zp,Cu,yu,xu,Ba,Vp),{singleton:!0}),i7=lt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(_e(ue(s,Ge(a),Ne(([,l])=>l!==0),Ge(i,e,t,r,n),ve(([[,l],u,c,d,h,f=[]])=>T2(l,u,c,d,h,f))),o),{}),Dt(mi,Cu,Io,Ba),{singleton:!0}),R2=lt(([{scrollVelocity:e}])=>{const t=fe(!1),n=tt(),r=fe(!1);return _e(ue(e,Ge(r,t,n),Ne(([i,a])=>!!a),ve(([i,a,o,s])=>{const{exit:l,enter:u}=a;if(o){if(l(i,s))return!1}else if(u(i,s))return!0;return o}),_t()),t),mt(ue(sn(t,e,n),Ge(r)),([[i,a,o],s])=>i&&s&&s.change&&s.change(a,o)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Dt(xu),{singleton:!0}),a7=lt(([{topItemsIndexes:e}])=>{const t=fe(0);return _e(ue(t,Ne(n=>n>0),ve(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},Dt(Io)),B2=lt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const a=tt(),o=Cn(ue(sn(e,r,t,n,i),ve(([s,l,u,c,d])=>s+l+u+c+d.offsetBottom+d.bottom)),0);return _e(Le(o),a),{totalListHeight:o,totalListHeightChanged:a}},Dt($n,Io),{singleton:!0});function $2(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const o7=$2(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),s7=lt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:a,scrollDirection:o,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:d,gap:h},{log:f},{recalcInProgress:g}])=>{const p=tr(ue(l,Ge(s),ii(([,b,v,x],[{items:C,totalCount:E,bottom:w,offsetBottom:B},y])=>{const S=w+B;let D=0;return v===E&&b.length>0&&C.length>0&&(C[0].originalIndex===0&&b[0].originalIndex===0||(D=S-x,D!==0&&(D+=y))),[D,C,E,S]},[0,[],0,0]),Ne(([b])=>b!==0),Ge(t,o,r,a,f,g),Ne(([,b,v,x,,,C])=>!C&&!x&&b!==0&&v===Ml),ve(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},nr.DEBUG),b))));function m(b){b>0?(We(e,{top:-b,behavior:"auto"}),We(n,0)):(We(n,0),We(e,{top:-b,behavior:"auto"}))}return mt(ue(p,Ge(n,i)),([b,v,x])=>{x&&o7()?We(n,v-b):m(-b)}),mt(ue(sn(Cn(i,!1),n,g),Ne(([b,v,x])=>!b&&!x&&v!==0),ve(([b,v])=>v),ua(1)),m),_e(ue(c,ve(b=>({top:-b}))),e),mt(ue(u,Ge(d,h),ve(([b,{lastSize:v,groupIndices:x,sizeTree:C},E])=>{function w(B){return B*(v+E)}if(x.length===0)return w(b);{let B=0;const y=Fl(C,0);let S=0,D=0;for(;S<b;){S++,B+=y;let A=x.length===D+1?1/0:x[D+1]-x[D]-1;S+A>b&&(B-=y,A=b-S+1),S+=A,B+=w(A),D++}return B}})),b=>{We(n,b),requestAnimationFrame(()=>{We(e,{top:b}),requestAnimationFrame(()=>{We(n,0),We(g,!1)})})}),{deviation:n}},Dt($n,xu,Io,mi,Ra,Vp)),l7=lt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return mt(ue(e,Ge(r),Ne(([,i])=>i!==0),ve(([,i])=>({top:i}))),i=>{fi(ue(n,vs(1),Ne(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{We(t,i)})})}),{initialScrollTop:r}},Dt(Ba,$n,Io),{singleton:!0}),u7=lt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=Cn(ue(sn(n,e,t),Ne(([i])=>i),ve(([,i,a])=>Math.max(0,i-a)),ua(0),_t()),0);return{alignToBottom:n,paddingTopAddition:r}},Dt($n,B2),{singleton:!0}),Gp=lt(([{scrollTo:e,scrollContainerState:t}])=>{const n=tt(),r=tt(),i=tt(),a=fe(!1),o=fe(void 0);return _e(ue(sn(n,r),ve(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),_e(ue(e,Ge(r),ve(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{useWindowScroll:a,customScrollParent:o,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},Dt($n)),c7=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:a,...o}})=>e<n?{...o,behavior:i,align:a??"start"}:t>r?{...o,behavior:i,align:a??"end"}:null,d7=lt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:a,fixedHeaderHeight:o,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=tt();return _e(ue(c,Ge(e,i,t,a,o,s,r),Ge(n),ve(([[d,h,f,g,p,m,b,v],x])=>{const{done:C,behavior:E,align:w,calculateViewLocation:B=c7,...y}=d,S=w2(d,h,g-1),D=Nl(S,h.offsetTree,x)+p+m,A=D+Nr(h.sizeTree,S)[1],T=v+m,F=v+f-b,k=B({itemTop:D,itemBottom:A,viewportTop:T,viewportBottom:F,locationParams:{behavior:E,align:w,...y}});return k?C&&fi(ue(l,Ne(P=>P===!1),vs(xn(l)?1:2)),C):C&&C(),k}),Ne(d=>d!==null)),u),{scrollIntoView:c}},Dt(mi,$n,yu,Io,Ra),{singleton:!0}),f7=lt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:s}])=>{const l=tt(),u=fe(void 0),c=fe(null),d=fe(null);return _e(o,c),_e(s,d),mt(ue(l,Ge(e,n,a,c,d)),([h,f,g,p,m,b])=>{const v=X8(f.sizeTree);p&&m!==null&&b!==null&&(g=m.scrollTop-b.offsetTop),h({ranges:v,scrollTop:g})}),_e(ue(u,Ne(Np),ve(h7)),r),_e(ue(i,Ge(u),Ne(([,h])=>h!==void 0),_t(),ve(([,h])=>h.ranges)),t),{getState:l,restoreStateFrom:u}},Dt(mi,$n,Cu,Ba,Gp));function h7(e){return{offset:e.scrollTop,index:0,align:"start"}}const g7=lt(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),Dt(zp,i7,Ba,R2,B2,l7,u7,Gp,d7,Ra)),k2=lt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:a,data:o,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:d},{initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g},p,m,b,{listState:v,topItemsIndexes:x,...C},{scrollToIndex:E},w,{topItemCount:B},{groupCounts:y},S])=>(_e(C.rangeChanged,S.scrollSeekRangeChanged),_e(ue(S.windowViewportRect,ve(D=>D.visibleHeight)),p.viewportHeight),{totalCount:e,data:o,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g,topItemsIndexes:x,topItemCount:B,groupCounts:y,fixedItemHeight:n,defaultItemHeight:r,gap:c,...b,statefulTotalCount:u,listState:v,scrollToIndex:E,trackItemSizes:i,itemSize:a,groupIndices:l,...C,...S,...p,sizes:d,...m}),Dt(mi,Cu,$n,f7,t7,Io,yu,s7,a7,D2,g7)),mh="-webkit-sticky",Rb="sticky",P2=$2(()=>{if(typeof document>"u")return Rb;const e=document.createElement("div");return e.style.position=mh,e.style.position===mh?mh:Rb});function Up(e,t){const n=I.useRef(null),r=I.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,d;if(t){const h=t.getBoundingClientRect(),f=l.top-h.top;c=h.height-Math.max(0,f),d=f+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:a}=Op(r),o=I.useCallback(()=>{r(a.current)},[r,a]);return I.useEffect(()=>{if(t){t.addEventListener("scroll",o);const s=new ResizeObserver(()=>{requestAnimationFrame(o)});return s.observe(t),()=>{t.removeEventListener("scroll",o),s.unobserve(t)}}else return window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t]),i}const Sf=I.createContext(void 0),F2=I.createContext(void 0);function Xp(e){return e}const p7=lt(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),i=fe(Xp),a=fe("div"),o=fe(wo),s=(l,u=null)=>Cn(ue(r,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),m7=lt(([e,t])=>({...e,...t}),Dt(k2,p7)),b7=({height:e})=>I.createElement("div",{style:{height:e}}),v7={position:P2(),zIndex:1,overflowAnchor:"none"},y7={overflowAnchor:"none"},Bb=I.memo(function({showTopList:t=!1}){const n=Ke("listState"),r=xr("sizeRanges"),i=Ke("useWindowScroll"),a=Ke("customScrollParent"),o=xr("windowScrollContainerState"),s=xr("scrollContainerState"),l=a||i?o:s,u=Ke("itemContent"),c=Ke("context"),d=Ke("groupContent"),h=Ke("trackItemSizes"),f=Ke("itemSize"),g=Ke("log"),p=xr("gap"),{callbackRef:m}=p2(r,f,h,t?wo:l,g,p,a),[b,v]=I.useState(0);Kp("deviation",k=>{b!==k&&v(k)});const x=Ke("EmptyPlaceholder"),C=Ke("ScrollSeekPlaceholder")||b7,E=Ke("ListComponent"),w=Ke("ItemComponent"),B=Ke("GroupComponent"),y=Ke("computeItemKey"),S=Ke("isSeeking"),D=Ke("groupIndices").length>0,A=Ke("alignToBottom"),T=Ke("initialItemFinalLocationReached"),F=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:A?"auto":0,...T?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&x?I.createElement(x,Ft(x,c)):I.createElement(E,{...Ft(E,c),ref:m,style:F,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const P=k.originalIndex,$=y(P+n.firstItemIndex,k.data,c);return S?I.createElement(C,{...Ft(C,c),key:$,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?I.createElement(B,{...Ft(B,c),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,style:v7},d(k.index,c)):I.createElement(w,{...Ft(w,c),...N2(w,k.data),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,style:y7},D?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),x7={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ks=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),C7={width:"100%",position:P2(),top:0,zIndex:1};function Ft(e,t){if(typeof e!="string")return{context:t}}function N2(e,t){return{item:typeof e=="string"?void 0:t}}const E7=I.memo(function(){const t=Ke("HeaderComponent"),n=xr("headerHeight"),r=Ke("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),S7=I.memo(function(){const t=Ke("FooterComponent"),n=xr("footerHeight"),r=Ke("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null});function Zp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("scrollerRef"),h=n("context"),{scrollerRef:f,scrollByCallback:g,scrollToCallback:p}=b2(l,c,u,d);return t("scrollTo",p),t("scrollBy",g),I.createElement(u,{ref:f,style:{...x7,...a},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...Ft(u,h)},o)})}function Yp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("totalListHeight"),h=n("deviation"),f=n("customScrollParent"),g=n("context"),{scrollerRef:p,scrollByCallback:m,scrollToCallback:b}=b2(l,c,u,wo,f);return $8(()=>(p.current=f||window,()=>{p.current=null}),[p,f]),t("windowScrollTo",b),t("scrollBy",m),I.createElement(u,{style:{position:"relative",...a,...d!==0?{height:d+h}:{}},"data-virtuoso-scroller":!0,...s,...Ft(u,g)},o)})}const w7=({children:e})=>{const t=I.useContext(Sf),n=xr("viewportHeight"),r=xr("fixedItemHeight"),i=Ke("alignToBottom"),a=hi(kl(n,o=>Fr(o,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:ks(i),ref:a,"data-viewport-type":"element"},e)},I7=({children:e})=>{const t=I.useContext(Sf),n=xr("windowViewportRect"),r=xr("fixedItemHeight"),i=Ke("customScrollParent"),a=Up(n,i),o=Ke("alignToBottom");return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:ks(o),"data-viewport-type":"window"},e)},_7=({children:e})=>{const t=Ke("TopItemListComponent")||"div",n=Ke("headerHeight"),r={...C7,marginTop:`${n}px`},i=Ke("context");return I.createElement(t,{style:r,...Ft(t,i)},e)},D7=I.memo(function(t){const n=Ke("useWindowScroll"),r=Ke("topItemsIndexes").length>0,i=Ke("customScrollParent"),a=i||n?R7:T7,o=i||n?I7:w7;return I.createElement(a,{...t},r&&I.createElement(_7,null,I.createElement(Bb,{showTopList:!0})),I.createElement(o,null,I.createElement(E7,null),I.createElement(Bb,null),I.createElement(S7,null)))}),{Component:A7,usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}=Lp(m7,{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"},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"}},D7),T7=Zp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),R7=Yp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),B7=A7,$b={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},$7={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:kb,ceil:Pb,floor:Sd,min:bh,max:bl}=Math;function k7(e){return{...$7,items:e}}function Fb(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const a=n===null?null:n[i+e];return{index:i+e,data:a}})}function P7(e,t){return e&&e.column===t.column&&e.row===t.row}function Uu(e,t){return e&&e.width===t.width&&e.height===t.height}const F7=lt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:a,scrollTo:o,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},d,h,{propsReady:f,didMount:g},{windowViewportRect:p,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:x},C])=>{const E=fe(0),w=fe(0),B=fe($b),y=fe({height:0,width:0}),S=fe({height:0,width:0}),D=tt(),A=tt(),T=fe(0),F=fe(null),k=fe({row:0,column:0}),P=tt(),$=tt(),R=fe(!1),O=fe(0),j=fe(!0),V=fe(!1);mt(ue(g,Ge(O),Ne(([H,X])=>!!X)),()=>{We(j,!1),We(w,0)}),mt(ue(sn(g,j,S,y,O,V),Ne(([H,X,te,ie,,le])=>H&&!X&&te.height!==0&&ie.height!==0&&!le)),([,,,,H])=>{We(V,!0),jp(1,()=>{We(D,H)}),fi(ue(r),()=>{We(n,[0,0]),We(j,!0)})}),_e(ue($,Ne(H=>H!=null&&H.scrollTop>0),Jr(0)),w),mt(ue(g,Ge($),Ne(([,H])=>H!=null)),([,H])=>{H&&(We(y,H.viewport),We(S,H==null?void 0:H.item),We(k,H.gap),H.scrollTop>0&&(We(R,!0),fi(ue(r,vs(1)),X=>{We(R,!1)}),We(o,{top:H.scrollTop})))}),_e(ue(y,ve(({height:H})=>H)),i),_e(ue(sn(Le(y,Uu),Le(S,Uu),Le(k,(H,X)=>H&&H.column===X.column&&H.row===X.row),Le(r)),ve(([H,X,te,ie])=>({viewport:H,item:X,gap:te,scrollTop:ie}))),P),_e(ue(sn(Le(E),t,Le(k,P7),Le(S,Uu),Le(y,Uu),Le(F),Le(w),Le(R),Le(j),Le(O)),Ne(([,,,,,,,H])=>!H),ve(([H,[X,te],ie,le,ce,Q,be,,Ce,Se])=>{const{row:un,column:ye}=ie,{height:Ee,width:He}=le,{width:bt}=ce;if(be===0&&(H===0||bt===0))return $b;if(He===0){const Gf=Wp(Se,H),vI=Gf===0?Math.max(be-1,0):Gf;return k7(Fb(Gf,vI,Q))}const Kt=M2(bt,He,ye);let at,Qe;Ce?X===0&&te===0&&be>0?(at=0,Qe=be-1):(at=Kt*Sd((X+un)/(Ee+un)),Qe=Kt*Pb((te+un)/(Ee+un))-1,Qe=bh(H-1,bl(Qe,Kt-1)),at=bh(Qe,bl(0,at))):(at=0,Qe=-1);const or=Fb(at,Qe,Q),{top:wr,bottom:Ir}=Nb(ce,ie,le,or),Ro=Pb(H/Kt),bI=Ro*Ee+(Ro-1)*un-Ir;return{items:or,offsetTop:wr,offsetBottom:bI,top:wr,bottom:Ir,itemHeight:Ee,itemWidth:He}})),B),_e(ue(F,Ne(H=>H!==null),ve(H=>H.length)),E),_e(ue(sn(y,S,B,k),Ne(([H,X,{items:te}])=>te.length>0&&X.height!==0&&H.height!==0),ve(([H,X,{items:te},ie])=>{const{top:le,bottom:ce}=Nb(H,ie,X,te);return[le,ce]}),_t(Ll)),n);const W=fe(!1);_e(ue(r,Ge(W),ve(([H,X])=>X||H!==0)),W);const U=tr(ue(Le(B),Ne(({items:H})=>H.length>0),Ge(E,W),Ne(([{items:H},X,te])=>te&&H[H.length-1].index===X-1),ve(([,H])=>H-1),_t())),K=tr(ue(Le(B),Ne(({items:H})=>H.length>0&&H[0].index===0),Jr(0),_t())),ee=tr(ue(Le(B),Ge(R),Ne(([{items:H},X])=>H.length>0&&!X),ve(([{items:H}])=>({startIndex:H[0].index,endIndex:H[H.length-1].index})),_t(A2),ua(0)));_e(ee,h.scrollSeekRangeChanged),_e(ue(D,Ge(y,S,E,k),ve(([H,X,te,ie,le])=>{const ce=_2(H),{align:Q,behavior:be,offset:Ce}=ce;let Se=ce.index;Se==="LAST"&&(Se=ie-1),Se=bl(0,Se,bh(ie-1,Se));let un=ag(X,le,te,Se);return Q==="end"?un=kb(un-X.height+te.height):Q==="center"&&(un=kb(un-X.height/2+te.height/2)),Ce&&(un+=Ce),{top:un,behavior:be}})),o);const z=Cn(ue(B,ve(H=>H.offsetBottom+H.bottom)),0);return _e(ue(p,ve(H=>({width:H.visibleWidth,height:H.visibleHeight}))),y),{data:F,totalCount:E,viewportDimensions:y,itemDimensions:S,scrollTop:r,scrollHeight:A,overscan:e,scrollBy:a,scrollTo:o,scrollToIndex:D,smoothScrollTargetReached:s,windowViewportRect:p,windowScrollTo:x,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,deviation:T,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:w,gap:k,restoreStateFrom:$,...h,initialTopMostItemIndex:O,gridState:B,totalListHeight:z,...d,startReached:K,endReached:U,rangeChanged:ee,stateChanged:P,propsReady:f,stateRestoreInProgress:R,...C}},Dt(zp,$n,xu,R2,Ba,Gp,Ra));function Nb(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const a=ag(e,t,n,r[0].index),o=ag(e,t,n,r[r.length-1].index)+i;return{top:a,bottom:o}}function ag(e,t,n,r){const i=M2(e.width,n.width,t.column),a=Sd(r/i),o=a*n.height+bl(0,a-1)*t.row;return o>0?o+t.row:o}function M2(e,t,n){return bl(1,Sd((e+n)/(Sd(t)+n)))}const N7=lt(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),i=fe("virtuoso-grid-list"),a=fe(Xp),o=fe("div"),s=fe(wo),l=(u,c=null)=>Cn(ue(t,ve(d=>d[u]),_t()),c);return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,headerFooterTag:o,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),M7=lt(([e,t])=>({...e,...t}),Dt(F7,N7)),L7=I.memo(function(){const t=$t("gridState"),n=$t("listClassName"),r=$t("itemClassName"),i=$t("itemContent"),a=$t("computeItemKey"),o=$t("isSeeking"),s=kr("scrollHeight"),l=$t("ItemComponent"),u=$t("ListComponent"),c=$t("ScrollSeekPlaceholder"),d=$t("context"),h=kr("itemDimensions"),f=kr("gap"),g=$t("log"),p=$t("stateRestoreInProgress"),m=hi(b=>{const v=b.parentElement.parentElement.scrollHeight;s(v);const x=b.firstChild;if(x){const{width:C,height:E}=x.getBoundingClientRect();h({width:C,height:E})}f({row:Mb("row-gap",getComputedStyle(b).rowGap,g),column:Mb("column-gap",getComputedStyle(b).columnGap,g)})});return p?null:I.createElement(u,{ref:m,className:n,...Ft(u,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=a(b.index,b.data,d);return o?I.createElement(c,{key:v,...Ft(c,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):I.createElement(l,{...Ft(l,d),className:r,"data-index":b.index,key:v},i(b.index,b.data,d))}))}),O7=I.memo(function(){const t=$t("HeaderComponent"),n=kr("headerHeight"),r=$t("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=$t("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),V7=I.memo(function(){const t=$t("FooterComponent"),n=kr("footerHeight"),r=$t("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=$t("context");return t?I.createElement(r,{ref:i},I.createElement(t,Ft(t,a))):null}),H7=({children:e})=>{const t=I.useContext(F2),n=kr("itemDimensions"),r=kr("viewportDimensions"),i=hi(a=>{r(a.getBoundingClientRect())});return I.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),I.createElement("div",{style:ks(!1),ref:i},e)},j7=({children:e})=>{const t=I.useContext(F2),n=kr("windowViewportRect"),r=kr("itemDimensions"),i=$t("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),I.createElement("div",{ref:a,style:ks(!1)},e)},W7=I.memo(function({...t}){const n=$t("useWindowScroll"),r=$t("customScrollParent"),i=r||n?G7:z7,a=r||n?j7:H7;return I.createElement(i,{...t},I.createElement(a,null,I.createElement(O7,null),I.createElement(L7,null),I.createElement(V7,null)))}),{usePublisher:kr,useEmitterValue:$t,useEmitter:L2}=Lp(M7,{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"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},W7),z7=Zp({usePublisher:kr,useEmitterValue:$t,useEmitter:L2}),G7=Yp({usePublisher:kr,useEmitterValue:$t,useEmitter:L2});function Mb(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}const U7=lt(()=>{const e=fe(l=>I.createElement("td",null,"Item $",l)),t=fe(null),n=fe(null),r=fe(null),i=fe({}),a=fe(Xp),o=fe(wo),s=(l,u=null)=>Cn(ue(i,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableFooterComponent:s("TableFoot","tfoot"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),X7=lt(([e,t])=>({...e,...t}),Dt(k2,U7)),Z7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e}})),Y7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e,padding:0,border:0}})),K7={overflowAnchor:"none"},J7=I.memo(function(){const t=ht("listState"),n=Pr("sizeRanges"),r=ht("useWindowScroll"),i=ht("customScrollParent"),a=Pr("windowScrollContainerState"),o=Pr("scrollContainerState"),s=i||r?a:o,l=ht("itemContent"),u=ht("trackItemSizes"),c=ht("itemSize"),d=ht("log"),{callbackRef:h,ref:f}=p2(n,c,u,s,d,void 0,i),[g,p]=I.useState(0);Jp("deviation",$=>{g!==$&&(f.current.style.marginTop=`${$}px`,p($))});const m=ht("EmptyPlaceholder"),b=ht("ScrollSeekPlaceholder")||Z7,v=ht("FillerRow")||Y7,x=ht("TableBodyComponent"),C=ht("TableRowComponent"),E=ht("computeItemKey"),w=ht("isSeeking"),B=ht("paddingTopAddition"),y=ht("firstItemIndex"),S=ht("statefulTotalCount"),D=ht("context");if(S===0&&m)return I.createElement(m,Ft(m,D));const A=t.offsetTop+B+g,T=t.offsetBottom,F=A>0?I.createElement(v,{height:A,key:"padding-top",context:D}):null,k=T>0?I.createElement(v,{height:T,key:"padding-bottom",context:D}):null,P=t.items.map($=>{const R=$.originalIndex,O=E(R+y,$.data,D);return w?I.createElement(b,{...Ft(b,D),key:O,index:$.index,height:$.size,type:$.type||"item"}):I.createElement(C,{...Ft(C,D),...N2(C,$.data),key:O,"data-index":R,"data-known-size":$.size,"data-item-index":$.index,style:K7},l($.index,$.data,D))});return I.createElement(x,{ref:h,"data-testid":"virtuoso-item-list",...Ft(x,D)},[F,...P,k])}),q7=({children:e})=>{const t=I.useContext(Sf),n=Pr("viewportHeight"),r=Pr("fixedItemHeight"),i=hi(kl(n,a=>Fr(a,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:ks(!1),ref:i,"data-viewport-type":"element"},e)},Q7=({children:e})=>{const t=I.useContext(Sf),n=Pr("windowViewportRect"),r=Pr("fixedItemHeight"),i=ht("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:ks(!1),"data-viewport-type":"window"},e)},eP=I.memo(function(t){const n=ht("useWindowScroll"),r=ht("customScrollParent"),i=Pr("fixedHeaderHeight"),a=Pr("fixedFooterHeight"),o=ht("fixedHeaderContent"),s=ht("fixedFooterContent"),l=ht("context"),u=hi(kl(i,v=>Fr(v,"height"))),c=hi(kl(a,v=>Fr(v,"height"))),d=r||n?rP:nP,h=r||n?Q7:q7,f=ht("TableComponent"),g=ht("TableHeadComponent"),p=ht("TableFooterComponent"),m=o?I.createElement(g,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:u,...Ft(g,l)},o()):null,b=s?I.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:c,...Ft(p,l)},s()):null;return I.createElement(d,{...t},I.createElement(h,null,I.createElement(f,{style:{borderSpacing:0,overflowAnchor:"none"},...Ft(f,l)},[m,I.createElement(J7,{key:"TableBody"}),b])))}),{Component:tP,usePublisher:Pr,useEmitterValue:ht,useEmitter:Jp}=Lp(X7,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",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"}},eP),nP=Zp({usePublisher:Pr,useEmitterValue:ht,useEmitter:Jp}),rP=Yp({usePublisher:Pr,useEmitterValue:ht,useEmitter:Jp}),iP=tP,aP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),oP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),qp=I.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:d,typeCalculateItemSize:h="manual",itemSizeNames:f=[],overscan:g=null,component:p={},idContainer:m="",triggerCalCulateContainer:b="",accumulationHeight:v=0,delayTriggerCalculateHeight:x=0,increaseViewportBy:C=()=>0,context:E={},endReached:w,increaseTotalCount:B=1}=e,[y,S]=I.useState(0),D=()=>{if(o==="min-max"){const F=(a+B)*s;return{height:a>u?l:y>F?y:F}}return o==="container"?{height:y}:{}},A=F=>{var $;const k=F.getAttribute("data-index");let P=(($=F.getBoundingClientRect())==null?void 0:$.height)||0;return f==null||f.forEach(R=>{var O,j;P+=((j=(O=document.querySelector(`[${R}="${k}"]`))==null?void 0:O.getBoundingClientRect())==null?void 0:j.height)??0}),P},T=()=>{var F;if(m&&o==="container"){const k=((F=document==null?void 0:document.getElementById(m))==null?void 0:F.offsetHeight)??0;S(k-v)}};return I.useEffect(()=>{const F=setTimeout(T,x);return window==null||window.addEventListener("resize",T),window==null||window.addEventListener("load",T),()=>{clearTimeout(F),window==null||window.removeEventListener("resize",T),window==null||window.removeEventListener("load",T)}},[o,b]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(iP,{context:E,ref:t,overscan:typeof g=="function"?g(o==="container"?y:l):o==="container"?y:l,totalListHeightChanged:F=>o==="min-max"?S(F):null,style:D(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(F=>h==="manual"?i(F):A(F),[]),components:{TableRow:oP,...p},fixedHeaderContent:c,itemContent:(...F)=>d(aP,...F),endReached:w,increaseViewportBy:C(o==="container"?y:l)})})});qp.displayName="TableVirtualization";const sP="_sorting_1a30n_536",tn={"payhere-reguler":"_payhere-reguler_1a30n_109","laba-reguler":"_laba-reguler_1a30n_259","laba-rounded-md-extra-small":"_laba-rounded-md-extra-small_1a30n_259","laba-small_body-small":"_laba-small_body-small_1a30n_295","laba-small":"_laba-small_1a30n_295","bill-reguler":"_bill-reguler_1a30n_421","pointer-laba":"_pointer-laba_1a30n_489","pointer-payhere":"_pointer-payhere_1a30n_494","pointer-bill":"_pointer-bill_1a30n_499","resize-menu":"_resize-menu_1a30n_504",sorting:sP,"laba-grey-02":"_laba-grey-02_1a30n_557","laba-blue-01_border-transparent":"_laba-blue-01_border-transparent_1a30n_566"};function lP(e,t=null){const[n,r]=I.useState(!1);return I.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 vh=e=>{const t=e.getTime()-Date.now();return Math.max(Math.floor(t/1e3),0)},uP=e=>{const t=I.useMemo(()=>{const f=new Date(e.date);return e.adjustTimesTime&&f.setHours(f.getHours()-e.adjustTimesTime),f},[e.date,e.adjustTimesTime]),[n,r]=I.useState(t),[i,a]=I.useState(()=>vh(n)),[o,s]=I.useState(e.running??!1),[l,u]=I.useState(()=>e==null?void 0:e.callbackDone);return I.useEffect(()=>{let f;return o&&i>0&&(f=setInterval(()=>{const g=vh(n);a(g),g<=0&&(s(!1),f&&clearInterval(f),typeof l=="function"&&l())},e.intervalMs)),()=>{f&&clearInterval(f)}},[o,n,e.intervalMs,l,i]),{count:i,isRunning:o,startCountdown:()=>{!o&&i>0&&s(!0)},stopCountdown:()=>{s(!1)},resetCountdown:f=>{let g;f instanceof Date?g=f:typeof f=="number"?g=new Date(Date.now()+f*1e3):g=t,r(g);const p=vh(g);p<=0?s(!1):s(!0),a(p)},setCallbackDone:f=>u(()=>f)}};function O2(e,t=0){const n=I.useRef({promise:null,resolve:null,reject:null,timeout:null});return I.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 wf=typeof window<"u"?I.useLayoutEffect:I.useEffect,cP=(e,t)=>{const[n,r]=I.useState({width:0,height:0}),[i,a]=I.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=I.useRef(null);return wf(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=d=>{for(const h of d){const{width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C}=h.contentRect;a({width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C})}};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 dP(e){const[t,n]=I.useState(e),r=I.useRef(t);return I.useEffect(()=>{r.current=t},[t]),[t,n,r]}function fP(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 hP(...e){return t=>{e.forEach(n=>{fP(n,t)})}}function If(...e){return I.useMemo(()=>hP(...e),e)}function Ol(e){const t=I.useRef(e);return vp(e,t.current)||(t.current=e),t.current}function ba(e,t){const n=t.map(Ol);I.useEffect(e,n)}function gP({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){I.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const pP=({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=I.useCallback(()=>{const d=e.current;if(!d)return;const h=Array.from(d.children);if(h.length===0){d.style.height="0px";return}const f=Array(n).fill(0),g=d.offsetWidth;if(g===0)return;const p=(g-(n-1)*r)/n,m=a.includes("rtl"),b=a.includes("top-down");h.forEach((x,C)=>{x.style.width=`${p}px`,x.style.position="absolute",l&&(x.style.transition=`top ${s}ms ease, left ${s}ms ease`);let E;if(b)E=C%n;else{const y=Math.min(...f);E=f.indexOf(y)}const w=f[E];let B;m?B=g-(p*(E+1)+r*E):B=E*(p+r),x.style.top=`${w}px`,x.style.left=`${B}px`,f[E]+=x.offsetHeight+i});const v=Math.max(...f);d.style.height=`${v-i}px`},[e,n,r,a,i]),c=O2(async()=>{u()},o);return I.useLayoutEffect(()=>{u()},[t,u]),I.useEffect(()=>(window.addEventListener("load",u),window.addEventListener("resize",c),()=>{window.removeEventListener("load",u),window.removeEventListener("resize",c)}),[t,c,u]),{recalculateLayout:u}},mP=({id:e,numInputs:t,onComplete:n,disableFocusOnEdit:r=!1,blurOnComplete:i=!1,disableOnComplete:a=!1})=>{const[o,s]=I.useState(()=>Array(t).fill("")),l=I.useRef([]),[u]=I.useState(()=>`otp-${Math.random().toString(36).slice(2,9)}`),c=e||u;I.useEffect(()=>{l.current=l.current.slice(0,t)},[t]);const d=I.useCallback((v,x)=>{var D,A;const C=v.target.value,E=C.length>1?C.slice(-1):C,w=o[x]!=="",B=[...o];B[x]=E,s(B);const y=B.join(""),S=!B.slice(0,t).includes("");E!==""&&x<t-1&&(r&&w&&S||(D=l.current[x+1])==null||D.focus()),S&&(typeof n=="function"&&n(y),i&&((A=l.current[x])==null||A.blur()))},[o,t,n,r,i]),h=I.useCallback((v,x)=>{var C,E,w,B,y;switch(v.key){case"Backspace":if(o[x]===""&&x>0){v.preventDefault();const S=[...o];S[x-1]="",s(S),(C=l.current[x-1])==null||C.focus()}break;case"ArrowLeft":x>0&&(v.preventDefault(),(E=l.current[x-1])==null||E.focus());break;case"ArrowRight":x<t-1&&(v.preventDefault(),(w=l.current[x+1])==null||w.focus());break;case"Home":v.preventDefault(),(B=l.current[0])==null||B.focus();break;case"End":v.preventDefault(),(y=l.current[t-1])==null||y.focus();break}},[o,t]),f=I.useCallback((v,x)=>{var D,A;v.preventDefault();const C=v.clipboardData.getData("text").trim();if(!C)return;const E=[...o];let w=x;for(const T of C){if(w>=t)break;E[w]=T,w++}s(E);const B=E.join(""),y=!E.includes(""),S=Math.min(w,t-1);(D=l.current[S])==null||D.focus(),y&&(typeof n=="function"&&n(B),i&&((A=l.current[S])==null||A.blur()))},[o,t,n,i]),g=v=>{v.target.select()},p=()=>{var v;s(Array(t).fill("")),(v=l.current[0])==null||v.focus()},m=v=>{if(v<0||v>=t)throw new Error(`useOtpInput: index ${v} is out of bounds for numInputs ${t}.`);const x=o.join("").length===t;return{id:`${c}-${v}`,"aria-label":`OTP digit ${v+1} of ${t}`,ref:C=>{l.current[v]=C},value:o[v],onChange:C=>d(C,v),onKeyDown:C=>h(C,v),onPaste:C=>f(C,v),onFocus:g,disabled:a&&x,type:"text",inputMode:"numeric",autoComplete:"one-time-code"}};return{getInputProps:m,getInputData:v=>({...qC(m(v),["onChange","onKeyDown","onPaste","onFocus","aria-label","autoComplete"]),isOtpFilled:o[v]!==""}),otpValues:o,otpString:o.join(""),clearOtp:p,isOtpComplete:o.join("").length===t}},Fo={"sub-mobile-payhere-reguler":"_sub-mobile-payhere-reguler_elvgc_115"},lr="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",cn=()=>({kind:{"payhere-reguler":tn["payhere-reguler"],"laba-reguler":tn["laba-reguler"],"laba-small":tn["laba-small"],"laba-rounded-md-extra-small":tn["laba-rounded-md-extra-small"],"laba-small_body-small":tn["laba-small_body-small"],"bill-reguler":tn["bill-reguler"]},subMobile:{"payhere-reguler":Fo["sub-mobile-payhere-reguler"],"laba-reguler":Fo["sub-mobile-laba-reguler"],"laba-small":Fo["sub-mobile-laba-small"],"laba-rounded-md-extra-small":Fo["sub-mobile-laba-rounded-md-extra-small"],"laba-small_body-small":Fo["sub-mobile-laba-small_body-small"],"bill-reguler":Fo["sub-mobile-bill-reguler"]},pointer:{"payhere-reguler":tn["pointer-payhere"],"laba-reguler":tn["pointer-laba"],"laba-small":tn["pointer-laba"],"laba-rounded-md-extra-small":tn["pointer-laba"],"laba-small_body-small":tn["pointer-laba"],"bill-reguler":tn["pointer-bill"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"bill-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-rounded-md-extra-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small_body-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":tn["laba-grey-02"],"laba-blue-01_border-transparent":tn["laba-blue-01_border-transparent"]}});Object.keys(cn().kind);Object.keys(cn().variant);const bP=(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},wd=(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":""}:{}},V2=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}},vP=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,theadTrId:s,maxHeight:l,idCalculateHeight:u,componentSortASC:c,componentSortDESC:d,classNamePointer:h,emptyPlaceholder:f,renderSubComponent:g,visibilityColumns:p,classNameSubMobile:m})=>_.jsx("div",{id:"1ru-table",style:l?{height:l,overflow:"auto"}:{},className:t??"",children:_.jsxs("table",{className:n,style:{width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},children:[_.jsx("thead",{id:a,"data-calculate-height-header":u,children:e.getHeaderGroups().map(b=>_.jsx("tr",{children:b.headers.map(v=>{var C,E,w,B;const x=(E=(C=v.column.columnDef.meta)==null?void 0:C.rowSpan)==null?void 0:E.call(C,v);return!v.isPlaceholder&&x!==void 0&&v.id===v.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{style:{...bP(l,v),...wd(v.column),...p.columns.includes(v.column.id)?{display:"none"}:{}},id:`${s(v)}-${v.id}`,colSpan:typeof((w=v.column.columnDef.meta)==null?void 0:w.colSpan)=="function"?(B=v.column.columnDef.meta)==null?void 0:B.colSpan(v.column.columnDef):v.colSpan,rowSpan:x,children:[v.isPlaceholder&&x===void 0?null:_.jsxs("div",{className:v.column.getCanSort()?tn.sorting:"",onClick:v.column.getToggleSortingHandler(),id:v.column.getCanSort()?`${s(v)}-${v.id}-sort`:"",children:[bs(v.column.columnDef.header,v.getContext()),v.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:v.column.getIsSorted()==="asc"||v.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[v.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:c}),v.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:d})]}):_.jsx(_.Fragment,{})})]}),v.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>v.column.resetSize(),onMouseDown:v.getResizeHandler(),onTouchStart:v.getResizeHandler(),className:tn["resize-menu"]})]},v.id)})},b.id))}),_.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((b,v)=>{var x;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{onClick:C=>{C.stopPropagation(),i&&typeof r=="function"&&r(b.original,b)},className:i?h:"","data-calculate-height":`${u}-${v}`,id:o(b),children:b.getVisibleCells().map(C=>{var E,w,B;return _.jsx("td",{style:{...typeof((E=C.column.columnDef.meta)==null?void 0:E.styleTd)=="function"?C.column.columnDef.meta.styleTd(b.original,b):{},...wd(C.column,!0),...p.columns.includes(C.column.id)?{display:"none"}:{}},className:typeof((w=C.column.columnDef.meta)==null?void 0:w.classNameTd)=="function"?(B=C.column.columnDef.meta)==null?void 0:B.classNameTd(b.original,b):"",id:`${o(b)}-${C.column.id}`,children:bs(C.column.columnDef.cell,C.getContext())},C.id)})},b.id),b.getIsExpanded()&&typeof g=="function"&&_.jsx("tr",{children:_.jsx("td",{colSpan:b.getVisibleCells().length-(((x=p==null?void 0:p.realColumns)==null?void 0:x.length)||0),children:g(b.original,b,{visibilityColumns:p,classNameSubMobile:m})})})]},b.id)}),e.getRowModel().rows.length===0&&I.isValidElement(f)&&_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:f})})]})]})}),H2=I.forwardRef((e,t)=>{const{context:n,...r}=e;return _.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});H2.displayName="VirtualizationHead";const yP=({style:e,context:t,...n})=>_.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:{...e,width:t==null?void 0:t.width}}),xP=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,theadTrId:s,classNameTable:l,componentSortASC:u,componentSortDESC:c,classNamePointer:d,emptyPlaceholder:h,renderSubComponent:f,visibilityColumns:g,classNameSubMobile:p})=>{var v,x,C;const[m,b]=I.useState(0);return _.jsx(qp,{context:{headerId:a,classNameTable:l,width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},typeHight:"min-max",totalCount:((v=e.getRowModel().rows)==null?void 0:v.length)||0,minLengthItem:((x=e.getRowModel().rows)==null?void 0:x.length)||0,typeCalculateItemSize:"auto",component:{TableHead:H2,Table:yP,EmptyPlaceholder:()=>_.jsx("tbody",{ref:E=>{var w;return b(((w=E==null?void 0:E.getBoundingClientRect())==null?void 0:w.height)??0)},children:_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:I.isValidElement(h)&&h})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(E=>_.jsx("tr",{children:E.headers.map(w=>{var y,S,D,A;const B=(S=(y=w.column.columnDef.meta)==null?void 0:y.rowSpan)==null?void 0:S.call(y,w);return!w.isPlaceholder&&B!==void 0&&w.id===w.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{id:`${s(w)}-${w.id}`,colSpan:w.colSpan,rowSpan:B,style:{...typeof((D=w.column.columnDef.meta)==null?void 0:D.styleTh)=="function"?(A=w.column.columnDef.meta)==null?void 0:A.styleTh(w.column.columnDef):{},...wd(w.column),...g.columns.includes(w.column.id)?{display:"none"}:{}},children:[w.isPlaceholder&&B===void 0?null:_.jsxs("div",{className:w.column.getCanSort()?tn.sorting:"",onClick:w.column.getToggleSortingHandler(),id:w.column.getCanSort()?`${s(w)}-${w.id}-sort`:"",children:[bs(w.column.columnDef.header,w.getContext()),w.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:w.column.getIsSorted()==="asc"||w.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[w.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:u}),w.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:c})]}):_.jsx(_.Fragment,{})})]}),w.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>w.column.resetSize(),onMouseDown:w.getResizeHandler(),onTouchStart:w.getResizeHandler(),className:tn["resize-menu"]})]},w.id)})},E.id)),itemContent:(E,w)=>{var y,S;const B=(S=(y=e.getRowModel())==null?void 0:y.rows)==null?void 0:S[w];return _.jsx(E,{children:({...D})=>{var A;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{...D,onClick:T=>{T.stopPropagation(),r&&typeof n=="function"&&n(B.original,B)},className:r?d:"",id:o(B),children:B.getVisibleCells().map(T=>{var F,k,P;return _.jsx(_.Fragment,{children:_.jsx("td",{style:{...typeof((F=T.column.columnDef.meta)==null?void 0:F.styleTd)=="function"?T.column.columnDef.meta.styleTd(B.original,B):{},...wd(T.column,!0),...g.columns.includes(T.column.id)?{display:"none"}:{}},className:typeof((k=T.column.columnDef.meta)==null?void 0:k.classNameTd)=="function"?(P=T.column.columnDef.meta)==null?void 0:P.classNameTd(B.original,B):"",id:`${o(B)}-${T.column.id}`,children:bs(T.column.columnDef.cell,T.getContext())},T.id)})})}),B.getIsExpanded()&&typeof f=="function"&&_.jsx("tr",{"data-sub-component":w,children:_.jsx("td",{colSpan:B.getVisibleCells().length-(((A=g==null?void 0:g.realColumns)==null?void 0:A.length)||0),children:f(B.original,B,{visibilityColumns:g,classNameSubMobile:p})})})]},B.id)}},B.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 f=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},CP=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",theadTrId:c=()=>"",maxHeight:d=0,idCalculateHeight:h=void 0,kind:f="laba-reguler",componentSortASC:g,componentSortDESC:p,scrollTop:m=!1,emptyPlaceholder:b,variant:v,renderSubComponent:x,columnBreakpoints:C})=>{var A;const[E,w]=I.useState(0),[B,y]=I.useState({columns:[],realColumns:[]}),S=()=>{if(![void 0,"undefined"].includes(h)){const T=document.querySelector(`[data-calculate-height-header="${h}"]`);let F=0;const k=document.querySelectorAll(`[data-calculate-height^="${h}-"]`);return k==null||k.forEach(P=>{F+=P.offsetHeight}),F>d?d+T.offsetHeight:0}return d},D=()=>{var P;const T=((P=document.querySelector("body"))==null?void 0:P.offsetWidth)||0,F=C==null?void 0:C.sort(($,R)=>{const O=($.maxWidth??$.minWidth)||0,j=(R.maxWidth??R.minWidth)||0;return O!==j?O-j:$.maxWidth?-1:1}),k=(F==null?void 0:F.find($=>!!(Object.hasOwnProperty.call($,"maxWidth")&&T<=($.maxWidth||0)||Object.hasOwnProperty.call($,"minWidth")&&T>=($.minWidth||0))))||{};Object.keys(k).length>0?(y({columns:k.columns,realColumns:k.realColumns||k.columns}),k!=null&&k.resetExpanded&&e.resetExpanded()):y({columns:[],realColumns:[]})};return ba(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),ba(()=>{d>0&&w(S())},[(A=e==null?void 0:e.options)==null?void 0:A.data,d]),ba(()=>{if(Array.isArray(C)&&(C==null?void 0:C.length)>0)return D(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[C]),_.jsxs(_.Fragment,{children:[!o&&_.jsx(vP,{theadTrId:c,tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${cn().kind[f]} ${v?cn().variant[v]:""}
66
+ */function bs(e,t){return e?v8(e)?q.createElement(e,t):e:null}function v8(e){return y8(e)||typeof e=="function"||x8(e)}function y8(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function x8(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function C8(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=q.useState(()=>({current:c2(t)})),[r,i]=q.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 E8=Object.freeze(Object.defineProperty({__proto__:null,ColumnFaceting:O4,ColumnFiltering:Z4,ColumnGrouping:Y4,ColumnOrdering:J4,ColumnPinning:q4,ColumnSizing:Q4,ColumnVisibility:t2,GlobalFaceting:n2,GlobalFiltering:r2,Headers:L4,RowExpanding:i2,RowPagination:a2,RowPinning:o2,RowSelection:s2,RowSorting:u2,_getVisibleLeafColumns:ns,aggregationFns:Bc,buildHeaderGroups:Qs,createCell:N4,createColumn:M4,createColumnHelper:jk,createRow:vu,createTable:c2,defaultColumnSizing:el,expandRows:Fp,filterFns:Xr,flattenBy:$p,flexRender:bs,functionalUpdate:Fi,getCoreRowModel:o8,getExpandedRowModel:s8,getFacetedMinMaxValues:l8,getFacetedRowModel:d8,getFacetedUniqueValues:f8,getFilteredRowModel:h8,getGroupedRowModel:g8,getMemoOptions:Ie,getPaginationRowModel:m8,getSortedRowModel:b8,isFunction:bu,isNumberArray:F4,isRowSelected:vf,isSubRowSelected:vd,makeStateUpdater:Wn,memo:we,noop:Wk,orderColumns:K4,passiveEventSupported:e2,reSplitAlphaNumeric:yd,selectRowsFn:$c,shouldAutoRemoveFilter:J0,sortingFns:Uo,useReactTable:C8},Symbol.toStringTag,{value:"Module"})),yf=0,Ta=1,$s=2,f2=4;function kl(e,t){return n=>e(t(n))}function S8(e,t){return t(e)}function h2(e,t){return n=>e(t,n)}function yb(e,t){return()=>e(t)}function xf(e,t){return t(e),e}function Dt(...e){return e}function w8(e){e()}function xb(e){return()=>e}function I8(...e){return()=>{e.map(w8)}}function Np(e){return e!==void 0}function wo(){}function mt(e,t){return e(Ta,t)}function We(e,t){e(yf,t)}function Mp(e){e($s)}function xn(e){return e(f2)}function _e(e,t){return mt(e,h2(t,yf))}function fi(e,t){const n=e(Ta,r=>{n(),t(r)});return n}function tt(){const e=[];return(t,n)=>{switch(t){case $s:e.splice(0,e.length);return;case Ta:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case yf:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=tt();return(r,i)=>{switch(r){case Ta:i(t);break;case yf:t=i;break;case f2:return t}return n(r,i)}}function _8(e){let t,n;const r=()=>t&&t();return function(i,a){switch(i){case Ta:return a?n===a?void 0:(r(),n=a,t=mt(e,a),t):(r(),wo);case $s:r(),n=null;return;default:throw new Error(`unrecognized action ${i}`)}}}function tr(e){return xf(tt(),t=>_e(e,t))}function Cn(e,t){return xf(fe(t),n=>_e(e,n))}function D8(...e){return t=>e.reduceRight(S8,t)}function ue(e,...t){const n=D8(...t);return(r,i)=>{switch(r){case Ta:return mt(e,n(i));case $s:Mp(e);return}}}function g2(e,t){return e===t}function _t(e=g2){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Ne(e){return t=>n=>{e(n)&&t(n)}}function ve(e){return t=>kl(t,e)}function Jr(e){return t=>()=>t(e)}function ii(e,t){return n=>r=>n(t=e(t,r))}function vs(e){return t=>n=>{e>0?e--:t(n)}}function ua(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Cb(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ge(...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);mt(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 Eb(...e){return function(t,n){switch(t){case Ta:return I8(...e.map(r=>mt(r,n)));case $s:return;default:throw new Error(`unrecognized action ${t}`)}}}function Le(e,t=g2){return ue(e,_t(t))}function sn(...e){const t=tt(),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);mt(a,l=>{n[o]=l,r=r|s,r===i&&We(t,n)})}),function(a,o){switch(a){case Ta:return r===i&&o(n),mt(t,o);case $s:return Mp(t);default:throw new Error(`unrecognized action ${a}`)}}}function lt(e,t=[],{singleton:n}={singleton:!0}){return{id:A8(),constructor:e,dependencies:t,singleton:n}}const A8=()=>Symbol();function T8(e){const t=new Map,n=({id:r,constructor:i,dependencies:a,singleton:o})=>{if(o&&t.has(r))return t.get(r);const s=i(a.map(l=>n(l)));return o&&t.set(r,s),s};return n(e)}function R8(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)r.hasOwnProperty(o)||(n[o]=t[o]);return n}const Gu=typeof document<"u"?I.useLayoutEffect:I.useEffect;function Lp(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=I.createContext({});function l(b,v){b.propsReady&&We(b.propsReady,!1);for(const x of r){const C=b[t.required[x]];We(C,v[x])}for(const x of i)if(x in v){const C=b[t.optional[x]];We(C,v[x])}b.propsReady&&We(b.propsReady,!0)}function u(b){return a.reduce((v,x)=>(v[x]=C=>{const E=b[t.methods[x]];We(E,C)},v),{})}function c(b){return o.reduce((v,x)=>(v[x]=_8(b[t.events[x]]),v),{})}const d=I.forwardRef((b,v)=>{const{children:x,...C}=b,[E]=I.useState(()=>xf(T8(e),B=>l(B,C))),[w]=I.useState(yb(c,E));return Gu(()=>{for(const B of o)B in C&&mt(w[B],C[B]);return()=>{Object.values(w).map(Mp)}},[C,w,E]),Gu(()=>{l(E,C)}),I.useImperativeHandle(v,xb(u(E))),I.createElement(s.Provider,{value:E},n?I.createElement(n,R8([...r,...i,...o],C),x):x)}),h=b=>I.useCallback(h2(We,I.useContext(s)[b]),[b]),f=b=>{const x=I.useContext(s)[b],C=I.useCallback(E=>mt(x,E),[x]);return I.useSyncExternalStore(C,()=>xn(x),()=>xn(x))},g=b=>{const x=I.useContext(s)[b],[C,E]=I.useState(yb(xn,x));return Gu(()=>mt(x,w=>{w!==C&&E(xb(w))}),[x,C]),C},p=I.version.startsWith("18")?f:g;return{Component:d,usePublisher:h,useEmitterValue:p,useEmitter:(b,v)=>{const C=I.useContext(s)[b];Gu(()=>mt(C,v),[v,C])}}}const B8=typeof document<"u"?I.useLayoutEffect:I.useEffect,$8=B8;var nr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(nr||{});const k8={0:"debug",1:"log",2:"warn",3:"error"},P8=()=>typeof globalThis>"u"?window:globalThis,Ra=lt(()=>{const e=fe(3);return{log:fe((n,r,i=1)=>{var a;const o=(a=P8().VIRTUOSO_LOG_LEVEL)!=null?a:xn(e);i>=o&&console[k8[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function Op(e,t=!0){const n=I.useRef(null);let r=i=>{};if(typeof ResizeObserver<"u"){const i=I.useMemo(()=>new ResizeObserver(a=>{requestAnimationFrame(()=>{const o=a[0].target;o.offsetParent!==null&&e(o)})}),[e]);r=a=>{a&&t?(i.observe(a),n.current=a):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function hi(e,t=!0){return Op(e,t).callbackRef}function p2(e,t,n,r,i,a,o){const s=I.useCallback(l=>{const u=F8(l.children,t,"offsetHeight",i);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const d=c.lastElementChild.dataset.viewportType==="window",h=o?o.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,f=o?o.scrollHeight:d?document.documentElement.scrollHeight:c.scrollHeight,g=o?o.offsetHeight:d?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(h,0),scrollHeight:f,viewportHeight:g}),a==null||a(N8("row-gap",getComputedStyle(l).rowGap,i)),u!==null&&e(u)},[e,t,i,a,o,r]);return Op(s,n)}function F8(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||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},nr.ERROR),c===u)continue;const d=a[a.length-1];a.length===0||d.size!==c||d.endIndex!==l-1?a.push({startIndex:l,endIndex:l,size:c}):a[a.length-1].endIndex++}return a}function N8(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}function Fr(e,t){return Math.round(e.getBoundingClientRect()[t])}function m2(e,t){return Math.abs(e-t)<1.01}function b2(e,t,n,r=wo,i){const a=I.useRef(null),o=I.useRef(null),s=I.useRef(null),l=I.useCallback(d=>{const h=d.target,f=h===window||h===document,g=f?window.pageYOffset||document.documentElement.scrollTop:h.scrollTop,p=f?document.documentElement.scrollHeight:h.scrollHeight,m=f?window.innerHeight:h.offsetHeight,b=()=>{e({scrollTop:Math.max(g,0),scrollHeight:p,viewportHeight:m})};d.suppressFlushSync?b():cu.flushSync(b),o.current!==null&&(g===o.current||g<=0||g===p-m)&&(o.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);I.useEffect(()=>{const d=i||a.current;return r(i||a.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[a,l,n,r,i]);function u(d){const h=a.current;if(!h||"offsetHeight"in h&&h.offsetHeight===0)return;const f=d.behavior==="smooth";let g,p,m;h===window?(p=Math.max(Fr(document.documentElement,"height"),document.documentElement.scrollHeight),g=window.innerHeight,m=document.documentElement.scrollTop):(p=h.scrollHeight,g=Fr(h,"height"),m=h.scrollTop);const b=p-g;if(d.top=Math.ceil(Math.max(Math.min(b,d.top),0)),m2(g,p)||d.top===m){e({scrollTop:m,scrollHeight:p,viewportHeight:g}),f&&t(!0);return}f?(o.current=d.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,o.current=null,t(!0)},1e3)):o.current=null,h.scrollTo(d)}function c(d){a.current.scrollBy(d)}return{scrollerRef:a,scrollByCallback:c,scrollToCallback:u}}const $n=lt(()=>{const e=tt(),t=tt(),n=fe(0),r=tt(),i=fe(0),a=tt(),o=tt(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),d=tt(),h=tt(),f=fe(!1);return _e(ue(e,ve(({scrollTop:g})=>g)),t),_e(ue(e,ve(({scrollHeight:g})=>g)),o),_e(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:o,smoothScrollTargetReached:r,scrollTo:d,scrollBy:h,statefulScrollTop:i,deviation:n,scrollingInProgress:f}},[],{singleton:!0}),Pl={lvl:0};function v2(e,t,n,r=Pl,i=Pl){return{k:e,v:t,lvl:n,l:r,r:i}}function yt(e){return e===Pl}function rs(){return Pl}function tg(e,t){if(yt(e))return Pl;const{k:n,l:r,r:i}=e;if(t===n){if(yt(r))return i;if(yt(i))return r;{const[a,o]=y2(r);return kc(qt(e,{k:a,v:o,l:x2(r)}))}}else return t<n?kc(qt(e,{l:tg(r,t)})):kc(qt(e,{r:tg(i,t)}))}function Fl(e,t){if(!yt(e))return t===e.k?e.v:t<e.k?Fl(e.l,t):Fl(e.r,t)}function Nr(e,t,n="k"){if(yt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Nr(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Nr(e.l,t,n)}function qn(e,t,n){return yt(e)?v2(t,n,1):t===e.k?qt(e,{k:t,v:n}):t<e.k?Sb(qt(e,{l:qn(e.l,t,n)})):Sb(qt(e,{r:qn(e.r,t,n)}))}function ng(e,t,n){if(yt(e))return[];const{k:r,v:i,l:a,r:o}=e;let s=[];return r>t&&(s=s.concat(ng(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:i}),r<=n&&(s=s.concat(ng(o,t,n))),s}function Qa(e){return yt(e)?[]:[...Qa(e.l),{k:e.k,v:e.v},...Qa(e.r)]}function y2(e){return yt(e.r)?[e.k,e.v]:y2(e.r)}function x2(e){return yt(e.r)?e.l:kc(qt(e,{r:x2(e.r)}))}function qt(e,t){return v2(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 gh(e){return yt(e)||e.lvl>e.r.lvl}function Sb(e){return rg(E2(e))}function kc(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(gh(t))return E2(qt(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return qt(t.r,{l:qt(t,{r:t.r.l}),r:qt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(gh(e))return rg(qt(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const i=n.l,a=gh(i)?n.lvl-1:n.lvl;return qt(i,{l:qt(e,{r:i.l,lvl:r-1}),r:rg(qt(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Cf(e,t,n){if(yt(e))return[];const r=Nr(e,t)[0];return M8(ng(e,r,n))}function C2(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({start:r,end:s-1,value:i}),r=s,i=l}return a.push({start:r,end:1/0,value:i}),a}function M8(e){return C2(e,({k:t,v:n})=>({index:t,value:n}))}function rg(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?qt(t,{l:qt(e,{r:t.l}),lvl:n+1}):e}function E2(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?qt(t,{r:qt(e,{l:t.r})}):e}function xd(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 S2(e,t,n){return e[xd(e,t,n)]}function L8(e,t,n,r){const i=xd(e,t,r),a=xd(e,n,r,i);return e.slice(i,a+1)}const Vp=lt(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function O8(e){const{size:t,startIndex:n,endIndex:r}=e;return i=>i.start===n&&(i.end===r||i.end===1/0)&&i.value===t}function wb(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 V8(e,t){let n=yt(e)?0:1/0;for(const r of t){const{size:i,startIndex:a,endIndex:o}=r;if(n=Math.min(n,a),yt(e)){e=qn(e,0,i);continue}const s=Cf(e,a-1,o+1);if(s.some(O8(r)))continue;let l=!1,u=!1;for(const{start:c,end:d,value:h}of s)l?(o>=c||i===h)&&(e=tg(e,c)):(u=h!==i,l=!0),d>o&&o>=c&&h!==i&&(e=qn(e,o+1,h));u&&(e=qn(e,a,i))}return[e,n]}function H8(){return{offsetTree:[],sizeTree:rs(),groupOffsetTree:rs(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Hp({index:e},t){return t===e?0:t<e?-1:1}function j8({offset:e},t){return t===e?0:t<e?-1:1}function W8(e){return{index:e.index,value:e}}function z8(e,t,n,r=0){return r>0&&(t=Math.max(t,S2(e,r,Hp).offset)),C2(L8(e,t,n,j8),W8)}function ig(e,t,n,r){let i=e,a=0,o=0,s=0,l=0;if(t!==0){l=xd(i,t-1,Hp),s=i[l].offset;const c=Nr(n,t-1);a=c[0],o=c[1],i.length&&i[l].size===Nr(n,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:u,value:c}of Cf(n,t,1/0)){const d=u-a,h=d*o+s+d*r;i.push({offset:h,size:c,index:u}),a=u,s=h,o=c}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function G8(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,nr.DEBUG);const a=e.sizeTree;let o=a,s=0;if(n.length>0&&yt(a)&&t.length===2){const h=t[0].size,f=t[1].size;o=n.reduce((g,p)=>qn(qn(g,p,h),p+1,f),o)}else[o,s]=V8(o,t);if(o===a)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:d}=ig(e.offsetTree,s,o,i);return{sizeTree:o,offsetTree:l,lastIndex:u,lastOffset:d,lastSize:c,groupOffsetTree:n.reduce((h,f)=>qn(h,f,Nl(f,l,i)),rs()),groupIndices:n}}function Nl(e,t,n){if(t.length===0)return 0;const{offset:r,index:i,size:a}=S2(t,e,Hp),o=e-i,s=a*o+(o-1)*n+r;return s>0?s+n:s}function U8(e){return typeof e.groupIndex<"u"}function w2(e,t,n){if(U8(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let i=I2(r,t);return i=Math.max(0,i,Math.min(n,i)),i}}function I2(e,t){if(!Ef(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Ef(e){return!yt(e.groupOffsetTree)}function X8(e){return Qa(e).map(({k:t,v:n},r,i)=>{const a=i[r+1],o=a?a.k-1:1/0;return{startIndex:t,endIndex:o,size:n}})}const Z8={offsetHeight:"height",offsetWidth:"width"},mi=lt(([{log:e},{recalcInProgress:t}])=>{const n=tt(),r=tt(),i=Cn(r,0),a=tt(),o=tt(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),d=fe((E,w)=>Fr(E,Z8[w])),h=fe(void 0),f=fe(0),g=H8(),p=Cn(ue(n,Ge(l,e,f),ii(G8,g),_t()),g),m=Cn(ue(l,_t(),ii((E,w)=>({prev:E.current,current:w}),{prev:[],current:[]}),ve(({prev:E})=>E)),[]);_e(ue(l,Ne(E=>E.length>0),Ge(p,f),ve(([E,w,B])=>{const y=E.reduce((S,D,A)=>qn(S,D,Nl(D,w.offsetTree,B)||A),rs());return{...w,groupIndices:E,groupOffsetTree:y}})),p),_e(ue(r,Ge(p),Ne(([E,{lastIndex:w}])=>E<w),ve(([E,{lastIndex:w,lastSize:B}])=>[{startIndex:E,endIndex:w,size:B}])),n),_e(u,c);const b=Cn(ue(u,ve(E=>E===void 0)),!0);_e(ue(c,Ne(E=>E!==void 0&&yt(xn(p).sizeTree)),ve(E=>[{startIndex:0,endIndex:0,size:E}])),n);const v=tr(ue(n,Ge(p),ii(({sizes:E},[w,B])=>({changed:B!==E,sizes:B}),{changed:!1,sizes:g}),ve(E=>E.changed)));mt(ue(s,ii((E,w)=>({diff:E.prev-w,prev:w}),{diff:0,prev:0}),ve(E=>E.diff)),E=>{const{groupIndices:w}=xn(p);if(E>0)We(t,!0),We(a,E+wb(E,w));else if(E<0){const B=xn(m);B.length>0&&(E-=wb(-E,B)),We(o,E)}}),mt(ue(s,Ge(e)),([E,w])=>{E<0&&w("`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},nr.ERROR)});const x=tr(a);_e(ue(a,Ge(p),ve(([E,w])=>{const B=w.groupIndices.length>0,y=[],S=w.lastSize;if(B){const D=Fl(w.sizeTree,0);let A=0,T=0;for(;A<E;){const P=w.groupIndices[T],$=w.groupIndices.length===T+1?1/0:w.groupIndices[T+1]-P-1;y.push({startIndex:P,endIndex:P,size:D}),y.push({startIndex:P+1,endIndex:P+1+$-1,size:S}),T++,A+=$+1}const F=Qa(w.sizeTree);return A!==E&&F.shift(),F.reduce((P,{k:$,v:R})=>{let O=P.ranges;return P.prevSize!==0&&(O=[...P.ranges,{startIndex:P.prevIndex,endIndex:$+E-1,size:P.prevSize}]),{ranges:O,prevIndex:$+E,prevSize:R}},{ranges:y,prevIndex:E,prevSize:0}).ranges}return Qa(w.sizeTree).reduce((D,{k:A,v:T})=>({ranges:[...D.ranges,{startIndex:D.prevIndex,endIndex:A+E-1,size:D.prevSize}],prevIndex:A+E,prevSize:T}),{ranges:[],prevIndex:0,prevSize:S}).ranges})),n);const C=tr(ue(o,Ge(p,f),ve(([E,{offsetTree:w},B])=>{const y=-E;return Nl(y,w,B)})));return _e(ue(o,Ge(p,f),ve(([E,w,B])=>{if(w.groupIndices.length>0){if(yt(w.sizeTree))return w;let S=rs();const D=xn(m);let A=0,T=0,F=0;for(;A<-E;){F=D[T];const P=D[T+1]-F-1;T++,A+=P+1}if(S=Qa(w.sizeTree).reduce((P,{k:$,v:R})=>qn(P,Math.max(0,$+E),R),S),A!==-E){const P=Fl(w.sizeTree,F);S=qn(S,0,P);const $=Nr(w.sizeTree,-E+1)[1];S=qn(S,1,$)}return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}else{const S=Qa(w.sizeTree).reduce((D,{k:A,v:T})=>qn(D,Math.max(0,A+E),T),rs());return{...w,sizeTree:S,...ig(w.offsetTree,0,S,B)}}})),p),{data:h,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:a,shiftWith:o,shiftWithOffset:C,beforeUnshiftWith:x,firstItemIndex:s,gap:f,sizes:p,listRefresh:v,statefulTotalCount:i,trackItemSizes:b,itemSize:d}},Dt(Ra,Vp),{singleton:!0}),Y8=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function _2(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Y8)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const yu=lt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:i,viewportHeight:a,scrollTo:o,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:d},{log:h}])=>{const f=tt(),g=tt(),p=fe(0);let m=null,b=null,v=null;function x(){m&&(m(),m=null),v&&(v(),v=null),b&&(clearTimeout(b),b=null),We(i,!1)}return _e(ue(f,Ge(e,a,t,p,l,u,h),Ge(r,c,d),ve(([[C,E,w,B,y,S,D,A],T,F,k])=>{const P=_2(C),{align:$,behavior:R,offset:O}=P,j=B-1,V=w2(P,E,j);let W=Nl(V,E.offsetTree,T)+S;$==="end"?(W+=F+Nr(E.sizeTree,V)[1]-w+k,V===j&&(W+=D)):$==="center"?W+=(F+Nr(E.sizeTree,V)[1]-w+k)/2:W-=y,O&&(W+=O);const U=K=>{x(),K?(A("retrying to scroll to",{location:C},nr.DEBUG),We(f,C)):(We(g,!0),A("list did not change, scroll successful",{},nr.DEBUG))};if(x(),R==="smooth"){let K=!1;v=mt(n,ee=>{K=K||ee}),m=fi(s,()=>{U(K)})}else m=fi(ue(n,K8(150)),U);return b=setTimeout(()=>{x()},1200),We(i,!0),A("scrolling from index to",{index:V,top:W,behavior:R},nr.DEBUG),{top:W,behavior:R}})),o),{scrollToIndex:f,scrollTargetReached:g,topListHeight:p}},Dt(mi,$n,Ra),{singleton:!0});function K8(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Ml="up",ml="down",J8="none",q8={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Q8=0,xu=lt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:i,scrollBy:a}])=>{const o=fe(!1),s=fe(!0),l=tt(),u=tt(),c=fe(4),d=fe(Q8),h=Cn(ue(Eb(ue(Le(t),vs(1),Jr(!0)),ue(Le(t),vs(1),Jr(!1),Cb(100))),_t()),!1),f=Cn(ue(Eb(ue(a,Jr(!0)),ue(a,Jr(!1),Cb(200))),_t()),!1);_e(ue(sn(Le(t),Le(d)),ve(([v,x])=>v<=x),_t()),s),_e(ue(s,ua(50)),u);const g=tr(ue(sn(e,Le(n),Le(r),Le(i),Le(c)),ii((v,[{scrollTop:x,scrollHeight:C},E,w,B,y])=>{const S=x+E-C>-y,D={viewportHeight:E,scrollTop:x,scrollHeight:C};if(S){let T,F;return x>v.state.scrollTop?(T="SCROLLED_DOWN",F=v.state.scrollTop-x):(T="SIZE_DECREASED",F=v.state.scrollTop-x||v.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:T,scrollTopDelta:F}}let A;return D.scrollHeight>v.state.scrollHeight?A="SIZE_INCREASED":E<v.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":x<v.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:D}},q8),_t((v,x)=>v&&v.atBottom===x.atBottom))),p=Cn(ue(e,ii((v,{scrollTop:x,scrollHeight:C,viewportHeight:E})=>{if(m2(v.scrollHeight,C))return{scrollTop:x,scrollHeight:C,jump:0,changed:!1};{const w=C-(x+E)<1;return v.scrollTop!==x&&w?{scrollHeight:C,scrollTop:x,jump:v.scrollTop-x,changed:!0}:{scrollHeight:C,scrollTop:x,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Ne(v=>v.changed),ve(v=>v.jump)),0);_e(ue(g,ve(v=>v.atBottom)),o),_e(ue(o,ua(50)),l);const m=fe(ml);_e(ue(e,ve(({scrollTop:v})=>v),_t(),ii((v,x)=>xn(f)?{direction:v.direction,prevScrollTop:x}:{direction:x<v.prevScrollTop?Ml:ml,prevScrollTop:x},{direction:ml,prevScrollTop:0}),ve(v=>v.direction)),m),_e(ue(e,ua(50),Jr(J8)),m);const b=fe(0);return _e(ue(h,Ne(v=>!v),Jr(0)),b),_e(ue(t,ua(100),Ge(h),Ne(([v,x])=>!!x),ii(([v,x],[C])=>[x,C],[0,0]),ve(([v,x])=>x-v)),b),{isScrolling:h,isAtTop:s,isAtBottom:o,atBottomState:g,atTopStateChange:u,atBottomStateChange:l,scrollDirection:m,atBottomThreshold:c,atTopThreshold:d,scrollVelocity:b,lastJumpDueToItemResize:p}},Dt($n)),Ba=lt(([{log:e}])=>{const t=fe(!1),n=tr(ue(t,Ne(r=>r),_t()));return mt(t,r=>{r&&xn(e)("props updated",{},nr.DEBUG)}),{propsReady:t,didMount:n}},Dt(Ra),{singleton:!0});function jp(e,t){e==0?t():requestAnimationFrame(()=>jp(e-1,t))}function Wp(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Cu=lt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:i,scrollTargetReached:a},{didMount:o}])=>{const s=fe(!0),l=fe(0),u=fe(!0);return _e(ue(o,Ge(l),Ne(([c,d])=>!!d),Jr(!1)),s),_e(ue(o,Ge(l),Ne(([c,d])=>!!d),Jr(!1)),u),mt(ue(sn(t,o),Ge(s,e,n,u),Ne(([[,c],d,{sizeTree:h},f,g])=>c&&(!yt(h)||Np(f))&&!d&&!g),Ge(l)),([,c])=>{fi(a,()=>{We(u,!0)}),jp(4,()=>{fi(r,()=>{We(s,!0)}),We(i,c)})}),{scrolledToInitialItem:s,initialTopMostItemIndex:l,initialItemFinalLocationReached:u}},Dt(mi,$n,yu,Ba),{singleton:!0});function Ib(e){return e?e==="smooth"?"smooth":"auto":!1}const e7=(e,t)=>typeof e=="function"?Ib(e(t)):t&&Ib(e),t7=lt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:i},{scrolledToInitialItem:a},{propsReady:o,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),d=tt();let h=null;function f(p){We(i,{index:"LAST",align:"end",behavior:p})}mt(ue(sn(ue(Le(e),vs(1)),s),Ge(Le(c),n,a,u),ve(([[p,m],b,v,x,C])=>{let E=m&&x,w="auto";return E&&(w=e7(b,v||C),E=E&&!!w),{totalCount:p,shouldFollow:E,followOutputBehavior:w}}),Ne(({shouldFollow:p})=>p)),({totalCount:p,followOutputBehavior:m})=>{h&&(h(),h=null),h=fi(t,()=>{xn(l)("following output to ",{totalCount:p},nr.DEBUG),f(m),h=null})});function g(p){const m=fi(r,b=>{p&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(xn(l)("scrolling to bottom due to increased size",{},nr.DEBUG),f("auto"))});setTimeout(m,100)}return mt(ue(sn(Le(c),e,o),Ne(([p,,m])=>p&&m),ii(({value:p},[,m])=>({refreshed:p===m,value:m}),{refreshed:!1,value:0}),Ne(({refreshed:p})=>p),Ge(c,e)),([,p])=>{xn(a)&&g(p!==!1)}),mt(d,()=>{g(xn(c)!==!1)}),mt(sn(Le(c),r),([p,m])=>{p&&!m.atBottom&&m.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")}),{followOutput:c,autoscrollToBottom:d}},Dt(mi,xu,yu,Cu,Ba,Ra,$n));function n7(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const D2=lt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:i}])=>{const a=tt(),o=tt(),s=tr(ue(a,ve(n7)));return _e(ue(s,ve(l=>l.totalCount)),e),_e(ue(s,ve(l=>l.groupIndices)),t),_e(ue(sn(r,n,i),Ne(([l,u])=>Ef(u)),ve(([l,u,c])=>Nr(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),_t(),ve(l=>[l])),o),{groupCounts:a,topItemsIndexes:o}},Dt(mi,$n));function Ll(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function A2(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const Cd="top",Ed="bottom",_b="none";function Db(e,t,n){return typeof e=="number"?n===Ml&&t===Cd||n===ml&&t===Ed?e:0:n===Ml?t===Cd?e.main:e.reverse:t===Ed?e.main:e.reverse}function Ab(e,t){return typeof e=="number"?e:e[t]||0}const zp=lt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:i}])=>{const a=tt(),o=fe(0),s=fe(0),l=fe(0),u=Cn(ue(sn(Le(e),Le(t),Le(r),Le(a,Ll),Le(l),Le(o),Le(i),Le(n),Le(s)),ve(([c,d,h,[f,g],p,m,b,v,x])=>{const C=c-v,E=m+b,w=Math.max(h-C,0);let B=_b;const y=Ab(x,Cd),S=Ab(x,Ed);return f-=v,f+=h+b,g+=h+b,g-=v,f>c+E-y&&(B=Ml),g<c-w+d+S&&(B=ml),B!==_b?[Math.max(C-h-Db(p,Cd,B)-y,0),C-w-b+d+Db(p,Ed,B)+S]:null}),Ne(c=>c!=null),_t(Ll)),[0,0]);return{listBoundary:a,overscan:l,topListHeight:o,increaseViewportBy:s,visibleRange:u}},Dt($n),{singleton:!0});function r7(e,t,n){if(Ef(t)){const r=I2(e,t);return[{index:Nr(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ph={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Tb(e,t,n){if(e.length===0)return[];if(!Ef(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=Cf(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={type:"group",index:l}:c={index:u.index-(l+1)+n,groupIndex:l},a.push({...c,size:u.size,offset:u.offset,originalIndex:u.index,data:u.data})}return a}function Pc(e,t,n,r,i,a){const{lastSize:o,lastOffset:s,lastIndex:l}=i;let u=0,c=0;if(e.length>0){u=e[0].offset;const p=e[e.length-1];c=p.offset+p.size}const d=n-l,h=s+d*o+(d-1)*r,f=u,g=h-c;return{items:Tb(e,i,a),topItems:Tb(t,i,a),topListHeight:t.reduce((p,m)=>m.size+p,0),offsetTop:u,offsetBottom:g,top:f,bottom:c,totalCount:n,firstItemIndex:a}}function T2(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=Wp(t,s),u=Array.from({length:s}).map((c,d)=>({index:d+l,size:0,offset:0,data:a[d+l]}));return Pc(u,[],s,i,n,r)}const Io=lt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:i},a,{visibleRange:o,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:d},h,{didMount:f},{recalcInProgress:g}])=>{const p=fe([]),m=fe(0),b=tt();_e(a.topItemsIndexes,p);const v=Cn(ue(sn(f,g,Le(o,Ll),Le(t),Le(e),Le(c),u,Le(p),Le(r),Le(i),n),Ne(([w,B,,y,,,,,,,S])=>{const D=S&&S.length!==y;return w&&!B&&!D}),ve(([,,[w,B],y,S,D,A,T,F,k,P])=>{const $=S,{sizeTree:R,offsetTree:O}=$,j=xn(m);if(y===0)return{...ph,totalCount:y};if(w===0&&B===0)return j===0?{...ph,totalCount:y}:T2(j,D,S,F,k,P||[]);if(yt(R))return j>0?null:Pc(r7(Wp(D,y),$,P),[],y,k,$,F);const V=[];if(T.length>0){const z=T[0],H=T[T.length-1];let X=0;for(const te of Cf(R,z,H)){const ie=te.value,le=Math.max(te.start,z),ce=Math.min(te.end,H);for(let Q=le;Q<=ce;Q++)V.push({index:Q,size:ie,offset:X,data:P&&P[Q]}),X+=ie}}if(!A)return Pc([],V,y,k,$,F);const W=T.length>0?T[T.length-1]+1:0,U=z8(O,w,B,W);if(U.length===0)return null;const K=y-1,ee=xf([],z=>{for(const H of U){const X=H.value;let te=X.offset,ie=H.start;const le=X.size;if(X.offset<w){ie+=Math.floor((w-X.offset+k)/(le+k));const Q=ie-H.start;te+=Q*le+Q*k}ie<W&&(te+=(W-ie)*le,ie=W);const ce=Math.min(H.end,K);for(let Q=ie;Q<=ce&&!(te>=B);Q++)z.push({index:Q,size:le,offset:te,data:P&&P[Q]}),te+=le+k}});return Pc(ee,V,y,k,$,F)}),Ne(w=>w!==null),_t()),ph);_e(ue(n,Ne(Np),ve(w=>w==null?void 0:w.length)),t),_e(ue(v,ve(w=>w.topListHeight)),d),_e(d,l),_e(ue(v,ve(w=>[w.top,w.bottom])),s),_e(ue(v,ve(w=>w.items)),b);const x=tr(ue(v,Ne(({items:w})=>w.length>0),Ge(t,n),Ne(([{items:w},B])=>w[w.length-1].originalIndex===B-1),ve(([,w,B])=>[w-1,B]),_t(Ll),ve(([w])=>w))),C=tr(ue(v,ua(200),Ne(({items:w,topItems:B})=>w.length>0&&w[0].originalIndex===B.length),ve(({items:w})=>w[0].index),_t())),E=tr(ue(v,Ne(({items:w})=>w.length>0),ve(({items:w})=>{let B=0,y=w.length-1;for(;w[B].type==="group"&&B<y;)B++;for(;w[y].type==="group"&&y>B;)y--;return{startIndex:w[B].index,endIndex:w[y].index}}),_t(A2)));return{listState:v,topItemsIndexes:p,endReached:x,startReached:C,rangeChanged:E,itemsRendered:b,initialItemCount:m,...h}},Dt(mi,D2,zp,Cu,yu,xu,Ba,Vp),{singleton:!0}),i7=lt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(_e(ue(s,Ge(a),Ne(([,l])=>l!==0),Ge(i,e,t,r,n),ve(([[,l],u,c,d,h,f=[]])=>T2(l,u,c,d,h,f))),o),{}),Dt(mi,Cu,Io,Ba),{singleton:!0}),R2=lt(([{scrollVelocity:e}])=>{const t=fe(!1),n=tt(),r=fe(!1);return _e(ue(e,Ge(r,t,n),Ne(([i,a])=>!!a),ve(([i,a,o,s])=>{const{exit:l,enter:u}=a;if(o){if(l(i,s))return!1}else if(u(i,s))return!0;return o}),_t()),t),mt(ue(sn(t,e,n),Ge(r)),([[i,a,o],s])=>i&&s&&s.change&&s.change(a,o)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Dt(xu),{singleton:!0}),a7=lt(([{topItemsIndexes:e}])=>{const t=fe(0);return _e(ue(t,Ne(n=>n>0),ve(n=>Array.from({length:n}).map((r,i)=>i))),e),{topItemCount:t}},Dt(Io)),B2=lt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:i}])=>{const a=tt(),o=Cn(ue(sn(e,r,t,n,i),ve(([s,l,u,c,d])=>s+l+u+c+d.offsetBottom+d.bottom)),0);return _e(Le(o),a),{totalListHeight:o,totalListHeightChanged:a}},Dt($n,Io),{singleton:!0});function $2(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const o7=$2(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),s7=lt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:i,isAtBottom:a,scrollDirection:o,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:d,gap:h},{log:f},{recalcInProgress:g}])=>{const p=tr(ue(l,Ge(s),ii(([,b,v,x],[{items:C,totalCount:E,bottom:w,offsetBottom:B},y])=>{const S=w+B;let D=0;return v===E&&b.length>0&&C.length>0&&(C[0].originalIndex===0&&b[0].originalIndex===0||(D=S-x,D!==0&&(D+=y))),[D,C,E,S]},[0,[],0,0]),Ne(([b])=>b!==0),Ge(t,o,r,a,f,g),Ne(([,b,v,x,,,C])=>!C&&!x&&b!==0&&v===Ml),ve(([[b],,,,,v])=>(v("Upward scrolling compensation",{amount:b},nr.DEBUG),b))));function m(b){b>0?(We(e,{top:-b,behavior:"auto"}),We(n,0)):(We(n,0),We(e,{top:-b,behavior:"auto"}))}return mt(ue(p,Ge(n,i)),([b,v,x])=>{x&&o7()?We(n,v-b):m(-b)}),mt(ue(sn(Cn(i,!1),n,g),Ne(([b,v,x])=>!b&&!x&&v!==0),ve(([b,v])=>v),ua(1)),m),_e(ue(c,ve(b=>({top:-b}))),e),mt(ue(u,Ge(d,h),ve(([b,{lastSize:v,groupIndices:x,sizeTree:C},E])=>{function w(B){return B*(v+E)}if(x.length===0)return w(b);{let B=0;const y=Fl(C,0);let S=0,D=0;for(;S<b;){S++,B+=y;let A=x.length===D+1?1/0:x[D+1]-x[D]-1;S+A>b&&(B-=y,A=b-S+1),S+=A,B+=w(A),D++}return B}})),b=>{We(n,b),requestAnimationFrame(()=>{We(e,{top:b}),requestAnimationFrame(()=>{We(n,0),We(g,!1)})})}),{deviation:n}},Dt($n,xu,Io,mi,Ra,Vp)),l7=lt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return mt(ue(e,Ge(r),Ne(([,i])=>i!==0),ve(([,i])=>({top:i}))),i=>{fi(ue(n,vs(1),Ne(a=>a.items.length>1)),()=>{requestAnimationFrame(()=>{We(t,i)})})}),{initialScrollTop:r}},Dt(Ba,$n,Io),{singleton:!0}),u7=lt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=Cn(ue(sn(n,e,t),Ne(([i])=>i),ve(([,i,a])=>Math.max(0,i-a)),ua(0),_t()),0);return{alignToBottom:n,paddingTopAddition:r}},Dt($n,B2),{singleton:!0}),Gp=lt(([{scrollTo:e,scrollContainerState:t}])=>{const n=tt(),r=tt(),i=tt(),a=fe(!1),o=fe(void 0);return _e(ue(sn(n,r),ve(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),_e(ue(e,Ge(r),ve(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),i),{useWindowScroll:a,customScrollParent:o,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:i}},Dt($n)),c7=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:i,align:a,...o}})=>e<n?{...o,behavior:i,align:a??"start"}:t>r?{...o,behavior:i,align:a??"end"}:null,d7=lt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:i,headerHeight:a,fixedHeaderHeight:o,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=tt();return _e(ue(c,Ge(e,i,t,a,o,s,r),Ge(n),ve(([[d,h,f,g,p,m,b,v],x])=>{const{done:C,behavior:E,align:w,calculateViewLocation:B=c7,...y}=d,S=w2(d,h,g-1),D=Nl(S,h.offsetTree,x)+p+m,A=D+Nr(h.sizeTree,S)[1],T=v+m,F=v+f-b,k=B({itemTop:D,itemBottom:A,viewportTop:T,viewportBottom:F,locationParams:{behavior:E,align:w,...y}});return k?C&&fi(ue(l,Ne(P=>P===!1),vs(xn(l)?1:2)),C):C&&C(),k}),Ne(d=>d!==null)),u),{scrollIntoView:c}},Dt(mi,$n,yu,Io,Ra),{singleton:!0}),f7=lt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:i},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:s}])=>{const l=tt(),u=fe(void 0),c=fe(null),d=fe(null);return _e(o,c),_e(s,d),mt(ue(l,Ge(e,n,a,c,d)),([h,f,g,p,m,b])=>{const v=X8(f.sizeTree);p&&m!==null&&b!==null&&(g=m.scrollTop-b.offsetTop),h({ranges:v,scrollTop:g})}),_e(ue(u,Ne(Np),ve(h7)),r),_e(ue(i,Ge(u),Ne(([,h])=>h!==void 0),_t(),ve(([,h])=>h.ranges)),t),{getState:l,restoreStateFrom:u}},Dt(mi,$n,Cu,Ba,Gp));function h7(e){return{offset:e.scrollTop,index:0,align:"start"}}const g7=lt(([e,t,n,r,i,a,o,s,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...l,...u}),Dt(zp,i7,Ba,R2,B2,l7,u7,Gp,d7,Ra)),k2=lt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:i,itemSize:a,data:o,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:d},{initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g},p,m,b,{listState:v,topItemsIndexes:x,...C},{scrollToIndex:E},w,{topItemCount:B},{groupCounts:y},S])=>(_e(C.rangeChanged,S.scrollSeekRangeChanged),_e(ue(S.windowViewportRect,ve(D=>D.visibleHeight)),p.viewportHeight),{totalCount:e,data:o,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:g,topItemsIndexes:x,topItemCount:B,groupCounts:y,fixedItemHeight:n,defaultItemHeight:r,gap:c,...b,statefulTotalCount:u,listState:v,scrollToIndex:E,trackItemSizes:i,itemSize:a,groupIndices:l,...C,...S,...p,sizes:d,...m}),Dt(mi,Cu,$n,f7,t7,Io,yu,s7,a7,D2,g7)),mh="-webkit-sticky",Rb="sticky",P2=$2(()=>{if(typeof document>"u")return Rb;const e=document.createElement("div");return e.style.position=mh,e.style.position===mh?mh:Rb});function Up(e,t){const n=I.useRef(null),r=I.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,d;if(t){const h=t.getBoundingClientRect(),f=l.top-h.top;c=h.height-Math.max(0,f),d=f+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:i,ref:a}=Op(r),o=I.useCallback(()=>{r(a.current)},[r,a]);return I.useEffect(()=>{if(t){t.addEventListener("scroll",o);const s=new ResizeObserver(()=>{requestAnimationFrame(o)});return s.observe(t),()=>{t.removeEventListener("scroll",o),s.unobserve(t)}}else return window.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[o,t]),i}const Sf=I.createContext(void 0),F2=I.createContext(void 0);function Xp(e){return e}const p7=lt(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),i=fe(Xp),a=fe("div"),o=fe(wo),s=(l,u=null)=>Cn(ue(r,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),m7=lt(([e,t])=>({...e,...t}),Dt(k2,p7)),b7=({height:e})=>I.createElement("div",{style:{height:e}}),v7={position:P2(),zIndex:1,overflowAnchor:"none"},y7={overflowAnchor:"none"},Bb=I.memo(function({showTopList:t=!1}){const n=Ke("listState"),r=xr("sizeRanges"),i=Ke("useWindowScroll"),a=Ke("customScrollParent"),o=xr("windowScrollContainerState"),s=xr("scrollContainerState"),l=a||i?o:s,u=Ke("itemContent"),c=Ke("context"),d=Ke("groupContent"),h=Ke("trackItemSizes"),f=Ke("itemSize"),g=Ke("log"),p=xr("gap"),{callbackRef:m}=p2(r,f,h,t?wo:l,g,p,a),[b,v]=I.useState(0);Kp("deviation",k=>{b!==k&&v(k)});const x=Ke("EmptyPlaceholder"),C=Ke("ScrollSeekPlaceholder")||b7,E=Ke("ListComponent"),w=Ke("ItemComponent"),B=Ke("GroupComponent"),y=Ke("computeItemKey"),S=Ke("isSeeking"),D=Ke("groupIndices").length>0,A=Ke("alignToBottom"),T=Ke("initialItemFinalLocationReached"),F=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:b!==0?b:A?"auto":0,...T?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&x?I.createElement(x,Nt(x,c)):I.createElement(E,{...Nt(E,c),ref:m,style:F,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const P=k.originalIndex,$=y(P+n.firstItemIndex,k.data,c);return S?I.createElement(C,{...Nt(C,c),key:$,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?I.createElement(B,{...Nt(B,c),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,style:v7},d(k.index,c)):I.createElement(w,{...Nt(w,c),...N2(w,k.data),key:$,"data-index":P,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,style:y7},D?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),x7={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ks=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),C7={width:"100%",position:P2(),top:0,zIndex:1};function Nt(e,t){if(typeof e!="string")return{context:t}}function N2(e,t){return{item:typeof e=="string"?void 0:t}}const E7=I.memo(function(){const t=Ke("HeaderComponent"),n=xr("headerHeight"),r=Ke("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Nt(t,a))):null}),S7=I.memo(function(){const t=Ke("FooterComponent"),n=xr("footerHeight"),r=Ke("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=Ke("context");return t?I.createElement(r,{ref:i},I.createElement(t,Nt(t,a))):null});function Zp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("scrollerRef"),h=n("context"),{scrollerRef:f,scrollByCallback:g,scrollToCallback:p}=b2(l,c,u,d);return t("scrollTo",p),t("scrollBy",g),I.createElement(u,{ref:f,style:{...x7,...a},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...Nt(u,h)},o)})}function Yp({usePublisher:e,useEmitter:t,useEmitterValue:n}){return I.memo(function({style:a,children:o,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),d=n("totalListHeight"),h=n("deviation"),f=n("customScrollParent"),g=n("context"),{scrollerRef:p,scrollByCallback:m,scrollToCallback:b}=b2(l,c,u,wo,f);return $8(()=>(p.current=f||window,()=>{p.current=null}),[p,f]),t("windowScrollTo",b),t("scrollBy",m),I.createElement(u,{style:{position:"relative",...a,...d!==0?{height:d+h}:{}},"data-virtuoso-scroller":!0,...s,...Nt(u,g)},o)})}const w7=({children:e})=>{const t=I.useContext(Sf),n=xr("viewportHeight"),r=xr("fixedItemHeight"),i=Ke("alignToBottom"),a=hi(kl(n,o=>Fr(o,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:ks(i),ref:a,"data-viewport-type":"element"},e)},I7=({children:e})=>{const t=I.useContext(Sf),n=xr("windowViewportRect"),r=xr("fixedItemHeight"),i=Ke("customScrollParent"),a=Up(n,i),o=Ke("alignToBottom");return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:ks(o),"data-viewport-type":"window"},e)},_7=({children:e})=>{const t=Ke("TopItemListComponent")||"div",n=Ke("headerHeight"),r={...C7,marginTop:`${n}px`},i=Ke("context");return I.createElement(t,{style:r,...Nt(t,i)},e)},D7=I.memo(function(t){const n=Ke("useWindowScroll"),r=Ke("topItemsIndexes").length>0,i=Ke("customScrollParent"),a=i||n?R7:T7,o=i||n?I7:w7;return I.createElement(a,{...t},r&&I.createElement(_7,null,I.createElement(Bb,{showTopList:!0})),I.createElement(o,null,I.createElement(E7,null),I.createElement(Bb,null),I.createElement(S7,null)))}),{Component:A7,usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}=Lp(m7,{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"},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"}},D7),T7=Zp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),R7=Yp({usePublisher:xr,useEmitterValue:Ke,useEmitter:Kp}),B7=A7,$b={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},$7={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:kb,ceil:Pb,floor:Sd,min:bh,max:bl}=Math;function k7(e){return{...$7,items:e}}function Fb(e,t,n){return Array.from({length:t-e+1}).map((r,i)=>{const a=n===null?null:n[i+e];return{index:i+e,data:a}})}function P7(e,t){return e&&e.column===t.column&&e.row===t.row}function Uu(e,t){return e&&e.width===t.width&&e.height===t.height}const F7=lt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:i,scrollBy:a,scrollTo:o,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},d,h,{propsReady:f,didMount:g},{windowViewportRect:p,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,windowScrollTo:x},C])=>{const E=fe(0),w=fe(0),B=fe($b),y=fe({height:0,width:0}),S=fe({height:0,width:0}),D=tt(),A=tt(),T=fe(0),F=fe(null),k=fe({row:0,column:0}),P=tt(),$=tt(),R=fe(!1),O=fe(0),j=fe(!0),V=fe(!1);mt(ue(g,Ge(O),Ne(([H,X])=>!!X)),()=>{We(j,!1),We(w,0)}),mt(ue(sn(g,j,S,y,O,V),Ne(([H,X,te,ie,,le])=>H&&!X&&te.height!==0&&ie.height!==0&&!le)),([,,,,H])=>{We(V,!0),jp(1,()=>{We(D,H)}),fi(ue(r),()=>{We(n,[0,0]),We(j,!0)})}),_e(ue($,Ne(H=>H!=null&&H.scrollTop>0),Jr(0)),w),mt(ue(g,Ge($),Ne(([,H])=>H!=null)),([,H])=>{H&&(We(y,H.viewport),We(S,H==null?void 0:H.item),We(k,H.gap),H.scrollTop>0&&(We(R,!0),fi(ue(r,vs(1)),X=>{We(R,!1)}),We(o,{top:H.scrollTop})))}),_e(ue(y,ve(({height:H})=>H)),i),_e(ue(sn(Le(y,Uu),Le(S,Uu),Le(k,(H,X)=>H&&H.column===X.column&&H.row===X.row),Le(r)),ve(([H,X,te,ie])=>({viewport:H,item:X,gap:te,scrollTop:ie}))),P),_e(ue(sn(Le(E),t,Le(k,P7),Le(S,Uu),Le(y,Uu),Le(F),Le(w),Le(R),Le(j),Le(O)),Ne(([,,,,,,,H])=>!H),ve(([H,[X,te],ie,le,ce,Q,be,,Ce,Se])=>{const{row:un,column:ye}=ie,{height:Ee,width:He}=le,{width:bt}=ce;if(be===0&&(H===0||bt===0))return $b;if(He===0){const Gf=Wp(Se,H),vI=Gf===0?Math.max(be-1,0):Gf;return k7(Fb(Gf,vI,Q))}const Kt=M2(bt,He,ye);let at,Qe;Ce?X===0&&te===0&&be>0?(at=0,Qe=be-1):(at=Kt*Sd((X+un)/(Ee+un)),Qe=Kt*Pb((te+un)/(Ee+un))-1,Qe=bh(H-1,bl(Qe,Kt-1)),at=bh(Qe,bl(0,at))):(at=0,Qe=-1);const or=Fb(at,Qe,Q),{top:wr,bottom:Ir}=Nb(ce,ie,le,or),Ro=Pb(H/Kt),bI=Ro*Ee+(Ro-1)*un-Ir;return{items:or,offsetTop:wr,offsetBottom:bI,top:wr,bottom:Ir,itemHeight:Ee,itemWidth:He}})),B),_e(ue(F,Ne(H=>H!==null),ve(H=>H.length)),E),_e(ue(sn(y,S,B,k),Ne(([H,X,{items:te}])=>te.length>0&&X.height!==0&&H.height!==0),ve(([H,X,{items:te},ie])=>{const{top:le,bottom:ce}=Nb(H,ie,X,te);return[le,ce]}),_t(Ll)),n);const W=fe(!1);_e(ue(r,Ge(W),ve(([H,X])=>X||H!==0)),W);const U=tr(ue(Le(B),Ne(({items:H})=>H.length>0),Ge(E,W),Ne(([{items:H},X,te])=>te&&H[H.length-1].index===X-1),ve(([,H])=>H-1),_t())),K=tr(ue(Le(B),Ne(({items:H})=>H.length>0&&H[0].index===0),Jr(0),_t())),ee=tr(ue(Le(B),Ge(R),Ne(([{items:H},X])=>H.length>0&&!X),ve(([{items:H}])=>({startIndex:H[0].index,endIndex:H[H.length-1].index})),_t(A2),ua(0)));_e(ee,h.scrollSeekRangeChanged),_e(ue(D,Ge(y,S,E,k),ve(([H,X,te,ie,le])=>{const ce=_2(H),{align:Q,behavior:be,offset:Ce}=ce;let Se=ce.index;Se==="LAST"&&(Se=ie-1),Se=bl(0,Se,bh(ie-1,Se));let un=ag(X,le,te,Se);return Q==="end"?un=kb(un-X.height+te.height):Q==="center"&&(un=kb(un-X.height/2+te.height/2)),Ce&&(un+=Ce),{top:un,behavior:be}})),o);const z=Cn(ue(B,ve(H=>H.offsetBottom+H.bottom)),0);return _e(ue(p,ve(H=>({width:H.visibleWidth,height:H.visibleHeight}))),y),{data:F,totalCount:E,viewportDimensions:y,itemDimensions:S,scrollTop:r,scrollHeight:A,overscan:e,scrollBy:a,scrollTo:o,scrollToIndex:D,smoothScrollTargetReached:s,windowViewportRect:p,windowScrollTo:x,useWindowScroll:m,customScrollParent:b,windowScrollContainerState:v,deviation:T,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:w,gap:k,restoreStateFrom:$,...h,initialTopMostItemIndex:O,gridState:B,totalListHeight:z,...d,startReached:K,endReached:U,rangeChanged:ee,stateChanged:P,propsReady:f,stateRestoreInProgress:R,...C}},Dt(zp,$n,xu,R2,Ba,Gp,Ra));function Nb(e,t,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{top:0,bottom:0};const a=ag(e,t,n,r[0].index),o=ag(e,t,n,r[r.length-1].index)+i;return{top:a,bottom:o}}function ag(e,t,n,r){const i=M2(e.width,n.width,t.column),a=Sd(r/i),o=a*n.height+bl(0,a-1)*t.row;return o>0?o+t.row:o}function M2(e,t,n){return bl(1,Sd((e+n)/(Sd(t)+n)))}const N7=lt(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),i=fe("virtuoso-grid-list"),a=fe(Xp),o=fe("div"),s=fe(wo),l=(u,c=null)=>Cn(ue(t,ve(d=>d[u]),_t()),c);return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,headerFooterTag:o,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),M7=lt(([e,t])=>({...e,...t}),Dt(F7,N7)),L7=I.memo(function(){const t=$t("gridState"),n=$t("listClassName"),r=$t("itemClassName"),i=$t("itemContent"),a=$t("computeItemKey"),o=$t("isSeeking"),s=kr("scrollHeight"),l=$t("ItemComponent"),u=$t("ListComponent"),c=$t("ScrollSeekPlaceholder"),d=$t("context"),h=kr("itemDimensions"),f=kr("gap"),g=$t("log"),p=$t("stateRestoreInProgress"),m=hi(b=>{const v=b.parentElement.parentElement.scrollHeight;s(v);const x=b.firstChild;if(x){const{width:C,height:E}=x.getBoundingClientRect();h({width:C,height:E})}f({row:Mb("row-gap",getComputedStyle(b).rowGap,g),column:Mb("column-gap",getComputedStyle(b).columnGap,g)})});return p?null:I.createElement(u,{ref:m,className:n,...Nt(u,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(b=>{const v=a(b.index,b.data,d);return o?I.createElement(c,{key:v,...Nt(c,d),index:b.index,height:t.itemHeight,width:t.itemWidth}):I.createElement(l,{...Nt(l,d),className:r,"data-index":b.index,key:v},i(b.index,b.data,d))}))}),O7=I.memo(function(){const t=$t("HeaderComponent"),n=kr("headerHeight"),r=$t("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=$t("context");return t?I.createElement(r,{ref:i},I.createElement(t,Nt(t,a))):null}),V7=I.memo(function(){const t=$t("FooterComponent"),n=kr("footerHeight"),r=$t("headerFooterTag"),i=hi(o=>n(Fr(o,"height"))),a=$t("context");return t?I.createElement(r,{ref:i},I.createElement(t,Nt(t,a))):null}),H7=({children:e})=>{const t=I.useContext(F2),n=kr("itemDimensions"),r=kr("viewportDimensions"),i=hi(a=>{r(a.getBoundingClientRect())});return I.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),I.createElement("div",{style:ks(!1),ref:i},e)},j7=({children:e})=>{const t=I.useContext(F2),n=kr("windowViewportRect"),r=kr("itemDimensions"),i=$t("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),I.createElement("div",{ref:a,style:ks(!1)},e)},W7=I.memo(function({...t}){const n=$t("useWindowScroll"),r=$t("customScrollParent"),i=r||n?G7:z7,a=r||n?j7:H7;return I.createElement(i,{...t},I.createElement(a,null,I.createElement(O7,null),I.createElement(L7,null),I.createElement(V7,null)))}),{usePublisher:kr,useEmitterValue:$t,useEmitter:L2}=Lp(M7,{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"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},W7),z7=Zp({usePublisher:kr,useEmitterValue:$t,useEmitter:L2}),G7=Yp({usePublisher:kr,useEmitterValue:$t,useEmitter:L2});function Mb(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,nr.WARN),t==="normal"?0:parseInt(t??"0",10)}const U7=lt(()=>{const e=fe(l=>I.createElement("td",null,"Item $",l)),t=fe(null),n=fe(null),r=fe(null),i=fe({}),a=fe(Xp),o=fe(wo),s=(l,u=null)=>Cn(ue(i,ve(c=>c[l]),_t()),u);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s("Table","table"),TableHeadComponent:s("TableHead","thead"),TableFooterComponent:s("TableFoot","tfoot"),TableBodyComponent:s("TableBody","tbody"),TableRowComponent:s("TableRow","tr"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),FillerRow:s("FillerRow")}}),X7=lt(([e,t])=>({...e,...t}),Dt(k2,U7)),Z7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e}})),Y7=({height:e})=>I.createElement("tr",null,I.createElement("td",{style:{height:e,padding:0,border:0}})),K7={overflowAnchor:"none"},J7=I.memo(function(){const t=ht("listState"),n=Pr("sizeRanges"),r=ht("useWindowScroll"),i=ht("customScrollParent"),a=Pr("windowScrollContainerState"),o=Pr("scrollContainerState"),s=i||r?a:o,l=ht("itemContent"),u=ht("trackItemSizes"),c=ht("itemSize"),d=ht("log"),{callbackRef:h,ref:f}=p2(n,c,u,s,d,void 0,i),[g,p]=I.useState(0);Jp("deviation",$=>{g!==$&&(f.current.style.marginTop=`${$}px`,p($))});const m=ht("EmptyPlaceholder"),b=ht("ScrollSeekPlaceholder")||Z7,v=ht("FillerRow")||Y7,x=ht("TableBodyComponent"),C=ht("TableRowComponent"),E=ht("computeItemKey"),w=ht("isSeeking"),B=ht("paddingTopAddition"),y=ht("firstItemIndex"),S=ht("statefulTotalCount"),D=ht("context");if(S===0&&m)return I.createElement(m,Nt(m,D));const A=t.offsetTop+B+g,T=t.offsetBottom,F=A>0?I.createElement(v,{height:A,key:"padding-top",context:D}):null,k=T>0?I.createElement(v,{height:T,key:"padding-bottom",context:D}):null,P=t.items.map($=>{const R=$.originalIndex,O=E(R+y,$.data,D);return w?I.createElement(b,{...Nt(b,D),key:O,index:$.index,height:$.size,type:$.type||"item"}):I.createElement(C,{...Nt(C,D),...N2(C,$.data),key:O,"data-index":R,"data-known-size":$.size,"data-item-index":$.index,style:K7},l($.index,$.data,D))});return I.createElement(x,{ref:h,"data-testid":"virtuoso-item-list",...Nt(x,D)},[F,...P,k])}),q7=({children:e})=>{const t=I.useContext(Sf),n=Pr("viewportHeight"),r=Pr("fixedItemHeight"),i=hi(kl(n,a=>Fr(a,"height")));return I.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),I.createElement("div",{style:ks(!1),ref:i,"data-viewport-type":"element"},e)},Q7=({children:e})=>{const t=I.useContext(Sf),n=Pr("windowViewportRect"),r=Pr("fixedItemHeight"),i=ht("customScrollParent"),a=Up(n,i);return I.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),I.createElement("div",{ref:a,style:ks(!1),"data-viewport-type":"window"},e)},eP=I.memo(function(t){const n=ht("useWindowScroll"),r=ht("customScrollParent"),i=Pr("fixedHeaderHeight"),a=Pr("fixedFooterHeight"),o=ht("fixedHeaderContent"),s=ht("fixedFooterContent"),l=ht("context"),u=hi(kl(i,v=>Fr(v,"height"))),c=hi(kl(a,v=>Fr(v,"height"))),d=r||n?rP:nP,h=r||n?Q7:q7,f=ht("TableComponent"),g=ht("TableHeadComponent"),p=ht("TableFooterComponent"),m=o?I.createElement(g,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:u,...Nt(g,l)},o()):null,b=s?I.createElement(p,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:c,...Nt(p,l)},s()):null;return I.createElement(d,{...t},I.createElement(h,null,I.createElement(f,{style:{borderSpacing:0,overflowAnchor:"none"},...Nt(f,l)},[m,I.createElement(J7,{key:"TableBody"}),b])))}),{Component:tP,usePublisher:Pr,useEmitterValue:ht,useEmitter:Jp}=Lp(X7,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",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"}},eP),nP=Zp({usePublisher:Pr,useEmitterValue:ht,useEmitter:Jp}),rP=Yp({usePublisher:Pr,useEmitterValue:ht,useEmitter:Jp}),iP=tP,aP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),oP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),qp=I.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:d,typeCalculateItemSize:h="manual",itemSizeNames:f=[],overscan:g=null,component:p={},idContainer:m="",triggerCalCulateContainer:b="",accumulationHeight:v=0,delayTriggerCalculateHeight:x=0,increaseViewportBy:C=()=>0,context:E={},endReached:w,increaseTotalCount:B=1}=e,[y,S]=I.useState(0),D=()=>{if(o==="min-max"){const F=(a+B)*s;return{height:a>u?l:y>F?y:F}}return o==="container"?{height:y}:{}},A=F=>{var $;const k=F.getAttribute("data-index");let P=(($=F.getBoundingClientRect())==null?void 0:$.height)||0;return f==null||f.forEach(R=>{var O,j;P+=((j=(O=document.querySelector(`[${R}="${k}"]`))==null?void 0:O.getBoundingClientRect())==null?void 0:j.height)??0}),P},T=()=>{var F;if(m&&o==="container"){const k=((F=document==null?void 0:document.getElementById(m))==null?void 0:F.offsetHeight)??0;S(k-v)}};return I.useEffect(()=>{const F=setTimeout(T,x);return window==null||window.addEventListener("resize",T),window==null||window.addEventListener("load",T),()=>{clearTimeout(F),window==null||window.removeEventListener("resize",T),window==null||window.removeEventListener("load",T)}},[o,b]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(iP,{context:E,ref:t,overscan:typeof g=="function"?g(o==="container"?y:l):o==="container"?y:l,totalListHeightChanged:F=>o==="min-max"?S(F):null,style:D(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(F=>h==="manual"?i(F):A(F),[]),components:{TableRow:oP,...p},fixedHeaderContent:c,itemContent:(...F)=>d(aP,...F),endReached:w,increaseViewportBy:C(o==="container"?y:l)})})});qp.displayName="TableVirtualization";const sP="_sorting_1a30n_536",tn={"payhere-reguler":"_payhere-reguler_1a30n_109","laba-reguler":"_laba-reguler_1a30n_259","laba-rounded-md-extra-small":"_laba-rounded-md-extra-small_1a30n_259","laba-small_body-small":"_laba-small_body-small_1a30n_295","laba-small":"_laba-small_1a30n_295","bill-reguler":"_bill-reguler_1a30n_421","pointer-laba":"_pointer-laba_1a30n_489","pointer-payhere":"_pointer-payhere_1a30n_494","pointer-bill":"_pointer-bill_1a30n_499","resize-menu":"_resize-menu_1a30n_504",sorting:sP,"laba-grey-02":"_laba-grey-02_1a30n_557","laba-blue-01_border-transparent":"_laba-blue-01_border-transparent_1a30n_566"};function lP(e,t=null){const[n,r]=I.useState(!1);return I.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 vh=e=>{const t=e.getTime()-Date.now();return Math.max(Math.floor(t/1e3),0)},uP=e=>{const t=I.useMemo(()=>{const f=new Date(e.date);return e.adjustTimesTime&&f.setHours(f.getHours()-e.adjustTimesTime),f},[e.date,e.adjustTimesTime]),[n,r]=I.useState(t),[i,a]=I.useState(()=>vh(n)),[o,s]=I.useState(e.running??!1),[l,u]=I.useState(()=>e==null?void 0:e.callbackDone);return I.useEffect(()=>{let f;return o&&i>0&&(f=setInterval(()=>{const g=vh(n);a(g),g<=0&&(s(!1),f&&clearInterval(f),typeof l=="function"&&l())},e.intervalMs)),()=>{f&&clearInterval(f)}},[o,n,e.intervalMs,l,i]),{count:i,isRunning:o,startCountdown:()=>{!o&&i>0&&s(!0)},stopCountdown:()=>{s(!1)},resetCountdown:f=>{let g;f instanceof Date?g=f:typeof f=="number"?g=new Date(Date.now()+f*1e3):g=t,r(g);const p=vh(g);p<=0?s(!1):s(!0),a(p)},setCallbackDone:f=>u(()=>f)}};function O2(e,t=0){const n=I.useRef({promise:null,resolve:null,reject:null,timeout:null});return I.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 wf=typeof window<"u"?I.useLayoutEffect:I.useEffect,cP=(e,t)=>{const[n,r]=I.useState({width:0,height:0}),[i,a]=I.useState({width:0,height:0,top:0,left:0,bottom:0,right:0,x:0,y:0}),o=I.useRef(null);return wf(()=>{const s=()=>{r({width:window.innerWidth,height:window.innerHeight})},l=d=>{for(const h of d){const{width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C}=h.contentRect;a({width:f,height:g,top:p,left:m,bottom:b,right:v,x,y:C})}};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 dP(e){const[t,n]=I.useState(e),r=I.useRef(t);return I.useEffect(()=>{r.current=t},[t]),[t,n,r]}function fP(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 hP(...e){return t=>{e.forEach(n=>{fP(n,t)})}}function If(...e){return I.useMemo(()=>hP(...e),e)}function Ol(e){const t=I.useRef(e);return vp(e,t.current)||(t.current=e),t.current}function ba(e,t){const n=t.map(Ol);I.useEffect(e,n)}function gP({ref:e,handlerMain:t,eventListener:n="mousedown",useEffectDependency:r=[]}){I.useEffect(()=>{function i(a){t(e,a)}return document.addEventListener(n,i),()=>{document.removeEventListener(n,i)}},[e,t,n,...r])}const pP=({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=I.useCallback(()=>{const d=e.current;if(!d)return;const h=Array.from(d.children);if(h.length===0){d.style.height="0px";return}const f=Array(n).fill(0),g=d.offsetWidth;if(g===0)return;const p=(g-(n-1)*r)/n,m=a.includes("rtl"),b=a.includes("top-down");h.forEach((x,C)=>{x.style.width=`${p}px`,x.style.position="absolute",l&&(x.style.transition=`top ${s}ms ease, left ${s}ms ease`);let E;if(b)E=C%n;else{const y=Math.min(...f);E=f.indexOf(y)}const w=f[E];let B;m?B=g-(p*(E+1)+r*E):B=E*(p+r),x.style.top=`${w}px`,x.style.left=`${B}px`,f[E]+=x.offsetHeight+i});const v=Math.max(...f);d.style.height=`${v-i}px`},[e,n,r,a,i]),c=O2(async()=>{u()},o);return I.useLayoutEffect(()=>{u()},[t,u]),I.useEffect(()=>(window.addEventListener("load",u),window.addEventListener("resize",c),()=>{window.removeEventListener("load",u),window.removeEventListener("resize",c)}),[t,c,u]),{recalculateLayout:u}},mP=({id:e,numInputs:t,onComplete:n,disableFocusOnEdit:r=!1,blurOnComplete:i=!1,disableOnComplete:a=!1})=>{const[o,s]=I.useState(()=>Array(t).fill("")),l=I.useRef([]),[u]=I.useState(()=>`otp-${Math.random().toString(36).slice(2,9)}`),c=e||u;I.useEffect(()=>{l.current=l.current.slice(0,t)},[t]);const d=I.useCallback((v,x)=>{var D,A;const C=v.target.value,E=C.length>1?C.slice(-1):C,w=o[x]!=="",B=[...o];B[x]=E,s(B);const y=B.join(""),S=!B.slice(0,t).includes("");E!==""&&x<t-1&&(r&&w&&S||(D=l.current[x+1])==null||D.focus()),S&&(typeof n=="function"&&n(y),i&&((A=l.current[x])==null||A.blur()))},[o,t,n,r,i]),h=I.useCallback((v,x)=>{var C,E,w,B,y;switch(v.key){case"Backspace":if(o[x]===""&&x>0){v.preventDefault();const S=[...o];S[x-1]="",s(S),(C=l.current[x-1])==null||C.focus()}break;case"ArrowLeft":x>0&&(v.preventDefault(),(E=l.current[x-1])==null||E.focus());break;case"ArrowRight":x<t-1&&(v.preventDefault(),(w=l.current[x+1])==null||w.focus());break;case"Home":v.preventDefault(),(B=l.current[0])==null||B.focus();break;case"End":v.preventDefault(),(y=l.current[t-1])==null||y.focus();break}},[o,t]),f=I.useCallback((v,x)=>{var D,A;v.preventDefault();const C=v.clipboardData.getData("text").trim();if(!C)return;const E=[...o];let w=x;for(const T of C){if(w>=t)break;E[w]=T,w++}s(E);const B=E.join(""),y=!E.includes(""),S=Math.min(w,t-1);(D=l.current[S])==null||D.focus(),y&&(typeof n=="function"&&n(B),i&&((A=l.current[S])==null||A.blur()))},[o,t,n,i]),g=v=>{v.target.select()},p=()=>{var v;s(Array(t).fill("")),(v=l.current[0])==null||v.focus()},m=v=>{if(v<0||v>=t)throw new Error(`useOtpInput: index ${v} is out of bounds for numInputs ${t}.`);const x=o.join("").length===t;return{id:`${c}-${v}`,"aria-label":`OTP digit ${v+1} of ${t}`,ref:C=>{l.current[v]=C},value:o[v],onChange:C=>d(C,v),onKeyDown:C=>h(C,v),onPaste:C=>f(C,v),onFocus:g,disabled:a&&x,type:"text",inputMode:"numeric",autoComplete:"one-time-code"}};return{getInputProps:m,getInputData:v=>({...qC(m(v),["onChange","onKeyDown","onPaste","onFocus","aria-label","autoComplete"]),isOtpFilled:o[v]!==""}),otpValues:o,otpString:o.join(""),clearOtp:p,isOtpComplete:o.join("").length===t}},Fo={"sub-mobile-payhere-reguler":"_sub-mobile-payhere-reguler_elvgc_115"},lr="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",cn=()=>({kind:{"payhere-reguler":tn["payhere-reguler"],"laba-reguler":tn["laba-reguler"],"laba-small":tn["laba-small"],"laba-rounded-md-extra-small":tn["laba-rounded-md-extra-small"],"laba-small_body-small":tn["laba-small_body-small"],"bill-reguler":tn["bill-reguler"]},subMobile:{"payhere-reguler":Fo["sub-mobile-payhere-reguler"],"laba-reguler":Fo["sub-mobile-laba-reguler"],"laba-small":Fo["sub-mobile-laba-small"],"laba-rounded-md-extra-small":Fo["sub-mobile-laba-rounded-md-extra-small"],"laba-small_body-small":Fo["sub-mobile-laba-small_body-small"],"bill-reguler":Fo["sub-mobile-bill-reguler"]},pointer:{"payhere-reguler":tn["pointer-payhere"],"laba-reguler":tn["pointer-laba"],"laba-small":tn["pointer-laba"],"laba-rounded-md-extra-small":tn["pointer-laba"],"laba-small_body-small":tn["pointer-laba"],"bill-reguler":tn["pointer-bill"]},utility:{"table-scroll-top":""},sortingIcon:{"payhere-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"bill-reguler":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-rounded-md-extra-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})},"laba-small_body-small":{asc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4"}),desc:_.jsx("img",{src:lr,className:"1ru-w-4 1ru-h-4 1ru-rotate-180"})}},variant:{"laba-grey-02":tn["laba-grey-02"],"laba-blue-01_border-transparent":tn["laba-blue-01_border-transparent"]}});Object.keys(cn().kind);Object.keys(cn().variant);const bP=(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},wd=(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":""}:{}},V2=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}},vP=({tableInstance:e,classNameWrapperTable:t,classNameTable:n,handlerRowClick:r,privillageRowClick:i,headerId:a,tbodyTrId:o,theadTrId:s,maxHeight:l,idCalculateHeight:u,componentSortASC:c,componentSortDESC:d,classNamePointer:h,emptyPlaceholder:f,renderSubComponent:g,visibilityColumns:p,classNameSubMobile:m})=>_.jsx("div",{id:"1ru-table",style:l?{height:l,overflow:"auto"}:{},className:t??"",children:_.jsxs("table",{className:n,style:{width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},children:[_.jsx("thead",{id:a,"data-calculate-height-header":u,children:e.getHeaderGroups().map(b=>_.jsx("tr",{children:b.headers.map(v=>{var C,E,w,B;const x=(E=(C=v.column.columnDef.meta)==null?void 0:C.rowSpan)==null?void 0:E.call(C,v);return!v.isPlaceholder&&x!==void 0&&v.id===v.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{style:{...bP(l,v),...wd(v.column),...p.columns.includes(v.column.id)?{display:"none"}:{}},id:`${s(v)}-${v.id}`,colSpan:typeof((w=v.column.columnDef.meta)==null?void 0:w.colSpan)=="function"?(B=v.column.columnDef.meta)==null?void 0:B.colSpan(v.column.columnDef):v.colSpan,rowSpan:x,children:[v.isPlaceholder&&x===void 0?null:_.jsxs("div",{className:v.column.getCanSort()?tn.sorting:"",onClick:v.column.getToggleSortingHandler(),id:v.column.getCanSort()?`${s(v)}-${v.id}-sort`:"",children:[bs(v.column.columnDef.header,v.getContext()),v.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:v.column.getIsSorted()==="asc"||v.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[v.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:c}),v.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:d})]}):_.jsx(_.Fragment,{})})]}),v.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>v.column.resetSize(),onMouseDown:v.getResizeHandler(),onTouchStart:v.getResizeHandler(),className:tn["resize-menu"]})]},v.id)})},b.id))}),_.jsxs("tbody",{children:[e.getRowModel().rows.length>0&&e.getRowModel().rows.map((b,v)=>{var x;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{onClick:C=>{C.stopPropagation(),i&&typeof r=="function"&&r(b.original,b)},className:i?h:"","data-calculate-height":`${u}-${v}`,id:o(b),children:b.getVisibleCells().map(C=>{var E,w,B;return _.jsx("td",{style:{...typeof((E=C.column.columnDef.meta)==null?void 0:E.styleTd)=="function"?C.column.columnDef.meta.styleTd(b.original,b):{},...wd(C.column,!0),...p.columns.includes(C.column.id)?{display:"none"}:{}},className:typeof((w=C.column.columnDef.meta)==null?void 0:w.classNameTd)=="function"?(B=C.column.columnDef.meta)==null?void 0:B.classNameTd(b.original,b):"",id:`${o(b)}-${C.column.id}`,children:bs(C.column.columnDef.cell,C.getContext())},C.id)})},b.id),b.getIsExpanded()&&typeof g=="function"&&_.jsx("tr",{children:_.jsx("td",{colSpan:b.getVisibleCells().length-(((x=p==null?void 0:p.realColumns)==null?void 0:x.length)||0),children:g(b.original,b,{visibilityColumns:p,classNameSubMobile:m})})})]},b.id)}),e.getRowModel().rows.length===0&&I.isValidElement(f)&&_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:f})})]})]})}),H2=I.forwardRef((e,t)=>{const{context:n,...r}=e;return _.jsx("thead",{id:(n==null?void 0:n.headerId)??"",...r,ref:t})});H2.displayName="VirtualizationHead";const yP=({style:e,context:t,...n})=>_.jsx("table",{...n,id:"1ru-table",className:(t==null?void 0:t.classNameTable)??"",style:{...e,width:t==null?void 0:t.width}}),xP=({tableInstance:e,classNameWrapperTable:t,handlerRowClick:n,privillageRowClick:r,virtualizationProps:i,headerId:a,tbodyTrId:o,theadTrId:s,classNameTable:l,componentSortASC:u,componentSortDESC:c,classNamePointer:d,emptyPlaceholder:h,renderSubComponent:f,visibilityColumns:g,classNameSubMobile:p})=>{var v,x,C;const[m,b]=I.useState(0);return _.jsx(qp,{context:{headerId:a,classNameTable:l,width:V2(e.getState()).isPinning?e.getCenterTotalSize():""},typeHight:"min-max",totalCount:((v=e.getRowModel().rows)==null?void 0:v.length)||0,minLengthItem:((x=e.getRowModel().rows)==null?void 0:x.length)||0,typeCalculateItemSize:"auto",component:{TableHead:H2,Table:yP,EmptyPlaceholder:()=>_.jsx("tbody",{ref:E=>{var w;return b(((w=E==null?void 0:E.getBoundingClientRect())==null?void 0:w.height)??0)},children:_.jsx("tr",{children:_.jsx("td",{colSpan:e.getVisibleFlatColumns().length,children:I.isValidElement(h)&&h})})})},classNameContainer:t,fixedHeaderContent:()=>e.getHeaderGroups().map(E=>_.jsx("tr",{children:E.headers.map(w=>{var y,S,D,A;const B=(S=(y=w.column.columnDef.meta)==null?void 0:y.rowSpan)==null?void 0:S.call(y,w);return!w.isPlaceholder&&B!==void 0&&w.id===w.column.id?_.jsx(_.Fragment,{}):_.jsxs("th",{id:`${s(w)}-${w.id}`,colSpan:w.colSpan,rowSpan:B,style:{...typeof((D=w.column.columnDef.meta)==null?void 0:D.styleTh)=="function"?(A=w.column.columnDef.meta)==null?void 0:A.styleTh(w.column.columnDef):{},...wd(w.column),...g.columns.includes(w.column.id)?{display:"none"}:{}},children:[w.isPlaceholder&&B===void 0?null:_.jsxs("div",{className:w.column.getCanSort()?tn.sorting:"",onClick:w.column.getToggleSortingHandler(),id:w.column.getCanSort()?`${s(w)}-${w.id}-sort`:"",children:[bs(w.column.columnDef.header,w.getContext()),w.column.getCanSort()&&_.jsx("span",{className:"1ru-flex-shrink-0",children:w.column.getIsSorted()==="asc"||w.column.getIsSorted()==="desc"?_.jsxs(_.Fragment,{children:[w.column.getIsSorted()==="asc"&&_.jsx(_.Fragment,{children:u}),w.column.getIsSorted()==="desc"&&_.jsx(_.Fragment,{children:c})]}):_.jsx(_.Fragment,{})})]}),w.column.getIsPinned()&&_.jsx("div",{onDoubleClick:()=>w.column.resetSize(),onMouseDown:w.getResizeHandler(),onTouchStart:w.getResizeHandler(),className:tn["resize-menu"]})]},w.id)})},E.id)),itemContent:(E,w)=>{var y,S;const B=(S=(y=e.getRowModel())==null?void 0:y.rows)==null?void 0:S[w];return _.jsx(E,{children:({...D})=>{var A;return _.jsxs(I.Fragment,{children:[_.jsx("tr",{...D,onClick:T=>{T.stopPropagation(),r&&typeof n=="function"&&n(B.original,B)},className:r?d:"",id:o(B),children:B.getVisibleCells().map(T=>{var F,k,P;return _.jsx(_.Fragment,{children:_.jsx("td",{style:{...typeof((F=T.column.columnDef.meta)==null?void 0:F.styleTd)=="function"?T.column.columnDef.meta.styleTd(B.original,B):{},...wd(T.column,!0),...g.columns.includes(T.column.id)?{display:"none"}:{}},className:typeof((k=T.column.columnDef.meta)==null?void 0:k.classNameTd)=="function"?(P=T.column.columnDef.meta)==null?void 0:P.classNameTd(B.original,B):"",id:`${o(B)}-${T.column.id}`,children:bs(T.column.columnDef.cell,T.getContext())},T.id)})})}),B.getIsExpanded()&&typeof f=="function"&&_.jsx("tr",{"data-sub-component":w,children:_.jsx("td",{colSpan:B.getVisibleCells().length-(((A=g==null?void 0:g.realColumns)==null?void 0:A.length)||0),children:f(B.original,B,{visibilityColumns:g,classNameSubMobile:p})})})]},B.id)}},B.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 f=="function"?[...(i==null?void 0:i.itemSizeNames)??[],"data-sub-component"]:i==null?void 0:i.itemSizeNames})},CP=({tableInstance:e,classNameWrapperTable:t="",classNameTable:n="",collapseAll:r=!0,handlerRowClick:i,privillageRowClick:a=!1,virtualization:o=!1,virtualizationProps:s,headerId:l="",tbodyTrId:u=()=>"",theadTrId:c=()=>"",maxHeight:d=0,idCalculateHeight:h=void 0,kind:f="laba-reguler",componentSortASC:g,componentSortDESC:p,scrollTop:m=!1,emptyPlaceholder:b,variant:v,renderSubComponent:x,columnBreakpoints:C})=>{var A;const[E,w]=I.useState(0),[B,y]=I.useState({columns:[],realColumns:[]}),S=()=>{if(![void 0,"undefined"].includes(h)){const T=document.querySelector(`[data-calculate-height-header="${h}"]`);let F=0;const k=document.querySelectorAll(`[data-calculate-height^="${h}-"]`);return k==null||k.forEach(P=>{F+=P.offsetHeight}),F>d?d+T.offsetHeight:0}return d},D=()=>{var P;const T=((P=document.querySelector("body"))==null?void 0:P.offsetWidth)||0,F=C==null?void 0:C.sort(($,R)=>{const O=($.maxWidth??$.minWidth)||0,j=(R.maxWidth??R.minWidth)||0;return O!==j?O-j:$.maxWidth?-1:1}),k=(F==null?void 0:F.find($=>!!(Object.hasOwnProperty.call($,"maxWidth")&&T<=($.maxWidth||0)||Object.hasOwnProperty.call($,"minWidth")&&T>=($.minWidth||0))))||{};Object.keys(k).length>0?(y({columns:k.columns,realColumns:k.realColumns||k.columns}),k!=null&&k.resetExpanded&&e.resetExpanded()):y({columns:[],realColumns:[]})};return ba(()=>{!r&&typeof e.toggleAllRowsExpanded=="function"&&e.toggleAllRowsExpanded()},[r,e==null?void 0:e.toggleAllRowsExpanded]),ba(()=>{d>0&&w(S())},[(A=e==null?void 0:e.options)==null?void 0:A.data,d]),ba(()=>{if(Array.isArray(C)&&(C==null?void 0:C.length)>0)return D(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[C]),_.jsxs(_.Fragment,{children:[!o&&_.jsx(vP,{theadTrId:c,tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${cn().kind[f]} ${v?cn().variant[v]:""}
67
67
  ${m?cn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,maxHeight:E,idCalculateHeight:h,componentSortASC:I.isValidElement(g)?g:cn().sortingIcon[f].asc,componentSortDESC:I.isValidElement(p)?p:cn().sortingIcon[f].desc,classNamePointer:cn().pointer[f],emptyPlaceholder:b,renderSubComponent:x,visibilityColumns:B,classNameSubMobile:cn().subMobile[f]}),o&&_.jsx(xP,{theadTrId:c,tbodyTrId:u,headerId:l,tableInstance:e,classNameTable:n,classNameWrapperTable:`${cn().kind[f]} ${v?cn().variant[v]:""}
68
- ${m?cn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,virtualizationProps:s,componentSortASC:I.isValidElement(g)?g:cn().sortingIcon[f].asc,componentSortDESC:I.isValidElement(p)?p:cn().sortingIcon[f].desc,classNamePointer:cn().pointer[f],emptyPlaceholder:b,renderSubComponent:x,visibilityColumns:B,classNameSubMobile:cn().subMobile[f]})]})},EP=(e,t,{visibilityColumns:n,classNameSubMobile:r})=>_.jsx("table",{className:"-1ru-mx-6 -1ru-my-3 !1ru-w-[calc(100%+48px)]",children:_.jsx("tbody",{children:t.getVisibleCells().map((i,a)=>{var o,s,l,u,c,d;return _.jsx(_.Fragment,{children:n!=null&&n.columns.includes(i.column.id)?_.jsxs("tr",{className:r,children:[_.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:_.jsxs("div",{children:[typeof i.column.columnDef.header=="string"&&_.jsx(_.Fragment,{children:i.column.columnDef.header}),typeof i.column.columnDef.header!="string"&&((l=i.column.columnDef.meta)==null?void 0:l.labelCellSubs)&&_.jsx(_.Fragment,{children:(u=i.column.columnDef.meta)==null?void 0:u.labelCellSubs(t.original,t)})]})}),_.jsx("td",{"data-section":"right",style:{...typeof((c=i.column.columnDef.meta)==null?void 0:c.styleTdRightCellSubs)=="function"?(d=i.column.columnDef.meta)==null?void 0:d.styleTdRightCellSubs(t.original,t):{}},children:_.jsxs("div",{children:[_.jsx("div",{className:"1ru-pr-1",children:":"})," ",bs(i.column.columnDef.cell,i.getContext())]})})]},i.id):_.jsx(_.Fragment,{})},a)})})}),SP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),wP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),j2=I.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:d="manual",itemSizeNames:h=[],overscan:f=null,component:g={},idContainer:p="",triggerCalCulateContainer:m="",accumulationHeight:b=0,delayTriggerCalculateHeight:v=0,increaseViewportBy:x=()=>0,context:C={},endReached:E,increaseTotalCount:w=1}=e,[B,y]=I.useState(0),S=()=>{if(o==="min-max"){const T=(a+w)*s;return{height:a>u?l:B>T?B:T}}return o==="container"?{height:B}:{}},D=T=>{var P;const F=T.getAttribute("data-index");let k=((P=T.getBoundingClientRect())==null?void 0:P.height)||0;return h==null||h.forEach($=>{var R,O;k+=((O=(R=document.querySelector(`[${$}="${F}"]`))==null?void 0:R.getBoundingClientRect())==null?void 0:O.height)??0}),k},A=()=>{var T;if(p&&o==="container"){const F=((T=document==null?void 0:document.getElementById(p))==null?void 0:T.offsetHeight)??0;y(F-b)}};return I.useEffect(()=>{const T=setTimeout(A,v);return window==null||window.addEventListener("resize",A),window==null||window.addEventListener("load",A),()=>{clearTimeout(T),window==null||window.removeEventListener("resize",A),window==null||window.removeEventListener("load",A)}},[o,m]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(B7,{context:C,ref:t,overscan:typeof f=="function"?f(o==="container"?B:l):o==="container"?B:l,totalListHeightChanged:T=>o==="min-max"?y(T):null,style:S(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(T=>d==="manual"?i(T):D(T),[]),itemContent:(...T)=>c(SP,...T),components:{Item:wP,...g},endReached:E,increaseViewportBy:x(o==="container"?B:l)})})});j2.displayName="ListVirtualization";const IP="_ripple_eap0t_571",_P="_active_eap0t_578",Vt={"tabs-m":"_tabs-m_eap0t_115","tabs-list":"_tabs-list_eap0t_115","button-tabs":"_button-tabs_eap0t_115","container-tabs":"_container-tabs_eap0t_115","original-laba-blue-10":"_original-laba-blue-10_eap0t_115","original-bill-secondary-800":"_original-bill-secondary-800_eap0t_115","tabs-s":"_tabs-s_eap0t_139","tabs-medium":"_tabs-medium_eap0t_259","tabs-small":"_tabs-small_eap0t_289","disable-transition":"_disable-transition_eap0t_469","tab-panel":"_tab-panel_eap0t_473",ripple:IP,active:_P,"tabs-slider":"_tabs-slider_eap0t_585","container-payhere-brand-base":"_container-payhere-brand-base_eap0t_593","container-payhere-brand-base-bg_white":"_container-payhere-brand-base-bg_white_eap0t_630","container-laba-blue-10":"_container-laba-blue-10_eap0t_667","container-laba-blue-10-bg_white":"_container-laba-blue-10-bg_white_eap0t_704","container-laba-blue-10-bg_blue-01":"_container-laba-blue-10-bg_blue-01_eap0t_741","container-bill-secondary-800":"_container-bill-secondary-800_eap0t_820"},_f={"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"},Na={tabsVariant:{"original-laba-blue-10":Vt["original-laba-blue-10"],"container-payhere-brand-base":Vt["container-payhere-brand-base"],"container-payhere-brand-base-bg_white":Vt["container-payhere-brand-base-bg_white"],"container-laba-blue-10":Vt["container-laba-blue-10"],"container-laba-blue-10-bg_white":Vt["container-laba-blue-10-bg_white"],"container-laba-blue-10-bg_blue-01":Vt["container-laba-blue-10-bg_blue-01"],"original-bill-secondary-800":Vt["original-bill-secondary-800"],"container-bill-secondary-800":Vt["container-bill-secondary-800"]},size:{"tabs-m":Vt["tabs-m"],"tabs-s":Vt["tabs-s"],"tabs-medium":Vt["tabs-medium"],"tabs-small":Vt["tabs-small"]},borderRadius:_f,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","container-bill-secondary-800"]},DP=({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:d=!0,mountedExecuteChange:h=!0,typeButton:f="button",onChange:g,locale:p})=>{var D;const m=I.useRef([]);let b=r||[];const v=Object.fromEntries(new URL(window.location.href).searchParams.entries()),[x,C]=I.useState(-1),[E,w]=I.useState({height:0,width:0,left:0});b=b.filter(A=>typeof(A==null?void 0:A.isHide)=="boolean"?!A.isHide:!0);const B=A=>{const T=A.currentTarget,F=document.createElement("span"),k=Math.max(T.clientWidth,T.clientHeight),P=k/2;F.style.width=F.style.height=`${k}px`,F.style.left=`${A.clientX-T.getBoundingClientRect().left-P}px`,F.style.top=`${A.clientY-T.getBoundingClientRect().top-P}px`,F.classList.add(Vt.ripple);const $=T.getElementsByClassName(Vt.ripple)[0];$&&$.remove(),T.appendChild(F),setTimeout(()=>{F.remove()},500)},y=(A,T)=>{typeof g=="function"&&g(A,T)},S=I.useCallback((A,T)=>{var F,k;return p&&((k=(F=r.find($=>$.id===A))==null?void 0:F.locale)==null?void 0:k[p])||T},[p]);return I.useLayoutEffect(()=>{function A(){setTimeout(()=>{const T=m.current[x],F={left:(T==null?void 0:T.offsetLeft)??0,width:(T==null?void 0:T.clientWidth)??0,height:Na.isContainer.includes(s)?(T==null?void 0:T.clientHeight)||0:4};w(F)},50)}return x>=0&&A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[x]),I.useLayoutEffect(()=>{const A=b.findIndex(T=>T.id===(v==null?void 0:v[n])||T.id===t);if((v!=null&&v[n]||t)&&A>=0){C(A);const T=b==null?void 0:b.find(F=>F.id===(v==null?void 0:v[n]));v!=null&&v[n]&&T&&!t&&h&&y(T,"mounted")}A<0&&h&&y(b[0],"mounted")},[JSON.stringify(t),JSON.stringify(v==null?void 0:v[n])]),_.jsx("div",{className:`${Vt["container-tabs"]} ${c?"1ru-opacity-50":""} ${a??""}`,children:_.jsxs("div",{className:`${Na.tabsVariant[s]}
68
+ ${m?cn().utility["table-scroll-top"]:""} ${t}`,handlerRowClick:i,privillageRowClick:a,virtualizationProps:s,componentSortASC:I.isValidElement(g)?g:cn().sortingIcon[f].asc,componentSortDESC:I.isValidElement(p)?p:cn().sortingIcon[f].desc,classNamePointer:cn().pointer[f],emptyPlaceholder:b,renderSubComponent:x,visibilityColumns:B,classNameSubMobile:cn().subMobile[f]})]})},EP=(e,t,{visibilityColumns:n,classNameSubMobile:r})=>_.jsx("table",{className:"-1ru-mx-6 -1ru-my-3 !1ru-w-[calc(100%+48px)]",children:_.jsx("tbody",{children:t.getVisibleCells().map((i,a)=>{var o,s,l,u,c,d;return _.jsx(_.Fragment,{children:n!=null&&n.columns.includes(i.column.id)?_.jsxs("tr",{className:r,children:[_.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:_.jsxs("div",{children:[typeof i.column.columnDef.header=="string"&&_.jsx(_.Fragment,{children:i.column.columnDef.header}),typeof i.column.columnDef.header!="string"&&((l=i.column.columnDef.meta)==null?void 0:l.labelCellSubs)&&_.jsx(_.Fragment,{children:(u=i.column.columnDef.meta)==null?void 0:u.labelCellSubs(t.original,t)})]})}),_.jsx("td",{"data-section":"right",style:{...typeof((c=i.column.columnDef.meta)==null?void 0:c.styleTdRightCellSubs)=="function"?(d=i.column.columnDef.meta)==null?void 0:d.styleTdRightCellSubs(t.original,t):{}},children:_.jsxs("div",{children:[_.jsx("div",{className:"1ru-pr-1",children:":"})," ",bs(i.column.columnDef.cell,i.getContext())]})})]},i.id):_.jsx(_.Fragment,{})},a)})})}),SP=({children:e,...t})=>_.jsx(_.Fragment,{children:e(t)}),wP=({children:e,...t})=>_.jsx(_.Fragment,{children:I.isValidElement(e)&&_.jsx(_.Fragment,{children:I.cloneElement(e,t)})}),j2=I.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:d="manual",itemSizeNames:h=[],overscan:f=null,component:g={},idContainer:p="",triggerCalCulateContainer:m="",accumulationHeight:b=0,delayTriggerCalculateHeight:v=0,increaseViewportBy:x=()=>0,context:C={},endReached:E,increaseTotalCount:w=1}=e,[B,y]=I.useState(0),S=()=>{if(o==="min-max"){const T=(a+w)*s;return{height:a>u?l:B>T?B:T}}return o==="container"?{height:B}:{}},D=T=>{var P;const F=T.getAttribute("data-index");let k=((P=T.getBoundingClientRect())==null?void 0:P.height)||0;return h==null||h.forEach($=>{var R,O;k+=((O=(R=document.querySelector(`[${$}="${F}"]`))==null?void 0:R.getBoundingClientRect())==null?void 0:O.height)??0}),k},A=()=>{var T;if(p&&o==="container"){const F=((T=document==null?void 0:document.getElementById(p))==null?void 0:T.offsetHeight)??0;y(F-b)}};return I.useEffect(()=>{const T=setTimeout(A,v);return window==null||window.addEventListener("resize",A),window==null||window.addEventListener("load",A),()=>{clearTimeout(T),window==null||window.removeEventListener("resize",A),window==null||window.removeEventListener("load",A)}},[o,m]),_.jsx("div",{className:`1ru-w-full ${n}`,children:_.jsx(B7,{context:C,ref:t,overscan:typeof f=="function"?f(o==="container"?B:l):o==="container"?B:l,totalListHeightChanged:T=>o==="min-max"?y(T):null,style:S(),totalCount:a,computeItemKey:r,itemSize:I.useCallback(T=>d==="manual"?i(T):D(T),[]),itemContent:(...T)=>c(SP,...T),components:{Item:wP,...g},endReached:E,increaseViewportBy:x(o==="container"?B:l)})})});j2.displayName="ListVirtualization";const IP="_ripple_kxmyl_572",_P="_active_kxmyl_579",Pt={"tabs-m":"_tabs-m_kxmyl_115","tabs-list":"_tabs-list_kxmyl_115","button-tabs":"_button-tabs_kxmyl_115","container-tabs":"_container-tabs_kxmyl_115","original-laba-blue-10":"_original-laba-blue-10_kxmyl_115","original-payhere-primary-700":"_original-payhere-primary-700_kxmyl_115","original-bill-secondary-800":"_original-bill-secondary-800_kxmyl_115","tabs-s":"_tabs-s_kxmyl_139","tabs-medium":"_tabs-medium_kxmyl_259","tabs-small":"_tabs-small_kxmyl_289","disable-transition":"_disable-transition_kxmyl_469","tab-panel":"_tab-panel_kxmyl_473",ripple:IP,active:_P,"tabs-slider":"_tabs-slider_kxmyl_587","container-payhere-brand-base":"_container-payhere-brand-base_kxmyl_639","container-payhere-brand-base-bg_white":"_container-payhere-brand-base-bg_white_kxmyl_676","container-laba-blue-10":"_container-laba-blue-10_kxmyl_713","container-laba-blue-10-bg_white":"_container-laba-blue-10-bg_white_kxmyl_750","container-laba-blue-10-bg_blue-01":"_container-laba-blue-10-bg_blue-01_kxmyl_787","container-bill-secondary-800":"_container-bill-secondary-800_kxmyl_868"},_f={"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"},Na={tabsVariant:{"original-laba-blue-10":Pt["original-laba-blue-10"],"container-payhere-brand-base":Pt["container-payhere-brand-base"],"container-payhere-brand-base-bg_white":Pt["container-payhere-brand-base-bg_white"],"container-laba-blue-10":Pt["container-laba-blue-10"],"container-laba-blue-10-bg_white":Pt["container-laba-blue-10-bg_white"],"container-laba-blue-10-bg_blue-01":Pt["container-laba-blue-10-bg_blue-01"],"original-bill-secondary-800":Pt["original-bill-secondary-800"],"container-bill-secondary-800":Pt["container-bill-secondary-800"],"original-payhere-primary-700":Pt["original-payhere-primary-700"]},size:{"tabs-m":Pt["tabs-m"],"tabs-s":Pt["tabs-s"],"tabs-medium":Pt["tabs-medium"],"tabs-small":Pt["tabs-small"]},borderRadius:_f,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","container-bill-secondary-800"]},DP=({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:d=!0,mountedExecuteChange:h=!0,typeButton:f="button",onChange:g,locale:p})=>{var D;const m=I.useRef([]);let b=r||[];const v=Object.fromEntries(new URL(window.location.href).searchParams.entries()),[x,C]=I.useState(-1),[E,w]=I.useState({height:0,width:0,left:0});b=b.filter(A=>typeof(A==null?void 0:A.isHide)=="boolean"?!A.isHide:!0);const B=A=>{const T=A.currentTarget,F=document.createElement("span"),k=Math.max(T.clientWidth,T.clientHeight),P=k/2;F.style.width=F.style.height=`${k}px`,F.style.left=`${A.clientX-T.getBoundingClientRect().left-P}px`,F.style.top=`${A.clientY-T.getBoundingClientRect().top-P}px`,F.classList.add(Pt.ripple);const $=T.getElementsByClassName(Pt.ripple)[0];$&&$.remove(),T.appendChild(F),setTimeout(()=>{F.remove()},500)},y=(A,T)=>{typeof g=="function"&&g(A,T)},S=I.useCallback((A,T)=>{var F,k;return p&&((k=(F=r.find($=>$.id===A))==null?void 0:F.locale)==null?void 0:k[p])||T},[p]);return I.useLayoutEffect(()=>{function A(){setTimeout(()=>{const T=m.current[x],F={left:(T==null?void 0:T.offsetLeft)??0,width:(T==null?void 0:T.clientWidth)??0,height:Na.isContainer.includes(s)?(T==null?void 0:T.clientHeight)||0:4};w(F)},50)}return x>=0&&A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[x]),I.useLayoutEffect(()=>{const A=b.findIndex(T=>T.id===(v==null?void 0:v[n])||T.id===t);if((v!=null&&v[n]||t)&&A>=0){C(A);const T=b==null?void 0:b.find(F=>F.id===(v==null?void 0:v[n]));v!=null&&v[n]&&T&&!t&&h&&y(T,"mounted")}A<0&&h&&y(b[0],"mounted")},[JSON.stringify(t),JSON.stringify(v==null?void 0:v[n])]),_.jsx("div",{className:`${Pt["container-tabs"]} ${c?"1ru-opacity-50":""} ${a??""}`,children:_.jsxs("div",{className:`${Na.tabsVariant[s]}
69
69
  ${Na.isContainer.includes(s)?Na.size[l]:""}
70
70
  ${i??""}
71
- `,id:e??"1ru-tabs",children:[_.jsx("div",{className:Vt["tabs-list"],children:b.map((A,T)=>_.jsx("button",{type:f,id:`1ru-tabs-button-${A.id}`,ref:F=>m.current[T]=F,className:`${Vt["button-tabs"]} ${Na.borderRadius[u]}
71
+ `,id:e??"1ru-tabs",children:[_.jsx("div",{className:Pt["tabs-list"],children:b.map((A,T)=>_.jsx("button",{type:f,id:`1ru-tabs-button-${A.id}`,ref:F=>m.current[T]=F,className:`${Pt["button-tabs"]} ${Na.borderRadius[u]}
72
72
  ${o??""} ${(A==null?void 0:A.className)??""}
73
- ${x===T?Vt.active:""}`,disabled:c,onClick:F=>{Na.isContainer.includes(s)||B(F),x!=T&&y(A,"change")},children:S(A.id,A.label)},T))}),_.jsx("div",{className:`${Vt["tabs-slider"]} ${Na.borderRadius[u]}
74
- ${o??""} ${d?"":Vt["disable-transition"]}
75
- `,style:{left:E.left,width:E.width,height:E.height,background:((D=r[x])==null?void 0:D.activeColor)??""}})]})})},AP=({children:e,id:t,value:n,selected:r,className:i,isHide:a})=>_.jsx("div",{role:"tabpanel",id:t??`1ru-tabpanel-${n}`,hidden:a??n!==r,className:`${Vt["tab-panel"]} ${i??""}`,children:e}),TP="_option_k6p13_109",RP="_active_k6p13_624",Fn={"pagination-box":"_pagination-box_k6p13_61","navigation-container":"_navigation-container_k6p13_61","goto-page":"_goto-page_k6p13_61","goto-page-input":"_goto-page-input_k6p13_61","pagination-nude":"_pagination-nude_k6p13_61","options-size":"_options-size_k6p13_109",option:TP,"pagination-size":"_pagination-size_k6p13_480","button-container":"_button-container_k6p13_494","button-next":"_button-next_k6p13_494","button-prev":"_button-prev_k6p13_494","pagination-active":"_pagination-active_k6p13_517",active:RP},BP="_selected_1tkcj_469",$P="_disabled_1tkcj_497",kP="_valid_1tkcj_575",PP="_invalid_1tkcj_581",FP="_error_1tkcj_645",Pe={"container-filter-date":"_container-filter-date_1tkcj_271","container-calendar":"_container-calendar_1tkcj_289","days-calendar":"_days-calendar_1tkcj_289","cell-calendar":"_cell-calendar_1tkcj_289","visible-cell-calendar":"_visible-cell-calendar_1tkcj_289","active-cell-calendar":"_active-cell-calendar_1tkcj_289","custom-time-calendar":"_custom-time-calendar_1tkcj_289","type-time":"_type-time_1tkcj_289","container-cell-time":"_container-cell-time_1tkcj_289","cell-time":"_cell-time_1tkcj_289","month-calendar":"_month-calendar_1tkcj_469","cell-month":"_cell-month_1tkcj_469",selected:BP,"year-calendar":"_year-calendar_1tkcj_470","cell-year":"_cell-year_1tkcj_470","header-calendar":"_header-calendar_1tkcj_480","header-button-calendar":"_header-button-calendar_1tkcj_487",disabled:$P,"header-time":"_header-time_1tkcj_537",valid:kP,invalid:PP,"footer-calendar":"_footer-calendar_1tkcj_615","button-filter-date":"_button-filter-date_1tkcj_629","button-reset-filter-date":"_button-reset-filter-date_1tkcj_638","button-filter-date-custome":"_button-filter-date-custome_1tkcj_641",error:FP},li=({className:e})=>_.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:_.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 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 0s-12.5 32.8 0 45.3l192 192z"})}),W2=({title:e,state:t,type:n,setUpYear:r={startYear:1970,endAfterThisYear:20},hiddenHeader:i,setActiveTypeCalendar:a,onChangeYear:o})=>{const s=(u,c)=>{const d=t.focusedDate.set({year:u});c?(a("month"),t.setFocusedDate(d)):!c&&typeof o=="function"&&o(d)},l=(u,c,d)=>Array.from({length:(c-u)/d+1},(h,f)=>u+f*d);return I.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})},[]),_.jsxs("div",{className:`1ru-w-[296px] ${Pe["container-calendar"]}`,children:[!i&&_.jsx("div",{className:`${Pe["header-calendar"]} 1ru-my-2`,children:_.jsxs("div",{className:`${Pe["header-button-calendar"]} ${n.includes("date")||n.includes("month")?"":Pe.disabled}`,onClick:()=>{n.includes("date")?a("date"):n.includes("month")&&a("month")},children:[e," ",(n.includes("date")||n.includes("month"))&&_.jsx(li,{})]})}),_.jsx("div",{id:"wrapper-calendar-year",className:Pe["year-calendar"],children:l(r==null?void 0:r.startYear,new Date().getFullYear()+r.endAfterThisYear,1).map(u=>{var g,p;const c=Number(u),d=t!=null&&t.minValue?c<((g=t==null?void 0:t.minValue)==null?void 0:g.year):!1,h=t!=null&&t.maxValue?c>((p=t==null?void 0:t.maxValue)==null?void 0:p.year):!1,f=d||h;return _.jsx("div",{id:`calendar-year-${u}`,onClick:()=>{f||s(c,n.includes("month"))},className:`${Pe["cell-year"]} ${t.focusedDate.year===c&&!f?Pe.selected:""} ${t.focusedDate.year!==c&&!f?"hover:1ru-bg-laba-blue-01":""} ${f?"1ru-text-gray-400":"1ru-cursor-pointer"}`,children:u},u)})})]})},va={lato:"1ru-font-Lato",inter:"1ru-font-Inter",pJakartaSans:"1ru-font-PJakartaSans"},yh={kind:{box:Fn["pagination-box"],nude:Fn["pagination-nude"]},fonts:{inter:{value:va.inter,typographyButtonLabel:"1ru-text-payhere-body-sr"},lato:{value:va.lato,typographyButtonLabel:"1ru-text-payhere-body-sr"},pJakartaSans:{value:va.pJakartaSans,typographyButtonLabel:"1ru-text-bill-label-r"}}},Xu=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)},xh={"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:"}},NP=({totalData:e,totalPage:t,pageNumber:n,pageSize:r,className:i,id:a="1ru-pagination",kind:o="box",prevIcon:s,nextIcon:l,onChange:u,optionPageSize:c=[25,50,75,100],offset:d=1.5,zIndex:h,withGotoPage:f=!1,withMorePage:g=!0,withOptionPageSize:p=!1,locale:m="id-ID",fonts:b="inter"})=>{const v=I.useRef(null),[x,C]=I.useState(n),[E,w]=I.useState(n.toString()),B=1,y=(x-1)*r+1,S=r*x,D=e?`${Qi(y,"decimal")}-${S>=e?Qi(e,"decimal"):Qi(S,"decimal")}`:0,A=I.useMemo(()=>{const P=Math.ceil(e/r);if(B+5>=P)return Xu(1,P);const R=Math.max(x-B,1),O=Math.min(x+B,P),j=R>2,V=O<P-2,W=1,U=P;if(!j&&V){const K=3+2*B;return[...Xu(1,K),"mr",P]}if(j&&!V){const K=3+2*B,ee=Xu(P-K+1,P);return[W,"ml",...ee]}if(j&&V){const K=Xu(R,O);return[W,"ml",...K,"mr",U]}},[e,r,B,x]),T=P=>{typeof u=="function"&&(u(P),C(P.pageNumber),w(P.pageNumber.toString()))},F=P=>{if(typeof u=="function"&&g){if(P==="ml"){const R=x-5;C(R<1?1:x-5)}else if(P==="mr"){const R=x+5;C(R>t?t:x+5)}}},k=P=>{w(P);const $=Number(P);$>0&&$<=t&&T({pageSize:r,totalData:e,totalPage:t,pageNumber:$})};return _.jsxs(_.Fragment,{children:[_.jsxs("div",{id:a,className:`${yh.kind[o]} ${yh.fonts[b].value} ${i}`,children:[_.jsxs("div",{className:Fn["pagination-size"],children:[_.jsx("span",{children:xh[m]["Rows per page:"]}),p&&_.jsx(jn,{id:`${a}-option-size`,variants:"ghost-blue-gray-100-bg_white",size:"xs",endIcon:_.jsx(li,{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 $;return($=v.current)==null?void 0:$.handlerShow(P)},children:Qi(r,"decimal")}),_.jsxs("span",{children:[D," ",xh[m].of," ",Qi(e,"decimal")]})]}),_.jsxs("div",{className:Fn["navigation-container"],children:[_.jsx("button",{id:`${a}-button-prev`,className:`${Fn["button-prev"]}`,disabled:x===1,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n-1}),children:typeof s=="function"||I.isValidElement(s)?I.isValidElement(s)?s:s():_.jsx(li,{className:"1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),(A??[]).map((P,$)=>{if(typeof P!="number"){const R=["ml","mr"].includes(P);return _.jsx("button",{className:Fn["button-container"],disabled:!g,onClick:()=>F(P),children:R?"...":P},$)}return _.jsx("button",{id:`${a}-button-${P}`,className:`${P===n?Fn["pagination-active"]:""} ${Fn["button-container"]}
73
+ ${x===T?Pt.active:""}`,disabled:c,onClick:F=>{Na.isContainer.includes(s)||B(F),x!=T&&y(A,"change")},children:S(A.id,A.label)},T))}),_.jsx("div",{className:`${Pt["tabs-slider"]} ${Na.borderRadius[u]}
74
+ ${o??""} ${d?"":Pt["disable-transition"]}
75
+ `,style:{left:E.left,width:E.width,height:E.height,background:((D=r[x])==null?void 0:D.activeColor)??""}})]})})},AP=({children:e,id:t,value:n,selected:r,className:i,isHide:a})=>_.jsx("div",{role:"tabpanel",id:t??`1ru-tabpanel-${n}`,hidden:a??n!==r,className:`${Pt["tab-panel"]} ${i??""}`,children:e}),TP="_option_k6p13_109",RP="_active_k6p13_624",Fn={"pagination-box":"_pagination-box_k6p13_61","navigation-container":"_navigation-container_k6p13_61","goto-page":"_goto-page_k6p13_61","goto-page-input":"_goto-page-input_k6p13_61","pagination-nude":"_pagination-nude_k6p13_61","options-size":"_options-size_k6p13_109",option:TP,"pagination-size":"_pagination-size_k6p13_480","button-container":"_button-container_k6p13_494","button-next":"_button-next_k6p13_494","button-prev":"_button-prev_k6p13_494","pagination-active":"_pagination-active_k6p13_517",active:RP},BP="_selected_1tkcj_469",$P="_disabled_1tkcj_497",kP="_valid_1tkcj_575",PP="_invalid_1tkcj_581",FP="_error_1tkcj_645",Fe={"container-filter-date":"_container-filter-date_1tkcj_271","container-calendar":"_container-calendar_1tkcj_289","days-calendar":"_days-calendar_1tkcj_289","cell-calendar":"_cell-calendar_1tkcj_289","visible-cell-calendar":"_visible-cell-calendar_1tkcj_289","active-cell-calendar":"_active-cell-calendar_1tkcj_289","custom-time-calendar":"_custom-time-calendar_1tkcj_289","type-time":"_type-time_1tkcj_289","container-cell-time":"_container-cell-time_1tkcj_289","cell-time":"_cell-time_1tkcj_289","month-calendar":"_month-calendar_1tkcj_469","cell-month":"_cell-month_1tkcj_469",selected:BP,"year-calendar":"_year-calendar_1tkcj_470","cell-year":"_cell-year_1tkcj_470","header-calendar":"_header-calendar_1tkcj_480","header-button-calendar":"_header-button-calendar_1tkcj_487",disabled:$P,"header-time":"_header-time_1tkcj_537",valid:kP,invalid:PP,"footer-calendar":"_footer-calendar_1tkcj_615","button-filter-date":"_button-filter-date_1tkcj_629","button-reset-filter-date":"_button-reset-filter-date_1tkcj_638","button-filter-date-custome":"_button-filter-date-custome_1tkcj_641",error:FP},li=({className:e})=>_.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:_.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 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 0s-12.5 32.8 0 45.3l192 192z"})}),W2=({title:e,state:t,type:n,setUpYear:r={startYear:1970,endAfterThisYear:20},hiddenHeader:i,setActiveTypeCalendar:a,onChangeYear:o})=>{const s=(u,c)=>{const d=t.focusedDate.set({year:u});c?(a("month"),t.setFocusedDate(d)):!c&&typeof o=="function"&&o(d)},l=(u,c,d)=>Array.from({length:(c-u)/d+1},(h,f)=>u+f*d);return I.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})},[]),_.jsxs("div",{className:`1ru-w-[296px] ${Fe["container-calendar"]}`,children:[!i&&_.jsx("div",{className:`${Fe["header-calendar"]} 1ru-my-2`,children:_.jsxs("div",{className:`${Fe["header-button-calendar"]} ${n.includes("date")||n.includes("month")?"":Fe.disabled}`,onClick:()=>{n.includes("date")?a("date"):n.includes("month")&&a("month")},children:[e," ",(n.includes("date")||n.includes("month"))&&_.jsx(li,{})]})}),_.jsx("div",{id:"wrapper-calendar-year",className:Fe["year-calendar"],children:l(r==null?void 0:r.startYear,new Date().getFullYear()+r.endAfterThisYear,1).map(u=>{var g,p;const c=Number(u),d=t!=null&&t.minValue?c<((g=t==null?void 0:t.minValue)==null?void 0:g.year):!1,h=t!=null&&t.maxValue?c>((p=t==null?void 0:t.maxValue)==null?void 0:p.year):!1,f=d||h;return _.jsx("div",{id:`calendar-year-${u}`,onClick:()=>{f||s(c,n.includes("month"))},className:`${Fe["cell-year"]} ${t.focusedDate.year===c&&!f?Fe.selected:""} ${t.focusedDate.year!==c&&!f?"hover:1ru-bg-laba-blue-01":""} ${f?"1ru-text-gray-400":"1ru-cursor-pointer"}`,children:u},u)})})]})},va={lato:"1ru-font-Lato",inter:"1ru-font-Inter",pJakartaSans:"1ru-font-PJakartaSans"},yh={kind:{box:Fn["pagination-box"],nude:Fn["pagination-nude"]},fonts:{inter:{value:va.inter,typographyButtonLabel:"1ru-text-payhere-body-sr"},lato:{value:va.lato,typographyButtonLabel:"1ru-text-payhere-body-sr"},pJakartaSans:{value:va.pJakartaSans,typographyButtonLabel:"1ru-text-bill-label-r"}}},Xu=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)},xh={"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:"}},NP=({totalData:e,totalPage:t,pageNumber:n,pageSize:r,className:i,id:a="1ru-pagination",kind:o="box",prevIcon:s,nextIcon:l,onChange:u,optionPageSize:c=[25,50,75,100],offset:d=1.5,zIndex:h,withGotoPage:f=!1,withMorePage:g=!0,withOptionPageSize:p=!1,locale:m="id-ID",fonts:b="inter"})=>{const v=I.useRef(null),[x,C]=I.useState(n),[E,w]=I.useState(n.toString()),B=1,y=(x-1)*r+1,S=r*x,D=e?`${Qi(y,"decimal")}-${S>=e?Qi(e,"decimal"):Qi(S,"decimal")}`:0,A=I.useMemo(()=>{const P=Math.ceil(e/r);if(B+5>=P)return Xu(1,P);const R=Math.max(x-B,1),O=Math.min(x+B,P),j=R>2,V=O<P-2,W=1,U=P;if(!j&&V){const K=3+2*B;return[...Xu(1,K),"mr",P]}if(j&&!V){const K=3+2*B,ee=Xu(P-K+1,P);return[W,"ml",...ee]}if(j&&V){const K=Xu(R,O);return[W,"ml",...K,"mr",U]}},[e,r,B,x]),T=P=>{typeof u=="function"&&(u(P),C(P.pageNumber),w(P.pageNumber.toString()))},F=P=>{if(typeof u=="function"&&g){if(P==="ml"){const R=x-5;C(R<1?1:x-5)}else if(P==="mr"){const R=x+5;C(R>t?t:x+5)}}},k=P=>{w(P);const $=Number(P);$>0&&$<=t&&T({pageSize:r,totalData:e,totalPage:t,pageNumber:$})};return _.jsxs(_.Fragment,{children:[_.jsxs("div",{id:a,className:`${yh.kind[o]} ${yh.fonts[b].value} ${i}`,children:[_.jsxs("div",{className:Fn["pagination-size"],children:[_.jsx("span",{children:xh[m]["Rows per page:"]}),p&&_.jsx(jn,{id:`${a}-option-size`,variants:"ghost-blue-gray-100-bg_white",size:"xs",endIcon:_.jsx(li,{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 $;return($=v.current)==null?void 0:$.handlerShow(P)},children:Qi(r,"decimal")}),_.jsxs("span",{children:[D," ",xh[m].of," ",Qi(e,"decimal")]})]}),_.jsxs("div",{className:Fn["navigation-container"],children:[_.jsx("button",{id:`${a}-button-prev`,className:`${Fn["button-prev"]}`,disabled:x===1,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n-1}),children:typeof s=="function"||I.isValidElement(s)?I.isValidElement(s)?s:s():_.jsx(li,{className:"1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),(A??[]).map((P,$)=>{if(typeof P!="number"){const R=["ml","mr"].includes(P);return _.jsx("button",{className:Fn["button-container"],disabled:!g,onClick:()=>F(P),children:R?"...":P},$)}return _.jsx("button",{id:`${a}-button-${P}`,className:`${P===n?Fn["pagination-active"]:""} ${Fn["button-container"]}
76
76
  ${yh.fonts[b].typographyButtonLabel}`,disabled:P===n,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:P}),children:Qi(P,"decimal")},$)}),_.jsx("button",{id:`${a}-button-next`,className:`${Fn["button-next"]}`,disabled:x===t||!t,onClick:()=>T({pageSize:r,totalData:e,totalPage:t,pageNumber:n+1}),children:typeof l=="function"||I.isValidElement(l)?I.isValidElement(l)?l:l():_.jsx(li,{className:"-1ru-rotate-90 !1ru-text-gray-500 !1ru-w-[14px] !1ru-h-[14px]"})}),f&&_.jsxs("div",{className:Fn["goto-page"],children:[_.jsx("span",{children:xh[m]["Go to:"]}),_.jsx("input",{id:`${a}-goto-page`,type:"number",className:Fn["goto-page-input"],value:E,onChange:P=>k(P.target.value),onBlur:()=>w(x.toString())})]})]})]}),_.jsx(pi,{floatingOptions:{placement:"bottom-end"},ref:v,className:Fn["options-size"],offset:d,zIndex:h,id:`${a}-popover-options-size`,children:c.map((P,$)=>_.jsx("p",{id:`${a}-option-size-${P}`,className:`${Fn.option} ${P===r?Fn.active:""}`,onClick:()=>{var R;T({totalData:e,totalPage:t,pageSize:P,pageNumber:1}),(R=v.current)==null||R.setShow(!1)},children:Qi(P,"decimal")},$))})]})};function mo(e){"@babel/helpers - typeof";return mo=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},mo(e)}function MP(e,t){if(mo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z2(e){var t=MP(e,"string");return mo(t)=="symbol"?t:t+""}function tl(e,t,n){return(t=z2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lb(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 Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lb(Object(n),!0).forEach(function(r){tl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lb(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LP(e){if(Array.isArray(e))return e}function OP(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 og(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 G2(e,t){if(e){if(typeof e=="string")return og(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)?og(e,t):void 0}}function VP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
77
77
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vi(e,t){return LP(e)||OP(e,t)||G2(e,t)||VP()}function HP(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 zi(e,t){if(e==null)return{};var n,r,i=HP(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 jP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function WP(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,d=e.onMenuClose,h=e.onMenuOpen,f=e.value,g=zi(e,jP),p=I.useState(s!==void 0?s:n),m=Vi(p,2),b=m[0],v=m[1],x=I.useState(l!==void 0?l:i),C=Vi(x,2),E=C[0],w=C[1],B=I.useState(f!==void 0?f:o),y=Vi(B,2),S=y[0],D=y[1],A=I.useCallback(function(O,j){typeof u=="function"&&u(O,j),D(O)},[u]),T=I.useCallback(function(O,j){var V;typeof c=="function"&&(V=c(O,j)),v(V!==void 0?V:O)},[c]),F=I.useCallback(function(){typeof h=="function"&&h(),w(!0)},[h]),k=I.useCallback(function(){typeof d=="function"&&d(),w(!1)},[d]),P=s!==void 0?s:b,$=l!==void 0?l:E,R=f!==void 0?f:S;return Be(Be({},g),{},{inputValue:P,menuIsOpen:$,onChange:A,onInputChange:T,onMenuClose:k,onMenuOpen:F,value:R})}function $e(){return $e=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},$e.apply(null,arguments)}function zP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ob(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,z2(r.key),r)}}function GP(e,t,n){return t&&Ob(e.prototype,t),n&&Ob(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sg(e,t){return sg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},sg(e,t)}function UP(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&&sg(e,t)}function Id(e){return Id=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Id(e)}function U2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U2=function(){return!!e})()}function XP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZP(e,t){if(t&&(mo(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XP(e)}function YP(e){var t=U2();return function(){var n,r=Id(e);if(t){var i=Id(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ZP(this,n)}}function KP(e){if(Array.isArray(e))return og(e)}function JP(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
78
78
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qp(e){return KP(e)||JP(e)||G2(e)||qP()}function QP(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 eF(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 tF=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(eF(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:
@@ -100,10 +100,10 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
100
100
  You should wrap it with \`css\` like this:
101
101
 
102
102
  `+("css`"+l+"`"))}break}if(t==null)return n;var u=t[n];return u!==void 0?u:n}function ZF(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=jl(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object")t!=null&&t[o]!==void 0?r+=a+"{"+t[o]+"}":Xb(o)&&(r+=Ch(a)+":"+Dd(a,o)+";");else{if(a==="NO_COMPONENT_SELECTOR"&&process.env.NODE_ENV!=="production")throw new Error(i3);if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var s=0;s<o.length;s++)Xb(o[s])&&(r+=Ch(a)+":"+Dd(a,o[s])+";");else{var l=jl(e,t,o);switch(a){case"animation":case"animationName":{r+=Ch(a)+":"+l+";";break}default:process.env.NODE_ENV!=="production"&&a==="undefined"&&console.error(HF),r+=a+"{"+l+"}"}}}}return r}var Yb=/label:\s*([^\s;\n{]+)\s*(;|$)/g,a3;process.env.NODE_ENV!=="production"&&(a3=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g);var Tr,Wl=function(t,n,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,a="";Tr=void 0;var o=t[0];o==null||o.raw===void 0?(i=!1,a+=jl(r,n,o)):(process.env.NODE_ENV!=="production"&&o[0]===void 0&&console.error(Ub),a+=o[0]);for(var s=1;s<t.length;s++)a+=jl(r,n,t[s]),i&&(process.env.NODE_ENV!=="production"&&o[s]===void 0&&console.error(Ub),a+=o[s]);var l;process.env.NODE_ENV!=="production"&&(a=a.replace(a3,function(h){return l=h,""})),Yb.lastIndex=0;for(var u="",c;(c=Yb.exec(a))!==null;)u+="-"+c[1];var d=LF(a)+u;return process.env.NODE_ENV!=="production"?{name:d,styles:a,map:l,next:Tr,toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}:{name:d,styles:a,next:Tr}},YF=function(t){return t()},o3=q.useInsertionEffect?q.useInsertionEffect:!1,s3=o3||YF,Kb=o3||q.useLayoutEffect,lm={}.hasOwnProperty,um=q.createContext(typeof HTMLElement<"u"?$F({key:"css"}):null);process.env.NODE_ENV!=="production"&&(um.displayName="EmotionCacheContext");um.Provider;var cm=function(t){return I.forwardRef(function(n,r){var i=I.useContext(um);return t(n,i,r)})},Rf=q.createContext({});process.env.NODE_ENV!=="production"&&(Rf.displayName="EmotionThemeContext");var Jb=function(t){var n=t.split(".");return n[n.length-1]},KF=function(t){var n=/^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(t);if(n||(n=/^([A-Za-z0-9$.]+)@/.exec(t),n))return Jb(n[1])},JF=new Set(["renderWithHooks","processChild","finishClassComponent","renderToString"]),qF=function(t){return t.replace(/\$/g,"-")},QF=function(t){if(t)for(var n=t.split(`
103
- `),r=0;r<n.length;r++){var i=KF(n[r]);if(i){if(JF.has(i))break;if(/^[A-Z]/.test(i))return qF(i)}}},dg="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",fg="__EMOTION_LABEL_PLEASE_DO_NOT_USE__",eN=function(t,n){if(process.env.NODE_ENV!=="production"&&typeof n.css=="string"&&n.css.indexOf(":")!==-1)throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`"+n.css+"`");var r={};for(var i in n)lm.call(n,i)&&(r[i]=n[i]);if(r[dg]=t,process.env.NODE_ENV!=="production"&&n.css&&(typeof n.css!="object"||typeof n.css.name!="string"||n.css.name.indexOf("-")===-1)){var a=QF(new Error().stack);a&&(r[fg]=a)}return r},tN=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return am(n,r,i),s3(function(){return om(n,r,i)}),null},l3=cm(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[dg],a=[r],o="";typeof e.className=="string"?o=n3(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var s=Wl(a,void 0,q.useContext(Rf));if(process.env.NODE_ENV!=="production"&&s.name.indexOf("-")===-1){var l=e[fg];l&&(s=Wl([s,"label:"+l+";"]))}o+=t.key+"-"+s.name;var u={};for(var c in e)lm.call(e,c)&&c!=="css"&&c!==dg&&(process.env.NODE_ENV==="production"||c!==fg)&&(u[c]=e[c]);return u.ref=n,u.className=o,q.createElement(q.Fragment,null,q.createElement(tN,{cache:t,serialized:s,isStringTag:typeof i=="string"}),q.createElement(i,u))});process.env.NODE_ENV!=="production"&&(l3.displayName="EmotionCssPropInternal");var nN=l3,rN={version:"11.11.4"},Te=function(t,n){var r=arguments;if(n==null||!lm.call(n,"css"))return q.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=nN,a[1]=eN(t,n);for(var o=2;o<i;o++)a[o]=r[o];return q.createElement.apply(null,a)},qb=!1,iN=cm(function(e,t){process.env.NODE_ENV!=="production"&&!qb&&(e.className||e.css)&&(console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"),qb=!0);var n=e.styles,r=Wl([n],void 0,q.useContext(Rf)),i=q.useRef();return Kb(function(){var a=t.key+"-global",o=new t.sheet.constructor({key:a,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+a+" "+r.name+'"]');return t.sheet.tags.length&&(o.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",a),o.hydrate([l])),i.current=[o,s],function(){o.flush()}},[t]),Kb(function(){var a=i.current,o=a[0],s=a[1];if(s){a[1]=!1;return}if(r.next!==void 0&&om(t,r.next,!0),o.tags.length){var l=o.tags[o.tags.length-1].nextElementSibling;o.before=l,o.flush()}t.insert("",r,o,!1)},[t,r.name]),null});process.env.NODE_ENV!=="production"&&(iN.displayName="EmotionGlobal");function dm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Wl(t)}var aN=function(){var t=dm.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},oN=function e(t){for(var n=t.length,r=0,i="";r<n;r++){var a=t[r];if(a!=null){var o=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))o=e(a);else{process.env.NODE_ENV!=="production"&&a.styles!==void 0&&a.name!==void 0&&console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component."),o="";for(var s in a)a[s]&&s&&(o&&(o+=" "),o+=s)}break}default:o=a}o&&(i&&(i+=" "),i+=o)}}return i};function sN(e,t,n){var r=[],i=n3(e,r,n);return r.length<2?n:i+t(r)}var lN=function(t){var n=t.cache,r=t.serializedArr;return s3(function(){for(var i=0;i<r.length;i++)om(n,r[i],!1)}),null},uN=cm(function(e,t){var n=!1,r=[],i=function(){if(n&&process.env.NODE_ENV!=="production")throw new Error("css can only be used during render");for(var u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];var h=Wl(c,t.registered);return r.push(h),am(t,h,!1),t.key+"-"+h.name},a=function(){if(n&&process.env.NODE_ENV!=="production")throw new Error("cx can only be used during render");for(var u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];return sN(t.registered,i,oN(c))},o={css:i,cx:a,theme:q.useContext(Rf)},s=e.children(o);return n=!0,q.createElement(q.Fragment,null,q.createElement(lN,{cache:t,serializedArr:r}),s)});process.env.NODE_ENV!=="production"&&(uN.displayName="EmotionClassNames");if(process.env.NODE_ENV!=="production"){var Qb=!0,cN=typeof jest<"u"||typeof vi<"u";if(Qb&&!cN){var ev=typeof globalThis<"u"?globalThis:Qb?window:global,tv="__EMOTION_REACT_"+rN.version.split(".")[0]+"__";ev[tv]&&console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used."),ev[tv]=!0}}function dN(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var hg=I.useLayoutEffect,fN=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ad=function(){};function hN(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function gN(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=[].concat(r);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&a.push("".concat(hN(e,o)));return a.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var nv=function(t){return SN(t)?t.filter(Boolean):mo(t)==="object"&&t!==null?[t]:[]},u3=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=zi(t,fN);return Be({},n)},Mt=function(t,n,r){var i=t.cx,a=t.getStyles,o=t.getClassNames,s=t.className;return{css:a(n,t),className:i(r??{},o(n,t),s)}};function Bf(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function pN(e){return Bf(e)?window.innerHeight:e.clientHeight}function c3(e){return Bf(e)?window.pageYOffset:e.scrollTop}function Td(e,t){if(Bf(e)){window.scrollTo(0,t);return}e.scrollTop=t}function mN(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function bN(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Yu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ad,i=c3(e),a=t-i,o=10,s=0;function l(){s+=o;var u=bN(s,i,a,n);Td(e,u),s<n?window.requestAnimationFrame(l):r(e)}l()}function rv(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?Td(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&Td(e,Math.max(t.offsetTop-i,0))}function vN(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function iv(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function yN(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var d3=!1,xN={get passive(){return d3=!0}},Ku=typeof window<"u"?window:{};Ku.addEventListener&&Ku.removeEventListener&&(Ku.addEventListener("p",Ad,xN),Ku.removeEventListener("p",Ad,!1));var CN=d3;function EN(e){return e!=null}function SN(e){return Array.isArray(e)}function Ju(e,t,n){return e?t:n}var wN=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=Object.entries(t).filter(function(o){var s=Vi(o,1),l=s[0];return!r.includes(l)});return a.reduce(function(o,s){var l=Vi(s,2),u=l[0],c=l[1];return o[u]=c,o},{})},IN=["children","innerProps"],_N=["children","innerProps"];function DN(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,a=e.shouldScroll,o=e.isFixedPosition,s=e.controlHeight,l=mN(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,h=n.getBoundingClientRect(),f=h.bottom,g=h.height,p=h.top,m=n.offsetParent.getBoundingClientRect(),b=m.top,v=o?window.innerHeight:pN(l),x=c3(l),C=parseInt(getComputedStyle(n).marginBottom,10),E=parseInt(getComputedStyle(n).marginTop,10),w=b-E,B=v-p,y=w+x,S=d-x-p,D=f-v+x+C,A=x+p-E,T=160;switch(i){case"auto":case"bottom":if(B>=g)return{placement:"bottom",maxHeight:t};if(S>=g&&!o)return a&&Yu(l,D,T),{placement:"bottom",maxHeight:t};if(!o&&S>=r||o&&B>=r){a&&Yu(l,D,T);var F=o?B-C:S-C;return{placement:"bottom",maxHeight:F}}if(i==="auto"||o){var k=t,P=o?w:y;return P>=r&&(k=Math.min(P-C-s,t)),{placement:"top",maxHeight:k}}if(i==="bottom")return a&&Td(l,D),{placement:"bottom",maxHeight:t};break;case"top":if(w>=g)return{placement:"top",maxHeight:t};if(y>=g&&!o)return a&&Yu(l,A,T),{placement:"top",maxHeight:t};if(!o&&y>=r||o&&w>=r){var $=t;return(!o&&y>=r||o&&w>=r)&&($=o?w-E:y-E),a&&Yu(l,A,T),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function AN(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var f3=function(t){return t==="auto"?"bottom":t},TN=function(t,n){var r,i=t.placement,a=t.theme,o=a.borderRadius,s=a.spacing,l=a.colors;return Be((r={label:"menu"},tl(r,AN(i),"100%"),tl(r,"position","absolute"),tl(r,"width","100%"),tl(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},h3=I.createContext(null),RN=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,a=t.menuPlacement,o=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,u=I.useContext(h3)||{},c=u.setPortalPlacement,d=I.useRef(null),h=I.useState(i),f=Vi(h,2),g=f[0],p=f[1],m=I.useState(null),b=Vi(m,2),v=b[0],x=b[1],C=l.spacing.controlHeight;return hg(function(){var E=d.current;if(E){var w=o==="fixed",B=s&&!w,y=DN({maxHeight:i,menuEl:E,minHeight:r,placement:a,shouldScroll:B,isFixedPosition:w,controlHeight:C});p(y.maxHeight),x(y.placement),c==null||c(y.placement)}},[i,a,o,s,r,c,C]),n({ref:d,placerProps:Be(Be({},t),{},{placement:v||f3(a),maxHeight:g})})},BN=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Te("div",$e({},Mt(t,"menu",{menu:!0}),{ref:r},i),n)},$N=BN,kN=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Be({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},PN=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,a=t.isMulti;return Te("div",$e({},Mt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:i},r),n)},g3=function(t,n){var r=t.theme,i=r.spacing.baseUnit,a=r.colors;return Be({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},FN=g3,NN=g3,MN=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,a=zi(t,IN);return Te("div",$e({},Mt(Be(Be({},a),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},LN=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,a=zi(t,_N);return Te("div",$e({},Mt(Be(Be({},a),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},ON=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},VN=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,a=t.innerProps,o=t.menuPlacement,s=t.menuPosition,l=I.useRef(null),u=I.useRef(null),c=I.useState(f3(o)),d=Vi(c,2),h=d[0],f=d[1],g=I.useMemo(function(){return{setPortalPlacement:f}},[]),p=I.useState(null),m=Vi(p,2),b=m[0],v=m[1],x=I.useCallback(function(){if(i){var B=vN(i),y=s==="fixed"?0:window.pageYOffset,S=B[h]+y;(S!==(b==null?void 0:b.offset)||B.left!==(b==null?void 0:b.rect.left)||B.width!==(b==null?void 0:b.rect.width))&&v({offset:S,rect:B})}},[i,s,h,b==null?void 0:b.offset,b==null?void 0:b.rect.left,b==null?void 0:b.rect.width]);hg(function(){x()},[x]);var C=I.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=w4(i,l.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);hg(function(){C()},[C]);var E=I.useCallback(function(B){l.current=B,C()},[C]);if(!n&&s!=="fixed"||!b)return null;var w=Te("div",$e({ref:E},Mt(Be(Be({},t),{},{offset:b.offset,position:s,rect:b.rect}),"menuPortal",{"menu-portal":!0}),a),r);return Te(h3.Provider,{value:g},n?cu.createPortal(w,n):w)},HN=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},jN=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,a=t.isRtl;return Te("div",$e({},Mt(t,"container",{"--is-disabled":i,"--is-rtl":a}),r),n)},WN=function(t,n){var r=t.theme.spacing,i=t.isMulti,a=t.hasValue,o=t.selectProps.controlShouldRenderValue;return Be({alignItems:"center",display:i&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},zN=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,a=t.hasValue;return Te("div",$e({},Mt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":a}),r),n)},GN=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},UN=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Mt(t,"indicatorsContainer",{indicators:!0}),r),n)},av,XN=["size"],ZN=["innerProps","isRtl","size"];function YN(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var KN=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",toString:YN},p3=function(t){var n=t.size,r=zi(t,XN);return Te("svg",$e({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:KN},r))},fm=function(t){return Te(p3,$e({size:20},t),Te("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},m3=function(t){return Te(p3,$e({size:20},t),Te("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},b3=function(t,n){var r=t.isFocused,i=t.theme,a=i.spacing.baseUnit,o=i.colors;return Be({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},JN=b3,qN=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Mt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Te(m3,null))},QN=b3,eM=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Mt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Te(fm,null))},tM=function(t,n){var r=t.isDisabled,i=t.theme,a=i.spacing.baseUnit,o=i.colors;return Be({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},nM=function(t){var n=t.innerProps;return Te("span",$e({},n,Mt(t,"indicatorSeparator",{"indicator-separator":!0})))},rM=aN(av||(av=dN([`
103
+ `),r=0;r<n.length;r++){var i=KF(n[r]);if(i){if(JF.has(i))break;if(/^[A-Z]/.test(i))return qF(i)}}},dg="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",fg="__EMOTION_LABEL_PLEASE_DO_NOT_USE__",eN=function(t,n){if(process.env.NODE_ENV!=="production"&&typeof n.css=="string"&&n.css.indexOf(":")!==-1)throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`"+n.css+"`");var r={};for(var i in n)lm.call(n,i)&&(r[i]=n[i]);if(r[dg]=t,process.env.NODE_ENV!=="production"&&n.css&&(typeof n.css!="object"||typeof n.css.name!="string"||n.css.name.indexOf("-")===-1)){var a=QF(new Error().stack);a&&(r[fg]=a)}return r},tN=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return am(n,r,i),s3(function(){return om(n,r,i)}),null},l3=cm(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[dg],a=[r],o="";typeof e.className=="string"?o=n3(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var s=Wl(a,void 0,q.useContext(Rf));if(process.env.NODE_ENV!=="production"&&s.name.indexOf("-")===-1){var l=e[fg];l&&(s=Wl([s,"label:"+l+";"]))}o+=t.key+"-"+s.name;var u={};for(var c in e)lm.call(e,c)&&c!=="css"&&c!==dg&&(process.env.NODE_ENV==="production"||c!==fg)&&(u[c]=e[c]);return u.ref=n,u.className=o,q.createElement(q.Fragment,null,q.createElement(tN,{cache:t,serialized:s,isStringTag:typeof i=="string"}),q.createElement(i,u))});process.env.NODE_ENV!=="production"&&(l3.displayName="EmotionCssPropInternal");var nN=l3,rN={version:"11.11.4"},Te=function(t,n){var r=arguments;if(n==null||!lm.call(n,"css"))return q.createElement.apply(void 0,r);var i=r.length,a=new Array(i);a[0]=nN,a[1]=eN(t,n);for(var o=2;o<i;o++)a[o]=r[o];return q.createElement.apply(null,a)},qb=!1,iN=cm(function(e,t){process.env.NODE_ENV!=="production"&&!qb&&(e.className||e.css)&&(console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"),qb=!0);var n=e.styles,r=Wl([n],void 0,q.useContext(Rf)),i=q.useRef();return Kb(function(){var a=t.key+"-global",o=new t.sheet.constructor({key:a,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+a+" "+r.name+'"]');return t.sheet.tags.length&&(o.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",a),o.hydrate([l])),i.current=[o,s],function(){o.flush()}},[t]),Kb(function(){var a=i.current,o=a[0],s=a[1];if(s){a[1]=!1;return}if(r.next!==void 0&&om(t,r.next,!0),o.tags.length){var l=o.tags[o.tags.length-1].nextElementSibling;o.before=l,o.flush()}t.insert("",r,o,!1)},[t,r.name]),null});process.env.NODE_ENV!=="production"&&(iN.displayName="EmotionGlobal");function dm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Wl(t)}var aN=function(){var t=dm.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},oN=function e(t){for(var n=t.length,r=0,i="";r<n;r++){var a=t[r];if(a!=null){var o=void 0;switch(typeof a){case"boolean":break;case"object":{if(Array.isArray(a))o=e(a);else{process.env.NODE_ENV!=="production"&&a.styles!==void 0&&a.name!==void 0&&console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component."),o="";for(var s in a)a[s]&&s&&(o&&(o+=" "),o+=s)}break}default:o=a}o&&(i&&(i+=" "),i+=o)}}return i};function sN(e,t,n){var r=[],i=n3(e,r,n);return r.length<2?n:i+t(r)}var lN=function(t){var n=t.cache,r=t.serializedArr;return s3(function(){for(var i=0;i<r.length;i++)om(n,r[i],!1)}),null},uN=cm(function(e,t){var n=!1,r=[],i=function(){if(n&&process.env.NODE_ENV!=="production")throw new Error("css can only be used during render");for(var u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];var h=Wl(c,t.registered);return r.push(h),am(t,h,!1),t.key+"-"+h.name},a=function(){if(n&&process.env.NODE_ENV!=="production")throw new Error("cx can only be used during render");for(var u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];return sN(t.registered,i,oN(c))},o={css:i,cx:a,theme:q.useContext(Rf)},s=e.children(o);return n=!0,q.createElement(q.Fragment,null,q.createElement(lN,{cache:t,serializedArr:r}),s)});process.env.NODE_ENV!=="production"&&(uN.displayName="EmotionClassNames");if(process.env.NODE_ENV!=="production"){var Qb=!0,cN=typeof jest<"u"||typeof vi<"u";if(Qb&&!cN){var ev=typeof globalThis<"u"?globalThis:Qb?window:global,tv="__EMOTION_REACT_"+rN.version.split(".")[0]+"__";ev[tv]&&console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used."),ev[tv]=!0}}function dN(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var hg=I.useLayoutEffect,fN=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ad=function(){};function hN(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function gN(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=[].concat(r);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&a.push("".concat(hN(e,o)));return a.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var nv=function(t){return SN(t)?t.filter(Boolean):mo(t)==="object"&&t!==null?[t]:[]},u3=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=zi(t,fN);return Be({},n)},Lt=function(t,n,r){var i=t.cx,a=t.getStyles,o=t.getClassNames,s=t.className;return{css:a(n,t),className:i(r??{},o(n,t),s)}};function Bf(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function pN(e){return Bf(e)?window.innerHeight:e.clientHeight}function c3(e){return Bf(e)?window.pageYOffset:e.scrollTop}function Td(e,t){if(Bf(e)){window.scrollTo(0,t);return}e.scrollTop=t}function mN(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function bN(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Yu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ad,i=c3(e),a=t-i,o=10,s=0;function l(){s+=o;var u=bN(s,i,a,n);Td(e,u),s<n?window.requestAnimationFrame(l):r(e)}l()}function rv(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?Td(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&Td(e,Math.max(t.offsetTop-i,0))}function vN(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function iv(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function yN(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var d3=!1,xN={get passive(){return d3=!0}},Ku=typeof window<"u"?window:{};Ku.addEventListener&&Ku.removeEventListener&&(Ku.addEventListener("p",Ad,xN),Ku.removeEventListener("p",Ad,!1));var CN=d3;function EN(e){return e!=null}function SN(e){return Array.isArray(e)}function Ju(e,t,n){return e?t:n}var wN=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=Object.entries(t).filter(function(o){var s=Vi(o,1),l=s[0];return!r.includes(l)});return a.reduce(function(o,s){var l=Vi(s,2),u=l[0],c=l[1];return o[u]=c,o},{})},IN=["children","innerProps"],_N=["children","innerProps"];function DN(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,a=e.shouldScroll,o=e.isFixedPosition,s=e.controlHeight,l=mN(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,h=n.getBoundingClientRect(),f=h.bottom,g=h.height,p=h.top,m=n.offsetParent.getBoundingClientRect(),b=m.top,v=o?window.innerHeight:pN(l),x=c3(l),C=parseInt(getComputedStyle(n).marginBottom,10),E=parseInt(getComputedStyle(n).marginTop,10),w=b-E,B=v-p,y=w+x,S=d-x-p,D=f-v+x+C,A=x+p-E,T=160;switch(i){case"auto":case"bottom":if(B>=g)return{placement:"bottom",maxHeight:t};if(S>=g&&!o)return a&&Yu(l,D,T),{placement:"bottom",maxHeight:t};if(!o&&S>=r||o&&B>=r){a&&Yu(l,D,T);var F=o?B-C:S-C;return{placement:"bottom",maxHeight:F}}if(i==="auto"||o){var k=t,P=o?w:y;return P>=r&&(k=Math.min(P-C-s,t)),{placement:"top",maxHeight:k}}if(i==="bottom")return a&&Td(l,D),{placement:"bottom",maxHeight:t};break;case"top":if(w>=g)return{placement:"top",maxHeight:t};if(y>=g&&!o)return a&&Yu(l,A,T),{placement:"top",maxHeight:t};if(!o&&y>=r||o&&w>=r){var $=t;return(!o&&y>=r||o&&w>=r)&&($=o?w-E:y-E),a&&Yu(l,A,T),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function AN(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var f3=function(t){return t==="auto"?"bottom":t},TN=function(t,n){var r,i=t.placement,a=t.theme,o=a.borderRadius,s=a.spacing,l=a.colors;return Be((r={label:"menu"},tl(r,AN(i),"100%"),tl(r,"position","absolute"),tl(r,"width","100%"),tl(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},h3=I.createContext(null),RN=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,a=t.menuPlacement,o=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,u=I.useContext(h3)||{},c=u.setPortalPlacement,d=I.useRef(null),h=I.useState(i),f=Vi(h,2),g=f[0],p=f[1],m=I.useState(null),b=Vi(m,2),v=b[0],x=b[1],C=l.spacing.controlHeight;return hg(function(){var E=d.current;if(E){var w=o==="fixed",B=s&&!w,y=DN({maxHeight:i,menuEl:E,minHeight:r,placement:a,shouldScroll:B,isFixedPosition:w,controlHeight:C});p(y.maxHeight),x(y.placement),c==null||c(y.placement)}},[i,a,o,s,r,c,C]),n({ref:d,placerProps:Be(Be({},t),{},{placement:v||f3(a),maxHeight:g})})},BN=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Te("div",$e({},Lt(t,"menu",{menu:!0}),{ref:r},i),n)},$N=BN,kN=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Be({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},PN=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,a=t.isMulti;return Te("div",$e({},Lt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:i},r),n)},g3=function(t,n){var r=t.theme,i=r.spacing.baseUnit,a=r.colors;return Be({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},FN=g3,NN=g3,MN=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,a=zi(t,IN);return Te("div",$e({},Lt(Be(Be({},a),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},LN=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,a=zi(t,_N);return Te("div",$e({},Lt(Be(Be({},a),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},ON=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},VN=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,a=t.innerProps,o=t.menuPlacement,s=t.menuPosition,l=I.useRef(null),u=I.useRef(null),c=I.useState(f3(o)),d=Vi(c,2),h=d[0],f=d[1],g=I.useMemo(function(){return{setPortalPlacement:f}},[]),p=I.useState(null),m=Vi(p,2),b=m[0],v=m[1],x=I.useCallback(function(){if(i){var B=vN(i),y=s==="fixed"?0:window.pageYOffset,S=B[h]+y;(S!==(b==null?void 0:b.offset)||B.left!==(b==null?void 0:b.rect.left)||B.width!==(b==null?void 0:b.rect.width))&&v({offset:S,rect:B})}},[i,s,h,b==null?void 0:b.offset,b==null?void 0:b.rect.left,b==null?void 0:b.rect.width]);hg(function(){x()},[x]);var C=I.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=w4(i,l.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);hg(function(){C()},[C]);var E=I.useCallback(function(B){l.current=B,C()},[C]);if(!n&&s!=="fixed"||!b)return null;var w=Te("div",$e({ref:E},Lt(Be(Be({},t),{},{offset:b.offset,position:s,rect:b.rect}),"menuPortal",{"menu-portal":!0}),a),r);return Te(h3.Provider,{value:g},n?cu.createPortal(w,n):w)},HN=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},jN=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,a=t.isRtl;return Te("div",$e({},Lt(t,"container",{"--is-disabled":i,"--is-rtl":a}),r),n)},WN=function(t,n){var r=t.theme.spacing,i=t.isMulti,a=t.hasValue,o=t.selectProps.controlShouldRenderValue;return Be({alignItems:"center",display:i&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},zN=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,a=t.hasValue;return Te("div",$e({},Lt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":a}),r),n)},GN=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},UN=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Lt(t,"indicatorsContainer",{indicators:!0}),r),n)},av,XN=["size"],ZN=["innerProps","isRtl","size"];function YN(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var KN=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",toString:YN},p3=function(t){var n=t.size,r=zi(t,XN);return Te("svg",$e({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:KN},r))},fm=function(t){return Te(p3,$e({size:20},t),Te("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},m3=function(t){return Te(p3,$e({size:20},t),Te("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},b3=function(t,n){var r=t.isFocused,i=t.theme,a=i.spacing.baseUnit,o=i.colors;return Be({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},JN=b3,qN=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Lt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Te(m3,null))},QN=b3,eM=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Lt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Te(fm,null))},tM=function(t,n){var r=t.isDisabled,i=t.theme,a=i.spacing.baseUnit,o=i.colors;return Be({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},nM=function(t){var n=t.innerProps;return Te("span",$e({},n,Lt(t,"indicatorSeparator",{"indicator-separator":!0})))},rM=aN(av||(av=dN([`
104
104
  0%, 80%, 100% { opacity: 0; }
105
105
  40% { opacity: 1; }
106
- `]))),iM=function(t,n){var r=t.isFocused,i=t.size,a=t.theme,o=a.colors,s=a.spacing.baseUnit;return Be({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:s*2})},Eh=function(t){var n=t.delay,r=t.offset;return Te("span",{css:dm({animation:"".concat(rM," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */")})},aM=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,a=i===void 0?4:i,o=zi(t,ZN);return Te("div",$e({},Mt(Be(Be({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Te(Eh,{delay:0,offset:r}),Te(Eh,{delay:160,offset:!0}),Te(Eh,{delay:320,offset:!r}))},oM=function(t,n){var r=t.isDisabled,i=t.isFocused,a=t.theme,o=a.colors,s=a.borderRadius,l=a.spacing;return Be({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},sM=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,a=t.innerRef,o=t.innerProps,s=t.menuIsOpen;return Te("div",$e({ref:a},Mt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":s}),o,{"aria-disabled":r||void 0}),n)},lM=sM,uM=["data"],cM=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},dM=function(t){var n=t.children,r=t.cx,i=t.getStyles,a=t.getClassNames,o=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Te("div",$e({},Mt(t,"group",{group:!0}),l),Te(o,$e({},s,{selectProps:d,theme:c,getStyles:i,getClassNames:a,cx:r}),u),Te("div",null,n))},fM=function(t,n){var r=t.theme,i=r.colors,a=r.spacing;return Be({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},hM=function(t){var n=u3(t);n.data;var r=zi(n,uM);return Te("div",$e({},Mt(t,"groupHeading",{"group-heading":!0}),r))},gM=dM,pM=["innerRef","isDisabled","isHidden","inputClassName"],mM=function(t,n){var r=t.isDisabled,i=t.value,a=t.theme,o=a.spacing,s=a.colors;return Be(Be({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},bM),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},v3={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},bM={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Be({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},v3)},vM=function(t){return Be({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},v3)},yM=function(t){var n=t.cx,r=t.value,i=u3(t),a=i.innerRef,o=i.isDisabled,s=i.isHidden,l=i.inputClassName,u=zi(i,pM);return Te("div",$e({},Mt(t,"input",{"input-container":!0}),{"data-value":r||""}),Te("input",$e({className:n({input:!0},l),ref:a,style:vM(s),disabled:o},u)))},xM=yM,CM=function(t,n){var r=t.theme,i=r.spacing,a=r.borderRadius,o=r.colors;return Be({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:i.baseUnit/2})},EM=function(t,n){var r=t.theme,i=r.borderRadius,a=r.colors,o=t.cropWithEllipsis;return Be({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},SM=function(t,n){var r=t.theme,i=r.spacing,a=r.borderRadius,o=r.colors,s=t.isFocused;return Be({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},y3=function(t){var n=t.children,r=t.innerProps;return Te("div",r,n)},wM=y3,IM=y3;function _M(e){var t=e.children,n=e.innerProps;return Te("div",$e({role:"button"},n),t||Te(fm,{size:14}))}var DM=function(t){var n=t.children,r=t.components,i=t.data,a=t.innerProps,o=t.isDisabled,s=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Te(u,{data:i,innerProps:Be(Be({},Mt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:l},Te(c,{data:i,innerProps:Be({},Mt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Te(d,{data:i,innerProps:Be(Be({},Mt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},AM=DM,TM=function(t,n){var r=t.isDisabled,i=t.isFocused,a=t.isSelected,o=t.theme,s=o.spacing,l=o.colors;return Be({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:a?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?l.primary:l.primary50}})},RM=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,a=t.isSelected,o=t.innerRef,s=t.innerProps;return Te("div",$e({},Mt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":a}),{ref:o,"aria-disabled":r},s),n)},BM=RM,$M=function(t,n){var r=t.theme,i=r.spacing,a=r.colors;return Be({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},kM=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Mt(t,"placeholder",{placeholder:!0}),r),n)},PM=kM,FM=function(t,n){var r=t.isDisabled,i=t.theme,a=i.spacing,o=i.colors;return Be({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},NM=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Te("div",$e({},Mt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},MM=NM,x3={ClearIndicator:eM,Control:lM,DropdownIndicator:qN,DownChevron:m3,CrossIcon:fm,Group:gM,GroupHeading:hM,IndicatorsContainer:UN,IndicatorSeparator:nM,Input:xM,LoadingIndicator:aM,Menu:$N,MenuList:PN,MenuPortal:VN,LoadingMessage:LN,NoOptionsMessage:MN,MultiValue:AM,MultiValueContainer:wM,MultiValueLabel:IM,MultiValueRemove:_M,Option:BM,Placeholder:PM,SelectContainer:jN,SingleValue:MM,ValueContainer:zN},LM=function(t){return Be(Be({},x3),t.components)},ov=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function OM(e,t){return!!(e===t||ov(e)&&ov(t))}function VM(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!OM(e[n],t[n]))return!1;return!0}function HM(e,t){t===void 0&&(t=VM);var n=null;function r(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}function jM(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var WM=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:jM},zM=function(t){return Te("span",$e({css:WM},t))},sv=zM,GM={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,a=t.context,o=t.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,a=t.labels,o=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,a=t.label,o=a===void 0?"":a,s=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,m){return p&&p.length?"".concat(p.indexOf(m)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(o," focused, ").concat(d(s,r),".");if(n==="menu"&&c){var h=l?" disabled":"",f="".concat(u?" selected":"").concat(h);return"".concat(o).concat(f,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},UM=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.focusableOptions,o=t.isFocused,s=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,h=l.getOptionLabel,f=l.inputValue,g=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,b=l.menuIsOpen,v=l.options,x=l.screenReaderStatus,C=l.tabSelectsValue,E=l.isLoading,w=l["aria-label"],B=l["aria-live"],y=I.useMemo(function(){return Be(Be({},GM),d||{})},[d]),S=I.useMemo(function(){var P="";if(n&&y.onChange){var $=n.option,R=n.options,O=n.removedValue,j=n.removedValues,V=n.value,W=function(te){return Array.isArray(te)?null:te},U=O||$||W(V),K=U?h(U):"",ee=R||j||void 0,z=ee?ee.map(h):[],H=Be({isDisabled:U&&p(U,s),label:K,labels:z},n);P=y.onChange(H)}return P},[n,y,p,s,h]),D=I.useMemo(function(){var P="",$=r||i,R=!!(r&&s&&s.includes(r));if($&&y.onFocus){var O={focused:$,label:h($),isDisabled:p($,s),isSelected:R,options:a,context:$===r?"menu":"value",selectValue:s,isAppleDevice:c};P=y.onFocus(O)}return P},[r,i,h,p,y,a,s,c]),A=I.useMemo(function(){var P="";if(b&&v.length&&!E&&y.onFilter){var $=x({count:a.length});P=y.onFilter({inputValue:f,resultsMessage:$})}return P},[a,f,b,y,v,x,E]),T=(n==null?void 0:n.action)==="initial-input-focus",F=I.useMemo(function(){var P="";if(y.guidance){var $=i?"value":b?"menu":"input";P=y.guidance({"aria-label":w,context:$,isDisabled:r&&p(r,s),isMulti:g,isSearchable:m,tabSelectsValue:C,isInitialFocus:T})}return P},[w,r,i,g,p,m,b,y,s,C,T]),k=Te(I.Fragment,null,Te("span",{id:"aria-selection"},S),Te("span",{id:"aria-focused"},D),Te("span",{id:"aria-results"},A),Te("span",{id:"aria-guidance"},F));return Te(I.Fragment,null,Te(sv,{id:u},T&&k),Te(sv,{"aria-live":B,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!T&&k))},XM=UM,gg=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],ZM=new RegExp("["+gg.map(function(e){return e.letters}).join("")+"]","g"),C3={};for(var Sh=0;Sh<gg.length;Sh++)for(var wh=gg[Sh],Ih=0;Ih<wh.letters.length;Ih++)C3[wh.letters[Ih]]=wh.base;var E3=function(t){return t.replace(ZM,function(n){return C3[n]})},YM=HM(E3),lv=function(t){return t.replace(/^\s+|\s+$/g,"")},KM=function(t){return"".concat(t.label," ").concat(t.value)},JM=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Be({ignoreCase:!0,ignoreAccents:!0,stringify:KM,trim:!0,matchFrom:"any"},t),a=i.ignoreCase,o=i.ignoreAccents,s=i.stringify,l=i.trim,u=i.matchFrom,c=l?lv(r):r,d=l?lv(s(n)):s(n);return a&&(c=c.toLowerCase(),d=d.toLowerCase()),o&&(c=YM(c),d=E3(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},qM=["innerRef"];function QM(e){var t=e.innerRef,n=zi(e,qM),r=wN(n,"onExited","in","enter","exit","appear");return Te("input",$e({ref:t},r,{css:dm({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")}))}var eL=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function tL(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,a=e.onTopLeave,o=I.useRef(!1),s=I.useRef(!1),l=I.useRef(0),u=I.useRef(null),c=I.useCallback(function(m,b){if(u.current!==null){var v=u.current,x=v.scrollTop,C=v.scrollHeight,E=v.clientHeight,w=u.current,B=b>0,y=C-E-x,S=!1;y>b&&o.current&&(r&&r(m),o.current=!1),B&&s.current&&(a&&a(m),s.current=!1),B&&b>y?(n&&!o.current&&n(m),w.scrollTop=C,S=!0,o.current=!0):!B&&-b>x&&(i&&!s.current&&i(m),w.scrollTop=0,S=!0,s.current=!0),S&&eL(m)}},[n,r,i,a]),d=I.useCallback(function(m){c(m,m.deltaY)},[c]),h=I.useCallback(function(m){l.current=m.changedTouches[0].clientY},[]),f=I.useCallback(function(m){var b=l.current-m.changedTouches[0].clientY;c(m,b)},[c]),g=I.useCallback(function(m){if(m){var b=CN?{passive:!1}:!1;m.addEventListener("wheel",d,b),m.addEventListener("touchstart",h,b),m.addEventListener("touchmove",f,b)}},[f,h,d]),p=I.useCallback(function(m){m&&(m.removeEventListener("wheel",d,!1),m.removeEventListener("touchstart",h,!1),m.removeEventListener("touchmove",f,!1))},[f,h,d]);return I.useEffect(function(){if(t){var m=u.current;return g(m),function(){p(m)}}},[t,g,p]),function(m){u.current=m}}var uv=["boxSizing","height","overflow","paddingRight","position"],cv={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function dv(e){e.preventDefault()}function fv(e){e.stopPropagation()}function hv(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function gv(){return"ontouchstart"in window||navigator.maxTouchPoints}var pv=!!(typeof window<"u"&&window.document&&window.document.createElement),Vs=0,No={capture:!1,passive:!1};function nL(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=I.useRef({}),a=I.useRef(null),o=I.useCallback(function(l){if(pv){var u=document.body,c=u&&u.style;if(r&&uv.forEach(function(g){var p=c&&c[g];i.current[g]=p}),r&&Vs<1){var d=parseInt(i.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,f=window.innerWidth-h+d||0;Object.keys(cv).forEach(function(g){var p=cv[g];c&&(c[g]=p)}),c&&(c.paddingRight="".concat(f,"px"))}u&&gv()&&(u.addEventListener("touchmove",dv,No),l&&(l.addEventListener("touchstart",hv,No),l.addEventListener("touchmove",fv,No))),Vs+=1}},[r]),s=I.useCallback(function(l){if(pv){var u=document.body,c=u&&u.style;Vs=Math.max(Vs-1,0),r&&Vs<1&&uv.forEach(function(d){var h=i.current[d];c&&(c[d]=h)}),u&&gv()&&(u.removeEventListener("touchmove",dv,No),l&&(l.removeEventListener("touchstart",hv,No),l.removeEventListener("touchmove",fv,No)))}},[r]);return I.useEffect(function(){if(t){var l=a.current;return o(l),function(){s(l)}}},[t,o,s]),function(l){a.current=l}}function rL(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var iL=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},aL=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:rL};function oL(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,a=e.onBottomArrive,o=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,u=tL({isEnabled:i,onBottomArrive:a,onBottomLeave:o,onTopArrive:s,onTopLeave:l}),c=nL({isEnabled:n}),d=function(f){u(f),c(f)};return Te(I.Fragment,null,n&&Te("div",{onClick:iL,css:aL}),t(d))}function sL(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var lL=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:sL},uL=function(t){var n=t.name,r=t.onFocus;return Te("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:lL,value:"",onChange:function(){}})},cL=uL;function hm(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function dL(){return hm(/^iPhone/i)}function S3(){return hm(/^Mac/i)}function fL(){return hm(/^iPad/i)||S3()&&navigator.maxTouchPoints>1}function hL(){return dL()||fL()}function gL(){return S3()||hL()}var pL=function(t){return t.label},mL=function(t){return t.label},bL=function(t){return t.value},vL=function(t){return!!t.isDisabled},yL={clearIndicator:QN,container:HN,control:oM,dropdownIndicator:JN,group:cM,groupHeading:fM,indicatorsContainer:GN,indicatorSeparator:tM,input:mM,loadingIndicator:iM,loadingMessage:NN,menu:TN,menuList:kN,menuPortal:ON,multiValue:CM,multiValueLabel:EM,multiValueRemove:SM,noOptionsMessage:FN,option:TM,placeholder:$M,singleValue:FM,valueContainer:WN},xL={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},CL=4,w3=4,EL=38,SL=w3*2,wL={baseUnit:w3,controlHeight:EL,menuGutter:SL},_h={borderRadius:CL,colors:xL,spacing:wL},IL={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:iv(),captureMenuScroll:!iv(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:JM(),formatGroupLabel:pL,getOptionLabel:mL,getOptionValue:bL,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:vL,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!yN(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function mv(e,t,n,r){var i=D3(e,t,n),a=A3(e,t,n),o=_3(e,t),s=Rd(e,t);return{type:"option",data:t,isDisabled:i,isSelected:a,label:o,value:s,index:r}}function Lc(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,s){return mv(e,o,t,s)}).filter(function(o){return vv(e,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var a=mv(e,n,t,r);return vv(e,a)?a:void 0}).filter(EN)}function I3(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Qp(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function bv(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Qp(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function _L(e,t){return I3(Lc(e,t))}function vv(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,a=t.isSelected,o=t.label,s=t.value;return(!R3(e)||!a)&&T3(e,{label:o,value:s,data:i},r)}function DL(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var a=t.indexOf(n);if(a>-1)return n;if(i<t.length)return t[i]}return null}function AL(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Dh=function(t,n){var r,i=(r=t.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return i||null},_3=function(t,n){return t.getOptionLabel(n)},Rd=function(t,n){return t.getOptionValue(n)};function D3(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function A3(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Rd(e,t);return n.some(function(i){return Rd(e,i)===r})}function T3(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var R3=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},TL=1,B3=function(e){UP(n,e);var t=YP(n);function n(r){var i;if(zP(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=gL(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,h=c.name;u.name=h,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,h=d.closeMenuOnSelect,f=d.isMulti,g=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:g}),h&&(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,h=u.name,f=i.state.selectValue,g=d&&i.isOptionSelected(l,f),p=i.isOptionDisabled(l,f);if(g){var m=i.getOptionValue(l);i.setValue(f.filter(function(b){return i.getOptionValue(b)!==m}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(Qp(f),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:h});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),h=c.filter(function(g){return i.getOptionValue(g)!==d}),f=Ju(u,h,h[0]||null);i.onChange(f,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(Ju(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),h=Ju(l,d,d[0]||null);i.onChange(h,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return Dh(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return bv(Lc(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return gN.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return _3(i.props,l)},i.getOptionValue=function(l){return Rd(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=yL[l](u,c);d.boxSizing="border-box";var h=i.props.styles[l];return h?h(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return LM(i.props)},i.buildCategorizedOptions=function(){return Lc(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return I3(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Be({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Bf(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),h=Math.abs(c.clientY-i.initialTouchY),f=5;i.userIsDragging=d>f||h>f}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return R3(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,h=u.escapeClearsValue,f=u.inputValue,g=u.isClearable,p=u.isDisabled,m=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,x=u.openMenuOnFocus,C=i.state,E=C.focusedOption,w=C.focusedValue,B=C.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||f)return;i.focusValue("previous");break;case"ArrowRight":if(!c||f)return;i.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(w)i.removeValue(w);else{if(!d)return;c?i.popValue():g&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!m||!v||!E||x&&i.isOptionSelected(E,B))return;i.selectOption(E);break;case"Enter":if(l.keyCode===229)break;if(m){if(!E||i.isComposing)return;i.selectOption(E);break}return;case"Escape":m?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:f}),i.onMenuClose()):g&&h&&i.clearValue();break;case" ":if(f)return;if(!m){i.openMenu("first");break}if(!E)return;i.selectOption(E);break;case"ArrowUp":m?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":m?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!m)return;i.focusOption("pageup");break;case"PageDown":if(!m)return;i.focusOption("pagedown");break;case"Home":if(!m)return;i.focusOption("first");break;case"End":if(!m)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++TL),i.state.selectValue=nv(r.value),r.menuIsOpen&&i.state.selectValue.length){var a=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),s=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=a,i.state.focusedOption=o[s],i.state.focusedOptionId=Dh(a,o[s])}return i}return GP(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&rv(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isDisabled,s=a.menuIsOpen,l=this.state.isFocused;(l&&!o&&i.isDisabled||l&&s&&!i.menuIsOpen)&&this.focusInput(),l&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(rv(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,o=this.state,s=o.selectValue,l=o.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,o=a.selectValue,s=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=o.indexOf(s);s||(l=-1);var u=o.length-1,c=-1;if(o.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:o[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(o);o||(u=-1),i==="up"?l=u>0?u-1:s.length-1:i==="down"?l=(u+1)%s.length:i==="pageup"?(l=u-a,l<0&&(l=0)):i==="pagedown"?(l=u+a,l>s.length-1&&(l=s.length-1)):i==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(_h):Be(Be({},_h),this.props.theme):_h}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,o=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,h=d.isMulti,f=d.isRtl,g=d.options,p=this.hasValue();return{clearValue:i,cx:a,getStyles:o,getClassNames:s,getValue:l,hasValue:p,isMulti:h,isRtl:f,options:g,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,o=i.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(i,a){return D3(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return A3(this.props,i,a)}},{key:"filterOption",value:function(i,a){return T3(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:o,selectValue:s})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,o=i.isSearchable,s=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,h=i.required,f=this.getComponents(),g=f.Input,p=this.state,m=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,x=s||this.getElementId("input"),C=Be(Be(Be({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(b==null?void 0:b.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?q.createElement(g,$e({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:a,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},C)):q.createElement(QM,$e({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ad,onFocus:this.onInputFocus,disabled:a,tabIndex:u,inputMode:"none",form:c,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),o=a.MultiValue,s=a.MultiValueContainer,l=a.MultiValueLabel,u=a.MultiValueRemove,c=a.SingleValue,d=a.Placeholder,h=this.commonProps,f=this.props,g=f.controlShouldRenderValue,p=f.isDisabled,m=f.isMulti,b=f.inputValue,v=f.placeholder,x=this.state,C=x.selectValue,E=x.focusedValue,w=x.isFocused;if(!this.hasValue()||!g)return b?null:q.createElement(d,$e({},h,{key:"placeholder",isDisabled:p,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),v);if(m)return C.map(function(y,S){var D=y===E,A="".concat(i.getOptionLabel(y),"-").concat(i.getOptionValue(y));return q.createElement(o,$e({},h,{components:{Container:s,Label:l,Remove:u},isFocused:D,isDisabled:p,key:A,index:S,removeProps:{onClick:function(){return i.removeValue(y)},onTouchEnd:function(){return i.removeValue(y)},onMouseDown:function(F){F.preventDefault()}},data:y}),i.formatOptionLabel(y,"value"))});if(b)return null;var B=C[0];return q.createElement(c,$e({},h,{data:B,isDisabled:p}),this.formatOptionLabel(B,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,o=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!a||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return q.createElement(a,$e({},o,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,o=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!a||!u)return null;var d={"aria-hidden":"true"};return q.createElement(a,$e({},o,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,o=i.IndicatorSeparator;if(!a||!o)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return q.createElement(o,$e({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var o=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return q.createElement(a,$e({},o,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),o=a.Group,s=a.GroupHeading,l=a.Menu,u=a.MenuList,c=a.MenuPortal,d=a.LoadingMessage,h=a.NoOptionsMessage,f=a.Option,g=this.commonProps,p=this.state.focusedOption,m=this.props,b=m.captureMenuScroll,v=m.inputValue,x=m.isLoading,C=m.loadingMessage,E=m.minMenuHeight,w=m.maxMenuHeight,B=m.menuIsOpen,y=m.menuPlacement,S=m.menuPosition,D=m.menuPortalTarget,A=m.menuShouldBlockScroll,T=m.menuShouldScrollIntoView,F=m.noOptionsMessage,k=m.onMenuScrollToTop,P=m.onMenuScrollToBottom;if(!B)return null;var $=function(K,ee){var z=K.type,H=K.data,X=K.isDisabled,te=K.isSelected,ie=K.label,le=K.value,ce=p===H,Q=X?void 0:function(){return i.onOptionHover(H)},be=X?void 0:function(){return i.selectOption(H)},Ce="".concat(i.getElementId("option"),"-").concat(ee),Se={id:Ce,onClick:be,onMouseMove:Q,onMouseOver:Q,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:te};return q.createElement(f,$e({},g,{innerProps:Se,data:H,isDisabled:X,isSelected:te,key:Ce,label:ie,type:z,value:le,isFocused:ce,innerRef:ce?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(K.data,"menu"))},R;if(this.hasOptions())R=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var K=U.data,ee=U.options,z=U.index,H="".concat(i.getElementId("group"),"-").concat(z),X="".concat(H,"-heading");return q.createElement(o,$e({},g,{key:H,data:K,options:ee,Heading:s,headingProps:{id:X,data:U.data},label:i.formatGroupLabel(U.data)}),U.options.map(function(te){return $(te,"".concat(z,"-").concat(te.index))}))}else if(U.type==="option")return $(U,"".concat(U.index))});else if(x){var O=C({inputValue:v});if(O===null)return null;R=q.createElement(d,g,O)}else{var j=F({inputValue:v});if(j===null)return null;R=q.createElement(h,g,j)}var V={minMenuHeight:E,maxMenuHeight:w,menuPlacement:y,menuPosition:S,menuShouldScrollIntoView:T},W=q.createElement(RN,$e({},g,V),function(U){var K=U.ref,ee=U.placerProps,z=ee.placement,H=ee.maxHeight;return q.createElement(l,$e({},g,V,{innerRef:K,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:z}),q.createElement(oL,{captureEnabled:b,onTopArrive:k,onBottomArrive:P,lockEnabled:A},function(X){return q.createElement(u,$e({},g,{innerRef:function(ie){i.getMenuListRef(ie),X(ie)},innerProps:{role:"listbox","aria-multiselectable":g.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:H,focusedOption:p}),R)}))});return D||S==="fixed"?q.createElement(c,$e({},g,{appendTo:D,controlElement:this.controlRef,menuPlacement:y,menuPosition:S}),W):W}},{key:"renderFormField",value:function(){var i=this,a=this.props,o=a.delimiter,s=a.isDisabled,l=a.isMulti,u=a.name,c=a.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return q.createElement(cL,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(o){var h=d.map(function(p){return i.getOptionValue(p)}).join(o);return q.createElement("input",{name:u,type:"hidden",value:h})}else{var f=d.length>0?d.map(function(p,m){return q.createElement("input",{key:"i-".concat(m),name:u,type:"hidden",value:i.getOptionValue(p)})}):q.createElement("input",{name:u,type:"hidden",value:""});return q.createElement("div",null,f)}else{var g=d[0]?this.getOptionValue(d[0]):"";return q.createElement("input",{name:u,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,o=a.ariaSelection,s=a.focusedOption,l=a.focusedValue,u=a.isFocused,c=a.selectValue,d=this.getFocusableOptions();return q.createElement(XM,$e({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,o=i.IndicatorsContainer,s=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,h=u.isDisabled,f=u.menuIsOpen,g=this.state.isFocused,p=this.commonProps=this.getCommonProps();return q.createElement(s,$e({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:g}),this.renderLiveRegion(),q.createElement(a,$e({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:g,menuIsOpen:f}),q.createElement(l,$e({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),q.createElement(o,$e({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var o=a.prevProps,s=a.clearFocusValueOnUpdate,l=a.inputIsHiddenAfterUpdate,u=a.ariaSelection,c=a.isFocused,d=a.prevWasFocused,h=a.instancePrefix,f=i.options,g=i.value,p=i.menuIsOpen,m=i.inputValue,b=i.isMulti,v=nv(g),x={};if(o&&(g!==o.value||f!==o.options||p!==o.menuIsOpen||m!==o.inputValue)){var C=p?_L(i,v):[],E=p?bv(Lc(i,v),"".concat(h,"-option")):[],w=s?DL(a,v):null,B=AL(a,C),y=Dh(E,B);x={selectValue:v,focusedOption:B,focusedOptionId:y,focusableOptionsWithIds:E,focusedValue:w,clearFocusValueOnUpdate:!1}}var S=l!=null&&i!==o?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},D=u,A=c&&d;return c&&!A&&(D={value:Ju(b,v,v[0]||null),options:v,action:"initial-input-focus"},A=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(D=null),Be(Be(Be({},x),S),{},{prevProps:i,ariaSelection:D,prevWasFocused:A})}}]),n}(I.Component);B3.defaultProps=IL;var RL=I.forwardRef(function(e,t){var n=WP(e);return q.createElement(B3,$e({ref:t},n))}),BL=RL;const $L="_container_2k8uz_109",Oc={container:$L,"error-payhere":"_error-payhere_2k8uz_109","error-laba":"_error-laba_2k8uz_307","error-bill":"_error-bill_2k8uz_421"},kL={control:e=>({...e,border:"1px solid #D6D6D6","&:hover":{borderColor:"#0163C8"},borderRadius:"4px",outline:"none",boxShadow:"none",color:"#898989",backgroundColor:"white",margin:"0px",cursor:"text",minHeight:32,fontSize:"12px",lineHeight:"16px",fontFamily:"Lato"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Lato",cursor:"pointer",background:t.isSelected?"#F0F7FF":"white",color:t.isSelected?"#0163C8":e.color,"&:hover":{background:t.isDisabled?"":"#F0F7FF",color:t.isDisabled?"":"#0163C8",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"12px",lineHeight:"16px",fontFamily:"Lato"})},PL={control:e=>({...e,border:"1px solid #BDBDBD","&:hover":{borderColor:"#64B5F6"},borderRadius:"6px",outline:"none",color:"#212121",backgroundColor:"white",margin:"0px",cursor:"text",minHeight:38,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter",marginBottom:"5px"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter",cursor:"pointer",background:t.isSelected?"#E1F5FE":"white",color:t.isSelected?"#1565C0":e.color,"&:hover":{background:t.isDisabled?"":"#E1F5FE",color:t.isDisabled?"":"#1565C0",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter"})},FL={control:e=>({...e,border:"1px solid #BDBDBD","&:hover":{borderColor:"#64B5F6"},borderRadius:"6px",outline:"none",color:"#212121",backgroundColor:"white",margin:"0px",cursor:"text",minHeight:38,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans",marginBottom:"5px"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px",borderRadius:"12px"}),menuList:e=>({...e,borderRadius:"12px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans",cursor:"pointer",background:t.isSelected?"#F0FEFD":"white",color:t.isSelected?"#2F7E79":e.color,"&:hover":{background:t.isDisabled?"":"#F0FEFD",color:t.isDisabled?"":"#2F7E79",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans"})},NL={control:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Lato",cursor:"pointer",background:t.isSelected?"#F0F7FF":"white",color:t.isSelected?"#0163C8":e.color,"&:hover":{background:t.isDisabled?"":"#F0F7FF",color:t.isDisabled?"":"#0163C8",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"12px",lineHeight:"16px",fontFamily:"Lato"})},ML={control:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter",cursor:"pointer",background:t.isSelected?"#E1F5FE":"white",color:t.isSelected?"#1565C0":e.color,"&:hover":{background:t.isDisabled?"":"#E1F5FE",color:t.isDisabled?"":"#1565C0",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter"})},LL={control:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px",borderRadius:"12px"}),menuList:e=>({...e,borderRadius:"12px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans",fontWeight:"500",cursor:"pointer",background:t.isSelected?"#F0FEFD":"white",color:t.isSelected?"#2F7E79":e.color,"&:hover":{background:t.isDisabled?"":"#F0FEFD",color:t.isDisabled?"":"#2F7E79",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans"})},qu={error:{laba:Oc["error-laba"],payhere:Oc["error-payhere"],bill:Oc["error-bill"]},variant:{laba:kL,payhere:PL,bill:FL},noSearchVariant:{laba:NL,payhere:ML,bill:LL},classNamePopover:{laba:"",payhere:"",bill:"!1ru-rounded-xl"}},$3=I.forwardRef((e,t)=>{const{width:n,children:r,components:i,classNameContainer:a="",classNameContainerShowSelect:o="",classNameContainerSelect:s="",classNameLabelError:l="",error:u,onChange:c,externalValue:d=!1,defaultValueButtonDropdown:h={},autoClose:f=!0,onMenuOpen:g=()=>{},autoCloseOutside:p=!0,styleInnerPopper:m={},onMenuClose:b=()=>{},zIndexPopper:v=0,id:x="select-dropdown-container",idPopover:C="select-dropdown-container-popover",useAutoPlacement:E,flipOptions:w,autoPlacementOptions:B,withSearch:y=!1,floatingOptions:S={},offsetPopover:D=5,selectProps:A={},errorLabel:T="payhere",controlType:F="payhere",actionValueChange:k=()=>{},...P}=e,$=I.useRef(null),R=I.useRef(null),[O,j]=I.useState(""),[V,W]=I.useState(!1),[U,K]=I.useState({}),[ee,z]=I.useState(0),H=Q=>{var be;(be=R.current)==null||be.setShow(Q),W(Q)},X=()=>{if(d)return e.isMulti?h:[h]},te=Q=>{var be;(be=R.current)==null||be.handlerShow(Q),z($.current.offsetWidth),W(Ce=>!Ce)},ie=()=>{var Q;p&&((Q=R.current)==null||Q.setShow(!1))},le=(Q,be)=>{var Ce;f&&(W(!1),(Ce=R.current)==null||Ce.setShow(!1)),typeof c=="function"&&c(Q,be),d||K(Q)},ce=()=>{$.current&&z($.current.offsetWidth)};return ba(()=>{d&&K(h),k(h)},[d,h]),I.useEffect(()=>{V?g():V||(b(),j(""))},[V]),I.useImperativeHandle(t,()=>({selectValue:U,setSelectValue:K,handlerClose:ie,handlerShow:te,show:V,setShow:H}),[V,Ol(U)]),I.useEffect(()=>(window.addEventListener("resize",ce),window.addEventListener("load",ce),()=>{window.removeEventListener("resize",ce),window.removeEventListener("load",ce)}),[$]),_.jsxs("div",{id:x,className:`${Oc.container} ${a} ${V?`${o} open-popover`:null}`,ref:$,children:[r({selectValue:U,setSelectValue:K,handlerClose:ie,handlerShow:te,show:V,setShow:H}),_.jsx(pi,{ref:R,offset:D,useAutoPlacement:E,flipOptions:w,autoPlacementOptions:B,zIndex:v,styleInnerPopover:m,id:C,width:typeof n=="function"?n(ee,U):n||ee,className:`${s} ${qu.classNamePopover[F]}`,floatingOptions:S,children:_.jsx(BL,{className:"1ru-w-full",defaultValue:X(),inputValue:O,onInputChange:(Q,{action:be})=>{be==="input-change"&&j(Q)},openMenuOnFocus:!0,autoFocus:!1,backspaceRemovesValue:!1,components:{IndicatorSeparator:null,...i},controlShouldRenderValue:!1,hideSelectedOptions:!1,isClearable:!1,menuIsOpen:!0,tabSelectsValue:!1,styles:y?qu.variant[F]:qu.noSearchVariant[F],noOptionsMessage:()=>"Tidak ada data.",onChange:le,selectProps:{...A,setShowDropdown:H},...P})}),_.jsx("div",{className:`${qu.error[T]} ${l}`,children:u})]})});$3.displayName="SelectDropdownContainer";function as(e,t){return e-t*Math.floor(e/t)}const k3=1721426;function eo(e,t,n,r){t=Su(e,t);let i=t-1,a=-2;return n<=2?a=0:ca(t)&&(a=-1),k3-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function ca(e){return e%4===0&&(e%100!==0||e%400===0)}function Su(e,t){return e==="BC"?1-t:t}function $f(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const OL={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class ar{fromJulianDay(t){let n=t,r=n-k3,i=Math.floor(r/146097),a=as(r,146097),o=Math.floor(a/36524),s=as(a,36524),l=Math.floor(s/1461),u=as(s,1461),c=Math.floor(u/365),d=i*400+o*100+l*4+c+(o!==4&&c!==4?1:0),[h,f]=$f(d),g=n-eo(h,f,1,1),p=2;n<eo(h,f,3,1)?p=0:ca(f)&&(p=1);let m=Math.floor(((g+p)*12+373)/367),b=n-eo(h,f,m,1)+1;return new Ot(h,f,m,b)}toJulianDay(t){return eo(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return OL[ca(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ca(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const VL={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Gt(e,t){return t=rn(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function pg(e,t){return e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function HL(e,t){return Gt(e,gm(t))}function kf(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1-UL(t))%7;return r<0&&(r+=7),r}function jL(e){return ai(Date.now(),e)}function gm(e){return Bn(jL(e))}function P3(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function F3(e,t){return yv(e)-yv(t)}function yv(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ah=null;function Kn(){return Ah==null&&(Ah=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ah}function wu(e){return e.subtract({days:e.day-1})}function mg(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function WL(e){return wu(e.subtract({months:e.month-1}))}function zl(e,t){let n=kf(e,t);return e.subtract({days:n})}function zL(e,t){return zl(e,t).add({days:6})}const xv=new Map;function GL(e){if(Intl.Locale){let n=xv.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&xv.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function UL(e){let t=GL(e);return t&&VL[t]||0}function N3(e,t){let n=e.calendar.getDaysInMonth(e);return Math.ceil((kf(wu(e),t)+n)/7)}function pm(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function mm(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}function xs(e){e=rn(e,new ar);let t=Su(e.era,e.year);return M3(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function M3(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function bg(e,t){if(t==="UTC")return 0;if(e>0&&t===Kn())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=L3(e,t);return M3(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}const Cv=new Map;function L3(e,t){let n=Cv.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Cv.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let a of r)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const Ev=864e5;function XL(e,t,n,r){return(n===r?[n]:[n,r]).filter(a=>ZL(e,t,a))}function ZL(e,t,n){let r=L3(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Ri(e,t,n="compatible"){let r=Ia(e);if(t==="UTC")return xs(r);if(t===Kn()&&n==="compatible"){r=rn(r,new ar);let l=new Date,u=Su(r.era,r.year);return l.setFullYear(u,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let i=xs(r),a=bg(i-Ev,t),o=bg(i+Ev,t),s=XL(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-a,i-o);case"compatible":case"later":return Math.max(i-a,i-o);case"reject":throw new RangeError("No such absolute time found")}}function O3(e,t,n="compatible"){return new Date(Ri(e,t,n))}function ai(e,t){let n=bg(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),l=r.getUTCMinutes(),u=r.getUTCSeconds(),c=r.getUTCMilliseconds();return new Ul(i,a,o,t,n,s,l,u,c)}function Sv(e,t){return ai(e.getTime(),t)}function Bn(e){return new Ot(e.calendar,e.era,e.year,e.month,e.day)}function Ia(e,t){let n=0,r=0,i=0,a=0;if("timeZone"in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new Bd(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function rn(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,bo(r),r}function YL(e,t,n){if(e instanceof Ul)return e.timeZone===t?e:JL(e,t);let r=Ri(e,t,n);return ai(r,t)}function KL(e){let t=xs(e)-e.offset;return new Date(t)}function JL(e,t){let n=xs(e)-e.offset;return rn(ai(n,t),e.calendar)}const Hs=36e5;function Pf(e,t){let n=e.copy(),r="hour"in n?W3(n,t):0;vg(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,yg(n),V3(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,qL(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,o;let l=(a=(o=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(o,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function vg(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function yg(e){for(;e.month<1;)vg(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,vg(e,1)}function qL(e){for(;e.day<1;)e.month--,yg(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,yg(e)}function V3(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function bo(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),V3(e)}function bm(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function H3(e,t){return Pf(e,bm(t))}function vm(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),bo(n),n}function Gl(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),j3(n),n}function QL(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Qu(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Qu(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Qu(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Qu(e.hour,24),t}function j3(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Qu(e,t){let n=e%t;return n<0&&(n+=t),n}function W3(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,QL(e)}function z3(e,t){let n=e.copy();return W3(n,t),n}function eO(e,t){return z3(e,bm(t))}function ym(e,t,n,r){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),l=s.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Ni(l,n,0,s.length-1,r==null?void 0:r.round),i.era=s[l],bo(i);break}case"year":var a,o;!((a=(o=i.calendar).isInverseEra)===null||a===void 0)&&a.call(o,i)&&(n=-n),i.year=Ni(e.year,n,-1/0,9999,r==null?void 0:r.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Ni(e.month,n,1,e.calendar.getMonthsInYear(e),r==null?void 0:r.round);break;case"day":i.day=Ni(e.day,n,1,e.calendar.getDaysInMonth(e),r==null?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),bo(i),i}function xm(e,t,n,r){let i=e.copy();switch(t){case"hour":{let a=e.hour,o=0,s=23;if((r==null?void 0:r.hourCycle)===12){let l=a>=12;o=l?12:0,s=l?23:11}i.hour=Ni(a,n,o,s,r==null?void 0:r.round);break}case"minute":i.minute=Ni(e.minute,n,0,59,r==null?void 0:r.round);break;case"second":i.second=Ni(e.second,n,0,59,r==null?void 0:r.round);break;case"millisecond":i.millisecond=Ni(e.millisecond,n,0,999,r==null?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return i}function Ni(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e<n&&(e=r);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function G3(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let i=Pf(Ia(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Ri(i,e.timeZone)}else n=xs(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=ai(n,e.timeZone);return rn(r,e.calendar)}function tO(e,t){return G3(e,bm(t))}function nO(e,t,n,r){switch(t){case"hour":{let i=0,a=23;if((r==null?void 0:r.hourCycle)===12){let g=e.hour>=12;i=g?12:0,a=g?23:11}let o=Ia(e),s=rn(Gl(o,{hour:i}),new ar),l=[Ri(s,e.timeZone,"earlier"),Ri(s,e.timeZone,"later")].filter(g=>ai(g,e.timeZone).day===s.day)[0],u=rn(Gl(o,{hour:a}),new ar),c=[Ri(u,e.timeZone,"earlier"),Ri(u,e.timeZone,"later")].filter(g=>ai(g,e.timeZone).day===u.day).pop(),d=xs(e)-e.offset,h=Math.floor(d/Hs),f=d%Hs;return d=Ni(h,n,Math.floor(l/Hs),Math.floor(c/Hs),r==null?void 0:r.round)*Hs+f,rn(ai(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return xm(e,t,n,r);case"era":case"year":case"month":case"day":{let i=ym(Ia(e),t,n,r),a=Ri(i,e.timeZone);return rn(ai(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function rO(e,t,n){let r=Ia(e),i=Gl(vm(r,t),t);if(i.compare(r)===0)return e;let a=Ri(i,e.timeZone,n);return rn(ai(a,e.timeZone),e.calendar)}const iO=/^(\d{4})-(\d{2})-(\d{2})$/;function Cm(e){let t=e.match(iO);if(!t)throw new Error("Invalid ISO 8601 date string: "+e);let n=new Ot(Th(t[1],0,9999),Th(t[2],1,12),1);return n.day=Th(t[3],0,n.calendar.getDaysInMonth(n)),n}function Th(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function U3(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function X3(e){let t=rn(e,new ar);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Z3(e){return`${X3(e)}T${U3(e)}`}function aO(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function oO(e){return`${Z3(e)}${aO(e.offset)}[${e.timeZone}]`}function sO(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iu(e,t,n){sO(e,t),t.set(e,n)}function Em(e){let t=typeof e[0]=="object"?e.shift():new ar,n;if(typeof e[0]=="string")n=e.shift();else{let o=t.getEras();n=o[o.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var lO=new WeakMap;class Ot{copy(){return this.era?new Ot(this.calendar,this.era,this.year,this.month,this.day):new Ot(this.calendar,this.year,this.month,this.day)}add(t){return Pf(this,t)}subtract(t){return H3(this,t)}set(t){return vm(this,t)}cycle(t,n,r){return ym(this,t,n,r)}toDate(t){return O3(this,t)}toString(){return X3(this)}compare(t){return P3(this,t)}constructor(...t){Iu(this,lO,{writable:!0,value:void 0});let[n,r,i,a,o]=Em(t);this.calendar=n,this.era=r,this.year=i,this.month=a,this.day=o,bo(this)}}var uO=new WeakMap;class Sm{copy(){return new Sm(this.hour,this.minute,this.second,this.millisecond)}add(t){return z3(this,t)}subtract(t){return eO(this,t)}set(t){return Gl(this,t)}cycle(t,n,r){return xm(this,t,n,r)}toString(){return U3(this)}compare(t){return F3(this,t)}constructor(t=0,n=0,r=0,i=0){Iu(this,uO,{writable:!0,value:void 0}),this.hour=t,this.minute=n,this.second=r,this.millisecond=i,j3(this)}}var cO=new WeakMap;class Bd{copy(){return this.era?new Bd(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Bd(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Pf(this,t)}subtract(t){return H3(this,t)}set(t){return vm(Gl(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return ym(this,t,n,r);default:return xm(this,t,n,r)}}toDate(t,n){return O3(this,t,n)}toString(){return Z3(this)}compare(t){let n=P3(this,t);return n===0?F3(this,Ia(t)):n}constructor(...t){Iu(this,cO,{writable:!0,value:void 0});let[n,r,i,a,o]=Em(t);this.calendar=n,this.era=r,this.year=i,this.month=a,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,bo(this)}}var dO=new WeakMap;class Ul{copy(){return this.era?new Ul(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Ul(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return G3(this,t)}subtract(t){return tO(this,t)}set(t,n){return rO(this,t,n)}cycle(t,n,r){return nO(this,t,n,r)}toDate(){return KL(this)}toString(){return oO(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-YL(t,this.timeZone).toDate().getTime()}constructor(...t){Iu(this,dO,{writable:!0,value:void 0});let[n,r,i,a,o]=Em(t),s=t.shift(),l=t.shift();this.calendar=n,this.era=r,this.year=i,this.month=a,this.day=o,this.timeZone=s,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,bo(this)}}const os=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],fO=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],Vc=[1867,1911,1925,1988,2018],ta=["meiji","taisho","showa","heisei","reiwa"];function wv(e){const t=os.findIndex(([n,r,i])=>e.year<n||e.year===n&&e.month<r||e.year===n&&e.month===r&&e.day<i);return t===-1?os.length-1:t===0?0:t-1}function Rh(e){let t=Vc[ta.indexOf(e.era)];if(!t)throw new Error("Unknown era: "+e.era);return new Ot(e.year+t,e.month,e.day)}class hO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=wv(n);return new Ot(this,ta[r],n.year-Vc[r],n.month,n.day)}toJulianDay(t){return super.toJulianDay(Rh(t))}balanceDate(t){let n=Rh(t),r=wv(n);ta[r]!==t.era&&(t.era=ta[r],t.year=n.year-Vc[r]),this.constrainDate(t)}constrainDate(t){let n=ta.indexOf(t.era),r=fO[n];if(r!=null){let[i,a,o]=r,s=i-Vc[n];t.year=Math.max(1,Math.min(s,t.year)),t.year===s&&(t.month=Math.min(a,t.month),t.month===a&&(t.day=Math.min(o,t.day)))}if(t.year===1&&n>=0){let[,i,a]=os[n];t.month=Math.max(i,t.month),t.month===i&&(t.day=Math.max(a,t.day))}}getEras(){return ta}getYearsInEra(t){let n=ta.indexOf(t.era),r=os[n],i=os[n+1];if(i==null)return 9999-r[0]+1;let a=i[0]-r[0];return(t.month<i[1]||t.month===i[1]&&t.day<i[2])&&a++,a}getDaysInMonth(t){return super.getDaysInMonth(Rh(t))}getMinimumMonthInYear(t){let n=Iv(t);return n?n[1]:1}getMinimumDayInMonth(t){let n=Iv(t);return n&&t.month===n[1]?n[2]:1}constructor(...t){super(...t),this.identifier="japanese"}}function Iv(e){if(e.year===1){let t=ta.indexOf(e.era);return os[t]}}const Y3=-543;class gO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=Su(n.era,n.year);return new Ot(this,r-Y3,n.month,n.day)}toJulianDay(t){return super.toJulianDay(_v(t))}getEras(){return["BE"]}getDaysInMonth(t){return super.getDaysInMonth(_v(t))}balanceDate(){}constructor(...t){super(...t),this.identifier="buddhist"}}function _v(e){let[t,n]=$f(e.year+Y3);return new Ot(t,n,e.month,e.day)}const $d=1911;function K3(e){return e.era==="minguo"?e.year+$d:1-e.year+$d}function Dv(e){let t=e-$d;return t>0?["minguo",t]:["before_minguo",1-t]}class pO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=Su(n.era,n.year),[i,a]=Dv(r);return new Ot(this,i,a,n.month,n.day)}toJulianDay(t){return super.toJulianDay(Av(t))}getEras(){return["before_minguo","minguo"]}balanceDate(t){let[n,r]=Dv(K3(t));t.era=n,t.year=r}isInverseEra(t){return t.era==="before_minguo"}getDaysInMonth(t){return super.getDaysInMonth(Av(t))}getYearsInEra(t){return t.era==="before_minguo"?9999:9999-$d}constructor(...t){super(...t),this.identifier="roc"}}function Av(e){let[t,n]=$f(K3(e));return new Ot(t,n,e.month,e.day)}const Tv=1948320,Rv=[0,31,62,93,124,155,186,216,246,276,306,336];class mO{fromJulianDay(t){let n=t-Tv,r=1+Math.floor((33*n+3)/12053),i=365*(r-1)+Math.floor((8*r+21)/33),a=n-i,o=a<216?Math.floor(a/31):Math.floor((a-6)/30),s=a-Rv[o]+1;return new Ot(this,r,o+1,s)}toJulianDay(t){let n=Tv-1+365*(t.year-1)+Math.floor((8*t.year+21)/33);return n+=Rv[t.month-1],n+=t.day,n}getMonthsInYear(){return 12}getDaysInMonth(t){return t.month<=6?31:t.month<=11||as(25*t.year+11,33)<8?30:29}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}const Bh=78,Bv=80;class bO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=n.year-Bh,i=t-eo(n.era,n.year,1,1),a;i<Bv?(r--,a=ca(n.year-1)?31:30,i+=a+155+90+10):(a=ca(n.year)?31:30,i-=Bv);let o,s;if(i<a)o=1,s=i+1;else{let l=i-a;l<155?(o=Math.floor(l/31)+2,s=l%31+1):(l-=155,o=Math.floor(l/30)+7,s=l%30+1)}return new Ot(this,r,o,s)}toJulianDay(t){let n=t.year+Bh,[r,i]=$f(n),a,o;return ca(i)?(a=31,o=eo(r,i,3,21)):(a=30,o=eo(r,i,3,22)),t.month===1?o+t.day-1:(o+=a+Math.min(t.month-2,5)*31,t.month>=8&&(o+=(t.month-7)*30),o+=t.day-1,o)}getDaysInMonth(t){return t.month===1&&ca(t.year+Bh)||t.month>=2&&t.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...t){super(...t),this.identifier="indian"}}const kd=1948440,$v=1948439,hr=1300,Mo=1600,vO=460322;function Pd(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function J3(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+Pd(t,r,1,1)))/29.5)+1),a=n-Pd(t,r,i,1)+1;return new Ot(e,r,i,a)}function kv(e){return(14+11*e)%30<11}class wm{fromJulianDay(t){return J3(this,kd,t)}toJulianDay(t){return Pd(kd,t.year,t.month,t.day)}getDaysInMonth(t){let n=29+t.month%2;return t.month===12&&kv(t.year)&&n++,n}getMonthsInYear(){return 12}getDaysInYear(t){return kv(t.year)?355:354}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class yO extends wm{fromJulianDay(t){return J3(this,$v,t)}toJulianDay(t){return Pd($v,t.year,t.month,t.day)}constructor(...t){super(...t),this.identifier="islamic-tbla"}}const xO="qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";let xg,ss;function Hc(e){return vO+ss[e-hr]}function nl(e,t){let n=e-hr,r=1<<11-(t-1);return xg[n]&r?30:29}function Pv(e,t){let n=Hc(e);for(let r=1;r<t;r++)n+=nl(e,r);return n}function Fv(e){return ss[e+1-hr]-ss[e-hr]}class CO extends wm{fromJulianDay(t){let n=t-kd,r=Hc(hr),i=Hc(Mo);if(n<r||n>i)return super.fromJulianDay(t);{let a=hr-1,o=1,s=1;for(;s>0;){a++,s=n-Hc(a)+1;let l=Fv(a);if(s===l){o=12;break}else if(s<l){let u=nl(a,o);for(o=1;s>u;)s-=u,o++,u=nl(a,o);break}}return new Ot(this,a,o,n-Pv(a,o)+1)}}toJulianDay(t){return t.year<hr||t.year>Mo?super.toJulianDay(t):kd+Pv(t.year,t.month)+(t.day-1)}getDaysInMonth(t){return t.year<hr||t.year>Mo?super.getDaysInMonth(t):nl(t.year,t.month)}getDaysInYear(t){return t.year<hr||t.year>Mo?super.getDaysInYear(t):Fv(t.year)}constructor(){if(super(),this.identifier="islamic-umalqura",xg||(xg=new Uint16Array(Uint8Array.from(atob(xO),t=>t.charCodeAt(0)).buffer)),!ss){ss=new Uint32Array(Mo-hr+1);let t=0;for(let n=hr;n<=Mo;n++){ss[n-hr]=t;for(let r=1;r<=12;r++)t+=nl(n,r)}}}}const Nv=347997,q3=1080,Q3=24*q3,EO=29,SO=12*q3+793,wO=EO*Q3+SO;function Ya(e){return as(e*7+1,19)<7}function jc(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return as(3*(r+1),7)<3&&(r+=1),r}function IO(e){let t=jc(e-1),n=jc(e);return jc(e+1)-n===356?2:n-t===382?1:0}function vl(e){return jc(e)+IO(e)}function eE(e){return vl(e+1)-vl(e)}function _O(e){let t=eE(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function ec(e,t){if(t>=6&&!Ya(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=_O(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Ya(e)?30:0:30}class DO{fromJulianDay(t){let n=t-Nv,r=n*Q3/wO,i=Math.floor((19*r+234)/235)+1,a=vl(i),o=Math.floor(n-a);for(;o<1;)i--,a=vl(i),o=Math.floor(n-a);let s=1,l=0;for(;l<o;)l+=ec(i,s),s++;s--,l-=ec(i,s);let u=o-l;return new Ot(this,i,s,u)}toJulianDay(t){let n=vl(t.year);for(let r=1;r<t.month;r++)n+=ec(t.year,r);return n+t.day+Nv}getDaysInMonth(t){return ec(t.year,t.month)}getMonthsInYear(t){return Ya(t.year)?13:12}getDaysInYear(t){return eE(t.year)}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(t,n){n.year!==t.year&&(Ya(n.year)&&!Ya(t.year)&&n.month>6?t.month--:!Ya(n.year)&&Ya(t.year)&&n.month>6&&t.month++)}constructor(){this.identifier="hebrew"}}const Cg=1723856,Mv=1824665,Eg=5500;function Fd(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function Im(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-Fd(e,n,1,1))/30),i=t+1-Fd(e,n,r,1);return[n,r,i]}function tE(e){return Math.floor(e%4/3)}function nE(e,t){return t%13!==0?30:tE(e)+5}class _m{fromJulianDay(t){let[n,r,i]=Im(Cg,t),a="AM";return n<=0&&(a="AA",n+=Eg),new Ot(this,a,n,r,i)}toJulianDay(t){let n=t.year;return t.era==="AA"&&(n-=Eg),Fd(Cg,n,t.month,t.day)}getDaysInMonth(t){return nE(t.year,t.month)}getMonthsInYear(){return 13}getDaysInYear(t){return 365+tE(t.year)}getYearsInEra(t){return t.era==="AA"?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class AO extends _m{fromJulianDay(t){let[n,r,i]=Im(Cg,t);return n+=Eg,new Ot(this,"AA",n,r,i)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...t){super(...t),this.identifier="ethioaa"}}class TO extends _m{fromJulianDay(t){let[n,r,i]=Im(Mv,t),a="CE";return n<=0&&(a="BCE",n=1-n),new Ot(this,a,n,r,i)}toJulianDay(t){let n=t.year;return t.era==="BCE"&&(n=1-n),Fd(Mv,n,t.month,t.day)}getDaysInMonth(t){let n=t.year;return t.era==="BCE"&&(n=1-n),nE(n,t.month)}isInverseEra(t){return t.era==="BCE"}balanceDate(t){t.year<=0&&(t.era=t.era==="BCE"?"CE":"BCE",t.year=1-t.year)}getEras(){return["BCE","CE"]}getYearsInEra(t){return t.era==="BCE"?9999:9715}constructor(...t){super(...t),this.identifier="coptic"}}function _u(e){switch(e){case"buddhist":return new gO;case"ethiopic":return new _m;case"ethioaa":return new AO;case"coptic":return new TO;case"hebrew":return new DO;case"indian":return new bO;case"islamic-civil":return new wm;case"islamic-tbla":return new yO;case"islamic-umalqura":return new CO;case"japanese":return new hO;case"persian":return new mO;case"roc":return new pO;case"gregory":default:return new ar}}let $h=new Map;class Xl{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),i=this.formatter.formatToParts(n);return[...r.map(a=>({...a,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return $O()&&(this.resolvedHourCycle||(this.resolvedHourCycle=kO(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=rE(t,n),this.options=n}}const RO={true:{ja:"h11"},false:{}};function rE(e,t={}){if(typeof t.hour12=="boolean"&&BO()){t={...t};let i=RO[String(t.hour12)][e.split("-")[0]],a=t.hour12?"h12":"h23";t.hourCycle=i??a,delete t.hour12}let n=e+(t?Object.entries(t).sort((i,a)=>i[0]<a[0]?-1:1).join():"");if($h.has(n))return $h.get(n);let r=new Intl.DateTimeFormat(e,t);return $h.set(n,r),r}let kh=null;function BO(){return kh==null&&(kh=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),kh}let Ph=null;function $O(){return Ph==null&&(Ph=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ph}function kO(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=rE(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(a=>a.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(a=>a.type==="hour").value,10);if(r===0&&i===23)return"h23";if(r===24&&i===23)return"h24";if(r===0&&i===11)return"h11";if(r===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}const _o=typeof document<"u"?I.useLayoutEffect:()=>{};function Bi(e){const t=I.useRef(null);return _o(()=>{t.current=e},[e]),I.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}function PO(e){let[t,n]=I.useState(e),r=I.useRef(null),i=Bi(()=>{if(!r.current)return;let o=r.current.next();if(o.done){r.current=null;return}t===o.value?i():n(o.value)});_o(()=>{r.current&&i()});let a=Bi(o=>{r.current=o(t),i()});return[t,a]}const Nd={prefix:String(Math.round(Math.random()*1e10)),current:0},iE=I.createContext(Nd),FO=I.createContext(!1);let NO=!!(typeof window<"u"&&window.document&&window.document.createElement),Fh=new WeakMap;function MO(e=!1){let t=I.useContext(iE),n=I.useRef(null);if(n.current===null&&!e){var r,i;let a=(i=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(a){let o=Fh.get(a);o==null?Fh.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==o.state&&(t.current=o.id,Fh.delete(a))}n.current=++t.current}return n.current}function LO(e){let t=I.useContext(iE);t===Nd&&!NO&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=MO(!!e),r=t===Nd&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${n}`}function OO(e){let t=I.useId(),[n]=I.useState(aE()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Nd.prefix}`;return e||`${r}-${t}`}const VO=typeof I.useId=="function"?OO:LO;function HO(){return!1}function jO(){return!0}function WO(e){return()=>{}}function aE(){return typeof I.useSyncExternalStore=="function"?I.useSyncExternalStore(WO,HO,jO):I.useContext(FO)}let zO=!!(typeof window<"u"&&window.document&&window.document.createElement),Md=new Map;function Cs(e){let[t,n]=I.useState(e),r=I.useRef(null),i=VO(t),a=I.useCallback(o=>{r.current=o},[]);return zO&&Md.set(i,a),_o(()=>{let o=i;return()=>{Md.delete(o)}},[i]),I.useEffect(()=>{let o=r.current;o&&(r.current=null,n(o))}),i}function GO(e,t){if(e===t)return e;let n=Md.get(e);if(n)return n(t),t;let r=Md.get(t);return r?(r(e),e):t}function Sg(e=[]){let t=Cs(),[n,r]=PO(t),i=I.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return _o(i,[t,i,...e]),n}function oE(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const yn=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Br=e=>e&&"window"in e&&e.window===e?e:yn(e).defaultView||window;function Gn(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let i in r){let a=t[i],o=r[i];typeof a=="function"&&typeof o=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=oE(a,o):(i==="className"||i==="UNSAFE_className")&&typeof a=="string"&&typeof o=="string"?t[i]=Pi(a,o):i==="id"&&a&&o?t.id=GO(a,o):t[i]=o!==void 0?o:a}}return t}const UO=new Set(["id"]),XO=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),ZO=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),YO=/^(data-.*)$/;function Dm(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,a={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(UO.has(o)||n&&XO.has(o)||r&&ZO.has(o)||i!=null&&i.has(o)||YO.test(o))&&(a[o]=e[o]);return a}function da(e){if(KO())e.focus({preventScroll:!0});else{let t=JO(e);e.focus(),qO(t)}}let tc=null;function KO(){if(tc==null){tc=!1;try{document.createElement("div").focus({get preventScroll(){return tc=!0,!0}})}catch{}}return tc}function JO(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function qO(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function Ff(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Am(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Zl(){return Am(/^Mac/i)}function QO(){return Am(/^iPhone/i)}function sE(){return Am(/^iPad/i)||Zl()&&navigator.maxTouchPoints>1}function lE(){return QO()||sE()}function eV(){return Ff(/AppleWebKit/i)&&!tV()}function tV(){return Ff(/Chrome/i)}function uE(){return Ff(/Android/i)}function nV(){return Ff(/Firefox/i)}function Yl(e,t,n=!0){var r,i;let{metaKey:a,ctrlKey:o,altKey:s,shiftKey:l}=t;nV()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Zl()?a=!0:o=!0);let u=eV()&&Zl()&&!sE()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:a,ctrlKey:o,altKey:s,shiftKey:l}):new MouseEvent("click",{metaKey:a,ctrlKey:o,altKey:s,shiftKey:l,bubbles:!0,cancelable:!0});Yl.isOpening=n,da(e),e.dispatchEvent(u),Yl.isOpening=!1}Yl.isOpening=!1;let Xo=new Map,wg=new Set;function Lv(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=Xo.get(r.target);i||(i=new Set,Xo.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=Xo.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),Xo.delete(r.target)),Xo.size===0)){for(let a of wg)a();wg.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Lv():document.addEventListener("DOMContentLoaded",Lv));function cE(e){requestAnimationFrame(()=>{Xo.size===0?e():wg.add(e)})}function rV(){let e=I.useRef(new Map),t=I.useCallback((i,a,o,s)=>{let l=s!=null&&s.once?(...u)=>{e.current.delete(o),o(...u)}:o;e.current.set(o,{type:a,eventTarget:i,fn:l,options:s}),i.addEventListener(a,o,s)},[]),n=I.useCallback((i,a,o,s)=>{var l;let u=((l=e.current.get(o))===null||l===void 0?void 0:l.fn)||o;i.removeEventListener(a,u,s),e.current.delete(o)},[]),r=I.useCallback(()=>{e.current.forEach((i,a)=>{n(i.eventTarget,i.type,a,i.options)})},[n]);return I.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Tm(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=Cs(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function Ov(e,t){const n=I.useRef(!0),r=I.useRef(null);I.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),I.useEffect(()=>{n.current?n.current=!1:(!r.current||t.some((i,a)=>!Object.is(i,r[a])))&&e(),r.current=t},t)}function dE(e,t){_o(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ig(e,t){let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function iV(e,t){let n=e;for(Ig(n,t)&&(n=n.parentElement);n&&!Ig(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function aV(e,t){const n=[];for(;e&&e!==document.documentElement;)Ig(e,t)&&n.push(e),e=e.parentElement;return n}let oV=0;const Nh=new Map;function fE(e){let[t,n]=I.useState();return _o(()=>{if(!e)return;let r=Nh.get(e);if(r)n(r.element.id);else{let i=`react-aria-description-${oV++}`;n(i);let a=document.createElement("div");a.id=i,a.style.display="none",a.textContent=e,document.body.appendChild(a),r={refCount:0,element:a},Nh.set(e,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),Nh.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function Mh(e,t,n,r){let i=Bi(n),a=n==null;I.useEffect(()=>{if(a||!e.current)return;let o=e.current;return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[e,t,r,a,i])}function sV(e,t){let n=Vv(e,t,"left"),r=Vv(e,t,"top"),i=t.offsetWidth,a=t.offsetHeight,o=e.scrollLeft,s=e.scrollTop,{borderTopWidth:l,borderLeftWidth:u}=getComputedStyle(e),c=e.scrollLeft+parseInt(u,10),d=e.scrollTop+parseInt(l,10),h=c+e.clientWidth,f=d+e.clientHeight;n<=o?o=n-parseInt(u,10):n+i>h&&(o+=n+i-h),r<=d?s=r-parseInt(l,10):r+a>f&&(s+=r+a-f),e.scrollLeft=o,e.scrollTop=s}function Vv(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function lV(e,t){if(document.contains(e)){let o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let l=aV(e);for(let u of l)sV(u,e)}else{var n;let{left:l,top:u}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:c,top:d}=e.getBoundingClientRect();if(Math.abs(l-c)>1||Math.abs(u-d)>1){var r,i,a;t==null||(i=t.containingElement)===null||i===void 0||(r=i.scrollIntoView)===null||r===void 0||r.call(i,{block:"center",inline:"center"}),(a=e.scrollIntoView)===null||a===void 0||a.call(e,{block:"nearest"})}}}}function _g(e){return e.mozInputSource===0&&e.isTrusted?!0:uE()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function uV(e){return!uE()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function hE(e,t){let n=I.useRef(null);return e&&n.current&&t(e,n.current)&&(e=n.current),n.current=e,e}function Kl(e,t,n){let[r,i]=I.useState(e||t),a=I.useRef(e!==void 0),o=e!==void 0;I.useEffect(()=>{let u=a.current;u!==o&&console.warn(`WARN: A component changed from ${u?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}.`),a.current=o},[o]);let s=o?e:r,l=I.useCallback((u,...c)=>{let d=(h,...f)=>{n&&(Object.is(s,h)||n(h,...f)),o||(s=h)};typeof u=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),i((f,...g)=>{let p=u(o?s:f,...g);return d(p,...c),o?f:p})):(o||i(u),d(u,...c))},[o,s,n]);return[s,l]}let qo="default",Dg="",Wc=new WeakMap;function Hv(e){if(lE()){if(qo==="default"){const t=yn(e);Dg=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}qo="disabled"}else(e instanceof HTMLElement||e instanceof SVGElement)&&(Wc.set(e,e.style.userSelect),e.style.userSelect="none")}function nc(e){if(lE()){if(qo!=="disabled")return;qo="restoring",setTimeout(()=>{cE(()=>{if(qo==="restoring"){const t=yn(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Dg||""),Dg="",qo="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Wc.has(e)){let t=Wc.get(e);e.style.userSelect==="none"&&(e.style.userSelect=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Wc.delete(e)}}const gE=I.createContext({register:()=>{}});gE.displayName="PressResponderContext";function cV(e,t){return t.get?t.get.call(e):t.value}function pE(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function dV(e,t){var n=pE(e,t,"get");return cV(e,n)}function fV(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function jv(e,t,n){var r=pE(e,t,"set");return fV(e,r,n),n}function hV(e){let t=I.useContext(gE);if(t){let{register:n,...r}=t;e=Gn(r,e),n()}return dE(t,e.ref),e}var rc=new WeakMap;class ic{continuePropagation(){jv(this,rc,!1)}get shouldStopPropagation(){return dV(this,rc)}constructor(t,n,r){Iu(this,rc,{writable:!0,value:void 0}),jv(this,rc,!0),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey}}const Wv=Symbol("linkClicked");function Rm(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,isDisabled:o,isPressed:s,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:d,...h}=hV(e),[f,g]=I.useState(!1),p=I.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:m,removeAllGlobalListeners:b}=rV(),v=Bi((y,S)=>{let D=p.current;if(o||D.didFirePressStart)return!1;let A=!0;if(D.isTriggeringEvent=!0,r){let T=new ic("pressstart",S,y);r(T),A=T.shouldStopPropagation}return n&&n(!0),D.isTriggeringEvent=!1,D.didFirePressStart=!0,g(!0),A}),x=Bi((y,S,D=!0)=>{let A=p.current;if(!A.didFirePressStart)return!1;A.ignoreClickAfterPress=!0,A.didFirePressStart=!1,A.isTriggeringEvent=!0;let T=!0;if(i){let F=new ic("pressend",S,y);i(F),T=F.shouldStopPropagation}if(n&&n(!1),g(!1),t&&D&&!o){let F=new ic("press",S,y);t(F),T&&(T=F.shouldStopPropagation)}return A.isTriggeringEvent=!1,T}),C=Bi((y,S)=>{let D=p.current;if(o)return!1;if(a){D.isTriggeringEvent=!0;let A=new ic("pressup",S,y);return a(A),D.isTriggeringEvent=!1,A.shouldStopPropagation}return!0}),E=Bi(y=>{let S=p.current;S.isPressed&&S.target&&(S.isOverTarget&&S.pointerType!=null&&x(yi(S.target,y),S.pointerType,!1),S.isPressed=!1,S.isOverTarget=!1,S.activePointerId=null,S.pointerType=null,b(),c||nc(S.target))}),w=Bi(y=>{u&&E(y)}),B=I.useMemo(()=>{let y=p.current,S={onKeyDown(A){if(Lh(A.nativeEvent,A.currentTarget)&&A.currentTarget.contains(A.target)){var T;Gv(A.target,A.key)&&A.preventDefault();let F=!0;if(!y.isPressed&&!A.repeat){y.target=A.currentTarget,y.isPressed=!0,F=v(A,"keyboard");let k=A.currentTarget,P=$=>{Lh($,k)&&!$.repeat&&k.contains($.target)&&y.target&&C(yi(y.target,$),"keyboard")};m(yn(A.currentTarget),"keyup",oE(P,D),!0)}F&&A.stopPropagation(),A.metaKey&&Zl()&&((T=y.metaKeyEvents)===null||T===void 0||T.set(A.key,A.nativeEvent))}else A.key==="Meta"&&(y.metaKeyEvents=new Map)},onClick(A){if(!(A&&!A.currentTarget.contains(A.target))&&A&&A.button===0&&!y.isTriggeringEvent&&!Yl.isOpening){let T=!0;if(o&&A.preventDefault(),!y.ignoreClickAfterPress&&!y.ignoreEmulatedMouseEvents&&!y.isPressed&&(y.pointerType==="virtual"||_g(A.nativeEvent))){!o&&!l&&da(A.currentTarget);let F=v(A,"virtual"),k=C(A,"virtual"),P=x(A,"virtual");T=F&&k&&P}y.ignoreEmulatedMouseEvents=!1,y.ignoreClickAfterPress=!1,T&&A.stopPropagation()}}},D=A=>{var T;if(y.isPressed&&y.target&&Lh(A,y.target)){var F;Gv(A.target,A.key)&&A.preventDefault();let P=A.target;x(yi(y.target,A),"keyboard",y.target.contains(P)),b(),A.key!=="Enter"&&Bm(y.target)&&y.target.contains(P)&&!A[Wv]&&(A[Wv]=!0,Yl(y.target,A,!1)),y.isPressed=!1,(F=y.metaKeyEvents)===null||F===void 0||F.delete(A.key)}else if(A.key==="Meta"&&(!((T=y.metaKeyEvents)===null||T===void 0)&&T.size)){var k;let P=y.metaKeyEvents;y.metaKeyEvents=void 0;for(let $ of P.values())(k=y.target)===null||k===void 0||k.dispatchEvent(new KeyboardEvent("keyup",$))}};if(typeof PointerEvent<"u"){S.onPointerDown=k=>{if(k.button!==0||!k.currentTarget.contains(k.target))return;if(uV(k.nativeEvent)){y.pointerType="virtual";return}Oh(k.currentTarget)&&k.preventDefault(),y.pointerType=k.pointerType;let P=!0;y.isPressed||(y.isPressed=!0,y.isOverTarget=!0,y.activePointerId=k.pointerId,y.target=k.currentTarget,!o&&!l&&da(k.currentTarget),c||Hv(y.target),P=v(k,y.pointerType),m(yn(k.currentTarget),"pointermove",A,!1),m(yn(k.currentTarget),"pointerup",T,!1),m(yn(k.currentTarget),"pointercancel",F,!1)),P&&k.stopPropagation()},S.onMouseDown=k=>{k.currentTarget.contains(k.target)&&k.button===0&&(Oh(k.currentTarget)&&k.preventDefault(),k.stopPropagation())},S.onPointerUp=k=>{!k.currentTarget.contains(k.target)||y.pointerType==="virtual"||k.button===0&&Lo(k,k.currentTarget)&&C(k,y.pointerType||k.pointerType)};let A=k=>{k.pointerId===y.activePointerId&&(y.target&&Lo(k,y.target)?!y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!0,v(yi(y.target,k),y.pointerType)):y.target&&y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!1,x(yi(y.target,k),y.pointerType,!1),w(k)))},T=k=>{k.pointerId===y.activePointerId&&y.isPressed&&k.button===0&&y.target&&(Lo(k,y.target)&&y.pointerType!=null?x(yi(y.target,k),y.pointerType):y.isOverTarget&&y.pointerType!=null&&x(yi(y.target,k),y.pointerType,!1),y.isPressed=!1,y.isOverTarget=!1,y.activePointerId=null,y.pointerType=null,b(),c||nc(y.target))},F=k=>{E(k)};S.onDragStart=k=>{k.currentTarget.contains(k.target)&&E(k)}}else{S.onMouseDown=F=>{if(F.button!==0||!F.currentTarget.contains(F.target))return;if(Oh(F.currentTarget)&&F.preventDefault(),y.ignoreEmulatedMouseEvents){F.stopPropagation();return}y.isPressed=!0,y.isOverTarget=!0,y.target=F.currentTarget,y.pointerType=_g(F.nativeEvent)?"virtual":"mouse",!o&&!l&&da(F.currentTarget),v(F,y.pointerType)&&F.stopPropagation(),m(yn(F.currentTarget),"mouseup",A,!1)},S.onMouseEnter=F=>{if(!F.currentTarget.contains(F.target))return;let k=!0;y.isPressed&&!y.ignoreEmulatedMouseEvents&&y.pointerType!=null&&(y.isOverTarget=!0,k=v(F,y.pointerType)),k&&F.stopPropagation()},S.onMouseLeave=F=>{if(!F.currentTarget.contains(F.target))return;let k=!0;y.isPressed&&!y.ignoreEmulatedMouseEvents&&y.pointerType!=null&&(y.isOverTarget=!1,k=x(F,y.pointerType,!1),w(F)),k&&F.stopPropagation()},S.onMouseUp=F=>{F.currentTarget.contains(F.target)&&!y.ignoreEmulatedMouseEvents&&F.button===0&&C(F,y.pointerType||"mouse")};let A=F=>{if(F.button===0){if(y.isPressed=!1,b(),y.ignoreEmulatedMouseEvents){y.ignoreEmulatedMouseEvents=!1;return}y.target&&Lo(F,y.target)&&y.pointerType!=null?x(yi(y.target,F),y.pointerType):y.target&&y.isOverTarget&&y.pointerType!=null&&x(yi(y.target,F),y.pointerType,!1),y.isOverTarget=!1}};S.onTouchStart=F=>{if(!F.currentTarget.contains(F.target))return;let k=gV(F.nativeEvent);if(!k)return;y.activePointerId=k.identifier,y.ignoreEmulatedMouseEvents=!0,y.isOverTarget=!0,y.isPressed=!0,y.target=F.currentTarget,y.pointerType="touch",!o&&!l&&da(F.currentTarget),c||Hv(y.target),v(F,y.pointerType)&&F.stopPropagation(),m(Br(F.currentTarget),"scroll",T,!0)},S.onTouchMove=F=>{if(!F.currentTarget.contains(F.target))return;if(!y.isPressed){F.stopPropagation();return}let k=zv(F.nativeEvent,y.activePointerId),P=!0;k&&Lo(k,F.currentTarget)?!y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!0,P=v(F,y.pointerType)):y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!1,P=x(F,y.pointerType,!1),w(F)),P&&F.stopPropagation()},S.onTouchEnd=F=>{if(!F.currentTarget.contains(F.target))return;if(!y.isPressed){F.stopPropagation();return}let k=zv(F.nativeEvent,y.activePointerId),P=!0;k&&Lo(k,F.currentTarget)&&y.pointerType!=null?(C(F,y.pointerType),P=x(F,y.pointerType)):y.isOverTarget&&y.pointerType!=null&&(P=x(F,y.pointerType,!1)),P&&F.stopPropagation(),y.isPressed=!1,y.activePointerId=null,y.isOverTarget=!1,y.ignoreEmulatedMouseEvents=!0,y.target&&!c&&nc(y.target),b()},S.onTouchCancel=F=>{F.currentTarget.contains(F.target)&&(F.stopPropagation(),y.isPressed&&E(F))};let T=F=>{y.isPressed&&F.target.contains(y.target)&&E({currentTarget:y.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};S.onDragStart=F=>{F.currentTarget.contains(F.target)&&E(F)}}return S},[m,o,l,b,c,E,w,x,v,C]);return I.useEffect(()=>()=>{var y;c||nc((y=p.current.target)!==null&&y!==void 0?y:void 0)},[c]),{isPressed:s||f,pressProps:Gn(h,B)}}function Bm(e){return e.tagName==="A"&&e.hasAttribute("href")}function Lh(e,t){const{key:n,code:r}=e,i=t,a=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof Br(i).HTMLInputElement&&!mE(i,n)||i instanceof Br(i).HTMLTextAreaElement||i.isContentEditable)&&!((a==="link"||!a&&Bm(i))&&n!=="Enter")}function gV(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function zv(e,t){const n=e.changedTouches;for(let r=0;r<n.length;r++){const i=n[r];if(i.identifier===t)return i}return null}function yi(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function pV(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function mV(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Lo(e,t){let n=t.getBoundingClientRect(),r=pV(e);return mV(n,r)}function Oh(e){return!(e instanceof HTMLElement)||!e.hasAttribute("draggable")}function Gv(e,t){return e instanceof HTMLInputElement?!mE(e,t):e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Bm(e)}const bV=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function mE(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":bV.has(e.type)}class vV{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function bE(e){let t=I.useRef({isFocused:!1,observer:null});_o(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Bi(r=>{e==null||e(r)});return I.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,a=o=>{t.current.isFocused=!1,i.disabled&&n(new vV("blur",o)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var o;(o=t.current.observer)===null||o===void 0||o.disconnect();let s=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function vE(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const a=I.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),o=bE(a),s=I.useCallback(l=>{const u=yn(l.target);l.target===l.currentTarget&&u.activeElement===l.target&&(n&&n(l),i&&i(!0),o(l))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}let Fs=null,Ag=new Set,yl=new Map,vo=!1,Tg=!1;const yV={Tab:!0,Escape:!0};function $m(e,t){for(let n of Ag)n(e,t)}function xV(e){return!(e.metaKey||!Zl()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Ld(e){vo=!0,xV(e)&&(Fs="keyboard",$m("keyboard",e))}function pr(e){Fs="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(vo=!0,$m("pointer",e))}function yE(e){_g(e)&&(vo=!0,Fs="virtual")}function xE(e){e.target===window||e.target===document||(!vo&&!Tg&&(Fs="virtual",$m("virtual",e)),vo=!1,Tg=!1)}function CE(){vo=!1,Tg=!0}function Rg(e){if(typeof window>"u"||yl.get(Br(e)))return;const t=Br(e),n=yn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){vo=!0,r.apply(this,arguments)},n.addEventListener("keydown",Ld,!0),n.addEventListener("keyup",Ld,!0),n.addEventListener("click",yE,!0),t.addEventListener("focus",xE,!0),t.addEventListener("blur",CE,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",pr,!0),n.addEventListener("pointermove",pr,!0),n.addEventListener("pointerup",pr,!0)):(n.addEventListener("mousedown",pr,!0),n.addEventListener("mousemove",pr,!0),n.addEventListener("mouseup",pr,!0)),t.addEventListener("beforeunload",()=>{EE(e)},{once:!0}),yl.set(t,{focus:r})}const EE=(e,t)=>{const n=Br(e),r=yn(e);t&&r.removeEventListener("DOMContentLoaded",t),yl.has(n)&&(n.HTMLElement.prototype.focus=yl.get(n).focus,r.removeEventListener("keydown",Ld,!0),r.removeEventListener("keyup",Ld,!0),r.removeEventListener("click",yE,!0),n.removeEventListener("focus",xE,!0),n.removeEventListener("blur",CE,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",pr,!0),r.removeEventListener("pointermove",pr,!0),r.removeEventListener("pointerup",pr,!0)):(r.removeEventListener("mousedown",pr,!0),r.removeEventListener("mousemove",pr,!0),r.removeEventListener("mouseup",pr,!0)),yl.delete(n))};function CV(e){const t=yn(e);let n;return t.readyState!=="loading"?Rg(e):(n=()=>{Rg(e)},t.addEventListener("DOMContentLoaded",n)),()=>EE(e,n)}typeof document<"u"&&CV();function SE(){return Fs!=="pointer"}function wE(){return Fs}const EV=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function SV(e,t,n){var r;const i=typeof window<"u"?Br(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?Br(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Br(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?Br(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!EV.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof a||(n==null?void 0:n.target)instanceof o&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof s&&!yV[n.key])}function wV(e,t,n){Rg(),I.useEffect(()=>{let r=(i,a)=>{SV(!!(n!=null&&n.isTextInput),i,a)&&e(SE())};return Ag.add(r),()=>{Ag.delete(r)}},t)}function IE(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=I.useRef({isFocusWithin:!1}),o=I.useCallback(u=>{a.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(a.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,a]),s=bE(o),l=I.useCallback(u=>{!a.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),i&&i(!0),a.current.isFocusWithin=!0,s(u))},[r,i,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:o}}}function Uv(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}};e(r),t&&n.stopPropagation()}}function IV(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Uv(e.onKeyDown),onKeyUp:Uv(e.onKeyUp)}}}function _E(e){const t=yn(e);if(wE()==="virtual"){let n=t.activeElement;cE(()=>{t.activeElement===n&&e.isConnected&&da(e)})}else da(e)}function _V(e){const t=Br(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:a}=e.ownerDocument.defaultView;let{display:o,visibility:s}=a(e);i=o!=="none"&&s!=="hidden"&&s!=="collapse"}return i}function DV(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function DE(e,t){return e.nodeName!=="#comment"&&_V(e)&&DV(e,t)&&(!e.parentElement||DE(e.parentElement,e))}const km=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],AV=km.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";km.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const TV=km.join(':not([hidden]):not([tabindex="-1"]),');function AE(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function js(e,t=!1){if(e!=null&&!t)try{_E(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function rl(e,t,n){let r=t!=null&&t.tabbable?TV:AV,i=yn(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){var o;return!(t==null||(o=t.from)===null||o===void 0)&&o.contains(a)?NodeFilter.FILTER_REJECT:a.matches(r)&&DE(a)&&(!n||AE(a,n))&&(!(t!=null&&t.accept)||t.accept(a))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function TE(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,l=i||yn(r).activeElement,u=rl(r,{tabbable:a,accept:s});r.contains(l)&&(u.currentNode=l);let c=u.nextNode();return!c&&o&&(u.currentNode=r,c=u.nextNode()),c&&js(c,!0),c},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,l=i||yn(r).activeElement,u=rl(r,{tabbable:a,accept:s});if(r.contains(l))u.currentNode=l;else{let d=Vh(u);return d&&js(d,!0),d??null}let c=u.previousNode();if(!c&&o){u.currentNode=r;let d=Vh(u);if(!d)return null;c=d}return c&&js(c,!0),c??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,s=rl(r,{tabbable:i,accept:a}).nextNode();return s&&js(s,!0),s},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=rl(r,{tabbable:i,accept:a}),s=Vh(o);return s&&js(s,!0),s??null}}}function Vh(e){let t,n;do n=e.lastChild(),n&&(t=n);while(n);return t}class Pm{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let a=new Xv({scopeRef:t});i.addChild(a),a.parent=i,this.fastMap.set(t,a),r&&(a.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let a of this.traverse())a!==n&&n.nodeToRestore&&a.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&AE(a.nodeToRestore,n.scopeRef.current)&&(a.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(a=>r&&r.addChild(a))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new Pm;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new Xv({scopeRef:null}),this.fastMap.set(null,this.root)}}class Xv{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}new Pm;function RE(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=I.useRef({isFocused:!1,isFocusVisible:t||SE()}),[a,o]=I.useState(!1),[s,l]=I.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=I.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),c=I.useCallback(f=>{i.current.isFocused=f,o(f),u()},[u]);wV(f=>{i.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:d}=vE({isDisabled:r,onFocusChange:c}),{focusWithinProps:h}=IE({isDisabled:!r,onFocusWithinChange:c});return{isFocused:a,isFocusVisible:s,focusProps:r?h:d}}let RV=I.createContext(null);function BV(e){let t=I.useContext(RV)||{};dE(t,e);let{ref:n,...r}=t;return r}function $V(e,t){let{focusProps:n}=vE(e),{keyboardProps:r}=IV(e),i=Gn(n,r),a=BV(t),o=e.isDisabled?{}:a,s=I.useRef(e.autoFocus);return I.useEffect(()=>{s.current&&t.current&&_E(t.current),s.current=!1},[t]),{focusableProps:Gn({...i,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},o)}}const kV=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),PV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function BE(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return kV.has(n.script)}let t=e.split("-")[0];return PV.has(t)}const FV=Symbol.for("react-aria.i18n.locale");function $E(){let e=typeof window<"u"&&window[FV]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:BE(e)?"rtl":"ltr"}}let Bg=$E(),il=new Set;function Zv(){Bg=$E();for(let e of il)e(Bg)}function kE(){let e=aE(),[t,n]=I.useState(Bg);return I.useEffect(()=>(il.size===0&&window.addEventListener("languagechange",Zv),il.add(n),()=>{il.delete(n),il.size===0&&window.removeEventListener("languagechange",Zv)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const PE=I.createContext(null);function Fm(e){let{locale:t,children:n}=e,r=kE(),i=I.useMemo(()=>t?{locale:t,direction:BE(t)?"rtl":"ltr"}:r,[r,t]);return I.createElement(PE.Provider,{value:i},n)}function Mr(){let e=kE();return I.useContext(PE)||e}const NV=Symbol.for("react-aria.i18n.locale"),MV=Symbol.for("react-aria.i18n.strings");let Oo;class Do{getStringForLocale(t,n){let i=this.getStringsForLocale(n)[t];if(!i)throw new Error(`Could not find intl message ${t} in ${n} locale`);return i}getStringsForLocale(t){let n=this.strings[t];return n||(n=LV(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[NV];if(Oo===void 0){let i=window[MV];if(!i)return null;Oo={};for(let a in i)Oo[a]=new Do({[n]:i[a]},n)}let r=Oo==null?void 0:Oo[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function LV(e,t,n="en-US"){if(t[e])return t[e];let r=OV(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}function OV(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const Yv=new Map,Kv=new Map;class FE{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let i=n["="+t];if(i)return typeof i=="function"?i():i;let a=this.locale+":"+r,o=Yv.get(a);o||(o=new Intl.PluralRules(this.locale,{type:r}),Yv.set(a,o));let s=o.select(t);return i=n[s]||n.other,typeof i=="function"?i():i}number(t){let n=Kv.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),Kv.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const Jv=new WeakMap;function VV(e){let t=Jv.get(e);return t||(t=new Do(e),Jv.set(e,t)),t}function HV(e,t){return t&&Do.getGlobalDictionaryForPackage(t)||VV(e)}function Du(e,t){let{locale:n}=Mr(),r=HV(e,t);return I.useMemo(()=>new FE(n,r),[n,r])}function _a(e){e=hE(e??{},jV);let{locale:t}=Mr();return I.useMemo(()=>new Xl(t,e),[t,e])}function jV(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(t[i]!==e[i])return!1;return!0}function WV(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:l,preventFocusOnPress:u,allowFocusWhenDisabled:c,onClick:d,href:h,target:f,rel:g,type:p="button"}=e,m;n==="button"?m={type:p,disabled:r}:m={role:"button",tabIndex:r?void 0:0,href:n==="a"&&r?void 0:h,target:n==="a"?f:void 0,type:n==="input"?p:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?g:void 0};let{pressProps:b,isPressed:v}=Rm({onPressStart:a,onPressEnd:o,onPressChange:l,onPress:i,onPressUp:s,isDisabled:r,preventFocusOnPress:u,ref:t}),{focusableProps:x}=$V(e,t);c&&(x.tabIndex=r?-1:x.tabIndex);let C=Gn(x,b,Dm(e,{labelable:!0}));return{isPressed:v,buttonProps:Gn(m,C,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],onClick:E=>{d&&(d(E),console.warn("onClick is deprecated, please use onPress"))}})}}var NE={};NE={dateRange:e=>`${e.startDate} إلى ${e.endDate}`,dateSelected:e=>`${e.date} المحدد`,finishRangeSelectionPrompt:"انقر لإنهاء عملية تحديد نطاق التاريخ",maximumDate:"آخر تاريخ متاح",minimumDate:"أول تاريخ متاح",next:"التالي",previous:"السابق",selectedDateDescription:e=>`تاريخ محدد: ${e.date}`,selectedRangeDescription:e=>`المدى الزمني المحدد: ${e.dateRange}`,startRangeSelectionPrompt:"انقر لبدء عملية تحديد نطاق التاريخ",todayDate:e=>`اليوم، ${e.date}`,todayDateSelected:e=>`اليوم، ${e.date} محدد`};var ME={};ME={dateRange:e=>`${e.startDate} до ${e.endDate}`,dateSelected:e=>`Избрано е ${e.date}`,finishRangeSelectionPrompt:"Натиснете, за да довършите избора на времеви интервал",maximumDate:"Последна налична дата",minimumDate:"Първа налична дата",next:"Напред",previous:"Назад",selectedDateDescription:e=>`Избрана дата: ${e.date}`,selectedRangeDescription:e=>`Избран диапазон: ${e.dateRange}`,startRangeSelectionPrompt:"Натиснете, за да пристъпите към избора на времеви интервал",todayDate:e=>`Днес, ${e.date}`,todayDateSelected:e=>`Днес, ${e.date} са избрани`};var LE={};LE={dateRange:e=>`${e.startDate} až ${e.endDate}`,dateSelected:e=>`Vybráno ${e.date}`,finishRangeSelectionPrompt:"Kliknutím dokončíte výběr rozsahu dat",maximumDate:"Poslední dostupné datum",minimumDate:"První dostupné datum",next:"Další",previous:"Předchozí",selectedDateDescription:e=>`Vybrané datum: ${e.date}`,selectedRangeDescription:e=>`Vybrané období: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknutím zahájíte výběr rozsahu dat",todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybráno ${e.date}`};var OE={};OE={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klik for at fuldføre valg af datoområde",maximumDate:"Sidste ledige dato",minimumDate:"Første ledige dato",next:"Næste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:"Klik for at starte valg af datoområde",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var VE={};VE={dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgewählt`,finishRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beenden",maximumDate:"Letztes verfügbares Datum",minimumDate:"Erstes verfügbares Datum",next:"Weiter",previous:"Zurück",selectedDateDescription:e=>`Ausgewähltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgewählter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beginnen",todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgewählt`};var HE={};HE={dateRange:e=>`${e.startDate} έως ${e.endDate}`,dateSelected:e=>`Επιλέχθηκε ${e.date}`,finishRangeSelectionPrompt:"Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών",maximumDate:"Τελευταία διαθέσιμη ημερομηνία",minimumDate:"Πρώτη διαθέσιμη ημερομηνία",next:"Επόμενο",previous:"Προηγούμενο",selectedDateDescription:e=>`Επιλεγμένη ημερομηνία: ${e.date}`,selectedRangeDescription:e=>`Επιλεγμένο εύρος: ${e.dateRange}`,startRangeSelectionPrompt:"Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών",todayDate:e=>`Σήμερα, ${e.date}`,todayDateSelected:e=>`Σήμερα, επιλέχτηκε ${e.date}`};var jE={};jE={previous:"Previous",next:"Next",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:"Click to start selecting date range",finishRangeSelectionPrompt:"Click to finish selecting date range",minimumDate:"First available date",maximumDate:"Last available date",dateRange:e=>`${e.startDate} to ${e.endDate}`};var WE={};WE={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:"Haga clic para terminar de seleccionar rango de fechas",maximumDate:"Última fecha disponible",minimumDate:"Primera fecha disponible",next:"Siguiente",previous:"Anterior",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:"Haga clic para comenzar a seleccionar un rango de fechas",todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`};var zE={};zE={dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:"Klõpsake kuupäevavahemiku valimise lõpetamiseks",maximumDate:"Viimane saadaolev kuupäev",minimumDate:"Esimene saadaolev kuupäev",next:"Järgmine",previous:"Eelmine",selectedDateDescription:e=>`Valitud kuupäev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:"Klõpsake kuupäevavahemiku valimiseks",todayDate:e=>`Täna, ${e.date}`,todayDateSelected:e=>`Täna, ${e.date} valitud`};var GE={};GE={dateRange:e=>`${e.startDate} – ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:"Lopeta päivämääräalueen valinta napsauttamalla tätä.",maximumDate:"Viimeinen varattavissa oleva päivämäärä",minimumDate:"Ensimmäinen varattavissa oleva päivämäärä",next:"Seuraava",previous:"Edellinen",selectedDateDescription:e=>`Valittu päivämäärä: ${e.date}`,selectedRangeDescription:e=>`Valittu aikaväli: ${e.dateRange}`,startRangeSelectionPrompt:"Aloita päivämääräalueen valinta napsauttamalla tätä.",todayDate:e=>`Tänään, ${e.date}`,todayDateSelected:e=>`Tänään, ${e.date} valittu`};var UE={};UE={dateRange:e=>`${e.startDate} à ${e.endDate}`,dateSelected:e=>`${e.date} sélectionné`,finishRangeSelectionPrompt:"Cliquer pour finir de sélectionner la plage de dates",maximumDate:"Dernière date disponible",minimumDate:"Première date disponible",next:"Suivant",previous:"Précédent",selectedDateDescription:e=>`Date sélectionnée : ${e.date}`,selectedRangeDescription:e=>`Plage sélectionnée : ${e.dateRange}`,startRangeSelectionPrompt:"Cliquer pour commencer à sélectionner la plage de dates",todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd’hui, ${e.date} sélectionné`};var XE={};XE={dateRange:e=>`${e.startDate} עד ${e.endDate}`,dateSelected:e=>`${e.date} נבחר`,finishRangeSelectionPrompt:"חץ כדי לסיים את בחירת טווח התאריכים",maximumDate:"תאריך פנוי אחרון",minimumDate:"תאריך פנוי ראשון",next:"הבא",previous:"הקודם",selectedDateDescription:e=>`תאריך נבחר: ${e.date}`,selectedRangeDescription:e=>`טווח נבחר: ${e.dateRange}`,startRangeSelectionPrompt:"לחץ כדי להתחיל בבחירת טווח התאריכים",todayDate:e=>`היום, ${e.date}`,todayDateSelected:e=>`היום, ${e.date} נבחר`};var ZE={};ZE={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:"Kliknite da dovršite raspon odabranih datuma",maximumDate:"Posljednji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sljedeći",previous:"Prethodni",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete raspon odabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`};var YE={};YE={dateRange:e=>`${e.startDate}–${e.endDate}`,dateSelected:e=>`${e.date} kiválasztva`,finishRangeSelectionPrompt:"Kattintson a dátumtartomány kijelölésének befejezéséhez",maximumDate:"Utolsó elérhető dátum",minimumDate:"Az első elérhető dátum",next:"Következő",previous:"Előző",selectedDateDescription:e=>`Kijelölt dátum: ${e.date}`,selectedRangeDescription:e=>`Kijelölt tartomány: ${e.dateRange}`,startRangeSelectionPrompt:"Kattintson a dátumtartomány kijelölésének indításához",todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijelölve`};var KE={};KE={dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:"Fai clic per completare la selezione dell’intervallo di date",maximumDate:"Ultima data disponibile",minimumDate:"Prima data disponibile",next:"Successivo",previous:"Precedente",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:"Fai clic per selezionare l’intervallo di date",todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`};var JE={};JE={dateRange:e=>`${e.startDate} から ${e.endDate}`,dateSelected:e=>`${e.date} を選択`,finishRangeSelectionPrompt:"クリックして日付範囲の選択を終了",maximumDate:"最終利用可能日",minimumDate:"最初の利用可能日",next:"次へ",previous:"前へ",selectedDateDescription:e=>`選択した日付 : ${e.date}`,selectedRangeDescription:e=>`選択範囲 : ${e.dateRange}`,startRangeSelectionPrompt:"クリックして日付範囲の選択を開始",todayDate:e=>`本日、${e.date}`,todayDateSelected:e=>`本日、${e.date} を選択`};var qE={};qE={dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} 선택됨`,finishRangeSelectionPrompt:"날짜 범위 선택을 완료하려면 클릭하십시오.",maximumDate:"마지막으로 사용 가능한 일자",minimumDate:"처음으로 사용 가능한 일자",next:"다음",previous:"이전",selectedDateDescription:e=>`선택 일자: ${e.date}`,selectedRangeDescription:e=>`선택 범위: ${e.dateRange}`,startRangeSelectionPrompt:"날짜 범위 선택을 시작하려면 클릭하십시오.",todayDate:e=>`오늘, ${e.date}`,todayDateSelected:e=>`오늘, ${e.date} 선택됨`};var QE={};QE={dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:"Spustelėkite, kad baigtumėte pasirinkti datų intervalą",maximumDate:"Paskutinė galima data",minimumDate:"Pirmoji galima data",next:"Paskesnis",previous:"Ankstesnis",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:"Spustelėkite, kad pradėtumėte pasirinkti datų intervalą",todayDate:e=>`Šiandien, ${e.date}`,todayDateSelected:e=>`Šiandien, pasirinkta ${e.date}`};var eS={};eS={dateRange:e=>`No ${e.startDate} līdz ${e.endDate}`,dateSelected:e=>`Atlasīts: ${e.date}`,finishRangeSelectionPrompt:"Noklikšķiniet, lai pabeigtu datumu diapazona atlasi",maximumDate:"Pēdējais pieejamais datums",minimumDate:"Pirmais pieejamais datums",next:"Tālāk",previous:"Atpakaļ",selectedDateDescription:e=>`Atlasītais datums: ${e.date}`,selectedRangeDescription:e=>`Atlasītais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:"Noklikšķiniet, lai sāktu datumu diapazona atlasi",todayDate:e=>`Šodien, ${e.date}`,todayDateSelected:e=>`Atlasīta šodiena, ${e.date}`};var tS={};tS={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klikk for å fullføre valg av datoområde",maximumDate:"Siste tilgjengelige dato",minimumDate:"Første tilgjengelige dato",next:"Neste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt område: ${e.dateRange}`,startRangeSelectionPrompt:"Klikk for å starte valg av datoområde",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var nS={};nS={dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:"Klik om de selectie van het datumbereik te voltooien",maximumDate:"Laatste beschikbare datum",minimumDate:"Eerste beschikbare datum",next:"Volgende",previous:"Vorige",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:"Klik om het datumbereik te selecteren",todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`};var rS={};rS={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:"Kliknij, aby zakończyć wybór zakresu dat",maximumDate:"Ostatnia dostępna data",minimumDate:"Pierwsza dostępna data",next:"Dalej",previous:"Wstecz",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknij, aby rozpocząć wybór zakresu dat",todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`};var iS={};iS={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para concluir a seleção do intervalo de datas",maximumDate:"Última data disponível",minimumDate:"Primeira data disponível",next:"Próximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para iniciar a seleção do intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var aS={};aS={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para terminar de selecionar o intervalo de datas",maximumDate:"Última data disponível",minimumDate:"Primeira data disponível",next:"Próximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para começar a selecionar o intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var oS={};oS={dateRange:e=>`De la ${e.startDate} până la ${e.endDate}`,dateSelected:e=>`${e.date} selectată`,finishRangeSelectionPrompt:"Apăsaţi pentru a finaliza selecţia razei pentru dată",maximumDate:"Ultima dată disponibilă",minimumDate:"Prima dată disponibilă",next:"Următorul",previous:"Înainte",selectedDateDescription:e=>`Dată selectată: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:"Apăsaţi pentru a începe selecţia razei pentru dată",todayDate:e=>`Astăzi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectată`};var sS={};sS={dateRange:e=>`С ${e.startDate} по ${e.endDate}`,dateSelected:e=>`Выбрано ${e.date}`,finishRangeSelectionPrompt:"Щелкните, чтобы завершить выбор диапазона дат",maximumDate:"Последняя доступная дата",minimumDate:"Первая доступная дата",next:"Далее",previous:"Назад",selectedDateDescription:e=>`Выбранная дата: ${e.date}`,selectedRangeDescription:e=>`Выбранный диапазон: ${e.dateRange}`,startRangeSelectionPrompt:"Щелкните, чтобы начать выбор диапазона дат",todayDate:e=>`Сегодня, ${e.date}`,todayDateSelected:e=>`Сегодня, выбрано ${e.date}`};var lS={};lS={dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybratý dátum ${e.date}`,finishRangeSelectionPrompt:"Kliknutím dokončíte výber rozsahu dátumov",maximumDate:"Posledný dostupný dátum",minimumDate:"Prvý dostupný dátum",next:"Nasledujúce",previous:"Predchádzajúce",selectedDateDescription:e=>`Vybratý dátum: ${e.date}`,selectedRangeDescription:e=>`Vybratý rozsah: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknutím spustíte výber rozsahu dátumov",todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybratý dnešný dátum ${e.date}`};var uS={};uS={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:"Kliknite za dokončanje izbire datumskega obsega",maximumDate:"Zadnji razpoložljivi datum",minimumDate:"Prvi razpoložljivi datum",next:"Naprej",previous:"Nazaj",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano območje: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite za začetek izbire datumskega obsega",todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`};var cS={};cS={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:"Kliknite da dovršite opseg izabranih datuma",maximumDate:"Zadnji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sledeći",previous:"Prethodni",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete opseg izabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`};var dS={};dS={dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:"Klicka för att avsluta val av datumintervall",maximumDate:"Sista tillgängliga datum",minimumDate:"Första tillgängliga datum",next:"Nästa",previous:"Föregående",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:"Klicka för att välja datumintervall",todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`};var fS={};fS={dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} seçildi`,finishRangeSelectionPrompt:"Tarih aralığı seçimini tamamlamak için tıklayın",maximumDate:"Son müsait tarih",minimumDate:"İlk müsait tarih",next:"Sonraki",previous:"Önceki",selectedDateDescription:e=>`Seçilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Seçilen Aralık: ${e.dateRange}`,startRangeSelectionPrompt:"Tarih aralığı seçimini başlatmak için tıklayın",todayDate:e=>`Bugün, ${e.date}`,todayDateSelected:e=>`Bugün, ${e.date} seçildi`};var hS={};hS={dateRange:e=>`${e.startDate} — ${e.endDate}`,dateSelected:e=>`Вибрано ${e.date}`,finishRangeSelectionPrompt:"Натисніть, щоб завершити вибір діапазону дат",maximumDate:"Остання доступна дата",minimumDate:"Перша доступна дата",next:"Наступний",previous:"Попередній",selectedDateDescription:e=>`Вибрана дата: ${e.date}`,selectedRangeDescription:e=>`Вибраний діапазон: ${e.dateRange}`,startRangeSelectionPrompt:"Натисніть, щоб почати вибір діапазону дат",todayDate:e=>`Сьогодні, ${e.date}`,todayDateSelected:e=>`Сьогодні, вибрано ${e.date}`};var gS={};gS={dateRange:e=>`${e.startDate} 至 ${e.endDate}`,dateSelected:e=>`已选择 ${e.date}`,finishRangeSelectionPrompt:"单击以完成选择日期范围",maximumDate:"最后一个可用日期",minimumDate:"第一个可用日期",next:"下一页",previous:"上一页",selectedDateDescription:e=>`选定的日期:${e.date}`,selectedRangeDescription:e=>`选定的范围:${e.dateRange}`,startRangeSelectionPrompt:"单击以开始选择日期范围",todayDate:e=>`今天,即 ${e.date}`,todayDateSelected:e=>`已选择今天,即 ${e.date}`};var pS={};pS={dateRange:e=>`${e.startDate} 至 ${e.endDate}`,dateSelected:e=>`已選取 ${e.date}`,finishRangeSelectionPrompt:"按一下以完成選取日期範圍",maximumDate:"最後一個可用日期",minimumDate:"第一個可用日期",next:"下一頁",previous:"上一頁",selectedDateDescription:e=>`選定的日期:${e.date}`,selectedRangeDescription:e=>`選定的範圍:${e.dateRange}`,startRangeSelectionPrompt:"按一下以開始選取日期範圍",todayDate:e=>`今天,${e.date}`,todayDateSelected:e=>`已選取今天,${e.date}`};var Au={};Au={"ar-AE":NE,"bg-BG":ME,"cs-CZ":LE,"da-DK":OE,"de-DE":VE,"el-GR":HE,"en-US":jE,"es-ES":WE,"et-EE":zE,"fi-FI":GE,"fr-FR":UE,"he-IL":XE,"hr-HR":ZE,"hu-HU":YE,"it-IT":KE,"ja-JP":JE,"ko-KR":qE,"lt-LT":QE,"lv-LV":eS,"nb-NO":tS,"nl-NL":nS,"pl-PL":rS,"pt-BR":iS,"pt-PT":aS,"ro-RO":oS,"ru-RU":sS,"sk-SK":lS,"sl-SI":uS,"sr-SP":cS,"sv-SE":dS,"tr-TR":fS,"uk-UA":hS,"zh-CN":gS,"zh-TW":pS};function mS(e){return e&&e.__esModule?e.default:e}const Nm=new WeakMap;function Jl(e){return(e==null?void 0:e.calendar.identifier)==="gregory"&&e.era==="BC"?"short":void 0}function zV(e){let t=Du(mS(Au),"@react-aria/calendar"),n,r;"highlightedRange"in e?{start:n,end:r}=e.highlightedRange||{}:n=r=e.value;let i=_a({weekday:"long",month:"long",year:"numeric",day:"numeric",era:Jl(n)||Jl(r),timeZone:e.timeZone}),a="anchorDate"in e?e.anchorDate:null;return I.useMemo(()=>{if(!a&&n&&r)if(Gt(n,r)){let o=i.format(n.toDate(e.timeZone));return t.format("selectedDateDescription",{date:o})}else{let o=kg(i,t,n,r,e.timeZone);return t.format("selectedRangeDescription",{dateRange:o})}return""},[n,r,a,e.timeZone,t,i])}function $g(e,t,n,r){let i=Du(mS(Au),"@react-aria/calendar"),a=Jl(e)||Jl(t),o=_a({month:"long",year:"numeric",era:a,calendar:e.calendar.identifier,timeZone:n}),s=_a({month:"long",year:"numeric",day:"numeric",era:a,calendar:e.calendar.identifier,timeZone:n});return I.useMemo(()=>{if(Gt(e,wu(e))){if(Gt(t,mg(e)))return o.format(e.toDate(n));if(Gt(t,mg(t)))return r?kg(o,i,e,t,n):o.formatRange(e.toDate(n),t.toDate(n))}return r?kg(s,i,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,o,s,i,n,r])}function kg(e,t,n,r,i){let a=e.formatRangeToParts(n.toDate(i),r.toDate(i)),o=-1;for(let u=0;u<a.length;u++){let c=a[u];if(c.source==="shared"&&c.type==="literal")o=u;else if(c.source==="endRange")break}let s="",l="";for(let u=0;u<a.length;u++)u<o?s+=a[u].value:u>o&&(l+=a[u].value);return t.format("dateRange",{startDate:s,endDate:l})}const bS=7e3;let Hh=null;function qv(e,t="assertive",n=bS){Hh||(Hh=new GV),Hh.announce(e,t,n)}class GV{createLog(t){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",t),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,n="assertive",r=bS){if(!this.node)return;let i=document.createElement("div");i.textContent=t,n==="assertive"?this.assertiveLog.appendChild(i):this.politeLog.appendChild(i),t!==""&&setTimeout(()=>{i.remove()},r)}clear(t){this.node&&((!t||t==="assertive")&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&(this.politeLog.innerHTML=""))}constructor(){this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node)}}function UV(e){return e&&e.__esModule?e.default:e}function vS(e,t){let n=Du(UV(Au),"@react-aria/calendar"),r=Dm(e),i=$g(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),a=$g(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);Ov(()=>{t.isFocused||qv(a)},[a]);let o=zV(t);Ov(()=>{o&&qv(o,"polite",4e3)},[o]);let s=Sg([!!e.errorMessage,e.isInvalid,e.validationState]);Nm.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:s,selectedDateDescription:o});let[l,u]=I.useState(!1),c=e.isDisabled||t.isNextVisibleRangeInvalid();c&&l&&(u(!1),t.setFocused(!0));let[d,h]=I.useState(!1),f=e.isDisabled||t.isPreviousVisibleRangeInvalid();f&&d&&(h(!1),t.setFocused(!0));let g=Tm({id:e.id,"aria-label":[e["aria-label"],a].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]});return{calendarProps:Gn(r,g,{role:"application","aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":n.format("next"),isDisabled:c,onFocusChange:u},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":n.format("previous"),isDisabled:f,onFocusChange:h},errorMessageProps:{id:s},title:i}}function yS(e,t){return vS(e,t)}function XV(e,t,n){let r=vS(e,t),i=I.useRef(!1),a=I.useRef(typeof window<"u"?window:null);return Mh(a,"pointerdown",s=>{i.current=s.width===0&&s.height===0}),Mh(a,"pointerup",s=>{if(i.current){i.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let l=s.target;n.current&&n.current.contains(document.activeElement)&&(!n.current.contains(l)||!l.closest('button, [role="button"]'))&&t.selectFocusedDate()}),r.calendarProps.onBlur=s=>{n.current&&(!s.relatedTarget||!n.current.contains(s.relatedTarget))&&t.anchorDate&&t.selectFocusedDate()},Mh(n,"touchmove",s=>{t.isDragging&&s.preventDefault()},{passive:!1,capture:!0}),r}function xS(e,t){let{startDate:n=t.visibleRange.start,endDate:r=t.visibleRange.end}=e,{direction:i}=Mr(),a=f=>{switch(f.key){case"Enter":case" ":f.preventDefault(),t.selectFocusedDate();break;case"PageUp":f.preventDefault(),f.stopPropagation(),t.focusPreviousSection(f.shiftKey);break;case"PageDown":f.preventDefault(),f.stopPropagation(),t.focusNextSection(f.shiftKey);break;case"End":f.preventDefault(),f.stopPropagation(),t.focusSectionEnd();break;case"Home":f.preventDefault(),f.stopPropagation(),t.focusSectionStart();break;case"ArrowLeft":f.preventDefault(),f.stopPropagation(),i==="rtl"?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":f.preventDefault(),f.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":f.preventDefault(),f.stopPropagation(),i==="rtl"?t.focusPreviousDay():t.focusNextDay();break;case"ArrowDown":f.preventDefault(),f.stopPropagation(),t.focusNextRow();break;case"Escape":"setAnchorDate"in t&&(f.preventDefault(),t.setAnchorDate(null));break}},o=$g(n,r,t.timeZone,!0),{ariaLabel:s,ariaLabelledBy:l}=Nm.get(t),u=Tm({"aria-label":[s,o].filter(Boolean).join(", "),"aria-labelledby":l}),c=_a({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:d}=Mr(),h=I.useMemo(()=>{let f=zl(gm(t.timeZone),d);return[...new Array(7).keys()].map(g=>{let m=f.add({days:g}).toDate(t.timeZone);return c.format(m)})},[d,t.timeZone,c]);return{gridProps:Gn(u,{role:"grid","aria-readonly":t.isReadOnly||null,"aria-disabled":t.isDisabled||null,"aria-multiselectable":"highlightedRange"in t||void 0,onKeyDown:a,onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:h}}function ZV(e){return e&&e.__esModule?e.default:e}function YV(e,t,n){let{date:r,isDisabled:i}=e,{errorMessageId:a,selectedDateDescription:o}=Nm.get(t),s=Du(ZV(Au),"@react-aria/calendar"),l=_a({weekday:"long",day:"numeric",month:"long",year:"numeric",era:Jl(r),timeZone:t.timeZone}),u=t.isSelected(r),c=t.isCellFocused(r);i=i||t.isCellDisabled(r);let d=t.isCellUnavailable(r),h=!i&&!d,f=t.isValueInvalid&&("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&r.compare(t.highlightedRange.start)>=0&&r.compare(t.highlightedRange.end)<=0:t.value&&Gt(t.value,r));f&&(u=!0),r=hE(r,pg);let g=I.useMemo(()=>r.toDate(t.timeZone),[r,t.timeZone]),p=HL(r,t.timeZone),m=I.useMemo(()=>{let A="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(Gt(r,t.value.start)||Gt(r,t.value.end))&&(A=o+", "),A+=l.format(g),p?A=s.format(u?"todayDateSelected":"todayDate",{date:A}):u&&(A=s.format("dateSelected",{date:A})),t.minValue&&Gt(r,t.minValue)?A+=", "+s.format("minimumDate"):t.maxValue&&Gt(r,t.maxValue)&&(A+=", "+s.format("maximumDate")),A},[l,g,s,u,p,r,t,o]),b="";"anchorDate"in t&&c&&!t.isReadOnly&&h&&(t.anchorDate?b=s.format("finishRangeSelectionPrompt"):b=s.format("startRangeSelectionPrompt"));let v=fE(b),x=I.useRef(!1),C=I.useRef(!1),E=I.useRef(null),{pressProps:w,isPressed:B}=Rm({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!h||t.isReadOnly,onPressStart(A){if(t.isReadOnly){t.setFocusedDate(r);return}if("highlightedRange"in t&&!t.anchorDate&&(A.pointerType==="mouse"||A.pointerType==="touch")){if(t.highlightedRange&&!f){if(Gt(r,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(r),t.setDragging(!0),C.current=!0;return}else if(Gt(r,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(r),t.setDragging(!0),C.current=!0;return}}let T=()=>{t.setDragging(!0),E.current=null,t.selectDate(r),t.setFocusedDate(r),x.current=!0};A.pointerType==="touch"?E.current=setTimeout(T,200):T()}},onPressEnd(){C.current=!1,x.current=!1,clearTimeout(E.current),E.current=null},onPress(){!("anchorDate"in t)&&!t.isReadOnly&&(t.selectDate(r),t.setFocusedDate(r))},onPressUp(A){if(!t.isReadOnly&&("anchorDate"in t&&E.current&&(t.selectDate(r),t.setFocusedDate(r)),"anchorDate"in t))if(C.current)t.setAnchorDate(r);else if(t.anchorDate&&!x.current)t.selectDate(r),t.setFocusedDate(r);else if(A.pointerType==="keyboard"&&!t.anchorDate){t.selectDate(r);let T=r.add({days:1});t.isInvalid(T)&&(T=r.subtract({days:1})),t.isInvalid(T)||t.setFocusedDate(T)}else A.pointerType==="virtual"&&(t.selectDate(r),t.setFocusedDate(r))}}),y=null;i||(y=Gt(r,t.focusedDate)?0:-1),I.useEffect(()=>{c&&n.current&&(da(n.current),wE()!=="pointer"&&document.activeElement===n.current&&lV(n.current,{containingElement:iV(n.current)}))},[c,n]);let S=_a({day:"numeric",timeZone:t.timeZone,calendar:r.calendar.identifier}),D=I.useMemo(()=>S.formatToParts(g).find(A=>A.type==="day").value,[S,g]);return{cellProps:{role:"gridcell","aria-disabled":!h||null,"aria-selected":u||null,"aria-invalid":f||null},buttonProps:Gn(w,{onFocus(){i||t.setFocusedDate(r)},tabIndex:y,role:"button","aria-disabled":!h||null,"aria-label":m,"aria-invalid":f||null,"aria-describedby":[f?a:null,v["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(A){"highlightDate"in t&&(A.pointerType!=="touch"||t.isDragging)&&h&&t.highlightDate(r)},onPointerDown(A){"releasePointerCapture"in A.target&&A.target.releasePointerCapture(A.pointerId)},onContextMenu(A){A.preventDefault()}}),isPressed:B,isFocused:c,isSelected:u,isDisabled:i,isUnavailable:d,isOutsideVisibleRange:r.compare(t.visibleRange.start)<0||r.compare(t.visibleRange.end)>0,isInvalid:f,formattedDate:D}}const Nf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},CS={...Nf,customError:!0,valid:!1},Ka={isInvalid:!1,validationDetails:Nf,validationErrors:[]},KV=I.createContext({}),Od="__formValidationState"+Date.now();function JV(e){if(e[Od]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Od];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return qV(e)}function qV(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s="aria"}=e;n&&(t||(t=n==="invalid"));let l=t!==void 0?{isInvalid:t,validationErrors:[],validationDetails:CS}:null,u=I.useMemo(()=>Qv(QV(o,i)),[o,i]);a!=null&&a.validationDetails.valid&&(a=null);let c=I.useContext(KV),d=I.useMemo(()=>r?Array.isArray(r)?r.flatMap(D=>Pg(c[D])):Pg(c[r]):[],[c,r]),[h,f]=I.useState(c),[g,p]=I.useState(!1);c!==h&&(f(c),p(!1));let m=I.useMemo(()=>Qv(g?[]:d),[g,d]),b=I.useRef(Ka),[v,x]=I.useState(Ka),C=I.useRef(Ka),E=()=>{if(!w)return;B(!1);let D=u||a||b.current;jh(D,C.current)||(C.current=D,x(D))},[w,B]=I.useState(!1);return I.useEffect(E),{realtimeValidation:l||m||u||a||Ka,displayValidation:s==="native"?l||m||v:l||m||u||a||v,updateValidation(D){s==="aria"&&!jh(v,D)?x(D):b.current=D},resetValidation(){let D=Ka;jh(D,C.current)||(C.current=D,x(D)),s==="native"&&B(!1),p(!0)},commitValidation(){s==="native"&&B(!0),p(!0)}}}function Pg(e){return e?Array.isArray(e)?e:[e]:[]}function QV(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return Pg(n)}return[]}function Qv(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:CS}:null}function jh(e,t){return e===t?!0:e&&t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function Vd(...e){let t=new Set,n=!1,r={...Nf};for(let o of e){var i,a;for(let s of o.validationErrors)t.add(s);n||(n=o.isInvalid);for(let s in r)(i=r)[a=s]||(i[a]=o.validationDetails[s])}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}function eH(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a="label"}=e;t=Cs(t);let o=Cs(),s={};n?(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a==="label"?t:void 0}):!r&&!i&&console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let l=Tm({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:l}}function tH(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=eH(e),s=Sg([!!t,!!n,r,i]),l=Sg([!!t,!!n,r,i]);return o=Gn(o,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:l}}}var ES={};ES={calendar:"التقويم",day:"يوم",dayPeriod:"ص/م",endDate:"تاريخ الانتهاء",era:"العصر",hour:"الساعات",minute:"الدقائق",month:"الشهر",second:"الثواني",selectedDateDescription:e=>`تاريخ محدد: ${e.date}`,selectedRangeDescription:e=>`المدى الزمني المحدد: ${e.startDate} إلى ${e.endDate}`,selectedTimeDescription:e=>`الوقت المحدد: ${e.time}`,startDate:"تاريخ البدء",timeZoneName:"التوقيت",weekday:"اليوم",year:"السنة"};var SS={};SS={calendar:"Календар",day:"ден",dayPeriod:"пр.об./сл.об.",endDate:"Крайна дата",era:"ера",hour:"час",minute:"минута",month:"месец",second:"секунда",selectedDateDescription:e=>`Избрана дата: ${e.date}`,selectedRangeDescription:e=>`Избран диапазон: ${e.startDate} до ${e.endDate}`,selectedTimeDescription:e=>`Избрано време: ${e.time}`,startDate:"Начална дата",timeZoneName:"часова зона",weekday:"ден от седмицата",year:"година"};var wS={};wS={calendar:"Kalendář",day:"den",dayPeriod:"část dne",endDate:"Konečné datum",era:"letopočet",hour:"hodina",minute:"minuta",month:"měsíc",second:"sekunda",selectedDateDescription:e=>`Vybrané datum: ${e.date}`,selectedRangeDescription:e=>`Vybrané období: ${e.startDate} až ${e.endDate}`,selectedTimeDescription:e=>`Vybraný čas: ${e.time}`,startDate:"Počáteční datum",timeZoneName:"časové pásmo",weekday:"den v týdnu",year:"rok"};var IS={};IS={calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"æra",hour:"time",minute:"minut",month:"måned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"år"};var _S={};_S={calendar:"Kalender",day:"Tag",dayPeriod:"Tageshälfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgewähltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgewählter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgewählte Zeit: ${e.time}`,startDate:"Anfangsdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"};var DS={};DS={calendar:"Ημερολόγιο",day:"ημέρα",dayPeriod:"π.μ./μ.μ.",endDate:"Ημερομηνία λήξης",era:"περίοδος",hour:"ώρα",minute:"λεπτό",month:"μήνας",second:"δευτερόλεπτο",selectedDateDescription:e=>`Επιλεγμένη ημερομηνία: ${e.date}`,selectedRangeDescription:e=>`Επιλεγμένο εύρος: ${e.startDate} έως ${e.endDate}`,selectedTimeDescription:e=>`Επιλεγμένη ώρα: ${e.time}`,startDate:"Ημερομηνία έναρξης",timeZoneName:"ζώνη ώρας",weekday:"καθημερινή",year:"έτος"};var AS={};AS={era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`};var TS={};TS={calendar:"Calendario",day:"día",dayPeriod:"a. m./p. m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"día de la semana",year:"año"};var RS={};RS={calendar:"Kalender",day:"päev",dayPeriod:"enne/pärast lõunat",endDate:"Lõppkuupäev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuupäev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuupäev",timeZoneName:"ajavöönd",weekday:"nädalapäev",year:"aasta"};var BS={};BS={calendar:"Kalenteri",day:"päivä",dayPeriod:"vuorokaudenaika",endDate:"Päättymispäivä",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu päivämäärä: ${e.date}`,selectedRangeDescription:e=>`Valittu aikaväli: ${e.startDate} – ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamispäivä",timeZoneName:"aikavyöhyke",weekday:"viikonpäivä",year:"vuosi"};var $S={};$S={calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"ère",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date sélectionnée : ${e.date}`,selectedRangeDescription:e=>`Plage sélectionnée : ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie : ${e.time}`,startDate:"Date de début",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"année"};var kS={};kS={calendar:"לוח שנה",day:"יום",dayPeriod:"לפנה״צ/אחה״צ",endDate:"תאריך סיום",era:"תקופה",hour:"שעה",minute:"דקה",month:"חודש",second:"שנייה",selectedDateDescription:e=>`תאריך נבחר: ${e.date}`,selectedRangeDescription:e=>`טווח נבחר: ${e.startDate} עד ${e.endDate}`,selectedTimeDescription:e=>`זמן נבחר: ${e.time}`,startDate:"תאריך התחלה",timeZoneName:"אזור זמן",weekday:"יום בשבוע",year:"שנה"};var PS={};PS={calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum završetka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum početka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"};var FS={};FS={calendar:"Naptár",day:"nap",dayPeriod:"napszak",endDate:"Befejező dátum",era:"éra",hour:"óra",minute:"perc",month:"hónap",second:"másodperc",selectedDateDescription:e=>`Kijelölt dátum: ${e.date}`,selectedRangeDescription:e=>`Kijelölt tartomány: ${e.startDate}–${e.endDate}`,selectedTimeDescription:e=>`Kijelölt idő: ${e.time}`,startDate:"Kezdő dátum",timeZoneName:"időzóna",weekday:"hét napja",year:"év"};var NS={};NS={calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"};var MS={};MS={calendar:"カレンダー",day:"日",dayPeriod:"午前/午後",endDate:"終了日",era:"時代",hour:"時",minute:"分",month:"月",second:"秒",selectedDateDescription:e=>`選択した日付 : ${e.date}`,selectedRangeDescription:e=>`選択範囲 : ${e.startDate} から ${e.endDate}`,selectedTimeDescription:e=>`選択した時間 : ${e.time}`,startDate:"開始日",timeZoneName:"タイムゾーン",weekday:"曜日",year:"年"};var LS={};LS={calendar:"달력",day:"일",dayPeriod:"오전/오후",endDate:"종료일",era:"연호",hour:"시",minute:"분",month:"월",second:"초",selectedDateDescription:e=>`선택 일자: ${e.date}`,selectedRangeDescription:e=>`선택 범위: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`선택 시간: ${e.time}`,startDate:"시작일",timeZoneName:"시간대",weekday:"요일",year:"년"};var OS={};OS={calendar:"Kalendorius",day:"diena",dayPeriod:"iki pietų / po pietų",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minutė",month:"mėnuo",second:"sekundė",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Pradžios data",timeZoneName:"laiko juosta",weekday:"savaitės diena",year:"metai"};var VS={};VS={calendar:"Kalendārs",day:"diena",dayPeriod:"priekšpusdienā/pēcpusdienā",endDate:"Beigu datums",era:"ēra",hour:"stundas",minute:"minūtes",month:"mēnesis",second:"sekundes",selectedDateDescription:e=>`Atlasītais datums: ${e.date}`,selectedRangeDescription:e=>`Atlasītais diapazons: no ${e.startDate} līdz ${e.endDate}`,selectedTimeDescription:e=>`Atlasītais laiks: ${e.time}`,startDate:"Sākuma datums",timeZoneName:"laika josla",weekday:"nedēļas diena",year:"gads"};var HS={};HS={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"måned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt område: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"år"};var jS={};jS={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"};var WS={};WS={calendar:"Kalendarz",day:"dzień",dayPeriod:"rano / po południu / wieczorem",endDate:"Data końcowa",era:"era",hour:"godzina",minute:"minuta",month:"miesiąc",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data początkowa",timeZoneName:"strefa czasowa",weekday:"dzień tygodnia",year:"rok"};var zS={};zS={calendar:"Calendário",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"mês",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso horário",weekday:"dia da semana",year:"ano"};var GS={};GS={calendar:"Calendário",day:"dia",dayPeriod:"am/pm",endDate:"Data de Término",era:"era",hour:"hora",minute:"minuto",month:"mês",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de Início",timeZoneName:"fuso horário",weekday:"dia da semana",year:"ano"};var US={};US={calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dată final",era:"eră",hour:"oră",minute:"minut",month:"lună",second:"secundă",selectedDateDescription:e=>`Dată selectată: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} până la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectată: ${e.time}`,startDate:"Dată început",timeZoneName:"fus orar",weekday:"ziua din săptămână",year:"an"};var XS={};XS={calendar:"Календарь",day:"день",dayPeriod:"AM/PM",endDate:"Дата окончания",era:"эра",hour:"час",minute:"минута",month:"месяц",second:"секунда",selectedDateDescription:e=>`Выбранная дата: ${e.date}`,selectedRangeDescription:e=>`Выбранный диапазон: с ${e.startDate} по ${e.endDate}`,selectedTimeDescription:e=>`Выбранное время: ${e.time}`,startDate:"Дата начала",timeZoneName:"часовой пояс",weekday:"день недели",year:"год"};var ZS={};ZS={calendar:"Kalendár",day:"deň",dayPeriod:"AM/PM",endDate:"Dátum ukončenia",era:"letopočet",hour:"hodina",minute:"minúta",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybratý dátum: ${e.date}`,selectedRangeDescription:e=>`Vybratý rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybratý čas: ${e.time}`,startDate:"Dátum začatia",timeZoneName:"časové pásmo",weekday:"deň týždňa",year:"rok"};var YS={};YS={calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano območje: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani čas: ${e.time}`,startDate:"Datum začetka",timeZoneName:"časovni pas",weekday:"dan v tednu",year:"leto"};var KS={};KS={calendar:"Kalendar",day:"дан",dayPeriod:"пре подне/по подне",endDate:"Datum završetka",era:"ера",hour:"сат",minute:"минут",month:"месец",second:"секунд",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum početka",timeZoneName:"временска зона",weekday:"дан у недељи",year:"година"};var JS={};JS={calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"månad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"år"};var qS={};qS={calendar:"Takvim",day:"gün",dayPeriod:"ÖÖ/ÖS",endDate:"Bitiş Tarihi",era:"çağ",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Seçilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Seçilen Aralık: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Seçilen Zaman: ${e.time}`,startDate:"Başlangıç Tarihi",timeZoneName:"saat dilimi",weekday:"haftanın günü",year:"yıl"};var QS={};QS={calendar:"Календар",day:"день",dayPeriod:"дп/пп",endDate:"Дата завершення",era:"ера",hour:"година",minute:"хвилина",month:"місяць",second:"секунда",selectedDateDescription:e=>`Вибрана дата: ${e.date}`,selectedRangeDescription:e=>`Вибраний діапазон: ${e.startDate} — ${e.endDate}`,selectedTimeDescription:e=>`Вибраний час: ${e.time}`,startDate:"Дата початку",timeZoneName:"часовий пояс",weekday:"день тижня",year:"рік"};var ew={};ew={calendar:"日历",day:"日",dayPeriod:"上午/下午",endDate:"结束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`选定的日期:${e.date}`,selectedRangeDescription:e=>`选定的范围:${e.startDate} 至 ${e.endDate}`,selectedTimeDescription:e=>`选定的时间:${e.time}`,startDate:"开始日期",timeZoneName:"时区",weekday:"工作日",year:"年"};var tw={};tw={calendar:"日曆",day:"日",dayPeriod:"上午/下午",endDate:"結束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`選定的日期:${e.date}`,selectedRangeDescription:e=>`選定的範圍:${e.startDate} 至 ${e.endDate}`,selectedTimeDescription:e=>`選定的時間:${e.time}`,startDate:"開始日期",timeZoneName:"时区",weekday:"工作日",year:"年"};var nw={};nw={"ar-AE":ES,"bg-BG":SS,"cs-CZ":wS,"da-DK":IS,"de-DE":_S,"el-GR":DS,"en-US":AS,"es-ES":TS,"et-EE":RS,"fi-FI":BS,"fr-FR":$S,"he-IL":kS,"hr-HR":PS,"hu-HU":FS,"it-IT":NS,"ja-JP":MS,"ko-KR":LS,"lt-LT":OS,"lv-LV":VS,"nb-NO":HS,"nl-NL":jS,"pl-PL":WS,"pt-BR":zS,"pt-PT":GS,"ro-RO":US,"ru-RU":XS,"sk-SK":ZS,"sl-SI":YS,"sr-SP":KS,"sv-SE":JS,"tr-TR":qS,"uk-UA":QS,"zh-CN":ew,"zh-TW":tw};function nH(e,t,n){let{direction:r}=Mr(),i=I.useMemo(()=>TE(t),[t]),a=l=>{if(l.currentTarget.contains(l.target)&&(l.altKey&&(l.key==="ArrowDown"||l.key==="ArrowUp")&&"setOpen"in e&&(l.preventDefault(),l.stopPropagation(),e.setOpen(!0)),!n))switch(l.key){case"ArrowLeft":l.preventDefault(),l.stopPropagation(),r==="rtl"?i.focusNext():i.focusPrevious();break;case"ArrowRight":l.preventDefault(),l.stopPropagation(),r==="rtl"?i.focusPrevious():i.focusNext();break}},o=()=>{var l;let u=(l=window.event)===null||l===void 0?void 0:l.target,c=rl(t.current,{tabbable:!0});if(u&&(c.currentNode=u,u=c.previousNode()),!u){let d;do d=c.lastChild(),d&&(u=d);while(d)}for(;u!=null&&u.hasAttribute("data-placeholder");){let d=c.previousNode();if(d&&d.hasAttribute("data-placeholder"))u=d;else break}u&&u.focus()},{pressProps:s}=Rm({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(l){l.pointerType==="mouse"&&o()},onPress(l){l.pointerType!=="mouse"&&o()}});return Gn(s,{onKeyDown:a})}const rH="__role_"+Date.now(),iH="__focusManager_"+Date.now();function aH(e){return e&&e.__esModule?e.default:e}function oH(e,t,n){var r,i;let a=Du(aH(nw),"@react-aria/datepicker"),{isInvalid:o,validationErrors:s,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:c,descriptionProps:d,errorMessageProps:h}=tH({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||s}),f=c["aria-labelledby"]||c.id,{locale:g}=Mr(),p=t.formatValue(g,{month:"long"}),m=p?a.format("selectedRangeDescription",{startDate:p.start,endDate:p.end}):"",b=fE(m),v={"aria-label":a.format("startDate"),"aria-labelledby":f},x={"aria-label":a.format("endDate"),"aria-labelledby":f},C=Cs(),E=Cs(),w=nH(t,n),B=[b["aria-describedby"],c["aria-describedby"]].filter(Boolean).join(" ")||void 0,y=I.useMemo(()=>TE(n,{accept:k=>k.id!==C}),[n,C]),S={[iH]:y,[rH]:"presentation","aria-describedby":B,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},D=Dm(e),{focusWithinProps:A}=IE({...e,isDisabled:t.isOpen,onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),T=I.useRef(Ka),F=I.useRef(Ka);return{groupProps:Gn(D,w,c,b,A,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":B,onKeyDown(k){t.isOpen||e.onKeyDown&&e.onKeyDown(k)},onKeyUp(k){t.isOpen||e.onKeyUp&&e.onKeyUp(k)}}),labelProps:{...u,onClick:()=>{y.focusFirst()}},buttonProps:{...b,id:C,"aria-haspopup":"dialog","aria-label":a.format("calendar"),"aria-labelledby":`${C} ${f}`,"aria-describedby":B,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:E,"aria-labelledby":`${C} ${f}`},startFieldProps:{...v,...S,value:(r=t.value)===null||r===void 0?void 0:r.start,onChange:k=>t.setDateTime("start",k),autoFocus:e.autoFocus,name:e.startName,[Od]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(k){T.current=k,t.updateValidation(Vd(k,F.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...x,...S,value:(i=t.value)===null||i===void 0?void 0:i.end,onChange:k=>t.setDateTime("end",k),name:e.endName,[Od]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(k){F.current=k,t.updateValidation(Vd(T.current,k))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:d,errorMessageProps:h,calendarProps:{autoFocus:!0,value:t.dateRange,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:typeof e.errorMessage=="function"?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" ")},isInvalid:o,validationErrors:s,validationDetails:l}}function ls(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function Fg(e,t,n,r,i){let a={};for(let s in t)a[s]=Math.floor(t[s]/2),a[s]>0&&t[s]%2===0&&a[s]--;let o=to(e,t,n).subtract(a);return ql(e,o,t,n,r,i)}function to(e,t,n,r,i){let a=e;return t.years?a=WL(e):t.months?a=wu(e):t.weeks&&(a=zl(e,n)),ql(e,a,t,n,r,i)}function Ng(e,t,n,r,i){let a={...t};t.days?a.days--:t.weeks?a.weeks--:t.months?a.months--:t.years&&a.years--;let o=to(e,t,n).subtract(a);return ql(e,o,t,n,r,i)}function ql(e,t,n,r,i,a){return i&&e.compare(i)>=0&&(t=mm(t,to(Bn(i),n,r))),a&&e.compare(a)<=0&&(t=pm(t,Ng(Bn(a),n,r))),t}function ea(e,t,n){return t&&(e=mm(e,Bn(t))),n&&(e=pm(e,Bn(n))),e}function rw(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});if(e.compare(t)>=0)return e}function iw(e){let t=I.useMemo(()=>new Xl(e.locale),[e.locale]),n=I.useMemo(()=>t.resolvedOptions(),[t]),{locale:r,createCalendar:i,visibleDuration:a={months:1},minValue:o,maxValue:s,selectionAlignment:l,isDateUnavailable:u,pageBehavior:c="visible"}=e,d=I.useMemo(()=>i(n.calendar),[i,n.calendar]),[h,f]=Kl(e.value,e.defaultValue,e.onChange),g=I.useMemo(()=>h?rn(Bn(h),d):null,[h,d]),p=I.useMemo(()=>h&&"timeZone"in h?h.timeZone:n.timeZone,[h,n.timeZone]),m=I.useMemo(()=>e.focusedValue?ea(rn(Bn(e.focusedValue),d),o,s):void 0,[e.focusedValue,d,o,s]),b=I.useMemo(()=>ea(e.defaultFocusedValue?rn(Bn(e.defaultFocusedValue),d):g||rn(gm(p),d),o,s),[e.defaultFocusedValue,g,p,d,o,s]),[v,x]=Kl(m,b,e.onFocusChange),[C,E]=I.useState(()=>{switch(l){case"start":return to(v,a,r,o,s);case"end":return Ng(v,a,r,o,s);case"center":default:return Fg(v,a,r,o,s)}}),[w,B]=I.useState(e.autoFocus||!1),y=I.useMemo(()=>{let R={...a};return R.days?R.days--:R.days=-1,C.add(R)},[C,a]),[S,D]=I.useState(d.identifier);if(d.identifier!==S){let R=rn(v,d);E(Fg(R,a,r,o,s)),x(R),D(d.identifier)}ls(v,o,s)?x(ea(v,o,s)):v.compare(C)<0?E(Ng(v,a,r,o,s)):v.compare(y)>0&&E(to(v,a,r,o,s));function A(R){R=ea(R,o,s),x(R)}function T(R){if(!e.isDisabled&&!e.isReadOnly){if(R===null){f(null);return}if(R=ea(R,o,s),R=rw(R,C,u),!R)return;R=rn(R,(h==null?void 0:h.calendar)||new ar),h&&"hour"in h?f(h.set(R)):f(R)}}let F=I.useMemo(()=>g?u&&u(g)?!0:ls(g,o,s):!1,[g,u,o,s]),k=e.isInvalid||e.validationState==="invalid"||F,P=k?"invalid":null,$=I.useMemo(()=>c==="visible"?a:Wh(a),[c,a]);return{isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,value:g,setValue:T,visibleRange:{start:C,end:y},minValue:o,maxValue:s,focusedDate:v,timeZone:p,validationState:P,isValueInvalid:k,setFocusedDate(R){A(R),B(!0)},focusNextDay(){A(v.add({days:1}))},focusPreviousDay(){A(v.subtract({days:1}))},focusNextRow(){a.days?this.focusNextPage():(a.weeks||a.months||a.years)&&A(v.add({weeks:1}))},focusPreviousRow(){a.days?this.focusPreviousPage():(a.weeks||a.months||a.years)&&A(v.subtract({weeks:1}))},focusNextPage(){let R=C.add($);x(ea(v.add($),o,s)),E(to(ql(v,R,$,r,o,s),$,r))},focusPreviousPage(){let R=C.subtract($);x(ea(v.subtract($),o,s)),E(to(ql(v,R,$,r,o,s),$,r))},focusSectionStart(){a.days?A(C):a.weeks?A(zl(v,r)):(a.months||a.years)&&A(wu(v))},focusSectionEnd(){a.days?A(y):a.weeks?A(zL(v,r)):(a.months||a.years)&&A(mg(v))},focusNextSection(R){if(!R&&!a.days){A(v.add(Wh(a)));return}a.days?this.focusNextPage():a.weeks?A(v.add({months:1})):(a.months||a.years)&&A(v.add({years:1}))},focusPreviousSection(R){if(!R&&!a.days){A(v.subtract(Wh(a)));return}a.days?this.focusPreviousPage():a.weeks?A(v.subtract({months:1})):(a.months||a.years)&&A(v.subtract({years:1}))},selectFocusedDate(){T(v)},selectDate(R){T(R)},isFocused:w,setFocused:B,isInvalid(R){return ls(R,o,s)},isSelected(R){return g!=null&&Gt(R,g)&&!this.isCellDisabled(R)&&!this.isCellUnavailable(R)},isCellFocused(R){return w&&v&&Gt(R,v)},isCellDisabled(R){return e.isDisabled||R.compare(C)<0||R.compare(y)>0||this.isInvalid(R,o,s)},isCellUnavailable(R){return e.isDateUnavailable&&e.isDateUnavailable(R)},isPreviousVisibleRangeInvalid(){let R=C.subtract({days:1});return Gt(R,C)||this.isInvalid(R,o,s)},isNextVisibleRangeInvalid(){let R=y.add({days:1});return Gt(R,y)||this.isInvalid(R,o,s)},getDatesInWeek(R,O=C){let j=O.add({weeks:R}),V=[];j=zl(j,r);let W=kf(j,r);for(let U=0;U<W;U++)V.push(null);for(;V.length<7;){V.push(j);let U=j.add({days:1});if(Gt(j,U))break;j=U}for(;V.length<7;)V.push(null);return V}}}function Wh(e){let t={...e};for(let n in e)t[n]=1;return t}function sH(e){let{value:t,defaultValue:n,onChange:r,createCalendar:i,locale:a,visibleDuration:o={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=Kl(t,n||null,r),[h,f]=I.useState(null),g="center";if(c&&c.start&&c.end){let O=Fg(Bn(c.start),o,a,s,l).add(o).subtract({days:1});c.end.compare(O)>0&&(g="start")}let p=I.useRef(null),[m,b]=I.useState(null),v=I.useMemo(()=>mm(s,m==null?void 0:m.start),[s,m]),x=I.useMemo(()=>pm(l,m==null?void 0:m.end),[l,m]),C=iw({...u,value:c&&c.start,createCalendar:i,locale:a,visibleDuration:o,minValue:v,maxValue:x,selectionAlignment:g}),E=R=>{R&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(p.current={start:ty(R,C,-1),end:ty(R,C,1)},b(p.current)):(p.current=null,b(null))},[w,B]=I.useState(C.visibleRange);(!pg(C.visibleRange.start,w.start)||!pg(C.visibleRange.end,w.end))&&(E(h),B(C.visibleRange));let y=R=>{R?(f(R),E(R)):(f(null),E(null))},S=h?zh(h,C.focusedDate):c&&zh(c.start,c.end),D=R=>{if(!e.isReadOnly&&(R=ea(R,v,x),R=rw(R,C.visibleRange.start,e.isDateUnavailable),!!R))if(!h)y(R);else{let O=zh(h,R);d({start:ey(O.start,c==null?void 0:c.start),end:ey(O.end,c==null?void 0:c.end)}),y(null)}},[A,T]=I.useState(!1),{isDateUnavailable:F}=e,k=I.useMemo(()=>!c||h?!1:F&&(F(c.start)||F(c.end))?!0:ls(c.start,s,l)||ls(c.end,s,l),[F,c,h,s,l]),P=e.isInvalid||e.validationState==="invalid"||k;return{...C,value:c,setValue:d,anchorDate:h,setAnchorDate:y,highlightedRange:S,validationState:P?"invalid":null,isValueInvalid:P,selectFocusedDate(){D(C.focusedDate)},selectDate:D,highlightDate(R){h&&C.setFocusedDate(R)},isSelected(R){return S&&R.compare(S.start)>=0&&R.compare(S.end)<=0&&!C.isCellDisabled(R)&&!C.isCellUnavailable(R)},isInvalid(R){var O,j;return C.isInvalid(R)||ls(R,(O=p.current)===null||O===void 0?void 0:O.start,(j=p.current)===null||j===void 0?void 0:j.end)},isDragging:A,setDragging:T}}function zh(e,t){return!e||!t?null:(t.compare(e)<0&&([e,t]=[t,e]),{start:Bn(e),end:Bn(t)})}function ey(e,t){return e=rn(e,(t==null?void 0:t.calendar)||new ar),t&&"hour"in t?t.set(e):e}function ty(e,t,n){let r=e.add({days:n});for(;(n<0?r.compare(t.visibleRange.start)>=0:r.compare(t.visibleRange.end)<=0)&&!t.isCellUnavailable(r);)r=r.add({days:n});return t.isCellUnavailable(r)?r.add({days:-n}):null}function lH(e){let[t,n]=Kl(e.isOpen,e.defaultOpen||!1,e.onOpenChange);const r=I.useCallback(()=>{n(!0)},[n]),i=I.useCallback(()=>{n(!1)},[n]),a=I.useCallback(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:i,toggle:a}}var aw={};aw={rangeOverflow:e=>`يجب أن تكون القيمة ${e.maxValue} أو قبل ذلك.`,rangeReversed:"تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.",rangeUnderflow:e=>`يجب أن تكون القيمة ${e.minValue} أو بعد ذلك.`,unavailableDate:"البيانات المحددة غير متاحة."};var ow={};ow={rangeOverflow:e=>`Стойността трябва да е ${e.maxValue} или по-ранна.`,rangeReversed:"Началната дата трябва да е преди крайната.",rangeUnderflow:e=>`Стойността трябва да е ${e.minValue} или по-късно.`,unavailableDate:"Избраната дата не е налична."};var sw={};sw={rangeOverflow:e=>`Hodnota musí být ${e.maxValue} nebo dřívější.`,rangeReversed:"Datum zahájení musí předcházet datu ukončení.",rangeUnderflow:e=>`Hodnota musí být ${e.minValue} nebo pozdější.`,unavailableDate:"Vybrané datum není k dispozici."};var lw={};lw={rangeOverflow:e=>`Værdien skal være ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal være før slutdatoen.",rangeUnderflow:e=>`Værdien skal være ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilgængelig."};var uw={};uw={rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder früher sein.`,rangeReversed:"Das Anfangsdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder später sein.`,unavailableDate:"Das ausgewählte Datum ist nicht verfügbar."};var cw={};cw={rangeOverflow:e=>`Η τιμή πρέπει να είναι ${e.maxValue} ή παλαιότερη.`,rangeReversed:"Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.",rangeUnderflow:e=>`Η τιμή πρέπει να είναι ${e.minValue} ή μεταγενέστερη.`,unavailableDate:"Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη."};var dw={};dw={rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."};var fw={};fw={rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalización.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."};var hw={};hw={rangeOverflow:e=>`Väärtus peab olema ${e.maxValue} või varasem.`,rangeReversed:"Alguskuupäev peab olema enne lõppkuupäeva.",rangeUnderflow:e=>`Väärtus peab olema ${e.minValue} või hilisem.`,unavailableDate:"Valitud kuupäev pole saadaval."};var gw={};gw={rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sitä aikaisempi.`,rangeReversed:"Aloituspäivän on oltava ennen lopetuspäivää.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sitä myöhäisempi.`,unavailableDate:"Valittu päivämäärä ei ole käytettävissä."};var pw={};pw={rangeOverflow:e=>`La valeur doit être ${e.maxValue} ou antérieure.`,rangeReversed:"La date de début doit être antérieure à la date de fin.",rangeUnderflow:e=>`La valeur doit être ${e.minValue} ou ultérieure.`,unavailableDate:"La date sélectionnée n’est pas disponible."};var mw={};mw={rangeOverflow:e=>`הערך חייב להיות ${e.maxValue} או מוקדם יותר.`,rangeReversed:"תאריך ההתחלה חייב להיות לפני תאריך הסיום.",rangeUnderflow:e=>`הערך חייב להיות ${e.minValue} או מאוחר יותר.`,unavailableDate:"התאריך הנבחר אינו זמין."};var bw={};bw={rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum početka mora biti prije datuma završetka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."};var vw={};vw={rangeOverflow:e=>`Az értéknek ${e.maxValue} vagy korábbinak kell lennie.`,rangeReversed:"A kezdő dátumnak a befejező dátumnál korábbinak kell lennie.",rangeUnderflow:e=>`Az értéknek ${e.minValue} vagy későbbinek kell lennie.`,unavailableDate:"A kiválasztott dátum nem érhető el."};var yw={};yw={rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."};var xw={};xw={rangeOverflow:e=>`値は ${e.maxValue} 以下にする必要があります。`,rangeReversed:"開始日は終了日より前にする必要があります。",rangeUnderflow:e=>`値は ${e.minValue} 以上にする必要があります。`,unavailableDate:"選択した日付は使用できません。"};var Cw={};Cw={rangeOverflow:e=>`값은 ${e.maxValue} 이전이어야 합니다.`,rangeReversed:"시작일은 종료일 이전이어야 합니다.",rangeUnderflow:e=>`값은 ${e.minValue} 이상이어야 합니다.`,unavailableDate:"선택한 날짜를 사용할 수 없습니다."};var Ew={};Ew={rangeOverflow:e=>`Reikšmė turi būti ${e.maxValue} arba ankstesnė.`,rangeReversed:"Pradžios data turi būti ankstesnė nei pabaigos data.",rangeUnderflow:e=>`Reikšmė turi būti ${e.minValue} arba naujesnė.`,unavailableDate:"Pasirinkta data nepasiekiama."};var Sw={};Sw={rangeOverflow:e=>`Vērtībai ir jābūt ${e.maxValue} vai agrākai.`,rangeReversed:"Sākuma datumam ir jābūt pirms beigu datuma.",rangeUnderflow:e=>`Vērtībai ir jābūt ${e.minValue} vai vēlākai.`,unavailableDate:"Atlasītais datums nav pieejams."};var ww={};ww={rangeOverflow:e=>`Verdien må være ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen må være før sluttdatoen.",rangeUnderflow:e=>`Verdien må være ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."};var Iw={};Iw={rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."};var _w={};_w={rangeOverflow:e=>`Wartość musi mieć wartość ${e.maxValue} lub wcześniejszą.`,rangeReversed:"Data rozpoczęcia musi być wcześniejsza niż data zakończenia.",rangeUnderflow:e=>`Wartość musi mieć wartość ${e.minValue} lub późniejszą.`,unavailableDate:"Wybrana data jest niedostępna."};var Dw={};Dw={rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior à data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indisponível."};var Aw={};Aw={rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de início deve ser anterior à data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indisponível."};var Tw={};Tw={rangeOverflow:e=>`Valoarea trebuie să fie ${e.maxValue} sau anterioară.`,rangeReversed:"Data de început trebuie să fie anterioară datei de sfârșit.",rangeUnderflow:e=>`Valoarea trebuie să fie ${e.minValue} sau ulterioară.`,unavailableDate:"Data selectată nu este disponibilă."};var Rw={};Rw={rangeOverflow:e=>`Значение должно быть не позже ${e.maxValue}.`,rangeReversed:"Дата начала должна предшествовать дате окончания.",rangeUnderflow:e=>`Значение должно быть не раньше ${e.minValue}.`,unavailableDate:"Выбранная дата недоступна."};var Bw={};Bw={rangeOverflow:e=>`Hodnota musí byť ${e.maxValue} alebo skoršia.`,rangeReversed:"Dátum začiatku musí byť skorší ako dátum konca.",rangeUnderflow:e=>`Hodnota musí byť ${e.minValue} alebo neskoršia.`,unavailableDate:"Vybratý dátum je nedostupný."};var $w={};$w={rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starejša.`,rangeReversed:"Začetni datum mora biti pred končnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novejša.`,unavailableDate:"Izbrani datum ni na voljo."};var kw={};kw={rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum početka mora biti pre datuma završetka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."};var Pw={};Pw={rangeOverflow:e=>`Värdet måste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet måste vara före slutdatumet.",rangeUnderflow:e=>`Värdet måste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet är inte tillgängligt."};var Fw={};Fw={rangeOverflow:e=>`Değer, ${e.maxValue} veya öncesi olmalıdır.`,rangeReversed:"Başlangıç tarihi bitiş tarihinden önce olmalıdır.",rangeUnderflow:e=>`Değer, ${e.minValue} veya sonrası olmalıdır.`,unavailableDate:"Seçilen tarih kullanılamıyor."};var Nw={};Nw={rangeOverflow:e=>`Значення має бути не пізніше ${e.maxValue}.`,rangeReversed:"Дата початку має передувати даті завершення.",rangeUnderflow:e=>`Значення має бути не раніше ${e.minValue}.`,unavailableDate:"Вибрана дата недоступна."};var Mw={};Mw={rangeOverflow:e=>`值必须是 ${e.maxValue} 或更早日期。`,rangeReversed:"开始日期必须早于结束日期。",rangeUnderflow:e=>`值必须是 ${e.minValue} 或更晚日期。`,unavailableDate:"所选日期不可用。"};var Lw={};Lw={rangeOverflow:e=>`值必須是 ${e.maxValue} 或更早。`,rangeReversed:"開始日期必須在結束日期之前。",rangeUnderflow:e=>`值必須是 ${e.minValue} 或更晚。`,unavailableDate:"所選日期無法使用。"};var Ow={};Ow={"ar-AE":aw,"bg-BG":ow,"cs-CZ":sw,"da-DK":lw,"de-DE":uw,"el-GR":cw,"en-US":dw,"es-ES":fw,"et-EE":hw,"fi-FI":gw,"fr-FR":pw,"he-IL":mw,"hr-HR":bw,"hu-HU":vw,"it-IT":yw,"ja-JP":xw,"ko-KR":Cw,"lt-LT":Ew,"lv-LV":Sw,"nb-NO":ww,"nl-NL":Iw,"pl-PL":_w,"pt-BR":Dw,"pt-PT":Aw,"ro-RO":Tw,"ru-RU":Rw,"sk-SK":Bw,"sl-SI":$w,"sr-SP":kw,"sv-SE":Pw,"tr-TR":Fw,"uk-UA":Nw,"zh-CN":Mw,"zh-TW":Lw};function uH(e){return e&&e.__esModule?e.default:e}const Vw=new Do(uH(Ow));function Hw(){return typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US"}function ny(e,t,n,r,i){let a=e!=null&&n!=null&&e.compare(n)>0,o=e!=null&&t!=null&&e.compare(t)<0,s=e!=null&&(r==null?void 0:r(e))||!1,l=a||o||s,u=[];if(l){let c=Hw(),d=Do.getGlobalDictionaryForPackage("@react-stately/datepicker")||Vw,h=new FE(c,d),f=new Xl(c,Mg({},i)),g=f.resolvedOptions().timeZone;o&&u.push(h.format("rangeUnderflow",{minValue:f.format(t.toDate(g))})),a&&u.push(h.format("rangeOverflow",{maxValue:f.format(n.toDate(g))})),s&&u.push(h.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:a,rangeUnderflow:o,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}function cH(e,t,n,r,i){let a=ny(e==null?void 0:e.start,t,n,r,i),o=ny(e==null?void 0:e.end,t,n,r,i),s=Vd(a,o);if(e.end!=null&&e.start!=null&&e.end.compare(e.start)<0){let l=Do.getGlobalDictionaryForPackage("@react-stately/datepicker")||Vw;s=Vd(s,{isInvalid:!0,validationErrors:[l.getStringForLocale("rangeReversed",Hw())],validationDetails:{...Nf,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return s}const dH={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},fH={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function Mg(e,t){e={...t.shouldForceLeadingZeros?fH:dH,...e};let r=t.granularity||"minute",i=Object.keys(e);var a;let o=i.indexOf((a=t.maxGranularity)!==null&&a!==void 0?a:"year");o<0&&(o=0);let s=i.indexOf(r);if(s<0&&(s=2),o>s)throw new Error("maxGranularity must be greater than granularity");let l=i.slice(o,s+1).reduce((c,d)=>(c[d]=e[d],c),{});return t.hourCycle!=null&&(l.hour12=t.hourCycle===12),l.timeZone=t.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&t.timeZone&&!t.hideTimeZone&&(l.timeZoneName="short"),t.showEra&&o===0&&(l.era="short"),l}function ac(e){return e&&"hour"in e?e:new Sm}function hH(e,t){let n=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw new Error("Invalid granularity "+t+" for value "+e.toString());let[i,a]=I.useState([r,n]);e&&(i[0]!==r||i[1]!==n)&&a([r,n]),t||(t=e?r:i[0]);let o=e?n:i[1];return[t,o]}function gH(e){var t,n;let r=lH(e),[i,a]=Kl(e.value,e.defaultValue||null,e.onChange),[o,s]=I.useState(()=>i||{start:null,end:null});i==null&&o.start&&o.end&&(o={start:null,end:null},s(o));let l=i||o,u=$=>{s($||{start:null,end:null}),$!=null&&$.start&&$.end?a($):a(null)},c=(l==null?void 0:l.start)||(l==null?void 0:l.end)||e.placeholderValue,[d,h]=hH(c,e.granularity),f=d==="hour"||d==="minute"||d==="second";var g;let p=(g=e.shouldCloseOnSelect)!==null&&g!==void 0?g:!0,[m,b]=I.useState(null),[v,x]=I.useState(null);l&&l.start&&l.end&&(m=l,"hour"in l.start&&(v=l));let C=($,R)=>{u({start:"timeZone"in R.start?R.start.set(Bn($.start)):Ia($.start,R.start),end:"timeZone"in R.end?R.end.set(Bn($.end)):Ia($.end,R.end)}),b(null),x(null),F.commitValidation()},E=$=>{let R=typeof p=="function"?p():p;f?R||$.start&&$.end&&(v!=null&&v.start)&&(v!=null&&v.end)?C($,{start:(v==null?void 0:v.start)||ac(e.placeholderValue),end:(v==null?void 0:v.end)||ac(e.placeholderValue)}):b($):$.start&&$.end?(u($),F.commitValidation()):b($),R&&r.setOpen(!1)},w=$=>{m!=null&&m.start&&(m!=null&&m.end)&&$.start&&$.end?C(m,$):x($)},B=(l==null||(t=l.start)===null||t===void 0?void 0:t.calendar.identifier)==="gregory"&&l.start.era==="BC"||(l==null||(n=l.end)===null||n===void 0?void 0:n.calendar.identifier)==="gregory"&&l.end.era==="BC",y=I.useMemo(()=>({granularity:d,timeZone:h,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:B}),[d,e.hourCycle,e.shouldForceLeadingZeros,h,e.hideTimeZone,B]),{minValue:S,maxValue:D,isDateUnavailable:A}=e,T=I.useMemo(()=>cH(l,S,D,A,y),[l,S,D,A,y]),F=JV({...e,value:i,name:I.useMemo(()=>[e.startName,e.endName],[e.startName,e.endName]),builtinValidation:T}),k=F.displayValidation.isInvalid,P=e.validationState||(k?"invalid":null);return{...F,value:l,setValue:u,dateRange:m,timeRange:v,granularity:d,hasTime:f,setDate($,R){E({...m,[$]:R})},setTime($,R){w({...v,[$]:R})},setDateTime($,R){u({...l,[$]:R})},setDateRange:E,setTimeRange:w,...r,setOpen($){!$&&!(l!=null&&l.start&&(l!=null&&l.end))&&(m!=null&&m.start)&&(m!=null&&m.end)&&f&&C(m,{start:(v==null?void 0:v.start)||ac(e.placeholderValue),end:(v==null?void 0:v.end)||ac(e.placeholderValue)}),r.setOpen($)},validationState:P,isInvalid:k,formatValue($,R){if(!l||!l.start||!l.end)return null;let O="timeZone"in l.start?l.start.timeZone:void 0,j=e.granularity||(l.start&&"minute"in l.start?"minute":"day"),V="timeZone"in l.end?l.end.timeZone:void 0,W=e.granularity||(l.end&&"minute"in l.end?"minute":"day"),U=Mg(R,{granularity:j,timeZone:O,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:l.start.calendar.identifier==="gregory"&&l.start.era==="BC"||l.end.calendar.identifier==="gregory"&&l.end.era==="BC"}),K=l.start.toDate(O||"UTC"),ee=l.end.toDate(V||"UTC"),z=new Xl($,U),H;if(O===V&&j===W&&l.start.compare(l.end)!==0){try{let X=z.formatRangeToParts(K,ee),te=-1;for(let ce=0;ce<X.length;ce++){let Q=X[ce];if(Q.source==="shared"&&Q.type==="literal")te=ce;else if(Q.source==="endRange")break}let ie="",le="";for(let ce=0;ce<X.length;ce++)ce<te?ie+=X[ce].value:ce>te&&(le+=X[ce].value);return{start:ie,end:le}}catch{}H=z}else{let X=Mg(R,{granularity:W,timeZone:V,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle});H=new Xl($,X)}return{start:z.format(K),end:H.format(ee)}}}}const jw=e=>{const t=I.useRef(null),{locale:n}=Mr(),{state:r,date:i}=e,{cellProps:a,buttonProps:o,isSelected:s,isOutsideVisibleRange:l,isDisabled:u,formattedDate:c,isInvalid:d}=YV({date:i},r,t),{focusProps:h}=RE(),f="highlightedRange"in r?r.highlightedRange?Gt(i,r.highlightedRange.start):null:s,g="highlightedRange"in r?r.highlightedRange?Gt(i,r.highlightedRange.end):null:s,p=kf(i,n),m=s&&(f||p===0||i.day===1),b=s&&(g||p===6||i.day===i.calendar.getDaysInMonth(i));return _.jsx("td",{...a,children:_.jsx("div",{...Gn(o,h),ref:t,className:`${Pe["cell-calendar"]} ${m?"1ru-rounded-l-full":""} ${b?"1ru-rounded-r-full":""} ${s?d?"1ru-bg-red-300":"1ru-bg-laba-blue-02":""} ${u?"1ru-disabled":""}`,children:l?_.jsx("div",{className:Pe["visible-cell-calendar"],children:c}):_.jsx("div",{className:`${Pe["active-cell-calendar"]} ${u&&!d?Pe.disabled:""} ${f||g?d?Pe.error:Pe.selected:""} ${s&&!u&&!(f??g)?d?"hover:1ru-bg-red-400":"hover:1ru-text-laba-blue-05":""} ${!s&&!u?"hover:1ru-bg-laba-blue-01":""}`,children:c})})})},Es=e=>{const t=I.useRef(null),{buttonProps:n}=WV(e,t),{focusProps:r}=RE();return _.jsx("button",{...Gn(n,r),ref:t,className:`1ru-px-2 1ru-py-1 1ru-rounded-full ${e.isDisabled?"1ru-text-gray-400":"1ru-text-laba-blue-10"} ${e.isDisabled?"":"hover:1ru-bg-laba-blue-01 1ru-cursor-pointer"} 1ru-outline-none`,children:e.children})},Ww=({prevIcon:e,nextIcon:t,state:n,setActiveTypeCalendar:r,onChangeMonth:i,type:a,hiddenHeader:o})=>{const s=new Date().getFullYear(),l=n.focusedDate.calendar.getMonthsInYear(n.focusedDate),u=_a({month:"short",timeZone:n.timeZone}),c=(h,f)=>{const g=n.focusedDate.set({month:h});f?(r("date"),n.setFocusedDate(g)):!f&&typeof i=="function"&&i(g)},d=h=>{const f=n.focusedDate.set({year:h});n.setFocusedDate(f)};return _.jsxs("div",{className:`1ru-w-[296px] ${Pe["container-calendar"]}`,children:[!o&&_.jsxs("div",{className:Pe["header-calendar"],children:[_.jsx(Es,{isDisabled:n!=null&&n.minValue?n.focusedDate.year<=n.minValue.year:!1,onPress:()=>d(n.focusedDate.year-1),children:typeof e=="function"||I.isValidElement(e)?I.isValidElement(e)?e:e():_.jsx(li,{className:"1ru-rotate-90"})}),_.jsx("div",{className:`${Pe["header-button-calendar"]} ${a.includes("year")?"":Pe.disabled}`,onClick:()=>{a.includes("year")&&r("year")},children:n.focusedDate.year}),_.jsx(Es,{isDisabled:n!=null&&n.maxValue?n.focusedDate.year>=n.maxValue.year:!1,onPress:()=>d(n.focusedDate.year+1),children:typeof t=="function"||I.isValidElement(t)?I.isValidElement(t)?t:t():_.jsx(li,{className:"-1ru-rotate-90"})})]}),_.jsx("div",{className:Pe["month-calendar"],children:[...Array(l).keys()].map(h=>{var x,C,E,w;const f=n.focusedDate.set({month:h+1}),g=u.format(f.toDate(n.timeZone)),p=((x=n.value)==null?void 0:x.year)||((E=(C=n.value)==null?void 0:C.start)==null?void 0:E.year)||s,m=n!=null&&n.minValue?f.month<((w=n==null?void 0:n.minValue)==null?void 0:w.month)&&f.year<=n.minValue.year:!1,b=n!=null&&n.maxValue?f.month>n.maxValue.month&&f.year>=n.maxValue.year:!1,v=m||b;return _.jsx("div",{onClick:()=>{v||c(f.month,a.includes("date"))},className:`${Pe["cell-month"]} ${n.focusedDate.month===f.month&&!v&&f.year===p?Pe.selected:""} ${n.focusedDate.month!==f.month&&!v?"hover:1ru-bg-laba-blue-01":""} ${v?"1ru-text-gray-400":"1ru-cursor-pointer"}`,children:g},h)})})]})},pH=e=>{const t=N3(e.state.visibleRange.start,e.locale),{gridProps:n,headerProps:r,weekDays:i}=xS({},e.state),{prevButtonProps:a,nextButtonProps:o,title:s}=yS(e,e.state),l=u=>{let c="";switch(u){case 0:c="Min";break;case 1:c="Sen";break;case 2:c="Sel";break;case 3:c="Rab";break;case 4:c="Kam";break;case 5:c="Jum";break;case 6:c="Sab";break}return c};return _.jsxs("div",{children:[!e.hiddenHeader&&_.jsxs("div",{className:Pe["header-calendar"],children:[_.jsx(Es,{...a,children:typeof(e==null?void 0:e.prevIcon)=="function"||I.isValidElement(e==null?void 0:e.prevIcon)?I.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():_.jsx(li,{className:"1ru-rotate-90"})}),_.jsx("div",{className:Pe["header-button-calendar"],onClick:()=>e.setActiveTypeCalendar("month"),children:s}),_.jsx(Es,{...o,children:typeof(e==null?void 0:e.nextIcon)=="function"||I.isValidElement(e==null?void 0:e.nextIcon)?I.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():_.jsx(li,{className:"-1ru-rotate-90"})})]}),_.jsxs("table",{...n,children:[_.jsx("thead",{...r,children:_.jsx("tr",{children:i.map((u,c)=>_.jsx("th",{className:Pe["days-calendar"],children:l(c)},c))})}),_.jsx("tbody",{children:[...new Array(t).keys()].map(u=>_.jsx("tr",{children:e.state.getDatesInWeek(u).map((c,d)=>c?_.jsx(jw,{state:e.state,date:c},d):_.jsx("td",{},d))},u))})]})]})},Hd=({minDate:e,maxDate:t,value:n,time:r,hiddenHeader:i,handlerChangeTime:a,timeLabel:o,type:s})=>{const l=e?new Date(e):null,u=t?new Date(t):null,c=l==null?void 0:l.getHours(),d=u==null?void 0:u.getHours(),h=l==null?void 0:l.getMinutes(),f=u==null?void 0:u.getMinutes(),[g,p]=I.useState(!0),m=(C,E,w)=>Array.from({length:(E-C)/w+1},(B,y)=>C+y*w),b=(C,E)=>{typeof a=="function"&&a({hour:C,minut:E,second:r==null?void 0:r.second})},v=()=>{const C=document.getElementById(`calendar-hour-${r==null?void 0:r.hour}-${s}`),E=document.getElementById(`calendar-minut-${r==null?void 0:r.minut}-${s}`),w=document.getElementById(`wrapper-calendar-hour-${s}`),B=document.getElementById(`wrapper-calendar-minut-${s}`);C&&w&&w.scrollTo({behavior:"instant",top:C.offsetTop-78}),E&&B&&B.scrollTo({behavior:"instant",top:E.offsetTop-78})},x=(C,E)=>{let w=!0;if(l&&n){const B=n.year===l.getFullYear(),y=n.month===l.getMonth()+1;n.day===l.getDate()&&y&&B?(E==="hour"&&C<(c??0)||E==="minut"&&((r==null?void 0:r.hour)??0)<=l.getHours()&&C<(h??0))&&(w=!1):n.toDate(Kn()).getTime()<l.getTime()&&(w=!1)}if(u&&n){const B=n.year===u.getFullYear(),y=n.month===u.getMonth()+1;n.day===u.getDate()&&y&&B?(E==="hour"&&C>(d??0)||E==="minut"&&((r==null?void 0:r.hour)??0)>=u.getHours()&&C>(f??0))&&(w=!1):n.toDate(Kn()).getTime()>u.getTime()&&(w=!1)}return w};return I.useEffect(()=>{g&&v(),r&&p(!1)},[JSON.stringify(n),JSON.stringify(r)]),_.jsxs("div",{className:Pe["custom-time-calendar"],children:[!i&&_.jsx("div",{className:Pe["header-time"],children:o||"Atur Waktu"}),_.jsxs("div",{className:Pe["type-time"],children:[_.jsx("div",{children:"Jam"}),_.jsx("div",{children:"Menit"})]}),_.jsxs("div",{className:"1ru-flex 1ru-justify-around",children:[_.jsx("div",{id:`wrapper-calendar-hour-${s}`,className:Pe["container-cell-time"],children:m(0,23,1).map(C=>_.jsx("div",{id:`calendar-hour-${C}-${s}`,className:`${Pe["cell-time"]} ${(r==null?void 0:r.hour)===C?x(C,"hour")?Pe.selected:Pe.error:""} ${x(C,"hour")&&(r==null?void 0:r.hour)!=C?Pe.valid:Pe.invalid}`,onClick:()=>{x(C,"hour")&&b(C,r==null?void 0:r.minut)},children:C<10?`0${C}`:C},C))}),_.jsx("div",{id:`wrapper-calendar-minut-${s}`,className:Pe["container-cell-time"],children:m(0,59,1).map(C=>_.jsx("div",{id:`calendar-minut-${C}-${s}`,className:`${Pe["cell-time"]} ${(r==null?void 0:r.minut)===C?x(C,"minut")?Pe.selected:Pe.error:""} ${x(C,"minut")&&(r==null?void 0:r.minut)!=C?Pe.valid:Pe.invalid}`,onClick:()=>{x(C,"minut")&&b(r==null?void 0:r.hour,C)},children:C<10?`0${C}`:C},C))})]})]})},Mf=e=>{var h,f,g,p,m,b,v,x,C;const t=e.typeTime??"SINGLE",n=iw({...e,locale:e.locale,createCalendar:_u}),{title:r}=yS(e,n),[i,a]=I.useState((e==null?void 0:e.activeType)??"date"),[o,s]=I.useState({start:void 0,end:void 0}),l=((f=(h=o.start)==null?void 0:h.hour)==null?void 0:f.toString())&&((p=(g=o==null?void 0:o.start)==null?void 0:g.minut)==null?void 0:p.toString())&&((v=e.value)==null?void 0:v.toDate(Kn()).setHours((m=o.start)==null?void 0:m.hour,(b=o.start)==null?void 0:b.minut))||e.minDate,u=e.maxDate,c=(E,w)=>{const B={...o,[w]:E};s(B),typeof(e==null?void 0:e.handlerChangeTime)=="function"&&e.handlerChangeTime(B)},d=E=>{n.setValue(E)};return ba(()=>{e!=null&&e.activeType&&a(e.activeType)},[e==null?void 0:e.activeType]),I.useEffect(()=>{var E,w;if((E=e.time)!=null&&E.start&&((w=e.time)!=null&&w.end)){const B=e.time.start,y=e.time.end;s({start:B,end:y})}},[JSON.stringify(e.time)]),_.jsxs("div",{className:"1ru-text-laba-base-sr",children:[i==="date"&&_.jsx(_.Fragment,{children:_.jsxs("div",{className:Pe["container-calendar"],children:[_.jsxs("div",{className:"1ru-flex 1ru-gap-2",children:[_.jsx(pH,{state:n,setActiveTypeCalendar:a,...e}),(e==null?void 0:e.isCustomTime)&&_.jsxs("div",{className:"1ru-flex",children:[_.jsx(Hd,{minDate:e.minDate,maxDate:e.maxDate,time:(x=e.time)==null?void 0:x.start,value:e.value,timeLabel:t==="RANGE"?"Awal":"Atur Waktu",type:"start",handlerChangeTime:E=>c(E,"start")}),t==="RANGE"&&_.jsx(Hd,{minDate:l,maxDate:u,time:(C=e.time)==null?void 0:C.end,value:e.value,timeLabel:"Akhir",type:"end",handlerChangeTime:E=>c(E,"end")})]})]}),((e==null?void 0:e.withConfirm)??(e==null?void 0:e.isCustomTime))&&_.jsxs("div",{className:`${Pe["footer-calendar"]}`,children:[typeof(e==null?void 0:e.buttonReset)=="function"?_.jsx("div",{onClick:()=>e.handlerReset(n),children:e.buttonReset()}):_.jsx(jn,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(n),children:"Reset"}),typeof(e==null?void 0:e.buttonSubmit)=="function"?_.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):_.jsx(jn,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})}),i==="month"&&_.jsx(Ww,{state:n,setActiveTypeCalendar:a,type:e.type,onChangeMonth:d,hiddenHeader:e.hiddenHeader}),i==="year"&&_.jsx(W2,{state:n,type:e.type,setActiveTypeCalendar:a,title:r,onChangeYear:d,hiddenHeader:e.hiddenHeader})]})},mH=e=>{var C,E,w,B,y,S,D,A,T,F,k,P;const t=I.useRef(null),{locale:n}=Mr(),r=sH({...e,locale:n,createCalendar:_u}),i=$=>{let R="";switch($){case 0:R="Min";break;case 1:R="Sen";break;case 2:R="Sel";break;case 3:R="Rab";break;case 4:R="Kam";break;case 5:R="Jum";break;case 6:R="Sab";break}return R},{calendarProps:a,prevButtonProps:o,nextButtonProps:s,title:l}=XV(e,r,t),{gridProps:u,headerProps:c,weekDays:d}=xS({},r),h=N3(r.visibleRange.start,n),[f,g]=I.useState("date"),[p,m]=I.useState({start:void 0,end:void 0}),b=((E=(C=p.start)==null?void 0:C.hour)==null?void 0:E.toString())&&((B=(w=p==null?void 0:p.start)==null?void 0:w.minut)==null?void 0:B.toString())&&((A=(y=e.value)==null?void 0:y.start)==null?void 0:A.toDate(Kn()).setHours((S=p.start)==null?void 0:S.hour,(D=p.start)==null?void 0:D.minut))||e.minDate,v=e.maxDate,x=($,R)=>{const O={...p,[R]:$};m(O),typeof(e==null?void 0:e.handlerChangeTimeRange)=="function"&&e.handlerChangeTimeRange(O)};return I.useEffect(()=>{var $,R;if(($=e.time)!=null&&$.start&&((R=e.time)!=null&&R.end)){const O=e.time.start,j=e.time.end;m({start:O,end:j})}},[JSON.stringify(e.time)]),_.jsxs("div",{className:"1ru-text-laba-base-sr",children:[f==="date"&&_.jsx(_.Fragment,{children:_.jsx("div",{...a,ref:t,children:_.jsxs("div",{className:Pe["container-calendar"],children:[_.jsxs("div",{className:"1ru-flex 1ru-gap-2",children:[_.jsxs("div",{children:[_.jsxs("div",{className:Pe["header-calendar"],children:[_.jsx(Es,{...o,children:typeof(e==null?void 0:e.prevIcon)=="function"||I.isValidElement(e==null?void 0:e.prevIcon)?I.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():_.jsx(li,{className:"1ru-rotate-90"})}),_.jsx("div",{className:Pe["header-button-calendar"],onClick:()=>g("month"),children:l}),_.jsx(Es,{...s,children:typeof(e==null?void 0:e.nextIcon)=="function"||I.isValidElement(e==null?void 0:e.nextIcon)?I.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():_.jsx(li,{className:"-1ru-rotate-90"})})]}),_.jsxs("table",{...u,cellPadding:"0",className:"flex-1",children:[_.jsx("thead",{...c,className:"text-gray-600",children:_.jsx("tr",{children:d.map(($,R)=>_.jsx("th",{className:Pe["days-calendar"],children:i(R)},R))})}),_.jsx("tbody",{children:[...new Array(h).keys()].map($=>_.jsx("tr",{children:r.getDatesInWeek($).map((R,O)=>R?_.jsx(jw,{state:r,date:R},O):_.jsx("td",{},O))},$))})]})]}),(e==null?void 0:e.isCustomTime)&&_.jsxs("div",{className:"1ru-flex",children:[_.jsx(Hd,{minDate:e.minDate,maxDate:e.maxDate,time:(T=e.time)==null?void 0:T.start,value:(F=e.value)==null?void 0:F.start,timeLabel:"Awal",type:"start",handlerChangeTime:$=>x($,"start")}),_.jsx(Hd,{minDate:b,maxDate:v,time:(k=e.time)==null?void 0:k.end,value:(P=e.value)==null?void 0:P.end,timeLabel:"Akhir",type:"end",handlerChangeTime:$=>x($,"end")})]})]}),e.withConfirm&&_.jsxs("div",{className:Pe["footer-calendar"],children:[typeof(e==null?void 0:e.buttonReset)=="function"?_.jsx("div",{onClick:()=>e.handlerReset(r),children:e.buttonReset()}):_.jsx(jn,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(r),children:"Reset"}),typeof(e==null?void 0:e.buttonSubmit)=="function"?_.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):_.jsx(jn,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})})}),f==="month"&&_.jsx(Ww,{state:r,setActiveTypeCalendar:g,type:["date","month","year"]}),f==="year"&&_.jsx(W2,{state:r,setActiveTypeCalendar:g,title:l,type:["date","month","year"]})]})},zw=e=>{const t=gH(e),n=I.useRef(null),{calendarProps:r}=oH(e,t,n);return _.jsx("div",{ref:n,children:_.jsx(mH,{handlerReset:e.handlerReset,handlerSubmit:e.handlerSubmit,withConfirm:e.withConfirm,prevIcon:e.prevIcon,nextIcon:e.nextIcon,buttonReset:e.buttonReset,buttonSubmit:e.buttonSubmit,isCustomTime:e.isCustomTime,time:e.time,minDate:e.minDate,maxDate:e.maxDate,handlerChangeTimeRange:e.handlerChangeTimeRange,...r})})},oc=e=>{let t;const n=new Date(e??new Date);return e&&(t=Cm(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},bH=e=>{const{minDate:t,maxDate:n,value:r,defaultValue:i,withConfirm:a=!1,isCustomTime:o=!1,className:s,classNameButton:l,buttonClick:u,buttonReset:c,buttonSubmit:d,prevIcon:h,nextIcon:f,onChange:g,id:p="date-picker",idPopover:m="date-picker-popover",floatingOptions:b={},offsetPopover:v=5,zIndexPopper:x=1,hiddenHeader:C}=e,E=_a(),{locale:w}=Mr(),B=oc(t),y=oc(n),S=I.useRef(null),[D,A]=I.useState(),[T,F]=I.useState(),k=j=>{var ee;const V=new Date;let W=j.toDate(Kn());W.setHours(V.getHours(),V.getMinutes(),V.getSeconds());const U=t?new Date(t):null,K=n?new Date(n):null;if(o){if(W=new Date(new Date(W).setHours((T==null?void 0:T.hour)??0,T==null?void 0:T.minut,T==null?void 0:T.second)),U&&(U==null?void 0:U.toDateString())===new Date(W).toDateString()&&(U==null?void 0:U.toTimeString())>=(W==null?void 0:W.toTimeString())){if(U&&(U.getHours()>W.getHours()||U.getHours()===W.getHours()&&U.getMinutes()>W.getMinutes()))return;W=new Date(U.setSeconds(U.getSeconds()+1))}if(K&&(K==null?void 0:K.toDateString())===new Date(W).toDateString()&&(K==null?void 0:K.toTimeString())<(W==null?void 0:W.toTimeString())){if(K&&(K.getHours()<W.getHours()||K.getHours()===W.getHours()&&K.getMinutes()<W.getMinutes()))return;W=new Date(K.setSeconds(K.getSeconds()-1))}}else U&&E.format(W)===E.format(U)&&U.getTime()>=W.getTime()?W=new Date(U.setSeconds(U.getSeconds()+1)):K&&E.format(W)===E.format(K)&&K.getTime()<=W.getTime()&&(W=new Date(K.setSeconds(K.getSeconds()-1)));typeof g=="function"&&(g(W),(ee=S.current)==null||ee.setShow(!1))},P=(j,V)=>{A(j),(V??(!a&&!o))&&k(j)},$=j=>{const{start:V}=j;F(V)},R=j=>{const V=new Date(r??new Date);F({hour:V.getHours(),minut:V.getMinutes(),second:V.getSeconds()}),A(oc(r))},O=()=>{D&&P(D,!0)};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:p,onClick:j=>{var V;(V=S.current)==null||V.handlerShow(j),R()},className:l,children:typeof u=="function"?u(r):r?new Date(r).toDateString():"Pilih Tanggal"}),_.jsx(pi,{zIndex:x,ref:S,offset:v,id:m,floatingOptions:{placement:"bottom-end",...b},children:_.jsx("div",{className:s??"",children:_.jsx(Fm,{locale:"id-ID",children:_.jsx(Mf,{minValue:B,maxValue:y,minDate:t,maxDate:n,time:{start:T},locale:w,value:D,typeTime:"SINGLE",buttonReset:c,buttonSubmit:d,prevIcon:h,nextIcon:f,createCalendar:_u,defaultValue:oc(r),onChange:P,handlerReset:()=>{var j;typeof g=="function"&&(g(i),(j=S.current)==null||j.setShow(!1))},handlerSubmit:O,handlerChangeTime:$,withConfirm:a,isCustomTime:o,type:["date","month","year"],hiddenHeader:C})})})})]})},Gh=e=>{let t;const n=new Date(e??new Date);return e&&(t=Cm(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},ry=e=>{const t=new Date((e==null?void 0:e.startDate)??new Date),n=new Date((e==null?void 0:e.endDate)??new Date),r=new Ot(t.getFullYear(),t.getMonth()+1,t.getDate()),i=new Ot(n.getFullYear(),n.getMonth()+1,n.getDate());return e?{start:r,end:i}:void 0},Gw=e=>{const{minDate:t,maxDate:n,defaultValue:r,withConfirm:i,prevIcon:a,nextIcon:o,buttonReset:s,buttonSubmit:l,typePicker:u="RANGE",onChange:c,value:d,onReset:h,isCustomTime:f}=e,{locale:g}=Mr(),p=Gh(t),m=Gh(n),[b,v]=I.useState(),[x,C]=I.useState({start:void 0,end:void 0}),E=D=>{typeof c=="function"&&c(D)},w=(D,A)=>{const T=D.start.toDate(Kn()),F=D.end.toDate(Kn());v(D),C({start:{hour:0,minut:0,second:0},end:{hour:23,minut:59,second:59}}),(A??!i)&&E({startDate:T,endDate:new Date(F.setHours(23,59,59))})},B=(D,A)=>{var T,F,k,P,$,R,O,j;if(b!=null&&b.start&&(b!=null&&b.end)&&(C(D),(F=(T=D.start)==null?void 0:T.hour)!=null&&F.toString()&&((P=(k=D.start)==null?void 0:k.minut)!=null&&P.toString())&&((R=($=D.end)==null?void 0:$.hour)!=null&&R.toString())&&((j=(O=D.end)==null?void 0:O.minut)!=null&&j.toString())&&(A??!i))){const V=b.start.toDate(Kn()),W=b.end.toDate(Kn()),U=new Date(V.setHours(D.start.hour,D.start.minut)),K=new Date(W.setHours(D.end.hour,D.end.minut,59));U.getTime()<K.getTime()&&E({startDate:U,endDate:K})}},y=D=>{if(typeof h=="function")h();else if(r&&D){const A=new Date(r.endDate??new Date),T=D.focusedDate.set({month:A.getMonth()+1,year:A.getFullYear()});D.setFocusedDate(T)}v(ry(r))},S=()=>{b&&(f?B(x,!0):w(b,!0))};return I.useEffect(()=>{if(d!=null&&d.endDate&&(d!=null&&d.startDate)){const D=new Date(d.startDate),A=new Date(d.endDate),T=D.getHours(),F=D.getMinutes(),k=A.getHours(),P=A.getMinutes(),$=Bn(Sv(D,Kn())),R=Bn(Sv(A,Kn()));v({start:$,end:R}),C({start:{hour:T,minut:F},end:{hour:k,minut:P}})}},[JSON.stringify(d)]),_.jsx("div",{className:"1ru-flex 1ru-flex-col",children:_.jsxs(Fm,{locale:"id-ID",children:[u==="RANGE"&&_.jsx(zw,{defaultValue:ry(r),value:b,minValue:p,maxValue:m,withConfirm:i,prevIcon:a,nextIcon:o,buttonReset:s,buttonSubmit:l,onChange:w,isCustomTime:f,handlerReset:y,handlerSubmit:S,time:x,minDate:t,maxDate:n,handlerChangeTimeRange:B}),u==="SINGLE"&&_.jsx(Mf,{defaultValue:Gh(r==null?void 0:r.endDate),value:b==null?void 0:b.end,minValue:p,maxValue:m,minDate:t,maxDate:n,withConfirm:i,prevIcon:a,nextIcon:o,buttonReset:s,buttonSubmit:l,locale:g,time:x,typeTime:"RANGE",handlerChangeTime:B,isCustomTime:f,createCalendar:_u,onChange:D=>w({start:D,end:D}),handlerReset:y,handlerSubmit:S,type:["date","month","year"]})]})})},vH=({value:e,prevIcon:t,nextIcon:n,buttonReset:r,buttonSubmit:i,className:a,classNameButton:o,buttonClick:s,buttonList:l,typePicker:u="RANGE",onChange:c,idPopover:d="filter-date-popover",id:h="filter-date",floatingOptions:f={},offsetPopover:g=5,zIndexPopper:p=0,defaultValueLabel:m,isCustomTime:b=!1,mountedExecuteChange:v=!0,formatingDate:x})=>{const C=[{key:"thisDay",value:"Hari ini"},{key:"thisWeek",value:"Minggu ini"},{key:"thisMonth",value:"Bulan ini"},{key:"thisYear",value:"Tahun ini"},{key:"yesterday",value:"Kemarin"},{key:"lastWeek",value:"Minggu lalu"},{key:"lastMonth",value:"Bulan lalu"},{key:"lastYear",value:"Tahun lalu"},{key:"custom",value:"Kustom"}],E=I.useRef(null),[w,B]=I.useState(),[y,S]=I.useState(),[D,A]=I.useState(),T=(z,H)=>{const X=new Date(z??new Date);return H==="start"?new Date(X.setHours(0,0,0)):new Date(X.setHours(23,59,59))},F=()=>{const z=new Date;return{startDate:z,endDate:z}},k=()=>{const z=new Date;z.setDate(z.getDate()-z.getDay());const H=new Date;return H.setDate(H.getDate()+(6-H.getDay())),{startDate:z,endDate:H}},P=()=>{const z=new Date,H=new Date(z.getFullYear(),z.getMonth(),1),X=new Date(z.getFullYear(),z.getMonth()+1,0);return{startDate:H,endDate:X}},$=()=>{const z=new Date(new Date().getFullYear(),0,1),H=new Date(new Date().getFullYear(),11,31);return{startDate:z,endDate:H}},R=()=>{const z=new Date(new Date().setDate(new Date().getDate()-1));return{startDate:z,endDate:z}},O=()=>{const z=new Date;z.setDate(z.getDate()-(7+z.getDay()));const H=new Date;return H.setDate(H.getDate()-(H.getDay()+1)),{startDate:z,endDate:H}},j=()=>{const z=new Date,H=new Date(z.getFullYear(),z.getMonth()-1,1),X=new Date(z.getFullYear(),z.getMonth(),0);return{startDate:H,endDate:X}},V=()=>{const z=new Date(new Date().getFullYear()-1,0,1),H=new Date(new Date().getFullYear()-1,11,31);return{startDate:z,endDate:H}},W=(z,H,X)=>{var te;if(A(z),typeof c=="function"){let ie=z;x==="string"&&z?ie={startDate:Jo(z.startDate,x),endDate:Jo(z.endDate,x)}:typeof x=="boolean"&&z&&(ie={startDate:Jo(z.startDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),endDate:Jo(z.endDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}),(te=E.current)==null||te.setShow(!1),c(ie,H??"",X)}},U=(z,H)=>{B(z);let X;if((z==null?void 0:z.key)!=="custom"){switch(S(z),z==null?void 0:z.key){case"thisDay":X=F();break;case"thisWeek":X=k();break;case"thisMonth":X=P();break;case"thisYear":X=$();break;case"yesterday":X=R();break;case"lastWeek":X=O();break;case"lastMonth":X=j();break;case"lastYear":X=V();break}X&&H&&W({startDate:T(X.startDate,"start"),endDate:T(X.endDate,"end")},z==null?void 0:z.value,z)}},K=(z,H)=>{const X=(l??C).find(te=>te.key===z);!z&&!X?(H&&W(),U(void 0,H),S(void 0)):typeof z=="object"?(H&&W({startDate:T(z.startDate,"start"),endDate:T(z.endDate,"end")},"Kustom",{key:"custom",value:"Kustom"}),U({key:"custom",value:"Kustom"},H),S({key:"custom",value:"Kustom"})):(U(X,H),S(X))},ee=()=>{var z;if(e){A(e);const H=(z=l??C)==null?void 0:z.find(X=>X.key===e.label||X.value===e.label);Object.keys(H||{}).length>0&&B(H)}else B(void 0),S(void 0)};return I.useEffect(()=>{ee()},[JSON.stringify(e)]),I.useEffect(()=>{K(m??e,v)},[]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{onClick:z=>{var H;(H=E.current)==null||H.handlerShow(z),ee()},className:o,id:h,children:[I.isValidElement(s)&&s,typeof s=="function"?s(D,y):"Pilih Filter"]}),_.jsx(pi,{zIndex:p,ref:E,offset:g,id:d,floatingOptions:{placement:"bottom-end",...f},children:_.jsxs("div",{className:`${Pe["container-filter-date"]} ${a}`,children:[_.jsxs("div",{children:[(l??C).map((z,H)=>_.jsx("div",{className:`${Pe["button-filter-date"]} hover:1ru-bg-laba-blue-01 ${(w==null?void 0:w.key)===z.key?"1ru-text-laba-blue-10":""}`,onClick:()=>U(z,!0),children:z.value},H)),(w==null?void 0:w.key)!=="custom"&&_.jsx(_.Fragment,{children:typeof r=="function"?_.jsx("div",{className:Pe["button-filter-date-custome"],onClick:()=>K(m,!0),children:r()}):_.jsx(jn,{className:Pe["button-reset-filter-date"],variants:"nude-laba-blue-10",size:"small",onClick:()=>K(m,!0),children:"Reset"})})]}),(w==null?void 0:w.key)==="custom"&&_.jsx("div",{children:_.jsx(Gw,{defaultValue:D,value:D,prevIcon:t,nextIcon:n,buttonReset:r,buttonSubmit:i,isCustomTime:b,onChange:z=>{W(z,"Kustom",{key:"custom",value:"Kustom"}),S({key:"custom",value:"Kustom"})},onReset:()=>{K(m,!0)},typePicker:u,withConfirm:!0})})]})})]})},yH="_active_1fa6e_506",xH="_disabled_1fa6e_509",Jt={"title-switch-payhere":"_title-switch-payhere_1fa6e_73","description-switch-payhere":"_description-switch-payhere_1fa6e_109","title-switch-laba":"_title-switch-laba_1fa6e_247","description-switch-laba":"_description-switch-laba_1fa6e_271","title-switch-bill":"_title-switch-bill_1fa6e_385","description-switch-bill":"_description-switch-bill_1fa6e_421","switch-l":"_switch-l_1fa6e_493","switch-payhere":"_switch-payhere_1fa6e_493",active:yH,disabled:xH,"disabled-nonactive":"_disabled-nonactive_1fa6e_512","thumb-switch":"_thumb-switch_1fa6e_515","switch-laba":"_switch-laba_1fa6e_532","switch-bill":"_switch-bill_1fa6e_571","switch-r":"_switch-r_1fa6e_611","switch-s":"_switch-s_1fa6e_729"},sc={size:{large:Jt["switch-l"],regular:Jt["switch-r"],small:Jt["switch-s"]},kind:{laba:Jt["switch-laba"],payhere:Jt["switch-payhere"],bill:Jt["switch-bill"]},text:{title:{laba:Jt["title-switch-laba"],payhere:Jt["title-switch-payhere"],bill:Jt["title-switch-bill"]},desc:{laba:Jt["description-switch-laba"],payhere:Jt["description-switch-payhere"],bill:Jt["description-switch-bill"]}}},CH=({value:e,disabled:t,title:n="",description:r="",size:i="regular",kind:a="payhere",id:o,className:s,classNameTitle:l,classNameDesc:u,onChange:c})=>{const d=()=>{!t&&typeof c=="function"&&c(!e)};return _.jsxs("div",{className:`1ru-flex 1ru-gap-2 ${s??""}`,onClick:h=>h.stopPropagation(),children:[_.jsxs("label",{children:[_.jsx("input",{id:o??"1ru-switch",type:"checkbox",checked:e,onChange:d,className:"1ru-hidden"}),_.jsx("span",{className:`${sc.size[i]} ${sc.kind[a]} ${e?Jt.active:""} ${t?Jt.disabled:""} ${!e&&t?Jt["disabled-nonactive"]:""}`,children:_.jsx("span",{className:`${Jt["thumb-switch"]} ${e?Jt.active:""} ${t?Jt.disabled:""} ${!e&&t?Jt["disabled-nonactive"]:""}`})})]}),(n||r)&&_.jsxs("div",{children:[n&&_.jsx("div",{className:`${sc.text.title[a]} ${l}`,children:n}),r&&_.jsx("div",{className:`${sc.text.desc[a]} ${u}`,children:r})]})]})},EH="_loading_b0du1_482",Me={"button-l":"_button-l_b0du1_67","button-m":"_button-m_b0du1_67","button-s":"_button-s_b0du1_115","button-xs":"_button-xs_b0du1_115","button-large":"_button-large_b0du1_241","button-reguler":"_button-reguler_b0du1_241","button-small":"_button-small_b0du1_259","button-extra-small":"_button-extra-small_b0du1_259","button-bill-l":"_button-bill-l_b0du1_379","button-bill-m":"_button-bill-m_b0du1_379","button-bill-s":"_button-bill-s_b0du1_427","button-bill-xs":"_button-bill-xs_b0du1_427","button-bill-xxs":"_button-bill-xxs_b0du1_427",loading:EH,"nude-laba-red-05":"_nude-laba-red-05_b0du1_497","nude-laba-red-10":"_nude-laba-red-10_b0du1_497","nude-gray-500":"_nude-gray-500_b0du1_497","nude-green-700":"_nude-green-700_b0du1_497","nude-red-700":"_nude-red-700_b0du1_497","nude-laba-blue-10":"_nude-laba-blue-10_b0du1_497","ghost-laba-green-10":"_ghost-laba-green-10_b0du1_497","ghost-blue-gray-100-bg_white":"_ghost-blue-gray-100-bg_white_b0du1_497","ghost-green-700":"_ghost-green-700_b0du1_497","ghost-red-700":"_ghost-red-700_b0du1_497","ghost-laba-blue-10":"_ghost-laba-blue-10_b0du1_497","filled-laba-white_laba-red-05":"_filled-laba-white_laba-red-05_b0du1_497","filled-laba-white_laba-blue-10":"_filled-laba-white_laba-blue-10_b0du1_497","primary-green-700-dsb_laba-grey-06":"_primary-green-700-dsb_laba-grey-06_b0du1_497","primary-red-700-dsb_laba-grey-06":"_primary-red-700-dsb_laba-grey-06_b0du1_497","primary-laba-blue-10":"_primary-laba-blue-10_b0du1_497","primary-bill-red-700":"_primary-bill-red-700_b0du1_497","tertiary-bill-secondary-800":"_tertiary-bill-secondary-800_b0du1_497","secondary-bill-secondary-800":"_secondary-bill-secondary-800_b0du1_497","primary-bill-primary-600":"_primary-bill-primary-600_b0du1_497","tertiary-gray-500":"_tertiary-gray-500_b0du1_497","tertiary-red-600":"_tertiary-red-600_b0du1_497","tertiary-red-300":"_tertiary-red-300_b0du1_497","tertiary-blue-700":"_tertiary-blue-700_b0du1_497","secondary-green-600":"_secondary-green-600_b0du1_497","secondary-red-700":"_secondary-red-700_b0du1_497","secondary-red-600":"_secondary-red-600_b0du1_497","secondary-blue-700":"_secondary-blue-700_b0du1_497","primary-red-700":"_primary-red-700_b0du1_497","primary-blue-700":"_primary-blue-700_b0du1_497","icon-loading":"_icon-loading_b0du1_595"},Uh={size:{large:Me["button-large"],reguler:Me["button-reguler"],small:Me["button-small"],"extra-small":Me["button-extra-small"],l:Me["button-l"],m:Me["button-m"],s:Me["button-s"],xs:Me["button-xs"],"bill-l":Me["button-bill-l"],"bill-m":Me["button-bill-m"],"bill-s":Me["button-bill-s"],"bill-xs":Me["button-bill-xs"],"bill-xxs":Me["button-bill-xxs"]},loadingSize:{large:"1ru-size-6",reguler:"1ru-size-5",small:"1ru-size-5","extra-small":"1ru-size-5",l:"1ru-size-6",m:"1ru-size-5",s:"1ru-size-5",xs:"1ru-size-5","bill-l":"1ru-size-6","bill-m":"1ru-size-5","bill-s":"1ru-size-5","bill-xs":"1ru-size-5","bill-xxs":"1ru-size-5"},variants:{"primary-laba-blue-10":Me["primary-laba-blue-10"],"primary-red-700-dsb_laba-grey-06":Me["primary-red-700-dsb_laba-grey-06"],"primary-green-700-dsb_laba-grey-06":Me["primary-green-700-dsb_laba-grey-06"],"filled-laba-white_laba-blue-10":Me["filled-laba-white_laba-blue-10"],"filled-laba-white_laba-red-05":Me["filled-laba-white_laba-red-05"],"ghost-laba-blue-10":Me["ghost-laba-blue-10"],"ghost-red-700":Me["ghost-red-700"],"ghost-green-700":Me["ghost-green-700"],"ghost-laba-green-10":Me["ghost-laba-green-10"],"nude-laba-blue-10":Me["nude-laba-blue-10"],"nude-red-700":Me["nude-red-700"],"nude-green-700":Me["nude-green-700"],"nude-gray-500":Me["nude-gray-500"],"primary-blue-700":Me["primary-blue-700"],"secondary-blue-700":Me["secondary-blue-700"],"tertiary-blue-700":Me["tertiary-blue-700"],"ghost-blue-gray-100-bg_white":Me["ghost-blue-gray-100-bg_white"],"secondary-red-600":Me["secondary-red-600"],"tertiary-red-300":Me["tertiary-red-300"],"tertiary-gray-500":Me["tertiary-gray-500"],"tertiary-red-600":Me["tertiary-red-600"],"secondary-green-600":Me["secondary-green-600"],"nude-laba-red-10":Me["nude-laba-red-10"],"nude-laba-red-05":Me["nude-laba-red-05"],"primary-red-700":Me["primary-red-700"],"secondary-red-700":Me["secondary-red-700"],"primary-bill-primary-600":Me["primary-bill-primary-600"],"secondary-bill-secondary-800":Me["secondary-bill-secondary-800"],"tertiary-bill-secondary-800":Me["tertiary-bill-secondary-800"],"primary-bill-red-700":Me["primary-bill-red-700"]}},SH=({className:e=""})=>_.jsx("svg",{className:`${Me["icon-loading"]} ${e??""}`,xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:_.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 \r
106
+ `]))),iM=function(t,n){var r=t.isFocused,i=t.size,a=t.theme,o=a.colors,s=a.spacing.baseUnit;return Be({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:s*2})},Eh=function(t){var n=t.delay,r=t.offset;return Te("span",{css:dm({animation:"".concat(rM," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaWRkZW49XCJ0cnVlXCJcbiAgICBmb2N1c2FibGU9XCJmYWxzZVwiXG4gICAgY3NzPXt7XG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIGZpbGw6ICdjdXJyZW50Q29sb3InLFxuICAgICAgbGluZUhlaWdodDogMSxcbiAgICAgIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBzdHJva2VXaWR0aDogMCxcbiAgICB9fVxuICAgIHsuLi5wcm9wc31cbiAgLz5cbik7XG5cbmV4cG9ydCB0eXBlIENyb3NzSWNvblByb3BzID0gSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZT86IG51bWJlciB9O1xuZXhwb3J0IGNvbnN0IENyb3NzSWNvbiA9IChwcm9wczogQ3Jvc3NJY29uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTE0LjM0OCAxNC44NDljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDBsLTIuNjUxLTMuMDMwLTIuNjUxIDMuMDI5Yy0wLjQ2OSAwLjQ2OS0xLjIyOSAwLjQ2OS0xLjY5NyAwLTAuNDY5LTAuNDY5LTAuNDY5LTEuMjI5IDAtMS42OTdsMi43NTgtMy4xNS0yLjc1OS0zLjE1MmMtMC40NjktMC40NjktMC40NjktMS4yMjggMC0xLjY5N3MxLjIyOC0wLjQ2OSAxLjY5NyAwbDIuNjUyIDMuMDMxIDIuNjUxLTMuMDMxYzAuNDY5LTAuNDY5IDEuMjI4LTAuNDY5IDEuNjk3IDBzMC40NjkgMS4yMjkgMCAxLjY5N2wtMi43NTggMy4xNTIgMi43NTggMy4xNWMwLjQ2OSAwLjQ2OSAwLjQ2OSAxLjIyOSAwIDEuNjk4elwiIC8+XG4gIDwvU3ZnPlxuKTtcbmV4cG9ydCB0eXBlIERvd25DaGV2cm9uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgRG93bkNoZXZyb24gPSAocHJvcHM6IERvd25DaGV2cm9uUHJvcHMpID0+IChcbiAgPFN2ZyBzaXplPXsyMH0gey4uLnByb3BzfT5cbiAgICA8cGF0aCBkPVwiTTQuNTE2IDcuNTQ4YzAuNDM2LTAuNDQ2IDEuMDQzLTAuNDgxIDEuNTc2IDBsMy45MDggMy43NDcgMy45MDgtMy43NDdjMC41MzMtMC40ODEgMS4xNDEtMC40NDYgMS41NzQgMCAwLjQzNiAwLjQ0NSAwLjQwOCAxLjE5NyAwIDEuNjE1LTAuNDA2IDAuNDE4LTQuNjk1IDQuNTAyLTQuNjk1IDQuNTAyLTAuMjE3IDAuMjIzLTAuNTAyIDAuMzM1LTAuNzg3IDAuMzM1cy0wLjU3LTAuMTEyLTAuNzg5LTAuMzM1YzAgMC00LjI4Ny00LjA4NC00LjY5NS00LjUwMnMtMC40MzYtMS4xNyAwLTEuNjE1elwiIC8+XG4gIDwvU3ZnPlxuKTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEJ1dHRvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xufVxuXG5jb25zdCBiYXNlQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTpcbiAgICB8IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbiAgICB8IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JDb250YWluZXInLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICAgICc6aG92ZXInOiB7XG4gICAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsODAgOiBjb2xvcnMubmV1dHJhbDQwLFxuICAgICAgICB9LFxuICAgICAgfSksXG59KTtcblxuZXhwb3J0IGNvbnN0IGRyb3Bkb3duSW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBEcm9wZG93bkluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IERyb3Bkb3duSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2Ryb3Bkb3duSW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdkcm9wZG93bi1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPERvd25DaGV2cm9uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBDbGVhckluZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFRoZSBjaGlsZHJlbiB0byBiZSByZW5kZXJlZCBpbnNpZGUgdGhlIGluZGljYXRvci4gKi9cbiAgY2hpbGRyZW4/OiBSZWFjdE5vZGU7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGNvbnN0IGNsZWFySW5kaWNhdG9yQ1NTID0gYmFzZUNTUztcbmV4cG9ydCBjb25zdCBDbGVhckluZGljYXRvciA9IDxcbiAgT3B0aW9uLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPlxuPihcbiAgcHJvcHM6IENsZWFySW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGNoaWxkcmVuLCBpbm5lclByb3BzIH0gPSBwcm9wcztcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICB7Li4uZ2V0U3R5bGVQcm9wcyhwcm9wcywgJ2NsZWFySW5kaWNhdG9yJywge1xuICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICdjbGVhci1pbmRpY2F0b3InOiB0cnVlLFxuICAgICAgfSl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICB7Y2hpbGRyZW4gfHwgPENyb3NzSWNvbiAvPn1cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuLy8gU2VwYXJhdG9yXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuZXhwb3J0IGludGVyZmFjZSBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaW5uZXJQcm9wcz86IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3BhbiddO1xufVxuXG5leHBvcnQgY29uc3QgaW5kaWNhdG9yU2VwYXJhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNEaXNhYmxlZCxcbiAgICB0aGVtZToge1xuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgICAgY29sb3JzLFxuICAgIH0sXG4gIH06IEluZGljYXRvclNlcGFyYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+LFxuICB1bnN0eWxlZDogYm9vbGVhblxuKTogQ1NTT2JqZWN0V2l0aExhYmVsID0+ICh7XG4gIGxhYmVsOiAnaW5kaWNhdG9yU2VwYXJhdG9yJyxcbiAgYWxpZ25TZWxmOiAnc3RyZXRjaCcsXG4gIHdpZHRoOiAxLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGJhY2tncm91bmRDb2xvcjogaXNEaXNhYmxlZCA/IGNvbG9ycy5uZXV0cmFsMTAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBtYXJnaW5Cb3R0b206IGJhc2VVbml0ICogMixcbiAgICAgICAgbWFyZ2luVG9wOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgSW5kaWNhdG9yU2VwYXJhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD5cbikgPT4ge1xuICBjb25zdCB7IGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxzcGFuXG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnaW5kaWNhdG9yU2VwYXJhdG9yJywge1xuICAgICAgICAnaW5kaWNhdG9yLXNlcGFyYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAvPlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBMb2FkaW5nXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgbG9hZGluZ0RvdEFuaW1hdGlvbnMgPSBrZXlmcmFtZXNgXG4gIDAlLCA4MCUsIDEwMCUgeyBvcGFjaXR5OiAwOyB9XG4gIDQwJSB7IG9wYWNpdHk6IDE7IH1cbmA7XG5cbmV4cG9ydCBjb25zdCBsb2FkaW5nSW5kaWNhdG9yQ1NTID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICB7XG4gICAgaXNGb2N1c2VkLFxuICAgIHNpemUsXG4gICAgdGhlbWU6IHtcbiAgICAgIGNvbG9ycyxcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICB9LFxuICB9OiBMb2FkaW5nSW5kaWNhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdsb2FkaW5nSW5kaWNhdG9yJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICB0cmFuc2l0aW9uOiAnY29sb3IgMTUwbXMnLFxuICBhbGlnblNlbGY6ICdjZW50ZXInLFxuICBmb250U2l6ZTogc2l6ZSxcbiAgbGluZUhlaWdodDogMSxcbiAgbWFyZ2luUmlnaHQ6IHNpemUsXG4gIHRleHRBbGlnbjogJ2NlbnRlcicsXG4gIHZlcnRpY2FsQWxpZ246ICdtaWRkbGUnLFxuICAuLi4odW5zdHlsZWRcbiAgICA/IHt9XG4gICAgOiB7XG4gICAgICAgIGNvbG9yOiBpc0ZvY3VzZWQgPyBjb2xvcnMubmV1dHJhbDYwIDogY29sb3JzLm5ldXRyYWwyMCxcbiAgICAgICAgcGFkZGluZzogYmFzZVVuaXQgKiAyLFxuICAgICAgfSksXG59KTtcblxuaW50ZXJmYWNlIExvYWRpbmdEb3RQcm9wcyB7XG4gIGRlbGF5OiBudW1iZXI7XG4gIG9mZnNldDogYm9vbGVhbjtcbn1cbmNvbnN0IExvYWRpbmdEb3QgPSAoeyBkZWxheSwgb2Zmc2V0IH06IExvYWRpbmdEb3RQcm9wcykgPT4gKFxuICA8c3BhblxuICAgIGNzcz17e1xuICAgICAgYW5pbWF0aW9uOiBgJHtsb2FkaW5nRG90QW5pbWF0aW9uc30gMXMgZWFzZS1pbi1vdXQgJHtkZWxheX1tcyBpbmZpbml0ZTtgLFxuICAgICAgYmFja2dyb3VuZENvbG9yOiAnY3VycmVudENvbG9yJyxcbiAgICAgIGJvcmRlclJhZGl1czogJzFlbScsXG4gICAgICBkaXNwbGF5OiAnaW5saW5lLWJsb2NrJyxcbiAgICAgIG1hcmdpbkxlZnQ6IG9mZnNldCA/ICcxZW0nIDogdW5kZWZpbmVkLFxuICAgICAgaGVpZ2h0OiAnMWVtJyxcbiAgICAgIHZlcnRpY2FsQWxpZ246ICd0b3AnLFxuICAgICAgd2lkdGg6ICcxZW0nLFxuICAgIH19XG4gIC8+XG4pO1xuXG5leHBvcnQgaW50ZXJmYWNlIExvYWRpbmdJbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBQcm9wcyB0aGF0IHdpbGwgYmUgcGFzc2VkIG9uIHRvIHRoZSBjaGlsZHJlbi4gKi9cbiAgaW5uZXJQcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */")})},aM=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,a=i===void 0?4:i,o=zi(t,ZN);return Te("div",$e({},Lt(Be(Be({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Te(Eh,{delay:0,offset:r}),Te(Eh,{delay:160,offset:!0}),Te(Eh,{delay:320,offset:!r}))},oM=function(t,n){var r=t.isDisabled,i=t.isFocused,a=t.theme,o=a.colors,s=a.borderRadius,l=a.spacing;return Be({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},sM=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,a=t.innerRef,o=t.innerProps,s=t.menuIsOpen;return Te("div",$e({ref:a},Lt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":s}),o,{"aria-disabled":r||void 0}),n)},lM=sM,uM=["data"],cM=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},dM=function(t){var n=t.children,r=t.cx,i=t.getStyles,a=t.getClassNames,o=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Te("div",$e({},Lt(t,"group",{group:!0}),l),Te(o,$e({},s,{selectProps:d,theme:c,getStyles:i,getClassNames:a,cx:r}),u),Te("div",null,n))},fM=function(t,n){var r=t.theme,i=r.colors,a=r.spacing;return Be({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},hM=function(t){var n=u3(t);n.data;var r=zi(n,uM);return Te("div",$e({},Lt(t,"groupHeading",{"group-heading":!0}),r))},gM=dM,pM=["innerRef","isDisabled","isHidden","inputClassName"],mM=function(t,n){var r=t.isDisabled,i=t.value,a=t.theme,o=a.spacing,s=a.colors;return Be(Be({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},bM),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},v3={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},bM={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Be({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},v3)},vM=function(t){return Be({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},v3)},yM=function(t){var n=t.cx,r=t.value,i=u3(t),a=i.innerRef,o=i.isDisabled,s=i.isHidden,l=i.inputClassName,u=zi(i,pM);return Te("div",$e({},Lt(t,"input",{"input-container":!0}),{"data-value":r||""}),Te("input",$e({className:n({input:!0},l),ref:a,style:vM(s),disabled:o},u)))},xM=yM,CM=function(t,n){var r=t.theme,i=r.spacing,a=r.borderRadius,o=r.colors;return Be({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:i.baseUnit/2})},EM=function(t,n){var r=t.theme,i=r.borderRadius,a=r.colors,o=t.cropWithEllipsis;return Be({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},SM=function(t,n){var r=t.theme,i=r.spacing,a=r.borderRadius,o=r.colors,s=t.isFocused;return Be({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:s?o.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},y3=function(t){var n=t.children,r=t.innerProps;return Te("div",r,n)},wM=y3,IM=y3;function _M(e){var t=e.children,n=e.innerProps;return Te("div",$e({role:"button"},n),t||Te(fm,{size:14}))}var DM=function(t){var n=t.children,r=t.components,i=t.data,a=t.innerProps,o=t.isDisabled,s=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Te(u,{data:i,innerProps:Be(Be({},Lt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:l},Te(c,{data:i,innerProps:Be({},Lt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Te(d,{data:i,innerProps:Be(Be({},Lt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},AM=DM,TM=function(t,n){var r=t.isDisabled,i=t.isFocused,a=t.isSelected,o=t.theme,s=o.spacing,l=o.colors;return Be({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:a?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?l.primary:l.primary50}})},RM=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,a=t.isSelected,o=t.innerRef,s=t.innerProps;return Te("div",$e({},Lt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":a}),{ref:o,"aria-disabled":r},s),n)},BM=RM,$M=function(t,n){var r=t.theme,i=r.spacing,a=r.colors;return Be({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},kM=function(t){var n=t.children,r=t.innerProps;return Te("div",$e({},Lt(t,"placeholder",{placeholder:!0}),r),n)},PM=kM,FM=function(t,n){var r=t.isDisabled,i=t.theme,a=i.spacing,o=i.colors;return Be({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},NM=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Te("div",$e({},Lt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},MM=NM,x3={ClearIndicator:eM,Control:lM,DropdownIndicator:qN,DownChevron:m3,CrossIcon:fm,Group:gM,GroupHeading:hM,IndicatorsContainer:UN,IndicatorSeparator:nM,Input:xM,LoadingIndicator:aM,Menu:$N,MenuList:PN,MenuPortal:VN,LoadingMessage:LN,NoOptionsMessage:MN,MultiValue:AM,MultiValueContainer:wM,MultiValueLabel:IM,MultiValueRemove:_M,Option:BM,Placeholder:PM,SelectContainer:jN,SingleValue:MM,ValueContainer:zN},LM=function(t){return Be(Be({},x3),t.components)},ov=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function OM(e,t){return!!(e===t||ov(e)&&ov(t))}function VM(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!OM(e[n],t[n]))return!1;return!0}function HM(e,t){t===void 0&&(t=VM);var n=null;function r(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var o=e.apply(this,i);return n={lastResult:o,lastArgs:i,lastThis:this},o}return r.clear=function(){n=null},r}function jM(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var WM=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:jM},zM=function(t){return Te("span",$e({css:WM},t))},sv=zM,GM={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,a=t.context,o=t.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,a=t.labels,o=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,a=t.label,o=a===void 0?"":a,s=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,m){return p&&p.length?"".concat(p.indexOf(m)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(o," focused, ").concat(d(s,r),".");if(n==="menu"&&c){var h=l?" disabled":"",f="".concat(u?" selected":"").concat(h);return"".concat(o).concat(f,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},UM=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.focusableOptions,o=t.isFocused,s=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,h=l.getOptionLabel,f=l.inputValue,g=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,b=l.menuIsOpen,v=l.options,x=l.screenReaderStatus,C=l.tabSelectsValue,E=l.isLoading,w=l["aria-label"],B=l["aria-live"],y=I.useMemo(function(){return Be(Be({},GM),d||{})},[d]),S=I.useMemo(function(){var P="";if(n&&y.onChange){var $=n.option,R=n.options,O=n.removedValue,j=n.removedValues,V=n.value,W=function(te){return Array.isArray(te)?null:te},U=O||$||W(V),K=U?h(U):"",ee=R||j||void 0,z=ee?ee.map(h):[],H=Be({isDisabled:U&&p(U,s),label:K,labels:z},n);P=y.onChange(H)}return P},[n,y,p,s,h]),D=I.useMemo(function(){var P="",$=r||i,R=!!(r&&s&&s.includes(r));if($&&y.onFocus){var O={focused:$,label:h($),isDisabled:p($,s),isSelected:R,options:a,context:$===r?"menu":"value",selectValue:s,isAppleDevice:c};P=y.onFocus(O)}return P},[r,i,h,p,y,a,s,c]),A=I.useMemo(function(){var P="";if(b&&v.length&&!E&&y.onFilter){var $=x({count:a.length});P=y.onFilter({inputValue:f,resultsMessage:$})}return P},[a,f,b,y,v,x,E]),T=(n==null?void 0:n.action)==="initial-input-focus",F=I.useMemo(function(){var P="";if(y.guidance){var $=i?"value":b?"menu":"input";P=y.guidance({"aria-label":w,context:$,isDisabled:r&&p(r,s),isMulti:g,isSearchable:m,tabSelectsValue:C,isInitialFocus:T})}return P},[w,r,i,g,p,m,b,y,s,C,T]),k=Te(I.Fragment,null,Te("span",{id:"aria-selection"},S),Te("span",{id:"aria-focused"},D),Te("span",{id:"aria-results"},A),Te("span",{id:"aria-guidance"},F));return Te(I.Fragment,null,Te(sv,{id:u},T&&k),Te(sv,{"aria-live":B,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!T&&k))},XM=UM,gg=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],ZM=new RegExp("["+gg.map(function(e){return e.letters}).join("")+"]","g"),C3={};for(var Sh=0;Sh<gg.length;Sh++)for(var wh=gg[Sh],Ih=0;Ih<wh.letters.length;Ih++)C3[wh.letters[Ih]]=wh.base;var E3=function(t){return t.replace(ZM,function(n){return C3[n]})},YM=HM(E3),lv=function(t){return t.replace(/^\s+|\s+$/g,"")},KM=function(t){return"".concat(t.label," ").concat(t.value)},JM=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Be({ignoreCase:!0,ignoreAccents:!0,stringify:KM,trim:!0,matchFrom:"any"},t),a=i.ignoreCase,o=i.ignoreAccents,s=i.stringify,l=i.trim,u=i.matchFrom,c=l?lv(r):r,d=l?lv(s(n)):s(n);return a&&(c=c.toLowerCase(),d=d.toLowerCase()),o&&(c=YM(c),d=E3(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},qM=["innerRef"];function QM(e){var t=e.innerRef,n=zi(e,qM),r=wN(n,"onExited","in","enter","exit","appear");return Te("input",$e({ref:t},r,{css:dm({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVtb3ZlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIER1bW15SW5wdXQoe1xuICBpbm5lclJlZixcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snaW5wdXQnXSAmIHtcbiAgcmVhZG9ubHkgaW5uZXJSZWY6IFJlZjxIVE1MSW5wdXRFbGVtZW50Pjtcbn0pIHtcbiAgLy8gUmVtb3ZlIGFuaW1hdGlvbiBwcm9wcyBub3QgbWVhbnQgZm9yIEhUTUwgZWxlbWVudHNcbiAgY29uc3QgZmlsdGVyZWRQcm9wcyA9IHJlbW92ZVByb3BzKFxuICAgIHByb3BzLFxuICAgICdvbkV4aXRlZCcsXG4gICAgJ2luJyxcbiAgICAnZW50ZXInLFxuICAgICdleGl0JyxcbiAgICAnYXBwZWFyJ1xuICApO1xuXG4gIHJldHVybiAoXG4gICAgPGlucHV0XG4gICAgICByZWY9e2lubmVyUmVmfVxuICAgICAgey4uLmZpbHRlcmVkUHJvcHN9XG4gICAgICBjc3M9e3tcbiAgICAgICAgbGFiZWw6ICdkdW1teUlucHV0JyxcbiAgICAgICAgLy8gZ2V0IHJpZCBvZiBhbnkgZGVmYXVsdCBzdHlsZXNcbiAgICAgICAgYmFja2dyb3VuZDogMCxcbiAgICAgICAgYm9yZGVyOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHRoaXMgaGlkZXMgdGhlIGZsYXNoaW5nIGN1cnNvclxuICAgICAgICBjYXJldENvbG9yOiAndHJhbnNwYXJlbnQnLFxuICAgICAgICBmb250U2l6ZTogJ2luaGVyaXQnLFxuICAgICAgICBncmlkQXJlYTogJzEgLyAxIC8gMiAvIDMnLFxuICAgICAgICBvdXRsaW5lOiAwLFxuICAgICAgICBwYWRkaW5nOiAwLFxuICAgICAgICAvLyBpbXBvcnRhbnQhIHdpdGhvdXQgYHdpZHRoYCBicm93c2VycyB3b24ndCBhbGxvdyBmb2N1c1xuICAgICAgICB3aWR0aDogMSxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIGRlc2t0b3BcbiAgICAgICAgY29sb3I6ICd0cmFuc3BhcmVudCcsXG5cbiAgICAgICAgLy8gcmVtb3ZlIGN1cnNvciBvbiBtb2JpbGUgd2hpbHN0IG1haW50YWluaW5nIFwic2Nyb2xsIGludG8gdmlld1wiIGJlaGF2aW91clxuICAgICAgICBsZWZ0OiAtMTAwLFxuICAgICAgICBvcGFjaXR5OiAwLFxuICAgICAgICBwb3NpdGlvbjogJ3JlbGF0aXZlJyxcbiAgICAgICAgdHJhbnNmb3JtOiAnc2NhbGUoLjAxKScsXG4gICAgICB9fVxuICAgIC8+XG4gICk7XG59XG4iXX0= */")}))}var eL=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function tL(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,a=e.onTopLeave,o=I.useRef(!1),s=I.useRef(!1),l=I.useRef(0),u=I.useRef(null),c=I.useCallback(function(m,b){if(u.current!==null){var v=u.current,x=v.scrollTop,C=v.scrollHeight,E=v.clientHeight,w=u.current,B=b>0,y=C-E-x,S=!1;y>b&&o.current&&(r&&r(m),o.current=!1),B&&s.current&&(a&&a(m),s.current=!1),B&&b>y?(n&&!o.current&&n(m),w.scrollTop=C,S=!0,o.current=!0):!B&&-b>x&&(i&&!s.current&&i(m),w.scrollTop=0,S=!0,s.current=!0),S&&eL(m)}},[n,r,i,a]),d=I.useCallback(function(m){c(m,m.deltaY)},[c]),h=I.useCallback(function(m){l.current=m.changedTouches[0].clientY},[]),f=I.useCallback(function(m){var b=l.current-m.changedTouches[0].clientY;c(m,b)},[c]),g=I.useCallback(function(m){if(m){var b=CN?{passive:!1}:!1;m.addEventListener("wheel",d,b),m.addEventListener("touchstart",h,b),m.addEventListener("touchmove",f,b)}},[f,h,d]),p=I.useCallback(function(m){m&&(m.removeEventListener("wheel",d,!1),m.removeEventListener("touchstart",h,!1),m.removeEventListener("touchmove",f,!1))},[f,h,d]);return I.useEffect(function(){if(t){var m=u.current;return g(m),function(){p(m)}}},[t,g,p]),function(m){u.current=m}}var uv=["boxSizing","height","overflow","paddingRight","position"],cv={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function dv(e){e.preventDefault()}function fv(e){e.stopPropagation()}function hv(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function gv(){return"ontouchstart"in window||navigator.maxTouchPoints}var pv=!!(typeof window<"u"&&window.document&&window.document.createElement),Vs=0,No={capture:!1,passive:!1};function nL(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=I.useRef({}),a=I.useRef(null),o=I.useCallback(function(l){if(pv){var u=document.body,c=u&&u.style;if(r&&uv.forEach(function(g){var p=c&&c[g];i.current[g]=p}),r&&Vs<1){var d=parseInt(i.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,f=window.innerWidth-h+d||0;Object.keys(cv).forEach(function(g){var p=cv[g];c&&(c[g]=p)}),c&&(c.paddingRight="".concat(f,"px"))}u&&gv()&&(u.addEventListener("touchmove",dv,No),l&&(l.addEventListener("touchstart",hv,No),l.addEventListener("touchmove",fv,No))),Vs+=1}},[r]),s=I.useCallback(function(l){if(pv){var u=document.body,c=u&&u.style;Vs=Math.max(Vs-1,0),r&&Vs<1&&uv.forEach(function(d){var h=i.current[d];c&&(c[d]=h)}),u&&gv()&&(u.removeEventListener("touchmove",dv,No),l&&(l.removeEventListener("touchstart",hv,No),l.removeEventListener("touchmove",fv,No)))}},[r]);return I.useEffect(function(){if(t){var l=a.current;return o(l),function(){s(l)}}},[t,o,s]),function(l){a.current=l}}function rL(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var iL=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},aL=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:rL};function oL(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,a=e.onBottomArrive,o=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,u=tL({isEnabled:i,onBottomArrive:a,onBottomLeave:o,onTopArrive:s,onTopLeave:l}),c=nL({isEnabled:n}),d=function(f){u(f),c(f)};return Te(I.Fragment,null,n&&Te("div",{onClick:iL,css:aL}),t(d))}function sL(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var lL=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:sL},uL=function(t){var n=t.name,r=t.onFocus;return Te("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:lL,value:"",onChange:function(){}})},cL=uL;function hm(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function dL(){return hm(/^iPhone/i)}function S3(){return hm(/^Mac/i)}function fL(){return hm(/^iPad/i)||S3()&&navigator.maxTouchPoints>1}function hL(){return dL()||fL()}function gL(){return S3()||hL()}var pL=function(t){return t.label},mL=function(t){return t.label},bL=function(t){return t.value},vL=function(t){return!!t.isDisabled},yL={clearIndicator:QN,container:HN,control:oM,dropdownIndicator:JN,group:cM,groupHeading:fM,indicatorsContainer:GN,indicatorSeparator:tM,input:mM,loadingIndicator:iM,loadingMessage:NN,menu:TN,menuList:kN,menuPortal:ON,multiValue:CM,multiValueLabel:EM,multiValueRemove:SM,noOptionsMessage:FN,option:TM,placeholder:$M,singleValue:FM,valueContainer:WN},xL={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},CL=4,w3=4,EL=38,SL=w3*2,wL={baseUnit:w3,controlHeight:EL,menuGutter:SL},_h={borderRadius:CL,colors:xL,spacing:wL},IL={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:iv(),captureMenuScroll:!iv(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:JM(),formatGroupLabel:pL,getOptionLabel:mL,getOptionValue:bL,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:vL,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!yN(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function mv(e,t,n,r){var i=D3(e,t,n),a=A3(e,t,n),o=_3(e,t),s=Rd(e,t);return{type:"option",data:t,isDisabled:i,isSelected:a,label:o,value:s,index:r}}function Lc(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(o,s){return mv(e,o,t,s)}).filter(function(o){return vv(e,o)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var a=mv(e,n,t,r);return vv(e,a)?a:void 0}).filter(EN)}function I3(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Qp(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function bv(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Qp(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function _L(e,t){return I3(Lc(e,t))}function vv(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,a=t.isSelected,o=t.label,s=t.value;return(!R3(e)||!a)&&T3(e,{label:o,value:s,data:i},r)}function DL(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var a=t.indexOf(n);if(a>-1)return n;if(i<t.length)return t[i]}return null}function AL(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Dh=function(t,n){var r,i=(r=t.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return i||null},_3=function(t,n){return t.getOptionLabel(n)},Rd=function(t,n){return t.getOptionValue(n)};function D3(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function A3(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Rd(e,t);return n.some(function(i){return Rd(e,i)===r})}function T3(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var R3=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},TL=1,B3=function(e){UP(n,e);var t=YP(n);function n(r){var i;if(zP(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=gL(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,d=c.onChange,h=c.name;u.name=h,i.ariaOnChange(l,u),d(l,u)},i.setValue=function(l,u,c){var d=i.props,h=d.closeMenuOnSelect,f=d.isMulti,g=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:g}),h&&(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,h=u.name,f=i.state.selectValue,g=d&&i.isOptionSelected(l,f),p=i.isOptionDisabled(l,f);if(g){var m=i.getOptionValue(l);i.setValue(f.filter(function(b){return i.getOptionValue(b)!==m}),"deselect-option",l)}else if(!p)d?i.setValue([].concat(Qp(f),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:h});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(l),h=c.filter(function(g){return i.getOptionValue(g)!==d}),f=Ju(u,h,h[0]||null);i.onChange(f,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(Ju(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),h=Ju(l,d,d[0]||null);i.onChange(h,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return Dh(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return bv(Lc(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return gN.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return _3(i.props,l)},i.getOptionValue=function(l){return Rd(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,d=yL[l](u,c);d.boxSizing="border-box";var h=i.props.styles[l];return h?h(d,u):d},i.getClassNames=function(l,u){var c,d;return(c=(d=i.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return LM(i.props)},i.buildCategorizedOptions=function(){return Lc(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return I3(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Be({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Bf(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),h=Math.abs(c.clientY-i.initialTouchY),f=5;i.userIsDragging=d>f||h>f}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return R3(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,h=u.escapeClearsValue,f=u.inputValue,g=u.isClearable,p=u.isDisabled,m=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,x=u.openMenuOnFocus,C=i.state,E=C.focusedOption,w=C.focusedValue,B=C.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||f)return;i.focusValue("previous");break;case"ArrowRight":if(!c||f)return;i.focusValue("next");break;case"Delete":case"Backspace":if(f)return;if(w)i.removeValue(w);else{if(!d)return;c?i.popValue():g&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!m||!v||!E||x&&i.isOptionSelected(E,B))return;i.selectOption(E);break;case"Enter":if(l.keyCode===229)break;if(m){if(!E||i.isComposing)return;i.selectOption(E);break}return;case"Escape":m?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:f}),i.onMenuClose()):g&&h&&i.clearValue();break;case" ":if(f)return;if(!m){i.openMenu("first");break}if(!E)return;i.selectOption(E);break;case"ArrowUp":m?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":m?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!m)return;i.focusOption("pageup");break;case"PageDown":if(!m)return;i.focusOption("pagedown");break;case"Home":if(!m)return;i.focusOption("first");break;case"End":if(!m)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++TL),i.state.selectValue=nv(r.value),r.menuIsOpen&&i.state.selectValue.length){var a=i.getFocusableOptionsWithIds(),o=i.buildFocusableOptions(),s=o.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=a,i.state.focusedOption=o[s],i.state.focusedOptionId=Dh(a,o[s])}return i}return GP(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&rv(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isDisabled,s=a.menuIsOpen,l=this.state.isFocused;(l&&!o&&i.isDisabled||l&&s&&!i.menuIsOpen)&&this.focusInput(),l&&o&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!o&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(rv(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,o=this.state,s=o.selectValue,l=o.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,o=a.selectValue,s=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=o.indexOf(s);s||(l=-1);var u=o.length-1,c=-1;if(o.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:o[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(o);o||(u=-1),i==="up"?l=u>0?u-1:s.length-1:i==="down"?l=(u+1)%s.length:i==="pageup"?(l=u-a,l<0&&(l=0)):i==="pagedown"?(l=u+a,l>s.length-1&&(l=s.length-1)):i==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(_h):Be(Be({},_h),this.props.theme):_h}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,o=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,h=d.isMulti,f=d.isRtl,g=d.options,p=this.hasValue();return{clearValue:i,cx:a,getStyles:o,getClassNames:s,getValue:l,hasValue:p,isMulti:h,isRtl:f,options:g,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,o=i.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(i,a){return D3(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return A3(this.props,i,a)}},{key:"filterOption",value:function(i,a){return T3(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:o,selectValue:s})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,o=i.isSearchable,s=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,h=i.required,f=this.getComponents(),g=f.Input,p=this.state,m=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,x=s||this.getElementId("input"),C=Be(Be(Be({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(b==null?void 0:b.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?q.createElement(g,$e({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:a,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},C)):q.createElement(QM,$e({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ad,onFocus:this.onInputFocus,disabled:a,tabIndex:u,inputMode:"none",form:c,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),o=a.MultiValue,s=a.MultiValueContainer,l=a.MultiValueLabel,u=a.MultiValueRemove,c=a.SingleValue,d=a.Placeholder,h=this.commonProps,f=this.props,g=f.controlShouldRenderValue,p=f.isDisabled,m=f.isMulti,b=f.inputValue,v=f.placeholder,x=this.state,C=x.selectValue,E=x.focusedValue,w=x.isFocused;if(!this.hasValue()||!g)return b?null:q.createElement(d,$e({},h,{key:"placeholder",isDisabled:p,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),v);if(m)return C.map(function(y,S){var D=y===E,A="".concat(i.getOptionLabel(y),"-").concat(i.getOptionValue(y));return q.createElement(o,$e({},h,{components:{Container:s,Label:l,Remove:u},isFocused:D,isDisabled:p,key:A,index:S,removeProps:{onClick:function(){return i.removeValue(y)},onTouchEnd:function(){return i.removeValue(y)},onMouseDown:function(F){F.preventDefault()}},data:y}),i.formatOptionLabel(y,"value"))});if(b)return null;var B=C[0];return q.createElement(c,$e({},h,{data:B,isDisabled:p}),this.formatOptionLabel(B,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,o=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!a||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return q.createElement(a,$e({},o,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,o=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!a||!u)return null;var d={"aria-hidden":"true"};return q.createElement(a,$e({},o,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,o=i.IndicatorSeparator;if(!a||!o)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return q.createElement(o,$e({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var o=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return q.createElement(a,$e({},o,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),o=a.Group,s=a.GroupHeading,l=a.Menu,u=a.MenuList,c=a.MenuPortal,d=a.LoadingMessage,h=a.NoOptionsMessage,f=a.Option,g=this.commonProps,p=this.state.focusedOption,m=this.props,b=m.captureMenuScroll,v=m.inputValue,x=m.isLoading,C=m.loadingMessage,E=m.minMenuHeight,w=m.maxMenuHeight,B=m.menuIsOpen,y=m.menuPlacement,S=m.menuPosition,D=m.menuPortalTarget,A=m.menuShouldBlockScroll,T=m.menuShouldScrollIntoView,F=m.noOptionsMessage,k=m.onMenuScrollToTop,P=m.onMenuScrollToBottom;if(!B)return null;var $=function(K,ee){var z=K.type,H=K.data,X=K.isDisabled,te=K.isSelected,ie=K.label,le=K.value,ce=p===H,Q=X?void 0:function(){return i.onOptionHover(H)},be=X?void 0:function(){return i.selectOption(H)},Ce="".concat(i.getElementId("option"),"-").concat(ee),Se={id:Ce,onClick:be,onMouseMove:Q,onMouseOver:Q,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:te};return q.createElement(f,$e({},g,{innerProps:Se,data:H,isDisabled:X,isSelected:te,key:Ce,label:ie,type:z,value:le,isFocused:ce,innerRef:ce?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(K.data,"menu"))},R;if(this.hasOptions())R=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var K=U.data,ee=U.options,z=U.index,H="".concat(i.getElementId("group"),"-").concat(z),X="".concat(H,"-heading");return q.createElement(o,$e({},g,{key:H,data:K,options:ee,Heading:s,headingProps:{id:X,data:U.data},label:i.formatGroupLabel(U.data)}),U.options.map(function(te){return $(te,"".concat(z,"-").concat(te.index))}))}else if(U.type==="option")return $(U,"".concat(U.index))});else if(x){var O=C({inputValue:v});if(O===null)return null;R=q.createElement(d,g,O)}else{var j=F({inputValue:v});if(j===null)return null;R=q.createElement(h,g,j)}var V={minMenuHeight:E,maxMenuHeight:w,menuPlacement:y,menuPosition:S,menuShouldScrollIntoView:T},W=q.createElement(RN,$e({},g,V),function(U){var K=U.ref,ee=U.placerProps,z=ee.placement,H=ee.maxHeight;return q.createElement(l,$e({},g,V,{innerRef:K,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:z}),q.createElement(oL,{captureEnabled:b,onTopArrive:k,onBottomArrive:P,lockEnabled:A},function(X){return q.createElement(u,$e({},g,{innerRef:function(ie){i.getMenuListRef(ie),X(ie)},innerProps:{role:"listbox","aria-multiselectable":g.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:H,focusedOption:p}),R)}))});return D||S==="fixed"?q.createElement(c,$e({},g,{appendTo:D,controlElement:this.controlRef,menuPlacement:y,menuPosition:S}),W):W}},{key:"renderFormField",value:function(){var i=this,a=this.props,o=a.delimiter,s=a.isDisabled,l=a.isMulti,u=a.name,c=a.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return q.createElement(cL,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(o){var h=d.map(function(p){return i.getOptionValue(p)}).join(o);return q.createElement("input",{name:u,type:"hidden",value:h})}else{var f=d.length>0?d.map(function(p,m){return q.createElement("input",{key:"i-".concat(m),name:u,type:"hidden",value:i.getOptionValue(p)})}):q.createElement("input",{name:u,type:"hidden",value:""});return q.createElement("div",null,f)}else{var g=d[0]?this.getOptionValue(d[0]):"";return q.createElement("input",{name:u,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,o=a.ariaSelection,s=a.focusedOption,l=a.focusedValue,u=a.isFocused,c=a.selectValue,d=this.getFocusableOptions();return q.createElement(XM,$e({},i,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,o=i.IndicatorsContainer,s=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,d=u.id,h=u.isDisabled,f=u.menuIsOpen,g=this.state.isFocused,p=this.commonProps=this.getCommonProps();return q.createElement(s,$e({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:g}),this.renderLiveRegion(),q.createElement(a,$e({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:g,menuIsOpen:f}),q.createElement(l,$e({},p,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),q.createElement(o,$e({},p,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var o=a.prevProps,s=a.clearFocusValueOnUpdate,l=a.inputIsHiddenAfterUpdate,u=a.ariaSelection,c=a.isFocused,d=a.prevWasFocused,h=a.instancePrefix,f=i.options,g=i.value,p=i.menuIsOpen,m=i.inputValue,b=i.isMulti,v=nv(g),x={};if(o&&(g!==o.value||f!==o.options||p!==o.menuIsOpen||m!==o.inputValue)){var C=p?_L(i,v):[],E=p?bv(Lc(i,v),"".concat(h,"-option")):[],w=s?DL(a,v):null,B=AL(a,C),y=Dh(E,B);x={selectValue:v,focusedOption:B,focusedOptionId:y,focusableOptionsWithIds:E,focusedValue:w,clearFocusValueOnUpdate:!1}}var S=l!=null&&i!==o?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},D=u,A=c&&d;return c&&!A&&(D={value:Ju(b,v,v[0]||null),options:v,action:"initial-input-focus"},A=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(D=null),Be(Be(Be({},x),S),{},{prevProps:i,ariaSelection:D,prevWasFocused:A})}}]),n}(I.Component);B3.defaultProps=IL;var RL=I.forwardRef(function(e,t){var n=WP(e);return q.createElement(B3,$e({ref:t},n))}),BL=RL;const $L="_container_2k8uz_109",Oc={container:$L,"error-payhere":"_error-payhere_2k8uz_109","error-laba":"_error-laba_2k8uz_307","error-bill":"_error-bill_2k8uz_421"},kL={control:e=>({...e,border:"1px solid #D6D6D6","&:hover":{borderColor:"#0163C8"},borderRadius:"4px",outline:"none",boxShadow:"none",color:"#898989",backgroundColor:"white",margin:"0px",cursor:"text",minHeight:32,fontSize:"12px",lineHeight:"16px",fontFamily:"Lato"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Lato",cursor:"pointer",background:t.isSelected?"#F0F7FF":"white",color:t.isSelected?"#0163C8":e.color,"&:hover":{background:t.isDisabled?"":"#F0F7FF",color:t.isDisabled?"":"#0163C8",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"12px",lineHeight:"16px",fontFamily:"Lato"})},PL={control:e=>({...e,border:"1px solid #BDBDBD","&:hover":{borderColor:"#64B5F6"},borderRadius:"6px",outline:"none",color:"#212121",backgroundColor:"white",margin:"0px",cursor:"text",minHeight:38,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter",marginBottom:"5px"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter",cursor:"pointer",background:t.isSelected?"#E1F5FE":"white",color:t.isSelected?"#1565C0":e.color,"&:hover":{background:t.isDisabled?"":"#E1F5FE",color:t.isDisabled?"":"#1565C0",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter"})},FL={control:e=>({...e,border:"1px solid #BDBDBD","&:hover":{borderColor:"#64B5F6"},borderRadius:"6px",outline:"none",color:"#212121",backgroundColor:"white",margin:"0px",cursor:"text",minHeight:38,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans",marginBottom:"5px"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px",borderRadius:"12px"}),menuList:e=>({...e,borderRadius:"12px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans",cursor:"pointer",background:t.isSelected?"#F0FEFD":"white",color:t.isSelected?"#2F7E79":e.color,"&:hover":{background:t.isDisabled?"":"#F0FEFD",color:t.isDisabled?"":"#2F7E79",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans"})},NL={control:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Lato",cursor:"pointer",background:t.isSelected?"#F0F7FF":"white",color:t.isSelected?"#0163C8":e.color,"&:hover":{background:t.isDisabled?"":"#F0F7FF",color:t.isDisabled?"":"#0163C8",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"12px",lineHeight:"16px",fontFamily:"Lato"})},ML={control:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter",cursor:"pointer",background:t.isSelected?"#E1F5FE":"white",color:t.isSelected?"#1565C0":e.color,"&:hover":{background:t.isDisabled?"":"#E1F5FE",color:t.isDisabled?"":"#1565C0",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"Inter"})},LL={control:()=>({display:"none"}),dropdownIndicator:e=>({...e,padding:"0px 8px"}),menu:e=>({...e,position:"static",boxShadow:"none",marginTop:"0px",borderRadius:"12px"}),menuList:e=>({...e,borderRadius:"12px"}),option:(e,t)=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans",fontWeight:"500",cursor:"pointer",background:t.isSelected?"#F0FEFD":"white",color:t.isSelected?"#2F7E79":e.color,"&:hover":{background:t.isDisabled?"":"#F0FEFD",color:t.isDisabled?"":"#2F7E79",cursor:t.isDisabled?"default":""}}),group:e=>({...e,padding:0}),placeholder:e=>({...e,fontSize:"14px",lineHeight:"22px",fontFamily:"PJakartaSans"})},qu={error:{laba:Oc["error-laba"],payhere:Oc["error-payhere"],bill:Oc["error-bill"]},variant:{laba:kL,payhere:PL,bill:FL},noSearchVariant:{laba:NL,payhere:ML,bill:LL},classNamePopover:{laba:"",payhere:"",bill:"!1ru-rounded-xl"}},$3=I.forwardRef((e,t)=>{const{width:n,children:r,components:i,classNameContainer:a="",classNameContainerShowSelect:o="",classNameContainerSelect:s="",classNameLabelError:l="",error:u,onChange:c,externalValue:d=!1,defaultValueButtonDropdown:h={},autoClose:f=!0,onMenuOpen:g=()=>{},autoCloseOutside:p=!0,styleInnerPopper:m={},onMenuClose:b=()=>{},zIndexPopper:v=0,id:x="select-dropdown-container",idPopover:C="select-dropdown-container-popover",useAutoPlacement:E,flipOptions:w,autoPlacementOptions:B,withSearch:y=!1,floatingOptions:S={},offsetPopover:D=5,selectProps:A={},errorLabel:T="payhere",controlType:F="payhere",actionValueChange:k=()=>{},...P}=e,$=I.useRef(null),R=I.useRef(null),[O,j]=I.useState(""),[V,W]=I.useState(!1),[U,K]=I.useState({}),[ee,z]=I.useState(0),H=Q=>{var be;(be=R.current)==null||be.setShow(Q),W(Q)},X=()=>{if(d)return e.isMulti?h:[h]},te=Q=>{var be;(be=R.current)==null||be.handlerShow(Q),z($.current.offsetWidth),W(Ce=>!Ce)},ie=()=>{var Q;p&&((Q=R.current)==null||Q.setShow(!1))},le=(Q,be)=>{var Ce;f&&(W(!1),(Ce=R.current)==null||Ce.setShow(!1)),typeof c=="function"&&c(Q,be),d||K(Q)},ce=()=>{$.current&&z($.current.offsetWidth)};return ba(()=>{d&&K(h),k(h)},[d,h]),I.useEffect(()=>{V?g():V||(b(),j(""))},[V]),I.useImperativeHandle(t,()=>({selectValue:U,setSelectValue:K,handlerClose:ie,handlerShow:te,show:V,setShow:H}),[V,Ol(U)]),I.useEffect(()=>(window.addEventListener("resize",ce),window.addEventListener("load",ce),()=>{window.removeEventListener("resize",ce),window.removeEventListener("load",ce)}),[$]),_.jsxs("div",{id:x,className:`${Oc.container} ${a} ${V?`${o} open-popover`:null}`,ref:$,children:[r({selectValue:U,setSelectValue:K,handlerClose:ie,handlerShow:te,show:V,setShow:H}),_.jsx(pi,{ref:R,offset:D,useAutoPlacement:E,flipOptions:w,autoPlacementOptions:B,zIndex:v,styleInnerPopover:m,id:C,width:typeof n=="function"?n(ee,U):n||ee,className:`${s} ${qu.classNamePopover[F]}`,floatingOptions:S,children:_.jsx(BL,{className:"1ru-w-full",defaultValue:X(),inputValue:O,onInputChange:(Q,{action:be})=>{be==="input-change"&&j(Q)},openMenuOnFocus:!0,autoFocus:!1,backspaceRemovesValue:!1,components:{IndicatorSeparator:null,...i},controlShouldRenderValue:!1,hideSelectedOptions:!1,isClearable:!1,menuIsOpen:!0,tabSelectsValue:!1,styles:y?qu.variant[F]:qu.noSearchVariant[F],noOptionsMessage:()=>"Tidak ada data.",onChange:le,selectProps:{...A,setShowDropdown:H},...P})}),_.jsx("div",{className:`${qu.error[T]} ${l}`,children:u})]})});$3.displayName="SelectDropdownContainer";function as(e,t){return e-t*Math.floor(e/t)}const k3=1721426;function eo(e,t,n,r){t=Su(e,t);let i=t-1,a=-2;return n<=2?a=0:ca(t)&&(a=-1),k3-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function ca(e){return e%4===0&&(e%100!==0||e%400===0)}function Su(e,t){return e==="BC"?1-t:t}function $f(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const OL={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class ar{fromJulianDay(t){let n=t,r=n-k3,i=Math.floor(r/146097),a=as(r,146097),o=Math.floor(a/36524),s=as(a,36524),l=Math.floor(s/1461),u=as(s,1461),c=Math.floor(u/365),d=i*400+o*100+l*4+c+(o!==4&&c!==4?1:0),[h,f]=$f(d),g=n-eo(h,f,1,1),p=2;n<eo(h,f,3,1)?p=0:ca(f)&&(p=1);let m=Math.floor(((g+p)*12+373)/367),b=n-eo(h,f,m,1)+1;return new Vt(h,f,m,b)}toJulianDay(t){return eo(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return OL[ca(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return ca(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const VL={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Gt(e,t){return t=rn(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function pg(e,t){return e.calendar.identifier===t.calendar.identifier&&e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function HL(e,t){return Gt(e,gm(t))}function kf(e,t){let n=e.calendar.toJulianDay(e),r=Math.ceil(n+1-UL(t))%7;return r<0&&(r+=7),r}function jL(e){return ai(Date.now(),e)}function gm(e){return Bn(jL(e))}function P3(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function F3(e,t){return yv(e)-yv(t)}function yv(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Ah=null;function Kn(){return Ah==null&&(Ah=new Intl.DateTimeFormat().resolvedOptions().timeZone),Ah}function wu(e){return e.subtract({days:e.day-1})}function mg(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function WL(e){return wu(e.subtract({months:e.month-1}))}function zl(e,t){let n=kf(e,t);return e.subtract({days:n})}function zL(e,t){return zl(e,t).add({days:6})}const xv=new Map;function GL(e){if(Intl.Locale){let n=xv.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&xv.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function UL(e){let t=GL(e);return t&&VL[t]||0}function N3(e,t){let n=e.calendar.getDaysInMonth(e);return Math.ceil((kf(wu(e),t)+n)/7)}function pm(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function mm(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}function xs(e){e=rn(e,new ar);let t=Su(e.era,e.year);return M3(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function M3(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function bg(e,t){if(t==="UTC")return 0;if(e>0&&t===Kn())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=L3(e,t);return M3(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}const Cv=new Map;function L3(e,t){let n=Cv.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Cv.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let a of r)a.type!=="literal"&&(i[a.type]=a.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const Ev=864e5;function XL(e,t,n,r){return(n===r?[n]:[n,r]).filter(a=>ZL(e,t,a))}function ZL(e,t,n){let r=L3(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Ri(e,t,n="compatible"){let r=Ia(e);if(t==="UTC")return xs(r);if(t===Kn()&&n==="compatible"){r=rn(r,new ar);let l=new Date,u=Su(r.era,r.year);return l.setFullYear(u,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let i=xs(r),a=bg(i-Ev,t),o=bg(i+Ev,t),s=XL(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-a,i-o);case"compatible":case"later":return Math.max(i-a,i-o);case"reject":throw new RangeError("No such absolute time found")}}function O3(e,t,n="compatible"){return new Date(Ri(e,t,n))}function ai(e,t){let n=bg(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),l=r.getUTCMinutes(),u=r.getUTCSeconds(),c=r.getUTCMilliseconds();return new Ul(i,a,o,t,n,s,l,u,c)}function Sv(e,t){return ai(e.getTime(),t)}function Bn(e){return new Vt(e.calendar,e.era,e.year,e.month,e.day)}function Ia(e,t){let n=0,r=0,i=0,a=0;if("timeZone"in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new Bd(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function rn(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,bo(r),r}function YL(e,t,n){if(e instanceof Ul)return e.timeZone===t?e:JL(e,t);let r=Ri(e,t,n);return ai(r,t)}function KL(e){let t=xs(e)-e.offset;return new Date(t)}function JL(e,t){let n=xs(e)-e.offset;return rn(ai(n,t),e.calendar)}const Hs=36e5;function Pf(e,t){let n=e.copy(),r="hour"in n?W3(n,t):0;vg(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,yg(n),V3(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,qL(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var a,o;let l=(a=(o=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(o,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function vg(e,t){var n,r;!((n=(r=e.calendar).isInverseEra)===null||n===void 0)&&n.call(r,e)&&(t=-t),e.year+=t}function yg(e){for(;e.month<1;)vg(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,vg(e,1)}function qL(e){for(;e.day<1;)e.month--,yg(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,yg(e)}function V3(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function bo(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),V3(e)}function bm(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function H3(e,t){return Pf(e,bm(t))}function vm(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),bo(n),n}function Gl(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),j3(n),n}function QL(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Qu(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Qu(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Qu(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Qu(e.hour,24),t}function j3(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Qu(e,t){let n=e%t;return n<0&&(n+=t),n}function W3(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,QL(e)}function z3(e,t){let n=e.copy();return W3(n,t),n}function eO(e,t){return z3(e,bm(t))}function ym(e,t,n,r){let i=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),l=s.indexOf(e.era);if(l<0)throw new Error("Invalid era: "+e.era);l=Ni(l,n,0,s.length-1,r==null?void 0:r.round),i.era=s[l],bo(i);break}case"year":var a,o;!((a=(o=i.calendar).isInverseEra)===null||a===void 0)&&a.call(o,i)&&(n=-n),i.year=Ni(e.year,n,-1/0,9999,r==null?void 0:r.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=Ni(e.month,n,1,e.calendar.getMonthsInYear(e),r==null?void 0:r.round);break;case"day":i.day=Ni(e.day,n,1,e.calendar.getDaysInMonth(e),r==null?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),bo(i),i}function xm(e,t,n,r){let i=e.copy();switch(t){case"hour":{let a=e.hour,o=0,s=23;if((r==null?void 0:r.hourCycle)===12){let l=a>=12;o=l?12:0,s=l?23:11}i.hour=Ni(a,n,o,s,r==null?void 0:r.round);break}case"minute":i.minute=Ni(e.minute,n,0,59,r==null?void 0:r.round);break;case"second":i.second=Ni(e.second,n,0,59,r==null?void 0:r.round);break;case"millisecond":i.millisecond=Ni(e.millisecond,n,0,999,r==null?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return i}function Ni(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e<n&&(e=r);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function G3(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let i=Pf(Ia(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=Ri(i,e.timeZone)}else n=xs(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let r=ai(n,e.timeZone);return rn(r,e.calendar)}function tO(e,t){return G3(e,bm(t))}function nO(e,t,n,r){switch(t){case"hour":{let i=0,a=23;if((r==null?void 0:r.hourCycle)===12){let g=e.hour>=12;i=g?12:0,a=g?23:11}let o=Ia(e),s=rn(Gl(o,{hour:i}),new ar),l=[Ri(s,e.timeZone,"earlier"),Ri(s,e.timeZone,"later")].filter(g=>ai(g,e.timeZone).day===s.day)[0],u=rn(Gl(o,{hour:a}),new ar),c=[Ri(u,e.timeZone,"earlier"),Ri(u,e.timeZone,"later")].filter(g=>ai(g,e.timeZone).day===u.day).pop(),d=xs(e)-e.offset,h=Math.floor(d/Hs),f=d%Hs;return d=Ni(h,n,Math.floor(l/Hs),Math.floor(c/Hs),r==null?void 0:r.round)*Hs+f,rn(ai(d,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return xm(e,t,n,r);case"era":case"year":case"month":case"day":{let i=ym(Ia(e),t,n,r),a=Ri(i,e.timeZone);return rn(ai(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function rO(e,t,n){let r=Ia(e),i=Gl(vm(r,t),t);if(i.compare(r)===0)return e;let a=Ri(i,e.timeZone,n);return rn(ai(a,e.timeZone),e.calendar)}const iO=/^(\d{4})-(\d{2})-(\d{2})$/;function Cm(e){let t=e.match(iO);if(!t)throw new Error("Invalid ISO 8601 date string: "+e);let n=new Vt(Th(t[1],0,9999),Th(t[2],1,12),1);return n.day=Th(t[3],0,n.calendar.getDaysInMonth(n)),n}function Th(e,t,n){let r=Number(e);if(r<t||r>n)throw new RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function U3(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function X3(e){let t=rn(e,new ar);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Z3(e){return`${X3(e)}T${U3(e)}`}function aO(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),r=e%36e5/6e4;return`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function oO(e){return`${Z3(e)}${aO(e.offset)}[${e.timeZone}]`}function sO(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iu(e,t,n){sO(e,t),t.set(e,n)}function Em(e){let t=typeof e[0]=="object"?e.shift():new ar,n;if(typeof e[0]=="string")n=e.shift();else{let o=t.getEras();n=o[o.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var lO=new WeakMap;class Vt{copy(){return this.era?new Vt(this.calendar,this.era,this.year,this.month,this.day):new Vt(this.calendar,this.year,this.month,this.day)}add(t){return Pf(this,t)}subtract(t){return H3(this,t)}set(t){return vm(this,t)}cycle(t,n,r){return ym(this,t,n,r)}toDate(t){return O3(this,t)}toString(){return X3(this)}compare(t){return P3(this,t)}constructor(...t){Iu(this,lO,{writable:!0,value:void 0});let[n,r,i,a,o]=Em(t);this.calendar=n,this.era=r,this.year=i,this.month=a,this.day=o,bo(this)}}var uO=new WeakMap;class Sm{copy(){return new Sm(this.hour,this.minute,this.second,this.millisecond)}add(t){return z3(this,t)}subtract(t){return eO(this,t)}set(t){return Gl(this,t)}cycle(t,n,r){return xm(this,t,n,r)}toString(){return U3(this)}compare(t){return F3(this,t)}constructor(t=0,n=0,r=0,i=0){Iu(this,uO,{writable:!0,value:void 0}),this.hour=t,this.minute=n,this.second=r,this.millisecond=i,j3(this)}}var cO=new WeakMap;class Bd{copy(){return this.era?new Bd(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Bd(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Pf(this,t)}subtract(t){return H3(this,t)}set(t){return vm(Gl(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return ym(this,t,n,r);default:return xm(this,t,n,r)}}toDate(t,n){return O3(this,t,n)}toString(){return Z3(this)}compare(t){let n=P3(this,t);return n===0?F3(this,Ia(t)):n}constructor(...t){Iu(this,cO,{writable:!0,value:void 0});let[n,r,i,a,o]=Em(t);this.calendar=n,this.era=r,this.year=i,this.month=a,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,bo(this)}}var dO=new WeakMap;class Ul{copy(){return this.era?new Ul(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Ul(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return G3(this,t)}subtract(t){return tO(this,t)}set(t,n){return rO(this,t,n)}cycle(t,n,r){return nO(this,t,n,r)}toDate(){return KL(this)}toString(){return oO(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-YL(t,this.timeZone).toDate().getTime()}constructor(...t){Iu(this,dO,{writable:!0,value:void 0});let[n,r,i,a,o]=Em(t),s=t.shift(),l=t.shift();this.calendar=n,this.era=r,this.year=i,this.month=a,this.day=o,this.timeZone=s,this.offset=l,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,bo(this)}}const os=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],fO=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],Vc=[1867,1911,1925,1988,2018],ta=["meiji","taisho","showa","heisei","reiwa"];function wv(e){const t=os.findIndex(([n,r,i])=>e.year<n||e.year===n&&e.month<r||e.year===n&&e.month===r&&e.day<i);return t===-1?os.length-1:t===0?0:t-1}function Rh(e){let t=Vc[ta.indexOf(e.era)];if(!t)throw new Error("Unknown era: "+e.era);return new Vt(e.year+t,e.month,e.day)}class hO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=wv(n);return new Vt(this,ta[r],n.year-Vc[r],n.month,n.day)}toJulianDay(t){return super.toJulianDay(Rh(t))}balanceDate(t){let n=Rh(t),r=wv(n);ta[r]!==t.era&&(t.era=ta[r],t.year=n.year-Vc[r]),this.constrainDate(t)}constrainDate(t){let n=ta.indexOf(t.era),r=fO[n];if(r!=null){let[i,a,o]=r,s=i-Vc[n];t.year=Math.max(1,Math.min(s,t.year)),t.year===s&&(t.month=Math.min(a,t.month),t.month===a&&(t.day=Math.min(o,t.day)))}if(t.year===1&&n>=0){let[,i,a]=os[n];t.month=Math.max(i,t.month),t.month===i&&(t.day=Math.max(a,t.day))}}getEras(){return ta}getYearsInEra(t){let n=ta.indexOf(t.era),r=os[n],i=os[n+1];if(i==null)return 9999-r[0]+1;let a=i[0]-r[0];return(t.month<i[1]||t.month===i[1]&&t.day<i[2])&&a++,a}getDaysInMonth(t){return super.getDaysInMonth(Rh(t))}getMinimumMonthInYear(t){let n=Iv(t);return n?n[1]:1}getMinimumDayInMonth(t){let n=Iv(t);return n&&t.month===n[1]?n[2]:1}constructor(...t){super(...t),this.identifier="japanese"}}function Iv(e){if(e.year===1){let t=ta.indexOf(e.era);return os[t]}}const Y3=-543;class gO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=Su(n.era,n.year);return new Vt(this,r-Y3,n.month,n.day)}toJulianDay(t){return super.toJulianDay(_v(t))}getEras(){return["BE"]}getDaysInMonth(t){return super.getDaysInMonth(_v(t))}balanceDate(){}constructor(...t){super(...t),this.identifier="buddhist"}}function _v(e){let[t,n]=$f(e.year+Y3);return new Vt(t,n,e.month,e.day)}const $d=1911;function K3(e){return e.era==="minguo"?e.year+$d:1-e.year+$d}function Dv(e){let t=e-$d;return t>0?["minguo",t]:["before_minguo",1-t]}class pO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=Su(n.era,n.year),[i,a]=Dv(r);return new Vt(this,i,a,n.month,n.day)}toJulianDay(t){return super.toJulianDay(Av(t))}getEras(){return["before_minguo","minguo"]}balanceDate(t){let[n,r]=Dv(K3(t));t.era=n,t.year=r}isInverseEra(t){return t.era==="before_minguo"}getDaysInMonth(t){return super.getDaysInMonth(Av(t))}getYearsInEra(t){return t.era==="before_minguo"?9999:9999-$d}constructor(...t){super(...t),this.identifier="roc"}}function Av(e){let[t,n]=$f(K3(e));return new Vt(t,n,e.month,e.day)}const Tv=1948320,Rv=[0,31,62,93,124,155,186,216,246,276,306,336];class mO{fromJulianDay(t){let n=t-Tv,r=1+Math.floor((33*n+3)/12053),i=365*(r-1)+Math.floor((8*r+21)/33),a=n-i,o=a<216?Math.floor(a/31):Math.floor((a-6)/30),s=a-Rv[o]+1;return new Vt(this,r,o+1,s)}toJulianDay(t){let n=Tv-1+365*(t.year-1)+Math.floor((8*t.year+21)/33);return n+=Rv[t.month-1],n+=t.day,n}getMonthsInYear(){return 12}getDaysInMonth(t){return t.month<=6?31:t.month<=11||as(25*t.year+11,33)<8?30:29}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}const Bh=78,Bv=80;class bO extends ar{fromJulianDay(t){let n=super.fromJulianDay(t),r=n.year-Bh,i=t-eo(n.era,n.year,1,1),a;i<Bv?(r--,a=ca(n.year-1)?31:30,i+=a+155+90+10):(a=ca(n.year)?31:30,i-=Bv);let o,s;if(i<a)o=1,s=i+1;else{let l=i-a;l<155?(o=Math.floor(l/31)+2,s=l%31+1):(l-=155,o=Math.floor(l/30)+7,s=l%30+1)}return new Vt(this,r,o,s)}toJulianDay(t){let n=t.year+Bh,[r,i]=$f(n),a,o;return ca(i)?(a=31,o=eo(r,i,3,21)):(a=30,o=eo(r,i,3,22)),t.month===1?o+t.day-1:(o+=a+Math.min(t.month-2,5)*31,t.month>=8&&(o+=(t.month-7)*30),o+=t.day-1,o)}getDaysInMonth(t){return t.month===1&&ca(t.year+Bh)||t.month>=2&&t.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...t){super(...t),this.identifier="indian"}}const kd=1948440,$v=1948439,hr=1300,Mo=1600,vO=460322;function Pd(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function J3(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+Pd(t,r,1,1)))/29.5)+1),a=n-Pd(t,r,i,1)+1;return new Vt(e,r,i,a)}function kv(e){return(14+11*e)%30<11}class wm{fromJulianDay(t){return J3(this,kd,t)}toJulianDay(t){return Pd(kd,t.year,t.month,t.day)}getDaysInMonth(t){let n=29+t.month%2;return t.month===12&&kv(t.year)&&n++,n}getMonthsInYear(){return 12}getDaysInYear(t){return kv(t.year)?355:354}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class yO extends wm{fromJulianDay(t){return J3(this,$v,t)}toJulianDay(t){return Pd($v,t.year,t.month,t.day)}constructor(...t){super(...t),this.identifier="islamic-tbla"}}const xO="qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";let xg,ss;function Hc(e){return vO+ss[e-hr]}function nl(e,t){let n=e-hr,r=1<<11-(t-1);return xg[n]&r?30:29}function Pv(e,t){let n=Hc(e);for(let r=1;r<t;r++)n+=nl(e,r);return n}function Fv(e){return ss[e+1-hr]-ss[e-hr]}class CO extends wm{fromJulianDay(t){let n=t-kd,r=Hc(hr),i=Hc(Mo);if(n<r||n>i)return super.fromJulianDay(t);{let a=hr-1,o=1,s=1;for(;s>0;){a++,s=n-Hc(a)+1;let l=Fv(a);if(s===l){o=12;break}else if(s<l){let u=nl(a,o);for(o=1;s>u;)s-=u,o++,u=nl(a,o);break}}return new Vt(this,a,o,n-Pv(a,o)+1)}}toJulianDay(t){return t.year<hr||t.year>Mo?super.toJulianDay(t):kd+Pv(t.year,t.month)+(t.day-1)}getDaysInMonth(t){return t.year<hr||t.year>Mo?super.getDaysInMonth(t):nl(t.year,t.month)}getDaysInYear(t){return t.year<hr||t.year>Mo?super.getDaysInYear(t):Fv(t.year)}constructor(){if(super(),this.identifier="islamic-umalqura",xg||(xg=new Uint16Array(Uint8Array.from(atob(xO),t=>t.charCodeAt(0)).buffer)),!ss){ss=new Uint32Array(Mo-hr+1);let t=0;for(let n=hr;n<=Mo;n++){ss[n-hr]=t;for(let r=1;r<=12;r++)t+=nl(n,r)}}}}const Nv=347997,q3=1080,Q3=24*q3,EO=29,SO=12*q3+793,wO=EO*Q3+SO;function Ya(e){return as(e*7+1,19)<7}function jc(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return as(3*(r+1),7)<3&&(r+=1),r}function IO(e){let t=jc(e-1),n=jc(e);return jc(e+1)-n===356?2:n-t===382?1:0}function vl(e){return jc(e)+IO(e)}function eE(e){return vl(e+1)-vl(e)}function _O(e){let t=eE(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function ec(e,t){if(t>=6&&!Ya(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=_O(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Ya(e)?30:0:30}class DO{fromJulianDay(t){let n=t-Nv,r=n*Q3/wO,i=Math.floor((19*r+234)/235)+1,a=vl(i),o=Math.floor(n-a);for(;o<1;)i--,a=vl(i),o=Math.floor(n-a);let s=1,l=0;for(;l<o;)l+=ec(i,s),s++;s--,l-=ec(i,s);let u=o-l;return new Vt(this,i,s,u)}toJulianDay(t){let n=vl(t.year);for(let r=1;r<t.month;r++)n+=ec(t.year,r);return n+t.day+Nv}getDaysInMonth(t){return ec(t.year,t.month)}getMonthsInYear(t){return Ya(t.year)?13:12}getDaysInYear(t){return eE(t.year)}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(t,n){n.year!==t.year&&(Ya(n.year)&&!Ya(t.year)&&n.month>6?t.month--:!Ya(n.year)&&Ya(t.year)&&n.month>6&&t.month++)}constructor(){this.identifier="hebrew"}}const Cg=1723856,Mv=1824665,Eg=5500;function Fd(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function Im(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-Fd(e,n,1,1))/30),i=t+1-Fd(e,n,r,1);return[n,r,i]}function tE(e){return Math.floor(e%4/3)}function nE(e,t){return t%13!==0?30:tE(e)+5}class _m{fromJulianDay(t){let[n,r,i]=Im(Cg,t),a="AM";return n<=0&&(a="AA",n+=Eg),new Vt(this,a,n,r,i)}toJulianDay(t){let n=t.year;return t.era==="AA"&&(n-=Eg),Fd(Cg,n,t.month,t.day)}getDaysInMonth(t){return nE(t.year,t.month)}getMonthsInYear(){return 13}getDaysInYear(t){return 365+tE(t.year)}getYearsInEra(t){return t.era==="AA"?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class AO extends _m{fromJulianDay(t){let[n,r,i]=Im(Cg,t);return n+=Eg,new Vt(this,"AA",n,r,i)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...t){super(...t),this.identifier="ethioaa"}}class TO extends _m{fromJulianDay(t){let[n,r,i]=Im(Mv,t),a="CE";return n<=0&&(a="BCE",n=1-n),new Vt(this,a,n,r,i)}toJulianDay(t){let n=t.year;return t.era==="BCE"&&(n=1-n),Fd(Mv,n,t.month,t.day)}getDaysInMonth(t){let n=t.year;return t.era==="BCE"&&(n=1-n),nE(n,t.month)}isInverseEra(t){return t.era==="BCE"}balanceDate(t){t.year<=0&&(t.era=t.era==="BCE"?"CE":"BCE",t.year=1-t.year)}getEras(){return["BCE","CE"]}getYearsInEra(t){return t.era==="BCE"?9999:9715}constructor(...t){super(...t),this.identifier="coptic"}}function _u(e){switch(e){case"buddhist":return new gO;case"ethiopic":return new _m;case"ethioaa":return new AO;case"coptic":return new TO;case"hebrew":return new DO;case"indian":return new bO;case"islamic-civil":return new wm;case"islamic-tbla":return new yO;case"islamic-umalqura":return new CO;case"japanese":return new hO;case"persian":return new mO;case"roc":return new pO;case"gregory":default:return new ar}}let $h=new Map;class Xl{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),i=this.formatter.formatToParts(n);return[...r.map(a=>({...a,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(a=>({...a,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return $O()&&(this.resolvedHourCycle||(this.resolvedHourCycle=kO(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=rE(t,n),this.options=n}}const RO={true:{ja:"h11"},false:{}};function rE(e,t={}){if(typeof t.hour12=="boolean"&&BO()){t={...t};let i=RO[String(t.hour12)][e.split("-")[0]],a=t.hour12?"h12":"h23";t.hourCycle=i??a,delete t.hour12}let n=e+(t?Object.entries(t).sort((i,a)=>i[0]<a[0]?-1:1).join():"");if($h.has(n))return $h.get(n);let r=new Intl.DateTimeFormat(e,t);return $h.set(n,r),r}let kh=null;function BO(){return kh==null&&(kh=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),kh}let Ph=null;function $O(){return Ph==null&&(Ph=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ph}function kO(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=rE(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(a=>a.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(a=>a.type==="hour").value,10);if(r===0&&i===23)return"h23";if(r===24&&i===23)return"h24";if(r===0&&i===11)return"h11";if(r===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}const _o=typeof document<"u"?I.useLayoutEffect:()=>{};function Bi(e){const t=I.useRef(null);return _o(()=>{t.current=e},[e]),I.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}function PO(e){let[t,n]=I.useState(e),r=I.useRef(null),i=Bi(()=>{if(!r.current)return;let o=r.current.next();if(o.done){r.current=null;return}t===o.value?i():n(o.value)});_o(()=>{r.current&&i()});let a=Bi(o=>{r.current=o(t),i()});return[t,a]}const Nd={prefix:String(Math.round(Math.random()*1e10)),current:0},iE=I.createContext(Nd),FO=I.createContext(!1);let NO=!!(typeof window<"u"&&window.document&&window.document.createElement),Fh=new WeakMap;function MO(e=!1){let t=I.useContext(iE),n=I.useRef(null);if(n.current===null&&!e){var r,i;let a=(i=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(a){let o=Fh.get(a);o==null?Fh.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==o.state&&(t.current=o.id,Fh.delete(a))}n.current=++t.current}return n.current}function LO(e){let t=I.useContext(iE);t===Nd&&!NO&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=MO(!!e),r=t===Nd&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${n}`}function OO(e){let t=I.useId(),[n]=I.useState(aE()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Nd.prefix}`;return e||`${r}-${t}`}const VO=typeof I.useId=="function"?OO:LO;function HO(){return!1}function jO(){return!0}function WO(e){return()=>{}}function aE(){return typeof I.useSyncExternalStore=="function"?I.useSyncExternalStore(WO,HO,jO):I.useContext(FO)}let zO=!!(typeof window<"u"&&window.document&&window.document.createElement),Md=new Map;function Cs(e){let[t,n]=I.useState(e),r=I.useRef(null),i=VO(t),a=I.useCallback(o=>{r.current=o},[]);return zO&&Md.set(i,a),_o(()=>{let o=i;return()=>{Md.delete(o)}},[i]),I.useEffect(()=>{let o=r.current;o&&(r.current=null,n(o))}),i}function GO(e,t){if(e===t)return e;let n=Md.get(e);if(n)return n(t),t;let r=Md.get(t);return r?(r(e),e):t}function Sg(e=[]){let t=Cs(),[n,r]=PO(t),i=I.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return _o(i,[t,i,...e]),n}function oE(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const yn=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Br=e=>e&&"window"in e&&e.window===e?e:yn(e).defaultView||window;function Gn(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let i in r){let a=t[i],o=r[i];typeof a=="function"&&typeof o=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=oE(a,o):(i==="className"||i==="UNSAFE_className")&&typeof a=="string"&&typeof o=="string"?t[i]=Pi(a,o):i==="id"&&a&&o?t.id=GO(a,o):t[i]=o!==void 0?o:a}}return t}const UO=new Set(["id"]),XO=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),ZO=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),YO=/^(data-.*)$/;function Dm(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,a={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(UO.has(o)||n&&XO.has(o)||r&&ZO.has(o)||i!=null&&i.has(o)||YO.test(o))&&(a[o]=e[o]);return a}function da(e){if(KO())e.focus({preventScroll:!0});else{let t=JO(e);e.focus(),qO(t)}}let tc=null;function KO(){if(tc==null){tc=!1;try{document.createElement("div").focus({get preventScroll(){return tc=!0,!0}})}catch{}}return tc}function JO(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function qO(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function Ff(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Am(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Zl(){return Am(/^Mac/i)}function QO(){return Am(/^iPhone/i)}function sE(){return Am(/^iPad/i)||Zl()&&navigator.maxTouchPoints>1}function lE(){return QO()||sE()}function eV(){return Ff(/AppleWebKit/i)&&!tV()}function tV(){return Ff(/Chrome/i)}function uE(){return Ff(/Android/i)}function nV(){return Ff(/Firefox/i)}function Yl(e,t,n=!0){var r,i;let{metaKey:a,ctrlKey:o,altKey:s,shiftKey:l}=t;nV()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Zl()?a=!0:o=!0);let u=eV()&&Zl()&&!sE()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:a,ctrlKey:o,altKey:s,shiftKey:l}):new MouseEvent("click",{metaKey:a,ctrlKey:o,altKey:s,shiftKey:l,bubbles:!0,cancelable:!0});Yl.isOpening=n,da(e),e.dispatchEvent(u),Yl.isOpening=!1}Yl.isOpening=!1;let Xo=new Map,wg=new Set;function Lv(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=Xo.get(r.target);i||(i=new Set,Xo.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=Xo.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),Xo.delete(r.target)),Xo.size===0)){for(let a of wg)a();wg.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Lv():document.addEventListener("DOMContentLoaded",Lv));function cE(e){requestAnimationFrame(()=>{Xo.size===0?e():wg.add(e)})}function rV(){let e=I.useRef(new Map),t=I.useCallback((i,a,o,s)=>{let l=s!=null&&s.once?(...u)=>{e.current.delete(o),o(...u)}:o;e.current.set(o,{type:a,eventTarget:i,fn:l,options:s}),i.addEventListener(a,o,s)},[]),n=I.useCallback((i,a,o,s)=>{var l;let u=((l=e.current.get(o))===null||l===void 0?void 0:l.fn)||o;i.removeEventListener(a,u,s),e.current.delete(o)},[]),r=I.useCallback(()=>{e.current.forEach((i,a)=>{n(i.eventTarget,i.type,a,i.options)})},[n]);return I.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Tm(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=Cs(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function Ov(e,t){const n=I.useRef(!0),r=I.useRef(null);I.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),I.useEffect(()=>{n.current?n.current=!1:(!r.current||t.some((i,a)=>!Object.is(i,r[a])))&&e(),r.current=t},t)}function dE(e,t){_o(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ig(e,t){let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function iV(e,t){let n=e;for(Ig(n,t)&&(n=n.parentElement);n&&!Ig(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function aV(e,t){const n=[];for(;e&&e!==document.documentElement;)Ig(e,t)&&n.push(e),e=e.parentElement;return n}let oV=0;const Nh=new Map;function fE(e){let[t,n]=I.useState();return _o(()=>{if(!e)return;let r=Nh.get(e);if(r)n(r.element.id);else{let i=`react-aria-description-${oV++}`;n(i);let a=document.createElement("div");a.id=i,a.style.display="none",a.textContent=e,document.body.appendChild(a),r={refCount:0,element:a},Nh.set(e,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),Nh.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function Mh(e,t,n,r){let i=Bi(n),a=n==null;I.useEffect(()=>{if(a||!e.current)return;let o=e.current;return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[e,t,r,a,i])}function sV(e,t){let n=Vv(e,t,"left"),r=Vv(e,t,"top"),i=t.offsetWidth,a=t.offsetHeight,o=e.scrollLeft,s=e.scrollTop,{borderTopWidth:l,borderLeftWidth:u}=getComputedStyle(e),c=e.scrollLeft+parseInt(u,10),d=e.scrollTop+parseInt(l,10),h=c+e.clientWidth,f=d+e.clientHeight;n<=o?o=n-parseInt(u,10):n+i>h&&(o+=n+i-h),r<=d?s=r-parseInt(l,10):r+a>f&&(s+=r+a-f),e.scrollLeft=o,e.scrollTop=s}function Vv(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function lV(e,t){if(document.contains(e)){let o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let l=aV(e);for(let u of l)sV(u,e)}else{var n;let{left:l,top:u}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:c,top:d}=e.getBoundingClientRect();if(Math.abs(l-c)>1||Math.abs(u-d)>1){var r,i,a;t==null||(i=t.containingElement)===null||i===void 0||(r=i.scrollIntoView)===null||r===void 0||r.call(i,{block:"center",inline:"center"}),(a=e.scrollIntoView)===null||a===void 0||a.call(e,{block:"nearest"})}}}}function _g(e){return e.mozInputSource===0&&e.isTrusted?!0:uE()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function uV(e){return!uE()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function hE(e,t){let n=I.useRef(null);return e&&n.current&&t(e,n.current)&&(e=n.current),n.current=e,e}function Kl(e,t,n){let[r,i]=I.useState(e||t),a=I.useRef(e!==void 0),o=e!==void 0;I.useEffect(()=>{let u=a.current;u!==o&&console.warn(`WARN: A component changed from ${u?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}.`),a.current=o},[o]);let s=o?e:r,l=I.useCallback((u,...c)=>{let d=(h,...f)=>{n&&(Object.is(s,h)||n(h,...f)),o||(s=h)};typeof u=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),i((f,...g)=>{let p=u(o?s:f,...g);return d(p,...c),o?f:p})):(o||i(u),d(u,...c))},[o,s,n]);return[s,l]}let qo="default",Dg="",Wc=new WeakMap;function Hv(e){if(lE()){if(qo==="default"){const t=yn(e);Dg=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}qo="disabled"}else(e instanceof HTMLElement||e instanceof SVGElement)&&(Wc.set(e,e.style.userSelect),e.style.userSelect="none")}function nc(e){if(lE()){if(qo!=="disabled")return;qo="restoring",setTimeout(()=>{cE(()=>{if(qo==="restoring"){const t=yn(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Dg||""),Dg="",qo="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Wc.has(e)){let t=Wc.get(e);e.style.userSelect==="none"&&(e.style.userSelect=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Wc.delete(e)}}const gE=I.createContext({register:()=>{}});gE.displayName="PressResponderContext";function cV(e,t){return t.get?t.get.call(e):t.value}function pE(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function dV(e,t){var n=pE(e,t,"get");return cV(e,n)}function fV(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function jv(e,t,n){var r=pE(e,t,"set");return fV(e,r,n),n}function hV(e){let t=I.useContext(gE);if(t){let{register:n,...r}=t;e=Gn(r,e),n()}return dE(t,e.ref),e}var rc=new WeakMap;class ic{continuePropagation(){jv(this,rc,!1)}get shouldStopPropagation(){return dV(this,rc)}constructor(t,n,r){Iu(this,rc,{writable:!0,value:void 0}),jv(this,rc,!0),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey}}const Wv=Symbol("linkClicked");function Rm(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,isDisabled:o,isPressed:s,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:d,...h}=hV(e),[f,g]=I.useState(!1),p=I.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:m,removeAllGlobalListeners:b}=rV(),v=Bi((y,S)=>{let D=p.current;if(o||D.didFirePressStart)return!1;let A=!0;if(D.isTriggeringEvent=!0,r){let T=new ic("pressstart",S,y);r(T),A=T.shouldStopPropagation}return n&&n(!0),D.isTriggeringEvent=!1,D.didFirePressStart=!0,g(!0),A}),x=Bi((y,S,D=!0)=>{let A=p.current;if(!A.didFirePressStart)return!1;A.ignoreClickAfterPress=!0,A.didFirePressStart=!1,A.isTriggeringEvent=!0;let T=!0;if(i){let F=new ic("pressend",S,y);i(F),T=F.shouldStopPropagation}if(n&&n(!1),g(!1),t&&D&&!o){let F=new ic("press",S,y);t(F),T&&(T=F.shouldStopPropagation)}return A.isTriggeringEvent=!1,T}),C=Bi((y,S)=>{let D=p.current;if(o)return!1;if(a){D.isTriggeringEvent=!0;let A=new ic("pressup",S,y);return a(A),D.isTriggeringEvent=!1,A.shouldStopPropagation}return!0}),E=Bi(y=>{let S=p.current;S.isPressed&&S.target&&(S.isOverTarget&&S.pointerType!=null&&x(yi(S.target,y),S.pointerType,!1),S.isPressed=!1,S.isOverTarget=!1,S.activePointerId=null,S.pointerType=null,b(),c||nc(S.target))}),w=Bi(y=>{u&&E(y)}),B=I.useMemo(()=>{let y=p.current,S={onKeyDown(A){if(Lh(A.nativeEvent,A.currentTarget)&&A.currentTarget.contains(A.target)){var T;Gv(A.target,A.key)&&A.preventDefault();let F=!0;if(!y.isPressed&&!A.repeat){y.target=A.currentTarget,y.isPressed=!0,F=v(A,"keyboard");let k=A.currentTarget,P=$=>{Lh($,k)&&!$.repeat&&k.contains($.target)&&y.target&&C(yi(y.target,$),"keyboard")};m(yn(A.currentTarget),"keyup",oE(P,D),!0)}F&&A.stopPropagation(),A.metaKey&&Zl()&&((T=y.metaKeyEvents)===null||T===void 0||T.set(A.key,A.nativeEvent))}else A.key==="Meta"&&(y.metaKeyEvents=new Map)},onClick(A){if(!(A&&!A.currentTarget.contains(A.target))&&A&&A.button===0&&!y.isTriggeringEvent&&!Yl.isOpening){let T=!0;if(o&&A.preventDefault(),!y.ignoreClickAfterPress&&!y.ignoreEmulatedMouseEvents&&!y.isPressed&&(y.pointerType==="virtual"||_g(A.nativeEvent))){!o&&!l&&da(A.currentTarget);let F=v(A,"virtual"),k=C(A,"virtual"),P=x(A,"virtual");T=F&&k&&P}y.ignoreEmulatedMouseEvents=!1,y.ignoreClickAfterPress=!1,T&&A.stopPropagation()}}},D=A=>{var T;if(y.isPressed&&y.target&&Lh(A,y.target)){var F;Gv(A.target,A.key)&&A.preventDefault();let P=A.target;x(yi(y.target,A),"keyboard",y.target.contains(P)),b(),A.key!=="Enter"&&Bm(y.target)&&y.target.contains(P)&&!A[Wv]&&(A[Wv]=!0,Yl(y.target,A,!1)),y.isPressed=!1,(F=y.metaKeyEvents)===null||F===void 0||F.delete(A.key)}else if(A.key==="Meta"&&(!((T=y.metaKeyEvents)===null||T===void 0)&&T.size)){var k;let P=y.metaKeyEvents;y.metaKeyEvents=void 0;for(let $ of P.values())(k=y.target)===null||k===void 0||k.dispatchEvent(new KeyboardEvent("keyup",$))}};if(typeof PointerEvent<"u"){S.onPointerDown=k=>{if(k.button!==0||!k.currentTarget.contains(k.target))return;if(uV(k.nativeEvent)){y.pointerType="virtual";return}Oh(k.currentTarget)&&k.preventDefault(),y.pointerType=k.pointerType;let P=!0;y.isPressed||(y.isPressed=!0,y.isOverTarget=!0,y.activePointerId=k.pointerId,y.target=k.currentTarget,!o&&!l&&da(k.currentTarget),c||Hv(y.target),P=v(k,y.pointerType),m(yn(k.currentTarget),"pointermove",A,!1),m(yn(k.currentTarget),"pointerup",T,!1),m(yn(k.currentTarget),"pointercancel",F,!1)),P&&k.stopPropagation()},S.onMouseDown=k=>{k.currentTarget.contains(k.target)&&k.button===0&&(Oh(k.currentTarget)&&k.preventDefault(),k.stopPropagation())},S.onPointerUp=k=>{!k.currentTarget.contains(k.target)||y.pointerType==="virtual"||k.button===0&&Lo(k,k.currentTarget)&&C(k,y.pointerType||k.pointerType)};let A=k=>{k.pointerId===y.activePointerId&&(y.target&&Lo(k,y.target)?!y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!0,v(yi(y.target,k),y.pointerType)):y.target&&y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!1,x(yi(y.target,k),y.pointerType,!1),w(k)))},T=k=>{k.pointerId===y.activePointerId&&y.isPressed&&k.button===0&&y.target&&(Lo(k,y.target)&&y.pointerType!=null?x(yi(y.target,k),y.pointerType):y.isOverTarget&&y.pointerType!=null&&x(yi(y.target,k),y.pointerType,!1),y.isPressed=!1,y.isOverTarget=!1,y.activePointerId=null,y.pointerType=null,b(),c||nc(y.target))},F=k=>{E(k)};S.onDragStart=k=>{k.currentTarget.contains(k.target)&&E(k)}}else{S.onMouseDown=F=>{if(F.button!==0||!F.currentTarget.contains(F.target))return;if(Oh(F.currentTarget)&&F.preventDefault(),y.ignoreEmulatedMouseEvents){F.stopPropagation();return}y.isPressed=!0,y.isOverTarget=!0,y.target=F.currentTarget,y.pointerType=_g(F.nativeEvent)?"virtual":"mouse",!o&&!l&&da(F.currentTarget),v(F,y.pointerType)&&F.stopPropagation(),m(yn(F.currentTarget),"mouseup",A,!1)},S.onMouseEnter=F=>{if(!F.currentTarget.contains(F.target))return;let k=!0;y.isPressed&&!y.ignoreEmulatedMouseEvents&&y.pointerType!=null&&(y.isOverTarget=!0,k=v(F,y.pointerType)),k&&F.stopPropagation()},S.onMouseLeave=F=>{if(!F.currentTarget.contains(F.target))return;let k=!0;y.isPressed&&!y.ignoreEmulatedMouseEvents&&y.pointerType!=null&&(y.isOverTarget=!1,k=x(F,y.pointerType,!1),w(F)),k&&F.stopPropagation()},S.onMouseUp=F=>{F.currentTarget.contains(F.target)&&!y.ignoreEmulatedMouseEvents&&F.button===0&&C(F,y.pointerType||"mouse")};let A=F=>{if(F.button===0){if(y.isPressed=!1,b(),y.ignoreEmulatedMouseEvents){y.ignoreEmulatedMouseEvents=!1;return}y.target&&Lo(F,y.target)&&y.pointerType!=null?x(yi(y.target,F),y.pointerType):y.target&&y.isOverTarget&&y.pointerType!=null&&x(yi(y.target,F),y.pointerType,!1),y.isOverTarget=!1}};S.onTouchStart=F=>{if(!F.currentTarget.contains(F.target))return;let k=gV(F.nativeEvent);if(!k)return;y.activePointerId=k.identifier,y.ignoreEmulatedMouseEvents=!0,y.isOverTarget=!0,y.isPressed=!0,y.target=F.currentTarget,y.pointerType="touch",!o&&!l&&da(F.currentTarget),c||Hv(y.target),v(F,y.pointerType)&&F.stopPropagation(),m(Br(F.currentTarget),"scroll",T,!0)},S.onTouchMove=F=>{if(!F.currentTarget.contains(F.target))return;if(!y.isPressed){F.stopPropagation();return}let k=zv(F.nativeEvent,y.activePointerId),P=!0;k&&Lo(k,F.currentTarget)?!y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!0,P=v(F,y.pointerType)):y.isOverTarget&&y.pointerType!=null&&(y.isOverTarget=!1,P=x(F,y.pointerType,!1),w(F)),P&&F.stopPropagation()},S.onTouchEnd=F=>{if(!F.currentTarget.contains(F.target))return;if(!y.isPressed){F.stopPropagation();return}let k=zv(F.nativeEvent,y.activePointerId),P=!0;k&&Lo(k,F.currentTarget)&&y.pointerType!=null?(C(F,y.pointerType),P=x(F,y.pointerType)):y.isOverTarget&&y.pointerType!=null&&(P=x(F,y.pointerType,!1)),P&&F.stopPropagation(),y.isPressed=!1,y.activePointerId=null,y.isOverTarget=!1,y.ignoreEmulatedMouseEvents=!0,y.target&&!c&&nc(y.target),b()},S.onTouchCancel=F=>{F.currentTarget.contains(F.target)&&(F.stopPropagation(),y.isPressed&&E(F))};let T=F=>{y.isPressed&&F.target.contains(y.target)&&E({currentTarget:y.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};S.onDragStart=F=>{F.currentTarget.contains(F.target)&&E(F)}}return S},[m,o,l,b,c,E,w,x,v,C]);return I.useEffect(()=>()=>{var y;c||nc((y=p.current.target)!==null&&y!==void 0?y:void 0)},[c]),{isPressed:s||f,pressProps:Gn(h,B)}}function Bm(e){return e.tagName==="A"&&e.hasAttribute("href")}function Lh(e,t){const{key:n,code:r}=e,i=t,a=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof Br(i).HTMLInputElement&&!mE(i,n)||i instanceof Br(i).HTMLTextAreaElement||i.isContentEditable)&&!((a==="link"||!a&&Bm(i))&&n!=="Enter")}function gV(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function zv(e,t){const n=e.changedTouches;for(let r=0;r<n.length;r++){const i=n[r];if(i.identifier===t)return i}return null}function yi(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function pV(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function mV(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Lo(e,t){let n=t.getBoundingClientRect(),r=pV(e);return mV(n,r)}function Oh(e){return!(e instanceof HTMLElement)||!e.hasAttribute("draggable")}function Gv(e,t){return e instanceof HTMLInputElement?!mE(e,t):e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Bm(e)}const bV=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function mE(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":bV.has(e.type)}class vV{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function bE(e){let t=I.useRef({isFocused:!1,observer:null});_o(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Bi(r=>{e==null||e(r)});return I.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,a=o=>{t.current.isFocused=!1,i.disabled&&n(new vV("blur",o)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var o;(o=t.current.observer)===null||o===void 0||o.disconnect();let s=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function vE(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const a=I.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),o=bE(a),s=I.useCallback(l=>{const u=yn(l.target);l.target===l.currentTarget&&u.activeElement===l.target&&(n&&n(l),i&&i(!0),o(l))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}let Fs=null,Ag=new Set,yl=new Map,vo=!1,Tg=!1;const yV={Tab:!0,Escape:!0};function $m(e,t){for(let n of Ag)n(e,t)}function xV(e){return!(e.metaKey||!Zl()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Ld(e){vo=!0,xV(e)&&(Fs="keyboard",$m("keyboard",e))}function pr(e){Fs="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(vo=!0,$m("pointer",e))}function yE(e){_g(e)&&(vo=!0,Fs="virtual")}function xE(e){e.target===window||e.target===document||(!vo&&!Tg&&(Fs="virtual",$m("virtual",e)),vo=!1,Tg=!1)}function CE(){vo=!1,Tg=!0}function Rg(e){if(typeof window>"u"||yl.get(Br(e)))return;const t=Br(e),n=yn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){vo=!0,r.apply(this,arguments)},n.addEventListener("keydown",Ld,!0),n.addEventListener("keyup",Ld,!0),n.addEventListener("click",yE,!0),t.addEventListener("focus",xE,!0),t.addEventListener("blur",CE,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",pr,!0),n.addEventListener("pointermove",pr,!0),n.addEventListener("pointerup",pr,!0)):(n.addEventListener("mousedown",pr,!0),n.addEventListener("mousemove",pr,!0),n.addEventListener("mouseup",pr,!0)),t.addEventListener("beforeunload",()=>{EE(e)},{once:!0}),yl.set(t,{focus:r})}const EE=(e,t)=>{const n=Br(e),r=yn(e);t&&r.removeEventListener("DOMContentLoaded",t),yl.has(n)&&(n.HTMLElement.prototype.focus=yl.get(n).focus,r.removeEventListener("keydown",Ld,!0),r.removeEventListener("keyup",Ld,!0),r.removeEventListener("click",yE,!0),n.removeEventListener("focus",xE,!0),n.removeEventListener("blur",CE,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",pr,!0),r.removeEventListener("pointermove",pr,!0),r.removeEventListener("pointerup",pr,!0)):(r.removeEventListener("mousedown",pr,!0),r.removeEventListener("mousemove",pr,!0),r.removeEventListener("mouseup",pr,!0)),yl.delete(n))};function CV(e){const t=yn(e);let n;return t.readyState!=="loading"?Rg(e):(n=()=>{Rg(e)},t.addEventListener("DOMContentLoaded",n)),()=>EE(e,n)}typeof document<"u"&&CV();function SE(){return Fs!=="pointer"}function wE(){return Fs}const EV=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function SV(e,t,n){var r;const i=typeof window<"u"?Br(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?Br(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Br(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?Br(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof i&&!EV.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof a||(n==null?void 0:n.target)instanceof o&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof s&&!yV[n.key])}function wV(e,t,n){Rg(),I.useEffect(()=>{let r=(i,a)=>{SV(!!(n!=null&&n.isTextInput),i,a)&&e(SE())};return Ag.add(r),()=>{Ag.delete(r)}},t)}function IE(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=I.useRef({isFocusWithin:!1}),o=I.useCallback(u=>{a.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(a.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,a]),s=bE(o),l=I.useCallback(u=>{!a.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),i&&i(!0),a.current.isFocusWithin=!0,s(u))},[r,i,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:o}}}function Uv(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}};e(r),t&&n.stopPropagation()}}function IV(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Uv(e.onKeyDown),onKeyUp:Uv(e.onKeyUp)}}}function _E(e){const t=yn(e);if(wE()==="virtual"){let n=t.activeElement;cE(()=>{t.activeElement===n&&e.isConnected&&da(e)})}else da(e)}function _V(e){const t=Br(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:a}=e.ownerDocument.defaultView;let{display:o,visibility:s}=a(e);i=o!=="none"&&s!=="hidden"&&s!=="collapse"}return i}function DV(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function DE(e,t){return e.nodeName!=="#comment"&&_V(e)&&DV(e,t)&&(!e.parentElement||DE(e.parentElement,e))}const km=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],AV=km.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";km.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const TV=km.join(':not([hidden]):not([tabindex="-1"]),');function AE(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function js(e,t=!1){if(e!=null&&!t)try{_E(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function rl(e,t,n){let r=t!=null&&t.tabbable?TV:AV,i=yn(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){var o;return!(t==null||(o=t.from)===null||o===void 0)&&o.contains(a)?NodeFilter.FILTER_REJECT:a.matches(r)&&DE(a)&&(!n||AE(a,n))&&(!(t!=null&&t.accept)||t.accept(a))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function TE(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,l=i||yn(r).activeElement,u=rl(r,{tabbable:a,accept:s});r.contains(l)&&(u.currentNode=l);let c=u.nextNode();return!c&&o&&(u.currentNode=r,c=u.nextNode()),c&&js(c,!0),c},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:i,tabbable:a=t.tabbable,wrap:o=t.wrap,accept:s=t.accept}=n,l=i||yn(r).activeElement,u=rl(r,{tabbable:a,accept:s});if(r.contains(l))u.currentNode=l;else{let d=Vh(u);return d&&js(d,!0),d??null}let c=u.previousNode();if(!c&&o){u.currentNode=r;let d=Vh(u);if(!d)return null;c=d}return c&&js(c,!0),c??null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,s=rl(r,{tabbable:i,accept:a}).nextNode();return s&&js(s,!0),s},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:i=t.tabbable,accept:a=t.accept}=n,o=rl(r,{tabbable:i,accept:a}),s=Vh(o);return s&&js(s,!0),s??null}}}function Vh(e){let t,n;do n=e.lastChild(),n&&(t=n);while(n);return t}class Pm{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let a=new Xv({scopeRef:t});i.addChild(a),a.parent=i,this.fastMap.set(t,a),r&&(a.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let a of this.traverse())a!==n&&n.nodeToRestore&&a.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&AE(a.nodeToRestore,n.scopeRef.current)&&(a.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(a=>r&&r.addChild(a))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new Pm;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new Xv({scopeRef:null}),this.fastMap.set(null,this.root)}}class Xv{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}new Pm;function RE(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=I.useRef({isFocused:!1,isFocusVisible:t||SE()}),[a,o]=I.useState(!1),[s,l]=I.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=I.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),c=I.useCallback(f=>{i.current.isFocused=f,o(f),u()},[u]);wV(f=>{i.current.isFocusVisible=f,u()},[],{isTextInput:n});let{focusProps:d}=vE({isDisabled:r,onFocusChange:c}),{focusWithinProps:h}=IE({isDisabled:!r,onFocusWithinChange:c});return{isFocused:a,isFocusVisible:s,focusProps:r?h:d}}let RV=I.createContext(null);function BV(e){let t=I.useContext(RV)||{};dE(t,e);let{ref:n,...r}=t;return r}function $V(e,t){let{focusProps:n}=vE(e),{keyboardProps:r}=IV(e),i=Gn(n,r),a=BV(t),o=e.isDisabled?{}:a,s=I.useRef(e.autoFocus);return I.useEffect(()=>{s.current&&t.current&&_E(t.current),s.current=!1},[t]),{focusableProps:Gn({...i,tabIndex:e.excludeFromTabOrder&&!e.isDisabled?-1:void 0},o)}}const kV=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),PV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function BE(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return kV.has(n.script)}let t=e.split("-")[0];return PV.has(t)}const FV=Symbol.for("react-aria.i18n.locale");function $E(){let e=typeof window<"u"&&window[FV]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:BE(e)?"rtl":"ltr"}}let Bg=$E(),il=new Set;function Zv(){Bg=$E();for(let e of il)e(Bg)}function kE(){let e=aE(),[t,n]=I.useState(Bg);return I.useEffect(()=>(il.size===0&&window.addEventListener("languagechange",Zv),il.add(n),()=>{il.delete(n),il.size===0&&window.removeEventListener("languagechange",Zv)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const PE=I.createContext(null);function Fm(e){let{locale:t,children:n}=e,r=kE(),i=I.useMemo(()=>t?{locale:t,direction:BE(t)?"rtl":"ltr"}:r,[r,t]);return I.createElement(PE.Provider,{value:i},n)}function Mr(){let e=kE();return I.useContext(PE)||e}const NV=Symbol.for("react-aria.i18n.locale"),MV=Symbol.for("react-aria.i18n.strings");let Oo;class Do{getStringForLocale(t,n){let i=this.getStringsForLocale(n)[t];if(!i)throw new Error(`Could not find intl message ${t} in ${n} locale`);return i}getStringsForLocale(t){let n=this.strings[t];return n||(n=LV(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[NV];if(Oo===void 0){let i=window[MV];if(!i)return null;Oo={};for(let a in i)Oo[a]=new Do({[n]:i[a]},n)}let r=Oo==null?void 0:Oo[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function LV(e,t,n="en-US"){if(t[e])return t[e];let r=OV(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}function OV(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const Yv=new Map,Kv=new Map;class FE{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let i=n["="+t];if(i)return typeof i=="function"?i():i;let a=this.locale+":"+r,o=Yv.get(a);o||(o=new Intl.PluralRules(this.locale,{type:r}),Yv.set(a,o));let s=o.select(t);return i=n[s]||n.other,typeof i=="function"?i():i}number(t){let n=Kv.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),Kv.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const Jv=new WeakMap;function VV(e){let t=Jv.get(e);return t||(t=new Do(e),Jv.set(e,t)),t}function HV(e,t){return t&&Do.getGlobalDictionaryForPackage(t)||VV(e)}function Du(e,t){let{locale:n}=Mr(),r=HV(e,t);return I.useMemo(()=>new FE(n,r),[n,r])}function _a(e){e=hE(e??{},jV);let{locale:t}=Mr();return I.useMemo(()=>new Xl(t,e),[t,e])}function jV(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(t[i]!==e[i])return!1;return!0}function WV(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:l,preventFocusOnPress:u,allowFocusWhenDisabled:c,onClick:d,href:h,target:f,rel:g,type:p="button"}=e,m;n==="button"?m={type:p,disabled:r}:m={role:"button",tabIndex:r?void 0:0,href:n==="a"&&r?void 0:h,target:n==="a"?f:void 0,type:n==="input"?p:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?g:void 0};let{pressProps:b,isPressed:v}=Rm({onPressStart:a,onPressEnd:o,onPressChange:l,onPress:i,onPressUp:s,isDisabled:r,preventFocusOnPress:u,ref:t}),{focusableProps:x}=$V(e,t);c&&(x.tabIndex=r?-1:x.tabIndex);let C=Gn(x,b,Dm(e,{labelable:!0}));return{isPressed:v,buttonProps:Gn(m,C,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],onClick:E=>{d&&(d(E),console.warn("onClick is deprecated, please use onPress"))}})}}var NE={};NE={dateRange:e=>`${e.startDate} إلى ${e.endDate}`,dateSelected:e=>`${e.date} المحدد`,finishRangeSelectionPrompt:"انقر لإنهاء عملية تحديد نطاق التاريخ",maximumDate:"آخر تاريخ متاح",minimumDate:"أول تاريخ متاح",next:"التالي",previous:"السابق",selectedDateDescription:e=>`تاريخ محدد: ${e.date}`,selectedRangeDescription:e=>`المدى الزمني المحدد: ${e.dateRange}`,startRangeSelectionPrompt:"انقر لبدء عملية تحديد نطاق التاريخ",todayDate:e=>`اليوم، ${e.date}`,todayDateSelected:e=>`اليوم، ${e.date} محدد`};var ME={};ME={dateRange:e=>`${e.startDate} до ${e.endDate}`,dateSelected:e=>`Избрано е ${e.date}`,finishRangeSelectionPrompt:"Натиснете, за да довършите избора на времеви интервал",maximumDate:"Последна налична дата",minimumDate:"Първа налична дата",next:"Напред",previous:"Назад",selectedDateDescription:e=>`Избрана дата: ${e.date}`,selectedRangeDescription:e=>`Избран диапазон: ${e.dateRange}`,startRangeSelectionPrompt:"Натиснете, за да пристъпите към избора на времеви интервал",todayDate:e=>`Днес, ${e.date}`,todayDateSelected:e=>`Днес, ${e.date} са избрани`};var LE={};LE={dateRange:e=>`${e.startDate} až ${e.endDate}`,dateSelected:e=>`Vybráno ${e.date}`,finishRangeSelectionPrompt:"Kliknutím dokončíte výběr rozsahu dat",maximumDate:"Poslední dostupné datum",minimumDate:"První dostupné datum",next:"Další",previous:"Předchozí",selectedDateDescription:e=>`Vybrané datum: ${e.date}`,selectedRangeDescription:e=>`Vybrané období: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknutím zahájíte výběr rozsahu dat",todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybráno ${e.date}`};var OE={};OE={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klik for at fuldføre valg af datoområde",maximumDate:"Sidste ledige dato",minimumDate:"Første ledige dato",next:"Næste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:"Klik for at starte valg af datoområde",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var VE={};VE={dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgewählt`,finishRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beenden",maximumDate:"Letztes verfügbares Datum",minimumDate:"Erstes verfügbares Datum",next:"Weiter",previous:"Zurück",selectedDateDescription:e=>`Ausgewähltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgewählter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beginnen",todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgewählt`};var HE={};HE={dateRange:e=>`${e.startDate} έως ${e.endDate}`,dateSelected:e=>`Επιλέχθηκε ${e.date}`,finishRangeSelectionPrompt:"Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών",maximumDate:"Τελευταία διαθέσιμη ημερομηνία",minimumDate:"Πρώτη διαθέσιμη ημερομηνία",next:"Επόμενο",previous:"Προηγούμενο",selectedDateDescription:e=>`Επιλεγμένη ημερομηνία: ${e.date}`,selectedRangeDescription:e=>`Επιλεγμένο εύρος: ${e.dateRange}`,startRangeSelectionPrompt:"Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών",todayDate:e=>`Σήμερα, ${e.date}`,todayDateSelected:e=>`Σήμερα, επιλέχτηκε ${e.date}`};var jE={};jE={previous:"Previous",next:"Next",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:"Click to start selecting date range",finishRangeSelectionPrompt:"Click to finish selecting date range",minimumDate:"First available date",maximumDate:"Last available date",dateRange:e=>`${e.startDate} to ${e.endDate}`};var WE={};WE={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:"Haga clic para terminar de seleccionar rango de fechas",maximumDate:"Última fecha disponible",minimumDate:"Primera fecha disponible",next:"Siguiente",previous:"Anterior",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:"Haga clic para comenzar a seleccionar un rango de fechas",todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`};var zE={};zE={dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:"Klõpsake kuupäevavahemiku valimise lõpetamiseks",maximumDate:"Viimane saadaolev kuupäev",minimumDate:"Esimene saadaolev kuupäev",next:"Järgmine",previous:"Eelmine",selectedDateDescription:e=>`Valitud kuupäev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:"Klõpsake kuupäevavahemiku valimiseks",todayDate:e=>`Täna, ${e.date}`,todayDateSelected:e=>`Täna, ${e.date} valitud`};var GE={};GE={dateRange:e=>`${e.startDate} – ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:"Lopeta päivämääräalueen valinta napsauttamalla tätä.",maximumDate:"Viimeinen varattavissa oleva päivämäärä",minimumDate:"Ensimmäinen varattavissa oleva päivämäärä",next:"Seuraava",previous:"Edellinen",selectedDateDescription:e=>`Valittu päivämäärä: ${e.date}`,selectedRangeDescription:e=>`Valittu aikaväli: ${e.dateRange}`,startRangeSelectionPrompt:"Aloita päivämääräalueen valinta napsauttamalla tätä.",todayDate:e=>`Tänään, ${e.date}`,todayDateSelected:e=>`Tänään, ${e.date} valittu`};var UE={};UE={dateRange:e=>`${e.startDate} à ${e.endDate}`,dateSelected:e=>`${e.date} sélectionné`,finishRangeSelectionPrompt:"Cliquer pour finir de sélectionner la plage de dates",maximumDate:"Dernière date disponible",minimumDate:"Première date disponible",next:"Suivant",previous:"Précédent",selectedDateDescription:e=>`Date sélectionnée : ${e.date}`,selectedRangeDescription:e=>`Plage sélectionnée : ${e.dateRange}`,startRangeSelectionPrompt:"Cliquer pour commencer à sélectionner la plage de dates",todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd’hui, ${e.date} sélectionné`};var XE={};XE={dateRange:e=>`${e.startDate} עד ${e.endDate}`,dateSelected:e=>`${e.date} נבחר`,finishRangeSelectionPrompt:"חץ כדי לסיים את בחירת טווח התאריכים",maximumDate:"תאריך פנוי אחרון",minimumDate:"תאריך פנוי ראשון",next:"הבא",previous:"הקודם",selectedDateDescription:e=>`תאריך נבחר: ${e.date}`,selectedRangeDescription:e=>`טווח נבחר: ${e.dateRange}`,startRangeSelectionPrompt:"לחץ כדי להתחיל בבחירת טווח התאריכים",todayDate:e=>`היום, ${e.date}`,todayDateSelected:e=>`היום, ${e.date} נבחר`};var ZE={};ZE={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:"Kliknite da dovršite raspon odabranih datuma",maximumDate:"Posljednji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sljedeći",previous:"Prethodni",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete raspon odabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`};var YE={};YE={dateRange:e=>`${e.startDate}–${e.endDate}`,dateSelected:e=>`${e.date} kiválasztva`,finishRangeSelectionPrompt:"Kattintson a dátumtartomány kijelölésének befejezéséhez",maximumDate:"Utolsó elérhető dátum",minimumDate:"Az első elérhető dátum",next:"Következő",previous:"Előző",selectedDateDescription:e=>`Kijelölt dátum: ${e.date}`,selectedRangeDescription:e=>`Kijelölt tartomány: ${e.dateRange}`,startRangeSelectionPrompt:"Kattintson a dátumtartomány kijelölésének indításához",todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijelölve`};var KE={};KE={dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:"Fai clic per completare la selezione dell’intervallo di date",maximumDate:"Ultima data disponibile",minimumDate:"Prima data disponibile",next:"Successivo",previous:"Precedente",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:"Fai clic per selezionare l’intervallo di date",todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`};var JE={};JE={dateRange:e=>`${e.startDate} から ${e.endDate}`,dateSelected:e=>`${e.date} を選択`,finishRangeSelectionPrompt:"クリックして日付範囲の選択を終了",maximumDate:"最終利用可能日",minimumDate:"最初の利用可能日",next:"次へ",previous:"前へ",selectedDateDescription:e=>`選択した日付 : ${e.date}`,selectedRangeDescription:e=>`選択範囲 : ${e.dateRange}`,startRangeSelectionPrompt:"クリックして日付範囲の選択を開始",todayDate:e=>`本日、${e.date}`,todayDateSelected:e=>`本日、${e.date} を選択`};var qE={};qE={dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} 선택됨`,finishRangeSelectionPrompt:"날짜 범위 선택을 완료하려면 클릭하십시오.",maximumDate:"마지막으로 사용 가능한 일자",minimumDate:"처음으로 사용 가능한 일자",next:"다음",previous:"이전",selectedDateDescription:e=>`선택 일자: ${e.date}`,selectedRangeDescription:e=>`선택 범위: ${e.dateRange}`,startRangeSelectionPrompt:"날짜 범위 선택을 시작하려면 클릭하십시오.",todayDate:e=>`오늘, ${e.date}`,todayDateSelected:e=>`오늘, ${e.date} 선택됨`};var QE={};QE={dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:"Spustelėkite, kad baigtumėte pasirinkti datų intervalą",maximumDate:"Paskutinė galima data",minimumDate:"Pirmoji galima data",next:"Paskesnis",previous:"Ankstesnis",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:"Spustelėkite, kad pradėtumėte pasirinkti datų intervalą",todayDate:e=>`Šiandien, ${e.date}`,todayDateSelected:e=>`Šiandien, pasirinkta ${e.date}`};var eS={};eS={dateRange:e=>`No ${e.startDate} līdz ${e.endDate}`,dateSelected:e=>`Atlasīts: ${e.date}`,finishRangeSelectionPrompt:"Noklikšķiniet, lai pabeigtu datumu diapazona atlasi",maximumDate:"Pēdējais pieejamais datums",minimumDate:"Pirmais pieejamais datums",next:"Tālāk",previous:"Atpakaļ",selectedDateDescription:e=>`Atlasītais datums: ${e.date}`,selectedRangeDescription:e=>`Atlasītais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:"Noklikšķiniet, lai sāktu datumu diapazona atlasi",todayDate:e=>`Šodien, ${e.date}`,todayDateSelected:e=>`Atlasīta šodiena, ${e.date}`};var tS={};tS={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klikk for å fullføre valg av datoområde",maximumDate:"Siste tilgjengelige dato",minimumDate:"Første tilgjengelige dato",next:"Neste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt område: ${e.dateRange}`,startRangeSelectionPrompt:"Klikk for å starte valg av datoområde",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var nS={};nS={dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:"Klik om de selectie van het datumbereik te voltooien",maximumDate:"Laatste beschikbare datum",minimumDate:"Eerste beschikbare datum",next:"Volgende",previous:"Vorige",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:"Klik om het datumbereik te selecteren",todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`};var rS={};rS={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:"Kliknij, aby zakończyć wybór zakresu dat",maximumDate:"Ostatnia dostępna data",minimumDate:"Pierwsza dostępna data",next:"Dalej",previous:"Wstecz",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknij, aby rozpocząć wybór zakresu dat",todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`};var iS={};iS={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para concluir a seleção do intervalo de datas",maximumDate:"Última data disponível",minimumDate:"Primeira data disponível",next:"Próximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para iniciar a seleção do intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var aS={};aS={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para terminar de selecionar o intervalo de datas",maximumDate:"Última data disponível",minimumDate:"Primeira data disponível",next:"Próximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para começar a selecionar o intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var oS={};oS={dateRange:e=>`De la ${e.startDate} până la ${e.endDate}`,dateSelected:e=>`${e.date} selectată`,finishRangeSelectionPrompt:"Apăsaţi pentru a finaliza selecţia razei pentru dată",maximumDate:"Ultima dată disponibilă",minimumDate:"Prima dată disponibilă",next:"Următorul",previous:"Înainte",selectedDateDescription:e=>`Dată selectată: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:"Apăsaţi pentru a începe selecţia razei pentru dată",todayDate:e=>`Astăzi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectată`};var sS={};sS={dateRange:e=>`С ${e.startDate} по ${e.endDate}`,dateSelected:e=>`Выбрано ${e.date}`,finishRangeSelectionPrompt:"Щелкните, чтобы завершить выбор диапазона дат",maximumDate:"Последняя доступная дата",minimumDate:"Первая доступная дата",next:"Далее",previous:"Назад",selectedDateDescription:e=>`Выбранная дата: ${e.date}`,selectedRangeDescription:e=>`Выбранный диапазон: ${e.dateRange}`,startRangeSelectionPrompt:"Щелкните, чтобы начать выбор диапазона дат",todayDate:e=>`Сегодня, ${e.date}`,todayDateSelected:e=>`Сегодня, выбрано ${e.date}`};var lS={};lS={dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybratý dátum ${e.date}`,finishRangeSelectionPrompt:"Kliknutím dokončíte výber rozsahu dátumov",maximumDate:"Posledný dostupný dátum",minimumDate:"Prvý dostupný dátum",next:"Nasledujúce",previous:"Predchádzajúce",selectedDateDescription:e=>`Vybratý dátum: ${e.date}`,selectedRangeDescription:e=>`Vybratý rozsah: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknutím spustíte výber rozsahu dátumov",todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybratý dnešný dátum ${e.date}`};var uS={};uS={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:"Kliknite za dokončanje izbire datumskega obsega",maximumDate:"Zadnji razpoložljivi datum",minimumDate:"Prvi razpoložljivi datum",next:"Naprej",previous:"Nazaj",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano območje: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite za začetek izbire datumskega obsega",todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`};var cS={};cS={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:"Kliknite da dovršite opseg izabranih datuma",maximumDate:"Zadnji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sledeći",previous:"Prethodni",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete opseg izabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`};var dS={};dS={dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:"Klicka för att avsluta val av datumintervall",maximumDate:"Sista tillgängliga datum",minimumDate:"Första tillgängliga datum",next:"Nästa",previous:"Föregående",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:"Klicka för att välja datumintervall",todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`};var fS={};fS={dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} seçildi`,finishRangeSelectionPrompt:"Tarih aralığı seçimini tamamlamak için tıklayın",maximumDate:"Son müsait tarih",minimumDate:"İlk müsait tarih",next:"Sonraki",previous:"Önceki",selectedDateDescription:e=>`Seçilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Seçilen Aralık: ${e.dateRange}`,startRangeSelectionPrompt:"Tarih aralığı seçimini başlatmak için tıklayın",todayDate:e=>`Bugün, ${e.date}`,todayDateSelected:e=>`Bugün, ${e.date} seçildi`};var hS={};hS={dateRange:e=>`${e.startDate} — ${e.endDate}`,dateSelected:e=>`Вибрано ${e.date}`,finishRangeSelectionPrompt:"Натисніть, щоб завершити вибір діапазону дат",maximumDate:"Остання доступна дата",minimumDate:"Перша доступна дата",next:"Наступний",previous:"Попередній",selectedDateDescription:e=>`Вибрана дата: ${e.date}`,selectedRangeDescription:e=>`Вибраний діапазон: ${e.dateRange}`,startRangeSelectionPrompt:"Натисніть, щоб почати вибір діапазону дат",todayDate:e=>`Сьогодні, ${e.date}`,todayDateSelected:e=>`Сьогодні, вибрано ${e.date}`};var gS={};gS={dateRange:e=>`${e.startDate} 至 ${e.endDate}`,dateSelected:e=>`已选择 ${e.date}`,finishRangeSelectionPrompt:"单击以完成选择日期范围",maximumDate:"最后一个可用日期",minimumDate:"第一个可用日期",next:"下一页",previous:"上一页",selectedDateDescription:e=>`选定的日期:${e.date}`,selectedRangeDescription:e=>`选定的范围:${e.dateRange}`,startRangeSelectionPrompt:"单击以开始选择日期范围",todayDate:e=>`今天,即 ${e.date}`,todayDateSelected:e=>`已选择今天,即 ${e.date}`};var pS={};pS={dateRange:e=>`${e.startDate} 至 ${e.endDate}`,dateSelected:e=>`已選取 ${e.date}`,finishRangeSelectionPrompt:"按一下以完成選取日期範圍",maximumDate:"最後一個可用日期",minimumDate:"第一個可用日期",next:"下一頁",previous:"上一頁",selectedDateDescription:e=>`選定的日期:${e.date}`,selectedRangeDescription:e=>`選定的範圍:${e.dateRange}`,startRangeSelectionPrompt:"按一下以開始選取日期範圍",todayDate:e=>`今天,${e.date}`,todayDateSelected:e=>`已選取今天,${e.date}`};var Au={};Au={"ar-AE":NE,"bg-BG":ME,"cs-CZ":LE,"da-DK":OE,"de-DE":VE,"el-GR":HE,"en-US":jE,"es-ES":WE,"et-EE":zE,"fi-FI":GE,"fr-FR":UE,"he-IL":XE,"hr-HR":ZE,"hu-HU":YE,"it-IT":KE,"ja-JP":JE,"ko-KR":qE,"lt-LT":QE,"lv-LV":eS,"nb-NO":tS,"nl-NL":nS,"pl-PL":rS,"pt-BR":iS,"pt-PT":aS,"ro-RO":oS,"ru-RU":sS,"sk-SK":lS,"sl-SI":uS,"sr-SP":cS,"sv-SE":dS,"tr-TR":fS,"uk-UA":hS,"zh-CN":gS,"zh-TW":pS};function mS(e){return e&&e.__esModule?e.default:e}const Nm=new WeakMap;function Jl(e){return(e==null?void 0:e.calendar.identifier)==="gregory"&&e.era==="BC"?"short":void 0}function zV(e){let t=Du(mS(Au),"@react-aria/calendar"),n,r;"highlightedRange"in e?{start:n,end:r}=e.highlightedRange||{}:n=r=e.value;let i=_a({weekday:"long",month:"long",year:"numeric",day:"numeric",era:Jl(n)||Jl(r),timeZone:e.timeZone}),a="anchorDate"in e?e.anchorDate:null;return I.useMemo(()=>{if(!a&&n&&r)if(Gt(n,r)){let o=i.format(n.toDate(e.timeZone));return t.format("selectedDateDescription",{date:o})}else{let o=kg(i,t,n,r,e.timeZone);return t.format("selectedRangeDescription",{dateRange:o})}return""},[n,r,a,e.timeZone,t,i])}function $g(e,t,n,r){let i=Du(mS(Au),"@react-aria/calendar"),a=Jl(e)||Jl(t),o=_a({month:"long",year:"numeric",era:a,calendar:e.calendar.identifier,timeZone:n}),s=_a({month:"long",year:"numeric",day:"numeric",era:a,calendar:e.calendar.identifier,timeZone:n});return I.useMemo(()=>{if(Gt(e,wu(e))){if(Gt(t,mg(e)))return o.format(e.toDate(n));if(Gt(t,mg(t)))return r?kg(o,i,e,t,n):o.formatRange(e.toDate(n),t.toDate(n))}return r?kg(s,i,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,o,s,i,n,r])}function kg(e,t,n,r,i){let a=e.formatRangeToParts(n.toDate(i),r.toDate(i)),o=-1;for(let u=0;u<a.length;u++){let c=a[u];if(c.source==="shared"&&c.type==="literal")o=u;else if(c.source==="endRange")break}let s="",l="";for(let u=0;u<a.length;u++)u<o?s+=a[u].value:u>o&&(l+=a[u].value);return t.format("dateRange",{startDate:s,endDate:l})}const bS=7e3;let Hh=null;function qv(e,t="assertive",n=bS){Hh||(Hh=new GV),Hh.announce(e,t,n)}class GV{createLog(t){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",t),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,n="assertive",r=bS){if(!this.node)return;let i=document.createElement("div");i.textContent=t,n==="assertive"?this.assertiveLog.appendChild(i):this.politeLog.appendChild(i),t!==""&&setTimeout(()=>{i.remove()},r)}clear(t){this.node&&((!t||t==="assertive")&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&(this.politeLog.innerHTML=""))}constructor(){this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node)}}function UV(e){return e&&e.__esModule?e.default:e}function vS(e,t){let n=Du(UV(Au),"@react-aria/calendar"),r=Dm(e),i=$g(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),a=$g(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);Ov(()=>{t.isFocused||qv(a)},[a]);let o=zV(t);Ov(()=>{o&&qv(o,"polite",4e3)},[o]);let s=Sg([!!e.errorMessage,e.isInvalid,e.validationState]);Nm.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:s,selectedDateDescription:o});let[l,u]=I.useState(!1),c=e.isDisabled||t.isNextVisibleRangeInvalid();c&&l&&(u(!1),t.setFocused(!0));let[d,h]=I.useState(!1),f=e.isDisabled||t.isPreviousVisibleRangeInvalid();f&&d&&(h(!1),t.setFocused(!0));let g=Tm({id:e.id,"aria-label":[e["aria-label"],a].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]});return{calendarProps:Gn(r,g,{role:"application","aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":n.format("next"),isDisabled:c,onFocusChange:u},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":n.format("previous"),isDisabled:f,onFocusChange:h},errorMessageProps:{id:s},title:i}}function yS(e,t){return vS(e,t)}function XV(e,t,n){let r=vS(e,t),i=I.useRef(!1),a=I.useRef(typeof window<"u"?window:null);return Mh(a,"pointerdown",s=>{i.current=s.width===0&&s.height===0}),Mh(a,"pointerup",s=>{if(i.current){i.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let l=s.target;n.current&&n.current.contains(document.activeElement)&&(!n.current.contains(l)||!l.closest('button, [role="button"]'))&&t.selectFocusedDate()}),r.calendarProps.onBlur=s=>{n.current&&(!s.relatedTarget||!n.current.contains(s.relatedTarget))&&t.anchorDate&&t.selectFocusedDate()},Mh(n,"touchmove",s=>{t.isDragging&&s.preventDefault()},{passive:!1,capture:!0}),r}function xS(e,t){let{startDate:n=t.visibleRange.start,endDate:r=t.visibleRange.end}=e,{direction:i}=Mr(),a=f=>{switch(f.key){case"Enter":case" ":f.preventDefault(),t.selectFocusedDate();break;case"PageUp":f.preventDefault(),f.stopPropagation(),t.focusPreviousSection(f.shiftKey);break;case"PageDown":f.preventDefault(),f.stopPropagation(),t.focusNextSection(f.shiftKey);break;case"End":f.preventDefault(),f.stopPropagation(),t.focusSectionEnd();break;case"Home":f.preventDefault(),f.stopPropagation(),t.focusSectionStart();break;case"ArrowLeft":f.preventDefault(),f.stopPropagation(),i==="rtl"?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":f.preventDefault(),f.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":f.preventDefault(),f.stopPropagation(),i==="rtl"?t.focusPreviousDay():t.focusNextDay();break;case"ArrowDown":f.preventDefault(),f.stopPropagation(),t.focusNextRow();break;case"Escape":"setAnchorDate"in t&&(f.preventDefault(),t.setAnchorDate(null));break}},o=$g(n,r,t.timeZone,!0),{ariaLabel:s,ariaLabelledBy:l}=Nm.get(t),u=Tm({"aria-label":[s,o].filter(Boolean).join(", "),"aria-labelledby":l}),c=_a({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:d}=Mr(),h=I.useMemo(()=>{let f=zl(gm(t.timeZone),d);return[...new Array(7).keys()].map(g=>{let m=f.add({days:g}).toDate(t.timeZone);return c.format(m)})},[d,t.timeZone,c]);return{gridProps:Gn(u,{role:"grid","aria-readonly":t.isReadOnly||null,"aria-disabled":t.isDisabled||null,"aria-multiselectable":"highlightedRange"in t||void 0,onKeyDown:a,onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:h}}function ZV(e){return e&&e.__esModule?e.default:e}function YV(e,t,n){let{date:r,isDisabled:i}=e,{errorMessageId:a,selectedDateDescription:o}=Nm.get(t),s=Du(ZV(Au),"@react-aria/calendar"),l=_a({weekday:"long",day:"numeric",month:"long",year:"numeric",era:Jl(r),timeZone:t.timeZone}),u=t.isSelected(r),c=t.isCellFocused(r);i=i||t.isCellDisabled(r);let d=t.isCellUnavailable(r),h=!i&&!d,f=t.isValueInvalid&&("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&r.compare(t.highlightedRange.start)>=0&&r.compare(t.highlightedRange.end)<=0:t.value&&Gt(t.value,r));f&&(u=!0),r=hE(r,pg);let g=I.useMemo(()=>r.toDate(t.timeZone),[r,t.timeZone]),p=HL(r,t.timeZone),m=I.useMemo(()=>{let A="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(Gt(r,t.value.start)||Gt(r,t.value.end))&&(A=o+", "),A+=l.format(g),p?A=s.format(u?"todayDateSelected":"todayDate",{date:A}):u&&(A=s.format("dateSelected",{date:A})),t.minValue&&Gt(r,t.minValue)?A+=", "+s.format("minimumDate"):t.maxValue&&Gt(r,t.maxValue)&&(A+=", "+s.format("maximumDate")),A},[l,g,s,u,p,r,t,o]),b="";"anchorDate"in t&&c&&!t.isReadOnly&&h&&(t.anchorDate?b=s.format("finishRangeSelectionPrompt"):b=s.format("startRangeSelectionPrompt"));let v=fE(b),x=I.useRef(!1),C=I.useRef(!1),E=I.useRef(null),{pressProps:w,isPressed:B}=Rm({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!h||t.isReadOnly,onPressStart(A){if(t.isReadOnly){t.setFocusedDate(r);return}if("highlightedRange"in t&&!t.anchorDate&&(A.pointerType==="mouse"||A.pointerType==="touch")){if(t.highlightedRange&&!f){if(Gt(r,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(r),t.setDragging(!0),C.current=!0;return}else if(Gt(r,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(r),t.setDragging(!0),C.current=!0;return}}let T=()=>{t.setDragging(!0),E.current=null,t.selectDate(r),t.setFocusedDate(r),x.current=!0};A.pointerType==="touch"?E.current=setTimeout(T,200):T()}},onPressEnd(){C.current=!1,x.current=!1,clearTimeout(E.current),E.current=null},onPress(){!("anchorDate"in t)&&!t.isReadOnly&&(t.selectDate(r),t.setFocusedDate(r))},onPressUp(A){if(!t.isReadOnly&&("anchorDate"in t&&E.current&&(t.selectDate(r),t.setFocusedDate(r)),"anchorDate"in t))if(C.current)t.setAnchorDate(r);else if(t.anchorDate&&!x.current)t.selectDate(r),t.setFocusedDate(r);else if(A.pointerType==="keyboard"&&!t.anchorDate){t.selectDate(r);let T=r.add({days:1});t.isInvalid(T)&&(T=r.subtract({days:1})),t.isInvalid(T)||t.setFocusedDate(T)}else A.pointerType==="virtual"&&(t.selectDate(r),t.setFocusedDate(r))}}),y=null;i||(y=Gt(r,t.focusedDate)?0:-1),I.useEffect(()=>{c&&n.current&&(da(n.current),wE()!=="pointer"&&document.activeElement===n.current&&lV(n.current,{containingElement:iV(n.current)}))},[c,n]);let S=_a({day:"numeric",timeZone:t.timeZone,calendar:r.calendar.identifier}),D=I.useMemo(()=>S.formatToParts(g).find(A=>A.type==="day").value,[S,g]);return{cellProps:{role:"gridcell","aria-disabled":!h||null,"aria-selected":u||null,"aria-invalid":f||null},buttonProps:Gn(w,{onFocus(){i||t.setFocusedDate(r)},tabIndex:y,role:"button","aria-disabled":!h||null,"aria-label":m,"aria-invalid":f||null,"aria-describedby":[f?a:null,v["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(A){"highlightDate"in t&&(A.pointerType!=="touch"||t.isDragging)&&h&&t.highlightDate(r)},onPointerDown(A){"releasePointerCapture"in A.target&&A.target.releasePointerCapture(A.pointerId)},onContextMenu(A){A.preventDefault()}}),isPressed:B,isFocused:c,isSelected:u,isDisabled:i,isUnavailable:d,isOutsideVisibleRange:r.compare(t.visibleRange.start)<0||r.compare(t.visibleRange.end)>0,isInvalid:f,formattedDate:D}}const Nf={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},CS={...Nf,customError:!0,valid:!1},Ka={isInvalid:!1,validationDetails:Nf,validationErrors:[]},KV=I.createContext({}),Od="__formValidationState"+Date.now();function JV(e){if(e[Od]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Od];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return qV(e)}function qV(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s="aria"}=e;n&&(t||(t=n==="invalid"));let l=t!==void 0?{isInvalid:t,validationErrors:[],validationDetails:CS}:null,u=I.useMemo(()=>Qv(QV(o,i)),[o,i]);a!=null&&a.validationDetails.valid&&(a=null);let c=I.useContext(KV),d=I.useMemo(()=>r?Array.isArray(r)?r.flatMap(D=>Pg(c[D])):Pg(c[r]):[],[c,r]),[h,f]=I.useState(c),[g,p]=I.useState(!1);c!==h&&(f(c),p(!1));let m=I.useMemo(()=>Qv(g?[]:d),[g,d]),b=I.useRef(Ka),[v,x]=I.useState(Ka),C=I.useRef(Ka),E=()=>{if(!w)return;B(!1);let D=u||a||b.current;jh(D,C.current)||(C.current=D,x(D))},[w,B]=I.useState(!1);return I.useEffect(E),{realtimeValidation:l||m||u||a||Ka,displayValidation:s==="native"?l||m||v:l||m||u||a||v,updateValidation(D){s==="aria"&&!jh(v,D)?x(D):b.current=D},resetValidation(){let D=Ka;jh(D,C.current)||(C.current=D,x(D)),s==="native"&&B(!1),p(!0)},commitValidation(){s==="native"&&B(!0),p(!0)}}}function Pg(e){return e?Array.isArray(e)?e:[e]:[]}function QV(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return Pg(n)}return[]}function Qv(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:CS}:null}function jh(e,t){return e===t?!0:e&&t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function Vd(...e){let t=new Set,n=!1,r={...Nf};for(let o of e){var i,a;for(let s of o.validationErrors)t.add(s);n||(n=o.isInvalid);for(let s in r)(i=r)[a=s]||(i[a]=o.validationDetails[s])}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}function eH(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a="label"}=e;t=Cs(t);let o=Cs(),s={};n?(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a==="label"?t:void 0}):!r&&!i&&console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let l=Tm({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:l}}function tH(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=eH(e),s=Sg([!!t,!!n,r,i]),l=Sg([!!t,!!n,r,i]);return o=Gn(o,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:l}}}var ES={};ES={calendar:"التقويم",day:"يوم",dayPeriod:"ص/م",endDate:"تاريخ الانتهاء",era:"العصر",hour:"الساعات",minute:"الدقائق",month:"الشهر",second:"الثواني",selectedDateDescription:e=>`تاريخ محدد: ${e.date}`,selectedRangeDescription:e=>`المدى الزمني المحدد: ${e.startDate} إلى ${e.endDate}`,selectedTimeDescription:e=>`الوقت المحدد: ${e.time}`,startDate:"تاريخ البدء",timeZoneName:"التوقيت",weekday:"اليوم",year:"السنة"};var SS={};SS={calendar:"Календар",day:"ден",dayPeriod:"пр.об./сл.об.",endDate:"Крайна дата",era:"ера",hour:"час",minute:"минута",month:"месец",second:"секунда",selectedDateDescription:e=>`Избрана дата: ${e.date}`,selectedRangeDescription:e=>`Избран диапазон: ${e.startDate} до ${e.endDate}`,selectedTimeDescription:e=>`Избрано време: ${e.time}`,startDate:"Начална дата",timeZoneName:"часова зона",weekday:"ден от седмицата",year:"година"};var wS={};wS={calendar:"Kalendář",day:"den",dayPeriod:"část dne",endDate:"Konečné datum",era:"letopočet",hour:"hodina",minute:"minuta",month:"měsíc",second:"sekunda",selectedDateDescription:e=>`Vybrané datum: ${e.date}`,selectedRangeDescription:e=>`Vybrané období: ${e.startDate} až ${e.endDate}`,selectedTimeDescription:e=>`Vybraný čas: ${e.time}`,startDate:"Počáteční datum",timeZoneName:"časové pásmo",weekday:"den v týdnu",year:"rok"};var IS={};IS={calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"æra",hour:"time",minute:"minut",month:"måned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"år"};var _S={};_S={calendar:"Kalender",day:"Tag",dayPeriod:"Tageshälfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgewähltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgewählter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgewählte Zeit: ${e.time}`,startDate:"Anfangsdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"};var DS={};DS={calendar:"Ημερολόγιο",day:"ημέρα",dayPeriod:"π.μ./μ.μ.",endDate:"Ημερομηνία λήξης",era:"περίοδος",hour:"ώρα",minute:"λεπτό",month:"μήνας",second:"δευτερόλεπτο",selectedDateDescription:e=>`Επιλεγμένη ημερομηνία: ${e.date}`,selectedRangeDescription:e=>`Επιλεγμένο εύρος: ${e.startDate} έως ${e.endDate}`,selectedTimeDescription:e=>`Επιλεγμένη ώρα: ${e.time}`,startDate:"Ημερομηνία έναρξης",timeZoneName:"ζώνη ώρας",weekday:"καθημερινή",year:"έτος"};var AS={};AS={era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`};var TS={};TS={calendar:"Calendario",day:"día",dayPeriod:"a. m./p. m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"día de la semana",year:"año"};var RS={};RS={calendar:"Kalender",day:"päev",dayPeriod:"enne/pärast lõunat",endDate:"Lõppkuupäev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuupäev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuupäev",timeZoneName:"ajavöönd",weekday:"nädalapäev",year:"aasta"};var BS={};BS={calendar:"Kalenteri",day:"päivä",dayPeriod:"vuorokaudenaika",endDate:"Päättymispäivä",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu päivämäärä: ${e.date}`,selectedRangeDescription:e=>`Valittu aikaväli: ${e.startDate} – ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamispäivä",timeZoneName:"aikavyöhyke",weekday:"viikonpäivä",year:"vuosi"};var $S={};$S={calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"ère",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date sélectionnée : ${e.date}`,selectedRangeDescription:e=>`Plage sélectionnée : ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie : ${e.time}`,startDate:"Date de début",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"année"};var kS={};kS={calendar:"לוח שנה",day:"יום",dayPeriod:"לפנה״צ/אחה״צ",endDate:"תאריך סיום",era:"תקופה",hour:"שעה",minute:"דקה",month:"חודש",second:"שנייה",selectedDateDescription:e=>`תאריך נבחר: ${e.date}`,selectedRangeDescription:e=>`טווח נבחר: ${e.startDate} עד ${e.endDate}`,selectedTimeDescription:e=>`זמן נבחר: ${e.time}`,startDate:"תאריך התחלה",timeZoneName:"אזור זמן",weekday:"יום בשבוע",year:"שנה"};var PS={};PS={calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum završetka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum početka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"};var FS={};FS={calendar:"Naptár",day:"nap",dayPeriod:"napszak",endDate:"Befejező dátum",era:"éra",hour:"óra",minute:"perc",month:"hónap",second:"másodperc",selectedDateDescription:e=>`Kijelölt dátum: ${e.date}`,selectedRangeDescription:e=>`Kijelölt tartomány: ${e.startDate}–${e.endDate}`,selectedTimeDescription:e=>`Kijelölt idő: ${e.time}`,startDate:"Kezdő dátum",timeZoneName:"időzóna",weekday:"hét napja",year:"év"};var NS={};NS={calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"};var MS={};MS={calendar:"カレンダー",day:"日",dayPeriod:"午前/午後",endDate:"終了日",era:"時代",hour:"時",minute:"分",month:"月",second:"秒",selectedDateDescription:e=>`選択した日付 : ${e.date}`,selectedRangeDescription:e=>`選択範囲 : ${e.startDate} から ${e.endDate}`,selectedTimeDescription:e=>`選択した時間 : ${e.time}`,startDate:"開始日",timeZoneName:"タイムゾーン",weekday:"曜日",year:"年"};var LS={};LS={calendar:"달력",day:"일",dayPeriod:"오전/오후",endDate:"종료일",era:"연호",hour:"시",minute:"분",month:"월",second:"초",selectedDateDescription:e=>`선택 일자: ${e.date}`,selectedRangeDescription:e=>`선택 범위: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`선택 시간: ${e.time}`,startDate:"시작일",timeZoneName:"시간대",weekday:"요일",year:"년"};var OS={};OS={calendar:"Kalendorius",day:"diena",dayPeriod:"iki pietų / po pietų",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minutė",month:"mėnuo",second:"sekundė",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Pradžios data",timeZoneName:"laiko juosta",weekday:"savaitės diena",year:"metai"};var VS={};VS={calendar:"Kalendārs",day:"diena",dayPeriod:"priekšpusdienā/pēcpusdienā",endDate:"Beigu datums",era:"ēra",hour:"stundas",minute:"minūtes",month:"mēnesis",second:"sekundes",selectedDateDescription:e=>`Atlasītais datums: ${e.date}`,selectedRangeDescription:e=>`Atlasītais diapazons: no ${e.startDate} līdz ${e.endDate}`,selectedTimeDescription:e=>`Atlasītais laiks: ${e.time}`,startDate:"Sākuma datums",timeZoneName:"laika josla",weekday:"nedēļas diena",year:"gads"};var HS={};HS={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"måned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt område: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"år"};var jS={};jS={calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"};var WS={};WS={calendar:"Kalendarz",day:"dzień",dayPeriod:"rano / po południu / wieczorem",endDate:"Data końcowa",era:"era",hour:"godzina",minute:"minuta",month:"miesiąc",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data początkowa",timeZoneName:"strefa czasowa",weekday:"dzień tygodnia",year:"rok"};var zS={};zS={calendar:"Calendário",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"mês",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso horário",weekday:"dia da semana",year:"ano"};var GS={};GS={calendar:"Calendário",day:"dia",dayPeriod:"am/pm",endDate:"Data de Término",era:"era",hour:"hora",minute:"minuto",month:"mês",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de Início",timeZoneName:"fuso horário",weekday:"dia da semana",year:"ano"};var US={};US={calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dată final",era:"eră",hour:"oră",minute:"minut",month:"lună",second:"secundă",selectedDateDescription:e=>`Dată selectată: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} până la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectată: ${e.time}`,startDate:"Dată început",timeZoneName:"fus orar",weekday:"ziua din săptămână",year:"an"};var XS={};XS={calendar:"Календарь",day:"день",dayPeriod:"AM/PM",endDate:"Дата окончания",era:"эра",hour:"час",minute:"минута",month:"месяц",second:"секунда",selectedDateDescription:e=>`Выбранная дата: ${e.date}`,selectedRangeDescription:e=>`Выбранный диапазон: с ${e.startDate} по ${e.endDate}`,selectedTimeDescription:e=>`Выбранное время: ${e.time}`,startDate:"Дата начала",timeZoneName:"часовой пояс",weekday:"день недели",year:"год"};var ZS={};ZS={calendar:"Kalendár",day:"deň",dayPeriod:"AM/PM",endDate:"Dátum ukončenia",era:"letopočet",hour:"hodina",minute:"minúta",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybratý dátum: ${e.date}`,selectedRangeDescription:e=>`Vybratý rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybratý čas: ${e.time}`,startDate:"Dátum začatia",timeZoneName:"časové pásmo",weekday:"deň týždňa",year:"rok"};var YS={};YS={calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano območje: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani čas: ${e.time}`,startDate:"Datum začetka",timeZoneName:"časovni pas",weekday:"dan v tednu",year:"leto"};var KS={};KS={calendar:"Kalendar",day:"дан",dayPeriod:"пре подне/по подне",endDate:"Datum završetka",era:"ера",hour:"сат",minute:"минут",month:"месец",second:"секунд",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum početka",timeZoneName:"временска зона",weekday:"дан у недељи",year:"година"};var JS={};JS={calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"månad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"år"};var qS={};qS={calendar:"Takvim",day:"gün",dayPeriod:"ÖÖ/ÖS",endDate:"Bitiş Tarihi",era:"çağ",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Seçilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Seçilen Aralık: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Seçilen Zaman: ${e.time}`,startDate:"Başlangıç Tarihi",timeZoneName:"saat dilimi",weekday:"haftanın günü",year:"yıl"};var QS={};QS={calendar:"Календар",day:"день",dayPeriod:"дп/пп",endDate:"Дата завершення",era:"ера",hour:"година",minute:"хвилина",month:"місяць",second:"секунда",selectedDateDescription:e=>`Вибрана дата: ${e.date}`,selectedRangeDescription:e=>`Вибраний діапазон: ${e.startDate} — ${e.endDate}`,selectedTimeDescription:e=>`Вибраний час: ${e.time}`,startDate:"Дата початку",timeZoneName:"часовий пояс",weekday:"день тижня",year:"рік"};var ew={};ew={calendar:"日历",day:"日",dayPeriod:"上午/下午",endDate:"结束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`选定的日期:${e.date}`,selectedRangeDescription:e=>`选定的范围:${e.startDate} 至 ${e.endDate}`,selectedTimeDescription:e=>`选定的时间:${e.time}`,startDate:"开始日期",timeZoneName:"时区",weekday:"工作日",year:"年"};var tw={};tw={calendar:"日曆",day:"日",dayPeriod:"上午/下午",endDate:"結束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`選定的日期:${e.date}`,selectedRangeDescription:e=>`選定的範圍:${e.startDate} 至 ${e.endDate}`,selectedTimeDescription:e=>`選定的時間:${e.time}`,startDate:"開始日期",timeZoneName:"时区",weekday:"工作日",year:"年"};var nw={};nw={"ar-AE":ES,"bg-BG":SS,"cs-CZ":wS,"da-DK":IS,"de-DE":_S,"el-GR":DS,"en-US":AS,"es-ES":TS,"et-EE":RS,"fi-FI":BS,"fr-FR":$S,"he-IL":kS,"hr-HR":PS,"hu-HU":FS,"it-IT":NS,"ja-JP":MS,"ko-KR":LS,"lt-LT":OS,"lv-LV":VS,"nb-NO":HS,"nl-NL":jS,"pl-PL":WS,"pt-BR":zS,"pt-PT":GS,"ro-RO":US,"ru-RU":XS,"sk-SK":ZS,"sl-SI":YS,"sr-SP":KS,"sv-SE":JS,"tr-TR":qS,"uk-UA":QS,"zh-CN":ew,"zh-TW":tw};function nH(e,t,n){let{direction:r}=Mr(),i=I.useMemo(()=>TE(t),[t]),a=l=>{if(l.currentTarget.contains(l.target)&&(l.altKey&&(l.key==="ArrowDown"||l.key==="ArrowUp")&&"setOpen"in e&&(l.preventDefault(),l.stopPropagation(),e.setOpen(!0)),!n))switch(l.key){case"ArrowLeft":l.preventDefault(),l.stopPropagation(),r==="rtl"?i.focusNext():i.focusPrevious();break;case"ArrowRight":l.preventDefault(),l.stopPropagation(),r==="rtl"?i.focusPrevious():i.focusNext();break}},o=()=>{var l;let u=(l=window.event)===null||l===void 0?void 0:l.target,c=rl(t.current,{tabbable:!0});if(u&&(c.currentNode=u,u=c.previousNode()),!u){let d;do d=c.lastChild(),d&&(u=d);while(d)}for(;u!=null&&u.hasAttribute("data-placeholder");){let d=c.previousNode();if(d&&d.hasAttribute("data-placeholder"))u=d;else break}u&&u.focus()},{pressProps:s}=Rm({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(l){l.pointerType==="mouse"&&o()},onPress(l){l.pointerType!=="mouse"&&o()}});return Gn(s,{onKeyDown:a})}const rH="__role_"+Date.now(),iH="__focusManager_"+Date.now();function aH(e){return e&&e.__esModule?e.default:e}function oH(e,t,n){var r,i;let a=Du(aH(nw),"@react-aria/datepicker"),{isInvalid:o,validationErrors:s,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:c,descriptionProps:d,errorMessageProps:h}=tH({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||s}),f=c["aria-labelledby"]||c.id,{locale:g}=Mr(),p=t.formatValue(g,{month:"long"}),m=p?a.format("selectedRangeDescription",{startDate:p.start,endDate:p.end}):"",b=fE(m),v={"aria-label":a.format("startDate"),"aria-labelledby":f},x={"aria-label":a.format("endDate"),"aria-labelledby":f},C=Cs(),E=Cs(),w=nH(t,n),B=[b["aria-describedby"],c["aria-describedby"]].filter(Boolean).join(" ")||void 0,y=I.useMemo(()=>TE(n,{accept:k=>k.id!==C}),[n,C]),S={[iH]:y,[rH]:"presentation","aria-describedby":B,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},D=Dm(e),{focusWithinProps:A}=IE({...e,isDisabled:t.isOpen,onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),T=I.useRef(Ka),F=I.useRef(Ka);return{groupProps:Gn(D,w,c,b,A,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":B,onKeyDown(k){t.isOpen||e.onKeyDown&&e.onKeyDown(k)},onKeyUp(k){t.isOpen||e.onKeyUp&&e.onKeyUp(k)}}),labelProps:{...u,onClick:()=>{y.focusFirst()}},buttonProps:{...b,id:C,"aria-haspopup":"dialog","aria-label":a.format("calendar"),"aria-labelledby":`${C} ${f}`,"aria-describedby":B,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:E,"aria-labelledby":`${C} ${f}`},startFieldProps:{...v,...S,value:(r=t.value)===null||r===void 0?void 0:r.start,onChange:k=>t.setDateTime("start",k),autoFocus:e.autoFocus,name:e.startName,[Od]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(k){T.current=k,t.updateValidation(Vd(k,F.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...x,...S,value:(i=t.value)===null||i===void 0?void 0:i.end,onChange:k=>t.setDateTime("end",k),name:e.endName,[Od]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(k){F.current=k,t.updateValidation(Vd(T.current,k))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:d,errorMessageProps:h,calendarProps:{autoFocus:!0,value:t.dateRange,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:typeof e.errorMessage=="function"?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" ")},isInvalid:o,validationErrors:s,validationDetails:l}}function ls(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function Fg(e,t,n,r,i){let a={};for(let s in t)a[s]=Math.floor(t[s]/2),a[s]>0&&t[s]%2===0&&a[s]--;let o=to(e,t,n).subtract(a);return ql(e,o,t,n,r,i)}function to(e,t,n,r,i){let a=e;return t.years?a=WL(e):t.months?a=wu(e):t.weeks&&(a=zl(e,n)),ql(e,a,t,n,r,i)}function Ng(e,t,n,r,i){let a={...t};t.days?a.days--:t.weeks?a.weeks--:t.months?a.months--:t.years&&a.years--;let o=to(e,t,n).subtract(a);return ql(e,o,t,n,r,i)}function ql(e,t,n,r,i,a){return i&&e.compare(i)>=0&&(t=mm(t,to(Bn(i),n,r))),a&&e.compare(a)<=0&&(t=pm(t,Ng(Bn(a),n,r))),t}function ea(e,t,n){return t&&(e=mm(e,Bn(t))),n&&(e=pm(e,Bn(n))),e}function rw(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});if(e.compare(t)>=0)return e}function iw(e){let t=I.useMemo(()=>new Xl(e.locale),[e.locale]),n=I.useMemo(()=>t.resolvedOptions(),[t]),{locale:r,createCalendar:i,visibleDuration:a={months:1},minValue:o,maxValue:s,selectionAlignment:l,isDateUnavailable:u,pageBehavior:c="visible"}=e,d=I.useMemo(()=>i(n.calendar),[i,n.calendar]),[h,f]=Kl(e.value,e.defaultValue,e.onChange),g=I.useMemo(()=>h?rn(Bn(h),d):null,[h,d]),p=I.useMemo(()=>h&&"timeZone"in h?h.timeZone:n.timeZone,[h,n.timeZone]),m=I.useMemo(()=>e.focusedValue?ea(rn(Bn(e.focusedValue),d),o,s):void 0,[e.focusedValue,d,o,s]),b=I.useMemo(()=>ea(e.defaultFocusedValue?rn(Bn(e.defaultFocusedValue),d):g||rn(gm(p),d),o,s),[e.defaultFocusedValue,g,p,d,o,s]),[v,x]=Kl(m,b,e.onFocusChange),[C,E]=I.useState(()=>{switch(l){case"start":return to(v,a,r,o,s);case"end":return Ng(v,a,r,o,s);case"center":default:return Fg(v,a,r,o,s)}}),[w,B]=I.useState(e.autoFocus||!1),y=I.useMemo(()=>{let R={...a};return R.days?R.days--:R.days=-1,C.add(R)},[C,a]),[S,D]=I.useState(d.identifier);if(d.identifier!==S){let R=rn(v,d);E(Fg(R,a,r,o,s)),x(R),D(d.identifier)}ls(v,o,s)?x(ea(v,o,s)):v.compare(C)<0?E(Ng(v,a,r,o,s)):v.compare(y)>0&&E(to(v,a,r,o,s));function A(R){R=ea(R,o,s),x(R)}function T(R){if(!e.isDisabled&&!e.isReadOnly){if(R===null){f(null);return}if(R=ea(R,o,s),R=rw(R,C,u),!R)return;R=rn(R,(h==null?void 0:h.calendar)||new ar),h&&"hour"in h?f(h.set(R)):f(R)}}let F=I.useMemo(()=>g?u&&u(g)?!0:ls(g,o,s):!1,[g,u,o,s]),k=e.isInvalid||e.validationState==="invalid"||F,P=k?"invalid":null,$=I.useMemo(()=>c==="visible"?a:Wh(a),[c,a]);return{isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,value:g,setValue:T,visibleRange:{start:C,end:y},minValue:o,maxValue:s,focusedDate:v,timeZone:p,validationState:P,isValueInvalid:k,setFocusedDate(R){A(R),B(!0)},focusNextDay(){A(v.add({days:1}))},focusPreviousDay(){A(v.subtract({days:1}))},focusNextRow(){a.days?this.focusNextPage():(a.weeks||a.months||a.years)&&A(v.add({weeks:1}))},focusPreviousRow(){a.days?this.focusPreviousPage():(a.weeks||a.months||a.years)&&A(v.subtract({weeks:1}))},focusNextPage(){let R=C.add($);x(ea(v.add($),o,s)),E(to(ql(v,R,$,r,o,s),$,r))},focusPreviousPage(){let R=C.subtract($);x(ea(v.subtract($),o,s)),E(to(ql(v,R,$,r,o,s),$,r))},focusSectionStart(){a.days?A(C):a.weeks?A(zl(v,r)):(a.months||a.years)&&A(wu(v))},focusSectionEnd(){a.days?A(y):a.weeks?A(zL(v,r)):(a.months||a.years)&&A(mg(v))},focusNextSection(R){if(!R&&!a.days){A(v.add(Wh(a)));return}a.days?this.focusNextPage():a.weeks?A(v.add({months:1})):(a.months||a.years)&&A(v.add({years:1}))},focusPreviousSection(R){if(!R&&!a.days){A(v.subtract(Wh(a)));return}a.days?this.focusPreviousPage():a.weeks?A(v.subtract({months:1})):(a.months||a.years)&&A(v.subtract({years:1}))},selectFocusedDate(){T(v)},selectDate(R){T(R)},isFocused:w,setFocused:B,isInvalid(R){return ls(R,o,s)},isSelected(R){return g!=null&&Gt(R,g)&&!this.isCellDisabled(R)&&!this.isCellUnavailable(R)},isCellFocused(R){return w&&v&&Gt(R,v)},isCellDisabled(R){return e.isDisabled||R.compare(C)<0||R.compare(y)>0||this.isInvalid(R,o,s)},isCellUnavailable(R){return e.isDateUnavailable&&e.isDateUnavailable(R)},isPreviousVisibleRangeInvalid(){let R=C.subtract({days:1});return Gt(R,C)||this.isInvalid(R,o,s)},isNextVisibleRangeInvalid(){let R=y.add({days:1});return Gt(R,y)||this.isInvalid(R,o,s)},getDatesInWeek(R,O=C){let j=O.add({weeks:R}),V=[];j=zl(j,r);let W=kf(j,r);for(let U=0;U<W;U++)V.push(null);for(;V.length<7;){V.push(j);let U=j.add({days:1});if(Gt(j,U))break;j=U}for(;V.length<7;)V.push(null);return V}}}function Wh(e){let t={...e};for(let n in e)t[n]=1;return t}function sH(e){let{value:t,defaultValue:n,onChange:r,createCalendar:i,locale:a,visibleDuration:o={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=Kl(t,n||null,r),[h,f]=I.useState(null),g="center";if(c&&c.start&&c.end){let O=Fg(Bn(c.start),o,a,s,l).add(o).subtract({days:1});c.end.compare(O)>0&&(g="start")}let p=I.useRef(null),[m,b]=I.useState(null),v=I.useMemo(()=>mm(s,m==null?void 0:m.start),[s,m]),x=I.useMemo(()=>pm(l,m==null?void 0:m.end),[l,m]),C=iw({...u,value:c&&c.start,createCalendar:i,locale:a,visibleDuration:o,minValue:v,maxValue:x,selectionAlignment:g}),E=R=>{R&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(p.current={start:ty(R,C,-1),end:ty(R,C,1)},b(p.current)):(p.current=null,b(null))},[w,B]=I.useState(C.visibleRange);(!pg(C.visibleRange.start,w.start)||!pg(C.visibleRange.end,w.end))&&(E(h),B(C.visibleRange));let y=R=>{R?(f(R),E(R)):(f(null),E(null))},S=h?zh(h,C.focusedDate):c&&zh(c.start,c.end),D=R=>{if(!e.isReadOnly&&(R=ea(R,v,x),R=rw(R,C.visibleRange.start,e.isDateUnavailable),!!R))if(!h)y(R);else{let O=zh(h,R);d({start:ey(O.start,c==null?void 0:c.start),end:ey(O.end,c==null?void 0:c.end)}),y(null)}},[A,T]=I.useState(!1),{isDateUnavailable:F}=e,k=I.useMemo(()=>!c||h?!1:F&&(F(c.start)||F(c.end))?!0:ls(c.start,s,l)||ls(c.end,s,l),[F,c,h,s,l]),P=e.isInvalid||e.validationState==="invalid"||k;return{...C,value:c,setValue:d,anchorDate:h,setAnchorDate:y,highlightedRange:S,validationState:P?"invalid":null,isValueInvalid:P,selectFocusedDate(){D(C.focusedDate)},selectDate:D,highlightDate(R){h&&C.setFocusedDate(R)},isSelected(R){return S&&R.compare(S.start)>=0&&R.compare(S.end)<=0&&!C.isCellDisabled(R)&&!C.isCellUnavailable(R)},isInvalid(R){var O,j;return C.isInvalid(R)||ls(R,(O=p.current)===null||O===void 0?void 0:O.start,(j=p.current)===null||j===void 0?void 0:j.end)},isDragging:A,setDragging:T}}function zh(e,t){return!e||!t?null:(t.compare(e)<0&&([e,t]=[t,e]),{start:Bn(e),end:Bn(t)})}function ey(e,t){return e=rn(e,(t==null?void 0:t.calendar)||new ar),t&&"hour"in t?t.set(e):e}function ty(e,t,n){let r=e.add({days:n});for(;(n<0?r.compare(t.visibleRange.start)>=0:r.compare(t.visibleRange.end)<=0)&&!t.isCellUnavailable(r);)r=r.add({days:n});return t.isCellUnavailable(r)?r.add({days:-n}):null}function lH(e){let[t,n]=Kl(e.isOpen,e.defaultOpen||!1,e.onOpenChange);const r=I.useCallback(()=>{n(!0)},[n]),i=I.useCallback(()=>{n(!1)},[n]),a=I.useCallback(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:i,toggle:a}}var aw={};aw={rangeOverflow:e=>`يجب أن تكون القيمة ${e.maxValue} أو قبل ذلك.`,rangeReversed:"تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.",rangeUnderflow:e=>`يجب أن تكون القيمة ${e.minValue} أو بعد ذلك.`,unavailableDate:"البيانات المحددة غير متاحة."};var ow={};ow={rangeOverflow:e=>`Стойността трябва да е ${e.maxValue} или по-ранна.`,rangeReversed:"Началната дата трябва да е преди крайната.",rangeUnderflow:e=>`Стойността трябва да е ${e.minValue} или по-късно.`,unavailableDate:"Избраната дата не е налична."};var sw={};sw={rangeOverflow:e=>`Hodnota musí být ${e.maxValue} nebo dřívější.`,rangeReversed:"Datum zahájení musí předcházet datu ukončení.",rangeUnderflow:e=>`Hodnota musí být ${e.minValue} nebo pozdější.`,unavailableDate:"Vybrané datum není k dispozici."};var lw={};lw={rangeOverflow:e=>`Værdien skal være ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal være før slutdatoen.",rangeUnderflow:e=>`Værdien skal være ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilgængelig."};var uw={};uw={rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder früher sein.`,rangeReversed:"Das Anfangsdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder später sein.`,unavailableDate:"Das ausgewählte Datum ist nicht verfügbar."};var cw={};cw={rangeOverflow:e=>`Η τιμή πρέπει να είναι ${e.maxValue} ή παλαιότερη.`,rangeReversed:"Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.",rangeUnderflow:e=>`Η τιμή πρέπει να είναι ${e.minValue} ή μεταγενέστερη.`,unavailableDate:"Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη."};var dw={};dw={rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."};var fw={};fw={rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalización.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."};var hw={};hw={rangeOverflow:e=>`Väärtus peab olema ${e.maxValue} või varasem.`,rangeReversed:"Alguskuupäev peab olema enne lõppkuupäeva.",rangeUnderflow:e=>`Väärtus peab olema ${e.minValue} või hilisem.`,unavailableDate:"Valitud kuupäev pole saadaval."};var gw={};gw={rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sitä aikaisempi.`,rangeReversed:"Aloituspäivän on oltava ennen lopetuspäivää.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sitä myöhäisempi.`,unavailableDate:"Valittu päivämäärä ei ole käytettävissä."};var pw={};pw={rangeOverflow:e=>`La valeur doit être ${e.maxValue} ou antérieure.`,rangeReversed:"La date de début doit être antérieure à la date de fin.",rangeUnderflow:e=>`La valeur doit être ${e.minValue} ou ultérieure.`,unavailableDate:"La date sélectionnée n’est pas disponible."};var mw={};mw={rangeOverflow:e=>`הערך חייב להיות ${e.maxValue} או מוקדם יותר.`,rangeReversed:"תאריך ההתחלה חייב להיות לפני תאריך הסיום.",rangeUnderflow:e=>`הערך חייב להיות ${e.minValue} או מאוחר יותר.`,unavailableDate:"התאריך הנבחר אינו זמין."};var bw={};bw={rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum početka mora biti prije datuma završetka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."};var vw={};vw={rangeOverflow:e=>`Az értéknek ${e.maxValue} vagy korábbinak kell lennie.`,rangeReversed:"A kezdő dátumnak a befejező dátumnál korábbinak kell lennie.",rangeUnderflow:e=>`Az értéknek ${e.minValue} vagy későbbinek kell lennie.`,unavailableDate:"A kiválasztott dátum nem érhető el."};var yw={};yw={rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."};var xw={};xw={rangeOverflow:e=>`値は ${e.maxValue} 以下にする必要があります。`,rangeReversed:"開始日は終了日より前にする必要があります。",rangeUnderflow:e=>`値は ${e.minValue} 以上にする必要があります。`,unavailableDate:"選択した日付は使用できません。"};var Cw={};Cw={rangeOverflow:e=>`값은 ${e.maxValue} 이전이어야 합니다.`,rangeReversed:"시작일은 종료일 이전이어야 합니다.",rangeUnderflow:e=>`값은 ${e.minValue} 이상이어야 합니다.`,unavailableDate:"선택한 날짜를 사용할 수 없습니다."};var Ew={};Ew={rangeOverflow:e=>`Reikšmė turi būti ${e.maxValue} arba ankstesnė.`,rangeReversed:"Pradžios data turi būti ankstesnė nei pabaigos data.",rangeUnderflow:e=>`Reikšmė turi būti ${e.minValue} arba naujesnė.`,unavailableDate:"Pasirinkta data nepasiekiama."};var Sw={};Sw={rangeOverflow:e=>`Vērtībai ir jābūt ${e.maxValue} vai agrākai.`,rangeReversed:"Sākuma datumam ir jābūt pirms beigu datuma.",rangeUnderflow:e=>`Vērtībai ir jābūt ${e.minValue} vai vēlākai.`,unavailableDate:"Atlasītais datums nav pieejams."};var ww={};ww={rangeOverflow:e=>`Verdien må være ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen må være før sluttdatoen.",rangeUnderflow:e=>`Verdien må være ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."};var Iw={};Iw={rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."};var _w={};_w={rangeOverflow:e=>`Wartość musi mieć wartość ${e.maxValue} lub wcześniejszą.`,rangeReversed:"Data rozpoczęcia musi być wcześniejsza niż data zakończenia.",rangeUnderflow:e=>`Wartość musi mieć wartość ${e.minValue} lub późniejszą.`,unavailableDate:"Wybrana data jest niedostępna."};var Dw={};Dw={rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior à data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indisponível."};var Aw={};Aw={rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de início deve ser anterior à data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indisponível."};var Tw={};Tw={rangeOverflow:e=>`Valoarea trebuie să fie ${e.maxValue} sau anterioară.`,rangeReversed:"Data de început trebuie să fie anterioară datei de sfârșit.",rangeUnderflow:e=>`Valoarea trebuie să fie ${e.minValue} sau ulterioară.`,unavailableDate:"Data selectată nu este disponibilă."};var Rw={};Rw={rangeOverflow:e=>`Значение должно быть не позже ${e.maxValue}.`,rangeReversed:"Дата начала должна предшествовать дате окончания.",rangeUnderflow:e=>`Значение должно быть не раньше ${e.minValue}.`,unavailableDate:"Выбранная дата недоступна."};var Bw={};Bw={rangeOverflow:e=>`Hodnota musí byť ${e.maxValue} alebo skoršia.`,rangeReversed:"Dátum začiatku musí byť skorší ako dátum konca.",rangeUnderflow:e=>`Hodnota musí byť ${e.minValue} alebo neskoršia.`,unavailableDate:"Vybratý dátum je nedostupný."};var $w={};$w={rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starejša.`,rangeReversed:"Začetni datum mora biti pred končnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novejša.`,unavailableDate:"Izbrani datum ni na voljo."};var kw={};kw={rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum početka mora biti pre datuma završetka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."};var Pw={};Pw={rangeOverflow:e=>`Värdet måste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet måste vara före slutdatumet.",rangeUnderflow:e=>`Värdet måste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet är inte tillgängligt."};var Fw={};Fw={rangeOverflow:e=>`Değer, ${e.maxValue} veya öncesi olmalıdır.`,rangeReversed:"Başlangıç tarihi bitiş tarihinden önce olmalıdır.",rangeUnderflow:e=>`Değer, ${e.minValue} veya sonrası olmalıdır.`,unavailableDate:"Seçilen tarih kullanılamıyor."};var Nw={};Nw={rangeOverflow:e=>`Значення має бути не пізніше ${e.maxValue}.`,rangeReversed:"Дата початку має передувати даті завершення.",rangeUnderflow:e=>`Значення має бути не раніше ${e.minValue}.`,unavailableDate:"Вибрана дата недоступна."};var Mw={};Mw={rangeOverflow:e=>`值必须是 ${e.maxValue} 或更早日期。`,rangeReversed:"开始日期必须早于结束日期。",rangeUnderflow:e=>`值必须是 ${e.minValue} 或更晚日期。`,unavailableDate:"所选日期不可用。"};var Lw={};Lw={rangeOverflow:e=>`值必須是 ${e.maxValue} 或更早。`,rangeReversed:"開始日期必須在結束日期之前。",rangeUnderflow:e=>`值必須是 ${e.minValue} 或更晚。`,unavailableDate:"所選日期無法使用。"};var Ow={};Ow={"ar-AE":aw,"bg-BG":ow,"cs-CZ":sw,"da-DK":lw,"de-DE":uw,"el-GR":cw,"en-US":dw,"es-ES":fw,"et-EE":hw,"fi-FI":gw,"fr-FR":pw,"he-IL":mw,"hr-HR":bw,"hu-HU":vw,"it-IT":yw,"ja-JP":xw,"ko-KR":Cw,"lt-LT":Ew,"lv-LV":Sw,"nb-NO":ww,"nl-NL":Iw,"pl-PL":_w,"pt-BR":Dw,"pt-PT":Aw,"ro-RO":Tw,"ru-RU":Rw,"sk-SK":Bw,"sl-SI":$w,"sr-SP":kw,"sv-SE":Pw,"tr-TR":Fw,"uk-UA":Nw,"zh-CN":Mw,"zh-TW":Lw};function uH(e){return e&&e.__esModule?e.default:e}const Vw=new Do(uH(Ow));function Hw(){return typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US"}function ny(e,t,n,r,i){let a=e!=null&&n!=null&&e.compare(n)>0,o=e!=null&&t!=null&&e.compare(t)<0,s=e!=null&&(r==null?void 0:r(e))||!1,l=a||o||s,u=[];if(l){let c=Hw(),d=Do.getGlobalDictionaryForPackage("@react-stately/datepicker")||Vw,h=new FE(c,d),f=new Xl(c,Mg({},i)),g=f.resolvedOptions().timeZone;o&&u.push(h.format("rangeUnderflow",{minValue:f.format(t.toDate(g))})),a&&u.push(h.format("rangeOverflow",{maxValue:f.format(n.toDate(g))})),s&&u.push(h.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:a,rangeUnderflow:o,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}function cH(e,t,n,r,i){let a=ny(e==null?void 0:e.start,t,n,r,i),o=ny(e==null?void 0:e.end,t,n,r,i),s=Vd(a,o);if(e.end!=null&&e.start!=null&&e.end.compare(e.start)<0){let l=Do.getGlobalDictionaryForPackage("@react-stately/datepicker")||Vw;s=Vd(s,{isInvalid:!0,validationErrors:[l.getStringForLocale("rangeReversed",Hw())],validationDetails:{...Nf,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return s}const dH={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},fH={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function Mg(e,t){e={...t.shouldForceLeadingZeros?fH:dH,...e};let r=t.granularity||"minute",i=Object.keys(e);var a;let o=i.indexOf((a=t.maxGranularity)!==null&&a!==void 0?a:"year");o<0&&(o=0);let s=i.indexOf(r);if(s<0&&(s=2),o>s)throw new Error("maxGranularity must be greater than granularity");let l=i.slice(o,s+1).reduce((c,d)=>(c[d]=e[d],c),{});return t.hourCycle!=null&&(l.hour12=t.hourCycle===12),l.timeZone=t.timeZone||"UTC",(r==="hour"||r==="minute"||r==="second")&&t.timeZone&&!t.hideTimeZone&&(l.timeZoneName="short"),t.showEra&&o===0&&(l.era="short"),l}function ac(e){return e&&"hour"in e?e:new Sm}function hH(e,t){let n=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw new Error("Invalid granularity "+t+" for value "+e.toString());let[i,a]=I.useState([r,n]);e&&(i[0]!==r||i[1]!==n)&&a([r,n]),t||(t=e?r:i[0]);let o=e?n:i[1];return[t,o]}function gH(e){var t,n;let r=lH(e),[i,a]=Kl(e.value,e.defaultValue||null,e.onChange),[o,s]=I.useState(()=>i||{start:null,end:null});i==null&&o.start&&o.end&&(o={start:null,end:null},s(o));let l=i||o,u=$=>{s($||{start:null,end:null}),$!=null&&$.start&&$.end?a($):a(null)},c=(l==null?void 0:l.start)||(l==null?void 0:l.end)||e.placeholderValue,[d,h]=hH(c,e.granularity),f=d==="hour"||d==="minute"||d==="second";var g;let p=(g=e.shouldCloseOnSelect)!==null&&g!==void 0?g:!0,[m,b]=I.useState(null),[v,x]=I.useState(null);l&&l.start&&l.end&&(m=l,"hour"in l.start&&(v=l));let C=($,R)=>{u({start:"timeZone"in R.start?R.start.set(Bn($.start)):Ia($.start,R.start),end:"timeZone"in R.end?R.end.set(Bn($.end)):Ia($.end,R.end)}),b(null),x(null),F.commitValidation()},E=$=>{let R=typeof p=="function"?p():p;f?R||$.start&&$.end&&(v!=null&&v.start)&&(v!=null&&v.end)?C($,{start:(v==null?void 0:v.start)||ac(e.placeholderValue),end:(v==null?void 0:v.end)||ac(e.placeholderValue)}):b($):$.start&&$.end?(u($),F.commitValidation()):b($),R&&r.setOpen(!1)},w=$=>{m!=null&&m.start&&(m!=null&&m.end)&&$.start&&$.end?C(m,$):x($)},B=(l==null||(t=l.start)===null||t===void 0?void 0:t.calendar.identifier)==="gregory"&&l.start.era==="BC"||(l==null||(n=l.end)===null||n===void 0?void 0:n.calendar.identifier)==="gregory"&&l.end.era==="BC",y=I.useMemo(()=>({granularity:d,timeZone:h,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:B}),[d,e.hourCycle,e.shouldForceLeadingZeros,h,e.hideTimeZone,B]),{minValue:S,maxValue:D,isDateUnavailable:A}=e,T=I.useMemo(()=>cH(l,S,D,A,y),[l,S,D,A,y]),F=JV({...e,value:i,name:I.useMemo(()=>[e.startName,e.endName],[e.startName,e.endName]),builtinValidation:T}),k=F.displayValidation.isInvalid,P=e.validationState||(k?"invalid":null);return{...F,value:l,setValue:u,dateRange:m,timeRange:v,granularity:d,hasTime:f,setDate($,R){E({...m,[$]:R})},setTime($,R){w({...v,[$]:R})},setDateTime($,R){u({...l,[$]:R})},setDateRange:E,setTimeRange:w,...r,setOpen($){!$&&!(l!=null&&l.start&&(l!=null&&l.end))&&(m!=null&&m.start)&&(m!=null&&m.end)&&f&&C(m,{start:(v==null?void 0:v.start)||ac(e.placeholderValue),end:(v==null?void 0:v.end)||ac(e.placeholderValue)}),r.setOpen($)},validationState:P,isInvalid:k,formatValue($,R){if(!l||!l.start||!l.end)return null;let O="timeZone"in l.start?l.start.timeZone:void 0,j=e.granularity||(l.start&&"minute"in l.start?"minute":"day"),V="timeZone"in l.end?l.end.timeZone:void 0,W=e.granularity||(l.end&&"minute"in l.end?"minute":"day"),U=Mg(R,{granularity:j,timeZone:O,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:l.start.calendar.identifier==="gregory"&&l.start.era==="BC"||l.end.calendar.identifier==="gregory"&&l.end.era==="BC"}),K=l.start.toDate(O||"UTC"),ee=l.end.toDate(V||"UTC"),z=new Xl($,U),H;if(O===V&&j===W&&l.start.compare(l.end)!==0){try{let X=z.formatRangeToParts(K,ee),te=-1;for(let ce=0;ce<X.length;ce++){let Q=X[ce];if(Q.source==="shared"&&Q.type==="literal")te=ce;else if(Q.source==="endRange")break}let ie="",le="";for(let ce=0;ce<X.length;ce++)ce<te?ie+=X[ce].value:ce>te&&(le+=X[ce].value);return{start:ie,end:le}}catch{}H=z}else{let X=Mg(R,{granularity:W,timeZone:V,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle});H=new Xl($,X)}return{start:z.format(K),end:H.format(ee)}}}}const jw=e=>{const t=I.useRef(null),{locale:n}=Mr(),{state:r,date:i}=e,{cellProps:a,buttonProps:o,isSelected:s,isOutsideVisibleRange:l,isDisabled:u,formattedDate:c,isInvalid:d}=YV({date:i},r,t),{focusProps:h}=RE(),f="highlightedRange"in r?r.highlightedRange?Gt(i,r.highlightedRange.start):null:s,g="highlightedRange"in r?r.highlightedRange?Gt(i,r.highlightedRange.end):null:s,p=kf(i,n),m=s&&(f||p===0||i.day===1),b=s&&(g||p===6||i.day===i.calendar.getDaysInMonth(i));return _.jsx("td",{...a,children:_.jsx("div",{...Gn(o,h),ref:t,className:`${Fe["cell-calendar"]} ${m?"1ru-rounded-l-full":""} ${b?"1ru-rounded-r-full":""} ${s?d?"1ru-bg-red-300":"1ru-bg-laba-blue-02":""} ${u?"1ru-disabled":""}`,children:l?_.jsx("div",{className:Fe["visible-cell-calendar"],children:c}):_.jsx("div",{className:`${Fe["active-cell-calendar"]} ${u&&!d?Fe.disabled:""} ${f||g?d?Fe.error:Fe.selected:""} ${s&&!u&&!(f??g)?d?"hover:1ru-bg-red-400":"hover:1ru-text-laba-blue-05":""} ${!s&&!u?"hover:1ru-bg-laba-blue-01":""}`,children:c})})})},Es=e=>{const t=I.useRef(null),{buttonProps:n}=WV(e,t),{focusProps:r}=RE();return _.jsx("button",{...Gn(n,r),ref:t,className:`1ru-px-2 1ru-py-1 1ru-rounded-full ${e.isDisabled?"1ru-text-gray-400":"1ru-text-laba-blue-10"} ${e.isDisabled?"":"hover:1ru-bg-laba-blue-01 1ru-cursor-pointer"} 1ru-outline-none`,children:e.children})},Ww=({prevIcon:e,nextIcon:t,state:n,setActiveTypeCalendar:r,onChangeMonth:i,type:a,hiddenHeader:o})=>{const s=new Date().getFullYear(),l=n.focusedDate.calendar.getMonthsInYear(n.focusedDate),u=_a({month:"short",timeZone:n.timeZone}),c=(h,f)=>{const g=n.focusedDate.set({month:h});f?(r("date"),n.setFocusedDate(g)):!f&&typeof i=="function"&&i(g)},d=h=>{const f=n.focusedDate.set({year:h});n.setFocusedDate(f)};return _.jsxs("div",{className:`1ru-w-[296px] ${Fe["container-calendar"]}`,children:[!o&&_.jsxs("div",{className:Fe["header-calendar"],children:[_.jsx(Es,{isDisabled:n!=null&&n.minValue?n.focusedDate.year<=n.minValue.year:!1,onPress:()=>d(n.focusedDate.year-1),children:typeof e=="function"||I.isValidElement(e)?I.isValidElement(e)?e:e():_.jsx(li,{className:"1ru-rotate-90"})}),_.jsx("div",{className:`${Fe["header-button-calendar"]} ${a.includes("year")?"":Fe.disabled}`,onClick:()=>{a.includes("year")&&r("year")},children:n.focusedDate.year}),_.jsx(Es,{isDisabled:n!=null&&n.maxValue?n.focusedDate.year>=n.maxValue.year:!1,onPress:()=>d(n.focusedDate.year+1),children:typeof t=="function"||I.isValidElement(t)?I.isValidElement(t)?t:t():_.jsx(li,{className:"-1ru-rotate-90"})})]}),_.jsx("div",{className:Fe["month-calendar"],children:[...Array(l).keys()].map(h=>{var x,C,E,w;const f=n.focusedDate.set({month:h+1}),g=u.format(f.toDate(n.timeZone)),p=((x=n.value)==null?void 0:x.year)||((E=(C=n.value)==null?void 0:C.start)==null?void 0:E.year)||s,m=n!=null&&n.minValue?f.month<((w=n==null?void 0:n.minValue)==null?void 0:w.month)&&f.year<=n.minValue.year:!1,b=n!=null&&n.maxValue?f.month>n.maxValue.month&&f.year>=n.maxValue.year:!1,v=m||b;return _.jsx("div",{onClick:()=>{v||c(f.month,a.includes("date"))},className:`${Fe["cell-month"]} ${n.focusedDate.month===f.month&&!v&&f.year===p?Fe.selected:""} ${n.focusedDate.month!==f.month&&!v?"hover:1ru-bg-laba-blue-01":""} ${v?"1ru-text-gray-400":"1ru-cursor-pointer"}`,children:g},h)})})]})},pH=e=>{const t=N3(e.state.visibleRange.start,e.locale),{gridProps:n,headerProps:r,weekDays:i}=xS({},e.state),{prevButtonProps:a,nextButtonProps:o,title:s}=yS(e,e.state),l=u=>{let c="";switch(u){case 0:c="Min";break;case 1:c="Sen";break;case 2:c="Sel";break;case 3:c="Rab";break;case 4:c="Kam";break;case 5:c="Jum";break;case 6:c="Sab";break}return c};return _.jsxs("div",{children:[!e.hiddenHeader&&_.jsxs("div",{className:Fe["header-calendar"],children:[_.jsx(Es,{...a,children:typeof(e==null?void 0:e.prevIcon)=="function"||I.isValidElement(e==null?void 0:e.prevIcon)?I.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():_.jsx(li,{className:"1ru-rotate-90"})}),_.jsx("div",{className:Fe["header-button-calendar"],onClick:()=>e.setActiveTypeCalendar("month"),children:s}),_.jsx(Es,{...o,children:typeof(e==null?void 0:e.nextIcon)=="function"||I.isValidElement(e==null?void 0:e.nextIcon)?I.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():_.jsx(li,{className:"-1ru-rotate-90"})})]}),_.jsxs("table",{...n,children:[_.jsx("thead",{...r,children:_.jsx("tr",{children:i.map((u,c)=>_.jsx("th",{className:Fe["days-calendar"],children:l(c)},c))})}),_.jsx("tbody",{children:[...new Array(t).keys()].map(u=>_.jsx("tr",{children:e.state.getDatesInWeek(u).map((c,d)=>c?_.jsx(jw,{state:e.state,date:c},d):_.jsx("td",{},d))},u))})]})]})},Hd=({minDate:e,maxDate:t,value:n,time:r,hiddenHeader:i,handlerChangeTime:a,timeLabel:o,type:s})=>{const l=e?new Date(e):null,u=t?new Date(t):null,c=l==null?void 0:l.getHours(),d=u==null?void 0:u.getHours(),h=l==null?void 0:l.getMinutes(),f=u==null?void 0:u.getMinutes(),[g,p]=I.useState(!0),m=(C,E,w)=>Array.from({length:(E-C)/w+1},(B,y)=>C+y*w),b=(C,E)=>{typeof a=="function"&&a({hour:C,minut:E,second:r==null?void 0:r.second})},v=()=>{const C=document.getElementById(`calendar-hour-${r==null?void 0:r.hour}-${s}`),E=document.getElementById(`calendar-minut-${r==null?void 0:r.minut}-${s}`),w=document.getElementById(`wrapper-calendar-hour-${s}`),B=document.getElementById(`wrapper-calendar-minut-${s}`);C&&w&&w.scrollTo({behavior:"instant",top:C.offsetTop-78}),E&&B&&B.scrollTo({behavior:"instant",top:E.offsetTop-78})},x=(C,E)=>{let w=!0;if(l&&n){const B=n.year===l.getFullYear(),y=n.month===l.getMonth()+1;n.day===l.getDate()&&y&&B?(E==="hour"&&C<(c??0)||E==="minut"&&((r==null?void 0:r.hour)??0)<=l.getHours()&&C<(h??0))&&(w=!1):n.toDate(Kn()).getTime()<l.getTime()&&(w=!1)}if(u&&n){const B=n.year===u.getFullYear(),y=n.month===u.getMonth()+1;n.day===u.getDate()&&y&&B?(E==="hour"&&C>(d??0)||E==="minut"&&((r==null?void 0:r.hour)??0)>=u.getHours()&&C>(f??0))&&(w=!1):n.toDate(Kn()).getTime()>u.getTime()&&(w=!1)}return w};return I.useEffect(()=>{g&&v(),r&&p(!1)},[JSON.stringify(n),JSON.stringify(r)]),_.jsxs("div",{className:Fe["custom-time-calendar"],children:[!i&&_.jsx("div",{className:Fe["header-time"],children:o||"Atur Waktu"}),_.jsxs("div",{className:Fe["type-time"],children:[_.jsx("div",{children:"Jam"}),_.jsx("div",{children:"Menit"})]}),_.jsxs("div",{className:"1ru-flex 1ru-justify-around",children:[_.jsx("div",{id:`wrapper-calendar-hour-${s}`,className:Fe["container-cell-time"],children:m(0,23,1).map(C=>_.jsx("div",{id:`calendar-hour-${C}-${s}`,className:`${Fe["cell-time"]} ${(r==null?void 0:r.hour)===C?x(C,"hour")?Fe.selected:Fe.error:""} ${x(C,"hour")&&(r==null?void 0:r.hour)!=C?Fe.valid:Fe.invalid}`,onClick:()=>{x(C,"hour")&&b(C,r==null?void 0:r.minut)},children:C<10?`0${C}`:C},C))}),_.jsx("div",{id:`wrapper-calendar-minut-${s}`,className:Fe["container-cell-time"],children:m(0,59,1).map(C=>_.jsx("div",{id:`calendar-minut-${C}-${s}`,className:`${Fe["cell-time"]} ${(r==null?void 0:r.minut)===C?x(C,"minut")?Fe.selected:Fe.error:""} ${x(C,"minut")&&(r==null?void 0:r.minut)!=C?Fe.valid:Fe.invalid}`,onClick:()=>{x(C,"minut")&&b(r==null?void 0:r.hour,C)},children:C<10?`0${C}`:C},C))})]})]})},Mf=e=>{var h,f,g,p,m,b,v,x,C;const t=e.typeTime??"SINGLE",n=iw({...e,locale:e.locale,createCalendar:_u}),{title:r}=yS(e,n),[i,a]=I.useState((e==null?void 0:e.activeType)??"date"),[o,s]=I.useState({start:void 0,end:void 0}),l=((f=(h=o.start)==null?void 0:h.hour)==null?void 0:f.toString())&&((p=(g=o==null?void 0:o.start)==null?void 0:g.minut)==null?void 0:p.toString())&&((v=e.value)==null?void 0:v.toDate(Kn()).setHours((m=o.start)==null?void 0:m.hour,(b=o.start)==null?void 0:b.minut))||e.minDate,u=e.maxDate,c=(E,w)=>{const B={...o,[w]:E};s(B),typeof(e==null?void 0:e.handlerChangeTime)=="function"&&e.handlerChangeTime(B)},d=E=>{n.setValue(E)};return ba(()=>{e!=null&&e.activeType&&a(e.activeType)},[e==null?void 0:e.activeType]),I.useEffect(()=>{var E,w;if((E=e.time)!=null&&E.start&&((w=e.time)!=null&&w.end)){const B=e.time.start,y=e.time.end;s({start:B,end:y})}},[JSON.stringify(e.time)]),_.jsxs("div",{className:"1ru-text-laba-base-sr",children:[i==="date"&&_.jsx(_.Fragment,{children:_.jsxs("div",{className:Fe["container-calendar"],children:[_.jsxs("div",{className:"1ru-flex 1ru-gap-2",children:[_.jsx(pH,{state:n,setActiveTypeCalendar:a,...e}),(e==null?void 0:e.isCustomTime)&&_.jsxs("div",{className:"1ru-flex",children:[_.jsx(Hd,{minDate:e.minDate,maxDate:e.maxDate,time:(x=e.time)==null?void 0:x.start,value:e.value,timeLabel:t==="RANGE"?"Awal":"Atur Waktu",type:"start",handlerChangeTime:E=>c(E,"start")}),t==="RANGE"&&_.jsx(Hd,{minDate:l,maxDate:u,time:(C=e.time)==null?void 0:C.end,value:e.value,timeLabel:"Akhir",type:"end",handlerChangeTime:E=>c(E,"end")})]})]}),((e==null?void 0:e.withConfirm)??(e==null?void 0:e.isCustomTime))&&_.jsxs("div",{className:`${Fe["footer-calendar"]}`,children:[typeof(e==null?void 0:e.buttonReset)=="function"?_.jsx("div",{onClick:()=>e.handlerReset(n),children:e.buttonReset()}):_.jsx(jn,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(n),children:"Reset"}),typeof(e==null?void 0:e.buttonSubmit)=="function"?_.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):_.jsx(jn,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})}),i==="month"&&_.jsx(Ww,{state:n,setActiveTypeCalendar:a,type:e.type,onChangeMonth:d,hiddenHeader:e.hiddenHeader}),i==="year"&&_.jsx(W2,{state:n,type:e.type,setActiveTypeCalendar:a,title:r,onChangeYear:d,hiddenHeader:e.hiddenHeader})]})},mH=e=>{var C,E,w,B,y,S,D,A,T,F,k,P;const t=I.useRef(null),{locale:n}=Mr(),r=sH({...e,locale:n,createCalendar:_u}),i=$=>{let R="";switch($){case 0:R="Min";break;case 1:R="Sen";break;case 2:R="Sel";break;case 3:R="Rab";break;case 4:R="Kam";break;case 5:R="Jum";break;case 6:R="Sab";break}return R},{calendarProps:a,prevButtonProps:o,nextButtonProps:s,title:l}=XV(e,r,t),{gridProps:u,headerProps:c,weekDays:d}=xS({},r),h=N3(r.visibleRange.start,n),[f,g]=I.useState("date"),[p,m]=I.useState({start:void 0,end:void 0}),b=((E=(C=p.start)==null?void 0:C.hour)==null?void 0:E.toString())&&((B=(w=p==null?void 0:p.start)==null?void 0:w.minut)==null?void 0:B.toString())&&((A=(y=e.value)==null?void 0:y.start)==null?void 0:A.toDate(Kn()).setHours((S=p.start)==null?void 0:S.hour,(D=p.start)==null?void 0:D.minut))||e.minDate,v=e.maxDate,x=($,R)=>{const O={...p,[R]:$};m(O),typeof(e==null?void 0:e.handlerChangeTimeRange)=="function"&&e.handlerChangeTimeRange(O)};return I.useEffect(()=>{var $,R;if(($=e.time)!=null&&$.start&&((R=e.time)!=null&&R.end)){const O=e.time.start,j=e.time.end;m({start:O,end:j})}},[JSON.stringify(e.time)]),_.jsxs("div",{className:"1ru-text-laba-base-sr",children:[f==="date"&&_.jsx(_.Fragment,{children:_.jsx("div",{...a,ref:t,children:_.jsxs("div",{className:Fe["container-calendar"],children:[_.jsxs("div",{className:"1ru-flex 1ru-gap-2",children:[_.jsxs("div",{children:[_.jsxs("div",{className:Fe["header-calendar"],children:[_.jsx(Es,{...o,children:typeof(e==null?void 0:e.prevIcon)=="function"||I.isValidElement(e==null?void 0:e.prevIcon)?I.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():_.jsx(li,{className:"1ru-rotate-90"})}),_.jsx("div",{className:Fe["header-button-calendar"],onClick:()=>g("month"),children:l}),_.jsx(Es,{...s,children:typeof(e==null?void 0:e.nextIcon)=="function"||I.isValidElement(e==null?void 0:e.nextIcon)?I.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():_.jsx(li,{className:"-1ru-rotate-90"})})]}),_.jsxs("table",{...u,cellPadding:"0",className:"flex-1",children:[_.jsx("thead",{...c,className:"text-gray-600",children:_.jsx("tr",{children:d.map(($,R)=>_.jsx("th",{className:Fe["days-calendar"],children:i(R)},R))})}),_.jsx("tbody",{children:[...new Array(h).keys()].map($=>_.jsx("tr",{children:r.getDatesInWeek($).map((R,O)=>R?_.jsx(jw,{state:r,date:R},O):_.jsx("td",{},O))},$))})]})]}),(e==null?void 0:e.isCustomTime)&&_.jsxs("div",{className:"1ru-flex",children:[_.jsx(Hd,{minDate:e.minDate,maxDate:e.maxDate,time:(T=e.time)==null?void 0:T.start,value:(F=e.value)==null?void 0:F.start,timeLabel:"Awal",type:"start",handlerChangeTime:$=>x($,"start")}),_.jsx(Hd,{minDate:b,maxDate:v,time:(k=e.time)==null?void 0:k.end,value:(P=e.value)==null?void 0:P.end,timeLabel:"Akhir",type:"end",handlerChangeTime:$=>x($,"end")})]})]}),e.withConfirm&&_.jsxs("div",{className:Fe["footer-calendar"],children:[typeof(e==null?void 0:e.buttonReset)=="function"?_.jsx("div",{onClick:()=>e.handlerReset(r),children:e.buttonReset()}):_.jsx(jn,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(r),children:"Reset"}),typeof(e==null?void 0:e.buttonSubmit)=="function"?_.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):_.jsx(jn,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})})}),f==="month"&&_.jsx(Ww,{state:r,setActiveTypeCalendar:g,type:["date","month","year"]}),f==="year"&&_.jsx(W2,{state:r,setActiveTypeCalendar:g,title:l,type:["date","month","year"]})]})},zw=e=>{const t=gH(e),n=I.useRef(null),{calendarProps:r}=oH(e,t,n);return _.jsx("div",{ref:n,children:_.jsx(mH,{handlerReset:e.handlerReset,handlerSubmit:e.handlerSubmit,withConfirm:e.withConfirm,prevIcon:e.prevIcon,nextIcon:e.nextIcon,buttonReset:e.buttonReset,buttonSubmit:e.buttonSubmit,isCustomTime:e.isCustomTime,time:e.time,minDate:e.minDate,maxDate:e.maxDate,handlerChangeTimeRange:e.handlerChangeTimeRange,...r})})},oc=e=>{let t;const n=new Date(e??new Date);return e&&(t=Cm(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},bH=e=>{const{minDate:t,maxDate:n,value:r,defaultValue:i,withConfirm:a=!1,isCustomTime:o=!1,className:s,classNameButton:l,buttonClick:u,buttonReset:c,buttonSubmit:d,prevIcon:h,nextIcon:f,onChange:g,id:p="date-picker",idPopover:m="date-picker-popover",floatingOptions:b={},offsetPopover:v=5,zIndexPopper:x=1,hiddenHeader:C}=e,E=_a(),{locale:w}=Mr(),B=oc(t),y=oc(n),S=I.useRef(null),[D,A]=I.useState(),[T,F]=I.useState(),k=j=>{var ee;const V=new Date;let W=j.toDate(Kn());W.setHours(V.getHours(),V.getMinutes(),V.getSeconds());const U=t?new Date(t):null,K=n?new Date(n):null;if(o){if(W=new Date(new Date(W).setHours((T==null?void 0:T.hour)??0,T==null?void 0:T.minut,T==null?void 0:T.second)),U&&(U==null?void 0:U.toDateString())===new Date(W).toDateString()&&(U==null?void 0:U.toTimeString())>=(W==null?void 0:W.toTimeString())){if(U&&(U.getHours()>W.getHours()||U.getHours()===W.getHours()&&U.getMinutes()>W.getMinutes()))return;W=new Date(U.setSeconds(U.getSeconds()+1))}if(K&&(K==null?void 0:K.toDateString())===new Date(W).toDateString()&&(K==null?void 0:K.toTimeString())<(W==null?void 0:W.toTimeString())){if(K&&(K.getHours()<W.getHours()||K.getHours()===W.getHours()&&K.getMinutes()<W.getMinutes()))return;W=new Date(K.setSeconds(K.getSeconds()-1))}}else U&&E.format(W)===E.format(U)&&U.getTime()>=W.getTime()?W=new Date(U.setSeconds(U.getSeconds()+1)):K&&E.format(W)===E.format(K)&&K.getTime()<=W.getTime()&&(W=new Date(K.setSeconds(K.getSeconds()-1)));typeof g=="function"&&(g(W),(ee=S.current)==null||ee.setShow(!1))},P=(j,V)=>{A(j),(V??(!a&&!o))&&k(j)},$=j=>{const{start:V}=j;F(V)},R=j=>{const V=new Date(r??new Date);F({hour:V.getHours(),minut:V.getMinutes(),second:V.getSeconds()}),A(oc(r))},O=()=>{D&&P(D,!0)};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:p,onClick:j=>{var V;(V=S.current)==null||V.handlerShow(j),R()},className:l,children:typeof u=="function"?u(r):r?new Date(r).toDateString():"Pilih Tanggal"}),_.jsx(pi,{zIndex:x,ref:S,offset:v,id:m,floatingOptions:{placement:"bottom-end",...b},children:_.jsx("div",{className:s??"",children:_.jsx(Fm,{locale:"id-ID",children:_.jsx(Mf,{minValue:B,maxValue:y,minDate:t,maxDate:n,time:{start:T},locale:w,value:D,typeTime:"SINGLE",buttonReset:c,buttonSubmit:d,prevIcon:h,nextIcon:f,createCalendar:_u,defaultValue:oc(r),onChange:P,handlerReset:()=>{var j;typeof g=="function"&&(g(i),(j=S.current)==null||j.setShow(!1))},handlerSubmit:O,handlerChangeTime:$,withConfirm:a,isCustomTime:o,type:["date","month","year"],hiddenHeader:C})})})})]})},Gh=e=>{let t;const n=new Date(e??new Date);return e&&(t=Cm(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},ry=e=>{const t=new Date((e==null?void 0:e.startDate)??new Date),n=new Date((e==null?void 0:e.endDate)??new Date),r=new Vt(t.getFullYear(),t.getMonth()+1,t.getDate()),i=new Vt(n.getFullYear(),n.getMonth()+1,n.getDate());return e?{start:r,end:i}:void 0},Gw=e=>{const{minDate:t,maxDate:n,defaultValue:r,withConfirm:i,prevIcon:a,nextIcon:o,buttonReset:s,buttonSubmit:l,typePicker:u="RANGE",onChange:c,value:d,onReset:h,isCustomTime:f}=e,{locale:g}=Mr(),p=Gh(t),m=Gh(n),[b,v]=I.useState(),[x,C]=I.useState({start:void 0,end:void 0}),E=D=>{typeof c=="function"&&c(D)},w=(D,A)=>{const T=D.start.toDate(Kn()),F=D.end.toDate(Kn());v(D),C({start:{hour:0,minut:0,second:0},end:{hour:23,minut:59,second:59}}),(A??!i)&&E({startDate:T,endDate:new Date(F.setHours(23,59,59))})},B=(D,A)=>{var T,F,k,P,$,R,O,j;if(b!=null&&b.start&&(b!=null&&b.end)&&(C(D),(F=(T=D.start)==null?void 0:T.hour)!=null&&F.toString()&&((P=(k=D.start)==null?void 0:k.minut)!=null&&P.toString())&&((R=($=D.end)==null?void 0:$.hour)!=null&&R.toString())&&((j=(O=D.end)==null?void 0:O.minut)!=null&&j.toString())&&(A??!i))){const V=b.start.toDate(Kn()),W=b.end.toDate(Kn()),U=new Date(V.setHours(D.start.hour,D.start.minut)),K=new Date(W.setHours(D.end.hour,D.end.minut,59));U.getTime()<K.getTime()&&E({startDate:U,endDate:K})}},y=D=>{if(typeof h=="function")h();else if(r&&D){const A=new Date(r.endDate??new Date),T=D.focusedDate.set({month:A.getMonth()+1,year:A.getFullYear()});D.setFocusedDate(T)}v(ry(r))},S=()=>{b&&(f?B(x,!0):w(b,!0))};return I.useEffect(()=>{if(d!=null&&d.endDate&&(d!=null&&d.startDate)){const D=new Date(d.startDate),A=new Date(d.endDate),T=D.getHours(),F=D.getMinutes(),k=A.getHours(),P=A.getMinutes(),$=Bn(Sv(D,Kn())),R=Bn(Sv(A,Kn()));v({start:$,end:R}),C({start:{hour:T,minut:F},end:{hour:k,minut:P}})}},[JSON.stringify(d)]),_.jsx("div",{className:"1ru-flex 1ru-flex-col",children:_.jsxs(Fm,{locale:"id-ID",children:[u==="RANGE"&&_.jsx(zw,{defaultValue:ry(r),value:b,minValue:p,maxValue:m,withConfirm:i,prevIcon:a,nextIcon:o,buttonReset:s,buttonSubmit:l,onChange:w,isCustomTime:f,handlerReset:y,handlerSubmit:S,time:x,minDate:t,maxDate:n,handlerChangeTimeRange:B}),u==="SINGLE"&&_.jsx(Mf,{defaultValue:Gh(r==null?void 0:r.endDate),value:b==null?void 0:b.end,minValue:p,maxValue:m,minDate:t,maxDate:n,withConfirm:i,prevIcon:a,nextIcon:o,buttonReset:s,buttonSubmit:l,locale:g,time:x,typeTime:"RANGE",handlerChangeTime:B,isCustomTime:f,createCalendar:_u,onChange:D=>w({start:D,end:D}),handlerReset:y,handlerSubmit:S,type:["date","month","year"]})]})})},vH=({value:e,prevIcon:t,nextIcon:n,buttonReset:r,buttonSubmit:i,className:a,classNameButton:o,buttonClick:s,buttonList:l,typePicker:u="RANGE",onChange:c,idPopover:d="filter-date-popover",id:h="filter-date",floatingOptions:f={},offsetPopover:g=5,zIndexPopper:p=0,defaultValueLabel:m,isCustomTime:b=!1,mountedExecuteChange:v=!0,formatingDate:x})=>{const C=[{key:"thisDay",value:"Hari ini"},{key:"thisWeek",value:"Minggu ini"},{key:"thisMonth",value:"Bulan ini"},{key:"thisYear",value:"Tahun ini"},{key:"yesterday",value:"Kemarin"},{key:"lastWeek",value:"Minggu lalu"},{key:"lastMonth",value:"Bulan lalu"},{key:"lastYear",value:"Tahun lalu"},{key:"custom",value:"Kustom"}],E=I.useRef(null),[w,B]=I.useState(),[y,S]=I.useState(),[D,A]=I.useState(),T=(z,H)=>{const X=new Date(z??new Date);return H==="start"?new Date(X.setHours(0,0,0)):new Date(X.setHours(23,59,59))},F=()=>{const z=new Date;return{startDate:z,endDate:z}},k=()=>{const z=new Date;z.setDate(z.getDate()-z.getDay());const H=new Date;return H.setDate(H.getDate()+(6-H.getDay())),{startDate:z,endDate:H}},P=()=>{const z=new Date,H=new Date(z.getFullYear(),z.getMonth(),1),X=new Date(z.getFullYear(),z.getMonth()+1,0);return{startDate:H,endDate:X}},$=()=>{const z=new Date(new Date().getFullYear(),0,1),H=new Date(new Date().getFullYear(),11,31);return{startDate:z,endDate:H}},R=()=>{const z=new Date(new Date().setDate(new Date().getDate()-1));return{startDate:z,endDate:z}},O=()=>{const z=new Date;z.setDate(z.getDate()-(7+z.getDay()));const H=new Date;return H.setDate(H.getDate()-(H.getDay()+1)),{startDate:z,endDate:H}},j=()=>{const z=new Date,H=new Date(z.getFullYear(),z.getMonth()-1,1),X=new Date(z.getFullYear(),z.getMonth(),0);return{startDate:H,endDate:X}},V=()=>{const z=new Date(new Date().getFullYear()-1,0,1),H=new Date(new Date().getFullYear()-1,11,31);return{startDate:z,endDate:H}},W=(z,H,X)=>{var te;if(A(z),typeof c=="function"){let ie=z;x==="string"&&z?ie={startDate:Jo(z.startDate,x),endDate:Jo(z.endDate,x)}:typeof x=="boolean"&&z&&(ie={startDate:Jo(z.startDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),endDate:Jo(z.endDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}),(te=E.current)==null||te.setShow(!1),c(ie,H??"",X)}},U=(z,H)=>{B(z);let X;if((z==null?void 0:z.key)!=="custom"){switch(S(z),z==null?void 0:z.key){case"thisDay":X=F();break;case"thisWeek":X=k();break;case"thisMonth":X=P();break;case"thisYear":X=$();break;case"yesterday":X=R();break;case"lastWeek":X=O();break;case"lastMonth":X=j();break;case"lastYear":X=V();break}X&&H&&W({startDate:T(X.startDate,"start"),endDate:T(X.endDate,"end")},z==null?void 0:z.value,z)}},K=(z,H)=>{const X=(l??C).find(te=>te.key===z);!z&&!X?(H&&W(),U(void 0,H),S(void 0)):typeof z=="object"?(H&&W({startDate:T(z.startDate,"start"),endDate:T(z.endDate,"end")},"Kustom",{key:"custom",value:"Kustom"}),U({key:"custom",value:"Kustom"},H),S({key:"custom",value:"Kustom"})):(U(X,H),S(X))},ee=()=>{var z;if(e){A(e);const H=(z=l??C)==null?void 0:z.find(X=>X.key===e.label||X.value===e.label);Object.keys(H||{}).length>0&&B(H)}else B(void 0),S(void 0)};return I.useEffect(()=>{ee()},[JSON.stringify(e)]),I.useEffect(()=>{K(m??e,v)},[]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{onClick:z=>{var H;(H=E.current)==null||H.handlerShow(z),ee()},className:o,id:h,children:[I.isValidElement(s)&&s,typeof s=="function"?s(D,y):"Pilih Filter"]}),_.jsx(pi,{zIndex:p,ref:E,offset:g,id:d,floatingOptions:{placement:"bottom-end",...f},children:_.jsxs("div",{className:`${Fe["container-filter-date"]} ${a}`,children:[_.jsxs("div",{children:[(l??C).map((z,H)=>_.jsx("div",{className:`${Fe["button-filter-date"]} hover:1ru-bg-laba-blue-01 ${(w==null?void 0:w.key)===z.key?"1ru-text-laba-blue-10":""}`,onClick:()=>U(z,!0),children:z.value},H)),(w==null?void 0:w.key)!=="custom"&&_.jsx(_.Fragment,{children:typeof r=="function"?_.jsx("div",{className:Fe["button-filter-date-custome"],onClick:()=>K(m,!0),children:r()}):_.jsx(jn,{className:Fe["button-reset-filter-date"],variants:"nude-laba-blue-10",size:"small",onClick:()=>K(m,!0),children:"Reset"})})]}),(w==null?void 0:w.key)==="custom"&&_.jsx("div",{children:_.jsx(Gw,{defaultValue:D,value:D,prevIcon:t,nextIcon:n,buttonReset:r,buttonSubmit:i,isCustomTime:b,onChange:z=>{W(z,"Kustom",{key:"custom",value:"Kustom"}),S({key:"custom",value:"Kustom"})},onReset:()=>{K(m,!0)},typePicker:u,withConfirm:!0})})]})})]})},yH="_active_lii0v_506",xH="_disabled_lii0v_509",Jt={"title-switch-payhere":"_title-switch-payhere_lii0v_73","description-switch-payhere":"_description-switch-payhere_lii0v_109","title-switch-laba":"_title-switch-laba_lii0v_247","description-switch-laba":"_description-switch-laba_lii0v_271","title-switch-bill":"_title-switch-bill_lii0v_385","description-switch-bill":"_description-switch-bill_lii0v_421","switch-l":"_switch-l_lii0v_493","switch-payhere":"_switch-payhere_lii0v_493",active:yH,disabled:xH,"disabled-nonactive":"_disabled-nonactive_lii0v_512","thumb-switch":"_thumb-switch_lii0v_515","switch-laba":"_switch-laba_lii0v_532","switch-bill":"_switch-bill_lii0v_571","switch-r":"_switch-r_lii0v_611","switch-s":"_switch-s_lii0v_729"},sc={size:{large:Jt["switch-l"],regular:Jt["switch-r"],small:Jt["switch-s"]},kind:{laba:Jt["switch-laba"],payhere:Jt["switch-payhere"],bill:Jt["switch-bill"]},text:{title:{laba:Jt["title-switch-laba"],payhere:Jt["title-switch-payhere"],bill:Jt["title-switch-bill"]},desc:{laba:Jt["description-switch-laba"],payhere:Jt["description-switch-payhere"],bill:Jt["description-switch-bill"]}}},CH=({value:e,disabled:t,title:n="",description:r="",size:i="regular",kind:a="payhere",id:o,className:s,classNameTitle:l,classNameDesc:u,onChange:c})=>{const d=()=>{!t&&typeof c=="function"&&c(!e)};return _.jsxs("div",{className:`1ru-flex 1ru-gap-2 ${s??""}`,onClick:h=>h.stopPropagation(),children:[_.jsxs("label",{children:[_.jsx("input",{id:o??"1ru-switch",type:"checkbox",checked:e,onChange:d,className:"1ru-hidden"}),_.jsx("span",{className:`${sc.size[i]} ${sc.kind[a]} ${e?Jt.active:""} ${t?Jt.disabled:""} ${!e&&t?Jt["disabled-nonactive"]:""}`,children:_.jsx("span",{className:`${Jt["thumb-switch"]} ${e?Jt.active:""} ${t?Jt.disabled:""} ${!e&&t?Jt["disabled-nonactive"]:""}`})})]}),(n||r)&&_.jsxs("div",{children:[n&&_.jsx("div",{className:`${sc.text.title[a]} ${l}`,children:n}),r&&_.jsx("div",{className:`${sc.text.desc[a]} ${u}`,children:r})]})]})},EH="_loading_b0du1_482",Me={"button-l":"_button-l_b0du1_67","button-m":"_button-m_b0du1_67","button-s":"_button-s_b0du1_115","button-xs":"_button-xs_b0du1_115","button-large":"_button-large_b0du1_241","button-reguler":"_button-reguler_b0du1_241","button-small":"_button-small_b0du1_259","button-extra-small":"_button-extra-small_b0du1_259","button-bill-l":"_button-bill-l_b0du1_379","button-bill-m":"_button-bill-m_b0du1_379","button-bill-s":"_button-bill-s_b0du1_427","button-bill-xs":"_button-bill-xs_b0du1_427","button-bill-xxs":"_button-bill-xxs_b0du1_427",loading:EH,"nude-laba-red-05":"_nude-laba-red-05_b0du1_497","nude-laba-red-10":"_nude-laba-red-10_b0du1_497","nude-gray-500":"_nude-gray-500_b0du1_497","nude-green-700":"_nude-green-700_b0du1_497","nude-red-700":"_nude-red-700_b0du1_497","nude-laba-blue-10":"_nude-laba-blue-10_b0du1_497","ghost-laba-green-10":"_ghost-laba-green-10_b0du1_497","ghost-blue-gray-100-bg_white":"_ghost-blue-gray-100-bg_white_b0du1_497","ghost-green-700":"_ghost-green-700_b0du1_497","ghost-red-700":"_ghost-red-700_b0du1_497","ghost-laba-blue-10":"_ghost-laba-blue-10_b0du1_497","filled-laba-white_laba-red-05":"_filled-laba-white_laba-red-05_b0du1_497","filled-laba-white_laba-blue-10":"_filled-laba-white_laba-blue-10_b0du1_497","primary-green-700-dsb_laba-grey-06":"_primary-green-700-dsb_laba-grey-06_b0du1_497","primary-red-700-dsb_laba-grey-06":"_primary-red-700-dsb_laba-grey-06_b0du1_497","primary-laba-blue-10":"_primary-laba-blue-10_b0du1_497","primary-bill-red-700":"_primary-bill-red-700_b0du1_497","tertiary-bill-secondary-800":"_tertiary-bill-secondary-800_b0du1_497","secondary-bill-secondary-800":"_secondary-bill-secondary-800_b0du1_497","primary-bill-primary-600":"_primary-bill-primary-600_b0du1_497","tertiary-gray-500":"_tertiary-gray-500_b0du1_497","tertiary-red-600":"_tertiary-red-600_b0du1_497","tertiary-red-300":"_tertiary-red-300_b0du1_497","tertiary-blue-700":"_tertiary-blue-700_b0du1_497","secondary-green-600":"_secondary-green-600_b0du1_497","secondary-red-700":"_secondary-red-700_b0du1_497","secondary-red-600":"_secondary-red-600_b0du1_497","secondary-blue-700":"_secondary-blue-700_b0du1_497","primary-red-700":"_primary-red-700_b0du1_497","primary-blue-700":"_primary-blue-700_b0du1_497","icon-loading":"_icon-loading_b0du1_595"},Uh={size:{large:Me["button-large"],reguler:Me["button-reguler"],small:Me["button-small"],"extra-small":Me["button-extra-small"],l:Me["button-l"],m:Me["button-m"],s:Me["button-s"],xs:Me["button-xs"],"bill-l":Me["button-bill-l"],"bill-m":Me["button-bill-m"],"bill-s":Me["button-bill-s"],"bill-xs":Me["button-bill-xs"],"bill-xxs":Me["button-bill-xxs"]},loadingSize:{large:"1ru-size-6",reguler:"1ru-size-5",small:"1ru-size-5","extra-small":"1ru-size-5",l:"1ru-size-6",m:"1ru-size-5",s:"1ru-size-5",xs:"1ru-size-5","bill-l":"1ru-size-6","bill-m":"1ru-size-5","bill-s":"1ru-size-5","bill-xs":"1ru-size-5","bill-xxs":"1ru-size-5"},variants:{"primary-laba-blue-10":Me["primary-laba-blue-10"],"primary-red-700-dsb_laba-grey-06":Me["primary-red-700-dsb_laba-grey-06"],"primary-green-700-dsb_laba-grey-06":Me["primary-green-700-dsb_laba-grey-06"],"filled-laba-white_laba-blue-10":Me["filled-laba-white_laba-blue-10"],"filled-laba-white_laba-red-05":Me["filled-laba-white_laba-red-05"],"ghost-laba-blue-10":Me["ghost-laba-blue-10"],"ghost-red-700":Me["ghost-red-700"],"ghost-green-700":Me["ghost-green-700"],"ghost-laba-green-10":Me["ghost-laba-green-10"],"nude-laba-blue-10":Me["nude-laba-blue-10"],"nude-red-700":Me["nude-red-700"],"nude-green-700":Me["nude-green-700"],"nude-gray-500":Me["nude-gray-500"],"primary-blue-700":Me["primary-blue-700"],"secondary-blue-700":Me["secondary-blue-700"],"tertiary-blue-700":Me["tertiary-blue-700"],"ghost-blue-gray-100-bg_white":Me["ghost-blue-gray-100-bg_white"],"secondary-red-600":Me["secondary-red-600"],"tertiary-red-300":Me["tertiary-red-300"],"tertiary-gray-500":Me["tertiary-gray-500"],"tertiary-red-600":Me["tertiary-red-600"],"secondary-green-600":Me["secondary-green-600"],"nude-laba-red-10":Me["nude-laba-red-10"],"nude-laba-red-05":Me["nude-laba-red-05"],"primary-red-700":Me["primary-red-700"],"secondary-red-700":Me["secondary-red-700"],"primary-bill-primary-600":Me["primary-bill-primary-600"],"secondary-bill-secondary-800":Me["secondary-bill-secondary-800"],"tertiary-bill-secondary-800":Me["tertiary-bill-secondary-800"],"primary-bill-red-700":Me["primary-bill-red-700"]}},SH=({className:e=""})=>_.jsx("svg",{className:`${Me["icon-loading"]} ${e??""}`,xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:_.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 \r
107
107
  16.8106 0.800956C14.2782 -0.173807 11.4901 -0.261467 8.90143 0.552281C6.31275 1.36603 4.07629 \r
108
108
  3.03314 2.55704 5.28155C1.0378 7.52995 0.325454 10.2269 0.536268 12.9323C0.747083 15.6376 1.86861 \r
109
109
  18.1917 3.71782 20.1776C5.56702 22.1635 8.03473 23.4641 10.7182 23.867C13.4017 24.2699 16.1425 23.7514 \r
@@ -124,14 +124,14 @@ You should wrap it with \`css\` like this:
124
124
  ${p()} ${m()} ${u?ni.disabled:""} ${l??""}`,htmlFor:n??t,children:[_.jsx(Lf,{id:n,name:t,type:r,disabled:u,...e,...g}),_.jsxs("div",{children:[_.jsx("p",{className:`${ni.label}
125
125
  ${i?`${Ci.typographyLabel[i]} custom-typography`:""}`,children:d}),_.jsx("p",{className:`${ni.desc} ${a?`${Ci.typographyDesc[a]} custom-typography`:""}`,children:h})]})]})},$H="_urls_a8mrw_85",kH="_action_a8mrw_115",PH="_url_a8mrw_85",FH="_active_a8mrw_506",no={"blue-700":"_blue-700_a8mrw_85",urls:$H,action:kH,"laba-blue-10":"_laba-blue-10_a8mrw_241","bill-secondary-800":"_bill-secondary-800_a8mrw_397",url:PH,active:FH},iy={"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"},lc={fonts:va,variants:{"laba-blue-10":no["laba-blue-10"],"blue-700":no["blue-700"],"bill-secondary-800":no["bill-secondary-800"]},gapAction:iy,gapUrls:iy},NH=({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:d,onClickUrls:h,separator:f=">",propsLink:g,classNameAction:p,classNameUrl:m,renderAction:b,...v})=>{const x=e??"div",C=E=>!!(Array.isArray(r)&&r.length>0&&r.length-1===E);return _.jsxs("div",{className:`${lc.fonts[n]} ${lc.variants[t]}
126
126
  ${l??""}`,...v,children:[d&&_.jsxs("div",{onClick:d,className:`${no.action} ${p??""}
127
- ${o?lc.gapAction[o]:""}`,children:[c,u]}),typeof b=="function"&&b(),_.jsx("div",{className:`${no.urls} ${s?lc.gapUrls[s]:""}`,children:r==null?void 0:r.map((E,w)=>_.jsxs(I.Fragment,{children:[_.jsx(x,{className:`${no.url} ${C(w)?no.active:""} ${m??""}`,onClick:()=>{(a==null?void 0:a[w])!==void 0&&typeof a[w]=="function"?a[w]():typeof h=="function"&&h(E)},...g?g(E,w,r):{},children:i[w]}),!C(w)&&_.jsx(_.Fragment,{children:f})]},w))})]})},MH="_sidebar_1ibru_484",Wt={"splace-screen":"_splace-screen_1ibru_469","payhere-brand-base-white":"_payhere-brand-base-white_1ibru_481",sidebar:MH,"button-collaps-sidebar":"_button-collaps-sidebar_1ibru_499","menu-sidebar":"_menu-sidebar_1ibru_516","sidebar-open":"_sidebar-open_1ibru_547","container-icon-company-sidebar":"_container-icon-company-sidebar_1ibru_564","icon-company-sidebar":"_icon-company-sidebar_1ibru_567","sidebar-close":"_sidebar-close_1ibru_575","content-sidebar":"_content-sidebar_1ibru_600","payhere-brand-base-transparent":"_payhere-brand-base-transparent_1ibru_679","payhere-brand-blue-gray-900-transparent":"_payhere-brand-blue-gray-900-transparent_1ibru_877","payhere-brand-indigo-900-transparent":"_payhere-brand-indigo-900-transparent_1ibru_1075","laba-white":"_laba-white_1ibru_1273","lpd-brand-base-white":"_lpd-brand-base-white_1ibru_1663","lpd-brand-base-transparent":"_lpd-brand-base-transparent_1ibru_1861","lpd-brand-base-white-responsive":"_lpd-brand-base-white-responsive_1ibru_2059","lpd-brand-base-transparent-responsive":"_lpd-brand-base-transparent-responsive_1ibru_2293","bill-brand-base-white":"_bill-brand-base-white_1ibru_2527","bill-brand-base-white-responsive":"_bill-brand-base-white-responsive_1ibru_2931"},LH="_hidden_1mpkd_557",OH="_active_1mpkd_606",Fe={"item-sidebar-1":"_item-sidebar-1_1mpkd_115","sidebar-payhere-blue-gray-800":"_sidebar-payhere-blue-gray-800_1mpkd_115","item-label":"_item-label_1mpkd_115","sidebar-payhere-indigo-800":"_sidebar-payhere-indigo-800_1mpkd_115","sidebar-payhere":"_sidebar-payhere_1mpkd_115","sidebar-laba":"_sidebar-laba_1mpkd_115","sidebar-lpd":"_sidebar-lpd_1mpkd_115","item-sidebar-2":"_item-sidebar-2_1mpkd_115","sidebar-bill":"_sidebar-bill_1mpkd_427","item-icon-subs":"_item-icon-subs_1mpkd_469","end-icon":"_end-icon_1mpkd_469","item-icon":"_item-icon_1mpkd_469","item-sidebar-open":"_item-sidebar-open_1mpkd_514","item-sidebar-close":"_item-sidebar-close_1mpkd_529","item-subs-sidebar":"_item-subs-sidebar_1mpkd_545",hidden:LH,"divider-item-sidebar-payhere":"_divider-item-sidebar-payhere_1mpkd_567","divider-item-sidebar-lpd":"_divider-item-sidebar-lpd_1mpkd_572","parent-sidebar-5":"_parent-sidebar-5_1mpkd_587","parent-sidebar-6":"_parent-sidebar-6_1mpkd_591","parent-sidebar-7":"_parent-sidebar-7_1mpkd_595","parent-sidebar-8":"_parent-sidebar-8_1mpkd_600",active:OH},Ki={variant:{"payhere-brand-base-white":Fe["sidebar-payhere"],"payhere-brand-base-transparent":Fe["sidebar-payhere"],"payhere-brand-indigo-900-transparent":Fe["sidebar-payhere-indigo-800"],"payhere-brand-blue-gray-900-transparent":Fe["sidebar-payhere-blue-gray-800"],"laba-white":Fe["sidebar-laba"],"lpd-brand-base-white":Fe["sidebar-lpd"],"lpd-brand-base-transparent":Fe["sidebar-lpd"],"lpd-brand-base-white-responsive":Fe["sidebar-lpd"],"lpd-brand-base-transparent-responsive":Fe["sidebar-lpd"],"bill-brand-base-white":Fe["sidebar-bill"],"bill-brand-base-white-responsive":Fe["sidebar-bill"]},parent:{1:Fe["parent-sidebar-1"],2:Fe["parent-sidebar-2"],3:Fe["parent-sidebar-3"],4:Fe["parent-sidebar-4"],5:Fe["parent-sidebar-5"],6:Fe["parent-sidebar-6"],7:Fe["parent-sidebar-7"],8:Fe["parent-sidebar-8"]},divider:{"payhere-brand-base-white":Fe["divider-item-sidebar-payhere"],"payhere-brand-base-transparent":Fe["divider-item-sidebar-payhere"],"payhere-brand-indigo-900-transparent":Fe["divider-item-sidebar-payhere"],"payhere-brand-blue-gray-900-transparent":Fe["divider-item-sidebar-payhere"],"laba-white":Fe["divider-item-sidebar-laba"],"lpd-brand-base-white":Fe["divider-item-sidebar-lpd"],"lpd-brand-base-transparent":Fe["divider-item-sidebar-lpd"],"lpd-brand-base-white-responsive":Fe["divider-item-sidebar-lpd"],"lpd-brand-base-transparent-responsive":Fe["divider-item-sidebar-lpd"],"bill-brand-base-white":Fe["divider-item-sidebar-bill"],"bill-brand-base-white-responsive":Fe["divider-item-sidebar-bill"]}},Jw=({as:e,show:t,open:n,patch:r,iconSubs:i,variant:a="payhere-brand-base-white",setShow:o,onClickItems:s,propsLink:l,...u})=>{var v,x,C,E,w,B,y,S;let c=_.jsx(_.Fragment,{});const d=e??"div",[h,f]=I.useState(!1),g=r===u.slug,p=t.split("/"),m=p.includes(u.name),b=()=>{if(u.subs.length>0)if(m){const D=p.splice(0,p.indexOf(u.name));D.length>0?o(`${D.join("/")}/`):o("")}else o(`${t}${u.name}/`);else typeof s=="function"&&s(u)};return u.isShow?([1,3,5,6,7,8].includes(u.parent)&&(c=_.jsxs(_.Fragment,{children:[_.jsxs(d,{id:u.name,className:`${Fe["item-sidebar-1"]}
127
+ ${o?lc.gapAction[o]:""}`,children:[c,u]}),typeof b=="function"&&b(),_.jsx("div",{className:`${no.urls} ${s?lc.gapUrls[s]:""}`,children:r==null?void 0:r.map((E,w)=>_.jsxs(I.Fragment,{children:[_.jsx(x,{className:`${no.url} ${C(w)?no.active:""} ${m??""}`,onClick:()=>{(a==null?void 0:a[w])!==void 0&&typeof a[w]=="function"?a[w]():typeof h=="function"&&h(E)},...g?g(E,w,r):{},children:i[w]}),!C(w)&&_.jsx(_.Fragment,{children:f})]},w))})]})},MH="_sidebar_1wcl0_484",Wt={"splace-screen":"_splace-screen_1wcl0_469","payhere-brand-base-white":"_payhere-brand-base-white_1wcl0_481",sidebar:MH,"button-collaps-sidebar":"_button-collaps-sidebar_1wcl0_499","menu-sidebar":"_menu-sidebar_1wcl0_516","sidebar-open":"_sidebar-open_1wcl0_547","container-icon-company-sidebar":"_container-icon-company-sidebar_1wcl0_564","icon-company-sidebar":"_icon-company-sidebar_1wcl0_567","sidebar-close":"_sidebar-close_1wcl0_575","content-sidebar":"_content-sidebar_1wcl0_600","payhere-brand-base-transparent":"_payhere-brand-base-transparent_1wcl0_679","payhere-brand-blue-gray-900-transparent":"_payhere-brand-blue-gray-900-transparent_1wcl0_877","payhere-brand-indigo-900-transparent":"_payhere-brand-indigo-900-transparent_1wcl0_1075","laba-white":"_laba-white_1wcl0_1273","lpd-brand-base-white":"_lpd-brand-base-white_1wcl0_1663","lpd-brand-base-transparent":"_lpd-brand-base-transparent_1wcl0_1861","lpd-brand-base-white-responsive":"_lpd-brand-base-white-responsive_1wcl0_2059","lpd-brand-base-transparent-responsive":"_lpd-brand-base-transparent-responsive_1wcl0_2293","bill-brand-base":"_bill-brand-base_1wcl0_2527","bill-brand-base-responsive":"_bill-brand-base-responsive_1wcl0_2928"},LH="_hidden_rj7lj_557",OH="_active_rj7lj_606",Pe={"item-sidebar-1":"_item-sidebar-1_rj7lj_115","sidebar-payhere-blue-gray-800":"_sidebar-payhere-blue-gray-800_rj7lj_115","item-label":"_item-label_rj7lj_115","sidebar-payhere-indigo-800":"_sidebar-payhere-indigo-800_rj7lj_115","sidebar-payhere":"_sidebar-payhere_rj7lj_115","sidebar-laba":"_sidebar-laba_rj7lj_115","sidebar-lpd":"_sidebar-lpd_rj7lj_115","item-sidebar-2":"_item-sidebar-2_rj7lj_115","sidebar-bill":"_sidebar-bill_rj7lj_427","item-icon-subs":"_item-icon-subs_rj7lj_469","end-icon":"_end-icon_rj7lj_469","item-icon":"_item-icon_rj7lj_469","item-sidebar-open":"_item-sidebar-open_rj7lj_514","item-sidebar-close":"_item-sidebar-close_rj7lj_529","item-icon-subs-active":"_item-icon-subs-active_rj7lj_538","item-subs-sidebar":"_item-subs-sidebar_rj7lj_545",hidden:LH,"divider-item-sidebar-payhere":"_divider-item-sidebar-payhere_rj7lj_567","divider-item-sidebar-lpd":"_divider-item-sidebar-lpd_rj7lj_572","parent-sidebar-5":"_parent-sidebar-5_rj7lj_587","parent-sidebar-6":"_parent-sidebar-6_rj7lj_591","parent-sidebar-7":"_parent-sidebar-7_rj7lj_595","parent-sidebar-8":"_parent-sidebar-8_rj7lj_600",active:OH},Ki={variant:{"payhere-brand-base-white":Pe["sidebar-payhere"],"payhere-brand-base-transparent":Pe["sidebar-payhere"],"payhere-brand-indigo-900-transparent":Pe["sidebar-payhere-indigo-800"],"payhere-brand-blue-gray-900-transparent":Pe["sidebar-payhere-blue-gray-800"],"laba-white":Pe["sidebar-laba"],"lpd-brand-base-white":Pe["sidebar-lpd"],"lpd-brand-base-transparent":Pe["sidebar-lpd"],"lpd-brand-base-white-responsive":Pe["sidebar-lpd"],"lpd-brand-base-transparent-responsive":Pe["sidebar-lpd"],"bill-brand-base":Pe["sidebar-bill"],"bill-brand-base-responsive":Pe["sidebar-bill"]},parent:{1:Pe["parent-sidebar-1"],2:Pe["parent-sidebar-2"],3:Pe["parent-sidebar-3"],4:Pe["parent-sidebar-4"],5:Pe["parent-sidebar-5"],6:Pe["parent-sidebar-6"],7:Pe["parent-sidebar-7"],8:Pe["parent-sidebar-8"]},divider:{"payhere-brand-base-white":Pe["divider-item-sidebar-payhere"],"payhere-brand-base-transparent":Pe["divider-item-sidebar-payhere"],"payhere-brand-indigo-900-transparent":Pe["divider-item-sidebar-payhere"],"payhere-brand-blue-gray-900-transparent":Pe["divider-item-sidebar-payhere"],"laba-white":Pe["divider-item-sidebar-laba"],"lpd-brand-base-white":Pe["divider-item-sidebar-lpd"],"lpd-brand-base-transparent":Pe["divider-item-sidebar-lpd"],"lpd-brand-base-white-responsive":Pe["divider-item-sidebar-lpd"],"lpd-brand-base-transparent-responsive":Pe["divider-item-sidebar-lpd"],"bill-brand-base":Pe["divider-item-sidebar-bill"],"bill-brand-base-responsive":Pe["divider-item-sidebar-bill"]}},Jw=({as:e,show:t,open:n,patch:r,iconSubs:i,variant:a="payhere-brand-base-white",setShow:o,onClickItems:s,propsLink:l,...u})=>{var v,x,C,E,w,B,y,S;let c=_.jsx(_.Fragment,{});const d=e??"div",[h,f]=I.useState(!1),g=r===u.slug,p=t.split("/"),m=p.includes(u.name),b=()=>{if(u.subs.length>0)if(m){const D=p.splice(0,p.indexOf(u.name));D.length>0?o(`${D.join("/")}/`):o("")}else o(`${t}${u.name}/`);else typeof s=="function"&&s(u)};return u.isShow?([1,3,5,6,7,8].includes(u.parent)&&(c=_.jsxs(_.Fragment,{children:[_.jsxs(d,{id:u.name,className:`${Pe["item-sidebar-1"]}
128
128
  ${(v=Ki.variant)==null?void 0:v[a]} ${(x=Ki.parent)==null?void 0:x[u.parent.toString()]}
129
- ${g||u.subs.length>0&&m?Fe.active:""} ${typeof n=="boolean"&&n?Fe["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?Fe["item-sidebar-close"]:""}
130
- `,onClick:b,onMouseOver:()=>f(!0),onMouseOut:()=>f(!1),...l?l(u.slug,u):{},children:[_.jsxs("div",{className:"1ru-flex 1ru-items-center 1ru-gap-3 1ru-relative",children:[I.isValidElement(u.svgIcon)&&_.jsx("div",{className:Fe["item-icon"],children:g||u.subs.length>0&&m?u==null?void 0:u.svgIconActive:h?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),_.jsx("div",{className:Fe["item-label"],children:u.label})]}),I.isValidElement(u.endIcon)&&_.jsx("div",{className:Fe["end-icon"],children:u==null?void 0:u.endIcon}),u.subs.length>0&&n&&_.jsxs("div",{className:Fe["item-icon-subs"],id:`item-sidebar-subs-${u.name}-icon`,children:[I.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===3&&!u.subs.length&&_.jsx("div",{className:(C=Ki.divider)==null?void 0:C[a]})]})),(u.parent===2||u.parent===4)&&(c=_.jsxs(_.Fragment,{children:[_.jsxs(d,{id:u.name,className:`${Fe["item-sidebar-2"]}
129
+ ${g||u.subs.length>0&&m?Pe.active:""} ${typeof n=="boolean"&&n?Pe["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?Pe["item-sidebar-close"]:""}
130
+ `,onClick:b,onMouseOver:()=>f(!0),onMouseOut:()=>f(!1),...l?l(u.slug,u):{},children:[_.jsxs("div",{className:"1ru-flex 1ru-items-center 1ru-gap-3 1ru-relative",children:[I.isValidElement(u.svgIcon)&&_.jsx("div",{className:Pe["item-icon"],children:g||u.subs.length>0&&m?u==null?void 0:u.svgIconActive:h?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),_.jsx("div",{className:Pe["item-label"],children:u.label})]}),I.isValidElement(u.endIcon)&&_.jsx("div",{className:Pe["end-icon"],children:u==null?void 0:u.endIcon}),u.subs.length>0&&n&&_.jsxs("div",{className:`${Pe["item-icon-subs"]} ${m?Pe["item-icon-subs-active"]:""}`,id:`item-sidebar-subs-${u.name}-icon`,children:[I.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===3&&!u.subs.length&&_.jsx("div",{className:(C=Ki.divider)==null?void 0:C[a]})]})),(u.parent===2||u.parent===4)&&(c=_.jsxs(_.Fragment,{children:[_.jsxs(d,{id:u.name,className:`${Pe["item-sidebar-2"]}
131
131
  ${(E=Ki.variant)==null?void 0:E[a]} ${(w=Ki.parent)==null?void 0:w[u.parent.toString()]}
132
- ${g||u.subs.length>0&&m?Fe.active:""} ${typeof n=="boolean"&&n?Fe["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?Fe["item-sidebar-close"]:""}
133
- `,onClick:b,onMouseOver:()=>f(!0),onMouseOut:()=>f(!1),...l?l(u.slug,u):{},children:[I.isValidElement(u.svgIcon)&&_.jsx("div",{className:Fe["item-icon"],children:g||u.subs.length>0&&m?u==null?void 0:u.svgIconActive:h?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),_.jsx("div",{className:Fe["item-label"],children:u.label}),u.subs.length>0&&n&&_.jsxs("div",{className:Fe["item-icon-subs"],id:`item-sidebar-subs-${u.name}-icon`,children:[I.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===4&&!u.subs.length&&_.jsx("div",{className:(B=Ki.divider)==null?void 0:B[a]})]})),u.subs.length>0?_.jsxs("div",{className:`${n||m?"":"-mt-2"}`,children:[c,_.jsx("div",{id:`item-sidebar-subs-${u.name}-${n&&m?"open":"close"}`,className:`${Fe["item-subs-sidebar"]}
134
- ${(y=Ki.variant)==null?void 0:y[a]} ${!n||!m?Fe.hidden:""}`,children:u.subs.map(D=>I.createElement(Jw,{...D,as:D.manualRoute?"div":D.subs.length>0?e:u.linkComponent,key:D.name,patch:r,iconSubs:i,show:t,open:n,variant:a,setShow:o}))}),[3,4].includes(u.parent)&&_.jsx("div",{className:(S=Ki.divider)==null?void 0:S[a]})]}):c):_.jsx(_.Fragment,{})},Zh={withCuctomWidthIconCompany:["payhere-brand-base-white","payhere-brand-base-transparent"],variants:{"payhere-brand-base-white":Wt["payhere-brand-base-white"],"payhere-brand-base-transparent":Wt["payhere-brand-base-transparent"],"payhere-brand-indigo-900-transparent":Wt["payhere-brand-indigo-900-transparent"],"payhere-brand-blue-gray-900-transparent":Wt["payhere-brand-blue-gray-900-transparent"],"laba-white":Wt["laba-white"],"lpd-brand-base-white":Wt["lpd-brand-base-white"],"lpd-brand-base-transparent":Wt["lpd-brand-base-transparent"],"lpd-brand-base-white-responsive":Wt["lpd-brand-base-white-responsive"],"lpd-brand-base-transparent-responsive":Wt["lpd-brand-base-transparent-responsive"],"bill-brand-base-white":Wt["bill-brand-base-white"],"bill-brand-base-white-responsive":Wt["bill-brand-base-white-responsive"]},mobileSupport:["lpd-brand-base-transparent-responsive","lpd-brand-base-white-responsive","bill-brand-base-white-responsive"]},qw=I.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:d,variant:h="payhere-brand-base-white",footer:f,withInheritance:g,id:p="1ru-sidebar",...m}=e,b=I.useRef(null),[v,x]=I.useState(null),[C,E]=I.useState(null),[w,B]=I.useState(""),[y,S]=I.useState(),[D,A]=I.useState(0),T=()=>{var O;let $=0;const R=document.getElementById("icon-company-sidebar");(O=R==null?void 0:R.childNodes)==null||O.forEach(j=>{$+=j.getBoundingClientRect().width??0}),S($+c+"px")},F=()=>{A(window.innerWidth)},k=()=>{x(!C),C?S("auto"):setTimeout(()=>{T()},100)};return I.useEffect(()=>{D>=(Zh.mobileSupport.includes(h)?U0.lg:U0.md)?(x(!0),setTimeout(()=>{T()},100)):(x(!1),S("auto"))},[D]),I.useEffect(()=>{typeof v=="boolean"&&E(v)},[v]),I.useImperativeHandle(t,()=>({openSidebar:v,setOpenSidebar:x,handlerClickCollapse:k}),[v,C]),I.useEffect(()=>(i&&i.split("/").length>1&&B(i+"/"),T(),F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)),[]),_.jsxs("div",{className:Zh.variants[h],...m,ref:b,children:[_.jsxs("div",{id:p,className:`${Wt.sidebar} ${typeof C=="boolean"&&C?Wt["sidebar-open"]:""} ${typeof C=="boolean"&&!C?Wt["sidebar-close"]:""}`,children:[I.isValidElement(s)&&_.jsxs("div",{className:Wt["button-collaps-sidebar"],id:`${p}-${v?"close-collapse":"open-collapse"}`,onClick:k,children:[v&&s,v?"":I.isValidElement(l)?l:s]}),_.jsx("div",{className:Wt["container-icon-company-sidebar"],children:_.jsxs("div",{id:"icon-company-sidebar",className:Wt["icon-company-sidebar"],style:{width:y&&Zh.withCuctomWidthIconCompany.includes(h)?y:"100%"},children:[I.isValidElement(a)&&a,typeof a=="function"&&a({openSidebar:C,setOpenSidebar:x})]})}),_.jsx("div",{className:Wt["menu-sidebar"],onMouseOver:()=>{v||E(!0)},onMouseOut:()=>{v||E(!1)},children:u.map($=>I.createElement(Jw,{...$,as:$.manualRoute||$.subs.length>0?"div":n,linkComponent:n,key:$.name,show:w,open:C,patch:i,iconSubs:o,variant:h,setShow:B,onClickItems:d}))}),f&&_.jsxs("div",{className:C?"1ru-opacity-[1]":"1ru-opacity-0",children:[I.isValidElement(f)&&_.jsx("div",{children:f}),typeof f=="function"&&_.jsx("div",{children:f()})]})]}),v&&_.jsx("div",{id:`${p}-splace-screen`,className:Wt["splace-screen"],onClick:k}),_.jsxs("div",{className:Wt["content-sidebar"],children:[g&&((P=I.Children)==null?void 0:P.map(r,$=>_.jsx(_.Fragment,{children:I.isValidElement($)&&_.jsx(_.Fragment,{children:I.cloneElement($,{openSidebar:v,handlerClickCollapse:k})})}))),!g&&_.jsx(_.Fragment,{children:r})]})]})});qw.displayName="Sidebar";const VH="_collapse_qzzyu_1",Qw={collapse:VH},HH=({children:e,id:t,open:n,className:r,classNameContainer:i,maxCollapsedHeight:a="0px",triggerCalCulateContainer:o,delayTriggerCalculateHeight:s=0})=>{const[l,u]=I.useState("1000vh"),c=()=>{var h;const d=((h=document==null?void 0:document.getElementById(t))==null?void 0:h.offsetHeight)??0;u(d||"1000vh")};return I.useEffect(()=>{const d=setTimeout(c,s);return window==null||window.addEventListener("resize",c),window==null||window.addEventListener("load",c),()=>{clearTimeout(d),window==null||window.removeEventListener("resize",c),window==null||window.removeEventListener("load",c)}},[o]),_.jsx("div",{className:`${Qw.collapse} ${i??""}`,style:{maxHeight:n?l:a},children:_.jsx("div",{id:t,className:r??"",children:e})})},jH="_modal_12o7y_1",fa={modal:jH,"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"},WH={size:{small:fa["modal-small"],medium:fa["modal-medium"],regular:fa["modal-regular"],large:fa["modal-large"]}},zH=({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 d=e??"div",h=()=>{typeof u=="function"&&u()};return _.jsx(_.Fragment,{children:a&&document.getElementById(r)&&cu.createPortal(_.jsx("div",{id:n,onClick:h,className:`${fa.modal} ${i?fa["with-overlay"]:""} ${a?fa["modal-show"]:""} ${l??""}`,children:_.jsx(d,{onClick:f=>f.stopPropagation(),className:`${fa["modal-content"]} ${WH.size[o]} ${s??""}`,...c,children:t})}),document.getElementById(r))})},GH="_dot_jms5p_509",Wr={"timeline-content":"_timeline-content_jms5p_133","left-content":"_left-content_jms5p_133","time-content":"_time-content_jms5p_133","text-time":"_text-time_jms5p_133","timeline-container":"_timeline-container_jms5p_469","no-time":"_no-time_jms5p_482",dot:GH,"right-content":"_right-content_jms5p_515"},UH=({children:e,noTime:t=!1})=>_.jsx("div",{className:`${Wr["timeline-container"]} ${t?Wr["no-time"]:""}`,children:e}),XH=({children:e,time:t,clasName:n,noTime:r=!1})=>_.jsxs("div",{className:Wr["timeline-content"],children:[_.jsx("div",{className:`${Wr["left-content"]} ${r?Wr["no-time"]:""}`,children:_.jsxs("div",{className:Wr["time-content"],children:[!r&&_.jsx("time",{className:Wr["text-time"],children:t??""}),_.jsx("div",{className:Wr.dot})]})}),_.jsx("div",{className:`${Wr["right-content"]} ${r?Wr["no-time"]:""} ${n??""}`,children:e})]}),ZH=Object.assign(UH,{TimelineContent:XH}),uc=(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},e5=I.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:d={},reset:h}=e,f=u?{[c]:1}:{},[g,p]=I.useState(uc(o??{},l,"")),[m,b]=I.useState(H1(i,uc(a??{},l,i))),[v,x]=I.useState(!1),C=(B,y)=>{const S={};return Object.keys(y).forEach(D=>{S[`${B}${D}`]=y[D]}),S},E=(B,y,S,D)=>{let A=B;const T=C(i,{[y]:B});Array.isArray(B)&&(S==="array-of-object-to-array"?A=bp(B,D):S==="array-of-object-to-string"?A=mp(B,D):S==="array-to-string"&&(A=A.toString())),typeof r=="function"&&r({...g,[y]:A,...f},{...m,...T}),p(F=>({...F,[y]:A})),b(F=>({...F,...T}))},w=(B,y)=>{const D=C(i,{...y??B});typeof r=="function"&&r({...g,...B,...f},{...m,...D}),p(A=>({...A,...B})),b(A=>({...A,...D}))};return ba(()=>{!v&&typeof r=="function"&&s&&(r(g,m),x(!0))},[g,m,v,s]),ba(()=>{h&&(b(H1(i,uc(a??{},l,i))),p(uc(o??{},l,"")))},[h,d]),I.useImperativeHandle(t,()=>({nativeValue:m,value:g,handlerOnChange:E,handlerOnChangeNative:w}),[Ol(g),Ol(m)]),_.jsx(_.Fragment,{children:n({handlerOnChange:E,handlerOnChangeNative:w,value:g,nativeValue:m})})});e5.displayName="FilterContainer";function Mm(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 eu;(function(e){e.event="event",e.props="prop"})(eu||(eu={}));function $i(){}function YH(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 yo(e){return!!(e||"").match(/\d/)}function lo(e){return e==null}function KH(e){return typeof e=="number"&&isNaN(e)}function t5(e){return lo(e)||KH(e)||typeof e=="number"&&!isFinite(e)}function n5(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function JH(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 qH(e,t,n){var r=JH(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 QH(e){var t=I.useRef(e);t.current=e;var n=I.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function Lm(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 ej(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 r5(e,t,n){for(var r="",i=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||i;return r}function ay(e,t){return Array(t+1).join(e)}function i5(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."+ay("0",Math.abs(o))+i:o>=s?i=i+ay("0",o-s):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function oy(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Lm(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("."),d=a;a&&Number(c[0])&&(d=a.split("").reverse().reduce(function(p,m,b){return p.length>b?(Number(p[0])+Number(m)).toString()+p.substring(1,p.length):m+p},c[0]));var h=r5(c[1]||"",t,n),f=s?"-":"",g=r?".":"";return""+f+d+g+h}function ra(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 a5=YH(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}}}),tj=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function nj(e,t,n){return Math.min(Math.max(e,t),n)}function Yh(e){return Math.max(e.selectionStart,e.selectionEnd)}function rj(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function o5(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function s5(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function ij(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function aj(e,t,n,r,i,a,o){o===void 0&&(o=ij);var s=i.findIndex(function(C){return C}),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,d={},h=new Array(u),f=0;f<u;f++){h[f]=-1;for(var g=0,p=c;g<p;g++){var m=o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:f,formattedValueIndex:g});if(m&&d[g]!==!0){h[f]=g,d[g]=!0;break}}}for(var b=r;b<u&&(h[b]===-1||!a(n[b]));)b++;var v=b===u||h[b]===-1?c:h[b];for(b=r-1;b>0&&h[b]===-1;)b--;var x=b===-1||h[b]===-1?0:h[b]+1;return x>v?v:r-x<v-r?x:v}function jd(e,t,n,r){var i=e.length;if(t=nj(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 oj(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(yo(e[n])||yo(e[n-1]));return t}function l5(e,t,n,r,i,a){a===void 0&&(a=$i);var o=QH(function(g,p){var m,b;return t5(g)?(b="",m=""):typeof g=="number"||p?(b=typeof g=="number"?i5(g):g,m=r(b)):(b=i(g,void 0),m=r(b)),{formattedValue:m,numAsString:b}}),s=I.useState(function(){return o(lo(e)?t:e,n)}),l=s[0],u=s[1],c=function(g,p){g.formattedValue!==l.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),a(g,p)},d=e,h=n;lo(e)&&(d=l.numAsString,h=!0);var f=o(d,h);return I.useMemo(function(){u(f)},[f.formattedValue]),[l,c]}function sj(e){return e.replace(/[^0-9]/g,"")}function lj(e){return e}function u5(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=lj);var s=e.removeFormatting;s===void 0&&(s=sj);var l=e.defaultValue,u=e.valueIsNumericString,c=e.onValueChange,d=e.isAllowed,h=e.onChange;h===void 0&&(h=$i);var f=e.onKeyDown;f===void 0&&(f=$i);var g=e.onMouseUp;g===void 0&&(g=$i);var p=e.onFocus;p===void 0&&(p=$i);var m=e.onBlur;m===void 0&&(m=$i);var b=e.value,v=e.getCaretBoundary;v===void 0&&(v=oj);var x=e.isValidInputCharacter;x===void 0&&(x=yo);var C=e.isCharacterSame,E=Mm(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),w=l5(b,l,!!u,o,s,c),B=w[0],y=B.formattedValue,S=B.numAsString,D=w[1],A=I.useRef(),T=I.useRef({formattedValue:y,numAsString:S}),F=function(ye,Ee){T.current={formattedValue:ye.formattedValue,numAsString:ye.value},D(ye,Ee)},k=I.useState(!1),P=k[0],$=k[1],R=I.useRef(null),O=I.useRef({setCaretTimeout:null,focusTimeout:null});I.useEffect(function(){return $(!0),function(){clearTimeout(O.current.setCaretTimeout),clearTimeout(O.current.focusTimeout)}},[]);var j=o,V=function(ye,Ee){var He=parseFloat(Ee);return{formattedValue:ye,value:Ee,floatValue:isNaN(He)?void 0:He}},W=function(ye,Ee,He){ye.selectionStart===0&&ye.selectionEnd===ye.value.length||(ra(ye,Ee),O.current.setCaretTimeout=setTimeout(function(){ye.value===He&&ye.selectionStart!==Ee&&ra(ye,Ee)},0))},U=function(ye,Ee,He){return jd(ye,Ee,v(ye),He)},K=function(ye,Ee,He){var bt=v(Ee),Kt=aj(Ee,y,ye,He,bt,x,C);return Kt=jd(Ee,Kt,bt),Kt},ee=function(ye){var Ee=ye.formattedValue;Ee===void 0&&(Ee="");var He=ye.input,bt=ye.source,Kt=ye.event,at=ye.numAsString,Qe;if(He){var or=ye.inputValue||He.value,wr=Yh(He);He.value=Ee,Qe=K(or,Ee,wr),Qe!==void 0&&W(He,Qe,Ee)}Ee!==y&&F(V(Ee,at),{event:Kt,source:bt})};I.useEffect(function(){var ye=T.current,Ee=ye.formattedValue,He=ye.numAsString;(y!==Ee||S!==He)&&F(V(y,S),{event:void 0,source:eu.props})},[y,S]);var z=R.current?Yh(R.current):void 0,H=typeof window<"u"?I.useLayoutEffect:I.useEffect;H(function(){var ye=R.current;if(y!==T.current.formattedValue&&ye){var Ee=K(T.current.formattedValue,y,z);ye.value=y,W(ye,Ee,y)}},[y]);var X=function(ye,Ee,He){var bt=Ee.target,Kt=A.current?tj(A.current,bt.selectionEnd):a5(y,ye),at=Object.assign(Object.assign({},Kt),{lastValue:y}),Qe=s(ye,at),or=j(Qe);if(Qe=s(or,void 0),d&&!d(V(or,Qe))){var wr=Ee.target,Ir=Yh(wr),Ro=K(ye,y,Ir);return wr.value=y,W(wr,Ro,y),!1}return ee({formattedValue:or,numAsString:Qe,inputValue:ye,event:Ee,source:He,input:Ee.target}),!0},te=function(ye,Ee){Ee===void 0&&(Ee=0);var He=ye.selectionStart,bt=ye.selectionEnd;A.current={selectionStart:He,selectionEnd:bt+Ee}},ie=function(ye){var Ee=ye.target,He=Ee.value,bt=X(He,ye,eu.event);bt&&h(ye),A.current=void 0},le=function(ye){var Ee=ye.target,He=ye.key,bt=Ee.selectionStart,Kt=Ee.selectionEnd,at=Ee.value;at===void 0&&(at="");var Qe;He==="ArrowLeft"||He==="Backspace"?Qe=Math.max(bt-1,0):He==="ArrowRight"?Qe=Math.min(bt+1,at.length):He==="Delete"&&(Qe=bt);var or=0;He==="Delete"&&bt===Kt&&(or=1);var wr=He==="ArrowLeft"||He==="ArrowRight";if(Qe===void 0||bt!==Kt&&!wr){f(ye),te(Ee,or);return}var Ir=Qe;if(wr){var Ro=He==="ArrowLeft"?"left":"right";Ir=U(at,Qe,Ro),Ir!==Qe&&ye.preventDefault()}else He==="Delete"&&!x(at[Qe])?Ir=U(at,Qe,"right"):He==="Backspace"&&!x(at[Qe])&&(Ir=U(at,Qe,"left"));Ir!==Qe&&W(Ee,Ir,at),f(ye),te(Ee,or)},ce=function(ye){var Ee=ye.target,He=function(){var bt=Ee.selectionStart,Kt=Ee.selectionEnd,at=Ee.value;if(at===void 0&&(at=""),bt===Kt){var Qe=U(at,bt);Qe!==bt&&W(Ee,Qe,at)}};He(),requestAnimationFrame(function(){He()}),g(ye),te(Ee)},Q=function(ye){ye.persist&&ye.persist();var Ee=ye.target,He=ye.currentTarget;R.current=Ee,O.current.focusTimeout=setTimeout(function(){var bt=Ee.selectionStart,Kt=Ee.selectionEnd,at=Ee.value;at===void 0&&(at="");var Qe=U(at,bt);Qe!==bt&&!(bt===0&&Kt===at.length)&&W(Ee,Qe,at),p(Object.assign(Object.assign({},ye),{currentTarget:He}))},0)},be=function(ye){R.current=null,clearTimeout(O.current.focusTimeout),clearTimeout(O.current.setCaretTimeout),m(ye)},Ce=P&&rj()?"numeric":void 0,Se=Object.assign({inputMode:Ce},E,{type:t,value:y,onChange:ie,onKeyDown:le,onMouseUp:ce,onFocus:Q,onBlur:be});if(n==="text")return i?I.createElement(I.Fragment,null,i(y,E)||null):I.createElement("span",Object.assign({},E,{ref:a}),y);if(r){var un=r;return I.createElement(un,Object.assign({},Se,{ref:a}))}return I.createElement("input",Object.assign({},Se,{ref:a}))}function sy(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=Of(t),u=l.thousandSeparator,c=l.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,h=Lm(e,o),f=h.beforeDecimal,g=h.afterDecimal,p=h.addNegation;return n!==void 0&&(g=r5(g,n,!!r)),u&&(f=qH(f,u,s)),i&&(f=i+f),a&&(g=g+a),p&&(f="-"+f),e=f+(d&&c||"")+g,e}function Of(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 uj(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 cj(e,t){return new RegExp("(^-)|[0-9]|"+n5(e),"g")}function dj(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function fj(e,t,n){var r;t===void 0&&(t=o5(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,d=u.end,h=Of(n),f=h.allowedDecimalSeparators,g=h.decimalSeparator,p=e[d]===g;if(yo(e)&&(e===a||e===o)&&t.lastValue==="")return e;if(d-c===1&&f.indexOf(e[c])!==-1){var m=s===0?"":g;e=e.substring(0,c)+m+e.substring(c+1,e.length)}var b=function(R,O,j){var V=!1,W=!1;a.startsWith("-")?V=!1:R.startsWith("--")?(V=!1,W=!0):o.startsWith("-")&&R.length===o.length?V=!1:R[0]==="-"&&(V=!0);var U=V?1:0;return W&&(U=2),U&&(R=R.substring(U),O-=U,j-=U),{value:R,start:O,end:j,hasNegation:V}},v=b(e,c,d),x=v.hasNegation;r=v,e=r.value,c=r.start,d=r.end;var C=b(t.lastValue,l.start,l.end),E=C.start,w=C.end,B=C.value,y=e.substring(c,d);e.length&&B.length&&(E>B.length-o.length||w<a.length)&&!(y&&o.startsWith(y))&&(e=B);var S=0;e.startsWith(a)?S+=a.length:c<a.length&&(S=c),e=e.substring(S),d-=S;var D=e.length,A=e.length-o.length;e.endsWith(o)?D=A:(d>A||d>e.length-o.length)&&(D=d),e=e.substring(0,D),e=uj(x?"-"+e:e,i),e=(e.match(cj(g))||[]).join("");var T=e.indexOf(g);e=e.replace(new RegExp(n5(g),"g"),function(R,O){return O===T?".":""});var F=Lm(e,i),k=F.beforeDecimal,P=F.afterDecimal,$=F.addNegation;return u.end-u.start<l.end-l.start&&k===""&&p&&!parseFloat(P)&&(e=$?"-":""),e}function hj(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 gj(e){var t=Of(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(`
132
+ ${g||u.subs.length>0&&m?Pe.active:""} ${typeof n=="boolean"&&n?Pe["item-sidebar-open"]:""} ${typeof n=="boolean"&&!n?Pe["item-sidebar-close"]:""}
133
+ `,onClick:b,onMouseOver:()=>f(!0),onMouseOut:()=>f(!1),...l?l(u.slug,u):{},children:[I.isValidElement(u.svgIcon)&&_.jsx("div",{className:Pe["item-icon"],children:g||u.subs.length>0&&m?u==null?void 0:u.svgIconActive:h?(u==null?void 0:u.svgIconHover)||(u==null?void 0:u.svgIconActive):u==null?void 0:u.svgIcon}),_.jsx("div",{className:Pe["item-label"],children:u.label}),u.subs.length>0&&n&&_.jsxs("div",{className:`${Pe["item-icon-subs"]} ${m?Pe["item-icon-subs-active"]:""}`,id:`item-sidebar-subs-${u.name}-icon`,children:[I.isValidElement(i)&&i,typeof i=="function"&&i()]})]}),u.parent===4&&!u.subs.length&&_.jsx("div",{className:(B=Ki.divider)==null?void 0:B[a]})]})),u.subs.length>0?_.jsxs("div",{className:`${n||m?"":"-mt-2"}`,children:[c,_.jsx("div",{id:`item-sidebar-subs-${u.name}-${n&&m?"open":"close"}`,className:`${Pe["item-subs-sidebar"]}
134
+ ${(y=Ki.variant)==null?void 0:y[a]} ${!n||!m?Pe.hidden:""}`,children:u.subs.map(D=>I.createElement(Jw,{...D,as:D.manualRoute?"div":D.subs.length>0?e:u.linkComponent,key:D.name,patch:r,iconSubs:i,show:t,open:n,variant:a,setShow:o}))}),[3,4].includes(u.parent)&&_.jsx("div",{className:(S=Ki.divider)==null?void 0:S[a]})]}):c):_.jsx(_.Fragment,{})},Zh={withCuctomWidthIconCompany:["payhere-brand-base-white","payhere-brand-base-transparent"],variants:{"payhere-brand-base-white":Wt["payhere-brand-base-white"],"payhere-brand-base-transparent":Wt["payhere-brand-base-transparent"],"payhere-brand-indigo-900-transparent":Wt["payhere-brand-indigo-900-transparent"],"payhere-brand-blue-gray-900-transparent":Wt["payhere-brand-blue-gray-900-transparent"],"laba-white":Wt["laba-white"],"lpd-brand-base-white":Wt["lpd-brand-base-white"],"lpd-brand-base-transparent":Wt["lpd-brand-base-transparent"],"lpd-brand-base-white-responsive":Wt["lpd-brand-base-white-responsive"],"lpd-brand-base-transparent-responsive":Wt["lpd-brand-base-transparent-responsive"],"bill-brand-base":Wt["bill-brand-base"],"bill-brand-base-responsive":Wt["bill-brand-base-responsive"]},mobileSupport:["lpd-brand-base-transparent-responsive","lpd-brand-base-white-responsive","bill-brand-base-responsive"]},qw=I.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:d,variant:h="payhere-brand-base-white",footer:f,withInheritance:g,id:p="1ru-sidebar",...m}=e,b=I.useRef(null),[v,x]=I.useState(null),[C,E]=I.useState(null),[w,B]=I.useState(""),[y,S]=I.useState(),[D,A]=I.useState(0),T=()=>{var O;let $=0;const R=document.getElementById("icon-company-sidebar");(O=R==null?void 0:R.childNodes)==null||O.forEach(j=>{$+=j.getBoundingClientRect().width??0}),S($+c+"px")},F=()=>{A(window.innerWidth)},k=()=>{x(!C),C?S("auto"):setTimeout(()=>{T()},100)};return I.useEffect(()=>{D>=(Zh.mobileSupport.includes(h)?U0.lg:U0.md)?(x(!0),setTimeout(()=>{T()},100)):(x(!1),S("auto"))},[D]),I.useEffect(()=>{typeof v=="boolean"&&E(v)},[v]),I.useImperativeHandle(t,()=>({openSidebar:v,setOpenSidebar:x,handlerClickCollapse:k}),[v,C]),I.useEffect(()=>(i&&i.split("/").length>1&&B(i+"/"),T(),F(),window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)),[]),_.jsxs("div",{className:Zh.variants[h],...m,ref:b,children:[_.jsxs("div",{id:p,className:`${Wt.sidebar} ${typeof C=="boolean"&&C?Wt["sidebar-open"]:""} ${typeof C=="boolean"&&!C?Wt["sidebar-close"]:""}`,children:[I.isValidElement(s)&&_.jsxs("div",{className:Wt["button-collaps-sidebar"],id:`${p}-${v?"close-collapse":"open-collapse"}`,onClick:k,children:[v&&s,v?"":I.isValidElement(l)?l:s]}),_.jsx("div",{className:Wt["container-icon-company-sidebar"],children:_.jsxs("div",{id:"icon-company-sidebar",className:Wt["icon-company-sidebar"],style:{width:y&&Zh.withCuctomWidthIconCompany.includes(h)?y:"100%"},children:[I.isValidElement(a)&&a,typeof a=="function"&&a({openSidebar:C,setOpenSidebar:x})]})}),_.jsx("div",{className:Wt["menu-sidebar"],onMouseOver:()=>{v||E(!0)},onMouseOut:()=>{v||E(!1)},children:u.map($=>I.createElement(Jw,{...$,as:$.manualRoute||$.subs.length>0?"div":n,linkComponent:n,key:$.name,show:w,open:C,patch:i,iconSubs:o,variant:h,setShow:B,onClickItems:d}))}),f&&_.jsxs("div",{className:C?"1ru-opacity-[1]":"1ru-opacity-0",children:[I.isValidElement(f)&&_.jsx("div",{children:f}),typeof f=="function"&&_.jsx("div",{children:f()})]})]}),v&&_.jsx("div",{id:`${p}-splace-screen`,className:Wt["splace-screen"],onClick:k}),_.jsxs("div",{className:Wt["content-sidebar"],children:[g&&((P=I.Children)==null?void 0:P.map(r,$=>_.jsx(_.Fragment,{children:I.isValidElement($)&&_.jsx(_.Fragment,{children:I.cloneElement($,{openSidebar:v,handlerClickCollapse:k})})}))),!g&&_.jsx(_.Fragment,{children:r})]})]})});qw.displayName="Sidebar";const VH="_collapse_qzzyu_1",Qw={collapse:VH},HH=({children:e,id:t,open:n,className:r,classNameContainer:i,maxCollapsedHeight:a="0px",triggerCalCulateContainer:o,delayTriggerCalculateHeight:s=0})=>{const[l,u]=I.useState("1000vh"),c=()=>{var h;const d=((h=document==null?void 0:document.getElementById(t))==null?void 0:h.offsetHeight)??0;u(d||"1000vh")};return I.useEffect(()=>{const d=setTimeout(c,s);return window==null||window.addEventListener("resize",c),window==null||window.addEventListener("load",c),()=>{clearTimeout(d),window==null||window.removeEventListener("resize",c),window==null||window.removeEventListener("load",c)}},[o]),_.jsx("div",{className:`${Qw.collapse} ${i??""}`,style:{maxHeight:n?l:a},children:_.jsx("div",{id:t,className:r??"",children:e})})},jH="_modal_12o7y_1",fa={modal:jH,"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"},WH={size:{small:fa["modal-small"],medium:fa["modal-medium"],regular:fa["modal-regular"],large:fa["modal-large"]}},zH=({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 d=e??"div",h=()=>{typeof u=="function"&&u()};return _.jsx(_.Fragment,{children:a&&document.getElementById(r)&&cu.createPortal(_.jsx("div",{id:n,onClick:h,className:`${fa.modal} ${i?fa["with-overlay"]:""} ${a?fa["modal-show"]:""} ${l??""}`,children:_.jsx(d,{onClick:f=>f.stopPropagation(),className:`${fa["modal-content"]} ${WH.size[o]} ${s??""}`,...c,children:t})}),document.getElementById(r))})},GH="_dot_jms5p_509",Wr={"timeline-content":"_timeline-content_jms5p_133","left-content":"_left-content_jms5p_133","time-content":"_time-content_jms5p_133","text-time":"_text-time_jms5p_133","timeline-container":"_timeline-container_jms5p_469","no-time":"_no-time_jms5p_482",dot:GH,"right-content":"_right-content_jms5p_515"},UH=({children:e,noTime:t=!1})=>_.jsx("div",{className:`${Wr["timeline-container"]} ${t?Wr["no-time"]:""}`,children:e}),XH=({children:e,time:t,clasName:n,noTime:r=!1})=>_.jsxs("div",{className:Wr["timeline-content"],children:[_.jsx("div",{className:`${Wr["left-content"]} ${r?Wr["no-time"]:""}`,children:_.jsxs("div",{className:Wr["time-content"],children:[!r&&_.jsx("time",{className:Wr["text-time"],children:t??""}),_.jsx("div",{className:Wr.dot})]})}),_.jsx("div",{className:`${Wr["right-content"]} ${r?Wr["no-time"]:""} ${n??""}`,children:e})]}),ZH=Object.assign(UH,{TimelineContent:XH}),uc=(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},e5=I.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:d={},reset:h}=e,f=u?{[c]:1}:{},[g,p]=I.useState(uc(o??{},l,"")),[m,b]=I.useState(H1(i,uc(a??{},l,i))),[v,x]=I.useState(!1),C=(B,y)=>{const S={};return Object.keys(y).forEach(D=>{S[`${B}${D}`]=y[D]}),S},E=(B,y,S,D)=>{let A=B;const T=C(i,{[y]:B});Array.isArray(B)&&(S==="array-of-object-to-array"?A=bp(B,D):S==="array-of-object-to-string"?A=mp(B,D):S==="array-to-string"&&(A=A.toString())),typeof r=="function"&&r({...g,[y]:A,...f},{...m,...T}),p(F=>({...F,[y]:A})),b(F=>({...F,...T}))},w=(B,y)=>{const D=C(i,{...y??B});typeof r=="function"&&r({...g,...B,...f},{...m,...D}),p(A=>({...A,...B})),b(A=>({...A,...D}))};return ba(()=>{!v&&typeof r=="function"&&s&&(r(g,m),x(!0))},[g,m,v,s]),ba(()=>{h&&(b(H1(i,uc(a??{},l,i))),p(uc(o??{},l,"")))},[h,d]),I.useImperativeHandle(t,()=>({nativeValue:m,value:g,handlerOnChange:E,handlerOnChangeNative:w}),[Ol(g),Ol(m)]),_.jsx(_.Fragment,{children:n({handlerOnChange:E,handlerOnChangeNative:w,value:g,nativeValue:m})})});e5.displayName="FilterContainer";function Mm(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 eu;(function(e){e.event="event",e.props="prop"})(eu||(eu={}));function $i(){}function YH(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 yo(e){return!!(e||"").match(/\d/)}function lo(e){return e==null}function KH(e){return typeof e=="number"&&isNaN(e)}function t5(e){return lo(e)||KH(e)||typeof e=="number"&&!isFinite(e)}function n5(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function JH(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 qH(e,t,n){var r=JH(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 QH(e){var t=I.useRef(e);t.current=e;var n=I.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function Lm(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 ej(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 r5(e,t,n){for(var r="",i=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||i;return r}function ay(e,t){return Array(t+1).join(e)}function i5(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."+ay("0",Math.abs(o))+i:o>=s?i=i+ay("0",o-s):i=(i.substring(0,o)||"0")+"."+i.substring(o),n+i}function oy(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Lm(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("."),d=a;a&&Number(c[0])&&(d=a.split("").reverse().reduce(function(p,m,b){return p.length>b?(Number(p[0])+Number(m)).toString()+p.substring(1,p.length):m+p},c[0]));var h=r5(c[1]||"",t,n),f=s?"-":"",g=r?".":"";return""+f+d+g+h}function ra(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 a5=YH(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}}}),tj=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function nj(e,t,n){return Math.min(Math.max(e,t),n)}function Yh(e){return Math.max(e.selectionStart,e.selectionEnd)}function rj(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function o5(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function s5(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function ij(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function aj(e,t,n,r,i,a,o){o===void 0&&(o=ij);var s=i.findIndex(function(C){return C}),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,d={},h=new Array(u),f=0;f<u;f++){h[f]=-1;for(var g=0,p=c;g<p;g++){var m=o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:f,formattedValueIndex:g});if(m&&d[g]!==!0){h[f]=g,d[g]=!0;break}}}for(var b=r;b<u&&(h[b]===-1||!a(n[b]));)b++;var v=b===u||h[b]===-1?c:h[b];for(b=r-1;b>0&&h[b]===-1;)b--;var x=b===-1||h[b]===-1?0:h[b]+1;return x>v?v:r-x<v-r?x:v}function jd(e,t,n,r){var i=e.length;if(t=nj(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 oj(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(yo(e[n])||yo(e[n-1]));return t}function l5(e,t,n,r,i,a){a===void 0&&(a=$i);var o=QH(function(g,p){var m,b;return t5(g)?(b="",m=""):typeof g=="number"||p?(b=typeof g=="number"?i5(g):g,m=r(b)):(b=i(g,void 0),m=r(b)),{formattedValue:m,numAsString:b}}),s=I.useState(function(){return o(lo(e)?t:e,n)}),l=s[0],u=s[1],c=function(g,p){g.formattedValue!==l.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),a(g,p)},d=e,h=n;lo(e)&&(d=l.numAsString,h=!0);var f=o(d,h);return I.useMemo(function(){u(f)},[f.formattedValue]),[l,c]}function sj(e){return e.replace(/[^0-9]/g,"")}function lj(e){return e}function u5(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=lj);var s=e.removeFormatting;s===void 0&&(s=sj);var l=e.defaultValue,u=e.valueIsNumericString,c=e.onValueChange,d=e.isAllowed,h=e.onChange;h===void 0&&(h=$i);var f=e.onKeyDown;f===void 0&&(f=$i);var g=e.onMouseUp;g===void 0&&(g=$i);var p=e.onFocus;p===void 0&&(p=$i);var m=e.onBlur;m===void 0&&(m=$i);var b=e.value,v=e.getCaretBoundary;v===void 0&&(v=oj);var x=e.isValidInputCharacter;x===void 0&&(x=yo);var C=e.isCharacterSame,E=Mm(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),w=l5(b,l,!!u,o,s,c),B=w[0],y=B.formattedValue,S=B.numAsString,D=w[1],A=I.useRef(),T=I.useRef({formattedValue:y,numAsString:S}),F=function(ye,Ee){T.current={formattedValue:ye.formattedValue,numAsString:ye.value},D(ye,Ee)},k=I.useState(!1),P=k[0],$=k[1],R=I.useRef(null),O=I.useRef({setCaretTimeout:null,focusTimeout:null});I.useEffect(function(){return $(!0),function(){clearTimeout(O.current.setCaretTimeout),clearTimeout(O.current.focusTimeout)}},[]);var j=o,V=function(ye,Ee){var He=parseFloat(Ee);return{formattedValue:ye,value:Ee,floatValue:isNaN(He)?void 0:He}},W=function(ye,Ee,He){ye.selectionStart===0&&ye.selectionEnd===ye.value.length||(ra(ye,Ee),O.current.setCaretTimeout=setTimeout(function(){ye.value===He&&ye.selectionStart!==Ee&&ra(ye,Ee)},0))},U=function(ye,Ee,He){return jd(ye,Ee,v(ye),He)},K=function(ye,Ee,He){var bt=v(Ee),Kt=aj(Ee,y,ye,He,bt,x,C);return Kt=jd(Ee,Kt,bt),Kt},ee=function(ye){var Ee=ye.formattedValue;Ee===void 0&&(Ee="");var He=ye.input,bt=ye.source,Kt=ye.event,at=ye.numAsString,Qe;if(He){var or=ye.inputValue||He.value,wr=Yh(He);He.value=Ee,Qe=K(or,Ee,wr),Qe!==void 0&&W(He,Qe,Ee)}Ee!==y&&F(V(Ee,at),{event:Kt,source:bt})};I.useEffect(function(){var ye=T.current,Ee=ye.formattedValue,He=ye.numAsString;(y!==Ee||S!==He)&&F(V(y,S),{event:void 0,source:eu.props})},[y,S]);var z=R.current?Yh(R.current):void 0,H=typeof window<"u"?I.useLayoutEffect:I.useEffect;H(function(){var ye=R.current;if(y!==T.current.formattedValue&&ye){var Ee=K(T.current.formattedValue,y,z);ye.value=y,W(ye,Ee,y)}},[y]);var X=function(ye,Ee,He){var bt=Ee.target,Kt=A.current?tj(A.current,bt.selectionEnd):a5(y,ye),at=Object.assign(Object.assign({},Kt),{lastValue:y}),Qe=s(ye,at),or=j(Qe);if(Qe=s(or,void 0),d&&!d(V(or,Qe))){var wr=Ee.target,Ir=Yh(wr),Ro=K(ye,y,Ir);return wr.value=y,W(wr,Ro,y),!1}return ee({formattedValue:or,numAsString:Qe,inputValue:ye,event:Ee,source:He,input:Ee.target}),!0},te=function(ye,Ee){Ee===void 0&&(Ee=0);var He=ye.selectionStart,bt=ye.selectionEnd;A.current={selectionStart:He,selectionEnd:bt+Ee}},ie=function(ye){var Ee=ye.target,He=Ee.value,bt=X(He,ye,eu.event);bt&&h(ye),A.current=void 0},le=function(ye){var Ee=ye.target,He=ye.key,bt=Ee.selectionStart,Kt=Ee.selectionEnd,at=Ee.value;at===void 0&&(at="");var Qe;He==="ArrowLeft"||He==="Backspace"?Qe=Math.max(bt-1,0):He==="ArrowRight"?Qe=Math.min(bt+1,at.length):He==="Delete"&&(Qe=bt);var or=0;He==="Delete"&&bt===Kt&&(or=1);var wr=He==="ArrowLeft"||He==="ArrowRight";if(Qe===void 0||bt!==Kt&&!wr){f(ye),te(Ee,or);return}var Ir=Qe;if(wr){var Ro=He==="ArrowLeft"?"left":"right";Ir=U(at,Qe,Ro),Ir!==Qe&&ye.preventDefault()}else He==="Delete"&&!x(at[Qe])?Ir=U(at,Qe,"right"):He==="Backspace"&&!x(at[Qe])&&(Ir=U(at,Qe,"left"));Ir!==Qe&&W(Ee,Ir,at),f(ye),te(Ee,or)},ce=function(ye){var Ee=ye.target,He=function(){var bt=Ee.selectionStart,Kt=Ee.selectionEnd,at=Ee.value;if(at===void 0&&(at=""),bt===Kt){var Qe=U(at,bt);Qe!==bt&&W(Ee,Qe,at)}};He(),requestAnimationFrame(function(){He()}),g(ye),te(Ee)},Q=function(ye){ye.persist&&ye.persist();var Ee=ye.target,He=ye.currentTarget;R.current=Ee,O.current.focusTimeout=setTimeout(function(){var bt=Ee.selectionStart,Kt=Ee.selectionEnd,at=Ee.value;at===void 0&&(at="");var Qe=U(at,bt);Qe!==bt&&!(bt===0&&Kt===at.length)&&W(Ee,Qe,at),p(Object.assign(Object.assign({},ye),{currentTarget:He}))},0)},be=function(ye){R.current=null,clearTimeout(O.current.focusTimeout),clearTimeout(O.current.setCaretTimeout),m(ye)},Ce=P&&rj()?"numeric":void 0,Se=Object.assign({inputMode:Ce},E,{type:t,value:y,onChange:ie,onKeyDown:le,onMouseUp:ce,onFocus:Q,onBlur:be});if(n==="text")return i?I.createElement(I.Fragment,null,i(y,E)||null):I.createElement("span",Object.assign({},E,{ref:a}),y);if(r){var un=r;return I.createElement(un,Object.assign({},Se,{ref:a}))}return I.createElement("input",Object.assign({},Se,{ref:a}))}function sy(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=Of(t),u=l.thousandSeparator,c=l.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,h=Lm(e,o),f=h.beforeDecimal,g=h.afterDecimal,p=h.addNegation;return n!==void 0&&(g=r5(g,n,!!r)),u&&(f=qH(f,u,s)),i&&(f=i+f),a&&(g=g+a),p&&(f="-"+f),e=f+(d&&c||"")+g,e}function Of(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 uj(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 cj(e,t){return new RegExp("(^-)|[0-9]|"+n5(e),"g")}function dj(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function fj(e,t,n){var r;t===void 0&&(t=o5(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,d=u.end,h=Of(n),f=h.allowedDecimalSeparators,g=h.decimalSeparator,p=e[d]===g;if(yo(e)&&(e===a||e===o)&&t.lastValue==="")return e;if(d-c===1&&f.indexOf(e[c])!==-1){var m=s===0?"":g;e=e.substring(0,c)+m+e.substring(c+1,e.length)}var b=function(R,O,j){var V=!1,W=!1;a.startsWith("-")?V=!1:R.startsWith("--")?(V=!1,W=!0):o.startsWith("-")&&R.length===o.length?V=!1:R[0]==="-"&&(V=!0);var U=V?1:0;return W&&(U=2),U&&(R=R.substring(U),O-=U,j-=U),{value:R,start:O,end:j,hasNegation:V}},v=b(e,c,d),x=v.hasNegation;r=v,e=r.value,c=r.start,d=r.end;var C=b(t.lastValue,l.start,l.end),E=C.start,w=C.end,B=C.value,y=e.substring(c,d);e.length&&B.length&&(E>B.length-o.length||w<a.length)&&!(y&&o.startsWith(y))&&(e=B);var S=0;e.startsWith(a)?S+=a.length:c<a.length&&(S=c),e=e.substring(S),d-=S;var D=e.length,A=e.length-o.length;e.endsWith(o)?D=A:(d>A||d>e.length-o.length)&&(D=d),e=e.substring(0,D),e=uj(x?"-"+e:e,i),e=(e.match(cj(g))||[]).join("");var T=e.indexOf(g);e=e.replace(new RegExp(n5(g),"g"),function(R,O){return O===T?".":""});var F=Lm(e,i),k=F.beforeDecimal,P=F.afterDecimal,$=F.addNegation;return u.end-u.start<l.end-l.start&&k===""&&p&&!parseFloat(P)&&(e=$?"-":""),e}function hj(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 gj(e){var t=Of(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
135
  Decimal separator can't be same as thousand separator.
136
136
  thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
137
137
  decimalSeparator: `+r+` (default value for decimalSeparator is .)
@@ -166,12 +166,12 @@ You should wrap it with \`css\` like this:
166
166
  * https://www.chartjs.org
167
167
  * (c) 2024 Chart.js Contributors
168
168
  * Released under the MIT License
169
- */function Si(){}const sW=(()=>{let e=0;return()=>e++})();function Et(e){return e===null||typeof e>"u"}function Yt(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 qe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function wn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Vr(e,t){return wn(e)?e:t}function Ue(e,t){return typeof e>"u"?t:e}const lW=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,p5=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function St(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function pt(e,t,n,r){let i,a,o;if(Yt(e))for(a=e.length,i=0;i<a;i++)t.call(n,e[i],i);else if(qe(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function Wd(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 zd(e){if(Yt(e))return e.map(zd);if(qe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=zd(e[n[i]]);return t}return e}function m5(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function uW(e,t,n,r){if(!m5(e))return;const i=t[e],a=n[e];qe(i)&&qe(a)?nu(i,a,r):t[e]=zd(a)}function nu(e,t,n){const r=Yt(t)?t:[t],i=r.length;if(!qe(e))return e;n=n||{};const a=n.merger||uW;let o;for(let s=0;s<i;++s){if(o=r[s],!qe(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 xl(e,t){return nu(e,t,{merger:cW})}function cW(e,t,n){if(!m5(e))return;const r=t[e],i=n[e];qe(r)&&qe(i)?xl(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=zd(i))}const fy={"":e=>e,x:e=>e.x,y:e=>e.y};function dW(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 fW(e){const t=dW(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function xo(e,t){return(fy[t]||(fy[t]=fW(t)))(e)}function Wm(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ru=e=>typeof e<"u",Da=e=>typeof e=="function",hy=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function hW(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Lt=Math.PI,kt=2*Lt,gW=kt+Lt,Gd=Number.POSITIVE_INFINITY,pW=Lt/180,Qt=Lt/2,Ma=Lt/4,gy=Lt*2/3,b5=Math.log10,ci=Math.sign;function Cl(e,t,n){return Math.abs(e-t)<n}function py(e){const t=Math.round(e);e=Cl(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(b5(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function mW(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 iu(e){return!isNaN(parseFloat(e))&&isFinite(e)}function bW(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function vW(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 Mi(e){return e*(Lt/180)}function yW(e){return e*(180/Lt)}function my(e){if(!wn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function v5(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*Lt&&(a+=kt),{angle:a,distance:i}}function Og(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function xW(e,t){return(e-t+gW)%kt-Lt}function Zr(e){return(e%kt+kt)%kt}function au(e,t,n,r){const i=Zr(e),a=Zr(t),o=Zr(n),s=Zr(a-i),l=Zr(o-i),u=Zr(i-a),c=Zr(i-o);return i===a||i===o||r&&a===o||s>l&&u<c}function En(e,t,n){return Math.max(t,Math.min(n,e))}function CW(e){return En(e,-32768,32767)}function Li(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function zm(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 ro=(e,t,n,r)=>zm(e,n,r?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),EW=(e,t,n)=>zm(e,n,r=>e[r][t]>=n);function SW(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 y5=["push","pop","shift","splice","unshift"];function wW(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),y5.forEach(n=>{const r="_onData"+Wm(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 by(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)&&(y5.forEach(a=>{delete e[a]}),delete e._chartjs)}function x5(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const C5=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function E5(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,C5.call(window,()=>{r=!1,e.apply(t,n)}))}}function IW(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Gm=e=>e==="start"?"left":e==="end"?"right":"center",bn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,_W=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function DW(e,t,n){const r=t.length;let i=0,a=r;if(e._sorted){const{iScale:o,_parsed:s}=e,l=o.axis,{min:u,max:c,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(i=En(Math.min(ro(s,l,u).lo,n?r:ro(t,l,o.getPixelForValue(u)).lo),0,r-1)),h?a=En(Math.max(ro(s,o.axis,c,!0).hi+1,n?0:ro(t,l,o.getPixelForValue(c),!0).hi+1),i,r)-i:a=r-i}return{start:i,count:a}}function AW(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 hc=e=>e===0||e===1,vy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*kt/n)),yy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*kt/n)+1,El={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*Qt)+1,easeOutSine:e=>Math.sin(e*Qt),easeInOutSine:e=>-.5*(Math.cos(Lt*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=>hc(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=>hc(e)?e:vy(e,.075,.3),easeOutElastic:e=>hc(e)?e:yy(e,.075,.3),easeInOutElastic(e){return hc(e)?e:e<.5?.5*vy(e*2,.1125,.45):.5+.5*yy(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-El.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?El.easeInBounce(e*2)*.5:El.easeOutBounce(e*2-1)*.5+.5};function Um(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xy(e){return Um(e)?e:new tu(e)}function qh(e){return Um(e)?e:new tu(e).saturate(.5).darken(.1).hexString()}const TW=["x","y","borderWidth","radius","tension"],RW=["color","borderColor","backgroundColor"];function BW(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:RW},numbers:{type:"number",properties:TW}}),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 $W(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Cy=new Map;function kW(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Cy.get(n);return r||(r=new Intl.NumberFormat(e,t),Cy.set(n,r)),r}function Xm(e,t,n){return kW(t,n).format(e)}const PW={values(e){return Yt(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=FW(e,n)}const o=b5(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),Xm(e,r,l)}};function FW(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 S5={formatters:PW};function NW(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:S5.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 Co=Object.create(null),Vg=Object.create(null);function Sl(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 Qh(e,t,n){return typeof t=="string"?nu(Sl(e,t),n):nu(Sl(e,""),t)}class MW{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)=>qh(i.backgroundColor),this.hoverBorderColor=(r,i)=>qh(i.borderColor),this.hoverColor=(r,i)=>qh(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 Qh(this,t,n)}get(t){return Sl(this,t)}describe(t,n){return Qh(Vg,t,n)}override(t,n){return Qh(Co,t,n)}route(t,n,r,i){const a=Sl(this,t),o=Sl(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 qe(l)?Object.assign({},u,l):Ue(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var Ht=new MW({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[BW,$W,NW]);function LW(e){return!e||Et(e.size)||Et(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Ey(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 La(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 Sy(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Hg(e,t,n,r){w5(e,t,n,r,null)}function w5(e,t,n,r,i){let a,o,s,l,u,c,d,h;const f=t.pointStyle,g=t.rotation,p=t.radius;let m=(g||0)*pW;if(f&&typeof f=="object"&&(a=f.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),f){default:i?e.ellipse(n,r,i/2,p,0,0,kt):e.arc(n,r,p,0,kt),e.closePath();break;case"triangle":c=i?i/2:p,e.moveTo(n+Math.sin(m)*c,r-Math.cos(m)*p),m+=gy,e.lineTo(n+Math.sin(m)*c,r-Math.cos(m)*p),m+=gy,e.lineTo(n+Math.sin(m)*c,r-Math.cos(m)*p),e.closePath();break;case"rectRounded":u=p*.516,l=p-u,o=Math.cos(m+Ma)*l,d=Math.cos(m+Ma)*(i?i/2-u:l),s=Math.sin(m+Ma)*l,h=Math.sin(m+Ma)*(i?i/2-u:l),e.arc(n-d,r-s,u,m-Lt,m-Qt),e.arc(n+h,r-o,u,m-Qt,m),e.arc(n+d,r+s,u,m,m+Qt),e.arc(n-h,r+o,u,m+Qt,m+Lt),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}m+=Ma;case"rectRot":d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+h,r-o),e.lineTo(n+d,r+s),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":m+=Ma;case"cross":d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),m+=Ma,d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(m)*(i?i/2:p),r+Math.sin(m)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ou(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 Vf(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Hf(e){e.restore()}function OW(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 VW(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 HW(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 jW(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 WW(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function su(e,t,n,r,i,a={}){const o=Yt(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,HW(e,a),l=0;l<o.length;++l)u=o[l],a.backdrop&&WW(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),jW(e,n,r,u,a),r+=Number(i.lineHeight);e.restore()}function Ud(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*Lt,Lt,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,Lt,Qt,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,Qt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Qt,!0),e.lineTo(n+o.topLeft,r)}const zW=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,GW=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UW(e,t){const n=(""+e).match(zW);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 XW=e=>+e||0;function Zm(e,t){const n={},r=qe(t),i=r?Object.keys(t):t,a=qe(e)?r?o=>Ue(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=XW(a(o));return n}function I5(e){return Zm(e,{top:"y",right:"x",bottom:"y",left:"x"})}function us(e){return Zm(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Sr(e){const t=I5(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Sn(e,t){e=e||{},t=t||Ht.font;let n=Ue(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ue(e.style,t.style);r&&!(""+r).match(GW)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Ue(e.family,t.family),lineHeight:UW(Ue(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ue(e.weight,t.weight),string:""};return i.string=LW(i),i}function gc(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 ZW(e,t,n){const{min:r,max:i}=e,a=p5(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 Ao(e,t){return Object.assign(Object.create(e),t)}function Ym(e,t=[""],n,r,i=()=>e[0]){const a=n||e;typeof r>"u"&&(r=T5("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:s=>Ym([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 D5(s,l,()=>nz(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return Iy(s).includes(l)},ownKeys(s){return Iy(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function Ss(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:_5(e,r),setContext:a=>Ss(e,a,n,r),override:a=>Ss(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 D5(a,o,()=>KW(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 _5(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:Da(n)?n:()=>n,isIndexable:Da(r)?r:()=>r}}const YW=(e,t)=>e?e+Wm(t):t,Km=(e,t)=>qe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function D5(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function KW(e,t,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e;let s=r[t];return Da(s)&&o.isScriptable(t)&&(s=JW(t,s,e,n)),Yt(s)&&s.length&&(s=qW(t,s,e,o.isIndexable)),Km(t,s)&&(s=Ss(s,i,a&&a[t],o)),s}function JW(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),Km(e,l)&&(l=Jm(i._scopes,i,e,l)),l}function qW(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(qe(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=Jm(u,i,e,c);t.push(Ss(d,a,o&&o[e],s))}}return t}function A5(e,t,n){return Da(e)?e(t,n):e}const QW=(e,t)=>e===!0?t:typeof e=="string"?xo(t,e):void 0;function ez(e,t,n,r,i){for(const a of t){const o=QW(n,a);if(o){e.add(o);const s=A5(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 Jm(e,t,n,r){const i=t._rootScopes,a=A5(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let l=wy(s,o,n,a||n,r);return l===null||typeof a<"u"&&a!==n&&(l=wy(s,o,a,l,r),l===null)?!1:Ym(Array.from(s),[""],i,a,()=>tz(t,n,r))}function wy(e,t,n,r,i){for(;n;)n=ez(e,t,n,r,i);return n}function tz(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Yt(i)&&qe(n)?n:i||{}}function nz(e,t,n,r){let i;for(const a of t)if(i=T5(YW(a,e),n),typeof i<"u")return Km(e,i)?Jm(n,r,e,i):i}function T5(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function Iy(e){let t=e._keys;return t||(t=e._keys=rz(e._scopes)),t}function rz(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 iz=Number.EPSILON||1e-14,ws=(e,t)=>t<e.length&&!e[t].skip&&e[t],R5=e=>e==="x"?"y":"x";function az(e,t,n,r){const i=e.skip?t:e,a=t,o=n.skip?t:n,s=Og(a,i),l=Og(o,a);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,h=r*c;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+h*(o.x-i.x),y:a.y+h*(o.y-i.y)}}}function oz(e,t,n){const r=e.length;let i,a,o,s,l,u=ws(e,0);for(let c=0;c<r-1;++c)if(l=u,u=ws(e,c+1),!(!l||!u)){if(Cl(t[c],0,iz)){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 sz(e,t,n="x"){const r=R5(n),i=e.length;let a,o,s,l=ws(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=ws(e,u+1),!s)continue;const c=s[n],d=s[r];o&&(a=(c-o[n])/3,s[`cp1${n}`]=c-a,s[`cp1${r}`]=d-a*t[u]),l&&(a=(l[n]-c)/3,s[`cp2${n}`]=c+a,s[`cp2${r}`]=d+a*t[u])}}function lz(e,t="x"){const n=R5(t),r=e.length,i=Array(r).fill(0),a=Array(r);let o,s,l,u=ws(e,0);for(o=0;o<r;++o)if(s=l,l=u,u=ws(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?ci(i[o-1])!==ci(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}oz(e,i,a),sz(e,a,t)}function pc(e,t,n){return Math.max(Math.min(e,n),t)}function uz(e,t){let n,r,i,a,o,s=ou(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&ou(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=pc(i.cp1x,t.left,t.right),i.cp1y=pc(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=pc(i.cp2x,t.left,t.right),i.cp2y=pc(i.cp2y,t.top,t.bottom)))}function cz(e,t,n,r,i){let a,o,s,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")lz(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=az(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&&uz(e,n)}function qm(){return typeof window<"u"&&typeof document<"u"}function Qm(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Xd(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 jf=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function dz(e,t){return jf(e).getPropertyValue(t)}const fz=["top","right","bottom","left"];function uo(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=fz[i];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const hz=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function gz(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r;let o=!1,s,l;if(hz(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 Wa(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=jf(n),a=i.boxSizing==="border-box",o=uo(i,"padding"),s=uo(i,"border","width"),{x:l,y:u,box:c}=gz(e,n),d=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:f,height:g}=t;return a&&(f-=o.width+s.width,g-=o.height+s.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((u-h)/g*n.height/r)}}function pz(e,t,n){let r,i;if(t===void 0||n===void 0){const a=e&&Qm(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{const o=a.getBoundingClientRect(),s=jf(a),l=uo(s,"border","width"),u=uo(s,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Xd(s.maxWidth,a,"clientWidth"),i=Xd(s.maxHeight,a,"clientHeight")}}return{width:t,height:n,maxWidth:r||Gd,maxHeight:i||Gd}}const mc=e=>Math.round(e*10)/10;function mz(e,t,n,r){const i=jf(e),a=uo(i,"margin"),o=Xd(i.maxWidth,e,"clientWidth")||Gd,s=Xd(i.maxHeight,e,"clientHeight")||Gd,l=pz(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=uo(i,"border","width"),f=uo(i,"padding");u-=f.width+h.width,c-=f.height+h.height}return u=Math.max(0,u-a.width),c=Math.max(0,r?u/r:c-a.height),u=mc(Math.min(u,o,l.maxWidth)),c=mc(Math.min(c,s,l.maxHeight)),u&&!c&&(c=mc(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=mc(Math.floor(c*r))),{width:u,height:c}}function _y(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 bz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};qm()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Dy(e,t){const n=dz(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function za(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function vz(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 yz(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=za(e,i,n),s=za(i,a,n),l=za(a,t,n),u=za(o,s,n),c=za(s,l,n);return za(u,c,n)}const xz=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}}},Cz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function cs(e,t,n){return e?xz(t,n):Cz()}function B5(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 $5(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function k5(e){return e==="angle"?{between:au,compare:xW,normalize:Zr}:{between:Li,compare:(t,n)=>t-n,normalize:t=>t}}function Ay({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 Ez(e,t,n){const{property:r,start:i,end:a}=n,{between:o,normalize:s}=k5(r),l=t.length;let{start:u,end:c,loop:d}=e,h,f;if(d){for(u+=l,c+=l,h=0,f=l;h<f&&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:d,style:e.style}}function P5(e,t,n){if(!n)return[e];const{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:l,normalize:u}=k5(r),{start:c,end:d,loop:h,style:f}=Ez(e,t,n),g=[];let p=!1,m=null,b,v,x;const C=()=>l(i,x,b)&&s(i,x)!==0,E=()=>s(a,b)===0||l(a,x,b),w=()=>p||C(),B=()=>!p||E();for(let y=c,S=c;y<=d;++y)v=t[y%o],!v.skip&&(b=u(v[r]),b!==x&&(p=l(b,i,a),m===null&&w()&&(m=s(b,i)===0?y:S),m!==null&&B()&&(g.push(Ay({start:m,end:y,loop:h,count:o,style:f})),m=null),S=y,x=b));return m!==null&&g.push(Ay({start:m,end:d,loop:h,count:o,style:f})),g}function F5(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const a=P5(r[i],e.points,t);a.length&&n.push(...a)}return n}function Sz(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 wz(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 Iz(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const a=!!e._loop,{start:o,end:s}=Sz(n,i,a,r);if(r===!0)return Ty(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 Ty(e,wz(n,o,l,u),n,t)}function Ty(e,t,n,r){return!r||!r.setContext||!n?t:_z(e,t,n,r)}function _z(e,t,n,r){const i=e._chart.getContext(),a=Ry(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=a,d=t[0].start,h=d;function f(g,p,m,b){const v=s?-1:1;if(g!==p){for(g+=l;n[g%l].skip;)g-=v;for(;n[p%l].skip;)p+=v;g%l!==p%l&&(u.push({start:g%l,end:p%l,loop:m,style:b}),c=b,d=p%l)}}for(const g of t){d=s?d:g.start;let p=n[d%l],m;for(h=d+1;h<=g.end;h++){const b=n[h%l];m=Ry(r.setContext(Ao(i,{type:"segment",p0:p,p1:b,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),Dz(m,c)&&f(d,h-1,g.loop,c),p=b,c=m}d<h-1&&f(d,h-1,g.loop,c)}return u}function Ry(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Dz(e,t){if(!t)return!1;const n=[],r=function(i,a){return Um(a)?(n.includes(a)||n.push(a),n.indexOf(a)):a};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
169
+ */function Si(){}const sW=(()=>{let e=0;return()=>e++})();function Et(e){return e===null||typeof e>"u"}function Yt(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 qe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function wn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Vr(e,t){return wn(e)?e:t}function Ue(e,t){return typeof e>"u"?t:e}const lW=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,p5=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function St(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function pt(e,t,n,r){let i,a,o;if(Yt(e))for(a=e.length,i=0;i<a;i++)t.call(n,e[i],i);else if(qe(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function Wd(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 zd(e){if(Yt(e))return e.map(zd);if(qe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=zd(e[n[i]]);return t}return e}function m5(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function uW(e,t,n,r){if(!m5(e))return;const i=t[e],a=n[e];qe(i)&&qe(a)?nu(i,a,r):t[e]=zd(a)}function nu(e,t,n){const r=Yt(t)?t:[t],i=r.length;if(!qe(e))return e;n=n||{};const a=n.merger||uW;let o;for(let s=0;s<i;++s){if(o=r[s],!qe(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 xl(e,t){return nu(e,t,{merger:cW})}function cW(e,t,n){if(!m5(e))return;const r=t[e],i=n[e];qe(r)&&qe(i)?xl(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=zd(i))}const fy={"":e=>e,x:e=>e.x,y:e=>e.y};function dW(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 fW(e){const t=dW(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function xo(e,t){return(fy[t]||(fy[t]=fW(t)))(e)}function Wm(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ru=e=>typeof e<"u",Da=e=>typeof e=="function",hy=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function hW(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ot=Math.PI,kt=2*Ot,gW=kt+Ot,Gd=Number.POSITIVE_INFINITY,pW=Ot/180,Qt=Ot/2,Ma=Ot/4,gy=Ot*2/3,b5=Math.log10,ci=Math.sign;function Cl(e,t,n){return Math.abs(e-t)<n}function py(e){const t=Math.round(e);e=Cl(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(b5(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function mW(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 iu(e){return!isNaN(parseFloat(e))&&isFinite(e)}function bW(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function vW(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 Mi(e){return e*(Ot/180)}function yW(e){return e*(180/Ot)}function my(e){if(!wn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function v5(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*Ot&&(a+=kt),{angle:a,distance:i}}function Og(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function xW(e,t){return(e-t+gW)%kt-Ot}function Zr(e){return(e%kt+kt)%kt}function au(e,t,n,r){const i=Zr(e),a=Zr(t),o=Zr(n),s=Zr(a-i),l=Zr(o-i),u=Zr(i-a),c=Zr(i-o);return i===a||i===o||r&&a===o||s>l&&u<c}function En(e,t,n){return Math.max(t,Math.min(n,e))}function CW(e){return En(e,-32768,32767)}function Li(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function zm(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 ro=(e,t,n,r)=>zm(e,n,r?i=>{const a=e[i][t];return a<n||a===n&&e[i+1][t]===n}:i=>e[i][t]<n),EW=(e,t,n)=>zm(e,n,r=>e[r][t]>=n);function SW(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 y5=["push","pop","shift","splice","unshift"];function wW(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),y5.forEach(n=>{const r="_onData"+Wm(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 by(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)&&(y5.forEach(a=>{delete e[a]}),delete e._chartjs)}function x5(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const C5=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function E5(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,C5.call(window,()=>{r=!1,e.apply(t,n)}))}}function IW(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Gm=e=>e==="start"?"left":e==="end"?"right":"center",bn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,_W=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function DW(e,t,n){const r=t.length;let i=0,a=r;if(e._sorted){const{iScale:o,_parsed:s}=e,l=o.axis,{min:u,max:c,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(i=En(Math.min(ro(s,l,u).lo,n?r:ro(t,l,o.getPixelForValue(u)).lo),0,r-1)),h?a=En(Math.max(ro(s,o.axis,c,!0).hi+1,n?0:ro(t,l,o.getPixelForValue(c),!0).hi+1),i,r)-i:a=r-i}return{start:i,count:a}}function AW(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 hc=e=>e===0||e===1,vy=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*kt/n)),yy=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*kt/n)+1,El={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*Qt)+1,easeOutSine:e=>Math.sin(e*Qt),easeInOutSine:e=>-.5*(Math.cos(Ot*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=>hc(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=>hc(e)?e:vy(e,.075,.3),easeOutElastic:e=>hc(e)?e:yy(e,.075,.3),easeInOutElastic(e){return hc(e)?e:e<.5?.5*vy(e*2,.1125,.45):.5+.5*yy(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-El.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?El.easeInBounce(e*2)*.5:El.easeOutBounce(e*2-1)*.5+.5};function Um(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xy(e){return Um(e)?e:new tu(e)}function qh(e){return Um(e)?e:new tu(e).saturate(.5).darken(.1).hexString()}const TW=["x","y","borderWidth","radius","tension"],RW=["color","borderColor","backgroundColor"];function BW(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:RW},numbers:{type:"number",properties:TW}}),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 $W(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Cy=new Map;function kW(e,t){t=t||{};const n=e+JSON.stringify(t);let r=Cy.get(n);return r||(r=new Intl.NumberFormat(e,t),Cy.set(n,r)),r}function Xm(e,t,n){return kW(t,n).format(e)}const PW={values(e){return Yt(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=FW(e,n)}const o=b5(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),Xm(e,r,l)}};function FW(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 S5={formatters:PW};function NW(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:S5.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 Co=Object.create(null),Vg=Object.create(null);function Sl(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 Qh(e,t,n){return typeof t=="string"?nu(Sl(e,t),n):nu(Sl(e,""),t)}class MW{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)=>qh(i.backgroundColor),this.hoverBorderColor=(r,i)=>qh(i.borderColor),this.hoverColor=(r,i)=>qh(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 Qh(this,t,n)}get(t){return Sl(this,t)}describe(t,n){return Qh(Vg,t,n)}override(t,n){return Qh(Co,t,n)}route(t,n,r,i){const a=Sl(this,t),o=Sl(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 qe(l)?Object.assign({},u,l):Ue(l,u)},set(l){this[s]=l}}})}apply(t){t.forEach(n=>n(this))}}var Ht=new MW({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[BW,$W,NW]);function LW(e){return!e||Et(e.size)||Et(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Ey(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 La(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 Sy(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Hg(e,t,n,r){w5(e,t,n,r,null)}function w5(e,t,n,r,i){let a,o,s,l,u,c,d,h;const f=t.pointStyle,g=t.rotation,p=t.radius;let m=(g||0)*pW;if(f&&typeof f=="object"&&(a=f.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),f){default:i?e.ellipse(n,r,i/2,p,0,0,kt):e.arc(n,r,p,0,kt),e.closePath();break;case"triangle":c=i?i/2:p,e.moveTo(n+Math.sin(m)*c,r-Math.cos(m)*p),m+=gy,e.lineTo(n+Math.sin(m)*c,r-Math.cos(m)*p),m+=gy,e.lineTo(n+Math.sin(m)*c,r-Math.cos(m)*p),e.closePath();break;case"rectRounded":u=p*.516,l=p-u,o=Math.cos(m+Ma)*l,d=Math.cos(m+Ma)*(i?i/2-u:l),s=Math.sin(m+Ma)*l,h=Math.sin(m+Ma)*(i?i/2-u:l),e.arc(n-d,r-s,u,m-Ot,m-Qt),e.arc(n+h,r-o,u,m-Qt,m),e.arc(n+d,r+s,u,m,m+Qt),e.arc(n-h,r+o,u,m+Qt,m+Ot),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,c=i?i/2:l,e.rect(n-c,r-l,2*c,2*l);break}m+=Ma;case"rectRot":d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+h,r-o),e.lineTo(n+d,r+s),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":m+=Ma;case"cross":d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),m+=Ma,d=Math.cos(m)*(i?i/2:p),o=Math.cos(m)*p,s=Math.sin(m)*p,h=Math.sin(m)*(i?i/2:p),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(m)*p,s=Math.sin(m)*p,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(m)*(i?i/2:p),r+Math.sin(m)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ou(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 Vf(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Hf(e){e.restore()}function OW(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 VW(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 HW(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 jW(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 WW(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function su(e,t,n,r,i,a={}){const o=Yt(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!=="";let l,u;for(e.save(),e.font=i.string,HW(e,a),l=0;l<o.length;++l)u=o[l],a.backdrop&&WW(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),jW(e,n,r,u,a),r+=Number(i.lineHeight);e.restore()}function Ud(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*Ot,Ot,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,Ot,Qt,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,Qt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-Qt,!0),e.lineTo(n+o.topLeft,r)}const zW=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,GW=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function UW(e,t){const n=(""+e).match(zW);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 XW=e=>+e||0;function Zm(e,t){const n={},r=qe(t),i=r?Object.keys(t):t,a=qe(e)?r?o=>Ue(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=XW(a(o));return n}function I5(e){return Zm(e,{top:"y",right:"x",bottom:"y",left:"x"})}function us(e){return Zm(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Sr(e){const t=I5(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Sn(e,t){e=e||{},t=t||Ht.font;let n=Ue(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ue(e.style,t.style);r&&!(""+r).match(GW)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:Ue(e.family,t.family),lineHeight:UW(Ue(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ue(e.weight,t.weight),string:""};return i.string=LW(i),i}function gc(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 ZW(e,t,n){const{min:r,max:i}=e,a=p5(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 Ao(e,t){return Object.assign(Object.create(e),t)}function Ym(e,t=[""],n,r,i=()=>e[0]){const a=n||e;typeof r>"u"&&(r=T5("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:s=>Ym([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 D5(s,l,()=>nz(l,t,e,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(s,l){return Iy(s).includes(l)},ownKeys(s){return Iy(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function Ss(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:_5(e,r),setContext:a=>Ss(e,a,n,r),override:a=>Ss(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 D5(a,o,()=>KW(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 _5(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:Da(n)?n:()=>n,isIndexable:Da(r)?r:()=>r}}const YW=(e,t)=>e?e+Wm(t):t,Km=(e,t)=>qe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function D5(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function KW(e,t,n){const{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e;let s=r[t];return Da(s)&&o.isScriptable(t)&&(s=JW(t,s,e,n)),Yt(s)&&s.length&&(s=qW(t,s,e,o.isIndexable)),Km(t,s)&&(s=Ss(s,i,a&&a[t],o)),s}function JW(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),Km(e,l)&&(l=Jm(i._scopes,i,e,l)),l}function qW(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(qe(t[0])){const l=t,u=i._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=Jm(u,i,e,c);t.push(Ss(d,a,o&&o[e],s))}}return t}function A5(e,t,n){return Da(e)?e(t,n):e}const QW=(e,t)=>e===!0?t:typeof e=="string"?xo(t,e):void 0;function ez(e,t,n,r,i){for(const a of t){const o=QW(n,a);if(o){e.add(o);const s=A5(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 Jm(e,t,n,r){const i=t._rootScopes,a=A5(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let l=wy(s,o,n,a||n,r);return l===null||typeof a<"u"&&a!==n&&(l=wy(s,o,a,l,r),l===null)?!1:Ym(Array.from(s),[""],i,a,()=>tz(t,n,r))}function wy(e,t,n,r,i){for(;n;)n=ez(e,t,n,r,i);return n}function tz(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Yt(i)&&qe(n)?n:i||{}}function nz(e,t,n,r){let i;for(const a of t)if(i=T5(YW(a,e),n),typeof i<"u")return Km(e,i)?Jm(n,r,e,i):i}function T5(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function Iy(e){let t=e._keys;return t||(t=e._keys=rz(e._scopes)),t}function rz(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 iz=Number.EPSILON||1e-14,ws=(e,t)=>t<e.length&&!e[t].skip&&e[t],R5=e=>e==="x"?"y":"x";function az(e,t,n,r){const i=e.skip?t:e,a=t,o=n.skip?t:n,s=Og(a,i),l=Og(o,a);let u=s/(s+l),c=l/(s+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,h=r*c;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+h*(o.x-i.x),y:a.y+h*(o.y-i.y)}}}function oz(e,t,n){const r=e.length;let i,a,o,s,l,u=ws(e,0);for(let c=0;c<r-1;++c)if(l=u,u=ws(e,c+1),!(!l||!u)){if(Cl(t[c],0,iz)){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 sz(e,t,n="x"){const r=R5(n),i=e.length;let a,o,s,l=ws(e,0);for(let u=0;u<i;++u){if(o=s,s=l,l=ws(e,u+1),!s)continue;const c=s[n],d=s[r];o&&(a=(c-o[n])/3,s[`cp1${n}`]=c-a,s[`cp1${r}`]=d-a*t[u]),l&&(a=(l[n]-c)/3,s[`cp2${n}`]=c+a,s[`cp2${r}`]=d+a*t[u])}}function lz(e,t="x"){const n=R5(t),r=e.length,i=Array(r).fill(0),a=Array(r);let o,s,l,u=ws(e,0);for(o=0;o<r;++o)if(s=l,l=u,u=ws(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?ci(i[o-1])!==ci(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}oz(e,i,a),sz(e,a,t)}function pc(e,t,n){return Math.max(Math.min(e,n),t)}function uz(e,t){let n,r,i,a,o,s=ou(e[0],t);for(n=0,r=e.length;n<r;++n)o=a,a=s,s=n<r-1&&ou(e[n+1],t),a&&(i=e[n],o&&(i.cp1x=pc(i.cp1x,t.left,t.right),i.cp1y=pc(i.cp1y,t.top,t.bottom)),s&&(i.cp2x=pc(i.cp2x,t.left,t.right),i.cp2y=pc(i.cp2y,t.top,t.bottom)))}function cz(e,t,n,r,i){let a,o,s,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")lz(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=az(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&&uz(e,n)}function qm(){return typeof window<"u"&&typeof document<"u"}function Qm(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Xd(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 jf=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function dz(e,t){return jf(e).getPropertyValue(t)}const fz=["top","right","bottom","left"];function uo(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const a=fz[i];r[a]=parseFloat(e[t+"-"+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const hz=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function gz(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r;let o=!1,s,l;if(hz(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 Wa(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=jf(n),a=i.boxSizing==="border-box",o=uo(i,"padding"),s=uo(i,"border","width"),{x:l,y:u,box:c}=gz(e,n),d=o.left+(c&&s.left),h=o.top+(c&&s.top);let{width:f,height:g}=t;return a&&(f-=o.width+s.width,g-=o.height+s.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((u-h)/g*n.height/r)}}function pz(e,t,n){let r,i;if(t===void 0||n===void 0){const a=e&&Qm(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{const o=a.getBoundingClientRect(),s=jf(a),l=uo(s,"border","width"),u=uo(s,"padding");t=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Xd(s.maxWidth,a,"clientWidth"),i=Xd(s.maxHeight,a,"clientHeight")}}return{width:t,height:n,maxWidth:r||Gd,maxHeight:i||Gd}}const mc=e=>Math.round(e*10)/10;function mz(e,t,n,r){const i=jf(e),a=uo(i,"margin"),o=Xd(i.maxWidth,e,"clientWidth")||Gd,s=Xd(i.maxHeight,e,"clientHeight")||Gd,l=pz(e,t,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=uo(i,"border","width"),f=uo(i,"padding");u-=f.width+h.width,c-=f.height+h.height}return u=Math.max(0,u-a.width),c=Math.max(0,r?u/r:c-a.height),u=mc(Math.min(u,o,l.maxWidth)),c=mc(Math.min(c,s,l.maxHeight)),u&&!c&&(c=mc(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=mc(Math.floor(c*r))),{width:u,height:c}}function _y(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 bz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};qm()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Dy(e,t){const n=dz(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function za(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function vz(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 yz(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=za(e,i,n),s=za(i,a,n),l=za(a,t,n),u=za(o,s,n),c=za(s,l,n);return za(u,c,n)}const xz=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}}},Cz=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function cs(e,t,n){return e?xz(t,n):Cz()}function B5(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 $5(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function k5(e){return e==="angle"?{between:au,compare:xW,normalize:Zr}:{between:Li,compare:(t,n)=>t-n,normalize:t=>t}}function Ay({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 Ez(e,t,n){const{property:r,start:i,end:a}=n,{between:o,normalize:s}=k5(r),l=t.length;let{start:u,end:c,loop:d}=e,h,f;if(d){for(u+=l,c+=l,h=0,f=l;h<f&&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:d,style:e.style}}function P5(e,t,n){if(!n)return[e];const{property:r,start:i,end:a}=n,o=t.length,{compare:s,between:l,normalize:u}=k5(r),{start:c,end:d,loop:h,style:f}=Ez(e,t,n),g=[];let p=!1,m=null,b,v,x;const C=()=>l(i,x,b)&&s(i,x)!==0,E=()=>s(a,b)===0||l(a,x,b),w=()=>p||C(),B=()=>!p||E();for(let y=c,S=c;y<=d;++y)v=t[y%o],!v.skip&&(b=u(v[r]),b!==x&&(p=l(b,i,a),m===null&&w()&&(m=s(b,i)===0?y:S),m!==null&&B()&&(g.push(Ay({start:m,end:y,loop:h,count:o,style:f})),m=null),S=y,x=b));return m!==null&&g.push(Ay({start:m,end:d,loop:h,count:o,style:f})),g}function F5(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const a=P5(r[i],e.points,t);a.length&&n.push(...a)}return n}function Sz(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 wz(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 Iz(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const a=!!e._loop,{start:o,end:s}=Sz(n,i,a,r);if(r===!0)return Ty(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 Ty(e,wz(n,o,l,u),n,t)}function Ty(e,t,n,r){return!r||!r.setContext||!n?t:_z(e,t,n,r)}function _z(e,t,n,r){const i=e._chart.getContext(),a=Ry(e.options),{_datasetIndex:o,options:{spanGaps:s}}=e,l=n.length,u=[];let c=a,d=t[0].start,h=d;function f(g,p,m,b){const v=s?-1:1;if(g!==p){for(g+=l;n[g%l].skip;)g-=v;for(;n[p%l].skip;)p+=v;g%l!==p%l&&(u.push({start:g%l,end:p%l,loop:m,style:b}),c=b,d=p%l)}}for(const g of t){d=s?d:g.start;let p=n[d%l],m;for(h=d+1;h<=g.end;h++){const b=n[h%l];m=Ry(r.setContext(Ao(i,{type:"segment",p0:p,p1:b,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),Dz(m,c)&&f(d,h-1,g.loop,c),p=b,c=m}d<h-1&&f(d,h-1,g.loop,c)}return u}function Ry(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Dz(e,t){if(!t)return!1;const n=[],r=function(i,a){return Um(a)?(n.includes(a)||n.push(a),n.indexOf(a)):a};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
170
170
  * Chart.js v4.4.3
171
171
  * https://www.chartjs.org
172
172
  * (c) 2024 Chart.js Contributors
173
173
  * Released under the MIT License
174
- */class Az{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=C5.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 Ii=new Az;const By="transparent",Tz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=xy(e||By),i=r.valid&&xy(t||By);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Rz{constructor(t,n,r,i){const a=n[r];i=gc([t.to,i,a,t.from]);const o=gc([t.from,a,i]);this._active=!0,this._fn=t.fn||Tz[t.type||typeof o],this._easing=El[t.easing]||El.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=gc([t.to,n,i,t.from]),this._from=gc([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 N5{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!qe(t))return;const n=Object.keys(Ht.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!qe(a))return;const o={};for(const s of n)o[s]=a[s];(Yt(a.properties)&&a.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,o)})})}_animateOptions(t,n){const r=n.options,i=$z(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&Bz(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 d=a[u];const h=r.get(u);if(d)if(h&&d.active()){d.update(h,c,s);continue}else d.cancel();if(!h||!h.duration){t[u]=c;continue}a[u]=d=new Rz(h,t,u,c),i.push(d)}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 Ii.add(this._chart,r),!0}}function Bz(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 $z(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 $y(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 kz(e,t,n){if(n===!1)return!1;const r=$y(e,n),i=$y(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Pz(e){let t,n,r,i;return qe(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 M5(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 ky(e,t,n,r={}){const i=e.keys,a=r.mode==="single";let o,s,l,u;if(t!==null){for(o=0,s=i.length;o<s;++o){if(l=+i[o],l===n){if(r.all)continue;break}u=e.values[l],wn(u)&&(a||t===0||ci(t)===ci(u))&&(t+=u)}return t}}function Fz(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 Py(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Nz(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Mz(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 Lz(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Fy(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 Ny(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=Nz(a,o,r),d=t.length;let h;for(let f=0;f<d;++f){const g=t[f],{[l]:p,[u]:m}=g,b=g._stacks||(g._stacks={});h=b[u]=Lz(i,c,p),h[s]=m,h._top=Fy(h,o,!0,r.type),h._bottom=Fy(h,o,!1,r.type);const v=h._visualValues||(h._visualValues={});v[s]=m}}function e0(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Oz(e,t){return Ao(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Vz(e,t,n){return Ao(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function zs(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 t0=e=>e==="reset"||e==="none",My=(e,t)=>t?e:Object.assign({},e),Hz=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:M5(n,!0),values:null};class co{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=Py(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&&zs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,f,g)=>d==="x"?h:d==="r"?g:f,a=n.xAxisID=Ue(r.xAxisID,e0(t,"x")),o=n.yAxisID=Ue(r.yAxisID,e0(t,"y")),s=n.rAxisID=Ue(r.rAxisID,e0(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&&by(this._data,this),t._stacked&&zs(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(qe(n)){const i=this._cachedMeta;this._data=Fz(n,i)}else if(r!==n){if(r){by(r,this);const i=this._cachedMeta;zs(i),i._parsed=[]}n&&Object.isExtensible(n)&&wW(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=Py(n.vScale,n),n.stack!==r.stack&&(i=!0,zs(n),n.stack=r.stack),this._resyncElements(t),(i||a!==n._stacked)&&Ny(this,n._parsed)}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,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{Yt(i[t])?h=this.parseArrayData(r,i,t,n):qe(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const f=()=>d[s]===null||u&&d[s]<u[s];for(c=0;c<n;++c)r._parsed[c+t]=d=h[c],l&&(f()&&(l=!1),u=d);r._sorted=l}o&&Ny(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,d=new Array(i);let h,f,g;for(h=0,f=i;h<f;++h)g=h+r,d[h]={[s]:c||a.parse(u[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:a,yScale:o}=t,s=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],s[l]={x:a.parse(d[0],c),y:o.parse(d[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,d,h,f;for(c=0,d=i;c<d;++c)h=c+r,f=n[h],u[c]={x:a.parse(xo(f,s),h),y:o.parse(xo(f,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:M5(i,!0),values:n._stacks[t.axis]._visualValues};return ky(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=ky(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=Hz(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Mz(s);let h,f;function g(){f=i[h];const p=f[s.axis];return!wn(f[t.axis])||c>p||d<p}for(h=0;h<o&&!(!g()&&(this.updateRangeFromParsed(u,t,f,l),a));++h);if(a){for(h=o-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(u,t,f,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],wn(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=Pz(Ue(this.options.clip,kz(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 d=i[c];d.hidden||(d.active&&u?o.push(d):d.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=Vz(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=Oz(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&&ru(r);if(s)return My(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),c),f=Object.keys(Ht.elements[t]),g=()=>this.getContext(r,i,n),p=u.resolveNamedOptions(h,f,g,d);return p.$shared&&(p.$shared=l,a[o]=Object.freeze(My(p,l))),p}_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,d=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(h,this.getContext(t,r,n))}const u=new N5(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||t0(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){t0(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!t0(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&&zs(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])}}xe(co,"defaults",{}),xe(co,"datasetElementType",null),xe(co,"dataElementType",null);function jz(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=x5(r.sort((i,a)=>i-a))}return e._cache.$bar}function Wz(e){const t=e.iScale,n=jz(t,e.type);let r=t._length,i,a,o,s;const l=()=>{o===32767||o===-32768||(ru(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 zz(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 Gz(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 Uz(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 L5(e,t,n,r){return Yt(e)?Uz(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Ly(e,t,n,r){const i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,l=[];let u,c,d,h;for(u=n,c=n+r;u<c;++u)h=t[u],d={},d[i.axis]=s||i.parse(o[u],u),l.push(L5(h,d,a,u));return l}function n0(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Xz(e,t,n){return e!==0?ci(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Zz(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 Yz(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}=Zz(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(a[Oy(c,o,s,l)]=!0,i=u)),a[Oy(i,o,s,l)]=!0,e.borderSkipped=a}function Oy(e,t,n,r){return r?(e=Kz(e,t,n),e=Vy(e,n,t)):e=Vy(e,t,n),e}function Kz(e,t,n){return e===t?n:e===n?t:e}function Vy(e,t,n){return e==="start"?t:e==="end"?n:e}function Jz(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class zc extends co{parsePrimitiveData(t,n,r,i){return Ly(t,n,r,i)}parseArrayData(t,n,r,i){return Ly(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,d=[];let h,f,g,p;for(h=r,f=r+i;h<f;++h)p=n[h],g={},g[a.axis]=a.parse(xo(p,u),h),d.push(L5(xo(p,c),g,o,h));return d}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=n0(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:d,includeOptions:h}=this._getSharedOptions(n,i);for(let f=n;f<n+r;f++){const g=this.getParsed(f),p=a||Et(g[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,c),b=(g._stacks||{})[s.axis],v={horizontal:u,base:p.base,enableBorderRadius:!b||n0(g._custom)||o===b._top||o===b._bottom,x:u?p.head:m.center,y:u?m.center:p.head,height:u?m.size:Math.abs(p.size),width:u?Math.abs(p.size):m.size};h&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":i));const x=v.options||t[f].options;Yz(v,x,b,o),Jz(v,x,c.ratio),this.updateElement(t[f],f,v,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=r.options.stacked,o=[],s=l=>{const u=l.controller.getParsed(n),c=u&&u[l.vScale.axis];if(Et(c)||isNaN(c))return!0};for(const l of i)if(!(n!==void 0&&s(l))&&((a===!1||o.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_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||Wz(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=n0(u);let d=l[n.axis],h=0,f=r?this.applyStack(n,l,r):d,g,p;f!==d&&(h=f-d,f=d),c&&(d=u.barStart,f=u.barEnd-u.barStart,d!==0&&ci(d)!==ci(u.barEnd)&&(h=0),h+=d);const m=!Et(a)&&!c?a:h;let b=n.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(h+f):g=b,p=g-b,Math.abs(p)<o){p=Xz(p,n,s)*o,d===s&&(b-=p/2);const v=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),C=Math.min(v,x),E=Math.max(v,x);b=Math.max(Math.min(b,E),C),g=b+p,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(g)-n.getValueForPixel(b))}if(b===n.getPixelForValue(s)){const v=ci(p)*n.getLineWidthForValue(s)/2;b+=v,p-=v}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,a=i.skipNull,o=Ue(i.maxBarThickness,1/0);let s,l;if(n.grouped){const u=a?this._getStackCount(t):n.stackCount,c=i.barThickness==="flex"?Gz(t,n,i,u):zz(t,n,i,u),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);s=c.start+c.chunk*d+c.chunk/2,l=Math.min(o,c.chunk*c.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)}}xe(zc,"id","bar"),xe(zc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),xe(zc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function qz(e,t,n){let r=1,i=1,a=0,o=0;if(t<kt){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),h=Math.sin(l),f=(x,C,E)=>au(x,s,l,!0)?1:Math.max(C,C*n,E,E*n),g=(x,C,E)=>au(x,s,l,!0)?-1:Math.min(C,C*n,E,E*n),p=f(0,u,d),m=f(Qt,c,h),b=g(Lt,u,d),v=g(Lt+Qt,c,h);r=(p-b)/2,i=(m-v)/2,a=-(p+b)/2,o=-(m+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class ol extends co{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(qe(r[t])){const{key:l="value"}=this._parsing;a=u=>+xo(r[u],l)}let o,s;for(o=t,s=t+n;o<s;++o)i._parsed[o]=a(o)}}_getRotation(){return Mi(this.options.rotation-90)}_getCircumference(){return Mi(this.options.circumference)}_getRotationExtents(){let t=kt,n=-kt;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(lW(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:g,offsetY:p}=qz(d,c,l),m=(r.width-o)/h,b=(r.height-o)/f,v=Math.max(Math.min(m,b)/2,0),x=p5(this.options.radius,v),C=Math.max(x*l,0),E=(x-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,i.total=this.calculateTotal(),this.outerRadius=x-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*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/kt)}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,d=(s.top+s.bottom)/2,h=a&&u.animateScale,f=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(n,i);let b=this._getRotation(),v;for(v=0;v<n;++v)b+=this._circumference(v,a);for(v=n;v<n+r;++v){const x=this._circumference(v,a),C=t[v],E={x:c+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:g,innerRadius:f};m&&(E.options=p||this.resolveDataElementOptions(v,C.active?"active":i)),b+=x,this.updateElement(C,v,E,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)?kt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Xm(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(Ue(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}xe(ol,"id","doughnut"),xe(ol,"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"}),xe(ol,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),xe(ol,"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 Gc extends co{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}=DW(n,i,o);this._drawStart=s,this._drawCount=l,AW(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:d}=this._getSharedOptions(n,i),h=o.axis,f=s.axis,{spanGaps:g,segment:p}=this.options,m=iu(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||i==="none",v=n+r,x=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<x;++E){const w=t[E],B=b?w:{};if(E<n||E>=v){B.skip=!0;continue}const y=this.getParsed(E),S=Et(y[f]),D=B[h]=o.getPixelForValue(y[h],E),A=B[f]=a||S?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,y,l):y[f],E);B.skip=isNaN(D)||isNaN(A)||S,B.stop=E>0&&Math.abs(y[h]-C[h])>m,p&&(B.parsed=y,B.raw=u.data[E]),d&&(B.options=c||this.resolveDataElementOptions(E,w.active?"active":i)),b||this.updateElement(w,E,B,i),C=y}}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()}}xe(Gc,"id","line"),xe(Gc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),xe(Gc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Oa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class e1{constructor(t){xe(this,"options");this.options=t||{}}static override(t){Object.assign(e1.prototype,t)}init(){}formats(){return Oa()}parse(){return Oa()}format(){return Oa()}add(){return Oa()}diff(){return Oa()}startOf(){return Oa()}endOf(){return Oa()}}var Qz={_date:e1};function eG(e,t,n,r){const{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const l=s._reversePixels?EW:ro;if(r){if(i._sharedOptions){const u=a[0],c=typeof u.getRange=="function"&&u.getRange(t);if(c){const d=l(a,t,n-c),h=l(a,t,n+c);return{lo:d.lo,hi:h.hi}}}}else return l(a,t,n)}return{lo:0,hi:a.length-1}}function Wf(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:d,hi:h}=eG(a[s],t,o,i);for(let f=d;f<=h;++f){const g=c[f];g.skip||r(g,u,f)}}}function tG(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 r0(e,t,n,r,i){const a=[];return!i&&!e.isPointInArea(t)||Wf(e,n,t,function(s,l,u){!i&&!ou(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&a.push({element:s,datasetIndex:l,index:u})},!0),a}function nG(e,t,n,r){let i=[];function a(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=v5(o,{x:t.x,y:t.y});au(d,u,c)&&i.push({element:o,datasetIndex:s,index:l})}return Wf(e,n,t,a),i}function rG(e,t,n,r,i,a){let o=[];const s=tG(n);let l=Number.POSITIVE_INFINITY;function u(c,d,h){const f=c.inRange(t.x,t.y,i);if(r&&!f)return;const g=c.getCenterPoint(i);if(!(!!a||e.isPointInArea(g))&&!f)return;const m=s(t,g);m<l?(o=[{element:c,datasetIndex:d,index:h}],l=m):m===l&&o.push({element:c,datasetIndex:d,index:h})}return Wf(e,n,t,u),o}function i0(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n==="r"&&!r?nG(e,t,n,i):rG(e,t,n,r,i,a)}function Hy(e,t,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let s=!1;return Wf(e,n,t,(l,u,c)=>{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 iG={modes:{index(e,t,n,r){const i=Wa(t,e),a=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?r0(e,i,a,r,o):i0(e,i,a,!1,r,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=Wa(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?r0(e,i,a,r,o):i0(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=Wa(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return r0(e,i,a,r,o)},nearest(e,t,n,r){const i=Wa(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return i0(e,i,a,n.intersect,r,o)},x(e,t,n,r){const i=Wa(t,e);return Hy(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Wa(t,e);return Hy(e,i,"y",n.intersect,r)}}};const O5=["left","top","right","bottom"];function Gs(e,t){return e.filter(n=>n.pos===t)}function jy(e,t){return e.filter(n=>O5.indexOf(n.pos)===-1&&n.box.axis===t)}function Us(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 aG(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 oG(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!O5.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 sG(e,t){const n=oG(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 lG(e){const t=aG(e),n=Us(t.filter(u=>u.box.fullSize),!0),r=Us(Gs(t,"left"),!0),i=Us(Gs(t,"right")),a=Us(Gs(t,"top"),!0),o=Us(Gs(t,"bottom")),s=jy(t,"x"),l=jy(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:Gs(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(o).concat(s)}}function Wy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function V5(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 uG(e,t,n,r){const{pos:i,box:a}=n,o=e.maxPadding;if(!qe(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?a.height:a.width),n.size=d.size/d.count,e[i]+=n.size}a.getPadding&&V5(o,a.getPadding());const s=Math.max(0,t.outerWidth-Wy(o,e,"left","right")),l=Math.max(0,t.outerHeight-Wy(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 cG(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 dG(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 sl(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,dG(s.horizontal,t));const{same:d,other:h}=uG(t,n,s,r);u|=d&&i.length,c=c||h,l.fullSize||i.push(s)}return u&&sl(i,t,n,r)||c}function bc(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 zy(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 d=t.w*c,h=u.size||l.height;ru(u.start)&&(o=u.start),l.fullSize?bc(l,i.left,o,n.outerWidth-i.right-i.left,h):bc(l,t.left+u.placed,o,d,h),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,h=u.size||l.width;ru(u.start)&&(a=u.start),l.fullSize?bc(l,a,i.top,h,n.outerHeight-i.bottom-i.top):bc(l,a,t.top+u.placed,h,d),u.start=a,u.placed+=d,a=l.right}}t.x=a,t.y=o}var Cr={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=Sr(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=lG(e.boxes),l=s.vertical,u=s.horizontal;pt(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const c=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);V5(h,Sr(r));const f=Object.assign({maxPadding:h,w:a,h:o,x:i.left,y:i.top},i),g=sG(l.concat(u),d);sl(s.fullSize,f,d,g),sl(l,f,d,g),sl(u,f,d,g)&&sl(l,f,d,g),cG(f),zy(s.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,zy(s.rightAndBottom,f,d,g),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},pt(s.chartArea,p=>{const m=p.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class H5{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 fG extends H5{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Uc="$chartjs",hG={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Gy=e=>e===null||e==="";function gG(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Uc]={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",Gy(i)){const a=Dy(e,"width");a!==void 0&&(e.width=a)}if(Gy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const a=Dy(e,"height");a!==void 0&&(e.height=a)}return e}const j5=bz?{passive:!0}:!1;function pG(e,t,n){e&&e.addEventListener(t,n,j5)}function mG(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,j5)}function bG(e,t){const n=hG[e.type]||e.type,{x:r,y:i}=Wa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Zd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function vG(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zd(s.addedNodes,r),o=o&&!Zd(s.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function yG(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zd(s.removedNodes,r),o=o&&!Zd(s.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const lu=new Map;let Uy=0;function W5(){const e=window.devicePixelRatio;e!==Uy&&(Uy=e,lu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function xG(e,t){lu.size||window.addEventListener("resize",W5),lu.set(e,t)}function CG(e){lu.delete(e),lu.size||window.removeEventListener("resize",W5)}function EG(e,t,n){const r=e.canvas,i=r&&Qm(r);if(!i)return;const a=E5((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),xG(e,a),o}function a0(e,t,n){n&&n.disconnect(),t==="resize"&&CG(e)}function SG(e,t,n){const r=e.canvas,i=E5(a=>{e.ctx!==null&&n(bG(a,e))},e);return pG(r,t,i),i}class wG extends H5{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(gG(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Uc])return!1;const r=n[Uc].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[Uc],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:vG,detach:yG,resize:EG}[n]||SG;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:a0,detach:a0,resize:a0}[n]||mG)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return mz(t,n,r,i)}isAttached(t){const n=t&&Qm(t);return!!(n&&n.isConnected)}}function IG(e){return!qm()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?fG:wG}var Ic;let Gi=(Ic=class{constructor(){xe(this,"x");xe(this,"y");xe(this,"active",!1);xe(this,"options");xe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return iu(this.x)&&iu(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}},xe(Ic,"defaults",{}),xe(Ic,"defaultRoutes"),Ic);function _G(e,t){const n=e.options.ticks,r=DG(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?TG(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>i)return RG(t,u,a,o/i),u;const c=AG(a,t,i);if(o>0){let d,h;const f=o>1?Math.round((l-s)/(o-1)):null;for(vc(t,u,c,Et(f)?0:s-f,s),d=0,h=o-1;d<h;d++)vc(t,u,c,a[d],a[d+1]);return vc(t,u,c,l,Et(f)?t.length:l+f),u}return vc(t,u,c),u}function DG(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 AG(e,t,n){const r=BG(e),i=t.length/n;if(!r)return Math.max(i,1);const a=mW(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 TG(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function RG(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 vc(e,t,n,r,i){const a=Ue(r,0),o=Math.min(Ue(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 BG(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 $G=e=>e==="left"?"right":e==="right"?"left":e,Xy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Zy=(e,t)=>Math.min(t||e,e);function Yy(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 kG(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 PG(e,t){pt(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 Xs(e){return e.drawTicks?e.tickLength:0}function Ky(e,t){if(!e.display)return 0;const n=Sn(e.font,t),r=Sr(e.padding);return(Yt(e.text)?e.text.length:1)*n.lineHeight+r.height}function FG(e,t){return Ao(e,{scale:t,type:"scale"})}function NG(e,t,n){return Ao(e,{tick:n,index:t,type:"tick"})}function MG(e,t,n){let r=Gm(e);return(n&&t!=="right"||!n&&t==="right")&&(r=$G(r)),r}function LG(e,t,n,r){const{top:i,left:a,bottom:o,right:s,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,h,f,g;const p=o-i,m=s-a;if(e.isHorizontal()){if(f=bn(r,a,s),qe(n)){const b=Object.keys(n)[0],v=n[b];g=c[b].getPixelForValue(v)+p-t}else n==="center"?g=(u.bottom+u.top)/2+p-t:g=Xy(e,n,t);h=s-a}else{if(qe(n)){const b=Object.keys(n)[0],v=n[b];f=c[b].getPixelForValue(v)-m+t}else n==="center"?f=(u.left+u.right)/2-m+t:f=Xy(e,n,t);g=bn(r,o,i),d=n==="left"?-Qt:Qt}return{titleX:f,titleY:g,maxWidth:h,rotation:d}}class Ns extends Gi{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=Vr(t,Number.POSITIVE_INFINITY),n=Vr(n,Number.NEGATIVE_INFINITY),r=Vr(r,Number.POSITIVE_INFINITY),i=Vr(i,Number.NEGATIVE_INFINITY),{min:Vr(t,r),max:Vr(n,i),minDefined:wn(t),maxDefined:wn(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:Vr(n,Vr(r,n)),max:Vr(r,Vr(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(){St(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=ZW(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?Yy(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=_G(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(){St(this.options.afterUpdate,[this])}beforeSetDimensions(){St(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(){St(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),St(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){St(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=St(n.callback,[a.value,r,t],this)}afterTickToLabelConversion(){St(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){St(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Zy(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(),d=c.widest.width,h=c.highest.height,f=En(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:f/(r-1),d+6>s&&(s=f/(r-(t.offset?.5:1)),l=this.maxHeight-Xs(t.grid)-n.padding-Ky(t.title,this.chart.options.font),u=Math.sqrt(d*d+h*h),o=yW(Math.min(Math.asin(En((c.highest.height+6)/s,-1,1)),Math.asin(En(l/u,-1,1))-Math.asin(En(h/u,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){St(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){St(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=Ky(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=Xs(a)+l):(t.height=this.maxHeight,t.width=Xs(a)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:h}=this._getLabelSizes(),f=r.padding*2,g=Mi(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(s){const b=r.mirror?0:m*d.width+p*h.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=r.mirror?0:p*d.width+m*h.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(u,c,m,p)}}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,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?u?(h=i*t.width,f=r*n.height):(h=r*t.height,f=i*n.width):a==="start"?f=n.width:a==="end"?h=t.width:a!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;a==="start"?(c=0,d=t.height):a==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+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(){St(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=Yy(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/Zy(n,r));let u=0,c=0,d,h,f,g,p,m,b,v,x,C,E;for(d=0;d<n;d+=l){if(g=t[d].label,p=this._resolveTickFontOptions(d),i.font=m=p.string,b=a[m]=a[m]||{data:{},gc:[]},v=p.lineHeight,x=C=0,!Et(g)&&!Yt(g))x=Ey(i,b.data,b.gc,x,g),C=v;else if(Yt(g))for(h=0,f=g.length;h<f;++h)E=g[h],!Et(E)&&!Yt(E)&&(x=Ey(i,b.data,b.gc,x,E),C+=v);o.push(x),s.push(C),u=Math.max(x,u),c=Math.max(C,c)}PG(a,n);const w=o.indexOf(u),B=s.indexOf(c),y=S=>({width:o[S]||0,height:s[S]||0});return{first:y(0),last:y(n-1),widest:y(w),highest:y(B),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 CW(this._alignToPixels?La(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=NG(this.getContext(),t,r))}return this.$context||(this.$context=FG(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Mi(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(),d=this.ticks.length+(l?1:0),h=Xs(a),f=[],g=s.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function($){return La(r,$,p)};let v,x,C,E,w,B,y,S,D,A,T,F;if(o==="top")v=b(this.bottom),B=this.bottom-h,S=v-m,A=b(t.top)+m,F=t.bottom;else if(o==="bottom")v=b(this.top),A=t.top,F=b(t.bottom)-m,B=v+m,S=this.top+h;else if(o==="left")v=b(this.right),w=this.right-h,y=v-m,D=b(t.left)+m,T=t.right;else if(o==="right")v=b(this.left),D=t.left,T=b(t.right)-m,w=v+m,y=this.left+h;else if(n==="x"){if(o==="center")v=b((t.top+t.bottom)/2+.5);else if(qe(o)){const $=Object.keys(o)[0],R=o[$];v=b(this.chart.scales[$].getPixelForValue(R))}A=t.top,F=t.bottom,B=v+m,S=B+h}else if(n==="y"){if(o==="center")v=b((t.left+t.right)/2);else if(qe(o)){const $=Object.keys(o)[0],R=o[$];v=b(this.chart.scales[$].getPixelForValue(R))}w=v-m,y=w-h,D=t.left,T=t.right}const k=Ue(i.ticks.maxTicksLimit,d),P=Math.max(1,Math.ceil(d/k));for(x=0;x<d;x+=P){const $=this.getContext(x),R=a.setContext($),O=s.setContext($),j=R.lineWidth,V=R.color,W=O.dash||[],U=O.dashOffset,K=R.tickWidth,ee=R.tickColor,z=R.tickBorderDash||[],H=R.tickBorderDashOffset;C=kG(this,x,l),C!==void 0&&(E=La(r,C,j),u?w=y=D=T=E:B=S=A=F=E,f.push({tx1:w,ty1:B,tx2:y,ty2:S,x1:D,y1:A,x2:T,y2:F,width:j,color:V,borderDash:W,borderDashOffset:U,tickWidth:K,tickColor:ee,tickBorderDash:z,tickBorderDashOffset:H}))}return this._ticksLength=d,this._borderValue=v,f}_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:d}=a,h=Xs(r.grid),f=h+c,g=d?-c:f,p=-Mi(this.labelRotation),m=[];let b,v,x,C,E,w,B,y,S,D,A,T,F="middle";if(i==="top")w=this.bottom-g,B=this._getXAxisLabelAlignment();else if(i==="bottom")w=this.top+g,B=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(h);B=P.textAlign,E=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(h);B=P.textAlign,E=P.x}else if(n==="x"){if(i==="center")w=(t.top+t.bottom)/2+f;else if(qe(i)){const P=Object.keys(i)[0],$=i[P];w=this.chart.scales[P].getPixelForValue($)+f}B=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")E=(t.left+t.right)/2-f;else if(qe(i)){const P=Object.keys(i)[0],$=i[P];E=this.chart.scales[P].getPixelForValue($)}B=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const k=this._getLabelSizes();for(b=0,v=s.length;b<v;++b){x=s[b],C=x.label;const P=a.setContext(this.getContext(b));y=this.getPixelForTick(b)+a.labelOffset,S=this._resolveTickFontOptions(b),D=S.lineHeight,A=Yt(C)?C.length:1;const $=A/2,R=P.color,O=P.textStrokeColor,j=P.textStrokeWidth;let V=B;o?(E=y,B==="inner"&&(b===v-1?V=this.options.reverse?"left":"right":b===0?V=this.options.reverse?"right":"left":V="center"),i==="top"?u==="near"||p!==0?T=-A*D+D/2:u==="center"?T=-k.highest.height/2-$*D+D:T=-k.highest.height+D/2:u==="near"||p!==0?T=D/2:u==="center"?T=k.highest.height/2-$*D:T=k.highest.height-A*D,d&&(T*=-1),p!==0&&!P.showLabelBackdrop&&(E+=D/2*Math.sin(p))):(w=y,T=(1-A)*D/2);let W;if(P.showLabelBackdrop){const U=Sr(P.backdropPadding),K=k.heights[b],ee=k.widths[b];let z=T-U.top,H=0-U.left;switch(F){case"middle":z-=K/2;break;case"bottom":z-=K;break}switch(B){case"center":H-=ee/2;break;case"right":H-=ee;break;case"inner":b===v-1?H-=ee:b>0&&(H-=ee/2);break}W={left:H,top:z,width:ee+U.width,height:K+U.height,color:P.backdropColor}}m.push({label:C,font:S,textOffset:T,options:{rotation:p,color:R,strokeColor:O,strokeWidth:j,textAlign:V,textBaseline:F,translation:[E,w],backdrop:W}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Mi(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,d,h;this.isHorizontal()?(u=La(t,this.left,o)-o/2,c=La(t,this.right,s)+s/2,d=h=l):(d=La(t,this.top,o)-o/2,h=La(t,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Vf(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;su(r,u,0,c,l,s)}i&&Hf(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=Sn(r.font),o=Sr(r.padding),s=r.align;let l=a.lineHeight/2;n==="bottom"||n==="center"||qe(n)?(l+=o.bottom,Yt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:h}=LG(this,l,n,s);su(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:h,textAlign:MG(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=Ue(t.grid&&t.grid.z,-1),i=Ue(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ns.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 Sn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class yc{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;HG(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,OG(t,o,r),this.override&&Ht.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 Ht[i]&&(delete Ht[i][r],this.override&&delete Co[r])}}function OG(e,t,n){const r=nu(Object.create(null),[n?Ht.get(n):{},Ht.get(t),e.defaults]);Ht.set(t,r),e.defaultRoutes&&VG(t,e.defaultRoutes),e.descriptors&&Ht.describe(t,e.descriptors)}function VG(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(".");Ht.route(a,i,l,s)})}function HG(e){return"id"in e&&"defaults"in e}class jG{constructor(){this.controllers=new yc(co,"datasets",!0),this.elements=new yc(Gi,"elements"),this.plugins=new yc(Object,"plugins"),this.scales=new yc(Ns,"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):pt(i,o=>{const s=r||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,n,r){const i=Wm(t);St(r["before"+i],[],r),n[t](r),St(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 zr=new jG;class WG{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(St(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=Ue(r.options&&r.options.plugins,{}),a=zG(r);return i===!1&&!n?[]:UG(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 zG(e){const t={},n=[],r=Object.keys(zr.plugins.items);for(let a=0;a<r.length;a++)n.push(zr.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 GG(e,t){return!t&&e===!1?null:e===!0?{}:e}function UG(e,{plugins:t,localIds:n},r,i){const a=[],o=e.getContext();for(const s of t){const l=s.id,u=GG(r[l],i);u!==null&&a.push({plugin:s,options:XG(e.config,{plugin:s,local:n[l]},u,o)})}return a}function XG(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 jg(e,t){const n=Ht.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function ZG(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function YG(e,t){return e===t?"_index_":"_value_"}function Jy(e){if(e==="x"||e==="y"||e==="r")return e}function KG(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Wg(e,...t){if(Jy(e))return e;for(const n of t){const r=n.axis||KG(n.position)||e.length>1&&Jy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function qy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function JG(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 qy(e,"x",n[0])||qy(e,"y",n[0])}return{}}function qG(e,t){const n=Co[e.type]||{scales:{}},r=t.scales||{},i=jg(e.type,t),a=Object.create(null);return Object.keys(r).forEach(o=>{const s=r[o];if(!qe(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=Wg(o,s,JG(o,e),Ht.scales[s.type]),u=YG(l,i),c=n.scales||{};a[o]=xl(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||jg(s,t),c=(Co[s]||{}).scales||{};Object.keys(c).forEach(d=>{const h=ZG(d,l),f=o[h+"AxisID"]||h;a[f]=a[f]||Object.create(null),xl(a[f],[{axis:h},r[f],c[d]])})}),Object.keys(a).forEach(o=>{const s=a[o];xl(s,[Ht.scales[s.type],Ht.scale])}),a}function z5(e){const t=e.options||(e.options={});t.plugins=Ue(t.plugins,{}),t.scales=qG(e,t)}function G5(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function QG(e){return e=e||{},e.data=G5(e.data),z5(e),e}const Qy=new Map,U5=new Set;function xc(e,t){let n=Qy.get(e);return n||(n=t(),Qy.set(e,n),U5.add(n)),n}const Zs=(e,t,n)=>{const r=xo(t,n);r!==void 0&&e.add(r)};class eU{constructor(t){this._config=QG(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=G5(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(),z5(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return xc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return xc(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return xc(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return xc(`${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(d=>Zs(l,t,d))),c.forEach(d=>Zs(l,i,d)),c.forEach(d=>Zs(l,Co[a]||{},d)),c.forEach(d=>Zs(l,Ht,d)),c.forEach(d=>Zs(l,Vg,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),U5.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Co[n]||{},Ht.datasets[n]||{},{type:n},Ht,Vg]}resolveNamedOptions(t,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=ex(this._resolverCache,t,i);let l=o;if(nU(o,n)){a.$shared=!1,r=Da(r)?r():r;const u=this.createResolver(t,r,s);l=Ss(o,r,u)}for(const u of n)a[u]=l[u];return a}createResolver(t,n,r=[""],i){const{resolver:a}=ex(this._resolverCache,t,r);return qe(n)?Ss(a,n,void 0,i):a}}function ex(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:Ym(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,a)),a}const tU=e=>qe(e)&&Object.getOwnPropertyNames(e).some(t=>Da(e[t]));function nU(e,t){const{isScriptable:n,isIndexable:r}=_5(e);for(const i of t){const a=n(i),o=r(i),s=(o||a)&&e[i];if(a&&(Da(s)||tU(s))||o&&Yt(s))return!0}return!1}var rU="4.4.3";const iU=["top","bottom","left","right","chartArea"];function tx(e,t){return e==="top"||e==="bottom"||iU.indexOf(e)===-1&&t==="x"}function nx(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function rx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),St(n&&n.onComplete,[e],t)}function aU(e){const t=e.chart,n=t.options.animation;St(n&&n.onProgress,[e],t)}function X5(e){return qm()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Xc={},ix=e=>{const t=X5(e);return Object.values(Xc).filter(n=>n.canvas===t).pop()};function oU(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 sU(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Cc(e,t,n){return e.options.clip?e[n]:t[n]}function lU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Cc(n,t,"left"),right:Cc(n,t,"right"),top:Cc(r,t,"top"),bottom:Cc(r,t,"bottom")}:t}var qi;let To=(qi=class{static register(...t){zr.add(...t),ax()}static unregister(...t){zr.remove(...t),ax()}constructor(t,n){const r=this.config=new eU(n),i=X5(t),a=ix(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||IG(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=sW(),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 WG,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=IW(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Xc[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ii.listen(this,"complete",rx),Ii.listen(this,"progress",aU),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 zr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_y(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sy(this.canvas,this.ctx),this}stop(){return Ii.stop(this),this}resize(t,n){Ii.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,_y(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),St(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};pt(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=Wg(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),pt(a,o=>{const s=o.options,l=s.id,u=Wg(l,s),c=Ue(s.type,o.dtype);(s.position===void 0||tx(s.position,u)!==tx(o.dposition))&&(s.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const h=zr.getScale(c);d=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),pt(i,(o,s)=>{o||delete r[s]}),pt(r,o=>{Cr.configure(this,o,o.options),Cr.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(nx("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||jg(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=zr.getController(s),{datasetElementType:u,dataElementType:c}=Ht.datasets[s];Object.assign(l,{dataElementType:zr.getElement(c),datasetElementType:u&&zr.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){pt(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:d}=this.getDatasetMeta(u),h=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||pt(a,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(nx("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){pt(this.scales,t=>{Cr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!hy(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;oU(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(!hy(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;Cr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],pt(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,Da(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&&(Ii.has(this)?this.attached&&!Ii.running(this)&&Ii.start(this):(this.draw(),rx({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}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=t._clip,i=!r.disabled,a=lU(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&Vf(n,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&Hf(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ou(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const a=iG.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=Ao(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);ru(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(),Ii.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(),Sy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Xc[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)};pt(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(){pt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},pt(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}});!Wd(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(d=>c.datasetIndex===d.datasetIndex&&c.index===d.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=hW(t),u=sU(t,this._lastEvent,r,l);r&&(this._lastEvent=null,St(a.onHover,[t,s,this],this),l&&St(a.onClick,[t,s,this],this));const c=!Wd(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)}},xe(qi,"defaults",Ht),xe(qi,"instances",Xc),xe(qi,"overrides",Co),xe(qi,"registry",zr),xe(qi,"version",rU),xe(qi,"getChart",ix),qi);function ax(){return pt(To.instances,e=>e._plugins.invalidate())}function uU(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+Qt,r-Qt),e.closePath(),e.clip()}function cU(e){return Zm(e,["outerStart","outerEnd","innerStart","innerEnd"])}function dU(e,t,n,r){const i=cU(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 En(l,0,Math.min(a,u))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:En(i.innerStart,0,o),innerEnd:En(i.innerEnd,0,o)}}function jo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Yd(e,t,n,r,i,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,d=Math.max(t.outerRadius+r+n-u,0),h=c>0?c+r+n+u:0;let f=0;const g=i-l;if(r){const P=c>0?c-r:0,$=d>0?d-r:0,R=(P+$)/2,O=R!==0?g*R/(R+r):g;f=(g-O)/2}const p=Math.max(.001,g*d-n/Lt)/d,m=(g-p)/2,b=l+m+f,v=i-m-f,{outerStart:x,outerEnd:C,innerStart:E,innerEnd:w}=dU(t,h,d,v-b),B=d-x,y=d-C,S=b+x/B,D=v-C/y,A=h+E,T=h+w,F=b+E/A,k=v-w/T;if(e.beginPath(),a){const P=(S+D)/2;if(e.arc(o,s,d,S,P),e.arc(o,s,d,P,D),C>0){const j=jo(y,D,o,s);e.arc(j.x,j.y,C,D,v+Qt)}const $=jo(T,v,o,s);if(e.lineTo($.x,$.y),w>0){const j=jo(T,k,o,s);e.arc(j.x,j.y,w,v+Qt,k+Math.PI)}const R=(v-w/h+(b+E/h))/2;if(e.arc(o,s,h,v-w/h,R,!0),e.arc(o,s,h,R,b+E/h,!0),E>0){const j=jo(A,F,o,s);e.arc(j.x,j.y,E,F+Math.PI,b-Qt)}const O=jo(B,b,o,s);if(e.lineTo(O.x,O.y),x>0){const j=jo(B,S,o,s);e.arc(j.x,j.y,x,b-Qt,S)}}else{e.moveTo(o,s);const P=Math.cos(S)*d+o,$=Math.sin(S)*d+s;e.lineTo(P,$);const R=Math.cos(D)*d+o,O=Math.sin(D)*d+s;e.lineTo(R,O)}e.closePath()}function fU(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){Yd(e,t,n,r,l,i);for(let u=0;u<a;++u)e.fill();isNaN(s)||(l=o+(s%kt||kt))}return Yd(e,t,n,r,l,i),e.fill(),l}function hU(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:h}=l,f=l.borderAlign==="inner";if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=h,f?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let g=t.endAngle;if(a){Yd(e,t,n,r,g,i);for(let p=0;p<a;++p)e.stroke();isNaN(s)||(g=o+(s%kt||kt))}f&&uU(e,t,g),a||(Yd(e,t,n,r,g,i),e.stroke())}class ll extends Gi{constructor(n){super();xe(this,"circumference");xe(this,"endAngle");xe(this,"fullCircles");xe(this,"innerRadius");xe(this,"outerRadius");xe(this,"pixelMargin");xe(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}=v5(a,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,p=Ue(h,u-l)>=kt||au(o,l,u),m=Li(s,c+f,d+f);return p&&m}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,d=(a+o)/2,h=(s+l+c+u)/2;return{x:r+Math.cos(d)*h,y:i+Math.sin(d)*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>kt?Math.floor(i/kt):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(Lt,i||0)),c=a*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,fU(n,this,c,o,s),hU(n,this,c,o,s),n.restore()}}xe(ll,"id","arc"),xe(ll,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),xe(ll,"defaultRoutes",{backgroundColor:"backgroundColor"}),xe(ll,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Z5(e,t,n=t){e.lineCap=Ue(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ue(n.borderDash,t.borderDash)),e.lineDashOffset=Ue(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ue(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ue(n.borderWidth,t.borderWidth),e.strokeStyle=Ue(n.borderColor,t.borderColor)}function gU(e,t,n){e.lineTo(n.x,n.y)}function pU(e){return e.stepped?OW:e.tension||e.cubicInterpolationMode==="monotone"?VW:gU}function Y5(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 mU(e,t,n,r){const{points:i,options:a}=t,{count:o,start:s,loop:l,ilen:u}=Y5(i,n,r),c=pU(a);let{move:d=!0,reverse:h}=r||{},f,g,p;for(f=0;f<=u;++f)g=i[(s+(h?u-f:f))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,p,g,h,a.stepped),p=g);return l&&(g=i[(s+(h?u:0))%o],c(e,p,g,h,a.stepped)),!!l}function bU(e,t,n,r){const i=t.points,{count:a,start:o,ilen:s}=Y5(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,h,f,g,p,m,b;const v=C=>(o+(u?s-C:C))%a,x=()=>{p!==m&&(e.lineTo(c,m),e.lineTo(c,p),e.lineTo(c,b))};for(l&&(f=i[v(0)],e.moveTo(f.x,f.y)),h=0;h<=s;++h){if(f=i[v(h)],f.skip)continue;const C=f.x,E=f.y,w=C|0;w===g?(E<p?p=E:E>m&&(m=E),c=(d*c+C)/++d):(x(),e.lineTo(C,E),g=w,d=0,p=m=E),b=E}x()}function zg(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?bU:mU}function vU(e){return e.stepped?vz:e.tension||e.cubicInterpolationMode==="monotone"?yz:za}function yU(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Z5(e,t.options),e.stroke(i)}function xU(e,t,n,r){const{segments:i,options:a}=t,o=zg(t);for(const s of i)Z5(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const CU=typeof Path2D=="function";function EU(e,t,n,r){CU&&!t.options.segment?yU(e,t,n,r):xU(e,t,n,r)}class oi extends Gi{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;cz(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=Iz(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=F5(this,{property:n,start:i,end:i});if(!o.length)return;const s=[],l=vU(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:h}=o[u],f=a[d],g=a[h];if(f===g){s.push(f);continue}const p=Math.abs((i-f[n])/(g[n]-f[n])),m=l(f,g,p,r.stepped);m[n]=t[n],s.push(m)}return s.length===1?s[0]:s}pathSegment(t,n,r){return zg(this)(t,this,n,r)}path(t,n,r){const i=this.segments,a=zg(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(),EU(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}xe(oi,"id","line"),xe(oi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),xe(oi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),xe(oi,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ox(e,t,n,r){const i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}class fo extends Gi{constructor(n){super();xe(this,"parsed");xe(this,"skip");xe(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 ox(this,n,"x",r)}inYRange(n,r){return ox(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||!ou(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Hg(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}xe(fo,"id","point"),xe(fo,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),xe(fo,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function K5(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,d;return e.horizontal?(d=o/2,s=Math.min(n,i),l=Math.max(n,i),u=r-d,c=r+d):(d=a/2,s=n-d,l=n+d,u=Math.min(r,i),c=Math.max(r,i)),{left:s,top:u,right:l,bottom:c}}function ga(e,t,n,r){return e?0:En(t,n,r)}function SU(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,a=I5(r);return{t:ga(i.top,a.top,0,n),r:ga(i.right,a.right,0,t),b:ga(i.bottom,a.bottom,0,n),l:ga(i.left,a.left,0,t)}}function wU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,a=us(i),o=Math.min(t,n),s=e.borderSkipped,l=r||qe(i);return{topLeft:ga(!l||s.top||s.left,a.topLeft,0,o),topRight:ga(!l||s.top||s.right,a.topRight,0,o),bottomLeft:ga(!l||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:ga(!l||s.bottom||s.right,a.bottomRight,0,o)}}function IU(e){const t=K5(e),n=t.right-t.left,r=t.bottom-t.top,i=SU(e,n/2,r/2),a=wU(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 o0(e,t,n,r){const i=t===null,a=n===null,s=e&&!(i&&a)&&K5(e,r);return s&&(i||Li(t,s.left,s.right))&&(a||Li(n,s.top,s.bottom))}function _U(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function DU(e,t){e.rect(t.x,t.y,t.w,t.h)}function s0(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 Zc extends Gi{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}=IU(this),s=_U(o.radius)?Ud:DU;t.save(),(o.w!==a.w||o.h!==a.h)&&(t.beginPath(),s(t,s0(o,n,a)),t.clip(),s(t,s0(a,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,s0(a,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return o0(this,t,n,r)}inXRange(t,n){return o0(this,t,null,n)}inYRange(t,n){return o0(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}}xe(Zc,"id","bar"),xe(Zc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),xe(Zc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function AU(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=t1(l,u,i);const c=Gg(n,i[l],i[u],s.loop);if(!t.segments){o.push({source:s,target:c,start:i[l],end:i[u]});continue}const d=F5(t,c);for(const h of d){const f=Gg(n,a[h.start],a[h.end],h.loop),g=P5(s,i,f);for(const p of g)o.push({source:p,target:h,start:{[n]:sx(c,f,"start",Math.max)},end:{[n]:sx(c,f,"end",Math.min)}})}}return o}function Gg(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e==="angle"&&(i=Zr(i),a=Zr(a)),{property:e,start:i,end:a}}function TU(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:o,end:s})=>{s=t1(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 t1(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function sx(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function J5(e,t){let n=[],r=!1;return Yt(e)?(r=!0,n=e):n=TU(e,t),n.length?new oi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function lx(e){return e&&e.fill!==!1}function RU(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(!wn(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;a.push(i),i=o.fill}return!1}function BU(e,t,n){const r=FU(e);if(qe(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return wn(i)&&Math.floor(i)===i?$U(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function $U(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function kU(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:qe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function PU(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:qe(e)?r=e.value:r=t.getBaseValue(),r}function FU(e){const t=e.options,n=t.fill;let r=Ue(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function NU(e){const{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=MU(t,n);s.push(J5({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++)LU(i,o[c],s)}return new oi({points:i,options:{}})}function MU(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 LU(e,t,n){const r=[];for(let i=0;i<n.length;i++){const a=n[i],{first:o,last:s,point:l}=OU(a,t,"x");if(!(!l||o&&s)){if(o)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function OU(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],d=o[c.start][n],h=o[c.end][n];if(Li(i,d,h)){s=i===d,l=i===h;break}}return{first:s,last:l,point:r}}class q5{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:kt},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 VU(e){const{chart:t,fill:n,line:r}=e;if(wn(n))return HU(t,n);if(n==="stack")return NU(e);if(n==="shape")return!0;const i=jU(e);return i instanceof q5?i:J5(i,r)}function HU(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function jU(e){return(e.scale||{}).getPointPositionForValue?zU(e):WU(e)}function WU(e){const{scale:t={},fill:n}=e,r=kU(n,t);if(wn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function zU(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=PU(n,t,a),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new q5({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 l0(e,t,n){const r=VU(t),{line:i,scale:a,axis:o}=t,s=i.options,l=s.fill,u=s.backgroundColor,{above:c=u,below:d=u}=l||{};r&&i.points.length&&(Vf(e,n),GU(e,{line:i,target:r,above:c,below:d,area:n,scale:a,axis:o}),Hf(e))}function GU(e,t){const{line:n,target:r,above:i,below:a,area:o,scale:s}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&a!==i&&(ux(e,r,o.top),cx(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore(),e.save(),ux(e,r,o.bottom)),cx(e,{line:n,target:r,color:a,scale:s,property:l}),e.restore()}function ux(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],d=i[t1(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(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function cx(e,t){const{line:n,target:r,property:i,color:a,scale:o}=t,s=AU(n,r,i);for(const{source:l,target:u,start:c,end:d}of s){const{style:{backgroundColor:h=a}={}}=l,f=r!==!0;e.save(),e.fillStyle=h,UU(e,o,f&&Gg(i,c,d)),e.beginPath();const g=!!n.pathSegment(e,l);let p;if(f){g?e.closePath():dx(e,r,d,i);const m=!!r.pathSegment(e,u,{move:g,reverse:!0});p=g&&m,p||dx(e,r,c,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function UU(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:a,start:o,end:s}=n||{};a==="x"&&(e.beginPath(),e.rect(o,r,s-o,i-r),e.clip())}function dx(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Q5={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 oi&&(l={visible:e.isDatasetVisible(o),index:o,fill:BU(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=RU(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&&l0(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;lx(a)&&l0(e.ctx,a,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!lx(r)||n.drawTime!=="beforeDatasetDraw"||l0(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fx=(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)}},XU=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class hx extends Gi{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=St(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=Sn(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=fx(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 d=t;a.textAlign="left",a.textBaseline="middle";let h=-1,f=-c;return this.legendItems.forEach((g,p)=>{const m=r+n/2+a.measureText(g.text).width;(p===0||u[u.length-1]+m+2*s>o)&&(d+=c,u[u.length-(p>0?0:1)]=0,f+=c,h++),l[p]={left:0,top:f,row:h,width:m,height:i},u[u.length-1]+=m+s}),d}_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 d=s,h=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:v,itemHeight:x}=ZU(r,n,a,m,i);b>0&&f+x+2*s>c&&(d+=h+s,u.push({width:h,height:f}),g+=h+s,p++,h=f=0),l[b]={left:g,top:f,col:p,width:v,height:x},h=Math.max(h,v),f+=x+s}),d+=h,u.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=cs(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=bn(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=bn(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=bn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=bn(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;Vf(t,this),this._draw(),Hf(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=t,s=Ht.color,l=cs(t.rtl,this.left,this.width),u=Sn(o.font),{padding:c}=o,d=u.size,h=d/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=fx(o,d),b=function(w,B,y){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;i.save();const S=Ue(y.lineWidth,1);if(i.fillStyle=Ue(y.fillStyle,s),i.lineCap=Ue(y.lineCap,"butt"),i.lineDashOffset=Ue(y.lineDashOffset,0),i.lineJoin=Ue(y.lineJoin,"miter"),i.lineWidth=S,i.strokeStyle=Ue(y.strokeStyle,s),i.setLineDash(Ue(y.lineDash,[])),o.usePointStyle){const D={radius:p*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:S},A=l.xPlus(w,g/2),T=B+h;w5(i,D,A,T,o.pointStyleWidth&&g)}else{const D=B+Math.max((d-p)/2,0),A=l.leftForLtr(w,g),T=us(y.borderRadius);i.beginPath(),Object.values(T).some(F=>F!==0)?Ud(i,{x:A,y:D,w:g,h:p,radius:T}):i.rect(A,D,g,p),i.fill(),S!==0&&i.stroke()}i.restore()},v=function(w,B,y){su(i,y.text,w,B+m/2,u,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},x=this.isHorizontal(),C=this._computeTitleHeight();x?f={x:bn(a,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:f={x:this.left+c,y:bn(a,this.top+C+c,this.bottom-n[0].height),line:0},B5(this.ctx,t.textDirection);const E=m+c;this.legendItems.forEach((w,B)=>{i.strokeStyle=w.fontColor,i.fillStyle=w.fontColor;const y=i.measureText(w.text).width,S=l.textAlign(w.textAlign||(w.textAlign=o.textAlign)),D=g+h+y;let A=f.x,T=f.y;l.setWidth(this.width),x?B>0&&A+D+c>this.right&&(T=f.y+=E,f.line++,A=f.x=bn(a,this.left+c,this.right-r[f.line])):B>0&&T+E>this.bottom&&(A=f.x=A+n[f.line].width+c,f.line++,T=f.y=bn(a,this.top+C+c,this.bottom-n[f.line].height));const F=l.x(A);if(b(F,T,w),A=_W(S,A+g+h,x?A+D:this.right,t.rtl),v(l.x(A),T,w),x)f.x+=D+c;else if(typeof w.text!="string"){const k=u.lineHeight;f.y+=eI(w,k)+c}else f.y+=E}),$5(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Sn(n.font),i=Sr(n.padding);if(!n.display)return;const a=cs(t.rtl,this.left,this.width),o=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,d=bn(t.align,d,this.right-h);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);c=u+bn(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=bn(s,d,d+h);o.textAlign=a.textAlign(Gm(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,su(o,n.text,f,c,r)}_computeTitleHeight(){const t=this.options.title,n=Sn(t.font),r=Sr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,a;if(Li(t,this.left,this.right)&&Li(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],Li(t,i.left,i.left+i.width)&&Li(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!JU(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=XU(i,r);i&&!a&&St(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&St(n.onHover,[t,r,this],this)}else r&&St(n.onClick,[t,r,this],this)}}function ZU(e,t,n,r,i){const a=YU(r,e,t,n),o=KU(i,r,t.lineHeight);return{itemWidth:a,itemHeight:o}}function YU(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 KU(e,t,n){let r=e;return typeof t.text!="string"&&(r=eI(t,n)),r}function eI(e,t){const n=e.text?e.text.length:0;return t*n}function JU(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var tI={id:"legend",_element:hx,start(e,t,n){const r=e.legend=new hx({ctx:e.ctx,options:n,chart:e});Cr.configure(e,r,n),Cr.addBox(e,r)},stop(e){Cr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Cr.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=Sr(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 nI extends Gi{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=Yt(r.text)?r.text.length:1;this._padding=Sr(r.padding);const a=i*Sn(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,d;return this.isHorizontal()?(c=bn(s,r,a),d=n+t,u=a-r):(o.position==="left"?(c=r+t,d=bn(s,i,n),l=Lt*-.5):(c=a-t,d=bn(s,n,i),l=Lt*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Sn(n.font),a=r.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);su(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Gm(n.align),textBaseline:"middle",translation:[o,s]})}}function qU(e,t){const n=new nI({ctx:e.ctx,options:t,chart:e});Cr.configure(e,n,t),Cr.addBox(e,n),e.titleBlock=n}var rI={id:"title",_element:nI,start(e,t,n){qU(e,n)},stop(e){const t=e.titleBlock;Cr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Cr.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 ul={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{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=Og(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 Hr(e,t){return t&&(Yt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function _i(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
174
+ */class Az{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=C5.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 Ii=new Az;const By="transparent",Tz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=xy(e||By),i=r.valid&&xy(t||By);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Rz{constructor(t,n,r,i){const a=n[r];i=gc([t.to,i,a,t.from]);const o=gc([t.from,a,i]);this._active=!0,this._fn=t.fn||Tz[t.type||typeof o],this._easing=El[t.easing]||El.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=gc([t.to,n,i,t.from]),this._from=gc([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 N5{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!qe(t))return;const n=Object.keys(Ht.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!qe(a))return;const o={};for(const s of n)o[s]=a[s];(Yt(a.properties)&&a.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,o)})})}_animateOptions(t,n){const r=n.options,i=$z(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&Bz(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 d=a[u];const h=r.get(u);if(d)if(h&&d.active()){d.update(h,c,s);continue}else d.cancel();if(!h||!h.duration){t[u]=c;continue}a[u]=d=new Rz(h,t,u,c),i.push(d)}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 Ii.add(this._chart,r),!0}}function Bz(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 $z(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 $y(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 kz(e,t,n){if(n===!1)return!1;const r=$y(e,n),i=$y(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Pz(e){let t,n,r,i;return qe(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 M5(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 ky(e,t,n,r={}){const i=e.keys,a=r.mode==="single";let o,s,l,u;if(t!==null){for(o=0,s=i.length;o<s;++o){if(l=+i[o],l===n){if(r.all)continue;break}u=e.values[l],wn(u)&&(a||t===0||ci(t)===ci(u))&&(t+=u)}return t}}function Fz(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 Py(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Nz(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Mz(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 Lz(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Fy(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 Ny(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=Nz(a,o,r),d=t.length;let h;for(let f=0;f<d;++f){const g=t[f],{[l]:p,[u]:m}=g,b=g._stacks||(g._stacks={});h=b[u]=Lz(i,c,p),h[s]=m,h._top=Fy(h,o,!0,r.type),h._bottom=Fy(h,o,!1,r.type);const v=h._visualValues||(h._visualValues={});v[s]=m}}function e0(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Oz(e,t){return Ao(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Vz(e,t,n){return Ao(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function zs(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 t0=e=>e==="reset"||e==="none",My=(e,t)=>t?e:Object.assign({},e),Hz=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:M5(n,!0),values:null};class co{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=Py(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&&zs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,f,g)=>d==="x"?h:d==="r"?g:f,a=n.xAxisID=Ue(r.xAxisID,e0(t,"x")),o=n.yAxisID=Ue(r.yAxisID,e0(t,"y")),s=n.rAxisID=Ue(r.rAxisID,e0(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&&by(this._data,this),t._stacked&&zs(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(qe(n)){const i=this._cachedMeta;this._data=Fz(n,i)}else if(r!==n){if(r){by(r,this);const i=this._cachedMeta;zs(i),i._parsed=[]}n&&Object.isExtensible(n)&&wW(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=Py(n.vScale,n),n.stack!==r.stack&&(i=!0,zs(n),n.stack=r.stack),this._resyncElements(t),(i||a!==n._stacked)&&Ny(this,n._parsed)}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,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{Yt(i[t])?h=this.parseArrayData(r,i,t,n):qe(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const f=()=>d[s]===null||u&&d[s]<u[s];for(c=0;c<n;++c)r._parsed[c+t]=d=h[c],l&&(f()&&(l=!1),u=d);r._sorted=l}o&&Ny(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,d=new Array(i);let h,f,g;for(h=0,f=i;h<f;++h)g=h+r,d[h]={[s]:c||a.parse(u[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:a,yScale:o}=t,s=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],s[l]={x:a.parse(d[0],c),y:o.parse(d[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,d,h,f;for(c=0,d=i;c<d;++c)h=c+r,f=n[h],u[c]={x:a.parse(xo(f,s),h),y:o.parse(xo(f,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:M5(i,!0),values:n._stacks[t.axis]._visualValues};return ky(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=ky(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=Hz(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=Mz(s);let h,f;function g(){f=i[h];const p=f[s.axis];return!wn(f[t.axis])||c>p||d<p}for(h=0;h<o&&!(!g()&&(this.updateRangeFromParsed(u,t,f,l),a));++h);if(a){for(h=o-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(u,t,f,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],wn(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=Pz(Ue(this.options.clip,kz(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 d=i[c];d.hidden||(d.active&&u?o.push(d):d.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=Vz(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=Oz(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&&ru(r);if(s)return My(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),c),f=Object.keys(Ht.elements[t]),g=()=>this.getContext(r,i,n),p=u.resolveNamedOptions(h,f,g,d);return p.$shared&&(p.$shared=l,a[o]=Object.freeze(My(p,l))),p}_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,d=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(h,this.getContext(t,r,n))}const u=new N5(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||t0(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){t0(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!t0(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&&zs(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])}}xe(co,"defaults",{}),xe(co,"datasetElementType",null),xe(co,"dataElementType",null);function jz(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=x5(r.sort((i,a)=>i-a))}return e._cache.$bar}function Wz(e){const t=e.iScale,n=jz(t,e.type);let r=t._length,i,a,o,s;const l=()=>{o===32767||o===-32768||(ru(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 zz(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 Gz(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 Uz(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 L5(e,t,n,r){return Yt(e)?Uz(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Ly(e,t,n,r){const i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,l=[];let u,c,d,h;for(u=n,c=n+r;u<c;++u)h=t[u],d={},d[i.axis]=s||i.parse(o[u],u),l.push(L5(h,d,a,u));return l}function n0(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Xz(e,t,n){return e!==0?ci(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Zz(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 Yz(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}=Zz(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(a[Oy(c,o,s,l)]=!0,i=u)),a[Oy(i,o,s,l)]=!0,e.borderSkipped=a}function Oy(e,t,n,r){return r?(e=Kz(e,t,n),e=Vy(e,n,t)):e=Vy(e,t,n),e}function Kz(e,t,n){return e===t?n:e===n?t:e}function Vy(e,t,n){return e==="start"?t:e==="end"?n:e}function Jz(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class zc extends co{parsePrimitiveData(t,n,r,i){return Ly(t,n,r,i)}parseArrayData(t,n,r,i){return Ly(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,d=[];let h,f,g,p;for(h=r,f=r+i;h<f;++h)p=n[h],g={},g[a.axis]=a.parse(xo(p,u),h),d.push(L5(xo(p,c),g,o,h));return d}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=n0(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:d,includeOptions:h}=this._getSharedOptions(n,i);for(let f=n;f<n+r;f++){const g=this.getParsed(f),p=a||Et(g[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,c),b=(g._stacks||{})[s.axis],v={horizontal:u,base:p.base,enableBorderRadius:!b||n0(g._custom)||o===b._top||o===b._bottom,x:u?p.head:m.center,y:u?m.center:p.head,height:u?m.size:Math.abs(p.size),width:u?Math.abs(p.size):m.size};h&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":i));const x=v.options||t[f].options;Yz(v,x,b,o),Jz(v,x,c.ratio),this.updateElement(t[f],f,v,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=r.options.stacked,o=[],s=l=>{const u=l.controller.getParsed(n),c=u&&u[l.vScale.axis];if(Et(c)||isNaN(c))return!0};for(const l of i)if(!(n!==void 0&&s(l))&&((a===!1||o.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_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||Wz(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=n0(u);let d=l[n.axis],h=0,f=r?this.applyStack(n,l,r):d,g,p;f!==d&&(h=f-d,f=d),c&&(d=u.barStart,f=u.barEnd-u.barStart,d!==0&&ci(d)!==ci(u.barEnd)&&(h=0),h+=d);const m=!Et(a)&&!c?a:h;let b=n.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(h+f):g=b,p=g-b,Math.abs(p)<o){p=Xz(p,n,s)*o,d===s&&(b-=p/2);const v=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),C=Math.min(v,x),E=Math.max(v,x);b=Math.max(Math.min(b,E),C),g=b+p,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(g)-n.getValueForPixel(b))}if(b===n.getPixelForValue(s)){const v=ci(p)*n.getLineWidthForValue(s)/2;b+=v,p-=v}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,a=i.skipNull,o=Ue(i.maxBarThickness,1/0);let s,l;if(n.grouped){const u=a?this._getStackCount(t):n.stackCount,c=i.barThickness==="flex"?Gz(t,n,i,u):zz(t,n,i,u),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);s=c.start+c.chunk*d+c.chunk/2,l=Math.min(o,c.chunk*c.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)}}xe(zc,"id","bar"),xe(zc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),xe(zc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function qz(e,t,n){let r=1,i=1,a=0,o=0;if(t<kt){const s=e,l=s+t,u=Math.cos(s),c=Math.sin(s),d=Math.cos(l),h=Math.sin(l),f=(x,C,E)=>au(x,s,l,!0)?1:Math.max(C,C*n,E,E*n),g=(x,C,E)=>au(x,s,l,!0)?-1:Math.min(C,C*n,E,E*n),p=f(0,u,d),m=f(Qt,c,h),b=g(Ot,u,d),v=g(Ot+Qt,c,h);r=(p-b)/2,i=(m-v)/2,a=-(p+b)/2,o=-(m+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}class ol extends co{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(qe(r[t])){const{key:l="value"}=this._parsing;a=u=>+xo(r[u],l)}let o,s;for(o=t,s=t+n;o<s;++o)i._parsed[o]=a(o)}}_getRotation(){return Mi(this.options.rotation-90)}_getCircumference(){return Mi(this.options.circumference)}_getRotationExtents(){let t=kt,n=-kt;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(lW(this.options.cutout,s),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:g,offsetY:p}=qz(d,c,l),m=(r.width-o)/h,b=(r.height-o)/f,v=Math.max(Math.min(m,b)/2,0),x=p5(this.options.radius,v),C=Math.max(x*l,0),E=(x-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,i.total=this.calculateTotal(),this.outerRadius=x-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*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/kt)}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,d=(s.top+s.bottom)/2,h=a&&u.animateScale,f=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(n,i);let b=this._getRotation(),v;for(v=0;v<n;++v)b+=this._circumference(v,a);for(v=n;v<n+r;++v){const x=this._circumference(v,a),C=t[v],E={x:c+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:g,innerRadius:f};m&&(E.options=p||this.resolveDataElementOptions(v,C.active?"active":i)),b+=x,this.updateElement(C,v,E,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)?kt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Xm(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(Ue(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}xe(ol,"id","doughnut"),xe(ol,"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"}),xe(ol,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),xe(ol,"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 Gc extends co{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}=DW(n,i,o);this._drawStart=s,this._drawCount=l,AW(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:d}=this._getSharedOptions(n,i),h=o.axis,f=s.axis,{spanGaps:g,segment:p}=this.options,m=iu(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||i==="none",v=n+r,x=t.length;let C=n>0&&this.getParsed(n-1);for(let E=0;E<x;++E){const w=t[E],B=b?w:{};if(E<n||E>=v){B.skip=!0;continue}const y=this.getParsed(E),S=Et(y[f]),D=B[h]=o.getPixelForValue(y[h],E),A=B[f]=a||S?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,y,l):y[f],E);B.skip=isNaN(D)||isNaN(A)||S,B.stop=E>0&&Math.abs(y[h]-C[h])>m,p&&(B.parsed=y,B.raw=u.data[E]),d&&(B.options=c||this.resolveDataElementOptions(E,w.active?"active":i)),b||this.updateElement(w,E,B,i),C=y}}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()}}xe(Gc,"id","line"),xe(Gc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),xe(Gc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Oa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class e1{constructor(t){xe(this,"options");this.options=t||{}}static override(t){Object.assign(e1.prototype,t)}init(){}formats(){return Oa()}parse(){return Oa()}format(){return Oa()}add(){return Oa()}diff(){return Oa()}startOf(){return Oa()}endOf(){return Oa()}}var Qz={_date:e1};function eG(e,t,n,r){const{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale;if(s&&t===s.axis&&t!=="r"&&o&&a.length){const l=s._reversePixels?EW:ro;if(r){if(i._sharedOptions){const u=a[0],c=typeof u.getRange=="function"&&u.getRange(t);if(c){const d=l(a,t,n-c),h=l(a,t,n+c);return{lo:d.lo,hi:h.hi}}}}else return l(a,t,n)}return{lo:0,hi:a.length-1}}function Wf(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:d,hi:h}=eG(a[s],t,o,i);for(let f=d;f<=h;++f){const g=c[f];g.skip||r(g,u,f)}}}function tG(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 r0(e,t,n,r,i){const a=[];return!i&&!e.isPointInArea(t)||Wf(e,n,t,function(s,l,u){!i&&!ou(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&a.push({element:s,datasetIndex:l,index:u})},!0),a}function nG(e,t,n,r){let i=[];function a(o,s,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=v5(o,{x:t.x,y:t.y});au(d,u,c)&&i.push({element:o,datasetIndex:s,index:l})}return Wf(e,n,t,a),i}function rG(e,t,n,r,i,a){let o=[];const s=tG(n);let l=Number.POSITIVE_INFINITY;function u(c,d,h){const f=c.inRange(t.x,t.y,i);if(r&&!f)return;const g=c.getCenterPoint(i);if(!(!!a||e.isPointInArea(g))&&!f)return;const m=s(t,g);m<l?(o=[{element:c,datasetIndex:d,index:h}],l=m):m===l&&o.push({element:c,datasetIndex:d,index:h})}return Wf(e,n,t,u),o}function i0(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n==="r"&&!r?nG(e,t,n,i):rG(e,t,n,r,i,a)}function Hy(e,t,n,r,i){const a=[],o=n==="x"?"inXRange":"inYRange";let s=!1;return Wf(e,n,t,(l,u,c)=>{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 iG={modes:{index(e,t,n,r){const i=Wa(t,e),a=n.axis||"x",o=n.includeInvisible||!1,s=n.intersect?r0(e,i,a,r,o):i0(e,i,a,!1,r,o),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,n,r){const i=Wa(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;let s=n.intersect?r0(e,i,a,r,o):i0(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=Wa(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return r0(e,i,a,r,o)},nearest(e,t,n,r){const i=Wa(t,e),a=n.axis||"xy",o=n.includeInvisible||!1;return i0(e,i,a,n.intersect,r,o)},x(e,t,n,r){const i=Wa(t,e);return Hy(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Wa(t,e);return Hy(e,i,"y",n.intersect,r)}}};const O5=["left","top","right","bottom"];function Gs(e,t){return e.filter(n=>n.pos===t)}function jy(e,t){return e.filter(n=>O5.indexOf(n.pos)===-1&&n.box.axis===t)}function Us(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 aG(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 oG(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:a}=n;if(!r||!O5.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 sG(e,t){const n=oG(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 lG(e){const t=aG(e),n=Us(t.filter(u=>u.box.fullSize),!0),r=Us(Gs(t,"left"),!0),i=Us(Gs(t,"right")),a=Us(Gs(t,"top"),!0),o=Us(Gs(t,"bottom")),s=jy(t,"x"),l=jy(t,"y");return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(o).concat(s),chartArea:Gs(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(o).concat(s)}}function Wy(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function V5(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 uG(e,t,n,r){const{pos:i,box:a}=n,o=e.maxPadding;if(!qe(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?a.height:a.width),n.size=d.size/d.count,e[i]+=n.size}a.getPadding&&V5(o,a.getPadding());const s=Math.max(0,t.outerWidth-Wy(o,e,"left","right")),l=Math.max(0,t.outerHeight-Wy(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 cG(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 dG(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 sl(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,dG(s.horizontal,t));const{same:d,other:h}=uG(t,n,s,r);u|=d&&i.length,c=c||h,l.fullSize||i.push(s)}return u&&sl(i,t,n,r)||c}function bc(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 zy(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 d=t.w*c,h=u.size||l.height;ru(u.start)&&(o=u.start),l.fullSize?bc(l,i.left,o,n.outerWidth-i.right-i.left,h):bc(l,t.left+u.placed,o,d,h),u.start=o,u.placed+=d,o=l.bottom}else{const d=t.h*c,h=u.size||l.width;ru(u.start)&&(a=u.start),l.fullSize?bc(l,a,i.top,h,n.outerHeight-i.bottom-i.top):bc(l,a,t.top+u.placed,h,d),u.start=a,u.placed+=d,a=l.right}}t.x=a,t.y=o}var Cr={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=Sr(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=lG(e.boxes),l=s.vertical,u=s.horizontal;pt(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const c=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);V5(h,Sr(r));const f=Object.assign({maxPadding:h,w:a,h:o,x:i.left,y:i.top},i),g=sG(l.concat(u),d);sl(s.fullSize,f,d,g),sl(l,f,d,g),sl(u,f,d,g)&&sl(l,f,d,g),cG(f),zy(s.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,zy(s.rightAndBottom,f,d,g),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},pt(s.chartArea,p=>{const m=p.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class H5{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 fG extends H5{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Uc="$chartjs",hG={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Gy=e=>e===null||e==="";function gG(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[Uc]={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",Gy(i)){const a=Dy(e,"width");a!==void 0&&(e.width=a)}if(Gy(r))if(e.style.height==="")e.height=e.width/(t||2);else{const a=Dy(e,"height");a!==void 0&&(e.height=a)}return e}const j5=bz?{passive:!0}:!1;function pG(e,t,n){e&&e.addEventListener(t,n,j5)}function mG(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,j5)}function bG(e,t){const n=hG[e.type]||e.type,{x:r,y:i}=Wa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Zd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function vG(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zd(s.addedNodes,r),o=o&&!Zd(s.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function yG(e,t,n){const r=e.canvas,i=new MutationObserver(a=>{let o=!1;for(const s of a)o=o||Zd(s.removedNodes,r),o=o&&!Zd(s.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const lu=new Map;let Uy=0;function W5(){const e=window.devicePixelRatio;e!==Uy&&(Uy=e,lu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function xG(e,t){lu.size||window.addEventListener("resize",W5),lu.set(e,t)}function CG(e){lu.delete(e),lu.size||window.removeEventListener("resize",W5)}function EG(e,t,n){const r=e.canvas,i=r&&Qm(r);if(!i)return;const a=E5((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),xG(e,a),o}function a0(e,t,n){n&&n.disconnect(),t==="resize"&&CG(e)}function SG(e,t,n){const r=e.canvas,i=E5(a=>{e.ctx!==null&&n(bG(a,e))},e);return pG(r,t,i),i}class wG extends H5{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(gG(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Uc])return!1;const r=n[Uc].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[Uc],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:vG,detach:yG,resize:EG}[n]||SG;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:a0,detach:a0,resize:a0}[n]||mG)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return mz(t,n,r,i)}isAttached(t){const n=t&&Qm(t);return!!(n&&n.isConnected)}}function IG(e){return!qm()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?fG:wG}var Ic;let Gi=(Ic=class{constructor(){xe(this,"x");xe(this,"y");xe(this,"active",!1);xe(this,"options");xe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return iu(this.x)&&iu(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}},xe(Ic,"defaults",{}),xe(Ic,"defaultRoutes"),Ic);function _G(e,t){const n=e.options.ticks,r=DG(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?TG(t):[],o=a.length,s=a[0],l=a[o-1],u=[];if(o>i)return RG(t,u,a,o/i),u;const c=AG(a,t,i);if(o>0){let d,h;const f=o>1?Math.round((l-s)/(o-1)):null;for(vc(t,u,c,Et(f)?0:s-f,s),d=0,h=o-1;d<h;d++)vc(t,u,c,a[d],a[d+1]);return vc(t,u,c,l,Et(f)?t.length:l+f),u}return vc(t,u,c),u}function DG(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 AG(e,t,n){const r=BG(e),i=t.length/n;if(!r)return Math.max(i,1);const a=mW(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 TG(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function RG(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 vc(e,t,n,r,i){const a=Ue(r,0),o=Math.min(Ue(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 BG(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 $G=e=>e==="left"?"right":e==="right"?"left":e,Xy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Zy=(e,t)=>Math.min(t||e,e);function Yy(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 kG(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 PG(e,t){pt(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 Xs(e){return e.drawTicks?e.tickLength:0}function Ky(e,t){if(!e.display)return 0;const n=Sn(e.font,t),r=Sr(e.padding);return(Yt(e.text)?e.text.length:1)*n.lineHeight+r.height}function FG(e,t){return Ao(e,{scale:t,type:"scale"})}function NG(e,t,n){return Ao(e,{tick:n,index:t,type:"tick"})}function MG(e,t,n){let r=Gm(e);return(n&&t!=="right"||!n&&t==="right")&&(r=$G(r)),r}function LG(e,t,n,r){const{top:i,left:a,bottom:o,right:s,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,h,f,g;const p=o-i,m=s-a;if(e.isHorizontal()){if(f=bn(r,a,s),qe(n)){const b=Object.keys(n)[0],v=n[b];g=c[b].getPixelForValue(v)+p-t}else n==="center"?g=(u.bottom+u.top)/2+p-t:g=Xy(e,n,t);h=s-a}else{if(qe(n)){const b=Object.keys(n)[0],v=n[b];f=c[b].getPixelForValue(v)-m+t}else n==="center"?f=(u.left+u.right)/2-m+t:f=Xy(e,n,t);g=bn(r,o,i),d=n==="left"?-Qt:Qt}return{titleX:f,titleY:g,maxWidth:h,rotation:d}}class Ns extends Gi{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=Vr(t,Number.POSITIVE_INFINITY),n=Vr(n,Number.NEGATIVE_INFINITY),r=Vr(r,Number.POSITIVE_INFINITY),i=Vr(i,Number.NEGATIVE_INFINITY),{min:Vr(t,r),max:Vr(n,i),minDefined:wn(t),maxDefined:wn(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:Vr(n,Vr(r,n)),max:Vr(r,Vr(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(){St(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=ZW(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?Yy(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=_G(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(){St(this.options.afterUpdate,[this])}beforeSetDimensions(){St(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(){St(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),St(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){St(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=St(n.callback,[a.value,r,t],this)}afterTickToLabelConversion(){St(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){St(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Zy(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(),d=c.widest.width,h=c.highest.height,f=En(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:f/(r-1),d+6>s&&(s=f/(r-(t.offset?.5:1)),l=this.maxHeight-Xs(t.grid)-n.padding-Ky(t.title,this.chart.options.font),u=Math.sqrt(d*d+h*h),o=yW(Math.min(Math.asin(En((c.highest.height+6)/s,-1,1)),Math.asin(En(l/u,-1,1))-Math.asin(En(h/u,-1,1)))),o=Math.max(i,Math.min(a,o))),this.labelRotation=o}afterCalculateLabelRotation(){St(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){St(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=Ky(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=Xs(a)+l):(t.height=this.maxHeight,t.width=Xs(a)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:h}=this._getLabelSizes(),f=r.padding*2,g=Mi(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(s){const b=r.mirror?0:m*d.width+p*h.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=r.mirror?0:p*d.width+m*h.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(u,c,m,p)}}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,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?u?(h=i*t.width,f=r*n.height):(h=r*t.height,f=i*n.width):a==="start"?f=n.width:a==="end"?h=t.width:a!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=t.height/2;a==="start"?(c=0,d=t.height):a==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+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(){St(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=Yy(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/Zy(n,r));let u=0,c=0,d,h,f,g,p,m,b,v,x,C,E;for(d=0;d<n;d+=l){if(g=t[d].label,p=this._resolveTickFontOptions(d),i.font=m=p.string,b=a[m]=a[m]||{data:{},gc:[]},v=p.lineHeight,x=C=0,!Et(g)&&!Yt(g))x=Ey(i,b.data,b.gc,x,g),C=v;else if(Yt(g))for(h=0,f=g.length;h<f;++h)E=g[h],!Et(E)&&!Yt(E)&&(x=Ey(i,b.data,b.gc,x,E),C+=v);o.push(x),s.push(C),u=Math.max(x,u),c=Math.max(C,c)}PG(a,n);const w=o.indexOf(u),B=s.indexOf(c),y=S=>({width:o[S]||0,height:s[S]||0});return{first:y(0),last:y(n-1),widest:y(w),highest:y(B),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 CW(this._alignToPixels?La(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=NG(this.getContext(),t,r))}return this.$context||(this.$context=FG(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Mi(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(),d=this.ticks.length+(l?1:0),h=Xs(a),f=[],g=s.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function($){return La(r,$,p)};let v,x,C,E,w,B,y,S,D,A,T,F;if(o==="top")v=b(this.bottom),B=this.bottom-h,S=v-m,A=b(t.top)+m,F=t.bottom;else if(o==="bottom")v=b(this.top),A=t.top,F=b(t.bottom)-m,B=v+m,S=this.top+h;else if(o==="left")v=b(this.right),w=this.right-h,y=v-m,D=b(t.left)+m,T=t.right;else if(o==="right")v=b(this.left),D=t.left,T=b(t.right)-m,w=v+m,y=this.left+h;else if(n==="x"){if(o==="center")v=b((t.top+t.bottom)/2+.5);else if(qe(o)){const $=Object.keys(o)[0],R=o[$];v=b(this.chart.scales[$].getPixelForValue(R))}A=t.top,F=t.bottom,B=v+m,S=B+h}else if(n==="y"){if(o==="center")v=b((t.left+t.right)/2);else if(qe(o)){const $=Object.keys(o)[0],R=o[$];v=b(this.chart.scales[$].getPixelForValue(R))}w=v-m,y=w-h,D=t.left,T=t.right}const k=Ue(i.ticks.maxTicksLimit,d),P=Math.max(1,Math.ceil(d/k));for(x=0;x<d;x+=P){const $=this.getContext(x),R=a.setContext($),O=s.setContext($),j=R.lineWidth,V=R.color,W=O.dash||[],U=O.dashOffset,K=R.tickWidth,ee=R.tickColor,z=R.tickBorderDash||[],H=R.tickBorderDashOffset;C=kG(this,x,l),C!==void 0&&(E=La(r,C,j),u?w=y=D=T=E:B=S=A=F=E,f.push({tx1:w,ty1:B,tx2:y,ty2:S,x1:D,y1:A,x2:T,y2:F,width:j,color:V,borderDash:W,borderDashOffset:U,tickWidth:K,tickColor:ee,tickBorderDash:z,tickBorderDashOffset:H}))}return this._ticksLength=d,this._borderValue=v,f}_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:d}=a,h=Xs(r.grid),f=h+c,g=d?-c:f,p=-Mi(this.labelRotation),m=[];let b,v,x,C,E,w,B,y,S,D,A,T,F="middle";if(i==="top")w=this.bottom-g,B=this._getXAxisLabelAlignment();else if(i==="bottom")w=this.top+g,B=this._getXAxisLabelAlignment();else if(i==="left"){const P=this._getYAxisLabelAlignment(h);B=P.textAlign,E=P.x}else if(i==="right"){const P=this._getYAxisLabelAlignment(h);B=P.textAlign,E=P.x}else if(n==="x"){if(i==="center")w=(t.top+t.bottom)/2+f;else if(qe(i)){const P=Object.keys(i)[0],$=i[P];w=this.chart.scales[P].getPixelForValue($)+f}B=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")E=(t.left+t.right)/2-f;else if(qe(i)){const P=Object.keys(i)[0],$=i[P];E=this.chart.scales[P].getPixelForValue($)}B=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const k=this._getLabelSizes();for(b=0,v=s.length;b<v;++b){x=s[b],C=x.label;const P=a.setContext(this.getContext(b));y=this.getPixelForTick(b)+a.labelOffset,S=this._resolveTickFontOptions(b),D=S.lineHeight,A=Yt(C)?C.length:1;const $=A/2,R=P.color,O=P.textStrokeColor,j=P.textStrokeWidth;let V=B;o?(E=y,B==="inner"&&(b===v-1?V=this.options.reverse?"left":"right":b===0?V=this.options.reverse?"right":"left":V="center"),i==="top"?u==="near"||p!==0?T=-A*D+D/2:u==="center"?T=-k.highest.height/2-$*D+D:T=-k.highest.height+D/2:u==="near"||p!==0?T=D/2:u==="center"?T=k.highest.height/2-$*D:T=k.highest.height-A*D,d&&(T*=-1),p!==0&&!P.showLabelBackdrop&&(E+=D/2*Math.sin(p))):(w=y,T=(1-A)*D/2);let W;if(P.showLabelBackdrop){const U=Sr(P.backdropPadding),K=k.heights[b],ee=k.widths[b];let z=T-U.top,H=0-U.left;switch(F){case"middle":z-=K/2;break;case"bottom":z-=K;break}switch(B){case"center":H-=ee/2;break;case"right":H-=ee;break;case"inner":b===v-1?H-=ee:b>0&&(H-=ee/2);break}W={left:H,top:z,width:ee+U.width,height:K+U.height,color:P.backdropColor}}m.push({label:C,font:S,textOffset:T,options:{rotation:p,color:R,strokeColor:O,strokeWidth:j,textAlign:V,textBaseline:F,translation:[E,w],backdrop:W}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Mi(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,d,h;this.isHorizontal()?(u=La(t,this.left,o)-o/2,c=La(t,this.right,s)+s/2,d=h=l):(d=La(t,this.top,o)-o/2,h=La(t,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=a.width,n.strokeStyle=a.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Vf(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;su(r,u,0,c,l,s)}i&&Hf(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const a=Sn(r.font),o=Sr(r.padding),s=r.align;let l=a.lineHeight/2;n==="bottom"||n==="center"||qe(n)?(l+=o.bottom,Yt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:h}=LG(this,l,n,s);su(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:h,textAlign:MG(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=Ue(t.grid&&t.grid.z,-1),i=Ue(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ns.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 Sn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class yc{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;HG(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,OG(t,o,r),this.override&&Ht.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 Ht[i]&&(delete Ht[i][r],this.override&&delete Co[r])}}function OG(e,t,n){const r=nu(Object.create(null),[n?Ht.get(n):{},Ht.get(t),e.defaults]);Ht.set(t,r),e.defaultRoutes&&VG(t,e.defaultRoutes),e.descriptors&&Ht.describe(t,e.descriptors)}function VG(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(".");Ht.route(a,i,l,s)})}function HG(e){return"id"in e&&"defaults"in e}class jG{constructor(){this.controllers=new yc(co,"datasets",!0),this.elements=new yc(Gi,"elements"),this.plugins=new yc(Object,"plugins"),this.scales=new yc(Ns,"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):pt(i,o=>{const s=r||this._getRegistryForType(o);this._exec(t,s,o)})})}_exec(t,n,r){const i=Wm(t);St(r["before"+i],[],r),n[t](r),St(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 zr=new jG;class WG{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(St(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=Ue(r.options&&r.options.plugins,{}),a=zG(r);return i===!1&&!n?[]:UG(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 zG(e){const t={},n=[],r=Object.keys(zr.plugins.items);for(let a=0;a<r.length;a++)n.push(zr.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 GG(e,t){return!t&&e===!1?null:e===!0?{}:e}function UG(e,{plugins:t,localIds:n},r,i){const a=[],o=e.getContext();for(const s of t){const l=s.id,u=GG(r[l],i);u!==null&&a.push({plugin:s,options:XG(e.config,{plugin:s,local:n[l]},u,o)})}return a}function XG(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 jg(e,t){const n=Ht.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function ZG(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function YG(e,t){return e===t?"_index_":"_value_"}function Jy(e){if(e==="x"||e==="y"||e==="r")return e}function KG(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Wg(e,...t){if(Jy(e))return e;for(const n of t){const r=n.axis||KG(n.position)||e.length>1&&Jy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function qy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function JG(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 qy(e,"x",n[0])||qy(e,"y",n[0])}return{}}function qG(e,t){const n=Co[e.type]||{scales:{}},r=t.scales||{},i=jg(e.type,t),a=Object.create(null);return Object.keys(r).forEach(o=>{const s=r[o];if(!qe(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=Wg(o,s,JG(o,e),Ht.scales[s.type]),u=YG(l,i),c=n.scales||{};a[o]=xl(Object.create(null),[{axis:l},s,c[l],c[u]])}),e.data.datasets.forEach(o=>{const s=o.type||e.type,l=o.indexAxis||jg(s,t),c=(Co[s]||{}).scales||{};Object.keys(c).forEach(d=>{const h=ZG(d,l),f=o[h+"AxisID"]||h;a[f]=a[f]||Object.create(null),xl(a[f],[{axis:h},r[f],c[d]])})}),Object.keys(a).forEach(o=>{const s=a[o];xl(s,[Ht.scales[s.type],Ht.scale])}),a}function z5(e){const t=e.options||(e.options={});t.plugins=Ue(t.plugins,{}),t.scales=qG(e,t)}function G5(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function QG(e){return e=e||{},e.data=G5(e.data),z5(e),e}const Qy=new Map,U5=new Set;function xc(e,t){let n=Qy.get(e);return n||(n=t(),Qy.set(e,n),U5.add(n)),n}const Zs=(e,t,n)=>{const r=xo(t,n);r!==void 0&&e.add(r)};class eU{constructor(t){this._config=QG(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=G5(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(),z5(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return xc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return xc(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return xc(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return xc(`${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(d=>Zs(l,t,d))),c.forEach(d=>Zs(l,i,d)),c.forEach(d=>Zs(l,Co[a]||{},d)),c.forEach(d=>Zs(l,Ht,d)),c.forEach(d=>Zs(l,Vg,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),U5.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Co[n]||{},Ht.datasets[n]||{},{type:n},Ht,Vg]}resolveNamedOptions(t,n,r,i=[""]){const a={$shared:!0},{resolver:o,subPrefixes:s}=ex(this._resolverCache,t,i);let l=o;if(nU(o,n)){a.$shared=!1,r=Da(r)?r():r;const u=this.createResolver(t,r,s);l=Ss(o,r,u)}for(const u of n)a[u]=l[u];return a}createResolver(t,n,r=[""],i){const{resolver:a}=ex(this._resolverCache,t,r);return qe(n)?Ss(a,n,void 0,i):a}}function ex(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:Ym(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,a)),a}const tU=e=>qe(e)&&Object.getOwnPropertyNames(e).some(t=>Da(e[t]));function nU(e,t){const{isScriptable:n,isIndexable:r}=_5(e);for(const i of t){const a=n(i),o=r(i),s=(o||a)&&e[i];if(a&&(Da(s)||tU(s))||o&&Yt(s))return!0}return!1}var rU="4.4.3";const iU=["top","bottom","left","right","chartArea"];function tx(e,t){return e==="top"||e==="bottom"||iU.indexOf(e)===-1&&t==="x"}function nx(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function rx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),St(n&&n.onComplete,[e],t)}function aU(e){const t=e.chart,n=t.options.animation;St(n&&n.onProgress,[e],t)}function X5(e){return qm()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Xc={},ix=e=>{const t=X5(e);return Object.values(Xc).filter(n=>n.canvas===t).pop()};function oU(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 sU(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Cc(e,t,n){return e.options.clip?e[n]:t[n]}function lU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Cc(n,t,"left"),right:Cc(n,t,"right"),top:Cc(r,t,"top"),bottom:Cc(r,t,"bottom")}:t}var qi;let To=(qi=class{static register(...t){zr.add(...t),ax()}static unregister(...t){zr.remove(...t),ax()}constructor(t,n){const r=this.config=new eU(n),i=X5(t),a=ix(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||IG(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=sW(),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 WG,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=IW(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Xc[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ii.listen(this,"complete",rx),Ii.listen(this,"progress",aU),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 zr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_y(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sy(this.canvas,this.ctx),this}stop(){return Ii.stop(this),this}resize(t,n){Ii.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,_y(this,s,!0)&&(this.notifyPlugins("resize",{size:o}),St(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};pt(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=Wg(o,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),pt(a,o=>{const s=o.options,l=s.id,u=Wg(l,s),c=Ue(s.type,o.dtype);(s.position===void 0||tx(s.position,u)!==tx(o.dposition))&&(s.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const h=zr.getScale(c);d=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),pt(i,(o,s)=>{o||delete r[s]}),pt(r,o=>{Cr.configure(this,o,o.options),Cr.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(nx("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||jg(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=zr.getController(s),{datasetElementType:u,dataElementType:c}=Ht.datasets[s];Object.assign(l,{dataElementType:zr.getElement(c),datasetElementType:u&&zr.getElement(u)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){pt(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:d}=this.getDatasetMeta(u),h=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||pt(a,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(nx("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){pt(this.scales,t=>{Cr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!hy(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;oU(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(!hy(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;Cr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],pt(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,Da(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&&(Ii.has(this)?this.attached&&!Ii.running(this)&&Ii.start(this):(this.draw(),rx({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}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=t._clip,i=!r.disabled,a=lU(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&Vf(n,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&Hf(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ou(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const a=iG.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=Ao(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);ru(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(),Ii.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(),Sy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Xc[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)};pt(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(){pt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},pt(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}});!Wd(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(d=>c.datasetIndex===d.datasetIndex&&c.index===d.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=hW(t),u=sU(t,this._lastEvent,r,l);r&&(this._lastEvent=null,St(a.onHover,[t,s,this],this),l&&St(a.onClick,[t,s,this],this));const c=!Wd(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)}},xe(qi,"defaults",Ht),xe(qi,"instances",Xc),xe(qi,"overrides",Co),xe(qi,"registry",zr),xe(qi,"version",rU),xe(qi,"getChart",ix),qi);function ax(){return pt(To.instances,e=>e._plugins.invalidate())}function uU(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+Qt,r-Qt),e.closePath(),e.clip()}function cU(e){return Zm(e,["outerStart","outerEnd","innerStart","innerEnd"])}function dU(e,t,n,r){const i=cU(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 En(l,0,Math.min(a,u))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:En(i.innerStart,0,o),innerEnd:En(i.innerEnd,0,o)}}function jo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Yd(e,t,n,r,i,a){const{x:o,y:s,startAngle:l,pixelMargin:u,innerRadius:c}=t,d=Math.max(t.outerRadius+r+n-u,0),h=c>0?c+r+n+u:0;let f=0;const g=i-l;if(r){const P=c>0?c-r:0,$=d>0?d-r:0,R=(P+$)/2,O=R!==0?g*R/(R+r):g;f=(g-O)/2}const p=Math.max(.001,g*d-n/Ot)/d,m=(g-p)/2,b=l+m+f,v=i-m-f,{outerStart:x,outerEnd:C,innerStart:E,innerEnd:w}=dU(t,h,d,v-b),B=d-x,y=d-C,S=b+x/B,D=v-C/y,A=h+E,T=h+w,F=b+E/A,k=v-w/T;if(e.beginPath(),a){const P=(S+D)/2;if(e.arc(o,s,d,S,P),e.arc(o,s,d,P,D),C>0){const j=jo(y,D,o,s);e.arc(j.x,j.y,C,D,v+Qt)}const $=jo(T,v,o,s);if(e.lineTo($.x,$.y),w>0){const j=jo(T,k,o,s);e.arc(j.x,j.y,w,v+Qt,k+Math.PI)}const R=(v-w/h+(b+E/h))/2;if(e.arc(o,s,h,v-w/h,R,!0),e.arc(o,s,h,R,b+E/h,!0),E>0){const j=jo(A,F,o,s);e.arc(j.x,j.y,E,F+Math.PI,b-Qt)}const O=jo(B,b,o,s);if(e.lineTo(O.x,O.y),x>0){const j=jo(B,S,o,s);e.arc(j.x,j.y,x,b-Qt,S)}}else{e.moveTo(o,s);const P=Math.cos(S)*d+o,$=Math.sin(S)*d+s;e.lineTo(P,$);const R=Math.cos(D)*d+o,O=Math.sin(D)*d+s;e.lineTo(R,O)}e.closePath()}function fU(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s}=t;let l=t.endAngle;if(a){Yd(e,t,n,r,l,i);for(let u=0;u<a;++u)e.fill();isNaN(s)||(l=o+(s%kt||kt))}return Yd(e,t,n,r,l,i),e.fill(),l}function hU(e,t,n,r,i){const{fullCircles:a,startAngle:o,circumference:s,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:h}=l,f=l.borderAlign==="inner";if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=h,f?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let g=t.endAngle;if(a){Yd(e,t,n,r,g,i);for(let p=0;p<a;++p)e.stroke();isNaN(s)||(g=o+(s%kt||kt))}f&&uU(e,t,g),a||(Yd(e,t,n,r,g,i),e.stroke())}class ll extends Gi{constructor(n){super();xe(this,"circumference");xe(this,"endAngle");xe(this,"fullCircles");xe(this,"innerRadius");xe(this,"outerRadius");xe(this,"pixelMargin");xe(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}=v5(a,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,p=Ue(h,u-l)>=kt||au(o,l,u),m=Li(s,c+f,d+f);return p&&m}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,d=(a+o)/2,h=(s+l+c+u)/2;return{x:r+Math.cos(d)*h,y:i+Math.sin(d)*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>kt?Math.floor(i/kt):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(Ot,i||0)),c=a*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,fU(n,this,c,o,s),hU(n,this,c,o,s),n.restore()}}xe(ll,"id","arc"),xe(ll,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),xe(ll,"defaultRoutes",{backgroundColor:"backgroundColor"}),xe(ll,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Z5(e,t,n=t){e.lineCap=Ue(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ue(n.borderDash,t.borderDash)),e.lineDashOffset=Ue(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ue(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ue(n.borderWidth,t.borderWidth),e.strokeStyle=Ue(n.borderColor,t.borderColor)}function gU(e,t,n){e.lineTo(n.x,n.y)}function pU(e){return e.stepped?OW:e.tension||e.cubicInterpolationMode==="monotone"?VW:gU}function Y5(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 mU(e,t,n,r){const{points:i,options:a}=t,{count:o,start:s,loop:l,ilen:u}=Y5(i,n,r),c=pU(a);let{move:d=!0,reverse:h}=r||{},f,g,p;for(f=0;f<=u;++f)g=i[(s+(h?u-f:f))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):c(e,p,g,h,a.stepped),p=g);return l&&(g=i[(s+(h?u:0))%o],c(e,p,g,h,a.stepped)),!!l}function bU(e,t,n,r){const i=t.points,{count:a,start:o,ilen:s}=Y5(i,n,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,h,f,g,p,m,b;const v=C=>(o+(u?s-C:C))%a,x=()=>{p!==m&&(e.lineTo(c,m),e.lineTo(c,p),e.lineTo(c,b))};for(l&&(f=i[v(0)],e.moveTo(f.x,f.y)),h=0;h<=s;++h){if(f=i[v(h)],f.skip)continue;const C=f.x,E=f.y,w=C|0;w===g?(E<p?p=E:E>m&&(m=E),c=(d*c+C)/++d):(x(),e.lineTo(C,E),g=w,d=0,p=m=E),b=E}x()}function zg(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?bU:mU}function vU(e){return e.stepped?vz:e.tension||e.cubicInterpolationMode==="monotone"?yz:za}function yU(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Z5(e,t.options),e.stroke(i)}function xU(e,t,n,r){const{segments:i,options:a}=t,o=zg(t);for(const s of i)Z5(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const CU=typeof Path2D=="function";function EU(e,t,n,r){CU&&!t.options.segment?yU(e,t,n,r):xU(e,t,n,r)}class oi extends Gi{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;cz(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=Iz(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=F5(this,{property:n,start:i,end:i});if(!o.length)return;const s=[],l=vU(r);let u,c;for(u=0,c=o.length;u<c;++u){const{start:d,end:h}=o[u],f=a[d],g=a[h];if(f===g){s.push(f);continue}const p=Math.abs((i-f[n])/(g[n]-f[n])),m=l(f,g,p,r.stepped);m[n]=t[n],s.push(m)}return s.length===1?s[0]:s}pathSegment(t,n,r){return zg(this)(t,this,n,r)}path(t,n,r){const i=this.segments,a=zg(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(),EU(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}xe(oi,"id","line"),xe(oi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),xe(oi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),xe(oi,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ox(e,t,n,r){const i=e.options,{[n]:a}=e.getProps([n],r);return Math.abs(t-a)<i.radius+i.hitRadius}class fo extends Gi{constructor(n){super();xe(this,"parsed");xe(this,"skip");xe(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 ox(this,n,"x",r)}inYRange(n,r){return ox(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||!ou(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Hg(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}xe(fo,"id","point"),xe(fo,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),xe(fo,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function K5(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,d;return e.horizontal?(d=o/2,s=Math.min(n,i),l=Math.max(n,i),u=r-d,c=r+d):(d=a/2,s=n-d,l=n+d,u=Math.min(r,i),c=Math.max(r,i)),{left:s,top:u,right:l,bottom:c}}function ga(e,t,n,r){return e?0:En(t,n,r)}function SU(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,a=I5(r);return{t:ga(i.top,a.top,0,n),r:ga(i.right,a.right,0,t),b:ga(i.bottom,a.bottom,0,n),l:ga(i.left,a.left,0,t)}}function wU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,a=us(i),o=Math.min(t,n),s=e.borderSkipped,l=r||qe(i);return{topLeft:ga(!l||s.top||s.left,a.topLeft,0,o),topRight:ga(!l||s.top||s.right,a.topRight,0,o),bottomLeft:ga(!l||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:ga(!l||s.bottom||s.right,a.bottomRight,0,o)}}function IU(e){const t=K5(e),n=t.right-t.left,r=t.bottom-t.top,i=SU(e,n/2,r/2),a=wU(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 o0(e,t,n,r){const i=t===null,a=n===null,s=e&&!(i&&a)&&K5(e,r);return s&&(i||Li(t,s.left,s.right))&&(a||Li(n,s.top,s.bottom))}function _U(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function DU(e,t){e.rect(t.x,t.y,t.w,t.h)}function s0(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 Zc extends Gi{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}=IU(this),s=_U(o.radius)?Ud:DU;t.save(),(o.w!==a.w||o.h!==a.h)&&(t.beginPath(),s(t,s0(o,n,a)),t.clip(),s(t,s0(a,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,s0(a,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return o0(this,t,n,r)}inXRange(t,n){return o0(this,t,null,n)}inYRange(t,n){return o0(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}}xe(Zc,"id","bar"),xe(Zc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),xe(Zc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function AU(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=t1(l,u,i);const c=Gg(n,i[l],i[u],s.loop);if(!t.segments){o.push({source:s,target:c,start:i[l],end:i[u]});continue}const d=F5(t,c);for(const h of d){const f=Gg(n,a[h.start],a[h.end],h.loop),g=P5(s,i,f);for(const p of g)o.push({source:p,target:h,start:{[n]:sx(c,f,"start",Math.max)},end:{[n]:sx(c,f,"end",Math.min)}})}}return o}function Gg(e,t,n,r){if(r)return;let i=t[e],a=n[e];return e==="angle"&&(i=Zr(i),a=Zr(a)),{property:e,start:i,end:a}}function TU(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,a=[];return t.segments.forEach(({start:o,end:s})=>{s=t1(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 t1(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function sx(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function J5(e,t){let n=[],r=!1;return Yt(e)?(r=!0,n=e):n=TU(e,t),n.length?new oi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function lx(e){return e&&e.fill!==!1}function RU(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(!wn(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;a.push(i),i=o.fill}return!1}function BU(e,t,n){const r=FU(e);if(qe(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return wn(i)&&Math.floor(i)===i?$U(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function $U(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function kU(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:qe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function PU(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:qe(e)?r=e.value:r=t.getBaseValue(),r}function FU(e){const t=e.options,n=t.fill;let r=Ue(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function NU(e){const{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=MU(t,n);s.push(J5({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++)LU(i,o[c],s)}return new oi({points:i,options:{}})}function MU(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 LU(e,t,n){const r=[];for(let i=0;i<n.length;i++){const a=n[i],{first:o,last:s,point:l}=OU(a,t,"x");if(!(!l||o&&s)){if(o)r.unshift(l);else if(e.push(l),!s)break}}e.push(...r)}function OU(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],d=o[c.start][n],h=o[c.end][n];if(Li(i,d,h)){s=i===d,l=i===h;break}}return{first:s,last:l,point:r}}class q5{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:kt},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 VU(e){const{chart:t,fill:n,line:r}=e;if(wn(n))return HU(t,n);if(n==="stack")return NU(e);if(n==="shape")return!0;const i=jU(e);return i instanceof q5?i:J5(i,r)}function HU(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function jU(e){return(e.scale||{}).getPointPositionForValue?zU(e):WU(e)}function WU(e){const{scale:t={},fill:n}=e,r=kU(n,t);if(wn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function zU(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,o=PU(n,t,a),s=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new q5({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 l0(e,t,n){const r=VU(t),{line:i,scale:a,axis:o}=t,s=i.options,l=s.fill,u=s.backgroundColor,{above:c=u,below:d=u}=l||{};r&&i.points.length&&(Vf(e,n),GU(e,{line:i,target:r,above:c,below:d,area:n,scale:a,axis:o}),Hf(e))}function GU(e,t){const{line:n,target:r,above:i,below:a,area:o,scale:s}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&a!==i&&(ux(e,r,o.top),cx(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore(),e.save(),ux(e,r,o.bottom)),cx(e,{line:n,target:r,color:a,scale:s,property:l}),e.restore()}function ux(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],d=i[t1(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(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function cx(e,t){const{line:n,target:r,property:i,color:a,scale:o}=t,s=AU(n,r,i);for(const{source:l,target:u,start:c,end:d}of s){const{style:{backgroundColor:h=a}={}}=l,f=r!==!0;e.save(),e.fillStyle=h,UU(e,o,f&&Gg(i,c,d)),e.beginPath();const g=!!n.pathSegment(e,l);let p;if(f){g?e.closePath():dx(e,r,d,i);const m=!!r.pathSegment(e,u,{move:g,reverse:!0});p=g&&m,p||dx(e,r,c,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function UU(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:a,start:o,end:s}=n||{};a==="x"&&(e.beginPath(),e.rect(o,r,s-o,i-r),e.clip())}function dx(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var Q5={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 oi&&(l={visible:e.isDatasetVisible(o),index:o,fill:BU(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=RU(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&&l0(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;lx(a)&&l0(e.ctx,a,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!lx(r)||n.drawTime!=="beforeDatasetDraw"||l0(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fx=(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)}},XU=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class hx extends Gi{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=St(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=Sn(r.font),a=i.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=fx(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 d=t;a.textAlign="left",a.textBaseline="middle";let h=-1,f=-c;return this.legendItems.forEach((g,p)=>{const m=r+n/2+a.measureText(g.text).width;(p===0||u[u.length-1]+m+2*s>o)&&(d+=c,u[u.length-(p>0?0:1)]=0,f+=c,h++),l[p]={left:0,top:f,row:h,width:m,height:i},u[u.length-1]+=m+s}),d}_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 d=s,h=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:v,itemHeight:x}=ZU(r,n,a,m,i);b>0&&f+x+2*s>c&&(d+=h+s,u.push({width:h,height:f}),g+=h+s,p++,h=f=0),l[b]={left:g,top:f,col:p,width:v,height:x},h=Math.max(h,v),f+=x+s}),d+=h,u.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:a}}=this,o=cs(a,this.left,this.width);if(this.isHorizontal()){let s=0,l=bn(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=bn(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=bn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=bn(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;Vf(t,this),this._draw(),Hf(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:a,labels:o}=t,s=Ht.color,l=cs(t.rtl,this.left,this.width),u=Sn(o.font),{padding:c}=o,d=u.size,h=d/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=fx(o,d),b=function(w,B,y){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;i.save();const S=Ue(y.lineWidth,1);if(i.fillStyle=Ue(y.fillStyle,s),i.lineCap=Ue(y.lineCap,"butt"),i.lineDashOffset=Ue(y.lineDashOffset,0),i.lineJoin=Ue(y.lineJoin,"miter"),i.lineWidth=S,i.strokeStyle=Ue(y.strokeStyle,s),i.setLineDash(Ue(y.lineDash,[])),o.usePointStyle){const D={radius:p*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:S},A=l.xPlus(w,g/2),T=B+h;w5(i,D,A,T,o.pointStyleWidth&&g)}else{const D=B+Math.max((d-p)/2,0),A=l.leftForLtr(w,g),T=us(y.borderRadius);i.beginPath(),Object.values(T).some(F=>F!==0)?Ud(i,{x:A,y:D,w:g,h:p,radius:T}):i.rect(A,D,g,p),i.fill(),S!==0&&i.stroke()}i.restore()},v=function(w,B,y){su(i,y.text,w,B+m/2,u,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},x=this.isHorizontal(),C=this._computeTitleHeight();x?f={x:bn(a,this.left+c,this.right-r[0]),y:this.top+c+C,line:0}:f={x:this.left+c,y:bn(a,this.top+C+c,this.bottom-n[0].height),line:0},B5(this.ctx,t.textDirection);const E=m+c;this.legendItems.forEach((w,B)=>{i.strokeStyle=w.fontColor,i.fillStyle=w.fontColor;const y=i.measureText(w.text).width,S=l.textAlign(w.textAlign||(w.textAlign=o.textAlign)),D=g+h+y;let A=f.x,T=f.y;l.setWidth(this.width),x?B>0&&A+D+c>this.right&&(T=f.y+=E,f.line++,A=f.x=bn(a,this.left+c,this.right-r[f.line])):B>0&&T+E>this.bottom&&(A=f.x=A+n[f.line].width+c,f.line++,T=f.y=bn(a,this.top+C+c,this.bottom-n[f.line].height));const F=l.x(A);if(b(F,T,w),A=_W(S,A+g+h,x?A+D:this.right,t.rtl),v(l.x(A),T,w),x)f.x+=D+c;else if(typeof w.text!="string"){const k=u.lineHeight;f.y+=eI(w,k)+c}else f.y+=E}),$5(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Sn(n.font),i=Sr(n.padding);if(!n.display)return;const a=cs(t.rtl,this.left,this.width),o=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,d=bn(t.align,d,this.right-h);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);c=u+bn(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=bn(s,d,d+h);o.textAlign=a.textAlign(Gm(s)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,su(o,n.text,f,c,r)}_computeTitleHeight(){const t=this.options.title,n=Sn(t.font),r=Sr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,a;if(Li(t,this.left,this.right)&&Li(n,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],Li(t,i.left,i.left+i.width)&&Li(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!JU(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=XU(i,r);i&&!a&&St(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&St(n.onHover,[t,r,this],this)}else r&&St(n.onClick,[t,r,this],this)}}function ZU(e,t,n,r,i){const a=YU(r,e,t,n),o=KU(i,r,t.lineHeight);return{itemWidth:a,itemHeight:o}}function YU(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 KU(e,t,n){let r=e;return typeof t.text!="string"&&(r=eI(t,n)),r}function eI(e,t){const n=e.text?e.text.length:0;return t*n}function JU(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var tI={id:"legend",_element:hx,start(e,t,n){const r=e.legend=new hx({ctx:e.ctx,options:n,chart:e});Cr.configure(e,r,n),Cr.addBox(e,r)},stop(e){Cr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Cr.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=Sr(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 nI extends Gi{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=Yt(r.text)?r.text.length:1;this._padding=Sr(r.padding);const a=i*Sn(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,d;return this.isHorizontal()?(c=bn(s,r,a),d=n+t,u=a-r):(o.position==="left"?(c=r+t,d=bn(s,i,n),l=Ot*-.5):(c=a-t,d=bn(s,n,i),l=Ot*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Sn(n.font),a=r.lineHeight/2+this._padding.top,{titleX:o,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(a);su(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Gm(n.align),textBaseline:"middle",translation:[o,s]})}}function qU(e,t){const n=new nI({ctx:e.ctx,options:t,chart:e});Cr.configure(e,n,t),Cr.addBox(e,n),e.titleBlock=n}var rI={id:"title",_element:nI,start(e,t,n){qU(e,n)},stop(e){const t=e.titleBlock;Cr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Cr.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 ul={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{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=Og(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 Hr(e,t){return t&&(Yt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function _i(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
175
175
  `)>-1?e.split(`
176
176
  `):e}function QU(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 gx(e,t){const n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,l=Sn(t.bodyFont),u=Sn(t.titleFont),c=Sn(t.footerFont),d=a.length,h=i.length,f=r.length,g=Sr(t.padding);let p=g.height,m=0,b=r.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(p+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const C=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;p+=f*C+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}h&&(p+=t.footerMarginTop+h*c.lineHeight+(h-1)*t.footerSpacing);let v=0;const x=function(C){m=Math.max(m,n.measureText(C).width+v)};return n.save(),n.font=u.string,pt(e.title,x),n.font=l.string,pt(e.beforeBody.concat(e.afterBody),x),v=t.displayColors?o+2+t.boxPadding:0,pt(r,C=>{pt(C.before,x),pt(C.lines,x),pt(C.after,x)}),v=0,n.font=c.string,pt(e.footer,x),n.restore(),m+=g.width,{width:m,height:p}}function eX(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function tX(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 nX(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"),tX(u,e,t,n)&&(u="center"),u}function px(e,t,n){const r=n.yAlign||t.yAlign||eX(e,n);return{xAlign:n.xAlign||t.xAlign||nX(e,t,n,r),yAlign:r}}function rX(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function iX(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function mx(e,t,n,r){const{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:l}=n,u=i+a,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=us(o);let g=rX(t,s);const p=iX(t,l,u);return l==="center"?s==="left"?g+=u:s==="right"&&(g-=u):s==="left"?g-=Math.max(c,h)+i:s==="right"&&(g+=Math.max(d,f)+i),{x:En(g,0,r.width-t.width),y:En(p,0,r.height-t.height)}}function Ec(e,t,n){const r=Sr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function bx(e){return Hr([],_i(e))}function aX(e,t,n){return Ao(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function vx(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const iI={beforeTitle:Si,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:Si,beforeBody:Si,beforeLabel:Si,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:Si,afterBody:Si,beforeFooter:Si,footer:Si,afterFooter:Si};function kn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?iI[t].call(n,r):i}var y0;let yx=(y0=class extends Gi{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 N5(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=aX(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=kn(r,"beforeTitle",this,t),a=kn(r,"title",this,t),o=kn(r,"afterTitle",this,t);let s=[];return s=Hr(s,_i(i)),s=Hr(s,_i(a)),s=Hr(s,_i(o)),s}getBeforeBody(t,n){return bx(kn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return pt(t,a=>{const o={before:[],lines:[],after:[]},s=vx(r,a);Hr(o.before,_i(kn(s,"beforeLabel",this,a))),Hr(o.lines,kn(s,"label",this,a)),Hr(o.after,_i(kn(s,"afterLabel",this,a))),i.push(o)}),i}getAfterBody(t,n){return bx(kn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=kn(r,"beforeFooter",this,t),a=kn(r,"footer",this,t),o=kn(r,"afterFooter",this,t);let s=[];return s=Hr(s,_i(i)),s=Hr(s,_i(a)),s=Hr(s,_i(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(QU(this.chart,n[l]));return t.filter&&(s=s.filter((c,d,h)=>t.filter(c,d,h,r))),t.itemSort&&(s=s.sort((c,d)=>t.itemSort(c,d,r))),pt(s,c=>{const d=vx(t.callbacks,c);i.push(kn(d,"labelColor",this,c)),a.push(kn(d,"labelPointStyle",this,c)),o.push(kn(d,"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=ul[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=gx(this,r),u=Object.assign({},s,l),c=px(this.chart,r,u),d=mx(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,a={opacity:1,x:d.x,y:d.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:d}=us(s),{x:h,y:f}=t,{width:g,height:p}=n;let m,b,v,x,C,E;return a==="center"?(C=f+p/2,i==="left"?(m=h,b=m-o,x=C+o,E=C-o):(m=h+g,b=m+o,x=C-o,E=C+o),v=m):(i==="left"?b=h+Math.max(l,c)+o:i==="right"?b=h+g-Math.max(u,d)-o:b=this.caretX,a==="top"?(x=f,C=x-o,m=b-o,v=b+o):(x=f+p,C=x+o,m=b+o,v=b-o),E=x),{x1:m,x2:b,x3:v,y1:x,y2:C,y3:E}}drawTitle(t,n,r){const i=this.title,a=i.length;let o,s,l;if(a){const u=cs(r.rtl,this.x,this.width);for(t.x=Ec(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=Sn(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=Sn(a.bodyFont),d=Ec(this,"left",a),h=i.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,g=n.y+f;if(a.usePointStyle){const p={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},m=i.leftForLtr(h,u)+u/2,b=g+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,Hg(t,p,m,b),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Hg(t,p,m,b)}else{t.lineWidth=qe(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 p=i.leftForLtr(h,u),m=i.leftForLtr(i.xPlus(h,1),u-2),b=us(o.borderRadius);Object.values(b).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Ud(t,{x:p,y:g,w:u,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ud(t,{x:m,y:g+1,w:u-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(p,g,u,l),t.strokeRect(p,g,u,l),t.fillStyle=o.backgroundColor,t.fillRect(m,g+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,d=Sn(r.bodyFont);let h=d.lineHeight,f=0;const g=cs(r.rtl,this.x,this.width),p=function(y){n.fillText(y,g.x(t.x+f),t.y+h/2),t.y+=h+a},m=g.textAlign(o);let b,v,x,C,E,w,B;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=Ec(this,m,r),n.fillStyle=r.bodyColor,pt(this.beforeBody,p),f=s&&m!=="right"?o==="center"?u/2+c:u+2+c:0,C=0,w=i.length;C<w;++C){for(b=i[C],v=this.labelTextColors[C],n.fillStyle=v,pt(b.before,p),x=b.lines,s&&x.length&&(this._drawColorBox(n,t,C,g,r),h=Math.max(d.lineHeight,l)),E=0,B=x.length;E<B;++E)p(x[E]),h=d.lineHeight;pt(b.after,p)}f=0,h=d.lineHeight,pt(this.afterBody,p),t.y-=a}drawFooter(t,n,r){const i=this.footer,a=i.length;let o,s;if(a){const l=cs(r.rtl,this.x,this.width);for(t.x=Ec(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Sn(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:d,topRight:h,bottomLeft:f,bottomRight:g}=us(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,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-g),n.quadraticCurveTo(s+u,l+c,s+u-g,l+c),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+f,l+c),n.quadraticCurveTo(s,l+c,s,l+c-f),o==="center"&&a==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,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=ul[t.position].call(this,this._active,this._eventPosition);if(!o)return;const s=this._size=gx(this,t),l=Object.assign({},o,this._size),u=px(n,t,l),c=mx(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=Sr(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),B5(t,n.textDirection),a.y+=o.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),$5(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=!Wd(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||!Wd(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=ul[a.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}},xe(y0,"positioners",ul),y0);var uu={id:"tooltip",_element:yx,positioners:ul,afterInit(e,t,n){n&&(e.tooltip=new yx({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:iI},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 oX=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function sX(e,t,n,r){const i=e.indexOf(t);if(i===-1)return oX(e,t,n,r);const a=e.lastIndexOf(t);return i!==a?n:i}const lX=(e,t)=>e===null?null:En(Math.round(e),0,t);function xx(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Is extends Ns{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:sX(r,t,Ue(n,t),this._addedLabels),lX(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 xx.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}}xe(Is,"id","category"),xe(Is,"defaults",{ticks:{callback:xx}});function uX(e,t){const n=[],{bounds:i,step:a,min:o,max:s,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:h}=e,f=a||1,g=c-1,{min:p,max:m}=t,b=!Et(o),v=!Et(s),x=!Et(u),C=(m-p)/(d+1);let E=py((m-p)/g/f)*f,w,B,y,S;if(E<1e-14&&!b&&!v)return[{value:p},{value:m}];S=Math.ceil(m/E)-Math.floor(p/E),S>g&&(E=py(S*E/g/f)*f),Et(l)||(w=Math.pow(10,l),E=Math.ceil(E*w)/w),i==="ticks"?(B=Math.floor(p/E)*E,y=Math.ceil(m/E)*E):(B=p,y=m),b&&v&&a&&bW((s-o)/a,E/1e3)?(S=Math.round(Math.min((s-o)/E,c)),E=(s-o)/S,B=o,y=s):x?(B=b?o:B,y=v?s:y,S=u-1,E=(y-B)/S):(S=(y-B)/E,Cl(S,Math.round(S),E/1e3)?S=Math.round(S):S=Math.ceil(S));const D=Math.max(my(E),my(B));w=Math.pow(10,Et(l)?D:l),B=Math.round(B*w)/w,y=Math.round(y*w)/w;let A=0;for(b&&(h&&B!==o?(n.push({value:o}),B<o&&A++,Cl(Math.round((B+A*E)*w)/w,o,Cx(o,C,e))&&A++):B<o&&A++);A<S;++A){const T=Math.round((B+A*E)*w)/w;if(v&&T>s)break;n.push({value:T})}return v&&h&&y!==s?n.length&&Cl(n[n.length-1].value,s,Cx(s,C,e))?n[n.length-1].value=s:n.push({value:s}):(!v||y===s)&&n.push({value:y}),n}function Cx(e,t,{horizontal:n,minRotation:r}){const i=Mi(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/a,o)}class cX extends Ns{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=ci(i),u=ci(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=uX(i,a);return t.bounds==="ticks"&&vW(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 Xm(t,this.chart.options.locale,this.options.ticks.format)}}class _s extends cX{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=wn(t)?t:0,this.max=wn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Mi(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}}xe(_s,"id","linear"),xe(_s,"defaults",{ticks:{callback:S5.formatters.numeric}});const zf={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}},On=Object.keys(zf);function Ex(e,t){return e-t}function Sx(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)),wn(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(iu(a)||a===!0)?n.startOf(o,"isoWeek",a):n.startOf(o,i)),+o)}function wx(e,t,n,r){const i=On.length;for(let a=On.indexOf(e);a<i-1;++a){const o=zf[On[a]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(s*o.size))<=r)return On[a]}return On[i-1]}function dX(e,t,n,r,i){for(let a=On.length-1;a>=On.indexOf(n);a--){const o=On[a];if(zf[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return On[n?On.indexOf(n):0]}function fX(e){for(let t=On.indexOf(e)+1,n=On.length;t<n;++t)if(zf[On[t]].common)return On[t]}function Ix(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=zm(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function hX(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 _x(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:hX(e,r,i,n)}class Kd extends Ns{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 Qz._date(t.adapters.date);i.init(n),xl(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:Sx(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=wn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),a=wn(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=SW(i,a,o);return this._unit=n.unit||(r.autoSkip?wx(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):dX(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:fX(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),_x(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=En(n,0,o),r=En(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||wx(a.minUnit,n,r,this._getLabelCapacity(n)),s=Ue(i.ticks.stepSize,1),l=o==="week"?a.isoWeekday:!1,u=iu(l)||l===!0,c={};let d=n,h,f;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,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 g=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<r;h=+t.add(h,s,o),f++)Ix(c,h,g);return(h===r||i.bounds==="ticks"||f===1)&&Ix(c,h,g),Object.keys(c).sort(Ex).map(p=>+p)}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 St(o,[t,n,r],this);const s=a.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],d=u&&s[u],h=r[n],f=u&&d&&h&&h.major;return this._adapter.format(t,i||(f?d: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=Mi(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,_x(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(Sx(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return x5(t.sort(Ex))}}xe(Kd,"id","time"),xe(Kd,"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 Sc(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}=ro(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}=ro(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 Dx extends Kd{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=Sc(n,this.min),this._tableRange=Sc(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(Sc(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Sc(this._table,r*this._tableRange+this._minPos,!0)}}xe(Dx,"id","timeseries"),xe(Dx,"defaults",Kd.defaults);const aI="label";function Ax(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function gX(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function oI(e,t){e.labels=t}function sI(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:aI;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 pX(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:aI;const n={labels:[],datasets:[]};return oI(n,e.labels),sI(n,e.datasets,t),n}function mX(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:d,...h}=e,f=I.useRef(null),g=I.useRef(),p=()=>{f.current&&(g.current=new To(f.current,{type:o,data:pX(s,a),options:l&&{...l},plugins:u}),Ax(t,g.current))},m=()=>{Ax(t,null),g.current&&(g.current.destroy(),g.current=null)};return I.useEffect(()=>{!i&&g.current&&l&&gX(g.current,l)},[i,l]),I.useEffect(()=>{!i&&g.current&&oI(g.current.config.data,s.labels)},[i,s.labels]),I.useEffect(()=>{!i&&g.current&&s.datasets&&sI(g.current.config.data,s.datasets,a)},[i,s.datasets]),I.useEffect(()=>{g.current&&(i?(m(),setTimeout(p)):g.current.update(d))},[i,l,s.labels,s.datasets,d]),I.useEffect(()=>{g.current&&(m(),setTimeout(p))},[o]),I.useEffect(()=>(p(),()=>m()),[]),I.createElement("canvas",Object.assign({ref:f,role:"img",height:n,width:r},h),c)}const bX=I.forwardRef(mX);function n1(e,t){return To.register(t),I.forwardRef((n,r)=>I.createElement(bX,Object.assign({},n,{ref:r,type:e})))}const lI=n1("line",Gc),vX=n1("bar",zc),Tx=n1("doughnut",ol);To.register(Is,_s,fo,oi,ll,rI,uu,tI);const Rx=(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 A;const C=[].concat(t),E=C.length,w=u.font;let B=0,y=0,S;for(S=0;S<E;++S)u.font=C[S].font,B=Math.max(u.measureText(C[S].text).width,B),y+=(A=C[S].font)==null?void 0:A.lineHeight;return u.font=w,{height:y,width:B}},d=(C,E)=>{let w=document.createElement("div");document.body.appendChild(w),w.style.fontSize=`${E}px`,w.style.position="absolute",w.style.left="-10",w.style.top="-10",w.textContent=C;const B={width:w.clientWidth,height:w.clientHeight};return document.body.removeChild(w),w=null,B},h=c(),f=parseFloat(parseFloat(l).toFixed(2));u.textAlign="center",u.textBaseline="middle";const g=(e.chartArea.left+e.chartArea.right)/2,m=(e.chartArea.top+e.chartArea.bottom)/2-h.height/2;let b;const v=t.length;let x=0;for(b=0;b<v;++b){let C=(i=t[b].font)==null?void 0:i.size,E=(a=t[b].font)==null?void 0:a.lineHeight;const w=typeof t[b].text=="number"?t[b].text.toString():t[b].text;for(;d(w,C).width>f+(t[b].id==="value"?50:0);)C-=1,E=d(w,C).height;w.length>22&&E<14&&(E=18);const B=m+E/2+x,y=typeof t[b].text=="number"?new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(t[b].text):t[b].text;let S=t[b].urlIconDesc?" ":"";if(t[b].percentage!==void 0?S+=`${t[b].percentage}% ${t[b].text}`:S+=y,u.fillStyle=t[b].color,u.font=`${C<10?10:C}px sans-serif`,x+=E,t[b].percentage!==void 0&&t[b].urlIconDesc){const D=((s=(o=t[b])==null?void 0:o.percentage)==null?void 0:s.length)??0,A=new Image;A.src=t[b].urlIconDesc,u.drawImage(A,45-(D>6?D+2:D-2.5),B-8,16,14)}u.fillText(S,g,B)}u.restore(),u.save()}},yX=({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:d="backgroundColor",className:h})=>{const f={labels:e||t.map(p=>p[u]),datasets:[{data:t.map(p=>p[c]),backgroundColor:n||t.map(p=>p[d])}]},g={cutout:a,animation:{duration:i?400:0},plugins:{legend:{display:!1},tooltip:{external(p){let m=document.getElementById("chartjs-tooltip");m||(m=document.createElement("div"),m.id="chartjs-tooltip",m.innerHTML="<table></table>",document.body.appendChild(m));const b=p.tooltip;if(b.opacity===0){m.style.opacity="0";return}m.classList.remove("above","below","no-transform"),b.yAlign?m.classList.add(b.yAlign):m.classList.add("no-transform");const v=t.filter(B=>!B[u]),x=t.filter(B=>B[c]>0&&B[c]<1);if(v.length===1&&x.length===1)return;function C(B){return B.lines}if(b.body){const B=b.title||[];let y=b.body.map(C),S="<thead>";B.forEach(A=>{let T="";T+="display: flex",T+="; justify-content: center",T+="; font-weight: 600",T+="; font-size: 12px",T+="; padding: 0px 14px",S+=`<tr><span style="${T}">${A}</span></tr>`}),S+="</thead><tbody>",y.length>1&&y[0][0]===y[1][0]&&(y=[y[0]]),y.forEach(A=>{let T="";T+="display: flex",T+="; justify-content: center",T+="; color: #0163C8",T+="; padding: 0px 14px",T+="; font-size: 12px";const F=`<span style="${T}">${A}</span>`;S+=`<tr><td>${F}</td></tr>`}),S+="</tbody>";const D=m.querySelector("table");D&&(D.innerHTML=S)}const E=p.chart.canvas.getBoundingClientRect(),w=E.top+window.pageYOffset+b.caretY;m.style.opacity="1",m.style.border="solid 1px #0163C8",m.style.background="white",m.style.height="fit-content",m.style.borderRadius="10px",m.style.position="absolute",m.style.zIndex="10",m.style.padding="4px 0",m.style.left=`${E.left+window.pageXOffset+b.caretX-80}px`,m.style.top=`${w>300&&!s?280:w}px`,m.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title(p){const m=t[p[0].dataIndex];return m==null?void 0:m[u]},label(p){const m=t==null?void 0:t[p.dataIndex];let b="Nilai: ";return m&&(b+=m.value),b}}}},elements:{arc:{borderWidth:0}}};return _.jsxs("div",{className:h??"",children:[!s&&_.jsx(Tx,{data:f,redraw:i,plugins:[{id:"draw",beforeDraw(p){Rx(p,o)}}],options:Object.keys(r).length>1?r:g}),s&&_.jsx(Tx,{data:f,redraw:i,plugins:[{id:"draw",beforeDraw(p){Rx(p,o.filter(m=>m.id!==l))}}],options:Object.keys(r).length>1?r:g})]})},wc=e=>{let t;const n=new Date(e??new Date);return e&&(t=Cm(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),t},xX=({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:d="date-picker-popover",floatingOptions:h={},offsetPopover:f=5,zIndexPopper:g=1,hiddenHeader:p})=>{const{locale:m}=Mr(),b=I.useRef(null),v=wc(i),x=wc(a),C=E=>{var w;typeof l=="function"&&(l({month:E.month,year:E.year}),(w=b.current)==null||w.setShow(!1))};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:c,onClick:E=>{var w;E.stopPropagation(),(w=b.current)==null||w.handlerShow(E)},className:s,children:typeof u=="function"?u({month:e,year:t}):"Pilih Tanggal"}),_.jsx("div",{className:o??"",children:_.jsx(pi,{zIndex:g,ref:b,offset:f,id:d,floatingOptions:{placement:"bottom-end",...h},onClick:E=>E.stopPropagation(),children:_.jsx(Fm,{locale:"id-ID",children:_.jsx(Mf,{minValue:v,maxValue:x,minDate:i,maxDate:a,activeType:n.length===1?n[0]:r,locale:m,value:wc(`${t}/${e}/1`),createCalendar:_u,defaultValue:wc(`${t}/${e}/1`),onChange:C,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:n,hiddenHeader:p})})})})]})},CX=({indeterminate:e,className:t="",classNameContainer:n,...r})=>{const i=I.useRef(null);return I.useEffect(()=>{typeof e=="boolean"&&(i.current.indeterminate=!r.checked&&e)},[i,e]),_.jsx("div",{className:`1ru-flex 1ru-items-center 1ru-h-full ${t??""}`,children:_.jsx(Lf,{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"})})},EX="_input_orgbf_253",SX="_error_orgbf_513",fr={"container-l":"_container-l_orgbf_253","container-input":"_container-input_orgbf_253",input:EX,"container-s":"_container-s_orgbf_271","container-xs":"_container-xs_orgbf_289","label-error":"_label-error_orgbf_307",error:SX,"isset-right-icon":"_isset-right-icon_orgbf_522","isset-left-icon":"_isset-left-icon_orgbf_526","start-icon":"_start-icon_orgbf_530","end-icon":"_end-icon_orgbf_537"},wX={size:{l:fr["container-l"],s:fr["container-s"],xs:fr["container-xs"]}},r1=I.forwardRef(({name:e,classNameContainer:t,id:n,type:r="text",startIcon:i,endIcon:a,error:o,sizeInput:s="xs",classNameLabelError:l,className:u,...c},d)=>{const h=()=>typeof i=="function"||I.isValidElement(i),f=()=>typeof a=="function"||I.isValidElement(a);return _.jsxs("div",{className:`${wX.size[s]} ${t}`,children:[_.jsxs("div",{className:`${fr["container-input"]}`,children:[_.jsxs("div",{className:fr["start-icon"],children:[typeof i=="function"&&i(),I.isValidElement(i)&&i]}),_.jsx("input",{id:n??e,className:`${fr.input} ${o?fr.error:""}
177
177
  ${h()?fr["isset-left-icon"]:""}
@@ -189,7 +189,7 @@ You should wrap it with \`css\` like this:
189
189
  ${(d.step??f)<=e?Gr.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:d.desc})]},h)})});To.register(Is,_s,fo,oi,rI,uu,tI);const VX=(e,t,n)=>{const r=e,i=t||new Date().getMonth(),a=n||new Date().getFullYear();return new Date(`${i}/${r}/${a}`)},HX=({data:e,className:t,height:n=65})=>{const r=I.useRef(null),i=e.map(h=>wl(VX(1,h.label,h.year),"MMM yy",{locale:Kc}))||[],[a,o]=I.useState(""),[s,l]=I.useState(""),u=h=>{const f=[],g=[];let p=!h.find(m=>m.isCurrent);return h.forEach(m=>{p?(g.push(m.value),f.push(null)):(f.push(m.value),m.isCurrent?(p=!0,g.push(m.value)):g.push(null))}),{passed:f,notPassed:g}},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 f=e[h.dataIndex];let g=s;return f.isCurrent&&(g="#ED0019"),g},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||[]}]},d={interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1,labels:{usePointStyle:!0}},tooltip:{external:function(h){let f=document.getElementById("chartjs-tooltip");f||(f=document.createElement("div"),f.id="chartjs-tooltip",f.innerHTML="<table></table>",document.body.appendChild(f));const g=h.tooltip;if(g.opacity===0){f.style.opacity="0";return}f.classList.remove("above","below","no-transform"),g.yAlign?f.classList.add(g.yAlign):f.classList.add("no-transform");function p(b){return b.lines}if(g.body){const b=g.title||[];let v=g.body.map(p),x="<thead>";b.forEach(E=>{let w="";w+="display: flex",w+="; justify-content: center",w+="; font-weight: 600",w+="; font-size: 12px",w+="; padding: 0px 14px",x+=`<tr><span style="${w}">${E}</span></tr>`}),x+="</thead><tbody>",v.length>1&&v[0][0]===v[1][0]&&(v=[v[0]]),v.forEach(E=>{let w="";w+="display: flex",w+="; justify-content: center",w+="; color: #0163C8",w+="; padding: 0px 14px",w+="; font-size: 12px";const B=`<span style="${w}">${E}</span>`;x+=`<tr><td>${B}</td></tr>`}),x+="</tbody>";const C=f.querySelector("table");C&&(C.innerHTML=x)}const m=h.chart.canvas.getBoundingClientRect();f.style.opacity="1",f.style.border="solid 1px #0163C8",f.style.background="white",f.style.height="fit-content",f.style.borderRadius="10px",f.style.position="absolute",f.style.zIndex="10",f.style.padding="4px 0",f.style.left=m.left+window.pageXOffset+g.caretX-30+"px",f.style.top=m.top+window.pageYOffset+g.caretY-60+"px",f.style.pointerEvents="none"},displayColors:!0,enabled:!1,callbacks:{title:function(h){const f=e[h[0].dataIndex];return wl(new Date(`1/${f.label}/${f.year}`),"MMMM yyyy",{locale:Kc})},label:function(h){let f=h.dataset.label??"";return f&&(f+=": "),h.parsed.y!==null&&(f+=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(h.parsed.y)),f}}}},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 df(h)??0}}}}};return I.useEffect(()=>{if(r.current){const h=r.current.getContext("2d"),f=h==null?void 0:h.createLinearGradient(0,100,500,-500);f==null||f.addColorStop(0,"rgba(237, 0, 25, 0)"),f==null||f.addColorStop(1,"rgba(237, 0, 25, 20)");const g=h.fillStyle="rgba(255, 255, 255, 0)";l(g),o(f)}},[]),_.jsxs("div",{className:t??"",children:[_.jsx(lI,{options:d,data:c,height:n}),_.jsx("div",{className:"1ru-h-5",children:_.jsx("canvas",{ref:r})})]})},jX="_container_ser71_289",kx={"container-popover":"_container-popover_ser71_289",container:jX},WX=({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:d,delay:h=600})=>{let f;const g=I.useRef(null),p={backgroundColor:a4[s]||s},[m,b]=I.useState(!1),[v,x]=I.useState(!1),C=w=>{var B;(B=g.current)==null||B.handlerShow(w),x(!0),typeof i=="function"&&i()},E=()=>{var w;x(!1),m||(clearInterval(f),(w=g.current)==null||w.setShow(!1),typeof a=="function"&&a())};return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:e,onMouseEnter:w=>{if(d&&!m){const B=w.currentTarget;f=setTimeout(()=>{C({...w,currentTarget:B})},h)}},onMouseLeave:()=>{d&&!m&&E()},onClick:w=>{b(!0),clearInterval(f),v||C(w)},className:kx.container,children:t}),_.jsx(pi,{floatingOptions:{placement:o},ref:g,id:"1ru-popover-tooltip",offset:10,withArrow:!0,zIndex:r,onClose:()=>{m&&(b(!1),E())},styleInnerPopover:{backgroundColor:p.backgroundColor},propsArrow:{fill:p.backgroundColor,...u},className:`${kx["container-popover"]} ${c??""}`,...l,children:n})]})},zX="_icon_zrudt_5",GX="_show_zrudt_10",c0={"container-popover":"_container-popover_zrudt_1",icon:zX,show:GX},cI=I.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:d="",placement:h="top-end",popoverProps:f,zIndexPopover:g=1,offset:p=5,idPopover:m="1ru-popover-button-popover",onClick:b,onClose:v,...x}=e,C=I.useRef(null),E=I.useRef(null),[w,B]=I.useState(!1),y=(T,F,k)=>{let P=_.jsx(_.Fragment,{});return T&&I.isValidElement(F)?P=F:I.isValidElement(k)&&(P=_.jsx("div",{className:`${c0.icon} ${T?c0.show:""}`,children:k})),P},S=T=>{var F;(F=C.current)==null||F.setShow(T),B(T)},D=T=>{var F;(F=C.current)==null||F.handlerShow(T),B(!0)},A=()=>{var T;B(!1),(T=C.current)==null||T.setShow(!1),typeof v=="function"&&v()};return I.useImperativeHandle(t,()=>({show:w,setShow:S,handlerClose:A,handlerShow:D}),[w]),_.jsxs(_.Fragment,{children:[_.jsx(jn,{ref:E,id:r,className:`${u} ${w?c:""}`,onClick:T=>{w?A():typeof b=="function"?b(T):D(T)},startIcon:y(w,s,a),endIcon:y(w,l,o),...x,children:i}),_.jsx(pi,{ref:C,id:m,offset:p,floatingOptions:{placement:h},zIndex:g,onClose:A,className:`${c0["container-popover"]} ${d}`,...f,children:n})]})});cI.displayName="ButtonPopover";To.register(Is,_s,fo,oi,Q5,uu);const UX=e=>({chart:t,tooltip:n})=>{var l,u,c,d,h,f;const r={};if(n.opacity===0){e(g=>({...g,style:{...g.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=((d=(c=n.dataPoints)==null?void 0:c[0])==null?void 0:d.raw)??"",s=((f=(h=n.dataPoints)==null?void 0:h[0])==null?void 0:f.dataset.label)??"";e({dataset:s,label:a,value:o,style:r,dataPoints:n.dataPoints})},XX={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())}},ZX={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}},YX=({data:e,height:t,classNameContainer:n,id:r,options:i,CustomTooltip:a})=>{const o=I.useRef(void 0),s=I.useRef(0),l=I.useRef(0),[u,c]=I.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),d=I.useCallback(function({ctx:p,chartArea:m,scales:b,chartHeight:v,gradientFor:x,item:C}){let B=(b.y.getPixelForValue(0)-m.top)/v;B=B<0?0:B>1?1:B,o.current=p.createLinearGradient(0,m.top,0,v+m.top),x==="background"?(o.current.addColorStop(0,(C==null?void 0:C.colorBackgroundPositiveZero)||"#9FD2FF"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),o.current.addColorStop(1,(C==null?void 0:C.colorBackgroundNegativeOne)||"#EB6B6B")):(o.current.addColorStop(B,(C==null?void 0:C.colorBorderPositive)||"#80CBC4"),o.current.addColorStop(B,(C==null?void 0:C.colorBorderNegative)||"#EB6B6B"))},[]),h=I.useCallback(function({ctx:p,chartArea:m,scales:b,gradientFor:v,item:x}){const C=m.right-m.left,E=m.bottom-m.top;return(!o.current||s.current!==C||l.current!==E)&&(s.current=C,l.current=E,d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x})),d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x}),o.current},[]),f=I.useMemo(()=>({...e,datasets:e.datasets.map(m=>({fill:!0,backgroundColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"background",item:m})},borderColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"border",item:m})},borderWidth:3,tension:0,pointRadius:0,pointHoverRadius:4,...m,data:m.data}))}),[e]),g=I.useMemo(()=>_l(ZX,{plugins:{tooltip:{enabled:!a,external:({chart:m,tooltip:b})=>a?UX(c)({chart:m,tooltip:b}):void 0}}},i??{}),[i,a]);return _.jsxs("div",{id:r,className:n,style:{height:t||"300px"},children:[a&&_.jsx(Om,{selector:"body",children:_.jsx(a,{...u})}),_.jsx(lI,{data:f,options:g,plugins:[XX]})]})};To.register(Is,_s,Zc,uu,fo,Q5,uu);const KX=e=>({chart:t,tooltip:n})=>{var l,u,c,d,h,f;const r={};if(n.opacity===0){e(g=>({...g,style:{...g.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=((d=(c=n.dataPoints)==null?void 0:c[0])==null?void 0:d.raw)??"",s=((f=(h=n.dataPoints)==null?void 0:h[0])==null?void 0:f.dataset.label)??"";e({dataset:s,label:a,value:o,style:r,dataPoints:n.dataPoints})},JX={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?df(String(u)):String(u);t.font="12px Lato",t.textAlign="center";let d,h=!1;typeof u=="number"&&u>=0?(t.textBaseline="bottom",t.fillStyle=(i==null?void 0:i.colorTextLabelPositive)||s.options.borderColor,d=s.y-5,d>n&&(h=!0)):(t.textBaseline="top",t.fillStyle=(i==null?void 0:i.colorTextLabelNegative)||s.options.borderColor,d=s.y+5,d<r&&(h=!0)),h&&t.fillText(c,s.x,d)})}),t.restore()}},qX={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 df(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}},QX=({data:e,classNameContainer:t,height:n,id:r,options:i,CustomTooltip:a})=>{const o=I.useRef(void 0),s=I.useRef(0),l=I.useRef(0),[u,c]=I.useState({dataset:"",label:"",value:0,style:{opacity:0,position:"absolute",left:0,bottom:0},dataPoints:[]}),d=I.useCallback(function({ctx:p,chartArea:m,scales:b,chartHeight:v,gradientFor:x,item:C}){let B=(b.y.getPixelForValue(0)-m.top)/v;B=B<0?0:B>1?1:B,o.current=p.createLinearGradient(0,m.top,0,v+m.top),x==="background"?(o.current.addColorStop(0,(C==null?void 0:C.colorBackgroundPositiveZero)||"#9FD2FF"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundPositivePercentage)||"rgba(115, 235, 163, 0.1)"),o.current.addColorStop(B,(C==null?void 0:C.colorBackgroundNegativePercentage)||"rgba(235, 107, 107, 0.1)"),o.current.addColorStop(1,(C==null?void 0:C.colorBackgroundNegativeOne)||"#EB6B6B")):(o.current.addColorStop(B,(C==null?void 0:C.colorBorderPositive)||"#80CBC4"),o.current.addColorStop(B,(C==null?void 0:C.colorBorderNegative)||"#EB6B6B"))},[]),h=I.useCallback(function({ctx:p,chartArea:m,scales:b,gradientFor:v,item:x}){const C=m.right-m.left,E=m.bottom-m.top;return(!o.current||s.current!==C||l.current!==E)&&(s.current=C,l.current=E,d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x})),d({ctx:p,chartArea:m,scales:b,chartHeight:E,gradientFor:v,item:x}),o.current},[]),f=I.useMemo(()=>({...e,datasets:e.datasets.map(m=>({fill:!0,backgroundColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"background",item:m})},borderColor:function(b){const v=b.chart,{ctx:x,chartArea:C,scales:E}=v;if(C)return h({ctx:x,chartArea:C,scales:E,gradientFor:"border",item:m})},borderWidth:0,tension:0,pointRadius:0,pointHoverRadius:4,setDigit:!0,...m,data:m.data}))}),[e]),g=I.useMemo(()=>_l(qX,{plugins:{tooltip:{enabled:!a,external:({chart:m,tooltip:b})=>a?KX(c)({chart:m,tooltip:b}):void 0}}},i??{}),[i,a]);return _.jsxs("div",{id:r,className:t,style:{height:n||"300px"},children:[a&&_.jsx(Om,{selector:"body",children:_.jsx(a,{...u})}),_.jsx(vX,{data:f,options:g,plugins:[JX]})]})},eZ="_left_fwo8v_475",tZ="_right_fwo8v_478",nZ="_indicator_fwo8v_489",rZ="_active_fwo8v_494",Ji={"container-step-indicator":"_container-step-indicator_fwo8v_301","text-step-indicator":"_text-step-indicator_fwo8v_301",left:eZ,right:tZ,"step-indicator":"_step-indicator_fwo8v_485",indicator:nZ,active:rZ};function iZ(e,t){if(e<=0)return"0px";if(e===1)return"100%";const n=e-1;return`calc((100% - (${t} * ${n})) / ${e})`}const aZ=({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:d=""})=>_.jsxs("div",{id:o,className:`${Ji["container-step-indicator"]}
190
190
  ${s==="left"?Ji.left:Ji.right} ${r||""}`,children:[s==="left"&&_.jsxs("p",{className:`${Ji["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]}),_.jsx("div",{className:`${Ji["step-indicator"]} ${d||""}
191
191
  ${u?"1ru-w-full":""} ${c}`,style:{gap:c},children:Array.from({length:t}).map((h,f)=>_.jsx("div",{className:`${Ji.indicator} ${a||""}
192
- ${f<=e?`${Ji.active} ${n}`:""}`,style:{width:u?iZ(t,c):l}},f))}),s==="right"&&_.jsxs("p",{className:`${Ji["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]})]}),oZ="1.0.13",Px={version:oZ},sZ=({label:e})=>({tinymceScriptSrc:`https://unpkg.com/1mpacto-react-ui@${Px.version}/dist/tinymce/js/tinymce/tinymce.min.js`,init:{plugins:"lists",menubar:!1,statusbar:!1,content_css:`https://unpkg.com/1mpacto-react-ui@${Px.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:`
192
+ ${f<=e?`${Ji.active} ${n}`:""}`,style:{width:u?iZ(t,c):l}},f))}),s==="right"&&_.jsxs("p",{className:`${Ji["text-step-indicator"]} ${i||""}`,children:[e+1,"/",t]})]}),oZ="1.0.15",Px={version:oZ},sZ=({label:e})=>({tinymceScriptSrc:`https://unpkg.com/1mpacto-react-ui@${Px.version}/dist/tinymce/js/tinymce/tinymce.min.js`,init:{plugins:"lists",menubar:!1,statusbar:!1,content_css:`https://unpkg.com/1mpacto-react-ui@${Px.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:`
193
193
  Lato=Lato;
194
194
  Inter=Inter;
195
195
  Andale Mono=Andale Mono,times;